20a50c69 张雷

隐患排查功能流程修改

1 个父辈 0ee986ad
......@@ -150,9 +150,11 @@ public class FlowBussinessDescManageServiceImpl implements IFlowBusinessDescServ
List<String> avgIndexCodeArray = Arrays.asList(ids.split(","));
String inSqlPart = avgIndexCodeArray.stream().map(s -> "'" + s.trim() + "'").collect(Collectors.joining(","));
String sql = "SELECT a.id," +
" CONCAT(a.create_by,'-考核评价审批') as title " +
" CONCAT( d.depart_name, '-', a.assessment_date, '-考核评价审批' ) AS title " +
"FROM " +
" data_assessment_socre_master a " +
" LEFT JOIN sys_depart d ON a.assessment_depart = d.id " +
" LEFT JOIN sys_user u ON a.create_by = u.username " +
"WHERE " +
" a.id in (" + inSqlPart + ")";
List<Map<String, Object>> dataList = masterDB.queryForList(sql);
......
......@@ -66,7 +66,7 @@ public class EnvironmentTargetServiceImpl extends ServiceImpl<EnvironmentTargetM
environmentTarget.setSuddenlyNum(oldEnvironmentTarget.getSuddenlyNum());
environmentTarget.setNewCaseNum(oldEnvironmentTarget.getNewCaseNum());
environmentTarget.setExamScore(oldEnvironmentTarget.getExamScore());
environmentTargetMapper.updateById(oldEnvironmentTarget);
environmentTargetMapper.updateById(environmentTarget);
}else{
environmentTargetMapper.insert(environmentTarget);
}
......@@ -74,8 +74,27 @@ public class EnvironmentTargetServiceImpl extends ServiceImpl<EnvironmentTargetM
//计算评分等级
private String countLevel(String leaderScore) {
String level = "A";
return level;
String level = "A";
boolean isNumeric = false;
try {
Integer.parseInt(leaderScore);
isNumeric = true;
} catch (NumberFormatException e) {
isNumeric = false;
}
if (isNumeric) {
int number = Integer.parseInt(leaderScore);
if (number > 80) {
level = "A"; // 数字大于等于80,返回 A 级
} else if (number > 60) {
level = "B"; // 数字大于等于60并小于80,返回 B 级
} else if (number > 40) {
level = "C"; // 数字大于等于40并小于60,返回 C 级
} else {
level = "D"; // 数字小于40,返回 D 级
}
}
return level;
}
}
......
......@@ -89,19 +89,19 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://113.249.91.27:3306/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false
url: jdbc:mysql://20.0.99.3:3306/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false
username: root
password: jkauto@123
driver-class-name: com.mysql.jdbc.Driver
# 恩菲数据同步
nf-db:
url: jdbc:mysql://113.249.91.27:3306/zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false
url: jdbc:mysql://20.0.99.3:3306/zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false
username: root
password: jkauto@123
driver-class-name: com.mysql.jdbc.Driver
# 多数据源配置
pg-db:
url: jdbc:postgresql://113.249.91.27:10086/postgres?useUnicode=true&characterEncoding=UTF8
url: jdbc:postgresql://20.0.99.4:10086/postgres?useUnicode=true&characterEncoding=UTF8
username: postgres
password: jkauto@123
driver-class-name: org.postgresql.Driver
......
......@@ -3,6 +3,7 @@ package com.skua.modules.system.controller;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
......@@ -68,6 +69,8 @@ public class SysFactoryUserInfoController {
private ISysUserService sysUserService;
@Autowired
private ISequenceService sequenceService;
// 定义日期格式
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
/**
* 分页列表查询
* @param sysFactoryUserInfo
......@@ -152,7 +155,13 @@ public class SysFactoryUserInfoController {
sysFactoryUserInfo.setUserName(user.getRealname());
sysFactoryUserInfo.setEmail(user.getEmail());
sysFactoryUserInfo.setTelephone(user.getPhone());
sysFactoryUserInfo.setSex(user.getSalt());
if(ConvertUtils.isNotEmpty(user.getSex())){
sysFactoryUserInfo.setSex(user.getSex().toString());
}
if(ConvertUtils.isNotEmpty(user.getBirthday())){
String birthday = sdf.format(user.getBirthday());
sysFactoryUserInfo.setUserAge(birthday);
}
}
}
sysFactoryUserInfo.setId(String.valueOf(sequenceService.nextId()));
......@@ -179,6 +188,21 @@ public class SysFactoryUserInfoController {
if(sysFactoryUserInfoEntity==null) {
result.error500("未找到对应实体");
}else {
if(StringUtils.isNotEmpty(sysFactoryUserInfo.getUserId())){
SysUser user = sysUserService.getById(sysFactoryUserInfo.getUserId());
if(ConvertUtils.isNotEmpty(user)){
sysFactoryUserInfo.setUserName(user.getRealname());
sysFactoryUserInfo.setEmail(user.getEmail());
sysFactoryUserInfo.setTelephone(user.getPhone());
if(ConvertUtils.isNotEmpty(user.getSex())){
sysFactoryUserInfo.setSex(user.getSex().toString());
}
if(ConvertUtils.isNotEmpty(user.getBirthday())){
String birthday = sdf.format(user.getBirthday());
sysFactoryUserInfo.setUserAge(birthday);
}
}
}
boolean ok = sysFactoryUserInfoService.updateById(sysFactoryUserInfo);
if(ok) {
result.success("修改成功!");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!