feat: 관리자 심의 판정 저장

dev
Lim Jonguk 3 years ago
parent 4c72a1a333
commit 65d0cb399f

@ -20,8 +20,8 @@ public class CtgyConstants {
// 심의결과코드 // 심의결과코드
RESULT_JUDGE_PRE("0", "심의전"), RESULT_JUDGE_PRE("0", "심의전"),
RESULT_JUDGE_IMPOSE("0", "부과"), RESULT_JUDGE_IMPOSE("1", "부과"),
RESULT_JUDGE_NON_IMPOSE("0", "미부과"), RESULT_JUDGE_NON_IMPOSE("2", "미부과"),
// 데이타구분 // 데이타구분
DATAGB_RESIDENT("1", "거주자"), DATAGB_RESIDENT("1", "거주자"),
DATAGB_DISABLED("2", "장애인") DATAGB_DISABLED("2", "장애인")

@ -2,6 +2,7 @@ package com.xit.biz.ctgy.controller;
import com.xit.biz.ctgy.dto.GnRecallScDto; import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.JudgeListDto; 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.JudgeTargetDto;
import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct; import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct;
import com.xit.biz.ctgy.service.IResidentAndDisabledService; import com.xit.biz.ctgy.service.IResidentAndDisabledService;
@ -164,18 +165,17 @@ public class ResidentAndDisabledController {
return RestResponse.of(service.findJudgeResults(dto)); return RestResponse.of(service.findJudgeResults(dto));
} }
@Secured(policy = SecurityPolicy.TOKEN) //@Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "거주자/장애인 의견진술 심의 자료 삭제" , description = "거주자/장애인 의견진술 심의 자료 삭제") @Operation(summary = "관리자 심사기준 적용 심사 처리" , description = "관리자 심사기준 적용 심사 처리")
@PostMapping(value="/admin/remove", produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value="/admin/judge", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> removeJudge( public ResponseEntity<? extends IRestResponse> saveJudgeStds(
@Valid @Valid
@RequestBody @RequestBody
final JudgeListDto dto) { final JudgeStdDto dto) {
service.removeJudge(dto); service.saveJudgeStds(dto);
return RestResponse.of(HttpStatus.OK); return RestResponse.of(HttpStatus.OK);
} }
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// 심사자 // 심사자
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------

@ -0,0 +1,43 @@
package com.xit.biz.ctgy.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.validation.constraints.Size;
import java.util.List;
import java.util.Map;
@Schema(name = "JudgeStdDto", description = "심사기준적용DTO")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class JudgeStdDto {
@Schema(required = true, title = "데이타구분", example = " ", description = "데이타구분")
private String dataGb;
@Schema(required = true, title = "심사기준(명수)", example = "", description = "4")
private int judgeStdCnt;
@Schema(required = true, title = "심사대상키목록", example = "", description = "")
private List<Map<String, Object>> judgeDataKeys;
//private List<Map<String, Object>> judgeDataKeys;
static class JudgeDataKey {
@Schema(title = "민원코드", example = " ", description = "민원코드")
private Long msMaincode;
@Schema(title = "접수번호", example = " ", description = "접수번호")
private String msSeq;
}
}
//class JudgeDataKey {
// @Schema(title = "민원코드", example = " ", description = "민원코드")
// private Long msMaincode;
// @Schema(title = "접수번호", example = " ", description = "접수번호")
// private String msSeq;
//}

@ -14,4 +14,8 @@ public interface IJudgeRepository extends JpaRepository<MinSimsa680Sc, Long> {
@Query(value = "SELECT e.msMaincode FROM #{#entityName} e WHERE e.msDatagb = :msDatagb AND e.msChasu = :msChasu AND e.msSdate >= :msSdate AND e.msEdate <= :msEdate") @Query(value = "SELECT e.msMaincode FROM #{#entityName} e WHERE e.msDatagb = :msDatagb AND e.msChasu = :msChasu AND e.msSdate >= :msSdate AND e.msEdate <= :msEdate")
List<Long> findAllMsMaincode(@Param("msDatagb") String msDatagb, @Param("msChasu") Long msChasu, @Param("msSdate") LocalDate msSdate, @Param("msEdate")LocalDate msEdate); List<Long> findAllMsMaincode(@Param("msDatagb") String msDatagb, @Param("msChasu") Long msChasu, @Param("msSdate") LocalDate msSdate, @Param("msEdate")LocalDate msEdate);
@Modifying
@Query(value = "UPDATE #{#entityName} m SET m.msResult = :msResult WHERE m.msMaincode = :msMaincode AND m.msSeq = :msSeq")
int updateMsResult(@Param("msMaincode") final Long msMaincode, @Param("msSeq") final String msSeq, @Param("msResult") final String msResult);
} }

