Browse Source

feat:新增时含税金额赋值

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

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

@ -68,7 +68,7 @@ public class ProductionCreateEAIService extends AbsEAIService {
Random random = new Random(); Random random = new Random();
//默认赋值 //默认赋值
for (ProductionDetailsEntity productionDetailsEntity : productionDetailsEntities) { for (ProductionDetailsEntity productionDetailsEntity : productionDetailsEntities) {
int randomNumber = random.nextInt(3);
int randomNumber = random.nextInt(2)+1;
productionDetailsEntity.setFactoryNo(this.list.get(randomNumber).getFactoryNo()); productionDetailsEntity.setFactoryNo(this.list.get(randomNumber).getFactoryNo());
productionDetailsEntity.setFactoryName(this.list.get(randomNumber).getFactoryName()); productionDetailsEntity.setFactoryName(this.list.get(randomNumber).getFactoryName());
productionDetailsEntity.setProductionManagementPerson(this.list.get(randomNumber).getProductionManagementPerson()); productionDetailsEntity.setProductionManagementPerson(this.list.get(randomNumber).getProductionManagementPerson());


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

@ -1,6 +1,5 @@
package com.digiwin.athena.app.ptc.service.receivables; package com.digiwin.athena.app.ptc.service.receivables;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.common.utils.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.digiwin.app.service.DWEAIResult; import com.digiwin.app.service.DWEAIResult;
@ -72,20 +71,20 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService {
LambdaQueryWrapper<CollectionDetailEntity> lmq = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CollectionDetailEntity> lmq = new LambdaQueryWrapper<>();
lmq.eq(CollectionDetailEntity::getTenantSid,tenantSid); lmq.eq(CollectionDetailEntity::getTenantSid,tenantSid);
lmq.eq(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue()); lmq.eq(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue());
List<CollectionDetailEntity> list = collectionDetailService.list(lmq);
List<CollectionDetailEntity> collectionDetailEntities = collectionDetailService.list(lmq);
//删除应收数据 //删除应收数据
if (CollectionUtils.isNotEmpty(list)){
receivablesDetailRepository.deleteBatch(list,tenantSid);
if (CollectionUtils.isNotEmpty(collectionDetailEntities)){
receivablesDetailRepository.deleteBatch(collectionDetailEntities,tenantSid);
} }
Random random = new Random(); Random random = new Random();
//随机新增 //随机新增
for (ReceivablesDetailEntity receivablesDetailEntity : this.list) { 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("RE-"+DateUtils.currentTimeString());
receivablesDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString()); receivablesDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString());
receivablesDetailEntity.setStatus("1"); receivablesDetailEntity.setStatus("1");
@ -93,6 +92,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService {
receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString());
receivablesDetailEntity.setPriceTax(new BigDecimal(String.valueOf(randomNumber))); receivablesDetailEntity.setPriceTax(new BigDecimal(String.valueOf(randomNumber)));
receivablesDetailEntity.setQuantity(new BigDecimal(String.valueOf(nextInt))); 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.setReceivableDate(org.apache.commons.lang.time.DateUtils.addDays(new Date(),dayInt));
receivablesDetailEntity.setSalesmanAssistant("qcsupplierqcuser001"); receivablesDetailEntity.setSalesmanAssistant("qcsupplierqcuser001");
receivablesDetailEntity.setSalesmanBoss("Sp0001"); receivablesDetailEntity.setSalesmanBoss("Sp0001");


Loading…
Cancel
Save