zhoux 1 год назад
Родитель
Сommit
1c8d836c81

+ 4 - 5
src/main/java/com/dk/oauth/entity/ComMenu.java

@@ -46,12 +46,11 @@ public class ComMenu extends PageInfo<ComMenu> implements Serializable {
 
 
     /**
-     * 企业Id
+     * 系统版本
      */
-    @TableField(fill = FieldFill.INSERT)
-    @Excel(name = "企业Id")
-    @ApiModelProperty(value = "企业Id")
-    private Integer cpId;
+    @Excel(name = "系统版本")
+    @ApiModelProperty(value = "系统版本")
+    private String gradeCode;
 
 
     /**

+ 4 - 13
src/main/java/com/dk/oauth/entity/ComMenuResponse.java

@@ -46,22 +46,13 @@ public class ComMenuResponse extends PageInfo<ComMenuResponse> implements Serial
 
 
     /**
-     * 企业Id
+     * 企业版本
      */
-    @TableField(fill = FieldFill.INSERT)
-    @Excel(name = "企业Id")
-    @ApiModelProperty(value = "企业Id")
-    private Integer cpId;
+    @Excel(name = "企业版本")
+    @ApiModelProperty(value = "企业版本")
+    private String gradeCode;
 
 
-    /**
-     * 员工Id
-     */
-    @Excel(name = "员工Id")
-    @ApiModelProperty(value = "员工Id")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String staffId;
-
 
     /**
      * 应用代码

+ 16 - 4
src/main/java/com/dk/oauth/service/impl/CompanyServiceImpl.java

@@ -99,8 +99,12 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
         String licenseStr = AESUtil.desEncrypt(company.getLicense());
         if(licenseStr != null ){
             Map<String,Object> licenseMap = JSON.parseObject(licenseStr,Map.class);
-            mp.put("web_max_num",Integer.parseInt(licenseMap.get("web_max_num").toString()));
-            mp.put("wx_max_num",Integer.parseInt(licenseMap.get("wx_max_num").toString()));
+            if(licenseMap.get("web_max_num") != null){
+                mp.put("web_max_num",Integer.parseInt(licenseMap.get("web_max_num").toString()));
+            }
+            if(licenseMap.get("wx_max_num") != null){
+                mp.put("wx_max_num",Integer.parseInt(licenseMap.get("wx_max_num").toString()));
+            }
         }else{
             mp.put("web_max_num",1);
             mp.put("wx_max_num",1);
@@ -393,6 +397,16 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
         }
         map.put("goodsCategorys",listGoodsCategorys);
         // 常用功能
+        List<ComMenuResponse> comMenuResponses = comMenuMapper.selectByCond(new ComMenu().setGradeCode(company.getGradeCode()));
+        List<Map<String, Object>> listComMenu = new ArrayList<>();
+        for (int i = 0; i < comMenuResponses.size(); i++) {
+            m = new HashMap<>();
+            m.put("menuUuid",comMenuResponses.get(i).getMenuUuid());
+            m.put("appCode",comMenuResponses.get(i).getAppCode());
+            m.put("displayNo",comMenuResponses.get(i).getDisplayNo());
+            listComMenu.add(m);
+        }
+        map.put("listComMenu",listComMenu);
 
         //  打印票据
         List<PrintLayout> printLayoutResponses = printLayoutMapper.selectByCond(new PrintLayout());
@@ -409,8 +423,6 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
         }
         map.put("printLayout",listPrintLayout);
 
-
-
         ResponseResultVO  listResponseResultVO = staffFeign.insertFeignCompanyData(map);
 
         // 如果没有成功返回

+ 10 - 22
src/main/resources/mapper/ComMenuMapper.xml

@@ -5,8 +5,7 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        menu_uuid
-        , cp_id, staff_id, app_code, display_no, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+        menu_uuid,grade_code, app_code, display_no, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -16,8 +15,7 @@
         <result column="object_code" property="objectCode"/>
         <result column="object_path" property="objectPath"/>
         <result column="object_icon" property="objectIcon"/>
-        <result column="cp_id" property="cpId"/>
-        <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
+        <result column="grade_code" property="gradeCode"/>
         <result column="app_code" property="appCode"/>
         <result column="display_no" property="displayNo"/>
         <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
@@ -30,11 +28,8 @@
     <!-- 通用条件列 -->
     <sql id="Condition">
         <where>
-            <if test="cpId != null">
-                AND cp_id = #{cpId}
-            </if>
-            <if test="staffId != null and staffId != ''">
-                AND staff_id = #{staffId}
+            <if test="gradeCode != null and gradeCode != ''">
+                AND grade_code = #{gradeCode}
             </if>
             <if test="appCode != null and appCode != ''">
                 AND app_code = #{appCode}
@@ -52,21 +47,14 @@
 
     <!-- 查询表t_mst_com_menu,(条件查询+分页)列表 -->
     <select id="selectByCond" resultMap="BaseResultMap">
-        SELECT
-            sys.f_get_name_i18n ( tam.menu_name_i18n, #{i18n} ) menu_name,
-            tmcm.menu_uuid,
-            tam.object_code,
-            tam.object_path,
-            CASE WHEN tam.object_icon IS NULL THEN NULL ELSE tam.object_icon || '.png' END AS object_icon
+        SELECT tmcm.menu_uuid,
+            tmcm.display_no,
+            tmcm.app_code,
+            tmcm.grade_code
         FROM
             dkic_b.t_mst_com_menu tmcm
-                INNER JOIN sys.t_app_menu tam ON tmcm.menu_uuid = tam.menu_uuid
-        WHERE
-            tmcm.staff_id = #{staffId} ::uuid
-          AND tmcm.app_code = #{appCode}
-        <if test="gradeCode != null and gradeCode != ''">
-            AND (tam.grade_codes is null or #{gradeCode} = any(tam.grade_codes))
-        </if>
+        <include refid="Condition"/>
+        ORDER BY tmcm.display_no
     </select>
 
     <!-- 查询表t_mst_com_menu,(条件查询)个数 -->