Просмотр исходного кода

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

于继渤 2 лет назад
Родитель
Сommit
c4e42869a6

+ 60 - 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);
-    }
+
 
 
     /**
@@ -1400,9 +1388,9 @@ public class CommonController extends BaseController<Map<String, Object>> {
     }
 
     /**
-     * @desc : 获取供应商
+     * @desc   : 获取供应商
      * @author : 常皓宁
-     * @date : 2024/3/1 9:19
+     * @date   : 2024/3/1 9:19
      */
     @ApiOperation(
             value = "获取供应商",
@@ -1437,6 +1425,63 @@ public class CommonController extends BaseController<Map<String, Object>> {
     public ResponseResultVO<List<Map<String, Object>>> getChannel(@RequestBody Map<String, Object> param) {
         return commonService.getChannel(param);
     }
+    /**
+     * @desc :  商品品牌查询
+     * @author : 王英杰
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"goods_brand_list_by"})
+    public ResponseResultVO<PageList<Map<String, Object>>> goodsBrandListBy(@RequestBody Map<String, Object> param) {
+        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);
+    }
 }
 
 

+ 72 - 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   : 获取仓位
@@ -980,4 +968,76 @@ public interface CommonMapper extends BaseMapper<Map<String, Object>> {
      * @date   : 2024-03-02 10:18
      */
     List<Map<String, Object>> getChannel(Map param);
+
+
+    /**
+     * @desc   : 获取商品品牌
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:21
+     */
+    List<Map<String, Object>> getGoodsBrand(Map param);
+
+    /**
+     * @desc   : 获取商品品牌数量
+     * @author : 王英杰
+     * @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);
 }

+ 184 - 34
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -630,7 +630,7 @@
         select sku_id   as "skuId",
                sku_code as "skuCode",
                sku_name as "skuName",
-               remarks  as "remarks"
+               remarks     as "remarks"
         from mst.t_erp_sku
         where flg_valid
           and fty_id = #{ftyId}
@@ -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">
@@ -2805,7 +2775,6 @@
                  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 tmgs.flg_valid
-          and tmgs.cp_id = #{cpId}
         <if test="skuCode != null">
             AND tmgs.sku_code = #{skuCode}
         </if>
@@ -2820,7 +2789,6 @@
         count(1)
         from dkic_b.t_mst_goods_sku as tmgs
         where tmgs.flg_valid
-          and tmgs.cp_id = #{cpId}
         <if test="skuCode != null">
             AND tmgs.sku_code = #{skuCode}
         </if>
@@ -2867,7 +2835,6 @@
                  inner join dkic_b.t_mst_sale_channel tmsc on tmc.channel_id = tmsc.channel_id
                  left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
         where tmc.flg_valid
-          and tmc.cp_id = #{cpId}
         <if test="skuCode != null">
             AND tmc.cus_code = #{cusCode}
         </if>
@@ -2964,4 +2931,187 @@
             limit #{limit}
         </if>
     </select>
+    <select id="getGoodsBrand" resultType="java.util.Map">
+        SELECT
+        tmgb.flg_valid AS "flgValid",
+        tmgb.brand_id AS "brandId", tmgb.brand_code AS "brandCode", tmgb.brand_name  AS "brandName",
+        (SELECT  COALESCE(array_to_string(array_agg(tsm.sup_name), ','),'')
+        FROM dkic_b.t_mst_supplier_brand tsmb
+        left join dkic_b.t_mst_supplier tsm on tsm.sup_id = tsmb.sup_id
+        WHERE tsmb.brand_id  =  tmgb.brand_id) AS "supplierName"
+        FROM dkic_b.t_mst_goods_brand tmgb
+        <where>
+            <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">
+            limit #{end} offset #{start}
+        </if>
+
+
+    </select>
+
+    <!-- 查询表t_mst_goods_brand,(条件查询)个数 -->
+    <select id="countGoodsBrand" resultType="Long">
+        SELECT
+        count(1)
+        FROM dkic_b.t_mst_goods_brand tmgb
+        <where>
+            <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>

+ 0 - 1
src/main/java/com/dk/mdm/model/response/mst/MoneyAccountResponse.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.dk.common.infrastructure.annotaiton.ExportTitle;
-import com.dk.common.infrastructure.handler.StringListTypeHandler;
 import com.dk.common.infrastructure.handler.TimestampTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.model.pojo.PageInfo;

+ 103 - 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 : 获取仓位
@@ -1397,4 +1388,106 @@ public class CommonService extends BaseService<Map<String, Object>> {
         List<Map<String, Object>> list = commonMapper.getChannel(param);
         return ResponseResultUtil.success(list);
     }
+
+    /**
+     * @desc   : 获取商品品牌(分页)
+     * @author : 王英杰
+     * @date   : 2024/3/1 9:20
+     */
+    public ResponseResultVO<PageList<Map<String, Object>>> goodsBrandListBy(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.getGoodsBrand(param);
+        // 获取总数量
+        Long total = commonMapper.countGoodsBrand(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>>> 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));
+    }
 }

+ 87 - 88
src/main/java/com/dk/mdm/service/mst/GoodsBrandService.java

