收款凭证红冲,费控付款申请接口增加转账附言
This commit is contained in:
parent
02589371e6
commit
959ad0585f
|
|
@ -177,7 +177,7 @@ public class RecRedPushOperation extends AbstractOperationServicePlugIn implemen
|
|||
responseBody.put("requestTime", requestTime);
|
||||
HashMap<String, Object> data = new HashMap<>(1);
|
||||
List<Map<String, Object>> IT_ITEM = new ArrayList<>(1);
|
||||
//TODO 用户名-从红冲单上获取人员,当前操作人可能是定时任务
|
||||
//用户名-从红冲单上获取人员,当前操作人可能是定时任务
|
||||
DynamicObject userinfo = BusinessDataServiceHelper.loadSingleFromCache(RequestContext.get().getCurrUserId(), "bos_user");
|
||||
String oaUser = userinfo.getString("shjh_oauser");
|
||||
//冲销原因
|
||||
|
|
@ -200,7 +200,12 @@ public class RecRedPushOperation extends AbstractOperationServicePlugIn implemen
|
|||
IT_ITEMS.put("BUKRS",recBill.getString("org.number"));//公司代码
|
||||
IT_ITEMS.put("GJAHR",recBill.getString("shjh_sapfiscalyear"));//会计年度
|
||||
IT_ITEMS.put("STGRD","04");//冲销原因 跨期冲销;默认04,冲销日期必传
|
||||
if(EsbUtils.isEmpty(oaUser)){
|
||||
IT_ITEMS.put("UNAME","资金系统");//用户名
|
||||
}else{
|
||||
IT_ITEMS.put("UNAME",oaUser);//用户名
|
||||
}
|
||||
|
||||
SimpleDateFormat sdfdate = new SimpleDateFormat("yyyy-MM-dd");
|
||||
IT_ITEMS.put("BUDAT",sdfdate.format(new Date()));//凭证中的过帐日期
|
||||
IT_ITEM.add(IT_ITEMS);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|||
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
public class VoucherAuditOperation extends AbstractOperationServicePlugIn implements Plugin {
|
||||
|
|
@ -50,12 +51,23 @@ public class VoucherAuditOperation extends AbstractOperationServicePlugIn implem
|
|||
sourcebilltype = pzinfo.getDynamicObject("sourcebilltype").getString("number");
|
||||
if(recbillName.equals(sourcebilltype)){
|
||||
bizbillinfo = BusinessDataServiceHelper.loadSingle(sourcebillid,recbillName);
|
||||
|
||||
//执行收款单推送sap操作,并反馈操作执行结果
|
||||
if (bizbillinfo.getBigDecimal("actrecamt").compareTo(BigDecimal.ZERO) > 0) {
|
||||
operResult = OperationServiceHelper.executeOperate("pushvoucher", recbillName, new DynamicObject[]{bizbillinfo}, operateOption);
|
||||
// 可以根据需要处理 operationResult,例如检查是否成功、获取返回值等
|
||||
if (operResult.isSuccess()) {
|
||||
logger.info("执行收款单 pushvoucher 成功,单据编号:" + bizbillinfo.getString("billno"));
|
||||
}
|
||||
}else{
|
||||
//收款金额为负数 红冲 redpunch
|
||||
operResult = OperationServiceHelper.executeOperate("redpunch", recbillName, new DynamicObject[]{bizbillinfo}, operateOption);
|
||||
if (operResult.isSuccess()) {
|
||||
logger.info("执行收款单 redpunch 成功,单据编号:" + bizbillinfo.getString("billno"));
|
||||
}
|
||||
}
|
||||
|
||||
//可以根据需要处理 operationResult,例如检查是否成功、获取返回值等
|
||||
if (!operResult.isSuccess()){
|
||||
logger.error(operResult.getMessage());
|
||||
List<OperateErrorInfo> allErrorInfo = operResult.getAllErrorInfo();
|
||||
for (OperateErrorInfo errorInfo : allErrorInfo) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
package shjh.jhzj7.fi.fi.webapi;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.drew.lang.annotations.NotNull;
|
||||
import kd.bos.context.RequestContext;
|
||||
import kd.bos.dataentity.OperateOption;
|
||||
|
|
@ -30,7 +27,9 @@ import shjh.jhzj7.fi.fi.webapi.model.ApplyBillModel;
|
|||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* "应付付款申请单接口
|
||||
|
|
@ -56,19 +55,19 @@ public class ApplyBillControler {
|
|||
|
||||
@ApiPostMapping(value = apimenthod, desc = "应付付款申请单接口")
|
||||
public CustomApiResult<ApiResultPayApplyExt> applybill_sync (@NotNull @Valid @ApiRequestBody(value="入参json格式数据") ApplyBillModel applybill) {
|
||||
JSONObject json_body;
|
||||
// JSONObject json_body;
|
||||
String jsonBodyString = null;
|
||||
|
||||
//返回值
|
||||
ApiResultPayApplyExt apiResultExt = new ApiResultPayApplyExt();
|
||||
try {
|
||||
// 解析入参,如果格式不正确,日志记录,并反馈esb
|
||||
json_body = (JSONObject) JSON.toJSON(applybill);
|
||||
jsonBodyString = JSON.toJSONString(json_body);
|
||||
} catch (JSONException e) {
|
||||
handleError("应付付款申请单接口入参异常:" + e.getMessage(), Apimenthod, "费控", null);
|
||||
return handleErrorAndReturn(apiResultExt, "接口入参异常");
|
||||
}
|
||||
// try {
|
||||
// // 解析入参,如果格式不正确,日志记录,并反馈esb
|
||||
// json_body = (JSONObject) JSON.toJSON(applybill);
|
||||
// jsonBodyString = JSON.toJSONString(json_body);
|
||||
// } catch (JSONException e) {
|
||||
// handleError("应付付款申请单接口入参异常:" + e.getMessage(), Apimenthod, "费控", null);
|
||||
// return handleErrorAndReturn(apiResultExt, "接口入参异常");
|
||||
// }
|
||||
// 费控单据编号
|
||||
String fkBillNum = applybill.getFkBillNum();
|
||||
|
||||
|
|
@ -429,6 +428,7 @@ public class ApplyBillControler {
|
|||
ap_payapply.set("shjh_sourcesystem", "B");//费控
|
||||
//唯一值(勿动)
|
||||
ap_payapply.set("shjh_sapuniquevalue",fkBillID + fkEntryID);//费控唯一值 :费控表头ID+费控分录ID
|
||||
ap_payapply.set("shjh_transferremark", applybill.getTransferRemark());//转账附言 20250512 yxl
|
||||
|
||||
OperateOption option= OperateOption.create();
|
||||
option.setVariableValue(OperateOptionConst.IGNOREWARN, String.valueOf(true)); // 不执行警告级别校验器
|
||||
|
|
|
|||
|
|
@ -57,7 +57,16 @@ public class ApplyBillModel implements Serializable {
|
|||
private String fkEntryID;
|
||||
@ApiParam(value="付款类型",required=false,position=25)
|
||||
private String paymenttype;
|
||||
@ApiParam(value="转账附言",required=false,position=26)
|
||||
private String transferRemark;
|
||||
|
||||
public String getTransferRemark() {
|
||||
return transferRemark;
|
||||
}
|
||||
|
||||
public void setTransferRemark(String transferRemark) {
|
||||
this.transferRemark = transferRemark;
|
||||
}
|
||||
|
||||
public void setPaymenttype(String paymenttype) {
|
||||
this.paymenttype = paymenttype;
|
||||
|
|
|
|||
Loading…
Reference in New Issue