feat: mpower 적용 완료

dev
Jonguk. Lim 2 years ago
parent c93cfe870a
commit ce0bada846

@ -24,7 +24,7 @@ import javax.annotation.Nonnull;
import java.util.List; import java.util.List;
@Tag(name = "CmmCodeMgtController", description = "코드 관리") @Tag(name = "CmmCodeMgtController", description = "코드 관리")
@RestController //@RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/v1/biz/cmm") @RequestMapping("/api/v1/biz/cmm")
public class CmmCodeMgtController { public class CmmCodeMgtController {

@ -31,7 +31,7 @@ import java.nio.file.Paths;
import java.util.Arrays; import java.util.Arrays;
@Tag(name = "CmmFileController", description = "파일 관리") @Tag(name = "CmmFileController", description = "파일 관리")
@RestController //@RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/v1/ctgy/cmm") @RequestMapping("/api/v1/ctgy/cmm")
public class CmmFileController { public class CmmFileController {

@ -28,7 +28,7 @@ import java.util.List;
@Slf4j @Slf4j
@Service //@Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class CmmCodeService implements ICmmCodeService { public class CmmCodeService implements ICmmCodeService {

@ -16,7 +16,7 @@ import java.io.IOException;
import java.util.Objects; import java.util.Objects;
@Slf4j @Slf4j
@Service //@Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class CmmFileService implements ICmmFileService { public class CmmFileService implements ICmmFileService {

@ -17,7 +17,7 @@ import java.util.Optional;
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains; import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
@Service //@Service
public class CmmUserService extends AbstractJpaService<CmmUser, String> implements ICmmUserService { public class CmmUserService extends AbstractJpaService<CmmUser, String> implements ICmmUserService {
private final ICmmUserRepository cmmUserRepository; private final ICmmUserRepository cmmUserRepository;

@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
@Tag(name = "BoardController", description = "게시글 관리") @Tag(name = "BoardController", description = "게시글 관리")
@RestController //@RestController
@RequestMapping("/api/v1/ctgy/board") @RequestMapping("/api/v1/ctgy/board")
@Validated @Validated
@RequiredArgsConstructor @RequiredArgsConstructor

@ -34,7 +34,7 @@ import java.nio.file.Paths;
import java.util.Arrays; import java.util.Arrays;
@Tag(name = "CtgyFileMgtController", description = "공지사항 / 게시판 관리") @Tag(name = "CtgyFileMgtController", description = "공지사항 / 게시판 관리")
@RestController //@RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/v1/ctgy/file") @RequestMapping("/api/v1/ctgy/file")
public class CtgyFileMgtController { public class CtgyFileMgtController {

@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
@Tag(name = "MinUserController", description = "사용자 관리") @Tag(name = "MinUserController", description = "사용자 관리")
@RestController //@RestController
@RequestMapping("/api/v1/ctgy/user") @RequestMapping("/api/v1/ctgy/user")
@Validated @Validated
@RequiredArgsConstructor @RequiredArgsConstructor

@ -24,7 +24,7 @@ import javax.validation.Valid;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@Tag(name = "OAuth2MinController", description = "인증 관리") @Tag(name = "OAuth2MinController", description = "인증 관리")
@RestController //@RestController
@RequestMapping("/api/v1/ctgy/account") @RequestMapping("/api/v1/ctgy/account")
@Validated @Validated
@RequiredArgsConstructor @RequiredArgsConstructor

@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
@Tag(name = "ParkingController", description = "주정차 의견진술 관리") @Tag(name = "ParkingController", description = "주정차 의견진술 관리")
@RestController //@RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
@RequestMapping("/api/v1/ctgy/parking") @RequestMapping("/api/v1/ctgy/parking")

@ -21,7 +21,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@Tag(name = "PublicBoardController", description = "공지사항 관리") @Tag(name = "PublicBoardController", description = "공지사항 관리")
@RestController //@RestController
@RequestMapping("/api/v1/ctgy/pboard") @RequestMapping("/api/v1/ctgy/pboard")
@Validated @Validated
@RequiredArgsConstructor @RequiredArgsConstructor

@ -36,7 +36,7 @@ import javax.validation.constraints.NotNull;
* : scDatagb = "2" * : scDatagb = "2"
*/ */
@Tag(name = "ResidentAndDisabledController", description = "거주자/장애인 의견진술 관리") @Tag(name = "ResidentAndDisabledController", description = "거주자/장애인 의견진술 관리")
@RestController //@RestController
@RequestMapping("/api/v1/ctgy") @RequestMapping("/api/v1/ctgy")
@Validated @Validated
@RequiredArgsConstructor @RequiredArgsConstructor

@ -194,7 +194,7 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
minSimsaUser680.msuCode, minSimsaUser680.msuCode,
minSimsaUser680.msuResult, minSimsaUser680.msuResult,
minSimsaUser680.msuReason, minSimsaUser680.msuReason,
tf680Main.mmWdate.as("msWdate") tf680Main.mmWdate.as("scWdate")
//tf680Recall.scPos //tf680Recall.scPos
)) ))
.from(minSimsa680) .from(minSimsa680)

@ -26,7 +26,7 @@ import java.util.List;
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains; import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
@Service //@Service
@AllArgsConstructor @AllArgsConstructor
public class BoardService implements IBoardService { public class BoardService implements IBoardService {

@ -27,7 +27,7 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
@Slf4j @Slf4j
@Service //@Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class CtgyFileService implements ICtgyFileService { public class CtgyFileService implements ICtgyFileService {

@ -18,7 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains; import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
@AllArgsConstructor @AllArgsConstructor
@Service //@Service
public class MinUserService implements IMinUserService { public class MinUserService implements IMinUserService {
private final PasswordEncoder passwordEncoder; private final PasswordEncoder passwordEncoder;

@ -27,7 +27,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service //@Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class ParkingService implements IParkingService { public class ParkingService implements IParkingService {

@ -12,7 +12,7 @@ import org.springframework.transaction.annotation.Transactional;
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains; import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
@Service //@Service
@AllArgsConstructor @AllArgsConstructor
public class PublicBoardService implements IPublicBoardService { public class PublicBoardService implements IPublicBoardService {

@ -43,7 +43,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service //@Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class ResidentAndDisabledService implements IResidentAndDisabledService { public class ResidentAndDisabledService implements IResidentAndDisabledService {

@ -39,60 +39,63 @@ public class CmmCodeMgtController {
//return RestResponse.of(cmmCodeService.findComboCodes(searchKeyDto)); //return RestResponse.of(cmmCodeService.findComboCodes(searchKeyDto));
} }
@Operation(summary = "코드그룹 목록 조회") // @Operation(summary = "코드그룹 목록 조회")
@Parameters({ // @Parameters({
@Parameter(in = ParameterIn.QUERY, name = "codeGrpId", description = "코드그룹ID", required = false, example = " "), // @Parameter(in = ParameterIn.QUERY, name = "codeGrpId", description = "코드그룹ID", required = false, example = " "),
@Parameter(in = ParameterIn.QUERY, name = "codeNm", description = "코드그룹명", required = false, example = " "), // @Parameter(in = ParameterIn.QUERY, name = "codeNm", description = "코드그룹명", required = false, example = " "),
@Parameter(name = "codeCd", hidden = true), // @Parameter(name = "codeCd", hidden = true),
@Parameter(name = "codeMeta1", hidden = true), // @Parameter(name = "codeMeta1", hidden = true),
@Parameter(name = "codeMeta2", hidden = true), // @Parameter(name = "codeMeta2", hidden = true),
@Parameter(name = "codeMeta3", hidden = true), // @Parameter(name = "codeMeta3", hidden = true),
@Parameter(name = "codeMeta4", hidden = true), // @Parameter(name = "codeMeta4", hidden = true),
@Parameter(name = "codeMeta5", hidden = true), // @Parameter(name = "codeMeta5", hidden = true),
@Parameter(name = "createdBy", hidden = true), // @Parameter(name = "createdBy", hidden = true),
@Parameter(name = "modifiedBy", hidden = true), // @Parameter(name = "modifiedBy", hidden = true),
@Parameter(name = "createdDate", hidden = true), // @Parameter(name = "createdDate", hidden = true),
@Parameter(name = "modifiedDate", hidden = true), // @Parameter(name = "modifiedDate", hidden = true),
@Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"), // @Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"),
@Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") // @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10")
//@Parameter(in = ParameterIn.QUERY, name = "sort", description = "정렬", required = true, example = "codeOrdr"), // //@Parameter(in = ParameterIn.QUERY, name = "sort", description = "정렬", required = true, example = "codeOrdr"),
}) // })
@GetMapping(value="/grp", produces = MediaType.APPLICATION_JSON_VALUE) // @GetMapping(value="/grp", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findCmmCodeGrps( // public ResponseEntity<? extends IRestResponse> findCmmCodeGrps(
@Parameter(hidden = true) // @Parameter(hidden = true)
final CmmCodeDto codeDto, // final CmmCodeDto codeDto,
@Parameter(hidden = true) // @Parameter(hidden = true)
@Nonnull final Pageable pageable) { // @Nonnull final Pageable pageable) {
return RestResponse.of(cmmCodeService.findCmmCodeGrps(codeDto, pageable)); // return RestResponse.of(cmmCodeService.findCmmCodeGrps(codeDto, pageable));
} // }
//
// @Operation(summary = "코드 목록 조회")
// @Parameters({
// @Parameter(in = ParameterIn.QUERY, name = "codeGrpId", description = "코드그룹ID", required = true, example = "TRAFFIC"),
// @Parameter(in = ParameterIn.QUERY, name = "codeLcd", description = "대분류코드", required = false, example = "GANGNAM_SIMSA"),
// @Parameter(in = ParameterIn.QUERY, name = "codeMcd", description = "중분류코드", required = false, example = " "),
// @Parameter(in = ParameterIn.QUERY, name = "codeCd", description = "코드", required = false, example = " "),
// @Parameter(in = ParameterIn.QUERY, name = "codeNm", description = "코드명", required = false, example = " "),
// @Parameter(in = ParameterIn.QUERY, name = "codeMeta1", description = "코드메타1", required = false, example = " "),
// @Parameter(in = ParameterIn.QUERY, name = "codeMeta2", description = "코드메타2", required = false, example = " "),
// @Parameter(in = ParameterIn.QUERY, name = "codeMeta3", description = "코드메타3", required = false, example = " "),
// @Parameter(in = ParameterIn.QUERY, name = "codeMeta4", description = "코드메타4", required = false, example = " "),
// @Parameter(in = ParameterIn.QUERY, name = "codeMeta5", description = "코드메타5", required = false, example = " "),
// @Parameter(in = ParameterIn.QUERY, name = "createdBy", hidden = true),
// @Parameter(in = ParameterIn.QUERY, name = "modifiedBy", hidden = true),
// @Parameter(in = ParameterIn.QUERY, name = "createdDate", hidden = true),
// @Parameter(in = ParameterIn.QUERY, name = "modifiedDate", hidden = true)
// })
// @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<? extends IRestResponse> findCmmCodes(@Parameter(hidden = true) @Nonnull final CmmCodeDto codeDto) {
// return RestResponse.of(cmmCodeService.findCmmCodes(codeDto));
// }
//
// @Operation(summary = "코드그룹저장" , description = "코드그룹저장")
// @PostMapping(value="/grp", produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<? extends IRestResponse> saveCmmCodeGrp(@RequestBody @Nonnull CmmCodeGrp cmmCodeGrp) {
// return RestResponse.of(cmmCodeService.saveCmmCodeGrp(cmmCodeGrp));
// }
@Operation(summary = "코드 목록 조회")
@Parameters({
@Parameter(in = ParameterIn.QUERY, name = "codeGrpId", description = "코드그룹ID", required = true, example = "TRAFFIC"),
@Parameter(in = ParameterIn.QUERY, name = "codeLcd", description = "대분류코드", required = false, example = "GANGNAM_SIMSA"),
@Parameter(in = ParameterIn.QUERY, name = "codeMcd", description = "중분류코드", required = false, example = " "),
@Parameter(in = ParameterIn.QUERY, name = "codeCd", description = "코드", required = false, example = " "),
@Parameter(in = ParameterIn.QUERY, name = "codeNm", description = "코드명", required = false, example = " "),
@Parameter(in = ParameterIn.QUERY, name = "codeMeta1", description = "코드메타1", required = false, example = " "),
@Parameter(in = ParameterIn.QUERY, name = "codeMeta2", description = "코드메타2", required = false, example = " "),
@Parameter(in = ParameterIn.QUERY, name = "codeMeta3", description = "코드메타3", required = false, example = " "),
@Parameter(in = ParameterIn.QUERY, name = "codeMeta4", description = "코드메타4", required = false, example = " "),
@Parameter(in = ParameterIn.QUERY, name = "codeMeta5", description = "코드메타5", required = false, example = " "),
@Parameter(in = ParameterIn.QUERY, name = "createdBy", hidden = true),
@Parameter(in = ParameterIn.QUERY, name = "modifiedBy", hidden = true),
@Parameter(in = ParameterIn.QUERY, name = "createdDate", hidden = true),
@Parameter(in = ParameterIn.QUERY, name = "modifiedDate", hidden = true)
})
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findCmmCodes(@Parameter(hidden = true) @Nonnull final CmmCodeDto codeDto) {
return RestResponse.of(cmmCodeService.findCmmCodes(codeDto));
}
@Operation(summary = "코드그룹저장" , description = "코드그룹저장")
@PostMapping(value="/grp", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveCmmCodeGrp(@RequestBody @Nonnull CmmCodeGrp cmmCodeGrp) {
return RestResponse.of(cmmCodeService.saveCmmCodeGrp(cmmCodeGrp));
}
// @Operation(summary = "대분류코드저장" , description = "대분류코드저장") // @Operation(summary = "대분류코드저장" , description = "대분류코드저장")
// @PostMapping("/lcode") // @PostMapping("/lcode")
@ -112,9 +115,12 @@ public class CmmCodeMgtController {
// return RestResult.of(cmmCodeService.saveCmmCodeS(cmmCodeS)); // return RestResult.of(cmmCodeService.saveCmmCodeS(cmmCodeS));
// } // }
@Operation(summary = "코드 저장")
@PostMapping
public ResponseEntity<? extends IRestResponse> saveCmmCode(@RequestBody @Nonnull CmmCodeDto cmmCodeDto) {
return RestResponse.of(cmmCodeService.saveCmmCode(cmmCodeDto)); // @Operation(summary = "코드 저장")
} // @PostMapping
// public ResponseEntity<? extends IRestResponse> saveCmmCode(@RequestBody @Nonnull CmmCodeDto cmmCodeDto) {
// return RestResponse.of(cmmCodeService.saveCmmCode(cmmCodeDto));
// }
} }

@ -1,12 +1,10 @@
package com.xit.biz.ctgy.v2.repository; package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.ctgy.dto.BoardDto; import com.xit.biz.ctgy.dto.*;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.JudgeTargetDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.entity.MinSimsaUser680; import com.xit.biz.ctgy.entity.MinSimsaUser680;
import com.xit.biz.ctgy.entity.MinSimsaUser680Sc; import com.xit.biz.ctgy.entity.MinSimsaUser680Sc;
import com.xit.core.config.database.BaseMpowerDaoSupport; import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.oauth2.utils.HeaderUtil;
import com.xit.core.support.sql.parser.QueryGenerator; import com.xit.core.support.sql.parser.QueryGenerator;
import com.xit.core.util.ConvertUtils; import com.xit.core.util.ConvertUtils;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@ -189,4 +187,30 @@ public class ParkingDao extends BaseMpowerDaoSupport {
.getQueryString(); .getQueryString();
delete(sql); delete(sql);
} }
public List<DashboardJudgeListDto> findDashboardJudgeList() {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectDashboardJudgeList")
.getQueryString();
final String fieldStrs = "msEdate, msuTeam, name, jcnt, tcnt";
return selectList(DashboardJudgeListDto.class, sql, fieldStrs);
}
public List<JudgeListDto> findByUserJudges() {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectByUserJudgeList")
.setParameter("msuUserid", HeaderUtil.getUserId())
.getQueryString();
final String fieldStrs = "msMaincode, msSeq, msCarnum, msResult, msYear, msChasu, msSdate, msStartsi, msEdate, msCdate, " +
"msClosesi, msDatgb, msuCode, msuResult, msuReason, scWdate, scPos";
return selectList(JudgeListDto.class, sql, fieldStrs);
}
public void updateMsuResonAndMsuResultByMsuCode(@NotNull final Long msuCode, @NotNull final String msuResult, @NotNull final String msuReason, @NotNull final LocalDate msuIndate) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMsuResonAndMsuResultByMsuCode")
.setParameter("msuCode", msuCode)
.setParameter("msuResult", msuResult)
.setParameter("msuReason", msuReason)
.setParameter("msuIndate", msuIndate)
.getQueryString();
update(sql);
}
} }

@ -1,10 +1,14 @@
package com.xit.biz.ctgy.v2.repository; package com.xit.biz.ctgy.v2.repository;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Projections;
import com.xit.biz.ctgy.dto.DashboardJudgeListDto;
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.JudgeTargetDto; import com.xit.biz.ctgy.dto.JudgeTargetDto;
import com.xit.biz.ctgy.entity.MinSimsaUser680Sc; import com.xit.biz.ctgy.entity.MinSimsaUser680Sc;
import com.xit.core.config.database.BaseMpowerDaoSupport; import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.oauth2.utils.HeaderUtil;
import com.xit.core.support.sql.parser.QueryGenerator; import com.xit.core.support.sql.parser.QueryGenerator;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -15,6 +19,10 @@ import java.time.LocalDate;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.xit.biz.ctgy.entity.QGnRecallSc.gnRecallSc;
import static com.xit.biz.ctgy.entity.QMinSimsa680Sc.minSimsa680Sc;
import static com.xit.biz.ctgy.entity.QMinSimsaUser680Sc.minSimsaUser680Sc;
@Repository @Repository
public class ResidentAndDisabledDao extends BaseMpowerDaoSupport { public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "residentAndDisabled"; private static final String NAME_SPACE = "residentAndDisabled";
@ -275,4 +283,31 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
.getQueryString(); .getQueryString();
} }
public List<DashboardJudgeListDto> findDashboardJudgeList(@NotNull final String msDatagb) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectDashboardJudgeList")
.getQueryString();
final String fieldStrs = "msEdate, msuTeam, name, jcnt, tcnt";
return selectList(DashboardJudgeListDto.class, sql, fieldStrs);
}
public List<JudgeListDto> findByUserJudges(@NotNull final JudgeListDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectByUserJudgeList")
.setParameter("msDatagb", dto.getMsDatagb())
.setParameter("msuUserid", HeaderUtil.getUserId())
.getQueryString();
final String fieldStrs = "msMaincode, msSeq, msCarnum, msResult, msYear, msChasu, msSdate, msStartsi, msEdate, msCdate, " +
"msClosesi, msDatgb, msuCode, msuResult, msuReason, scWdate, scPos";
return selectList(JudgeListDto.class, sql, fieldStrs);
}
public void updateMsuResonAndMsuResultByMsuCode(@NotNull final Long msuCode, @NotNull final String msuResult, @NotNull final String msuReason, @NotNull final LocalDate msuIndate) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMsuResonAndMsuResultByMsuCode")
.setParameter("msuCode", msuCode)
.setParameter("msuResult", msuResult)
.setParameter("msuReason", msuReason)
.setParameter("msuIndate", msuIndate)
.getQueryString();
update(sql);
}
} }

