Browse Source

Merge branch 'master' of http://106.15.38.8:3000/yaoyq/imcs-yj-be

oyq28 3 years ago
parent
commit
e9237a3018

+ 5 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/service/impl/BomProcedureVersionServiceImpl.java

@@ -315,12 +315,15 @@ public class BomProcedureVersionServiceImpl extends SuperServiceImpl<BomProcedur
 
 
     private boolean checkSameName(List<Map<String,Object>> procedureList){
     private boolean checkSameName(List<Map<String,Object>> procedureList){
         if(CollectionUtil.isNotEmpty(procedureList)){
         if(CollectionUtil.isNotEmpty(procedureList)){
-            Map<String,String> map = procedureList.stream().collect(Collectors.toMap(t->t.get("no").toString(), t->t.get("no").toString()));
+            Map<String,String> map = procedureList.stream().collect(Collectors.toMap(t->t.get("no").toString(), t->t.get("no").toString(),(k1,k2)->k1));
             if(map.size()<procedureList.size()){
             if(map.size()<procedureList.size()){
                 return true;
                 return true;
             }
             }
 
 
-            Map<String,String> map1 = procedureList.stream().collect(Collectors.toMap(t->t.get("name").toString(), t->t.get("name").toString()));
+            Map<String,String> map1 = procedureList.stream().collect(Collectors.toMap(t->t.get("name").toString(), t->t.get("name").toString(),(k1,k2)->k1));
+            if(map1.size()<procedureList.size()){
+                return true;
+            }
         }
         }
         return false;
         return false;
     }
     }

+ 16 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/ZZoneServiceImpl.java

@@ -25,6 +25,8 @@ import com.github.zuihou.database.mybatis.auth.DataScope;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.tenant.dao.ProductionresourceviewMapper;
 import com.github.zuihou.tenant.dao.ProductionresourceviewMapper;
+import com.github.zuihou.tenant.dto.CodeRuleSaveDTO;
+import com.github.zuihou.tenant.entity.CodeRule;
 import com.github.zuihou.tenant.service.CodeRuleService;
 import com.github.zuihou.tenant.service.CodeRuleService;
 import com.github.zuihou.tenant.service.ProductionresourceService;
 import com.github.zuihou.tenant.service.ProductionresourceService;
 import com.github.zuihou.utils.BeanPlusUtil;
 import com.github.zuihou.utils.BeanPlusUtil;
@@ -98,6 +100,9 @@ public class ZZoneServiceImpl extends SuperServiceImpl<ZZoneMapper, ZZone> imple
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public ZZone save(ZZoneSaveDTO data) {
     public ZZone save(ZZoneSaveDTO data) {
+        isFalse(check(data.getName()), "该产线已存在,请重新输入");
+
+
         ZZone zZone = BeanPlusUtil.toBean(data, ZZone.class);
         ZZone zZone = BeanPlusUtil.toBean(data, ZZone.class);
         //根据编码规则
         //根据编码规则
         String no = codeRuleService.getBillCode(CodeRuleModule.CODE_RULE_ZZONE);
         String no = codeRuleService.getBillCode(CodeRuleModule.CODE_RULE_ZZONE);
@@ -107,10 +112,21 @@ public class ZZoneServiceImpl extends SuperServiceImpl<ZZoneMapper, ZZone> imple
         return zZone;
         return zZone;
     }
     }
 
 
+
+
+    public boolean check(String name) {
+        return super.count(Wraps.<ZZone>lbQ().eq(ZZone::getName,name)) > 0;
+    }
+
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public ZZone update(ZZoneUpdateDTO data) {
     public ZZone update(ZZoneUpdateDTO data) {
         ZZone zZone = BeanPlusUtil.toBean(data, ZZone.class);
         ZZone zZone = BeanPlusUtil.toBean(data, ZZone.class);
+        ZZone oriZone = baseMapper.selectById(zZone.getId());
+        if(!zZone.getName().equals(oriZone.getName())){//修改过名称
+            isFalse(check(data.getName()), "该产线已存在,请重新输入");
+        }
+
         updateById(zZone);
         updateById(zZone);
 
 
         return zZone;
         return zZone;

+ 2 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionReadyCenter/MToolClampController.java

@@ -53,6 +53,8 @@ public class MToolClampController extends SuperController<MToolClampService, Lon
 
 
         MToolClamp module = BeanUtil.toBean(data, MToolClamp.class);
         MToolClamp module = BeanUtil.toBean(data, MToolClamp.class);
         wrapper.like(MToolClamp::getName, module.getName())
         wrapper.like(MToolClamp::getName, module.getName())
+                .eq(MToolClamp::getNo, module.getNo() )
+                .eq(MToolClamp::getMaterialType, module.getMaterialType() )
                 .eq(MToolClamp::getStatus, module.getStatus())
                 .eq(MToolClamp::getStatus, module.getStatus())
                 .eq(MToolClamp::getBrand, module.getBrand())
                 .eq(MToolClamp::getBrand, module.getBrand())
                 .eq(MToolClamp::getCategory, module.getCategory() )
                 .eq(MToolClamp::getCategory, module.getCategory() )

+ 1 - 1
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/dto/MToolClampPageDTO.java

@@ -91,7 +91,7 @@ public class MToolClampPageDTO implements Serializable {
      * 物料类型
      * 物料类型
      */
      */
     @ApiModelProperty(value = "物料类型")
     @ApiModelProperty(value = "物料类型")
-    private RemoteData<String, String> materialType;
+    private String materialType;
 
 
     @ApiModelProperty(value = "同步状态 0:未同步 1:已同步")
     @ApiModelProperty(value = "同步状态 0:未同步 1:已同步")
     private Integer synFlag;
     private Integer synFlag;

+ 3 - 3
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/entity/MToolClamp.java

@@ -127,11 +127,11 @@ public class MToolClamp extends Entity<Long> {
      * 物料类型
      * 物料类型
      */
      */
     @ApiModelProperty(value = "物料类型")
     @ApiModelProperty(value = "物料类型")
-    @Length(max = 4, message = "物料类型长度不能超过4")
+    @Length(max = 128, message = "物料类型长度不能超过128")
     @InjectionField(api = DICTIONARY_ITEM_CLASS, method = DICTIONARY_ITEM_METHOD, dictType = DictionaryType.MATERIAL_TYPE)
     @InjectionField(api = DICTIONARY_ITEM_CLASS, method = DICTIONARY_ITEM_METHOD, dictType = DictionaryType.MATERIAL_TYPE)
     @TableField(value = "material_type", condition = LIKE)
     @TableField(value = "material_type", condition = LIKE)
     @Excel(name = "物料类型")
     @Excel(name = "物料类型")
-    private RemoteData<String, String> materialType;
+    private String materialType;
 
 
     /**
     /**
      * 同步状态 0:未同步 1:已同步
      * 同步状态 0:未同步 1:已同步
@@ -145,7 +145,7 @@ public class MToolClamp extends Entity<Long> {
     @Builder
     @Builder
     public MToolClamp(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser,
     public MToolClamp(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser,
                       String no, String name, String status, String model, RemoteData<String, String> category, String mapNo, int period,int expiryDate,
                       String no, String name, String status, String model, RemoteData<String, String> category, String mapNo, int period,int expiryDate,
-                      int num, String joinDate, RemoteData<String, String> brand, RemoteData<String, String> materialType,int synFlag) {
+                      int num, String joinDate, RemoteData<String, String> brand, String materialType,int synFlag) {
         this.id = id;
         this.id = id;
         this.createTime = createTime;
         this.createTime = createTime;
         this.createUser = createUser;
         this.createUser = createUser;