Просмотр исходного кода

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-mdm

姜永辉 1 год назад
Родитель
Сommit
60e0fc6710

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

@@ -145,6 +145,19 @@ public class OutboundSaleReturnController {
     public ResponseResultVO<?> getOutReturnForUpdate(@PathVariable String id) {
         return outboundSaleReturnService.getOutReturnForUpdate(id);
     }
+
+    /**
+     * @desc : 销售出库转退货
+     * @author : 于继渤
+     * @date : 2024-03-03 9:28
+     */
+    @ApiOperation(value = "销售出库转退货", notes = "销售出库转退货")
+    @PostMapping({"get_out_return_for_update_wx/{id}"})
+    public ResponseResultVO<?> getOutReturnForUpdateWx(@PathVariable String id) {
+        return outboundSaleReturnService.getOutReturnForUpdateWx(id);
+    }
+
+
     /********************************************** 销售退货查询相关方法end *************************************/
 
 //    /**

+ 9 - 0
src/main/java/com/dk/mdm/controller/mst/GoodsSkuController.java

@@ -68,6 +68,15 @@ public class GoodsSkuController{
         return this.getService().disable(id);
     }
 
+    /**
+     * @desc : 启用
+     * @author : 王英杰
+     * @date :  2023/1/4 9:39
+     */
+    @PostMapping("enable/{id}")
+    public ResponseResultVO<Boolean> enable(@PathVariable String id) {
+        return this.getService().enable(id);
+    }
 
     /**
      * @desc : 新建

+ 6 - 0
src/main/java/com/dk/mdm/mapper/ivt/OutboundItemMapper.java

@@ -66,6 +66,12 @@ public interface OutboundItemMapper extends BaseMapper<OutboundItem>{
      * @date   : 2024-03-12 11:07
      */
     List<OutboundItemResponse> selectByCondForReturnEdit(String id);
+    /**
+     * @desc : 销售出库转退货
+     * @author : 于继渤
+     * @date : 2024-03-03 9:28
+     */
+    List<OutboundItemResponse> selectByCondForReturnEditWx(String id);
 
     /**
      * @desc   : 根据id查询

+ 42 - 0
src/main/java/com/dk/mdm/mapper/ivt/OutboundItemMapper.xml

@@ -109,6 +109,7 @@
         <result column="orderQty" property="orderQty"/>
         <result column="canOutingQty" property="canOutingQty"/>
         <result column="whId" property="whId"/>
+        <result column="wh_id" property="whId"/>
         <result column="invQty" property="invQty"/>
         <result column="usableQty" property="usableQty"/>
         <result column="whName" property="whName"/>
@@ -516,6 +517,47 @@
         order by t.item_index
     </select>
 
+    <!-- 根据条件进行查询(退货编辑用) -->
+    <select id="selectByCondForReturnEditWx" resultMap="BaseResultMapResponse">
+        SELECT t.item_id,
+               t.out_id,
+               t.s_out_id,
+               t.s_out_item_id,
+               t.s_order_id,
+               t.s_order_item_id,
+               t.item_index,
+               t.sku_id,
+               tmgs.sku_images,
+               tmgb.brand_name,
+               tmgb.short_name,
+               tmgs.sku_code                                                                         as "skuCode",
+               tmgs.sku_model                                                                        as "skuModel",
+               tmgs.sku_name                                                                         as "skuName",
+               COALESCE(tpobi.out_qty, 0)                                                            as "outboundOutQty",
+               t.out_qty - t.return_qty                   as "canReturnQty",
+               t.inv_id,
+               tpi.wh_id,
+               tpi.inv_qty                                                                           as "invQty",
+               tpi.usable_qty                                                                        as "usableQty",
+               tmw.wh_name                                                                           as "whName",
+               t.price_out,
+               t.outing_qty + t.out_qty                                                              as outing_qty,
+               t.outing_amt + t.out_amt                                                              as outing_amt,
+
+               t.out_qty,
+               t.out_amt,
+            t.non_std_code,
+               t.remarks
+        FROM dkic_b.t_psi_outbound_item as t
+                 left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = t.sku_id
+                 left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
+                 left join dkic_b.t_psi_inventory tpi on tpi.inv_id = t.inv_id
+                 left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpi.wh_id
+                 left join dkic_b.t_psi_outbound_item as tpobi on tpobi.item_id = t.s_out_item_id
+        where t.flg_valid
+          and t.out_id = #{id}::uuid
+        order by t.item_index
+    </select>
 
     <!--修改退货信息 -->
     <update id="updateReturnMessage" parameterType="com.dk.mdm.model.pojo.ivt.OutboundItem">

+ 18 - 0
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleReturnService.java

@@ -1195,6 +1195,24 @@ public class OutboundSaleReturnService extends BaseService<Outbound> {
     }
     /********************************************** 销售退货查询相关方法end *************************************/
 
+    /**
+     * @desc : 销售出库转退货
+     * @author : 于继渤
+     * @date : 2024-03-03 9:28
+     */
+    public ResponseResultVO<?> getOutReturnForUpdateWx(String id) {
+        Map<String, Object> dataInfo = new HashMap<>();
+        OutboundResponse outboundResponse = outboundMapper.selectById(id);
+        dataInfo.put("data", outboundResponse);
+
+        // 商品明细
+        List<OutboundItemResponse> outboundItemResponse = outboundItemMapper.selectByCondForReturnEditWx(id);
+        dataInfo.put("dataItem", outboundItemResponse);
+        return ResponseResultUtil.success(dataInfo);
+    }
+
+
+
 //    /**
 //     * @desc : 条件查询
 //     * @date : 2024/3/18 11:20

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

@@ -113,7 +113,7 @@ public class DictionaryDataService extends BaseService<DictionaryData> {
         }
         //新建
         dictionaryDataMapper.insert(dictionaryData);
-        return ResponseResultUtil.success();
+        return ResponseResultUtil.success(dictionaryData);
     }
 
     /**

+ 12 - 10
src/main/java/com/dk/mdm/service/mst/SupplierService.java

@@ -140,16 +140,18 @@ public class SupplierService extends BaseService<Supplier> {
             param.put("dictCode", "基础资料-支出");
             param.put("dataValue", "期初");
             Map<String, Object> data = commonMapper.selectDictionaryData(param);
-            String dataId = String.valueOf(data.get("dataId"));
-            otherPayableItemVO.setPayableType(dataId);
-            otherPayableItemVO.setAmtPayable(supplierVo.getStartAmount());
-            itemList.add(otherPayableItemVO);
-            //调用 新建其他支出
-            OtherPayableVO otherPayableVO = new OtherPayableVO().setBusinessType(0).setObjectId(supplier.getSupId())
-                    .setSumAmtPayable(supplierVo.getStartAmount()).setStaffId(supplier.getStaffId())
-                    .setOrgId(supplier.getOrgId()).setAccDate(LocalDate.now()).setMakeStaff(supplierVo
-                            .getMakeStaff()).setItemList(itemList).setSumAmtPay(BigDecimal.ZERO);
-            otherPayableService.insert(otherPayableVO);
+            if(data != null && data.size() > 0){
+                String dataId = String.valueOf(data.get("dataId"));
+                otherPayableItemVO.setPayableType(dataId);
+                otherPayableItemVO.setAmtPayable(supplierVo.getStartAmount());
+                itemList.add(otherPayableItemVO);
+                //调用 新建其他支出
+                OtherPayableVO otherPayableVO = new OtherPayableVO().setBusinessType(0).setObjectId(supplier.getSupId())
+                        .setSumAmtPayable(supplierVo.getStartAmount()).setStaffId(supplier.getStaffId())
+                        .setOrgId(supplier.getOrgId()).setAccDate(LocalDate.now()).setMakeStaff(supplierVo
+                                .getMakeStaff()).setItemList(itemList).setSumAmtPay(BigDecimal.ZERO);
+                otherPayableService.insert(otherPayableVO);
+            }
         }
         return ResponseResultUtil.success();
     }

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

@@ -91,7 +91,7 @@ public class WarehouseService extends BaseService<Warehouse> {
         }
         //新建
         warehouseMapper.insert(warehouse);
-        return ResponseResultUtil.success();
+        return ResponseResultUtil.success(warehouse);
     }