@ -16,14 +16,14 @@ import java.util.List;
public interface ICmmCodeService { public interface ICmmCodeService {
List<ComboCodeDto> findComboCodes(CmmCodeSIds searchKeyDto); List<ComboCodeDto> findComboCodes(CmmCodeSIds searchKeyDto);
CmmCodeGrp saveCmmCodeGrp(CmmCodeGrp cmmCodeGrp); // CmmCodeGrp saveCmmCodeGrp(CmmCodeGrp cmmCodeGrp);
// CmmCodeL saveCmmCodeL(CmmCodeL cmmCodeL); //// CmmCodeL saveCmmCodeL(CmmCodeL cmmCodeL);
// CmmCodeM saveCmmCodeM(CmmCodeM cmmCodeM); //// CmmCodeM saveCmmCodeM(CmmCodeM cmmCodeM);
// CmmCodeS saveCmmCodeS(CmmCodeS cmmCodeS); //// CmmCodeS saveCmmCodeS(CmmCodeS cmmCodeS);
//
Page<CmmCodeGrp> findCmmCodeGrps(CmmCodeDto cmmCodeDto, Pageable pageable); // Page<CmmCodeGrp> findCmmCodeGrps(CmmCodeDto cmmCodeDto, Pageable pageable);
//
List<?> findCmmCodes(CmmCodeDto cmmCodeDto); // List<?> findCmmCodes(CmmCodeDto cmmCodeDto);
//
Object saveCmmCode(CmmCodeDto cmmCodeDto); // Object saveCmmCode(CmmCodeDto cmmCodeDto);
} }

