收款推送费控操作,优化注释

This commit is contained in:
yuxueliang0813 2025-04-24 18:12:52 +08:00
parent 20d5d0fd8a
commit 681d4578cf
3 changed files with 27 additions and 26 deletions

View File

@ -193,17 +193,17 @@ public class LoanPushSapOperation extends AbstractOperationServicePlugIn impleme
header.put("FM_RequestCode", billNumber);
//公司编码
header.put("FM_CompanyCode", recBill.getString("org.number"));
//部门编码
//部门编码-从收款分录获取
header.put("FM_DeptCode", recBill.getDynamicObjectCollection("entry").get(0).getString("shjh_deptcode"));
//还款人工号
//还款人工号-从收款分录获取
header.put("FM_UserCode", recBill.getDynamicObjectCollection("entry").get(0).getString("shjh_usercode"));
//todo:收款银行账号
//收款银行账号
header.put("FM_BankCode",recBill.getString("accountbank.number"));
// header.put("FM_BankCode","11016612133000");
//todo:成本中心编码
//成本中心编码
header.put("FM_CostCenterCode", recBill.getString("shjh_costcenter.number"));
// header.put("FM_CostCenterCode", "100100");
//todo:创建人工号
//创建人工号-可能会存在定时任务推送故保持和还款人工号一致
header.put("FM_CreateUserCode", recBill.getDynamicObjectCollection("entry").get(0).getString("shjh_usercode"));
// header.put("FM_CreateUserCode", recBill.getString("creator.number"));
// header.put("FM_CreateUserCode", "GH017994");
@ -213,7 +213,7 @@ public class LoanPushSapOperation extends AbstractOperationServicePlugIn impleme
//附件URL地址
//HashMap<String, String> url = new HashMap<>(2);
//header.put("FM_AttachUr", new ArrayList<>());
//todo:事项描述_摘要
//事项描述_摘要
header.put("Remark", recBill.getString("txt_description"));
List<Map<String, Object>> body = new ArrayList<>();
List<Map<String, Object>> loanRequestList = new ArrayList<>();

View File

@ -77,7 +77,7 @@ public class PaymentPushSapOperation extends AbstractOperationServicePlugIn impl
@Override
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
super.afterExecuteOperationTransaction(e);
//TODO:调用生成预付款退回单接口
//调用生成预付款退回单接口
String operationKey = e.getOperationKey();
if (StringUtils.equals(KEY_PUSH_PAYMENT, operationKey)) {
DynamicObject[] dataEntities = e.getDataEntities();
@ -195,17 +195,17 @@ public class PaymentPushSapOperation extends AbstractOperationServicePlugIn impl
//公司编码
header.put("FM_CompanyCode", recBill.getString("org.number"));
//header.put("FM_CompanyCode", "C021");//测试用
//todo:部门编码
//部门编码-从收款分录获取
header.put("FM_DeptCode", recBill.getDynamicObjectCollection("entry").get(0).getString("shjh_deptcode"));
//todo:供应商编码
//供应商编码
header.put("FM_SupplierCode", getSupOrCusNumber(recBill));
// header.put("FM_SupplierCode", "6000003");
//员工工号
//员工工号-从收款分录获取
header.put("FM_UserCode", recBill.getDynamicObjectCollection("entry").get(0).getString("shjh_usercode"));
//todo:成本中心编码
//成本中心编码
header.put("FM_CostCenterCode", recBill.getString("shjh_costcenter.number"));
//header.put("FM_CostCenterCode", "300100");//测试用
//todo:创建人工号
//创建人工号-可能会存在定时任务推送故保持和员工工号一致
header.put("FM_CreateUserCode", recBill.getDynamicObjectCollection("entry").get(0).getString("shjh_usercode"));
// header.put("FM_CreateUserCode", recBill.getString("creator.number"));
//header.put("FM_CreateUserCode", "GH017994");//测试用
@ -215,7 +215,7 @@ public class PaymentPushSapOperation extends AbstractOperationServicePlugIn impl
//附件URL地址
//HashMap<String, String> url = new HashMap<>(2);
//header.put("FM_AttachUr", new ArrayList<>());
//todo:事项描述_摘要
//事项描述_摘要
header.put("Remark", recBill.getString("txt_description"));
List<Map<String, Object>> body = new ArrayList<>();
List<Map<String, Object>> loanRequestList = new ArrayList<>();

View File

@ -13,9 +13,7 @@ import kd.bos.orm.query.QFilter;
import kd.bos.schedule.executor.AbstractTask;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.OperationServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.sdk.plugin.Plugin;
import shjh.jhzj7.fi.fi.plugin.operate.PaymentPushSapOperation;
import java.util.ArrayList;
import java.util.Map;
@ -29,11 +27,13 @@ public class RecPushFiTask extends AbstractTask implements Plugin {
private final static Log logger = LogFactory.getLog(RecPushFiTask.class);
private static final String KEY_RECEIVING_TYPE="receivingtype.number";
private static final String KEY_RECEIVING_TYPE = "receivingtype.number";//收款类型编号
private static final String KEY_VOUCHER_NUM="shjh_vouchernum";
private static final String KEY_VOUCHER_NUM = "shjh_vouchernum";//sap凭证编号
private static final String KEY_REC_BILL="cas_recbill";
private static final String KEY_REC_BILL = "cas_recbill";//收款单实体标识
private static final String KEY_IS_PUSH_FI = "shjh_ispushfc";//是否已推送费控
@ -41,13 +41,14 @@ public class RecPushFiTask extends AbstractTask implements Plugin {
public void execute(RequestContext requestContext, Map<String, Object> map) throws KDException {
//获取所有符合要求的收款处理单
ArrayList<String> typeList = new ArrayList<>();
typeList.add("109");
typeList.add("103");
QFilter qFilter = new QFilter(KEY_RECEIVING_TYPE, QCP.in, typeList);
qFilter.and(new QFilter(KEY_VOUCHER_NUM,QCP.not_equals,""));
typeList.add("109");//生成员工还款单
typeList.add("103");//生成预付款退回单
QFilter qFilter = new QFilter(KEY_RECEIVING_TYPE, QCP.in, typeList);//只有这两类推送费控
qFilter.and(new QFilter(KEY_VOUCHER_NUM,QCP.not_equals,""));//sap凭证编号不为空
qFilter.and(new QFilter(KEY_IS_PUSH_FI,QCP.equals,"0"));//没有推过费控的
DynamicObject[] recBillList = BusinessDataServiceHelper.load(KEY_REC_BILL, "id", qFilter.toArray());
if (recBillList.length != 0){
ArrayList<Long> ids = new ArrayList<>();
ArrayList<Long> ids = new ArrayList<>(recBillList.length);
for (DynamicObject dynamicObject : recBillList) {
ids.add(dynamicObject.getLong("id"));
}
@ -68,7 +69,7 @@ public class RecPushFiTask extends AbstractTask implements Plugin {
OperationResult operationResult = OperationServiceHelper.executeOperate(operationKey, KEY_REC_BILL, billArray, operateOption);
// 可以根据需要处理 operationResult例如检查是否成功获取返回值等
if (operationResult.isSuccess()) {
logger.info("执行 pushPayment 成功,单据编号:" + dynamicObject.getPkValue());
logger.info("执行 "+operationKey+" 成功,单据编号:" + dynamicObject.getString("billno"));
} else {
logger.error(operationResult.getMessage());
}