dongke 1 год назад
Родитель
Сommit
c0b5d0fc5b

+ 13 - 0
src/main/java/com/dk/mdm/controller/ivt/outBound/OutboundSaleReturnController.java

@@ -44,6 +44,19 @@ public class OutboundSaleReturnController {
     public ResponseResultVO<?> saleReturnOutboundInsert(@Valid @RequestBody OutboundVO outboundVO) {
         return outboundSaleReturnService.saleReturnOutboundInsert(outboundVO);
     }
+    /**
+     * @desc :  销售退货出库新建退款
+     * @date : 2024/3/18 15:22
+     * @author : 寇珊珊
+     */
+    @ApiOperation(
+            value = "销售退货出库新建退款",
+            notes = "销售退货出库新建退款"
+    )
+    @PostMapping({"outbound_insert_refund"})
+    public ResponseResultVO<?> saleReturnOutboundInsertRefund(@Valid @RequestBody OutboundVO outboundVO) {
+        return outboundSaleReturnService.saleReturnOutboundInsertRefund(outboundVO);
+    }
 
     /**
      * @desc : 销售退货出库办理

+ 2 - 1
src/main/java/com/dk/mdm/mapper/mst/GoodsSkuMapper.xml

@@ -156,7 +156,8 @@
                 )
             </if>
             <if test="searchText !=null">
-                AND tmgs.sku_name LIKE concat('%', #{searchText}, '%')
+                AND (tmgs.sku_name LIKE concat('%', #{searchText}, '%')
+                or tmgs.sku_model LIKE concat('%', #{searchText}, '%'))
             </if>
         </where>
     </sql>

+ 33 - 0
src/main/java/com/dk/mdm/model/vo/ivt/OutboundVO.java

@@ -11,6 +11,7 @@ import com.dk.common.infrastructure.handler.TimestampTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.model.pojo.PageInfo;
 import com.dk.common.model.vo.AnnexVO;
+import com.dk.mdm.model.vo.mac.RecPayItemVO;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -38,6 +39,38 @@ public class OutboundVO{
      * 数据库字段
      */
 
+    @ApiModelProperty(value = "收款明细")
+    private List<RecPayItemVO> itemListRecPayItemVO;
+
+    /**
+     * 收款金额
+     */
+    @Excel(name = "收款金额")
+    @ApiModelProperty(value = "收款金额")
+    private BigDecimal sumAmtRec;
+
+    /**
+     * 收付款类型 (【系统字典】收款、付款)
+     */
+    @Excel(name = "收付款类型 (【系统字典】收款、付款)")
+    @ApiModelProperty(value = "收付款类型 (【系统字典】收款、付款)")
+    private String rpType;
+    /**
+     * 收付款日期 (账务日期)
+     */
+    @Excel(name = "收付款日期 (账务日期)")
+    @ApiModelProperty(value = "收付款日期 (账务日期)")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate accDate;
+    /**
+     * 账务对象ID (账务对象:客户、供应商)
+     */
+    @Excel(name = "账务对象ID (账务对象:客户、供应商)")
+    @ApiModelProperty(value = "账务对象ID (账务对象:客户、供应商)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String objectId;
+
     /**
      * 出库单ID
      */

+ 26 - 2
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleReturnService.java

@@ -32,9 +32,11 @@ import com.dk.mdm.model.response.sale.OrderResponse;
 import com.dk.mdm.model.vo.ivt.InboundItemVO;
 import com.dk.mdm.model.vo.ivt.OutboundItemVO;
 import com.dk.mdm.model.vo.ivt.OutboundVO;
+import com.dk.mdm.model.vo.mac.RecPayVO;
 import com.dk.mdm.service.common.CommonService;
 import com.dk.mdm.service.ivt.inventory.InventoryService;
 import com.dk.mdm.service.mac.AccountService;
+import com.dk.mdm.service.mac.ReceiptService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -89,7 +91,8 @@ public class OutboundSaleReturnService extends BaseService<Outbound> {
 
     @Autowired
     private OutCommon outCommon;
-
+    @Autowired
+    private ReceiptService receiptService;
 
     /**
      * @desc : 修改原总单数据(订单,出库单)
@@ -282,7 +285,28 @@ public class OutboundSaleReturnService extends BaseService<Outbound> {
             }
         }
     }
-
+    /**
+     * @desc : 销售退货出库新建>>>退款
+     * @date : 2024/3/7 14:13
+     * @author : 寇珊珊
+     */
+    @Transactional(rollbackFor = {Exception.class})
+    public ResponseResultVO<?> saleReturnOutboundInsertRefund(OutboundVO outboundVO) {
+      //新建退货出库
+        saleReturnOutboundInsert(outboundVO);
+      //新建退款
+        RecPayVO recPayVO = new RecPayVO();
+        recPayVO.setObjectId(outboundVO.getObjectId());
+        recPayVO.setOrgId(outboundVO.getOrgId());
+        recPayVO.setStaffId(outboundVO.getStaffId());
+        recPayVO.setAccDate(outboundVO.getAccDate());
+        recPayVO.setMakeStaff(outboundVO.getMakeStaff());
+        recPayVO.setRpType(outboundVO.getRpType());
+        recPayVO.setSumAmtRec(outboundVO.getSumAmtRec());
+        recPayVO.setItemList(outboundVO.getItemListRecPayItemVO());
+        receiptService.insertRefund(recPayVO);
+        return ResponseResultUtil.success();
+    }
     /**
      * @desc : 销售退货出库新建
      * @date : 2024/3/7 14:13

+ 1 - 1
src/main/java/com/dk/mdm/service/mst/GoodsCategoryService.java

@@ -95,7 +95,7 @@ public class GoodsCategoryService extends BaseService<GoodsCategory> {
         goodsCategoryMapper.insert(goodsCategory);
         //执行函数
         goodsCategoryMapper.resetLevelGoodsCategory(new GoodsCategoryQuery().setTopId(goodsCategory.getParentId()).setCpId(goodsCategory.getCpId()));
-        return ResponseResultUtil.success();
+        return ResponseResultUtil.success(goodsCategory);
     }
 
 

+ 1 - 1
src/main/java/com/dk/mdm/service/mst/GoodsSeriesService.java

@@ -99,7 +99,7 @@ public class GoodsSeriesService extends BaseService<GoodsSeries> {
 		goodsSeries.setSeriesCode(uniqueNoteCode.get("outNote").toString());
 		//新建
 		goodsSeriesMapper.insert(goodsSeries);
-		return ResponseResultUtil.success();
+		return ResponseResultUtil.success(goodsSeries);
 	}
 
 

+ 1 - 1
src/main/java/com/dk/mdm/service/mst/UnitService.java

@@ -76,7 +76,7 @@ public class UnitService extends BaseService<Unit> {
 		unit.setUnitCode(uniqueNoteCode.get("outNote").toString());
 		//新建
 		unitMapper.insert(unit);
-		return ResponseResultUtil.success();
+		return ResponseResultUtil.success(unit);
 	}