Parcourir la source

Merge remote-tracking branch 'origin/master'

home il y a 2 ans
Parent
commit
0588274e62

+ 30 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/controller/stock/ManualInStockController.java

@@ -0,0 +1,30 @@
+package com.fjhx.controller.stock;
+
+import com.fjhx.enums.stock.InTypeEnum;
+import com.fjhx.params.stock.StockChangeVo;
+import com.fjhx.service.stock.StockService;
+import org.springblade.core.tool.api.R;
+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("/manual/in/stock")
+public class ManualInStockController {
+
+    @Autowired
+    private StockService stockService;
+
+    @PostMapping("/add")
+    public R add(@RequestBody StockChangeVo stockVo) {
+        stockVo.setTypeEnum(InTypeEnum.MANUAL);
+        stockService.changeQuantity(stockVo);
+        return R.success();
+    }
+
+}

+ 11 - 9
hx-service/victoriatourist/src/main/java/com/fjhx/controller/stock/ApplyInController.java → hx-service/victoriatourist/src/main/java/com/fjhx/controller/stock/PurchaseInStockController.java

@@ -2,10 +2,11 @@ package com.fjhx.controller.stock;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.base.Condition;
-import com.fjhx.entity.stock.StockJournal;
+import com.fjhx.enums.stock.InTypeEnum;
+import com.fjhx.params.stock.StockChangeVo;
 import com.fjhx.service.apply.ApplyPurchaseService;
 import com.fjhx.service.logistics.LogisticsDetailsService;
-import com.fjhx.service.stock.StockJournalService;
+import com.fjhx.service.stock.StockService;
 import org.springblade.core.tool.api.R;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -17,11 +18,11 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * 购入库
+ * 购入库
  */
 @RestController
-@RequestMapping("/applyIn")
-public class ApplyInController {
+@RequestMapping("/purchase/in/stock")
+public class PurchaseInStockController {
 
     @Autowired
     private ApplyPurchaseService applyPurchaseService;
@@ -30,7 +31,7 @@ public class ApplyInController {
     private LogisticsDetailsService logisticsDetailsService;
 
     @Autowired
-    private StockJournalService stockJournalService;
+    private StockService stockService;
 
     @PostMapping("/page")
     public R page(@RequestBody Condition condition) {
@@ -44,9 +45,10 @@ public class ApplyInController {
         return R.success(result);
     }
 
-    @PostMapping("/inAdd")
-    public R inAdd(@RequestBody List<StockJournal> list) {
-//        stockJournalService.inAdd(list);
+    @PostMapping("/add")
+    public R add(@RequestBody StockChangeVo stockVo) {
+        stockVo.setTypeEnum(InTypeEnum.PURCHASE);
+        stockService.changeQuantity(stockVo);
         return R.success();
     }
 

+ 4 - 3
hx-service/victoriatourist/src/main/java/com/fjhx/mapper/logistics/LogisticsDetailsMapper.xml

@@ -8,13 +8,14 @@
                pi.code     productCode,
                pi.name     productName,
                pi.type     productType,
+               ap.receipt_warehouse_id warehouseId,
                w.name      warehouseName,
-               ap.quantity apply_purchase_quantity,
-               ld.shipment_quantity
+               ap.quantity applyPurchaseQuantity,
+               ld.shipment_quantity shipmentQuantity
         from logistics_details ld
                  left join apply_purchase ap on ld.apply_purchase_id = ap.id
                  left join product_info pi on ap.goods_id = pi.id
-                 left join warehouse w on ap.receipt_warehouse_id
+                 left join warehouse w on ap.receipt_warehouse_id = w.id
             ${ew.customSqlSegment}
     </select>
 

+ 1 - 1
hx-service/victoriatourist/src/main/java/com/fjhx/service/apply/impl/ApplyPurchaseServiceImpl.java

@@ -191,7 +191,7 @@ public class ApplyPurchaseServiceImpl extends ServiceImpl<ApplyPurchaseMapper, A
     public Page<ApplyPurchase> stayPurchasePage(Map<String, Object> condition) {
         IWrapper<ApplyPurchase> wrapper = IWrapper.getWrapper(condition);
 
-        wrapper.lt("t1", ApplyPurchase::getStatus, ApplyPurchaseStatusEnum.STATUS_20.getKey())
+        wrapper.le("t1", ApplyPurchase::getStatus, ApplyPurchaseStatusEnum.STATUS_20.getKey())
                 .eq("t1", ApplyPurchase::getStatus)
                 .apply(Func.isNotEmpty(condition.get("code")), "instr(t1.`code`, '" + condition.get("code") + "') > 0")
                 .apply(Func.isNotEmpty(condition.get("goodsCode")), "instr(t2.`code`, '" + condition.get("goodsCode") + "') > 0")