@ -2,6 +2,7 @@ package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.MinSimsa680; import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.jpa.repository.JpaRepository; 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.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
@ -13,4 +14,7 @@ public interface IParkingRepository extends JpaRepository<MinSimsa680, Long>, IP
@Query(value = "SELECT e.msMaincode FROM #{#entityName} e WHERE e.msChasu = :msChasu AND e.msSdate >= :msSdate AND e.msEdate <= :msEdate") @Query(value = "SELECT e.msMaincode FROM #{#entityName} e WHERE e.msChasu = :msChasu AND e.msSdate >= :msSdate AND e.msEdate <= :msEdate")
List<Long> findAllMsMaincode(@Param("msChasu") Long msChasu, @Param("msSdate")LocalDate msSdate, @Param("msEdate")LocalDate msEdate); List<Long> findAllMsMaincode(@Param("msChasu") Long msChasu, @Param("msSdate")LocalDate msSdate, @Param("msEdate")LocalDate msEdate);
@Modifying
@Query(value = "UPDATE #{#entityName} m SET m.msResult = :msResult WHERE m.msMaincode = :msMaincode AND m.msSeq = :msSeq")
int updateMsResult(@Param("msMaincode") final Long msMaincode, @Param("msSeq") final String msSeq, @Param("msResult") final String msResult);
} }

@ -14,6 +14,8 @@ public interface IParkingRepositoryCustom {
List<ParkingTargetDto> findParkingJudgeTargets(final ParkingTargetDto dto); List<ParkingTargetDto> findParkingJudgeTargets(final ParkingTargetDto dto);
int getJudgeStdCnt(final Long msMaincode);
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// 심사자 // 심사자
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------

@ -21,7 +21,9 @@ import java.util.List;
import static com.xit.biz.cmm.entity.QCmmCodeS.cmmCodeS; import static com.xit.biz.cmm.entity.QCmmCodeS.cmmCodeS;
import static com.xit.biz.ctgy.entity.QMinSimsa680.minSimsa680; 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.QMinSimsaUser680.minSimsaUser680;
import static com.xit.biz.ctgy.entity.QMinSimsaUser680Sc.minSimsaUser680Sc;
import static com.xit.biz.ctgy.entity.QMinUserinfo.minUserinfo; import static com.xit.biz.ctgy.entity.QMinUserinfo.minUserinfo;
import static com.xit.biz.ctgy.entity.QTf680Main.tf680Main; import static com.xit.biz.ctgy.entity.QTf680Main.tf680Main;
import static com.xit.biz.ctgy.entity.QTf680Recall.tf680Recall; import static com.xit.biz.ctgy.entity.QTf680Recall.tf680Recall;
@ -152,6 +154,18 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
return rslt; return rslt;
} }
@Override
public int getJudgeStdCnt(final Long msMaincode){
return queryFactory.select(minSimsaUser680.msuCode)
.from(minSimsaUser680)
.where(
minSimsaUser680.msuMaincode.eq(msMaincode),
minSimsaUser680.msuResult.eq(CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode())
)
.fetch()
.size();
}
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// 심사자 // 심사자
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------

