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

+ 31 - 40
src/main/java/com/dk/mdm/mapper/mst/GoodsCategoryMapper.xml

@@ -9,6 +9,13 @@
         , cat_code, cat_name, parent_id, display_no, top_id, level_upper, level_lower, level_leaf, level_no, level_code, level_name, 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>
 
+    <sql id="Base_Column_List_Join">
+        tmgc.cat_id
+        , tmgc.cat_code, tmgc.cat_name, tmgc.parent_id, tmgc.display_no, tmgc.top_id, tmgc.level_upper,
+        tmgc.level_lower, tmgc.level_leaf, tmgc.level_no, tmgc.level_code, tmgc.level_name, tmgc.remarks, tmgc.flg_valid, tmgc.cp_id
+    </sql>
+
+
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mst.GoodsCategory">
         <id column="cat_id" property="catId"/>
@@ -52,76 +59,57 @@
         <result column="remarks" property="remarks"/>
         <result column="flg_valid" property="flgValid"/>
         <result column="cp_id" property="cpId"/>
+        <result column="parentName" property="parentName"/>
     </resultMap>
 
     <!-- 通用条件列 -->
     <sql id="Condition">
         <where>
             <if test="catCode != null and catCode != ''">
-                AND cat_code = #{catCode}
+                AND tmgc.cat_code = #{catCode}
             </if>
             <if test="catName != null and catName != ''">
-                AND cat_name = #{catName}
+                AND tmgc.cat_name = #{catName}
             </if>
             <if test="parentId != null and parentId != ''">
-                AND parent_id = #{parentId}
+                AND tmgc.parent_id = #{parentId}
             </if>
             <if test="displayNo != null">
-                AND display_no = #{displayNo}
+                AND tmgc.display_no = #{displayNo}
             </if>
             <if test="topId != null and topId != ''">
-                AND top_id = #{topId}
+                AND tmgc.top_id = #{topId}
             </if>
             <if test="levelUpper != null and levelUpper != ''">
-                AND level_upper = #{levelUpper}
+                AND tmgc.level_upper = #{levelUpper}
             </if>
             <if test="levelLower != null and levelLower != ''">
-                AND level_lower = #{levelLower}
+                AND tmgc.level_lower = #{levelLower}
             </if>
             <if test="levelLeaf != null">
-                AND level_leaf = #{levelLeaf}
+                AND tmgc.level_leaf = #{levelLeaf}
             </if>
             <if test="levelNo != null">
-                AND level_no = #{levelNo}
+                AND tmgc.level_no = #{levelNo}
             </if>
             <if test="levelCode != null and levelCode != ''">
-                AND level_code = #{levelCode}
+                AND tmgc.level_code = #{levelCode}
             </if>
             <if test="levelName != null and levelName != ''">
-                AND level_name = #{levelName}
+                AND tmgc.level_name = #{levelName}
             </if>
             <if test="remarks != null and remarks != ''">
-                AND remarks = #{remarks}
+                AND tmgc.remarks = #{remarks}
             </if>
             <if test="flgValid != null">
-                AND flg_valid = #{flgValid}
+                AND tmgc.flg_valid = #{flgValid}
             </if>
             <if test="cpId != null">
-                AND cp_id = #{cpId}
-            </if>
-            <if test="opCreateTime != null">
-                AND op_create_time = #{opCreateTime}
-            </if>
-            <if test="opCreateUserId != null and opCreateUserId != ''">
-                AND op_create_user_id = #{opCreateUserId}
-            </if>
-            <if test="opUpdateTime != null">
-                AND op_update_time = #{opUpdateTime}
-            </if>
-            <if test="opUpdateUserId != null and opUpdateUserId != ''">
-                AND op_update_user_id = #{opUpdateUserId}
-            </if>
-            <if test="opAppCode != null and opAppCode != ''">
-                AND op_app_code = #{opAppCode}
-            </if>
-            <if test="opTimestamp != null">
-                AND op_timestamp = #{opTimestamp}
-            </if>
-            <if test="opDbUser != null and opDbUser != ''">
-                AND op_db_user = #{opDbUser}
+                AND tmgc.cp_id = #{cpId}
             </if>
+
             <if test="searchText != null">
-                AND (position(#{searchText} in cat_code) > 0   OR position(#{searchText} in cat_name) > 0   OR  position(#{searchText} in remarks) > 0 )
+                AND (position(#{searchText} in tmgc.cat_code) > 0   OR position(#{searchText} in tmgc.cat_name) > 0   OR  position(#{searchText} in tmgc.remarks) > 0 )
             </if>
         </where>
     </sql>
@@ -137,10 +125,13 @@
     <!-- 查询表t_mst_goods_category,(条件查询+分页)列表 -->
     <select id="selectByCond" resultMap="BaseResultMapResponse">
         SELECT
-        <include refid="Base_Column_List"/>
-        FROM dkic_b.t_mst_goods_category
+        <include refid="Base_Column_List_Join"/>,
+
+        (select cat_name FROM dkic_b.t_mst_goods_category tmstg where tmstg.cat_id = tmgc.parent_id) AS "parentName"
+        FROM dkic_b.t_mst_goods_category tmgc
+
         <include refid="Condition"/>
-        ORDER BY display_no
+        ORDER BY tmgc.display_no
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
@@ -150,7 +141,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM dkic_b.t_mst_goods_category
+        FROM dkic_b.t_mst_goods_category tmgc
         <include refid="Condition"/>
     </select>
 

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

@@ -161,6 +161,7 @@ public class GoodsCategoryResponse implements Serializable {
     @Excel(name = "企业ID")
     @ApiModelProperty(value = "企业ID")
     private Integer cpId;
+    private String parentName;
 
 
 

+ 19 - 19
src/main/java/com/dk/mdm/model/vo/mst/GoodsCategoryVO.java

@@ -90,24 +90,24 @@ public class GoodsCategoryVO extends PageInfo<GoodsCategoryVO> implements Serial
     private String topId;
 
 
-    /**
-     * 上层ID
-     */
-    @Excel(name = "上层ID")
-    @ApiModelProperty(value = "上层ID")
-    @TableField(typeHandler = UuidListTypeHandler.class)
-    private String levelUpper;
-
-
-    /**
-     * 下层ID
-     */
-    @Excel(name = "下层ID")
-    @ApiModelProperty(value = "下层ID")
-    @TableField(typeHandler = UuidListTypeHandler.class)
-    private String levelLower;
-
-
+//    /**
+//     * 上层ID
+//     */
+//    @Excel(name = "上层ID")
+//    @ApiModelProperty(value = "上层ID")
+//    @TableField(typeHandler = UuidListTypeHandler.class)
+//    private String levelUpper;
+//
+//
+//    /**
+//     * 下层ID
+//     */
+//    @Excel(name = "下层ID")
+//    @ApiModelProperty(value = "下层ID")
+//    @TableField(typeHandler = UuidListTypeHandler.class)
+//    private String levelLower;
+//
+//
     /**
      * 末级标识
      */
@@ -115,7 +115,7 @@ public class GoodsCategoryVO extends PageInfo<GoodsCategoryVO> implements Serial
     @ApiModelProperty(value = "末级标识")
     private Boolean levelLeaf;
 
-
+//
     /**
      * 层级序号
      */

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

@@ -97,7 +97,7 @@ public class RoleService extends BaseService<Role> {
     }
 
     private void setRoleItem(RoleVo roleVO, Role role) {
-        if (roleVO.getRoleFunList() != null && roleVO.getRoleFunList().size() > 0) {
+        if (roleVO.getRoleFunList() != null && roleVO.getRoleFunList().size() > 0 && roleVO.getRoleFunList().get(0).getFunUuid() != null) {
             //新建角色功能权限
             for (RoleFun roleFun : roleVO.getRoleFunList()) {
                 roleFun.setRoleId(role.getRoleId());
@@ -105,7 +105,7 @@ public class RoleService extends BaseService<Role> {
             }
             roleFunService.saveRoleFun(roleVO.getRoleFunList());
         }
-        if (roleVO.getRoleSensitiveList() != null && roleVO.getRoleSensitiveList().size() > 0) {
+        if (roleVO.getRoleSensitiveList() != null && roleVO.getRoleSensitiveList().size() > 0 && roleVO.getRoleSensitiveList().get(0).getSenItemCode()!= null) {
             //新建角色敏感信息权限
             for (RoleSensitive roleSensitive : roleVO.getRoleSensitiveList()) {
                 roleSensitive.setRoleId(role.getRoleId());