|
|
@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.digiwin.app.service.DWEAIResult; |
|
|
|
import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; |
|
|
|
import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; |
|
|
|
import com.digiwin.athena.app.ptc.infra.entity.ReceivablesDetailEntity; |
|
|
|
import com.digiwin.athena.app.ptc.infra.repository.CollectionDetailRepository; |
|
|
|
import com.digiwin.athena.app.ptc.infra.repository.ReceivablesDetailRepository; |
|
|
|
import com.digiwin.athena.app.ptc.infra.service.CollectionDetailService; |
|
|
|
import com.digiwin.athena.app.ptc.infra.service.ReceivablesDetailService; |
|
|
|
import com.digiwin.athena.opt.common.eai.service.AbsEAIService; |
|
|
|
import com.digiwin.athena.opt.common.security.SecurityUtil; |
|
|
|
import com.digiwin.athena.opt.common.util.DateUtils; |
|
|
@ -33,6 +35,10 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { |
|
|
|
@Resource |
|
|
|
private ReceivablesDetailRepository receivablesDetailRepository; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
private ReceivablesDetailService receivablesDetailService; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private CollectionDetailService collectionDetailService; |
|
|
|
|
|
|
@ -44,16 +50,16 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { |
|
|
|
|
|
|
|
|
|
|
|
//随机赋值list |
|
|
|
private List<CollectionDetailEntity> list = Arrays.asList( |
|
|
|
new CollectionDetailEntity("鼎捷A半导体有限公司","dj001","张三","186****9498"), |
|
|
|
new CollectionDetailEntity("鼎捷B半导体有限公司","dj002","李四","158****4794"), |
|
|
|
new CollectionDetailEntity("鼎捷C半导体有限公司","dj003","王五","150****9529"), |
|
|
|
new CollectionDetailEntity("鼎新A半导体有限公司","dj004","赵六","139****0530"), |
|
|
|
new CollectionDetailEntity("鼎新B半导体有限公司","dj005","陈七","136****5333"), |
|
|
|
new CollectionDetailEntity("鼎新C半导体有限公司","dj006","刘八","188****9299"), |
|
|
|
new CollectionDetailEntity("鼎华A半导体有限公司","dj007","韩九","130****3555"), |
|
|
|
new CollectionDetailEntity("鼎华B半导体有限公司","dj008","管十一","138****9999"), |
|
|
|
new CollectionDetailEntity("鼎华C半导体有限公司","dj009","谢十二","187****6160")); |
|
|
|
private List<ReceivablesDetailEntity> list = Arrays.asList( |
|
|
|
new ReceivablesDetailEntity("鼎捷A半导体有限公司","dj001","张三","186****9498"), |
|
|
|
new ReceivablesDetailEntity("鼎捷B半导体有限公司","dj002","李四","158****4794"), |
|
|
|
new ReceivablesDetailEntity("鼎捷C半导体有限公司","dj003","王五","150****9529"), |
|
|
|
new ReceivablesDetailEntity("鼎新A半导体有限公司","dj004","赵六","139****0530"), |
|
|
|
new ReceivablesDetailEntity("鼎新B半导体有限公司","dj005","陈七","136****5333"), |
|
|
|
new ReceivablesDetailEntity("鼎新C半导体有限公司","dj006","刘八","188****9299"), |
|
|
|
new ReceivablesDetailEntity("鼎华A半导体有限公司","dj007","韩九","130****3555"), |
|
|
|
new ReceivablesDetailEntity("鼎华B半导体有限公司","dj008","管十一","138****9999"), |
|
|
|
new ReceivablesDetailEntity("鼎华C半导体有限公司","dj009","谢十二","187****6160")); |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@ -76,28 +82,27 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { |
|
|
|
|
|
|
|
Random random = new Random(); |
|
|
|
//随机新增 |
|
|
|
for (CollectionDetailEntity collectionDetailEntity : this.list) { |
|
|
|
for (ReceivablesDetailEntity receivablesDetailEntity : this.list) { |
|
|
|
int randomNumber = random.nextInt(100); |
|
|
|
int nextInt = random.nextInt(30); |
|
|
|
int dayInt = random.nextInt(10); |
|
|
|
collectionDetailEntity.setReceivableNo("RE-"+DateUtils.currentTimeString()); |
|
|
|
collectionDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString()); |
|
|
|
collectionDetailEntity.setStatus("1"); |
|
|
|
collectionDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString()); |
|
|
|
collectionDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); |
|
|
|
collectionDetailEntity.setContractNo(UUID.randomUUID().toString()); |
|
|
|
collectionDetailEntity.setPriceTax(new BigDecimal(String.valueOf(randomNumber))); |
|
|
|
collectionDetailEntity.setQuantity(new BigDecimal(String.valueOf(nextInt))); |
|
|
|
collectionDetailEntity.setReceivableDate(org.apache.commons.lang.time.DateUtils.addDays(new Date(),dayInt)); |
|
|
|
collectionDetailEntity.setSalesmanAssistant("qcsupplierqcuser001"); |
|
|
|
collectionDetailEntity.setSalesmanBoss("Sp0001"); |
|
|
|
collectionDetailEntity.setSalesman("qcuser001"); |
|
|
|
collectionDetailEntity.setProduceBoss("Sp0002"); |
|
|
|
collectionDetailEntity.setWorkNo("work-"+DateUtils.currentTimeString()); |
|
|
|
collectionDetailEntity.setOverdueDays(String.valueOf(DateUtils.getDayInterval(new Date(),collectionDetailEntity.getReceivableDate()))); |
|
|
|
receivablesDetailEntity.setReceivableNo("RE-"+DateUtils.currentTimeString()); |
|
|
|
receivablesDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString()); |
|
|
|
receivablesDetailEntity.setStatus("1"); |
|
|
|
receivablesDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString()); |
|
|
|
receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); |
|
|
|
receivablesDetailEntity.setPriceTax(new BigDecimal(String.valueOf(randomNumber))); |
|
|
|
receivablesDetailEntity.setQuantity(new BigDecimal(String.valueOf(nextInt))); |
|
|
|
receivablesDetailEntity.setReceivableDate(org.apache.commons.lang.time.DateUtils.addDays(new Date(),dayInt)); |
|
|
|
receivablesDetailEntity.setSalesmanAssistant("qcsupplierqcuser001"); |
|
|
|
receivablesDetailEntity.setSalesmanBoss("Sp0001"); |
|
|
|
receivablesDetailEntity.setSalesman("qcuser001"); |
|
|
|
receivablesDetailEntity.setProduceBoss("Sp0002"); |
|
|
|
receivablesDetailEntity.setWorkNo("work-"+DateUtils.currentTimeString()); |
|
|
|
receivablesDetailEntity.setOverdueDays(String.valueOf(DateUtils.getDayInterval(new Date(),receivablesDetailEntity.getReceivableDate()))); |
|
|
|
} |
|
|
|
|
|
|
|
collectionDetailService.saveBatch(this.list); |
|
|
|
receivablesDetailService.saveBatch(this.list); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|