@ -0,0 +1,12 @@
package com.xit.biz.ctgy.v2.service;
import org.springframework.web.multipart.MultipartFile;
/**
* @author Lim, Jong Uk (minuk926)
* @since 2021-07-16
*/
public interface ICmmFileService {
String uploadFiles(MultipartFile[] files, String rootPath, String uploadPath);
}

@ -32,16 +32,16 @@ import java.util.List;
@RequiredArgsConstructor @RequiredArgsConstructor
public class CmmCodeService implements ICmmCodeService { public class CmmCodeService implements ICmmCodeService {
private final ICmmCodeGrpRepository cmmCodeGrpRepository; // private final ICmmCodeGrpRepository cmmCodeGrpRepository;
private final ICmmCodeLRepostory cmmCodeLRepository; // private final ICmmCodeLRepostory cmmCodeLRepository;
private final ICmmCodeMRepository cmmCodeMRepository; // private final ICmmCodeMRepository cmmCodeMRepository;
private final ICmmCodeSRepository cmmCodeSRepository; // private final ICmmCodeSRepository cmmCodeSRepository;
private final CmmCodeDao cmmCodeDao; private final CmmCodeDao cmmCodeDao;
private CmmCodeGrpMapstruct codeGrpstruct = Mappers.getMapper(CmmCodeGrpMapstruct.class); // private CmmCodeGrpMapstruct codeGrpstruct = Mappers.getMapper(CmmCodeGrpMapstruct.class);
private CmmCodeLMapstruct codeLstruct = Mappers.getMapper(CmmCodeLMapstruct.class); // private CmmCodeLMapstruct codeLstruct = Mappers.getMapper(CmmCodeLMapstruct.class);
private CmmCodeMMapstruct codeMstruct = Mappers.getMapper(CmmCodeMMapstruct.class); // private CmmCodeMMapstruct codeMstruct = Mappers.getMapper(CmmCodeMMapstruct.class);
private CmmCodeSMapstruct codeSstruct = Mappers.getMapper(CmmCodeSMapstruct.class); // private CmmCodeSMapstruct codeSstruct = Mappers.getMapper(CmmCodeSMapstruct.class);
@Override @Override
public List<ComboCodeDto> findComboCodes(CmmCodeSIds searchKeyDto) { public List<ComboCodeDto> findComboCodes(CmmCodeSIds searchKeyDto) {
@ -50,121 +50,82 @@ public class CmmCodeService implements ICmmCodeService {
// 소분류 코드 조회 // 소분류 코드 조회
if(StringUtils.hasText(searchKeyDto.getCodeMcd())){ if(StringUtils.hasText(searchKeyDto.getCodeMcd())){
AssertUtils.isTrue(!Checks.isEmpty(searchKeyDto.getCodeLcd()), "대분류 코드가 선택되지 않았습니다."); AssertUtils.isTrue(!Checks.isEmpty(searchKeyDto.getCodeLcd()), "대분류 코드가 선택되지 않았습니다.");
List<ComboCodeDto> list = cmmCodeDao.queryComboCodeClass(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd()); //List<ComboCodeDto> list = cmmCodeDao.queryComboCodeClass(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd());
//List<IComboCodeDto> list = cmmComboCodeRepository.queryComboCode(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd()); //List<IComboCodeDto> list = cmmComboCodeRepository.queryComboCode(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd());
return list; //return list;
//return cmmCodeSRepository.queryComboCode(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd()); //return cmmCodeSRepository.queryComboCode(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd());
} }
return cmmCodeDao.queryComboCodeClass(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd());
// 중분류 코드 조회 // // 중분류 코드 조회
if(StringUtils.hasText(searchKeyDto.getCodeLcd())){ // if(StringUtils.hasText(searchKeyDto.getCodeLcd())){
return cmmCodeMRepository.queryComboCode(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd()); // return cmmCodeMRepository.queryComboCode(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd());
} // }
//
// 대분류 코드 조회 // // 대분류 코드 조회
return cmmCodeLRepository.queryComboCode(searchKeyDto.getCodeGrpId()); // return cmmCodeLRepository.queryComboCode(searchKeyDto.getCodeGrpId());
}
@Override
public Page<CmmCodeGrp> findCmmCodeGrps(CmmCodeDto cmmCodeDto, Pageable pageable) {
Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr");
pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), sort);
Example<CmmCodeGrp> example = Example.of(codeGrpstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny());
return cmmCodeGrpRepository.findAll(example, pageable);
}
@Override
public List<?> findCmmCodes(CmmCodeDto cmmCodeDto) {
Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr");
AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeGrpId()), "조회할 코드그룹을 선택해 주세요.");
// 소분류 코드 조회
if(StringUtils.hasText(cmmCodeDto.getCodeMcd())){
AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeLcd()), "대분류 코드가 선택되지 않았습니다.");
Example<CmmCodeS> example = Example.of(codeSstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny());
return cmmCodeSRepository.findAll(example, sort);
}
// 중분류 코드 조회
if(StringUtils.hasText(cmmCodeDto.getCodeLcd())){
Example<CmmCodeM> example = Example.of(codeMstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny());
return cmmCodeMRepository.findAll(example, sort);
}
// 대분류 코드 조회
Example<CmmCodeL> example = Example.of(codeLstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny());
return cmmCodeLRepository.findAll(example, sort);
}
@Override
@Transactional
public CmmCodeGrp saveCmmCodeGrp(CmmCodeGrp cmmCodeGrp) {
AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeGrpId()), "코드 그룹을 입력해 주세요.");
AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeNm()), "코드 그룹명 입력해 주세요.");
AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeOrdr()), "정렬 순서를 입력해 주세요.");
return cmmCodeGrpRepository.save(cmmCodeGrp);
} }
// @Override // @Override
// @Transactional // public Page<CmmCodeGrp> findCmmCodeGrps(CmmCodeDto cmmCodeDto, Pageable pageable) {
// public CmmCodeL saveCmmCodeL(CmmCodeL cmmCodeL) { // Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr");
// AssertUtils.state(!Checks.isEmpty(cmmCodeL.getCodeGrpId()), "코드 그룹을 입력해 주세요."); // pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), sort);
// AssertUtils.state(!Checks.isEmpty(cmmCodeL.getCodeCd()), "대분류 코드를 입력해 주세요."); // Example<CmmCodeGrp> example = Example.of(codeGrpstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny());
// AssertUtils.state(!Checks.isEmpty(cmmCodeL.getCodeNm()), "대분류 코드명 입력해 주세요."); // return cmmCodeGrpRepository.findAll(example, pageable);
// AssertUtils.state(!Checks.isEmpty(cmmCodeL.getCodeOrdr()), "정렬 순서를 입력해 주세요.");
// return cmmCodeLRepository.save(cmmCodeL);
// } // }
// //
// @Override // @Override
// @Transactional // public List<?> findCmmCodes(CmmCodeDto cmmCodeDto) {
// public CmmCodeM saveCmmCodeM(CmmCodeM cmmCodeM) { // Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr");
// AssertUtils.state(!Checks.isEmpty(cmmCodeM.getCodeGrpId()), "코드 그룹을 입력해 주세요."); // AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeGrpId()), "조회할 코드그룹을 선택해 주세요.");
// AssertUtils.state(!Checks.isEmpty(cmmCodeM.getCodeLcd()), "대분류 코드를 입력해 주세요."); //
// AssertUtils.state(!Checks.isEmpty(cmmCodeM.getCodeCd()), "중분류 코드를 입력해 주세요."); // // 소분류 코드 조회
// AssertUtils.state(!Checks.isEmpty(cmmCodeM.getCodeNm()), "중분류 코드명 입력해 주세요."); // if(StringUtils.hasText(cmmCodeDto.getCodeMcd())){
// AssertUtils.state(!Checks.isEmpty(cmmCodeM.getCodeOrdr()), "정렬 순서를 입력해 주세요."); // AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeLcd()), "대분류 코드가 선택되지 않았습니다.");
// return cmmCodeMRepository.save(cmmCodeM); // Example<CmmCodeS> example = Example.of(codeSstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny());
// return cmmCodeSRepository.findAll(example, sort);
// }
//
// // 중분류 코드 조회
// if(StringUtils.hasText(cmmCodeDto.getCodeLcd())){
// Example<CmmCodeM> example = Example.of(codeMstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny());
// return cmmCodeMRepository.findAll(example, sort);
// }
//
// // 대분류 코드 조회
// Example<CmmCodeL> example = Example.of(codeLstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny());
// return cmmCodeLRepository.findAll(example, sort);
// } // }
// //
// @Override // @Override
// @Transactional // @Transactional
// public CmmCodeS saveCmmCodeS(CmmCodeS cmmCodeS) { // public CmmCodeGrp saveCmmCodeGrp(CmmCodeGrp cmmCodeGrp) {
// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeGrpId()), "코드그룹을 입력해 주세요."); // AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeGrpId()), "코드 그룹을 입력해 주세요.");
// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeLcd()), "대분류 코드를 입력해 주세요."); // AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeNm()), "코드 그룹명 입력해 주세요.");
// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeMcd()), "중분류 코드를 입력해 주세요."); // AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeOrdr()), "정렬 순서를 입력해 주세요.");
// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeCd()), "소분류 코드를 입력해 주세요."); // return cmmCodeGrpRepository.save(cmmCodeGrp);
// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeNm()), "소분류 코드명 입력해 주세요.");
// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeOrdr()), "정렬 순서를 입력해 주세요.");
// return cmmCodeSRepository.save(cmmCodeS);
// } // }
//
// private void validate(Class<?> clz){ // @Transactional
// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeGrpId()), "코드그룹을 입력해 주세요."); // @Override
// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeCd()), "대분류코드를 입력해 주세요."); // public Object saveCmmCode(CmmCodeDto cmmCodeDto) {
// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeNm()), "대분류코드명 입력해 주세요."); // AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeGrpId()), "코드그룹을 입력해 주세요.");
// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeOrdr()), "정렬순서를 입력해 주세요."); // AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeCd()), "코드를 입력해 주세요.");
// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeNm()), "코드명을 입력해 주세요.");
//
// // 소분류 코드
// if(StringUtils.hasText(cmmCodeDto.getCodeMcd())){
// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeLcd()), "대분류 코드를 입력해 주세요.");
// return cmmCodeSRepository.save(codeSstruct.toEntity(cmmCodeDto));
// }
//
// // 중분류 코드
// if(StringUtils.hasText(cmmCodeDto.getCodeLcd())){
// return cmmCodeMRepository.save(codeMstruct.toEntity(cmmCodeDto));
// }
//
// // 대분류 코드
// return cmmCodeLRepository.save(codeLstruct.toEntity(cmmCodeDto));
// } // }
@Transactional
@Override
public Object saveCmmCode(CmmCodeDto cmmCodeDto) {
AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeGrpId()), "코드그룹을 입력해 주세요.");
AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeCd()), "코드를 입력해 주세요.");
AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeNm()), "코드명을 입력해 주세요.");
// 소분류 코드
if(StringUtils.hasText(cmmCodeDto.getCodeMcd())){
AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeLcd()), "대분류 코드를 입력해 주세요.");
return cmmCodeSRepository.save(codeSstruct.toEntity(cmmCodeDto));
}
// 중분류 코드
if(StringUtils.hasText(cmmCodeDto.getCodeLcd())){
return cmmCodeMRepository.save(codeMstruct.toEntity(cmmCodeDto));
}
// 대분류 코드
return cmmCodeLRepository.save(codeLstruct.toEntity(cmmCodeDto));
}
} }

