Merge branches 'dev' and 'dev' of ssh://git.jetbrains.space/nalpari/q-cast-iii/qcast-api into dev

This commit is contained in:
lelalela 2025-01-20 16:34:15 +09:00
commit 23272ffdc5
51 changed files with 1294 additions and 553 deletions

View File

@ -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 <T> Step buildStep(String stepName, JobRepository jobRepository,
PlatformTransactionManager transactionManager, ItemReader<T> reader, ItemWriter<T> writer) {
return new StepBuilder(stepName, jobRepository).<T, T>chunk(10, transactionManager)
.reader(reader).writer(writer).build();
private <T> Step buildStep(
String stepName,
JobRepository jobRepository,
PlatformTransactionManager transactionManager,
ItemReader<T> reader,
ItemWriter<T> writer) {
return new StepBuilder(stepName, jobRepository)
.<T, T>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 <T> ListItemReader<T> createReader(List<T> items, String readerName) {
@ -131,25 +137,21 @@ public class SpecialNoteDispItemJobConfiguration implements JobExecutionListener
@Bean
@StepScope
public ListItemReader<SpecialNoteRequest> specialNoteListReader() {
return createReader(SpecialNoteDispItemSyncResponse != null
? SpecialNoteDispItemSyncResponse.getSdOrderSpnList()
: null, "specialNote");
return createReader(
SpecialNoteDispItemSyncResponse != null
? SpecialNoteDispItemSyncResponse.getSdOrderSpnList()
: null,
"specialNote");
}
@Bean
@StepScope
public ListItemReader<SpecialNoteItemRequest> specialNoteItemListReader() {
return createReader(SpecialNoteDispItemSyncResponse != null
? SpecialNoteDispItemSyncResponse.getSdOrderSpnItemList()
: null, "specialNoteItem");
}
@Bean
@StepScope
public ListItemReader<DisplayItemRequest> storeDispItemListReader() {
return createReader(SpecialNoteDispItemSyncResponse != null
? SpecialNoteDispItemSyncResponse.getStoreDispItemList()
: null, "storeDispItem");
return createReader(
SpecialNoteDispItemSyncResponse != null
? SpecialNoteDispItemSyncResponse.getSdOrderSpnItemList()
: null,
"specialNoteItem");
}
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {

View File

@ -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 <T> ListItemReader<T> createReader(List<T> 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<DisplayItemRequest> storeDispItemListReader() {
return createReader(
storeSyncResponse != null ? storeSyncResponse.getStoreDispItemList() : null,
"storeDispItem");
}
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
return items -> {
try {

View File

@ -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<CanvasStatusResponse> selectAllCanvasStatus(@PathVariable String userId) throws QcastException {
public List<CanvasStatusResponse> 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<CanvasStatusResponse> selectObjectNoCanvasStatus(@PathVariable String objectNo, @PathVariable String userId) throws QcastException {
public List<CanvasStatusResponse> 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);
}
}

View File

@ -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<CanvasStatusResponse> selectAllCanvasStatus(String userId);
// 견적서 조회(objectNo/userId)
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(String objectNo, String userId);
// 견적서 조회(Max id)
public List<CanvasStatusResponse> getMaxIdCanvasStatus(String objectNo, String userId);
// 견적서 조회(id별)
public List<CanvasStatusResponse> getIdCanvasStatus(Integer id);
// 견적서 조회(objectNo)
public List<CanvasStatusResponse> 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);
}
// imageName 생성(미사용)
public CanvasStatus getCanvasStatusImageAdd(String objectNo);
// 전체 캔버스 조회 by 사용자(userId)
public List<CanvasStatusResponse> selectAllCanvasStatus(String userId);
// 캔버스 조회 by 물건번호(objectNo) && 사용자(userId)
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(String objectNo, String userId);
// 캔버스 조회 by Max(id)
public List<CanvasStatusResponse> getMaxIdCanvasStatus(String objectNo, String userId);
// 캔버스 조회 by id
public List<CanvasStatusResponse> getIdCanvasStatus(Integer id);
// 캔버스 조회 by 물건번호(objectNo)
public List<CanvasStatusResponse> 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);
}

View File

@ -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<CanvasStatusResponse> selectAllCanvasStatus(String userId) throws QcastException {
List<CanvasStatusResponse> 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<CanvasStatusResponse> selectAllCanvasStatus(String userId) throws QcastException {
List<CanvasStatusResponse> result = null;
// 견적서 조회(objectNo)
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(String objectNo, String userId) throws QcastException {
List<CanvasStatusResponse> 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<CanvasStatusResponse> 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<CanvasStatusResponse> selectObjectNoCanvasStatus(String objectNo, String userId)
throws QcastException {
List<CanvasStatusResponse> result = null;
if (cs.getId() == null) {
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다.");
}
// 먼저 데이터가 존재하는지 확인
List<CanvasStatusResponse> 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<CanvasStatusResponse> 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<CanvasStatusResponse> 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<CanvasStatusResponse> 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<CanvasStatusResponse> 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<CanvasStatusResponse> 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<CanvasStatusResponse> existingStatus = canvasStatusMapper.getIdCanvasStatus(id);
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
if (existingStatus.size() > 0) {
canvasStatusMapper.deleteIdCanvasStatus(id);
} else {
throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 캔버스가 존재하지 않습니다.");
}
}
}

View File

@ -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 파일명

View File

@ -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; // 수정일시

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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());
}
}
}

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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<String, String> result = new HashMap<String, String>();
@ -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");

