TC 수정사항 반영

This commit is contained in:
kimre
2022-07-16 23:53:22 +09:00
parent c323de8bb9
commit e8328fef2c
43 changed files with 954 additions and 904 deletions

View File

@@ -15,8 +15,4 @@ public interface ChannelMgtMapper {
List<TmpltInfo> selectTmpltList(TmpltListReqDto tmpltListReqDto);
List<TmpltInfo> selectTmpltListExcel(TmpltListExcelReqDto tmpltListExcelReqDto);
default String selectChannelAuthMenuNo(String targetUserId) {
return null;
}
}

View File

@@ -37,8 +37,6 @@ public class ChannelMgtService {
ChannelMgtMapper channelMgtMapper = sqlSessionSlave.getMapper(ChannelMgtMapper.class);
String nowPage = String.valueOf(tmpltListReqDto.getPage());
String channelAuthMenuNo = channelMgtMapper.selectChannelAuthMenuNo(targetUserId);
tmpltListReqDto.setChannelAuthMenuNo(channelAuthMenuNo);
tmpltListReqDto.setUserId(targetUserId);
int totalCnt = channelMgtMapper.selectTmpltTotalCnt(tmpltListReqDto);
@@ -74,8 +72,7 @@ public class ChannelMgtService {
//
public TmpltListExcelResDto tmpltListExcel(TmpltListExcelReqDto tmpltListExcelReqDto, String targetUserId) {
ChannelMgtMapper channelMgtMapper = sqlSessionSlave.getMapper(ChannelMgtMapper.class);
String channelAuthMenuNo = channelMgtMapper.selectChannelAuthMenuNo(targetUserId);
tmpltListExcelReqDto.setChannelAuthMenuNo(channelAuthMenuNo);
tmpltListExcelReqDto.setUserId(targetUserId);
List<TmpltInfo> tmpltInfos = channelMgtMapper.selectTmpltListExcel(tmpltListExcelReqDto);

View File

@@ -140,4 +140,35 @@ public class CommService {
return result;
}
/**
* date : 2022. 7. 16.
* auth : ckr
* desc : 권한으로 메뉴 조회
* @param role
* @return
*/
public Menu getByRoleMenu(String role) {
CommMapper commMapper = sqlSessionSlave.getMapper(CommMapper.class);
log.debug("role : {}", role);
List<Menu> menuList = commMapper.getMenuByRole(role);
Menu root = new Menu();
Map<Integer, Menu> map = menuList.stream().collect(
Collectors.toMap(Menu::getMenuNo, Function.identity()));
for (Menu menu : menuList) {
Integer prntId = menu.getPrntsMenuNo();
if (prntId == null || prntId == 0) {
root.addChild(menu);
}
else {
map.get(prntId).addChild(menu);
}
}
return root;
}
}

View File

@@ -707,8 +707,11 @@ public class CustMgtService {
svcUserInfo2.setPwdInit(Const.COMM_YES);
svcUserInfo2.setHpNo(insertMassUsers.get(j).getMdn());
svcUserInfo2.setEmail(insertMassUsers.get(j).getEmail());
svcUserInfo2.setUserSttusCd(insertMassUsers.get(j).getStat() == "사용" ? Const.USER_STTUS_CD_NOMAL
: Const.USER_STTUS_CD_STOP);
if(StringUtils.contains(insertMassUsers.get(j).getStat(), "사용")){
svcUserInfo2.setUserSttusCd(Const.USER_STTUS_CD_NOMAL);
}else{
svcUserInfo2.setUserSttusCd(Const.USER_STTUS_CD_STOP);
}
svcUserInfo2.setCustSeq(svcUserInfo.getCustSeq());
svcUserInfo2.setPrntsUserSeq(svcUserInfo.getUserSeq());
svcUserInfo2.setUserTpCd(Const.USER_TP_CD_USR);

View File

@@ -3,6 +3,8 @@ package kr.co.uplus.ez.api.login;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import kr.co.uplus.ez.api.comm.CommService;
import kr.co.uplus.ez.api.comm.dto.Menu;
import kr.co.uplus.ez.api.login.dto.*;
import kr.co.uplus.ez.common.data.ApiResponseCode;
import kr.co.uplus.ez.common.data.Const;
@@ -25,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
@RestController
@@ -40,6 +43,9 @@ public class LoginController {
private LoginFailureHandler loginFailureHandler;
@Autowired
private LoginService loginService;
@Autowired
private CommService commService;
@Autowired
private JwtService jwtSvc;
@@ -143,8 +149,15 @@ public class LoginController {
String nextUrl = getReturnUrl(request, response);
logger.debug("login SUCCESS - nextUrl = [{}]", nextUrl);
AuthUser authUser = loginService.getUser(authentication.getName());
String auth = authUser.getAutCd();
Menu menuData = commService.getByRoleMenu(auth);
LoginRes loginRes = new LoginRes(SecurityConfig.LOGIN_SUCC_URL);
ArrayList<Menu> menu = (ArrayList<Menu>) menuData.getChildren();
logger.info(menu.get(0).toString());
Menu rootMenu = menu.get(0);
String rootUrl = rootMenu.getChildren().get(0).getMenuUrl();
LoginRes loginRes = new LoginRes(rootUrl);
loginRes.setUserId(authUser.getOprtrId());
loginRes.setUserNm(authUser.getOprtrNm());
@@ -166,8 +179,16 @@ public class LoginController {
String nextUrl = getReturnUrl(request, response);
logger.debug("login SUCCESS - nextUrl = [{}]", nextUrl);
AuthUser authUser = loginService.getUser(authentication.getName());
LoginRes loginRes = new LoginRes(SecurityConfig.LOGIN_SUCC_URL);
String auth = authUser.getAutCd();
Menu menuData = commService.getByRoleMenu(auth);
ArrayList<Menu> menu = (ArrayList<Menu>) menuData.getChildren();
logger.info(menu.get(0).toString());
Menu rootMenu = menu.get(0);
String rootUrl = rootMenu.getChildren().get(0).getMenuUrl();
LoginRes loginRes = new LoginRes(rootUrl);
//LoginRes loginRes = new LoginRes(SecurityConfig.LOGIN_SUCC_URL);
loginRes.setUserId(authUser.getOprtrId());
loginRes.setUserNm(authUser.getOprtrNm());