| | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.constant.DataBaseConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog; |
| | |
| | | private IEamRepairOrderService iEamRepairOrderService; |
| | | @Autowired |
| | | private ISysBusinessCodeRuleService businessCodeRuleService; |
| | | @Autowired |
| | | private IEamReportThreeNoSpareService eamReportThreeNoSpareService; |
| | | @Autowired |
| | | private IEamBaseHFCodeService hfCodeService; |
| | | /** |
| | | * 分页列表 |
| | | * |
| | |
| | | eamReportProductHazards.setReportId(eamReportRepair.getId()); |
| | | eamReportProductHazards.setDelFlag(Integer.valueOf(CommonConstant.DEFAULT_0)); |
| | | eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.PENDING_SUBMIT.name()); |
| | | EamBaseHFCode eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.REPORT_PRODUCT_HAZARDS.name()); |
| | | if (eamBaseHFCode == null) { |
| | | throw new JeecgBootException("未配置产品安全隐患确认的HF编码,添加失败!"); |
| | | } |
| | | eamReportProductHazards.setHfCode(eamBaseHFCode.getHfCode()); |
| | | iEamReportProductHazardsService.save(eamReportProductHazards); |
| | | } |
| | | if (StrUtil.isNotEmpty(eamReportRepair.getIsAccidentsRegister())&&("1").equals(eamReportRepair.getIsAccidentsRegister())) { |
| | | //添加设备事故登记表 |
| | | EamReportAccidentsRegister eamReportAccidentsRegister = new EamReportAccidentsRegister(); |
| | | BeanUtils.copyProperties(eamReportRepairRequest, eamReportAccidentsRegister); |
| | | eamReportAccidentsRegister.setId(null); |
| | | eamReportAccidentsRegister.setReportId(eamReportRepair.getId()); |
| | | eamReportAccidentsRegister.setDelFlag(Integer.valueOf(CommonConstant.DEFAULT_0)); |
| | | eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.PENDING_SUBMIT.name()); |
| | | EamBaseHFCode eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.REPORT_ACCIDENTS_REGISTER.name()); |
| | | if (eamBaseHFCode == null) { |
| | | throw new JeecgBootException("未配置设备事故登记表的HF编码,添加失败!"); |
| | | } |
| | | eamReportAccidentsRegister.setHfCode(eamBaseHFCode.getHfCode()); |
| | | iEamReportAccidentsRegisterService.save(eamReportAccidentsRegister); |
| | | //生成三不原则 |
| | | EamReportThreeNoSpare eamReportThreeNoSpare = new EamReportThreeNoSpare(); |
| | | BeanUtils.copyProperties(eamReportRepairRequest, eamReportThreeNoSpare); |
| | | eamReportThreeNoSpare.setId(null); |
| | | eamReportThreeNoSpare.setReportId(eamReportRepair.getId()); |
| | | eamReportThreeNoSpare.setPreventionMeasures(eamReportAccidentsRegister.getTakeSteps()); |
| | | eamReportThreeNoSpare.setSubmitStatus(EamReportThreeNoSpareEnum.PENDING_SUBMIT.name()); |
| | | eamReportThreeNoSpare.setDelFlag(Integer.valueOf(CommonConstant.DEFAULT_0)); |
| | | EamBaseHFCode threeHfCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.REPORT_THREE_NO_SPARE.name()); |
| | | if (threeHfCode == null) { |
| | | throw new JeecgBootException("未配置三不放过原则表的HF编码,添加失败!"); |
| | | } |
| | | eamReportThreeNoSpare.setHfCode(threeHfCode.getHfCode()); |
| | | eamReportThreeNoSpareService.save(eamReportThreeNoSpare); |
| | | } |
| | | //生成维修工单 |
| | | EamRepairOrder eamRepairOrder=new EamRepairOrder(); |