瀏覽代碼

메뉴등록 수정

dwkim 2 年之前
父節點
當前提交
c6dcd6b378

+ 1 - 0
src/main/java/com/oqpo/api/entity/oper/MenuEntity.java

@@ -29,6 +29,7 @@ public class MenuEntity implements Serializable {
29 29
     private String useYnNm;
30 30
     private Integer bMenuCnt;
31 31
     private String idPathNm;
32
+    private String sysTypeCd;
32 33
 
33 34
 
34 35
     List<MenuEntity> subMenuList;

+ 5 - 0
src/main/java/com/oqpo/api/service/system/MenuService.java

@@ -65,6 +65,10 @@ public class MenuService extends CommonService {
65 65
     @Transactional
66 66
     public void saveMenu(String userId, SaveMenuRequest saveMenuRequest) throws Exception {
67 67
         try {
68
+
69
+            // 상위메뉴가 모바일인지 웹인지정보 가져옴
70
+            MenuEntity topMenuInfo = menuMapper.selectMenuInfo(saveMenuRequest.getTopMenuNo().toString());
71
+
68 72
             // 기본정보 저장
69 73
             MenuEntity entity = new MenuEntity();
70 74
             entity.setMenuNo(saveMenuRequest.getMenuNo());
@@ -77,6 +81,7 @@ public class MenuService extends CommonService {
77 81
             entity.setIconYn(saveMenuRequest.getIconYn());
78 82
             entity.setRoleDesc(saveMenuRequest.getRoleDesc());
79 83
             entity.setOpenCd(saveMenuRequest.getOpenCd());
84
+            entity.setSysTypeCd(topMenuInfo.getSysTypeCd());
80 85
 
81 86
             if ("C".equals(saveMenuRequest.getViewCd())) {
82 87
                 menuMapper.insertMenu(userId, entity);

+ 3 - 3
src/main/resources/mybatis/sqlmaps/system/Menu.xml

@@ -180,16 +180,16 @@
180 180
     <select id="selectMenuInfo" resultType="com.oqpo.api.entity.oper.MenuEntity">
181 181
         select /* selectMenuInfo */
182 182
                 menu_no, menu_id, top_menu_no, menu_nm, use_yn, view_num, conn_url, icon_yn, role_desc, open_cd
183
-                ,fn_get_menu_nm(top_menu_no) as top_menu_nm
183
+                ,fn_get_menu_nm(top_menu_no) as top_menu_nm, sys_type_cd
184 184
         from   np_sys_menu
185 185
         where  menu_no = #{menuNo}
186 186
     </select>
187 187
 
188 188
     <insert id="insertMenu" >
189 189
         insert into np_sys_menu /** insertMenu */
190
-        ( menu_id, top_menu_no, menu_nm, use_yn, view_num, conn_url, icon_yn, role_desc, open_cd , add_dt, add_id, chg_dt, chg_id)
190
+        ( menu_id, top_menu_no, menu_nm, use_yn, view_num, conn_url, icon_yn, role_desc, open_cd , add_dt, add_id, chg_dt, chg_id, sys_type_cd)
191 191
         values
192
-         ( #{entity.menuId}, #{entity.topMenuNo}, #{entity.menuNm}, #{entity.useYn}, #{entity.viewNum}, #{entity.connUrl}, #{entity.iconYn}, #{entity.roleDesc}, #{entity.openCd}, now(), #{userId}, now(), #{userId})
192
+         ( #{entity.menuId}, #{entity.topMenuNo}, #{entity.menuNm}, #{entity.useYn}, #{entity.viewNum}, #{entity.connUrl}, #{entity.iconYn}, #{entity.roleDesc}, #{entity.openCd}, now(), #{userId}, now(), #{userId}, #{sysTypeCd})
193 193
     </insert>
194 194
 
195 195
     <update id="updateMenu" >