修复了差旅费用报销的bug

This commit is contained in:
itzhang 2025-06-28 08:20:01 +08:00
parent 32108809c8
commit 25604adebe
3 changed files with 16 additions and 7 deletions

View File

@ -84,14 +84,16 @@ public class ReimbursementController {
String expensesUrl = ERPURLConstant.ERP_URL + "/ierp/kapi/v2/f9w5/em/er_dailyreimbursebill/dailyreimbursebillQuery"; String expensesUrl = ERPURLConstant.ERP_URL + "/ierp/kapi/v2/f9w5/em/er_dailyreimbursebill/dailyreimbursebillQuery";
JSONObject expensesRes = new JSONObject(); String expensesResStr = "";
try { try {
expensesRes = restTemplate.postForObject(expensesUrl, expensesEntity, JSONObject.class); expensesResStr = restTemplate.postForObject(expensesUrl, expensesEntity, String.class);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
JSONObject expensesRes = JSON.parseObject(expensesResStr);
System.out.println(expensesRes); System.out.println(expensesRes);
//开始判断是否存在符合条件的数据 //开始判断是否存在符合条件的数据
@ -398,14 +400,16 @@ public class ReimbursementController {
String expensesUrl = ERPURLConstant.ERP_URL + "/ierp/kapi/v2/f9w5/em/er_publicreimbursebill/publicreimbursebillQuery"; String expensesUrl = ERPURLConstant.ERP_URL + "/ierp/kapi/v2/f9w5/em/er_publicreimbursebill/publicreimbursebillQuery";
JSONObject expensesRes = new JSONObject(); String expensesResStr = "";
try { try {
expensesRes = restTemplate.postForObject(expensesUrl, expensesEntity, JSONObject.class); expensesResStr = restTemplate.postForObject(expensesUrl, expensesEntity, String.class);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
JSONObject expensesRes = JSON.parseObject(expensesResStr);
System.out.println(expensesRes); System.out.println(expensesRes);
//判断是否成功或者数据是否存在 //判断是否成功或者数据是否存在
@ -702,14 +706,16 @@ public class ReimbursementController {
String expensesUrl = ERPURLConstant.ERP_URL + "/ierp/kapi/v2/f9w5/em/er_tripreimbursebill/query"; String expensesUrl = ERPURLConstant.ERP_URL + "/ierp/kapi/v2/f9w5/em/er_tripreimbursebill/query";
JSONObject expensesRes = new JSONObject(); String expensesResStr = "";
try { try {
expensesRes = restTemplate.postForObject(expensesUrl, expensesEntity, JSONObject.class); expensesResStr = restTemplate.postForObject(expensesUrl, expensesEntity, String.class);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
JSONObject expensesRes = JSON.parseObject(expensesResStr);
System.out.println(expensesRes); System.out.println(expensesRes);
if (!"0".equals(expensesRes.getString("errorCode")) || expensesRes.getJSONObject("data").getJSONArray("rows").isEmpty()) { if (!"0".equals(expensesRes.getString("errorCode")) || expensesRes.getJSONObject("data").getJSONArray("rows").isEmpty()) {

View File

@ -38,6 +38,8 @@ public class CrmTask {
BankInfoController bankInfoController; BankInfoController bankInfoController;
@Autowired @Autowired
ReimbursementController reimbursementController; ReimbursementController reimbursementController;
@Autowired
VendorController vendorController;
/** /**
* 定时任务获取纷享销客token * 定时任务获取纷享销客token
@ -79,6 +81,7 @@ public class CrmTask {
// reimbursementController.syncReimbursement(); // reimbursementController.syncReimbursement();
// reimbursementController.syncPublicExpenses(); // reimbursementController.syncPublicExpenses();
// reimbursementController.syncTravelExpenses(); // reimbursementController.syncTravelExpenses();
// vendorController.syncVendor();
// System.out.println("ERP数据执行完毕"); // System.out.println("ERP数据执行完毕");
// } // }

View File

@ -41,7 +41,7 @@ public class CrmTaskTZ {
// projectInitiateController.syncProjectInitiate(); // projectInitiateController.syncProjectInitiate();
// deliveryReqController.syncDeliveryReq(); // deliveryReqController.syncDeliveryReq();
// deliveryReqController.syncRefund(); // deliveryReqController.syncRefund();
// //deviceInstallController.syncDeviceInstall(); // deviceInstallController.syncDeviceInstall();
// deviceInstallController.upDeviceInstall(); // deviceInstallController.upDeviceInstall();
// xshtController.syncSaleOrder(); // xshtController.syncSaleOrder();
// yqhtController.syncYQHT(); // yqhtController.syncYQHT();