@ -56,6 +56,8 @@ public interface IResidentAndDisabledRepositoryCustom {
*/ */
List<JudgeTargetDto> findJudgeTargets(final JudgeTargetDto dto); List<JudgeTargetDto> findJudgeTargets(final JudgeTargetDto dto);
int getJudgeStdCnt(final Long msMaincode);
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// 심사자 // 심사자
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------

@ -259,6 +259,18 @@ public class IResidentAndDisabledRepositoryImpl implements IResidentAndDisabledR
return queryResidentJudgeTargets(dto.getScDatagb(), stateCond, dto.getScTransfer(), dto.getScSeq1(), dto.getScSeq2()); return queryResidentJudgeTargets(dto.getScDatagb(), stateCond, dto.getScTransfer(), dto.getScSeq1(), dto.getScSeq2());
} }
@Override
public int getJudgeStdCnt(final Long msMaincode){
return queryFactory.select(minSimsaUser680Sc.msuCode)
.from(minSimsaUser680Sc)
.where(
minSimsaUser680Sc.msuMaincode.eq(msMaincode),
minSimsaUser680Sc.msuResult.eq(CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode())
)
.fetch()
.size();
}
private List<JudgeTargetDto> queryResidentJudgeTargets(String dataGb, String state, String transfer, Long seq1, Long seq2){ private List<JudgeTargetDto> queryResidentJudgeTargets(String dataGb, String state, String transfer, Long seq1, Long seq2){
return queryFactory return queryFactory
.select(Projections.fields(JudgeTargetDto.class, .select(Projections.fields(JudgeTargetDto.class,

@ -2,6 +2,7 @@ package com.xit.biz.ctgy.service;
import com.xit.biz.ctgy.dto.GnRecallScDto; import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.JudgeListDto; 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.JudgeTargetDto;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -76,6 +77,7 @@ public interface IResidentAndDisabledService {
void removeJudge(final JudgeListDto dto); void removeJudge(final JudgeListDto dto);
void saveJudgeStds(final JudgeStdDto dto);
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// 심사자 // 심사자

@ -4,14 +4,12 @@ import com.xit.biz.cmm.service.ICmmFileService;
import com.xit.biz.ctgy.CtgyConstants; import com.xit.biz.ctgy.CtgyConstants;
import com.xit.biz.ctgy.dto.GnRecallScDto; import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.JudgeListDto; 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.JudgeTargetDto;
import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct; import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct;
import com.xit.biz.ctgy.entity.*; import com.xit.biz.ctgy.entity.*;
import com.xit.biz.ctgy.mapper.IResidentAndDisabledMapper; import com.xit.biz.ctgy.mapper.IResidentAndDisabledMapper;
import com.xit.biz.ctgy.repository.IJudgeRepository; import com.xit.biz.ctgy.repository.*;
import com.xit.biz.ctgy.repository.IJudgeUserRepository;
import com.xit.biz.ctgy.repository.IMinUserRepository;
import com.xit.biz.ctgy.repository.IResidentAndDisabledRepository;
import com.xit.biz.ctgy.service.IResidentAndDisabledService; import com.xit.biz.ctgy.service.IResidentAndDisabledService;
import com.xit.core.constant.ErrorCode; import com.xit.core.constant.ErrorCode;
import com.xit.core.exception.CustomBaseException; import com.xit.core.exception.CustomBaseException;
@ -62,6 +60,8 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
private final IJudgeRepository judgeRepository; private final IJudgeRepository judgeRepository;
private final IResidentAndDisabledMapper residentAndDisabledMapper; private final IResidentAndDisabledMapper residentAndDisabledMapper;
private final IParkingRepository parkingRepository;
private final ICmmFileService fileService; private final ICmmFileService fileService;
private final EntityManager entityManager; private final EntityManager entityManager;
@ -263,6 +263,35 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
}); });
} }
@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);
}
});
}
private void setFileInfoAndFileUpload(GnRecallScDto dto, MultipartFile[] mfs, String setMethodName) { 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]); String makePath = fileService.uploadFiles(mfs, rootPath, CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(dto.getScDatagb())? uploadPath[0] : uploadPath[1]);
//makePath = makePath + File.separator; //makePath = makePath + File.separator;

@ -12,7 +12,7 @@ xit:
# api response logging 여부 # api response logging 여부
api: api:
reponse: reponse:
logging: false logging: true
file: file:
cmm: cmm:

@ -4,12 +4,12 @@
<springProfile name="local"> <springProfile name="local">
<property name="LOG_PATH" value="/data/xit/logs"/> <!-- <property name="LOG_PATH" value="/data/xit/logs"/>-->
<!-- <property name="LOG_PATH" value="/Users/minuk/data/xit/logs"/>--> <property name="LOG_PATH" value="/Users/minuk/data/xit/logs"/>
</springProfile> </springProfile>
<springProfile name="dev,prod"> <springProfile name="dev,prod">
<property name="LOG_PATH" value="/data/xit/logs"/> <!-- <property name="LOG_PATH" value="/data/xit/logs"/>-->
<!-- <property name="LOG_PATH" value="/Users/minuk/data/xit/logs"/>--> <property name="LOG_PATH" value="/Users/minuk/data/xit/logs"/>
</springProfile> </springProfile>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/> <include resource="org/springframework/boot/logging/logback/defaults.xml"/>

Loading…
Cancel
Save