| | |
| | | |
| | | import com.ruoyi.common.constant.TrHiddenDangerCheckConstants; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.security.ShiroUtils; |
| | | import com.ruoyi.doublePrevention.entity.PreventRiskDangerInfo; |
| | | import com.ruoyi.doublePrevention.service.RiskService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | |
| | | import com.ruoyi.project.system.user.service.IUserService; |
| | | import com.ruoyi.project.tr.hiddenDangerCheckPoint.domain.HiddenDangerCheckPoint; |
| | | import com.ruoyi.project.tr.hiddenDangerCheckPoint.service.IHiddenDangerCheckPointService; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @Autowired |
| | | JpushService jpushService; |
| | | |
| | | @Autowired |
| | | private RiskService riskService; |
| | | |
| | | @GetMapping() |
| | | public String hiddenDangerCheckPoint() { |
| | | return prefix + "/dangerRectify"; |
| | |
| | | |
| | | /** |
| | | * 隐患整改--整改 |
| | | * |
| | | */ |
| | | @Log(title = "隐患整改--整改") |
| | | @GetMapping("/editDangerRectify/{id}") |
| | |
| | | return prefix + "/editDangerRectify"; |
| | | } |
| | | |
| | | /** |
| | | * 隐患整改--延期 |
| | | * |
| | | */ |
| | | @Log(title = "隐患整改--整改") |
| | | @GetMapping("/delayDangerRectify/{id}") |
| | | public String delayDangerRectify(@PathVariable("id") Long id, ModelMap mmap) { |
| | | //隐患排查实体 |
| | | HiddenDangerCheckPoint hiddenDangerCheckPoint = hiddenDangerCheckPointService.selectHiddenDangerCheckPointById(Long.valueOf(id)); |
| | | mmap.put("hdcp", hiddenDangerCheckPoint); |
| | | |
| | | //获取所在公司人员信息 |
| | | User sysUser = getSysUser(); |
| | | if (sysUser != null && sysUser.getCompanyId() != null) { |
| | | User userTemp = new User(); |
| | | userTemp.setCompanyId(sysUser.getCompanyId()); |
| | | List<User> userList = userService.selectUserList(userTemp); |
| | | mmap.put("userList", userList); |
| | | } |
| | | return prefix + "/delayDangerRectify"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 隐患整改--保存 |
| | |
| | | @Log(title = "隐患整改--保存", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/editDangerRectifySave") |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult editDangerRectifySave(HiddenDangerCheckPoint hiddenDangerCheckPoint) { |
| | | //获取当前更新用户信息 |
| | | hiddenDangerCheckPoint.setUpdateBy(ShiroUtils.getLoginName()); |
| | |
| | | hiddenDangerCheckPoint.setAcceptStatus(TrHiddenDangerCheckConstants.ACCEPT_STATUS_NOT_ACCEPT);//验收状态(未验收) |
| | | hiddenDangerCheckPoint.setStage(TrHiddenDangerCheckConstants.DANGER_STAGE_PLAN_ACCEPT);//隐患验收阶段(数据进入到隐患验收阶段) |
| | | int i = hiddenDangerCheckPointService.updateHiddenDangerCheckPoint(hiddenDangerCheckPoint); |
| | | |
| | | // todo-2022 隐患信息附属表 |
| | | int result = riskService.updateDangerInfoRectify(hiddenDangerCheckPoint); |
| | | if (result < 1){ |
| | | throw new RuntimeException("整改信息保存失败"); |
| | | } |
| | | |
| | | hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送 |
| | | |
| | |
| | | public String detailDangerRectify(@PathVariable("id") Long id, ModelMap mmap) { |
| | | //隐患排查实体 |
| | | HiddenDangerCheckPoint hiddenDangerCheckPoint = hiddenDangerCheckPointService.selectHiddenDangerCheckPointById(Long.valueOf(id)); |
| | | PreventRiskDangerInfo dangerInfo = riskService.getDangerInfoById(hiddenDangerCheckPoint.getId()); |
| | | if (ObjectUtils.isNotEmpty(dangerInfo)){ |
| | | hiddenDangerCheckPoint.setHazardCode(dangerInfo.getHazardCode()); |
| | | hiddenDangerCheckPoint.setDangerSrc(dangerInfo.getDangerSrc()); |
| | | hiddenDangerCheckPoint.setDangerReason(dangerInfo.getDangerReason()); |
| | | hiddenDangerCheckPoint.setHazardDangerType(dangerInfo.getHazardDangerType()); |
| | | hiddenDangerCheckPoint.setDangerResult(dangerInfo.getDangerResult()); |
| | | } |
| | | mmap.put("hdcp", hiddenDangerCheckPoint); |
| | | return prefix + "/detailDangerRectify"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 隐患整改延期 - 保存 |
| | | */ |
| | | @Log(title = "隐患上报", businessType = BusinessType.DELETE) |
| | | @PostMapping("/rectifyTimeOut") |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult rectifyTimeOutSave(HiddenDangerCheckPoint hdcp) { |
| | | if(ObjectUtils.isEmpty(hdcp.getId())){ |
| | | return AjaxResult.error("id不能为空"); |
| | | } |
| | | if(ObjectUtils.isEmpty(hdcp.getRectifyDeadlineTime())){ |
| | | return AjaxResult.error("延期时间不能为空"); |
| | | } |
| | | int i = hiddenDangerCheckPointService.rectifyTimeOut(hdcp.getId(), hdcp.getRectifyDeadlineTime()); |
| | | if (i < 1){ |
| | | return AjaxResult.error("操作失败"); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | } |