fix: 심사결과 반영

dev
minuk926 3 years ago
parent 00694c3572
commit 4d144db227

@ -46,4 +46,5 @@ public interface IParkingMapper {
* @return List<Map> * @return List<Map>
*/ */
List<Map<String,Object>> selectParkingJudgeResultList(Map<String,Object> map); List<Map<String,Object>> selectParkingJudgeResultList(Map<String,Object> map);
List<Map<String,Object>> selectParkingJudgeResultList2(Map<String,Object> map);
} }

@ -46,4 +46,5 @@ public interface IResidentAndDisabledMapper {
* @return List<Map> * @return List<Map>
*/ */
List<Map<String,Object>> selectJudgeResultList(Map<String,Object> map); List<Map<String,Object>> selectJudgeResultList(Map<String,Object> map);
List<Map<String,Object>> selectJudgeResultList2(Map<String,Object> map);
} }

@ -65,33 +65,39 @@ public class ParkingService implements IParkingService {
List<Map<String, Object>> teamList = mapper.selectParkingJudgeTeamGroupByChasuAndTeamList(dto); List<Map<String, Object>> teamList = mapper.selectParkingJudgeTeamGroupByChasuAndTeamList(dto);
if (Checks.isEmpty(teamList) || teamList.size() == 0) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND); if (Checks.isEmpty(teamList) || teamList.size() == 0) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND);
// 차수별 심사자별 심사결과 합산
dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam"))); dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam")));
List<Map<String, Object>> totJudgeUserList = mapper.selectTotParkingJudgeResultGroupByUser(dto); List<Map<String, Object>> totJudgeUserList = mapper.selectTotParkingJudgeResultGroupByUser(dto);
totJudgeUserList.add(teamList.get(0)); totJudgeUserList.add(teamList.get(0));
// 심사대상 차량 목록
List<Map<String,Object>> judgeCarList = mapper.selectParkingJurgeResultGroupByCarnum(dto); List<Map<String,Object>> judgeCarList = mapper.selectParkingJurgeResultGroupByCarnum(dto);
// 차량별 심사자 심사결과 목록
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("msDatagb", dto.getMsDatagb()); paramMap.put("msDatagb", dto.getMsDatagb());
paramMap.put("msChasu", dto.getMsChasu()); paramMap.put("msChasu", dto.getMsChasu());
paramMap.put("msSdate", dto.getMsSdate()); paramMap.put("msSdate", dto.getMsSdate());
paramMap.put("msEdate", dto.getMsEdate()); paramMap.put("msEdate", dto.getMsEdate());
paramMap.put("msuTeam", dto.getMsuTeam()); paramMap.put("msuTeam", dto.getMsuTeam());
paramMap.put("seqList", judgeCarList.stream().map(m -> m.get("msSeq")).collect(Collectors.toList()));
List<Map<String,Object>> resultList = judgeCarList.stream().peek((m) -> { paramMap.put("carnumList", judgeCarList.stream().map(m -> m.get("msCarnum")).collect(Collectors.toList()));
paramMap.put("msSeq", m.get("msSeq"));
paramMap.put("msCarnum", m.get("msCarnum")); List<Map<String,Object>> jurgeUserList = mapper.selectParkingJudgeResultList(paramMap);
m.put("simsa", mapper.selectParkingJudgeResultList(paramMap)); // List<Map<String,Object>> resultList = judgeCarList.stream().peek((m) -> {
// Map<String,Object> usersMap = mapper.selectJudgeResultByCarnum(paramMap) // paramMap.put("msSeq", m.get("msSeq"));
// .stream() // paramMap.put("msCarnum", m.get("msCarnum"));
// .reduce((preMap, curMap) -> { // m.put("simsa", mapper.selectParkingJudgeResultList(paramMap));
// preMap.putAll(curMap); // }).collect(Collectors.toList());
// return preMap;
// }).orElse(null); resultMap.put("teamList", teamList);
// m.putAll(usersMap); // 차수별 심사자별 심사결과 합산
}).collect(Collectors.toList()); resultMap.put("totJudgeUserData", totJudgeUserList);
// 심사대상 차량 목록
resultMap.put("totData", totJudgeUserList); resultMap.put("judgeCarData", judgeCarList);
resultMap.put("judgeData", resultList); // 차량별 심사자 심사결과 목록
resultMap.put("judgeUserData", jurgeUserList);
return resultMap; return resultMap;
} }

@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.persistence.EntityManager;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.File; import java.io.File;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
@ -62,6 +63,8 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
private final IResidentAndDisabledMapper residentAndDisabledMapper; private final IResidentAndDisabledMapper residentAndDisabledMapper;
private final EntityManager entityManager;
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Page<GnRecallScDto> findJudgeDatas(@NotNull final String scDatagb, Pageable pageable) { public Page<GnRecallScDto> findJudgeDatas(@NotNull final String scDatagb, Pageable pageable) {
@ -191,11 +194,16 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
List<Map<String, Object>> teamList = residentAndDisabledMapper.selectJudgeTeamGroupByChasuAndTeamList(dto); List<Map<String, Object>> teamList = residentAndDisabledMapper.selectJudgeTeamGroupByChasuAndTeamList(dto);
if (Checks.isEmpty(teamList) || teamList.size() == 0) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND); if (Checks.isEmpty(teamList) || teamList.size() == 0) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND);
// 차수별 심사자별 심사결과 합산
dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam"))); dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam")));
List<Map<String, Object>> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto); List<Map<String, Object>> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto);
totJudgeUserList.add(teamList.get(0)); totJudgeUserList.add(teamList.get(0));
// 심사대상 차량 목록
List<Map<String,Object>> judgeCarList = residentAndDisabledMapper.selectJudgeResultGroupByCarnum(dto); List<Map<String,Object>> judgeCarList = residentAndDisabledMapper.selectJudgeResultGroupByCarnum(dto);
// 차량별 심사자 심사결과 목록
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("msDatagb", dto.getMsDatagb()); paramMap.put("msDatagb", dto.getMsDatagb());
paramMap.put("msChasu", dto.getMsChasu()); paramMap.put("msChasu", dto.getMsChasu());
@ -203,22 +211,24 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
paramMap.put("msEdate", dto.getMsEdate()); paramMap.put("msEdate", dto.getMsEdate());
paramMap.put("msuTeam", dto.getMsuTeam()); paramMap.put("msuTeam", dto.getMsuTeam());
List<Map<String,Object>> resultList = judgeCarList.stream().peek((m) -> { paramMap.put("seqList", judgeCarList.stream().map(m -> m.get("msSeq")).collect(Collectors.toList()));
paramMap.put("msSeq", m.get("msSeq")); paramMap.put("carnumList", judgeCarList.stream().map(m -> m.get("msCarnum")).collect(Collectors.toList()));
paramMap.put("msCarnum", m.get("msCarnum")); List<Map<String,Object>> jurgeUserList = residentAndDisabledMapper.selectJudgeResultList(paramMap);
m.put("simsa", residentAndDisabledMapper.selectJudgeResultList(paramMap));
// Map<String,Object> usersMap = mapper.selectJudgeResultByCarnum(paramMap) // List<Map<String,Object>> resultList = judgeCarList.stream().peek((m) -> {
// .stream() // paramMap.put("msSeq", m.get("msSeq"));
// .reduce((preMap, curMap) -> { // paramMap.put("msCarnum", m.get("msCarnum"));
// preMap.putAll(curMap); // m.put("simsa", residentAndDisabledMapper.selectJudgeResultList(paramMap));
// return preMap; // }).collect(Collectors.toList());
// }).orElse(null);
// m.putAll(usersMap);
}).collect(Collectors.toList());
resultMap.put("totData", totJudgeUserList);
resultMap.put("judgeData", resultList);
resultMap.put("teamList", teamList);
// 차수별 심사자별 심사결과 합산
resultMap.put("totJudgeUserData", totJudgeUserList);
// 심사대상 차량 목록
resultMap.put("judgeCarData", judgeCarList);
// 차량별 심사자 심사결과 목록
resultMap.put("judgeUserData", jurgeUserList);
return resultMap; return resultMap;
} }
} }

