资金计划判断明细维度的期间
This commit is contained in:
parent
cee95af175
commit
6e39061530
|
|
@ -33,7 +33,7 @@ import java.text.SimpleDateFormat;
|
|||
*/
|
||||
public class RevenueBillOperation extends AbstractOperationServicePlugIn implements Plugin {
|
||||
|
||||
private static final String updateVoucherFlag = "update t_cim_revenue set fk_shjh_sendsap=1,shjh_sappzh=? where fid=?;";
|
||||
private static final String updateVoucherFlag = "update t_cim_revenue set fk_shjh_sendsap=1,fk_shjh_sappzh=? where fid=?;";
|
||||
private static final String userName = "bos_user";//用户
|
||||
private static final String voucherName = "gl_voucher";//凭证
|
||||
private static final String pcName = "shjh_pc";//利润中心
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ public class FundPlanCollectionTask extends AbstractTask implements Plugin {
|
|||
JSONObject json_obj;//入参主对象
|
||||
JSONArray items;//计划科目明细
|
||||
String reportPeriodCode;//编报期间的编号
|
||||
DynamicObject detailPeriodInfo;//明细期间
|
||||
DynamicObject reportOrg;//编报主体对象
|
||||
DynamicObject accountInfo;//资金计划科目
|
||||
String sybnum;//事业部编号-编报主体的编号
|
||||
|
|
@ -96,11 +97,16 @@ public class FundPlanCollectionTask extends AbstractTask implements Plugin {
|
|||
//非叶子节点的数据,不处理
|
||||
continue;
|
||||
}
|
||||
detailPeriodInfo = entryinfo.getDynamicObject("periodmem");
|
||||
if(detailPeriodInfo == null){
|
||||
//无明细期间,比如备注列或非金额列,不处理
|
||||
continue;
|
||||
}
|
||||
accountnum = accountInfo.getString("number");
|
||||
JSONObject itemInfo = new JSONObject();
|
||||
itemInfo.put("currencyCode",entryinfo.getDynamicObject("currencymem").getString("number"));//币别 code
|
||||
itemInfo.put("subjectCode",accountnum);//计划科目 code
|
||||
months = entryinfo.getDynamicObject("periodmem").getString("number");
|
||||
months = detailPeriodInfo.getString("number");
|
||||
itemInfo.put("entryPeriodCode",months);//主维度数据分录期间 code
|
||||
//组装度量值
|
||||
JSONArray mms = new JSONArray(1);//科目的度量值明细,目前只写入计划参考数
|
||||
|
|
@ -108,6 +114,9 @@ public class FundPlanCollectionTask extends AbstractTask implements Plugin {
|
|||
//PLANREFERENCEAMT 计划参考值 ACTMAT 已执行额度
|
||||
mmInfo.put("templateMetricType","ACTMAT");//度量值预置类型
|
||||
mmInfo.put("amount",acctamountMap.get(months+accountnum));//写入金额-从SAP接口中汇总
|
||||
logger.info(billno+"收款计划实际数入参 months "+months);
|
||||
logger.info(billno+"收款计划实际数入参 accountnum "+accountnum);
|
||||
logger.info(billno+"收款计划实际数"+acctamountMap.get(months+accountnum));
|
||||
mmInfo.put("amountUnit","one");//金额单位 one元 thousand千元 ten_thousand 万元
|
||||
mms.add(mmInfo);
|
||||
itemInfo.put("metricMembers",mms);//度量值列表
|
||||
|
|
@ -174,7 +183,7 @@ public class FundPlanCollectionTask extends AbstractTask implements Plugin {
|
|||
}else{
|
||||
acctamountMap.put(mapkey,amount);
|
||||
}
|
||||
|
||||
logger.info("SAP应收已清对应资金科目"+mapkey);
|
||||
//根据品牌和事业部关系,将该笔金额归属到事业部上
|
||||
// ppsybinfo = BusinessDataServiceHelper.loadSingleFromCache(ppsybName,new QFilter[]{new QFilter("shjh_productgroup.number", QCP.equals, productnum)});
|
||||
// if(ppsybinfo != null){
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import java.util.*;
|
|||
*/
|
||||
public class FundPlanPaymentTask extends AbstractTask implements Plugin {
|
||||
|
||||
private static final String entityName = "fpm_report";//资金计划编制 t_fpm_report
|
||||
private static final String entityName = "fpm_report";//资金计划编制 t_fpm_report 维度分表 t_fpm_reportdatamain
|
||||
private static final String payReceName = "shjh_request_account";//付款申请单_资金计划科目配置表
|
||||
// private static final String ppsybName = "shjh_ejbm_syb";//二级部门和事业部对应关系 tk_shjh_pg
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ public class FundPlanPaymentTask extends AbstractTask implements Plugin {
|
|||
// qFilter.and("name", QCP.equals, " 编制表");//报表名称--非报表类型名称,注释此过滤条件
|
||||
qFilter.and("enable", QCP.equals, "1");//是否可用
|
||||
qFilter.and("reportplantype", QCP.equals, "reportplan");//报表类型-计划编制
|
||||
DynamicObject[] collection = BusinessDataServiceHelper.load(entityName, "id,maindimentry", qFilter.toArray());
|
||||
DynamicObject[] collection = BusinessDataServiceHelper.load(entityName, "id,maindimentry.id", qFilter.toArray());
|
||||
if(collection.length > 0){
|
||||
//调用SAP应付未清接口,按照事业部、月份、计划科目汇总金额
|
||||
Map<String, BigDecimal> acctamountMap = getSapAR();
|
||||
|
|
@ -64,6 +64,7 @@ public class FundPlanPaymentTask extends AbstractTask implements Plugin {
|
|||
JSONObject json_obj;//入参主对象
|
||||
JSONArray items;//计划科目明细
|
||||
String reportPeriodCode;//编报期间的编号
|
||||
DynamicObject detailPeriodInfo;//明细期间
|
||||
DynamicObject reportOrg;//编报主体对象
|
||||
DynamicObject accountInfo;//资金计划科目
|
||||
String sybnum;//编报主体的编号
|
||||
|
|
@ -79,7 +80,7 @@ public class FundPlanPaymentTask extends AbstractTask implements Plugin {
|
|||
maindimentrys = doinfo.getDynamicObjectCollection("maindimentry");//主维度分录
|
||||
if(maindimentrys.isEmpty()){
|
||||
//自动触发调用保存操作,现在测试出来,前台保存后,才会有这个维度分录
|
||||
// doinfo = BusinessDataServiceHelper.loadSingle(doinfo.getPkValue(),entityName);
|
||||
doinfo = BusinessDataServiceHelper.loadSingle(doinfo.getPkValue(),entityName);
|
||||
OperationServiceHelper.executeOperate("save", entityName, new DynamicObject[]{doinfo}, option);
|
||||
doinfo = BusinessDataServiceHelper.loadSingle(doinfo.getPkValue(),entityName);
|
||||
maindimentrys = doinfo.getDynamicObjectCollection("maindimentry");//主维度分录
|
||||
|
|
@ -109,11 +110,16 @@ public class FundPlanPaymentTask extends AbstractTask implements Plugin {
|
|||
//非叶子节点的数据,不处理
|
||||
continue;
|
||||
}
|
||||
detailPeriodInfo = entryinfo.getDynamicObject("periodmem");
|
||||
if(detailPeriodInfo == null){
|
||||
//无明细期间,比如备注列或非金额列,不处理
|
||||
continue;
|
||||
}
|
||||
accountnum = accountInfo.getString("number");
|
||||
JSONObject itemInfo = new JSONObject();
|
||||
itemInfo.put("currencyCode",entryinfo.getDynamicObject("currencymem").getString("number"));//币别 code
|
||||
itemInfo.put("subjectCode",accountnum);//计划科目 code
|
||||
months = entryinfo.getDynamicObject("periodmem").getString("number");
|
||||
months = detailPeriodInfo.getString("number");
|
||||
itemInfo.put("entryPeriodCode",months);//主维度数据分录期间 code
|
||||
//组装度量值
|
||||
JSONArray mms = new JSONArray(1);//科目的度量值明细,目前只写入计划参考数
|
||||
|
|
|
|||
Loading…
Reference in New Issue