diff --git a/src/main/java/com/interplug/qcast/batch/master/SpecialNoteDispItemJobConfiguration.java b/src/main/java/com/interplug/qcast/batch/master/SpecialNoteDispItemJobConfiguration.java index 195004b0..d1448c5e 100644 --- a/src/main/java/com/interplug/qcast/batch/master/SpecialNoteDispItemJobConfiguration.java +++ b/src/main/java/com/interplug/qcast/batch/master/SpecialNoteDispItemJobConfiguration.java @@ -1,8 +1,14 @@ package com.interplug.qcast.batch.master; +import com.interplug.qcast.biz.specialNote.SpecialNoteService; +import com.interplug.qcast.biz.specialNote.dto.SpecialNoteItemRequest; +import com.interplug.qcast.biz.specialNote.dto.SpecialNoteRequest; +import com.interplug.qcast.biz.specialNote.dto.SpecialNoteSyncResponse; +import com.interplug.qcast.util.InterfaceQsp; import java.util.Collections; import java.util.List; import java.util.function.Consumer; +import lombok.extern.slf4j.Slf4j; import org.springframework.batch.core.Job; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobExecutionListener; @@ -19,14 +25,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; import org.springframework.transaction.PlatformTransactionManager; -import com.interplug.qcast.biz.displayItem.DisplayItemService; -import com.interplug.qcast.biz.displayItem.dto.DisplayItemRequest; -import com.interplug.qcast.biz.specialNote.SpecialNoteService; -import com.interplug.qcast.biz.specialNote.dto.SpecialNoteItemRequest; -import com.interplug.qcast.biz.specialNote.dto.SpecialNoteRequest; -import com.interplug.qcast.biz.specialNote.dto.SpecialNoteSyncResponse; -import com.interplug.qcast.util.InterfaceQsp; -import lombok.extern.slf4j.Slf4j; @Configuration @Slf4j @@ -35,92 +33,100 @@ public class SpecialNoteDispItemJobConfiguration implements JobExecutionListener private final InterfaceQsp interfaceQsp; private final SpecialNoteService specialNoteService; - private final DisplayItemService displayItemService; @Value("${qsp.master-special-note-disp-item-batch-url}") private String qspMasterSpecialNoteDispItemBatchUrl; private SpecialNoteSyncResponse SpecialNoteDispItemSyncResponse; - public SpecialNoteDispItemJobConfiguration(InterfaceQsp interfaceQsp, - SpecialNoteService specialNoteService, DisplayItemService displayItemService) { + public SpecialNoteDispItemJobConfiguration( + InterfaceQsp interfaceQsp, SpecialNoteService specialNoteService) { this.interfaceQsp = interfaceQsp; this.specialNoteService = specialNoteService; - this.displayItemService = displayItemService; } @Override public void beforeJob(JobExecution jobExecution) { log.info("Job 시작: 초기화 메서드 호출 중..."); try { - this.SpecialNoteDispItemSyncResponse = interfaceQsp.callApiData(HttpMethod.GET, - qspMasterSpecialNoteDispItemBatchUrl, null, SpecialNoteSyncResponse.class); - log.info("API 호출 완료, 항목 수: {}", - this.SpecialNoteDispItemSyncResponse.getSdOrderSpnList().size()); + this.SpecialNoteDispItemSyncResponse = + interfaceQsp.callApiData( + HttpMethod.GET, + qspMasterSpecialNoteDispItemBatchUrl, + null, + SpecialNoteSyncResponse.class); + log.info( + "API 호출 완료, 항목 수: {}", this.SpecialNoteDispItemSyncResponse.getSdOrderSpnList().size()); } catch (Exception e) { log.error("specialNoteDispItemSyncResponse 갱신 중 오류: {}", e.getMessage()); } } @Bean - public Job specialNoteDispItemAdditionalJob(JobRepository jobRepository, Step specialNoteStep, - Step specialNoteItemStep, Step storeDispItemStep) { - return new JobBuilder("specialNoteDispItemAdditionalJob", jobRepository).start(specialNoteStep) - .next(specialNoteItemStep).next(storeDispItemStep).listener(this).build(); + public Job specialNoteDispItemAdditionalJob( + JobRepository jobRepository, Step specialNoteStep, Step specialNoteItemStep) { + return new JobBuilder("specialNoteDispItemAdditionalJob", jobRepository) + .start(specialNoteStep) + .next(specialNoteItemStep) + .listener(this) + .build(); } - private Step buildStep(String stepName, JobRepository jobRepository, - PlatformTransactionManager transactionManager, ItemReader reader, ItemWriter writer) { - return new StepBuilder(stepName, jobRepository).chunk(10, transactionManager) - .reader(reader).writer(writer).build(); + private Step buildStep( + String stepName, + JobRepository jobRepository, + PlatformTransactionManager transactionManager, + ItemReader reader, + ItemWriter writer) { + return new StepBuilder(stepName, jobRepository) + .chunk(10, transactionManager) + .reader(reader) + .writer(writer) + .build(); } @Bean - public Step specialNoteStep(JobRepository jobRepository, - PlatformTransactionManager transactionManager) { - return buildStep("specialNoteStep", jobRepository, transactionManager, specialNoteListReader(), - createWriter((items) -> { - try { - log.debug("Special Note batch processing {} items", items.size()); - specialNoteService.setSpecialNoteBatch(items); - log.debug("Successfully processed Special Note batch"); - } catch (Exception e) { - log.error("Error processing Special Note batch: {}", e.getMessage(), e); - throw new RuntimeException("Failed to process Special Note batch", e); - } - }, "specialNote")); + public Step specialNoteStep( + JobRepository jobRepository, PlatformTransactionManager transactionManager) { + return buildStep( + "specialNoteStep", + jobRepository, + transactionManager, + specialNoteListReader(), + createWriter( + (items) -> { + try { + log.debug("Special Note batch processing {} items", items.size()); + specialNoteService.setSpecialNoteBatch(items); + log.debug("Successfully processed Special Note batch"); + } catch (Exception e) { + log.error("Error processing Special Note batch: {}", e.getMessage(), e); + throw new RuntimeException("Failed to process Special Note batch", e); + } + }, + "specialNote")); } @Bean - public Step specialNoteItemStep(JobRepository jobRepository, - PlatformTransactionManager transactionManager) { - return buildStep("specialNoteItemStep", jobRepository, transactionManager, - specialNoteItemListReader(), createWriter((items) -> { - try { - log.debug("Special Note Item batch processing {} items", items.size()); - specialNoteService.setSpecialNoteItemBatch(items); - log.debug("Successfully processed Special Note Item batch"); - } catch (Exception e) { - log.error("Error processing Special Note Item batch: {}", e.getMessage(), e); - throw new RuntimeException("Failed to process Special Note Item batch", e); - } - }, "specialNoteItem")); - } - - @Bean - public Step storeDispItemStep(JobRepository jobRepository, - PlatformTransactionManager transactionManager) { - return buildStep("storeDispItemStep", jobRepository, transactionManager, - storeDispItemListReader(), createWriter((items) -> { - try { - log.debug("Store Disp Item batch processing {} items", items.size()); - displayItemService.setStoreDispItemBatch(items); - log.debug("Successfully processed Store Disp Item batch"); - } catch (Exception e) { - log.error("Error processing Store Disp Item batch: {}", e.getMessage(), e); - throw new RuntimeException("Failed to process Store Disp Item batch", e); - } - }, "storeDispItem")); + public Step specialNoteItemStep( + JobRepository jobRepository, PlatformTransactionManager transactionManager) { + return buildStep( + "specialNoteItemStep", + jobRepository, + transactionManager, + specialNoteItemListReader(), + createWriter( + (items) -> { + try { + log.debug("Special Note Item batch processing {} items", items.size()); + specialNoteService.setSpecialNoteItemBatch(items); + log.debug("Successfully processed Special Note Item batch"); + } catch (Exception e) { + log.error("Error processing Special Note Item batch: {}", e.getMessage(), e); + throw new RuntimeException("Failed to process Special Note Item batch", e); + } + }, + "specialNoteItem")); } private ListItemReader createReader(List items, String readerName) { @@ -131,25 +137,21 @@ public class SpecialNoteDispItemJobConfiguration implements JobExecutionListener @Bean @StepScope public ListItemReader specialNoteListReader() { - return createReader(SpecialNoteDispItemSyncResponse != null - ? SpecialNoteDispItemSyncResponse.getSdOrderSpnList() - : null, "specialNote"); + return createReader( + SpecialNoteDispItemSyncResponse != null + ? SpecialNoteDispItemSyncResponse.getSdOrderSpnList() + : null, + "specialNote"); } @Bean @StepScope public ListItemReader specialNoteItemListReader() { - return createReader(SpecialNoteDispItemSyncResponse != null - ? SpecialNoteDispItemSyncResponse.getSdOrderSpnItemList() - : null, "specialNoteItem"); - } - - @Bean - @StepScope - public ListItemReader storeDispItemListReader() { - return createReader(SpecialNoteDispItemSyncResponse != null - ? SpecialNoteDispItemSyncResponse.getStoreDispItemList() - : null, "storeDispItem"); + return createReader( + SpecialNoteDispItemSyncResponse != null + ? SpecialNoteDispItemSyncResponse.getSdOrderSpnItemList() + : null, + "specialNoteItem"); } private ItemWriter createWriter(Consumer> processor, String writerName) { diff --git a/src/main/java/com/interplug/qcast/batch/master/StoreJobConfiguration.java b/src/main/java/com/interplug/qcast/batch/master/StoreJobConfiguration.java index 20fb8cf6..ed2443a7 100644 --- a/src/main/java/com/interplug/qcast/batch/master/StoreJobConfiguration.java +++ b/src/main/java/com/interplug/qcast/batch/master/StoreJobConfiguration.java @@ -1,5 +1,7 @@ package com.interplug.qcast.batch.master; +import com.interplug.qcast.biz.displayItem.DisplayItemService; +import com.interplug.qcast.biz.displayItem.dto.DisplayItemRequest; import com.interplug.qcast.biz.storeFavorite.StoreFavoriteService; import com.interplug.qcast.biz.storeFavorite.dto.StoreFavoriteRequest; import com.interplug.qcast.biz.user.UserService; @@ -32,6 +34,7 @@ public class StoreJobConfiguration implements JobExecutionListener { private final InterfaceQsp interfaceQsp; private final UserService userService; private final StoreFavoriteService storeFavService; + private final DisplayItemService displayItemService; @Value("${qsp.master-store-batch-url}") private String qspMasterStoreBatchUrl; @@ -39,10 +42,14 @@ public class StoreJobConfiguration implements JobExecutionListener { private StoreSyncResponse storeSyncResponse; public StoreJobConfiguration( - InterfaceQsp interfaceQsp, UserService userService, StoreFavoriteService storeFavService) { + InterfaceQsp interfaceQsp, + UserService userService, + StoreFavoriteService storeFavService, + DisplayItemService displayItemService) { this.interfaceQsp = interfaceQsp; this.userService = userService; this.storeFavService = storeFavService; + this.displayItemService = displayItemService; } @Override @@ -60,11 +67,16 @@ public class StoreJobConfiguration implements JobExecutionListener { @Bean public Job storeAdditionalJob( - JobRepository jobRepository, Step storeStep, Step userStep, Step favoriteStep) { + JobRepository jobRepository, + Step storeStep, + Step userStep, + Step favoriteStep, + Step storeDispItemStep) { return new JobBuilder("storeAdditionalJob", jobRepository) .start(storeStep) .next(userStep) .next(favoriteStep) + .next(storeDispItemStep) .listener(this) .build(); } @@ -138,6 +150,28 @@ public class StoreJobConfiguration implements JobExecutionListener { "favorite")); } + @Bean + public Step storeDispItemStep( + JobRepository jobRepository, PlatformTransactionManager transactionManager) { + return buildStep( + "storeDispItemStep", + jobRepository, + transactionManager, + storeDispItemListReader(), + createWriter( + (items) -> { + try { + log.debug("Store Disp Item batch processing {} items", items.size()); + displayItemService.setStoreDispItemBatch(items); + log.debug("Successfully processed Store Disp Item batch"); + } catch (Exception e) { + log.error("Error processing Store Disp Item batch: {}", e.getMessage(), e); + throw new RuntimeException("Failed to process Store Disp Item batch", e); + } + }, + "storeDispItem")); + } + private ListItemReader createReader(List items, String readerName) { log.info("{}Reader 호출됨...", readerName); return new ListItemReader<>(items != null ? items : Collections.emptyList()); @@ -163,6 +197,14 @@ public class StoreJobConfiguration implements JobExecutionListener { storeSyncResponse != null ? storeSyncResponse.getStoreFavList() : null, "storeFav"); } + @Bean + @StepScope + public ListItemReader storeDispItemListReader() { + return createReader( + storeSyncResponse != null ? storeSyncResponse.getStoreDispItemList() : null, + "storeDispItem"); + } + private ItemWriter createWriter(Consumer> processor, String writerName) { return items -> { try { diff --git a/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusController.java b/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusController.java index eac5b83f..27ef93d3 100644 --- a/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusController.java +++ b/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusController.java @@ -17,43 +17,44 @@ import org.springframework.web.bind.annotation.*; public class CanvasStatusController { private final CanvasStatusService canvasStatusService; - @Operation(description = "계정에 해당하는 전체 견적서를 조회 한다.") + @Operation(description = "사용자(userId)에 해당하는 전체 캔버스를 조회 한다.") @GetMapping("/canvas-statuses/{userId}") - public List selectAllCanvasStatus(@PathVariable String userId) throws QcastException { + public List selectAllCanvasStatus(@PathVariable String userId) + throws QcastException { return canvasStatusService.selectAllCanvasStatus(userId); } - - @Operation(description = "견적서를 조회 한다.") + + @Operation(description = "사용자(userId)와 물건번호(objectNo)에 해당하는 캔버스를 조회 한다.") @GetMapping("/canvas-statuses/by-object/{objectNo}/{userId}") - public List selectObjectNoCanvasStatus(@PathVariable String objectNo, @PathVariable String userId) throws QcastException { + public List selectObjectNoCanvasStatus( + @PathVariable String objectNo, @PathVariable String userId) throws QcastException { return canvasStatusService.selectObjectNoCanvasStatus(objectNo, userId); } - - @Operation(description = "견적서를 등록 한다.") + + @Operation(description = "캔버스를 등록 한다.") @PostMapping("/canvas-statuses") @ResponseStatus(HttpStatus.CREATED) public Integer insertCanvasStatus(@RequestBody CanvasStatus cs) throws QcastException { - return canvasStatusService.insertCanvasStatus(cs); + return canvasStatusService.insertCanvasStatus(cs); } - @Operation(description = "견적서를 수정 한다.") + @Operation(description = "캔버스를 수정 한다.") @PutMapping("/canvas-statuses") public void updateCanvasStatus(@RequestBody CanvasStatus cs) throws QcastException { - canvasStatusService.updateCanvasStatus(cs); + canvasStatusService.updateCanvasStatus(cs); } - - @Operation(description = "견적서를 삭제 한다.") + + @Operation(description = "물건번호(objectNo)에 해당하는캔버스를 삭제 한다.") @DeleteMapping("/canvas-statuses/by-object/{objectNo}") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteObjectNoCanvasStatus(@PathVariable String objectNo) throws QcastException { - canvasStatusService.deleteObjectNoCanvasStatus(objectNo); + canvasStatusService.deleteObjectNoCanvasStatus(objectNo); } - - @Operation(description = "견적서의 이미지(템플릿)를 삭제 한다.") + + @Operation(description = "id에 해당하는 캔버스를 삭제 한다.") @DeleteMapping("/canvas-statuses/by-id/{id}") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteIdCanvasStatus(@PathVariable Integer id) throws QcastException { - canvasStatusService.deleteIdCanvasStatus(id); + canvasStatusService.deleteIdCanvasStatus(id); } - } diff --git a/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusMapper.java b/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusMapper.java index c76b892e..94c312e0 100644 --- a/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusMapper.java +++ b/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusMapper.java @@ -2,46 +2,42 @@ package com.interplug.qcast.biz.canvasStatus; import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus; import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse; - import java.util.List; - import org.apache.ibatis.annotations.Mapper; @Mapper public interface CanvasStatusMapper { - // objectNo 생성(미사용) - public CanvasStatus getCanvasStatusNewObjectNo(String userId); - - // imageName 생성(미사용) - public CanvasStatus getCanvasStatusImageAdd(String objectNo); - - // 전체 견적서 조회 - public List selectAllCanvasStatus(String userId); - - // 견적서 조회(objectNo/userId) - public List selectObjectNoCanvasStatus(String objectNo, String userId); - - // 견적서 조회(Max id) - public List getMaxIdCanvasStatus(String objectNo, String userId); - - // 견적서 조회(id별) - public List getIdCanvasStatus(Integer id); - - // 견적서 조회(objectNo) - public List getObjectNoCanvasStatus(String objectNo); - - // 견적서 등록 - public void insertCanvasStatus(CanvasStatus cs); - - // 견적서 수정 - public void updateCanvasStatus(CanvasStatus cs); - - // 견적서 삭제 - public void deleteObjectNoCanvasStatus(String objectNo); - - // 이미지(템플릿) 삭제 - public void deleteIdCanvasStatus(Integer id); + // objectNo 생성(미사용) + public CanvasStatus getCanvasStatusNewObjectNo(String userId); - -} \ No newline at end of file + // imageName 생성(미사용) + public CanvasStatus getCanvasStatusImageAdd(String objectNo); + + // 전체 캔버스 조회 by 사용자(userId) + public List selectAllCanvasStatus(String userId); + + // 캔버스 조회 by 물건번호(objectNo) && 사용자(userId) + public List selectObjectNoCanvasStatus(String objectNo, String userId); + + // 캔버스 조회 by Max(id) + public List getMaxIdCanvasStatus(String objectNo, String userId); + + // 캔버스 조회 by id + public List getIdCanvasStatus(Integer id); + + // 캔버스 조회 by 물건번호(objectNo) + public List getObjectNoCanvasStatus(String objectNo); + + // 캔버스 등록 + public void insertCanvasStatus(CanvasStatus cs); + + // 캔버스 수정 + public void updateCanvasStatus(CanvasStatus cs); + + // 캔버스 삭제 by 물건번호(objectNo) + public void deleteObjectNoCanvasStatus(String objectNo); + + // 캔버스 삭제 by id + public void deleteIdCanvasStatus(Integer id); +} diff --git a/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusService.java b/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusService.java index 3f8cefc3..281bb3e3 100644 --- a/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusService.java +++ b/src/main/java/com/interplug/qcast/biz/canvasStatus/CanvasStatusService.java @@ -4,119 +4,119 @@ import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus; import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse; import com.interplug.qcast.config.Exception.ErrorCode; import com.interplug.qcast.config.Exception.QcastException; - -import lombok.RequiredArgsConstructor; - import java.util.List; +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @Service @RequiredArgsConstructor public class CanvasStatusService { - private final CanvasStatusMapper canvasStatusMapper; + private final CanvasStatusMapper canvasStatusMapper; - // 전체 견적서 조회 - public List selectAllCanvasStatus(String userId) throws QcastException { - List result = null; - - if (userId != null && !userId.trim().isEmpty()) { - result = canvasStatusMapper.selectAllCanvasStatus(userId); - } else { - throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); - } - - return result; - } + // 사용자(userId)에 해당하는 전체 캔버스 조회 + public List selectAllCanvasStatus(String userId) throws QcastException { + List result = null; - // 견적서 조회(objectNo) - public List selectObjectNoCanvasStatus(String objectNo, String userId) throws QcastException { - List result = null; - - if (objectNo != null && !objectNo.trim().isEmpty() && userId != null && !userId.trim().isEmpty()) { - result = canvasStatusMapper.selectObjectNoCanvasStatus(objectNo, userId); - } else { - throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); - } - - return result; - } + if (userId != null && !userId.trim().isEmpty()) { + result = canvasStatusMapper.selectAllCanvasStatus(userId); + } else { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); + } - // 견적서 등록 - public Integer insertCanvasStatus(CanvasStatus cs) throws QcastException { - - Integer id = 0; - - // 데이터가 없으면 저장 - try { - canvasStatusMapper.insertCanvasStatus(cs); - - // 데이터 저장 후 Max id 확인 - List maxId = canvasStatusMapper.getMaxIdCanvasStatus(cs.getObjectNo(), cs.getUserId()); - id = maxId.get(0).getId(); - - } catch (Exception e) { - throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"견적서 등록 중 오류 발생"); - } - - // 생성된 id 반환 - return id; - } + return result; + } - // 견적서 수정 - public void updateCanvasStatus(CanvasStatus cs) throws QcastException { + // 사용자(userId)와 물건번호(objectNo)에 해당하는 캔버스 조회 + public List selectObjectNoCanvasStatus(String objectNo, String userId) + throws QcastException { + List result = null; - if (cs.getId() == null) { - throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); - } - - // 먼저 데이터가 존재하는지 확인 - List existingStatus = canvasStatusMapper.getIdCanvasStatus(cs.getId()); + if (objectNo != null + && !objectNo.trim().isEmpty() + && userId != null + && !userId.trim().isEmpty()) { + result = canvasStatusMapper.selectObjectNoCanvasStatus(objectNo, userId); + } else { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); + } - // 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐 - if (existingStatus.size() > 0) { - canvasStatusMapper.updateCanvasStatus(cs); - } else { - throw new QcastException (ErrorCode.NOT_FOUND ,"수정할 견적서가 존재하지 않습니다."); - } - - } + return result; + } - // 전체 견적서 삭제 - public void deleteObjectNoCanvasStatus(String objectNo) throws QcastException { - - if (objectNo == null || objectNo.trim().isEmpty()) { - throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); - } - - // 먼저 데이터가 존재하는지 확인 - List existingStatus = canvasStatusMapper.getObjectNoCanvasStatus(objectNo); - - // 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐 - if (existingStatus.size() > 0) { - canvasStatusMapper.deleteObjectNoCanvasStatus(objectNo); - } else { - throw new QcastException (ErrorCode.NOT_FOUND ,"삭제할 견적서가 존재하지 않습니다."); - } - - } + // 캔버스 등록 + public Integer insertCanvasStatus(CanvasStatus cs) throws QcastException { - // 이미지(템플릿) 삭제 - public void deleteIdCanvasStatus(Integer id) throws QcastException { - - if (id == null) { - throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); - } - - // 먼저 데이터가 존재하는지 확인 - List existingStatus = canvasStatusMapper.getIdCanvasStatus(id); - - // 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐 - if (existingStatus.size() > 0) { - canvasStatusMapper.deleteIdCanvasStatus(id); - } else { - throw new QcastException (ErrorCode.NOT_FOUND ,"삭제할 견적서가 존재하지 않습니다."); - } - - } + Integer id = 0; + // 데이터가 없으면 저장 + try { + canvasStatusMapper.insertCanvasStatus(cs); + + // 데이터 저장 후 Max id 확인 + List maxId = + canvasStatusMapper.getMaxIdCanvasStatus(cs.getObjectNo(), cs.getUserId()); + id = maxId.get(0).getId(); + + } catch (Exception e) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "캔버스 등록 중 오류 발생"); + } + + // 생성된 id 반환 + return id; + } + + // 캔버스 수정 + public void updateCanvasStatus(CanvasStatus cs) throws QcastException { + + if (cs.getId() == null) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); + } + + // 먼저 데이터가 존재하는지 확인 + List existingStatus = canvasStatusMapper.getIdCanvasStatus(cs.getId()); + + // 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐 + if (existingStatus.size() > 0) { + canvasStatusMapper.updateCanvasStatus(cs); + } else { + throw new QcastException(ErrorCode.NOT_FOUND, "수정할 캔버스가 존재하지 않습니다."); + } + } + + // 물건번호(objectNo)에 해당하는 캔버스 삭제 + public void deleteObjectNoCanvasStatus(String objectNo) throws QcastException { + + if (objectNo == null || objectNo.trim().isEmpty()) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); + } + + // 먼저 데이터가 존재하는지 확인 + List existingStatus = + canvasStatusMapper.getObjectNoCanvasStatus(objectNo); + + // 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐 + if (existingStatus.size() > 0) { + canvasStatusMapper.deleteObjectNoCanvasStatus(objectNo); + } else { + throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 캔버스가 존재하지 않습니다."); + } + } + + // id에 해당하는 캔버스 삭제 + public void deleteIdCanvasStatus(Integer id) throws QcastException { + + if (id == null) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); + } + + // 먼저 데이터가 존재하는지 확인 + List existingStatus = canvasStatusMapper.getIdCanvasStatus(id); + + // 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐 + if (existingStatus.size() > 0) { + canvasStatusMapper.deleteIdCanvasStatus(id); + } else { + throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 캔버스가 존재하지 않습니다."); + } + } } diff --git a/src/main/java/com/interplug/qcast/biz/canvasStatus/dto/CanvasStatus.java b/src/main/java/com/interplug/qcast/biz/canvasStatus/dto/CanvasStatus.java index f0a74443..f5e25418 100644 --- a/src/main/java/com/interplug/qcast/biz/canvasStatus/dto/CanvasStatus.java +++ b/src/main/java/com/interplug/qcast/biz/canvasStatus/dto/CanvasStatus.java @@ -7,7 +7,7 @@ public class CanvasStatus { private Integer id; // PK ID private String userId; // 사용자 ID private String objectNo; // 견적서 번호 - private String imageName; // 이미지명 + private String planNo; // 플랜 번호 private String canvasStatus; // 캠버스 상태 private String bgImageName; // 배경 이미지명 private String mapPositionAddress; // 배경 CAD 파일명 diff --git a/src/main/java/com/interplug/qcast/biz/canvasStatus/dto/CanvasStatusResponse.java b/src/main/java/com/interplug/qcast/biz/canvasStatus/dto/CanvasStatusResponse.java index e6530eda..4fb4a44c 100644 --- a/src/main/java/com/interplug/qcast/biz/canvasStatus/dto/CanvasStatusResponse.java +++ b/src/main/java/com/interplug/qcast/biz/canvasStatus/dto/CanvasStatusResponse.java @@ -10,7 +10,7 @@ public class CanvasStatusResponse { private Integer id; // PK ID private String userId; // 사용자 ID private String objectNo; // 견적서 번호 - private String imageName; // 이미지명 + private String planNo; // 플랜 번호 private String canvasStatus; // 캠버스 상태 private Date registDatetime; // 생성일시 private Date lastEditDatetime; // 수정일시 diff --git a/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/CanvasPopupStatusController.java b/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/CanvasPopupStatusController.java new file mode 100644 index 00000000..3cdcdef4 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/CanvasPopupStatusController.java @@ -0,0 +1,80 @@ +package com.interplug.qcast.biz.canvaspopupstatus; + +import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus; +import com.interplug.qcast.config.Exception.ErrorCode; +import com.interplug.qcast.config.Exception.QcastException; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api/v1/canvas-popup-status") +@RequiredArgsConstructor +@Tag(name = "CanvasPopupStatusController", description = "Canvas Popup Status 관련 API") +public class CanvasPopupStatusController { + + private final CanvasPopupStatusService canvasPopupStatusService; + + /** + * 캔버스 팝업 상태를 조회한다. + * + * @param objectNo 물건정보 번호 + * @param planNo plan 번호 + * @param popupType 캔버스 팝업 단계 + * @return 조회된 CanvasPopupStatus 객체 + * @throws QcastException 조회된 데이터가 없을 경우 예외 발생 + */ + @Operation(description = "캔버스 팝업 상태를 조회한다.") + @GetMapping + public CanvasPopupStatus getCanvasPopupStatus( + @RequestParam @Schema(description = "물건정보 번호") String objectNo, + @RequestParam @Schema(description = "plan 번호") Integer planNo, + @RequestParam @Schema(description = "캔버스 팝업 단계") String popupType) + throws QcastException { + if (objectNo == null + || objectNo.trim().isEmpty() + || planNo == null + || popupType == null + || popupType.trim().isEmpty()) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE); + } + return canvasPopupStatusService.selectCanvasPopupStatus(objectNo, planNo, popupType); + } + + /** + * 캔버스 팝업 상태를 저장 또는 수정한다. + * + * @param canvasPopupStatus 저장 또는 수정할 CanvasPopupStatus 객체 + * @throws QcastException 저장 또는 수정 중 예외 발생 시 + */ + @Operation(description = "캔버스 팝업 상태를 저장 또는 수정한다.") + @PostMapping + public void saveCanvasPopupStatus(@RequestBody CanvasPopupStatus canvasPopupStatus) + throws QcastException { + canvasPopupStatusService.saveCanvasPopupStatus(canvasPopupStatus); + } + + /** + * 캔버스 팝업 상태를 삭제한다. (미사용) + * + * @param canvasPopupStatus 삭제할 CanvasPopupStatus 객체 + * @throws QcastException 삭제 중 예외 발생 시 + */ + @Operation(description = "캔버스 팝업 상태를 삭제한다. (미사용)") + @DeleteMapping + @ResponseStatus(HttpStatus.NO_CONTENT) + public void deleteCanvasPopupStatus(@RequestBody CanvasPopupStatus canvasPopupStatus) + throws QcastException { + canvasPopupStatusService.deleteCanvasPopupStatus(canvasPopupStatus); + } +} diff --git a/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/CanvasPopupStatusMapper.java b/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/CanvasPopupStatusMapper.java new file mode 100644 index 00000000..bfe59520 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/CanvasPopupStatusMapper.java @@ -0,0 +1,37 @@ +package com.interplug.qcast.biz.canvaspopupstatus; + +import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface CanvasPopupStatusMapper { + + /** + * Canvas Popup Status 조회 + * + * @param canvasPopupStatus 조회할 CanvasPopupStatus 객체 + * @return 조회된 CanvasPopupStatus 객체 + */ + public CanvasPopupStatus selectCanvasPopupStatus(CanvasPopupStatus canvasPopupStatus); + + /** + * Canvas Popup Status 생성 + * + * @param canvasPopupStatus 생성할 CanvasPopupStatus 객체 + */ + public void insertCanvasPopupStatus(CanvasPopupStatus canvasPopupStatus); + + /** + * Canvas Popup Status 수정 + * + * @param canvasPopupStatus 수정할 CanvasPopupStatus 객체 + */ + public void updateCanvasPopupStatus(CanvasPopupStatus canvasPopupStatus); + + /** + * Canvas Popup Status 삭제 + * + * @param canvasPopupStatus 삭제할 CanvasPopupStatus 객체 + */ + public void deleteCanvasPopupStatus(CanvasPopupStatus canvasPopupStatus); +} diff --git a/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/CanvasPopupStatusService.java b/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/CanvasPopupStatusService.java new file mode 100644 index 00000000..aaffa1b1 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/CanvasPopupStatusService.java @@ -0,0 +1,91 @@ +package com.interplug.qcast.biz.canvaspopupstatus; + +import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus; +import com.interplug.qcast.config.Exception.ErrorCode; +import com.interplug.qcast.config.Exception.QcastException; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class CanvasPopupStatusService { + + private final CanvasPopupStatusMapper canvasPopupStatusMapper; + + /** + * Canvas Popup Status 조회 + * + * @param objectNo 조회할 object 번호 + * @param planNo 조회할 plan 번호 + * @param popupType 조회할 popup 타입 + * @return 조회된 CanvasPopupStatus 객체 + * @throws QcastException 조회된 데이터가 없을 경우 예외 발생 + */ + public CanvasPopupStatus selectCanvasPopupStatus( + String objectNo, Integer planNo, String popupType) throws QcastException { + CanvasPopupStatus request = + CanvasPopupStatus.builder().objectNo(objectNo).planNo(planNo).popupType(popupType).build(); + CanvasPopupStatus cps = canvasPopupStatusMapper.selectCanvasPopupStatus(request); + if (cps == null) throw new QcastException(ErrorCode.NOT_FOUND); + return cps; + } + + /** + * Canvas Popup Status 저장 - 이미 존재하는 데이터인 경우 수정, 없는 경우 생성 + * + * @param cps 저장할 CanvasPopupStatus 객체 + * @throws QcastException 저장 중 예외 발생 시 + */ + public void saveCanvasPopupStatus(CanvasPopupStatus cps) throws QcastException { + CanvasPopupStatus chk = canvasPopupStatusMapper.selectCanvasPopupStatus(cps); + if (chk == null) { + createCanvasPopupStatus(cps); + } else { + updateCanvasPopupStatus(cps); + } + } + + /** + * Canvas Popup Status 생성 + * + * @param cps 생성할 CanvasPopupStatus 객체 + * @throws QcastException 생성 중 예외 발생 시 + */ + public void createCanvasPopupStatus(CanvasPopupStatus cps) throws QcastException { + try { + canvasPopupStatusMapper.insertCanvasPopupStatus(cps); + } catch (Exception e) { + throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage()); + } + } + + /** + * Canvas Popup Status 수정 + * + * @param cps 수정할 CanvasPopupStatus 객체 + * @throws QcastException 수정 중 예외 발생 시 + */ + public void updateCanvasPopupStatus(CanvasPopupStatus cps) throws QcastException { + try { + canvasPopupStatusMapper.updateCanvasPopupStatus(cps); + } catch (Exception e) { + throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage()); + } + } + + /** + * Canvas Popup Status 삭제 + * + * @param cps 삭제할 CanvasPopupStatus 객체 + * @throws QcastException 삭제 중 예외 발생 시 + */ + public void deleteCanvasPopupStatus(CanvasPopupStatus cps) throws QcastException { + // 존재 유무 확인 + selectCanvasPopupStatus(cps.getObjectNo(), cps.getPlanNo(), cps.getPopupType()); + try { + canvasPopupStatusMapper.deleteCanvasPopupStatus(cps); + } catch (Exception e) { + throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage()); + } + } +} diff --git a/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/dto/CanvasPopupStatus.java b/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/dto/CanvasPopupStatus.java new file mode 100644 index 00000000..2cad4a04 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/canvaspopupstatus/dto/CanvasPopupStatus.java @@ -0,0 +1,28 @@ +package com.interplug.qcast.biz.canvaspopupstatus.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Builder +@Schema(description = "캔버스 팝업 상태") +public class CanvasPopupStatus { + + // @Schema(description = "id") + // private Long id; + + @Schema(description = "물건정보 번호") + private String objectNo; + + @Schema(description = "plan 번호") + private Integer planNo; + + @Schema(description = "캔버스 팝업 단계") + private String popupType; + + @Schema(description = "캔버스 팝업 상태 데이터") + private String popupStatus; +} diff --git a/src/main/java/com/interplug/qcast/biz/community/BoardController.java b/src/main/java/com/interplug/qcast/biz/community/BoardController.java index c2b980e2..f9ce8aaf 100644 --- a/src/main/java/com/interplug/qcast/biz/community/BoardController.java +++ b/src/main/java/com/interplug/qcast/biz/community/BoardController.java @@ -42,8 +42,8 @@ public class BoardController { @GetMapping("/file/download") @ResponseStatus(HttpStatus.OK) public void getFileDownload(HttpServletResponse response, - @RequestParam(required = true) String encodeFileNo) throws Exception { - boardService.getFileDownload(response, encodeFileNo); + @RequestParam(required = true) String keyNo, @RequestParam String zipYn) throws Exception { + boardService.getFileDownload(response, keyNo, zipYn); } } diff --git a/src/main/java/com/interplug/qcast/biz/community/BoardService.java b/src/main/java/com/interplug/qcast/biz/community/BoardService.java index e7451fe2..d412b7a0 100644 --- a/src/main/java/com/interplug/qcast/biz/community/BoardService.java +++ b/src/main/java/com/interplug/qcast/biz/community/BoardService.java @@ -71,7 +71,9 @@ public class BoardService { .queryParam("schNoticeTpCd", boardRequest.getSchNoticeTpCd()) .queryParam("schNoticeClsCd", boardRequest.getSchNoticeClsCd()) .queryParam("startRow", boardRequest.getStartRow()) - .queryParam("endRow", boardRequest.getEndRow()).build().toUriString(); + .queryParam("endRow", boardRequest.getEndRow()) + .queryParam("schMainYn", boardRequest.getSchMainYn()).build().toUriString(); + /* [2]. QSP API CALL -> Response */ String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null); @@ -135,17 +137,24 @@ public class BoardService { * @param encodeFileNo * @throws Exception */ - public void getFileDownload(HttpServletResponse response, String encodeFileNo) throws Exception { + public void getFileDownload(HttpServletResponse response, String keyNo, String zipYn) + throws Exception { /* [0]. Validation Check */ - if ("".equals(encodeFileNo)) { + if ("".equals(keyNo)) { // [msg] {0} is required input value. + String arg = "Y".equals(zipYn) ? "Notice No" : "File No"; throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "File No")); + message.getMessage("common.message.required.data", arg)); } /* [1]. QSP API (url + fileNo) Setting */ - String url = QSP_API_URL + "/api/file/downloadFile" + "?encodeFileNo=" + encodeFileNo; + String url = QSP_API_URL + "/api/file/downloadFile"; + if ("Y".equals(zipYn)) { + url += "?noticeNo=" + keyNo; + } else { + url += "?fileNo=" + keyNo; + } /* [2]. QSP API CALL -> Response */ Map result = new HashMap(); @@ -154,6 +163,7 @@ public class BoardService { if (byteResponse != null && byteResponse.length > 0) { try { /* [3]. API 응답 파일 처리 */ + response.addHeader("Access-Control-Expose-Headers", "Content-Disposition"); response.setContentType( !"".equals(result.get("type")) && result.get("type") != null ? result.get("type") : "application/octet-stream"); diff --git a/src/main/java/com/interplug/qcast/biz/community/dto/BoardRequest.java b/src/main/java/com/interplug/qcast/biz/community/dto/BoardRequest.java index 1823be75..0834cafb 100644 --- a/src/main/java/com/interplug/qcast/biz/community/dto/BoardRequest.java +++ b/src/main/java/com/interplug/qcast/biz/community/dto/BoardRequest.java @@ -25,4 +25,7 @@ public class BoardRequest { /** 종료 행 */ private int endRow; + /** 메인여부 */ + private String schMainYn; + } diff --git a/src/main/java/com/interplug/qcast/biz/estimate/EstimateMapper.java b/src/main/java/com/interplug/qcast/biz/estimate/EstimateMapper.java index 407a594c..2d5c137c 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/EstimateMapper.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/EstimateMapper.java @@ -72,13 +72,13 @@ public interface EstimateMapper { // 견적서 API 정보 수정 public int updateEstimateApi(EstimateRequest estimateRequest); - // 견적서 지붕재 등록 + // 견적서 지붕면 등록 public int insertEstimateRoof(RoofRequest roofRequest); - // 견적서 지붕재 아이템 등록 + // 견적서 지붕면 아이템 등록 public int insertEstimateRoofItem(ItemRequest itemRequest); - // 견적서 지붕재 회로구성 아이템 등록 + // 견적서 지붕면 회로구성 아이템 등록 public int insertEstimateCircuitItem(ItemRequest itemRequest); // 견적서 도면 아이템 등록 @@ -108,6 +108,15 @@ public interface EstimateMapper { // 견적서 복사 public int insertEstimateCopy(EstimateCopyRequest estimateCopyRequest); + // 견적서 지붕면 복사 + public int insertEstimateRoofCopy(EstimateCopyRequest estimateCopyRequest); + + // 견적서 지붕면 아이템 복사 + public int insertEstimateRoofItemCopy(EstimateCopyRequest estimateCopyRequest); + + // 견적서 지붕면 회로구성 아이템 복사 + public int insertEstimateCircuitItemCopy(EstimateCopyRequest estimateCopyRequest); + // 견적서 도면 아이템 복사 public int insertEstimateDrawingItemCopy(EstimateCopyRequest estimateCopyRequest); diff --git a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java index fd576929..1e40090c 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java @@ -300,7 +300,7 @@ public class EstimateService { } // [2]. 지붕재 관련 데이터 셋팅 - roofList = estimateRequest.getRoofList(); + roofList = estimateRequest.getRoofSurfaceList(); // 지붕재 시공사양 ID String constructSpecifications = ""; @@ -576,7 +576,7 @@ public class EstimateService { : "UNIT_PRICE"); estimateMapper.updateEstimate(estimateRequest); - // 도면 작성일 경우에만 지붕재, 도면 아이템 데이터 초기화 후 저장 + // 도면 작성일 경우에만 지붕면, 도면 아이템 데이터 초기화 후 저장 if ("1".equals(estimateRequest.getDrawingFlg())) { // 견적서 지붕면/아이템 및 PC 회로구성도 제거 estimateMapper.deleteEstimateRoofList(estimateRequest); @@ -591,11 +591,32 @@ public class EstimateService { estimateMapper.insertEstimateRoof(roofRequest); - List roofItemList = roofRequest.getRoofItemList(); + List moduleList = roofRequest.getModuleList(); + List roofItemList = new ArrayList(); + + // 동일 모듈, PCS 아이템 묶기 + for (ItemRequest itemRequest : moduleList) { + boolean overLap = false; + for (ItemRequest data : roofItemList) { + if (itemRequest.getItemId().equals(data.getItemId()) + && itemRequest.getPcItemId().equals(data.getPcItemId())) { + data.setAmount( + String.valueOf(Integer.parseInt(data.getAmount()) + 1)); // 데이터 존재하면 카운팅 + 1 + overLap = true; + break; + } + } + + if (!overLap) { + itemRequest.setAmount("1"); + roofItemList.add(itemRequest); + } + } + for (ItemRequest itemRequest : roofItemList) { + itemRequest.setRoofSurfaceId(roofRequest.getRoofSurfaceId()); itemRequest.setObjectNo(estimateRequest.getObjectNo()); itemRequest.setPlanNo(estimateRequest.getPlanNo()); - itemRequest.setRoofNo(roofRequest.getRoofNo()); estimateMapper.insertEstimateRoofItem(itemRequest); } @@ -692,6 +713,7 @@ public class EstimateService { } } catch (Exception e) { + e.printStackTrace(); throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR); } } @@ -811,64 +833,13 @@ public class EstimateService { estimateMapper.insertEstimateItem(itemRequest); } - // [6]. 견적서 지붕재 및 도면 초기 데이터 복사 - List roofList = estimateMapper.selectEstimateRoofList(estimateRequest); - List roofItemList = estimateMapper.selectEstimateRoofItemList(estimateRequest); - List circuitItemList = - estimateMapper.selectEstimateCircuitItemList(estimateRequest); - - for (RoofResponse roofResponse : roofList) { - List roofItemList2 = new ArrayList(); - - // 현재 매칭되는 지붕재 아이템 축출 - for (RoofResponse roofItemResponse : roofItemList) { - if (roofResponse.getRoofNo().equals(roofItemResponse.getRoofNo())) { - roofItemList2.add(roofItemResponse); - } - } - - RoofRequest roofRequest = new RoofRequest(); - roofRequest.setObjectNo(estimateCopyRequest.getCopyObjectNo()); - roofRequest.setPlanNo(estimateCopyRequest.getCopyPlanNo()); - roofRequest.setRoofSurface(roofResponse.getRoofSurface()); - roofRequest.setRoofMaterialId(roofResponse.getRoofMaterialId()); - roofRequest.setSupportMethodId(roofResponse.getSupportMethodId()); - roofRequest.setConstructSpecification(roofResponse.getConstructSpecification()); - roofRequest.setSlope(roofResponse.getSlope()); - roofRequest.setAngle(roofResponse.getAngle()); - roofRequest.setClassType(roofResponse.getClassType()); - roofRequest.setAzimuth(roofResponse.getAzimuth()); - roofRequest.setUserId(estimateCopyRequest.getUserId()); - - estimateMapper.insertEstimateRoof(roofRequest); - - for (RoofResponse roofItemResponse : roofItemList2) { - ItemRequest itemRequest = new ItemRequest(); - itemRequest.setRoofNo(roofRequest.getRoofNo()); - itemRequest.setObjectNo(estimateCopyRequest.getCopyObjectNo()); - itemRequest.setPlanNo(estimateCopyRequest.getCopyPlanNo()); - itemRequest.setItemId(roofItemResponse.getItemId()); - itemRequest.setItemNo(roofItemResponse.getItemNo()); - itemRequest.setItemName(roofItemResponse.getItemName()); - itemRequest.setSpecification(roofItemResponse.getSpecification()); - itemRequest.setAmount(roofItemResponse.getAmount()); - itemRequest.setPcItemId(roofItemResponse.getPcItemId()); - - estimateMapper.insertEstimateRoofItem(itemRequest); - } - } - - for (ItemResponse itemResponse : circuitItemList) { - ItemRequest circuitItemRequest = new ItemRequest(); - - circuitItemRequest.setObjectNo(estimateCopyRequest.getCopyObjectNo()); - circuitItemRequest.setPlanNo(estimateCopyRequest.getCopyPlanNo()); - circuitItemRequest.setItemId(itemResponse.getItemId()); - circuitItemRequest.setCircuitCfg(itemResponse.getCircuitCfg()); - - estimateMapper.insertEstimateCircuitItem(circuitItemRequest); - } - + // [6]. 견적서 지붕면 및 도면 초기 데이터 복사 + // 견적서 지붕면 복사 + estimateMapper.insertEstimateRoofCopy(estimateCopyRequest); + // 견적서 지붕면 아이템 복사 + estimateMapper.insertEstimateRoofItemCopy(estimateCopyRequest); + // 견적서 지붕면 회로구성 아이템 복사 + estimateMapper.insertEstimateCircuitItemCopy(estimateCopyRequest); // 도면 초기 데이타 복사(초기화 위해 필요) estimateMapper.insertEstimateDrawingItemCopy(estimateCopyRequest); @@ -966,7 +937,6 @@ public class EstimateService { String[] arrItemId = new String[itemList.size()]; int i = 0; for (ItemRequest itemRequest : itemList) { - System.out.println(">>>>>>>>>>>>>>>>" + itemRequest.getItemId()); arrItemId[i++] = itemRequest.getItemId(); } estimateRequest.setArrItemId(arrItemId); @@ -1256,12 +1226,6 @@ public class EstimateService { HttpServletRequest request, HttpServletResponse response, EstimateRequest estimateRequest) throws Exception { - // file Name 명이 없는경우 - if (estimateRequest.getFileName() == null || "".equals(estimateRequest.getFileName())) { - estimateRequest.setFileName( - "Quation_Detail_" + new SimpleDateFormat("yyyyMMdd").format(new Date())); - } - EstimateResponse estimateResponse = new EstimateResponse(); String splitStr = "、"; @@ -1269,6 +1233,16 @@ public class EstimateService { // 견적서 상세 조회 estimateResponse = estimateMapper.selectEstimatePdfDetail(estimateRequest); + // file Name 명이 없는경우 + if (estimateRequest.getFileName() == null || "".equals(estimateRequest.getFileName())) { + estimateRequest.setFileName( + estimateResponse.getObjectNo() + + "_" + + estimateResponse.getObjectName() + + "_" + + new SimpleDateFormat("yyyyMMdd").format(new Date())); + } + if ("1".equals(estimateRequest.getSchDisplayFlg())) { estimateResponse.setCustSaleStoreName(estimateResponse.getObjectName()); estimateResponse.setCustOmit(estimateResponse.getObjectNameOmit()); @@ -1297,7 +1271,7 @@ public class EstimateService { estimateResponse.setNoteList(noteList); } - // 지붕재 목록 조회 + // 지붕면 목록 조회 RoofInfoResponse roofInfoResponse = new RoofInfoResponse(); List roofList = estimateMapper.selectEstimateRoofList(estimateRequest); List circuitItemList = @@ -1741,6 +1715,9 @@ public class EstimateService { elm = doc.getElementById("objectName1"); elm.text(StringUtils.defaultString(data.getObjectName())); + elm = doc.getElementById("objectNameOmit1"); + elm.text(StringUtils.defaultString(data.getObjectNameOmit())); + elm = doc.getElementById("objectNo1"); elm.text( StringUtils.defaultString(data.getObjectNo()) diff --git a/src/main/java/com/interplug/qcast/biz/estimate/dto/EstimateRequest.java b/src/main/java/com/interplug/qcast/biz/estimate/dto/EstimateRequest.java index c384a1b2..6f7e2a59 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/dto/EstimateRequest.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/dto/EstimateRequest.java @@ -193,9 +193,9 @@ public class EstimateRequest { // 데이터 목록 관련 정보 @Schema(description = "지붕재 목록") - List roofList; + List roofSurfaceList; - @Schema(description = "지붕재 목록") + @Schema(description = "PC 회로구성도 목록") List circuitItemList; @Schema(description = "아이템 목록") diff --git a/src/main/java/com/interplug/qcast/biz/estimate/dto/ItemRequest.java b/src/main/java/com/interplug/qcast/biz/estimate/dto/ItemRequest.java index 44c948e1..054f7401 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/dto/ItemRequest.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/dto/ItemRequest.java @@ -18,7 +18,7 @@ public class ItemRequest { private String roofItemNo; @Schema(description = "지붕재 번호") - private String roofNo; + private String roofSurfaceId; @Schema(description = "아이템 ID") private String itemId; @@ -80,6 +80,9 @@ public class ItemRequest { @Schema(description = "회로번호") private String circuitNo; + @Schema(description = "회로구성번호") + private String circuit; + @Schema(description = "회로구성도") private String circuitCfg; diff --git a/src/main/java/com/interplug/qcast/biz/estimate/dto/RoofRequest.java b/src/main/java/com/interplug/qcast/biz/estimate/dto/RoofRequest.java index 1a2aedcc..18288d5c 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/dto/RoofRequest.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/dto/RoofRequest.java @@ -15,8 +15,8 @@ public class RoofRequest { @Schema(description = "플랜번호") private String planNo; - @Schema(description = "지붕재 번호") - private String roofNo; + @Schema(description = "지붕재 ID") + private String roofSurfaceId; @Schema(description = "지붕면") private String roofSurface; @@ -58,5 +58,5 @@ public class RoofRequest { private String userId; @Schema(description = "아이템 목록") - List roofItemList; + List moduleList; } diff --git a/src/main/java/com/interplug/qcast/biz/estimate/dto/RoofResponse.java b/src/main/java/com/interplug/qcast/biz/estimate/dto/RoofResponse.java index 4337db13..a1c9bd6f 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/dto/RoofResponse.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/dto/RoofResponse.java @@ -14,8 +14,8 @@ public class RoofResponse { @Schema(description = "플랜번호") private String planNo; - @Schema(description = "지붕재 번호") - private String roofNo; + @Schema(description = "지붕면 ID") + private String roofSurfaceId; @Schema(description = "지붕면") private String roofSurface; diff --git a/src/main/java/com/interplug/qcast/biz/master/MasterController.java b/src/main/java/com/interplug/qcast/biz/master/MasterController.java index 71cd236f..5fe2527a 100644 --- a/src/main/java/com/interplug/qcast/biz/master/MasterController.java +++ b/src/main/java/com/interplug/qcast/biz/master/MasterController.java @@ -3,11 +3,12 @@ package com.interplug.qcast.biz.master; import com.interplug.qcast.biz.master.dto.*; import com.interplug.qcast.biz.master.dto.construction.ApiConstructionResponse; import com.interplug.qcast.biz.master.dto.moduletype.ApiModuleTpResponse; -import com.interplug.qcast.biz.master.dto.pcs.autorecommend.ApiPcsAutoRecommendRequest; +import com.interplug.qcast.biz.master.dto.pcs.ApiPcsInfoRequest; import com.interplug.qcast.biz.master.dto.pcs.autorecommend.ApiPcsAutoRecommendResponse; import com.interplug.qcast.biz.master.dto.pcs.maker.ApiPcsMakerResponse; import com.interplug.qcast.biz.master.dto.pcs.series.ApiPcsSeriesItemRequest; import com.interplug.qcast.biz.master.dto.pcs.series.ApiPcsSeriesItemResponse; +import com.interplug.qcast.biz.master.dto.pcs.voltagestepup.ApiPcsVoltageStepUpResponse; import com.interplug.qcast.biz.master.dto.quotation.ApiQuotationItemRequest; import com.interplug.qcast.biz.master.dto.quotation.ApiQuotationItemResponse; import com.interplug.qcast.biz.master.dto.roofmaterial.ApiRoofMaterialResponse; @@ -195,7 +196,8 @@ public class MasterController { req.getInclCd(), req.getConstTp(), req.getMixMatlNo(), - req.getRoofPitch()); + req.getRoofPitch(), + req.getWorkingWidth()); ApiTrestleDetailResponse data = response.getData(); if (data != null) { @@ -225,13 +227,26 @@ public class MasterController { return masterService.getPcsSeriesItemList(pcsSeriesItemListRequest); } - @Operation(description = "시리즈 중 자동으로 추천 PCS 정보 조회한다.") + @Operation(description = "시리즈 중 자동으로 추천 PCS 정보를 조회한다.") @PostMapping("/getPcsAutoRecommendList") public ApiResponse getPcsAutoRecommendList( - @RequestBody ApiPcsAutoRecommendRequest autoRecommendRequest) { + @RequestBody ApiPcsInfoRequest autoRecommendRequest) { return masterService.getPcsAutoRecommendList(autoRecommendRequest); } + @Operation(description = "배치된 모듈을 선택한 PCS로 회로 구성 가능 여부 체크한다.") + @PostMapping("/getPcsVoltageChk") + public ApiResultResponse getPcsVoltageChk(@RequestBody ApiPcsInfoRequest pcsVoltageChkRequest) { + return masterService.getPcsVoltageChk(pcsVoltageChkRequest).getResult(); + } + + @Operation(description = "PCS 승압설정 정보를 조회한다.") + @PostMapping("/getPcsVoltageStepUpList") + public ApiResponse getPcsVoltageStepUpList( + @RequestBody ApiPcsInfoRequest pcsVoltageStepUpRequest) { + return masterService.getPcsVoltageStepUpList(pcsVoltageStepUpRequest); + } + /** remote api group : quotation */ @Operation(description = "견적서 아이템을 조회한다.") @PostMapping("/getQuotationItem") diff --git a/src/main/java/com/interplug/qcast/biz/master/MasterService.java b/src/main/java/com/interplug/qcast/biz/master/MasterService.java index 8b084618..bf676258 100644 --- a/src/main/java/com/interplug/qcast/biz/master/MasterService.java +++ b/src/main/java/com/interplug/qcast/biz/master/MasterService.java @@ -1,13 +1,15 @@ package com.interplug.qcast.biz.master; +import com.fasterxml.jackson.databind.JsonNode; import com.interplug.qcast.biz.master.dto.*; import com.interplug.qcast.biz.master.dto.construction.ApiConstructionResponse; import com.interplug.qcast.biz.master.dto.moduletype.ApiModuleTpResponse; -import com.interplug.qcast.biz.master.dto.pcs.autorecommend.ApiPcsAutoRecommendRequest; +import com.interplug.qcast.biz.master.dto.pcs.ApiPcsInfoRequest; import com.interplug.qcast.biz.master.dto.pcs.autorecommend.ApiPcsAutoRecommendResponse; import com.interplug.qcast.biz.master.dto.pcs.maker.ApiPcsMakerResponse; import com.interplug.qcast.biz.master.dto.pcs.series.ApiPcsSeriesItemRequest; import com.interplug.qcast.biz.master.dto.pcs.series.ApiPcsSeriesItemResponse; +import com.interplug.qcast.biz.master.dto.pcs.voltagestepup.ApiPcsVoltageStepUpResponse; import com.interplug.qcast.biz.master.dto.roofmaterial.ApiRoofMaterialResponse; import com.interplug.qcast.biz.master.dto.trestle.ApiTrestleResponse; import com.interplug.qcast.biz.master.dto.trestle.detail.ApiTrestleDetailResponse; @@ -72,7 +74,8 @@ public interface MasterService { @RequestParam String inclCd, @RequestParam String constTp, @RequestParam(required = false) Integer mixMatlNo, - @RequestParam(required = false) Integer roofPitch); + @RequestParam(required = false) Integer roofPitch, + @RequestParam(required = false) String workingWidth); // PCS Maker, 시리즈 목록 조회 @GetMapping("/pcsMakerList") @@ -88,5 +91,14 @@ public interface MasterService { // 시리즈 중 자동으로 추천 PCS 정보 조회 @PostMapping("/pcsAutoRecommendList") public ApiResponse getPcsAutoRecommendList( - @RequestBody ApiPcsAutoRecommendRequest req); + @RequestBody ApiPcsInfoRequest req); + + // 배치된 모듈을 선택한 PCS로 회로 구성 가능 여부 체크 + @PostMapping("/pcsVoltageChk") + public ApiResponse getPcsVoltageChk(@RequestBody ApiPcsInfoRequest req); + + // PCS 승압설정 정보 조회 + @PostMapping("/pcsVoltageStepUpList") + public ApiResponse getPcsVoltageStepUpList( + @RequestBody ApiPcsInfoRequest req); } diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendRequest.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsInfoRequest.java similarity index 63% rename from src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendRequest.java rename to src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsInfoRequest.java index 33cb58ec..93d003f4 100644 --- a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendRequest.java +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsInfoRequest.java @@ -1,6 +1,5 @@ -package com.interplug.qcast.biz.master.dto.pcs.autorecommend; +package com.interplug.qcast.biz.master.dto.pcs; -import com.interplug.qcast.biz.master.dto.pcs.ApiPcsModuleItemRequest; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import java.util.List; @@ -9,8 +8,8 @@ import lombok.Setter; @Getter @Setter -@Schema(description = "시리즈 중 자동으로 추천 PCS 정보 조회 요청 객체") -public class ApiPcsAutoRecommendRequest { +@Schema(description = "PCS 정보 조회 요청 객체") +public class ApiPcsInfoRequest { @Schema(description = "Max접속(과적)여부") @NotNull public String maxConnYn; @@ -29,9 +28,9 @@ public class ApiPcsAutoRecommendRequest { @Schema(description = "지붕면별 목록") @NotNull - public List roofSurfaceList; + public List roofSurfaceList; @Schema(description = "PCS아이템ID") @NotNull - public List pcsItemList; + public List pcsItemList; } diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendPcsItemRequest.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsItemRequest.java similarity index 64% rename from src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendPcsItemRequest.java rename to src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsItemRequest.java index 16d771cc..d75c57ca 100644 --- a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendPcsItemRequest.java +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsItemRequest.java @@ -1,4 +1,4 @@ -package com.interplug.qcast.biz.master.dto.pcs.autorecommend; +package com.interplug.qcast.biz.master.dto.pcs; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; @@ -7,8 +7,8 @@ import lombok.Setter; @Getter @Setter -@Schema(description = "시리즈 중 자동으로 추천 PCS 정보 조회 PCS 아이템 요청 객체") -public class ApiPcsAutoRecommendPcsItemRequest { +@Schema(description = "PCS 아이템 요청 객체") +public class ApiPcsItemRequest { @Schema(description = "PCS제품ID", maxLength = 20) @NotNull private String itemId; @@ -20,4 +20,7 @@ public class ApiPcsAutoRecommendPcsItemRequest { @Schema(description = "PCS시리즈코드", maxLength = 10) @NotNull private String pcsSerCd; + + @Schema(description = "선택한직렬매수(적용직렬매수)", maxLength = 10) + private Integer applySerQty; } diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendModuleItemIdRequest.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsModuleItemIdRequest.java similarity index 72% rename from src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendModuleItemIdRequest.java rename to src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsModuleItemIdRequest.java index 0bfc50f3..036315e9 100644 --- a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendModuleItemIdRequest.java +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsModuleItemIdRequest.java @@ -1,4 +1,4 @@ -package com.interplug.qcast.biz.master.dto.pcs.autorecommend; +package com.interplug.qcast.biz.master.dto.pcs; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; @@ -8,7 +8,7 @@ import lombok.Setter; @Getter @Setter @Schema(description = "PCS 모듈아이템 ID 요청 객체") -public class ApiPcsAutoRecommendModuleItemIdRequest { +public class ApiPcsModuleItemIdRequest { @Schema(description = "제품ID", maxLength = 20) @NotNull private String itemId; diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendRoofSurfaceRequest.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsRoofSurfaceRequest.java similarity index 66% rename from src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendRoofSurfaceRequest.java rename to src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsRoofSurfaceRequest.java index 7dc9e3a1..24e3f968 100644 --- a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/autorecommend/ApiPcsAutoRecommendRoofSurfaceRequest.java +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/ApiPcsRoofSurfaceRequest.java @@ -1,4 +1,4 @@ -package com.interplug.qcast.biz.master.dto.pcs.autorecommend; +package com.interplug.qcast.biz.master.dto.pcs; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; @@ -8,8 +8,8 @@ import lombok.Setter; @Getter @Setter -@Schema(description = "시리즈 중 자동으로 추천 PCS 정보 조회 지붕면 요청 객체") -public class ApiPcsAutoRecommendRoofSurfaceRequest { +@Schema(description = "PCS 아이템 지붕면 요청 객체") +public class ApiPcsRoofSurfaceRequest { @Schema(description = "지붕면ID") @NotNull private String roofSurfaceId; @@ -24,5 +24,5 @@ public class ApiPcsAutoRecommendRoofSurfaceRequest { @Schema(description = "모듈아이템 List(도면에 설치된 모듈)") @NotNull - private List moduleList; + private List moduleList; } diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/series/ApiPcsSeriesItemResponse.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/series/ApiPcsSeriesItemResponse.java index c23003f7..8176e003 100644 --- a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/series/ApiPcsSeriesItemResponse.java +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/series/ApiPcsSeriesItemResponse.java @@ -47,6 +47,24 @@ public class ApiPcsSeriesItemResponse { @Schema(description = "회로수(최대병렬수)") public Integer paralMax; + @Schema(description = "최소직렬수") + public Integer serMinQty; + + @Schema(description = "표준직렬수") + public Integer serMaxQty; + + @Schema(description = "과적직렬수(표준이상)") + public Integer serStdMaxQty; + + @Schema(description = "표준직렬수(표준-한랭지)") + public Integer serColdZoneMaxQty; + + @Schema(description = "과적직렬수(표준이상-한랭지)") + public Integer serStdColdZoneMaxQty; + + @Schema(description = "최소매수(모듈최소매수)") + public Integer moduleMinQty; + @Schema(description = "표준매수(모듈표준매수)") public String moduleStdQty; diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpConnResponse.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpConnResponse.java new file mode 100644 index 00000000..6561961a --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpConnResponse.java @@ -0,0 +1,29 @@ +package com.interplug.qcast.biz.master.dto.pcs.voltagestepup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Schema(description = "PCS 승압설정 정보 조회 연결함목록 응답 객체") +public class ApiPcsVoltageStepUpConnResponse { + + @Schema(description = "제품ID", maxLength = 20) + private String itemId; + + @Schema(description = "제품명", maxLength = 100) + private String itemNm; + + @Schema(description = "제품명(Basic Material)", maxLength = 40) + private String goodsNo; + + @Schema(description = "병렬수(회로수)", maxLength = 10) + private Integer connMaxParalCnt; + + @Schema(description = "최대전력", maxLength = 10) + private Integer connAllowCur; + + @Schema(description = "승압병렬수", maxLength = 10) + private Integer vStuParalCnt; +} diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpOptionResponse.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpOptionResponse.java new file mode 100644 index 00000000..876c98a6 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpOptionResponse.java @@ -0,0 +1,20 @@ +package com.interplug.qcast.biz.master.dto.pcs.voltagestepup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Schema(description = "PCS 승압설정 정보 조회 옵션목록(모니터선택) 응답 객체") +public class ApiPcsVoltageStepUpOptionResponse { + + @Schema(description = "PCS옵션코드", maxLength = 10) + private String pcsOptCd; + + @Schema(description = "PCS옵션코드명", maxLength = 100) + private String pcsOptNm; + + @Schema(description = "PCS옵션코드명(일본)", maxLength = 100) + private String pcsOptNmJp; +} diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpPcsItemResponse.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpPcsItemResponse.java new file mode 100644 index 00000000..a392bf83 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpPcsItemResponse.java @@ -0,0 +1,36 @@ +package com.interplug.qcast.biz.master.dto.pcs.voltagestepup; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Schema(description = "PCS 승압설정 정보 조회 PCS 아이템 응답 객체") +public class ApiPcsVoltageStepUpPcsItemResponse { + + @Schema(description = "PCS메이커코드", maxLength = 10) + private String pcsMkrCd; + + @Schema(description = "PCS시리즈코드", maxLength = 10) + private String pcsSerCd; + + @Schema(description = "PCS 아이템 ID", maxLength = 20) + private String itemId; + + @Schema(description = "PCS 제품명", maxLength = 100) + private String itemNm; + + @Schema(description = "PCS 제품명(Basic Material)", maxLength = 40) + private String goodsNo; + + @Schema(description = "PCS 회로구성정보(모듈수) - 발전시물레이션에서 사용", maxLength = 50) + private String circuitCfg; + + @Schema(description = "직렬매수 목록") + private List serQtyList; + + @Schema(description = "연결함목록") + private List connList; +} diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpResponse.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpResponse.java new file mode 100644 index 00000000..b89ae874 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpResponse.java @@ -0,0 +1,18 @@ +package com.interplug.qcast.biz.master.dto.pcs.voltagestepup; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Schema(description = "PCS 승압설정 정보 조회 응답 객체") +public class ApiPcsVoltageStepUpResponse { + + @Schema(description = "PCS 아이템 목록") + private List pcsItemList; + + @Schema(description = "옵션목록(모니터선택)") + private List optionList; +} diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpRoofSurfaceModuleResponse.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpRoofSurfaceModuleResponse.java new file mode 100644 index 00000000..d2c25095 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpRoofSurfaceModuleResponse.java @@ -0,0 +1,17 @@ +package com.interplug.qcast.biz.master.dto.pcs.voltagestepup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Schema(description = "PCS 승압설정 정보 조회 모듈아이템 List(도면에 설치된 모듈) 응답 객체") +public class ApiPcsVoltageStepUpRoofSurfaceModuleResponse { + + @Schema(description = "제품ID", maxLength = 20) + private String itemId; + + @Schema(description = "회로구성번호((1-1,1-1,1-2,1-2,2-1,2-2.....))", maxLength = 10) + private String circuit; +} diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpRoofSurfaceResponse.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpRoofSurfaceResponse.java new file mode 100644 index 00000000..5fb96a99 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpRoofSurfaceResponse.java @@ -0,0 +1,24 @@ +package com.interplug.qcast.biz.master.dto.pcs.voltagestepup; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Schema(description = "PCS 승압설정 정보 조회 지붕면 응답 객체") +public class ApiPcsVoltageStepUpRoofSurfaceResponse { + + @Schema(description = "지붕면ID", maxLength = 50) + private String roofSurfaceId; + + @Schema(description = "지붕면방위(동,서,남,북,동남,서북 등등)", maxLength = 10) + private String roofSurface; + + @Schema(description = "촌수(경사도)", maxLength = 10) + private Double roofSurfaceIncl; + + @Schema(description = "모듈아이템 List(도면에 설치된 모듈)") + private List moduleList; +} diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpSerQtyResponse.java b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpSerQtyResponse.java new file mode 100644 index 00000000..830acb5a --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/master/dto/pcs/voltagestepup/ApiPcsVoltageStepUpSerQtyResponse.java @@ -0,0 +1,27 @@ +package com.interplug.qcast.biz.master.dto.pcs.voltagestepup; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Schema(description = "PCS 승압설정 정보 조회 직렬매수 응답 객체") +public class ApiPcsVoltageStepUpSerQtyResponse { + + @Schema(description = "직렬매수", maxLength = 10) + private Integer serQty; + + @Schema(description = "병렬수(회로수)", maxLength = 10) + private Integer paralQty; + + @Schema(description = "추천여부", maxLength = 1) + private String rmdYn; + + @Schema(description = "사용가능여부", maxLength = 1) + private String usePossYn; + + @Schema(description = "지붕면 목록") + private List roofSurfaceList; +} diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/quotation/ApiQuotationItemPcsRequest.java b/src/main/java/com/interplug/qcast/biz/master/dto/quotation/ApiQuotationItemPcsRequest.java new file mode 100644 index 00000000..e8a74fdd --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/master/dto/quotation/ApiQuotationItemPcsRequest.java @@ -0,0 +1,32 @@ +package com.interplug.qcast.biz.master.dto.quotation; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Schema(description = "Api 견적서 아이템 조회 PCS 요청 객체") +public class ApiQuotationItemPcsRequest { + + @Schema(description = "PCS메이커코드", maxLength = 10) + @NotNull + public String pcsMkrCd; + + @Schema(description = "PCS시리즈코드", maxLength = 10) + @NotNull + public String pcsSerCd; + + @Schema(description = "PCS 아이템ID", maxLength = 20) + @NotNull + public String pcsItemId; + + @Schema(description = "PCS옵션코드", maxLength = 20) + @NotNull + public String pscOptCd; + + @Schema(description = "병렬수(회로수)") + @NotNull + public Integer paralQty; +} diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/quotation/ApiQuotationItemRequest.java b/src/main/java/com/interplug/qcast/biz/master/dto/quotation/ApiQuotationItemRequest.java index 600eb75b..bc6c494a 100644 --- a/src/main/java/com/interplug/qcast/biz/master/dto/quotation/ApiQuotationItemRequest.java +++ b/src/main/java/com/interplug/qcast/biz/master/dto/quotation/ApiQuotationItemRequest.java @@ -143,4 +143,8 @@ public class ApiQuotationItemRequest { @Schema(description = "랙") @NotNull public List racks; + + @Schema(description = "PCS") + @NotNull + public List pcses; } diff --git a/src/main/java/com/interplug/qcast/biz/master/dto/trestle/detail/ApiTrestleDetailRequest.java b/src/main/java/com/interplug/qcast/biz/master/dto/trestle/detail/ApiTrestleDetailRequest.java index a9043cdf..d99d9708 100644 --- a/src/main/java/com/interplug/qcast/biz/master/dto/trestle/detail/ApiTrestleDetailRequest.java +++ b/src/main/java/com/interplug/qcast/biz/master/dto/trestle/detail/ApiTrestleDetailRequest.java @@ -62,4 +62,7 @@ public class ApiTrestleDetailRequest { @Schema(description = "지붕index 번호") private String roofIndex; + + @Schema(description = "작업폭") + private String workingWidth; } diff --git a/src/main/java/com/interplug/qcast/biz/object/ObjectController.java b/src/main/java/com/interplug/qcast/biz/object/ObjectController.java index 55d9031d..d08f0d94 100644 --- a/src/main/java/com/interplug/qcast/biz/object/ObjectController.java +++ b/src/main/java/com/interplug/qcast/biz/object/ObjectController.java @@ -93,6 +93,13 @@ public class ObjectController { return objectService.updateObject(objectRequest); } + @Operation(description = "물건정보 갱신일을 수정한다.") + @PutMapping("/update-object-date") + @ResponseStatus(HttpStatus.CREATED) + public void updateObjectLastEditDate(@RequestBody ObjectRequest objectRequest) throws Exception { + objectService.updateObjectLastEditDate(objectRequest); + } + @Operation(description = "물건정보을 삭제한다.") @DeleteMapping("/{objectNo}") @ResponseStatus(HttpStatus.NO_CONTENT) diff --git a/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java b/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java index 1d7fb162..b3530d35 100644 --- a/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java +++ b/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java @@ -49,6 +49,9 @@ public interface ObjectMapper { // 물건정보 수정 public int updateObject(ObjectRequest objectRequest); + // 물건정보 갱신일 수정 + public int updateObjectLastEditDate(ObjectRequest objectRequest); + // 물건정보 삭제 public int deleteObject(ObjectRequest objectRequest); diff --git a/src/main/java/com/interplug/qcast/biz/object/ObjectService.java b/src/main/java/com/interplug/qcast/biz/object/ObjectService.java index aceacb3d..87bfaa4a 100644 --- a/src/main/java/com/interplug/qcast/biz/object/ObjectService.java +++ b/src/main/java/com/interplug/qcast/biz/object/ObjectService.java @@ -261,6 +261,7 @@ public class ObjectService { result += objectMapper.updateObjectDelivery(objectRequest); // 디폴트 Plan 등록 + /* PlanRequest planRequest = new PlanRequest(); planRequest.setObjectNo(objectNo); planRequest.setRoofKindId("0"); @@ -273,6 +274,7 @@ public class ObjectService { planRequest.setTempFlg("1"); planRequest.setUserId(objectRequest.getUserId()); result += objectMapper.insertPlan(planRequest); + */ // 플랜번호 존재 시 물건번호 업데이트 if ("0".equals(objectRequest.getTempFlg()) @@ -305,7 +307,6 @@ public class ObjectService { // 결과 데이터 리턴 ObjectResponse objectResponse = new ObjectResponse(); objectResponse.setObjectNo(objectNo); - objectResponse.setPlanNo(planRequest.getPlanNo()); return objectResponse; } @@ -398,6 +399,28 @@ public class ObjectService { return objectResponse; } + /** + * 물건정보 갱신일 수정 + * + * @param objectRequest + * @throws Exception + */ + public void updateObjectLastEditDate(ObjectRequest objectRequest) throws Exception { + // Validation + if (StringUtils.isEmpty(objectRequest.getObjectNo())) { + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, + message.getMessage("common.message.required.data", "Object No")); + } + + try { + // object 갱신일 수정 + objectMapper.updateObjectLastEditDate(objectRequest); + } catch (Exception e) { + throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR); + } + } + /** * 물건정보 삭제 * diff --git a/src/main/java/com/interplug/qcast/biz/pwrGnrSimulation/PwrGnrSimService.java b/src/main/java/com/interplug/qcast/biz/pwrGnrSimulation/PwrGnrSimService.java index 48029e5e..72f73060 100644 --- a/src/main/java/com/interplug/qcast/biz/pwrGnrSimulation/PwrGnrSimService.java +++ b/src/main/java/com/interplug/qcast/biz/pwrGnrSimulation/PwrGnrSimService.java @@ -115,7 +115,7 @@ public class PwrGnrSimService { // 견적서의 지붕재 목록 조회 List roofList = pwrGnrSimMapper.selectRoofList(pwrGnrSimRequest); - int roofLength = roofList.size(); // Set의 크기 = 고유 roofNo 개수 + int roofLength = roofList.size(); // Set의 크기 = 고유 roofSurfaceId 개수 // 지붕재 정보가 없음. if (roofList == null || roofList.isEmpty()) { @@ -123,44 +123,46 @@ public class PwrGnrSimService { return exceptionRes; } - // 지붕재의 모든 모듈 Item 조회 + // 지붕재의 모든 Group 모듈 Item 조회 pwrGnrSimRequest.setItemGroup("MODULE_"); - List roofModuleList = + List roofGroupModuleList = pwrGnrSimMapper.selectRoofItemList(pwrGnrSimRequest); - // 전체 모듈에서 모듈 그룹형태로 변경 + // 전체 모듈에서 SORT 변경 (총용량 DESC) List moduleGroupList = - roofModuleList.stream() - .collect( - Collectors.groupingBy( - PwrGnrSimRoofResponse::getItemId, // 첫 번째 그룹화 기준 - Collectors.collectingAndThen( - Collectors.toList(), - list -> { - // 그룹화된 첫 번째 요소를 기반으로 새 객체 생성 - ObjectMapper mapper = new ObjectMapper(); - PwrGnrSimRoofResponse setDto = - mapper.convertValue(list.get(0), PwrGnrSimRoofResponse.class); - - // specification 합산 - double totSpecification = - list.stream() - .mapToDouble(response -> response.getTotSpecification()) - .sum(); - - totSpecification = totSpecification / 1000; - - // 합산 결과 설정 - setDto.setTotSpecification(totSpecification); - - return setDto; - }))) - .values() - .stream() + roofGroupModuleList.stream() .sorted( Comparator.comparingDouble(PwrGnrSimRoofResponse::getTotSpecification) .reversed()) // 내림차순 정렬 .collect(Collectors.toList()); + // .collect( + // Collectors.groupingBy( + // PwrGnrSimRoofResponse::getItemId, // 첫 번째 그룹화 기준 + // Collectors.collectingAndThen( + // Collectors.toList(), + // list -> { + // // 그룹화된 첫 번째 요소를 기반으로 새 객체 생성 + // ObjectMapper mapper = new ObjectMapper(); + // PwrGnrSimRoofResponse setDto = + // mapper.convertValue(list.get(0), + // PwrGnrSimRoofResponse.class); + // + // // specification 합산 + // double totSpecification = + // list.stream() + // .mapToDouble(response -> + // response.getTotSpecification()) + // .sum(); + // + // totSpecification = totSpecification / 1000; + // + // // 합산 결과 설정 + // setDto.setTotSpecification(totSpecification); + // + // return setDto; + // }))) + // .values() + // .stream() // 모듈 아이템이 없음. if (moduleGroupList.isEmpty()) { @@ -168,12 +170,7 @@ public class PwrGnrSimService { return exceptionRes; } - // 지붕재의 모든 PCS Item 조회 - // pwrGnrSimRequest.setItemGroup("PC_"); - // List roofPcsList = - // pwrGnrSimMapper.selectRoofItemList(pwrGnrSimRequest); - - // GROUP PCS Group Item 조회 + // 모든GROUP PCS Group Item 조회 List pcsGroupList = pwrGnrSimMapper.selectRoofPcsGroupList(pwrGnrSimRequest); @@ -261,8 +258,8 @@ public class PwrGnrSimService { // 지붕별 모듈정보 셋팅 int j = 0; - for (PwrGnrSimRoofResponse m : roofModuleList) { - if (data.getRoofNo().equals(m.getRoofNo())) { + for (PwrGnrSimRoofResponse m : moduleGroupList) { + if (data.getRoofSurfaceId().equals(m.getRoofSurfaceId())) { dSpecification += m.getTotSpecification(); if (j == 0) { dModuleInput1[i] = Integer.parseInt(m.getAmount()); @@ -271,7 +268,6 @@ public class PwrGnrSimService { } else { dModuleInput3[i] = Integer.parseInt(m.getAmount()); } - j++; } } @@ -306,7 +302,7 @@ public class PwrGnrSimService { pwrGnrSimRes.setAreaName(planInfo.getAreaName()); pwrGnrSimRes.setSnowfall(planInfo.getSnowfall()); pwrGnrSimRes.setStandardWindSpeedId(planInfo.getStandardWindSpeedId()); - pwrGnrSimRes.setRoofModuleList(roofModuleList); + pwrGnrSimRes.setRoofModuleList(roofGroupModuleList); pwrGnrSimRes.setPcsList(pcsGroupList); return pwrGnrSimRes; diff --git a/src/main/java/com/interplug/qcast/biz/pwrGnrSimulation/dto/PwrGnrSimRoofResponse.java b/src/main/java/com/interplug/qcast/biz/pwrGnrSimulation/dto/PwrGnrSimRoofResponse.java index c7e2af8f..5fa61895 100644 --- a/src/main/java/com/interplug/qcast/biz/pwrGnrSimulation/dto/PwrGnrSimRoofResponse.java +++ b/src/main/java/com/interplug/qcast/biz/pwrGnrSimulation/dto/PwrGnrSimRoofResponse.java @@ -7,7 +7,7 @@ import lombok.Data; public class PwrGnrSimRoofResponse { @Schema(description = "지붕재") - private String roofNo; + private String roofSurfaceId; @Schema(description = "지붕명") private String roofSurface; diff --git a/src/main/java/com/interplug/qcast/biz/specialNote/dto/SpecialNoteSyncResponse.java b/src/main/java/com/interplug/qcast/biz/specialNote/dto/SpecialNoteSyncResponse.java index 01ee06ad..ecaad88f 100644 --- a/src/main/java/com/interplug/qcast/biz/specialNote/dto/SpecialNoteSyncResponse.java +++ b/src/main/java/com/interplug/qcast/biz/specialNote/dto/SpecialNoteSyncResponse.java @@ -1,8 +1,7 @@ package com.interplug.qcast.biz.specialNote.dto; -import java.util.List; -import com.interplug.qcast.biz.displayItem.dto.DisplayItemRequest; import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; import lombok.Getter; import lombok.Setter; @@ -15,8 +14,4 @@ public class SpecialNoteSyncResponse { @Schema(description = "견적 특이사항 아이템 목록") private List sdOrderSpnItemList; - - @Schema(description = "노출 아이템 목록") - private List storeDispItemList; - } diff --git a/src/main/java/com/interplug/qcast/biz/user/dto/StoreSyncResponse.java b/src/main/java/com/interplug/qcast/biz/user/dto/StoreSyncResponse.java index 1df9f990..aa3d62b3 100644 --- a/src/main/java/com/interplug/qcast/biz/user/dto/StoreSyncResponse.java +++ b/src/main/java/com/interplug/qcast/biz/user/dto/StoreSyncResponse.java @@ -1,5 +1,6 @@ package com.interplug.qcast.biz.user.dto; +import com.interplug.qcast.biz.displayItem.dto.DisplayItemRequest; import com.interplug.qcast.biz.storeFavorite.dto.StoreFavoriteRequest; import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; @@ -18,4 +19,7 @@ public class StoreSyncResponse { @Schema(description = "즐겨찾기 목록") private List storeFavList; + + @Schema(description = "노출 아이템 목록") + private List storeDispItemList; } diff --git a/src/main/resources/mappers/canvasStatus/canvasStatusMapper.xml b/src/main/resources/mappers/canvasStatus/canvasStatusMapper.xml index 9b0d15f9..92a207e8 100644 --- a/src/main/resources/mappers/canvasStatus/canvasStatusMapper.xml +++ b/src/main/resources/mappers/canvasStatus/canvasStatusMapper.xml @@ -1,125 +1,129 @@ - + - + - + - + - + - + - + - + - - /* sqlid : com.interplug.qcast.canvasStatus.insertCanvasStatus 견적서 등록 */ - INSERT INTO TB_CANVAS_STATUS - ( user_id - , object_no - , image_name - , canvas_status - , regist_datetime - , bg_image_name - , map_position_address) - VALUES ( #{userId} - , #{objectNo} - , #{imageName} - , #{canvasStatus} - , GETDATE() - , #{bgImageName} - , #{mapPositionAddress}) - + + /* sqlid : com.interplug.qcast.canvasStatus.insertCanvasStatus 캔버스 등록 */ + INSERT INTO TB_CANVAS_STATUS + ( user_id + , object_no + , plan_no + , canvas_status + , regist_datetime + , bg_image_name + , map_position_address) + VALUES ( #{userId} + , #{objectNo} + , #{planNo} + , #{canvasStatus} + , GETDATE() + , #{bgImageName} + , #{mapPositionAddress}) + - - /* sqlid : com.interplug.qcast.canvasStatus.updateCanvasStatus 견적서 수정 */ - UPDATE TB_CANVAS_STATUS - SET canvas_status = #{canvasStatus} - , bg_image_name = #{bgImageName} - , map_position_address = #{mapPositionAddress} - , last_edit_datetime = GETDATE() - WHERE id = #{id} - + + /* sqlid : com.interplug.qcast.canvasStatus.updateCanvasStatus 캔버스 수정 */ + UPDATE TB_CANVAS_STATUS + SET canvas_status = #{canvasStatus} + , bg_image_name = #{bgImageName} + , map_position_address = #{mapPositionAddress} + , last_edit_datetime = GETDATE() + WHERE id = #{id} + - - /* sqlid : com.interplug.qcast.canvasStatus.deleteObjectNoCanvasStatus 견적서 삭제 */ - DELETE - FROM TB_CANVAS_STATUS - WHERE object_no = #{objectNo} - + + /* sqlid : com.interplug.qcast.canvasStatus.deleteObjectNoCanvasStatus 캔버스 삭제 by 물건번호(objectNo) */ + DELETE + FROM TB_CANVAS_STATUS + WHERE object_no = #{objectNo} + - - /* sqlid : com.interplug.qcast.canvasStatus.deleteIdCanvasStatus 이미지(템플릿) 삭제 */ - DELETE - FROM TB_CANVAS_STATUS - WHERE id = #{id} - + + /* sqlid : com.interplug.qcast.canvasStatus.deleteIdCanvasStatus 캔버스 삭제 by id */ + DELETE + FROM TB_CANVAS_STATUS + WHERE id = #{id} + \ No newline at end of file diff --git a/src/main/resources/mappers/canvaspopupstatus/CanvasPopupStatusMapper.xml b/src/main/resources/mappers/canvaspopupstatus/CanvasPopupStatusMapper.xml new file mode 100644 index 00000000..52dcb1ed --- /dev/null +++ b/src/main/resources/mappers/canvaspopupstatus/CanvasPopupStatusMapper.xml @@ -0,0 +1,51 @@ + + + + + + + + + INSERT INTO T_CANVAS_POPUP_STATUS + (object_no, + plan_no, + popup_type, + popup_status) + VALUES (#{objectNo}, + #{planNo}, + #{popupType}, + #{popupStatus}) + + + + UPDATE T_CANVAS_POPUP_STATUS + SET popup_status = #{popupStatus} + WHERE object_no = #{objectNo} + AND plan_no = #{planNo} + AND popup_type = #{popupType} + + + + DELETE + FROM T_CANVAS_POPUP_STATUS + WHERE object_no = #{objectNo} + AND plan_no = #{planNo} + AND popup_type = #{popupType} + + + \ No newline at end of file diff --git a/src/main/resources/mappers/estimate/estimateMapper.xml b/src/main/resources/mappers/estimate/estimateMapper.xml index 7e7e8f84..b1aa420e 100644 --- a/src/main/resources/mappers/estimate/estimateMapper.xml +++ b/src/main/resources/mappers/estimate/estimateMapper.xml @@ -351,7 +351,7 @@ , P.PLAN_NO , ROUND(CAST(P.SETUP_HEIGHT AS FLOAT), 2) AS SETUP_HEIGHT , P.SURFACE_TYPE - , RE.ROOF_NO + , RE.ROOF_SURFACE_ID , RE.ROOF_SURFACE , RE.ROOF_MATERIAL_ID , RE.SUPPORT_METHOD_ID @@ -383,7 +383,7 @@ /* sqlid : com.interplug.qcast.api.pwrGnrSimulation.selectRoofItemList (견적서 지붕재 아이템 정보 조회) */ - SELECT - A.ROOF_NO - , B.ITEM_ID - , B.AMOUNT - , B.ITEM_NO - , ISNULL((B.AMOUNT * TRY_CAST(B.SPECIFICATION AS FLOAT)), 0) AS TOT_SPECIFICATION /* 용량 */ - , C.ITEM_GROUP - /* 추후 지붕재테이블로 봐야함. */ - , C.TEMP_LOSS - , C.TEMP_COEFF - , C.CNV_EFF - , C.AMP - , B.SPECIFICATION - , A.ROOF_SURFACE - , A.CLASS_TYPE - , A.AZIMUTH - , (CASE WHEN A.CLASS_TYPE = 0 THEN A.SLOPE ELSE A.ANGLE END) AS SLOPE_ANGLE - , (CASE WHEN A.CLASS_TYPE = 0 THEN CAST(CAST(A.SLOPE AS INT)AS VARCHAR) + '寸' ELSE CAST(CAST(A.ANGLE AS INT)AS VARCHAR) + N'º' END) AS SLOPE_ANGLE_TXT - FROM T_PART_ROOF_ESTIMATE A WITH (NOLOCK) - INNER JOIN T_PART_ROOF_ITEM_ESTIMATE B WITH (NOLOCK) - ON A.OBJECT_NO = B.OBJECT_NO - AND A.PLAN_NO = B.PLAN_NO - AND A.ROOF_NO = B.ROOF_NO - INNER JOIN M_ITEM C WITH (NOLOCK) - ON B.ITEM_ID = C.ITEM_ID - WHERE A.OBJECT_NO = #{objectNo} - AND A.PLAN_NO = #{planNo} - AND C.ITEM_GROUP = #{itemGroup} - ORDER BY B.SPECIFICATION DESC + SELECT T.* + FROM ( + SELECT + A.ROOF_SURFACE_ID + , B.ITEM_ID + , SUM(B.AMOUNT) AS AMOUNT + , B.ITEM_NO + , ISNULL((SUM(B.AMOUNT) * TRY_CAST(MAX(B.SPECIFICATION) AS FLOAT)),0) AS TOT_SPECIFICATION /* 용량 */ + , MAX(C.ITEM_GROUP) AS ITEM_GROUP /* 추후 지붕재테이블로 봐야함. */ + , MAX(C.TEMP_LOSS) AS TEMP_LOSS + , MAX(C.TEMP_COEFF ) AS TEMP_COEFF + , MAX(C.CNV_EFF) AS CNV_EFF + , MAX(C.AMP) AS AMP + , MAX(B.SPECIFICATION) AS SPECIFICATION + , A.ROOF_SURFACE AS ROOF_SURFACE + , A.CLASS_TYPE AS CLASS_TYPE + , A.AZIMUTH AS AZIMUTH + , (CASE + WHEN A.CLASS_TYPE = 0 THEN A.SLOPE + ELSE A.ANGLE END) AS SLOPE_ANGLE + , (CASE + WHEN A.CLASS_TYPE = 0 THEN CAST(CAST(A.SLOPE AS INT)AS VARCHAR) + '寸' + ELSE CAST(CAST(A.ANGLE AS INT)AS VARCHAR) + N'º' END) AS SLOPE_ANGLE_TXT + FROM T_PART_ROOF_ESTIMATE A WITH (NOLOCK) + INNER JOIN T_PART_ROOF_ITEM_ESTIMATE B WITH (NOLOCK) + ON A.OBJECT_NO = B.OBJECT_NO + AND A.PLAN_NO = B.PLAN_NO + AND A.ROOF_SURFACE_ID = B.ROOF_SURFACE_ID + INNER JOIN M_ITEM C WITH (NOLOCK) + ON B.ITEM_ID = C.ITEM_ID + WHERE A.OBJECT_NO = #{objectNo} + AND A.PLAN_NO = #{planNo} + AND C.ITEM_GROUP = #{itemGroup} + GROUP BY A.ROOF_SURFACE_ID, A.ROOF_SURFACE, A.CLASS_TYPE, A.AZIMUTH, A.ANGLE, A.SLOPE, B.ITEM_ID, B.ITEM_NO + ) T + ORDER BY T.ROOF_SURFACE_ID ASC, T.ITEM_ID ASC \ No newline at end of file diff --git a/src/main/resources/template/excel/excel_download_quotation_detail_template.xlsx b/src/main/resources/template/excel/excel_download_quotation_detail_template.xlsx index b350a1bb..3b142409 100644 Binary files a/src/main/resources/template/excel/excel_download_quotation_detail_template.xlsx and b/src/main/resources/template/excel/excel_download_quotation_detail_template.xlsx differ diff --git a/src/main/resources/template/pdf/pdf_download_quotation_detail_template.html b/src/main/resources/template/pdf/pdf_download_quotation_detail_template.html index 4f73428a..44a1492b 100644 --- a/src/main/resources/template/pdf/pdf_download_quotation_detail_template.html +++ b/src/main/resources/template/pdf/pdf_download_quotation_detail_template.html @@ -367,6 +367,7 @@
件名 : +