fix: 심사결과 반영

dev
minuk926 3 years ago
parent 00694c3572
commit 4d144db227

@ -46,4 +46,5 @@ public interface IParkingMapper {
* @return List<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>
*/
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);
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 = mapper.selectTotParkingJudgeResultGroupByUser(dto);
totJudgeUserList.add(teamList.get(0));
// 심사대상 차량 목록
List<Map<String,Object>> judgeCarList = mapper.selectParkingJurgeResultGroupByCarnum(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());
List<Map<String,Object>> resultList = judgeCarList.stream().peek((m) -> {
paramMap.put("msSeq", m.get("msSeq"));
paramMap.put("msCarnum", m.get("msCarnum"));
m.put("simsa", mapper.selectParkingJudgeResultList(paramMap));
// Map<String,Object> usersMap = mapper.selectJudgeResultByCarnum(paramMap)
// .stream()
// .reduce((preMap, curMap) -> {
// preMap.putAll(curMap);
// return preMap;
// }).orElse(null);
// m.putAll(usersMap);
}).collect(Collectors.toList());
resultMap.put("totData", totJudgeUserList);
resultMap.put("judgeData", resultList);
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 = mapper.selectParkingJudgeResultList(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", mapper.selectParkingJudgeResultList(paramMap));
// }).collect(Collectors.toList());
resultMap.put("teamList", teamList);
// 차수별 심사자별 심사결과 합산
resultMap.put("totJudgeUserData", totJudgeUserList);
// 심사대상 차량 목록
resultMap.put("judgeCarData", judgeCarList);
// 차량별 심사자 심사결과 목록
resultMap.put("judgeUserData", jurgeUserList);
return resultMap;
}

@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.persistence.EntityManager;
import javax.validation.constraints.NotNull;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
@ -62,6 +63,8 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
private final IResidentAndDisabledMapper residentAndDisabledMapper;
private final EntityManager entityManager;
@Override
@Transactional(readOnly = true)
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);
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());
@ -203,22 +211,24 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
paramMap.put("msEdate", dto.getMsEdate());
paramMap.put("msuTeam", dto.getMsuTeam());
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));
// Map<String,Object> usersMap = mapper.selectJudgeResultByCarnum(paramMap)
// .stream()
// .reduce((preMap, curMap) -> {
// preMap.putAll(curMap);
// return preMap;
// }).orElse(null);
// m.putAll(usersMap);
}).collect(Collectors.toList());
resultMap.put("totData", totJudgeUserList);
resultMap.put("judgeData", resultList);
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;
}
}

@ -49,8 +49,8 @@
, NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu
, NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot
, '결과' as name
FROM min_simsa680 MS,
msu680_view MV
FROM min_simsa680 MS
, msu680_view MV
WHERE MS.ms_maincode = MV.msu_maincode
<if test='msuTeam != null and 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, '2', 1, 0)), 0) tot
, '결과' as name
FROM min_simsa680 MS,
msu680_view MV
FROM min_simsa680 MS
, msu680_view MV
WHERE MS.ms_maincode = MV.msu_maincode
<if test='msuTeam != null and msuTeam != ""'>
AND MV.msu_team = #{msuTeam}
@ -89,19 +89,19 @@
, SUM(DECODE(MSU_RESULT, '1', 1, 0)) mibu
, SUM(DECODE(MSU_RESULT, '1', 1, '2', 1, 0)) tot
, MU.name
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 MSU.msu_userid = MU.userid
<if test='msuTeam != null and msuTeam != ""'>
AND MSU.msu_team = #{msuTeam}
</if>
GROUP BY MSU.msu_userid, MU.name
ORDER BY MSU.msu_userid, MU.name
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 MSU.msu_userid = MU.userid
<if test='msuTeam != null and msuTeam != ""'>
AND MSU.msu_team = #{msuTeam}
</if>
GROUP BY MSU.msu_userid, MU.name
ORDER BY MSU.msu_userid, MU.name
</select>
<select id="selectParkingJurgeResultGroupByCarnum" parameterType="com.xit.biz.ctgy.dto.JudgeListDto" resultType="camelCaseLinkedMap">
@ -109,8 +109,8 @@
SELECT MS.ms_maincode
, MS.ms_seq
, MS.ms_carnum
FROM min_simsa680 MS,
min_simsa_user680 MSU
FROM min_simsa680 MS
, min_simsa_user680 MSU
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate &gt;= #{msSdate}
@ -122,6 +122,48 @@
</select>
<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 */
SELECT MS.ms_maincode
, MS.ms_seq
@ -139,9 +181,9 @@
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
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}

@ -53,8 +53,8 @@
, NVL(SUM(DECODE(MSS.ms_result, '1', 1, 0)), 0) mibu
, NVL(SUM(DECODE(MSS.ms_result, '1', 1, '2', 1, 0)), 0) tot
, '결과' as name
FROM min_simsa680_sc MSS,
msu680_sc_view MSV
FROM min_simsa680_sc MSS
, msu680_sc_view MSV
WHERE MSS.ms_maincode = MSV.msu_maincode
<if test='msuTeam != null and 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, '2', 1, 0)), 0) tot
, '결과' as name
FROM min_simsa680_sc MSS,
msu680_sc_view MSV
FROM min_simsa680_sc MSS
, msu680_sc_view MSV
WHERE MSS.ms_maincode = MSV.msu_maincode
<if test='msuTeam != null and msuTeam != ""'>
AND MSV.msu_team = #{msuTeam}
@ -94,9 +94,9 @@
, SUM(DECODE(MSU_RESULT, '1', 1, 0)) mibu
, SUM(DECODE(MSU_RESULT, '1', 1, '2', 1, 0)) tot
, MU.name
FROM min_simsa680_sc MSS,
min_simsa_user680_sc MSU,
min_userinfo MU
FROM min_simsa680_sc MSS
, min_simsa_user680_sc MSU
, min_userinfo MU
WHERE MSS.ms_maincode = MSU.msu_maincode
AND MSS.ms_datagb = #{msDatagb}
AND MSS.ms_chasu = #{msChasu}
@ -115,20 +115,64 @@
SELECT MSS.ms_maincode
, MSS.ms_seq
, MSS.ms_carnum
FROM min_simsa680_sc MSS,
min_simsa_user680_sc MSU
FROM min_simsa680_sc MSS
, 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
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_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 != ""'>
AND MSU.msu_team = #{msuTeam}
</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 id="selectJudgeResultList" parameterType="map" resultType="camelCaseLinkedMap">
<select id="selectJudgeResultList2" parameterType="map" resultType="camelCaseLinkedMap">
/* residentanddisabled-mapper|selectJudgeResultList|julim */
SELECT MSS.ms_maincode
, MSS.ms_seq
@ -146,9 +190,9 @@
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
FROM min_simsa680_sc MSS
, min_simsa_user680_sc MSU
, min_userinfo MU
WHERE MSS.ms_maincode = MSU.msu_maincode
AND MSS.ms_datagb = #{msDatagb}
AND MSS.ms_chasu = #{msChasu}
@ -160,6 +204,6 @@
AND MSU.msu_team = #{msuTeam}
</if>
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>
</mapper>
Loading…
Cancel
Save