禅道BUG修改
正在显示
18 个修改的文件
包含
209 行增加
和
50 行删除
1 | package com.skua.modules.quartz; | ||
2 | import com.skua.core.util.ConvertUtils; | ||
3 | import com.skua.modules.alarmtmp.vo.SystemNoticeVO; | ||
4 | import com.skua.modules.system.entity.SysUser; | ||
5 | import com.skua.modules.system.service.ISysUserService; | ||
6 | import com.skua.modules.util.SystemNoticeUtils; | ||
7 | import lombok.extern.slf4j.Slf4j; | ||
8 | import org.quartz.Job; | ||
9 | import org.quartz.JobExecutionContext; | ||
10 | import org.springframework.beans.factory.annotation.Autowired; | ||
11 | import org.springframework.stereotype.Component; | ||
12 | |||
13 | import java.time.LocalDate; | ||
14 | import java.time.format.DateTimeFormatter; | ||
15 | import java.time.temporal.ChronoUnit; | ||
16 | import java.util.List; | ||
17 | |||
18 | /** | ||
19 | * 发送消息任务 | ||
20 | */ | ||
21 | |||
22 | @Slf4j | ||
23 | @Component | ||
24 | public class UpdatePasswordJob implements Job { | ||
25 | |||
26 | @Autowired | ||
27 | private ISysUserService sysUserService; | ||
28 | @Autowired | ||
29 | private SystemNoticeUtils systemNoticeUtils; | ||
30 | |||
31 | @Override | ||
32 | public void execute(JobExecutionContext jobExecutionContext) { | ||
33 | int beforeNumber = 90;//未修改密码天数 | ||
34 | String editTime = getBeforeDay(beforeNumber); | ||
35 | log.info("开始检查长期未修改密码人员,提醒修改密码"); | ||
36 | List<SysUser> userList = sysUserService.getNoUpdatePasswordUserList(editTime); | ||
37 | if (userList.size() > 0) { | ||
38 | String userIds = ""; | ||
39 | for (SysUser sysUser : userList) { | ||
40 | if(ConvertUtils.isNotEmpty(sysUser.getPhone())){ | ||
41 | userIds = sysUser.getId() + "," + userIds; | ||
42 | } | ||
43 | } | ||
44 | SystemNoticeVO systemNoticeVO = new SystemNoticeVO(); | ||
45 | systemNoticeVO.setUserIds(userIds); | ||
46 | systemNoticeVO.setContent("您的密码已经超过"+beforeNumber+"天未修改密码,建议更换密码!"); | ||
47 | systemNoticeUtils.passwordNoticeMessage(systemNoticeVO); | ||
48 | log.info("长期未修改密码检测完成"); | ||
49 | } else { | ||
50 | log.info("没有需要修改密码的人员"); | ||
51 | } | ||
52 | |||
53 | } | ||
54 | |||
55 | //获取n天前的日期 | ||
56 | private static String getBeforeDay(int beforeNumber) { | ||
57 | LocalDate currentDate = LocalDate.now(); | ||
58 | LocalDate daysAgo = currentDate.minus(beforeNumber, ChronoUnit.DAYS);// 计算n天前的日期 | ||
59 | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); | ||
60 | return daysAgo.format(formatter)+" 00:00:00"; | ||
61 | } | ||
62 | |||
63 | } |
... | @@ -188,4 +188,69 @@ public class SystemNoticeUtils { | ... | @@ -188,4 +188,69 @@ public class SystemNoticeUtils { |
188 | } | 188 | } |
189 | 189 | ||
190 | } | 190 | } |
191 | |||
192 | /** | ||
193 | * 修改密码通知 | ||
194 | * @param systemNoticeVO | ||
195 | */ | ||
196 | public void passwordNoticeMessage(SystemNoticeVO systemNoticeVO) { | ||
197 | String userIds = systemNoticeVO.getUserIds(); | ||
198 | Date refDate = new Date(); | ||
199 | SysAnnouncement sysAnnouncement = new SysAnnouncement(); | ||
200 | sysAnnouncement.setDelFlag(CommonConstant.DEL_FLAG_0.toString()); | ||
201 | sysAnnouncement.setSendStatus(CommonSendStatus.PUBLISHED_STATUS_1);//发布 | ||
202 | sysAnnouncement.setMsgType("USER"); | ||
203 | sysAnnouncement.setPriority("M"); | ||
204 | sysAnnouncement.setId(UUIDGenerator.creatUUID()); | ||
205 | sysAnnouncement.setSendTime(refDate); | ||
206 | sysAnnouncement.setMsgCategory("2"); | ||
207 | //系统 | ||
208 | sysAnnouncement.setSender("系统"); | ||
209 | sysAnnouncement.setDepartId(systemNoticeVO.getDepartId()); | ||
210 | sysAnnouncement.setMsgContent(systemNoticeVO.getContent()); | ||
211 | sysAnnouncement.setTitile("修改密码通知"); | ||
212 | sysAnnouncement.setUserIds(userIds); | ||
213 | sysAnnouncementService.save(sysAnnouncement); | ||
214 | // 2.插入用户通告阅读标记表记录 | ||
215 | String[] users = userIds.split(","); | ||
216 | String anntId = sysAnnouncement.getId(); | ||
217 | for (int i = 0; i < users.length; i++) { | ||
218 | SysAnnouncementSend announcementSend = new SysAnnouncementSend(); | ||
219 | announcementSend.setAnntId(anntId); | ||
220 | announcementSend.setUserId(users[i]); | ||
221 | announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG); | ||
222 | announcementSend.setReadTime(refDate); | ||
223 | sysAnnouncementSendService.save(announcementSend); | ||
224 | } | ||
225 | // 发送webSocket | ||
226 | JSONObject obj = new JSONObject(); | ||
227 | obj.put("cmd", "passwordNotice"); | ||
228 | obj.put("type", sysAnnouncement.getPriority()); | ||
229 | obj.put("msgId", sysAnnouncement.getId()); | ||
230 | obj.put("msgTxt", sysAnnouncement.getTitile()); | ||
231 | webSocket.sendMoreMessage(users, obj.toJSONString()); | ||
232 | log.info("系统通知发送成功" + userIds); | ||
233 | |||
234 | //移动端消息推送 | ||
235 | //根据用户id查询cid | ||
236 | List<String> cidList = sysUserService.getCidByUserIds(userIds); | ||
237 | if (cidList != null && cidList.size() > 0) { | ||
238 | log.info("APP通知发送开始" + userIds); | ||
239 | try { | ||
240 | MessageEntity messageEntity = new MessageEntity(); | ||
241 | messageEntity.setMessageTitle("修改密码通知"); | ||
242 | messageEntity.setMessageBody(systemNoticeVO.getContent()); | ||
243 | messageEntity.setReceiveUserCid(cidList); | ||
244 | messageEntity.setForwardTag(""); | ||
245 | IPushService appPushService = PushMessageFactory.getPushService("MOB"); | ||
246 | appPushService.pushMessage(messageEntity); | ||
247 | } catch (Exception e) { | ||
248 | log.info("APP通知发送错误" + e); | ||
249 | } | ||
250 | log.info("APP通知发送成功" + userIds + ":" + "[修改密码通知]" + systemNoticeVO.getContent()); | ||
251 | } else { | ||
252 | log.info("APP通知没有cid" + userIds); | ||
253 | } | ||
254 | |||
255 | } | ||
191 | } | 256 | } | ... | ... |
... | @@ -79,16 +79,8 @@ public class AjhWasteSolidTransportController { | ... | @@ -79,16 +79,8 @@ public class AjhWasteSolidTransportController { |
79 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 79 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
80 | HttpServletRequest req) { | 80 | HttpServletRequest req) { |
81 | Result<IPage<AjhWasteSolidTransport>> result = new Result<IPage<AjhWasteSolidTransport>>(); | 81 | Result<IPage<AjhWasteSolidTransport>> result = new Result<IPage<AjhWasteSolidTransport>>(); |
82 | /*String departIds = BaseContextHandler.getDeparts(); | ||
83 | if(StringUtils.isNotEmpty(ajhWasteSolidTransport.getDepartId())){ | ||
84 | departIds = commonSqlService.getChildDepartId(ajhWasteSolidTransport.getDepartId()); | ||
85 | ajhWasteSolidTransport.setDepartId(null); | ||
86 | }*/ | ||
87 | QueryWrapper<AjhWasteSolidTransport> queryWrapper = QueryGenerator.initQueryWrapper(ajhWasteSolidTransport, req.getParameterMap()); | 82 | QueryWrapper<AjhWasteSolidTransport> queryWrapper = QueryGenerator.initQueryWrapper(ajhWasteSolidTransport, req.getParameterMap()); |
88 | Page<AjhWasteSolidTransport> page = new Page<AjhWasteSolidTransport>(pageNo, pageSize); | 83 | Page<AjhWasteSolidTransport> page = new Page<AjhWasteSolidTransport>(pageNo, pageSize); |
89 | /*if(StringUtils.isNotEmpty(departIds)){ | ||
90 | queryWrapper.in("depart_id", JSUtils.quoteEach(departIds,",")); | ||
91 | }*/ | ||
92 | String startDate = req.getParameter("startDate"); | 84 | String startDate = req.getParameter("startDate"); |
93 | if(StringUtils.isNotEmpty(startDate)){ | 85 | if(StringUtils.isNotEmpty(startDate)){ |
94 | queryWrapper.ge("transport_time",startDate+" 00:00:00"); | 86 | queryWrapper.ge("transport_time",startDate+" 00:00:00"); | ... | ... |
... | @@ -82,6 +82,16 @@ public class AjhWasteSolidTransport { | ... | @@ -82,6 +82,16 @@ public class AjhWasteSolidTransport { |
82 | @Excel(name = "联系电话", width = 15) | 82 | @Excel(name = "联系电话", width = 15) |
83 | @ApiModelProperty(value = "联系电话") | 83 | @ApiModelProperty(value = "联系电话") |
84 | private String contactsPhone; | 84 | private String contactsPhone; |
85 | |||
86 | /**跟车人*/ | ||
87 | @Excel(name = "跟车人", width = 15) | ||
88 | @ApiModelProperty(value = "跟车人") | ||
89 | private String followUser; | ||
90 | /**跟车人电话*/ | ||
91 | @Excel(name = "跟车人电话", width = 15) | ||
92 | @ApiModelProperty(value = "跟车人电话") | ||
93 | private String followPhone; | ||
94 | |||
85 | /**创建人id*/ | 95 | /**创建人id*/ |
86 | @Excel(name = "创建人id", width = 15) | 96 | @Excel(name = "创建人id", width = 15) |
87 | @ApiModelProperty(value = "创建人id") | 97 | @ApiModelProperty(value = "创建人id") | ... | ... |
... | @@ -99,7 +99,7 @@ public class SafetyOffenceRecord { | ... | @@ -99,7 +99,7 @@ public class SafetyOffenceRecord { |
99 | /**处理状态【1 已处理 2 暂不处理】*/ | 99 | /**处理状态【1 已处理 2 暂不处理】*/ |
100 | @Excel(name = "处理状态【1 已处理 2 暂不处理】", width = 15) | 100 | @Excel(name = "处理状态【1 已处理 2 暂不处理】", width = 15) |
101 | @ApiModelProperty(value = "处理状态【1 已处理 2 暂不处理】") | 101 | @ApiModelProperty(value = "处理状态【1 已处理 2 暂不处理】") |
102 | @Dict( dicCode = "handle_status") | 102 | @Dict( dicCode = "safety_handle_status") |
103 | private String handleStatus; | 103 | private String handleStatus; |
104 | /**反馈意见*/ | 104 | /**反馈意见*/ |
105 | @Excel(name = "反馈意见", width = 15) | 105 | @Excel(name = "反馈意见", width = 15) | ... | ... |
... | @@ -62,7 +62,6 @@ public class InspectionPlanController { | ... | @@ -62,7 +62,6 @@ public class InspectionPlanController { |
62 | result.setSuccess(true); | 62 | result.setSuccess(true); |
63 | result.setResult(pageList); | 63 | result.setResult(pageList); |
64 | } catch (Exception e) { | 64 | } catch (Exception e) { |
65 | e.printStackTrace(); | ||
66 | log.error(e.getMessage(), e); | 65 | log.error(e.getMessage(), e); |
67 | result.error500("查询失败"); | 66 | result.error500("查询失败"); |
68 | } | 67 | } | ... | ... |
... | @@ -58,33 +58,12 @@ public class InspectionTaskController { | ... | @@ -58,33 +58,12 @@ public class InspectionTaskController { |
58 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 58 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
59 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | 59 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
60 | Result<IPage<InspectionTask>> result = new Result<>(); | 60 | Result<IPage<InspectionTask>> result = new Result<>(); |
61 | // QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>(); | ||
62 | // if (StringUtils.isNotBlank(inspectionTaskVO.getStartTime()) | ||
63 | // && StringUtils.isNotBlank(inspectionTaskVO.getEndTime())) { | ||
64 | // queryWrapper.ge("inspection_cycle_start_date", inspectionTaskVO.getStartTime() + " 00:00:00"); | ||
65 | // queryWrapper.le("inspection_cycle_start_date", inspectionTaskVO.getEndTime() + " 23:59:59"); | ||
66 | // } | ||
67 | if (StringUtils.isNotBlank(inspectionTaskVO.getStartTime()) | 61 | if (StringUtils.isNotBlank(inspectionTaskVO.getStartTime()) |
68 | && StringUtils.isNotBlank(inspectionTaskVO.getEndTime())) { | 62 | && StringUtils.isNotBlank(inspectionTaskVO.getEndTime())) { |
69 | inspectionTaskVO.setStartTime(inspectionTaskVO.getStartTime() + " 00:00:00"); | 63 | inspectionTaskVO.setStartTime(inspectionTaskVO.getStartTime() + " 00:00:00"); |
70 | inspectionTaskVO.setEndTime(inspectionTaskVO.getEndTime() + " 23:59:59"); | 64 | inspectionTaskVO.setEndTime(inspectionTaskVO.getEndTime() + " 23:59:59"); |
71 | } | 65 | } |
72 | // if (StringUtils.isNotBlank(inspectionTaskVO.getTaskName())) { | ||
73 | // queryWrapper.like("task_name", inspectionTaskVO.getTaskName()); | ||
74 | // } | ||
75 | // if (StringUtils.isNotBlank(inspectionTaskVO.getTaskState())) { | ||
76 | // queryWrapper.eq("task_state", inspectionTaskVO.getTaskState()); | ||
77 | // } | ||
78 | // if (StringUtils.isNotBlank(inspectionTaskVO.getDepartId())) { | ||
79 | // queryWrapper.eq("depart_id", inspectionTaskVO.getDepartId()); | ||
80 | // } | ||
81 | // queryWrapper.eq("del_flag","1"); | ||
82 | // queryWrapper.orderByDesc("task_start_time"); | ||
83 | // if (inspectionTaskVO.getGroupName() != null && !"".equals(inspectionTaskVO.getGroupName())) { | ||
84 | // queryWrapper.like("inspection_working_group_name", inspectionTaskVO.getInspectionWorkingGroupName()); | ||
85 | // } | ||
86 | Page<InspectionTask> page = new Page<>(pageNo, pageSize); | 66 | Page<InspectionTask> page = new Page<>(pageNo, pageSize); |
87 | // IPage<InspectionTask> pageList = inspectionTaskService.page(page, queryWrapper); | ||
88 | IPage<InspectionTask> pageList = inspectionTaskService.getPage(page, inspectionTaskVO); | 67 | IPage<InspectionTask> pageList = inspectionTaskService.getPage(page, inspectionTaskVO); |
89 | result.setSuccess(true); | 68 | result.setSuccess(true); |
90 | result.setResult(pageList); | 69 | result.setResult(pageList); | ... | ... |
... | @@ -106,4 +106,10 @@ public class InspectionPlan { | ... | @@ -106,4 +106,10 @@ public class InspectionPlan { |
106 | @Excel(name = "删除标识(0:删除,1:有效)", width = 15) | 106 | @Excel(name = "删除标识(0:删除,1:有效)", width = 15) |
107 | @ApiModelProperty(value = "删除标识(0:删除,1:有效)") | 107 | @ApiModelProperty(value = "删除标识(0:删除,1:有效)") |
108 | private Integer delFlag; | 108 | private Integer delFlag; |
109 | |||
110 | /**计划任务类型*/ | ||
111 | @Excel(name = "计划任务类型", width = 15) | ||
112 | @ApiModelProperty(value = "计划任务类型") | ||
113 | @Dict(dicCode = "inspection_plan_type") | ||
114 | private String inspectionPlanType; | ||
109 | } | 115 | } | ... | ... |
1 | package com.skua.modules.inspection.entity; | 1 | package com.skua.modules.inspection.entity; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.annotation.TableField; | ||
3 | import com.baomidou.mybatisplus.annotation.TableName; | 4 | import com.baomidou.mybatisplus.annotation.TableName; |
4 | import com.fasterxml.jackson.annotation.JsonFormat; | 5 | import com.fasterxml.jackson.annotation.JsonFormat; |
5 | import com.skua.core.aspect.annotation.Dict; | 6 | import com.skua.core.aspect.annotation.Dict; |
... | @@ -149,4 +150,9 @@ public class InspectionTask { | ... | @@ -149,4 +150,9 @@ public class InspectionTask { |
149 | @Excel(name = "删除标识(0:删除,1:有效)", width = 15) | 150 | @Excel(name = "删除标识(0:删除,1:有效)", width = 15) |
150 | @ApiModelProperty(value = "删除标识(0:删除,1:有效)") | 151 | @ApiModelProperty(value = "删除标识(0:删除,1:有效)") |
151 | private String delFlag; | 152 | private String delFlag; |
153 | |||
154 | @TableField(exist=false) | ||
155 | @Dict(dicCode = "inspection_plan_type") | ||
156 | private String inspectionPlanType; | ||
157 | |||
152 | } | 158 | } | ... | ... |
... | @@ -12,38 +12,41 @@ | ... | @@ -12,38 +12,41 @@ |
12 | </select> | 12 | </select> |
13 | 13 | ||
14 | <select id="getList" parameterType="com.skua.modules.inspection.vo.InspectionTaskVO" resultType="com.skua.modules.inspection.entity.InspectionTask"> | 14 | <select id="getList" parameterType="com.skua.modules.inspection.vo.InspectionTaskVO" resultType="com.skua.modules.inspection.entity.InspectionTask"> |
15 | select | 15 | SELECT |
16 | * | 16 | t.*, |
17 | from inspection_task | 17 | p.inspection_plan_type |
18 | where inspection_plan_id in ( | 18 | FROM |
19 | select inspection_plan_id | 19 | inspection_task t |
20 | from inspection_plan_point | 20 | LEFT JOIN inspection_plan p ON t.inspection_plan_id = p.id |
21 | where inspection_point_id in ( | 21 | WHERE |
22 | select inspection_point_id | 22 | t.inspection_plan_id IN ( SELECT inspection_plan_id FROM inspection_plan_point |
23 | from inspection_point_fill_group | 23 | WHERE inspection_point_id IN ( SELECT inspection_point_id FROM inspection_point_fill_group |
24 | <if test="inspectionTaskVO.equipInfoId!=null and inspectionTaskVO.equipInfoId!=''"> | 24 | <if test="inspectionTaskVO.equipInfoId!=null and inspectionTaskVO.equipInfoId!=''"> |
25 | where equip_info_id = #{inspectionTaskVO.equipInfoId} | 25 | where equip_info_id = #{inspectionTaskVO.equipInfoId} |
26 | </if> | 26 | </if> |
27 | )) | 27 | ) ) |
28 | and del_flag = 1 | 28 | AND t.del_flag = 1 |
29 | <if test="inspectionTaskVO.startTime !=null and inspectionTaskVO.startTime!=''"> | 29 | <if test="inspectionTaskVO.startTime !=null and inspectionTaskVO.startTime!=''"> |
30 | and inspection_cycle_start_date BETWEEN #{inspectionTaskVO.startTime} and #{inspectionTaskVO.endTime} | 30 | and t.inspection_cycle_start_date BETWEEN #{inspectionTaskVO.startTime} and #{inspectionTaskVO.endTime} |
31 | </if> | 31 | </if> |
32 | <if test="inspectionTaskVO.taskName!=null and inspectionTaskVO.taskName!=''"> | 32 | <if test="inspectionTaskVO.taskName!=null and inspectionTaskVO.taskName!=''"> |
33 | and task_name like CONCAT('%',#{inspectionTaskVO.taskName},'%') | 33 | and t.task_name like CONCAT('%',#{inspectionTaskVO.taskName},'%') |
34 | </if> | 34 | </if> |
35 | <if test="inspectionTaskVO.taskState!=null and inspectionTaskVO.taskState!=''"> | 35 | <if test="inspectionTaskVO.taskState!=null and inspectionTaskVO.taskState!=''"> |
36 | and task_state = #{inspectionTaskVO.taskState} | 36 | and t.task_state = #{inspectionTaskVO.taskState} |
37 | </if> | 37 | </if> |
38 | <if test="inspectionTaskVO.departId!=null and inspectionTaskVO.departId!=''"> | 38 | <if test="inspectionTaskVO.departId!=null and inspectionTaskVO.departId!=''"> |
39 | and depart_id = #{inspectionTaskVO.departId} | 39 | and t.depart_id = #{inspectionTaskVO.departId} |
40 | </if> | 40 | </if> |
41 | <if test="inspectionTaskVO.groupName!=null and inspectionTaskVO.groupName!=''"> | 41 | <if test="inspectionTaskVO.groupName!=null and inspectionTaskVO.groupName!=''"> |
42 | and inspection_working_group_name like CONCAT('%',#{inspectionTaskVO.groupName},'%') | 42 | and t.inspection_working_group_name like CONCAT('%',#{inspectionTaskVO.groupName},'%') |
43 | </if> | 43 | </if> |
44 | <if test="inspectionTaskVO.inspectionWorkingGroupName!=null and inspectionTaskVO.inspectionWorkingGroupName!=''"> | 44 | <if test="inspectionTaskVO.inspectionWorkingGroupName!=null and inspectionTaskVO.inspectionWorkingGroupName!=''"> |
45 | and inspection_working_group_name like CONCAT('%',#{inspectionTaskVO.inspectionWorkingGroupName},'%') | 45 | and t.inspection_working_group_name like CONCAT('%',#{inspectionTaskVO.inspectionWorkingGroupName},'%') |
46 | </if> | 46 | </if> |
47 | ORDER BY task_start_time desc | 47 | <if test="inspectionTaskVO.inspectionPlanType!=null and inspectionTaskVO.inspectionPlanType!=''"> |
48 | and p.inspection_plan_type = #{inspectionTaskVO.inspectionPlanType} | ||
49 | </if> | ||
50 | ORDER BY t.task_start_time desc | ||
48 | </select> | 51 | </select> |
49 | </mapper> | 52 | </mapper> | ... | ... |
1 | package com.skua.modules.inspection.vo; | 1 | package com.skua.modules.inspection.vo; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.annotation.TableField; | ||
3 | import com.fasterxml.jackson.annotation.JsonFormat; | 4 | import com.fasterxml.jackson.annotation.JsonFormat; |
4 | import com.skua.core.aspect.annotation.Dict; | 5 | import com.skua.core.aspect.annotation.Dict; |
5 | import io.swagger.annotations.ApiModelProperty; | 6 | import io.swagger.annotations.ApiModelProperty; |
... | @@ -161,4 +162,7 @@ public class InspectionTaskVO { | ... | @@ -161,4 +162,7 @@ public class InspectionTaskVO { |
161 | 162 | ||
162 | /**关联设备ID*/ | 163 | /**关联设备ID*/ |
163 | private String equipInfoId; | 164 | private String equipInfoId; |
165 | |||
166 | /**计划任务类型*/ | ||
167 | private String inspectionPlanType; | ||
164 | } | 168 | } | ... | ... |
... | @@ -167,6 +167,7 @@ public class SysUserController { | ... | @@ -167,6 +167,7 @@ public class SysUserController { |
167 | user.setSalt(salt); | 167 | user.setSalt(salt); |
168 | String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), salt); | 168 | String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), salt); |
169 | user.setPassword(passwordEncode); | 169 | user.setPassword(passwordEncode); |
170 | user.setPasswordUpdateTime(new Date()); | ||
170 | user.setStatus(1); | 171 | user.setStatus(1); |
171 | user.setDelFlag("0"); | 172 | user.setDelFlag("0"); |
172 | sysUserService.addUserWithRole(user, selectedRoles); | 173 | sysUserService.addUserWithRole(user, selectedRoles); |
... | @@ -430,6 +431,7 @@ public class SysUserController { | ... | @@ -430,6 +431,7 @@ public class SysUserController { |
430 | sysUser.setSalt(salt); | 431 | sysUser.setSalt(salt); |
431 | String passwordEncode = PasswordUtil.encrypt(sysUser.getUsername(), password, salt); | 432 | String passwordEncode = PasswordUtil.encrypt(sysUser.getUsername(), password, salt); |
432 | sysUser.setPassword(passwordEncode); | 433 | sysUser.setPassword(passwordEncode); |
434 | sysUser.setPasswordUpdateTime(new Date()); | ||
433 | this.sysUserService.updateById(sysUser); | 435 | this.sysUserService.updateById(sysUser); |
434 | result.setResult(sysUser); | 436 | result.setResult(sysUser); |
435 | result.success("密码修改完成!"); | 437 | result.success("密码修改完成!"); |
... | @@ -629,7 +631,10 @@ public class SysUserController { | ... | @@ -629,7 +631,10 @@ public class SysUserController { |
629 | return result; | 631 | return result; |
630 | } | 632 | } |
631 | String newpassword = PasswordUtil.encrypt(username, password, user.getSalt()); | 633 | String newpassword = PasswordUtil.encrypt(username, password, user.getSalt()); |
632 | this.sysUserService.update(new SysUser().setPassword(newpassword), new LambdaQueryWrapper<SysUser>().eq(SysUser::getId, user.getId())); | 634 | SysUser sysUser = new SysUser(); |
635 | sysUser.setPassword(newpassword); | ||
636 | sysUser.setPasswordUpdateTime(new Date()); | ||
637 | this.sysUserService.update(sysUser, new LambdaQueryWrapper<SysUser>().eq(SysUser::getId, user.getId())); | ||
633 | result.success("密码修改完成!"); | 638 | result.success("密码修改完成!"); |
634 | return result; | 639 | return result; |
635 | } | 640 | } | ... | ... |
... | @@ -350,4 +350,10 @@ public class SysFactoryInfo { | ... | @@ -350,4 +350,10 @@ public class SysFactoryInfo { |
350 | @Dict(dicCode = "sludgeCraft") | 350 | @Dict(dicCode = "sludgeCraft") |
351 | private String sludgeCraft; | 351 | private String sludgeCraft; |
352 | 352 | ||
353 | @Excel(name = "周边环境敏感区域类型", width = 20) | ||
354 | @ApiModelProperty(value = "周边环境敏感区域类型") | ||
355 | @Dict(dicCode = "environmentType") | ||
356 | private String environmentType; | ||
357 | @ApiModelProperty(value = "所处流域") | ||
358 | private String factoryBasin; | ||
353 | } | 359 | } | ... | ... |
... | @@ -178,4 +178,9 @@ public class SysUser implements Serializable { | ... | @@ -178,4 +178,9 @@ public class SysUser implements Serializable { |
178 | * 数字孪生像素流地址 | 178 | * 数字孪生像素流地址 |
179 | */ | 179 | */ |
180 | private String pixelStreamPath; | 180 | private String pixelStreamPath; |
181 | |||
182 | //密码修改时间 | ||
183 | private Date passwordUpdateTime; | ||
184 | |||
185 | |||
181 | } | 186 | } | ... | ... |
... | @@ -79,4 +79,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> { | ... | @@ -79,4 +79,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> { |
79 | 79 | ||
80 | @Anonymous | 80 | @Anonymous |
81 | String queryDepartIdsByUserId(@Param("userId") String userId); | 81 | String queryDepartIdsByUserId(@Param("userId") String userId); |
82 | |||
83 | List<SysUser> getNoUpdatePasswordUserList(@Param("editTime") String editTime); | ||
82 | } | 84 | } | ... | ... |
... | @@ -163,4 +163,10 @@ | ... | @@ -163,4 +163,10 @@ |
163 | WHERE a.dep_id = #{departId} OR a.dep_ids LIKE CONCAT('%',#{departId},'%') | 163 | WHERE a.dep_id = #{departId} OR a.dep_ids LIKE CONCAT('%',#{departId},'%') |
164 | </if> | 164 | </if> |
165 | </select> | 165 | </select> |
166 | |||
167 | <select id="getNoUpdatePasswordUserList" resultType="com.skua.modules.system.entity.SysUser"> | ||
168 | select * from sys_user | ||
169 | where user_type = '2' | ||
170 | and password_update_time <= #{editTime} | ||
171 | </select> | ||
166 | </mapper> | 172 | </mapper> | ... | ... |
... | @@ -153,4 +153,6 @@ public interface ISysUserService extends IService<SysUser> { | ... | @@ -153,4 +153,6 @@ public interface ISysUserService extends IService<SysUser> { |
153 | * @return | 153 | * @return |
154 | */ | 154 | */ |
155 | String getUserNameByUserIds(String userIds); | 155 | String getUserNameByUserIds(String userIds); |
156 | |||
157 | List<SysUser> getNoUpdatePasswordUserList(String editTime); | ||
156 | } | 158 | } | ... | ... |
... | @@ -332,6 +332,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl | ... | @@ -332,6 +332,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
332 | } | 332 | } |
333 | 333 | ||
334 | @Override | 334 | @Override |
335 | public List<SysUser> getNoUpdatePasswordUserList(String editTime) { | ||
336 | List<SysUser> userList = baseMapper.getNoUpdatePasswordUserList(editTime); | ||
337 | return userList; | ||
338 | } | ||
339 | |||
340 | @Override | ||
335 | public List<SysUser> operationUserList(String departId) { | 341 | public List<SysUser> operationUserList(String departId) { |
336 | return userMapper.operationUserList(departId); | 342 | return userMapper.operationUserList(departId); |
337 | } | 343 | } | ... | ... |
-
请 注册 或 登录 后发表评论