From 82ea5cda7894d0f344eb50838bc42a6fa17cb970 Mon Sep 17 00:00:00 2001 From: Lim Jonguk Date: Thu, 14 Apr 2022 02:13:25 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A3=BC=EC=A0=95=EC=B0=A8=20=EC=8B=AC?= =?UTF-8?q?=EC=9D=98=20=EC=83=81=EC=84=B8=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xit/biz/ctgy/entity/MinSimsa680.java | 2 +- .../xit/biz/ctgy/mapper/IParkingMapper.java | 31 +++++++ .../IResidentAndDisabledRepositoryImpl.java | 4 - .../xit/biz/ctgy/service/IParkingService.java | 12 ++- .../biz/ctgy/service/impl/ParkingService.java | 43 ++++++++- .../biz/ctgy/parking-mapper.xml | 87 +++++++++++++++++++ 6 files changed, 167 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java index b0af7a7..12280e9 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java @@ -56,7 +56,7 @@ public class MinSimsa680 { //implements Serializable { @Schema(required = true, title = "심사마감일시", example = " ", description = "Input Description...") @Column(name = "ms_cdate", nullable = false) - private java.sql.Date msCdate; + private LocalDate msCdate; @Schema(required = true, title = "심사마감시간", example = " ", description = "Input Description...") @Column(name = "ms_closesi", nullable = false) diff --git a/src/main/java/com/xit/biz/ctgy/mapper/IParkingMapper.java b/src/main/java/com/xit/biz/ctgy/mapper/IParkingMapper.java index 6c0cfc9..956801b 100644 --- a/src/main/java/com/xit/biz/ctgy/mapper/IParkingMapper.java +++ b/src/main/java/com/xit/biz/ctgy/mapper/IParkingMapper.java @@ -1,11 +1,42 @@ package com.xit.biz.ctgy.mapper; +import com.xit.biz.ctgy.dto.JudgeListDto; import com.xit.biz.ctgy.dto.ParkingTargetDto; import org.apache.ibatis.annotations.Mapper; +import java.util.List; +import java.util.Map; + @Mapper public interface IParkingMapper { void insertParkingJudgeTargetIntoSelect(ParkingTargetDto dto); + /** + * 팀 && 차수 별 total + * @param dto JudgeListDto + * @return Map + */ + Map selectTotByParkingJurgeTeamAndChasu(JudgeListDto dto); + + /** + * 팀 && 차수 별 심사위원 심사 결과 + * @param dto JudgeListDto + * @return List + */ + List> selectTotParkingUsersByJudgeTeamAndChasu(JudgeListDto dto); + + /** + * 심사대상 차량 정보 목록 + * @param dto JudgeListDto + * @return List + */ + List> selectParkingJurgeTargetByCarnum(JudgeListDto dto); + + /** + * 차량별 심사위원 심사결과 목록 + * @param map Map + * @return List + */ + List> selectParkingJudgeResultByCarnum(Map map); } diff --git a/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java b/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java index 687db33..01e31f6 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java @@ -12,8 +12,6 @@ import com.xit.biz.ctgy.dto.GnRecallScDto; import com.xit.biz.ctgy.dto.JudgeDetailDto; import com.xit.biz.ctgy.dto.JudgeListDto; import com.xit.biz.ctgy.dto.JudgeTargetDto; -import com.xit.biz.ctgy.entity.MinSimsa680; -import com.xit.biz.ctgy.entity.MinSimsa680Sc; import com.xit.core.util.Checks; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; @@ -26,9 +24,7 @@ import java.util.List; import static com.xit.biz.cmm.entity.QCmmCodeS.cmmCodeS; import static com.xit.biz.ctgy.entity.QGnRecallSc.gnRecallSc; -import static com.xit.biz.ctgy.entity.QMinSimsa680.minSimsa680; import static com.xit.biz.ctgy.entity.QMinSimsa680Sc.minSimsa680Sc; -import static com.xit.biz.ctgy.entity.QMinSimsaUser680.minSimsaUser680; import static com.xit.biz.ctgy.entity.QMinSimsaUser680Sc.minSimsaUser680Sc; import static com.xit.biz.ctgy.entity.QMinUserinfo.minUserinfo; diff --git a/src/main/java/com/xit/biz/ctgy/service/IParkingService.java b/src/main/java/com/xit/biz/ctgy/service/IParkingService.java index 441bf0f..8c31a8e 100644 --- a/src/main/java/com/xit/biz/ctgy/service/IParkingService.java +++ b/src/main/java/com/xit/biz/ctgy/service/IParkingService.java @@ -2,17 +2,23 @@ package com.xit.biz.ctgy.service; import com.xit.biz.ctgy.dto.JudgeListDto; import com.xit.biz.ctgy.dto.ParkingTargetDto; -import com.xit.biz.ctgy.entity.MinSimsa680; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import java.util.List; +import java.util.Map; public interface IParkingService { - //Page findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable); Page findParkings(final JudgeListDto dto, Pageable pageable); - List findParkingDetails(final JudgeListDto dto); + + /** + * 주정차 의견진술 심의등록 상세 목록 + * @param dto JudgeListDto + * @return Map + */ + Map findParkingDetails(final JudgeListDto dto); + List findParkingJudgeTargets(final ParkingTargetDto dto) ; // Page findAll(final MinSimsa680 minSimsa680, Pageable pageable); diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java b/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java index 82955a3..89d979f 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java @@ -3,7 +3,6 @@ package com.xit.biz.ctgy.service.impl; import com.xit.biz.ctgy.CtgyConstants; import com.xit.biz.ctgy.dto.JudgeListDto; import com.xit.biz.ctgy.dto.ParkingTargetDto; -import com.xit.biz.ctgy.entity.MinSimsa680; import com.xit.biz.ctgy.entity.MinSimsaUser680; import com.xit.biz.ctgy.entity.MinUserinfo; import com.xit.biz.ctgy.entity.Tf680Recall; @@ -13,13 +12,16 @@ import com.xit.biz.ctgy.service.IParkingService; import com.xit.core.constant.ErrorCode; import com.xit.core.exception.CustomBaseException; import com.xit.core.support.jpa.JpaUtil; +import com.xit.core.util.Checks; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; @Service @@ -52,9 +54,42 @@ public class ParkingService implements IParkingService { } @Override - @Transactional(readOnly = true) - public List findParkingDetails(final JudgeListDto dto) { - return repository.findParkingDetails(dto); + public Map findParkingDetails(JudgeListDto dto) { + Map resultMap = new HashMap<>(); + + // team && 팀별 부과현황 조회 + Map teamMap = mapper.selectTotByParkingJurgeTeamAndChasu(dto); + if(Checks.isEmpty(teamMap)) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND); + dto.setMsuTeam(String.valueOf(teamMap.get("msuTeam"))); + + List> totJudgeUserList = mapper.selectTotParkingUsersByJudgeTeamAndChasu(dto); + totJudgeUserList.add(teamMap); + + List> judgeCarList = mapper.selectParkingJurgeTargetByCarnum(dto); + Map 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> resultList = judgeCarList.stream().peek((m) -> { + paramMap.put("msSeq", m.get("msSeq")); + paramMap.put("msCarnum", m.get("msCarnum")); + m.put("simsa", mapper.selectParkingJudgeResultByCarnum(paramMap)); +// Map 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); + + return resultMap; } @Override diff --git a/src/main/resources/mybatis-mapper/biz/ctgy/parking-mapper.xml b/src/main/resources/mybatis-mapper/biz/ctgy/parking-mapper.xml index 419e1e5..b0bb77a 100644 --- a/src/main/resources/mybatis-mapper/biz/ctgy/parking-mapper.xml +++ b/src/main/resources/mybatis-mapper/biz/ctgy/parking-mapper.xml @@ -41,4 +41,91 @@ join tf680_dong TD on TJ.mj_dong = TD.do_code + + + + + + + + \ No newline at end of file