@ -0,0 +1,93 @@
package com.xit.biz.ctgy.v2.service.impl;
import com.xit.biz.ctgy.v2.service.ICmmFileService;
import com.xit.core.util.AssertUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.Objects;
@Slf4j
@Service
@RequiredArgsConstructor
public class CmmFileService implements ICmmFileService {
@Value("${file.cmm.upload.url}")
private String serviceUrl;
@Value("${file.cmm.upload.allow.ext:}")
private String allowExt;
@Value("${file.cmm.upload.max.size:1024}")
private long maxSize;
/**
*
* return(ex : 20220406)
* -> rootPath + uploadPath + + fileName
* @param files MultipartFile[]
* @return String makePath
*/
@Override
@Transactional
public String uploadFiles(MultipartFile[] files, String rootPath, String uploadPath) {
String makePath = "";
if(files != null && files.length > 0){
//makePath = File.separator + DateUtil.getToday("");
// 파일 경로 : upload root 제외
String urlPath = uploadPath + makePath;
// 물리적인 파일 저장 위치
String fileUploadPath = rootPath + urlPath;
File file = new File(fileUploadPath);
if(!file.exists()) file.mkdirs();
for(MultipartFile mf : files) {
if (!mf.isEmpty()) {
String orgFileName = "";
try {
orgFileName = StringUtils.cleanPath(Objects.requireNonNull(mf.getOriginalFilename()));
mf.transferTo(new File(fileUploadPath + File.separator + orgFileName));
// inputStream을 가져와
// copyOfLocation (저장위치)로 파일을 쓴다.
// copy의 옵션은 기존에 존재하면 REPLACE(대체한다), 오버라이딩 한다
//Files.copy(multipartFile.getInputStream(), copyOfLocation, StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
String errMsg = String.format("File Upload Error :: %s[ %s ]", e.getLocalizedMessage(), orgFileName);
//TODO : 에러처리
//return RestError.of(String.format("File Upload Error :: %s", orgFileName));
AssertUtils.isTrue(false, errMsg);
}
}
}
}
return makePath;
}
}
/*
// File.seperator 는 OS종속적이다.
// Spring에서 제공하는 cleanPath()를 통해서 ../ 내부 점들에 대해서 사용을 억제한다
Path copyOfLocation = Paths.get(uploadDir + File.separator + StringUtils.cleanPath(multipartFile.getOriginalFilename()));
try {
// inputStream을 가져와서
// copyOfLocation (저장위치)로 파일을 쓴다.
// copy의 옵션은 기존에 존재하면 REPLACE(대체한다), 오버라이딩 한다
Files.copy(multipartFile.getInputStream(), copyOfLocation, StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
e.printStackTrace();
throw new FileStorageException("Could not store file : " + multipartFile.getOriginalFilename());
}
*/

