Browse Source

feat:应收日期生成规则调整

master
郑贵龙 1 year ago
parent
commit
52c60b3d54
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java

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

@ -82,11 +82,13 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService {
Random random = new Random(); Random random = new Random();
List<Integer> integerList = Arrays.asList(0,-1,-7);
//随机新增 //随机新增
for (ReceivablesDetailEntity receivablesDetailEntity : list) { for (ReceivablesDetailEntity receivablesDetailEntity : list) {
int randomNumber = random.nextInt(100)+1; int randomNumber = random.nextInt(100)+1;
int nextInt = random.nextInt(30)+1; int nextInt = random.nextInt(30)+1;
int dayInt = random.nextInt(10)+1;
int dateInt = random.nextInt(3);
//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");
@ -95,7 +97,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService {
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.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(),integerList.get(dateInt)));
receivablesDetailEntity.setSalesmanAssistant("qcsupplierqcuser001"); receivablesDetailEntity.setSalesmanAssistant("qcsupplierqcuser001");
receivablesDetailEntity.setSalesmanBoss("Sp0001"); receivablesDetailEntity.setSalesmanBoss("Sp0001");
receivablesDetailEntity.setSalesman("qcuser001"); receivablesDetailEntity.setSalesman("qcuser001");
@ -106,8 +108,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService {
receivablesDetailService.saveBatch(list); receivablesDetailService.saveBatch(list);
return buildOK(); return buildOK();
} }
} }

Loading…
Cancel
Save