From 89b8f1af78b6fbe8c8a4a01053e4c75b48bc67d9 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期二, 08 七月 2025 17:27:10 +0800
Subject: [PATCH] 修改

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamMaintenanceStandardServiceImpl.java |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamMaintenanceStandardServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamMaintenanceStandardServiceImpl.java
index bead1bd..bd7f285 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamMaintenanceStandardServiceImpl.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamMaintenanceStandardServiceImpl.java
@@ -10,12 +10,8 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jeecg.weibo.exception.BusinessException;
-import liquibase.pro.packaged.R;
-import liquibase.pro.packaged.S;
-import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.apache.poi.xwpf.usermodel.*;
 import org.apache.shiro.SecurityUtils;
 import org.flowable.engine.TaskService;
@@ -24,10 +20,10 @@
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.modules.eam.base.entity.BaseFactory;
-import org.jeecg.modules.eam.base.entity.BaseFactoryUser;
-import org.jeecg.modules.eam.base.service.IBaseFactoryService;
-import org.jeecg.modules.eam.base.service.IBaseFactoryUserService;
+import org.jeecg.modules.system.entity.BaseFactory;
+import org.jeecg.modules.system.entity.BaseFactoryUser;
+import org.jeecg.modules.system.service.IBaseFactoryService;
+import org.jeecg.modules.system.service.IBaseFactoryUserService;
 import org.jeecg.modules.eam.constant.BusinessCodeConst;
 import org.jeecg.modules.eam.constant.EamMaintenanceStandardDetailCategory;
 import org.jeecg.modules.eam.constant.MaintenanceStandardStatusEnum;
@@ -251,6 +247,7 @@
         newEntity.setMaintenanceCategory(standardRequest.getMaintenanceCategory());
         newEntity.setMaintenancePeriod(standardRequest.getMaintenancePeriod());
         newEntity.setInitialDate(standardRequest.getInitialDate());
+        newEntity.setPeriodUnit(standardRequest.getPeriodUnit());
         newEntity.setStandardStatus(MaintenanceStandardStatusEnum.WAIT_SUBMIT.name());
         //鐗堟湰閫掑
         //鑾峰彇鏁板瓧
@@ -373,7 +370,7 @@
             FlowMyBusiness flowMyBusiness = businessList.get(0);
             EamEquipment eamEquipment=eamEquipmentService.getById(maintenanceStandard.getEquipmentId());
             BaseFactory baseFactory=baseFactoryService.getOne(new QueryWrapper<BaseFactory>().eq("org_code", eamEquipment.getFactoryOrgCode()));
-            List<UserSelector> userSelectorList=sysUserService.selectOperatorFactoryList(eamEquipment.getEquipmentCode(),baseFactory.getId(), BusinessCodeConst.PCR0007);
+            List<UserSelector> userSelectorList=sysUserService.selectOperatorFactoryList(eamEquipment.getEquipmentCode(),baseFactory.getId(), BusinessCodeConst.PCR0008);
             if (!CollectionUtils.isEmpty(userSelectorList)) {
                 List<String> usernameList=userSelectorList.stream().map(UserSelector::getUsername).collect(Collectors.toList());
                 flowMyBusiness.setTodoUsers(JSON.toJSONString(usernameList));
@@ -453,7 +450,7 @@
                         EamMaintenanceStandard maintenanceStandard=this.getById(eamMaintenanceStandardVo.getDataId());
                         EamEquipment eamEquipment=eamEquipmentService.getById(maintenanceStandard.getEquipmentId());
                         BaseFactory baseFactory=baseFactoryService.getOne(new QueryWrapper<BaseFactory>().eq("org_code", eamEquipment.getFactoryOrgCode()));
-                        List<UserSelector> userSelectorList=sysUserService.selectOperatorFactoryList(eamEquipment.getEquipmentCode(),baseFactory.getId(), BusinessCodeConst.PCR0008);
+                        List<UserSelector> userSelectorList=sysUserService.selectOperatorFactoryList(eamEquipment.getEquipmentCode(),baseFactory.getId(), BusinessCodeConst.PCR0009);
                         if (!CollectionUtils.isEmpty(userSelectorList)) {
                             List<String> usernameList=userSelectorList.stream().map(UserSelector::getUsername).collect(Collectors.toList());
                             newflowMyBusiness.setTodoUsers(JSON.toJSONString(usernameList));
@@ -563,6 +560,10 @@
             EamMaintenanceStandard eamMaintenanceStandard = extractDeviceInfo(sheet);
             if (eamMaintenanceStandard == null) {
                 return Result.error("璁惧淇℃伅鎻愬彇澶辫触");
+            }else {
+                if (eamMaintenanceStandard.getEquipmentId() == null) {
+                    return Result.error("璁惧淇℃伅鎻愬彇澶辫触");
+                }
             }
 
             eamMaintenanceStandard.setStandardName(name);
@@ -649,6 +650,7 @@
 
         EamMaintenanceStandard standard = new EamMaintenanceStandard();
         standard.setEquipmentName(extractField(headerText, "璁惧鍚嶇О[:锛歖\\s*(\\S+)"));
+        standard.setEquipmentCode(extractField(headerText, "缁熶竴缂栧彿[:锛歖\\s*(\\S+)"));
 
 
         // 鏃ユ湡澶勭悊
@@ -1144,7 +1146,7 @@
         standard.setStandardName(filename)
                 .setInitialDate(new Date())
                 .setStandardStatus(MaintenanceStandardStatusEnum.START.name())
-                .setStandardVersion("v1.0")
+                .setStandardVersion("v" + CommonConstant.OPERATE_TYPE_1)
                 .setDelFlag(0)
                 .setStandardCode(businessCodeRuleService.generateBusinessCodeSeq(
                         BusinessCodeConst.MAINTENANCE_STANDARD_CODE_RULE

--
Gitblit v1.9.3