fix: 거주자심의 반영

dev
minuk926 3 years ago
parent bf04e4499e
commit fb3b8beefd

@ -73,6 +73,7 @@ public class ResidentController {
@Operation(summary = "거주자 의견진술 심의대상 조회" , description = "거주자 의견진술 심의대상 조회")
@GetMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE)
@Parameters({
@Parameter(in = ParameterIn.QUERY, name = "scDatagb", description = "데이타구분(1-거주자, 2-장애인)", required = true, example = "1"),
@Parameter(in = ParameterIn.QUERY, name = "scTransfer", description = "전송상태(미접수-1,접수-2)", required = true, example = "1"),
@Parameter(in = ParameterIn.QUERY, name = "scSeq1", description = "접수번호-시작", required = true, example = "2022200801"),
@Parameter(in = ParameterIn.QUERY, name = "scSeq2", description = "접수번호-종료", required = true, example = "2022200899"),

@ -48,7 +48,7 @@ public class ResidentTargetDto {
private String scTransfer;
@Schema(title = "데이타구분", example = "1", description = "데이타구분: 1-거주자,2-장애인")
private String scDatagb;
private String scDatagb = "1";
//------------------------------------------------------------------
// 심사대상 저장을 위한 속성

@ -6,6 +6,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IParkingMapper {
void insertSimsaTargetIntoSelect(ParkingTargetDto dto);
void insertParkingJudgeTargetIntoSelect(ParkingTargetDto dto);
}

@ -0,0 +1,11 @@
package com.xit.biz.ctgy.mapper;
import com.xit.biz.ctgy.dto.ResidentTargetDto;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IResidentMapper {
void insertResidentJudgeTargetIntoSelect(ResidentTargetDto dto);
}

@ -214,12 +214,10 @@ AND SC_CODE =
@Override
public List<ResidentTargetDto> findResidentJudgeTargets(final ResidentTargetDto dto) {
// 데이타구분 : 1-거주자 2-장애인
String dataGbCond = CtgyConstants.Judge.DATAGB_RESIDENT.getCode();
// 자료상태 : 1-접수
String stateCond = CtgyConstants.Judge.DATA_STATE_RECEIPT.getCode();
return queryReultResidentJudgeTargets(dataGbCond, stateCond, dto.getScTransfer(), dto.getScSeq1(), dto.getScSeq2());
return queryReultResidentJudgeTargets(dto.getScDatagb(), stateCond, dto.getScTransfer(), dto.getScSeq1(), dto.getScSeq2());
}
private List<ResidentTargetDto> queryReultResidentJudgeTargets(String dataGb, String state, String transfer, Long seq1, Long seq2){
@ -238,14 +236,14 @@ AND SC_CODE =
.where(gnRecallSc.scContDoc.eq(cmmCodeS.codeCd),cmmCodeS.codeGrpId.eq("TRAFFIC"),
cmmCodeS.codeLcd.eq("GANGNAM_SIMSA"),
cmmCodeS.codeMcd.eq("RC_CONT_DOC")),
"rcContDocNm"),
"scContDocNm"),
ExpressionUtils.as(
JPAExpressions.select(cmmCodeS.codeNm)
.from(cmmCodeS)
.where(gnRecallSc.scIngb.eq(cmmCodeS.codeCd),cmmCodeS.codeGrpId.eq("TRAFFIC"),
cmmCodeS.codeLcd.eq("GANGNAM_SIMSA"),
cmmCodeS.codeMcd.eq("RC_INGB")),
"rcIngbNm")
"scIngbNm")
))
.from(gnRecallSc)
.where(datagbEq(dataGb), stateEq(state), transferEq(transfer), seqGt(seq1), seqLt(seq2))

