Merge branch 'dev'

dev
Lim Jonguk 3 years ago
commit a12ea0b6ac

@ -83,6 +83,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.3'
// spring-boot 2.3 - spring-boot-starter-web
// hibernate-validator:5.2.4.Final

@ -30,7 +30,7 @@ public class JudgeResultDto {
@Schema(required = false, title = "결과코드", example = " ", description = "Input Description...")
private String msResult;
List<JudgeResultUserDto> judgeResultUserDtoList;
List<JudgeResultUserDto> judgeResultUsers;
// @Schema(required = true, title = "차수", example = " ", description = "Input Description...")
// private Long msChasu;

@ -8,6 +8,7 @@ import lombok.NoArgsConstructor;
import lombok.Setter;
import org.apache.ibatis.type.Alias;
import javax.persistence.Column;
import java.time.LocalDate;
@Schema(name = "JudgeResultUserDto", description = "심사결과사용자")
@ -17,13 +18,21 @@ import java.time.LocalDate;
@NoArgsConstructor
public class JudgeResultUserDto {
@Schema(required = true, title = "민원심사사용자매핑코드", example = " ", description = "Input Description...")
private Long msuCode;
@Schema(required = true, title = "민원코드", example = " ", description = "민원코드")
private Long msuMaincode;
@Schema(required = true, title = "민원심사사용자코드", example = " ", description = "Input Description...")
private String msuUserid;
@Schema(required = false, title = "결과코드", example = " ", description = "Input Description...")
private String msuResult;
@Schema(required = true, title = "팀코드", example = " ", description = "Input Description...")
private String msuTeam;
@Schema(required = false, title = "단속시간", example = " ", description = "Input Description...")
private String name;
}

@ -61,6 +61,7 @@ public interface IResidentAndDisabledService {
* @return Map
*/
Map<String,Object> findJudgeResults(final JudgeListDto dto);
Map<String,Object> findJudgeResults2(final JudgeListDto dto);
/**
* /

@ -240,6 +240,57 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
return resultMap;
}
@Override
@Transactional(readOnly = true)
public Map<String,Object> findJudgeResults2(JudgeListDto dto) {
Map<String, Object> resultMap = new HashMap<>();
// team && 팀별 부과현황 조회 : 팀이 선택되지 않은 경우 모두
// Map<String, Object> teamMap = residentAndDisabledMapper.selectTotJudgeResultGroupByTeamAndChasu(dto);
// if (Checks.isEmpty(teamMap)) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND);
// List<Map<String, Object>> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto);
// totJudgeUserList.add(teamMap);
List<Map<String, Object>> teamList = residentAndDisabledMapper.selectJudgeTeamGroupByChasuAndTeamList(dto);
if (Checks.isEmpty(teamList) || teamList.size() == 0) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND);
// 차수별 심사자별 심사결과 합산
dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam")));
List<Map<String, Object>> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto);
totJudgeUserList.add(teamList.get(0));
// 심사대상 차량 목록
List<Map<String,Object>> judgeCarList = residentAndDisabledMapper.selectJudgeResultGroupByCarnum(dto);
// 차량별 심사자 심사결과 목록
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("msDatagb", dto.getMsDatagb());
paramMap.put("msChasu", dto.getMsChasu());
paramMap.put("msSdate", dto.getMsSdate());
paramMap.put("msEdate", dto.getMsEdate());
paramMap.put("msuTeam", dto.getMsuTeam());
paramMap.put("seqList", judgeCarList.stream().map(m -> m.get("msSeq")).collect(Collectors.toList()));
paramMap.put("carnumList", judgeCarList.stream().map(m -> m.get("msCarnum")).collect(Collectors.toList()));
List<Map<String,Object>> jurgeUserList = residentAndDisabledMapper.selectJudgeResultList(paramMap);
// List<Map<String,Object>> resultList = judgeCarList.stream().peek((m) -> {
// paramMap.put("msSeq", m.get("msSeq"));
// paramMap.put("msCarnum", m.get("msCarnum"));
// m.put("simsa", residentAndDisabledMapper.selectJudgeResultList(paramMap));
// }).collect(Collectors.toList());
resultMap.put("teamList", teamList);
// 차수별 심사자별 심사결과 합산
resultMap.put("totJudgeUserData", totJudgeUserList);
// 심사대상 차량 목록
resultMap.put("judgeCarData", judgeCarList);
// 차량별 심사자 심사결과 목록
resultMap.put("judgeUserData", jurgeUserList);
return resultMap;
}
/**
*
* 1. : min_simsa680_sc : ms_datagb, ms_chasu, ms_sdate, ms_edate ms_maincode

@ -0,0 +1,29 @@
package com.xit.core.config.support;
import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JasyptConfig {
@Bean(name = "jasyptStringEncryptor")
public StringEncryptor stringEncryptor() {
String key = "xit_jasypt_key";
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
config.setPassword(key); // 암호화할 때 사용하는 키
config.setAlgorithm("PBEWithMD5AndDES"); // 암호화 알고리즘
config.setKeyObtentionIterations("1000"); // 반복할 해싱 회수
config.setPoolSize("1"); // 인스턴스 pool
config.setProviderName("SunJCE");
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator"); // salt 생성 클래스
config.setStringOutputType("base64"); //인코딩 방식
encryptor.setConfig(config);
return encryptor;
}
}

@ -1,6 +1,7 @@
package com.xit.core.init;
import lombok.extern.slf4j.Slf4j;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.springframework.boot.CommandLineRunner;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.DelegatingPasswordEncoder;
@ -22,10 +23,27 @@ public class XitFrameworkApplicationCommandLineRunner implements CommandLineRunn
log.info("XitFrameworkApplicationCommandLineRunner Args: " + Arrays.toString(args));
log.info("=====================================================================================");
System.out.println(new BCryptPasswordEncoder().encode("gnadmin"));
//System.out.println(new BCryptPasswordEncoder().encode("gnadmin"));
//System.out.println(new SCryptPasswordEncoder().encode("gnadmin"));
//System.out.println(new DelegatingPasswordEncoder().encode("gnadmin", ""));
System.out.println(new Pbkdf2PasswordEncoder().encode("gnadmin"));
//System.out.println(new Pbkdf2PasswordEncoder().encode("gnadmin"));
String url = "jdbc:oracle:thin:@211.119.124.118:1521:bustms";
String username = "traffic";
String password = "xhdgkq0";
System.out.println(jasyptEncoding(url));
System.out.println(jasyptEncoding(username));
System.out.println(jasyptEncoding(password));
}
private String jasyptEncoding(String value) {
String key = "xit_jasypt_key";
StandardPBEStringEncryptor pbeEnc = new StandardPBEStringEncryptor();
pbeEnc.setAlgorithm("PBEWithMD5AndDES");
pbeEnc.setPassword(key);
return pbeEnc.encrypt(value);
}
}

@ -18,9 +18,12 @@ spring:
# ==================================================================================================================
datasource:
driver-class-name: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:@211.119.124.118:1521:bustms
username: traffic
password: xhdgkq0
# url: jdbc:oracle:thin:@211.119.124.118:1521:bustms
# username: traffic
# password: xhdgkq0
url: ENC(Du4NMmmioRvKPEusb8MiTTvNaXVoTItupOvD6qDhkeJv8vJKgdQuYR1pfx6EiejdZxw42ihrilk=)
username: ENC(MtR2JPkVe/qAf4+4ov5Oaw==)
password: ENC(6DJ2lcMsftlVjv1Ddc4d2w==)
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}

@ -128,6 +128,10 @@ spring:
livereload:
enabled: true
jasypt:
encryptor:
bean: jasyptStringEncryptor
# ==================================================================================================================
# spring-doc setting
# ==================================================================================================================

@ -46,7 +46,13 @@
<select id="selectTotParkingJudgeResultGroupByTeamAndChasu" parameterType="com.xit.biz.ctgy.dto.JudgeListDto" resultType="camelCaseLinkedMap">
/* parking-mapper|selectTotParkingJudgeResultGroupByTeamAndChasu|julim */
SELECT NVL(SUM(DECODE(MS.ms_result, '2', 1, 0)), 0) bu
SELECT <if test='msuTeam != null and msuTeam != ""'>
MV.msu_team
</if>
<if test='msuTeam == null or msuTeam == ""'>
''
</if>
, NVL(SUM(DECODE(MS.ms_result, '2', 1, 0)), 0) bu
, 0 as seo
, NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu
, NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot
@ -58,9 +64,9 @@
AND MV.msu_team = #{msuTeam}
</if>
AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate &gt;= #{msSdate}
AND MS.ms_edate &lt;= #{msEdate}
GROUP BY MS.ms_chasu
AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate}
GROUP BY MV.msu_team, MS.ms_chasu
</select>
<select id="selectParkingJudgeTeamGroupByChasuAndTeamList" parameterType="com.xit.biz.ctgy.dto.JudgeListDto" resultType="camelCaseLinkedMap">
@ -78,8 +84,8 @@
AND MV.msu_team = #{msuTeam}
</if>
AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate &gt;= #{msSdate}
AND MS.ms_edate &lt;= #{msEdate}
AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate}
GROUP BY MS.ms_chasu, MV.msu_team
ORDER BY MS.ms_chasu, MV.msu_team
</select>
@ -96,8 +102,8 @@
, min_userinfo MU
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate &gt;= #{msSdate}
AND MS.ms_edate &lt;= #{msEdate}
AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate}
AND MSU.msu_userid = MU.userid
<if test='msuTeam != null and msuTeam != ""'>
AND MSU.msu_team = #{msuTeam}
@ -115,12 +121,13 @@
, min_simsa_user680 MSU
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate &gt;= #{msSdate}
AND MS.ms_edate &lt;= #{msEdate}
AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate}
<if test='msuTeam != null and msuTeam != ""'>
AND MSU.msu_team = #{msuTeam}
</if>
GROUP BY MS.ms_maincode, MS.ms_seq, MS.ms_carnum
ORDER BY MS.ms_maincode, MS.ms_seq, MS.ms_carnum
</select>
<select id="selectParkingJudgeResultList" parameterType="map" resultType="camelCaseLinkedMap">
@ -147,8 +154,8 @@
, min_userinfo MU
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate &gt;= #{msSdate}
AND MS.ms_edate &lt;= #{msEdate}
AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate}
AND MS.ms_seq in (
<foreach collection="seqList" item="seq" separator=",">
#{seq}
@ -163,7 +170,7 @@
AND MSU.msu_team = #{msuTeam}
</if>
AND MSU.msu_userid = MU.userid
ORDER BY MSU.msu_userid, MU.name, MS.ms_seq, MS.ms_carnum
ORDER BY MSU.msu_userid, MU.name, MS.ms_maincode, MS.ms_seq, MS.ms_carnum
</select>
<!--
<select id="selectParkingJudgeResultList2" parameterType="map" resultType="camelCaseLinkedMap">

@ -63,8 +63,8 @@
</if>
AND MSS.ms_datagb = #{msDatagb}
AND MSS.ms_chasu = #{msChasu}
AND MSS.ms_sdate &gt;= #{msSdate}
AND MSS.ms_edate &lt;= #{msEdate}
AND MSS.ms_sdate = #{msSdate}
AND MSS.ms_edate = #{msEdate}
GROUP BY MSV.msu_team, MSS.ms_chasu
</select>
@ -83,8 +83,8 @@
AND MSV.msu_team = #{msuTeam}
</if>
AND MSS.ms_chasu = #{msChasu}
AND MSS.ms_sdate &gt;= #{msSdate}
AND MSS.ms_edate &lt;= #{msEdate}
AND MSS.ms_sdate = #{msSdate}
AND MSS.ms_edate = #{msEdate}
GROUP BY MSS.ms_chasu, MSV.msu_team
ORDER BY MSS.ms_chasu, MSV.msu_team
</select>
@ -102,8 +102,8 @@
WHERE MSS.ms_maincode = MSU.msu_maincode
AND MSS.ms_datagb = #{msDatagb}
AND MSS.ms_chasu = #{msChasu}
AND MSS.ms_sdate &gt;= #{msSdate}
AND MSS.ms_edate &lt;= #{msEdate}
AND MSS.ms_sdate = #{msSdate}
AND MSS.ms_edate = #{msEdate}
AND MSU.msu_userid = MU.userid
<if test='msuTeam != null and msuTeam != ""'>
AND MSU.msu_team = #{msuTeam}
@ -122,8 +122,8 @@
WHERE MSS.ms_maincode = MSU.msu_maincode
AND MSS.ms_datagb = #{msDatagb}
AND MSS.ms_chasu = #{msChasu}
AND MSS.ms_sdate &gt;= #{msSdate}
AND MSS.ms_edate &lt;= #{msEdate}
AND MSS.ms_sdate = #{msSdate}
AND MSS.ms_edate = #{msEdate}
<if test='msuTeam != null and msuTeam != ""'>
AND MSU.msu_team = #{msuTeam}
</if>
@ -156,8 +156,8 @@
WHERE MSS.ms_maincode = MSU.msu_maincode
AND MSS.ms_datagb = #{msDatagb}
AND MSS.ms_chasu = #{msChasu}
AND MSS.ms_sdate &gt;= #{msSdate}
AND MSS.ms_edate &lt;= #{msEdate}
AND MSS.ms_sdate = #{msSdate}
AND MSS.ms_edate = #{msEdate}
AND MSS.ms_seq in (
<foreach collection="seqList" item="seq" separator=",">
#{seq}

@ -0,0 +1,36 @@
package com.xit.core;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
@SpringBootTest
@ActiveProfiles(value="dev")
class JasyptApplicationTests {
@Test
void contextLoads() {
}
@Test
void jasypt() {
String url = "jdbc:oracle:thin:@211.119.124.118:1521:bustms";
String username = "traffic";
String password = "xhdgkq0";
System.out.println(jasyptEncoding(url));
System.out.println(jasyptEncoding(username));
System.out.println(jasyptEncoding(password));
}
public String jasyptEncoding(String value) {
String key = "xit_jasypt_key";
StandardPBEStringEncryptor pbeEnc = new StandardPBEStringEncryptor();
pbeEnc.setAlgorithm("PBEWithMD5AndDES");
pbeEnc.setPassword(key);
return pbeEnc.encrypt(value);
}
}
Loading…
Cancel
Save