Преглед на файлове

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

zhoux преди 1 година
родител
ревизия
03c5f727b9

+ 1 - 1
src/main/java/com/dk/mdm/controller/report/ReportController.java

@@ -41,7 +41,7 @@ public class ReportController  {
             notes = "获取库存"
             notes = "获取库存"
     )
     )
     @PostMapping("get_ivt_detail_report")
     @PostMapping("get_ivt_detail_report")
-    public ResponseResultVO<List<Map<String, Object>>> getIvtDetailReport(@RequestBody Map<String, Object> param) {
+    public ResponseResultVO<PageList<Map<String, Object>>> getIvtDetailReport(@RequestBody Map<String, Object> param) {
         return reportService.getIvtDetailReport(param);
         return reportService.getIvtDetailReport(param);
     }
     }
 
 

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

@@ -23,7 +23,7 @@ public interface ReportMapper extends BaseMapper<JSONObject> {
      * @date   : 2024/4/11 8:52
      * @date   : 2024/4/11 8:52
      */
      */
     List<Map<String, Object>> getIvtDetailReport(Map param);
     List<Map<String, Object>> getIvtDetailReport(Map param);
-
+    Long getIvtDetailReportCount(Map<String, Object> param);
 
 
     /**
     /**
      * @desc   : 采购明细表(主表)
      * @desc   : 采购明细表(主表)

+ 35 - 0
src/main/java/com/dk/mdm/mapper/report/ReportMapper.xml

@@ -63,6 +63,41 @@
         <if test="whId != null">
         <if test="whId != null">
             AND tpi.wh_id = #{whId} ::uuid
             AND tpi.wh_id = #{whId} ::uuid
         </if>
         </if>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+    <!--库存查询count-->
+    <select id="getIvtDetailReportCount" resultType="java.lang.Long">
+        SELECT count(1)
+        from dkic_b.t_psi_inventory as tpi
+        inner join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
+        inner join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpi.sku_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_series as tmgseries on tmgs.series_id = tmgseries.series_id
+        left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
+        where tpi.flg_valid
+        AND tpi.cp_id = #{cpId}
+        AND tpi.inv_qty != 0
+        <if test="skuId != null">
+            AND tpi.sku_id = #{skuId} ::uuid
+        </if>
+        <if test="nonStdCode != null">
+            AND tpi.non_std_code = #{nonStdCode}
+        </if>
+        <if test="skuCode != null">
+            AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
+        </if>
+        <if test="skuName != null">
+            AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
+        </if>
+        <if test="whName != null">
+            AND tmgs.wh_name LIKE concat('%',my_ex.likequery(#{whName}),'%')
+        </if>
+        <if test="whId != null">
+            AND tpi.wh_id = #{whId} ::uuid
+        </if>
     </select>
     </select>
     <!-- 采购明细报表明细条件列 -->
     <!-- 采购明细报表明细条件列 -->
     <sql id="Condition_PurDetailReport">
     <sql id="Condition_PurDetailReport">

+ 13 - 2
src/main/java/com/dk/mdm/service/report/ReportService.java

@@ -103,10 +103,21 @@ public class ReportService {
      * @author : 常皓宁
      * @author : 常皓宁
      * @date : 2024/4/11 8:52
      * @date : 2024/4/11 8:52
      */
      */
-    public ResponseResultVO<List<Map<String, Object>>> getIvtDetailReport(Map<String, Object> param) {
+    public ResponseResultVO<PageList<Map<String, Object>>> getIvtDetailReport(Map<String, Object> param) {
+        // 校验分页参数
+        if (param.get("pageSize") == null || param.get("currentPage") == null) {
+            return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
+        }
         // 获取系统基础数据
         // 获取系统基础数据
+        PageList data = new PageList<>();
+        param.put("start", (Integer.parseInt(param.get("currentPage").toString()) - 1) * Integer.parseInt(param.get("pageSize").toString()));
+        param.put("end", Integer.parseInt(param.get("pageSize").toString()));
         List<Map<String, Object>> list = reportMapper.getIvtDetailReport(param);
         List<Map<String, Object>> list = reportMapper.getIvtDetailReport(param);
-        return ResponseResultUtil.success(list);
+        data.setList(list);
+        data.setTotal(reportMapper.getIvtDetailReportCount(param));
+        data.setPageSize((Integer) param.get("pageSize"));
+        data.setCurrentPage((Integer) param.get("currentPage"));
+        return ResponseResultUtil.success(data);
     }
     }
 
 
     /**
     /**