View File

@ -25,4 +25,7 @@ public class BoardRequest {
/** 종료 행 */
private int endRow;
/** 메인여부 */
private String schMainYn;
}

View File

@ -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);

View File

@ -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<ItemRequest> roofItemList = roofRequest.getRoofItemList();
List<ItemRequest> moduleList = roofRequest.getModuleList();
List<ItemRequest> roofItemList = new ArrayList<ItemRequest>();
// 동일 모듈, 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<RoofResponse> roofList = estimateMapper.selectEstimateRoofList(estimateRequest);
List<RoofResponse> roofItemList = estimateMapper.selectEstimateRoofItemList(estimateRequest);
List<ItemResponse> circuitItemList =
estimateMapper.selectEstimateCircuitItemList(estimateRequest);
for (RoofResponse roofResponse : roofList) {
List<RoofResponse> roofItemList2 = new ArrayList<RoofResponse>();
// 현재 매칭되는 지붕재 아이템 축출
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<RoofResponse> roofList = estimateMapper.selectEstimateRoofList(estimateRequest);
List<ItemResponse> 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())

View File

@ -193,9 +193,9 @@ public class EstimateRequest {
// 데이터 목록 관련 정보
@Schema(description = "지붕재 목록")
List<RoofRequest> roofList;
List<RoofRequest> roofSurfaceList;
@Schema(description = "지붕재 목록")
@Schema(description = "PC 회로구성도 목록")
List<ItemRequest> circuitItemList;
@Schema(description = "아이템 목록")

View File

@ -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;

View File

@ -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<ItemRequest> roofItemList;
List<ItemRequest> moduleList;
}

View File

@ -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;

View File

@ -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<ApiPcsAutoRecommendResponse> 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<ApiPcsVoltageStepUpResponse> getPcsVoltageStepUpList(
@RequestBody ApiPcsInfoRequest pcsVoltageStepUpRequest) {
return masterService.getPcsVoltageStepUpList(pcsVoltageStepUpRequest);
}
/** remote api group : quotation */
@Operation(description = "견적서 아이템을 조회한다.")
@PostMapping("/getQuotationItem")

View File

@ -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<ApiPcsAutoRecommendResponse> getPcsAutoRecommendList(
@RequestBody ApiPcsAutoRecommendRequest req);
@RequestBody ApiPcsInfoRequest req);
// 배치된 모듈을 선택한 PCS로 회로 구성 가능 여부 체크
@PostMapping("/pcsVoltageChk")
public ApiResponse<JsonNode> getPcsVoltageChk(@RequestBody ApiPcsInfoRequest req);
// PCS 승압설정 정보 조회
@PostMapping("/pcsVoltageStepUpList")
public ApiResponse<ApiPcsVoltageStepUpResponse> getPcsVoltageStepUpList(
@RequestBody ApiPcsInfoRequest req);
}

