commit: 添加罗库版本
This commit is contained in:
parent
9578e2ee1f
commit
868011b38e
|
@ -73,9 +73,9 @@ public class UserExcelVO implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 部门名称
|
* 部门名称
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "部门名称不能为空")
|
//@NotBlank(message = "部门名称不能为空")
|
||||||
@ExcelProperty("部门名称")
|
//@ExcelProperty("部门名称")
|
||||||
private String deptName;
|
//private String deptName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色列表
|
* 角色列表
|
||||||
|
@ -84,12 +84,12 @@ public class UserExcelVO implements Serializable {
|
||||||
@ExcelProperty("角色")
|
@ExcelProperty("角色")
|
||||||
private String roleNameList;
|
private String roleNameList;
|
||||||
|
|
||||||
/**
|
///**
|
||||||
* 角色列表
|
// * 角色列表
|
||||||
*/
|
// */
|
||||||
@NotBlank(message = "岗位不能为空")
|
//@NotBlank(message = "岗位不能为空")
|
||||||
@ExcelProperty("岗位名称")
|
//@ExcelProperty("岗位名称")
|
||||||
private String postNameList;
|
//private String postNameList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 锁定标记
|
* 锁定标记
|
||||||
|
|
|
@ -357,11 +357,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
.map(SysRole::getRoleName)
|
.map(SysRole::getRoleName)
|
||||||
.collect(Collectors.joining(StrUtil.COMMA));
|
.collect(Collectors.joining(StrUtil.COMMA));
|
||||||
excelVO.setRoleNameList(roleNameList);
|
excelVO.setRoleNameList(roleNameList);
|
||||||
String postNameList = userVO.getPostList()
|
//String postNameList = userVO.getPostList()
|
||||||
.stream()
|
// .stream()
|
||||||
.map(SysPost::getPostName)
|
// .map(SysPost::getPostName)
|
||||||
.collect(Collectors.joining(StrUtil.COMMA));
|
// .collect(Collectors.joining(StrUtil.COMMA));
|
||||||
excelVO.setPostNameList(postNameList);
|
//excelVO.setPostNameList(postNameList);
|
||||||
return excelVO;
|
return excelVO;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
return userExcelVOList;
|
return userExcelVOList;
|
||||||
|
@ -378,9 +378,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
public R importUser(List<UserExcelVO> excelVOList, BindingResult bindingResult) {
|
public R importUser(List<UserExcelVO> excelVOList, BindingResult bindingResult) {
|
||||||
// 通用校验获取失败的数据
|
// 通用校验获取失败的数据
|
||||||
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
||||||
List<SysDept> deptList = sysDeptService.list();
|
//List<SysDept> deptList = sysDeptService.list();
|
||||||
List<SysRole> roleList = sysRoleService.list();
|
List<SysRole> roleList = sysRoleService.list();
|
||||||
List<SysPost> postList = sysPostService.list();
|
//List<SysPost> postList = sysPostService.list();
|
||||||
|
|
||||||
// 执行数据插入操作 组装 UserDto
|
// 执行数据插入操作 组装 UserDto
|
||||||
for (UserExcelVO excel : excelVOList) {
|
for (UserExcelVO excel : excelVOList) {
|
||||||
|
@ -397,12 +397,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断输入的部门名称列表是否合法
|
// 判断输入的部门名称列表是否合法
|
||||||
Optional<SysDept> deptOptional = deptList.stream()
|
//Optional<SysDept> deptOptional = deptList.stream()
|
||||||
.filter(dept -> excel.getDeptName().equals(dept.getName()))
|
// .filter(dept -> excel.getDeptName().equals(dept.getName()))
|
||||||
.findFirst();
|
// .findFirst();
|
||||||
if (!deptOptional.isPresent()) {
|
//if (!deptOptional.isPresent()) {
|
||||||
errorMsg.add(MsgUtils.getMessage(ErrorCodes.SYS_DEPT_DEPTNAME_INEXISTENCE, excel.getDeptName()));
|
// errorMsg.add(MsgUtils.getMessage(ErrorCodes.SYS_DEPT_DEPTNAME_INEXISTENCE, excel.getDeptName()));
|
||||||
}
|
//}
|
||||||
|
|
||||||
// 判断输入的角色名称列表是否合法
|
// 判断输入的角色名称列表是否合法
|
||||||
List<String> roleNameList = StrUtil.split(excel.getRoleNameList(), StrUtil.COMMA);
|
List<String> roleNameList = StrUtil.split(excel.getRoleNameList(), StrUtil.COMMA);
|
||||||
|
@ -426,7 +426,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
|
|
||||||
// 数据合法情况
|
// 数据合法情况
|
||||||
if (CollUtil.isEmpty(errorMsg)) {
|
if (CollUtil.isEmpty(errorMsg)) {
|
||||||
insertExcelUser(excel, deptOptional, roleCollList, null);
|
insertExcelUser(excel, roleCollList);
|
||||||
} else {
|
} else {
|
||||||
// 数据不合法情况
|
// 数据不合法情况
|
||||||
errorMessageList.add(new ErrorMessage(excel.getLineNum(), errorMsg));
|
errorMessageList.add(new ErrorMessage(excel.getLineNum(), errorMsg));
|
||||||
|
@ -443,8 +443,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
/**
|
/**
|
||||||
* 插入excel User
|
* 插入excel User
|
||||||
*/
|
*/
|
||||||
private void insertExcelUser(UserExcelVO excel, Optional<SysDept> deptOptional, List<SysRole> roleCollList,
|
private void insertExcelUser(UserExcelVO excel, List<SysRole> roleCollList) {
|
||||||
List<SysPost> postCollList) {
|
|
||||||
UserDTO userDTO = new UserDTO();
|
UserDTO userDTO = new UserDTO();
|
||||||
userDTO.setUsername(excel.getUsername());
|
userDTO.setUsername(excel.getUsername());
|
||||||
userDTO.setPhone(excel.getPhone());
|
userDTO.setPhone(excel.getPhone());
|
||||||
|
@ -454,7 +453,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
// 批量导入初始密码为手机号
|
// 批量导入初始密码为手机号
|
||||||
userDTO.setPassword(userDTO.getPhone());
|
userDTO.setPassword(userDTO.getPhone());
|
||||||
// 根据部门名称查询部门ID
|
// 根据部门名称查询部门ID
|
||||||
userDTO.setDeptId(deptOptional.get().getDeptId());
|
//userDTO.setDeptId(deptOptional.get().getDeptId());
|
||||||
// 插入岗位名称
|
// 插入岗位名称
|
||||||
// List<Long> postIdList = postCollList.stream().map(SysPost::getPostId).collect(Collectors.toList());
|
// List<Long> postIdList = postCollList.stream().map(SysPost::getPostId).collect(Collectors.toList());
|
||||||
// userDTO.setPost(postIdList);
|
// userDTO.setPost(postIdList);
|
||||||
|
|
|
@ -29,11 +29,11 @@ public class ChatHandler implements WebSocketHandler {
|
||||||
@Resource
|
@Resource
|
||||||
private OAuth2AuthorizationService authorizationService;
|
private OAuth2AuthorizationService authorizationService;
|
||||||
|
|
||||||
@Resource
|
//@Resource
|
||||||
private ChatService chatService;
|
//private ChatService chatService;
|
||||||
|
//
|
||||||
@Autowired
|
//@Autowired
|
||||||
private RedisTemplate redisTemplate;
|
//private RedisTemplate redisTemplate;
|
||||||
|
|
||||||
// mysql地址
|
// mysql地址
|
||||||
@Value("${vital-sign.mysql.host}")
|
@Value("${vital-sign.mysql.host}")
|
||||||
|
@ -200,7 +200,6 @@ public class ChatHandler implements WebSocketHandler {
|
||||||
sessionDbMap.remove(session.getId());
|
sessionDbMap.remove(session.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 初始化聊天表格
|
// 初始化聊天表格
|
||||||
private void initTChatTable(String dbName, WebSocketSession session) {
|
private void initTChatTable(String dbName, WebSocketSession session) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -175,6 +175,8 @@ public class VitalSignTimerWS {
|
||||||
|
|
||||||
|
|
||||||
CustomDataSource finalDataSource = dataSource;
|
CustomDataSource finalDataSource = dataSource;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断罗库溴铵还是顺阿曲库胺
|
* 判断罗库溴铵还是顺阿曲库胺
|
||||||
* 0默认值无意义、1有创、2无创
|
* 0默认值无意义、1有创、2无创
|
||||||
|
@ -182,19 +184,31 @@ public class VitalSignTimerWS {
|
||||||
*/
|
*/
|
||||||
// 这里只判断罗库还是顺阿
|
// 这里只判断罗库还是顺阿
|
||||||
Connection connection = finalDataSource.getConnection();
|
Connection connection = finalDataSource.getConnection();
|
||||||
String selectSql = "SELECT sum(罗库) from selecttable;";
|
// 先判断selecttable是否存在, 不存在则跳过
|
||||||
Statement statement = connection.createStatement();
|
// mysql判断表是否存在
|
||||||
statement.execute(selectSql);
|
String selectTableSql = "SELECT * FROM information_schema.tables WHERE table_schema = '" + database + "' AND table_name = 'selecttable'";
|
||||||
ResultSet resultSet = statement.getResultSet();
|
Statement selectTableStatement = connection.createStatement();
|
||||||
double selectValue = 0;
|
ResultSet selectTableResultSet = selectTableStatement.executeQuery(selectTableSql);
|
||||||
while (resultSet.next()) {
|
boolean selectTableExists = false;
|
||||||
System.out.println("selectValue = " + selectValue);
|
while (selectTableResultSet.next()) {
|
||||||
selectValue = resultSet.getDouble("sum(罗库)");
|
selectTableExists = true;
|
||||||
System.out.println("change:selectValue = " + selectValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double finalSelectValue = selectValue;
|
// 如果存在, 根据逻辑判断
|
||||||
System.out.println("finalSelectValue = " + finalSelectValue);
|
double finalSelectValue = 2; // 默认顺阿曲库胺
|
||||||
|
|
||||||
|
if (selectTableExists) {
|
||||||
|
String selectSql = "SELECT sum(罗库) from selecttable;";
|
||||||
|
Statement statement = connection.createStatement();
|
||||||
|
statement.execute(selectSql);
|
||||||
|
ResultSet resultSet = statement.getResultSet();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
finalSelectValue = resultSet.getDouble("sum(罗库)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double finalSelectValue1 = finalSelectValue;
|
||||||
TimerTask timerTask = new TimerTask() {
|
TimerTask timerTask = new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -203,7 +217,7 @@ public class VitalSignTimerWS {
|
||||||
// List<Map> vitalSignsList = vitalSignsService.getVitalSignsList(connection);
|
// List<Map> vitalSignsList = vitalSignsService.getVitalSignsList(connection);
|
||||||
Map vitalSignsList = vitalSignsService.getVitalSignsList(connection, username, database);
|
Map vitalSignsList = vitalSignsService.getVitalSignsList(connection, username, database);
|
||||||
jsonObject.put("vitalSignsList", vitalSignsList);
|
jsonObject.put("vitalSignsList", vitalSignsList);
|
||||||
List<Map> aiMedicineList = aiMedicineService.getAIMedicine(connection,finalSelectValue);
|
List<Map> aiMedicineList = aiMedicineService.getAIMedicine(connection, finalSelectValue1);
|
||||||
jsonObject.put("aiMedicineList", aiMedicineList);
|
jsonObject.put("aiMedicineList", aiMedicineList);
|
||||||
// List<Map> docMedicineList = doctorMedicineService.getDocMedicine(connection);
|
// List<Map> docMedicineList = doctorMedicineService.getDocMedicine(connection);
|
||||||
// jsonObject.put("docMedicineList", docMedicineList);
|
// jsonObject.put("docMedicineList", docMedicineList);
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
//package com.rax.vital.v2.config;
|
|
||||||
//
|
|
||||||
//import com.rax.vital.v2.interceptor.WSChannelInterceptor;
|
|
||||||
//import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
//import org.springframework.context.annotation.Configuration;
|
|
||||||
//import org.springframework.messaging.simp.config.ChannelRegistration;
|
|
||||||
//import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
|
||||||
//import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
|
||||||
//import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
|
|
||||||
//import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
|
|
||||||
//import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
|
|
||||||
//
|
|
||||||
//@Configuration
|
|
||||||
//@EnableWebSocketMessageBroker
|
|
||||||
//public class WebSocketStompConfig implements WebSocketMessageBrokerConfigurer {
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private WSChannelInterceptor wsChannelInterceptor;
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void registerStompEndpoints(StompEndpointRegistry registry) {
|
|
||||||
// registry.addEndpoint("/rax/chat", "/rax/SurgeryData")
|
|
||||||
// .setAllowedOrigins("*");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void configureMessageBroker(MessageBrokerRegistry registry) {
|
|
||||||
// // 第一个值表示客户端发送心跳消息的间隔时间,第二个值表示服务端发送心跳消息的间隔时间
|
|
||||||
// long [] heartbeat = {60000, 60000};
|
|
||||||
// ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
|
|
||||||
// threadPoolTaskScheduler.initialize();
|
|
||||||
// registry.enableSimpleBroker("/topic").setTaskScheduler(threadPoolTaskScheduler).setHeartbeatValue(heartbeat);
|
|
||||||
// registry.setApplicationDestinationPrefixes("/front");
|
|
||||||
// registry.setUserDestinationPrefix("/topic/user");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * stomp未登录验证
|
|
||||||
// *
|
|
||||||
// * @param registration
|
|
||||||
// */
|
|
||||||
// @Override
|
|
||||||
// public void configureClientInboundChannel(ChannelRegistration registration) {
|
|
||||||
// registration.interceptors(wsChannelInterceptor);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user