| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- package com.malk.jianhui.controller;
- 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.Async;
- 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 {
- @Autowired
- private JianhuiService jianhuiService;
- @GetMapping("/test")
- public McR test(){
- return McR.success();
- }
- //新增销售订单
- @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);
- }
- //定时同步客户
- @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();
- }
- //定时同步销售价目表
- @GetMapping("/syncSalePrice")
- public McR syncSalePrice(){
- return jianhuiService.syncSalePrice();
- }
- //金蝶同步采购订单 每半小时同步一次
- @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);
- }
- //金蝶同步检验单
- @Scheduled(cron = "0 0/30 * * * ?")
- @GetMapping("/syncInspectionOrder")
- public McR syncInspectionOrder() {
- return jianhuiService.syncInspectionOrder();
- }
- //每天1点同步所有数据
- @Scheduled(cron = "0 0 1 * * ?")
- @GetMapping("/syncData")
- public McR syncData(){
- return jianhuiService.syncData();
- }
- @GetMapping("/manualSyncData")
- public McR manualSyncData(String userId){
- jianhuiService.manualSyncData(userId);
- return McR.success();
- }
- }
|