| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.security.ShiroUtils; |
| | | import com.ruoyi.doublePrevention.service.RiskService; |
| | | import com.ruoyi.doublePrevention.service.baseService.PreventRiskDangerCheckAndMeasureService; |
| | | import com.ruoyi.doublePrevention.service.baseService.PreventRiskDangerConfirmLogService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.project.mobile.domain.ApiRequestHeader; |
| | |
| | | |
| | | @Autowired |
| | | IHiddenDangerCheckPointService hdcpService;//隐患检查点Service |
| | | |
| | | @Autowired |
| | | private PreventRiskDangerCheckAndMeasureService riskDangerCheckAndMeasureService;//隐患检查点Service |
| | | |
| | | @Autowired |
| | | IUserService userService;//用户Service |
| | |
| | | return ApiResult.errorToken("验证userId,loginName,token,deviceType,deviceId,appType 不一致"); |
| | | } |
| | | try { |
| | | new ObjectMapper().readValue(str, HiddenDangerCheckPoint.class); |
| | | HiddenDangerCheckPoint hdcp = new ObjectMapper().readValue(str, HiddenDangerCheckPoint.class); |
| | | hdcp.setUpdateBy(header.loginName); |
| | | hdcp.setUpdateTime(DateUtils.getNowDate()); |
| | | if (ObjectUtils.isEmpty(hdcp.getAcceptCreateTime())){ |
| | | throw new RuntimeException("请填写验收时间"); |
| | | } |
| | | if (!StringUtils.isEmpty(hdcp.getAcceptResult())) { |
| | | //验收结果 (0不通过 打回上一级整改阶段 1通过) |
| | | if ("0".equals(hdcp.getAcceptResult())) { |
| | | hdcp.setAcceptCreateTime(DateUtils.getNowDate());//设置验收时间 |
| | | hdcp.setAcceptCreateTime(hdcp.getAcceptCreateTime());//设置验收时间 |
| | | hdcp.setStage(TrHiddenDangerCheckConstants.DANGER_STAGE_PLAN_RECTIFY);//隐患整改阶段(数据进入到隐患整改阶段) |
| | | hdcp.setRectifyStatus(TrHiddenDangerCheckConstants.RECTIFY_STATUS_NOT_RECTIFY);//整改状态(未整改) |
| | | hdcp.setAcceptStatus(TrHiddenDangerCheckConstants.ACCEPT_STATUS_ALREADY_ACCEPT_NOT_PASS);//验收状态(验收未通过) |
| | | } else if ("1".equals(hdcp.getAcceptResult())) { |
| | | hdcp.setAcceptCreateTime(DateUtils.getNowDate());//设置验收时间 |
| | | hdcp.setAcceptCreateTime(hdcp.getAcceptCreateTime());//设置验收时间 |
| | | hdcp.setAcceptStatus(TrHiddenDangerCheckConstants.ACCEPT_STATUS_ALREADY_ACCEPT_PASS);//验收状态(验收通过) |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 隐患计划执行中---设置为记录正常 // todo |
| | | * 隐患计划执行中---设置为记录正常 |
| | | */ |
| | | public ApiResult editPointSetNormal(String str, ApiRequestHeader header) { |
| | | //验证userId,loginName,token,deviceType,deviceId,appType 是否一致 |
| | |
| | | } |
| | | try { |
| | | HiddenDangerCheckPoint hdcp = new ObjectMapper().readValue(str, HiddenDangerCheckPoint.class); |
| | | if (ObjectUtils.isEmpty(hdcp.getCheckPerson())){ |
| | | throw new RuntimeException("检查人不能为空"); |
| | | } |
| | | if (ObjectUtils.isEmpty(hdcp.getFindTime())){ |
| | | throw new RuntimeException("发现时间不能为空"); |
| | | } |
| | | hdcp.setRegisterCreateTime(DateUtils.getNowDate());//设置隐患登记上报创建时间 |
| | | hdcp.setRegisterUserId(Long.valueOf(header.userId));//设置隐患登记上报创建人ID |
| | | User user = userService.selectUserById(Long.valueOf(header.userId)); |