资金日表取数逻辑更新
This commit is contained in:
parent
dc644ca975
commit
a9153d9342
|
@ -41,47 +41,39 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple
|
||||||
|
|
||||||
//获取过滤条件集合
|
//获取过滤条件集合
|
||||||
Map<String, Object> paramMap = this.transQueryParam(reportQueryParam);
|
Map<String, Object> paramMap = this.transQueryParam(reportQueryParam);
|
||||||
DynamicObjectCollection companys = (DynamicObjectCollection)paramMap.get("shkd_filter_company");//使用组织集合
|
DynamicObjectCollection companys = (DynamicObjectCollection)paramMap.get("shkd_filter_company");//使用=组织集合
|
||||||
DynamicObjectCollection groups = (DynamicObjectCollection)paramMap.get("shkd_filter_group");//使用组织集合
|
// DynamicObjectCollection groups = (DynamicObjectCollection)paramMap.get("shkd_filter_group");//使用组织集合
|
||||||
String shkd_queryorgtype = paramMap.get("shkd_queryorgtype").toString();//使用组织集合
|
String shkd_queryorgtype = paramMap.get("shkd_queryorgtype").toString();//使用组织集合
|
||||||
Collection<Object[]> firmParams = null ;
|
Collection<Object[]> firmParams = null ;
|
||||||
Date firstDate = (Date)paramMap.get("shkd_firstdate");//开始时间
|
Date firstDate = (Date)paramMap.get("shkd_firstdate");//开始时间
|
||||||
Date endDate = (Date)paramMap.get("shkd_enddate");//结束时间
|
Date endDate = (Date)paramMap.get("shkd_enddate");//结束时间
|
||||||
DynamicObject orgcurrency = (DynamicObject) paramMap.get("shkd_orgcurrency");
|
DynamicObject orgcurrency = (DynamicObject) paramMap.get("shkd_orgcurrency");
|
||||||
DynamicObject exratetable = (DynamicObject) paramMap.get("shkd_exratetable");
|
DynamicObject exratetable = (DynamicObject) paramMap.get("shkd_exratetable");
|
||||||
ArrayList<Long> longs = new ArrayList<>();
|
|
||||||
String groupName = null;
|
String groupName = null;
|
||||||
|
|
||||||
|
HashMap<Long, ArrayList<Long>> groupMap = new HashMap<>();//集团id集合
|
||||||
|
for (DynamicObject company : companys) {
|
||||||
|
long companyId = company.getLong("id");
|
||||||
|
List<Long> supGroupIds = OrgUnitServiceHelper.getSuperiorOrgs("08", companyId);
|
||||||
|
Long aLong = supGroupIds.get(0);
|
||||||
|
ArrayList<Long> companyList = null;
|
||||||
|
if (groupMap.containsKey(aLong)){
|
||||||
|
companyList = groupMap.get(aLong);
|
||||||
|
}else {
|
||||||
|
companyList = new ArrayList<>();
|
||||||
|
}
|
||||||
|
companyList.add(companyId);
|
||||||
|
groupMap.put(aLong,companyList);
|
||||||
|
}
|
||||||
//如果查询是查的集团,然后想要查询需查询下级及下级所有公司的id
|
//如果查询是查的集团,然后想要查询需查询下级及下级所有公司的id
|
||||||
if("group".equals(shkd_queryorgtype)){
|
if("group".equals(shkd_queryorgtype)){
|
||||||
for (DynamicObject group : groups) {
|
for (Long key : groupMap.keySet()){
|
||||||
longs.clear();//清除数据
|
DynamicObject bos_org_group = BusinessDataServiceHelper.loadSingle(key, "bos_org");
|
||||||
ArrayList<Long> grouplongs = new ArrayList<>();
|
groupName = bos_org_group.getString("name");
|
||||||
groupName = group.getString("name");
|
ArrayList<Long> longs = groupMap.get(key);
|
||||||
grouplongs.add(group.getLong("id"));
|
|
||||||
List<Long> allSubordinateOrgs = OrgUnitServiceHelper.getAllSubordinateOrgs(8L, grouplongs, true);
|
|
||||||
String shkd_iscontainyy = paramMap.get("shkd_iscontainyy").toString();//是否包含榆叶
|
|
||||||
if ("0".equals(shkd_iscontainyy)){
|
|
||||||
for (Long allSubordinateOrg : allSubordinateOrgs) {
|
|
||||||
DynamicObject bos_org = BusinessDataServiceHelper.loadSingle(allSubordinateOrg, "bos_org");
|
|
||||||
String shkd_affiliation = bos_org.getString("shkd_affiliation");
|
|
||||||
if ("1".equals(shkd_affiliation)){
|
|
||||||
longs.add(allSubordinateOrg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
firmParams = this.addFirmParams(shkd_queryorgtype,firmParams,groupName,longs,firstDate,endDate,orgcurrency,exratetable);
|
|
||||||
}else {
|
|
||||||
longs.addAll(allSubordinateOrgs);
|
|
||||||
firmParams = this.addFirmParams(shkd_queryorgtype,firmParams,groupName,longs,firstDate,endDate,orgcurrency,exratetable);
|
firmParams = this.addFirmParams(shkd_queryorgtype,firmParams,groupName,longs,firstDate,endDate,orgcurrency,exratetable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
for (DynamicObject company : companys) {
|
|
||||||
longs.add(company.getLong("id"));
|
|
||||||
}
|
|
||||||
firmParams = this.addFirmParams(shkd_queryorgtype,firmParams,null,longs,firstDate,endDate,orgcurrency,exratetable);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if(firmParams != null && firmParams.size() > 0){
|
if(firmParams != null && firmParams.size() > 0){
|
||||||
for (Object[] firmParam : firmParams) {
|
for (Object[] firmParam : firmParams) {
|
||||||
|
@ -126,29 +118,45 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple
|
||||||
for (DynamicObject per_cas_recbill : per_cas_recbills) {
|
for (DynamicObject per_cas_recbill : per_cas_recbills) {
|
||||||
//查询收款单,为内部往来的公司
|
//查询收款单,为内部往来的公司
|
||||||
String payertype = per_cas_recbill.getString("payertype");//付款人类型
|
String payertype = per_cas_recbill.getString("payertype");//付款人类型
|
||||||
|
Long payerid = per_cas_recbill.getLong("payer");//收款人id
|
||||||
|
//判断是否内部,不是则跳过该循环
|
||||||
if("bd_customer".equals(payertype)||"bd_supplier".equals(payertype)||"bos_org".equals(payertype)){
|
if("bd_customer".equals(payertype)||"bd_supplier".equals(payertype)||"bos_org".equals(payertype)){
|
||||||
if("bd_supplier".equals(payertype)){
|
if("bd_supplier".equals(payertype)){
|
||||||
DynamicObject f7_payer = per_cas_recbill.getDynamicObject("f7_payer");//供应商
|
QFilter per_recQF = new QFilter("id", QCP.equals, payerid);
|
||||||
long id = f7_payer.getLong("id");
|
|
||||||
QFilter per_recQF = new QFilter("billstatus", QCP.equals, "D");
|
|
||||||
per_recQF.and("org.id",QCP.equals,id);
|
|
||||||
DynamicObject bd_supplier = BusinessDataServiceHelper.loadSingle("bd_supplier", "id,number,internal_company", per_recQF.toArray());
|
DynamicObject bd_supplier = BusinessDataServiceHelper.loadSingle("bd_supplier", "id,number,internal_company", per_recQF.toArray());
|
||||||
|
if(bd_supplier != null){
|
||||||
DynamicObject internal_company = bd_supplier.getDynamicObject("internal_company");
|
DynamicObject internal_company = bd_supplier.getDynamicObject("internal_company");
|
||||||
if(internal_company==null){
|
if (internal_company != null){
|
||||||
|
if (isYuYe(internal_company.getLong("id"))){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ("bd_customer".equals(payertype)) {
|
} else if ("bd_customer".equals(payertype)) {
|
||||||
DynamicObject customerf7 = per_cas_recbill.getDynamicObject("customerf7");//供应商
|
QFilter per_recQF = new QFilter("id", QCP.equals, payerid);
|
||||||
long id = customerf7.getLong("id");
|
DynamicObject bd_customer = BusinessDataServiceHelper.loadSingle("bd_customer", "id,number,internal_company", per_recQF.toArray());
|
||||||
QFilter per_recQF = new QFilter("billstatus", QCP.equals, "D");
|
if (bd_customer != null){
|
||||||
per_recQF.and("org.id",QCP.equals,id);
|
DynamicObject internal_company = bd_customer.getDynamicObject("internal_company");
|
||||||
DynamicObject bd_supplier = BusinessDataServiceHelper.loadSingle("bd_supplier", "id,number,internal_company", per_recQF.toArray());
|
if (internal_company != null){
|
||||||
DynamicObject internal_company = bd_supplier.getDynamicObject("internal_company");
|
if (isYuYe(internal_company.getLong("id"))){
|
||||||
if(internal_company==null){
|
continue;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if (isYuYe(payerid)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//是内部往来,累计金额
|
||||||
BigDecimal actrecamt = per_cas_recbill.getBigDecimal("actrecamt");
|
BigDecimal actrecamt = per_cas_recbill.getBigDecimal("actrecamt");
|
||||||
recAmountTotal = recAmountTotal.add(actrecamt);//添加收入金额
|
recAmountTotal = recAmountTotal.add(actrecamt);//添加收入金额
|
||||||
|
|
||||||
|
@ -158,42 +166,82 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple
|
||||||
}
|
}
|
||||||
|
|
||||||
//内部往来付款合计
|
//内部往来付款合计
|
||||||
public BigDecimal getTransactionsByfk(DynamicObject[] per_cas_paybills){
|
public HashMap<String, BigDecimal> getTransactionsByfk(DynamicObject[] per_cas_paybills){
|
||||||
|
HashMap<String, BigDecimal> stringBigDecimalHashMap = new HashMap<>();
|
||||||
BigDecimal perPayAmountTotal = BigDecimal.ZERO;
|
BigDecimal perPayAmountTotal = BigDecimal.ZERO;
|
||||||
|
BigDecimal addRecAmountTotal = BigDecimal.ZERO;
|
||||||
for (DynamicObject per_cas_paybill : per_cas_paybills) {
|
for (DynamicObject per_cas_paybill : per_cas_paybills) {
|
||||||
//查询收款单,为内部往来的公司
|
//查询收款单,为内部往来的公司
|
||||||
String payertype = per_cas_paybill.getString("payeetype");//收款人款人类型
|
String payertype = per_cas_paybill.getString("payeetype");//收款人款人类型
|
||||||
Long payerid = per_cas_paybill.getLong("payee");//供应商
|
Long payerid = per_cas_paybill.getLong("payee");//收款人id
|
||||||
|
//判断是否内部,不是则跳过该循环
|
||||||
if("bd_customer".equals(payertype)||"bd_supplier".equals(payertype)||"bos_org".equals(payertype)){
|
if("bd_customer".equals(payertype)||"bd_supplier".equals(payertype)||"bos_org".equals(payertype)){
|
||||||
if("bd_supplier".equals(payertype)){
|
if("bd_supplier".equals(payertype)){
|
||||||
QFilter per_recQF = new QFilter("id",QCP.equals,payerid);
|
QFilter per_recQF = new QFilter("id",QCP.equals,payerid);
|
||||||
DynamicObject bd_supplier = BusinessDataServiceHelper.loadSingle("bd_supplier", "id,number,internal_company", per_recQF.toArray());
|
DynamicObject bd_supplier = BusinessDataServiceHelper.loadSingle("bd_supplier", "id,number,internal_company", per_recQF.toArray());
|
||||||
|
if (bd_supplier != null){
|
||||||
DynamicObject internal_company = bd_supplier.getDynamicObject("internal_company");
|
DynamicObject internal_company = bd_supplier.getDynamicObject("internal_company");
|
||||||
if(internal_company==null){
|
if (internal_company != null){
|
||||||
|
if (isYuYe(internal_company.getLong("id"))){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ("bd_customer".equals(payertype)) {
|
} else if ("bd_customer".equals(payertype)) {
|
||||||
QFilter per_recQF = new QFilter("org.id",QCP.equals,payerid);
|
QFilter per_recQF = new QFilter("id",QCP.equals,payerid);
|
||||||
DynamicObject bd_supplier = BusinessDataServiceHelper.loadSingle("bd_supplier", "id,number,internal_company", per_recQF.toArray());
|
DynamicObject bd_customer = BusinessDataServiceHelper.loadSingle("bd_customer", "id,number,internal_company", per_recQF.toArray());
|
||||||
DynamicObject internal_company = bd_supplier.getDynamicObject("internal_company");
|
if (bd_customer != null){
|
||||||
if(internal_company==null){
|
DynamicObject internal_company = bd_customer.getDynamicObject("internal_company");
|
||||||
|
if (internal_company != null){
|
||||||
|
if (isYuYe(internal_company.getLong("id"))){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (isYuYe(payerid)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//是内部往来,累计金额
|
||||||
String payNumber = per_cas_paybill.getDynamicObject("org").getString("number");
|
String payNumber = per_cas_paybill.getDynamicObject("org").getString("number");
|
||||||
String recNumber = per_cas_paybill.getString("payeenumber");
|
String recNumber = per_cas_paybill.getString("payeenumber");
|
||||||
BigDecimal actpayamt = per_cas_paybill.getBigDecimal("actpayamt");
|
BigDecimal actpayamt = per_cas_paybill.getBigDecimal("actpayamt");
|
||||||
perPayAmountTotal = perPayAmountTotal.add(actpayamt);
|
perPayAmountTotal = perPayAmountTotal.add(actpayamt);
|
||||||
if (payNumber.equals(recNumber)){//当付款编码同收款编码时
|
if (payNumber.equals(recNumber)){//当付款编码同收款编码时
|
||||||
perPayAmountTotal = perPayAmountTotal.add(actpayamt);//补充收款数据
|
addRecAmountTotal = addRecAmountTotal.add(actpayamt);//补充收款数据
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stringBigDecimalHashMap.put("pay",perPayAmountTotal);
|
||||||
|
stringBigDecimalHashMap.put("rec",addRecAmountTotal);
|
||||||
|
return stringBigDecimalHashMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否为榆叶系公司
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isYuYe(Long id){
|
||||||
|
DynamicObject bos_org = BusinessDataServiceHelper.loadSingle(id, "bos_org");
|
||||||
|
if (bos_org != null){
|
||||||
|
String shkd_affiliation = bos_org.getString("shkd_affiliation");
|
||||||
|
if ("0".equals(shkd_affiliation)){
|
||||||
|
return true;
|
||||||
|
}else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return perPayAmountTotal;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<Object[]> addFirmParams(String shkd_queryorgtype, Collection<Object[]> firmParams, String groupName, List<Long> longs, Date firstDate,Date endDate,DynamicObject orgcurrency, DynamicObject exratetable){
|
public Collection<Object[]> addFirmParams(String shkd_queryorgtype, Collection<Object[]> firmParams, String groupName, List<Long> longs, Date firstDate,Date endDate,DynamicObject orgcurrency, DynamicObject exratetable){
|
||||||
|
@ -252,7 +300,7 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple
|
||||||
//逻辑1:查询该公司到查询时间的所有付款单
|
//逻辑1:查询该公司到查询时间的所有付款单
|
||||||
QFilter bef_payQF = new QFilter("billstatus", QCP.equals, "D");
|
QFilter bef_payQF = new QFilter("billstatus", QCP.equals, "D");
|
||||||
bef_payQF.and("org.id",QCP.equals,orgPkValue);
|
bef_payQF.and("org.id",QCP.equals,orgPkValue);
|
||||||
bef_payQF.and("bizdate",QCP.large_equals,begindate);//付款日期paydate
|
bef_payQF.and("paydate",QCP.large_equals,begindate);//付款日期paydate 业务日期bizdate
|
||||||
if (firstDate == null){//没有设置时间,则查询今日记账,即查询期间开始到今日之前的所有付款单据
|
if (firstDate == null){//没有设置时间,则查询今日记账,即查询期间开始到今日之前的所有付款单据
|
||||||
firstDate = new Date();
|
firstDate = new Date();
|
||||||
}
|
}
|
||||||
|
@ -263,7 +311,7 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple
|
||||||
bef_payQF.and("currency.id",QCP.equals,orgcurrencyId);
|
bef_payQF.and("currency.id",QCP.equals,orgcurrencyId);
|
||||||
}
|
}
|
||||||
Date startDate = this.getStartDate(firstDate);//过滤条件-开始日期
|
Date startDate = this.getStartDate(firstDate);//过滤条件-开始日期
|
||||||
bef_payQF.and("bizdate","<",startDate);
|
bef_payQF.and("paydate","<",startDate);
|
||||||
DynamicObject[] bef_cas_paybills = BusinessDataServiceHelper.load("cas_paybill", "id,org,org.id,org.number,payeenumber,actpayamt,currency", bef_payQF.toArray());
|
DynamicObject[] bef_cas_paybills = BusinessDataServiceHelper.load("cas_paybill", "id,org,org.id,org.number,payeenumber,actpayamt,currency", bef_payQF.toArray());
|
||||||
for (DynamicObject bef_cas_paybill : bef_cas_paybills) {
|
for (DynamicObject bef_cas_paybill : bef_cas_paybills) {
|
||||||
String payNumber = bef_cas_paybill.getDynamicObject("org").getString("number");
|
String payNumber = bef_cas_paybill.getDynamicObject("org").getString("number");
|
||||||
|
@ -284,8 +332,8 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple
|
||||||
bef_recQF.and("currency.id",QCP.equals,orgcurrencyId);
|
bef_recQF.and("currency.id",QCP.equals,orgcurrencyId);
|
||||||
}
|
}
|
||||||
bef_recQF.and("org.id",QCP.equals,orgPkValue);
|
bef_recQF.and("org.id",QCP.equals,orgPkValue);
|
||||||
bef_recQF.and("bizdate",QCP.large_equals,begindate);//收款日期payeedate
|
bef_recQF.and("payeedate",QCP.large_equals,begindate);//收款日期payeedate 业务日期bizdate
|
||||||
bef_recQF.and("bizdate","<",startDate);
|
bef_recQF.and("payeedate","<",startDate);
|
||||||
DynamicObject[] cas_recbills = BusinessDataServiceHelper.load("cas_recbill", "id,org,org.id,org.number,actrecamt,currency", bef_recQF.toArray());
|
DynamicObject[] cas_recbills = BusinessDataServiceHelper.load("cas_recbill", "id,org,org.id,org.number,actrecamt,currency", bef_recQF.toArray());
|
||||||
for (DynamicObject cas_recbill : cas_recbills) {
|
for (DynamicObject cas_recbill : cas_recbills) {
|
||||||
BigDecimal actrecamt = cas_recbill.getBigDecimal("actrecamt");
|
BigDecimal actrecamt = cas_recbill.getBigDecimal("actrecamt");
|
||||||
|
@ -311,8 +359,8 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple
|
||||||
if (orgcurrency != null){
|
if (orgcurrency != null){
|
||||||
per_recQF.and("currency.id",QCP.equals,orgcurrencyId);
|
per_recQF.and("currency.id",QCP.equals,orgcurrencyId);
|
||||||
}
|
}
|
||||||
per_recQF.and("bizdate",QCP.large_equals,startDate);//收款日期payeedate
|
per_recQF.and("payeedate",QCP.large_equals,startDate);//收款日期payeedate 业务日期bizdate
|
||||||
per_recQF.and("bizdate",QCP.less_equals,overDate);
|
per_recQF.and("payeedate",QCP.less_equals,overDate);
|
||||||
DynamicObject[] per_cas_recbills = BusinessDataServiceHelper.load("cas_recbill", "id,org,org.id,org.number,actrecamt,currency,payertype,customerf7,customerf7", per_recQF.toArray());
|
DynamicObject[] per_cas_recbills = BusinessDataServiceHelper.load("cas_recbill", "id,org,org.id,org.number,actrecamt,currency,payertype,customerf7,customerf7", per_recQF.toArray());
|
||||||
BigDecimal transactions = this.getTransactions(per_cas_recbills);
|
BigDecimal transactions = this.getTransactions(per_cas_recbills);
|
||||||
recLB =recLB.add(transactions); //内部往来收入合计
|
recLB =recLB.add(transactions); //内部往来收入合计
|
||||||
|
@ -332,12 +380,12 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple
|
||||||
per_payQF.and("currency.id",QCP.equals,orgcurrencyId);
|
per_payQF.and("currency.id",QCP.equals,orgcurrencyId);
|
||||||
}
|
}
|
||||||
per_payQF.and("org.id",QCP.equals,orgPkValue);
|
per_payQF.and("org.id",QCP.equals,orgPkValue);
|
||||||
per_payQF.and("bizdate",QCP.large_equals,startDate);//付款日期paydate
|
per_payQF.and("paydate",QCP.large_equals,startDate);//付款日期paydate 业务日期bizdate
|
||||||
per_payQF.and("bizdate",QCP.less_equals,overDate);
|
per_payQF.and("paydate",QCP.less_equals,overDate);
|
||||||
DynamicObject[] per_cas_paybills = BusinessDataServiceHelper.load("cas_paybill", "id,org,org.id,org.number,payeenumber,actpayamt,currency,payeetype,payee", per_payQF.toArray());
|
DynamicObject[] per_cas_paybills = BusinessDataServiceHelper.load("cas_paybill", "id,org,org.id,org.number,payeenumber,actpayamt,currency,payeetype,payee", per_payQF.toArray());
|
||||||
BigDecimal transactionsByfk = this.getTransactionsByfk(per_cas_paybills);
|
HashMap<String, BigDecimal> stringBigDecimalHashMap = this.getTransactionsByfk(per_cas_paybills);
|
||||||
payLB =payLB.add(transactionsByfk); //内部往来收入合计
|
payLB =payLB.add(stringBigDecimalHashMap.get("pay")); //内部往来支出合计
|
||||||
|
recLB = recLB.add(stringBigDecimalHashMap.get("rec"));//内部往来收入合计(同公司收入补充)
|
||||||
for (DynamicObject per_cas_paybill : per_cas_paybills) {
|
for (DynamicObject per_cas_paybill : per_cas_paybills) {
|
||||||
String payNumber = per_cas_paybill.getDynamicObject("org").getString("number");
|
String payNumber = per_cas_paybill.getDynamicObject("org").getString("number");
|
||||||
String recNumber = per_cas_paybill.getString("payeenumber");
|
String recNumber = per_cas_paybill.getString("payeenumber");
|
||||||
|
|
|
@ -19,12 +19,15 @@ import kd.bos.orm.query.QCP;
|
||||||
import kd.bos.orm.query.QFilter;
|
import kd.bos.orm.query.QFilter;
|
||||||
import kd.bos.report.plugin.AbstractReportFormPlugin;
|
import kd.bos.report.plugin.AbstractReportFormPlugin;
|
||||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
import kd.bos.servicehelper.org.OrgUnitServiceHelper;
|
||||||
import kd.sdk.plugin.Plugin;
|
import kd.sdk.plugin.Plugin;
|
||||||
|
|
||||||
|
import java.sql.Array;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报表界面插件
|
* 报表界面插件
|
||||||
|
@ -51,14 +54,14 @@ public class CapitalDayFormListPlugin extends AbstractReportFormPlugin implement
|
||||||
//设置日期范围初始值
|
//设置日期范围初始值
|
||||||
this.getModel().setValue("shkd_firstdate",new Date());
|
this.getModel().setValue("shkd_firstdate",new Date());
|
||||||
this.getModel().setValue("shkd_enddate",new Date());
|
this.getModel().setValue("shkd_enddate",new Date());
|
||||||
//始化公司集团字段显影控制
|
//始化公司集团字段显影控制,逻辑变更代码取消
|
||||||
String shkd_queryorgtype = (String) this.getModel().getValue("shkd_queryorgtype");
|
// String shkd_queryorgtype = (String) this.getModel().getValue("shkd_queryorgtype");
|
||||||
if ("company".equals(shkd_queryorgtype)){
|
// if ("company".equals(shkd_queryorgtype)){
|
||||||
this.getView().setVisible(false,"shkd_filter_group");
|
// this.getView().setVisible(false,"shkd_filter_group");
|
||||||
this.getView().setVisible(false,"shkd_iscontainyy");
|
// this.getView().setVisible(false,"shkd_iscontainyy");
|
||||||
}else if ("group".equals(shkd_queryorgtype)){
|
// }else if ("group".equals(shkd_queryorgtype)){
|
||||||
this.getView().setVisible(false,"shkd_filter_company");
|
// this.getView().setVisible(false,"shkd_filter_company");
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +69,16 @@ public class CapitalDayFormListPlugin extends AbstractReportFormPlugin implement
|
||||||
public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) {
|
public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) {
|
||||||
String name = beforeF7SelectEvent.getProperty().getName();
|
String name = beforeF7SelectEvent.getProperty().getName();
|
||||||
if ("shkd_filter_company".equals(name)){
|
if ("shkd_filter_company".equals(name)){
|
||||||
|
QFilter orgQF = new QFilter("orgpattern.number",QCP.equals,"Orgform02");
|
||||||
|
DynamicObject[] loads = BusinessDataServiceHelper.load("bos_org", "id", orgQF.toArray());
|
||||||
|
List<Long> longs = new ArrayList<>();
|
||||||
|
for (DynamicObject load : loads) {
|
||||||
|
long id = load.getLong("id");
|
||||||
|
longs.add(id);
|
||||||
|
}
|
||||||
|
if (longs.size() > 0){
|
||||||
QFilter accQF = new QFilter("isfinishinit", QCP.equals, "1");//过滤为启用的公司账户
|
QFilter accQF = new QFilter("isfinishinit", QCP.equals, "1");//过滤为启用的公司账户
|
||||||
|
accQF.and("org.id",QCP.in,longs);
|
||||||
DynamicObject[] cas_cashmgtinits = BusinessDataServiceHelper.load("cas_cashmgtinit", "id,org,isfinishinit,startperiod,standardcurrency,exratetable," +
|
DynamicObject[] cas_cashmgtinits = BusinessDataServiceHelper.load("cas_cashmgtinit", "id,org,isfinishinit,startperiod,standardcurrency,exratetable," +
|
||||||
"entrybank.bank_accountbank,entrybank.bank_journalbalance,entrybank.bank_journalsumbalanceadj", accQF.toArray());
|
"entrybank.bank_accountbank,entrybank.bank_journalbalance,entrybank.bank_journalsumbalanceadj", accQF.toArray());
|
||||||
ArrayList<Long> orgIds = new ArrayList<>();
|
ArrayList<Long> orgIds = new ArrayList<>();
|
||||||
|
@ -76,32 +88,35 @@ public class CapitalDayFormListPlugin extends AbstractReportFormPlugin implement
|
||||||
ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
||||||
QFilter payment_qf= new QFilter("id",QCP.in,orgIds);
|
QFilter payment_qf= new QFilter("id",QCP.in,orgIds);
|
||||||
formShowParameter.getListFilterParameter().setFilter(payment_qf);
|
formShowParameter.getListFilterParameter().setFilter(payment_qf);
|
||||||
}else if ("shkd_filter_group".equals(name)){
|
|
||||||
QFilter orgpattern_qf= new QFilter("orgpattern.number",QCP.equals, "Orgform01");
|
|
||||||
ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
|
||||||
formShowParameter.getListFilterParameter().setFilter(orgpattern_qf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// else if ("shkd_filter_group".equals(name)){
|
||||||
|
// QFilter orgpattern_qf= new QFilter("orgpattern.number",QCP.equals, "Orgform01");
|
||||||
|
// ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
||||||
|
// formShowParameter.getListFilterParameter().setFilter(orgpattern_qf);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void propertyChanged(PropertyChangedArgs e) {
|
public void propertyChanged(PropertyChangedArgs e) {
|
||||||
super.propertyChanged(e);
|
super.propertyChanged(e);
|
||||||
String name = e.getProperty().getName();
|
// String name = e.getProperty().getName();
|
||||||
if ("shkd_queryorgtype".equals(name)){
|
// if ("shkd_queryorgtype".equals(name)){
|
||||||
ChangeData[] changeSet = e.getChangeSet();
|
// ChangeData[] changeSet = e.getChangeSet();
|
||||||
Object newValue = changeSet[0].getNewValue();
|
// Object newValue = changeSet[0].getNewValue();
|
||||||
if ("company".equals(newValue)){
|
// if ("company".equals(newValue)){
|
||||||
this.getModel().setValue("shkd_filter_group",null);
|
// this.getModel().setValue("shkd_filter_group",null);
|
||||||
this.getView().setVisible(false,"shkd_filter_group");
|
// this.getView().setVisible(false,"shkd_filter_group");
|
||||||
this.getView().setVisible(false,"shkd_iscontainyy");
|
// this.getView().setVisible(false,"shkd_iscontainyy");
|
||||||
this.getView().setVisible(true,"shkd_filter_company");
|
// this.getView().setVisible(true,"shkd_filter_company");
|
||||||
}else if ("group".equals(newValue)){
|
// }else if ("group".equals(newValue)){
|
||||||
this.getModel().setValue("shkd_filter_company",null);
|
// this.getModel().setValue("shkd_filter_company",null);
|
||||||
this.getView().setVisible(false,"shkd_filter_company");
|
// this.getView().setVisible(false,"shkd_filter_company");
|
||||||
this.getView().setVisible(true,"shkd_filter_group");
|
// this.getView().setVisible(true,"shkd_filter_group");
|
||||||
this.getView().setVisible(true,"shkd_iscontainyy");
|
// this.getView().setVisible(true,"shkd_iscontainyy");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,16 +130,17 @@ public class CapitalDayFormListPlugin extends AbstractReportFormPlugin implement
|
||||||
String shkd_queryorgtype = (String)this.getModel().getValue("shkd_queryorgtype");
|
String shkd_queryorgtype = (String)this.getModel().getValue("shkd_queryorgtype");
|
||||||
if (filterInfo != null) {
|
if (filterInfo != null) {
|
||||||
// 判断集团或公司是否为空
|
// 判断集团或公司是否为空
|
||||||
if("company".equals(shkd_queryorgtype)){//当类型为公司时,校验使用公司不为空
|
// if("company".equals(shkd_queryorgtype)){//当类型为公司时,校验使用公司不为空
|
||||||
DynamicObjectCollection company = (DynamicObjectCollection)filterInfo.getValue("shkd_filter_company");
|
// DynamicObjectCollection company = (DynamicObjectCollection)filterInfo.getValue("shkd_filter_company");
|
||||||
if (company == null || company.isEmpty()){
|
// if (company == null || company.isEmpty()){
|
||||||
this.getView().showTipNotification("使用公司条件不能为空!");
|
// this.getView().showTipNotification("使用公司条件不能为空!");
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
}else if ("group".equals(shkd_queryorgtype)){//当类型为集团时,校验使用集团不为空
|
// }else
|
||||||
DynamicObjectCollection group = (DynamicObjectCollection)filterInfo.getValue("shkd_filter_group");
|
if ("group".equals(shkd_queryorgtype)){//当类型为集团时,校验使用集团不为空
|
||||||
|
DynamicObjectCollection group = (DynamicObjectCollection)filterInfo.getValue("shkd_filter_company");
|
||||||
if (group == null || group.isEmpty()){
|
if (group == null || group.isEmpty()){
|
||||||
this.getView().showTipNotification("使用集团条件不能为空!");
|
this.getView().showTipNotification("使用公司条件不能为空!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue