Browse Source

制造单编号优化

guq 7 years ago
parent
commit
10b07251ef

+ 13 - 0
applications/document/document-server/src/main/resources/config/application-dev.yml

@@ -0,0 +1,13 @@
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health
+    status-page-url-path: /actuator/info
+    prefer-ip-address: true
+    metadata-map:
+      user.name: ${spring.security.user.name}
+      user.password: ${spring.security.user.password}
+  client:
+    registryFetchIntervalSeconds: 5
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/

+ 9 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/MakeListDTO.java

@@ -16,6 +16,7 @@ public class MakeListDTO extends CommonBaseDTO implements Serializable {
 
     private Make main;
     private List<MakeMaterial> items;
+    private boolean codeModified;
 
     public Make getMain() {
         return main;
@@ -40,4 +41,12 @@ public class MakeListDTO extends CommonBaseDTO implements Serializable {
 
     public MakeListDTO() {
     }
+
+    public boolean isCodeModified() {
+        return codeModified;
+    }
+
+    public void setCodeModified(boolean codeModified) {
+        this.codeModified = codeModified;
+    }
 }

+ 5 - 2
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java

@@ -96,7 +96,11 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
         Make make = makeListDTO.getMain();
         Long ma_id = make.getId();
         List<MakeMaterial> makeMaterialList = makeListDTO.getItems();
-        String code = pushMaxnubmer(make.getMa_code(), make.getId());
+        String code = make.getMa_code();
+        if (makeListDTO.isCodeModified()) {
+             code = pushMaxnubmer(code, make.getId());
+        }
+        make.setMa_code(code);
         DocBaseDTO docBaseDTO = null;
         //校验组合件和子件不允许相同
         if (makeMaterialList.size() > 0){
@@ -111,7 +115,6 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             //保存主表
             make.setCompanyId(BaseContextHolder.getCompanyId());
             make.setCreateTime(new Date());
-            make.setMa_code(code);
             getMapper().insertSelective(make);
             ma_id = make.getId();
             //录入人

+ 13 - 0
applications/storage/storage-server/src/main/resources/config/application-dev.yml

@@ -0,0 +1,13 @@
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health
+    status-page-url-path: /actuator/info
+    prefer-ip-address: true
+    metadata-map:
+      user.name: ${spring.security.user.name}
+      user.password: ${spring.security.user.password}
+  client:
+    registryFetchIntervalSeconds: 5
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/