|
@@ -4,9 +4,14 @@ import com.malk.jianhui.config.KDWebApiConf;
|
|
|
import com.malk.jianhui.service.JianhuiService;
|
|
|
import com.malk.server.common.McR;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
@RestController
|
|
|
public class JianhuiController {
|
|
|
|
|
@@ -16,11 +21,70 @@ public class JianhuiController {
|
|
|
@Autowired
|
|
|
private KDWebApiConf kdWebApiConf;
|
|
|
|
|
|
- @GetMapping("/test")
|
|
|
- public McR test() {
|
|
|
+ //新增销售订单
|
|
|
+ @PostMapping("/saveSaleOrder")
|
|
|
+ public McR saveSaleOrder(@RequestBody Map map) {
|
|
|
+ return jianhuiService.saveSaleOrder(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ //新增预测单
|
|
|
+ @PostMapping("/saveForecastOrder")
|
|
|
+ public McR saveForecastOrder(@RequestBody Map map) {
|
|
|
+ return jianhuiService.saveForecastOrder(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ //新增不良品处理单
|
|
|
+ @PostMapping("/saveDefectiveOrder")
|
|
|
+ public McR saveDefectiveOrder(@RequestBody Map map) {
|
|
|
+ return jianhuiService.saveDefectiveOrder(map);
|
|
|
+ }
|
|
|
|
|
|
- return jianhuiService.savePurchaseOrder();
|
|
|
+ //定时同步客户
|
|
|
+ @GetMapping("/syncCustomers")
|
|
|
+ public McR syncCustomers(){
|
|
|
+ return jianhuiService.syncCustomers();
|
|
|
}
|
|
|
|
|
|
+ //定时同步业务员
|
|
|
+ @GetMapping("/syncSalesman")
|
|
|
+ public McR syncSalesman(){
|
|
|
+ return jianhuiService.syncSalesman();
|
|
|
+ }
|
|
|
+
|
|
|
+ //定时同步物料
|
|
|
+ @GetMapping("/syncMaterial")
|
|
|
+ public McR syncMaterial(){
|
|
|
+ return jianhuiService.syncMaterial();
|
|
|
+ }
|
|
|
+
|
|
|
+ //定时同步供应商
|
|
|
+ @GetMapping("/syncSupplier")
|
|
|
+ public McR syncSupplier(){
|
|
|
+ return jianhuiService.syncSupplier();
|
|
|
+ }
|
|
|
+
|
|
|
+ //金蝶同步采购订单 每半小时同步一次
|
|
|
+ @Scheduled(cron = "0 0/30 * * * ?")
|
|
|
+ @GetMapping("/syncPurchaseOrder")
|
|
|
+ public McR syncPurchaseOrder() {
|
|
|
+ return jianhuiService.syncPurchaseOrder();
|
|
|
+ }
|
|
|
+
|
|
|
+ //审核采购订单
|
|
|
+ @PostMapping("/auditPurchaseOrder")
|
|
|
+ public McR auditPurchaseOrder(@RequestBody Map map) {
|
|
|
+ return jianhuiService.auditPurchaseOrder(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ //每天0点同步所有数据
|
|
|
+ @Scheduled(cron = "0 0 0 * * ?")
|
|
|
+ @GetMapping("/syncData")
|
|
|
+ public McR syncData(){
|
|
|
+ return jianhuiService.syncData();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|