Przeglądaj źródła

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

changhaoning 1 rok temu
rodzic
commit
7e8adc0818

+ 14 - 0
src/main/java/com/dk/mdm/controller/ivt/outBound/OutboundSaleOrderController.java

@@ -48,6 +48,20 @@ public class OutboundSaleOrderController {
     }
     }
 
 
     /**
     /**
+     * @desc :  销售出库新建和收款
+     * @date : 2024/3/18 15:22
+     * @author : 王英杰
+     */
+    @ApiOperation(
+            value = "销售出库新建",
+            notes = "销售出库新建"
+    )
+    @PostMapping({"outbound_insert_collection"})
+    public ResponseResultVO<?> saleOrderOutboundInsertCollection(@Valid @RequestBody OutboundVO outboundVO) {
+        return outboundSaleOrderService.saleOrderOutboundInsertCollection(outboundVO);
+    }
+
+    /**
      * @desc : 销售出库办理
      * @desc : 销售出库办理
      * @date : 2024/3/18 15:22
      * @date : 2024/3/18 15:22
      * @author : 寇珊珊
      * @author : 寇珊珊

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

@@ -47,7 +47,7 @@ public class OutboundSaleReturnController {
     /**
     /**
      * @desc :  销售退货出库新建退款
      * @desc :  销售退货出库新建退款
      * @date : 2024/3/18 15:22
      * @date : 2024/3/18 15:22
-     * @author : 寇珊珊
+     * @author : 王英杰
      */
      */
     @ApiOperation(
     @ApiOperation(
             value = "销售退货出库新建退款",
             value = "销售退货出库新建退款",

+ 5 - 0
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -497,6 +497,7 @@
         tmgs.sku_images        as "skuImages",
         tmgs.sku_images        as "skuImages",
         tmgs.remarks,
         tmgs.remarks,
         tmgs.pack_box AS "packBox"
         tmgs.pack_box AS "packBox"
+        ,tmgu.decimal_places    as "decimalPlaces"
         from dkic_b.t_mst_goods_sku as tmgs
         from dkic_b.t_mst_goods_sku as tmgs
         left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
         left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
         left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
         left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
@@ -800,6 +801,7 @@
             <if test="cpId != null">
             <if test="cpId != null">
                 AND tmgc.cp_id = #{cpId}
                 AND tmgc.cp_id = #{cpId}
             </if>
             </if>
+            AND  tmgc.flg_valid
         </where>
         </where>
         UNION ALL--父级
         UNION ALL--父级
         SELECT
         SELECT
@@ -819,6 +821,7 @@
             <if test="cpId != null">
             <if test="cpId != null">
                 AND tmgc.cp_id = #{cpId}
                 AND tmgc.cp_id = #{cpId}
             </if>
             </if>
+            AND  tmgc.flg_valid
         </where>
         </where>
         ) T
         ) T
         WHERE T.cat_id IS NOT NULL
         WHERE T.cat_id IS NOT NULL
@@ -907,6 +910,7 @@
             <if test="cpId != null">
             <if test="cpId != null">
                 AND cp_id = #{cpId}
                 AND cp_id = #{cpId}
             </if>
             </if>
+            AND flg_valid
         </where>
         </where>
         order by display_no asc
         order by display_no asc
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
@@ -947,6 +951,7 @@
             <if test="cpId != null">
             <if test="cpId != null">
                 AND cp_id = #{cpId}
                 AND cp_id = #{cpId}
             </if>
             </if>
+            AND flg_valid
         </where>
         </where>
         order by display_no asc
         order by display_no asc
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">

+ 2 - 0
src/main/java/com/dk/mdm/mapper/ivt/OutboundMapper.xml

@@ -204,6 +204,7 @@
         <result column="outing_piece" property="outingPiece"/>
         <result column="outing_piece" property="outingPiece"/>
         <result column="out_box" property="box"/>
         <result column="out_box" property="box"/>
         <result column="out_piece" property="piece"/>
         <result column="out_piece" property="piece"/>
+        <result column="decimal_places" property="decimalPlaces"/>
     </resultMap>
     </resultMap>
     <!-- 通用条件列 -->
     <!-- 通用条件列 -->
     <sql id="Condition">
     <sql id="Condition">
@@ -1130,6 +1131,7 @@
                 ,tpoi.outing_piece  as "list_outing_piece"
                 ,tpoi.outing_piece  as "list_outing_piece"
                 ,tpoi.out_box  as "list_out_box"
                 ,tpoi.out_box  as "list_out_box"
                 ,tpoi.out_piece  as "list_out_piece"
                 ,tpoi.out_piece  as "list_out_piece"