@ -36,11 +36,8 @@ import java.util.stream.Collectors;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class ParkingService implements IParkingService { public class ParkingService implements IParkingService {
private final IParkingRepository repository;
private final ParkingDao parkingDao; private final ParkingDao parkingDao;
private final UserDao userDao; private final UserDao userDao;
private final IParkingJudgeUserRepository parkingJudgeUserRepository;
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
@ -182,13 +179,13 @@ public class ParkingService implements IParkingService {
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public List<JudgeListDto> findByUserJudges() { public List<JudgeListDto> findByUserJudges() {
return repository.findByUserJudges(); return parkingDao.findByUserJudges();
} }
@Override @Override
@Transactional @Transactional
public void saveJudgeResult(JudgeListDto dto){ public void saveJudgeResult(JudgeListDto dto){
parkingJudgeUserRepository.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(), parkingDao.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(),
dto.getMsuResult(), dto.getMsuResult(),
dto.getMsuReason(), dto.getMsuReason(),
LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))); LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))));

@ -1,18 +1,12 @@
package com.xit.biz.ctgy.v2.service.impl; package com.xit.biz.ctgy.v2.service.impl;
import com.xit.biz.cmm.service.ICmmFileService; import com.xit.biz.ctgy.v2.service.ICmmFileService;
import com.xit.biz.ctgy.CtgyConstants; import com.xit.biz.ctgy.CtgyConstants;
import com.xit.biz.ctgy.dto.*; import com.xit.biz.ctgy.dto.*;
import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct;
import com.xit.biz.ctgy.entity.GnRecallSc; 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.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.repository.ParkingDao; import com.xit.biz.ctgy.v2.repository.ParkingDao;
import com.xit.biz.ctgy.v2.repository.PublicBoardDao;
import com.xit.biz.ctgy.v2.repository.ResidentAndDisabledDao; import com.xit.biz.ctgy.v2.repository.ResidentAndDisabledDao;
import com.xit.biz.ctgy.v2.repository.UserDao; import com.xit.biz.ctgy.v2.repository.UserDao;
import com.xit.biz.ctgy.v2.service.IResidentAndDisabledService; import com.xit.biz.ctgy.v2.service.IResidentAndDisabledService;
@ -23,18 +17,15 @@ import com.xit.core.util.Checks;
import com.xit.core.util.DateUtil; import com.xit.core.util.DateUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.mapstruct.factory.Mappers;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.persistence.EntityManager;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@ -50,26 +41,17 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class ResidentAndDisabledService implements IResidentAndDisabledService { public class ResidentAndDisabledService implements IResidentAndDisabledService {
@Value("${file.cmm.upload.root:c:/data/file/upload}") @Value("${file.cmm.upload.root:c:/data/file/upload}")
private String rootPath; private String rootPath;
@Value("${file.cmm.upload.simsaPath:[simUpFile_sc1]}") @Value("${file.cmm.upload.simsaPath:[simUpFile_sc1]}")
private String[] uploadPath; private String[] uploadPath;
private final GnRecallScMapstruct mapstruct = Mappers.getMapper(GnRecallScMapstruct.class);
private final IResidentAndDisabledRepository gnReacallRepository;
private final ResidentAndDisabledDao residentAndDisabledDao; private final ResidentAndDisabledDao residentAndDisabledDao;
private final UserDao userDao; private final UserDao userDao;
private final IJudgeUserRepository judgeUserRepository;
private final IResidentAndDisabledMapper residentAndDisabledMapper;
private final ParkingDao parkingDao; private final ParkingDao parkingDao;
private final ICmmFileService fileService; private final ICmmFileService fileService;
private final IPublicBoardService pBoardService; private final PublicBoardDao publicBoardDao;
private final IParkingMapper parkingMapper;
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
@ -78,11 +60,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Page<GnRecallScDto> findJudgeDatas(@NotNull final String scDatagb, Pageable pageable) { public Page<GnRecallScDto> findJudgeDatas(@NotNull final String scDatagb, Pageable pageable) {
// Sort sort = Sort.by(Sort.Direction.DESC, "inCode");
pageable = JpaUtil.getPagingInfo(pageable); pageable = JpaUtil.getPagingInfo(pageable);
// return gnReacallRepository.findJudgeDatas(
// scDatagb,
// PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("scCode").descending()));
return residentAndDisabledDao.findJudgeDatas(scDatagb, pageable); return residentAndDisabledDao.findJudgeDatas(scDatagb, pageable);
} }
@ -247,57 +225,6 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
return resultMap; 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")));
// 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 * 1. : min_simsa680_sc : ms_datagb, ms_chasu, ms_sdate, ms_edate ms_maincode
@ -353,10 +280,11 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Map<String,Object> findDashboard(){ public Map<String,Object> findDashboard(){
Map<String, Object> resultMap = new HashMap<>(); 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("pBoardList", publicBoardDao.findAll(new MinInfoBoard680Dto(), PageRequest.of(0, 7)));
resultMap.put("residentJudgeList", residentAndDisabledMapper.selectDashboardJudgeList(CtgyConstants.Judge.DATAGB_RESIDENT.getCode())); resultMap.put("parkJudgeList", parkingDao.findDashboardJudgeList());
resultMap.put("disabledJudgeList", residentAndDisabledMapper.selectDashboardJudgeList(CtgyConstants.Judge.DATAGB_DISABLED.getCode())); resultMap.put("residentJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_RESIDENT.getCode()));
resultMap.put("disabledJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_DISABLED.getCode()));
return resultMap; return resultMap;
} }
@ -388,13 +316,13 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public List<JudgeListDto> findByUserJudges(JudgeListDto dto) { public List<JudgeListDto> findByUserJudges(JudgeListDto dto) {
return gnReacallRepository.findByUserJudges(dto); return residentAndDisabledDao.findByUserJudges(dto);
} }
@Override @Override
@Transactional @Transactional
public void saveJudgeResult(JudgeListDto dto){ public void saveJudgeResult(JudgeListDto dto){
judgeUserRepository.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(), residentAndDisabledDao.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(),
dto.getMsuResult(), dto.getMsuResult(),
dto.getMsuReason(), dto.getMsuReason(),
LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))); LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))));

