退预付款、员工还款查询接口联调
This commit is contained in:
parent
57d4c77696
commit
6b86745905
|
|
@ -28,9 +28,12 @@ public class ClaimBillFormPlugin extends AbstractFormPlugin implements Plugin {
|
|||
@Override
|
||||
public void afterBindData(EventObject e) {
|
||||
super.afterBindData(e);
|
||||
//隐藏关联按钮
|
||||
this.getView().setVisible(false,ClaimFieldsInfo.ASS_PAYMENT);
|
||||
this.getView().setVisible(false,ClaimFieldsInfo.ASS_LOAN);
|
||||
String value = (String) this.getModel().getValue("billstatus");
|
||||
if (!"A".equals(value)){
|
||||
this.getView().setEnable(false,ClaimFieldsInfo.ASS_LOAN);
|
||||
this.getView().setEnable(false,ClaimFieldsInfo.ASS_PAYMENT);
|
||||
}
|
||||
//按钮显隐初始化
|
||||
initShowFields();
|
||||
}
|
||||
|
||||
|
|
@ -86,12 +89,26 @@ public class ClaimBillFormPlugin extends AbstractFormPlugin implements Plugin {
|
|||
setPaymentType();
|
||||
break;
|
||||
default:
|
||||
hideButton();
|
||||
break;
|
||||
}
|
||||
}
|
||||
private void showPaymentButton(){ this.getView().setVisible(true,ClaimFieldsInfo.ASS_PAYMENT);}
|
||||
private void showPaymentButton(){
|
||||
this.getView().setVisible(true,ClaimFieldsInfo.ASS_PAYMENT);
|
||||
this.getView().setVisible(false,ClaimFieldsInfo.ASS_LOAN);
|
||||
}
|
||||
|
||||
private void showLoanButton(){ this.getView().setVisible(true,ClaimFieldsInfo.ASS_LOAN);}
|
||||
private void hideButton(){
|
||||
this.getView().setVisible(false,ClaimFieldsInfo.ASS_LOAN);
|
||||
this.getView().setVisible(false,ClaimFieldsInfo.ASS_PAYMENT);
|
||||
|
||||
}
|
||||
|
||||
private void showLoanButton(){
|
||||
this.getView().setVisible(true,ClaimFieldsInfo.ASS_LOAN);
|
||||
this.getView().setVisible(false,ClaimFieldsInfo.ASS_PAYMENT);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 成本中心赋值
|
||||
|
|
|
|||
|
|
@ -169,66 +169,7 @@ public class FeeControlApiPlugin extends AbstractFormPlugin implements Plugin {
|
|||
data.put("SupplierCode", supplierCode);
|
||||
data.put("IsWriteOffDetail", true);
|
||||
|
||||
//String response = ApiUtils.sendPost(head, body, "https://hipint-stg.jahwa.com.cn:6443/gateway/HIP_ReceiveFromFM/1.0/fm/send");
|
||||
String response = "{\n" +
|
||||
" \"rootContextID\": \"8as6dfasd6f98as7d6f9a98sd76f\",\n" +
|
||||
" \"code\": \"0\",\n" +
|
||||
" \"msg\": \"成功\",\n" +
|
||||
" \"data\": {\n" +
|
||||
" \"total\": 1,\n" +
|
||||
" \"LoanItems\": [\n" +
|
||||
" {\n" +
|
||||
" \"ID\": \"fc7443ac-9f85-4d17-a7ee-5620330f28a6\",\n" +
|
||||
" \"RequestCode\": \"YFK2025010900001\",\n" +
|
||||
" \"RequestName\": \"2025-01-09对公预付款单\",\n" +
|
||||
" \"RequestAmt\": 111,\n" +
|
||||
" \"RequestDate\": \"2025-01-09 11:29:22\",\n" +
|
||||
" \"GLDate\": \"2025-01-09 00:00:00\",\n" +
|
||||
" \"RequestUserName\": \"余超\",\n" +
|
||||
" \"UserCode\": \"HCS2001\",\n" +
|
||||
" \"DeptCode\": \"1000001\",\n" +
|
||||
" \"AvailableAmt\": 80.5,\n" +
|
||||
" \"SupplierId\": 89948,\n" +
|
||||
" \"SupplierId_Name\": \"品销宝\",\n" +
|
||||
" \"CompanyCode\": \"C021\",\n" +
|
||||
" \"CompanyName\": \"上海家化电子商务有限公司\",\n" +
|
||||
" \"RequestRemark\": \"测试\",\n" +
|
||||
" \"StrColumn20\": \"1700000001\",\n" +
|
||||
" \"LoanDetailInfo\": [\n" +
|
||||
" {\n" +
|
||||
" \"BillHeaderID\": \"fc7443ac-9f85-4d17-a7ee-5620330f28a6\",\n" +
|
||||
" \"PoOrderNo\": \"YFKTH001\",\n" +
|
||||
" \"PoOrderColNo\": \"001\",\n" +
|
||||
" \"DetailID\": \"d7bc66bf-11e7-4ef5-9d98-80881c1caff7\",\n" +
|
||||
" \"ApplyAmt\": 111,\n" +
|
||||
" \"ThisAmt\": null,\n" +
|
||||
" \"AvailableAmt\": 80.5,\n" +
|
||||
" \"RequestCode\": \"YFK2025010900001\",\n" +
|
||||
" \"RequestName\": \"2025-01-09对公预付款单\",\n" +
|
||||
" \"RequestAmt\": 111,\n" +
|
||||
" \"InitialAmount\": 111,\n" +
|
||||
" \"Remark\": null,\n" +
|
||||
" \"CreatedDate\": null,\n" +
|
||||
" \"DetailRemark\": null,\n" +
|
||||
" \"ExpenseItemName\": null,\n" +
|
||||
" \"CurrencyId\": 0,\n" +
|
||||
" \"BillAvailableAmt\": 80.5\n" +
|
||||
" }\n" +
|
||||
" ]\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"VoucherItems\": [\n" +
|
||||
" {\n" +
|
||||
" \"BillHeaderID\": \"fc7443ac-9f85-4d17-a7ee-5620330f28a6\",\n" +
|
||||
" \"COAItemFullName\": \"1123900000 预付账款\",\n" +
|
||||
" \"COAItemCode\": \"1123900000\",\n" +
|
||||
" \"COAItemName\": \"预付账款\",\n" +
|
||||
" \"ReasonCode\": \"089\",\n" +
|
||||
" \"ReasonCodeName\": \"支付的其他与经营活动\"\n" +
|
||||
" }\n" +
|
||||
" ]\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
String response = ApiUtils.sendPost(head, body, "https://hipint-stg.jahwa.com.cn:6443/gateway/HIP_ReceiveFromFM/1.0/fm/send");
|
||||
if (response != null) {
|
||||
Boolean result = parseResponse(response, billNumber, String.valueOf(body), "预付款单清单查询接口");
|
||||
if (result) {
|
||||
|
|
@ -253,96 +194,7 @@ public class FeeControlApiPlugin extends AbstractFormPlugin implements Plugin {
|
|||
try {
|
||||
HashMap<String, String> head = ApiUtils.buildHead(INTERFACE_ID2,RECEIVER_ID);
|
||||
HashMap<String, Object> body = ApiUtils.buildBody(companyCode, this.getUserCode(), startDate, endDate);
|
||||
//String response = ApiUtils.sendPost(head, body, "https://hipint-stg.jahwa.com.cn:6443/gateway/HIP_ReceiveFromFM/1.0/fm/send");
|
||||
String response="{\n" +
|
||||
" \"rootContextID\": \"8as6dfasd6f98as7d6f9a98sd76f\",\n" +
|
||||
" \"code\": \"0\",\n" +
|
||||
" \"msg\": \"成功\",\n" +
|
||||
" \"data\": {\n" +
|
||||
" \"total\": 3,\n" +
|
||||
" \"LoanItems\": [\n" +
|
||||
" {\n" +
|
||||
" \"ID\": \"a50547a4-d661-486b-a5c0-adecdbe958b9\",\n" +
|
||||
" \"RequestCode\": \"JKY2025011400001\",\n" +
|
||||
" \"RequestName\": \"财务及分销系统余超2025-01-14员工借款单\",\n" +
|
||||
" \"RequestDeptID\": \"77ace8b5-557e-45d9-a3cf-e4831ec37231\",\n" +
|
||||
" \"RequestAmt\": 111,\n" +
|
||||
" \"RequestDate\": \"2025-01-14 14:57:13\",\n" +
|
||||
" \"GLDate\": \"2025-01-14 00:00:00\",\n" +
|
||||
" \"RequestDeptName\": \"财务及分销系统\",\n" +
|
||||
" \"ProjectName\": null,\n" +
|
||||
" \"RequestUserID\": \"ce989821-2bcb-45b9-a278-230d3ce627f3\",\n" +
|
||||
" \"RequestUserName\": \"余超\",\n" +
|
||||
" \"UserCode\": \"HCS2001\",\n" +
|
||||
" \"DeptCode\": \"1000001\",\n" +
|
||||
" \"RequestUserNumber\": null,\n" +
|
||||
" \"AvailableAmt\": 111,\n" +
|
||||
" \"CurrencyId\": 10510,\n" +
|
||||
" \"CurrencyName\": \"人民币\",\n" +
|
||||
" \"StrColumn6\": \"6217001180014130648\",\n" +
|
||||
" \"StrColumn7\": \"建设银行\",\n" +
|
||||
" \"CompanyCode\": \"C001\",\n" +
|
||||
" \"CompanyName\": \"上海家化联合股份有限公司\",\n" +
|
||||
" \"RequestRemark\": \"上传\",\n" +
|
||||
" \"StrColumn20\": \"1600000001\",\n" +
|
||||
" \"LoanDetailInfo\": null\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"ID\": \"b60358b5-e762-497b-b6d1-bdfdfbe123c4\",\n" +
|
||||
" \"RequestCode\": \"JKY2025021000002\",\n" +
|
||||
" \"RequestName\": \"技术部张三2025-02-10员工借款单\",\n" +
|
||||
" \"RequestDeptID\": \"88bdf9d1-9a8d-44f7-bfa1-0ab7893cd321\",\n" +
|
||||
" \"RequestAmt\": 500,\n" +
|
||||
" \"RequestDate\": \"2025-02-10 09:30:00\",\n" +
|
||||
" \"GLDate\": \"2025-02-10 00:00:00\",\n" +
|
||||
" \"RequestDeptName\": \"技术部\",\n" +
|
||||
" \"ProjectName\": \"ERP升级项目\",\n" +
|
||||
" \"RequestUserID\": \"ab123456-7890-1234-5678-abcdef123456\",\n" +
|
||||
" \"RequestUserName\": \"张三\",\n" +
|
||||
" \"UserCode\": \"JS2025\",\n" +
|
||||
" \"DeptCode\": \"2000002\",\n" +
|
||||
" \"RequestUserNumber\": \"003\",\n" +
|
||||
" \"AvailableAmt\": 300,\n" +
|
||||
" \"CurrencyId\": 10510,\n" +
|
||||
" \"CurrencyName\": \"人民币\",\n" +
|
||||
" \"StrColumn6\": \"6225881234567890\",\n" +
|
||||
" \"StrColumn7\": \"工商银行\",\n" +
|
||||
" \"CompanyCode\": \"C002\",\n" +
|
||||
" \"CompanyName\": \"北京科技有限公司\",\n" +
|
||||
" \"RequestRemark\": \"差旅借款\",\n" +
|
||||
" \"StrColumn20\": \"1600000002\",\n" +
|
||||
" \"LoanDetailInfo\": null\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"ID\": \"c78945c3-f983-4d7e-c3b2-3456fdbe456a\",\n" +
|
||||
" \"RequestCode\": \"JKY2025030100003\",\n" +
|
||||
" \"RequestName\": \"市场部李四2025-03-01员工借款单\",\n" +
|
||||
" \"RequestDeptID\": \"99ace8d5-1234-45d9-a3cf-9876cde45678\",\n" +
|
||||
" \"RequestAmt\": 880,\n" +
|
||||
" \"RequestDate\": \"2025-03-01 11:45:00\",\n" +
|
||||
" \"GLDate\": \"2025-03-01 00:00:00\",\n" +
|
||||
" \"RequestDeptName\": \"市场部\",\n" +
|
||||
" \"ProjectName\": null,\n" +
|
||||
" \"RequestUserID\": \"cd456789-1234-9876-5432-ba9876def123\",\n" +
|
||||
" \"RequestUserName\": \"李四\",\n" +
|
||||
" \"UserCode\": \"SC2025\",\n" +
|
||||
" \"DeptCode\": \"3000003\",\n" +
|
||||
" \"RequestUserNumber\": \"007\",\n" +
|
||||
" \"AvailableAmt\": 880,\n" +
|
||||
" \"CurrencyId\": 10510,\n" +
|
||||
" \"CurrencyName\": \"人民币\",\n" +
|
||||
" \"StrColumn6\": \"6230580001234567\",\n" +
|
||||
" \"StrColumn7\": \"农业银行\",\n" +
|
||||
" \"CompanyCode\": \"C003\",\n" +
|
||||
" \"CompanyName\": \"广州市场发展有限公司\",\n" +
|
||||
" \"RequestRemark\": \"项目启动备用金\",\n" +
|
||||
" \"StrColumn20\": \"1600000003\",\n" +
|
||||
" \"LoanDetailInfo\": null\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"VoucherItems\": []\n" +
|
||||
" }\n" +
|
||||
"}\n";
|
||||
String response = ApiUtils.sendPost(head, body, "https://hipint-stg.jahwa.com.cn:6443/gateway/HIP_ReceiveFromFM/1.0/fm/send");
|
||||
if (response != null) {
|
||||
Boolean result = parseResponse(response, billNumber, String.valueOf(body), "借款单清单查询接口");
|
||||
if (result) {
|
||||
|
|
@ -365,7 +217,8 @@ public class FeeControlApiPlugin extends AbstractFormPlugin implements Plugin {
|
|||
hideLoanFields();
|
||||
JSONObject root = JSONObject.parseObject(response);
|
||||
JSONObject data = root.getJSONObject("data");
|
||||
JSONArray rows = data.getJSONArray("LoanItems");
|
||||
JSONObject data2 = data.getJSONObject("data");
|
||||
JSONArray rows = data2.getJSONArray("LoanItems");
|
||||
DynamicObjectCollection entry = this.getModel().getEntryEntity(ENTRY_KEY);
|
||||
entry.clear();
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
|
|
@ -401,8 +254,8 @@ public class FeeControlApiPlugin extends AbstractFormPlugin implements Plugin {
|
|||
this.getModel().setValue("shjh_fiscalyear", top.getString("GLDate").substring(0, 4), i);
|
||||
this.getModel().setValue("shjh_billheaderid", detail.getString("BillHeaderID"), i);
|
||||
this.getModel().setValue("shjh_detailid", detail.getString("DetailID"), i);
|
||||
this.getModel().setValue("shjh_usercode", top.getString("UserCode"), i);
|
||||
this.getModel().setValue("shjh_deptcode", top.getString("DeptCode"), i);
|
||||
this.getModel().setValue("shjh_usercode", top.getString("RequestUserCode"), i);
|
||||
this.getModel().setValue("shjh_deptcode", top.getString("RequestDeptCode"), i);
|
||||
} catch (Exception e) {
|
||||
logger.error("预付单赋值异常: " + e.getMessage(), e);
|
||||
}
|
||||
|
|
@ -418,7 +271,8 @@ public class FeeControlApiPlugin extends AbstractFormPlugin implements Plugin {
|
|||
hidePaymentFields();
|
||||
JSONObject root = JSONObject.parseObject(response);
|
||||
JSONObject data = root.getJSONObject("data");
|
||||
JSONArray rows = data.getJSONArray("LoanItems");
|
||||
JSONObject data2 = data.getJSONObject("data");
|
||||
JSONArray rows = data2.getJSONArray("LoanItems");
|
||||
DynamicObjectCollection entry = this.getModel().getEntryEntity(ENTRY_KEY);
|
||||
entry.clear();
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
|
|
@ -446,8 +300,8 @@ public class FeeControlApiPlugin extends AbstractFormPlugin implements Plugin {
|
|||
this.getModel().setValue("shjh_verificationnum", top.getString("StrColumn20"), i);
|
||||
this.getModel().setValue("shjh_fiscalyear", top.getString("GLDate").substring(0, 4), i);
|
||||
this.getModel().setValue("shjh_billheaderid", top.getString("ID"), i);
|
||||
this.getModel().setValue("shjh_usercode", top.getString("UserCode"), i);
|
||||
this.getModel().setValue("shjh_deptcode", top.getString("DeptCode"), i);
|
||||
this.getModel().setValue("shjh_usercode", top.getString("RequestUserCode"), i);
|
||||
this.getModel().setValue("shjh_deptcode", top.getString("RequestDeptCode"), i);
|
||||
} catch (Exception e) {
|
||||
logger.error("借款单赋值异常: " + e.getMessage(), e);
|
||||
}
|
||||
|
|
@ -559,19 +413,19 @@ public class FeeControlApiPlugin extends AbstractFormPlugin implements Plugin {
|
|||
EsbUtils.saveLog(billNumber, apiName, body, response, true, "ESBQueryApi", "查询成功");
|
||||
break;
|
||||
case "1":
|
||||
this.getView().showMessage("服务异常");
|
||||
this.getView().showMessage("服务异常:"+result.getString("msg"));
|
||||
EsbUtils.saveLog(billNumber, apiName, body, response, false, "ESBQueryApi", "服务异常");
|
||||
break;
|
||||
case "2":
|
||||
this.getView().showMessage("三方服务异常");
|
||||
this.getView().showMessage("三方服务异常:"+result.getString("msg"));
|
||||
EsbUtils.saveLog(billNumber, apiName, body, response, false, "ESBQueryApi", "三方服务异常");
|
||||
break;
|
||||
case "3":
|
||||
this.getView().showMessage("业务异常");
|
||||
this.getView().showMessage("业务异常:"+result.getString("msg"));
|
||||
EsbUtils.saveLog(billNumber, apiName, body, response, false, "ESBQueryApi", "业务异常");
|
||||
break;
|
||||
default:
|
||||
this.getView().showMessage("未知异常");
|
||||
this.getView().showMessage(result.getString("msg"));
|
||||
EsbUtils.saveLog(billNumber, apiName, body, response, false, "ESBQueryApi", "未知异常");
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,14 +42,15 @@ public class RecBillToClearBillTask extends AbstractTask implements Plugin {
|
|||
// 【SAP凭证号】≠空 and
|
||||
// 【收款金额】>0 and
|
||||
// 【审核日期】T+1日下推T及T之前收款单
|
||||
QFilter qFilter = new QFilter(KEY_STATUS, QCP.equals, "D");
|
||||
QFilter qFilter = new QFilter(KEY_STATUS, QCP.equals, "A");
|
||||
qFilter.and(KEY_VOUCHER_NUM, QCP.not_equals, "");
|
||||
qFilter.and(KEY_ACT_RECT_AMOUNT, QCP.large_than, BigDecimal.ZERO);
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(new Date());
|
||||
cal.add(Calendar.DAY_OF_YEAR, -1); // 当前日期减1天
|
||||
Date yesterday = cal.getTime();
|
||||
qFilter.and(KEY_AUDIT_DATE, QCP.less_than, yesterday);
|
||||
//qFilter.and(KEY_AUDIT_DATE, QCP.less_than, yesterday);
|
||||
qFilter.and("billno", QCP.equals, "SKZJ202412300006");
|
||||
|
||||
DynamicObject[] collection = BusinessDataServiceHelper.load(srcEntityName, "id", qFilter.toArray());
|
||||
if (collection.length!=0){
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class ApiUtils {
|
|||
body.put("rootContextID",rootContextId);
|
||||
body.put("requestTime",requestTime);
|
||||
HashMap<String,Object> data = new HashMap<>(10);
|
||||
data.put("UserCode",userCode);
|
||||
data.put("UserCode","GH017994");
|
||||
data.put("QueryBeginDate",sdf.format(queryBeginDate));
|
||||
data.put("QueryEndDate",sdf.format(queryEndDate));
|
||||
data.put("page","1");
|
||||
|
|
|
|||
Loading…
Reference in New Issue