@ -27,10 +27,10 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class ParkingService implements IParkingService {
private final IParkingRepository simsaRepository;
private final IParkingRepository repository;
private final IRecallRepository recallRepository;
private final IMinUserRepository userRepository;
private final IJudgeUserRepository simsaUserRepository;
private final IJudgeUserRepository judgeUserRepository;
private final IParkingMapper mapper;
// @Override
@ -49,7 +49,7 @@ public class ParkingService implements IParkingService {
@Override
@Transactional(readOnly = true)
public Page<JudgeListDto> findParkings(final JudgeListDto minSimsa680GroupDto, Pageable pageable) {
return simsaRepository.findParkings(minSimsa680GroupDto, pageable);
return repository.findParkings(minSimsa680GroupDto, pageable);
}
@Override
@ -61,7 +61,7 @@ public class ParkingService implements IParkingService {
@Override
@Transactional(readOnly = true)
public List<ParkingTargetDto> findParkingJudgeTargets(ParkingTargetDto dto) {
return simsaRepository.findParkingJudgeTargets(dto);
return repository.findParkingJudgeTargets(dto);
}
@Override
@ -79,7 +79,7 @@ public class ParkingService implements IParkingService {
}
// 심사대상 등록
mapper.insertSimsaTargetIntoSelect(dto);
mapper.insertParkingJudgeTargetIntoSelect(dto);
// 등록된 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수
Tf680Recall recallEntity = recallRepository.findById(dto.getRcCode()).orElseGet(()->Tf680Recall.builder().build());
@ -103,7 +103,7 @@ public class ParkingService implements IParkingService {
//.msuIndate()
.build()
).collect(Collectors.toList());
simsaUserRepository.saveAll(simsaUserList);
judgeUserRepository.saveAll(simsaUserList);
}
}

@ -7,6 +7,7 @@ import com.xit.biz.ctgy.dto.ResidentTargetDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct;
import com.xit.biz.ctgy.entity.*;
import com.xit.biz.ctgy.mapper.IResidentMapper;
import com.xit.biz.ctgy.repository.*;
import com.xit.biz.ctgy.service.IResidentService;
import com.xit.core.support.jpa.JpaUtil;
@ -25,6 +26,7 @@ import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
@ -42,6 +44,11 @@ public class ResidentService implements IResidentService {
private final ICmmFileService fileService;
private final IMinUserRepository userRepository;
private final IJudgeUserRepository judgeUserRepository;
private final IResidentMapper mapper;
@Override
@Transactional(readOnly = true)
public Page<GnRecallScDto> findResidentDatas(Pageable pageable) {
@ -130,49 +137,44 @@ public class ResidentService implements IResidentService {
@Override
@Transactional
public void saveResidentJudgeTargets(ResidentTargetDto dto) {
// boolean isFirst = true;
//
// for(Long rcCode : dto.getRcCodes()) {
// dto.setRcCode(rcCode);
//
// if (isFirst) {
// dto.setMsYear(dto.getMsSdate().toString().substring(0, 4));
// dto.setMsResult("0");
// isFirst = false;
// }
//
// // 심사대상 등록
// mapper.insertSimsaTargetIntoSelect(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;
}
// 심사대상 등록
mapper.insertResidentJudgeTargetIntoSelect(dto);
// // 등록된 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수
// Tf680Recall recallEntity = recallRepository.findById(dto.getRcCode()).orElseGet(Tf680Recall::new);
// recallEntity.setRcIrTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
// JpaUtil.saveIfNullId(recallEntity.getRcCode(), recallRepository, recallEntity);
//
// // 심사자 등록
// List<MinUserinfo> userinfoList = userRepository.findAllByTeamAndIsenableAndAccesstype(
// dto.getMsuTeam(),
// CtgyConstants.UserInfo.ISENABLED_USE.getCode(),
// CtgyConstants.UserInfo.ACCESSTYPE_SIMSA.getCode());
//
// List<MinSimsaUser680> simsaUserList = userinfoList.stream().map(u ->
// MinSimsaUser680.builder()
// .msuMaincode(rcCode)
// .msuUserid(u.getUserid())
// .msuResult(CtgyConstants.SimsaUserInfo.MSU_RESULT_NONE.getCode())
// //.msuReason()
// .msuTeam(dto.getMsuTeam())
// //.msuIndate()
// .build()
// ).collect(Collectors.toList());
// simsaUserRepository.saveAll(simsaUserList);
//
// }
//
//
//// userinfoList.stream().forEach(user => simsaRepository.save(MinSimsa680));
//// simsaRepository.save
// return simsaRepository.findParkingTargets(dto);
// 심사자 등록
List<MinUserinfo> userinfoList = userRepository.findAllByTeamAndIsenableAndAccesstype(
dto.getMsuTeam(),
CtgyConstants.UserInfo.ISENABLED_USE.getCode(),
CtgyConstants.UserInfo.ACCESSTYPE_SIMSA.getCode());
List<MinSimsaUser680> simsaUserList = userinfoList.stream().map(u ->
MinSimsaUser680.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);
}
}
}

@ -2,8 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xit.biz.ctgy.mapper.IParkingMapper">
<insert id="insertSimsaTargetIntoSelect" parameterType="com.xit.biz.ctgy.dto.ParkingTargetDto">
/* parking-mapper|insertSimsaTargetIntoSelect|julim */
<insert id="insertParkingJudgeTargetIntoSelect" parameterType="com.xit.biz.ctgy.dto.ParkingTargetDto">
/* parking-mapper|insertParkingJudgeTargetIntoSelect|julim */
insert
into min_simsa680(
ms_maincode,
@ -41,26 +41,4 @@
join tf680_dong TD
on TJ.mj_dong = TD.do_code
</insert>
<insert id="insertSimaUserinfo" parameterType="com.xit.biz.ctgy.dto.ParkingTargetDto">
/* parking-mapper|insertSimsaTargetIntoSelect|julim */
/*
insert
into min_simsa_user680(
msu_code,
msu_maincode,
msu_userid,
msu_result,
msu_reason,
msu_team,
msu_indate
) select min_simsa680_seq.nextval,
TR.rc_code,
#{userid},
#{msuResult},
#{msuReason},
#{msuTeam},
#{msuIndate}
*/
</insert>
</mapper>

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xit.biz.ctgy.mapper.IResidentMapper">
<insert id="insertResidentJudgeTargetIntoSelect" parameterType="com.xit.biz.ctgy.dto.ResidentDto">
/* resident-mapper|insertResidentJudgeTargetIntoSelect|julim */
insert
into min_simsa680_sc(
ms_maincode,
ms_seq,
ms_carnum,
ms_year,
ms_chasu,
ms_sdate,
ms_startsi,
ms_edate,
ms_cdate,
ms_closesi,
ms_wdate,
ms_pos,
ms_result,
ms_jbtime,
ms_datagb
) select sc_code,
sc_seq,
sc_carnum,
#{msYear},
#{msChasu},
#{msSdate},
#{msStartsi},
#{msEdate},
#{msCdate},
#{msClosesi},
sc_wdate,
sc_dong||''||sc_pos,
#{msResult},
sc_jbtime,
sc_datagb
from gn_recall_sc
where sc_code = #{scCode}
</insert>
</mapper>
Loading…
Cancel
Save