parent
6404c02c54
commit
1fe29da4b1
|
|
@ -7,6 +7,8 @@ import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||||
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
||||||
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
||||||
import kd.bos.entity.plugin.args.BeforeOperationArgs;
|
import kd.bos.entity.plugin.args.BeforeOperationArgs;
|
||||||
|
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
||||||
|
import kd.bos.entity.plugin.args.EndOperationTransactionArgs;
|
||||||
import kd.bos.entity.validate.ErrorLevel;
|
import kd.bos.entity.validate.ErrorLevel;
|
||||||
import kd.bos.logging.Log;
|
import kd.bos.logging.Log;
|
||||||
import kd.bos.logging.LogFactory;
|
import kd.bos.logging.LogFactory;
|
||||||
|
|
@ -33,20 +35,23 @@ public class SubmitOccupyFilingApplication extends AbstractOperationServicePlugI
|
||||||
public void onPreparePropertys(PreparePropertysEventArgs e) {
|
public void onPreparePropertys(PreparePropertysEventArgs e) {
|
||||||
super.onPreparePropertys(e);
|
super.onPreparePropertys(e);
|
||||||
e.getFieldKeys().add("billno");
|
e.getFieldKeys().add("billno");
|
||||||
|
e.getFieldKeys().add("org");
|
||||||
e.getFieldKeys().add("shkd_baed");
|
e.getFieldKeys().add("shkd_baed");
|
||||||
e.getFieldKeys().add("drawamount");
|
e.getFieldKeys().add("drawamount");
|
||||||
|
e.getFieldKeys().add("amount");
|
||||||
e.getFieldKeys().add("billstatus");
|
e.getFieldKeys().add("billstatus");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
|
public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
|
||||||
super.beforeExecuteOperationTransaction(e);
|
super.beforeExecuteOperationTransaction(e);
|
||||||
|
// 限制只能选择一条数据进行提交
|
||||||
|
if (e.getDataEntities().length > 1) {
|
||||||
|
e.setCancelMessage("请选择一条数据审核!");
|
||||||
|
e.setCancel(true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
|
||||||
super.afterExecuteOperationTransaction(e);
|
|
||||||
logger.info("同步开始");
|
logger.info("同步开始");
|
||||||
//用于接收成功的数据
|
//用于接收成功的数据
|
||||||
ArrayList arrayList = new ArrayList();
|
ArrayList arrayList = new ArrayList();
|
||||||
|
|
@ -55,6 +60,7 @@ public class SubmitOccupyFilingApplication extends AbstractOperationServicePlugI
|
||||||
try {
|
try {
|
||||||
DynamicObject shkd_baed = dataEntity.getDynamicObject("shkd_baed");
|
DynamicObject shkd_baed = dataEntity.getDynamicObject("shkd_baed");
|
||||||
if (shkd_baed!=null){
|
if (shkd_baed!=null){
|
||||||
|
//提交前同步备案申请
|
||||||
boolean res = UpdateFilingApplicationData(shkd_baed, dataEntity);
|
boolean res = UpdateFilingApplicationData(shkd_baed, dataEntity);
|
||||||
if (res){
|
if (res){
|
||||||
arrayList.add(dataEntity);
|
arrayList.add(dataEntity);
|
||||||
|
|
@ -67,6 +73,17 @@ public class SubmitOccupyFilingApplication extends AbstractOperationServicePlugI
|
||||||
DynamicObject[] results = (DynamicObject[]) arrayList.toArray(new DynamicObject[arrayList.size()]);
|
DynamicObject[] results = (DynamicObject[]) arrayList.toArray(new DynamicObject[arrayList.size()]);
|
||||||
e.setDataEntities(results);
|
e.setDataEntities(results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beginOperationTransaction(BeginOperationTransactionArgs e) {
|
||||||
|
super.beginOperationTransaction(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
||||||
|
super.afterExecuteOperationTransaction(e);
|
||||||
|
|
||||||
|
}
|
||||||
public boolean UpdateFilingApplicationData(DynamicObject shkd_baed,DynamicObject dataEntity){
|
public boolean UpdateFilingApplicationData(DynamicObject shkd_baed,DynamicObject dataEntity){
|
||||||
boolean res=true;
|
boolean res=true;
|
||||||
QFilter qFilter = new QFilter("billstatus", QCP.in, Arrays.asList("B", "C"));//提交,审核状态
|
QFilter qFilter = new QFilter("billstatus", QCP.in, Arrays.asList("B", "C"));//提交,审核状态
|
||||||
|
|
@ -119,6 +136,11 @@ public class SubmitOccupyFilingApplication extends AbstractOperationServicePlugI
|
||||||
|
|
||||||
//合并
|
//合并
|
||||||
List<Map<String, Object>> hebinList=hebinLists(zqfxlist,rzzllist,kzcllist);
|
List<Map<String, Object>> hebinList=hebinLists(zqfxlist,rzzllist,kzcllist);
|
||||||
|
String name = dataEntity.getDataEntityType().getName();
|
||||||
|
Map<String,Object> getdatamap=getdatamap(name,dataEntity);
|
||||||
|
hebinList.add(getdatamap);
|
||||||
|
|
||||||
|
|
||||||
// 使用Stream计算shkd_zyje的合计
|
// 使用Stream计算shkd_zyje的合计
|
||||||
BigDecimal hebintotal = hebinList.stream() // 将zqfxlist转为Stream
|
BigDecimal hebintotal = hebinList.stream() // 将zqfxlist转为Stream
|
||||||
.map(map -> (BigDecimal) map.get("shkd_zyje")) // 提取shkd_zyje的值
|
.map(map -> (BigDecimal) map.get("shkd_zyje")) // 提取shkd_zyje的值
|
||||||
|
|
@ -168,6 +190,66 @@ public class SubmitOccupyFilingApplication extends AbstractOperationServicePlugI
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Map<String, Object> getdatamap(String name, DynamicObject dataEntity) {
|
||||||
|
String billno = dataEntity.getString("billno");
|
||||||
|
BigDecimal drawamount =BigDecimal.ZERO;
|
||||||
|
String shkd_djlx="提款处理";
|
||||||
|
switch (name){
|
||||||
|
case "cfm_loanbill"://提款处理
|
||||||
|
drawamount = dataEntity.getBigDecimal("drawamount");
|
||||||
|
if (billno.contains("JQFX")) {
|
||||||
|
shkd_djlx="债券发行";
|
||||||
|
} else if (billno.contains("JKHT")) {
|
||||||
|
shkd_djlx="借款合同";
|
||||||
|
} else if (billno.contains("RC")){
|
||||||
|
shkd_djlx="售后租回回款";
|
||||||
|
}else {
|
||||||
|
shkd_djlx="提款处理";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "fl_leasecontractbill":
|
||||||
|
drawamount = dataEntity.getBigDecimal("amount");
|
||||||
|
shkd_djlx="融资租赁";
|
||||||
|
break;
|
||||||
|
case "cfm_loanbill_bond":
|
||||||
|
drawamount = dataEntity.getBigDecimal("drawamount");
|
||||||
|
if (billno.contains("JQFX")) {
|
||||||
|
shkd_djlx="债券发行";
|
||||||
|
} else if (billno.contains("JKHT")) {
|
||||||
|
shkd_djlx="借款合同";
|
||||||
|
} else if (billno.contains("RC")){
|
||||||
|
shkd_djlx="售后租回回款";
|
||||||
|
}else {
|
||||||
|
shkd_djlx="提款处理";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "fl_receiptbill":
|
||||||
|
drawamount = dataEntity.getBigDecimal("drawamount");
|
||||||
|
if (billno.contains("JQFX")) {
|
||||||
|
shkd_djlx="债券发行";
|
||||||
|
} else if (billno.contains("JKHT")) {
|
||||||
|
shkd_djlx="借款合同";
|
||||||
|
} else if (billno.contains("RC")){
|
||||||
|
shkd_djlx="售后租回回款";
|
||||||
|
}else {
|
||||||
|
shkd_djlx="提款处理";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "lc_lettercredit":
|
||||||
|
drawamount = dataEntity.getBigDecimal("amount");
|
||||||
|
shkd_djlx="开证处理";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Map<String,Object> zqfxmap=new HashMap<>();
|
||||||
|
zqfxmap.put("shkd_djbh",dataEntity.getString("billno"));
|
||||||
|
zqfxmap.put("shkd_djlx",shkd_djlx);
|
||||||
|
zqfxmap.put("shkd_zyje",drawamount);
|
||||||
|
zqfxmap.put("shkd_org",dataEntity.getLong("org.id"));
|
||||||
|
return zqfxmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 合并集合方法
|
* 合并集合方法
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue