feat : 거주자/장애인 심사자 심사 반영

dev
minuk926 3 years ago
parent d9ee2861df
commit 3c58460afd

@ -193,4 +193,25 @@ public class ResidentAndDisabledController {
AssertUtils.isTrue(!Checks.isEmpty(dto.getMsDatagb()), "데이타구분 값은 필수입니다(1-거주자,2-장애인)");
return RestResponse.of(service.findByUserJudges(dto));
}
@Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "거주자/장애인 의견진술 심의 결과 저장" , description = "거주자/장애인 의견진술 심의 결과 저장")
@Parameters({
@Parameter(in = ParameterIn.QUERY, name = "msuCode", description = "심사코드", required = true, example = " "),
@Parameter(in = ParameterIn.QUERY, name = "msuResult", description = "심사결과코드", required = true, example = "1"),
@Parameter(in = ParameterIn.QUERY, name = "msuReason", description = "심사사유", required = true, example = " ")
})
@PostMapping(value="/judge", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveJudgeResult(
@Valid
@RequestBody
@Parameter(hidden = true)
final JudgeListDto dto) {
AssertUtils.isTrue(!Checks.isEmpty(dto), "필수 조건이 입력되지 않았습니다.");
AssertUtils.isTrue(!Checks.isEmpty(dto.getMsuCode()), "심사코드 값은 필수입니다(PK)");
AssertUtils.isTrue(!Checks.isEmpty(dto.getMsuResult()), "심사결과는 필수입니다(1-수용,2-미수용)");
AssertUtils.isTrue(!Checks.isEmpty(dto.getMsuReason()), "심의사유는 필수입니다");
service.saveJudgeResult(dto);
return RestResponse.of(HttpStatus.OK);
}
}

@ -53,4 +53,12 @@ public class JudgeListDto {
private String msResult;
@Schema(title = "심사자별 심사결과", example = " ", description = "심사자별 심사결과")
private String msuResult;
@Schema(title = "심사자코드", example = " ", description = "심사자코드")
private Long msuCode;
@Schema(title = "심사자별 사유", example = " ", description = "심사자별 사유")
private String msuReason;
@Schema(title = "심사일", example = " ", description = "심사일")
private LocalDate msuIndate;
}

@ -3,9 +3,20 @@ package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.MinSimsaUser680Sc;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.time.LocalDate;
public interface IJudgeUserRepository extends JpaRepository<MinSimsaUser680Sc, Long> {
@Modifying
int deleteByMsuMaincode(Long msMaincode);
@Modifying
@Query(value = "UPDATE #{#entityName} m SET m.msuReason = :msuReason, m.msuResult = :msuResult, m.msuIndate = :msuIndate WHERE m.msuCode = :msuCode")
int updateMsuResonAndMsuResultByMsuCode(@Param("msuCode")Long msuCode,
@Param("msuResult")String msuResult,
@Param("msuReason")String msuReason,
@Param("msuIndate")LocalDate msuIndate);
}

@ -343,7 +343,8 @@ public class IResidentAndDisabledRepositoryImpl implements IResidentAndDisabledR
minSimsa680Sc.msEdate,
minSimsa680Sc.msCdate,
minSimsa680Sc.msClosesi,
minSimsa680Sc.msDatagb
minSimsa680Sc.msDatagb,
minSimsaUser680Sc.msuCode
))
.from(minSimsa680Sc)
.join(minSimsaUser680Sc)

@ -82,4 +82,6 @@ public interface IResidentAndDisabledService {
//---------------------------------------------------------------------------------
List<JudgeListDto> findByUserJudges(JudgeListDto dto);
void saveJudgeResult(JudgeListDto dto);
}

@ -35,6 +35,9 @@ import javax.persistence.EntityManager;
import javax.validation.constraints.NotNull;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -289,4 +292,13 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
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"))));
}
}

Loading…
Cancel
Save