JianhuiController.java 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. package com.malk.jianhui.controller;
  2. import com.malk.jianhui.config.KDWebApiConf;
  3. import com.malk.jianhui.service.JianhuiService;
  4. import com.malk.server.common.McR;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.scheduling.annotation.Async;
  7. import org.springframework.scheduling.annotation.Scheduled;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.PostMapping;
  10. import org.springframework.web.bind.annotation.RequestBody;
  11. import org.springframework.web.bind.annotation.RestController;
  12. import java.util.Map;
  13. @RestController
  14. public class JianhuiController {
  15. @Autowired
  16. private JianhuiService jianhuiService;
  17. @GetMapping("/test")
  18. public McR test(){
  19. return McR.success();
  20. }
  21. //新增销售订单
  22. @PostMapping("/saveSaleOrder")
  23. public McR saveSaleOrder(@RequestBody Map map) {
  24. return jianhuiService.saveSaleOrder(map);
  25. }
  26. //新增预测单
  27. @PostMapping("/saveForecastOrder")
  28. public McR saveForecastOrder(@RequestBody Map map) {
  29. return jianhuiService.saveForecastOrder(map);
  30. }
  31. //新增不良品处理单
  32. @PostMapping("/saveDefectiveOrder")
  33. public McR saveDefectiveOrder(@RequestBody Map map) {
  34. return jianhuiService.saveDefectiveOrder(map);
  35. }
  36. //定时同步客户
  37. @GetMapping("/syncCustomers")
  38. public McR syncCustomers(){
  39. return jianhuiService.syncCustomers();
  40. }
  41. //定时同步业务员
  42. @GetMapping("/syncSalesman")
  43. public McR syncSalesman(){
  44. return jianhuiService.syncSalesman();
  45. }
  46. //定时同步物料
  47. @GetMapping("/syncMaterial")
  48. public McR syncMaterial(){
  49. return jianhuiService.syncMaterial();
  50. }
  51. //定时同步供应商
  52. @GetMapping("/syncSupplier")
  53. public McR syncSupplier(){
  54. return jianhuiService.syncSupplier();
  55. }
  56. //定时同步销售价目表
  57. @GetMapping("/syncSalePrice")
  58. public McR syncSalePrice(){
  59. return jianhuiService.syncSalePrice();
  60. }
  61. //金蝶同步采购订单 每半小时同步一次
  62. @Scheduled(cron = "0 0/30 * * * ?")
  63. @GetMapping("/syncPurchaseOrder")
  64. public McR syncPurchaseOrder() {
  65. return jianhuiService.syncPurchaseOrder();
  66. }
  67. //审核采购订单
  68. @PostMapping("/auditPurchaseOrder")
  69. public McR auditPurchaseOrder(@RequestBody Map map) {
  70. return jianhuiService.auditPurchaseOrder(map);
  71. }
  72. //金蝶同步检验单
  73. @Scheduled(cron = "0 0/30 * * * ?")
  74. @GetMapping("/syncInspectionOrder")
  75. public McR syncInspectionOrder() {
  76. return jianhuiService.syncInspectionOrder();
  77. }
  78. //每天1点同步所有数据
  79. @Scheduled(cron = "0 0 1 * * ?")
  80. @GetMapping("/syncData")
  81. public McR syncData(){
  82. return jianhuiService.syncData();
  83. }
  84. @GetMapping("/manualSyncData")
  85. public McR manualSyncData(String userId){
  86. jianhuiService.manualSyncData(userId);
  87. return McR.success();
  88. }
  89. }