parent
007cac798e
commit
711e5c584e
|
|
@ -32,6 +32,7 @@ public class PaybillOperation extends AbstractOperationServicePlugIn implements
|
||||||
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
||||||
super.afterExecuteOperationTransaction(e);
|
super.afterExecuteOperationTransaction(e);
|
||||||
|
|
||||||
|
Boolean isSuccess = true;//FKZJ2025040007
|
||||||
String operationKey = e.getOperationKey();
|
String operationKey = e.getOperationKey();
|
||||||
if ("pushfk".equals(operationKey)) {
|
if ("pushfk".equals(operationKey)) {
|
||||||
DynamicObject[] dataEntities = e.getDataEntities();
|
DynamicObject[] dataEntities = e.getDataEntities();
|
||||||
|
|
@ -42,37 +43,44 @@ public class PaybillOperation extends AbstractOperationServicePlugIn implements
|
||||||
if (null != paymentidentify) {
|
if (null != paymentidentify) {
|
||||||
if (!"FKBS02".equals(paymentidentify.getString("number"))) {
|
if (!"FKBS02".equals(paymentidentify.getString("number"))) {
|
||||||
addErrorInfo(bill, "付款标识不为被动付款");
|
addErrorInfo(bill, "付款标识不为被动付款");
|
||||||
|
isSuccess = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
addErrorInfo(bill, "付款标识为空无法判断被动主动");
|
addErrorInfo(bill, "付款标识为空无法判断被动主动");
|
||||||
|
isSuccess = false;
|
||||||
}
|
}
|
||||||
DynamicObject shjhBizsmall = bill.getDynamicObject("shjh_bizsmall");
|
DynamicObject shjhBizsmall = bill.getDynamicObject("shjh_bizsmall");
|
||||||
if (null != shjhBizsmall) {
|
if (null != shjhBizsmall) {
|
||||||
if (!shjhBizsmall.getBoolean("shjh_tsfk")) {
|
if (!shjhBizsmall.getBoolean("shjh_tsfk")) {
|
||||||
addErrorInfo(bill, "【业务小类】中【是否推送费控系统】=否");
|
addErrorInfo(bill, "【业务小类】中【是否推送费控系统】=否");
|
||||||
|
isSuccess = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
addErrorInfo(bill, "业务小类为空");
|
addErrorInfo(bill, "业务小类为空");
|
||||||
|
isSuccess = false;
|
||||||
}
|
}
|
||||||
if (bill.getBoolean("shjh_ispushfk")) {
|
if (bill.getBoolean("shjh_ispushfk")) {
|
||||||
addErrorInfo(bill, "付款单需推送费控系统 = 是");
|
addErrorInfo(bill, "付款单需推送费控系统 = 是");
|
||||||
|
isSuccess = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
JSONObject data = new JSONObject();
|
if (isSuccess) {
|
||||||
// 构建header
|
JSONObject data = new JSONObject();
|
||||||
JSONObject header = buildHeader(bill);
|
// 构建header
|
||||||
// 构建body
|
JSONObject header = buildHeader(bill);
|
||||||
JSONArray body = buildBody(bill);
|
// 构建body
|
||||||
data.put("header", header);
|
JSONArray body = buildBody(bill);
|
||||||
data.put("body", body);
|
data.put("header", header);
|
||||||
JSONObject jsonObject = withholding_billing(data, bill.getString("billno"));
|
data.put("body", body);
|
||||||
String code = (String) jsonObject.get("code");
|
JSONObject jsonObject = withholding_billing(data, bill.getString("billno"));
|
||||||
if (!"0".equals(code)) {
|
String code = (String) jsonObject.get("code");
|
||||||
addErrorInfo(bill, "推送费控失败:" + jsonObject.get("msg"));
|
if (!"0".equals(code)) {
|
||||||
} else {
|
addErrorInfo(bill, ""+jsonObject.get("msg"));
|
||||||
bill.set("shjh_ispushfk", true);
|
} else {
|
||||||
SaveServiceHelper.save(new DynamicObject[]{bill});
|
bill.set("shjh_ispushfk", true);
|
||||||
this.operationResult.addSuccessPkId(bill.getPkValue());
|
SaveServiceHelper.save(new DynamicObject[]{bill});
|
||||||
|
this.operationResult.addSuccessPkId(bill.getPkValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import kd.sdk.plugin.Plugin;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 强共享报表
|
* 强(弱)共享报表
|
||||||
* shjh_strongsharing
|
* shjh_strongsharing
|
||||||
*/
|
*/
|
||||||
public class StrongSharingQueryPlugin extends AbstractReportListDataPlugin implements Plugin {
|
public class StrongSharingQueryPlugin extends AbstractReportListDataPlugin implements Plugin {
|
||||||
|
|
@ -35,12 +35,19 @@ public class StrongSharingQueryPlugin extends AbstractReportListDataPlugin imple
|
||||||
FilterInfo filter = reportQueryParam.getFilter();
|
FilterInfo filter = reportQueryParam.getFilter();
|
||||||
Date shjh_jzdate = filter.getDate("shjh_jzdate");//基准日期
|
Date shjh_jzdate = filter.getDate("shjh_jzdate");//基准日期
|
||||||
QFilter q1 = new QFilter("bizdate", QCP.equals, shjh_jzdate);//交易日期
|
QFilter q1 = new QFilter("bizdate", QCP.equals, shjh_jzdate);//交易日期
|
||||||
|
String shjhIsshare = filter.getString("shjh_isshare");//公司属性
|
||||||
|
if (shjhIsshare.equals("1")) {
|
||||||
|
q1.and(new QFilter("company.shjh_isshare", QCP.equals, "1"));//公司属性为强共享
|
||||||
|
}else {
|
||||||
|
q1.and(new QFilter("company.shjh_isshare", QCP.equals, "0"));//公司属性为弱共享
|
||||||
|
}
|
||||||
|
|
||||||
DataSet result1 = null;
|
DataSet result1 = null;
|
||||||
// 被动付款入账
|
// 被动付款入账
|
||||||
DataSet beiIntelpay1 = QueryServiceHelper.queryDataSet(this.getClass().getName(), BEI_INTELPAY,
|
DataSet beiIntelpay1 = QueryServiceHelper.queryDataSet(this.getClass().getName(), BEI_INTELPAY,
|
||||||
"id,billno as shjh_billno,company.number as shjh_orgnumber,company.name as shjh_orgname," +
|
"id,billno as shjh_billno,company.number as shjh_orgnumber,company.name as shjh_orgname," +
|
||||||
"bank.number as banknumber,biztime as shjh_biztime,transbalance as shjh_amountjz,accountbank.id as accountbankid",
|
"bank.number as banknumber,biztime as shjh_biztime,transbalance as shjh_amountjz,accountbank.id as accountbankid," +
|
||||||
|
"company.shjh_isshare as shjh_companyisshare",
|
||||||
q1.toArray(), null);
|
q1.toArray(), null);
|
||||||
// 合作金融机构 bd_finorginfo
|
// 合作金融机构 bd_finorginfo
|
||||||
DataSet bdAccountbanks1 = QueryServiceHelper.queryDataSet(this.getClass().getName(),
|
DataSet bdAccountbanks1 = QueryServiceHelper.queryDataSet(this.getClass().getName(),
|
||||||
|
|
@ -55,7 +62,7 @@ public class StrongSharingQueryPlugin extends AbstractReportListDataPlugin imple
|
||||||
DataSet joinedDataSet = distinctBeiIntelpay.join(distinctBdAccountbanks)
|
DataSet joinedDataSet = distinctBeiIntelpay.join(distinctBdAccountbanks)
|
||||||
.on("banknumber", "finorginfonumber")
|
.on("banknumber", "finorginfonumber")
|
||||||
.select(new String[]{"shjh_billno", "shjh_orgnumber", "shjh_orgname", "shjh_bankname", "banknumber",
|
.select(new String[]{"shjh_billno", "shjh_orgnumber", "shjh_orgname", "shjh_bankname", "banknumber",
|
||||||
"shjh_biztime", "shjh_amountjz", "accountbankid"})
|
"shjh_biztime", "shjh_amountjz", "accountbankid","shjh_companyisshare"})
|
||||||
.finish();
|
.finish();
|
||||||
|
|
||||||
// 按银行账户id分组,取最大日期的集合
|
// 按银行账户id分组,取最大日期的集合
|
||||||
|
|
@ -68,11 +75,11 @@ public class StrongSharingQueryPlugin extends AbstractReportListDataPlugin imple
|
||||||
.on("accountbankid", "accountbankid")
|
.on("accountbankid", "accountbankid")
|
||||||
.on("shjh_biztime", "shjh_biztime")
|
.on("shjh_biztime", "shjh_biztime")
|
||||||
.select(new String[]{"shjh_billno", "shjh_orgnumber", "shjh_orgname", "shjh_bankname", "banknumber",
|
.select(new String[]{"shjh_billno", "shjh_orgnumber", "shjh_orgname", "shjh_bankname", "banknumber",
|
||||||
"shjh_biztime", "shjh_amountjz","accountbankid"})
|
"shjh_biztime", "shjh_amountjz","accountbankid","shjh_companyisshare"})
|
||||||
.finish();
|
.finish();
|
||||||
|
|
||||||
// 再次根据银行编码分组 求和余额
|
// 再次根据银行编码分组 求和余额
|
||||||
result1 = result.groupBy(new String[]{"shjh_orgnumber", "shjh_orgname", "shjh_bankname","banknumber"}).sum("shjh_amountjz").finish();
|
result1 = result.groupBy(new String[]{"shjh_orgnumber", "shjh_orgname", "shjh_bankname","banknumber","shjh_companyisshare"}).sum("shjh_amountjz").finish();
|
||||||
|
|
||||||
// // 分组后和源集合联表:除银行编码,余额的其他字段进行组合返回前台
|
// // 分组后和源集合联表:除银行编码,余额的其他字段进行组合返回前台
|
||||||
// result1 = result.join(finish1)
|
// result1 = result.join(finish1)
|
||||||
|
|
@ -104,11 +111,18 @@ public class StrongSharingQueryPlugin extends AbstractReportListDataPlugin imple
|
||||||
|
|
||||||
Date shjh_tnbjdate = filter.getDate("shjh_tnbjdate");//同年比较日期
|
Date shjh_tnbjdate = filter.getDate("shjh_tnbjdate");//同年比较日期
|
||||||
QFilter q2 = new QFilter("bizdate", QCP.equals, shjh_tnbjdate);//交易日期
|
QFilter q2 = new QFilter("bizdate", QCP.equals, shjh_tnbjdate);//交易日期
|
||||||
|
if (shjhIsshare.equals("1")) {
|
||||||
|
q2.and(new QFilter("company.shjh_isshare", QCP.equals, "1"));//公司属性为强共享
|
||||||
|
}else {
|
||||||
|
q2.and(new QFilter("company.shjh_isshare", QCP.equals, "0"));//公司属性为弱共享
|
||||||
|
}
|
||||||
|
|
||||||
DataSet result2 = null;
|
DataSet result2 = null;
|
||||||
// 原始查询
|
// 原始查询
|
||||||
DataSet beiIntelpay2 = QueryServiceHelper.queryDataSet(this.getClass().getName(), BEI_INTELPAY,
|
DataSet beiIntelpay2 = QueryServiceHelper.queryDataSet(this.getClass().getName(), BEI_INTELPAY,
|
||||||
"id,billno as shjh_billno,company.number as shjh_orgnumber,company.name as shjh_orgname," +
|
"id,billno as shjh_billno,company.number as shjh_orgnumber,company.name as shjh_orgname," +
|
||||||
"bank.number as banknumber,biztime as shjh_biztime,transbalance as shjh_amounttn,accountbank.id as accountbankid",
|
"bank.number as banknumber,biztime as shjh_biztime,transbalance as shjh_amounttn,accountbank.id as accountbankid," +
|
||||||
|
"company.shjh_isshare as shjh_companyisshare",
|
||||||
q2.toArray(), null);
|
q2.toArray(), null);
|
||||||
// 合作金融机构 bd_finorginfo
|
// 合作金融机构 bd_finorginfo
|
||||||
DataSet bdAccountbanks2 = QueryServiceHelper.queryDataSet(this.getClass().getName(),
|
DataSet bdAccountbanks2 = QueryServiceHelper.queryDataSet(this.getClass().getName(),
|
||||||
|
|
@ -123,7 +137,7 @@ public class StrongSharingQueryPlugin extends AbstractReportListDataPlugin imple
|
||||||
DataSet joinedDataSet = distinctBeiIntelpay.join(distinctBdAccountbanks)
|
DataSet joinedDataSet = distinctBeiIntelpay.join(distinctBdAccountbanks)
|
||||||
.on("banknumber", "finorginfonumber")
|
.on("banknumber", "finorginfonumber")
|
||||||
.select(new String[]{"shjh_billno", "shjh_orgnumber", "shjh_orgname", "shjh_bankname", "banknumber",
|
.select(new String[]{"shjh_billno", "shjh_orgnumber", "shjh_orgname", "shjh_bankname", "banknumber",
|
||||||
"shjh_biztime", "shjh_amounttn","accountbankid"})
|
"shjh_biztime", "shjh_amounttn","accountbankid","shjh_companyisshare"})
|
||||||
.finish();
|
.finish();
|
||||||
|
|
||||||
// 按银行账户id分组,取最大日期的集合
|
// 按银行账户id分组,取最大日期的集合
|
||||||
|
|
@ -136,11 +150,11 @@ public class StrongSharingQueryPlugin extends AbstractReportListDataPlugin imple
|
||||||
.on("accountbankid", "accountbankid")
|
.on("accountbankid", "accountbankid")
|
||||||
.on("shjh_biztime", "shjh_biztime")
|
.on("shjh_biztime", "shjh_biztime")
|
||||||
.select(new String[]{"shjh_billno", "shjh_orgnumber", "shjh_orgname", "shjh_bankname", "banknumber",
|
.select(new String[]{"shjh_billno", "shjh_orgnumber", "shjh_orgname", "shjh_bankname", "banknumber",
|
||||||
"shjh_biztime", "shjh_amounttn","accountbankid"})
|
"shjh_biztime", "shjh_amounttn","accountbankid","shjh_companyisshare"})
|
||||||
.finish();
|
.finish();
|
||||||
|
|
||||||
// 再次根据银行编码分组 求和余额
|
// 再次根据银行编码分组 求和余额
|
||||||
result2 = result.groupBy(new String[]{"shjh_orgnumber", "shjh_orgname", "shjh_bankname","banknumber"}).sum("shjh_amounttn").finish();
|
result2 = result.groupBy(new String[]{"shjh_orgnumber", "shjh_orgname", "shjh_bankname","banknumber","shjh_companyisshare"}).sum("shjh_amounttn").finish();
|
||||||
|
|
||||||
// // 分组后和源集合联表:除银行编码,余额的其他字段进行组合返回前台
|
// // 分组后和源集合联表:除银行编码,余额的其他字段进行组合返回前台
|
||||||
// result2 = result.join(finish1)
|
// result2 = result.join(finish1)
|
||||||
|
|
@ -177,7 +191,8 @@ public class StrongSharingQueryPlugin extends AbstractReportListDataPlugin imple
|
||||||
.on("shjh_orgname", "shjh_orgname")
|
.on("shjh_orgname", "shjh_orgname")
|
||||||
.on("shjh_bankname", "shjh_bankname")
|
.on("shjh_bankname", "shjh_bankname")
|
||||||
.on("shjh_orgnumber", "shjh_orgnumber")
|
.on("shjh_orgnumber", "shjh_orgnumber")
|
||||||
.select(new String[]{"shjh_orgnumber", "shjh_orgname", "shjh_bankname", "banknumber",
|
.on("shjh_companyisshare", "shjh_companyisshare")
|
||||||
|
.select(new String[]{"shjh_orgnumber", "shjh_orgname", "shjh_bankname", "banknumber","shjh_companyisshare",
|
||||||
"shjh_amountjz", "shjh_amounttn"})
|
"shjh_amountjz", "shjh_amounttn"})
|
||||||
.finish();
|
.finish();
|
||||||
finalResult.print(true);
|
finalResult.print(true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue