From e715943ca44113e2e81990740050b0a5e203d051 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 20:21:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E6=97=B6=E5=90=AB?= =?UTF-8?q?=E7=A8=8E=E9=87=91=E9=A2=9D=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production/ProductionCreateEAIService.java | 2 +- .../ReceivablesInitialCreateEAIService.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) 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");