@ -49,8 +49,8 @@
, NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu , NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu
, NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot , NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot
, '결과' as name , '결과' as name
FROM min_simsa680 MS, FROM min_simsa680 MS
msu680_view MV , msu680_view MV
WHERE MS.ms_maincode = MV.msu_maincode WHERE MS.ms_maincode = MV.msu_maincode
<if test='msuTeam != null and msuTeam != ""'> <if test='msuTeam != null and msuTeam != ""'>
AND MV.msu_team = #{msuTeam} AND MV.msu_team = #{msuTeam}
@ -69,8 +69,8 @@
, NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu , NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu
, NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot , NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot
, '결과' as name , '결과' as name
FROM min_simsa680 MS, FROM min_simsa680 MS
msu680_view MV , msu680_view MV
WHERE MS.ms_maincode = MV.msu_maincode WHERE MS.ms_maincode = MV.msu_maincode
<if test='msuTeam != null and msuTeam != ""'> <if test='msuTeam != null and msuTeam != ""'>
AND MV.msu_team = #{msuTeam} AND MV.msu_team = #{msuTeam}
@ -89,19 +89,19 @@
, SUM(DECODE(MSU_RESULT, '1', 1, 0)) mibu , SUM(DECODE(MSU_RESULT, '1', 1, 0)) mibu
, SUM(DECODE(MSU_RESULT, '1', 1, '2', 1, 0)) tot , SUM(DECODE(MSU_RESULT, '1', 1, '2', 1, 0)) tot
, MU.name , MU.name
FROM min_simsa680 MS, FROM min_simsa680 MS
min_simsa_user680 MSU, , min_simsa_user680 MSU
min_userinfo MU , min_userinfo MU
WHERE MS.ms_maincode = MSU.msu_maincode WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_chasu = #{msChasu} AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate &gt;= #{msSdate} AND MS.ms_sdate &gt;= #{msSdate}
AND MS.ms_edate &lt;= #{msEdate} AND MS.ms_edate &lt;= #{msEdate}
AND MSU.msu_userid = MU.userid AND MSU.msu_userid = MU.userid
<if test='msuTeam != null and msuTeam != ""'> <if test='msuTeam != null and msuTeam != ""'>
AND MSU.msu_team = #{msuTeam} AND MSU.msu_team = #{msuTeam}
</if> </if>
GROUP BY MSU.msu_userid, MU.name GROUP BY MSU.msu_userid, MU.name
ORDER BY MSU.msu_userid, MU.name ORDER BY MSU.msu_userid, MU.name
</select> </select>
<select id="selectParkingJurgeResultGroupByCarnum" parameterType="com.xit.biz.ctgy.dto.JudgeListDto" resultType="camelCaseLinkedMap"> <select id="selectParkingJurgeResultGroupByCarnum" parameterType="com.xit.biz.ctgy.dto.JudgeListDto" resultType="camelCaseLinkedMap">
@ -109,8 +109,8 @@
SELECT MS.ms_maincode SELECT MS.ms_maincode
, MS.ms_seq , MS.ms_seq
, MS.ms_carnum , MS.ms_carnum
FROM min_simsa680 MS, FROM min_simsa680 MS
min_simsa_user680 MSU , min_simsa_user680 MSU
WHERE MS.ms_maincode = MSU.msu_maincode WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_chasu = #{msChasu} AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate &gt;= #{msSdate} AND MS.ms_sdate &gt;= #{msSdate}
@ -122,6 +122,48 @@
</select> </select>
<select id="selectParkingJudgeResultList" parameterType="map" resultType="camelCaseLinkedMap"> <select id="selectParkingJudgeResultList" parameterType="map" resultType="camelCaseLinkedMap">
/* parking-mapper|selectParkingJudgeResultList|julim */
SELECT MS.ms_maincode
, MS.ms_seq
, MS.ms_carnum
, MU.name
, (SELECT code_nm
FROM tb_cmm_code_s
WHERE code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT'
AND code_cd = MS.ms_result) as ms_result
, (SELECT code_nm
FROM tb_cmm_code_s
WHERE code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT'
AND code_cd = MSU.msu_result) as msu_result
FROM min_simsa680 MS
, min_simsa_user680 MSU
, 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_seq in (
<foreach collection="seqList" item="seq" separator=",">
#{seq}
</foreach>
)
AND MS.ms_carnum in (
<foreach collection="carnumList" item="carnum" separator=",">
#{carnum}
</foreach>
)
<if test='msuTeam != null and msuTeam != ""'>
AND MSU.msu_team = #{msuTeam}
</if>
AND MSU.msu_userid = MU.userid
ORDER BY MSU.msu_userid, MU.name
</select>
<select id="selectParkingJudgeResultList2" parameterType="map" resultType="camelCaseLinkedMap">
/* parking-mapper|selectParkingJudgeResultList|julim */ /* parking-mapper|selectParkingJudgeResultList|julim */
SELECT MS.ms_maincode SELECT MS.ms_maincode
, MS.ms_seq , MS.ms_seq
@ -139,9 +181,9 @@
AND code_lcd = 'GANGNAM_SIMSA' AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT' AND code_mcd = 'RESULT'
AND code_cd = MSU.msu_result) as msu_result AND code_cd = MSU.msu_result) as msu_result
FROM min_simsa680 MS, FROM min_simsa680 MS
min_simsa_user680 MSU, , min_simsa_user680 MSU
min_userinfo MU , min_userinfo MU
WHERE MS.ms_maincode = MSU.msu_maincode WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_chasu = #{msChasu} AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate &gt;= #{msSdate} AND MS.ms_sdate &gt;= #{msSdate}