@ -338,7 +338,7 @@
, (SELECT * , (SELECT *
FROM (SELECT ms_edate FROM (SELECT ms_edate
FROM min_simsa680 FROM min_simsa680
WHERE MS_RESULT = '0' WHERE ms_result = '0'
ORDER BY ms_edate DESC) ORDER BY ms_edate DESC)
WHERE ROWNUM = 1) T WHERE ROWNUM = 1) T
WHERE MS.ms_maincode = MSU.msu_maincode WHERE MS.ms_maincode = MSU.msu_maincode
@ -349,4 +349,42 @@
ORDER BY MSU.msu_team, MU.name ORDER BY MSU.msu_team, MU.name
</native-query> </native-query>
<native-query id="selectByUserJudgeList">
/* parking-mapper|selectByUserJudgeList|julim */
SELECT MS.ms_maincode
, MS.ms_seq
, MS.ms_carnum
, MS.ms_result
, MS.ms_year
, MS.ms_chasu
, MS.ms_sdate
, MS.ms_startsi
, MS.ms_edate
, MS.ms_cdate
, MS.ms_closesi
, MS.ms_datagb
, MSU.msu_code
, MSU.msu_result
, MSU.msu_reason
, TM.mm_wdate as scWdate
FROM min_simsa680 MS
, min_simsa_user680 MSU
, tf680_recall TR
, tf680_main TM
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_maincode = TR.rc_code
AND TR.rc_maincode = TM.mm_code
AND MSU.msu_userid = #{msuUserid}
ORDER BY MS.ms_sdate, MS.ms_edate, MS.ms_seq
</native-query>
<native-query id="updateMsuResonAndMsuResultByMsuCode">
/* parking-mapper|updateMsuResonAndMsuResultByMsuCode|julim */
UPDATE min_simsa_user680
SET msu_reason = #{msuReason}
, msu_result = #{msuResult}
, msu_indate = #{msuIndate}
WHERE msu_code = #{msuCode}
</native-query>
</entity-mappings> </entity-mappings>

