| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.utils.poi.ExcelUtilByDangerLedger; |
| | | import com.ruoyi.common.utils.security.ShiroUtils; |
| | | 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.hiddenDangerCheckPoint.domain.HiddenDangerCheckPoint; |
| | | import com.ruoyi.project.tr.hiddenDangerCheckPoint.domain.HiddenDangerCheckPointExport; |
| | | import com.ruoyi.project.tr.hiddenDangerCheckPoint.service.IHiddenDangerCheckPointService; |
| | | import lombok.Data; |
| | | 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.*; |
| | | |
| | |
| | | import java.text.NumberFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 隐患台账Controller |
| | |
| | | if (!StringUtils.isEmpty(rectifyDeptIdLedger)) { |
| | | hiddenDangerCheckPoint.setRectifyDeptId(Long.valueOf(rectifyDeptIdLedger)); |
| | | } |
| | | List<HiddenDangerCheckPoint> list = hiddenDangerCheckPointService.selectHiddenDangerCheckPointList(hiddenDangerCheckPoint); |
| | | List<HiddenDangerCheckPoint> list = hiddenDangerCheckPointService.selectHiddenDangerCheckPointListNew(hiddenDangerCheckPoint); |
| | | |
| | | List<HiddenDangerCheckPointExport> exportList = new ArrayList<>(); |
| | | |
| | |
| | | export.setRiskPointName("-"); |
| | | } |
| | | |
| | | |
| | | //风险单元类型 |
| | | if ("1".equals(hcp.getRiskType())) { |
| | | export.setRiskPointType("设备设施清单"); |
| | |
| | | } else if ("3".equals(hcp.getRiskType())) { |
| | | export.setRiskPointType("工艺节点清单"); |
| | | } |
| | | // 隐患责任部门 |
| | | export.setDangerDep(hcp.getRectifyDeptName()); |
| | | |
| | | //隐患名称 |
| | | export.setDangerName(hcp.getDangerName()); |
| | | |
| | | //隐患描述 todo |
| | | export.setDangerDescription(hcp.getDangerDescription()); |
| | | |
| | | //隐患级别 |
| | | if ("0".equals(hcp.getDangerLevel())) { |
| | |
| | | export.setDangerSources(""); |
| | | } |
| | | |
| | | //整改完成期限 |
| | | if(ObjectUtils.isNotEmpty(hcp.getRectifyDeadlineTime())){ |
| | | export.setRectifyDeadlineTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getRectifyDeadlineTime())); |
| | | } |
| | | |
| | | //整改完成时间 |
| | | if(ObjectUtils.isNotEmpty(hcp.getRectifyCompleteTime())){ |
| | | export.setRectifyCompleteTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getRectifyCompleteTime())); |
| | | } |
| | | |
| | | //整改状态 |
| | | if (!StringUtils.isEmpty(hcp.getStage())) { |
| | |
| | | } else if (("超期改").equals(rectifyStatusLedger)) { |
| | | hiddenDangerCheckPoint.setStage("5"); |
| | | hiddenDangerCheckPoint.setOverdueRectify("1"); |
| | | // hiddenDangerCheckPoint.setAcceptStatus("1"); |
| | | } |
| | | } |
| | | //整改部门 |
| | |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 隐患类别修改 |
| | | */ |
| | | @Log(title = "隐患上报", businessType = BusinessType.DELETE) |
| | | @PostMapping("/editDangerLevel") |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult editDangerLevel(HiddenDangerCheckPoint hdcp) { |
| | | if(ObjectUtils.isEmpty(hdcp.getId())){ |
| | | return AjaxResult.error("id不能为空"); |
| | | } |
| | | if(ObjectUtils.isEmpty(hdcp.getTroubleshootTypeName())){ |
| | | return AjaxResult.error("隐患类别不能为空"); |
| | | } |
| | | //获取当前更新用户信息 |
| | | User sysUser = getSysUser(); |
| | | hdcp.setUpdateBy(ShiroUtils.getLoginName()); |
| | | hdcp.setUpdateTime(DateUtils.getNowDate()); |
| | | int i = hiddenDangerCheckPointService.editDangerLevel(hdcp); |
| | | if (i < 1){ |
| | | return AjaxResult.error("操作失败"); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |