diff --git a/src/main/java/com/xit/biz/ctgy/auth/MinPasswordEncoder.java b/src/main/java/com/xit/biz/ctgy/auth/MinPasswordEncoder.java index 5cdb358..432a75d 100644 --- a/src/main/java/com/xit/biz/ctgy/auth/MinPasswordEncoder.java +++ b/src/main/java/com/xit/biz/ctgy/auth/MinPasswordEncoder.java @@ -48,8 +48,9 @@ public class MinPasswordEncoder implements PasswordEncoder { this.logger.warn("Empty encoded password"); return false; } - - return Objects.equals(minUserinfoDao.queryGetPasswdEncode(rawPassword.toString()), encodedPassword); +//23.05.11 jhseo - DB 복호화 처리로 인하여 별도 암호화 하지 않고 비교 처리 +// return Objects.equals(minUserinfoDao.queryGetPasswdEncode(rawPassword.toString()), encodedPassword); + return Objects.equals(rawPassword.toString(), encodedPassword); } /** diff --git a/src/main/java/com/xit/biz/ctgy/v2/controller/ResidentAndDisabledController.java b/src/main/java/com/xit/biz/ctgy/v2/controller/ResidentAndDisabledController.java index 4fb8725..b23d724 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/controller/ResidentAndDisabledController.java +++ b/src/main/java/com/xit/biz/ctgy/v2/controller/ResidentAndDisabledController.java @@ -177,9 +177,15 @@ public class ResidentAndDisabledController { @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "dashboard" , description = "dashboard") + @Parameters({ + @Parameter(in = ParameterIn.QUERY, name = "accesstype", description = "사용구분(001-관리자, 002-심사자)", required = true, example = " ") + }) @GetMapping(value="/dashboard", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity getDashboard() { - return RestResponse.of(service.findDashboard()); + public ResponseEntity getDashboard( + @Valid + @Parameter(hidden = true) + final MinUserinfoDto dto) { + return RestResponse.of(service.findDashboard(dto)); } //--------------------------------------------------------------------------------- // 심사자 diff --git a/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java b/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java index 4518a60..e16a482 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java +++ b/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java @@ -216,8 +216,9 @@ public class ParkingDao extends BaseMpowerDaoSupport { delete(sql); } - public List findDashboardJudgeList() { + public List findDashboardJudgeList(MinUserinfoDto dto) { final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectDashboardJudgeList") + .setParameter("accesstype", dto.getAccesstype()) .getQueryString(); final String fieldStrs = "msEdate, msuTeam, name, jcnt, tcnt"; return selectList(DashboardJudgeListDto.class, sql, fieldStrs); diff --git a/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java b/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java index e00a1a3..04f7447 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java +++ b/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java @@ -297,9 +297,10 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport { } - public List findDashboardJudgeList(@NotNull final String msDatagb) { + public List findDashboardJudgeList(@NotNull final String msDatagb, MinUserinfoDto dto) { final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectDashboardJudgeList") .setParameter("msDatagb", msDatagb) + .setParameter("accesstype", dto.getAccesstype()) .getQueryString(); final String fieldStrs = "msEdate, msuTeam, name, jcnt, tcnt"; return selectList(DashboardJudgeListDto.class, sql, fieldStrs); diff --git a/src/main/java/com/xit/biz/ctgy/v2/repository/UserDao.java b/src/main/java/com/xit/biz/ctgy/v2/repository/UserDao.java index 2a4b92b..096963e 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/repository/UserDao.java +++ b/src/main/java/com/xit/biz/ctgy/v2/repository/UserDao.java @@ -111,7 +111,7 @@ public class UserDao extends BaseMpowerDaoSupport { .setParameter("email", dto.getEmail()) .setParameter("mphone", dto.getMphone()) .setParameter("name", dto.getName()) - //.setParameter("passwd", dto.getPasswd()) + .setParameter("passwd", dto.getPasswd()) .setParameter("team", dto.getTeam()) .getQueryString(); update(sql); diff --git a/src/main/java/com/xit/biz/ctgy/v2/repository/UserSubDao.java b/src/main/java/com/xit/biz/ctgy/v2/repository/UserSubDao.java index 861f173..014065a 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/repository/UserSubDao.java +++ b/src/main/java/com/xit/biz/ctgy/v2/repository/UserSubDao.java @@ -46,7 +46,7 @@ public class UserSubDao extends BaseMpowerDaoSupport { .setParameter("email", dto.getEmail()) .setParameter("mphone", dto.getMphone()) .setParameter("name", dto.getName()) - //.setParameter("passwd", dto.getPasswd()) + .setParameter("passwd", dto.getPasswd()) .setParameter("team", dto.getTeam()) .getQueryString(); update(sql); diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/IResidentAndDisabledService.java b/src/main/java/com/xit/biz/ctgy/v2/service/IResidentAndDisabledService.java index 8522c0c..d15fe83 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/service/IResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/v2/service/IResidentAndDisabledService.java @@ -77,7 +77,7 @@ public interface IResidentAndDisabledService { void saveJudgeStds(final JudgeStdDto dto); - Map findDashboard(); + Map findDashboard(MinUserinfoDto dto); //--------------------------------------------------------------------------------- // 심사자 diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/impl/MinUserService.java b/src/main/java/com/xit/biz/ctgy/v2/service/impl/MinUserService.java index 32e524d..e5662e8 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/service/impl/MinUserService.java +++ b/src/main/java/com/xit/biz/ctgy/v2/service/impl/MinUserService.java @@ -63,7 +63,10 @@ public class MinUserService implements IMinUserService { @Override //@Transactional public void removeMinUser(MinUserinfoDto dto) { - dto.setIsenable("0"); + if("0".equals(dto.getIsenable())) + dto.setIsenable("1"); + else + dto.setIsenable("0"); userDao.removeMinUserinfo(dto); userSubDao.removeMinUserinfo(dto); } diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java b/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java index 1dc5509..31de79e 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java @@ -286,13 +286,13 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { } //@Transactional(readOnly = true) - public Map findDashboard(){ + public Map findDashboard(MinUserinfoDto dto){ Map resultMap = new HashMap<>(); resultMap.put("pBoardList", publicBoardDao.findAll(new MinInfoBoard680Dto(), PageRequest.of(0, 7))); - resultMap.put("parkJudgeList", parkingDao.findDashboardJudgeList()); - resultMap.put("residentJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_RESIDENT.getCode())); - resultMap.put("disabledJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_DISABLED.getCode())); + resultMap.put("parkJudgeList", parkingDao.findDashboardJudgeList(dto)); + resultMap.put("residentJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_RESIDENT.getCode(), dto)); + resultMap.put("disabledJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_DISABLED.getCode(), dto)); return resultMap; } diff --git a/src/main/resources/config/application.yml b/src/main/resources/config/application.yml index ef7ebfb..8d6847f 100644 --- a/src/main/resources/config/application.yml +++ b/src/main/resources/config/application.yml @@ -3,7 +3,7 @@ spring: name: xit-framework #description: XIT api for development profiles: - active: local + active: prod include: oauth main: # bean name 중복 허용 - junit 사용시 true?? diff --git a/src/main/resources/sql/minuserinfo-mapper.xml b/src/main/resources/sql/minuserinfo-mapper.xml index b024893..94ad11b 100644 --- a/src/main/resources/sql/minuserinfo-mapper.xml +++ b/src/main/resources/sql/minuserinfo-mapper.xml @@ -4,7 +4,7 @@ /* minuserinfo-mapper|selectUserInfo|julim */ SELECT userid, - passwd, + TRAFFIC.ECL_DECRYPT(passwd) AS passwd, name, regnum, mphone, @@ -38,7 +38,7 @@ , gu , isenable , mphone - , passwd + , TRAFFIC.ECL_DECRYPT(passwd) AS passwd , regdate , regnum , team @@ -57,7 +57,7 @@ , isenable , mphone , name - , passwd + , TRAFFIC.ECL_DECRYPT(passwd) AS passwd , regdate , regnum , team @@ -138,6 +138,7 @@ , name = #{name} , mphone = #{mphone} , email = #{email} + , passwd = #{passwd} WHERE userid= #{userid} diff --git a/src/main/resources/sql/minusersubinfo-mapper.xml b/src/main/resources/sql/minusersubinfo-mapper.xml index 3a7d3c4..fe3e90e 100644 --- a/src/main/resources/sql/minusersubinfo-mapper.xml +++ b/src/main/resources/sql/minusersubinfo-mapper.xml @@ -37,6 +37,7 @@ , name = #{name} , mphone = #{mphone} , email = #{email} + , passwd = #{passwd} WHERE userid= #{userid} diff --git a/src/main/resources/sql/parking-mapper.xml b/src/main/resources/sql/parking-mapper.xml index ed1be3a..fff28f5 100644 --- a/src/main/resources/sql/parking-mapper.xml +++ b/src/main/resources/sql/parking-mapper.xml @@ -326,7 +326,7 @@ /* parking-mapper|selectDashboardJudgeList|julim */ SELECT MS.ms_edate , MSU.msu_team - , MU.name + , DECODE(#{accesstype}, '001', MU.name, '002', REGEXP_REPLACE(MU.name, '.', '*', 2)) name , SUM(DECODE(MSU.msu_result, '1', 1, '2', 1, 0)) jcnt , COUNT(*) tcnt FROM min_simsa680 MS @@ -350,7 +350,7 @@ /* parking-mapper|selectByUserJudgeList|julim */ SELECT MS.ms_maincode , MS.ms_seq - , MS.ms_carnum + , REGEXP_REPLACE(MS.ms_carnum, '.', '*', 4) as ms_carnum , DECODE(MS.ms_result, '1', '1', '2', '2', '0') as msResult , MS.ms_year , MS.ms_chasu diff --git a/src/main/resources/sql/residentAndDisabled-mapper.xml b/src/main/resources/sql/residentAndDisabled-mapper.xml index a799ded..8acab9c 100644 --- a/src/main/resources/sql/residentAndDisabled-mapper.xml +++ b/src/main/resources/sql/residentAndDisabled-mapper.xml @@ -585,7 +585,7 @@ /* residentAndDisabled-mapper|selectDashboardJudgeList|julim */ SELECT MS.ms_edate , MSU.msu_team - , MU.name + , DECODE(#{accesstype}, '001', MU.name, '002', REGEXP_REPLACE(MU.name, '.', '*', 2)) name , SUM(DECODE(MSU.msu_result, '1', 1, '2', 1, 0)) jcnt , COUNT(*) tcnt FROM min_simsa680_sc MS @@ -611,7 +611,7 @@ /* residentAndDisabled-mapper|selectByUserJudgeList|julim */ SELECT MS.ms_maincode , MS.ms_seq - , MS.ms_carnum + , REGEXP_REPLACE(MS.ms_carnum, '.', '*', 4) as ms_carnum , DECODE(MS.ms_result, '1', '1', '2', '2', '0') as msResult , MS.ms_year , MS.ms_chasu