|
@ -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"); |
|
|