@ -589,21 +589,64 @@
, MU.name , MU.name
, SUM(DECODE(MSU.msu_result, 0, 0, 1)) jcnt , SUM(DECODE(MSU.msu_result, 0, 0, 1)) jcnt
, COUNT(*) tcnt , COUNT(*) tcnt
FROM min_simsa680 MS FROM min_simsa680_sc MS
, min_simsa_user680 MSU , min_simsa_user680_sc MSU
, min_userinfo MU , min_userinfo MU
, (SELECT * , (SELECT *
FROM (SELECT ms_edate FROM (SELECT ms_edate
FROM min_simsa680 FROM min_simsa680_sc
WHERE MS_RESULT = '0' WHERE ms_datagb = #{msDatagb}
AND ms_result = '0'
ORDER BY ms_edate DESC) ORDER BY ms_edate DESC)
WHERE ROWNUM = 1) T WHERE ROWNUM = 1) T
WHERE MS.ms_maincode = MSU.msu_maincode WHERE MS.ms_datagb = #{msDatagb}
AND MS.ms_result = '0' AND MS.ms_result = '0'
MS.ms_maincode = MSU.msu_maincode
AND MSU.msu_userid = MU.userid AND MSU.msu_userid = MU.userid
AND MS.ms_edate = T.ms_edate AND MS.ms_edate = T.ms_edate
GROUP BY MS.ms_edate, MSU.msu_team, MU.name GROUP BY MS.ms_edate, MSU.msu_team, MU.name
ORDER BY MSU.msu_team, MU.name ORDER BY MSU.msu_team, MU.name
</native-query> </native-query>
<native-query id="selectByUserJudgeList">
/* residentAndDisabled-mapper|selectByUserJudgeList|julim */
SELECT MS.ms_maincode
, MS.ms_seq
, MS.ms_carnum
, MS.ms_result
, MS.ms_year
, MS.ms_chasu
, MS.ms_sdate
, MS.ms_startsi
, MS.ms_edate
, MS.ms_cdate
, MS.ms_closesi
, MS.ms_datagb
, MSU.msu_code
, MSU.msu_result
, MSU.msu_reason
, GR.sc_wdate
, GR.sc_pos
FROM min_simsa680_sc MS
, min_simsa_user680_sc MSU
, gn_recall_sc GR
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_maincode = GR.sc_code
AND MSU.msu_userid = #{msuUserid}
<if test="msDatagb != null and msDatagb != ''">
AND MS.ms_datagb = #{msDatagb}
</if>
ORDER BY MS.ms_sdate, MS.ms_edate, MS.ms_seq
</native-query>
<native-query id="updateMsuResonAndMsuResultByMsuCode">
/* residentAndDisabled-mapper|updateMsuResonAndMsuResultByMsuCode|julim */
UPDATE min_simsa_user680_sc
SET msu_reason = #{msuReason}
, msu_result = #{msuResult}
, msu_indate = #{msuIndate}
WHERE msu_code = #{msuCode}
</native-query>
</entity-mappings> </entity-mappings>
Loading…
Cancel
Save