Преглед изворни кода

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

zhoux пре 1 година
родитељ
комит
4fcb8a497b

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

@@ -95,6 +95,17 @@ public class ReportController  {
     public ResponseResultVO<PageList<Map<String, Object>>> getSalesTrackingReport(@RequestBody Map<String, Object> param) {
     public ResponseResultVO<PageList<Map<String, Object>>> getSalesTrackingReport(@RequestBody Map<String, Object> param) {
         return reportService.getSalesTrackingReport(param);
         return reportService.getSalesTrackingReport(param);
     }
     }
+
+    /**
+     * @desc   : 销售明细
+     * @author : 于继渤
+     * @date   : 2024/4/16 11:27
+     */
+    @PostMapping("sales_item_report")
+    public ResponseResultVO<PageList<Map<String, Object>>> getSalesItemReport(@RequestBody Map<String, Object> param) {
+        return reportService.getSalesItemReport(param);
+    }
+
     /**
     /**
      * @desc   : 采购跟踪表 列表查询
      * @desc   : 采购跟踪表 列表查询
      * @author : 王英杰
      * @author : 王英杰

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

@@ -94,9 +94,18 @@ public interface ReportMapper extends BaseMapper<JSONObject> {
      */
      */
     List<Map<String, Object>> getSalesTrackingReport(Map param);
     List<Map<String, Object>> getSalesTrackingReport(Map param);
 
 
+    /**
+     * @desc   : 销售明细表 列表查询
+     * @author : 于继渤
+     * @date   : 2024/4/16 11:27
+     */
+    List<Map<String, Object>> getSalesItemReport(Map param);
+
     List<Map<String, Object>> getSalesTrackingReportDetail(String id);
     List<Map<String, Object>> getSalesTrackingReportDetail(String id);
     Long getSalesTrackingReportCount(Map<String, Object> param);
     Long getSalesTrackingReportCount(Map<String, Object> param);
 
 
+    Long getSalesItemReportCount(Map<String, Object> param);
+
 
 
     /**
     /**
      * @desc   : 采购跟踪表 列表查询
      * @desc   : 采购跟踪表 列表查询

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

@@ -1097,6 +1097,115 @@
     </sql>
     </sql>
 
 
 
 
+    <!--  销售明细查询 -->
+    <select id="getSalesItemReport" resultType="java.util.Map">
+        SELECT
+            t.item_id AS "itemId",
+            t.order_id AS "orderId",
+            t.item_index AS "itemIndex",
+            t.sku_id AS "skuId",
+            tmgs.sku_code  as "skuCode",
+            tmgs.sku_model as "skuModel",
+            tmgs.sku_name  as "skuName",
+            t.item_qty AS "itemQty",
+            t.price_std AS "priceStd",
+            t.amt_std AS "amtStd",
+            t.price_sale AS "priceSale",
+            t.item_amt AS "itemAmt",
+            t.price_discount AS "priceDiscount",
+            t.non_std_code AS "nonStdCode",
+            t.out_status AS "outStatus",
+            t.outing_qty AS "outingQty",
+            t.outing_amt AS "outingAmt",
+            t.out_qty AS "outQty",
+            t.out_amt AS "outAmt",
+            t.return_qty AS "returnQty",
+            t.return_amt AS "returnAmt",
+            t.remarks,
+            t.wh_id AS "whId",
+            tmw.wh_name AS "whName"
+        FROM dkic_b.t_psi_order_item as t
+        inner join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
+        left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = t.wh_id
+        <include refid="ConditionSaleItem"/>
+        order by t.item_index
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+
+    </select>
+
+    <sql id="ConditionSaleItem">
+        <where>
+            <if test="orderId != null and orderId != ''">
+                AND t.order_id = #{orderId}::uuid
+            </if>
+            <if test="itemIndex != null">
+                AND t.item_index = #{itemIndex}
+            </if>
+            <if test="skuId != null and skuId != ''">
+                AND t.sku_id = #{skuId}
+            </if>
+            <if test="itemQty != null">
+                AND t.item_qty = #{itemQty}
+            </if>
+            <if test="priceStd != null">
+                AND t.price_std = #{priceStd}
+            </if>
+            <if test="amtStd != null">
+                AND t.amt_std = #{amtStd}
+            </if>
+            <if test="priceSale != null">
+                AND t.price_sale = #{priceSale}
+            </if>
+            <if test="itemAmt != null">
+                AND t.item_amt = #{itemAmt}
+            </if>
+            <if test="priceDiscount != null">
+                AND t.price_discount = #{priceDiscount}
+            </if>
+            <if test="nonStdCode != null and nonStdCode != ''">
+                AND t.non_std_code = #{nonStdCode}
+            </if>
+            <if test="outStatus != null and outStatus != ''">
+                AND t.out_status = #{outStatus}
+            </if>
+            <if test="outingQty != null">
+                AND t.outing_qty = #{outingQty}
+            </if>
+            <if test="outingAmt != null">
+                AND t.outing_amt = #{outingAmt}
+            </if>
+            <if test="outQty != null">
+                AND t.out_qty = #{outQty}
+            </if>
+            <if test="outAmt != null">
+                AND t.out_amt = #{outAmt}
+            </if>
+            <if test="returnQty != null">
+                AND t.return_qty = #{returnQty}
+            </if>
+            <if test="returnAmt != null">
+                AND t.return_amt = #{returnAmt}
+            </if>
+            <if test="remarks != null and remarks != ''">
+                AND t.remarks = #{remarks}
+            </if>
+            <if test="flgValid != null">
+                AND t.flg_valid = #{flgValid}
+            </if>
+            <if test="cpId != null">
+                AND t.cp_id = #{cpId}
+            </if>
+        </where>
+    </sql>
+    <select id="getSalesItemReportCount" resultType="java.lang.Long">
+        SELECT count(1)
+        FROM
+        FROM dkic_b.t_psi_order_item t
+        <include refid="ConditionSaleItem"/>
+    </select>
+
     <select id="getSalesTrackingReportCount" resultType="java.lang.Long">
     <select id="getSalesTrackingReportCount" resultType="java.lang.Long">
         SELECT count(1)
         SELECT count(1)
         FROM
         FROM
@@ -1104,6 +1213,7 @@
         <include refid="ConditionSalesTrackingReport"/>
         <include refid="ConditionSalesTrackingReport"/>
     </select>
     </select>
 
 
+
     <select id="getSalesTrackingReportDetail"  resultType="java.util.Map">
     <select id="getSalesTrackingReportDetail"  resultType="java.util.Map">
         SELECT T
         SELECT T
                    ."id",
                    ."id",

+ 25 - 0
src/main/java/com/dk/mdm/service/report/ReportService.java

@@ -158,6 +158,31 @@ public class ReportService {
 
 
 
 
     /**
     /**
+     * @desc   : 销售明细
+     * @author : 于继渤
+     * @date   : 2024/4/16 11:27
+     */
+    public ResponseResultVO<PageList<Map<String, Object>>> getSalesItemReport(Map<String, Object> param) {
+
+        // 校验分页参数
+        if (param.get("pageSize") == null || param.get("currentPage") == null) {
+            return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
+        }
+        // 定义返回值
+        PageList data = new PageList<>();
+        // 获取SKU商品
+        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>> dataList = reportMapper.getSalesItemReport(param);
+        data.setList(dataList);
+        data.setTotal(reportMapper.getSalesItemReportCount(param));
+        data.setPageSize((Integer) param.get("pageSize"));
+        data.setCurrentPage((Integer) param.get("currentPage"));
+        return ResponseResultUtil.success(data);
+    }
+
+
+    /**
      * @desc   : 采购跟踪表 列表查询
      * @desc   : 采购跟踪表 列表查询
      * @author : 王英杰
      * @author : 王英杰
      * @date   : 2024/4/16 11:27
      * @date   : 2024/4/16 11:27