Browse Source

feat:代码优化

master
郑贵龙 1 year ago
parent
commit
98f0843320
2 changed files with 5 additions and 6 deletions
  1. +4
    -5
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionCreateEAIService.java
  2. +1
    -1
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java

+ 4
- 5
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionCreateEAIService.java View File

@ -43,7 +43,7 @@ public class ProductionCreateEAIService extends AbsEAIService {
}
//随机赋值list
List<ProductionDetailsEntity> list = Arrays.asList(
private List<ProductionDetailsEntity> list = Arrays.asList(
new ProductionDetailsEntity("001", "一号工厂", "一号工厂刘晓鹏"),
new ProductionDetailsEntity("002", "二号工厂", "二号工厂饶文豪"),
new ProductionDetailsEntity("003", "三号工厂", "三号工厂卢人辅"));
@ -65,10 +65,9 @@ public class ProductionCreateEAIService extends AbsEAIService {
Random random = new Random();
//默认赋值
for (ProductionDetailsEntity productionDetailsEntity : productionDetailsEntities) {
Random random = new Random();
int randomNumber = random.nextInt(3);
productionDetailsEntity.setFactoryNo(this.list.get(randomNumber).getFactoryNo());
productionDetailsEntity.setFactoryName(this.list.get(randomNumber).getFactoryName());
@ -77,7 +76,7 @@ public class ProductionCreateEAIService extends AbsEAIService {
productionDetailsEntity.setProduceBoss("23467345221");
productionDetailsEntity.setProductionStatus(TabStatusEnums.PENDING.getValue().toString());
productionDetailsEntity.setNature(String.valueOf(randomNumber));
String batchNo = cteateBatchNo();
String batchNo = createBatchNo();
productionDetailsEntity.setBatchNo("MMDD-"+batchNo);
//预计产量赋值
if (CollectionUtils.isNotEmpty(list)) {
@ -98,7 +97,7 @@ public class ProductionCreateEAIService extends AbsEAIService {
return buildOK();
}
private String cteateBatchNo(){
private String createBatchNo(){
StringBuffer sb = new StringBuffer();
Long batchNo;
if (redisUtil.getRedisTemplate().hasKey(ProductionUtil.KEY)) {


+ 1
- 1
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java View File

@ -38,7 +38,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService {
//随机赋值list
List<CollectionDetailEntity> list = Arrays.asList(
private List<CollectionDetailEntity> list = Arrays.asList(
new CollectionDetailEntity("鼎捷A半导体有限公司","dj001","张三","186****9498"),
new CollectionDetailEntity("鼎捷B半导体有限公司","dj002","李四","158****4794"),
new CollectionDetailEntity("鼎捷C半导体有限公司","dj003","王五","150****9529"),


Loading…
Cancel
Save