借款单提交校验扣减返还逻辑优化
This commit is contained in:
parent
d24bcf8e06
commit
f4023db40a
|
@ -54,17 +54,22 @@ public class DailyLoanBillSubValidatorOp extends AbstractOperationServicePlugIn
|
||||||
if (OrgCheckUtils.isKS(companyId)) {
|
if (OrgCheckUtils.isKS(companyId)) {
|
||||||
String impRestType = er_dailyLoanBill.getString("zcgj_impresttype");//备用金类型
|
String impRestType = er_dailyLoanBill.getString("zcgj_impresttype");//备用金类型
|
||||||
DynamicObject applier = er_dailyLoanBill.getDynamicObject("applier");//申请人
|
DynamicObject applier = er_dailyLoanBill.getDynamicObject("applier");//申请人
|
||||||
|
Date bizDate = er_dailyLoanBill.getDate("bizdate");//申请日期
|
||||||
|
LocalDate localDate = bizDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||||
|
String bizDateYear = String.valueOf(localDate.getYear());//申请日期年份
|
||||||
if (impRestType != null && !"".equals(impRestType)) {
|
if (impRestType != null && !"".equals(impRestType)) {
|
||||||
if (impRestType.equals("0")) {
|
if (impRestType.equals("0")) {
|
||||||
//定额备用金
|
//定额备用金
|
||||||
Date bizDate = er_dailyLoanBill.getDate("bizdate");//申请日期
|
|
||||||
BigDecimal loanAmount = er_dailyLoanBill.getBigDecimal("loanamount");//借款金额合计
|
BigDecimal loanAmount = er_dailyLoanBill.getBigDecimal("loanamount");//借款金额合计
|
||||||
LocalDate localDate = bizDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
||||||
String bizDateYear = String.valueOf(localDate.getYear());//申请日期年份
|
|
||||||
|
|
||||||
QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());
|
QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());//可借款人员
|
||||||
filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear));
|
filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear));//申请日期年份
|
||||||
DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger", new QFilter[]{filter});//定额备用金初始台账
|
DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger",
|
||||||
|
new QFilter[]{filter});//定额备用金初始台账
|
||||||
|
if (quotaImprestLedger == null) {
|
||||||
|
this.addFatalErrorMessage(dataEnt, "您未在定额备用金初始化台账里!!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
DynamicObjectCollection entryEntityCollection = quotaImprestLedger.getDynamicObjectCollection("zcgj_entryentity");//分录
|
DynamicObjectCollection entryEntityCollection = quotaImprestLedger.getDynamicObjectCollection("zcgj_entryentity");//分录
|
||||||
for (DynamicObject entryEntity : entryEntityCollection) {
|
for (DynamicObject entryEntity : entryEntityCollection) {
|
||||||
DynamicObject person = entryEntity.getDynamicObject("zcgj_person");//人员
|
DynamicObject person = entryEntity.getDynamicObject("zcgj_person");//人员
|
||||||
|
@ -76,9 +81,17 @@ public class DailyLoanBillSubValidatorOp extends AbstractOperationServicePlugIn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}/* else if (impRestType.equals("1")) {
|
} else if (impRestType.equals("1")) {
|
||||||
//临时备用金
|
//临时备用金
|
||||||
} else if (impRestType.equals("2")) {
|
QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());//可借款人员
|
||||||
|
filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear));//申请日期年份
|
||||||
|
DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger",
|
||||||
|
"id",new QFilter[]{filter});//定额备用金初始台账
|
||||||
|
if (quotaImprestLedger != null) {
|
||||||
|
this.addFatalErrorMessage(dataEnt, "您在定额备用金初始化台账里,所以不能使用临时备用金!!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}/* else if (impRestType.equals("2")) {
|
||||||
//项目筹备备用金
|
//项目筹备备用金
|
||||||
QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());// 可借款人员
|
QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());// 可借款人员
|
||||||
filter.and(new QFilter("zcgj_entryentity.zcgj_isenabled", QCP.equals, true));// 启用
|
filter.and(new QFilter("zcgj_entryentity.zcgj_isenabled", QCP.equals, true));// 启用
|
||||||
|
|
|
@ -79,13 +79,13 @@ public class LoanSlipReserveFundReverserOp extends AbstractOperationServicePlugI
|
||||||
} else if (impRestType.equals("2")) {
|
} else if (impRestType.equals("2")) {
|
||||||
//项目筹备备用金
|
//项目筹备备用金
|
||||||
}*/
|
}*/
|
||||||
}
|
if (!modifiedEntities.isEmpty()) {
|
||||||
}
|
try {
|
||||||
if (!modifiedEntities.isEmpty()) {
|
SaveServiceHelper.save(modifiedEntities.toArray(new DynamicObject[0]));
|
||||||
try {
|
} catch (Exception ex) {
|
||||||
SaveServiceHelper.save(modifiedEntities.toArray(new DynamicObject[0]));
|
throw new RuntimeException(ex);
|
||||||
} catch (Exception ex) {
|
}
|
||||||
throw new RuntimeException(ex);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue