|
|
|
@ -6,11 +6,14 @@ import com.xit.biz.ctgy.dto.GnRecallScDto;
|
|
|
|
|
import com.xit.biz.ctgy.dto.JudgeListDto;
|
|
|
|
|
import com.xit.biz.ctgy.dto.JudgeStdDto;
|
|
|
|
|
import com.xit.biz.ctgy.dto.JudgeTargetDto;
|
|
|
|
|
import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct;
|
|
|
|
|
import com.xit.biz.ctgy.entity.GnRecallSc;
|
|
|
|
|
import com.xit.biz.ctgy.entity.MinInfoBoard680;
|
|
|
|
|
import com.xit.biz.ctgy.entity.MinSimsaUser680Sc;
|
|
|
|
|
import com.xit.biz.ctgy.entity.MinUserinfo;
|
|
|
|
|
import com.xit.biz.ctgy.mapper.IParkingMapper;
|
|
|
|
|
import com.xit.biz.ctgy.mapper.IResidentAndDisabledMapper;
|
|
|
|
|
import com.xit.biz.ctgy.repository.*;
|
|
|
|
|
import com.xit.biz.ctgy.service.IPublicBoardService;
|
|
|
|
|
import com.xit.biz.ctgy.v2.service.IResidentAndDisabledService;
|
|
|
|
|
import com.xit.core.constant.ErrorCode;
|
|
|
|
@ -54,6 +57,16 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
|
|
|
|
|
@Value("${file.cmm.upload.simsaPath:[simUpFile_sc1]}")
|
|
|
|
|
private String[] uploadPath;
|
|
|
|
|
|
|
|
|
|
private final GnRecallScMapstruct mapstruct = Mappers.getMapper(GnRecallScMapstruct.class);
|
|
|
|
|
private final IResidentAndDisabledRepository gnReacallRepository;
|
|
|
|
|
private final IMinUserRepository userRepository;
|
|
|
|
|
private final IJudgeUserRepository judgeUserRepository;
|
|
|
|
|
|
|
|
|
|
private final IJudgeRepository judgeRepository;
|
|
|
|
|
private final IResidentAndDisabledMapper residentAndDisabledMapper;
|
|
|
|
|
|
|
|
|
|
private final IParkingRepository parkingRepository;
|
|
|
|
|
|
|
|
|
|
private final ICmmFileService fileService;
|
|
|
|
|
private final IPublicBoardService pBoardService;
|
|
|
|
|
private final IParkingMapper parkingMapper;
|
|
|
|
@ -68,323 +81,323 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
|
|
|
|
|
public Page<GnRecallScDto> findJudgeDatas(@NotNull final String scDatagb, Pageable pageable) {
|
|
|
|
|
// Sort sort = Sort.by(Sort.Direction.DESC, "inCode");
|
|
|
|
|
pageable = JpaUtil.getPagingInfo(pageable);
|
|
|
|
|
return null;
|
|
|
|
|
// return gnReacallRepository.findJudgeDatas(
|
|
|
|
|
// scDatagb,
|
|
|
|
|
// PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("scCode").descending()));
|
|
|
|
|
return gnReacallRepository.findJudgeDatas(
|
|
|
|
|
scDatagb,
|
|
|
|
|
PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("scCode").descending()));
|
|
|
|
|
// List<CmmUser> userList = page.getContent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public GnRecallScDto findJudgeData(final Long scCode) {
|
|
|
|
|
return gnReacallRepository.findJudgeData(scCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void saveJudgeData(GnRecallScDto dto) {
|
|
|
|
|
boolean isNew = Checks.isEmpty(dto.getScCode()) || dto.getScCode() == 0L;
|
|
|
|
|
|
|
|
|
|
if(dto.getPicadFiles() != null) {
|
|
|
|
|
if(!isNew) changeFileUpload(dto, dto.getPicadFiles());
|
|
|
|
|
else setFileInfoAndFileUpload(dto, dto.getPicadFiles(), "setScPicad");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(dto.getFrecadFiles() != null) {
|
|
|
|
|
if(!isNew) changeFileUpload(dto, dto.getFrecadFiles());
|
|
|
|
|
else setFileInfoAndFileUpload(dto, dto.getFrecadFiles(), "setScFrecad");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(dto.getContadFiles() != null) {
|
|
|
|
|
if(!isNew) changeFileUpload(dto, dto.getContadFiles());
|
|
|
|
|
else setFileInfoAndFileUpload(dto, dto.getContadFiles(), "setScContad");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GnRecallSc entity = null;
|
|
|
|
|
// 신규
|
|
|
|
|
if (isNew) {
|
|
|
|
|
// 접수번호 채번 : 년도 + seq 10자리
|
|
|
|
|
dto.setScSeq(gnReacallRepository.getGnRecallScMaxScSeq(String.valueOf(DateUtil.getCurrentYear()), CtgyConstants.Judge.DATAGB_RESIDENT.getCode()));
|
|
|
|
|
entity = mapstruct.toEntity(dto);
|
|
|
|
|
}else{
|
|
|
|
|
entity = mapstruct.toEntity(dto);
|
|
|
|
|
}
|
|
|
|
|
gnReacallRepository.save(entity);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void removeJudgeData(final Long scCode){
|
|
|
|
|
gnReacallRepository.deleteById(scCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public List<JudgeTargetDto> findJudgeTargets(JudgeTargetDto dto) {
|
|
|
|
|
return gnReacallRepository.findJudgeTargets(dto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void saveJudgeTargets(JudgeTargetDto dto) {
|
|
|
|
|
boolean isFirst = true;
|
|
|
|
|
|
|
|
|
|
for(Long scCode : dto.getScCodes()) {
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
// 심사대상 등록
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
dto.setScCode(scCode);
|
|
|
|
|
|
|
|
|
|
if (isFirst) {
|
|
|
|
|
dto.setMsYear(dto.getMsSdate().toString().substring(0, 4));
|
|
|
|
|
dto.setMsResult("0");
|
|
|
|
|
isFirst = false;
|
|
|
|
|
}
|
|
|
|
|
if(residentAndDisabledMapper.insertJudgeTargetIntoSelect(dto) == 0) throw new CustomBaseException(String.format("처리된 데이타가 있습니다[ %s ]", dto.getScCarnum()));
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
// 등록한 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수, 심의결과 : 접수 -> 심사중
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
GnRecallSc entity = gnReacallRepository.findById(dto.getScCode()).orElseThrow(() -> new CustomBaseException(ErrorCode.DATA_NOT_FOUND));
|
|
|
|
|
entity.setScTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
|
|
|
|
|
// entity.setScState(CtgyConstants.Judge.DATA_STATE_JUDGE.getCode());
|
|
|
|
|
//JpaUtil.saveIfNullId(dto.getScCode(), repository, entity);
|
|
|
|
|
gnReacallRepository.save(entity);
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
// 심사자 등록
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
List<MinUserinfo> userinfoList = userRepository.findAllByTeamAndIsenableAndAccesstype(
|
|
|
|
|
dto.getMsuTeam(),
|
|
|
|
|
CtgyConstants.UserInfo.ISENABLED_USE.getCode(),
|
|
|
|
|
CtgyConstants.UserInfo.ACCESSTYPE_SIMSA.getCode());
|
|
|
|
|
|
|
|
|
|
List<MinSimsaUser680Sc> simsaUserList = userinfoList.stream().map(u ->
|
|
|
|
|
MinSimsaUser680Sc.builder()
|
|
|
|
|
.msuMaincode(scCode)
|
|
|
|
|
.msuUserid(u.getUserid())
|
|
|
|
|
.msuResult(CtgyConstants.SimsaUserInfo.MSU_RESULT_NONE.getCode())
|
|
|
|
|
//.msuReason()
|
|
|
|
|
.msuTeam(dto.getMsuTeam())
|
|
|
|
|
//.msuIndate()
|
|
|
|
|
.build()
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
judgeUserRepository.saveAll(simsaUserList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public Page<JudgeListDto> findJudges(JudgeListDto dto, Pageable pageable) {
|
|
|
|
|
|
|
|
|
|
pageable = JpaUtil.getPagingInfo(pageable);
|
|
|
|
|
return gnReacallRepository.findJudges(dto, pageable);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional(readOnly = true)
|
|
|
|
|
// public GnRecallScDto findJudgeData(final Long scCode) {
|
|
|
|
|
// return gnReacallRepository.findJudgeData(scCode);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional
|
|
|
|
|
// public void saveJudgeData(GnRecallScDto dto) {
|
|
|
|
|
// boolean isNew = Checks.isEmpty(dto.getScCode()) || dto.getScCode() == 0L;
|
|
|
|
|
//
|
|
|
|
|
// if(dto.getPicadFiles() != null) {
|
|
|
|
|
// if(!isNew) changeFileUpload(dto, dto.getPicadFiles());
|
|
|
|
|
// else setFileInfoAndFileUpload(dto, dto.getPicadFiles(), "setScPicad");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if(dto.getFrecadFiles() != null) {
|
|
|
|
|
// if(!isNew) changeFileUpload(dto, dto.getFrecadFiles());
|
|
|
|
|
// else setFileInfoAndFileUpload(dto, dto.getFrecadFiles(), "setScFrecad");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if(dto.getContadFiles() != null) {
|
|
|
|
|
// if(!isNew) changeFileUpload(dto, dto.getContadFiles());
|
|
|
|
|
// else setFileInfoAndFileUpload(dto, dto.getContadFiles(), "setScContad");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// GnRecallSc entity = null;
|
|
|
|
|
// // 신규
|
|
|
|
|
// if (isNew) {
|
|
|
|
|
// // 접수번호 채번 : 년도 + seq 10자리
|
|
|
|
|
// dto.setScSeq(gnReacallRepository.getGnRecallScMaxScSeq(String.valueOf(DateUtil.getCurrentYear()), CtgyConstants.Judge.DATAGB_RESIDENT.getCode()));
|
|
|
|
|
// entity = mapstruct.toEntity(dto);
|
|
|
|
|
// }else{
|
|
|
|
|
// entity = mapstruct.toEntity(dto);
|
|
|
|
|
// }
|
|
|
|
|
// gnReacallRepository.save(entity);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional
|
|
|
|
|
// public void removeJudgeData(final Long scCode){
|
|
|
|
|
// gnReacallRepository.deleteById(scCode);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional(readOnly = true)
|
|
|
|
|
// public List<JudgeTargetDto> findJudgeTargets(JudgeTargetDto dto) {
|
|
|
|
|
// return gnReacallRepository.findJudgeTargets(dto);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional
|
|
|
|
|
// public void saveJudgeTargets(JudgeTargetDto dto) {
|
|
|
|
|
// boolean isFirst = true;
|
|
|
|
|
//
|
|
|
|
|
// for(Long scCode : dto.getScCodes()) {
|
|
|
|
|
//
|
|
|
|
|
// //---------------------------------------------------------
|
|
|
|
|
// // 심사대상 등록
|
|
|
|
|
// //---------------------------------------------------------
|
|
|
|
|
// dto.setScCode(scCode);
|
|
|
|
|
//
|
|
|
|
|
// if (isFirst) {
|
|
|
|
|
// dto.setMsYear(dto.getMsSdate().toString().substring(0, 4));
|
|
|
|
|
// dto.setMsResult("0");
|
|
|
|
|
// isFirst = false;
|
|
|
|
|
// }
|
|
|
|
|
// if(residentAndDisabledMapper.insertJudgeTargetIntoSelect(dto) == 0) throw new CustomBaseException(String.format("처리된 데이타가 있습니다[ %s ]", dto.getScCarnum()));
|
|
|
|
|
//
|
|
|
|
|
// //---------------------------------------------------------
|
|
|
|
|
// // 등록한 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수, 심의결과 : 접수 -> 심사중
|
|
|
|
|
// //---------------------------------------------------------
|
|
|
|
|
// GnRecallSc entity = gnReacallRepository.findById(dto.getScCode()).orElseThrow(() -> new CustomBaseException(ErrorCode.DATA_NOT_FOUND));
|
|
|
|
|
// entity.setScTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
|
|
|
|
|
// // entity.setScState(CtgyConstants.Judge.DATA_STATE_JUDGE.getCode());
|
|
|
|
|
// //JpaUtil.saveIfNullId(dto.getScCode(), repository, entity);
|
|
|
|
|
// gnReacallRepository.save(entity);
|
|
|
|
|
//
|
|
|
|
|
// //---------------------------------------------------------
|
|
|
|
|
// // 심사자 등록
|
|
|
|
|
// //---------------------------------------------------------
|
|
|
|
|
// List<MinUserinfo> userinfoList = userRepository.findAllByTeamAndIsenableAndAccesstype(
|
|
|
|
|
// dto.getMsuTeam(),
|
|
|
|
|
// CtgyConstants.UserInfo.ISENABLED_USE.getCode(),
|
|
|
|
|
// CtgyConstants.UserInfo.ACCESSTYPE_SIMSA.getCode());
|
|
|
|
|
//
|
|
|
|
|
// List<MinSimsaUser680Sc> simsaUserList = userinfoList.stream().map(u ->
|
|
|
|
|
// MinSimsaUser680Sc.builder()
|
|
|
|
|
// .msuMaincode(scCode)
|
|
|
|
|
// .msuUserid(u.getUserid())
|
|
|
|
|
// .msuResult(CtgyConstants.SimsaUserInfo.MSU_RESULT_NONE.getCode())
|
|
|
|
|
// //.msuReason()
|
|
|
|
|
// .msuTeam(dto.getMsuTeam())
|
|
|
|
|
// //.msuIndate()
|
|
|
|
|
// .build()
|
|
|
|
|
// ).collect(Collectors.toList());
|
|
|
|
|
// judgeUserRepository.saveAll(simsaUserList);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional(readOnly = true)
|
|
|
|
|
// public Page<JudgeListDto> findJudges(JudgeListDto dto, Pageable pageable) {
|
|
|
|
|
//
|
|
|
|
|
// pageable = JpaUtil.getPagingInfo(pageable);
|
|
|
|
|
// return gnReacallRepository.findJudges(dto, pageable);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional(readOnly = true)
|
|
|
|
|
// public Map<String,Object> findJudgeResults(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")));
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public Map<String,Object> findJudgeResults(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(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;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @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")));
|
|
|
|
|
// 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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@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(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 삭제 대상 조회
|
|
|
|
|
// * 2. 심사자 삭제 : min_simsa_user680_sc 테이블 : msu_maincode = ms_maincode
|
|
|
|
|
// * 3. 단속데이타 정보 변경 : gn_recall_sc 테이블 : sc_transfer = '1', sc_state = '1', sc_code = ms_maincode
|
|
|
|
|
// * 4. 심사자료 삭제 : min_simsa680_sc 테이블 ms_maincode = ms_maincode
|
|
|
|
|
// * @param dto ParkingTargetDto
|
|
|
|
|
// */
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional
|
|
|
|
|
// public void removeJudge(final JudgeListDto dto) {
|
|
|
|
|
//
|
|
|
|
|
// List<Long> msMaincodes = judgeRepository.findAllMsMaincode(dto.getMsDatagb(), dto.getMsChasu(), dto.getMsSdate(), dto.getMsEdate());
|
|
|
|
|
//
|
|
|
|
|
// msMaincodes.forEach(msMaincode -> {
|
|
|
|
|
// //List<MinSimsaUser680Sc> judgeUsers = judgeUserRepository.findByMsuMaincode()
|
|
|
|
|
// judgeUserRepository.deleteByMsuMaincode(msMaincode);
|
|
|
|
|
// // 전송상태 -> 미접수(1), 심의결과 -> 접수(1)
|
|
|
|
|
// gnReacallRepository.updateScTransferAndScState(dto.getMsDatagb(), msMaincode);
|
|
|
|
|
// judgeRepository.deleteById(msMaincode);
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional
|
|
|
|
|
// public void saveJudgeStds(final JudgeStdDto dto) {
|
|
|
|
|
// int stdCnt = dto.getJudgeStdCnt();
|
|
|
|
|
//
|
|
|
|
|
// dto.getJudgeDataKeys().forEach(map -> {
|
|
|
|
|
// int cnt = 0;
|
|
|
|
|
// Long msMaincode = Long.valueOf(map.get("msMaincode").toString());
|
|
|
|
|
// String msSeq = map.get("msSeq").toString();
|
|
|
|
|
//
|
|
|
|
|
// // 미부과
|
|
|
|
|
// String msResult = CtgyConstants.Judge.RESULT_JUDGE_NON_IMPOSE.getCode();
|
|
|
|
|
// // 주정차 심사
|
|
|
|
|
// if (Checks.isEmpty(dto.getDataGb())) {
|
|
|
|
|
// cnt = parkingRepository.getJudgeStdCnt(msMaincode);
|
|
|
|
|
// if(cnt >= stdCnt) msResult = CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode();
|
|
|
|
|
//
|
|
|
|
|
// parkingRepository.updateMsResult(msMaincode, msSeq, msResult);
|
|
|
|
|
//
|
|
|
|
|
// // 거주자 장애인 심사
|
|
|
|
|
// } else {
|
|
|
|
|
// cnt = gnReacallRepository.getJudgeStdCnt(msMaincode);
|
|
|
|
|
// if(cnt >= stdCnt) msResult = CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode();
|
|
|
|
|
//
|
|
|
|
|
// judgeRepository.updateMsResult(msMaincode, msSeq, msResult);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @Transactional(readOnly = true)
|
|
|
|
|
// public Map<String,Object> findDashboard(){
|
|
|
|
|
// Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
|
// resultMap.put("pBoardList", pBoardService.findAll(MinInfoBoard680.builder().build(), PageRequest.of(0, 7)));
|
|
|
|
|
// resultMap.put("parkJudgeList", parkingMapper.selectDashboardJudgeList());
|
|
|
|
|
// resultMap.put("residentJudgeList", residentAndDisabledMapper.selectDashboardJudgeList(CtgyConstants.Judge.DATAGB_RESIDENT.getCode()));
|
|
|
|
|
// resultMap.put("disabledJudgeList", residentAndDisabledMapper.selectDashboardJudgeList(CtgyConstants.Judge.DATAGB_DISABLED.getCode()));
|
|
|
|
|
//
|
|
|
|
|
// return resultMap;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// private void setFileInfoAndFileUpload(GnRecallScDto dto, MultipartFile[] mfs, String setMethodName) {
|
|
|
|
|
// String makePath = fileService.uploadFiles(mfs, rootPath, CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(dto.getScDatagb())? uploadPath[0] : uploadPath[1]);
|
|
|
|
|
// //makePath = makePath + File.separator;
|
|
|
|
|
//
|
|
|
|
|
// for(int idx = 0; idx < mfs.length; idx++){
|
|
|
|
|
// MultipartFile mf = mfs[idx];
|
|
|
|
|
// try {
|
|
|
|
|
// Method method = GnRecallScDto.class.getMethod(setMethodName + (idx+1), String.class);
|
|
|
|
|
// method.invoke(dto, StringUtils.cleanPath(makePath + mf.getOriginalFilename()));
|
|
|
|
|
// //method.invoke(dto, StringUtils.cleanPath(makePath + mf.getOriginalFilename()));
|
|
|
|
|
// } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// private void changeFileUpload(GnRecallScDto dto, MultipartFile[] mfs) {
|
|
|
|
|
// fileService.uploadFiles(mfs, rootPath, CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(dto.getScDatagb())? uploadPath[0] : uploadPath[1]);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// //---------------------------------------------------------------------------------
|
|
|
|
|
// // 심사자
|
|
|
|
|
// //---------------------------------------------------------------------------------
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional(readOnly = true)
|
|
|
|
|
// public List<JudgeListDto> findByUserJudges(JudgeListDto dto) {
|
|
|
|
|
// return gnReacallRepository.findByUserJudges(dto);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional
|
|
|
|
|
// public void saveJudgeResult(JudgeListDto dto){
|
|
|
|
|
// judgeUserRepository.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(),
|
|
|
|
|
// dto.getMsuResult(),
|
|
|
|
|
// dto.getMsuReason(),
|
|
|
|
|
// LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))));
|
|
|
|
|
// }
|
|
|
|
|
// 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 삭제 대상 조회
|
|
|
|
|
* 2. 심사자 삭제 : min_simsa_user680_sc 테이블 : msu_maincode = ms_maincode
|
|
|
|
|
* 3. 단속데이타 정보 변경 : gn_recall_sc 테이블 : sc_transfer = '1', sc_state = '1', sc_code = ms_maincode
|
|
|
|
|
* 4. 심사자료 삭제 : min_simsa680_sc 테이블 ms_maincode = ms_maincode
|
|
|
|
|
* @param dto ParkingTargetDto
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void removeJudge(final JudgeListDto dto) {
|
|
|
|
|
|
|
|
|
|
List<Long> msMaincodes = judgeRepository.findAllMsMaincode(dto.getMsDatagb(), dto.getMsChasu(), dto.getMsSdate(), dto.getMsEdate());
|
|
|
|
|
|
|
|
|
|
msMaincodes.forEach(msMaincode -> {
|
|
|
|
|
//List<MinSimsaUser680Sc> judgeUsers = judgeUserRepository.findByMsuMaincode()
|
|
|
|
|
judgeUserRepository.deleteByMsuMaincode(msMaincode);
|
|
|
|
|
// 전송상태 -> 미접수(1), 심의결과 -> 접수(1)
|
|
|
|
|
gnReacallRepository.updateScTransferAndScState(dto.getMsDatagb(), msMaincode);
|
|
|
|
|
judgeRepository.deleteById(msMaincode);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void saveJudgeStds(final JudgeStdDto dto) {
|
|
|
|
|
int stdCnt = dto.getJudgeStdCnt();
|
|
|
|
|
|
|
|
|
|
dto.getJudgeDataKeys().forEach(map -> {
|
|
|
|
|
int cnt = 0;
|
|
|
|
|
Long msMaincode = Long.valueOf(map.get("msMaincode").toString());
|
|
|
|
|
String msSeq = map.get("msSeq").toString();
|
|
|
|
|
|
|
|
|
|
// 미부과
|
|
|
|
|
String msResult = CtgyConstants.Judge.RESULT_JUDGE_NON_IMPOSE.getCode();
|
|
|
|
|
// 주정차 심사
|
|
|
|
|
if (Checks.isEmpty(dto.getDataGb())) {
|
|
|
|
|
cnt = parkingRepository.getJudgeStdCnt(msMaincode);
|
|
|
|
|
if(cnt >= stdCnt) msResult = CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode();
|
|
|
|
|
|
|
|
|
|
parkingRepository.updateMsResult(msMaincode, msSeq, msResult);
|
|
|
|
|
|
|
|
|
|
// 거주자 장애인 심사
|
|
|
|
|
} else {
|
|
|
|
|
cnt = gnReacallRepository.getJudgeStdCnt(msMaincode);
|
|
|
|
|
if(cnt >= stdCnt) msResult = CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode();
|
|
|
|
|
|
|
|
|
|
judgeRepository.updateMsResult(msMaincode, msSeq, msResult);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public Map<String,Object> findDashboard(){
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
|
resultMap.put("pBoardList", pBoardService.findAll(MinInfoBoard680.builder().build(), PageRequest.of(0, 7)));
|
|
|
|
|
resultMap.put("parkJudgeList", parkingMapper.selectDashboardJudgeList());
|
|
|
|
|
resultMap.put("residentJudgeList", residentAndDisabledMapper.selectDashboardJudgeList(CtgyConstants.Judge.DATAGB_RESIDENT.getCode()));
|
|
|
|
|
resultMap.put("disabledJudgeList", residentAndDisabledMapper.selectDashboardJudgeList(CtgyConstants.Judge.DATAGB_DISABLED.getCode()));
|
|
|
|
|
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setFileInfoAndFileUpload(GnRecallScDto dto, MultipartFile[] mfs, String setMethodName) {
|
|
|
|
|
String makePath = fileService.uploadFiles(mfs, rootPath, CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(dto.getScDatagb())? uploadPath[0] : uploadPath[1]);
|
|
|
|
|
//makePath = makePath + File.separator;
|
|
|
|
|
|
|
|
|
|
for(int idx = 0; idx < mfs.length; idx++){
|
|
|
|
|
MultipartFile mf = mfs[idx];
|
|
|
|
|
try {
|
|
|
|
|
Method method = GnRecallScDto.class.getMethod(setMethodName + (idx+1), String.class);
|
|
|
|
|
method.invoke(dto, StringUtils.cleanPath(makePath + mf.getOriginalFilename()));
|
|
|
|
|
//method.invoke(dto, StringUtils.cleanPath(makePath + mf.getOriginalFilename()));
|
|
|
|
|
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void changeFileUpload(GnRecallScDto dto, MultipartFile[] mfs) {
|
|
|
|
|
fileService.uploadFiles(mfs, rootPath, CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(dto.getScDatagb())? uploadPath[0] : uploadPath[1]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
|
// 심사자
|
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public List<JudgeListDto> findByUserJudges(JudgeListDto dto) {
|
|
|
|
|
return gnReacallRepository.findByUserJudges(dto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void saveJudgeResult(JudgeListDto dto){
|
|
|
|
|
judgeUserRepository.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(),
|
|
|
|
|
dto.getMsuResult(),
|
|
|
|
|
dto.getMsuReason(),
|
|
|
|
|
LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|