| | |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.EamTechnicalStatusEvaluationOrderEnum; |
| | | import org.jeecg.modules.eam.constant.HfTemplateCategoryEnum; |
| | | import org.jeecg.modules.eam.constant.OrderCreationMethodEnum; |
| | | import org.jeecg.modules.eam.entity.EamBaseHFCode; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusEvaluationOrder; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusEvaluationStandard; |
| | | import org.jeecg.modules.eam.mapper.EamTechnicalStatusEvaluationOrderMapper; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationOrderQuery; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationOrderRequest; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IEamTechnicalStatusEvaluationOrderDetailService; |
| | | import org.jeecg.modules.eam.service.IEamTechnicalStatusEvaluationOrderService; |
| | | import org.jeecg.modules.eam.service.*; |
| | | import org.jeecg.modules.system.entity.BaseFactory; |
| | | import org.jeecg.modules.system.entity.BaseFactoryUser; |
| | | import org.jeecg.modules.system.service.IBaseFactoryService; |
| | |
| | | private IEamEquipmentService equipmentService; |
| | | @Autowired |
| | | private ISysBusinessCodeRuleService businessCodeRuleService; |
| | | @Autowired |
| | | private IEamTechnicalStatusEvaluationStandardService standardService; |
| | | @Autowired |
| | | private IEamBaseHFCodeService hfCodeService; |
| | | |
| | | @Override |
| | | public IPage<EamTechnicalStatusEvaluationOrder> queryPageList(Page<EamTechnicalStatusEvaluationOrder> page, EamTechnicalStatusEvaluationOrderQuery query) { |
| | |
| | | if (equipment == null) { |
| | | throw new JeecgBootException("设å¤ä¸åå¨ï¼æ·»å 失败ï¼"); |
| | | } |
| | | EamTechnicalStatusEvaluationStandard standard = standardService.getById(request.getStandardId()); |
| | | if(standard == null) { |
| | | throw new JeecgBootException("ææ¯ç¶æé´å®è§èä¸åå¨ï¼æ·»å 失败ï¼"); |
| | | } |
| | | EamTechnicalStatusEvaluationOrder order = new EamTechnicalStatusEvaluationOrder(); |
| | | order.setOrderNum(request.getOrderNum()); |
| | | order.setEquipmentId(request.getEquipmentId()); |
| | | order.setStandardId(request.getStandardId()); |
| | | order.setEvaluationDate(request.getEvaluationDate()); |
| | | order.setEvaluator(request.getEvaluator()); |
| | | order.setRemark(request.getRemark()); |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.TECHNICAL_STATUS_EVALUATION_ORDER_CODE_RULE); |
| | | request.setOrderNum(codeSeq); |
| | | request.setCreationMethod(OrderCreationMethodEnum.MANUAL.name()); |
| | | //ç¶æåå§å |
| | | order.setEvaluationStatus(EamTechnicalStatusEvaluationOrderEnum.WAIT_EVALUATION.name()); |
| | | order.setCreationMethod(request.getCreationMethod()); |
| | | //å 餿 è®° |
| | | order.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | //ææ¯ç¶æé´å®è¡¨ |
| | | EamBaseHFCode eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.TECHNICAL_STATUS_EVALUATION.name()); |
| | | if(eamBaseHFCode == null) { |
| | | throw new JeecgBootException("æªé
ç½®ææ¯ç¶æé´å®è¡¨çHFç¼ç ï¼æ·»å 失败ï¼"); |
| | | } |
| | | order.setHfCodeA(eamBaseHFCode.getHfCode()); |
| | | //ææ¯ç¶æé´å®å®å
¨è£
ç½®æ£æ¥è¡¨ |
| | | eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.TECHNICAL_STATUS_EVALUATION_SAFETY_CHECK.name()); |
| | | if(eamBaseHFCode == null) { |
| | | throw new JeecgBootException("æªé
ç½®å®å
¨è£
ç½®æ£æ¥è¡¨çHFç¼ç ï¼æ·»å 失败ï¼"); |
| | | } |
| | | order.setHfCodeB(eamBaseHFCode.getHfCode()); |
| | | //ææ¯ç¶æé´å®å
¶ä»æ£æ¥è¡¨ |
| | | eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.TECHNICAL_STATUS_EVALUATION_OTHER_CHECK.name()); |
| | | if(eamBaseHFCode == null) { |
| | | throw new JeecgBootException("æªé
ç½®å
¶ä»æ£æ¥è¡¨çHFç¼ç ï¼æ·»å 失败ï¼"); |
| | | } |
| | | order.setHfCodeD(eamBaseHFCode.getHfCode()); |
| | | //ææ¯ç¶æé´å®è®¾å¤ç²¾åº¦æ£æ¥è¡¨ |
| | | eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.TECHNICAL_STATUS_EVALUATION_PRECISION_CHECK.name()); |
| | | if(eamBaseHFCode == null) { |
| | | throw new JeecgBootException("æªé
置设å¤ç²¾åº¦æ£æ¥è¡¨çHFç¼ç ï¼æ·»å 失败ï¼"); |
| | | } |
| | | order.setHfCodeC(eamBaseHFCode.getHfCode()); |
| | | this.getBaseMapper().insert(order); |
| | | //å¤çæç»æ°æ® |
| | | if (CollectionUtil.isNotEmpty(request.getTableDetailList())) { |