Parcourir la source

商品档案 数据源

dongke il y a 2 ans
Parent
commit
273f243607

+ 49 - 15
src/main/java/com/dk/mdm/controller/common/CommonController.java

@@ -1235,19 +1235,7 @@ public class CommonController extends BaseController<Map<String, Object>> {
     }
 
 
-    /**
-     * @desc : 获取仓库
-     * @author : 洪旭东
-     * @date : 2023-08-09 14:32
-     */
-    @ApiOperation(
-            value = "获取仓库",
-            notes = "获取仓库"
-    )
-    @PostMapping("get_warehouse_by_page")
-    public ResponseResultVO<PageList<Map<String, Object>>> getWarehouseByPage(@RequestBody Map<String, Object> param) {
-        return commonService.getWarehouseByPage(param);
-    }
+
 
 
     /**
@@ -1438,8 +1426,8 @@ public class CommonController extends BaseController<Map<String, Object>> {
         return commonService.getChannel(param);
     }
     /**
-     * @desc : 条件查询
-     * @author : 于继渤
+     * @desc :  商品品牌查询
+     * @author : 王英杰
      * @date : 2024/2/26 10:36
      */
     @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
@@ -1448,6 +1436,52 @@ public class CommonController extends BaseController<Map<String, Object>> {
         return commonService.goodsBrandListBy(param);
     }
 
+    /**
+     * @desc :  商品种类查询
+     * @author : 王英杰
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"goods_category_list_by"})
+    public ResponseResultVO<PageList<Map<String, Object>>> goodsCategoryListBy(@RequestBody Map<String, Object> param) {
+        return commonService.goodsCategoryListBy(param);
+    }
+
+    /**
+     * @desc :  商品系列查询
+     * @author : 王英杰
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"goods_Series_list_by"})
+    public ResponseResultVO<PageList<Map<String, Object>>> goodsSeriesListBy(@RequestBody Map<String, Object> param) {
+        return commonService.goodsSeriesListBy(param);
+    }
+
+    /**
+     * @desc :  计量单位查询
+     * @author : 王英杰
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"unit_list_by"})
+    public ResponseResultVO<PageList<Map<String, Object>>> unitListBy(@RequestBody Map<String, Object> param) {
+        return commonService.unitListBy(param);
+    }
+
+    /**
+     * @desc : 获取仓库
+     * @author : 王英杰
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(
+            value = "获取仓库档案",
+            notes = "获取仓库档案"
+    )
+    @PostMapping("get_warehouse_by_page")
+    public ResponseResultVO<PageList<Map<String, Object>>> getWarehouseByPage(@RequestBody Map<String, Object> param) {
+        return commonService.getWarehouseByPage(param);
+    }
 }
 
 

+ 57 - 12
src/main/java/com/dk/mdm/mapper/common/CommonMapper.java

@@ -828,19 +828,7 @@ public interface CommonMapper extends BaseMapper<Map<String, Object>> {
 
 
 
-    /**
-     * @desc   : 获取仓库
-     * @author : 洪旭东
-     * @date   : 2023-08-09 14:29
-     */
-    List<Map<String, Object>> getWarehouseByPage(Map param);
 
-    /**
-     * @desc   : 获取仓库个数
-     * @author : 洪旭东
-     * @date   : 2023-08-09 14:29
-     */
-    Long countWarehouseByPage(Map param);
 
     /**
      * @desc   : 获取仓位
@@ -995,4 +983,61 @@ public interface CommonMapper extends BaseMapper<Map<String, Object>> {
      * @date   : 2024/3/1 9:21
      */
     Long countGoodsBrand(Map<String, Object> param);
+
+    /**
+     * @desc   : 获取商品种类
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:21
+     */
+    List<Map<String, Object>> getGoodsCategory(Map param);
+
+    /**
+     * @desc   : 获取商品种类数量
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:21
+     */
+    Long countGoodsCategory(Map<String, Object> param);
+
+    /**
+     * @desc   : 获取商品系列
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:21
+     */
+    List<Map<String, Object>> getGoodsSeries(Map param);
+
+    /**
+     * @desc   : 获取商品系列数量
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:21
+     */
+    Long countGoodsSeries(Map<String, Object> param);
+
+    /**
+     * @desc   : 获取计量单位
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:21
+     */
+    List<Map<String, Object>> getUnit(Map<String, Object> param);
+
+    /**
+     * @desc   : 获取计量单位数量
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:21
+     */
+    Long countUnit(Map<String, Object> param);
+
+
+    /**
+     * @desc   : 获取仓库档案
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:21
+     */
+    List<Map<String, Object>> getWarehouseByPage(Map param);
+
+    /**
+     * @desc   : 获取获取仓库档案个数
+     * @author : 洪旭东
+     * @date   : 2024/3/1 9:21
+     */
+    Long countWarehouseByPage(Map param);
 }

