收款推送sap优化
This commit is contained in:
parent
574336b0f8
commit
56988ec26c
|
|
@ -393,7 +393,6 @@ public class FeeControlApiPlugin extends AbstractFormPlugin implements Plugin {
|
|||
|
||||
/**
|
||||
* 获取当前操作用户工号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getUserCode() {
|
||||
|
|
@ -430,12 +429,12 @@ public class FeeControlApiPlugin extends AbstractFormPlugin implements Plugin {
|
|||
private HashMap<String,Object> getData(String companyCode, Date startDate, Date endDate){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
HashMap<String,Object> data = new HashMap<>(10);
|
||||
data.put("UserCode","GH017994");
|
||||
//data.put("UserCode",this.getUserCode());
|
||||
// data.put("UserCode","GH017994");//测试用,默认余老师账号
|
||||
data.put("UserCode",this.getUserCode());
|
||||
data.put("QueryBeginDate",sdf.format(startDate));
|
||||
data.put("QueryEndDate",sdf.format(endDate));
|
||||
data.put("page","1");
|
||||
data.put("rows","10");
|
||||
data.put("rows","5000");
|
||||
data.put("CompanyCode",companyCode);
|
||||
|
||||
return data;
|
||||
|
|
|
|||
|
|
@ -441,7 +441,6 @@ public class ClearAccountBillOperation extends AbstractOperationServicePlugIn im
|
|||
}else{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String datestr = sdf.format(new Date());
|
||||
// addFilterCondition(IT_LIST, "BUDAT", datestr, datestr);
|
||||
iteminfo.put("BUDAT", datestr);
|
||||
}
|
||||
IT_LIST.add(iteminfo);
|
||||
|
|
@ -543,15 +542,15 @@ public class ClearAccountBillOperation extends AbstractOperationServicePlugIn im
|
|||
String isoCode = prinfo.getDynamicObject("shjh_currency").getString("number");
|
||||
IS_HEADER.put("WAERS",JhzjUtils.getCurrencyCode(isoCode));//币种
|
||||
IS_HEADER.put("XBLNR",prinfo.getString("billno"));//参考凭证号-单据编号 固定长度16位
|
||||
// IS_HEADER.put("BKTXT",customerinfo.getString("name"));//凭证抬头文本 习惯传 供应商||客户名称
|
||||
IS_HEADER.put("BKTXT","上海禾诗家化妆品有限公司");// -- 仅测试
|
||||
IS_HEADER.put("BKTXT",customerinfo.getString("name"));//凭证抬头文本 习惯传 供应商||客户名称
|
||||
// IS_HEADER.put("BKTXT","上海禾诗家化妆品有限公司");// -- 仅测试
|
||||
//添加用户名过滤条件-操作审核按钮的用户(OA用户名)
|
||||
DynamicObject userinfo = BusinessDataServiceHelper.loadSingleFromCache(RequestContext.get().getCurrUserId(), userName);
|
||||
String oauser = userinfo.getString("shjh_oauser");
|
||||
IS_HEADER.put("USNAM",oauser);//用户名
|
||||
//----------------处理详细入参(清账不需要items参数)----------------------
|
||||
String customerCode = customerinfo.getString("number");
|
||||
customerCode = "1005004";//上海禾诗家化妆品有限公司 -- 仅测试
|
||||
// customerCode = "1005004";//上海禾诗家化妆品有限公司 -- 仅测试
|
||||
//----------------处理清账数据入参----------------------
|
||||
DynamicObjectCollection docolls = prinfo.getDynamicObjectCollection("shjh_details");
|
||||
DynamicObject entryinfo;
|
||||
|
|
|
|||
|
|
@ -79,13 +79,14 @@ public class PayBillSubmitOperation extends AbstractOperationServicePlugIn imple
|
|||
BigDecimal applyAmountBigDecimal = new BigDecimal(applyamount);
|
||||
int comparisonResult = applyAmountBigDecimal.compareTo(actpayamt);
|
||||
if (comparisonResult != 0) {
|
||||
this.addErrorMessage(entity,"费控校验未通过不能提交:付款金额不一致");
|
||||
this.addErrorMessage(entity,"费控校验未通过不能提交:付款金额不一致 费控:"+applyamount+" 金蝶:"+actpayamt);
|
||||
return;
|
||||
}
|
||||
|
||||
String assacct = tempData.getString("assacct");//费控-收款银行账号_payeebanknum
|
||||
String payeebanknum = bill.getString("payeebanknum");//金蝶-收款银行账号
|
||||
if (!assacct.equals(payeebanknum)) {
|
||||
this.addErrorMessage(entity,"费控校验未通过不能提交:收款账号不一致");
|
||||
this.addErrorMessage(entity,"费控校验未通过不能提交:收款账号不一致 费控:"+assacct+" 金蝶:"+payeebanknum);
|
||||
return;
|
||||
}
|
||||
// String bebank = tempData.getString("bebank");//收款银行名称-费控是银行简称,先不校验
|
||||
|
|
@ -96,9 +97,8 @@ public class PayBillSubmitOperation extends AbstractOperationServicePlugIn imple
|
|||
// }
|
||||
String bebankNum = tempData.getString("bebankNum");//费控-收款银行联行号_recbanknumber
|
||||
String recbanknumber = bill.getString("payeebank.number");//金蝶-收款银行联行号
|
||||
|
||||
if (!bebankNum.equals(recbanknumber)) {
|
||||
this.addErrorMessage(entity,"费控校验未通过不能提交:收款银行联行号不一致");
|
||||
this.addErrorMessage(entity,"费控校验未通过不能提交:收款银行联行号不一致 费控:"+bebankNum+" 金蝶:"+recbanknumber);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,6 +186,12 @@ public class RecPushVoucherOperation extends AbstractOperationServicePlugIn impl
|
|||
operateErrorInfo.setPkValue(dataEntity.getPkValue());
|
||||
this.operationResult.addErrorInfo(operateErrorInfo);
|
||||
}
|
||||
}else{
|
||||
OperateErrorInfo operateErrorInfo = new OperateErrorInfo();
|
||||
operateErrorInfo.setMessage("SAP返回值为空");
|
||||
operateErrorInfo.setErrorLevel(ErrorLevel.Error.name());
|
||||
operateErrorInfo.setPkValue(dataEntity.getPkValue());
|
||||
this.operationResult.addErrorInfo(operateErrorInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package shjh.jhzj7.fi.fi.plugin.operate;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import kd.bos.context.RequestContext;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
|
|
@ -119,10 +121,25 @@ public class RecRedPushOperation extends AbstractOperationServicePlugIn implemen
|
|||
if (!EsbUtils.isEmpty(response)) {
|
||||
boolean success = ApiUtils.parseResponse(response, billNumber, responseBody, INTERFACE_ID, message);
|
||||
if (success){
|
||||
//TODO sap红冲凭证成功,反写sap凭证号和推送标记
|
||||
recBill.set("shjh_ispushsap",true);
|
||||
SaveServiceHelper.update(recBill);
|
||||
//sap红冲凭证成功,反写sap凭证号和推送标记
|
||||
JSONObject sapReturnData = JSONObject.parseObject(response);
|
||||
JSONObject data = sapReturnData.getJSONObject("data");
|
||||
JSONArray rows = data.getJSONArray("IT_ITEM");
|
||||
JSONObject resultData = rows.getJSONObject(0);
|
||||
String key = resultData.getString("OBJ_KEY");
|
||||
if(EsbUtils.isEmpty(key)){
|
||||
message.append("收款处理【").append(billNumber).append("】:").append("SAP返回的OBJ_KEY为空").append("\n");
|
||||
}else{
|
||||
//sap凭证号
|
||||
recBill.set("shjh_vouchernum",key.length() >= 10 ? key.substring(0, 10) : key);
|
||||
//sap会计年度
|
||||
recBill.set("shjh_sapfiscalyear",key.length() >= 4 ? key.substring(key.length() - 4) : key);
|
||||
recBill.set("shjh_ispushsap",true);//sap已推送标记
|
||||
SaveServiceHelper.update(recBill);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
message.append("收款处理【").append(billNumber).append("】:").append("SAP返回值为空").append("\n");
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
message.append("收款处理【").append(billNumber).append("】:").append(ex.getMessage()).append("\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue