Commit 7cbbe4c0 by guojuxing

同步应用菜单调整:给一份好办小程序应用数据

parent 915d471a
package com.gic.auth.dao.mapper; package com.gic.auth.dao.mapper;
import com.gic.auth.dto.AuthItemListDTO; import com.gic.auth.dto.AuthItemListDTO;
import com.gic.auth.dto.MenuDTO;
import com.gic.auth.entity.TabSysMenu; import com.gic.auth.entity.TabSysMenu;
import com.gic.auth.qo.MenuListQO; import com.gic.auth.qo.MenuListQO;
import com.gic.auth.qo.MenuOperationItemListQO; import com.gic.auth.qo.MenuOperationItemListQO;
...@@ -51,6 +52,16 @@ public interface TabSysMenuMapper { ...@@ -51,6 +52,16 @@ public interface TabSysMenuMapper {
int updateByPrimaryKeySelective(TabSysMenu record); int updateByPrimaryKeySelective(TabSysMenu record);
/** /**
* 更新好办小程序应用
* @Title: updatePageForHaobanApplet

* @Description:

* @author guojuxing
* @param record

* @return int


*/
int updatePageForHaobanApplet(TabSysMenu record);
/**
* 根据主键更新记录 * 根据主键更新记录
* *
* @param record 实体对象 * @param record 实体对象
......
...@@ -71,6 +71,16 @@ public interface MenuService { ...@@ -71,6 +71,16 @@ public interface MenuService {
void updatePage(MenuDTO menuDTO); void updatePage(MenuDTO menuDTO);
/** /**
* 更新好办小程序应用数据
* @Title: updatePageForHaobanApplet

* @Description:

* @author guojuxing
* @param menuDTO

* @return void


*/
void updatePageForHaobanApplet(MenuDTO menuDTO);
/**
* 查询页面下面的操作项列表数据 * 查询页面下面的操作项列表数据
* @Title: listMenuRoleByParentId
 * @Title: listMenuRoleByParentId

* @Description: * @Description:
......
...@@ -80,6 +80,14 @@ public class MenuServiceImpl implements MenuService { ...@@ -80,6 +80,14 @@ public class MenuServiceImpl implements MenuService {
} }
@Override @Override
public void updatePageForHaobanApplet(MenuDTO menuDTO) {
TabSysMenu record = EntityUtil.changeEntityNew(TabSysMenu.class, menuDTO);
record.setUpdateTime(new Date());
record.setPlatformType(MenuPlatformTypeEnum.HAOBAN_APPLET_APP.getCode());
tabSysMenuMapper.updatePageForHaobanApplet(record);
}
@Override
public List<TabSysMenu> listMenuItemByParentId(Integer parentId) { public List<TabSysMenu> listMenuItemByParentId(Integer parentId) {
List<TabSysMenu> list = tabSysMenuMapper.listMenuItemByParentId(parentId); List<TabSysMenu> list = tabSysMenuMapper.listMenuItemByParentId(parentId);
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
...@@ -211,10 +219,11 @@ public class MenuServiceImpl implements MenuService { ...@@ -211,10 +219,11 @@ public class MenuServiceImpl implements MenuService {
@Override @Override
public void deleteNotInApp(List<String> projectList) { public void deleteNotInApp(List<String> projectList) {
//目前删除platform_type 为0和2的 //目前删除platform_type 为XXX的数据,做到同步应用市场应用数据
List<Integer> platformTypeList = new ArrayList<>(2); List<Integer> platformTypeList = new ArrayList<>(2);
platformTypeList.add(MenuPlatformTypeEnum.GIC.getCode()); platformTypeList.add(MenuPlatformTypeEnum.GIC.getCode());
platformTypeList.add(MenuPlatformTypeEnum.HAOBAN_APP.getCode()); platformTypeList.add(MenuPlatformTypeEnum.HAOBAN_APP.getCode());
platformTypeList.add(MenuPlatformTypeEnum.HAOBAN_APPLET_APP.getCode());
tabSysMenuMapper.deleteNotInApp(projectList, platformTypeList); tabSysMenuMapper.deleteNotInApp(projectList, platformTypeList);
} }
......
...@@ -967,6 +967,8 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -967,6 +967,8 @@ public class MenuApiServiceImpl implements MenuApiService {
//删除不在projectList中的应用菜单:逻辑删除 //删除不在projectList中的应用菜单:逻辑删除
menuService.deleteNotInApp(projectList); menuService.deleteNotInApp(projectList);
for (ApplicationDTO app : appList) { for (ApplicationDTO app : appList) {
//gic应用
boolean isGicApp = MenuPlatformTypeEnum.GIC.getCode().equals(app.getAppType());
if (appMenu.containsKey(app.getApplicationId().toString())) { if (appMenu.containsKey(app.getApplicationId().toString())) {
//如果已存在,则更新版本信息 //如果已存在,则更新版本信息
MenuDTO menuDTO = new MenuDTO(); MenuDTO menuDTO = new MenuDTO();
...@@ -976,6 +978,11 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -976,6 +978,11 @@ public class MenuApiServiceImpl implements MenuApiService {
// setMenuAuthType(menuDTO); // setMenuAuthType(menuDTO);
menuDTO.setMenuId(appMenu.get(app.getApplicationId().toString())); menuDTO.setMenuId(appMenu.get(app.getApplicationId().toString()));
menuService.updatePage(menuDTO); menuService.updatePage(menuDTO);
//
if (!isGicApp) {
menuDTO.setMenuId(null);
menuService.updatePageForHaobanApplet(menuDTO);
}
} else { } else {
MenuDTO menuDTO = new MenuDTO(); MenuDTO menuDTO = new MenuDTO();
menuDTO.setMenuName(app.getName()); menuDTO.setMenuName(app.getName());
...@@ -983,10 +990,13 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -983,10 +990,13 @@ public class MenuApiServiceImpl implements MenuApiService {
setMenuVersion(app.getPropDTOList(), app.getServeExpanList(), menuDTO); setMenuVersion(app.getPropDTOList(), app.getServeExpanList(), menuDTO);
// setMenuAuthType(menuDTO); // setMenuAuthType(menuDTO);
setNormalFieldValue(menuDTO); setNormalFieldValue(menuDTO);
//3:好办应用
boolean isGicApp =MenuPlatformTypeEnum.GIC.getCode().equals(app.getAppType());
menuDTO.setPlatformType(isGicApp ? MenuPlatformTypeEnum.GIC.getCode() : MenuPlatformTypeEnum.HAOBAN_APP.getCode()); menuDTO.setPlatformType(isGicApp ? MenuPlatformTypeEnum.GIC.getCode() : MenuPlatformTypeEnum.HAOBAN_APP.getCode());
menuService.savePage(menuDTO); menuService.savePage(menuDTO);
//好办小程序应用生成一份和好办应用同样的数据
if (!isGicApp) {
menuDTO.setPlatformType(MenuPlatformTypeEnum.HAOBAN_APPLET_APP.getCode());
menuService.savePage(menuDTO);
}
} }
} }
} }
......
...@@ -273,6 +273,71 @@ ...@@ -273,6 +273,71 @@
</set> </set>
where menu_id = #{menuId,jdbcType=INTEGER} where menu_id = #{menuId,jdbcType=INTEGER}
</update> </update>
<update id="updatePageForHaobanApplet" parameterType="com.gic.auth.entity.TabSysMenu">
update tab_sys_menu
<set>
<if test="menuName != null">
menu_name = #{menuName,jdbcType=VARCHAR},
</if>
<if test="menuUrl != null">
menu_url = #{menuUrl,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="target != null">
target = #{target,jdbcType=INTEGER},
</if>
<if test="iconUrl != null">
icon_url = #{iconUrl,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="level != null">
level = #{level,jdbcType=INTEGER},
</if>
<if test="isShow != null">
is_show = #{isShow,jdbcType=INTEGER},
</if>
<if test="menuCode != null">
menu_code = #{menuCode,jdbcType=VARCHAR},
</if>
<if test="parentCode != null">
parent_code = #{parentCode,jdbcType=VARCHAR},
</if>
<if test="menuVersion != null">
menu_version = #{menuVersion,jdbcType=VARCHAR},
</if>
<if test="menuType != null">
menu_type = #{menuType,jdbcType=INTEGER},
</if>
<if test="menuVersionName != null">
menu_version_name = #{menuVersionName,jdbcType=VARCHAR},
</if>
<if test="projectUrlForWeb != null">
project_url_for_web = #{projectUrlForWeb,jdbcType=VARCHAR},
</if>
<if test="adminOnlySign != null">
admin_only_sign = #{adminOnlySign,jdbcType=INTEGER},
</if>
<if test="authType != null">
auth_type = #{authType,jdbcType=INTEGER},
</if>
</set>
where platform_type = #{platformType,jdbcType=INTEGER}
and project = #{project,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.auth.entity.TabSysMenu"> <update id="updateByPrimaryKey" parameterType="com.gic.auth.entity.TabSysMenu">
update tab_sys_menu update tab_sys_menu
set menu_name = #{menuName,jdbcType=VARCHAR}, set menu_name = #{menuName,jdbcType=VARCHAR},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment