فهرست منبع

Merge remote-tracking branch 'origin/master'

姜永辉 2 سال پیش
والد
کامیت
2ae3ede22d
22فایلهای تغییر یافته به همراه457 افزوده شده و 25 حذف شده
  1. 10 1
      src/main/java/com/dk/mdm/controller/common/CommonController.java
  2. 12 4
      src/main/java/com/dk/mdm/controller/ivt/TransferController.java
  3. 6 0
      src/main/java/com/dk/mdm/mapper/common/CommonMapper.java
  4. 61 0
      src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml
  5. 1 1
      src/main/java/com/dk/mdm/mapper/ivt/InventoryMapper.xml
  6. 10 1
      src/main/java/com/dk/mdm/mapper/mac/OtherPayableMapper.xml
  7. 10 1
      src/main/java/com/dk/mdm/mapper/mac/OtherReceivableMapper.xml
  8. 2 9
      src/main/java/com/dk/mdm/mapper/mst/GoodsSkuMapper.xml
  9. 213 1
      src/main/java/com/dk/mdm/mapper/report/ReportMapper.xml
  10. 8 0
      src/main/java/com/dk/mdm/model/pojo/mac/OtherPayable.java
  11. 8 0
      src/main/java/com/dk/mdm/model/pojo/mac/OtherReceivable.java
  12. 7 1
      src/main/java/com/dk/mdm/model/pojo/mst/Supplier.java
  13. 8 0
      src/main/java/com/dk/mdm/model/query/mac/OtherPayableQuery.java
  14. 8 0
      src/main/java/com/dk/mdm/model/query/mac/OtherReceivableQuery.java
  15. 8 0
      src/main/java/com/dk/mdm/model/response/mac/OtherPayableResponse.java
  16. 8 0
      src/main/java/com/dk/mdm/model/response/mac/OtherReceivableResponse.java
  17. 8 0
      src/main/java/com/dk/mdm/model/vo/mac/OtherPayableVO.java
  18. 8 0
      src/main/java/com/dk/mdm/model/vo/mac/OtherReceivableVO.java
  19. 8 0
      src/main/java/com/dk/mdm/model/vo/mst/SupplierVo.java
  20. 13 0
      src/main/java/com/dk/mdm/service/common/CommonService.java
  21. 36 6
      src/main/java/com/dk/mdm/service/ivt/TransferService.java
  22. 4 0
      src/main/java/com/dk/mdm/service/mst/SupplierService.java

+ 10 - 1
src/main/java/com/dk/mdm/controller/common/CommonController.java

@@ -447,7 +447,16 @@ public class CommonController extends BaseController<Map<String, Object>> {
     public ResponseResultVO<List<Map<String, Object>>> getGoodsCategoryNoPage(@RequestBody Map<String, Object> param) {
         return commonService.getGoodsCategoryNoPage(param);
     }
-
+    /**
+     * @desc :  商品种类查询
+     * @author : 王英杰
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"get_goods_category_tree"})
+    public ResponseResultVO<List<Map<String, Object>>> getGoodsCategoryTree(@RequestBody Map<String, Object> param) {
+        return commonService.getGoodsCategoryTree(param);
+    }
 
     /**
      * @desc :  计量单位查询

+ 12 - 4
src/main/java/com/dk/mdm/controller/ivt/TransferController.java

@@ -9,11 +9,8 @@ import com.dk.mdm.model.response.ivt.TransferResponse;
 import com.dk.mdm.model.vo.ivt.CheckVO;
 import com.dk.mdm.model.vo.ivt.TransferVO;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RestController;
 import io.swagger.annotations.Api;
 import com.dk.mdm.service.ivt.TransferService;
 
@@ -50,4 +47,15 @@ public class TransferController{
     public ResponseResultVO<?> insert(@RequestBody TransferVO transferVO) {
         return transferService.insert(transferVO);
     }
+
+    /**
+     * @desc   : 作废
+     * @author : 宋扬
+     * @date   : 2024/4/15 16:27
+     */
+    @ApiOperation(value = "作废", notes = "作废")
+    @PostMapping({"invalid/{id}"})
+    public ResponseResultVO<?> invalid(@PathVariable String id) {
+        return transferService.invalid(id);
+    }
 }

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