+ 152 - 32
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -2577,36 +2577,6 @@
           and ptwp.flg_valid
     </select>
 
-    <!--获取仓库-->
-    <select id="getWarehouseByPage" resultType="java.util.Map">
-        SELECT mtw.wh_id as "whId",sys.f_code_name(mtw.wh_code,mtw.wh_name) AS "whCodeName"
-        FROM mst.t_warehouse mtw left join core.t_user ctu on ctu.user_id = mtw.op_create_user_id
-        WHERE mtw.fty_id = #{ftyId}
-        and mtw.flg_valid
-        <if test="whCode!=null and whCode!=''">
-            and position(#{whCode} in mtw.wh_code) > 0
-        </if>
-        <if test="whName!=null and whName!=''">
-            and position(#{warehouseName} in mtw.wh_name) > 0
-        </if>
-        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
-            limit #{end} offset #{start}
-        </if>
-    </select>
-
-    <!--获取仓库个数-->
-    <select id="countWarehouseByPage" resultType="Long">
-        select count(1)
-        from mst.t_warehouse mtw
-        WHERE mtw.fty_id = #{ftyId}
-        and mtw.flg_valid
-        <if test="whCode!=null and whCode!=''">
-            and position(#{whCode} in mtw.wh_code) > 0
-        </if>
-        <if test="whName!=null and whName!=''">
-            and position(#{warehouseName} in mtw.wh_name) > 0
-        </if>
-    </select>
 
     <!--获取仓位-->
     <select id="getWarehousePlaceByPage" resultType="java.util.Map">
@@ -2974,6 +2944,9 @@
             <if test="searchText !=null">
                 AND ( tmgb.brand_name LIKE concat('%', #{searchText}, '%')
             </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
         </where>
         order by display_no asc
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
@@ -2989,9 +2962,156 @@
         count(1)
         FROM dkic_b.t_mst_goods_brand tmgb
         <where>
-            <if test="brandName != null and brandName != ''">
-                AND tmgb.brand_name = #{brandName}
+            <if test="searchText !=null">
+                AND ( tmgb.brand_name LIKE concat('%', #{searchText}, '%')
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+        </where>
+    </select>
+    <select id="getGoodsCategory" resultType="java.util.Map">
+        SELECT
+        cat_code AS "catCode",
+        cat_name AS "catName",
+        flg_valid AS "flgValid"
+        FROM dkic_b.t_mst_goods_category
+        <where>
+            <if test="searchText !=null">
+                AND ( cat_name LIKE concat('%', #{searchText}, '%')
+                or ( remarks LIKE concat('%', #{searchText}, '%')
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+        </where>
+        ORDER BY display_no
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+
+    </select>
+    <select id="countGoodsCategory" resultType="java.lang.Long">
+        SELECT
+            count(1)
+        FROM dkic_b.t_mst_goods_category
+        <where>
+            <if test="searchText !=null">
+                AND ( cat_name LIKE concat('%', #{searchText}, '%')
+                or ( remarks LIKE concat('%', #{searchText}, '%')
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+        </where>
+    </select>
+    <select id="getGoodsSeries" resultType="java.util.Map">
+        SELECT
+        series_code AS "catCode",
+        series_name AS "catName",
+        flg_valid AS "flgValid"
+        FROM dkic_b.t_mst_goods_series
+        <where>
+            <if test="searchText !=null">
+                AND ( series_name LIKE concat('%', #{searchText}, '%')
+                or ( remarks LIKE concat('%', #{searchText}, '%')
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
             </if>
         </where>
+        order by display_no asc
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
     </select>
+    <select id="countGoodsSeries" resultType="java.lang.Long">
+        SELECT
+            count(1)
+        FROM dkic_b.t_mst_goods_series
+        <where>
+            <if test="searchText !=null">
+                AND ( series_name LIKE concat('%', #{searchText}, '%')
+                or ( remarks LIKE concat('%', #{searchText}, '%')
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+        </where>
+    </select>
+    <select id="getUnit" resultType="java.util.Map">
+        SELECT
+        unit_code AS "unitCode",
+        unit_name AS "unitName",
+        flg_valid AS "flgValid"
+        FROM  dkic_b.t_mst_unit
+        <where>
+            <if test="searchText !=null">
+                AND ( unit_name LIKE concat('%', #{searchText}, '%')
+                or ( remarks LIKE concat('%', #{searchText}, '%')
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+        </where>
+        order by display_no asc
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+    <select id="countUnit" resultType="java.lang.Long">
+        SELECT
+            count(1)
+        FROM  dkic_b.t_mst_unit
+        <where>
+            <if test="searchText !=null">
+                AND ( unit_name LIKE concat('%', #{searchText}, '%')
+                or ( remarks LIKE concat('%', #{searchText}, '%')
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+        </where>
+    </select>
+
+    <!--获取仓库档案-->
+    <select id="getWarehouseByPage" resultType="java.util.Map">
+        SELECT
+        wh_code AS "whCode",
+        wh_name AS "whName",
+        supervisor AS "supervisor",
+        contact_phone AS "contactPhone",
+        flg_valid AS "flgValid"
+        FROM  dkic_b.t_mst_warehouse
+        <where>
+            <if test="searchText !=null">
+                AND ( wh_name LIKE concat('%', #{searchText}, '%')
+                or ( remarks LIKE concat('%', #{searchText}, '%')
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+        </where>
+        order by display_no asc
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!--获取仓库档案个数-->
+    <select id="countWarehouseByPage" resultType="Long">
+        SELECT
+        count(1)
+        FROM  dkic_b.t_mst_warehouse
+        <where>
+            <if test="searchText !=null">
+                AND ( wh_name LIKE concat('%', #{searchText}, '%')
+                or ( remarks LIKE concat('%', #{searchText}, '%')
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+        </where>
+    </select>
+
 </mapper>

+ 78 - 10
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -1216,16 +1216,7 @@ public class CommonService extends BaseService<Map<String, Object>> {
     }
 
 
-    /**
-     * @desc : 获取仓库
-     * @author : 洪旭东
-     * @date : 2023-08-09 14:31
-     */
-    public ResponseResultVO<PageList<Map<String, Object>>> getWarehouseByPage(Map<String, Object> param) {
-        this.getLimit(param);
-        return super.mergeListWithCount(param, commonMapper.getWarehouseByPage(param),
-                commonMapper.countWarehouseByPage(param));
-    }
+
 
     /**
      * @desc : 获取仓位
@@ -1421,5 +1412,82 @@ public class CommonService extends BaseService<Map<String, Object>> {
         return ResponseResultUtil.success(data);
     }
 
+    /**
+     * @desc   : 获取商品种类(分页)
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:20
+     */
+    public ResponseResultVO<PageList<Map<String, Object>>> goodsCategoryListBy(Map<String, Object> param) {
+        // 校验分页参数
+        if (param.get("pageSize") == null || param.get("currentPage") == null) {
+            return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
+        }
+        // 分页参数赋值
+        param = this.getLimit(param);
+        // 定义返回值
+        PageList data = new PageList<>();
+        // 获取公司
+        List<Map<String, Object>> list = commonMapper.getGoodsCategory(param);
+        // 获取总数量
+        Long total = commonMapper.countGoodsCategory(param);
+        // 组装返回值
+        data.setPageSize((int) param.get("pageSize")).setCurrentPage((int) param.get("currentPage")).setList(list).setTotal(total);
+        return ResponseResultUtil.success(data);
+    }
 
+    /**
+     * @desc   : 获取商品系列(分页)
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:20
+     */
+    public ResponseResultVO<PageList<Map<String, Object>>> goodsSeriesListBy(Map<String, Object> param) {
+        // 校验分页参数
+        if (param.get("pageSize") == null || param.get("currentPage") == null) {
+            return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
+        }
+        // 分页参数赋值
+        param = this.getLimit(param);
+        // 定义返回值
+        PageList data = new PageList<>();
+        // 获取公司
+        List<Map<String, Object>> list = commonMapper.getGoodsSeries(param);
+        // 获取总数量
+        Long total = commonMapper.countGoodsSeries(param);
+        // 组装返回值
+        data.setPageSize((int) param.get("pageSize")).setCurrentPage((int) param.get("currentPage")).setList(list).setTotal(total);
+        return ResponseResultUtil.success(data);
+    }
+
+    /**
+     * @desc   : 计量单位查询(分页)
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:20
+     */
+    public ResponseResultVO<PageList<Map<String, Object>>> unitListBy(Map<String, Object> param) {
+        // 校验分页参数
+        if (param.get("pageSize") == null || param.get("currentPage") == null) {
+            return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
+        }
+        // 分页参数赋值
+        param = this.getLimit(param);
+        // 定义返回值
+        PageList data = new PageList<>();
+        // 获取公司
+        List<Map<String, Object>> list = commonMapper.getUnit(param);
+        // 获取总数量
+        Long total = commonMapper.countUnit(param);
+        // 组装返回值
+        data.setPageSize((int) param.get("pageSize")).setCurrentPage((int) param.get("currentPage")).setList(list).setTotal(total);
+        return ResponseResultUtil.success(data);
+    }
+    /**
+     * @desc : 获取仓库档案
+     * @author : 王英杰
+     * @date :2024/3/1 9:20
+     */
+    public ResponseResultVO<PageList<Map<String, Object>>> getWarehouseByPage(Map<String, Object> param) {
+        this.getLimit(param);
+        return super.mergeListWithCount(param, commonMapper.getWarehouseByPage(param),
+                commonMapper.countWarehouseByPage(param));
+    }
 }