Merge branch 'dev'

dev
Lim Jonguk 3 years ago
commit 9b89e652d7

@ -20,8 +20,8 @@ public class CtgyConstants {
// 심의결과코드
RESULT_JUDGE_PRE("0", "심의전"),
RESULT_JUDGE_IMPOSE("0", "부과"),
RESULT_JUDGE_NON_IMPOSE("0", "미부과"),
RESULT_JUDGE_IMPOSE("1", "부과"),
RESULT_JUDGE_NON_IMPOSE("2", "미부과"),
// 데이타구분
DATAGB_RESIDENT("1", "거주자"),
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.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.service.IResidentAndDisabledService;
@ -164,18 +165,17 @@ public class ResidentAndDisabledController {
return RestResponse.of(service.findJudgeResults(dto));
}
@Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "거주자/장애인 의견진술 심의 자료 삭제" , description = "거주자/장애인 의견진술 심의 자료 삭제")
@PostMapping(value="/admin/remove", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> removeJudge(
//@Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "관리자 심사기준 적용 심사 처리" , description = "관리자 심사기준 적용 심사 처리")
@PostMapping(value="/admin/judge", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveJudgeStds(
@Valid
@RequestBody
final JudgeListDto dto) {
service.removeJudge(dto);
final JudgeStdDto dto) {
service.saveJudgeStds(dto);
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")
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 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;
@ -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")
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);
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.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;
import static com.xit.biz.ctgy.entity.QTf680Main.tf680Main;
import static com.xit.biz.ctgy.entity.QTf680Recall.tf680Recall;
@ -152,6 +154,18 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
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);
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());
}
@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){
return queryFactory
.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.JudgeListDto;
import com.xit.biz.ctgy.dto.JudgeStdDto;
import com.xit.biz.ctgy.dto.JudgeTargetDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@ -76,6 +77,7 @@ public interface IResidentAndDisabledService {
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.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.*;
import com.xit.biz.ctgy.mapper.IResidentAndDisabledMapper;
import com.xit.biz.ctgy.repository.IJudgeRepository;
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.repository.*;
import com.xit.biz.ctgy.service.IResidentAndDisabledService;
import com.xit.core.constant.ErrorCode;
import com.xit.core.exception.CustomBaseException;
@ -62,6 +60,8 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
private final IJudgeRepository judgeRepository;
private final IResidentAndDisabledMapper residentAndDisabledMapper;
private final IParkingRepository parkingRepository;
private final ICmmFileService fileService;
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) {
String makePath = fileService.uploadFiles(mfs, rootPath, CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(dto.getScDatagb())? uploadPath[0] : uploadPath[1]);
//makePath = makePath + File.separator;

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

Loading…
Cancel
Save