KdYdCustomerController.java 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. package com.malk.huagao.controller;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.malk.huagao.service.IKdYdCustomerService;
  4. import com.malk.huagao.service.IKdYdZpService;
  5. import com.malk.huagao.service.YdHuaGaoService;
  6. import com.malk.server.aliwork.YDConf;
  7. import com.malk.server.aliwork.YDParam;
  8. import com.malk.server.common.McR;
  9. import com.malk.server.dingtalk.DDR_New;
  10. import com.malk.service.aliwork.YDClient;
  11. import com.malk.utils.UtilMap;
  12. import org.slf4j.MDC;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.PostMapping;
  15. import org.springframework.web.bind.annotation.RequestBody;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.stereotype.Controller;
  18. import org.springframework.web.bind.annotation.RestController;
  19. import java.util.List;
  20. import java.util.Map;
  21. /**
  22. * <p>
  23. * 前端控制器
  24. * </p>
  25. *
  26. * @author LQY
  27. * @since 2025-10-09
  28. */
  29. @RestController
  30. @RequestMapping("/hg")
  31. public class KdYdCustomerController {
  32. @Autowired
  33. private IKdYdCustomerService kdYdCustomerService;
  34. @Autowired
  35. private YdHuaGaoService ydHuaGaoService;
  36. @Autowired
  37. private IKdYdZpService kdYdZpService;
  38. @Autowired
  39. private YDClient ydClient;
  40. @PostMapping("/test30")
  41. McR test13(@RequestBody Map data) {
  42. MDC.put("MDC_KEY_PID","1003");
  43. // String ins = String.valueOf(data.get("formInstId"));
  44. //
  45. //
  46. DDR_New ddrNew = ydClient.queryData(YDParam.builder()
  47. .formUuid("FORM-E64114E9F2C9426E91F92886EDFFA2C08Q90")
  48. .build(), YDConf.FORM_QUERY.retrieve_search_form_id);
  49. System.out.println(ddrNew.getTotalCount());
  50. ydClient.operateData(YDParam.builder()
  51. .formUuid("FORM-E64114E9F2C9426E91F92886EDFFA2C08Q90")
  52. .asynchronousExecution(true)
  53. .formInstanceIdList((List<String>) ddrNew.getData())
  54. .build(), YDConf.FORM_OPERATION.delete_batch);
  55. // ydClient.operateData(YDParam.builder()
  56. // .formInstanceId(ins)
  57. // .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("numberField_mhirg0kz","156")))//xz04
  58. //// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map(employ,id)))//xz04
  59. // .useLatestVersion(true)
  60. // .build(), YDConf.FORM_OPERATION.update);
  61. // ydHuaGaoService.synckdYdMaterial();
  62. // ydHuaGaoService.synckdYdPayment();
  63. // ydHuaGaoService.syncKdYdReceivable();
  64. // kdYdZpService.insertkdYdZp(data);
  65. // ydHuaGaoService.synckdYdOutbound();
  66. return McR.success();
  67. }
  68. @PostMapping("/kdYdCustomer")
  69. McR insertCustomer(@RequestBody Map map) {
  70. kdYdCustomerService.insertCustomer(map);
  71. return McR.success();
  72. }
  73. }