KdYdCustomerController.java 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. package com.malk.huagao.controller;
  2. import com.alibaba.fastjson.JSON;
  3. import com.alibaba.fastjson.JSONObject;
  4. import com.malk.huagao.service.IKdYdCustomerService;
  5. import com.malk.huagao.service.IKdYdZpService;
  6. import com.malk.huagao.service.YdHuaGaoService;
  7. import com.malk.server.aliwork.YDConf;
  8. import com.malk.server.aliwork.YDParam;
  9. import com.malk.server.common.McR;
  10. import com.malk.server.dingtalk.DDR_New;
  11. import com.malk.service.aliwork.YDClient;
  12. import com.malk.service.dingtalk.DDClient;
  13. import com.malk.service.dingtalk.DDClient_Contacts;
  14. import com.malk.service.dingtalk.DDClient_Workflow;
  15. import com.malk.utils.UtilMap;
  16. import org.slf4j.MDC;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.web.bind.annotation.PostMapping;
  19. import org.springframework.web.bind.annotation.RequestBody;
  20. import org.springframework.web.bind.annotation.RequestMapping;
  21. import org.springframework.stereotype.Controller;
  22. import org.springframework.web.bind.annotation.RestController;
  23. import java.util.List;
  24. import java.util.Map;
  25. /**
  26. * <p>
  27. * 前端控制器
  28. * </p>
  29. *
  30. * @author LQY
  31. * @since 2025-10-09
  32. */
  33. @RestController
  34. @RequestMapping("/hg")
  35. public class KdYdCustomerController {
  36. @Autowired
  37. private IKdYdCustomerService kdYdCustomerService;
  38. @Autowired
  39. private YdHuaGaoService ydHuaGaoService;
  40. @Autowired
  41. private IKdYdZpService kdYdZpService;
  42. @Autowired
  43. private DDClient_Contacts ddClient_contacts;
  44. @Autowired
  45. private DDClient ddClient;
  46. @Autowired
  47. private YDClient ydClient;
  48. @PostMapping("/test30")
  49. McR test13(@RequestBody Map data) {
  50. MDC.put("MDC_KEY_PID","1003");
  51. // Map userInfoByMobile1 = ddClient_contacts.getUserInfoById(ddClient.getAccessToken(), "yzsyzid2");
  52. // if (userInfoByMobile1 != null && userInfoByMobile1.containsKey("mobile")) {
  53. // mobile = String.valueOf(userInfoByMobile1.get("mobile"));
  54. // }
  55. // String ins = String.valueOf(data.get("formInstId"));
  56. //
  57. //
  58. // DDR_New ddrNew = ydClient.queryData(YDParam.builder()
  59. // .formUuid("FORM-E64114E9F2C9426E91F92886EDFFA2C08Q90")
  60. // .build(), YDConf.FORM_QUERY.retrieve_search_form_id);
  61. //
  62. // System.out.println(ddrNew.getTotalCount());
  63. //
  64. // ydClient.operateData(YDParam.builder()
  65. // .formUuid("FORM-E64114E9F2C9426E91F92886EDFFA2C08Q90")
  66. // .asynchronousExecution(true)
  67. // .formInstanceIdList((List<String>) ddrNew.getData())
  68. // .build(), YDConf.FORM_OPERATION.delete_batch);
  69. // DDR_New ddrNew = ydClient.queryData(YDParam.builder()
  70. // .formInstId("FINST-DZ966471VB228QLYJ6WXG6I7YGV631VYLW0KMBQE")
  71. // .build(), YDConf.FORM_QUERY.retrieve_id);
  72. ////
  73. //// if (ddrNew == null || ddrNew.getFormData() == null) {
  74. //// throw new RuntimeException("未找到订单信息");
  75. //// }
  76. ////
  77. // Map formData1 = ddrNew.getFormData();
  78. // System.out.println("======"+formData1);
  79. // String ddje = UtilMap.getString(formData1, "numberField_mjm9k35k");
  80. // String dddate = UtilMap.getString(formData1, "dateField_mjm9k35j");
  81. //
  82. // System.out.println(dddate);
  83. // System.out.println(ddje);
  84. // ydClient.operateData(YDParam.builder()
  85. // .formInstanceId(ins)
  86. // .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("numberField_mhirg0kz","156")))//xz04
  87. //// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map(employ,id)))//xz04
  88. // .useLatestVersion(true)
  89. // .build(), YDConf.FORM_OPERATION.update);
  90. // ydHuaGaoService.synckdYdMaterial();
  91. // ydHuaGaoService.synckdYdPayment();
  92. // ydHuaGaoService.synckdYdTRANSFER();
  93. // ydHuaGaoService.syncKdYdReceivable();
  94. // kdYdZpService.insertkdYdZp(data);
  95. // ydHuaGaoService.synckdYdOutbound();
  96. return McR.success();
  97. }
  98. @PostMapping("/kdYdCustomer")
  99. Map<String, Object> insertCustomer(@RequestBody Map map) {
  100. Map<String, Object> stringObjectMap = kdYdCustomerService.insertCustomer(map);
  101. return stringObjectMap;
  102. }
  103. }