@@ -285,6 +285,12 @@ public interface CommonMapper extends BaseMapper<Map<String, Object>> {
      * @date : 2024/3/1 9:21
      */
     List<Map<String, Object>> getGoodsBrand(Map param);
+    /**
+     * @desc : 获取商品品牌 树形查询
+     * @author : 王英杰
+     * @date : 2024/3/1 9:21
+     */
+    List<Map<String, Object>> getGoodsCategoryTree(Map param);
 
     /**
      * @desc : 获取商品品牌数量

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

@@ -715,6 +715,67 @@
         </if>
     </select>
 
+    <!--    查询商品种类-->
+    <select id="getGoodsCategoryTree" resultType="java.util.Map">
+        SELECT
+        T.cat_id AS "catId",
+        T.cat_code AS "catCode",
+        T.cat_name AS "catName",
+        T.parent_id AS "parentId",
+        T.flg_valid AS "flgValid"
+        FROM
+        (--当前数据
+        SELECT
+        tmgc.cat_id,
+        tmgc.cat_code,
+        tmgc.cat_name,
+        tmgc.parent_id,
+        tmgc.flg_valid
+        FROM
+        dkic_b.t_mst_goods_category tmgc
+        <where>
+            <if test="searchText !=null">
+                AND ( tmgc.cat_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+                or tmgc.remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
+            </if>
+            <if test="cpId != null">
+                AND tmgc.cp_id = #{cpId}
+            </if>
+        </where>
+        UNION ALL--父级
+        SELECT
+        tmgcp.cat_id,
+        tmgcp.cat_code,
+        tmgcp.cat_name,
+        tmgcp.parent_id,
+        tmgcp.flg_valid
+        FROM
+        dkic_b.t_mst_goods_category tmgc
+        LEFT JOIN dkic_b.t_mst_goods_category tmgcp ON tmgc.cat_id = ANY ( tmgcp.level_lower )
+        <where>
+            <if test="searchText !=null">
+                AND ( tmgc.cat_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+                or tmgc.remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
+            </if>
+            <if test="cpId != null">
+                AND tmgc.cp_id = #{cpId}
+            </if>
+        </where>
+        ) T
+        WHERE T.cat_id IS NOT NULL
+        GROUP BY
+        T.cat_id,
+        T.cat_code,
+        T.cat_name,
+        T.parent_id,
+        T.flg_valid
+
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+
+    </select>
+
     <!-- 查询表t_mst_goods_brand,(条件查询)个数 -->
     <select id="countGoodsBrand" resultType="Long">
         SELECT

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

@@ -66,7 +66,7 @@
     <sql id="Condition">
         <where>
             <if test="whId != null and whId != ''">
-                AND tpi.wh_id = #{whId}
+                AND tpi.wh_id = #{whId}::UUID
             </if>
             <if test="skuId != null and skuId != ''">
                 AND tpi.sku_id = #{skuId}

+ 10 - 1
src/main/java/com/dk/mdm/mapper/mac/OtherPayableMapper.xml

@@ -5,7 +5,7 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        payable_id, payable_no, object_type, object_id, org_id, staff_id, sum_amt_payable, acc_item_id, acc_date, remarks, annex_paths, make_staff, make_time, flg_valid, cp_id
+        payable_id, payable_no, object_type, business_type, object_id, org_id, staff_id, sum_amt_payable, acc_item_id, acc_date, remarks, annex_paths, make_staff, make_time, flg_valid, cp_id
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -13,6 +13,7 @@
         <id column="payable_id" property="payableId"/>
             <result column="payable_no" property="payableNo"/>
             <result column="object_type" property="objectType"/>
+            <result column="business_type" property="businessType"/>
             <result column="object_id" property="objectId" typeHandler="UuidTypeHandler"/>
             <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
             <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
@@ -32,6 +33,7 @@
         <id column="payable_id" property="payableId"/>
             <result column="payable_no" property="payableNo"/>
             <result column="object_type" property="objectType"/>
+            <result column="business_type" property="businessType"/>
             <result column="object_id" property="objectId" typeHandler="UuidTypeHandler"/>
             <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
             <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
@@ -56,6 +58,9 @@
             <if test="objectType != null and objectType != ''">
                 AND t.object_type = #{objectType}
             </if>
+            <if test="businessType != null and businessType != ''">
+                AND t.business_type = #{businessType}
+            </if>
             <if test="objectId != null and objectId != ''">
                 AND t.object_id = #{objectId}
             </if>
@@ -122,6 +127,7 @@
         SELECT t.payable_id,
                t.payable_no,
                t.object_type,
+               t.business_type,
                sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "objectTypeName",
                t.object_id,
                supplier.sup_code    as "supCode",
@@ -171,6 +177,7 @@
         SELECT t.payable_id,
                t.payable_no,
                t.object_type,
+               t.business_type,
                sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "objectTypeName",
                t.object_id,
                supplier.sup_code    as "supCode",
@@ -223,6 +230,7 @@
         <trim suffixOverrides=",">
             payable_no,
             object_type,
+            business_type,
             object_id,
             org_id,
             staff_id,
@@ -243,6 +251,7 @@
             <trim suffixOverrides=",">
                 #{item.payableNo},
                 #{item.objectType},
+                #{item.businessType},
                 #{item.objectId}::uuid,
                 #{item.orgId}::uuid,
                 #{item.staffId}::uuid,

+ 10 - 1
src/main/java/com/dk/mdm/mapper/mac/OtherReceivableMapper.xml

@@ -5,7 +5,7 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        receivable_id, receivable_no, object_type, object_id, org_id, staff_id, sum_amt_receivable, acc_item_id, acc_date, remarks, annex_paths, make_staff, make_time, flg_valid, cp_id
+        receivable_id, receivable_no, object_type, business_type, object_id, org_id, staff_id, sum_amt_receivable, acc_item_id, acc_date, remarks, annex_paths, make_staff, make_time, flg_valid, cp_id
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -13,6 +13,7 @@
         <id column="receivable_id" property="receivableId"/>
             <result column="receivable_no" property="receivableNo"/>
             <result column="object_type" property="objectType"/>
+            <result column="business_type" property="businessType"/>
             <result column="object_id" property="objectId" typeHandler="UuidTypeHandler"/>
             <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
             <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
@@ -32,6 +33,7 @@
         <id column="receivable_id" property="receivableId"/>
             <result column="receivable_no" property="receivableNo"/>
             <result column="object_type" property="objectType"/>
+            <result column="business_type" property="businessType"/>
             <result column="object_id" property="objectId" typeHandler="UuidTypeHandler"/>
             <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
             <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
@@ -56,6 +58,9 @@
             <if test="objectType != null and objectType != ''">
                 AND t.object_type = #{objectType}
             </if>
+            <if test="businessType != null and businessType != ''">
+                AND t.business_type = #{businessType}
+            </if>
             <if test="objectId != null and objectId != ''">
                 AND t.object_id = #{objectId}
             </if>
@@ -125,6 +130,7 @@
         SELECT t.receivable_id,
                t.receivable_no,
                t.object_type,
+               t.business_type,
                sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "objectTypeName",
                t.object_id,
                tmc.cus_code         as "cusCode",
@@ -177,6 +183,7 @@
         SELECT t.receivable_id,
                t.receivable_no,
                t.object_type,
+               t.business_type,
                sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "objectTypeName",
                t.object_id,
                tmc.cus_id         as "cusId",
@@ -231,6 +238,7 @@
         <trim suffixOverrides=",">
             receivable_no,
             object_type,
+            business_type,
             object_id,
             org_id,
             staff_id,
@@ -250,6 +258,7 @@
             <trim suffixOverrides=",">
                 #{item.receivableNo},
                 #{item.objectType},
+                #{item.businessType},
                 #{item.objectId}::uuid,
                 #{item.orgId}::uuid,
                 #{item.staffId}::uuid,

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

@@ -139,7 +139,7 @@
                 )
             </if>
             <if test="searchText !=null">
-                AND ( tmgs.sku_name LIKE concat('%', #{searchText}, '%')
+                AND tmgs.sku_name LIKE concat('%', #{searchText}, '%')
             </if>
         </where>
     </sql>
@@ -163,14 +163,7 @@
         LEFT JOIN dkic_b.t_mst_goods_series tmgsr ON tmgsr.series_id = tmgs.series_id
         LEFT JOIN dkic_b.t_psi_inventory tpi ON tpi.sku_id = tmgs.sku_id
         <include refid="Condition"/>
-        ORDER BY CASE
-        WHEN #{sort}  = 2 THEN tpi.usable_qty
-        ELSE NULL
-        END ASC,
-        CASE
-        WHEN #{sort} != 2 THEN tpi.usable_qty
-        ELSE NULL
-        END DESC
+        order by  tmgs.op_create_time desc
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>

+ 213 - 1
src/main/java/com/dk/mdm/mapper/report/ReportMapper.xml

@@ -383,6 +383,116 @@
         </where>
     </sql>
 
+    <!-- 入库明细报表明细条件列 -->
+    <sql id="Condition_IntoboundDetailReport">
+        <where>
+            <if test="cpId != null">
+                AND t.cp_id = #{cpId}
+            </if>
+            <if test="outNo != null and outNo != ''">
+                AND t.out_no LIKE concat('%',my_ex.likequery(#{outNo}),'%')
+            </if>
+            <if test="supIdlist != null and supIdlist.size()>0">
+                AND t.sup_id = any(#{supIdlist,typeHandler=UuidListTypeHandler})
+            </if>
+            <if test="contactPhone != null and contactPhone != ''">
+                AND t.contact_phone LIKE concat('%',my_ex.likequery(#{contactPhone}),'%')
+            </if>
+            <if test="outTypeList != null and outTypeList.size()>0">
+                AND t.out_type =any(#{outTypeList,typeHandler=StringListTypeHandler})
+            </if>
+            <if test="fromNo != null and fromNo != ''">
+                AND t.from_no LIKE concat('%',my_ex.likequery(#{fromNo}),'%')
+            </if>
+            <if test="cusName != null and cusName != ''">
+                AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
+            </if>
+            <if test="orgIdList != null and orgIdList.size() > 0">
+                AND t.org_id  =any(#{orgIdList, typeHandler=uuidListTypeHandler})
+            </if>
+            <if test="staffIdList != null and staffIdList.size() > 0">
+                AND t.staff_id  =any(#{staffIdList, typeHandler=uuidListTypeHandler})
+            </if>
+            <if test="outStatusList != null and outStatusList.size() > 0">
+                AND t.out_status  =any(#{outStatusList, typeHandler=StringListTypeHandler})
+            </if>
+            <if test="outDateStart != null and outDateEnd != null">
+                AND t.out_date &gt;= #{outDateStart}::timestamp with time zone
+                AND t.out_date &lt; #{outDateEnd}::timestamp with time zone + interval '1 day'
+            </if>
+            <if test="makeTimeStart != null and makeTimeEnd != null">
+                AND t.make_time &gt;= #{makeTimeStart}::timestamp with time zone
+                AND t.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
+            </if>
+            <if test="goodsSeriesList != null  and goodsSeriesList.size()>0">
+                AND tmgs.series_id =
+                any(#{goodsSeriesList,typeHandler=UuidListTypeHandler})
+            </if>
+            <if test="goodsCategoryList != null  and goodsCategoryList.size()>0">
+                AND tmgs.category_id =
+                any(#{goodsCategoryList,typeHandler=UuidListTypeHandler})
+            </if>
+            <if test="goodsBrandList != null  and goodsBrandList.size()>0">
+                AND tmgs.brand_id =
+                any(#{goodsBrandList,typeHandler=UuidListTypeHandler})
+            </if>
+            <if test="skuName != null and skuName != ''">
+                AND tmgs.sku_name like concat('%', my_ex.likequery(#{skuName}) , '%')
+            </if>
+            <if test="skuModel != null and skuModel != ''">
+                AND tmgs.sku_model like concat('%', my_ex.likequery(#{skuModel}) , '%')
+            </if>
+            <if test="whList != null  and whList.size()>0">
+                AND tpi.wh_id =
+                any(#{whList,typeHandler=UuidListTypeHandler})
+            </if>
+        </where>
+    </sql>
+
+    <!-- 入库明细报表主表条件列 -->
+    <sql id="Condition_IntoboundReport">
+        <where>
+            <if test="cpId != null">
+                AND t.cp_id = #{cpId}
+            </if>
+            <if test="outNo != null and outNo != ''">
+                AND t.out_no LIKE concat('%',my_ex.likequery(#{outNo}),'%')
+            </if>
+            <if test="supIdlist != null and supIdlist.size()>0">
+                AND t.sup_id = any(#{supIdlist,typeHandler=UuidListTypeHandler})
+            </if>
+            <if test="contactPhone != null and contactPhone != ''">
+                AND t.contact_phone LIKE concat('%',my_ex.likequery(#{contactPhone}),'%')
+            </if>
+            <if test="outTypeList != null and outTypeList.size()>0">
+                AND t.out_type =any(#{outTypeList,typeHandler=StringListTypeHandler})
+            </if>
+            <if test="fromNo != null and fromNo != ''">
+                AND t.from_no LIKE concat('%',my_ex.likequery(#{fromNo}),'%')
+            </if>
+            <if test="cusName != null and cusName != ''">
+                AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
+            </if>
+            <if test="orgIdList != null and orgIdList.size() > 0">
+                AND t.org_id  =any(#{orgIdList, typeHandler=uuidListTypeHandler})
+            </if>
+            <if test="staffIdList != null and staffIdList.size() > 0">
+                AND t.staff_id  =any(#{staffIdList, typeHandler=uuidListTypeHandler})
+            </if>
+            <if test="outStatusList != null and outStatusList.size() > 0">
+                AND t.out_status  =any(#{outStatusList, typeHandler=StringListTypeHandler})
+            </if>
+            <if test="outDateStart != null and outDateEnd != null">
+                AND t.out_date &gt;= #{outDateStart}::timestamp with time zone
+                AND t.out_date &lt; #{outDateEnd}::timestamp with time zone + interval '1 day'
+            </if>
+            <if test="makeTimeStart != null and makeTimeEnd != null">
+                AND t.make_time &gt;= #{makeTimeStart}::timestamp with time zone
+                AND t.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
+            </if>
+        </where>
+    </sql>
+
     <!-- 采购明细报表主表 -->
     <select id="getPurReport" resultType="java.util.Map">
         select
@@ -686,7 +796,109 @@
         left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
         left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpoi.inv_id
         left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
-        <include refid="Condition_OrdDetailReport"/>
+        <include refid="Condition_OutboundDetailReport"/>
+        order by  tpoi.op_create_time desc
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 入库明细报表主表 -->
+    <select id="getInboundlReport" resultType="java.util.Map">
+        SELECT
+        t.into_no                                           as "intoNo",
+        t.from_no                                            as "fromNo",
+        tmo.org_name                                        as "orgName",
+        tms.staff_name                                      as "staffName",
+        tmc.cus_name                                        as "cusName",
+        tmc.cus_phone                                        as "cusPhone",
+        tmc.cus_from                                        as "cusFrom",
+        tmc.contact_phone                                   as "contactPhone",
+        tmc.address_full                                     as "addressFull",
+        tmdd.data_value                                      as cus_from_name,
+        tmp.sup_name                                         as "supplierName",
+        sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n})   as "intoStatusName",
+        sys.f_get_name_i18n(tdktype.kind_name_i18n, #{i18n}) as  "intoTypeName",
+        t.intoing_qty                                        as "intoingQtySum",
+        t.intoing_amt                                        as "intoingAmtSum",
+        t.into_qty                                          as "intoQtySum",
+        t.into_amt                                           as "intoAmtSum",
+        t.return_qty                                        as "returnintoQtySum",
+        t.return_amt                                        as "returnintoAmtSum",
+        t.into_date                                         as "intoDate",
+        tmw.wh_name                                        as "whName",
+        t.remarks,
+        makestaff.staff_name                                as "makeStaffName"
+        FROM dkic_b.t_psi_inbound as t
+        left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
+        Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_id
+        left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
+        left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
+        left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
+        left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
+        left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.into_status
+        left join sys.t_data_kind tdktype   ON tdktype.kind_code = t.into_type
+        left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = t.wh_id
+        <include refid="Condition_IntoboundReport"/>
+        order by  t.op_create_time desc
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 入库明细报表明细 -->
+    <select id="getInboundDetailReport" resultType="java.util.Map">
+        select
+        t.into_no                                           as "intoNo"
+        ,t.from_no                                            as "fromNo"
+        ,tmo.org_name                                        as "orgName"
+        ,tms.staff_name                                      as "staffName"
+        ,tmc.cus_name                                        as "cusName"
+        ,tmc.cus_phone                                        as "cusPhone"
+        ,tmc.cus_from                                        as "cusFrom"
+        ,tmc.contact_phone                                   as "contactPhone"
+        ,tmc.address_full                                     as "addressFull"
+        ,tmdd.data_value                                      as cus_from_name
+        ,tmp.sup_name                                         as "supplierName"
+        ,sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n})   as "intoStatusName"
+        ,sys.f_get_name_i18n(tdktype.kind_name_i18n, #{i18n}) as  "intoTypeName"
+        ,t.intoing_qty                                        as "intoingQtySum"
+        ,t.intoing_amt                                        as "intoingAmtSum"
+        ,t.into_qty                                          as "intoQtySum"
+        ,t.into_amt                                           as "intoAmtSum"
+        ,t.return_qty                                        as "returnInQtySum"
+        ,t.return_amt                                        as "returnInAmtSum"
+        ,t.into_date                                         as "intoDate"
+        ,t.remarks
+        ,makestaff.staff_name                               as "makeStaffName"
+        ,tmgs.sku_name                                      as "skuName"
+        ,tmgs.sku_model                                     as "skuModel"
+        ,tpi.non_std_code                                   as "nonStdCode"
+        ,tmgb.short_name                                    as "shortName"
+        ,tmgc.cat_name                                      as "catName"
+        ,series.series_name                                 as "seriesName"
+        ,tpoi.intoing_qty                                    as "intoingQty"
+        ,tpoi.intoing_amt                                    as "intoingAmt"
+        ,tpoi.into_qty                                       as "intoQty"
+        ,tpoi.into_amt                                       as "intoAmt"
+        ,tpoi.return_qty                                    as "returnQty"
+        ,tpoi.return_amt                                    as "returnAmt"
+        FROM dkic_b.t_psi_inbound as t
+        left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
+        Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_id
+        left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
+        left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
+        left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
+        left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
+        left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.into_status
+        LEFT JOIN sys.t_data_kind tdktype   ON tdktype.kind_code = t.into_type
+        left join dkic_b.t_psi_inbound_item as tpoi on tpoi.into_id = t.into_id
+        left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpoi.sku_id
+        left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
+        left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
+        left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
+        left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpoi.inv_id
+        <include refid="Condition_IntoboundDetailReport"/>
         order by  tpoi.op_create_time desc
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}

+ 8 - 0
src/main/java/com/dk/mdm/model/pojo/mac/OtherPayable.java

@@ -66,6 +66,14 @@ public class OtherPayable extends PageInfo<OtherPayable> implements Serializable
 
 
     /**
+     * 是否为业务单据 (0:期初 1:业务)
+     */
+    @Excel(name = "是否为业务单据 (0:期初 1:业务)")
+    @ApiModelProperty(value = "是否为业务单据 (0:期初 1:业务)")
+    private Integer businessType;
+
+
+    /**
      * 账务对象ID (账务对象)
      */
     @Excel(name = "账务对象ID (账务对象)")

+ 8 - 0
src/main/java/com/dk/mdm/model/pojo/mac/OtherReceivable.java

@@ -65,6 +65,14 @@ public class OtherReceivable extends PageInfo<OtherReceivable> implements Serial
 
 
     /**
+     * 是否为业务单据 (0:期初 1:业务)
+     */
+    @Excel(name = "是否为业务单据 (0:期初 1:业务)")
+    @ApiModelProperty(value = "是否为业务单据 (0:期初 1:业务)")
+    private Integer businessType;
+
+
+    /**
      * 账务对象ID (账务对象)
      */
     @Excel(name = "账务对象ID (账务对象)")

+ 7 - 1
src/main/java/com/dk/mdm/model/pojo/mst/Supplier.java

@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.alibaba.fastjson.JSONObject;
 
+import java.math.BigDecimal;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
@@ -56,7 +57,12 @@ public class Supplier extends PageInfo<Supplier> implements Serializable {
     @ApiModelProperty(value = "供应商编号")
     private String supCode;
 
-
+    /**
+     * 初始金额
+     */
+    @Excel(name = "初始金额")
+    @ApiModelProperty(value = "初始金额")
+    private int startAmount;
     /**
      * 供应商名称
      */

+ 8 - 0
src/main/java/com/dk/mdm/model/query/mac/OtherPayableQuery.java

@@ -68,6 +68,14 @@ public class OtherPayableQuery extends PageInfo<OtherPayableQuery> implements Se
 
 
     /**
+     * 是否为业务单据 (0:期初 1:业务)
+     */
+    @Excel(name = "是否为业务单据 (0:期初 1:业务)")
+    @ApiModelProperty(value = "是否为业务单据 (0:期初 1:业务)")
+    private Integer businessType;
+
+
+    /**
      * 账务对象ID (账务对象)
      */
     @Excel(name = "账务对象ID (账务对象)")

+ 8 - 0
src/main/java/com/dk/mdm/model/query/mac/OtherReceivableQuery.java

@@ -68,6 +68,14 @@ public class OtherReceivableQuery extends PageInfo<OtherReceivableQuery> impleme
 
 
     /**
+     * 是否为业务单据 (0:期初 1:业务)
+     */
+    @Excel(name = "是否为业务单据 (0:期初 1:业务)")
+    @ApiModelProperty(value = "是否为业务单据 (0:期初 1:业务)")
+    private Integer businessType;
+
+
+    /**
      * 账务对象ID (账务对象)
      */
     @Excel(name = "账务对象ID (账务对象)")

+ 8 - 0
src/main/java/com/dk/mdm/model/response/mac/OtherPayableResponse.java

@@ -67,6 +67,14 @@ public class OtherPayableResponse extends PageInfo<OtherPayableResponse> impleme
 
 
     /**
+     * 是否为业务单据 (0:期初 1:业务)
+     */
+    @Excel(name = "是否为业务单据 (0:期初 1:业务)")
+    @ApiModelProperty(value = "是否为业务单据 (0:期初 1:业务)")
+    private Integer businessType;
+
+
+    /**
      * 账务对象ID (账务对象)
      */
     @Excel(name = "账务对象ID (账务对象)")

+ 8 - 0
src/main/java/com/dk/mdm/model/response/mac/OtherReceivableResponse.java

@@ -74,6 +74,14 @@ public class OtherReceivableResponse extends PageInfo<OtherReceivableResponse> i
 
 
     /**
+     * 是否为业务单据 (0:期初 1:业务)
+     */
+    @Excel(name = "是否为业务单据 (0:期初 1:业务)")
+    @ApiModelProperty(value = "是否为业务单据 (0:期初 1:业务)")
+    private Integer businessType;
+
+
+    /**
      * 账务对象ID (账务对象)
      */
     @Excel(name = "账务对象ID (账务对象)")

+ 8 - 0
src/main/java/com/dk/mdm/model/vo/mac/OtherPayableVO.java

@@ -68,6 +68,14 @@ public class OtherPayableVO extends PageInfo<OtherPayableVO> implements Serializ
 
 
     /**
+     * 是否为业务单据 (0:期初 1:业务)
+     */
+    @Excel(name = "是否为业务单据 (0:期初 1:业务)")
+    @ApiModelProperty(value = "是否为业务单据 (0:期初 1:业务)")
+    private Integer businessType;
+
+
+    /**
      * 账务对象ID (账务对象)
      */
     @Excel(name = "账务对象ID (账务对象)")

+ 8 - 0
src/main/java/com/dk/mdm/model/vo/mac/OtherReceivableVO.java

@@ -68,6 +68,14 @@ public class OtherReceivableVO extends PageInfo<OtherReceivableVO> implements Se
 
 
     /**
+     * 是否为业务单据 (0:期初 1:业务)
+     */
+    @Excel(name = "是否为业务单据 (0:期初 1:业务)")
+    @ApiModelProperty(value = "是否为业务单据 (0:期初 1:业务)")
+    private Integer businessType;
+
+
+    /**
      * 账务对象ID (账务对象)
      */
     @Excel(name = "账务对象ID (账务对象)")

+ 8 - 0
src/main/java/com/dk/mdm/model/vo/mst/SupplierVo.java

@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.alibaba.fastjson.JSONObject;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.time.LocalDateTime;
 
@@ -145,6 +146,13 @@ public class SupplierVo extends PageInfo<SupplierVo> implements Serializable {
     @ApiModelProperty(value = "商品品牌")
     private String brandId;
 
+    /**
+     * 初始金额
+     */
+    @Excel(name = "初始金额")
+    @ApiModelProperty(value = "初始金额")
+    private int startAmount;
+
     @TableField(exist = false)
     @ApiModelProperty(value = "剩余应收付")
     private String sumResidue;

+ 13 - 0
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -673,7 +673,16 @@ public class CommonService extends BaseService<Map<String, Object>> {
     public ResponseResultVO<List<Map<String, Object>>> getGoodsCategoryNoPage(Map<String, Object> param) {
         List<Map<String, Object>> list = commonMapper.getGoodsCategory(param);
         return ResponseResultUtil.success(list);
+    }    /**
+     * @desc :  商品种类查询  树形
+     * @author : 王英杰
+     * @date : 2024/2/26 10:36
+     */
+    public ResponseResultVO<List<Map<String, Object>>> getGoodsCategoryTree(Map<String, Object> param) {
+        List<Map<String, Object>> list = commonMapper.getGoodsCategoryTree(param);
+        return ResponseResultUtil.success(list);
     }
+
     /**
      * @desc : 获取页面数据源集合 (小程序用)
      * @author : 于继渤
@@ -713,6 +722,10 @@ public class CommonService extends BaseService<Map<String, Object>> {
         if (dataSourceCode.equals("org")) {
             list = commonMapper.getOrg(map);
         }
+        //品牌
+        if (dataSourceCode.equals("brand")) {
+            list = commonMapper.getGoodsBrand(map);
+        }
         //员工
         if (dataSourceCode.equals("staff")) {
             list = commonMapper.getStaff(map);

+ 36 - 6
src/main/java/com/dk/mdm/service/ivt/TransferService.java

@@ -1,8 +1,12 @@
 package com.dk.mdm.service.ivt;
 
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.dk.common.exception.BaseBusinessException;
 import com.dk.common.infrastructure.annotaiton.Pagination;
 import com.dk.common.infrastructure.constant.Constant;
+import com.dk.common.infrastructure.enums.ErrorCodeEnum;
 import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
 import com.dk.mdm.infrastructure.convert.ivt.TransferConvert;
@@ -16,6 +20,9 @@ import com.dk.mdm.mapper.ivt.TransferMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.pojo.ivt.TransferItem;
+import com.dk.mdm.model.pojo.mac.RecPay;
+import com.dk.mdm.model.pojo.mac.RecPayItem;
+import com.dk.mdm.model.pojo.sale.Order;
 import com.dk.mdm.model.query.ivt.TransferQuery;
 import com.dk.mdm.model.response.ivt.InboundItemResponse;
 import com.dk.mdm.model.response.ivt.TransferResponse;
@@ -134,8 +141,8 @@ public class TransferService extends BaseService<Transfer> {
 				BigDecimal transferQtySum = transferVO.getItemList().stream().map(TransferItemVO::getTransferQty).reduce(BigDecimal.ZERO, BigDecimal::add)
 						.setScale(6, BigDecimal.ROUND_HALF_UP);
 				// 计算总入库金额
-				BigDecimal intoingAmtSum = transferVO.getItemList().stream().map(TransferItemVO::getIntoingAmt).reduce(BigDecimal.ZERO, BigDecimal::add)
-						.setScale(6, BigDecimal.ROUND_HALF_UP);
+				/*BigDecimal intoingAmtSum = transferVO.getItemList().stream().map(TransferItemVO::getIntoingAmt).reduce(BigDecimal.ZERO, BigDecimal::add)
+						.setScale(6, BigDecimal.ROUND_HALF_UP);*/
 				// 获取入库表实体
 				InboundVO inboundVO = new InboundVO();
 				List<InboundItem> inboundItemList=new ArrayList<>();
@@ -149,7 +156,7 @@ public class TransferService extends BaseService<Transfer> {
 							.setMakeStaff(transferVO.getMakeStaff()).setIntoingQty(transferQtySum)
 							.setFromId(transfer.getTransferId()).setFromNo(transfer.getTransferNo())
 							.setMakeTime(LocalDateTime.now()).setIntoDate(LocalDate.now()).setWhId(transferVO.getWhId())
-							.setFlgAutoHandle(true).setIntoingAmt(intoingAmtSum)
+							.setFlgAutoHandle(true).setIntoingAmt(BigDecimal.ZERO)
 							.setIntoType(Constant.IntoType.REMOVE.getName());
 					// 赋值出库实体
 					outboundVO.setOrgId(transferVO.getOrgId()).setStaffId(transferVO.getStaffId())
@@ -162,7 +169,7 @@ public class TransferService extends BaseService<Transfer> {
 						// 赋值入库明细实体
 						InboundItem inboundItem=new InboundItem();
 						inboundItem.setIntoingQty(transferItemVO.getTransferQty()).setFromId(transfer.getTransferId())
-								.setIntoingAmt(transferItemVO.getIntoingAmt()).setPriceInto(transferItemVO.getPriceInto())
+								.setIntoingAmt(BigDecimal.ZERO).setPriceInto(BigDecimal.ZERO).setIntoId(transferItemVO.getInvId())
 								.setWhId(transferItemVO.getWhId()).setSkuId(transferItemVO.getSkuId())
 								.setNonStdCode(transferItemVO.getONonStdCode()).setItemIndex(transferItemVO.getItemIndex());
 						inboundItemList.add(inboundItem);
@@ -213,7 +220,7 @@ public class TransferService extends BaseService<Transfer> {
 							.setMakeStaff(transferVO.getMakeStaff()).setIntoingQty(transferQtySum)
 							.setFromId(transfer.getTransferId()).setFromNo(transfer.getTransferNo())
 							.setMakeTime(LocalDateTime.now()).setIntoDate(LocalDate.now()).setWhId(transferVO.getOWhId())
-							.setFlgAutoHandle(true).setIntoingAmt(intoingAmtSum)
+							.setFlgAutoHandle(true).setIntoingAmt(BigDecimal.ZERO)
 							.setIntoStatus(Constant.InventoryDocCode.MOVE.getTableName());
 					// 赋值出库实体
 					outboundVO.setOrgId(transferVO.getOrgId()).setStaffId(transferVO.getStaffId())
@@ -226,7 +233,7 @@ public class TransferService extends BaseService<Transfer> {
 						// 赋值入库明细实体
 						InboundItem inboundItem=new InboundItem();
 						inboundItem.setIntoingQty(transferItemVO.getTransferQty()).setFromId(transfer.getTransferId())
-								.setIntoingAmt(transferItemVO.getIntoingAmt()).setPriceInto(transferItemVO.getPriceInto())
+								.setIntoingAmt(BigDecimal.ZERO).setPriceInto(BigDecimal.ZERO).setIntoId(transferItemVO.getInvId())
 								.setWhId(transferItemVO.getOWhId()).setSkuId(transferItemVO.getSkuId())
 								.setNonStdCode(transferItemVO.getNonStdCode()).setItemIndex(transferItemVO.getItemIndex());
 						inboundItemList.add(inboundItem);
@@ -279,4 +286,27 @@ public class TransferService extends BaseService<Transfer> {
 
 	}
 
+	/**
+	 * @desc   : 作废
+	 * @author : 宋扬
+	 * @date   : 2024/4/15 16:28
+	 */
+	public ResponseResultVO<?> invalid(String id) {
+		Transfer transferForUpdate = transferMapper.selectByIdForUpdate(id);
+		// 并发校验
+		if (!transferForUpdate.getFlgValid()) {
+			throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.ISFLGVALID_FALSE.getMessage());
+		}
+
+		// 作废
+		Transfer transferUpdate = new Transfer();
+		transferUpdate.setFlgValid(false).setTransferId(id);
+		super.updateByUuid(transferUpdate);
+
+		// 调用入库作废接口
+
+		// 调用出库作废接口
+
+		return ResponseResultUtil.success();
+	}
 }

+ 4 - 0
src/main/java/com/dk/mdm/service/mst/SupplierService.java

@@ -94,6 +94,10 @@ public class SupplierService extends BaseService<Supplier> {
                  }
                 supplierMapper.insertSupplierBrandtBatch(Supplierlst); // 向供应商品牌表插入数据
             }
+
+             if(supplier.getStartAmount()>0) {
+
+             }
             return ResponseResultUtil.success();
         } catch (Exception e) {
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); // 手动回滚事务