1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- package com.sd.wln.controller;
- import com.ruoyi.common.exception.ServiceException;
- import com.sd.wln.entity.ResynchronizationDto;
- import com.sd.wln.service.*;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- @RestController
- @RequestMapping("/orderHandle")
- public class OrderHandleController {
- @Autowired
- private OrderHandleService orderHandleService;
- @Autowired
- private WlnStatementOfAccount wlnStatementOfAccount;
- @Autowired
- private WlnSkuService wlnSkuService;
- @Autowired
- private WlnSalesReturnStockInService wlnSalesReturnStockInService;
- /**
- * 重新同步订单
- */
- @PostMapping("/resynchronization")
- public void resynchronization(@RequestBody ResynchronizationDto dto) {
- orderHandleService.resynchronization(dto);
- }
- /**
- * 生成对账单
- */
- @PostMapping("/createStatementOfAccount")
- public void createStatementOfAccount() {
- wlnStatementOfAccount.createStatementOfAccount();
- }
- /**
- * 批量同步订单
- */
- @PostMapping("/bathSyncOrder")
- public void bathSyncOrder() {
- orderHandleService.bathSyncOrder();
- }
- /**
- * 同步sku
- */
- @PostMapping("/syncSku")
- public void syncSku() {
- if (WlnSkuService.syncSkuLock.tryLock()) {
- try {
- wlnSkuService.syncSkuClassify();
- wlnSkuService.syncSku();
- } finally {
- WlnSkuService.syncSkuLock.unlock();
- }
- } else {
- throw new ServiceException("sku正在同步中,请勿重复操作");
- }
- }
- /**
- * 同步万里牛售后单数据
- */
- @PostMapping("/resynchronizationReturnOrder")
- public void resynchronizationReturnOrder() {
- wlnSalesReturnStockInService.syncSalesReturnStockIn();
- }
- }
|