Commit 82ba4f4f by 陶光胜

Merge branch 'developer' into 'master'

Developer

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

* @author guojuxing
* @param list

* @param menuCode 菜单code
* @return void


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