于继渤 2 жил өмнө
parent
commit
2921e0edf4

+ 28 - 0
src/main/java/com/dk/mdm/controller/ivt/inboundReturnController.java

@@ -95,4 +95,32 @@ public class inboundReturnController {
         return inboundReturnService.update(inboundVO);
     }
 
+
+    /**
+     * @desc : 办理
+     * @date : 2022/6/28 16:58
+     * @author : 于继渤
+     */
+    @ApiOperation(
+            value = "办理",
+            notes = "办理"
+    )
+    @PostMapping("return_handle")
+    public ResponseResultVO<String> returnHandle(@RequestBody InboundVO inboundVO) {
+        return inboundReturnService.returnHandle(inboundVO);
+    }
+    /**
+     * @desc : 采购退货入库撤销
+     * @date : 2022/6/28 16:58
+     * @author : 于继渤
+     */
+    @ApiOperation(
+            value = "采购退货入库撤销",
+            notes = "采购退货入库撤销"
+    )
+    @PostMapping({"inbound_return_cancel"})
+    public ResponseResultVO<?> inboundReturnCancel(@RequestBody InboundVO inboundVO) {
+        return inboundReturnService.inboundReturnCancel(inboundVO);
+    }
+
 }

+ 29 - 8
src/main/java/com/dk/mdm/service/ivt/InboundReturnService.java

@@ -173,9 +173,9 @@ public class InboundReturnService extends BaseService<Inbound> {
             inboundItemVO.setSPurId(inboundItemVO.getFromId());
             //源采购明细ID(采购退货时记录)
             inboundItemVO.setSPurItemId(inboundItemVO.getFromItemId());
-            inboundItemVO.setIntoingQty(inboundItemVO.getReturnQty().multiply(new BigDecimal(-1)));
-            inboundItemVO.setIntoingAmt(inboundItemVO.getReturnAmt().multiply(new BigDecimal(-1)));
-            inboundItemVO.setPriceInto(inboundItemVO.getPriceInto());
+            inboundItemVO.setIntoingQty(inboundItemVO.getReturnQty());
+            inboundItemVO.setIntoingAmt(inboundItemVO.getReturnAmt());
+            inboundItemVO.setPriceInto(inboundItemVO.getPriceInto().abs());
             inboundItemVO.setFromItemId(inboundItemVO.getItemId());
             inboundItemVO.setSkuId(inboundItemVO.getSkuId());
             inboundItemVO.setItemIndex(inboundItemVO.getItemIndex());
@@ -400,10 +400,31 @@ public class InboundReturnService extends BaseService<Inbound> {
 
 
 
-
-    public static void main(String[] args) {
-        BigDecimal a = new BigDecimal(5);
-        BigDecimal b = new BigDecimal(-5);
-        System.out.println(a.add(b));
+    /**
+     * @desc : 编辑
+     * @date : 2022/6/28 16:58
+     * @author : 于继渤
+     */
+    @Transactional(rollbackFor = {Exception.class})
+    public ResponseResultVO<String> returnHandle(InboundVO inboundVO){
+        for (InboundItemVO inboundItemVO : inboundVO.getItemList()) {
+            inboundItemVO.setIntoingQty(inboundItemVO.getReturnQty().abs());
+            inboundItemVO.setIntoingAmt(inboundItemVO.getReturnAmt().abs());
+        }
+        inboundPurchaseReturnService.saleReturnHandleInbound(inboundVO);
+        return ResponseResultUtil.success();
     }
+    /**
+     * @desc : 采购退货入库撤销
+     * @date : 2022/6/28 16:58
+     * @author : 于继渤
+     */
+    @Transactional(rollbackFor = {Exception.class})
+    public ResponseResultVO<String> inboundReturnCancel(InboundVO inboundVO){
+        inboundPurchaseReturnService.saleReturnInboundCancel(inboundVO);
+        return ResponseResultUtil.success();
+    }
+
+
+
 }