红单冲销获取日期、错误提示优化
This commit is contained in:
		
							parent
							
								
									405186b307
								
							
						
					
					
						commit
						cd8d847b80
					
				|  | @ -33,6 +33,7 @@ import java.util.Map; | |||
| 
 | ||||
| /** | ||||
|  * 定期预提记账处理 shjh_cim_depositprein_ext-单据推送sap操作插件 | ||||
|  * | ||||
|  * @author yuxueliang | ||||
|  */ | ||||
| public class DepositpreintSapOperation extends AbstractOperationServicePlugIn implements Plugin { | ||||
|  | @ -50,16 +51,16 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | |||
|     public void beforeExecuteOperationTransaction(BeforeOperationArgs e) { | ||||
|         super.beforeExecuteOperationTransaction(e); | ||||
|         String eok = e.getOperationKey(); | ||||
|         if("sendvoucher".equals(eok)){ | ||||
|         if ("sendvoucher".equals(eok)) { | ||||
|             DynamicObject[] dos = e.getDataEntities(); | ||||
|             DynamicObject prinfo; | ||||
|             for (int i = 0; i < dos.length; i++) { | ||||
|                 prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName()); | ||||
|                 //判断定期预提记账处理单是否已生成金蝶凭证 | ||||
|                 if(!prinfo.getBoolean("isvoucher")){ | ||||
|                 if (!prinfo.getBoolean("isvoucher")) { | ||||
|                     e.setCancelMessage(prinfo.getString("billno") + "未生成金蝶凭证,无法推送SAP"); | ||||
|                     e.setCancel(true); | ||||
|                 }else if(prinfo.getBoolean("shjh_sendsap")){ | ||||
|                 } else if (prinfo.getBoolean("shjh_sendsap")) { | ||||
|                     e.setCancelMessage(prinfo.getString("billno") + "已推送SAP,无需再次推送"); | ||||
|                     e.setCancel(true); | ||||
|                 } | ||||
|  | @ -71,7 +72,7 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | |||
|     public void afterExecuteOperationTransaction(AfterOperationArgs e) { | ||||
|         super.afterExecuteOperationTransaction(e); | ||||
|         String eok = e.getOperationKey(); | ||||
|         if("sendvoucher".equals(eok)){ | ||||
|         if ("sendvoucher".equals(eok)) { | ||||
|             //推送sap凭证接口 | ||||
|             DynamicObject[] dos = e.getDataEntities(); | ||||
|             DynamicObject prinfo;//定期预提记账处理单 | ||||
|  | @ -81,58 +82,58 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | |||
|             Map<String, String> sapMap = SapUtils.getAsstacttypeMap(); | ||||
|             for (int i = 0; i < dos.length; i++) { | ||||
|                 prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName()); | ||||
|                 if(prinfo.getBoolean("shjh_needvoucher") && !prinfo.getBoolean("shjh_sendsap")){ | ||||
|                 if (prinfo.getBoolean("shjh_needvoucher") && !prinfo.getBoolean("shjh_sendsap")) { | ||||
|                     //如果预提记账处理单需要生成凭证且未推送sap的才推送sap | ||||
|                     //判断原蓝单和红单,调用sap不同接口 操作类别 冲销预提收益-红单 预提收益-蓝单 | ||||
|                     if("preint".equals(prinfo.getString("operatetype"))){ | ||||
|                         sapReturnData = sendBlueVoucher(prinfo,sapMap);//蓝单 | ||||
|                         if(sapReturnData != null && "0".equals(sapReturnData.getString("code"))){ | ||||
|                     if ("preint".equals(prinfo.getString("operatetype"))) { | ||||
|                         sapReturnData = sendBlueVoucher(prinfo, sapMap);//蓝单 | ||||
|                         if (sapReturnData != null && "0".equals(sapReturnData.getString("code"))) { | ||||
|                             //解析sap凭证接口返回值 | ||||
|                             respdata = ApiUtils.getResponseData(sapReturnData); | ||||
|                             if(respdata == null){ | ||||
|                                 addErrorInfo(prinfo,"SAP凭证接口返回值为空,详见接口日志"); | ||||
|                             if (respdata == null) { | ||||
|                                 addErrorInfo(prinfo, "SAP凭证接口返回值为空,详见接口日志"); | ||||
|                                 continue; | ||||
|                             } | ||||
|                             //推送sap成功后,反写已推送标记和sap凭证号和年度至预提单中 | ||||
|                             DB.update(DBRoute.of("fi"), updateVoucherFlag, new Object[]{respdata.getNumber(),respdata.getYear(),prinfo.getPkValue()}); | ||||
|                             DB.update(DBRoute.of("fi"), updateVoucherFlag, new Object[]{respdata.getNumber(), respdata.getYear(), prinfo.getPkValue()}); | ||||
|                             this.operationResult.addSuccessPkId(prinfo.getPkValue()); | ||||
|                         }else if(sapReturnData != null){ | ||||
|                             addErrorInfo(prinfo,"推送SAP接口失败:"+sapReturnData.getString("msg")); | ||||
|                         }else{ | ||||
|                             addErrorInfo(prinfo,"推送SAP接口失败,SAP返回值为空;或者金蝶凭证未审核,请检查"); | ||||
|                         } else if (sapReturnData != null) { | ||||
|                             addErrorInfo(prinfo, "推送SAP接口失败:" + sapReturnData.getString("msg")); | ||||
|                         } else { | ||||
|                             addErrorInfo(prinfo, "推送SAP接口失败,SAP返回值为空;或者金蝶凭证未审核,请检查"); | ||||
|                         } | ||||
|                     }else if("reverseint".equals(prinfo.getString("operatetype"))){ | ||||
|                     } else if ("reverseint".equals(prinfo.getString("operatetype"))) { | ||||
|                         sapReturnData = sendRedVoucher(prinfo);//红单 | ||||
|                         if(sapReturnData != null && "0".equals(sapReturnData.getString("code"))){ | ||||
|                         if (sapReturnData != null && "0".equals(sapReturnData.getString("code"))) { | ||||
|                             //解析sap凭证接口返回值 | ||||
|                             JSONObject data = sapReturnData.getJSONObject("data"); | ||||
|                             if(data == null){ | ||||
|                                 addErrorInfo(prinfo,"推送SAP接口失败,SAP返回值data为空"); | ||||
|                             if (data == null) { | ||||
|                                 addErrorInfo(prinfo, "推送SAP接口失败,SAP返回值data为空"); | ||||
|                                 continue; | ||||
|                             } | ||||
|                             JSONArray rows = data.getJSONArray("IT_ITEM"); | ||||
|                             if(rows == null){ | ||||
|                                 addErrorInfo(prinfo,"推送SAP接口失败,SAP返回值IT_ITEM为空"); | ||||
|                             if (rows == null) { | ||||
|                                 addErrorInfo(prinfo, "推送SAP接口失败,SAP返回值IT_ITEM为空"); | ||||
|                                 continue; | ||||
|                             } | ||||
|                             JSONObject resultData = rows.getJSONObject(0); | ||||
|                             if(resultData == null){ | ||||
|                                 addErrorInfo(prinfo,"推送SAP接口失败,SAP返回值IT_ITEM为空"); | ||||
|                             if (resultData == null) { | ||||
|                                 addErrorInfo(prinfo, "推送SAP接口失败,SAP返回值IT_ITEM为空"); | ||||
|                                 continue; | ||||
|                             } | ||||
|                             String key = resultData.getString("OBJ_KEY"); | ||||
|                             if(JhzjUtils.isEmpty(key)){ | ||||
|                                 addErrorInfo(prinfo,"推送SAP接口失败,SAP返回值OBJ_KEY为空"); | ||||
|                             if (JhzjUtils.isEmpty(key)) { | ||||
|                                 addErrorInfo(prinfo, "推送SAP接口失败:"+resultData.getString("ZMESSAGE")); | ||||
|                                 continue; | ||||
|                             } | ||||
|                             //推送sap成功后,反写已推送标记和sap凭证号和年度至预提单中 | ||||
|                             DB.update(DBRoute.of("fi"), updateVoucherFlag, new Object[]{key.length() >= 10 ? key.substring(0, 10) : key, | ||||
|                                     key.length() >= 4 ? key.substring(key.length() - 4) : key, prinfo.getPkValue()}); | ||||
|                             this.operationResult.addSuccessPkId(prinfo.getPkValue()); | ||||
|                         }else if(sapReturnData != null){ | ||||
|                             addErrorInfo(prinfo,"推送SAP接口失败:"+sapReturnData.getString("msg")); | ||||
|                         }else{ | ||||
|                             addErrorInfo(prinfo,"推送SAP接口失败,SAP返回值为空"); | ||||
|                         } else if (sapReturnData != null) { | ||||
|                             addErrorInfo(prinfo, "推送SAP接口失败:" + sapReturnData.getString("msg")); | ||||
|                         } else { | ||||
|                             addErrorInfo(prinfo, "推送SAP接口失败,SAP返回值为空"); | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|  | @ -140,7 +141,7 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | |||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private JSONObject sendRedVoucher(DynamicObject prinfo){ | ||||
|     private JSONObject sendRedVoucher(DynamicObject prinfo) { | ||||
|         //SAP反清账接口入参组装和调用 | ||||
|         JSONArray IT_LIST = new JSONArray(); | ||||
|         JSONObject iteminfo = new JSONObject(); | ||||
|  | @ -158,41 +159,44 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | |||
|         //添加用户名-操作反清账按钮的用户(OA用户名) | ||||
|         DynamicObject userinfo = BusinessDataServiceHelper.loadSingleFromCache(RequestContext.get().getCurrUserId(), userName); | ||||
|         String oauser = userinfo.getString("shjh_oauser"); | ||||
|         if(JhzjUtils.isEmpty(oauser)){ | ||||
|             iteminfo.put("UNAME","资金系统");//用户名 | ||||
|         }else{ | ||||
|             iteminfo.put("UNAME",oauser);//用户名 | ||||
|         if (JhzjUtils.isEmpty(oauser)) { | ||||
|             iteminfo.put("UNAME", "资金系统");//用户名 | ||||
|         } else { | ||||
|             iteminfo.put("UNAME", oauser);//用户名 | ||||
|         } | ||||
|         //添加反清账日期 | ||||
|         long batchnoid = prinfo.getLong("batchnoid"); | ||||
|         if (batchnoid!=0L){ | ||||
|             Date date = this.getSourceDate(batchnoid,iteminfo); | ||||
|             if (date!=null){ | ||||
|                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||||
|                 String datestr = sdf.format(date); | ||||
|                 iteminfo.put("BUDAT", datestr); | ||||
|                 SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy"); | ||||
|                 String datestr2 = sdf2.format(date); | ||||
|                 iteminfo.put("GJAHR", datestr2); | ||||
|             } | ||||
| 
 | ||||
|         Date date = this.getSourceDate(prinfo, iteminfo); | ||||
|         if (date != null) { | ||||
|             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||||
|             String datestr = sdf.format(date); | ||||
|             iteminfo.put("BUDAT", datestr); | ||||
|             SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy"); | ||||
|             String datestr2 = sdf2.format(date); | ||||
|             iteminfo.put("GJAHR", datestr2); | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         IT_LIST.add(iteminfo); | ||||
| 
 | ||||
|         JSONObject sapReturnData = SapUtils.sapReversalAPI(IT_LIST,prinfo.getString("billno")); | ||||
|         JSONObject sapReturnData = SapUtils.sapReversalAPI(IT_LIST, prinfo.getString("billno")); | ||||
|         return sapReturnData; | ||||
|     } | ||||
| 
 | ||||
|     private Date getSourceDate(long batchnoid,JSONObject iteminfo) { | ||||
|         //联查蓝单 | ||||
|         QFilter qFilter = new QFilter("batchnoid", QCP.equals, batchnoid);//批次id | ||||
|         qFilter.and("operatetype",QCP.equals,"preint");//操作类别 | ||||
|     private Date getSourceDate(DynamicObject prinfo, JSONObject iteminfo) { | ||||
|         Long pkValue = prinfo.getLong("batchnoid"); | ||||
|         QFilter qFilter = new QFilter("batchnoid", QCP.equals, pkValue);//批次id | ||||
| 
 | ||||
|         if (pkValue == 0L) { | ||||
|             pkValue = prinfo.getLong("writeoffpreintbillid");; | ||||
|             qFilter = new QFilter("id", QCP.equals, pkValue); | ||||
|         } | ||||
|         qFilter.and("operatetype", QCP.equals, "preint");//操作类别 | ||||
|         DynamicObject depositprein = BusinessDataServiceHelper.loadSingle("cim_depositpreint", qFilter.toArray()); | ||||
|         if (depositprein!=null){ | ||||
|         if (depositprein != null) { | ||||
|             String shjh_pzh = depositprein.getString("shjh_sappzh"); | ||||
|             //添加会计凭证编号 | ||||
|             iteminfo.put("BELNR", shjh_pzh); | ||||
|             Date bizDate=depositprein.getDate("businessdate"); | ||||
|             Date bizDate = depositprein.getDate("businessdate"); | ||||
|             if (bizDate != null) { | ||||
|                 // 使用Calendar增加一个月 | ||||
|                 Calendar calendar = Calendar.getInstance(); | ||||
|  | @ -204,44 +208,44 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | |||
|         return null; // 任意环节为空时返回null | ||||
|     } | ||||
| 
 | ||||
|     private JSONObject sendBlueVoucher(DynamicObject prinfo, Map<String, String> sapMap){ | ||||
|     private JSONObject sendBlueVoucher(DynamicObject prinfo, Map<String, String> sapMap) { | ||||
|         //SAP定期预提收益凭证接口入参组装和调用 | ||||
|         JSONObject IS_HEADER = new JSONObject();//抬头 | ||||
|         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//日期格式化工具 | ||||
|         String companyCode = prinfo.getDynamicObject("org").getString("number"); | ||||
|         IS_HEADER.put("BUKRS",companyCode);//公司代码 | ||||
|         IS_HEADER.put("BLART","SA");//凭证类型-总账类凭证 | ||||
|         IS_HEADER.put("BUKRS", companyCode);//公司代码 | ||||
|         IS_HEADER.put("BLART", "SA");//凭证类型-总账类凭证 | ||||
| 
 | ||||
|         QFilter qFilter = new QFilter("sourcebill", QCP.equals, prinfo.getPkValue()); | ||||
|         DynamicObject voucher = BusinessDataServiceHelper.loadSingle("gl_voucher", qFilter.toArray()); | ||||
|         if (voucher != null) { | ||||
|             IS_HEADER.put("BLDAT",sdf.format(voucher.getDate("bizdate")));//凭证日期-业务日期 | ||||
|             IS_HEADER.put("BUDAT",sdf.format(voucher.getDate("bookeddate")));//过账日期-业务日期 | ||||
|             IS_HEADER.put("BLDAT", sdf.format(voucher.getDate("bizdate")));//凭证日期-业务日期 | ||||
|             IS_HEADER.put("BUDAT", sdf.format(voucher.getDate("bookeddate")));//过账日期-业务日期 | ||||
|         } | ||||
| 
 | ||||
|         String isoCode = prinfo.getDynamicObject("currency").getString("number"); | ||||
|         IS_HEADER.put("WAERS", JhzjUtils.getCurrencyCode(isoCode));//币种 | ||||
|         IS_HEADER.put("XBLNR",prinfo.getString("billno"));//参考凭证号-单据编号 固定长度16位 | ||||
|         IS_HEADER.put("XBLNR", prinfo.getString("billno"));//参考凭证号-单据编号 固定长度16位 | ||||
| //        IS_HEADER.put("BKTXT",prinfo.getString("productname"));//凭证抬头文本 产品名称 | ||||
|         //添加用户名过滤条件-操作审核按钮的用户(OA用户名) | ||||
|         DynamicObject userinfo = BusinessDataServiceHelper.loadSingleFromCache(RequestContext.get().getCurrUserId(), userName); | ||||
|         String oauser = userinfo.getString("shjh_oauser"); | ||||
|         if(JhzjUtils.isEmpty(oauser)){ | ||||
|             IS_HEADER.put("USNAM","资金系统");//用户名 | ||||
|         }else{ | ||||
|             IS_HEADER.put("USNAM",oauser);//用户名 | ||||
|         if (JhzjUtils.isEmpty(oauser)) { | ||||
|             IS_HEADER.put("USNAM", "资金系统");//用户名 | ||||
|         } else { | ||||
|             IS_HEADER.put("USNAM", oauser);//用户名 | ||||
|         } | ||||
| 
 | ||||
|         //----------------处理详细入参--获取对应金蝶凭证-------------------- | ||||
|         JSONArray IT_ITEM = new JSONArray();//详细 | ||||
|         QFilter voucherFilters = new QFilter("sourcebill", QCP.equals, prinfo.getPkValue());//凭证源单ID为预提单 | ||||
|         voucherFilters.and(new QFilter("billstatus",QCP.equals,"C"));//凭证状态已审核 | ||||
|         voucherFilters.and(new QFilter("billstatus", QCP.equals, "C"));//凭证状态已审核 | ||||
|         DynamicObject gl_voucher = BusinessDataServiceHelper.loadSingle(voucherName, | ||||
|                 "id,description,shjh_fjz,sourcebill,entries,entries.account,entries.assgrp,entries.debitlocal,entries.creditlocal,entries.entrydc,entries.edescription,vouchertype", | ||||
|                 voucherFilters.toArray()); | ||||
|         if (null != gl_voucher) { | ||||
|             IS_HEADER.put("BLART", gl_voucher.getString("vouchertype.number"));//根据金蝶凭证类型设置 | ||||
|             if(!JhzjUtils.isEmpty(gl_voucher.getString("description"))){ | ||||
|             if (!JhzjUtils.isEmpty(gl_voucher.getString("description"))) { | ||||
|                 IS_HEADER.put("BKTXT", gl_voucher.getString("description"));//凭证抬头文本-从金蝶凭证中获取 | ||||
|             } | ||||
|             DynamicObjectCollection entries = gl_voucher.getDynamicObjectCollection("entries"); | ||||
|  | @ -261,7 +265,7 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | |||
|                 } | ||||
|                 item.put("SGTXT", entry.getString("edescription"));//凭证行摘要 | ||||
|                 //凭证反记账标识判断,如果凭证上已勾选,则传X给sap | ||||
|                 if(gl_voucher.getBoolean("shjh_fjz")){ | ||||
|                 if (gl_voucher.getBoolean("shjh_fjz")) { | ||||
|                     item.put("XNEGP", "X"); | ||||
|                 } | ||||
|                 //获取贷方金额 | ||||
|  | @ -276,39 +280,39 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | |||
|                     item.put("DMBTR", String.valueOf(creditlocal.negate())); | ||||
|                 } | ||||
|                 assgrpinfo = entry.getDynamicObject("assgrp");//核算维度(弹性域) | ||||
|                 if(assgrpinfo != null){ | ||||
|                 if (assgrpinfo != null) { | ||||
|                     DynamicObjectCollection gl_assist_bd = QueryServiceHelper.query(glbdName, "asstype,assval", | ||||
|                             new QFilter[]{new QFilter("hg.id", QCP.equals, assgrpinfo.getPkValue())}); | ||||
| 
 | ||||
|                     for (int j = 0; j < gl_assist_bd.size(); j++) { | ||||
|                         glassistbd = gl_assist_bd.get(j); | ||||
|                         asstype = glassistbd.getString("asstype");//核算项目类型-对应核算维度的字段名 | ||||
|                         if("f000057".equals(asstype) || "f0001".equals(asstype)){ | ||||
|                         if ("f000057".equals(asstype) || "f0001".equals(asstype)) { | ||||
|                             //t_bas_flex_property 表中获取对应编号 客户-获利段 f0001 客户编码 f000057 | ||||
|                             hsxminfo = QueryServiceHelper.queryOne("bd_customer", "id,name,number", | ||||
|                                     new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值 | ||||
|                             item.put("KUNNR",hsxminfo.getString("number"));//客户 | ||||
|                         }else if("f000005".equals(asstype)){ | ||||
|                             item.put("KUNNR", hsxminfo.getString("number"));//客户 | ||||
|                         } else if ("f000005".equals(asstype)) { | ||||
|                             //供应商 f000005 | ||||
|                             hsxminfo = QueryServiceHelper.queryOne("bd_supplier", "id,name,number", | ||||
|                                     new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值 | ||||
|                             item.put("LIFNR",hsxminfo.getString("number"));//供应商 | ||||
|                         }else if("f000012".equals(asstype)){ | ||||
|                             item.put("LIFNR", hsxminfo.getString("number"));//供应商 | ||||
|                         } else if ("f000012".equals(asstype)) { | ||||
|                             //利润中心 f000012 | ||||
|                             hsxminfo = QueryServiceHelper.queryOne(pcName, "id,name,number", | ||||
|                                     new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值 | ||||
|                             item.put("PRCTR",hsxminfo.getString("number"));//利润中心_利润中心 | ||||
|                         }else if("f000011".equals(asstype)){ | ||||
|                             item.put("PRCTR", hsxminfo.getString("number"));//利润中心_利润中心 | ||||
|                         } else if ("f000011".equals(asstype)) { | ||||
|                             //成本中心 f000011 | ||||
|                             hsxminfo = QueryServiceHelper.queryOne(ccName, "id,name,number", | ||||
|                                     new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值 | ||||
|                             item.put("KOSTL",hsxminfo.getString("number"));//成本中心_成本中心 | ||||
|                         }else if("f000054".equals(asstype) || "f000014".equals(asstype)){ | ||||
|                             item.put("KOSTL", hsxminfo.getString("number"));//成本中心_成本中心 | ||||
|                         } else if ("f000054".equals(asstype) || "f000014".equals(asstype)) { | ||||
|                             //原因码 f000014 | ||||
|                             //付款原因代码 f000054 | ||||
|                             hsxminfo = QueryServiceHelper.queryOne("gl_cashflowitem", "id,name,number", | ||||
|                                     new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值 | ||||
|                             item.put("RSTGR",hsxminfo.getString("number")); | ||||
|                             item.put("RSTGR", hsxminfo.getString("number")); | ||||
|                         } | ||||
|                     } | ||||
|                     gl_assist_bd = QueryServiceHelper.query("gl_assist_txt", "asstype,assval", | ||||
|  | @ -316,35 +320,35 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | |||
|                     for (int j = 0; j < gl_assist_bd.size(); j++) { | ||||
|                         glassistbd = gl_assist_bd.get(j); | ||||
|                         asstype = glassistbd.getString("asstype");//核算项目类型-对应核算维度的字段名 | ||||
|                         if("f000054".equals(asstype)){ | ||||
|                         if ("f000054".equals(asstype)) { | ||||
|                             //原因码 f000054 | ||||
|                             item.put("RSTGR",glassistbd.getString("assval")); | ||||
|                         }else if("f000056".equals(asstype)){ | ||||
|                             item.put("RSTGR", glassistbd.getString("assval")); | ||||
|                         } else if ("f000056".equals(asstype)) { | ||||
|                             //分配编号 f000056 | ||||
|                             item.put("ZUONR",glassistbd.getString("assval")); | ||||
|                         }else if("f000023".equals(asstype)){ | ||||
|                             item.put("ZUONR", glassistbd.getString("assval")); | ||||
|                         } else if ("f000023".equals(asstype)) { | ||||
|                             //税码 f000023 | ||||
|                             item.put("MWSKZ",glassistbd.getString("assval")); | ||||
|                         }else if("f000031".equals(asstype)){ | ||||
|                             item.put("MWSKZ", glassistbd.getString("assval")); | ||||
|                         } else if ("f000031".equals(asstype)) { | ||||
|                             //税基 f000031 | ||||
|                             item.put("FWBAS",glassistbd.getString("assval")); | ||||
|                         }else if("f000060".equals(asstype)){ | ||||
|                             item.put("FWBAS", glassistbd.getString("assval")); | ||||
|                         } else if ("f000060".equals(asstype)) { | ||||
|                             //行项目的参考码 | ||||
|                             item.put("XREF3",glassistbd.getString("assval")); | ||||
|                         }else if(sapMap.containsKey(asstype)){ | ||||
|                             item.put(sapMap.get(asstype),glassistbd.getString("assval")); | ||||
|                             item.put("XREF3", glassistbd.getString("assval")); | ||||
|                         } else if (sapMap.containsKey(asstype)) { | ||||
|                             item.put(sapMap.get(asstype), glassistbd.getString("assval")); | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|                 IT_ITEM.add(item); | ||||
|             } | ||||
|         }else{ | ||||
|         } else { | ||||
|             String billNo = prinfo.getString("billno"); | ||||
|             logger.error("无法获取定期预提记账处理单[" + billNo + "]关联的凭证信息,凭证不存在或未审核"); | ||||
|             return null; | ||||
|         } | ||||
|         //组装参数调用推送sap凭证接口 | ||||
|         JSONObject sapReturnData = SapUtils.sapTransactionAPI(IS_HEADER,IT_ITEM,null,prinfo.getString("billno")); | ||||
|         JSONObject sapReturnData = SapUtils.sapTransactionAPI(IS_HEADER, IT_ITEM, null, prinfo.getString("billno")); | ||||
|         return sapReturnData; | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue