Quellcode durchsuchen

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

姜永辉 vor 1 Jahr
Ursprung
Commit
cbde3458b9

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

@@ -167,6 +167,7 @@
         display_no AS "displayNo",
         display_no AS "displayNo",
         remarks
         remarks
         ,flg_valid as "flgValid"
         ,flg_valid as "flgValid"
+        ,flg_business as "flgBusiness"
         from dkic_b.t_mst_org
         from dkic_b.t_mst_org
         where flg_valid
         where flg_valid
         and cp_id = #{cpId}
         and cp_id = #{cpId}
@@ -182,6 +183,9 @@
         <if test="orgName != null">
         <if test="orgName != null">
             AND org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
             AND org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
         </if>
         </if>
+        <if test="flgBusiness != null">
+            AND flg_business  = #{flgBusiness}
+        </if>
         <if test="ids != null and ids.size() > 0 ">
         <if test="ids != null and ids.size() > 0 ">
             order by case org_id
             order by case org_id
             <foreach collection="ids" index="index" item="item">
             <foreach collection="ids" index="index" item="item">

+ 13 - 3
src/main/java/com/dk/mdm/mapper/ivt/CheckMapper.xml

@@ -137,8 +137,18 @@
     <!-- 盘点一览查询条件 -->
     <!-- 盘点一览查询条件 -->
     <sql id="Condition_Respons">
     <sql id="Condition_Respons">
         <where>
         <where>
