Commit 82ba4f4f by 陶光胜

Merge branch 'developer' into 'master'

Developer

See merge request !13
parents bcaf60f4 2de899d5
...@@ -13,9 +13,10 @@ public interface MenuAuthDepartService { ...@@ -13,9 +13,10 @@ public interface MenuAuthDepartService {
* @Description: * @Description:

* @author guojuxing 
* @author guojuxing
* @param list
 * @param list

* @param menuCode 菜单code
* @return void
 * @return void


*/ 
*/
void saveFetch(List<MenuAuthDepartDTO> list); void saveFetch(List<MenuAuthDepartDTO> list, String menuCode);
/** /**
* 查询菜单的所有部门职位 * 查询菜单的所有部门职位
......
...@@ -16,9 +16,9 @@ public class MenuAuthDepartServiceImpl implements MenuAuthDepartService{ ...@@ -16,9 +16,9 @@ public class MenuAuthDepartServiceImpl implements MenuAuthDepartService{
private TabSysMenuAuthDepartMapper tabSysMenuAuthDepartMapper; private TabSysMenuAuthDepartMapper tabSysMenuAuthDepartMapper;
@Override @Override
public void saveFetch(List<MenuAuthDepartDTO> list) { public void saveFetch(List<MenuAuthDepartDTO> list, String menuCode) {
tabSysMenuAuthDepartMapper.deleteByMenuCode(menuCode);
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
tabSysMenuAuthDepartMapper.deleteByMenuCode(list.get(0).getMenuCode());
tabSysMenuAuthDepartMapper.saveFetch(list); tabSysMenuAuthDepartMapper.saveFetch(list);
} }
} }
......
...@@ -10,6 +10,7 @@ import com.gic.auth.qo.MenuOperationItemListQO; ...@@ -10,6 +10,7 @@ import com.gic.auth.qo.MenuOperationItemListQO;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -42,6 +43,10 @@ public class MenuServiceImpl implements MenuService { ...@@ -42,6 +43,10 @@ public class MenuServiceImpl implements MenuService {
record.setCreateTime(new Date()); record.setCreateTime(new Date());
record.setUpdateTime(new Date()); record.setUpdateTime(new Date());
record.setStatus(1); record.setStatus(1);
if (StringUtils.isBlank(menuDTO.getMenuCode())) {
//权限项没有菜单code数据,但是这样会导致不好批量上传到生产,给一个默认的数据
record.setMenuCode(String.valueOf(System.currentTimeMillis()));
}
tabSysMenuMapper.insertSelective(record); tabSysMenuMapper.insertSelective(record);
return record.getMenuId(); return record.getMenuId();
} }
......
...@@ -421,7 +421,7 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -421,7 +421,7 @@ public class MenuApiServiceImpl implements MenuApiService {
setMenuAuthType(menuDTO); setMenuAuthType(menuDTO);
menuService.updatePage(menuDTO); menuService.updatePage(menuDTO);
menuAuthDepartService.saveFetch(menuDTO.getMenuAuthDepartList()); menuAuthDepartService.saveFetch(menuDTO.getMenuAuthDepartList(), menuDTO.getMenuCode());
//同时更新子集的父级code数据 //同时更新子集的父级code数据
menuService.updateParentCodeByParentId(menuDTO.getMenuId(), menuDTO.getMenuCode()); menuService.updateParentCodeByParentId(menuDTO.getMenuId(), menuDTO.getMenuCode());
...@@ -675,6 +675,8 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -675,6 +675,8 @@ public class MenuApiServiceImpl implements MenuApiService {
menu.setParentCode(tabSysMenu.getMenuCode()); menu.setParentCode(tabSysMenu.getMenuCode());
menu.setMenuVersion(tabSysMenu.getMenuVersion()); menu.setMenuVersion(tabSysMenu.getMenuVersion());
menu.setMenuVersionName(tabSysMenu.getMenuVersionName()); menu.setMenuVersionName(tabSysMenu.getMenuVersionName());
//避免冲突
menu.setMenuId(null);
menuService.savePage(EntityUtil.changeEntityNew(MenuDTO.class, menu)); menuService.savePage(EntityUtil.changeEntityNew(MenuDTO.class, menu));
} else { } else {
//其他层级,查询他的父级ID,根据父级code //其他层级,查询他的父级ID,根据父级code
...@@ -682,6 +684,8 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -682,6 +684,8 @@ public class MenuApiServiceImpl implements MenuApiService {
menu.setParentId(otherLevel.getMenuId()); menu.setParentId(otherLevel.getMenuId());
menu.setMenuVersion(tabSysMenu.getMenuVersion()); menu.setMenuVersion(tabSysMenu.getMenuVersion());
menu.setMenuVersionName(tabSysMenu.getMenuVersionName()); menu.setMenuVersionName(tabSysMenu.getMenuVersionName());
//避免冲突
menu.setMenuId(null);
menuService.savePage(EntityUtil.changeEntityNew(MenuDTO.class, menu)); menuService.savePage(EntityUtil.changeEntityNew(MenuDTO.class, menu));
} }
} }
...@@ -736,7 +740,7 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -736,7 +740,7 @@ public class MenuApiServiceImpl implements MenuApiService {
setNormalFieldValue(menuDTO); setNormalFieldValue(menuDTO);
setMenuAuthType(menuDTO); setMenuAuthType(menuDTO);
menuService.savePage(menuDTO); menuService.savePage(menuDTO);
menuAuthDepartService.saveFetch(menuDTO.getMenuAuthDepartList()); menuAuthDepartService.saveFetch(menuDTO.getMenuAuthDepartList(), menuDTO.getMenuCode());
return ServiceResponse.success(); return ServiceResponse.success();
} }
...@@ -789,7 +793,7 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -789,7 +793,7 @@ public class MenuApiServiceImpl implements MenuApiService {
setMenuAuthType(menuDTO); setMenuAuthType(menuDTO);
Integer menuId = menuService.savePage(menuDTO); Integer menuId = menuService.savePage(menuDTO);
menuAuthDepartService.saveFetch(menuDTO.getMenuAuthDepartList()); menuAuthDepartService.saveFetch(menuDTO.getMenuAuthDepartList(), menuDTO.getMenuCode());
return ServiceResponse.success(menuId); return ServiceResponse.success(menuId);
} }
...@@ -839,7 +843,7 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -839,7 +843,7 @@ public class MenuApiServiceImpl implements MenuApiService {
setMenuVersion(menuDTO); setMenuVersion(menuDTO);
setMenuAuthType(menuDTO); setMenuAuthType(menuDTO);
menuService.updatePage(menuDTO); menuService.updatePage(menuDTO);
menuAuthDepartService.saveFetch(menuDTO.getMenuAuthDepartList()); menuAuthDepartService.saveFetch(menuDTO.getMenuAuthDepartList(), menuDTO.getMenuCode());
//同时更新子集的父级code数据 //同时更新子集的父级code数据
menuService.updateParentCodeByParentId(menuDTO.getMenuId(), menuDTO.getMenuCode()); menuService.updateParentCodeByParentId(menuDTO.getMenuId(), menuDTO.getMenuCode());
...@@ -1244,6 +1248,8 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -1244,6 +1248,8 @@ public class MenuApiServiceImpl implements MenuApiService {
}); });
} }
} }
} else {
departPosition.add(departmentCode + "-" + gicUserDTO.getPositionCode());
} }
} }
//过滤运营人员的部门职位权限 //过滤运营人员的部门职位权限
......
...@@ -31,8 +31,8 @@ import com.gic.member.config.api.service.MemberCardApiService; ...@@ -31,8 +31,8 @@ import com.gic.member.config.api.service.MemberCardApiService;
import com.gic.member.config.api.service.ServiceConfigApiService; import com.gic.member.config.api.service.ServiceConfigApiService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -47,7 +47,7 @@ import java.util.Map; ...@@ -47,7 +47,7 @@ import java.util.Map;
@RestController @RestController
public class LoginController { public class LoginController {
private final Logger logger = LogManager.getLogger(LoginController.class); private final static Logger logger = LogManager.getLogger(LoginController.class);
@Autowired @Autowired
private EnterpriseApiService enterpriseApiService; private EnterpriseApiService enterpriseApiService;
...@@ -113,6 +113,7 @@ public class LoginController { ...@@ -113,6 +113,7 @@ public class LoginController {
if (StringUtils.isBlank(nationCode)) { if (StringUtils.isBlank(nationCode)) {
nationCode = Constants.NATION_CODE; nationCode = Constants.NATION_CODE;
} }
long startTime = System.currentTimeMillis();
Md5Util md5 = new Md5Util(); Md5Util md5 = new Md5Util();
// password 自身作为盐值 // password 自身作为盐值
if (password.length() != 32) { if (password.length() != 32) {
...@@ -177,6 +178,7 @@ public class LoginController { ...@@ -177,6 +178,7 @@ public class LoginController {
} }
//塞缓存 //塞缓存
UserDetailUtils.setUserDetail(userDetail); UserDetailUtils.setUserDetail(userDetail);
logger.info("登录所花时间:{}", System.currentTimeMillis() - startTime);
return RestResponse.success(userDetail); return RestResponse.success(userDetail);
} }
} }
......
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