Browse Source

Merge branch 'sprint/S3' into release/S3

master
郑贵龙 1 year ago
parent
commit
1682fc0b8c
3 changed files with 84 additions and 24 deletions
  1. +16
    -2
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ReceivablesDetailEntity.java
  2. +62
    -22
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java
  3. +6
    -0
      doc/sql/app-20230912-ddl.sql

+ 16
- 2
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ReceivablesDetailEntity.java View File

@ -121,14 +121,28 @@ public class ReceivablesDetailEntity extends BaseMgrEntity<ReceivablesDetailEnti
private String produceBoss; private String produceBoss;
/** 限制金额 */ /** 限制金额 */
@TableField(exist = false)
@SerializedName(value = "limit_amount") @SerializedName(value = "limit_amount")
private BigDecimal limitAmount; private BigDecimal limitAmount;
public ReceivablesDetailEntity(String customerName, String customerNo, String contacts, String contactInformation) {
/** 邮箱 */
@SerializedName(value = "email")
private String email;
public ReceivablesDetailEntity(String customerName, String customerNo, String contacts, String contactInformation, BigDecimal priceTax, BigDecimal quantity, BigDecimal amountTax, BigDecimal limitAmount, Date receivableDate) {
this.customerNo = customerNo; this.customerNo = customerNo;
this.customerName = customerName; this.customerName = customerName;
this.contacts = contacts; this.contacts = contacts;
this.contactInformation = contactInformation; this.contactInformation = contactInformation;
this.priceTax = priceTax;
this.quantity = quantity;
this.amountTax = amountTax;
this.limitAmount = limitAmount;
this.receivableDate = receivableDate;
}
public ReceivablesDetailEntity(String skuCode, String skuName, String skuSpec) {
this.skuCode = skuCode;
this.skuName = skuName;
this.skuSpec = skuSpec;
} }
} }

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

