diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionCreateEAIService.java index 583f103..7cdfbb9 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionCreateEAIService.java @@ -68,7 +68,7 @@ public class ProductionCreateEAIService extends AbsEAIService { Random random = new Random(); //默认赋值 for (ProductionDetailsEntity productionDetailsEntity : productionDetailsEntities) { - int randomNumber = random.nextInt(3); + int randomNumber = random.nextInt(2)+1; productionDetailsEntity.setFactoryNo(this.list.get(randomNumber).getFactoryNo()); productionDetailsEntity.setFactoryName(this.list.get(randomNumber).getFactoryName()); productionDetailsEntity.setProductionManagementPerson(this.list.get(randomNumber).getProductionManagementPerson()); diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java index 57acce1..0ca35e5 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java @@ -1,6 +1,5 @@ package com.digiwin.athena.app.ptc.service.receivables; -import com.alibaba.fastjson.TypeReference; import com.alibaba.nacos.common.utils.CollectionUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.digiwin.app.service.DWEAIResult; @@ -72,20 +71,20 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(CollectionDetailEntity::getTenantSid,tenantSid); lmq.eq(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue()); - List list = collectionDetailService.list(lmq); + List collectionDetailEntities = collectionDetailService.list(lmq); //删除应收数据 - if (CollectionUtils.isNotEmpty(list)){ - receivablesDetailRepository.deleteBatch(list,tenantSid); + if (CollectionUtils.isNotEmpty(collectionDetailEntities)){ + receivablesDetailRepository.deleteBatch(collectionDetailEntities,tenantSid); } Random random = new Random(); //随机新增 for (ReceivablesDetailEntity receivablesDetailEntity : this.list) { - int randomNumber = random.nextInt(100); - int nextInt = random.nextInt(30); - int dayInt = random.nextInt(10); + int randomNumber = random.nextInt(100)+1; + int nextInt = random.nextInt(30)+1; + int dayInt = random.nextInt(10)+1; receivablesDetailEntity.setReceivableNo("RE-"+DateUtils.currentTimeString()); receivablesDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString()); receivablesDetailEntity.setStatus("1"); @@ -93,6 +92,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); receivablesDetailEntity.setPriceTax(new BigDecimal(String.valueOf(randomNumber))); receivablesDetailEntity.setQuantity(new BigDecimal(String.valueOf(nextInt))); + receivablesDetailEntity.setAmountTax(receivablesDetailEntity.getPriceTax().multiply(receivablesDetailEntity.getQuantity())); receivablesDetailEntity.setReceivableDate(org.apache.commons.lang.time.DateUtils.addDays(new Date(),dayInt)); receivablesDetailEntity.setSalesmanAssistant("qcsupplierqcuser001"); receivablesDetailEntity.setSalesmanBoss("Sp0001");