@ -53,8 +53,8 @@
, NVL(SUM(DECODE(MSS.ms_result, '1', 1, 0)), 0) mibu , NVL(SUM(DECODE(MSS.ms_result, '1', 1, 0)), 0) mibu
, NVL(SUM(DECODE(MSS.ms_result, '1', 1, '2', 1, 0)), 0) tot , NVL(SUM(DECODE(MSS.ms_result, '1', 1, '2', 1, 0)), 0) tot
, '결과' as name , '결과' as name
FROM min_simsa680_sc MSS, FROM min_simsa680_sc MSS
msu680_sc_view MSV , msu680_sc_view MSV
WHERE MSS.ms_maincode = MSV.msu_maincode WHERE MSS.ms_maincode = MSV.msu_maincode
<if test='msuTeam != null and msuTeam != ""'> <if test='msuTeam != null and msuTeam != ""'>
AND MSV.msu_team = #{msuTeam} AND MSV.msu_team = #{msuTeam}
@ -74,8 +74,8 @@
, NVL(SUM(DECODE(MSS.ms_result, '1', 1, 0)), 0) mibu , NVL(SUM(DECODE(MSS.ms_result, '1', 1, 0)), 0) mibu
, NVL(SUM(DECODE(MSS.ms_result, '1', 1, '2', 1, 0)), 0) tot , NVL(SUM(DECODE(MSS.ms_result, '1', 1, '2', 1, 0)), 0) tot
, '결과' as name , '결과' as name
FROM min_simsa680_sc MSS, FROM min_simsa680_sc MSS
msu680_sc_view MSV , msu680_sc_view MSV
WHERE MSS.ms_maincode = MSV.msu_maincode WHERE MSS.ms_maincode = MSV.msu_maincode
<if test='msuTeam != null and msuTeam != ""'> <if test='msuTeam != null and msuTeam != ""'>
AND MSV.msu_team = #{msuTeam} AND MSV.msu_team = #{msuTeam}
@ -94,9 +94,9 @@
, SUM(DECODE(MSU_RESULT, '1', 1, 0)) mibu , SUM(DECODE(MSU_RESULT, '1', 1, 0)) mibu
, SUM(DECODE(MSU_RESULT, '1', 1, '2', 1, 0)) tot , SUM(DECODE(MSU_RESULT, '1', 1, '2', 1, 0)) tot
, MU.name , MU.name
FROM min_simsa680_sc MSS, FROM min_simsa680_sc MSS
min_simsa_user680_sc MSU, , min_simsa_user680_sc MSU
min_userinfo MU , min_userinfo MU
WHERE MSS.ms_maincode = MSU.msu_maincode WHERE MSS.ms_maincode = MSU.msu_maincode
AND MSS.ms_datagb = #{msDatagb} AND MSS.ms_datagb = #{msDatagb}
AND MSS.ms_chasu = #{msChasu} AND MSS.ms_chasu = #{msChasu}
@ -115,20 +115,64 @@
SELECT MSS.ms_maincode SELECT MSS.ms_maincode
, MSS.ms_seq , MSS.ms_seq
, MSS.ms_carnum , MSS.ms_carnum
FROM min_simsa680_sc MSS, FROM min_simsa680_sc MSS
min_simsa_user680_sc MSU , min_simsa_user680_sc MSU
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}
<if test='msuTeam != null and msuTeam != ""'>
AND MSU.msu_team = #{msuTeam}
</if>
GROUP BY MSS.ms_maincode, MSS.ms_seq, MSS.ms_carnum
ORDER BY MSS.ms_maincode, MSS.ms_seq, MSS.ms_carnum
</select>
<select id="selectJudgeResultList" parameterType="map" resultType="camelCaseLinkedMap">
/* residentanddisabled-mapper|selectJudgeResultList2|julim */
SELECT MSS.ms_maincode
, MSS.ms_seq
, MSS.ms_carnum
, MU.name
, (SELECT code_nm
FROM tb_cmm_code_s
WHERE code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT'
AND code_cd = MSS.ms_result) as ms_result
, (SELECT code_nm
FROM tb_cmm_code_s
WHERE code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT'
AND code_cd = MSU.msu_result) as msu_result
FROM min_simsa680_sc MSS
, min_simsa_user680_sc MSU
, min_userinfo MU
WHERE MSS.ms_maincode = MSU.msu_maincode WHERE MSS.ms_maincode = MSU.msu_maincode
AND MSS.ms_datagb = #{msDatagb} AND MSS.ms_datagb = #{msDatagb}
AND MSS.ms_chasu = #{msChasu} AND MSS.ms_chasu = #{msChasu}
AND MSS.ms_sdate &gt;= #{msSdate} AND MSS.ms_sdate &gt;= #{msSdate}
AND MSS.ms_edate &lt;= #{msEdate} AND MSS.ms_edate &lt;= #{msEdate}
AND MSS.ms_seq in (
<foreach collection="seqList" item="seq" separator=",">
#{seq}
</foreach>
)
AND MSS.ms_carnum in (
<foreach collection="carnumList" item="carnum" separator=",">
#{carnum}
</foreach>
)
<if test='msuTeam != null and msuTeam != ""'> <if test='msuTeam != null and msuTeam != ""'>
AND MSU.msu_team = #{msuTeam} AND MSU.msu_team = #{msuTeam}
</if> </if>
GROUP BY MSS.ms_maincode, MSS.ms_seq, MSS.ms_carnum AND MSU.msu_userid = MU.userid
ORDER BY MSU.msu_userid, MU.name, MSS.ms_maincode, MSS.ms_seq, MSS.ms_carnum
</select> </select>
<select id="selectJudgeResultList" parameterType="map" resultType="camelCaseLinkedMap"> <select id="selectJudgeResultList2" parameterType="map" resultType="camelCaseLinkedMap">
/* residentanddisabled-mapper|selectJudgeResultList|julim */ /* residentanddisabled-mapper|selectJudgeResultList|julim */
SELECT MSS.ms_maincode SELECT MSS.ms_maincode
, MSS.ms_seq , MSS.ms_seq
@ -146,9 +190,9 @@
AND code_lcd = 'GANGNAM_SIMSA' AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT' AND code_mcd = 'RESULT'
AND code_cd = MSU.msu_result) as msu_result AND code_cd = MSU.msu_result) as msu_result
FROM min_simsa680_sc MSS, FROM min_simsa680_sc MSS
min_simsa_user680_sc MSU, , min_simsa_user680_sc MSU
min_userinfo MU , min_userinfo MU
WHERE MSS.ms_maincode = MSU.msu_maincode WHERE MSS.ms_maincode = MSU.msu_maincode
AND MSS.ms_datagb = #{msDatagb} AND MSS.ms_datagb = #{msDatagb}
AND MSS.ms_chasu = #{msChasu} AND MSS.ms_chasu = #{msChasu}
@ -160,6 +204,6 @@
AND MSU.msu_team = #{msuTeam} AND MSU.msu_team = #{msuTeam}
</if> </if>
AND MSU.msu_userid = MU.userid AND MSU.msu_userid = MU.userid
ORDER BY MSU.msu_userid, MU.name ORDER BY MSU.msu_userid, MU.name, MSS.ms_maincode, MSS.ms_seq, MSS.ms_carnum
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save