+,tmgu.decimal_places as "list_decimal_places"
     </sql>
     </sql>
 
 
     <select id="countByCondDetail" resultType="Long">
     <select id="countByCondDetail" resultType="Long">

+ 4 - 0
src/main/java/com/dk/mdm/mapper/mst/GoodsSkuMapper.xml

@@ -43,6 +43,7 @@
                 <result column="op_app_code" property="opAppCode"/>
                 <result column="op_app_code" property="opAppCode"/>
             <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
             <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
                 <result column="op_db_user" property="opDbUser"/>
                 <result column="op_db_user" property="opDbUser"/>
+        <result column="decimalPlaces" property="decimalPlaces"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="Base_Column_List_JOIN">
     <sql id="Base_Column_List_JOIN">
@@ -83,6 +84,7 @@
         <result column="cost_price" property="costPrice"/>
         <result column="cost_price" property="costPrice"/>
         <result column="priceInto" property="priceInto"/>
         <result column="priceInto" property="priceInto"/>
         <result column="intoQty" property="intoQty"/>
         <result column="intoQty" property="intoQty"/>
+        <result column="decimalPlaces" property="decimalPlaces"/>
     </resultMap>
     </resultMap>
 
 
     <!-- 通用条件列 -->
     <!-- 通用条件列 -->
@@ -178,6 +180,7 @@
         ,tmgb.brand_name AS "brandName",tmgsr.series_name AS "seriesName"
         ,tmgb.brand_name AS "brandName",tmgsr.series_name AS "seriesName"
         ,tmgus.unit_name         as "subUnitName"
         ,tmgus.unit_name         as "subUnitName"
         ,tmgu.unit_name         as "unitName"
         ,tmgu.unit_name         as "unitName"