View File

@ -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<ApiPcsAutoRecommendRoofSurfaceRequest> roofSurfaceList;
public List<ApiPcsRoofSurfaceRequest> roofSurfaceList;
@Schema(description = "PCS아이템ID")
@NotNull
public List<ApiPcsAutoRecommendPcsItemRequest> pcsItemList;
public List<ApiPcsItemRequest> pcsItemList;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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<ApiPcsAutoRecommendModuleItemIdRequest> moduleList;
private List<ApiPcsModuleItemIdRequest> moduleList;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<ApiPcsVoltageStepUpSerQtyResponse> serQtyList;
@Schema(description = "연결함목록")
private List<ApiPcsVoltageStepUpConnResponse> connList;
}

View File

@ -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<ApiPcsVoltageStepUpPcsItemResponse> pcsItemList;
@Schema(description = "옵션목록(모니터선택)")
private List<ApiPcsVoltageStepUpOptionResponse> optionList;
}

View File

@ -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;
}

View File

@ -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<ApiPcsVoltageStepUpRoofSurfaceModuleResponse> moduleList;
}

View File

@ -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<ApiPcsVoltageStepUpRoofSurfaceResponse> roofSurfaceList;
}

View File

@ -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;
}

View File

@ -143,4 +143,8 @@ public class ApiQuotationItemRequest {
@Schema(description = "")
@NotNull
public List<ApiQuotationItemRackRequest> racks;
@Schema(description = "PCS")
@NotNull
public List<ApiQuotationItemPcsRequest> pcses;
}

View File

@ -62,4 +62,7 @@ public class ApiTrestleDetailRequest {
@Schema(description = "지붕index 번호")
private String roofIndex;
@Schema(description = "작업폭")
private String workingWidth;
}

View File

@ -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)

View File