@ -49,22 +49,65 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService {
/** 品号品名规格赋值list*/
private List<ReceivablesDetailEntity> skuList = Arrays.asList(
new ReceivablesDetailEntity("24080Y100231","曲股组件(右)","仅前端钻接头孔"),
new ReceivablesDetailEntity("24070Y100230","直股组件(右)","仅前端钻接头孔"),
new ReceivablesDetailEntity("24100Y400023","可动心轨辙叉组件(右)","20992mm;无砟道床"),
new ReceivablesDetailEntity("220500100187","导轨","60kg/m,16193mm(两端均钻接头孔)"),
new ReceivablesDetailEntity("2111H0320001","60AT1-75单头锻压件(右轨)","U75V,在线淬火轨"),
new ReceivablesDetailEntity("24020Z100018","曲基本轨-组装(左)","60kg/m,(600+16792+600)mm"),
new ReceivablesDetailEntity("22040Y200001","曲线尖轨(右)","60AT1,21450mm"),
new ReceivablesDetailEntity("10940000124","手动扳道器-库改","60AT1,21450mm"),
new ReceivablesDetailEntity("3011040Y5014","60kg/m钢轨18号可动心轨单开道岔(右)","60-18"),
new ReceivablesDetailEntity("3011010Y1037","60kg/m钢轨9号单开道岔(右)","60-9(详见:营销2022261号-排20220800083号;顺坡垫板设置2处)(试车线、#64)"),
new ReceivablesDetailEntity("230300100008","胶接轨","60kg/m,20913(7809+8+13096)mm"),
new ReceivablesDetailEntity("220600200004","侧向护轨","50kg/m,4800mm"),
new ReceivablesDetailEntity("241200100015","叉心组件","直股后加长1800mm,不钻接头孔;曲股不加长,钻接头孔"),
new ReceivablesDetailEntity("2112H0610001","60AT1-模锻翼轨单头锻压件(左轨)","U71Mn,在线淬火轨"),
new ReceivablesDetailEntity("230109100004","序号9活动心轨(焊接轨件)","60kg/m+60AT1,15020(10737+4283)mm"),
new ReceivablesDetailEntity("221700200001","左侧尖轨","50AT1,6450mm(按图纸要求钻孔)")
);
@Override @Override
public DWEAIResult execute(Map<String, String> headers, String messageBody) throws Exception { public DWEAIResult execute(Map<String, String> headers, String messageBody) throws Exception {
//生成6个随机且不重复的随机整数
Random random = new Random();
HashSet<Integer> set = new HashSet<>();
int count = 0;
while (count < 6) {
int num = random.nextInt(27);
if (!set.contains(num)) {
set.add(num);
count++;
}
}
List<Integer> indexList = new ArrayList<>(set);
//客户名称随机生成
String[] abcArray = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
Date date = new Date();
Date date1 = org.apache.commons.lang.time.DateUtils.addDays(date, -1);
Date date2 = org.apache.commons.lang.time.DateUtils.addDays(date, -7);
//随机赋值list //随机赋值list
List<ReceivablesDetailEntity> list = Arrays.asList( 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"));
new ReceivablesDetailEntity("鼎捷"+abcArray[indexList.get(0)]+"半导体有限公司",abcArray[indexList.get(0)]+indexList.get(0),"张三","186****9498",new BigDecimal("10000"),new BigDecimal("135"),new BigDecimal("1350000"),new BigDecimal("20000000"),date),
new ReceivablesDetailEntity("鼎捷"+abcArray[indexList.get(0)]+"半导体有限公司",abcArray[indexList.get(0)]+indexList.get(0),"李四","158****4794",new BigDecimal("800"),new BigDecimal("2500"),new BigDecimal("2000000"),new BigDecimal("20000000"),date1),
new ReceivablesDetailEntity("鼎捷"+abcArray[indexList.get(0)]+"半导体有限公司",abcArray[indexList.get(0)]+indexList.get(0),"王五","150****9529",new BigDecimal("50000"),new BigDecimal("70"),new BigDecimal("3500000"),new BigDecimal("20000000"),date2),
new ReceivablesDetailEntity("鼎新"+abcArray[indexList.get(1)]+"半导体有限公司",abcArray[indexList.get(1)]+indexList.get(1),"赵六","139****0530",new BigDecimal("250000"),new BigDecimal("26"),new BigDecimal("6500000"),new BigDecimal("20000000"),date1),
new ReceivablesDetailEntity("鼎新"+abcArray[indexList.get(1)]+"半导体有限公司",abcArray[indexList.get(1)]+indexList.get(1),"陈七","136****5333",new BigDecimal("2500"),new BigDecimal("3400"),new BigDecimal("8500000"),new BigDecimal("20000000"),date2),
new ReceivablesDetailEntity("鼎新"+abcArray[indexList.get(2)]+"半导体有限公司",abcArray[indexList.get(2)]+indexList.get(2),"刘八","188****9299",new BigDecimal("10000"),new BigDecimal("20"),new BigDecimal("200000"),new BigDecimal("5000000"),date1),
new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(2)]+"半导体有限公司",abcArray[indexList.get(2)]+indexList.get(2),"韩九","130****3555",new BigDecimal("360"),new BigDecimal("5000"),new BigDecimal("1800000"),new BigDecimal("5000000"),date2),
new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(3)]+"半导体有限公司",abcArray[indexList.get(3)]+indexList.get(3),"管十一","138****9999",new BigDecimal("2500"),new BigDecimal("800"),new BigDecimal("2000000"),new BigDecimal("10000000"),date1),
new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(3)]+"半导体有限公司",abcArray[indexList.get(3)]+indexList.get(3),"丁十三","187****6160",new BigDecimal("30000"),new BigDecimal("100"),new BigDecimal("3000000"),new BigDecimal("10000000"),date2),
new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(4)]+"半导体有限公司",abcArray[indexList.get(4)]+indexList.get(4),"包十四","187****6160",new BigDecimal("400"),new BigDecimal("10000"),new BigDecimal("4000000"),new BigDecimal("15000000"),date1),
new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(4)]+"半导体有限公司",abcArray[indexList.get(4)]+indexList.get(4),"董十五","187****6160",new BigDecimal("100"),new BigDecimal("80000"),new BigDecimal("8000000"),new BigDecimal("15000000"),date2),
new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(5)]+"半导体有限公司",abcArray[indexList.get(5)]+indexList.get(5),"肖十六","187****6160",new BigDecimal("3500"),new BigDecimal("200"),new BigDecimal("7000000"),new BigDecimal("10000000"),date1),
new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(5)]+"半导体有限公司",abcArray[indexList.get(5)]+indexList.get(5),"肖十六","187****6160",new BigDecimal("4000"),new BigDecimal("250"),new BigDecimal("1000000"),new BigDecimal("10000000"),date2));
Long tenantSid = SecurityUtil.getUserProfile().getTenantSid(); Long tenantSid = SecurityUtil.getUserProfile().getTenantSid();
@ -81,29 +124,26 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService {
} }
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 nextInt = random.nextInt(30)+1;
int dateInt = random.nextInt(3);
//int dayInt = random.nextInt(10)+1;
int i = random.nextInt(16);
ReceivablesDetailEntity sku = skuList.get(i);
receivablesDetailEntity.setSkuCode(sku.getSkuCode());
receivablesDetailEntity.setSkuName(sku.getSkuName());
receivablesDetailEntity.setSkuSpec(sku.getSkuSpec());
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");
receivablesDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString()); receivablesDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString());
receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); 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(),integerList.get(dateInt)));
receivablesDetailEntity.setSalesmanAssistant("qcsupplierqcuser001");
receivablesDetailEntity.setSalesmanBoss("Sp0001");
receivablesDetailEntity.setSalesmanAssistant("Sp0001");
receivablesDetailEntity.setSalesmanBoss("qcsupplierqcuser001");
receivablesDetailEntity.setSalesman("qcuser001"); receivablesDetailEntity.setSalesman("qcuser001");
receivablesDetailEntity.setProduceBoss("Sp0002"); receivablesDetailEntity.setProduceBoss("Sp0002");
receivablesDetailEntity.setEmail("ath_Sp0001@163.com");
receivablesDetailEntity.setWorkNo("work-"+DateUtils.currentTimeString()); receivablesDetailEntity.setWorkNo("work-"+DateUtils.currentTimeString());
receivablesDetailEntity.setOverdueDays(String.valueOf(DateUtils.getDayInterval(new Date(),receivablesDetailEntity.getReceivableDate())));
receivablesDetailEntity.setOverdueDays(String.valueOf((new Date().getTime()-receivablesDetailEntity.getReceivableDate().getTime())/86400000L));
} }
receivablesDetailService.saveBatch(list); receivablesDetailService.saveBatch(list);


+ 6
- 0
doc/sql/app-20230912-ddl.sql View File

@ -125,3 +125,9 @@ alter table cim_collection_detail Add column processed_by varchar(32) null defau
alter table cim_collection_detail Add column produce_boss varchar(100) null default '' COMMENT '生产主管'; alter table cim_collection_detail Add column produce_boss varchar(100) null default '' COMMENT '生产主管';
alter table cim_receivables_detail Add column produce_boss varchar(100) null default '' COMMENT '生产主管'; alter table cim_receivables_detail Add column produce_boss varchar(100) null default '' COMMENT '生产主管';
--
ALTER TABLE `cim_chat_file` MODIFY COLUMN `question` text, MODIFY COLUMN `complete_explain` text;
--,
alter table cim_receivables_detail Add column email varchar(50) null default '' COMMENT '邮箱',Add column limit_amount decimal(15,3) DEFAULT NULL COMMENT '限制金额';

Loading…
Cancel
Save