| | |
| | | import com.ruoyi.doublePrevention.service.baseService.PreventReportConfigService;
|
| | | import com.ruoyi.doublePrevention.vo.ResultVO;
|
| | | import com.ruoyi.project.system.user.domain.User;
|
| | | import com.ruoyi.project.tr.riskList.domain.RiskList;
|
| | | import com.ruoyi.project.tr.riskList.service.IRiskListService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.util.ObjectUtils;
|
| | |
| | | private PreventOverhaulLogRepository overhaulLogRepository;
|
| | | @Autowired
|
| | | private PreventReportConfigService preventReportConfigService;
|
| | | @Autowired
|
| | | private IRiskListService iRiskListService;
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | | List<PreventOverhaulLog> preventOverhaulLogs = overhaulLogRepository.selectOverhaulLogPage(overhaulLogReqBO);
|
| | | List<PreventOverhaulLog> result = page.getResult();
|
| | |
|
| | | resultVO.setData(result);
|
| | | List<PreventOverhaulLogRespDTO> preventOverhaulLogRespDTOS = BeanCopyUtils.copyBeanList(result, PreventOverhaulLogRespDTO.class);
|
| | |
|
| | | List<RiskList> riskUnitLists = iRiskListService.getRiskUnitLists();
|
| | | for (PreventOverhaulLogRespDTO overhaulLog : preventOverhaulLogRespDTOS) {
|
| | | for (RiskList riskUnit : riskUnitLists) {
|
| | | if (overhaulLog.getRiskUnitId() == riskUnit.getRiskListId()){
|
| | | overhaulLog.setRiskUnitName(riskUnit.getRiskListName());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | resultVO.setData(preventOverhaulLogRespDTOS);
|
| | | resultVO.setCount((int) page.getTotal());
|
| | | resultVO.setPageNum(page.getPageNum());
|
| | | resultVO.setPageSize(page.getPageSize());
|
| | |
| | | ResultVO resultVO = new ResultVO<>();
|
| | | resultVO.setCode(ErrorCodes.REQUEST_PARAM_ERROR.getCode());
|
| | |
|
| | | // if (insertReqBO.getHazardCode().isEmpty()){
|
| | | // throw new RuntimeException("风险分析对象编码为空");
|
| | | // }
|
| | |
|
| | | if (ObjectUtils.isEmpty(insertReqBO.getRiskUnitId())){
|
| | | throw new RuntimeException("安全风险分析单元为空");
|
| | | }
|
| | |
| | | preventOverhaulLog.setGmtCreate(date);
|
| | | preventOverhaulLog.setLastEditUserName(sysUser.getUserName());
|
| | | preventOverhaulLog.setGmtModitify(date);
|
| | | preventOverhaulLog.setRiskUnitId(null);// todo 暂时未设置
|
| | |
|
| | | //todo 对所属企业id和uuid没有进行设置
|
| | | PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode());
|
| | |
| | | ResultVO resultVO = new ResultVO<>();
|
| | | resultVO.setCode(ErrorCodes.REQUEST_PARAM_ERROR.getCode());
|
| | |
|
| | | if (updateReqBO.getHazardCode().isEmpty()){
|
| | | resultVO.setMsg("风险分析对象编码");
|
| | | return resultVO;
|
| | | }
|
| | | if (ObjectUtils.isEmpty(updateReqBO.getRiskUnitId())){
|
| | | resultVO.setMsg("所属安全风险分析单元");
|
| | | return resultVO;
|