@@ -33,94 +33,93 @@ import java.util.Map;
 @Transactional
 public class GoodsBrandService extends BaseService<GoodsBrand> {
 
-	@Override
-	public BaseMapper<GoodsBrand> getRepository() {
-		return goodsBrandMapper;
-	}
-
-	@Autowired
-	private GoodsBrandMapper goodsBrandMapper;
-
-
-
-	@Autowired
-	private GoodsBrandConvert goodsBrandConvert;
-
-	@Autowired
-	private CommonService commonService;
-
-	/**
-	 * @desc : 重写主键
-	 * @author : 于继渤
-	 * @date : 2024/2/29 20:29
-	 */
-	@Override
-	public String getPrimaryKey() {
-		return "brand_id";
-	}
-	/**
-	 * @desc : 查询
-	 * @author : 于继渤
-	 * @date : 2023/1/5 9:39
-	 */
-	@Pagination
-	public ResponseResultVO<PageList<GoodsBrandResponse>> selectByCond(GoodsBrandQuery goodsBrandQuery) {
-		return super.mergeListWithCount(goodsBrandQuery, goodsBrandMapper.selectByCond(goodsBrandQuery),
-				goodsBrandMapper.countByCond(goodsBrandQuery));
-	}
-
-
-
-	/**
-	 * @desc : 新建
-	 * @author : 于继渤
-	 * @date : 2023/1/5 9:39
-	 */
-	@Transactional(
-			rollbackFor = {Exception.class}
-	)
-	public ResponseResultVO<?> insert(GoodsBrandVO goodsBrandVO) {
-		//实体转换
-		GoodsBrand goodsBrand = goodsBrandConvert.convertToPo(goodsBrandVO);
-		goodsBrand.setShortName(goodsBrand.getBrandName());
-		Integer displayNo = goodsBrandMapper.selectDisplayNo(new GoodsBrandQuery());
-		if (displayNo != null) {
-			//插入序号
-			goodsBrand.setDisplayNo(displayNo);
-		} else {
-			goodsBrand.setDisplayNo(0);
-		}
-		//设置编码
-		Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.BRAND.getName(), true);
-		goodsBrand.setBrandId(uniqueNoteCode.get("outId").toString());
-		goodsBrand.setBrandCode(uniqueNoteCode.get("outNote").toString());
-		//新建
-		goodsBrandMapper.insert(goodsBrand);
-
-		//保存供应商
-		List<String> supplierIds = goodsBrandVO.getSupplierIds();
-		for (String supplierId : supplierIds) {
-			goodsBrandMapper.saveSupplierBrand(supplierId,goodsBrand.getBrandId());
-		}
-		return ResponseResultUtil.success();
-	}
-
-
-
-	/**
-	 * @desc : 编辑
-	 * @author : 于继渤
-	 * @date : 2023/1/5 9:39
-	 */
-	@Transactional(
-			rollbackFor = {Exception.class}
-	)
-	public ResponseResultVO<?> updateGoodsBrand(GoodsBrandVO goodsBrandVO) {
-		GoodsBrand goodsBrand = goodsBrandConvert.convertToPo(goodsBrandVO);
-		super.updateByUuid(goodsBrand);
-		return ResponseResultUtil.success();
-	}
-
+    @Override
+    public BaseMapper<GoodsBrand> getRepository() {
+        return goodsBrandMapper;
+    }
+
+    @Autowired
+    private GoodsBrandMapper goodsBrandMapper;
+
+
+    @Autowired
+    private GoodsBrandConvert goodsBrandConvert;
+
+    @Autowired
+    private CommonService commonService;
+
+    /**
+     * @desc : 重写主键
+     * @author : 于继渤
+     * @date : 2024/2/29 20:29
+     */
+    @Override
+    public String getPrimaryKey() {
+        return "brand_id";
+    }
+
+    /**
+     * @desc : 查询
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @Pagination
+    public ResponseResultVO<PageList<GoodsBrandResponse>> selectByCond(GoodsBrandQuery goodsBrandQuery) {
+        return super.mergeListWithCount(goodsBrandQuery, goodsBrandMapper.selectByCond(goodsBrandQuery),
+                goodsBrandMapper.countByCond(goodsBrandQuery));
+    }
+
+
+    /**
+     * @desc : 新建
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @Transactional(
+            rollbackFor = {Exception.class}
+    )
+    public ResponseResultVO<?> insert(GoodsBrandVO goodsBrandVO) {
+        //实体转换
+        GoodsBrand goodsBrand = goodsBrandConvert.convertToPo(goodsBrandVO);
+        goodsBrand.setShortName(goodsBrand.getBrandName());
+        Integer displayNo = goodsBrandMapper.selectDisplayNo(new GoodsBrandQuery());
+        if (displayNo != null) {
+            //插入序号
+            goodsBrand.setDisplayNo(displayNo);
+        } else {
+            goodsBrand.setDisplayNo(0);
+        }
+        //设置编码
+        Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.BRAND.getName(), true);
+        goodsBrand.setBrandId(uniqueNoteCode.get("outId").toString());
+        goodsBrand.setBrandCode(uniqueNoteCode.get("outNote").toString());
+        //新建
+        goodsBrandMapper.insert(goodsBrand);
+
+        //保存供应商
+        List<String> supplierIds = goodsBrandVO.getSupplierIds();
+        if (supplierIds != null) {
+            for (String supplierId : supplierIds) {
+                goodsBrandMapper.saveSupplierBrand(supplierId, goodsBrand.getBrandId());
+            }
+        }
+        return ResponseResultUtil.success();
+    }
+
+
+    /**
+     * @desc : 编辑
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @Transactional(
+            rollbackFor = {Exception.class}
+    )
+    public ResponseResultVO<?> updateGoodsBrand(GoodsBrandVO goodsBrandVO) {
+        GoodsBrand goodsBrand = goodsBrandConvert.convertToPo(goodsBrandVO);
+        super.updateByUuid(goodsBrand);
+        return ResponseResultUtil.success();
+    }
 
 
 }