fix: 심사결과 fix

dev
Lim Jonguk 3 years ago
parent a95358f274
commit c15dda6b60

@ -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

@ -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}

Loading…
Cancel
Save