Skip to content

Commit 701f018

Browse files
committed
修复 菜单配置成功后,跳转问题
1 parent 0bc2647 commit 701f018

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

Api/src/main/java/com/java110/api/listener/configMenu/BindingConfigMenuListener.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,18 @@ protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context,
8383
}
8484

8585
if (!hasKey(addMenuView, "mId")) {
86-
addMenuView.put("gId",viewMenuGroupInfo.getString("gId"));
87-
addMenuView.put("pId",addPrivilegeView.getString("pId"));
86+
addMenuView.put("gId", viewMenuGroupInfo.getString("gId"));
87+
addMenuView.put("pId", addPrivilegeView.getString("pId"));
8888
saveMenu(addMenuView, context);
8989
}
9090

91+
JSONObject outParam = new JSONObject();
92+
outParam.put("gId", viewMenuGroupInfo.getString("gId"));
93+
outParam.put("pId", addPrivilegeView.getString("pId"));
94+
outParam.put("mId", addMenuView.getString("mId"));
9195

92-
ResponseEntity<String> responseEntity = new ResponseEntity<String>("", HttpStatus.OK);
96+
97+
ResponseEntity<String> responseEntity = new ResponseEntity<String>(outParam.toString(), HttpStatus.OK);
9398

9499
context.setResponseEntity(responseEntity);
95100

CommunityService/src/main/java/com/java110/community/dao/impl/MenuServiceDaoImpl.java

+29-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.springframework.stereotype.Service;
1515
import org.springframework.transaction.annotation.Transactional;
1616

17+
import java.util.HashMap;
1718
import java.util.List;
1819
import java.util.Map;
1920

@@ -230,7 +231,34 @@ public List<Map> getMenuInfo(Map info) throws DAOException {
230231
public int updateMenuInfo(Map info) throws DAOException {
231232
logger.debug("修改路由信息Instance 入参 info : {}", info);
232233

233-
int saveFlag = sqlSessionTemplate.update("menuServiceDaoImpl.updateMenuInfo", info);
234+
int saveFlag = 0;
235+
236+
//判断是否为删除
237+
if(info.containsKey("statusCd") && StatusConstant.STATUS_CD_INVALID.equals(info.get("statusCd"))){
238+
//做查询
239+
List<Map> baseMenus = getMenuInfo(info);
240+
241+
if(baseMenus != null && baseMenus.size() > 0){
242+
Map privilegeInfo = new HashMap();
243+
privilegeInfo.put("pId", baseMenus.get(0).get("pId"));
244+
privilegeInfo.put("statusCd", StatusConstant.STATUS_CD_INVALID);
245+
//删除权限 权限组关系
246+
saveFlag = sqlSessionTemplate.update("menuServiceDaoImpl.updateBasePrivilegeRelInfo", info);
247+
248+
if(saveFlag < 1){
249+
return saveFlag;
250+
}
251+
//删除权限
252+
saveFlag = sqlSessionTemplate.update("menuServiceDaoImpl.updateBasePrivilegeInfo", info);
253+
254+
if(saveFlag < 1){
255+
return saveFlag;
256+
}
257+
}
258+
259+
}
260+
261+
saveFlag = sqlSessionTemplate.update("menuServiceDaoImpl.updateMenuInfo", info);
234262

235263
return saveFlag;
236264
}

WebService/src/main/resources/components/menuPackage/menu-manage/menuManage.js

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
}
2727
},
2828
_initMethod:function(){
29+
vc.component.menuManageInfo.conditions.mId = vc.getParam("mId");
2930
vc.component._listMenus(DEFAULT_PAGE, DEFAULT_ROWS);
3031
},
3132
_initEvent:function(){

0 commit comments

Comments
 (0)