From 28c0d364e7ff349a77037c3770acaa9f656fb93b Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期三, 12 十一月 2025 18:01:27 +0800
Subject: [PATCH] yys  1.仓储物流增加分类管理      2.仓储物流分类管理导出接口      4.新疆生产管控定制化

---
 src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 57 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java b/src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java
index 5ca3bc2..169b83f 100644
--- a/src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java
+++ b/src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java
@@ -12,14 +12,20 @@
 import com.ruoyi.production.dto.ProductionDispatchAddDto;
 import com.ruoyi.production.dto.SalesLedgerSchedulingDto;
 import com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto;
+import com.ruoyi.production.mapper.SpeculativeTradingInfoMapper;
+import com.ruoyi.production.pojo.SpeculativeTradingInfo;
 import com.ruoyi.production.service.impl.SalesLedgerSchedulingServiceImpl;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -33,6 +39,45 @@
 
     @Autowired
     private SalesLedgerSchedulingServiceImpl salesLedgerSchedulingService;
+
+
+    @Autowired
+    private SpeculativeTradingInfoMapper speculativeTradingInfoMapper;
+
+    @GetMapping("/list")
+    @Log(title = "鐢熶骇绠$悊-鐢熶骇娲惧伐-鐐掓満淇℃伅", businessType = BusinessType.OTHER)
+    @ApiOperation("鐢熶骇绠$悊-鐢熶骇娲惧伐-鐐掓満淇℃伅")
+    public AjaxResult list() {
+        List<SpeculativeTradingInfo> result = speculativeTradingInfoMapper.selectList(null);
+        result.forEach(item -> {
+
+            item.setCurrentWorkLoad(salesLedgerSchedulingService.getSchedulingNumBySpeculativeTradingName(item.getName()).divide(new BigDecimal(1000),2, RoundingMode.CEILING));
+            item.setVacant(item.getWorkLoad().subtract(item.getCurrentWorkLoad()));
+        });
+        return AjaxResult.success(result);
+    }
+
+    @PostMapping("/addSpeculatTrading")
+    @Log(title = "鐢熶骇绠$悊-鐢熶骇娲惧伐-娣诲姞鐐掓満淇℃伅", businessType = BusinessType.INSERT)
+    @ApiOperation("鐢熶骇绠$悊-鐢熶骇娲惧伐-娣诲姞鐐掓満淇℃伅")
+    public AjaxResult addSpeculatTrading(@RequestBody List<SpeculativeTradingInfo> speculativeTradingInfo) {
+        if(CollectionUtils.isEmpty(speculativeTradingInfo)) return AjaxResult.error("鏁版嵁缁勪笉鑳戒负绌�");
+        speculativeTradingInfo.forEach(item -> {
+            speculativeTradingInfoMapper.insert(item);
+        });
+        return AjaxResult.success("娣诲姞鐐掓満淇℃伅鎴愬姛");
+    }
+
+    @PostMapping("/updateSpeculatTrading")
+    @Log(title = "鐢熶骇绠$悊-鐢熶骇娲惧伐-淇敼鐐掓満淇℃伅", businessType = BusinessType.UPDATE)
+    @ApiOperation("鐢熶骇绠$悊-鐢熶骇娲惧伐-淇敼鐐掓満淇℃伅")
+    public AjaxResult updateSpeculatTrading(@RequestBody List<SpeculativeTradingInfo> speculativeTradingInfo) {
+        if(CollectionUtils.isEmpty(speculativeTradingInfo)) return AjaxResult.error("鏁版嵁缁勪笉鑳戒负绌�");
+        speculativeTradingInfo.forEach(item -> {
+            speculativeTradingInfoMapper.updateById(item);
+        });
+        return AjaxResult.success("淇敼鐐掓満淇℃伅鎴愬姛");
+    }
 
 
     @GetMapping("/listPage")
@@ -69,7 +114,18 @@
     @ApiOperation("鐢熶骇绠$悊-鐢熶骇璁㈠崟-鐢熶骇娲惧伐")
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult productionDispatch(@RequestBody ProductionDispatchAddDto productionDispatchAddDto) {
-        int result = salesLedgerSchedulingService.productionDispatch(productionDispatchAddDto);
+        List<ProductionDispatchAddDto> productionDispatchAddDtoList = new ArrayList<>();
+        productionDispatchAddDtoList.add(productionDispatchAddDto);
+        String result = salesLedgerSchedulingService.productionDispatch(productionDispatchAddDtoList);
+        return AjaxResult.success(result);
+    }
+
+    @PostMapping("/productionDispatchList")
+    @Log(title = "鐢熶骇绠$悊-鐢熶骇璁㈠崟-鑷姩娲惧伐", businessType = BusinessType.INSERT)
+    @ApiOperation("鐢熶骇绠$悊-鐢熶骇璁㈠崟-鑷姩娲惧伐")
+    @Transactional(rollbackFor = Exception.class)
+    public AjaxResult productionDispatchList(@RequestBody List<ProductionDispatchAddDto> productionDispatchAddDto) {
+        String result = salesLedgerSchedulingService.productionDispatch(productionDispatchAddDto);
         return AjaxResult.success(result);
     }
 

--
Gitblit v1.9.3