zhangherong
2025-07-10 c15c980814508369fcbb2dbfcfb53fe95688e005
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java
@@ -14,15 +14,18 @@
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;
@@ -56,6 +59,10 @@
    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) {
@@ -127,18 +134,48 @@
        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())) {