+        ,tmgu.decimal_places    as "decimalPlaces"
         ,COALESCE((SELECT sum(tpi.usable_qty)  from dkic_b.t_psi_inventory tpi where tpi.sku_id = tmgs.sku_id and tpi.cp_id =  #{cpId} ),0) AS "usableQty"
         ,COALESCE((SELECT sum(tpi.usable_qty)  from dkic_b.t_psi_inventory tpi where tpi.sku_id = tmgs.sku_id and tpi.cp_id =  #{cpId} ),0) AS "usableQty"
         FROM dkic_b.t_mst_goods_sku  tmgs
         FROM dkic_b.t_mst_goods_sku  tmgs
         left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
         left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
@@ -208,6 +211,7 @@
         ,tmgb.brand_name AS "brandName"
         ,tmgb.brand_name AS "brandName"
            ,tmgc.cat_name AS "catName"
            ,tmgc.cat_name AS "catName"
         ,tmu.unit_name AS "unitName"
         ,tmu.unit_name AS "unitName"
+        ,tmu.decimal_places    as "decimalPlaces"
         ,subtmu.unit_name AS "subUnitName"
         ,subtmu.unit_name AS "subUnitName"
         ,tmgsr.series_name AS "seriesName"
         ,tmgsr.series_name AS "seriesName"
         ,(SELECT  count(1) FROM  dkic_b.t_psi_inventory tsic WHERE tsic.sku_id = tmgs.sku_id ) AS inventoryCount
         ,(SELECT  count(1) FROM  dkic_b.t_psi_inventory tsic WHERE tsic.sku_id = tmgs.sku_id ) AS inventoryCount

+ 1 - 0
src/main/java/com/dk/mdm/mapper/pur/PurchaseItemMapper.xml

@@ -452,6 +452,7 @@
         ,tppi.from_item_id  as "fromItemId"
         ,tppi.from_item_id  as "fromItemId"
         ,tpo.order_no  as "orderNo"
         ,tpo.order_no  as "orderNo"
         ,tpp.pur_no as "purNo"
         ,tpp.pur_no as "purNo"
+        ,(select ul.decimal_places from  dkic_b.t_mst_unit ul where dkic_b.t_psi_purchase_item.unit_id = ul.unit_id) as "decimalPlaces"
         FROM dkic_b.t_psi_purchase_item tppi
         FROM dkic_b.t_psi_purchase_item tppi
         left join dkic_b.t_psi_order tpo on tpo.order_id = tppi.from_id
         left join dkic_b.t_psi_order tpo on tpo.order_id = tppi.from_id
         left join dkic_b.t_psi_purchase tpp  on tpp.pur_id = tppi.pur_id
         left join dkic_b.t_psi_purchase tpp  on tpp.pur_id = tppi.pur_id

+ 6 - 0
src/main/java/com/dk/mdm/model/pojo/mst/GoodsSku.java

@@ -297,6 +297,12 @@ public class GoodsSku extends PageInfo<GoodsSku> implements Serializable {
      * 相关属性
      * 相关属性
      * @TableField(exist = false)
      * @TableField(exist = false)
      */
      */
+    /**
+     * 小数位数 ([0-6]能改大,不能改小)
+     */
+    @ApiModelProperty(value = "小数位数 ([0-6]能改大,不能改小)")
+    @TableField(exist = false)
+    private Integer decimalPlaces;
 
 
     /*
     /*
      * 关联属性 + 查询条件
      * 关联属性 + 查询条件

+ 6 - 1
src/main/java/com/dk/mdm/model/response/ivt/OutboundResponse.java

@@ -60,7 +60,12 @@ public class OutboundResponse extends PageInfo<OutboundResponse> implements Seri
     @Excel(name = "可用量")
     @Excel(name = "可用量")
     @ApiModelProperty(value = "可用量")
     @ApiModelProperty(value = "可用量")
     private BigDecimal usableQty;
     private BigDecimal usableQty;
-
+    /**
+     * 小数位数 ([0-6]能改大,不能改小)
+     */
+    @ApiModelProperty(value = "小数位数 ([0-6]能改大,不能改小)")
+    @TableField(exist = false)
+    private Integer decimalPlaces;
 
 
     @Excel(name = "包装")
     @Excel(name = "包装")
     @ApiModelProperty(value = "包装")
     @ApiModelProperty(value = "包装")

+ 6 - 0
src/main/java/com/dk/mdm/model/response/mst/GoodsSkuResponse.java

@@ -369,6 +369,12 @@ public class GoodsSkuResponse implements Serializable {
      * 相关属性
      * 相关属性
      * @TableField(exist = false)
      * @TableField(exist = false)
      */
      */
+    /**
+     * 小数位数 ([0-6]能改大,不能改小)
+     */
+    @ApiModelProperty(value = "小数位数 ([0-6]能改大,不能改小)")
+    @TableField(exist = false)
+    private Integer decimalPlaces;
 
 
     /*
     /*
      * 关联属性 + 查询条件
      * 关联属性 + 查询条件

+ 27 - 0
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java

@@ -48,9 +48,11 @@ import com.dk.mdm.model.vo.ivt.InboundItemVO;
 import com.dk.mdm.model.vo.ivt.InboundVO;
 import com.dk.mdm.model.vo.ivt.InboundVO;
 import com.dk.mdm.model.vo.ivt.OutboundItemVO;
 import com.dk.mdm.model.vo.ivt.OutboundItemVO;
 import com.dk.mdm.model.vo.ivt.OutboundVO;
 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.common.CommonService;
 import com.dk.mdm.service.ivt.inventory.InventoryService;
 import com.dk.mdm.service.ivt.inventory.InventoryService;
 import com.dk.mdm.service.mac.AccountService;
 import com.dk.mdm.service.mac.AccountService;
+import com.dk.mdm.service.mac.ReceiptService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -122,6 +124,8 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
     @Autowired
     @Autowired
     private InboundItemConvert inboundItemConvert;
     private InboundItemConvert inboundItemConvert;
 
 
+    @Autowired
+    private ReceiptService receiptService;
     /**
     /**
      * @desc : 删除外协品生产外协入库单
      * @desc : 删除外协品生产外协入库单
      * @date : 2024/5/10 10:31
      * @date : 2024/5/10 10:31
@@ -463,6 +467,29 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
     }
     }
 
 
     /**
     /**
+     * @desc : 销售出库新建>>>收款
+     * @date : 2024/3/7 14:13
+     * @author : 寇珊珊
+     */
+    @Transactional(rollbackFor = {Exception.class})
+    public ResponseResultVO<?> saleOrderOutboundInsertCollection(OutboundVO outboundVO) {
+        //新建销售出库
+        saleOrderOutboundInsert(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.insertReceipt(recPayVO);
+        return ResponseResultUtil.success();
+    }
+
+    /**
      * @desc : 销售出库编辑
      * @desc : 销售出库编辑
      * @date : 2024/3/25 16:25
      * @date : 2024/3/25 16:25
      * @author : 寇珊珊
      * @author : 寇珊珊