@ -49,6 +49,9 @@ public interface ObjectMapper {
// 물건정보 수정
public int updateObject(ObjectRequest objectRequest);
// 물건정보 갱신일 수정
public int updateObjectLastEditDate(ObjectRequest objectRequest);
// 물건정보 삭제
public int deleteObject(ObjectRequest objectRequest);

View File

@ -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);
}
}
/**
* 물건정보 삭제
*

View File

@ -115,7 +115,7 @@ public class PwrGnrSimService {
// 견적서의 지붕재 목록 조회
List<PwrGnrSimRoofResponse> 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<PwrGnrSimRoofResponse> roofModuleList =
List<PwrGnrSimRoofResponse> roofGroupModuleList =
pwrGnrSimMapper.selectRoofItemList(pwrGnrSimRequest);
// 전체 모듈에서 모듈 그룹형태로 변경
// 전체 모듈에서 SORT 변경 (총용량 DESC)
List<PwrGnrSimRoofResponse> 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<PwrGnrSimRoofResponse> roofPcsList =
// pwrGnrSimMapper.selectRoofItemList(pwrGnrSimRequest);
// GROUP PCS Group Item 조회
// 모든GROUP PCS Group Item 조회
List<PwrGnrSimRoofResponse> 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;

View File

@ -7,7 +7,7 @@ import lombok.Data;
public class PwrGnrSimRoofResponse {
@Schema(description = "지붕재")
private String roofNo;
private String roofSurfaceId;
@Schema(description = "지붕명")
private String roofSurface;

View File

@ -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<SpecialNoteItemRequest> sdOrderSpnItemList;
@Schema(description = "노출 아이템 목록")
private List<DisplayItemRequest> storeDispItemList;
}

View File

@ -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<StoreFavoriteRequest> storeFavList;
@Schema(description = "노출 아이템 목록")
private List<DisplayItemRequest> storeDispItemList;
}

View File

@ -1,125 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.interplug.qcast.biz.canvasStatus.CanvasStatusMapper">
<select id="getCanvasStatusNewObjectNo" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
/* sqlid : com.interplug.qcast.canvasStatus.getCanvasStatusNewObjectNo */
SELECT #{userId} + FORMAT(GETDATE(), 'yyMMdd') + RIGHT('000' + CAST(ISNULL(MAX(CAST(RIGHT(object_no, 3) AS INT)), 0) + 1 AS VARCHAR (3)), 3) AS objectNo
FROM TB_CANVAS_STATUS
WHERE object_no LIKE #{userId} + FORMAT(GETDATE(), 'yyMMdd') + '%'
</select>
<select id="getCanvasStatusNewObjectNo" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
/* sqlid : com.interplug.qcast.canvasStatus.getCanvasStatusNewObjectNo */
SELECT #{userId} + FORMAT(GETDATE(), 'yyMMdd') + RIGHT('000' + CAST(ISNULL(MAX(CAST(RIGHT(object_no, 3) AS INT)), 0) + 1 AS VARCHAR (3)), 3) AS objectNo
FROM TB_CANVAS_STATUS
WHERE object_no LIKE #{userId} + FORMAT(GETDATE(), 'yyMMdd') + '%'
</select>
<select id="getCanvasStatusImageAdd" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
/* sqlid : com.interplug.qcast.canvasStatus.getCanvasStatusImageAdd */
SELECT 'image' + RIGHT('00' + CAST(ISNULL(MAX(CAST(RIGHT(image_name, 2) AS INT)), 0) + 1 AS VARCHAR (2)), 2) AS imageName
FROM TB_CANVAS_STATUS
WHERE object_no = #{objectNo}
</select>
<select id="getCanvasStatusImageAdd" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
/* sqlid : com.interplug.qcast.canvasStatus.getCanvasStatusImageAdd */
SELECT 'image' + RIGHT('00' + CAST(ISNULL(MAX(CAST(RIGHT(image_name, 2) AS INT)), 0) + 1 AS VARCHAR (2)), 2) AS imageName
FROM TB_CANVAS_STATUS
WHERE object_no = #{objectNo}
</select>
<select id="selectAllCanvasStatus" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
/* sqlid : com.interplug.qcast.canvasStatus.selectAllCanvasStatus 전체 견적서 조회 */
SELECT id
, user_id
, object_no
, image_name
, canvas_status
, regist_datetime
, last_edit_datetime
, bg_image_name
, map_position_address
FROM TB_CANVAS_STATUS
WHERE user_id = #{userId}
</select>
<select id="selectAllCanvasStatus" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
/* sqlid : com.interplug.qcast.canvasStatus.selectAllCanvasStatus 전체 캔버스 조회 by 사용자(userId) */
SELECT id
, user_id
, object_no
, plan_no
, canvas_status
, regist_datetime
, last_edit_datetime
, bg_image_name
, map_position_address
FROM TB_CANVAS_STATUS
WHERE user_id = #{userId}
</select>
<select id="selectObjectNoCanvasStatus" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
/* sqlid : com.interplug.qcast.canvasStatus.selectObjectNoCanvasStatus 견적서 조회 */
SELECT id
, user_id
, object_no
, image_name
, canvas_status
, regist_datetime
, last_edit_datetime
, bg_image_name
, map_position_address
FROM TB_CANVAS_STATUS
WHERE object_no = #{objectNo}
<if test="userId != null and userId != ''">
AND user_id = #{userId}
</if>
</select>
<select id="selectObjectNoCanvasStatus" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
/* sqlid : com.interplug.qcast.canvasStatus.selectObjectNoCanvasStatus 캔버스 조회 by (물건번호(objectNo)
and 사용자(userId)) */
SELECT id
, user_id
, object_no
, plan_no
, canvas_status
, regist_datetime
, last_edit_datetime
, bg_image_name
, map_position_address
FROM TB_CANVAS_STATUS
WHERE object_no = #{objectNo}
<if test="userId != null and userId != ''">
AND user_id = #{userId}
</if>
</select>
<select id="getMaxIdCanvasStatus" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
/* sqlid : com.interplug.qcast.canvasStatus.getMaxIdCanvasStatus 견적서 조회(Max id) */
SELECT MAX(id) AS id
FROM TB_CANVAS_STATUS
WHERE object_no = #{objectNo}
AND user_id = #{userId}
</select>
<select id="getMaxIdCanvasStatus" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
/* sqlid : com.interplug.qcast.canvasStatus.getMaxIdCanvasStatus 캔버스 조회 by Max(id) */
SELECT MAX(id) AS id
FROM TB_CANVAS_STATUS
WHERE object_no = #{objectNo}
AND user_id = #{userId}
</select>
<select id="getIdCanvasStatus" parameterType="integer"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
/* sqlid : com.interplug.qcast.canvasStatus.getIdCanvasStatus 견적서 조회(id별) */
SELECT id
FROM TB_CANVAS_STATUS
WHERE id = #{id}
</select>
<select id="getIdCanvasStatus" parameterType="integer"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
/* sqlid : com.interplug.qcast.canvasStatus.getIdCanvasStatus 캔버스 조회 by id */
SELECT id
FROM TB_CANVAS_STATUS
WHERE id = #{id}
</select>
<select id="getObjectNoCanvasStatus" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
/* sqlid : com.interplug.qcast.canvasStatus.getObjectNoCanvasStatus 견적서 조회 */
SELECT object_no
FROM TB_CANVAS_STATUS
WHERE object_no = #{objectNo}
</select>
<select id="getObjectNoCanvasStatus" parameterType="string"
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
/* sqlid : com.interplug.qcast.canvasStatus.getObjectNoCanvasStatus 캔버스 조회 by 물건번호(objectNo) */
SELECT object_no
FROM TB_CANVAS_STATUS
WHERE object_no = #{objectNo}
</select>
<insert id="insertCanvasStatus" parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
/* 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})
</insert>
<insert id="insertCanvasStatus"
parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
/* 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})
</insert>
<update id="updateCanvasStatus" parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
/* 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}
</update>
<update id="updateCanvasStatus"
parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
/* 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}
</update>
<delete id="deleteObjectNoCanvasStatus" parameterType="string">
/* sqlid : com.interplug.qcast.canvasStatus.deleteObjectNoCanvasStatus 견적서 삭제 */
DELETE
FROM TB_CANVAS_STATUS
WHERE object_no = #{objectNo}
</delete>
<delete id="deleteObjectNoCanvasStatus" parameterType="string">
/* sqlid : com.interplug.qcast.canvasStatus.deleteObjectNoCanvasStatus 캔버스 삭제 by 물건번호(objectNo) */
DELETE
FROM TB_CANVAS_STATUS
WHERE object_no = #{objectNo}
</delete>
<delete id="deleteIdCanvasStatus" parameterType="integer">
/* sqlid : com.interplug.qcast.canvasStatus.deleteIdCanvasStatus 이미지(템플릿) 삭제 */
DELETE
FROM TB_CANVAS_STATUS
WHERE id = #{id}
</delete>
<delete id="deleteIdCanvasStatus" parameterType="integer">
/* sqlid : com.interplug.qcast.canvasStatus.deleteIdCanvasStatus 캔버스 삭제 by id */
DELETE
FROM TB_CANVAS_STATUS
WHERE id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.interplug.qcast.biz.canvaspopupstatus.CanvasPopupStatusMapper">
<select id="selectCanvasPopupStatus"
parameterType="com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus"
resultType="com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus">
SELECT object_no,
plan_no,
popup_type,
popup_status
FROM T_CANVAS_POPUP_STATUS
WHERE object_no = #{objectNo}
AND plan_no = #{planNo}
AND popup_type = #{popupType}
</select>
<insert id="insertCanvasPopupStatus"
parameterType="com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus">
INSERT INTO T_CANVAS_POPUP_STATUS
(object_no,
plan_no,
popup_type,
popup_status)
VALUES (#{objectNo},
#{planNo},
#{popupType},
#{popupStatus})
</insert>
<update id="updateCanvasPopupStatus"
parameterType="com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus">
UPDATE T_CANVAS_POPUP_STATUS
SET popup_status = #{popupStatus}
WHERE object_no = #{objectNo}
AND plan_no = #{planNo}
AND popup_type = #{popupType}
</update>
<delete id="deleteCanvasPopupStatus"
parameterType="com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus">
DELETE
FROM T_CANVAS_POPUP_STATUS
WHERE object_no = #{objectNo}
AND plan_no = #{planNo}
AND popup_type = #{popupType}
</delete>
</mapper>

View File

@ -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 @@
<select id="selectEstimateRoofItemList" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest" resultType="com.interplug.qcast.biz.estimate.dto.RoofResponse">
/* sqlid : com.interplug.qcast.biz.estimate.selectEstimateRoofList */
SELECT
PIE.ROOF_NO
PIE.ROOF_SURFACE_ID
, PIE.OBJECT_NO
, PIE.PLAN_NO
, PIE.ITEM_ID
@ -395,7 +395,7 @@
FROM T_PART_ROOF_ITEM_ESTIMATE PIE WITH (NOLOCK)
WHERE PIE.OBJECT_NO = #{objectNo}
AND PIE.PLAN_NO = #{planNo}
ORDER BY PIE.ROOF_NO
ORDER BY PIE.ROOF_SURFACE_ID
</select>
<select id="selectEstimateCircuitItemList" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest" resultType="com.interplug.qcast.biz.estimate.dto.ItemResponse">
@ -419,11 +419,12 @@
SELECT
T.OBJECT_NO
, T.PLAN_NO
, T.ROOF_NO
, T.ROOF_SURFACE_ID
, T.ROOF_SURFACE
, T.SLOPE
, T.ANGLE
, T.CLASS_TYPE
, T.ITEM_ID
, SUM(T.AMOUNT) AS AMOUNT
, ROUND(SUM(T.AMOUNT * T.SPECIFICATION / 1000), 4) AS VOL_KW
FROM
@ -431,7 +432,7 @@
SELECT
P.OBJECT_NO
, P.PLAN_NO
, RE.ROOF_NO
, RE.ROOF_SURFACE_ID
, RE.ROOF_SURFACE
, ROUND(CAST(RE.SLOPE AS FLOAT), 2) AS SLOPE
, ROUND(CAST(RE.ANGLE AS FLOAT), 2) AS ANGLE
@ -445,9 +446,9 @@
ON P.OBJECT_NO = RE.OBJECT_NO
AND P.PLAN_NO = RE.PLAN_NO
INNER JOIN T_PART_ROOF_ITEM_ESTIMATE RIE WITH (NOLOCK)
ON RE.ROOF_NO = RIE.ROOF_NO
AND RE.OBJECT_NO = RE.OBJECT_NO
AND RE.PLAN_NO = RE.PLAN_NO
ON RE.ROOF_SURFACE_ID = RIE.ROOF_SURFACE_ID
AND RE.OBJECT_NO = RIE.OBJECT_NO
AND RE.PLAN_NO = RIE.PLAN_NO
INNER JOIN M_ITEM I WITH (NOLOCK)
ON RIE.ITEM_ID = I.ITEM_ID
WHERE P.OBJECT_NO = #{objectNo}
@ -456,7 +457,8 @@
AND I.ITEM_GROUP = #{schItemGroup}
</if>
) T
GROUP BY T.OBJECT_NO, T.PLAN_NO, T.ROOF_NO, T.ROOF_SURFACE, T.SLOPE, T.ANGLE, T.CLASS_TYPE
GROUP BY T.OBJECT_NO, T.PLAN_NO, T.ROOF_SURFACE_ID, T.ROOF_SURFACE, T.SLOPE, T.ANGLE, T.CLASS_TYPE, T.ITEM_ID
ORDER BY T.ROOF_SURFACE_ID, T.ITEM_ID
</select>
<select id="selectEstimateNoteTitleList" parameterType="com.interplug.qcast.biz.estimate.dto.NoteRequest" resultType="com.interplug.qcast.biz.estimate.dto.NoteResponse">
@ -559,6 +561,9 @@
, ADDRESSEE_COMPANY_NAME = #{objectName} + ' ' + #{objectNameOmit}
, ADDRESSEE_COMPANY_NAME_OMIT = #{objectNameOmit}
</if>
<if test='charger != null and charger != ""'>
, RECEIVE_USER = #{charger}
</if>
<if test='standardWindSpeedId != null and standardWindSpeedId != ""'>
, STANDARD_WIND_SPEED_ID = #{standardWindSpeedId}
</if>
@ -820,13 +825,10 @@
<insert id="insertEstimateRoof" parameterType="com.interplug.qcast.biz.estimate.dto.RoofRequest">
/* sqlid : com.interplug.qcast.biz.estimate.insertEstimateRoof */
<selectKey keyProperty="roofNo" keyColumn="roofNo" resultType="String" order="AFTER">
SELECT @@IDENTITY
</selectKey>
INSERT INTO T_PART_ROOF_ESTIMATE
(
OBJECT_NO
ROOF_SURFACE_ID
, OBJECT_NO
, PLAN_NO
, ROOF_SURFACE
, ROOF_MATERIAL_ID
@ -847,7 +849,8 @@
, CREATE_DATETIME
, CREATE_USER
) VALUES (
#{objectNo}
#{roofSurfaceId}
, #{objectNo}
, #{planNo}
, #{roofSurface}
, #{roofMaterialId}
@ -879,7 +882,7 @@
INSERT INTO T_PART_ROOF_ITEM_ESTIMATE
(
ROOF_ITEM_NO
, ROOF_NO
, ROOF_SURFACE_ID
, OBJECT_NO
, PLAN_NO
, ITEM_ID
@ -891,7 +894,7 @@
)
SELECT
#{roofItemNo} AS ROOF_ITEM_NO
, #{roofNo} AS ROOF_NO
, #{roofSurfaceId} AS ROOF_SURFACE_ID
, #{objectNo} AS OBJECT_NO
, #{planNo} AS PLAN_NO
, I.ITEM_ID
@ -1075,6 +1078,95 @@
AND P.DEL_FLG = '0'
</insert>
<insert id="insertEstimateRoofCopy" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateCopyRequest">
/* sqlid : com.interplug.qcast.biz.estimate.insertEstimateRoofCopy */
INSERT INTO T_PART_ROOF_ESTIMATE
(
ROOF_SURFACE_ID
, OBJECT_NO
, PLAN_NO
, ROOF_SURFACE
, ROOF_MATERIAL_ID
, SUPPORT_METHOD_ID
, CONSTRUCT_SPECIFICATION
, SLOPE
, ANGLE
, CLASS_TYPE
, AZIMUTH
, CREATE_DATETIME
, CREATE_USER
)
SELECT
PRE.ROOF_SURFACE_ID
, #{copyObjectNo} AS OBJECT_NO
, #{copyPlanNo} AS PLAN_NO
, PRE.ROOF_SURFACE
, PRE.ROOF_MATERIAL_ID
, PRE.SUPPORT_METHOD_ID
, PRE.CONSTRUCT_SPECIFICATION
, PRE.SLOPE
, PRE.ANGLE
, PRE.CLASS_TYPE
, PRE.AZIMUTH
, GETDATE()
, #{userId} AS CREATE_USER
FROM T_PART_ROOF_ESTIMATE PRE WITH (NOLOCK)
WHERE PRE.OBJECT_NO = #{objectNo}
AND PRE.PLAN_NO = #{planNo}
</insert>
<insert id="insertEstimateRoofItemCopy" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateCopyRequest">
/* sqlid : com.interplug.qcast.biz.estimate.insertEstimateRoofItemCopy */
INSERT INTO T_PART_ROOF_ITEM_ESTIMATE
(
ROOF_ITEM_NO
, ROOF_SURFACE_ID
, OBJECT_NO
, PLAN_NO
, ITEM_ID
, ITEM_NO
, ITEM_NAME
, SPECIFICATION
, AMOUNT
, PC_ITEM_ID
)
SELECT
PRIE.ROOF_ITEM_NO
, PRIE.ROOF_SURFACE_ID
, #{copyObjectNo} AS OBJECT_NO
, #{copyPlanNo} AS PLAN_NO
, PRIE.ITEM_ID
, PRIE.ITEM_NO
, PRIE.ITEM_NAME
, PRIE.SPECIFICATION
, PRIE.AMOUNT
, PRIE.PC_ITEM_ID
FROM T_PART_ROOF_ITEM_ESTIMATE PRIE WITH (NOLOCK)
WHERE PRIE.OBJECT_NO = #{objectNo}
AND PRIE.PLAN_NO = #{planNo}
</insert>
<insert id="insertEstimateCircuitItemCopy" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateCopyRequest">
/* sqlid : com.interplug.qcast.biz.estimate.insertEstimateCircuitItemCopy */
INSERT INTO T_PART_CIRCUIT_ITEM_ESTIMATE
(
CIRCUIT_NO
, OBJECT_NO
, PLAN_NO
, ITEM_ID
, CIRCUIT_CFG
)
SELECT
PCIE.CIRCUIT_NO
, #{copyObjectNo} AS OBJECT_NO
, #{copyPlanNo} AS PLAN_NO
, PCIE.ITEM_ID
, PCIE.CIRCUIT_CFG
FROM T_PART_CIRCUIT_ITEM_ESTIMATE PCIE WITH (NOLOCK)
WHERE PCIE.OBJECT_NO = #{objectNo}
AND PCIE.PLAN_NO = #{planNo}
</insert>
<insert id="insertEstimateDrawingItemCopy" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateCopyRequest">
/* sqlid : com.interplug.qcast.biz.estimate.insertEstimateDrawingItemCopy */
INSERT INTO T_PART_DRAWING_ESTIMATE

View File

@ -632,6 +632,28 @@
WHERE OBJECT_NO = #{objectNo}
</update>
<update id="updateObjectLastEditDate" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest">
/* sqlid : com.interplug.qcast.biz.object.updateObjectLastEditDate */
UPDATE T_OBJECT
SET
OBJECT_NO = #{objectNo}
<if test='standardWindSpeedId != null and standardWindSpeedId != ""'>
, STANDARD_WIND_SPEED_ID = #{standardWindSpeedId}
</if>
<if test='verticalSnowCover != null and verticalSnowCover != ""'>
, VERTICAL_SNOW_COVER = #{verticalSnowCover}
</if>
<if test='surfaceType != null and surfaceType != ""'>
, SURFACE_TYPE = #{surfaceType}
</if>
<if test='installHeight != null and installHeight != ""'>
, INSTALL_HEIGHT = #{installHeight}
</if>
, LAST_EDIT_DATETIME = GETDATE()
, LAST_EDIT_USER = #{userId}
WHERE OBJECT_NO = #{objectNo}
</update>
<update id="updateObjectDelivery" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest">
/* sqlid : com.interplug.qcast.biz.object.updateObjectDelivery */
UPDATE A SET

View File

@ -9,7 +9,7 @@
SELECT
A.OBJECT_NO /* 물건번호 */
, A.PLAN_NO /* 물건번호 */
, CONVERT(VARCHAR(10), A.DRAWING_ESTIMATE_CREATE_DATE, 121) AS DRAWING_ESTIMATE_CREATE_DATE/* 작성일 */
, CONVERT(VARCHAR(10), A.LAST_EDIT_DATETIME, 121) AS DRAWING_ESTIMATE_CREATE_DATE/* 작성일 */
, A.CAPACITY /* 시스템 용량 */
, A.SNOWFALL/* 적설조건 */
, ISNULL(C1.CODE_NM, '') AS STANDARD_WIND_SPEED_ID/* 풍속조건명 */
@ -33,7 +33,7 @@
resultType="com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRoofResponse">
/* sqlid : com.interplug.qcast.api.pwrGnrSimulation.selectRoofList (견적서 지붕재 정보 조회) */
SELECT
A.ROOF_NO
A.ROOF_SURFACE_ID
, A.ROOF_SURFACE
, A.CLASS_TYPE
, A.AZIMUTH
@ -68,34 +68,41 @@
<select id="selectRoofItemList" parameterType="com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRequest"
resultType="com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRoofResponse">
/* 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
</select>
</mapper>

View File

@ -367,6 +367,7 @@
<div class="estimate-tit-form">
<span class="estimate-tit">件名 :</span>
<span id="objectName1"></span>
<span id="objectNameOmit1"></span>
</div>
</div>
</td>