隐患风险功能流程修改、增加密码测试验证
正在显示
8 个修改的文件
包含
103 行增加
和
29 行删除
... | @@ -89,7 +89,7 @@ | ... | @@ -89,7 +89,7 @@ |
89 | <artifactId>artemis-http-client</artifactId> | 89 | <artifactId>artemis-http-client</artifactId> |
90 | <version>1.1.3</version> | 90 | <version>1.1.3</version> |
91 | </dependency> | 91 | </dependency> |
92 | 92 | ||
93 | <dependency> | 93 | <dependency> |
94 | <groupId>org.bytedeco</groupId> | 94 | <groupId>org.bytedeco</groupId> |
95 | <artifactId>javacv</artifactId> | 95 | <artifactId>javacv</artifactId> | ... | ... |
... | @@ -131,11 +131,24 @@ public class AjhRectificationInfoController { | ... | @@ -131,11 +131,24 @@ public class AjhRectificationInfoController { |
131 | @ApiOperation(value="隐患检查-整改", notes="隐患检查-整改") | 131 | @ApiOperation(value="隐患检查-整改", notes="隐患检查-整改") |
132 | @PostMapping(value = "/mend") | 132 | @PostMapping(value = "/mend") |
133 | public Result mend(@Valid @RequestBody AjhRectificationInfoMendDto dto) { | 133 | public Result mend(@Valid @RequestBody AjhRectificationInfoMendDto dto) { |
134 | |||
135 | Result<EmergencyRiskEvent> result = new Result<EmergencyRiskEvent>(); | 134 | Result<EmergencyRiskEvent> result = new Result<EmergencyRiskEvent>(); |
136 | ajhRectificationInfoService.mend(dto); | 135 | ajhRectificationInfoService.mend(dto); |
137 | result.success("处理成功!"); | 136 | result.success("处理成功!"); |
137 | return result; | ||
138 | } | ||
138 | 139 | ||
140 | /** | ||
141 | * 整改完成 | ||
142 | * @return | ||
143 | */ | ||
144 | @AutoLog(value = "隐患检查-整改完成") | ||
145 | @ApiOperation(value="隐患检查-整改完成", notes="隐患检查-整改完成") | ||
146 | @PostMapping(value = "/complete-task-pass") | ||
147 | public Result pass(@Valid @RequestBody AjhRectificationInfo dto) { | ||
148 | Result<AjhRectificationInfo> result = new Result<AjhRectificationInfo>(); | ||
149 | boolean ok = ajhRectificationInfoService.pass(dto); | ||
150 | result.setSuccess(ok); | ||
151 | result.success("处理完成!"); | ||
139 | return result; | 152 | return result; |
140 | } | 153 | } |
141 | 154 | ... | ... |
... | @@ -11,7 +11,7 @@ | ... | @@ -11,7 +11,7 @@ |
11 | p.waste_name, | 11 | p.waste_name, |
12 | LEFT ( p.pro_out_date, 7 ) AS report_month, | 12 | LEFT ( p.pro_out_date, 7 ) AS report_month, |
13 | ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS month_produce, | 13 | ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS month_produce, |
14 | ROUND(ifnull(SUM( p.pro_out_count ),0) , 2) AS month_out, | 14 | ROUND(ifnull(SUM( k.keep_out_count ),0) , 2) AS month_out, |
15 | ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS month_keep, | 15 | ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS month_keep, |
16 | d.depart_name AS depart_name, | 16 | d.depart_name AS depart_name, |
17 | d.id as depart_id | 17 | d.id as depart_id |
... | @@ -44,8 +44,6 @@ | ... | @@ -44,8 +44,6 @@ |
44 | p.waste_name | 44 | p.waste_name |
45 | </select> | 45 | </select> |
46 | 46 | ||
47 | |||
48 | |||
49 | <select id="queryPageListByYear" resultType="com.skua.modules.ajh.entity.AjhWasteYearReport"> | 47 | <select id="queryPageListByYear" resultType="com.skua.modules.ajh.entity.AjhWasteYearReport"> |
50 | SELECT | 48 | SELECT |
51 | p.id, | 49 | p.id, |
... | @@ -53,7 +51,7 @@ | ... | @@ -53,7 +51,7 @@ |
53 | p.waste_name, | 51 | p.waste_name, |
54 | LEFT ( p.pro_out_date, 4 ) AS report_year, | 52 | LEFT ( p.pro_out_date, 4 ) AS report_year, |
55 | ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS year_produce, | 53 | ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS year_produce, |
56 | ROUND(ifnull(SUM( p.pro_out_count ),0) , 2) AS year_out, | 54 | ROUND(ifnull(SUM( k.keep_out_count ),0) , 2) AS year_out, |
57 | ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS year_keep, | 55 | ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS year_keep, |
58 | d.depart_name AS depart_name, | 56 | d.depart_name AS depart_name, |
59 | d.id as depart_id | 57 | d.id as depart_id | ... | ... |
... | @@ -107,4 +107,6 @@ public interface IAjhRectificationInfoService extends IService<AjhRectificationI | ... | @@ -107,4 +107,6 @@ public interface IAjhRectificationInfoService extends IService<AjhRectificationI |
107 | * @Description: TODO(这里描述这个方法的需求变更情况) | 107 | * @Description: TODO(这里描述这个方法的需求变更情况) |
108 | */ | 108 | */ |
109 | Map<String,Object> getStructNoHandleDetail(String startTime,String endTime); | 109 | Map<String,Object> getStructNoHandleDetail(String startTime,String endTime); |
110 | |||
111 | boolean pass(AjhRectificationInfo dto); | ||
110 | } | 112 | } | ... | ... |
... | @@ -505,6 +505,15 @@ public class AjhRectificationInfoServiceImpl extends ServiceImpl<AjhRectificatio | ... | @@ -505,6 +505,15 @@ public class AjhRectificationInfoServiceImpl extends ServiceImpl<AjhRectificatio |
505 | return map; | 505 | return map; |
506 | } | 506 | } |
507 | 507 | ||
508 | @Transactional(rollbackFor = Exception.class) | ||
509 | @Override | ||
510 | public boolean pass(AjhRectificationInfo updateParam) { | ||
511 | this.updateById(updateParam); | ||
512 | //调用同意接口 | ||
513 | boolean flag = flowBusinessService.completeTask(ProcessConstant.PASS_KEY, updateParam.getFlow()); | ||
514 | return flag; | ||
515 | } | ||
516 | |||
508 | @Override | 517 | @Override |
509 | public List<FlowProcessFormFieldInfoVO> buildCustomData(String s, List<FlowProcessFormFieldInfoVO> list) { | 518 | public List<FlowProcessFormFieldInfoVO> buildCustomData(String s, List<FlowProcessFormFieldInfoVO> list) { |
510 | for (FlowProcessFormFieldInfoVO entity : list) { | 519 | for (FlowProcessFormFieldInfoVO entity : list) { | ... | ... |
... | @@ -88,10 +88,10 @@ public class WorkAnalysisController { | ... | @@ -88,10 +88,10 @@ public class WorkAnalysisController { |
88 | 88 | ||
89 | @ApiOperation(value = "安全管理进度-数据列表", notes = "安全管理进度-数据列表 timeType = 1 表示月份,timeType=2 表示年") | 89 | @ApiOperation(value = "安全管理进度-数据列表", notes = "安全管理进度-数据列表 timeType = 1 表示月份,timeType=2 表示年") |
90 | @GetMapping("/analysisBySafeProgress") | 90 | @GetMapping("/analysisBySafeProgress") |
91 | public List<SafeProgressVO> analysisBySafeProgress(@RequestParam(defaultValue = "1") Integer timeType, String startTime, String endTime) { | 91 | public Result<List<SafeProgressVO>> analysisBySafeProgress(@RequestParam(defaultValue = "1") Integer timeType, String startTime, String endTime) { |
92 | Result<List<SafeProgressVO>> result = new Result<>(); | ||
92 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); | 93 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); |
93 | String departIds = null; | 94 | String departIds = null; |
94 | |||
95 | String sql = "select d.id 'depart_id' , d.depart_name , ifnull(aaa.count,0) 'meet_num', ifnull(bbb.count,0) 'meet_total', ifnull(ccc.count,0) 'exam_num', ifnull(ddd.count,0) 'exam_total',ifnull(eee.count, 0) 'frequency_num' , ifnull(fff.count , 0) 'frequency_total'"; | 95 | String sql = "select d.id 'depart_id' , d.depart_name , ifnull(aaa.count,0) 'meet_num', ifnull(bbb.count,0) 'meet_total', ifnull(ccc.count,0) 'exam_num', ifnull(ddd.count,0) 'exam_total',ifnull(eee.count, 0) 'frequency_num' , ifnull(fff.count , 0) 'frequency_total'"; |
96 | sql += " from sys_depart d "; | 96 | sql += " from sys_depart d "; |
97 | sql += getSafeProgressSql(departIds, startTime,endTime); | 97 | sql += getSafeProgressSql(departIds, startTime,endTime); |
... | @@ -102,12 +102,14 @@ public class WorkAnalysisController { | ... | @@ -102,12 +102,14 @@ public class WorkAnalysisController { |
102 | sql += " order by (ifnull(aaa.count,0) + ifnull(bbb.count,0) + ifnull(ccc.count,0) + ifnull(ddd.count,0) + ifnull(fff.count,0) ) asc "; | 102 | sql += " order by (ifnull(aaa.count,0) + ifnull(bbb.count,0) + ifnull(ccc.count,0) + ifnull(ddd.count,0) + ifnull(fff.count,0) ) asc "; |
103 | System.out.println("sql = "+sql); | 103 | System.out.println("sql = "+sql); |
104 | List<SafeProgressVO> dataList = jdbcTemplate.query(sql,new BeanPropertyRowMapper<SafeProgressVO>(SafeProgressVO.class)); | 104 | List<SafeProgressVO> dataList = jdbcTemplate.query(sql,new BeanPropertyRowMapper<SafeProgressVO>(SafeProgressVO.class)); |
105 | 105 | result.setResult(dataList); | |
106 | return dataList; | 106 | result.setSuccess(true); |
107 | return result; | ||
107 | } | 108 | } |
108 | @ApiOperation(value = "安全管理进度统计-数量统计", notes = "安全管理进度-数量统计 timeType = 1 表示月份,timeType=2 表示年") | 109 | @ApiOperation(value = "安全管理进度统计-数量统计", notes = "安全管理进度-数量统计 timeType = 1 表示月份,timeType=2 表示年") |
109 | @GetMapping("/analysisTotalBySafeProgress") | 110 | @GetMapping("/analysisTotalBySafeProgress") |
110 | public SafeProgressVO analysisTotalBySafeProgress(@RequestParam(defaultValue = "1") Integer timeType, String startTime, String endTime) { | 111 | public Result<SafeProgressVO> analysisTotalBySafeProgress(@RequestParam(defaultValue = "1") Integer timeType, String startTime, String endTime) { |
112 | Result<SafeProgressVO> result = new Result<>(); | ||
111 | String departIds = null;//DAY(LAST_DAY('"+startTime+"')) | 113 | String departIds = null;//DAY(LAST_DAY('"+startTime+"')) |
112 | String sql = "select count(d.id) 'departNum', ifnull(sum(aaa.count),0) 'meet_num' ,ifnull(sum(bbb.count),0) 'meet_total' ,ifnull(sum(ccc.count),0) 'exam_num' ,ifnull(sum(ddd.count),0) 'exam_total',ifnull(sum(eee.count),0) 'frequency_num' ,ifnull(sum(fff.count),0) 'frequency_total' "; | 114 | String sql = "select count(d.id) 'departNum', ifnull(sum(aaa.count),0) 'meet_num' ,ifnull(sum(bbb.count),0) 'meet_total' ,ifnull(sum(ccc.count),0) 'exam_num' ,ifnull(sum(ddd.count),0) 'exam_total',ifnull(sum(eee.count),0) 'frequency_num' ,ifnull(sum(fff.count),0) 'frequency_total' "; |
113 | sql += " from sys_depart d "; | 115 | sql += " from sys_depart d "; |
... | @@ -120,9 +122,10 @@ public class WorkAnalysisController { | ... | @@ -120,9 +122,10 @@ public class WorkAnalysisController { |
120 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); | 122 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); |
121 | List<SafeProgressVO> dataList = jdbcTemplate.query(sql,new BeanPropertyRowMapper<SafeProgressVO>(SafeProgressVO.class)); | 123 | List<SafeProgressVO> dataList = jdbcTemplate.query(sql,new BeanPropertyRowMapper<SafeProgressVO>(SafeProgressVO.class)); |
122 | if(dataList != null && !dataList.isEmpty()){ | 124 | if(dataList != null && !dataList.isEmpty()){ |
123 | return dataList.get(0); | 125 | result.setResult(dataList.get(0)); |
126 | result.setSuccess(true); | ||
124 | } | 127 | } |
125 | return null; | 128 | return result; |
126 | } | 129 | } |
127 | private String getSafeProgressSql( String departIds,String startTime, String endTime){ | 130 | private String getSafeProgressSql( String departIds,String startTime, String endTime){ |
128 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); | 131 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); | ... | ... |
... | @@ -11,6 +11,8 @@ import java.util.Objects; | ... | @@ -11,6 +11,8 @@ import java.util.Objects; |
11 | import javax.servlet.http.HttpServletRequest; | 11 | import javax.servlet.http.HttpServletRequest; |
12 | import javax.servlet.http.HttpServletResponse; | 12 | import javax.servlet.http.HttpServletResponse; |
13 | 13 | ||
14 | import cn.hutool.core.util.ObjectUtil; | ||
15 | import com.skua.core.context.SpringContextUtils; | ||
14 | import com.skua.core.util.encryption.MD5Util; | 16 | import com.skua.core.util.encryption.MD5Util; |
15 | import com.skua.modules.common.vo.AliCode; | 17 | import com.skua.modules.common.vo.AliCode; |
16 | import com.skua.modules.system.vo.SsoLogin; | 18 | import com.skua.modules.system.vo.SsoLogin; |
... | @@ -82,43 +84,87 @@ public class LoginController { | ... | @@ -82,43 +84,87 @@ public class LoginController { |
82 | SysUserDepartServiceImpl sysUserDepartService; | 84 | SysUserDepartServiceImpl sysUserDepartService; |
83 | @Autowired | 85 | @Autowired |
84 | private ISysBaseConfigService sysBaseConfigService; | 86 | private ISysBaseConfigService sysBaseConfigService; |
87 | private final String ERRORLOGIN = "errorLogin"; | ||
88 | private static Integer ERROR_TOTAL = 5;//允许错误次数 | ||
85 | 89 | ||
86 | @RequestMapping(value = "/login", method = RequestMethod.POST) | 90 | @RequestMapping(value = "/login", method = RequestMethod.POST) |
87 | //@ApiOperation("登录接口") | 91 | public Result<JSONObject> login(@RequestBody SysLoginModel sysLoginModel) { |
88 | public Result<JSONObject> login(@RequestBody SysLoginModel sysLoginModel) throws Exception { | ||
89 | Result<JSONObject> result = new Result<JSONObject>(); | 92 | Result<JSONObject> result = new Result<JSONObject>(); |
90 | String username = sysLoginModel.getUsername(); | 93 | String username = sysLoginModel.getUsername(); |
91 | String password = sysLoginModel.getPassword(); | 94 | String password = sysLoginModel.getPassword(); |
92 | //update-begin--Author:scott Date:20190805 for:暂时注释掉密码加密逻辑,有点问题 | ||
93 | //前端密码加密,后端进行密码解密 | ||
94 | //password = AesEncryptUtil.desEncrypt(sysLoginModel.getPassword().replaceAll("%2B", "\\+")).trim();//密码解密 | ||
95 | //update-begin--Author:scott Date:20190805 for:暂时注释掉密码加密逻辑,有点问题 | ||
96 | |||
97 | //1. 校验用户是否有效 | 95 | //1. 校验用户是否有效 |
98 | SysUser sysUser = sysUserService.getUserByName(username); | 96 | SysUser sysUser = sysUserService.getUserByName(username); |
99 | result = sysUserService.checkUserIsEffective(sysUser); | 97 | result = sysUserService.checkUserIsEffective(sysUser); |
100 | if (!result.isSuccess()) { | 98 | if (!result.isSuccess()) { |
101 | return result; | 99 | return result; |
102 | } | 100 | } |
103 | |||
104 | //2. 校验用户名或密码是否正确 | 101 | //2. 校验用户名或密码是否正确 |
105 | String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt()); | 102 | String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt()); |
106 | String syspassword = sysUser.getPassword(); | 103 | String syspassword = sysUser.getPassword(); |
107 | if (!syspassword.equals(userpassword)) { | 104 | //是否启用密码错误次数验证 |
108 | result.error500("用户名或密码错误"); | 105 | boolean errorNumCheck = false; |
109 | return result; | 106 | SysBaseConfig sysBaseConfig = sysBaseConfigService.getOne(new QueryWrapper<>()); |
107 | if(sysBaseConfig != null){ | ||
108 | ERROR_TOTAL = sysBaseConfig.getPasswordErrorNum(); | ||
109 | if("1".equals(sysBaseConfig.getErrorNumVerification())){ | ||
110 | errorNumCheck = true; | ||
111 | } | ||
112 | } | ||
113 | if(errorNumCheck){ | ||
114 | if (!syspassword.equals(userpassword)) { | ||
115 | //登录失败处理 | ||
116 | Integer errorNum = failureHandling(sysUser); | ||
117 | int errNum2 = ERROR_TOTAL - errorNum; | ||
118 | result.error500("用户名或密码错误,已连续失败"+errorNum+"次,剩余"+errNum2+"次将被冻结!"); | ||
119 | return result; | ||
120 | }else{ | ||
121 | resetErrorNum(username); | ||
122 | } | ||
123 | }else{ | ||
124 | if (!syspassword.equals(userpassword)) { | ||
125 | result.error500("用户名或密码错误!"); | ||
126 | return result; | ||
127 | } | ||
110 | } | 128 | } |
111 | |||
112 | //用户登录信息 | 129 | //用户登录信息 |
113 | userInfo(sysUser, result); | 130 | userInfo(sysUser, result); |
114 | sysBaseAPI.addLog("用户名: " + username + ",登录成功!", CommonConstant.LOG_TYPE_1, null); | 131 | sysBaseAPI.addLog("用户名: " + username + ",登录成功!", CommonConstant.LOG_TYPE_1, null); |
115 | |||
116 | return result; | 132 | return result; |
117 | } | 133 | } |
118 | 134 | ||
135 | /** | ||
136 | * 密码错误数量统计 | ||
137 | * @param user | ||
138 | * @return | ||
139 | */ | ||
140 | private Integer failureHandling(SysUser user){ | ||
141 | String username = user.getUsername(); | ||
142 | Integer errNum = (Integer) redisUtil.get(ERRORLOGIN + username); | ||
143 | if (ObjectUtil.isEmpty(errNum)) { | ||
144 | redisUtil.set(ERRORLOGIN + username,1,300); | ||
145 | }else{ | ||
146 | errNum++; | ||
147 | if (errNum >= ERROR_TOTAL){ | ||
148 | redisUtil.del(ERRORLOGIN + username); | ||
149 | user.setStatus(2); | ||
150 | sysUserService.updateById(user); | ||
151 | }else { | ||
152 | redisUtil.set(ERRORLOGIN + username, errNum); | ||
153 | } | ||
154 | } | ||
155 | return errNum; | ||
156 | } | ||
157 | |||
158 | /** | ||
159 | * 重置用户连续登录失败次数 | ||
160 | */ | ||
161 | private void resetErrorNum(String username){ | ||
162 | redisUtil.set(ERRORLOGIN + username,0); | ||
163 | } | ||
164 | |||
119 | @RequestMapping(value = "/appLogin", method = RequestMethod.POST) | 165 | @RequestMapping(value = "/appLogin", method = RequestMethod.POST) |
120 | //@ApiOperation("APP登录接口") | 166 | //@ApiOperation("APP登录接口") |
121 | public Result<SysAppUserInfo> appLogin(@RequestBody SysLoginModel sysLoginModel) throws Exception { | 167 | public Result<SysAppUserInfo> appLogin(@RequestBody SysLoginModel sysLoginModel) { |
122 | Result<SysAppUserInfo> result = new Result<SysAppUserInfo>(); | 168 | Result<SysAppUserInfo> result = new Result<SysAppUserInfo>(); |
123 | String username = sysLoginModel.getUsername(); | 169 | String username = sysLoginModel.getUsername(); |
124 | String password = sysLoginModel.getPassword(); | 170 | String password = sysLoginModel.getPassword(); | ... | ... |
... | @@ -24,7 +24,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; | ... | @@ -24,7 +24,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; |
24 | @Accessors(chain = true) | 24 | @Accessors(chain = true) |
25 | @ApiModel(value="sys_base_config对象", description="基础信息配置") | 25 | @ApiModel(value="sys_base_config对象", description="基础信息配置") |
26 | public class SysBaseConfig { | 26 | public class SysBaseConfig { |
27 | 27 | ||
28 | /**主键*/ | 28 | /**主键*/ |
29 | @TableId(type = IdType.ID_WORKER_STR) | 29 | @TableId(type = IdType.ID_WORKER_STR) |
30 | @ApiModelProperty(value = "主键") | 30 | @ApiModelProperty(value = "主键") |
... | @@ -71,7 +71,10 @@ public class SysBaseConfig { | ... | @@ -71,7 +71,10 @@ public class SysBaseConfig { |
71 | @Excel(name = "版权信息", width = 15) | 71 | @Excel(name = "版权信息", width = 15) |
72 | @ApiModelProperty(value = "版权信息") | 72 | @ApiModelProperty(value = "版权信息") |
73 | private java.lang.String copyrightInformation; | 73 | private java.lang.String copyrightInformation; |
74 | |||
75 | @ApiModelProperty(value = "数字孪生像素流地址") | 74 | @ApiModelProperty(value = "数字孪生像素流地址") |
76 | private java.lang.String pixelStreamPath; | 75 | private java.lang.String pixelStreamPath; |
76 | @ApiModelProperty(value = "密码错误次数限制") | ||
77 | private java.lang.Integer passwordErrorNum; | ||
78 | @ApiModelProperty(value = "密码错误次数校验") | ||
79 | private java.lang.String errorNumVerification; | ||
77 | } | 80 | } | ... | ... |
-
请 注册 或 登录 后发表评论