Browse Source

代码以及注释

于继渤 2 năm trước cách đây
mục cha
commit
d5b0279974

+ 47 - 4
src/main/java/com/dk/mdm/controller/mst/GoodsCategoryController.java

@@ -1,14 +1,19 @@
 package com.dk.mdm.controller.mst;
 
+import com.dk.common.model.pojo.PageList;
 import com.dk.common.response.ResponseResultVO;
 import com.dk.mdm.model.pojo.mst.GoodsCategory;
 import com.dk.common.controller.BaseController;
 import com.dk.common.service.BaseService;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.dk.mdm.model.query.mst.GoodsCategoryQuery;
+import com.dk.mdm.model.query.mst.GoodsSeriesQuery;
+import com.dk.mdm.model.response.mst.GoodsBrandResponse;
+import com.dk.mdm.model.response.mst.GoodsCategoryResponse;
+import com.dk.mdm.model.vo.mst.GoodsBrandVO;
+import com.dk.mdm.model.vo.mst.GoodsCategoryVO;
+import io.swagger.annotations.ApiOperation;
+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.mst.GoodsCategoryService;
 
@@ -26,6 +31,44 @@ public class GoodsCategoryController{
 
 
     /**
+     * @desc : 条件查询
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<GoodsCategoryResponse>> selectByCond(@RequestBody GoodsCategoryQuery goodsCategoryQuery) {
+        return goodsCategoryService.selectByCond(goodsCategoryQuery);
+    }
+
+
+    /**
+     * @desc : 新建
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @ApiOperation(value = "新建", notes = "新建")
+    @PostMapping({"insert"})
+    public ResponseResultVO<?> insert(@RequestBody GoodsCategoryVO goodsCategoryVO) {
+        return goodsCategoryService.insert(goodsCategoryVO);
+    }
+
+
+
+
+    /**
+     * @desc : 编辑
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @ApiOperation( value = "编辑", notes = "编辑" )
+    @PostMapping({"update"})
+    public ResponseResultVO<?> update(@RequestBody GoodsCategoryVO goodsCategoryVO) {
+        return goodsCategoryService.update(goodsCategoryVO);
+    }
+
+
+    /**
      * @desc : 停用
      * @author : 于继渤
      * @date :  2023/1/4 9:39

+ 42 - 5
src/main/java/com/dk/mdm/controller/mst/GoodsSeriesController.java

@@ -1,14 +1,16 @@
 package com.dk.mdm.controller.mst;
 
+import com.dk.common.model.pojo.PageList;
 import com.dk.common.response.ResponseResultVO;
 import com.dk.mdm.model.pojo.mst.GoodsSeries;
-import com.dk.common.controller.BaseController;
 import com.dk.common.service.BaseService;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.dk.mdm.model.query.mst.GoodsSeriesQuery;
+import com.dk.mdm.model.response.mst.GoodsBrandResponse;
+import com.dk.mdm.model.response.mst.GoodsSeriesResponse;
+import com.dk.mdm.model.vo.mst.GoodsSeriesVO;
+import io.swagger.annotations.ApiOperation;
+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.mst.GoodsSeriesService;
 
@@ -25,8 +27,43 @@ public class GoodsSeriesController{
     private GoodsSeriesService goodsSeriesService;
 
 
+    /**
+     * @desc : 条件查询
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<GoodsSeriesResponse>> selectByCond(@RequestBody GoodsSeriesQuery goodsSeriesQuery) {
+        return goodsSeriesService.selectByCond(goodsSeriesQuery);
+    }
+
 
     /**
+     * @desc : 新建
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @ApiOperation(value = "新建", notes = "新建")
+    @PostMapping({"insert"})
+    public ResponseResultVO<?> insert(@RequestBody GoodsSeriesVO goodsSeriesVO) {
+        return goodsSeriesService.insert(goodsSeriesVO);
+    }
+
+
+
+
+    /**
+     * @desc : 编辑
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @ApiOperation( value = "编辑", notes = "编辑" )
+    @PostMapping({"update"})
+    public ResponseResultVO<?> update(@RequestBody GoodsSeriesVO goodsSeriesVO) {
+        return goodsSeriesService.update(goodsSeriesVO);
+    }
+    /**
      * @desc : 停用
      * @author : 于继渤
      * @date :  2023/1/4 9:39

+ 0 - 9
src/main/java/com/dk/mdm/controller/mst/RoleController.java

@@ -73,15 +73,6 @@ public class RoleController{
 
 
 
-    /**
-     * @desc : 启用停用
-     * @author : 于继渤
-     * @date : 2023/1/5 9:39
-     */
-    @PostMapping({"/deactivate_enable"})
-    public ResponseResultVO<?> deactivateEnable(@RequestBody RoleVo roleVO) {
-        return roleService.deactivateEnable(roleVO);
-    }
 
     /**
      * @desc : 停用

+ 42 - 5
src/main/java/com/dk/mdm/controller/mst/UnitController.java

@@ -1,14 +1,16 @@
 package com.dk.mdm.controller.mst;
 
+import com.dk.common.model.pojo.PageList;
 import com.dk.common.response.ResponseResultVO;
 import com.dk.mdm.model.pojo.mst.Unit;
-import com.dk.common.controller.BaseController;
 import com.dk.common.service.BaseService;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.dk.mdm.model.query.mst.UnitQuery;
+import com.dk.mdm.model.response.mst.GoodsBrandResponse;
+import com.dk.mdm.model.response.mst.UnitResponse;
+import com.dk.mdm.model.vo.mst.UnitVO;
+import io.swagger.annotations.ApiOperation;
+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.mst.UnitService;
 
@@ -24,8 +26,43 @@ public class UnitController{
     @Autowired
     private UnitService unitService;
 
+    /**
+     * @desc : 条件查询
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<UnitResponse>> selectByCond(@RequestBody UnitQuery UnitQuery) {
+        return unitService.selectByCond(UnitQuery);
+    }
+
 
     /**
+     * @desc : 新建
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @ApiOperation(value = "新建", notes = "新建")
+    @PostMapping({"insert"})
+    public ResponseResultVO<?> insert(@RequestBody UnitVO unitVO) {
+        return unitService.insert(unitVO);
+    }
+
+
+
+
+    /**
+     * @desc : 编辑
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @ApiOperation( value = "编辑", notes = "编辑" )
+    @PostMapping({"update"})
+    public ResponseResultVO<?> update(@RequestBody UnitVO unitVO) {
+        return unitService.update(unitVO);
+    }
+    /**
      * @desc : 停用
      * @author : 于继渤
      * @date :  2023/1/4 9:39

+ 10 - 1
src/main/java/com/dk/mdm/mapper/mst/GoodsBrandMapper.java

@@ -28,8 +28,17 @@ public interface GoodsBrandMapper extends BaseMapper<GoodsBrand>{
      * @date : 2024/2/26 10:36
      */
     Long countByCond(GoodsBrandQuery goodsBrandQuery);
+    /**
+     * @desc   : 查询排序
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
     Integer selectDisplayNo(GoodsBrandQuery goodsBrandQuery);
-
+    /**
+     * @desc   : 生成编码
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
     String setBrandCode(GoodsBrand goodsBrand);
 }
 

+ 35 - 2
src/main/java/com/dk/mdm/mapper/mst/GoodsBrandMapper.xml

@@ -139,19 +139,21 @@
         insert into dkic_b.t_mst_goods_brand
         (
         <trim suffixOverrides=",">
+            barand_id,
             brand_code,
             brand_name,
             short_name,
             display_no,
             remarks,
-            cp_id,=
+            cp_id,
         </trim>
         )
         values
         <foreach collection="list" index="index" item="item" separator=",">
             (
             <trim suffixOverrides=",">
-                #{item.brandCode},
+                (SELECT sys.f_uuid_seq()),
+                dkic_b.f_create_code(1, (SELECT sys.f_uuid_seq()), '品牌'),
                 #{item.brandName},
                 #{item.shortName},
                 #{item.displayNo},
@@ -162,6 +164,37 @@
         </foreach>
     </insert>
 
+<!--    <insert id="insert">-->
+<!--        &lt;!&ndash; 使用 selectKey 来生成 brand_id &ndash;&gt;-->
+<!--        <selectKey keyProperty="brandId" resultType="java.lang.String" order="BEFORE">-->
+<!--            SELECT sys.f_uuid_seq() AS brandId-->
+<!--        </selectKey>-->
+<!--        &lt;!&ndash; 构建插入语句 &ndash;&gt;-->
+<!--        insert into dkic_b.t_mst_goods_brand-->
+<!--        (-->
+<!--        brand_id,-->
+<!--        brand_code,-->
+<!--        brand_name,-->
+<!--        short_name,-->
+<!--        display_no,-->
+<!--        remarks,-->
+<!--        cp_id-->
+<!--        )-->
+<!--        values-->
+<!--        (-->
+<!--        #{brandId}::uuid,-->
+<!--        dkic_b.f_create_code(1, #{brandId}::uuid, '品牌'),-->
+<!--        #{brandName},-->
+<!--        #{shortName},-->
+<!--        #{displayNo},-->
+<!--        #{remarks},-->
+<!--        #{cpId}-->
+<!--        )-->
+<!--    </insert>-->
+
+
+
+
 
     <select id="selectDisplayNo" resultType="Integer">
         SELECT MAX(display_no) + 1  FROM dkic_b.t_mst_goods_brand

+ 38 - 1
src/main/java/com/dk/mdm/mapper/mst/GoodsCategoryMapper.java

@@ -1,14 +1,51 @@
 package com.dk.mdm.mapper.mst;
 
+import com.dk.mdm.model.pojo.mst.GoodsBrand;
 import com.dk.mdm.model.pojo.mst.GoodsCategory;
 import com.dk.common.mapper.BaseMapper;
+import com.dk.mdm.model.query.mst.GoodsBrandQuery;
+import com.dk.mdm.model.query.mst.GoodsCategoryQuery;
+import com.dk.mdm.model.query.mst.GoodsSeriesQuery;
+import com.dk.mdm.model.response.mst.GoodsBrandResponse;
+import com.dk.mdm.model.response.mst.GoodsCategoryResponse;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 /**
 *  商品种类 Mapper
 */
 @Repository
 public interface GoodsCategoryMapper extends BaseMapper<GoodsCategory>{
-	
+    /**
+     * @desc   : 根据条件进行查询
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    List<GoodsCategoryResponse> selectByCond(GoodsCategoryQuery goodsCategoryQuery);
+
+    /**
+     * @desc   : 根据条件进行查询(数量)
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    Long countByCond(GoodsCategoryQuery goodsCategoryQuery);
+
+
+    /**
+     * @desc   : 查询排序
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    Integer selectDisplayNo(GoodsCategoryQuery goodsCategoryQuery);
+
+    /**
+     * @desc   : 生成编码
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    String setCategoryCode(GoodsCategory goodsCategory);
+
+    Boolean resetLevelGoodsCategory(GoodsCategoryQuery goodsCategoryQuery);
 }
 

+ 123 - 10
src/main/java/com/dk/mdm/mapper/mst/GoodsCategoryMapper.xml

@@ -16,8 +16,8 @@
                 <result column="parent_id" property="parentId" typeHandler="UuidTypeHandler"/>
                 <result column="display_no" property="displayNo"/>
                 <result column="top_id" property="topId" typeHandler="UuidTypeHandler"/>
-                <result column="level_upper" property="levelUpper" typeHandler="UuidListTypeHandler"/>
-                <result column="level_lower" property="levelLower" typeHandler="UuidListTypeHandler"/>
+                <result column="level_upper" property="levelUpper" typeHandler="UuidTypeHandler"/>
+                <result column="level_lower" property="levelLower" typeHandler="UuidTypeHandler"/>
                 <result column="level_leaf" property="levelLeaf"/>
                 <result column="level_no" property="levelNo"/>
                 <result column="level_code" property="levelCode"/>
@@ -34,6 +34,26 @@
                 <result column="op_db_user" property="opDbUser"/>
     </resultMap>
 
+
+
+    <resultMap id="BaseResultMapResponse" type="com.dk.mdm.model.response.mst.GoodsCategoryResponse">
+        <id column="cat_id" property="catId"/>
+        <result column="cat_code" property="catCode"/>
+        <result column="cat_name" property="catName"/>
+        <result column="parent_id" property="parentId" typeHandler="UuidTypeHandler"/>
+        <result column="display_no" property="displayNo"/>
+        <result column="top_id" property="topId" typeHandler="UuidTypeHandler"/>
+        <result column="level_upper" property="levelUpper" typeHandler="UuidTypeHandler"/>
+        <result column="level_lower" property="levelLower" typeHandler="UuidTypeHandler"/>
+        <result column="level_leaf" property="levelLeaf"/>
+        <result column="level_no" property="levelNo"/>
+        <result column="level_code" property="levelCode"/>
+        <result column="level_name" property="levelName"/>
+        <result column="remarks" property="remarks"/>
+        <result column="flg_valid" property="flgValid"/>
+        <result column="cp_id" property="cpId"/>
+    </resultMap>
+
     <!-- 通用条件列 -->
     <sql id="Condition">
         <where>
@@ -112,10 +132,10 @@
     </sql>
 
     <!-- 查询表t_mst_goods_category,(条件查询+分页)列表 -->
-    <select id="selectByCond" resultMap="BaseResultMap">
+    <select id="selectByCond" resultMap="BaseResultMapResponse">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_goods_category
+        FROM dkic_b.t_mst_goods_category
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -126,7 +146,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM t_mst_goods_category
+        FROM dkic_b.t_mst_goods_category
         <include refid="Condition"/>
     </select>
 
@@ -134,7 +154,7 @@
     <select id="selectById" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_goods_category
+        FROM dkic_b.t_mst_goods_category
         WHERE cat_id = #{catId}::uuid
     </select>
 
@@ -142,8 +162,8 @@
     <select id="selectByIdForUpdate" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_goods_category
-        WHERE cat_id = #{catId}
+        FROM dkic_b.t_mst_goods_category
+        WHERE cat_id = #{catId} ::uuid
         for update
     </select>
 
@@ -151,13 +171,13 @@
     <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_goods_category
+        FROM dkic_b.t_mst_goods_category
         <include refid="idsForeach"/>
         for update
     </select>
 
     <insert id="insertBatch">
-        insert into t_mst_goods_category
+        insert into dkic_b.t_mst_goods_category
         (
         <trim suffixOverrides=",">
             cat_code,
@@ -198,4 +218,97 @@
             )
         </foreach>
     </insert>
+
+
+    <select id="selectDisplayNo" resultType="Integer">
+        SELECT MAX(display_no) + 1  FROM dkic_b.t_mst_goods_category
+        <include refid="Condition"/>
+    </select>
+
+
+    <select id="setCategoryCode"  resultType="String">
+        select dkic_b.f_create_code(1,#{catId}::uuid,'种类');
+    </select>
+
+
+<!--    <update id="updateById"  parameterType="com.dk.mdm.model.pojo.mst.GoodsCategory">-->
+<!--        update-->
+<!--        dkic_b.t_mst_goods_category-->
+<!--        <set>-->
+<!--            <if test="et.catCode != null">-->
+<!--                cat_code = #{et.catCode},-->
+<!--            </if>-->
+<!--            <if test="et.catName != null">-->
+<!--                cat_name = #{et.catName},-->
+<!--            </if>-->
+<!--            <if test="et.parentId != null">-->
+<!--                parent_id = #{et.parentId}::uuid,-->
+<!--            </if>-->
+<!--            <if test="et.displayNo != null">-->
+<!--                display_no = #{et.displayNo},-->
+<!--            </if>-->
+<!--            <if test="et.topId != null">-->
+<!--                top_id = #{et.topId}::uuid,-->
+<!--            </if>-->
+<!--            <if test="et.remarks != null">-->
+<!--                remarks = #{et.remarks},-->
+<!--            </if>-->
+<!--            <if test="et.cpId != null">-->
+<!--                cp_id = #{et.cpId},-->
+<!--            </if>-->
+<!--            <if test="et.flgValid != null">-->
+<!--                flg_valid = #{et.flgValid},-->
+<!--            </if>-->
+
+<!--        </set>-->
+<!--        where cat_id = #{et.catId}::uuid-->
+<!--    </update>-->
+
+
+
+    <insert id="insert">
+        insert into dkic_b.t_mst_goods_category
+        (
+        <trim suffixOverrides=",">
+            cat_code,
+            cat_name,
+            parent_id,
+            display_no,
+            top_id,
+            level_upper,
+            level_lower,
+            level_leaf,
+            level_no,
+            level_code,
+            level_name,
+            remarks,
+            cp_id,
+            op_app_code,
+        </trim>
+        )
+        values
+
+            (
+            <trim suffixOverrides=",">
+                #{catCode},
+                #{catName},
+                #{parentId}::uuid,
+                #{displayNo},
+                #{topId}::uuid,
+                #{levelUpper},
+                #{levelLower},
+                #{levelLeaf},
+                #{levelNo},
+                #{levelCode},
+                #{levelName},
+                #{remarks},
+                #{cpId},
+                #{opAppCode},
+            </trim>
+            )
+
+    </insert>
+    <select id="resetLevelGoodsCategory" resultType="java.lang.Boolean">
+       select dkic_b.f_reset_level_goods_category(#{cpId},#{topId}::uuid)
+    </select>
 </mapper>

+ 32 - 1
src/main/java/com/dk/mdm/mapper/mst/GoodsSeriesMapper.java

@@ -1,14 +1,45 @@
 package com.dk.mdm.mapper.mst;
 
+import com.dk.mdm.model.pojo.mst.GoodsBrand;
 import com.dk.mdm.model.pojo.mst.GoodsSeries;
 import com.dk.common.mapper.BaseMapper;
+import com.dk.mdm.model.query.mst.GoodsBrandQuery;
+import com.dk.mdm.model.query.mst.GoodsSeriesQuery;
+import com.dk.mdm.model.response.mst.GoodsBrandResponse;
+import com.dk.mdm.model.response.mst.GoodsSeriesResponse;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 /**
 *  商品系列 Mapper
 */
 @Repository
 public interface GoodsSeriesMapper extends BaseMapper<GoodsSeries>{
-	
+    /**
+     * @desc   : 根据条件进行查询
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    List<GoodsSeriesResponse> selectByCond(GoodsSeriesQuery goodsSeriesQuery);
+
+    /**
+     * @desc   : 根据条件进行查询(数量)
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    Long countByCond(GoodsSeriesQuery goodsSeriesQuery);
+    /**
+     * @desc   : 查询排序
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    Integer selectDisplayNo(GoodsSeriesQuery goodsSeriesQuery);
+    /**
+     * @desc   : 生成编码
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    String setSeriesCode(GoodsSeries goodsSeries);
 }
 

+ 62 - 20
src/main/java/com/dk/mdm/mapper/mst/GoodsSeriesMapper.xml

@@ -5,25 +5,26 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        series_id, series_code, series_name, display_no, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+        series_id
+        , series_code, series_name, display_no, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
     </sql>
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mst.GoodsSeries">
         <id column="series_id" property="seriesId"/>
-                <result column="series_code" property="seriesCode"/>
-                <result column="series_name" property="seriesName"/>
-                <result column="display_no" property="displayNo"/>
-                <result column="remarks" property="remarks"/>
-                <result column="flg_valid" property="flgValid"/>
-                <result column="cp_id" property="cpId"/>
-            <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
-                <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
-            <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
-                <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
-                <result column="op_app_code" property="opAppCode"/>
-            <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
-                <result column="op_db_user" property="opDbUser"/>
+        <result column="series_code" property="seriesCode"/>
+        <result column="series_name" property="seriesName"/>
+        <result column="display_no" property="displayNo"/>
+        <result column="remarks" property="remarks"/>
+        <result column="flg_valid" property="flgValid"/>
+        <result column="cp_id" property="cpId"/>
+        <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
+        <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
+        <result column="op_app_code" property="opAppCode"/>
+        <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
+        <result column="op_db_user" property="opDbUser"/>
     </resultMap>
 
     <!-- 通用条件列 -->
@@ -83,8 +84,9 @@
     <select id="selectByCond" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_goods_series
+        FROM dkic_b.t_mst_goods_series
         <include refid="Condition"/>
+        order by display_no asc
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
@@ -94,7 +96,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM t_mst_goods_series
+        FROM dkic_b.t_mst_goods_series
         <include refid="Condition"/>
     </select>
 
@@ -102,7 +104,7 @@
     <select id="selectById" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_goods_series
+        FROM dkic_b.t_mst_goods_series
         WHERE series_id = #{seriesId}::uuid
     </select>
 
@@ -110,7 +112,7 @@
     <select id="selectByIdForUpdate" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_goods_series
+        FROM dkic_b.t_mst_goods_series
         WHERE series_id = #{seriesId}
         for update
     </select>
@@ -119,13 +121,13 @@
     <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_goods_series
+        FROM dkic_b.t_mst_goods_series
         <include refid="idsForeach"/>
         for update
     </select>
 
     <insert id="insertBatch">
-        insert into t_mst_goods_series
+        insert into dkic_b.t_mst_goods_series
         (
         <trim suffixOverrides=",">
             series_code,
@@ -150,4 +152,44 @@
             )
         </foreach>
     </insert>
+
+
+    <select id="setSeriesCode" resultType="String">
+        select dkic_b.f_create_code(1, #{seriesId}::uuid, '系列');
+    </select>
+
+    <select id="selectDisplayNo" resultType="Integer">
+        SELECT MAX(display_no) + 1 FROM dkic_b.t_mst_goods_series
+        <include refid="Condition"/>
+    </select>
+
+
+    <update id="updateById" parameterType="com.dk.mdm.model.pojo.mst.GoodsSeries">
+        update
+        dkic_b.t_mst_goods_series
+        <set>
+
+            <if test="et.seriesCode != null">
+                series_code = #{et.seriesCode},
+            </if>
+            <if test="et.seriesName != null">
+                series_name = #{et.seriesName},
+            </if>
+
+            <if test="et.displayNo != null">
+                display_no = #{et.displayNo},
+            </if>
+            <if test="et.remarks != null">
+                remarks = #{et.remarks},
+            </if>
+            <if test="et.cpId != null">
+                cp_id = #{et.cpId},
+            </if>
+            <if test="et.flgValid != null">
+                flg_valid = #{et.flgValid},
+            </if>
+
+        </set>
+        where series_id = #{et.seriesId}::uuid
+    </update>
 </mapper>

+ 30 - 1
src/main/java/com/dk/mdm/mapper/mst/UnitMapper.java

@@ -2,13 +2,42 @@ package com.dk.mdm.mapper.mst;
 
 import com.dk.mdm.model.pojo.mst.Unit;
 import com.dk.common.mapper.BaseMapper;
+import com.dk.mdm.model.query.mst.UnitQuery;
+import com.dk.mdm.model.response.mst.GoodsBrandResponse;
+import com.dk.mdm.model.response.mst.UnitResponse;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 /**
 *  计量单位 Mapper
 */
 @Repository
 public interface UnitMapper extends BaseMapper<Unit>{
-	
+    /**
+     * @desc   : 根据条件进行查询
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    List<UnitResponse> selectByCond(UnitQuery UnitQuery);
+
+    /**
+     * @desc   : 根据条件进行查询(数量)
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    Long countByCond(UnitQuery UnitQuery);
+    /**
+     * @desc   : 查询排序
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    Integer selectDisplayNo(UnitQuery UnitQuery);
+    /**
+     * @desc   : 生成编码
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    String setUnitCode(Unit unit);
 }
 

+ 49 - 6
src/main/java/com/dk/mdm/mapper/mst/UnitMapper.xml

@@ -87,8 +87,9 @@
     <select id="selectByCond" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_unit
+        FROM  dkic_b.t_mst_unit
         <include refid="Condition"/>
+        order by display_no asc
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
@@ -98,7 +99,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM t_mst_unit
+        FROM  dkic_b.t_mst_unit
         <include refid="Condition"/>
     </select>
 
@@ -106,7 +107,7 @@
     <select id="selectById" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_unit
+        FROM  dkic_b.t_mst_unit
         WHERE unit_id = #{unitId}::uuid
     </select>
 
@@ -114,7 +115,7 @@
     <select id="selectByIdForUpdate" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_unit
+        FROM  dkic_b.t_mst_unit
         WHERE unit_id = #{unitId}
         for update
     </select>
@@ -123,13 +124,13 @@
     <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_mst_unit
+        FROM  dkic_b.t_mst_unit
         <include refid="idsForeach"/>
         for update
     </select>
 
     <insert id="insertBatch">
-        insert into t_mst_unit
+        insert into  dkic_b.t_mst_unit
         (
         <trim suffixOverrides=",">
             unit_code,
@@ -156,4 +157,46 @@
             )
         </foreach>
     </insert>
+
+
+    <select id="setUnitCode" resultType="String">
+        select dkic_b.f_create_code(1, #{unitId}::uuid, '单位');
+    </select>
+
+    <select id="selectDisplayNo" resultType="Integer">
+        SELECT MAX(display_no) + 1 FROM dkic_b.t_mst_unit
+        <include refid="Condition"/>
+    </select>
+
+
+    <update id="updateById" parameterType="com.dk.mdm.model.pojo.mst.Unit">
+        update
+        dkic_b.t_mst_unit
+        <set>
+            <if test="et.unitCode != null">
+                unit_code = #{et.unitCode},
+            </if>
+            <if test="et.unitName != null">
+                unit_name = #{et.unitName},
+            </if>
+            <if test="et.decimalPlaces != null">
+                decimal_places = #{et.decimalPlaces},
+            </if>
+
+            <if test="et.displayNo != null">
+                display_no = #{et.displayNo},
+            </if>
+            <if test="et.remarks != null">
+                remarks = #{et.remarks},
+            </if>
+            <if test="et.cpId != null">
+                cp_id = #{et.cpId},
+            </if>
+            <if test="et.flgValid != null">
+                flg_valid = #{et.flgValid},
+            </if>
+
+        </set>
+        where unit_id = #{et.unitId}::uuid
+    </update>
 </mapper>

+ 3 - 77
src/main/java/com/dk/mdm/model/response/mst/GoodsCategoryResponse.java

@@ -28,12 +28,11 @@ import java.time.LocalDateTime;
 @Data
 @AllArgsConstructor
 @NoArgsConstructor
-@EqualsAndHashCode(callSuper = true)
 @Accessors(chain = true)
 @ExportTitle("商品种类")
 @TableName(value = "t_mst_goods_category", autoResultMap = true , schema =  "dkic_b")
 @ApiModel(value="实体类:商品种类", description="表名:t_mst_goods_category")
-public class GoodsCategoryResponse extends PageInfo<GoodsCategoryResponse> implements Serializable {
+public class GoodsCategoryResponse implements Serializable {
 
     /*
      * 数据库字段
@@ -95,7 +94,7 @@ public class GoodsCategoryResponse extends PageInfo<GoodsCategoryResponse> imple
      */
     @Excel(name = "上层ID")
     @ApiModelProperty(value = "上层ID")
-    @TableField(typeHandler = UuidListTypeHandler.class)
+    @TableField(typeHandler = UuidTypeHandler.class)
     private String levelUpper;
 
 
@@ -104,7 +103,7 @@ public class GoodsCategoryResponse extends PageInfo<GoodsCategoryResponse> imple
      */
     @Excel(name = "下层ID")
     @ApiModelProperty(value = "下层ID")
-    @TableField(typeHandler = UuidListTypeHandler.class)
+    @TableField(typeHandler = UuidTypeHandler.class)
     private String levelLower;
 
 
@@ -164,79 +163,6 @@ public class GoodsCategoryResponse extends PageInfo<GoodsCategoryResponse> imple
     private Integer cpId;
 
 
-    /**
-     * 创建时间 (触发器自动处理)
-     */
-    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
-    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opCreateTime;
-
-
-    /**
-     * 创建用户 (触发器自动处理)
-     */
-    @Excel(name = "创建用户 (触发器自动处理)")
-    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String opCreateUserId;
-
-
-    /**
-     * 修改时间 (触发器自动处理)
-     */
-    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
-    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opUpdateTime;
-
-
-    /**
-     * 修改用户 (触发器自动处理)
-     */
-    @Excel(name = "修改用户 (触发器自动处理)")
-    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String opUpdateUserId;
-
-
-    /**
-     * 数据操作应用 (触发器自动处理)
-     */
-    @Excel(name = "数据操作应用 (触发器自动处理)")
-    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
-    private String opAppCode;
-
-
-    /**
-     * 数据时间戳 (触发器自动处理)
-     */
-    @Excel(name = "数据时间戳 (触发器自动处理)")
-    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opTimestamp;
-
-
-    /**
-     * 数据操作数据库用户 (触发器自动处理)
-     */
-    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
-    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
-    private String opDbUser;
-
-
-    /*
-     * 相关属性
-     * @TableField(exist = false)
-     */
-
-    /*
-     * 关联属性 + 查询条件
-     * @TableField(exist = false)
-     */
 
 
     private static final long serialVersionUID = 1L;

+ 6 - 3
src/main/java/com/dk/mdm/service/mst/GoodsBrandService.java

@@ -72,14 +72,17 @@ public class GoodsBrandService extends BaseService<GoodsBrand> {
 			rollbackFor = {Exception.class}
 	)
 	public ResponseResultVO<?> insert(GoodsBrandVO goodsBrandVO) {
+		//实体转换
 		GoodsBrand goodsBrand = goodsBrandConvert.convertToPo(goodsBrandVO);
 		goodsBrand.setShortName(goodsBrand.getBrandName());
 		Integer displayNo = goodsBrandMapper.selectDisplayNo(new GoodsBrandQuery());
+		//设置序号
 		goodsBrand.setDisplayNo(displayNo);
+		//新建
 		goodsBrandMapper.insert(goodsBrand);
+		//设置编码
 		goodsBrand.setBrandCode(goodsBrandMapper.setBrandCode(goodsBrand));
-		goodsBrandMapper.updateById(goodsBrand);
-
+		super.updateByUuid(goodsBrand);
 		return ResponseResultUtil.success();
 	}
 
@@ -95,7 +98,7 @@ public class GoodsBrandService extends BaseService<GoodsBrand> {
 	)
 	public ResponseResultVO<?> updateGoodsBrand(GoodsBrandVO goodsBrandVO) {
 		GoodsBrand goodsBrand = goodsBrandConvert.convertToPo(goodsBrandVO);
-		goodsBrandMapper.updateById(goodsBrand);
+		super.updateByUuid(goodsBrand);
 		return ResponseResultUtil.success();
 	}
 

+ 94 - 6
src/main/java/com/dk/mdm/service/mst/GoodsCategoryService.java

@@ -1,23 +1,111 @@
 package com.dk.mdm.service.mst;
 
+import com.dk.common.infrastructure.annotaiton.Pagination;
+import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseResultUtil;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.mdm.infrastructure.convert.mst.GoodsCategoryConvert;
+import com.dk.mdm.model.pojo.mst.GoodsBrand;
 import com.dk.mdm.model.pojo.mst.GoodsCategory;
 import com.dk.mdm.mapper.mst.GoodsCategoryMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
+import com.dk.mdm.model.query.mst.GoodsBrandQuery;
+import com.dk.mdm.model.query.mst.GoodsCategoryQuery;
+import com.dk.mdm.model.query.mst.GoodsSeriesQuery;
+import com.dk.mdm.model.response.mst.GoodsCategoryResponse;
+import com.dk.mdm.model.response.mst.GoodsSeriesResponse;
+import com.dk.mdm.model.vo.mst.GoodsBrandVO;
+import com.dk.mdm.model.vo.mst.GoodsCategoryVO;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 
 @Service
 @Transactional
 public class GoodsCategoryService extends BaseService<GoodsCategory> {
 
-	@Override
-	public BaseMapper<GoodsCategory> getRepository() {
-		return goodsCategoryMapper;
-	}
+    @Override
+    public BaseMapper<GoodsCategory> getRepository() {
+        return goodsCategoryMapper;
+    }
 
-	@Autowired
-	private GoodsCategoryMapper goodsCategoryMapper;
+    @Autowired
+    private GoodsCategoryMapper goodsCategoryMapper;
 
+
+    @Autowired
+    private GoodsCategoryConvert goodsCategoryConvert;
+
+    /**
+     * @desc : 重写主键
+     * @author : 于继渤
+     * @date : 2024/2/29 20:29
+     */
+    @Override
+    public String getPrimaryKey() {
+        return "cat_id";
+    }
+
+    /**
+     * @desc : 查询
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @Pagination
+    public ResponseResultVO<PageList<GoodsCategoryResponse>> selectByCond(GoodsCategoryQuery goodsCategoryQuery) {
+        return super.mergeListWithCount(goodsCategoryQuery, goodsCategoryMapper.selectByCond(goodsCategoryQuery),
+                goodsCategoryMapper.countByCond(goodsCategoryQuery));
+    }
+
+
+    /**
+     * @desc : 新建
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @Transactional(
+            rollbackFor = {Exception.class}
+    )
+    public ResponseResultVO<?> insert(GoodsCategoryVO goodsCategoryVO) {
+        //实体转换
+        GoodsCategory goodsCategory = goodsCategoryConvert.convertToPo(goodsCategoryVO);
+        Integer displayNo = goodsCategoryMapper.selectDisplayNo(new GoodsCategoryQuery());
+        if (displayNo != null) {
+            //插入序号
+            goodsCategory.setDisplayNo(displayNo);
+        } else {
+            goodsCategory.setDisplayNo(0);
+        }
+        if (goodsCategory.getParentId() != null) {
+            //插入TOPid
+            goodsCategory.setTopId(goodsCategory.getParentId());
+        }
+        //新建
+        goodsCategoryMapper.insert(goodsCategory);
+        //设置编码
+        goodsCategory.setCatCode(goodsCategoryMapper.setCategoryCode(goodsCategory));
+        super.updateByUuid(goodsCategory);
+        //执行函数
+        goodsCategoryMapper.resetLevelGoodsCategory(new GoodsCategoryQuery().setTopId(goodsCategory.getParentId()).setCpId(goodsCategory.getCpId()));
+        return ResponseResultUtil.success();
+    }
+
+
+    /**
+     * @desc : 编辑
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
+    @Transactional(
+            rollbackFor = {Exception.class}
+    )
+    public ResponseResultVO<?> update(GoodsCategoryVO goodsCategoryVO) {
+        GoodsCategory goodsCategory = goodsCategoryConvert.convertToPo(goodsCategoryVO);
+        super.updateByUuid(goodsCategory);
+        return ResponseResultUtil.success();
+    }
 }

+ 70 - 0
src/main/java/com/dk/mdm/service/mst/GoodsSeriesService.java

@@ -1,9 +1,22 @@
 package com.dk.mdm.service.mst;
 
+import com.dk.common.infrastructure.annotaiton.Pagination;
+import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseResultUtil;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.mdm.infrastructure.convert.mst.GoodsBrandConvert;
+import com.dk.mdm.infrastructure.convert.mst.GoodsSeriesConvert;
+import com.dk.mdm.model.pojo.mst.GoodsBrand;
 import com.dk.mdm.model.pojo.mst.GoodsSeries;
 import com.dk.mdm.mapper.mst.GoodsSeriesMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
+import com.dk.mdm.model.query.mst.GoodsBrandQuery;
+import com.dk.mdm.model.query.mst.GoodsSeriesQuery;
+import com.dk.mdm.model.response.mst.GoodsBrandResponse;
+import com.dk.mdm.model.response.mst.GoodsSeriesResponse;
+import com.dk.mdm.model.vo.mst.GoodsBrandVO;
+import com.dk.mdm.model.vo.mst.GoodsSeriesVO;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -20,6 +33,10 @@ public class GoodsSeriesService extends BaseService<GoodsSeries> {
 	@Autowired
 	private GoodsSeriesMapper goodsSeriesMapper;
 
+
+	@Autowired
+	private GoodsSeriesConvert goodsSeriesConvert;
+
 	/**
 	 * @desc : 重写主键
 	 * @author : 于继渤
@@ -30,4 +47,57 @@ public class GoodsSeriesService extends BaseService<GoodsSeries> {
 		return "series_id";
 	}
 
+
+
+	/**
+	 * @desc : 查询
+	 * @author : 于继渤
+	 * @date : 2023/1/5 9:39
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<GoodsSeriesResponse>> selectByCond(GoodsSeriesQuery goodsSeriesQuery) {
+		return super.mergeListWithCount(goodsSeriesQuery, goodsSeriesMapper.selectByCond(goodsSeriesQuery),
+				goodsSeriesMapper.countByCond(goodsSeriesQuery));
+	}
+
+
+
+	/**
+	 * @desc : 新建
+	 * @author : 于继渤
+	 * @date : 2023/1/5 9:39
+	 */
+	@Transactional(
+			rollbackFor = {Exception.class}
+	)
+	public ResponseResultVO<?> insert(GoodsSeriesVO goodsSeriesVO) {
+		//实体转换
+		GoodsSeries goodsSeries = goodsSeriesConvert.convertToPo(goodsSeriesVO);
+		//查询序号
+		Integer displayNo = goodsSeriesMapper.selectDisplayNo(new GoodsSeriesQuery());
+		goodsSeries.setDisplayNo(displayNo);
+		//新建
+		goodsSeriesMapper.insert(goodsSeries);
+		//设置编码
+		goodsSeries.setSeriesCode(goodsSeriesMapper.setSeriesCode(goodsSeries));
+		super.updateByUuid(goodsSeries);
+		return ResponseResultUtil.success();
+	}
+
+
+
+	/**
+	 * @desc : 编辑
+	 * @author : 于继渤
+	 * @date : 2023/1/5 9:39
+	 */
+	@Transactional(
+			rollbackFor = {Exception.class}
+	)
+	public ResponseResultVO<?> update(GoodsSeriesVO goodsSeriesVO) {
+		GoodsSeries goodsSeries = goodsSeriesConvert.convertToPo(goodsSeriesVO);
+		super.updateByUuid(goodsSeries);
+		return ResponseResultUtil.success();
+	}
+
 }

+ 1 - 0
src/main/java/com/dk/mdm/service/mst/RoleFunService.java

@@ -81,6 +81,7 @@ public class RoleFunService extends BaseService<RoleFun> {
                 roleFun.setRoleId(roleVO.getRoleId());
                 roleFun.setCpId(roleVO.getCpId());
             }
+            //批量新建
             roleFunMapper.insertBatch(roleVO.getRoleFunList());
         }
 

+ 1 - 0
src/main/java/com/dk/mdm/service/mst/RoleSensitiveService.java

@@ -82,6 +82,7 @@ public class RoleSensitiveService extends BaseService<RoleSensitive> {
                 roleSensitive.setRoleId(roleVO.getRoleId());
                 roleSensitive.setCpId(roleVO.getCpId());
             }
+            //批量新建
             roleSensitiveMapper.insertBatch(roleVO.getRoleSensitiveList());
         }
 

+ 4 - 14
src/main/java/com/dk/mdm/service/mst/RoleService.java

@@ -73,10 +73,13 @@ public class RoleService extends BaseService<Role> {
         Role role = roleConvert.convertToPo(roleVO);
         Integer displayNo = roleMapper.selectDisplayNo(new RoleQuery());
         role.setDisplayNo(displayNo);
+        //新建
         roleMapper.insert(role);
         String setRoleCode = roleMapper.setRoleCode(role);
+        //设置编码
         role.setRoleCode(setRoleCode);
         roleMapper.updateById(role);
+        //设置角色权限明细
         setRoleItem(roleVO, role);
 
         return ResponseResultUtil.success();
@@ -121,24 +124,11 @@ public class RoleService extends BaseService<Role> {
             roleSensitiveService.deleteRoleId(roleVO.getRoleId());
         }
 
-
+        //设置角色权限明细
         setRoleItem(roleVO, role);
         return ResponseResultUtil.success();
     }
 
-    /**
-     * @desc : 启用停用
-     * @author : 于继渤
-     * @date : 2023/1/5 9:39
-     */
-    @Transactional(
-            rollbackFor = {Exception.class}
-    )
-    public ResponseResultVO<?> deactivateEnable(RoleVo roleVO) {
-        Role role = roleConvert.convertToPo(roleVO);
-        roleMapper.updateById(role);
-        return ResponseResultUtil.success();
-    }
 
 
 }

+ 74 - 0
src/main/java/com/dk/mdm/service/mst/UnitService.java

@@ -1,9 +1,18 @@
 package com.dk.mdm.service.mst;
 
+import com.dk.common.infrastructure.annotaiton.Pagination;
+import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseResultUtil;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.mdm.infrastructure.convert.mst.UnitConvert;
 import com.dk.mdm.model.pojo.mst.Unit;
 import com.dk.mdm.mapper.mst.UnitMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
+import com.dk.mdm.model.query.mst.UnitQuery;
+import com.dk.mdm.model.response.mst.GoodsBrandResponse;
+import com.dk.mdm.model.response.mst.UnitResponse;
+import com.dk.mdm.model.vo.mst.UnitVO;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -20,4 +29,69 @@ public class UnitService extends BaseService<Unit> {
 	@Autowired
 	private UnitMapper unitMapper;
 
+	@Autowired
+	private UnitConvert unitConvert;
+
+	/**
+	 * @desc : 重写主键
+	 * @author : 于继渤
+	 * @date : 2024/2/29 20:29
+	 */
+	@Override
+	public String getPrimaryKey() {
+		return "unit_id";
+	}
+
+
+
+	/**
+	 * @desc : 查询
+	 * @author : 于继渤
+	 * @date : 2023/1/5 9:39
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<UnitResponse>> selectByCond(UnitQuery UnitQuery) {
+		return super.mergeListWithCount(UnitQuery, unitMapper.selectByCond(UnitQuery),
+				unitMapper.countByCond(UnitQuery));
+	}
+
+
+
+	/**
+	 * @desc : 新建
+	 * @author : 于继渤
+	 * @date : 2023/1/5 9:39
+	 */
+	@Transactional(
+			rollbackFor = {Exception.class}
+	)
+	public ResponseResultVO<?> insert(UnitVO unitVO) {
+		//实体转换
+		Unit unit = unitConvert.convertToPo(unitVO);
+		Integer displayNo = unitMapper.selectDisplayNo(new UnitQuery());
+		//设置序号
+		unit.setDisplayNo(displayNo);
+		//新建
+		unitMapper.insert(unit);
+		//设置编码
+		unit.setUnitCode(unitMapper.setUnitCode(unit));
+		super.updateByUuid(unit);
+		return ResponseResultUtil.success();
+	}
+
+
+
+	/**
+	 * @desc : 编辑
+	 * @author : 于继渤
+	 * @date : 2023/1/5 9:39
+	 */
+	@Transactional(
+			rollbackFor = {Exception.class}
+	)
+	public ResponseResultVO<?> update(UnitVO unitVO) {
+		Unit unit = unitConvert.convertToPo(unitVO);
+		super.updateByUuid(unit);
+		return ResponseResultUtil.success();
+	}
 }