+            <if test="staffName != null and staffName != ''">
+                AND  staff.staff_name  LIKE concat('%',my_ex.likequery(#{staffName}),'%')
+            </if>
+            <if test="orgName != null and orgName != ''">
+                AND  org.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
+            </if>
             <if test="checkNo != null and checkNo != ''">
             <if test="checkNo != null and checkNo != ''">
-                AND ck.check_no = LIKE concat('%',my_ex.likequery(#{checkNo}),'%')
+                AND ck.check_no LIKE concat('%',my_ex.likequery(#{checkNo}),'%')
+            </if>
+
+            <if test="coilingStateList != null and coilingStateList.size()>0">
+                AND ck.check_status =any(#{coilingStateList,typeHandler=StringListTypeHandler})
             </if>
             </if>
             <if test="orgId != null and orgId != ''">
             <if test="orgId != null and orgId != ''">
                 AND ck.org_id = #{orgId}
                 AND ck.org_id = #{orgId}
@@ -183,8 +193,8 @@
                 AND   ck.check_no LIKE concat('%',my_ex.likequery(#{searchText}), '%')
                 AND   ck.check_no LIKE concat('%',my_ex.likequery(#{searchText}), '%')
             </if>
             </if>
             <if test="makeTimeStart != null and makeTimeEnd != null">
             <if test="makeTimeStart != null and makeTimeEnd != null">
-                AND tpi.make_time &gt;= #{makeTimeStart}::timestamp with time zone
-                AND tpi.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
+                AND ck.make_time &gt;= #{makeTimeStart}::timestamp with time zone
+                AND ck.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
             </if>
             </if>
         </where>
         </where>
     </sql>
     </sql>

+ 34 - 4
src/main/java/com/dk/mdm/mapper/ivt/FreezeMapper.xml

@@ -72,6 +72,33 @@
       <!-- 通用条件列 -->
       <!-- 通用条件列 -->
     <sql id="Condition">
     <sql id="Condition">
         <where>
         <where>
+            <if test="cusPhone != null and cusPhone != ''">
+                AND cus.cus_phone like concat('%', my_ex.likequery(#{cusPhone}) , '%')
+            </if>
+            <if test="cusName != null and cusName != ''">
+                AND cus.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
+            </if>
+            <if test="searchText !=null">
+                AND   fre.freeze_no LIKE concat('%',my_ex.likequery(#{searchText}), '%')
+            </if>
+            <if test="freezeDateSStart != null and freezeDateSEnd != null">
+                AND fre.freeze_date &gt;= #{freezeDateSStart}::timestamp with time zone
+                AND fre.freeze_date &lt; #{freezeDateSEnd}::timestamp with time zone + interval '1 day'
+            </if>
+            <if test="autoUnfreezeDateSStart != null and autoUnfreezeDateSEnd != null">
+                AND fre.auto_unfreeze_date &gt;= #{autoUnfreezeDateSStart}::timestamp with time zone
+                AND fre.auto_unfreeze_date &lt; #{autoUnfreezeDateSEnd}::timestamp with time zone + interval '1 day'
+            </if>
+            <if test="makeTimeStart != null and makeTimeEnd != null">
+                AND fre.make_time &gt;= #{makeTimeStart}::timestamp with time zone
+                AND fre.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
+            </if>
+            <if test="staffName != null and staffName != ''">
+                AND  staff.staff_name  LIKE concat('%',my_ex.likequery(#{staffName}),'%')
+            </if>
+            <if test="orgName != null and orgName != ''">
+                AND  org.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
+            </if>
             <if test="freezeNo != null and freezeNo != ''">
             <if test="freezeNo != null and freezeNo != ''">
                 AND fre.freeze_no LIKE concat('%',my_ex.likequery(#{freezeNo}),'%')
                 AND fre.freeze_no LIKE concat('%',my_ex.likequery(#{freezeNo}),'%')
             </if>
             </if>
@@ -108,11 +135,9 @@
             <if test="staffIdList != null and staffIdList.size>0">
             <if test="staffIdList != null and staffIdList.size>0">
                 AND fre.staff_id = any(#{staffIdList, typeHandler=UuidListTypeHandler})
                 AND fre.staff_id = any(#{staffIdList, typeHandler=UuidListTypeHandler})
             </if>
             </if>
-            <if test="cusName != null and cusName != ''">
-                AND cus.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
-            </if>
+
             <if test="freezeStatusList != null and freezeStatusList.size() > 0">
             <if test="freezeStatusList != null and freezeStatusList.size() > 0">
-                AND fre.freeze_status = any(#{freezeStatusList, typeHandler=UuidListTypeHandler})
+                AND fre.freeze_status = any(#{freezeStatusList, typeHandler=StringListTypeHandler})
             </if>
             </if>
         </where>
         </where>
     </sql>
     </sql>
@@ -138,6 +163,11 @@
         SELECT
         SELECT
         count(1)
         count(1)
         FROM dkic_b.t_psi_freeze AS fre
         FROM dkic_b.t_psi_freeze AS fre
+        lEFT JOIN dkic_b.t_mst_customer AS cus ON cus.cus_id=fre.cus_id
+        lEFT JOIN dkic_b.t_mst_staff AS staff ON  staff.staff_id=fre.staff_id
+        lEFT JOIN dkic_b.t_mst_org AS org ON org.org_id=fre.org_id
+        lEFT JOIN dkic_b.t_mst_staff AS mstaff ON mstaff.staff_id=fre.make_staff
+        LEFT JOIN sys.t_data_kind AS tdk  ON tdk.kind_code = fre.freeze_status
         <include refid="Condition"/>
         <include refid="Condition"/>
     </select>
     </select>
 
 

+ 1 - 1
src/main/java/com/dk/mdm/mapper/ivt/InventoryBatchMapper.xml

@@ -229,7 +229,7 @@
                 AND tpib.inv_id = #{invId,typeHandler=UuidTypeHandler}
                 AND tpib.inv_id = #{invId,typeHandler=UuidTypeHandler}
             </if>
             </if>
         </where>
         </where>
-        order by tpib.op_create_time asc
+        order by tpib.batch_id asc
     </select>
     </select>
 
 
     <!--修改库存数量金额-->
     <!--修改库存数量金额-->

+ 30 - 4
src/main/java/com/dk/mdm/mapper/ivt/TransferMapper.xml

@@ -151,8 +151,31 @@
     <!-- 一览条件列 -->
     <!-- 一览条件列 -->
     <sql id="Condition_Response">
     <sql id="Condition_Response">
         <where>
         <where>
+            <if test="oWhName != null and oWhName != ''">
+                AND  otmw.wh_name  LIKE concat('%',my_ex.likequery(#{oWhName}),'%')
+            </if>
+            <if test="whName != null and whName != ''">
+                AND  tmw.wh_name  LIKE concat('%',my_ex.likequery(#{whName}),'%')
+            </if>
+            <if test="staffName != null and staffName != ''">
+                AND  staff.staff_name  LIKE concat('%',my_ex.likequery(#{staffName}),'%')
+            </if>
+            <if test="orgName != null and orgName != ''">
+                AND  org.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
+            </if>
+            <if test="makeTimeStart != null and makeTimeEnd != null">
+                AND trf.make_time &gt;= #{makeTimeStart}::timestamp with time zone
+                AND trf.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
+            </if>
+            <if test="transferDateWStart != null and transferDateWEnd != null">
+                AND trf.transfer_date &gt;= #{transferDateWStart}::timestamp with time zone
+                AND trf.transfer_date &lt; #{transferDateWEnd}::timestamp with time zone + interval '1 day'
+            </if>
+            <if test="transferTypeList != null and transferTypeList.size()>0">
+                AND trf.transfer_type =any(#{transferTypeList,typeHandler=StringListTypeHandler})
+            </if>
             <if test="transferNo != null and transferNo != ''">
             <if test="transferNo != null and transferNo != ''">
-                AND trf.transfer_no = LIKE concat('%',my_ex.likequery(#{transferNo}),'%')
+                AND trf.transfer_no  LIKE concat('%',my_ex.likequery(#{transferNo}),'%')
             </if>
             </if>
             <if test="transferDate != null">
             <if test="transferDate != null">
                 AND trf.transfer_date = #{transferDate}
                 AND trf.transfer_date = #{transferDate}
@@ -164,13 +187,13 @@
                 AND wh_id = #{whId}
                 AND wh_id = #{whId}
             </if>
             </if>
             <if test="oNonStdCode != null and oNonStdCode != ''">
             <if test="oNonStdCode != null and oNonStdCode != ''">
-                AND o_non_std_code = #{oNonStdCode}
+                AND o_non_std_code LIKE concat('%',my_ex.likequery(#{oNonStdCode}),'%')
             </if>
             </if>
             <if test="nonStdCode != null and nonStdCode != ''">
             <if test="nonStdCode != null and nonStdCode != ''">
-                AND non_std_code = #{nonStdCode}
+                AND non_std_code LIKE concat('%',my_ex.likequery(#{nonStdCode}),'%')
             </if>
             </if>
             <if test="remarks != null and remarks != ''">
             <if test="remarks != null and remarks != ''">
-                AND trf.remarks = #{remarks}
+                AND trf.remarks  LIKE concat('%',my_ex.likequery(#{remarks}),'%')
             </if>
             </if>
             <if test="cpId != null">
             <if test="cpId != null">
                 AND trf.cp_id = #{cpId}
                 AND trf.cp_id = #{cpId}
@@ -184,6 +207,9 @@
             <if test="staffIdList != null and staffIdList.size>0">
             <if test="staffIdList != null and staffIdList.size>0">
                 AND trf.staff_id = any(#{staffIdList, typeHandler=UuidListTypeHandler})
                 AND trf.staff_id = any(#{staffIdList, typeHandler=UuidListTypeHandler})
             </if>
             </if>
+            <if test="searchText !=null">
+                AND   trf.transfer_no LIKE concat('%',my_ex.likequery(#{searchText}), '%')
+            </if>
         </where>
         </where>
     </sql>
     </sql>
 
 

+ 2 - 0
src/main/java/com/dk/mdm/mapper/mst/StaffMapper.xml

@@ -20,6 +20,7 @@
         <result column="staff_phone" property="staffPhone"/>
         <result column="staff_phone" property="staffPhone"/>
         <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
         <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
         <result column="org_name" property="orgName"/>
         <result column="org_name" property="orgName"/>
+        <result column="flg_business" property="flgBusiness"/>
         <result column="hr_status_name" property="hrStatusName"/>
         <result column="hr_status_name" property="hrStatusName"/>
         <result column="role_names" property="roleNames"/>
         <result column="role_names" property="roleNames"/>
         <result column="role_ids" property="roleIds" typeHandler="UuidListTypeHandler"/>
         <result column="role_ids" property="roleIds" typeHandler="UuidListTypeHandler"/>
@@ -149,6 +150,7 @@
         SELECT
         SELECT
         <include refid="Base_Column_List"/>
         <include refid="Base_Column_List"/>
         , org.org_name,
         , org.org_name,
+        org.flg_business,
         CASE
         CASE
         WHEN tmow.wh_id IS NULL THEN
         WHEN tmow.wh_id IS NULL THEN
         (SELECT wh_id FROM dkic_b.t_mst_warehouse where cp_id = T.cp_id and flg_default)
         (SELECT wh_id FROM dkic_b.t_mst_warehouse where cp_id = T.cp_id and flg_default)

+ 18 - 0
src/main/java/com/dk/mdm/model/query/ivt/CheckQuery.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.annotation.*;
 import com.dk.common.infrastructure.annotaiton.ExportTitle;
 import com.dk.common.infrastructure.annotaiton.ExportTitle;
 import com.dk.common.infrastructure.handler.JsonTypeHandler;
 import com.dk.common.infrastructure.handler.JsonTypeHandler;
+import com.dk.common.infrastructure.handler.StringListTypeHandler;
 import com.dk.common.infrastructure.handler.TimestampTypeHandler;
 import com.dk.common.infrastructure.handler.TimestampTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.model.pojo.PageInfo;
 import com.dk.common.model.pojo.PageInfo;
@@ -47,7 +48,24 @@ public class CheckQuery extends PageInfo<CheckQuery> implements Serializable {
     @TableField(typeHandler = UuidTypeHandler.class)
     @TableField(typeHandler = UuidTypeHandler.class)
     private String checkId;
     private String checkId;
 
 
+    /**
+     * 员工名称
+     */
+    @Excel(name = "员工名称")
+    @ApiModelProperty(value = "员工名称")
+    private String staffName;
+
+    private String searchText;
 
 
+    @ApiModelProperty(value = "部门名称")
+    @TableField(exist = false)
+    private String orgName;
+    /**
+     * 盘点状态
+     */
+    @ApiModelProperty(value = "盘点状态")
+    @TableField(typeHandler = StringListTypeHandler.class)
+    private List<String> coilingStateList;
     /**
     /**
      * 附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)
      * 附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)
      */
      */

+ 38 - 0
src/main/java/com/dk/mdm/model/query/ivt/FreezeQuery.java

@@ -40,6 +40,41 @@ public class FreezeQuery extends PageInfo<FreezeQuery> implements Serializable {
      * 数据库字段
      * 数据库字段
      */
      */
 
 
+    @ApiModelProperty(value = "时间开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate makeTimeStart;
+
+    @ApiModelProperty(value = "时间结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate makeTimeEnd;
+
+    @ApiModelProperty(value = "时间开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate freezeDateSStart;
+
+    @ApiModelProperty(value = "时间结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate freezeDateSEnd;
+
+    @ApiModelProperty(value = "时间开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate autoUnfreezeDateSStart;
+
+    @ApiModelProperty(value = "时间结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate autoUnfreezeDateSEnd;
+
+    private String searchText;
+    /**
+     * 员工名称
+     */
+    @Excel(name = "员工名称")
+    @ApiModelProperty(value = "员工名称")
+    private String staffName;
+
+    @ApiModelProperty(value = "部门名称")
+    @TableField(exist = false)
+    private String orgName;
     /**
     /**
      * 冻结ID
      * 冻结ID
      */
      */
@@ -268,6 +303,9 @@ public class FreezeQuery extends PageInfo<FreezeQuery> implements Serializable {
     @ApiModelProperty(value = "客户名称")
     @ApiModelProperty(value = "客户名称")
     private String cusName;
     private String cusName;
 
 
+    @ApiModelProperty(value = "客户电话")
+    private String cusPhone;
+
     /**
     /**
      * @desc   : 冻结状态
      * @desc   : 冻结状态
      * @author : 宋扬
      * @author : 宋扬

+ 49 - 0
src/main/java/com/dk/mdm/model/query/ivt/TransferQuery.java

@@ -9,6 +9,7 @@ import com.dk.common.infrastructure.handler.TimestampTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.model.pojo.PageInfo;
 import com.dk.common.model.pojo.PageInfo;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
@@ -18,6 +19,7 @@ import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
 import lombok.experimental.Accessors;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.util.List;
 import java.util.List;
 
 
@@ -61,7 +63,54 @@ public class TransferQuery extends PageInfo<TransferQuery> implements Serializab
     @ApiModelProperty(value = "调整单号")
     @ApiModelProperty(value = "调整单号")
     private String transferNo;
     private String transferNo;
 
 
+    @ApiModelProperty(value = "入库时间开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate makeTimeStart;
 
 
+    @ApiModelProperty(value = "入库时间结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate makeTimeEnd;
+
+    @ApiModelProperty(value = "调整日期开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate transferDateWStart;
+
+    @ApiModelProperty(value = "调整日期结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate transferDateWEnd;
+
+    private String searchText;
+
+    /**
+     * 员工名称
+     */
+    @Excel(name = "员工名称")
+    @ApiModelProperty(value = "员工名称")
+    private String staffName;
+
+    @ApiModelProperty(value = "部门名称")
+    @TableField(exist = false)
+    private String orgName;
+
+    /**
+     * 原仓库名称
+     */
+    @Excel(name = "原仓库名称")
+    @ApiModelProperty(value = "原仓库名称")
+    @JsonProperty(value = "oWhName")
+    private String oWhName;
+
+    /**
+     * 仓库名称
+     */
+    @Excel(name = "仓库名称")
+    @ApiModelProperty(value = "仓库名称")
+    @JsonProperty(value = "whName")
+    private String whName;
+
+
+    @ApiModelProperty(value = "调整类型")
+    private List<String> transferTypeList;
     /**
     /**
      * 调整类型 (【系统字典】调整类型(库区调整、批号调整))
      * 调整类型 (【系统字典】调整类型(库区调整、批号调整))
      */
      */

+ 24 - 2
src/main/java/com/dk/mdm/model/vo/mst/GoodsSkuVO.java

@@ -46,8 +46,18 @@ public class GoodsSkuVO implements Serializable {
     @ApiModelProperty(value = "商品ID")
     @ApiModelProperty(value = "商品ID")
     @TableField(typeHandler = UuidTypeHandler.class)
     @TableField(typeHandler = UuidTypeHandler.class)
     private String skuId;
     private String skuId;
-
-
+    /**
+     * 非标号
+     */
+    @Excel(name = "非标号")
+    @ApiModelProperty(value = "非标号")
+    private String nonStdCode;
+    /**
+     * 仓库ID
+     */
+    @ApiModelProperty(value = "仓库ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String whId;
     /**
     /**
      * 商品编号
      * 商品编号
      */
      */
@@ -55,6 +65,18 @@ public class GoodsSkuVO implements Serializable {
     @ApiModelProperty(value = "商品编号")
     @ApiModelProperty(value = "商品编号")
     private String skuCode;
     private String skuCode;
 
 
+    /**
+     * 入库数量 (流入为正数,流出为负数)
+     */
+    @ApiModelProperty(value = "入库数量 (流入为正数,流出为负数)")
+    private BigDecimal intoQty;
+
+
+    /**
+     * 入库金额
+     */
+    @ApiModelProperty(value = "入库金额")
+    private BigDecimal intoAmt;
 
 
     /**
     /**
      * 商品名称
      * 商品名称

+ 54 - 5
src/main/java/com/dk/mdm/service/ivt/inventory/InventoryService.java

@@ -428,7 +428,9 @@ public class InventoryService extends BaseService<Inventory> {
                 //新建
                 //新建
                 if (intoAddList.size() > 0) {
                 if (intoAddList.size() > 0) {
                     //正常逻辑 新建库存
                     //正常逻辑 新建库存
-                    this.operatingInsertInventory(intoAddList);
+                    intoAddList =  this.operatingInsertInventory(intoAddList);
+                    //修改入库单单价、金额、成本等信息
+                    this.updateIntobound(intoAddList);
                 }
                 }
                 //编辑
                 //编辑
                 if (intoEditList.size() > 0) {
                 if (intoEditList.size() > 0) {
@@ -510,7 +512,7 @@ public class InventoryService extends BaseService<Inventory> {
     @Transactional(
     @Transactional(
             rollbackFor = {Exception.class}
             rollbackFor = {Exception.class}
     )
     )
-    public void operatingInsertInventory(List<InOutRecordVO> inOutRecordVOList) {
+    public List<InOutRecordVO>  operatingInsertInventory(List<InOutRecordVO> inOutRecordVOList) {
         for (InOutRecordVO inOutRecordVO : inOutRecordVOList) {
         for (InOutRecordVO inOutRecordVO : inOutRecordVOList) {
             //校验库存是否存在
             //校验库存是否存在
             InventoryResponse inventoryResponse = this.checkInventoryNumber(inOutRecordVO);
             InventoryResponse inventoryResponse = this.checkInventoryNumber(inOutRecordVO);
@@ -535,6 +537,7 @@ public class InventoryService extends BaseService<Inventory> {
                         //region 库存流水
                         //region 库存流水
                         this.insertInboundRecord(inOutRecordVO);
                         this.insertInboundRecord(inOutRecordVO);
                         //endregion
                         //endregion
+
                     }
                     }
                 }
                 }
                 //endregion
                 //endregion
@@ -663,6 +666,8 @@ public class InventoryService extends BaseService<Inventory> {
 
 
             }
             }
         }
         }
+
+        return inOutRecordVOList;
     }
     }
 
 
     /**
     /**
@@ -677,9 +682,17 @@ public class InventoryService extends BaseService<Inventory> {
         //先删后加
         //先删后加
         this.deleteInventory(inOutRecordVOList);
         this.deleteInventory(inOutRecordVOList);
         //新建
         //新建
-        this.operatingInsertInventory(inOutRecordVOList);
-        //修改源出库信息
-        this.updateOutboundPri(inOutRecordVOList);
+        inOutRecordVOList = this.operatingInsertInventory(inOutRecordVOList);
+        //入库
+        if (Constant.InventoryType.INBOUND.getName().equals(inOutRecordVOList.get(0).getInventoryType())) {
+            //修改入库单单价、金额、成本等信息
+            this.updateIntobound(inOutRecordVOList);
+        }
+        //出库
+        else{
+            //修改源出库信息
+            this.updateOutboundPri(inOutRecordVOList);
+        }
     }
     }
 
 
     /**
     /**
@@ -888,6 +901,42 @@ public class InventoryService extends BaseService<Inventory> {
     }
     }
 
 
     /**
     /**
+     * @desc : 新建
+     * @date : 2024/4/10 15:27
+     * @author : 王英杰
+     */
+    @Transactional(
+            rollbackFor = {Exception.class}
+    )
+    public InOutRecordVO insertInventoryw(InOutRecordVO inOutRecordVO) {
+        Inventory inventory = new Inventory();
+        //仓库Id
+        inventory.setWhId(inOutRecordVO.getWhId());
+        //商品id
+        inventory.setSkuId(inOutRecordVO.getSkuId());
+        //非标号
+        inventory.setNonStdCode(inOutRecordVO.getNonStdCode());
+        //库存数量
+        inventory.setInvQty(inOutRecordVO.getIntoQty());
+        //可售数量(可用量)
+        inventory.setUsableQty(inOutRecordVO.getIntoQty());
+        //库存资产
+        inventory.setCostAmt(inOutRecordVO.getIntoAmt());
+        //库存单价   存货资产/存货数量
+        inventory.setCostPrice(inventory.getCostAmt().divide(inventory.getInvQty(), BigDecimal.ROUND_HALF_UP));
+
+
+        //新建
+        inventoryMapper.insert(inventory);
+        //仓库Id赋值
+        inOutRecordVO.setInvId(inventory.getInvId());
+
+        return inOutRecordVO;
+
+    }
+
+
+    /**
      * @desc : 出库成本
      * @desc : 出库成本
      * @date : 2024/3/22 9:33
      * @date : 2024/3/22 9:33
      * @author : 寇珊珊
      * @author : 寇珊珊

+ 14 - 0
src/main/java/com/dk/mdm/service/mst/GoodsSkuService.java

@@ -15,9 +15,11 @@ import com.dk.mdm.model.query.mst.GoodsSkuQuery;
 import com.dk.mdm.model.query.mst.RoleQuery;
 import com.dk.mdm.model.query.mst.RoleQuery;
 import com.dk.mdm.model.response.mst.GoodsSkuResponse;
 import com.dk.mdm.model.response.mst.GoodsSkuResponse;
 import com.dk.mdm.model.response.mst.RoleResponse;
 import com.dk.mdm.model.response.mst.RoleResponse;
+import com.dk.mdm.model.vo.ivt.InOutRecordVO;
 import com.dk.mdm.model.vo.mst.GoodsSkuVO;
 import com.dk.mdm.model.vo.mst.GoodsSkuVO;
 import com.dk.mdm.model.vo.mst.RoleVo;
 import com.dk.mdm.model.vo.mst.RoleVo;
 import com.dk.mdm.service.common.CommonService;
 import com.dk.mdm.service.common.CommonService;
+import com.dk.mdm.service.ivt.inventory.InventoryService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -39,6 +41,9 @@ public class GoodsSkuService extends BaseService<GoodsSku> {
 
 
 	@Autowired
 	@Autowired
 	private GoodsSkuConvert goodsSkuConvert;
 	private GoodsSkuConvert goodsSkuConvert;
+
+	@Autowired
+	InventoryService inventoryService;
  /**
  /**
      * @desc   : 重写组件
      * @desc   : 重写组件
      * @author : 王英杰
      * @author : 王英杰
@@ -78,6 +83,15 @@ public class GoodsSkuService extends BaseService<GoodsSku> {
 		goodsSku.setSkuId(codeMap.get("outId").toString());
 		goodsSku.setSkuId(codeMap.get("outId").toString());
 		goodsSku.setSkuCode(codeMap.get("outNote").toString());
 		goodsSku.setSkuCode(codeMap.get("outNote").toString());
 		super.insert(goodsSku);
 		super.insert(goodsSku);
+		InOutRecordVO inOutRecordVO = new InOutRecordVO();
+		inOutRecordVO.setWhId(goodsSkuVO.getWhId());
+		inOutRecordVO.setSkuId(goodsSku.getSkuId());
+		inOutRecordVO.setNonStdCode(goodsSkuVO.getNonStdCode());
+		inOutRecordVO.setIntoQty(goodsSkuVO.getIntoQty());
+		inOutRecordVO.setIntoAmt(goodsSkuVO.getIntoAmt());
+		if(inOutRecordVO.getWhId()!=null){
+			inventoryService.insertInventoryw(inOutRecordVO);
+		}
 		return ResponseResultUtil.success();
 		return ResponseResultUtil.success();
 	}
 	}
 	/**
 	/**