diff --git a/src/main/java/com/management/controller/InvoiceController.java b/src/main/java/com/management/controller/InvoiceController.java index a66aec9..c4c920a 100644 --- a/src/main/java/com/management/controller/InvoiceController.java +++ b/src/main/java/com/management/controller/InvoiceController.java @@ -687,6 +687,20 @@ public class InvoiceController { } //开始回写 + JSONObject unlockReq = crmRequestUtil.unlockCRM(redInvoiceId, "custom_object_example1__c"); + //解锁 + if ("1".equals(redInvoiceData.getString("lock_status"))) { + log.info("解锁"); + + JSONObject unlockRes = new JSONObject(); + + try { + unlockRes = restTemplate.postForObject(URLConstant.UNLOCK_CRM_URL, unlockReq, JSONObject.class); + } catch (RestClientException e) { + e.printStackTrace(); + } + System.out.println("解锁" + unlockRes); + } JSONObject backReq = crmRequestUtil.updateCRM(backReqMap); JSONObject backRes = new JSONObject(); @@ -699,6 +713,17 @@ public class InvoiceController { System.out.println("回写结果为:" + backRes); + log.info("上锁"); + JSONObject lockRes = new JSONObject(); + + try { + lockRes = restTemplate.postForObject(URLConstant.LOCK_CRM_URL, unlockReq, JSONObject.class); + } catch (RestClientException e) { + e.printStackTrace(); + } + + System.out.println("上锁" + lockRes); + //开始记录日志 JSONObject logRes = new JSONObject(); try {