| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.utils.security.ShiroUtils; |
| | | 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.tr.riskCheckPoint.service.IRiskCheckPointService; |
| | | import com.ruoyi.project.tr.riskEvaluationPlan.domain.RiskEvaluationPlan; |
| | | import com.ruoyi.project.tr.riskEvaluationPlan.service.IRiskEvaluationPlanService; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | 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 |
| | | private IRoleService roleService; |
| | | |
| | | @Autowired |
| | | private RiskService riskService; |
| | | |
| | | @GetMapping() |
| | | public String hiddenDangerCheck(ModelMap mmap) { |
| | |
| | | //是隐患设置核查人ID、核查人名称 |
| | | if ((!StringUtils.isEmpty(hdcp.getWhetherDanger())) && |
| | | (TrHiddenDangerCheckConstants.WHETHER_DANGER_YES.equals(hdcp.getWhetherDanger()))) { |
| | | hdcp.setExamineStatus(TrHiddenDangerCheckConstants.EXAMINE_STATUS_NOT_EXAMINE);//核查状态(待核查) |
| | | hdcp.setExamineStatus(TrHiddenDangerCheckConstants.EXAMINE_STATUS_NOT_EXAMINE);//核查状8态(待核查) |
| | | hdcp.setExamineUserId(hiddenDangerCheck.getExamineUserId());//核查人ID |
| | | hdcp.setExamineUserName(hiddenDangerCheck.getExamineUserName());//核查人名称 |
| | | hdcp.setStage(TrHiddenDangerCheckConstants.DANGER_STAGE_PLAN_EXAMINE);//3隐患核查阶段(/** 更新者 */数据进入到3隐患核查阶段) |
| | |
| | | hiddenDangerCheckPoint.setWhetherDanger(TrHiddenDangerCheckConstants.WHETHER_DANGER_NOT);//是否为隐患(正常) |
| | | // hiddenDangerCheckPoint.setScheduleCheckStatus(TrHiddenDangerCheckConstants.CHECK_STATUS_ALREADY_CHECK);//排查状态(已排查)(定时任务生成的数据) |
| | | // hiddenDangerCheckPoint.setCheckTime(DateUtils.getNowDate());//设置排查时间 |
| | | |
| | | if(ObjectUtils.isEmpty(hiddenDangerCheckPoint.getMobileCode())){ |
| | | throw new RuntimeException("手机识别码为空,请使用终端机进行填写"); |
| | | } |
| | | int i = hiddenDangerCheckPointService.updateHiddenDangerCheckPoint(hiddenDangerCheckPoint); |
| | | hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送 |
| | | |
| | |
| | | //隐患排查检查点实体 |
| | | HiddenDangerCheckPoint hiddenDangerCheckPoint = hiddenDangerCheckPointService.selectHiddenDangerCheckPointById(Long.valueOf(id)); |
| | | mmap.put("hiddenDangerCheckPoint", hiddenDangerCheckPoint); |
| | | |
| | | if(ObjectUtils.isEmpty(hiddenDangerCheckPoint.getMobileCode())){ |
| | | throw new RuntimeException("手机识别码为空,请使用终端机进行填写"); |
| | | } |
| | | //隐患类别 |
| | | User sysUser = getSysUser(); |
| | | HiddenTroubleType hiddenTroubleType = new HiddenTroubleType(); |
| | |
| | | hiddenDangerCheckPoint.setUpdateBy(getSysUser().getLoginName()); |
| | | hiddenDangerCheckPoint.setUpdateTime(DateUtils.getNowDate()); |
| | | i = hiddenDangerCheckPointService.updateHiddenDangerCheckPoint(hiddenDangerCheckPoint); |
| | | } |
| | | if(ObjectUtils.isEmpty(hiddenDangerCheckPoint.getMobileCode())){ |
| | | throw new RuntimeException("手机识别码为空,请使用终端机进行填写"); |
| | | } |
| | | hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送 |
| | | |
| | |
| | | @Log(title = "删除定时隐患排查", businessType = BusinessType.DELETE) |
| | | @PostMapping("/remove") |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult remove(String ids) { |
| | | return toAjax(hiddenDangerCheckService.deleteHiddenDangerCheckByIds(ids)); |
| | | //老代码 |
| | | int result = hiddenDangerCheckService.deleteHiddenDangerCheckByIds(ids); |
| | | |
| | | // todo-2022 删除定时核查任务 新代码添加 |
| | | int result1 = riskService.deleteDangerCheck(ids); |
| | | if (result1 < 1){ |
| | | throw new RuntimeException("删除核查任务附属表失败"); |
| | | } |
| | | |
| | | return toAjax(result); |
| | | } |
| | | |
| | | |