Merge branch 'dev' into feature/qcast-231

This commit is contained in:
DESKTOP-6ARNG1Q\dlsgk 2025-01-10 14:02:34 +09:00
commit dd957f8399
14 changed files with 741 additions and 308 deletions

View File

@ -71,6 +71,14 @@ public class EstimateController {
return estimateService.insertEstimateCopy(estimateCopyRequest);
}
@Operation(description = "견적서를 초기화한다.")
@PostMapping("/reset-estimate")
@ResponseStatus(HttpStatus.CREATED)
public EstimateResponse updateEstimateReset(@RequestBody EstimateRequest estimateRequest)
throws Exception {
return estimateService.updateEstimateReset(estimateRequest);
}
@Operation(description = "견적서를 엑셀로 다운로드한다.")
@PostMapping("/excel-download")
@ResponseStatus(HttpStatus.OK)

View File

@ -60,6 +60,9 @@ public interface EstimateMapper {
// 견적서 정보 수정
public int updateEstimate(EstimateRequest estimateRequest);
// 견적서 정보 초기화
public int updateEstimateReset(EstimateRequest estimateRequest);
// 견적서 API 정보 수정
public int updateEstimateApi(EstimateRequest estimateRequest);

View File

@ -40,10 +40,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -285,12 +282,17 @@ public class EstimateService {
List<RoofRequest> roofList = new ArrayList<RoofRequest>();
List<ItemRequest> itemList = estimateRequest.getItemList();
estimateRequest.setTempFlg("0");
try {
// 도면 작성일 경우에만 지붕재 데이터를 셋팅
if ("1".equals(estimateRequest.getDrawingFlg())) {
// [1]. 견적서 기본셋팅
// 플랜정보 조회 (임시저장여부 가져오기)
EstimateResponse estimateResponse = estimateMapper.selectEstimateDetail(estimateRequest);
estimateRequest.setEstimateType("YJOD");
estimateRequest.setPriceCd("UNIT_PRICE");
estimateRequest.setTempFlg("0".equals(estimateResponse.getTempFlg()) ? "0" : "1");
// 물건정보 조회 데이터 축출
ObjectResponse objectResponse =
@ -399,6 +401,7 @@ public class EstimateService {
itemRequest.setItemCtgGr(itemResponse.getItemCtgGr());
itemRequest.setPartAdd("0");
itemRequest.setDelFlg("0");
itemRequest.setDrawingItemFlg("1");
break;
}
}
@ -433,6 +436,7 @@ public class EstimateService {
bomItem.setItemCtgGr(itemResponse.getItemCtgGr());
bomItem.setPartAdd("0");
bomItem.setDelFlg("0");
bomItem.setDrawingItemFlg("1");
estimateBomList.add(bomItem);
}
@ -440,9 +444,7 @@ public class EstimateService {
}
// BOM 컴포넌트 추가
for (ItemRequest estimateBom : estimateBomList) {
itemList.add(estimateBom);
}
itemList.addAll(estimateBomList);
// [4]. 견적특이사항 관련 데이터 셋팅
NoteRequest noteRequest = new NoteRequest();
@ -469,10 +471,11 @@ public class EstimateService {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR004"; // 북면설치 체크
} else if ("ATTR005".equals(noteResponse.getCode())
&& "1".equals(objectResponse.getSaltAreaFlg())) {
&& "1".equals(objectResponse != null ? objectResponse.getSaltAreaFlg() : "")) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR005"; // 염해지역 체크
} else if ("ATTR006".equals(objectResponse.getColdRegionFlg())
} else if ("ATTR006"
.equals(objectResponse != null ? objectResponse.getColdRegionFlg() : "")
&& "1".equals(estimateRequest.getNorthArrangement())) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR006"; // 적설지역 체크
@ -651,20 +654,23 @@ public class EstimateService {
}
}
// QSP Q.CAST SEND API
List<EstimateSendResponse> resultList = new ArrayList<EstimateSendResponse>();
resultList = this.sendEstimateApi(estimateRequest);
// API에서 받은 문서번호 업데이트
for (EstimateSendResponse result : resultList) {
estimateRequest.setObjectNo(result.getObjectNo());
estimateRequest.setPlanNo(result.getPlanNo());
estimateRequest.setDocNo(result.getDocNo());
estimateRequest.setSyncFlg(result.getSyncFlg());
// 임시저장 상태에서는 인터페이스 막도록 처리
if ("0".equals(estimateRequest.getTempFlg())) {
// QSP Q.CAST SEND API
List<EstimateSendResponse> resultList = new ArrayList<EstimateSendResponse>();
resultList = this.sendEstimateApi(estimateRequest);
// API에서 받은 문서번호 업데이트
for (EstimateSendResponse result : resultList) {
estimateRequest.setObjectNo(result.getObjectNo());
estimateRequest.setPlanNo(result.getPlanNo());
estimateRequest.setDocNo(result.getDocNo());
estimateRequest.setSyncFlg(result.getSyncFlg());
estimateMapper.updateEstimateApi(estimateRequest);
estimateMapper.updateEstimateApi(estimateRequest);
}
}
} catch (Exception e) {
e.printStackTrace();
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR);
}
}
@ -856,6 +862,319 @@ public class EstimateService {
return response;
}
/**
* 견적서 초기화
*
* @param estimateRequest
* @return EstimateResponse 견적서 초기화 상세 정보
* @throws Exception
*/
public EstimateResponse updateEstimateReset(EstimateRequest estimateRequest) throws Exception {
// Validation
if (StringUtils.isEmpty(estimateRequest.getObjectNo())) {
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Object No"));
}
if (StringUtils.isEmpty(estimateRequest.getPlanNo())) {
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Plan No"));
}
// 견적서 상세 조회
EstimateResponse estimateResponse = estimateMapper.selectEstimateDetail(estimateRequest);
if (estimateResponse == null) {
throw new QcastException(
ErrorCode.NOT_FOUND, message.getMessage("common.message.required.data", "Estimate Info"));
}
// 응답 객체
EstimateResponse response = new EstimateResponse();
String splitStr = "";
try {
// [1]. 견적서 기본셋팅
estimateRequest.setEstimateType("YJOD");
estimateRequest.setPriceCd("UNIT_PRICE");
estimateRequest.setTempFlg("0".equals(estimateResponse.getTempFlg()) ? "0" : "1");
// 물건정보 조회 데이터 축출
ObjectResponse objectResponse =
objectMapper.selectObjectDetail(estimateRequest.getObjectNo());
if (objectResponse != null) {
estimateRequest.setWeatherPoint(
objectResponse.getPrefName() + " - " + objectResponse.getAreaName());
estimateRequest.setCharger(objectResponse.getReceiveUser());
}
// [2] 도면에서 저장된 아이템 목록 조회 (BOM 컴포넌트 제외)
estimateRequest.setSchBomNotExist("1");
estimateRequest.setSchDrawingFlg("1");
List<ItemResponse> estimateItemList = estimateMapper.selectEstimateItemList(estimateRequest);
List<ItemRequest> itemList = new ArrayList<ItemRequest>();
for (ItemResponse itemResponse : estimateItemList) {
ItemRequest itemRequest = new ItemRequest();
itemRequest.setObjectNo(itemResponse.getObjectNo());
itemRequest.setPlanNo(itemResponse.getPlanNo());
itemRequest.setItemId(itemResponse.getItemId());
itemRequest.setAmount(itemResponse.getAmount());
itemList.add(itemRequest);
}
// [3]. 아이템 관련 데이터 셋팅
String[] arrItemId = new String[itemList.size()];
int i = 0;
for (ItemRequest itemRequest : itemList) {
arrItemId[i++] = itemRequest.getItemId();
}
estimateRequest.setArrItemId(arrItemId);
// 아이템의 마스터 정보 정가 정보 조회
List<ItemResponse> itemResponseList = estimateMapper.selectItemMasterList(estimateRequest);
// BOM 정보 목록
List<ItemRequest> estimateBomList = new ArrayList<ItemRequest>();
int j = 1;
for (ItemRequest itemRequest : itemList) {
int dispOrder = 100 * j++;
itemRequest.setDispOrder(String.valueOf(dispOrder));
for (ItemResponse itemResponse : itemResponseList) {
if (itemRequest.getItemId().equals(itemResponse.getItemId())) {
itemRequest.setItemNo(itemResponse.getItemNo());
itemRequest.setItemName(itemResponse.getItemName());
itemRequest.setUnit(itemResponse.getUnit());
itemRequest.setPnowW(itemResponse.getPnowW());
itemRequest.setSpecification(itemResponse.getPnowW());
itemRequest.setUnitPrice(itemResponse.getSalePrice());
itemRequest.setSalePrice(itemResponse.getSalePrice());
itemRequest.setFileUploadFlg(itemResponse.getFileUploadFlg());
itemRequest.setPkgMaterialFlg(itemResponse.getPkgMaterialFlg());
itemRequest.setOpenFlg(itemResponse.getOpenFlg());
itemRequest.setItemGroup(itemResponse.getItemGroup());
itemRequest.setItemCtgGr(itemResponse.getItemCtgGr());
itemRequest.setPartAdd("0");
itemRequest.setDelFlg("0");
itemRequest.setDrawingItemFlg("1");
break;
}
}
// 아이템 BOM Header인 경우 컴포넌트 등록 처리
if ("ERLA".equals(itemRequest.getItemCtgGr())) {
List<ItemResponse> itemBomList =
estimateMapper.selectItemMasterBomList(itemRequest.getItemId());
int k = 1;
for (ItemResponse itemResponse : itemBomList) {
ItemRequest bomItem = new ItemRequest();
bomItem.setPaDispOrder(String.valueOf(dispOrder));
bomItem.setDispOrder(String.valueOf(dispOrder + k++));
bomItem.setItemId(itemResponse.getItemId());
bomItem.setItemNo(itemResponse.getItemNo());
bomItem.setItemName(itemResponse.getItemName());
bomItem.setUnit(itemResponse.getUnit());
bomItem.setPnowW(itemResponse.getPnowW());
bomItem.setSpecification(itemResponse.getPnowW());
bomItem.setAmount(
String.valueOf(
Integer.parseInt(itemResponse.getBomAmount())
* Integer.parseInt(itemRequest.getAmount())));
bomItem.setBomAmount(itemResponse.getBomAmount());
bomItem.setUnitPrice(itemResponse.getSalePrice());
bomItem.setSalePrice(itemResponse.getSalePrice());
bomItem.setFileUploadFlg(itemResponse.getFileUploadFlg());
bomItem.setPkgMaterialFlg(itemResponse.getPkgMaterialFlg());
bomItem.setItemGroup(itemResponse.getItemGroup());
bomItem.setItemCtgGr(itemResponse.getItemCtgGr());
bomItem.setPartAdd("0");
bomItem.setDelFlg("0");
bomItem.setDrawingItemFlg("1");
estimateBomList.add(bomItem);
}
}
}
// BOM 컴포넌트 추가
itemList.addAll(estimateBomList);
// [4]. 견적특이사항 관련 데이터 셋팅
NoteRequest noteRequest = new NoteRequest();
noteRequest.setArrItemId(arrItemId);
noteRequest.setSchSpnTypeCd("COMM");
List<NoteResponse> noteList = estimateMapper.selectEstimateNoteList(noteRequest);
noteRequest.setSchSpnTypeCd("PROD");
List<NoteResponse> noteItemList = estimateMapper.selectEstimateNoteItemList(noteRequest);
// 견적특이사항 코드
String estimateOptions = "";
for (NoteResponse noteResponse : noteList) {
if ("ATTR001".equals(noteResponse.getCode())) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR001"; // 공통 필수체크
} else if ("ATTR002".equals(noteResponse.getCode())) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR002"; // YJOD 필수체크
} else if ("ATTR003".equals(noteResponse.getCode())) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR003"; // 출력제어시간 기본 체크
} else if ("ATTR004".equals(noteResponse.getCode())
&& "1".equals(estimateRequest.getNorthArrangement())) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR004"; // 북면설치 체크
} else if ("ATTR005".equals(noteResponse.getCode())
&& "1".equals(objectResponse != null ? objectResponse.getSaltAreaFlg() : "")) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR005"; // 염해지역 체크
} else if ("ATTR006".equals(objectResponse != null ? objectResponse.getColdRegionFlg() : "")
&& "1".equals(estimateRequest.getNorthArrangement())) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR006"; // 적설지역 체크
} else if ("ATTR007".equals(noteResponse.getCode())) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR007"; // 지붕재치수, 레이아웃 기본 체크
} else if ("ATTR008".equals(noteResponse.getCode())) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR008"; // 별도비용 기본 체크
} else if ("ATTR009".equals(noteResponse.getCode())) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += "ATTR009"; // 과적재 기본 체크
}
}
for (NoteResponse noteResponse : noteItemList) {
if (estimateOptions.indexOf(noteResponse.getCode()) < 0) {
estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : "";
estimateOptions += noteResponse.getCode();
}
}
estimateRequest.setEstimateOption(estimateOptions);
// 아이템별 특이사항 코드 체크
for (ItemRequest itemRequest : itemList) {
String specialNoteCd = "";
for (NoteResponse noteResponse : noteItemList) {
if (itemRequest.getItemId().equals(noteResponse.getItemId())) {
specialNoteCd += !StringUtils.isEmpty(specialNoteCd) ? splitStr : "";
specialNoteCd += noteResponse.getCode();
}
}
itemRequest.setSpecialNoteCd(specialNoteCd);
}
// 첨부파일 초기화
FileRequest fileRequest = new FileRequest();
fileRequest.setObjectNo(estimateRequest.getObjectNo());
fileRequest.setPlanNo(estimateRequest.getPlanNo());
fileRequest.setUserId(estimateRequest.getUserId());
fileMapper.deleteFile(fileRequest);
// 아이템 목록 필수 체크
BigDecimal capacity = BigDecimal.ZERO;
String moduleModel = "";
String pcTypeNo = "";
for (ItemRequest itemRequest : itemList) {
if (StringUtils.isEmpty(itemRequest.getDispOrder())) {
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Display Order"));
}
if (StringUtils.isEmpty(itemRequest.getItemId())) {
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Item ID"));
}
if (StringUtils.isEmpty(itemRequest.getAmount())) {
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Item Amount"));
}
// 수량
BigDecimal amount =
new BigDecimal(
StringUtils.isEmpty(itemRequest.getAmount()) ? "0" : itemRequest.getAmount());
// 아이템용량
BigDecimal pnowW =
new BigDecimal(
StringUtils.isEmpty(itemRequest.getPnowW()) ? "0" : itemRequest.getPnowW());
// 모듈/PC 체크
if ("MODULE_".equals(itemRequest.getItemGroup())) {
moduleModel += !StringUtils.isEmpty(moduleModel) ? splitStr : "";
moduleModel += itemRequest.getItemNo();
capacity = capacity.add(amount.multiply(pnowW));
} else if ("PC_".equals(itemRequest.getItemGroup())) {
pcTypeNo += !StringUtils.isEmpty(pcTypeNo) ? splitStr : "";
pcTypeNo += itemRequest.getItemNo();
}
}
estimateRequest.setCapacity(String.valueOf(capacity));
estimateRequest.setModuleModel(moduleModel);
estimateRequest.setPcTypeNo(pcTypeNo);
// 견적서 정보 초기화
estimateMapper.updateEstimateReset(estimateRequest);
// 견적서 모든 아이템 제거
estimateMapper.deleteEstimateItemList(estimateRequest);
// 견적서 아이템 신규 추가
String hisNo = estimateMapper.selectEstimateItemHisNo(estimateRequest); // 아이템 히스토리 번호 조회
for (ItemRequest itemRequest : itemList) {
itemRequest.setHisNo(hisNo);
itemRequest.setObjectNo(estimateRequest.getObjectNo());
itemRequest.setPlanNo(estimateRequest.getPlanNo());
itemRequest.setAmount(
!StringUtils.isEmpty(itemRequest.getAmount()) ? itemRequest.getAmount() : "0");
itemRequest.setSalePrice(
!StringUtils.isEmpty(itemRequest.getSalePrice()) ? itemRequest.getSalePrice() : "0");
itemRequest.setBomAmount(
!StringUtils.isEmpty(itemRequest.getBomAmount()) ? itemRequest.getBomAmount() : "0");
itemRequest.setPartAdd(
!StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0");
itemRequest.setOpenFlg(
!StringUtils.isEmpty(itemRequest.getOpenFlg()) ? itemRequest.getOpenFlg() : "0");
itemRequest.setItemChangeFlg(
!StringUtils.isEmpty(itemRequest.getItemChangeFlg())
? itemRequest.getItemChangeFlg()
: "0");
itemRequest.setUserId(estimateRequest.getUserId());
estimateMapper.insertEstimateItemHis(itemRequest);
if (!"1".equals(itemRequest.getDelFlg())) {
estimateMapper.insertEstimateItem(itemRequest);
}
}
// 임시저장 상태에서는 인터페이스 막도록 처리
if ("0".equals(estimateRequest.getTempFlg())) {
// QSP Q.CAST SEND API
List<EstimateSendResponse> resultList = new ArrayList<EstimateSendResponse>();
resultList = this.sendEstimateApi(estimateRequest);
// API에서 받은 문서번호 업데이트
for (EstimateSendResponse result : resultList) {
estimateRequest.setObjectNo(result.getObjectNo());
estimateRequest.setPlanNo(result.getPlanNo());
estimateRequest.setDocNo(result.getDocNo());
estimateRequest.setSyncFlg(result.getSyncFlg());
estimateMapper.updateEstimateApi(estimateRequest);
}
}
} catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR);
}
// [9]. 최종 생성 물건번호 리턴
response.setObjectNo(estimateRequest.getObjectNo());
response.setPlanNo(estimateRequest.getPlanNo());
return response;
}
/**
* 견적서 엑셀 다운로드
*
@ -1354,11 +1673,14 @@ public class EstimateService {
elm = doc.getElementById("estimateDate");
elm.text(StringUtils.defaultString(data.getEstimateDate()));
elm = doc.getElementById("saleStoreName");
elm.text(StringUtils.defaultString(data.getSaleStoreName()));
elm = doc.getElementById("bizNo");
elm.text(StringUtils.defaultString(data.getBizNo()));
elm = doc.getElementById("zipNo");
elm.text(StringUtils.defaultString(data.getZipNo()));
elm.text("(" + StringUtils.defaultString(data.getZipNo()) + ")");
elm = doc.getElementById("address");
elm.text(StringUtils.defaultString(data.getAddress()));

View File

@ -157,6 +157,9 @@ public class EstimateRequest {
@Schema(description = "QSP 동기화 여부")
private String syncFlg;
@Schema(description = "임시저장 여부")
private String tempFlg;
@Schema(description = "비고")
private String remarks;
@ -185,6 +188,9 @@ public class EstimateRequest {
@Schema(description = "검색 - 아이템 BOM 제외여부")
private String schBomNotExist;
@Schema(description = "검색 - 도면 아이템여부")
private String schDrawingItemFlg;
// 데이터 목록 관련 정보
@Schema(description = "지붕재 목록")
List<RoofRequest> roofList;

View File

@ -146,6 +146,9 @@ public class EstimateResponse {
@Schema(description = "비고")
private String remarks;
@Schema(description = "임시저장 여부")
private String tempFlg;
@Schema(description = "갱신일")
private String lastEditDatetime;
@ -208,6 +211,12 @@ public class EstimateResponse {
@Schema(description = "하위 판매점명")
private String agencySaleStoreName;
@Schema(description = "한랭지 대책여부")
private String coldRegionFlg;
@Schema(description = "염해지역 아이템사용 여부")
private String saltAreaFlg;
// 판매점 정보
@Schema(description = "고객 판매점명")
private String custSaleStoreName;

View File

@ -89,6 +89,9 @@ public class ItemRequest {
@Schema(description = "히스토리 번호")
private String hisNo;
@Schema(description = "도면 아이템여부")
private String drawingItemFlg;
@Schema(description = "삭제여부")
private String delFlg;

View File

@ -1,240 +1,244 @@
package com.interplug.qcast.biz.master;
import com.interplug.qcast.biz.master.dto.ApiConstructionResponse;
import com.interplug.qcast.biz.master.dto.ApiModuleTpResponse;
import com.interplug.qcast.biz.master.dto.ApiResponse;
import com.interplug.qcast.biz.master.dto.ApiRoofMaterialResponse;
import com.interplug.qcast.biz.master.dto.ApiTrestleDetailResponse;
import com.interplug.qcast.biz.master.dto.ApiTrestleResponse;
import com.interplug.qcast.biz.master.dto.*;
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.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/api/v1/master")
@RequiredArgsConstructor
@Tag(name = "MasterController", description = "Master API")
public class MasterController {
private final MasterService masterService;
private final MasterService masterService;
@Operation(description = "지붕재 목록을 조회한다.")
@GetMapping("/getRoofMaterialList")
public ApiResponse<ApiRoofMaterialResponse> getRoofMaterialList() {
return masterService.getRoofMaterialList();
}
@Operation(description = "모듈 타입별 아이템 목록을 조회한다.")
@GetMapping("/getModuleTypeItemList")
public ApiResponse<ApiModuleTpResponse> getModuleTypeItemList(
@Parameter(description = "지붕재 코드 목록") @RequestParam("arrRoofMatlCd")
List<String> roofMaterialCd)
throws QcastException {
if (roofMaterialCd == null
|| roofMaterialCd.isEmpty()
|| roofMaterialCd.size() > 4
|| roofMaterialCd.stream().anyMatch(s -> s == null || s.trim().isEmpty())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE);
}
return masterService.getModuleTypeItemList(roofMaterialCd);
}
@Operation(description = "가대 목록 조회한다.")
@GetMapping("/getTrestleList")
public ApiResponse<ApiTrestleResponse> getTrestleList(
@Parameter(description = "모듈타입코드") @RequestParam(required = false) String moduleTpCd,
@Parameter(description = "지붕재코드") @RequestParam(required = false) String roofMatlCd,
@Parameter(description = "서까래기초코드") @RequestParam(required = false) String raftBaseCd,
@Parameter(description = "가대메이커코드") @RequestParam(required = false) String trestleMkrCd,
@Parameter(description = "공법코드") @RequestParam(required = false) String constMthdCd,
@Parameter(description = "지붕기초코드") @RequestParam(required = false) String roofBaseCd) {
ApiTrestleBuilder apiTrestleInfoBuilder =
new ApiTrestleBuilder(
moduleTpCd, roofMatlCd, raftBaseCd, trestleMkrCd, constMthdCd, roofBaseCd);
ApiTrestleBuilder atb =
apiTrestleInfoBuilder
.setModuleTpCd(moduleTpCd)
.setRoofMatlCdCd(roofMatlCd)
.setRaftBaseCd(raftBaseCd)
.setTrestleMkrCd(trestleMkrCd)
.setConstMthdCd(constMthdCd)
.setRoofBaseCd(roofBaseCd)
.build();
return masterService.getTrestleList(
atb.getModuleTpCd(),
atb.getRoofMatlCd(),
atb.getRaftBaseCd(),
atb.getTrestleMkrCd(),
atb.getConstMthdCd(),
atb.getRoofBaseCd());
}
@Operation(description = "시공법 목록 조회한다.")
@GetMapping("/getConstructionList")
public ApiResponse<ApiConstructionResponse> getConstructionList(
@Parameter(description = "모듈타입코드") @RequestParam String moduleTpCd,
@Parameter(description = "지붕재코드") @RequestParam String roofMatlCd,
@Parameter(description = "가대메이커코드") @RequestParam String trestleMkrCd,
@Parameter(description = "공법코드") @RequestParam String constMthdCd,
@Parameter(description = "지붕기초코드") @RequestParam String roofBaseCd,
@Parameter(description = "면조도") @RequestParam String illuminationTp,
@Parameter(description = "설치높이") @RequestParam String instHt,
@Parameter(description = "풍속") @RequestParam String stdWindSpeed,
@Parameter(description = "적설량") @RequestParam String stdSnowLd,
@Parameter(description = "경사도코드") @RequestParam String inclCd,
@Parameter(description = "서까래기초코드") @RequestParam(required = false) String raftBaseCd,
@Parameter(description = "하제(망둥어)피치") @RequestParam(required = false) Integer roofPitch)
throws QcastException {
if (moduleTpCd == null
|| moduleTpCd.trim().isEmpty()
|| roofMatlCd == null
|| roofMatlCd.trim().isEmpty()
|| trestleMkrCd == null
|| trestleMkrCd.trim().isEmpty()
|| constMthdCd == null
|| constMthdCd.trim().isEmpty()
|| roofBaseCd == null
|| roofBaseCd.trim().isEmpty()
|| illuminationTp == null
|| illuminationTp.trim().isEmpty()
|| instHt == null
|| instHt.trim().isEmpty()
|| stdWindSpeed == null
|| stdWindSpeed.trim().isEmpty()
|| stdSnowLd == null
|| stdSnowLd.trim().isEmpty()
|| inclCd == null
|| inclCd.trim().isEmpty()) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE);
@Operation(description = "지붕재 목록을 조회한다.")
@GetMapping("/getRoofMaterialList")
public ApiResponse<ApiRoofMaterialResponse> getRoofMaterialList() {
return masterService.getRoofMaterialList();
}
ApiConstructionBuilder apiConstructionBuilder =
new ApiConstructionBuilder(
moduleTpCd,
roofMatlCd,
trestleMkrCd,
constMthdCd,
roofBaseCd,
illuminationTp,
instHt,
stdWindSpeed,
stdSnowLd,
inclCd,
raftBaseCd,
roofPitch);
ApiConstructionBuilder acb =
apiConstructionBuilder
.setModuleTpCd(moduleTpCd)
.setRoofMatlCd(roofMatlCd)
.setTrestleMkrCd(trestleMkrCd)
.setConstMthdCd(constMthdCd)
.setRoofBaseCd(roofBaseCd)
.setIlluminationTp(illuminationTp)
.setInstHt(instHt)
.setStdWindSpeed(stdWindSpeed)
.setStdSnowLd(stdSnowLd)
.setInclCd(inclCd)
.setRaftBaseCd(raftBaseCd)
.setRoofPitch(roofPitch)
.build();
return masterService.getConstructionList(
acb.getModuleTpCd(),
acb.getRoofMatlCd(),
acb.getTrestleMkrCd(),
acb.getConstMthdCd(),
acb.getRoofBaseCd(),
acb.getIlluminationTp(),
acb.getInstHt(),
acb.getStdWindSpeed(),
acb.getStdSnowLd(),
acb.getInclCd(),
acb.getRaftBaseCd(),
acb.getRoofPitch());
}
@Operation(description = "가대 상세 조회한다.")
@GetMapping("/getTrestleDetailList")
public ApiResponse<ApiTrestleDetailResponse> getTrestleDetailList(
@Parameter(description = "모듈타입코드") @RequestParam String moduleTpCd,
@Parameter(description = "지붕재코드") @RequestParam String roofMatlCd,
@Parameter(description = "가대메이커코드") @RequestParam String trestleMkrCd,
@Parameter(description = "공법코드") @RequestParam String constMthdCd,
@Parameter(description = "지붕기초코드") @RequestParam String roofBaseCd,
@Parameter(description = "면조도") @RequestParam String illuminationTp,
@Parameter(description = "설치높이") @RequestParam String instHt,
@Parameter(description = "풍속") @RequestParam String stdWindSpeed,
@Parameter(description = "적설량") @RequestParam String stdSnowLd,
@Parameter(description = "경사도코드") @RequestParam String inclCd,
@Parameter(description = "시공법") @RequestParam String constTp,
@Parameter(description = "혼합모듈번호") @RequestParam(required = false) Integer mixMatlNo,
@Parameter(description = "하제(망둥어)피치") @RequestParam(required = false) Integer roofPitch)
throws QcastException {
if (moduleTpCd == null
|| moduleTpCd.trim().isEmpty()
|| roofMatlCd == null
|| roofMatlCd.trim().isEmpty()
|| trestleMkrCd == null
|| trestleMkrCd.trim().isEmpty()
|| constMthdCd == null
|| constMthdCd.trim().isEmpty()
|| roofBaseCd == null
|| roofBaseCd.trim().isEmpty()
|| illuminationTp == null
|| illuminationTp.trim().isEmpty()
|| instHt == null
|| instHt.trim().isEmpty()
|| stdWindSpeed == null
|| stdWindSpeed.trim().isEmpty()
|| stdSnowLd == null
|| stdSnowLd.trim().isEmpty()
|| inclCd == null
|| inclCd.trim().isEmpty()
|| constTp == null
|| constTp.trim().isEmpty()) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE);
@Operation(description = "모듈 타입별 아이템 목록을 조회한다.")
@GetMapping("/getModuleTypeItemList")
public ApiResponse<ApiModuleTpResponse> getModuleTypeItemList(
@Parameter(description = "지붕재 코드 목록") @RequestParam("arrRoofMatlCd")
List<String> roofMaterialCd)
throws QcastException {
if (roofMaterialCd == null
|| roofMaterialCd.isEmpty()
|| roofMaterialCd.size() > 4
|| roofMaterialCd.stream().anyMatch(s -> s == null || s.trim().isEmpty())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE);
}
return masterService.getModuleTypeItemList(roofMaterialCd);
}
ApiTrestleDetailBuilder atdb =
ApiTrestleDetailBuilder.builder()
.moduleTpCd(moduleTpCd)
.roofMatlCd(roofMatlCd)
.trestleMkrCd(trestleMkrCd)
.constMthdCd(constMthdCd)
.roofBaseCd(roofBaseCd)
.illuminationTp(illuminationTp)
.instHt(instHt)
.stdWindSpeed(stdWindSpeed)
.stdSnowLd(stdSnowLd)
.inclCd(inclCd)
.constTp(constTp)
.mixMatlNo(mixMatlNo)
.roofPitch(roofPitch)
.build();
@Operation(description = "가대 목록 조회한다.")
@GetMapping("/getTrestleList")
public ApiResponse<ApiTrestleResponse> getTrestleList(
@Parameter(description = "모듈타입코드") @RequestParam(required = false) String moduleTpCd,
@Parameter(description = "지붕재코드") @RequestParam(required = false) String roofMatlCd,
@Parameter(description = "서까래기초코드") @RequestParam(required = false) String raftBaseCd,
@Parameter(description = "가대메이커코드") @RequestParam(required = false) String trestleMkrCd,
@Parameter(description = "공법코드") @RequestParam(required = false) String constMthdCd,
@Parameter(description = "지붕기초코드") @RequestParam(required = false) String roofBaseCd) {
return masterService.getTrestleDetailList(
atdb.getModuleTpCd(),
atdb.getRoofMatlCd(),
atdb.getTrestleMkrCd(),
atdb.getConstMthdCd(),
atdb.getRoofBaseCd(),
atdb.getIlluminationTp(),
atdb.getInstHt(),
atdb.getStdWindSpeed(),
atdb.getStdSnowLd(),
atdb.getInclCd(),
atdb.getConstTp(),
atdb.getMixMatlNo(),
atdb.getRoofPitch());
}
ApiTrestleBuilder apiTrestleInfoBuilder =
new ApiTrestleBuilder(
moduleTpCd, roofMatlCd, raftBaseCd, trestleMkrCd, constMthdCd, roofBaseCd);
ApiTrestleBuilder atb =
apiTrestleInfoBuilder
.setModuleTpCd(moduleTpCd)
.setRoofMatlCdCd(roofMatlCd)
.setRaftBaseCd(raftBaseCd)
.setTrestleMkrCd(trestleMkrCd)
.setConstMthdCd(constMthdCd)
.setRoofBaseCd(roofBaseCd)
.build();
return masterService.getTrestleList(
atb.getModuleTpCd(),
atb.getRoofMatlCd(),
atb.getRaftBaseCd(),
atb.getTrestleMkrCd(),
atb.getConstMthdCd(),
atb.getRoofBaseCd());
}
@Operation(description = "시공법 목록 조회한다.")
@GetMapping("/getConstructionList")
public ApiResponse<ApiConstructionResponse> getConstructionList(
@Parameter(description = "모듈타입코드") @RequestParam String moduleTpCd,
@Parameter(description = "지붕재코드") @RequestParam String roofMatlCd,
@Parameter(description = "가대메이커코드") @RequestParam String trestleMkrCd,
@Parameter(description = "공법코드") @RequestParam String constMthdCd,
@Parameter(description = "지붕기초코드") @RequestParam String roofBaseCd,
@Parameter(description = "면조도") @RequestParam String illuminationTp,
@Parameter(description = "설치높이") @RequestParam String instHt,
@Parameter(description = "풍속") @RequestParam String stdWindSpeed,
@Parameter(description = "적설량") @RequestParam String stdSnowLd,
@Parameter(description = "경사도코드") @RequestParam String inclCd,
@Parameter(description = "서까래기초코드") @RequestParam(required = false) String raftBaseCd,
@Parameter(description = "하제(망둥어)피치") @RequestParam(required = false) Integer roofPitch)
throws QcastException {
if (moduleTpCd == null
|| moduleTpCd.trim().isEmpty()
|| roofMatlCd == null
|| roofMatlCd.trim().isEmpty()
|| trestleMkrCd == null
|| trestleMkrCd.trim().isEmpty()
|| constMthdCd == null
|| constMthdCd.trim().isEmpty()
|| roofBaseCd == null
|| roofBaseCd.trim().isEmpty()
|| illuminationTp == null
|| illuminationTp.trim().isEmpty()
|| instHt == null
|| instHt.trim().isEmpty()
|| stdWindSpeed == null
|| stdWindSpeed.trim().isEmpty()
|| stdSnowLd == null
|| stdSnowLd.trim().isEmpty()
|| inclCd == null
|| inclCd.trim().isEmpty()) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE);
}
ApiConstructionBuilder apiConstructionBuilder =
new ApiConstructionBuilder(
moduleTpCd,
roofMatlCd,
trestleMkrCd,
constMthdCd,
roofBaseCd,
illuminationTp,
instHt,
stdWindSpeed,
stdSnowLd,
inclCd,
raftBaseCd,
roofPitch);
ApiConstructionBuilder acb =
apiConstructionBuilder
.setModuleTpCd(moduleTpCd)
.setRoofMatlCd(roofMatlCd)
.setTrestleMkrCd(trestleMkrCd)
.setConstMthdCd(constMthdCd)
.setRoofBaseCd(roofBaseCd)
.setIlluminationTp(illuminationTp)
.setInstHt(instHt)
.setStdWindSpeed(stdWindSpeed)
.setStdSnowLd(stdSnowLd)
.setInclCd(inclCd)
.setRaftBaseCd(raftBaseCd)
.setRoofPitch(roofPitch)
.build();
return masterService.getConstructionList(
acb.getModuleTpCd(),
acb.getRoofMatlCd(),
acb.getTrestleMkrCd(),
acb.getConstMthdCd(),
acb.getRoofBaseCd(),
acb.getIlluminationTp(),
acb.getInstHt(),
acb.getStdWindSpeed(),
acb.getStdSnowLd(),
acb.getInclCd(),
acb.getRaftBaseCd(),
acb.getRoofPitch());
}
@Operation(description = "가대 상세 조회한다.")
@GetMapping("/getTrestleDetailList")
public ApiResponse<ApiTrestleDetailResponse> getTrestleDetailList(
@Parameter(description = "모듈타입코드") @RequestParam String moduleTpCd,
@Parameter(description = "지붕재코드") @RequestParam String roofMatlCd,
@Parameter(description = "가대메이커코드") @RequestParam String trestleMkrCd,
@Parameter(description = "공법코드") @RequestParam String constMthdCd,
@Parameter(description = "지붕기초코드") @RequestParam String roofBaseCd,
@Parameter(description = "면조도") @RequestParam String illuminationTp,
@Parameter(description = "설치높이") @RequestParam String instHt,
@Parameter(description = "풍속") @RequestParam String stdWindSpeed,
@Parameter(description = "적설량") @RequestParam String stdSnowLd,
@Parameter(description = "경사도코드") @RequestParam String inclCd,
@Parameter(description = "시공법") @RequestParam String constTp,
@Parameter(description = "혼합모듈번호") @RequestParam(required = false) Integer mixMatlNo,
@Parameter(description = "하제(망둥어)피치") @RequestParam(required = false) Integer roofPitch)
throws QcastException {
if (moduleTpCd == null
|| moduleTpCd.trim().isEmpty()
|| roofMatlCd == null
|| roofMatlCd.trim().isEmpty()
|| trestleMkrCd == null
|| trestleMkrCd.trim().isEmpty()
|| constMthdCd == null
|| constMthdCd.trim().isEmpty()
|| roofBaseCd == null
|| roofBaseCd.trim().isEmpty()
|| illuminationTp == null
|| illuminationTp.trim().isEmpty()
|| instHt == null
|| instHt.trim().isEmpty()
|| stdWindSpeed == null
|| stdWindSpeed.trim().isEmpty()
|| stdSnowLd == null
|| stdSnowLd.trim().isEmpty()
|| inclCd == null
|| inclCd.trim().isEmpty()
|| constTp == null
|| constTp.trim().isEmpty()) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE);
}
ApiTrestleDetailBuilder atdb =
ApiTrestleDetailBuilder.builder()
.moduleTpCd(moduleTpCd)
.roofMatlCd(roofMatlCd)
.trestleMkrCd(trestleMkrCd)
.constMthdCd(constMthdCd)
.roofBaseCd(roofBaseCd)
.illuminationTp(illuminationTp)
.instHt(instHt)
.stdWindSpeed(stdWindSpeed)
.stdSnowLd(stdSnowLd)
.inclCd(inclCd)
.constTp(constTp)
.mixMatlNo(mixMatlNo)
.roofPitch(roofPitch)
.build();
return masterService.getTrestleDetailList(
atdb.getModuleTpCd(),
atdb.getRoofMatlCd(),
atdb.getTrestleMkrCd(),
atdb.getConstMthdCd(),
atdb.getRoofBaseCd(),
atdb.getIlluminationTp(),
atdb.getInstHt(),
atdb.getStdWindSpeed(),
atdb.getStdSnowLd(),
atdb.getInclCd(),
atdb.getConstTp(),
atdb.getMixMatlNo(),
atdb.getRoofPitch());
}
@Operation(description = "PCS 메이커, 시리즈 조회한다.")
@GetMapping("/pcsMakerList")
public ApiResponse<ApiPcsMakerResponse> getPcsMakerList(@Parameter(description = "PCS 메이커 코드") @RequestParam(required = false) String pcsMkrCd,
@Parameter(description = "혼합모듈번호") @RequestParam(required = false) String mixMatlNo) {
return masterService.getPcsMakerList(pcsMkrCd, mixMatlNo);
}
}

View File

@ -1,69 +1,70 @@
package com.interplug.qcast.biz.master;
import com.interplug.qcast.biz.master.dto.ApiConstructionResponse;
import com.interplug.qcast.biz.master.dto.ApiModuleTpResponse;
import com.interplug.qcast.biz.master.dto.ApiResponse;
import com.interplug.qcast.biz.master.dto.ApiRoofMaterialResponse;
import com.interplug.qcast.biz.master.dto.ApiTrestleDetailResponse;
import com.interplug.qcast.biz.master.dto.ApiTrestleResponse;
import java.util.List;
import com.interplug.qcast.biz.master.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
// @FeignClient(name = "master", url = "${feign.master.url}")
@FeignClient(name = "master", url = "${qsp.url}/api/master")
public interface MasterService {
// 지붕재 목록 조회
@GetMapping("/roofMaterialList")
public ApiResponse<ApiRoofMaterialResponse> getRoofMaterialList();
// 지붕재 목록 조회
@GetMapping("/roofMaterialList")
public ApiResponse<ApiRoofMaterialResponse> getRoofMaterialList();
// 모듈 타입별 아이템 목록 조회
@GetMapping("/moduleTypeItemList")
public ApiResponse<ApiModuleTpResponse> getModuleTypeItemList(
@RequestParam("arrRoofMatlCd") List<String> roofMaterialCd);
// 모듈 타입별 아이템 목록 조회
@GetMapping("/moduleTypeItemList")
public ApiResponse<ApiModuleTpResponse> getModuleTypeItemList(
@RequestParam("arrRoofMatlCd") List<String> roofMaterialCd);
// 가대 목록 조회
@GetMapping("/trestle")
public ApiResponse<ApiTrestleResponse> getTrestleList(
@RequestParam(required = false) String moduleTpCd,
@RequestParam(required = false) String roofMatlCd,
@RequestParam(required = false) String raftBaseCd,
@RequestParam(required = false) String trestleMkrCd,
@RequestParam(required = false) String constMthdCd,
@RequestParam(required = false) String roofBaseCd);
// 가대 목록 조회
@GetMapping("/trestle")
public ApiResponse<ApiTrestleResponse> getTrestleList(
@RequestParam(required = false) String moduleTpCd,
@RequestParam(required = false) String roofMatlCd,
@RequestParam(required = false) String raftBaseCd,
@RequestParam(required = false) String trestleMkrCd,
@RequestParam(required = false) String constMthdCd,
@RequestParam(required = false) String roofBaseCd);
// 시공법 목록 조회
@GetMapping("/construction")
public ApiResponse<ApiConstructionResponse> getConstructionList(
@RequestParam String moduleTpCd,
@RequestParam String roofMatlCd,
@RequestParam String trestleMkrCd,
@RequestParam String constMthdCd,
@RequestParam String roofBaseCd,
@RequestParam String illuminationTp,
@RequestParam String instHt,
@RequestParam String stdWindSpeed,
@RequestParam String stdSnowLd,
@RequestParam String inclCd,
@RequestParam(required = false) String raftBaseCd,
@RequestParam(required = false) Integer roofPitch);
// 시공법 목록 조회
@GetMapping("/construction")
public ApiResponse<ApiConstructionResponse> getConstructionList(
@RequestParam String moduleTpCd,
@RequestParam String roofMatlCd,
@RequestParam String trestleMkrCd,
@RequestParam String constMthdCd,
@RequestParam String roofBaseCd,
@RequestParam String illuminationTp,
@RequestParam String instHt,
@RequestParam String stdWindSpeed,
@RequestParam String stdSnowLd,
@RequestParam String inclCd,
@RequestParam(required = false) String raftBaseCd,
@RequestParam(required = false) Integer roofPitch);
// 가대 상세 조회
@GetMapping(value = "/trestle/detail", consumes = "application/json")
public ApiResponse<ApiTrestleDetailResponse> getTrestleDetailList(
@RequestParam String moduleTpCd,
@RequestParam String roofMatlCd,
@RequestParam String trestleMkrCd,
@RequestParam String constMthdCd,
@RequestParam String roofBaseCd,
@RequestParam String illuminationTp,
@RequestParam String instHt,
@RequestParam String stdWindSpeed,
@RequestParam String stdSnowLd,
@RequestParam String inclCd,
@RequestParam String constTp,
@RequestParam(required = false) Integer mixMatlNo,
@RequestParam(required = false) Integer roofPitch);
// 가대 상세 조회
@GetMapping(value = "/trestle/detail", consumes = "application/json")
public ApiResponse<ApiTrestleDetailResponse> getTrestleDetailList(
@RequestParam String moduleTpCd,
@RequestParam String roofMatlCd,
@RequestParam String trestleMkrCd,
@RequestParam String constMthdCd,
@RequestParam String roofBaseCd,
@RequestParam String illuminationTp,
@RequestParam String instHt,
@RequestParam String stdWindSpeed,
@RequestParam String stdSnowLd,
@RequestParam String inclCd,
@RequestParam String constTp,
@RequestParam(required = false) Integer mixMatlNo,
@RequestParam(required = false) Integer roofPitch);
// PCS Maker, 시리즈 목록 조회
@GetMapping("/pcsMakerList")
public ApiResponse<ApiPcsMakerResponse> getPcsMakerList(@RequestParam(required = false) String pcsMkrCd,
@RequestParam(required = false) String mixMatlNo);
}

View File

@ -0,0 +1,37 @@
package com.interplug.qcast.biz.master.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "PCS 메이커, 시리즈 목록 조회")
public class ApiPcsMakerResponse {
@Schema(description = "PCS메이커코드")
private String pcsMkrCd;
@Schema(description = "PCS메이커코드명")
private String pcsMkrNm;
@Schema(description = "PCS메이커코드명(일본)")
private String pcsMkrNmJp;
@Schema(description = "PCS시리즈멀티선택타입(멀티:MULTI, 단독:SINGLE, 단독(병설):SINGLE-P)")
private String pcsMkrMultiType;
@Schema(description = "PCS시리즈코드")
private String pcsSerCd;
@Schema(description = "PCS시리즈코드명")
private String pcsSerNm;
@Schema(description = "PCS시리즈코드명(일본)")
private String pcsSerNmJp;
@Schema(description = "PCS시리즈 병설 여부")
private String pcsSerParallelYn;
}

View File

@ -1,14 +1,6 @@
package com.interplug.qcast.biz.object;
import com.interplug.qcast.biz.object.dto.ObjectRequest;
import com.interplug.qcast.biz.object.dto.ObjectResponse;
import com.interplug.qcast.biz.object.dto.PlanReqRequest;
import com.interplug.qcast.biz.object.dto.PlanReqResponse;
import com.interplug.qcast.biz.object.dto.PlanRequest;
import com.interplug.qcast.biz.object.dto.PrefResponse;
import com.interplug.qcast.biz.object.dto.SaleStoreResponse;
import com.interplug.qcast.biz.object.dto.UploadRequest;
import com.interplug.qcast.biz.object.dto.WindSpeedResponse;
import com.interplug.qcast.biz.object.dto.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
@ -113,8 +105,8 @@ public class ObjectController {
@Operation(description = "물건정보의 플랜정보를 추가한다.")
@PostMapping("/add-plan")
@ResponseStatus(HttpStatus.CREATED)
public void insertPlan(@RequestBody PlanRequest planRequest) throws Exception {
objectService.insertPlan(planRequest);
public PlanResponse insertPlan(@RequestBody PlanRequest planRequest) throws Exception {
return objectService.insertPlan(planRequest);
}
@Operation(description = "물건정보의 플랜정보를 삭제한다.")

View File

@ -270,6 +270,7 @@ public class ObjectService {
planRequest.setNorthArrangement("0");
planRequest.setDiffRoofEnabled("0");
planRequest.setOrderFlg("0");
planRequest.setTempFlg("1");
planRequest.setUserId(objectRequest.getUserId());
result += objectMapper.insertPlan(planRequest);
@ -460,7 +461,10 @@ public class ObjectService {
* @return String 추가 플랜번호
* @throws Exception
*/
public String insertPlan(PlanRequest planRequest) throws Exception {
public PlanResponse insertPlan(PlanRequest planRequest) throws Exception {
PlanResponse planResponse = new PlanResponse();
// Validation
if (StringUtils.isEmpty(planRequest.getObjectNo())) {
throw new QcastException(
@ -482,10 +486,14 @@ public class ObjectService {
planRequest.setNorthArrangement("0");
planRequest.setDiffRoofEnabled("0");
planRequest.setOrderFlg("0");
planRequest.setTempFlg("1");
objectMapper.insertPlan(planRequest);
return planRequest.getPlanNo();
planResponse.setObjectNo(planRequest.getObjectNo());
planResponse.setPlanNo(planRequest.getPlanNo());
return planResponse;
}
/**

View File

@ -106,4 +106,7 @@ public class PlanRequest {
@Schema(description = "발주여부")
private String orderFlg;
@Schema(description = "임시저장여부")
private String tempFlg;
}

View File

@ -49,6 +49,7 @@
, P.PKG_ASP
, P.PRICE_CD
, P.REMARKS
, P.TEMP_FLG
, P.LAST_EDIT_DATETIME
, P.CREATE_DATETIME
, P.CREATE_USER
@ -56,6 +57,8 @@
, O.OBJECT_NAME_OMIT
, O.REMARKS AS OBJECT_REMARKS
, O.SALE_STORE_ID
, ISNULL(O.COLD_REGION_FLG, '0') AS COLD_REGION_FLG
, ISNULL(O.SALT_AREA_FLG, '0') AS SALT_AREA_FLG
, SS.FIRST_AGENT_ID
, SS.SALE_STORE_LEVEL
, CASE WHEN ISNULL(SS.FIRST_AGENT_ID, '') = '' THEN SS.SALE_STORE_NAME ELSE (SELECT SALE_STORE_NAME FROM M_SALES_STORE WHERE SALE_STORE_ID = SS.FIRST_AGENT_ID) END AS FIRST_SALE_STORE_NAME
@ -75,11 +78,11 @@
SELECT
T.*
, SS1.SALE_STORE_NAME AS CUST_SALE_STORE_NAME
, SS2.SALE_STORE_NAME
, SS2.ZIP_NO
, SS2.ADDRESS
, SS2.TEL
, SS2.FAX
, CASE WHEN SS2.DISP_COMPANY_NAME IS NOT NULL THEN SS2.DISP_COMPANY_NAME ELSE SS2.SALE_STORE_NAME END AS SALE_STORE_NAME
, CASE WHEN SS2.DISP_ZIP_NO IS NOT NULL THEN SS2.DISP_ZIP_NO ELSE SS2.ZIP_NO END AS ZIP_NO
, CASE WHEN SS2.DISP_ADDRESS IS NOT NULL THEN SS2.DISP_ADDRESS ELSE SS2.ADDRESS END AS ADDRESS
, CASE WHEN SS2.DISP_TEL IS NOT NULL THEN SS2.DISP_TEL ELSE SS2.TEL END AS TEL
, CASE WHEN SS2.DISP_FAX IS NOT NULL THEN SS2.DISP_FAX ELSE SS2.FAX END AS FAX
, SS2.BIZ_NO
FROM
(
@ -240,6 +243,9 @@
<if test='schBomNotExist != null and schBomNotExist == "1"'>
AND (PE.PA_DISP_ORDER IS NULL OR PE.PA_DISP_ORDER = '')
</if>
<if test='schDrawingItemFlg != null and schDrawingItemFlg != ""'>
AND PE.DRAWING_ITEM_FLG = #{schDrawingItemFlg}
</if>
ORDER BY
PE.DISP_ORDER ASC
</select>
@ -606,6 +612,7 @@
, PKG_ASP = NULL
, PRICE_CD = #{priceCd}
, SURFACE_TYPE = #{surfaceType}
, TEMP_FLG = CASE WHEN TEMP_FLG = '0' THEN '0' ELSE #{tempFlg} END
, CREATE_DATETIME = GETDATE()
, CREATE_USER = #{userId}
</when>
@ -617,6 +624,7 @@
, REMARKS = #{remarks}
, PKG_ASP = #{pkgAsp}
, PRICE_CD = #{priceCd}
, TEMP_FLG = '0'
</otherwise>
</choose>
, CAPACITY = #{capacity}
@ -628,6 +636,27 @@
AND PLAN_NO = #{planNo}
</update>
<update id="updateEstimateReset" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest">
/* sqlid : com.interplug.qcast.biz.estimate.updateEstimate */
UPDATE T_PLAN
SET
ESTIMATE_TYPE = #{estimateType}
, CHARGER = NULL
, FILE_FLG = '0'
, ESTIMATE_OPTION = #{estimateOption}
, REMARKS = NULL
, PKG_ASP = NULL
, PRICE_CD = #{priceCd}
, TEMP_FLG = CASE WHEN TEMP_FLG = '0' THEN '0' ELSE #{tempFlg} END
, CAPACITY = #{capacity}
, MODULE_MODEL = #{moduleModel}
, PC_TYPE_NO = #{pcTypeNo}
, LAST_EDIT_DATETIME = GETDATE()
, LAST_EDIT_USER = #{userId}
WHERE OBJECT_NO = #{objectNo}
AND PLAN_NO = #{planNo}
</update>
<update id="updateEstimateApi" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest">
/* sqlid : com.interplug.qcast.biz.estimate.updateEstimateApi */
UPDATE T_PLAN
@ -672,6 +701,9 @@
, PKG_MATERIAL_FLG
, OPEN_FLG
, ITEM_CHANGE_FLG
<if test='drawingItemFlg != null and drawingItemFlg != ""'>
, DRAWING_ITEM_FLG
</if>
) VALUES (
#{objectNo}
, #{planNo}
@ -701,6 +733,9 @@
, #{pkgMaterialFlg}
, #{openFlg}
, #{itemChangeFlg}
<if test='drawingItemFlg != null and drawingItemFlg != ""'>
, #{drawingItemFlg}
</if>
)
</insert>

View File

@ -699,6 +699,7 @@
, SUPPORT_MEAKER_MULTI
, DIFF_ROOF_ENABLED
, ORDER_FLG
, TEMP_FLG
) VALUES (
#{objectNo}
, #{planNo}
@ -735,6 +736,7 @@
, #{supportMeakerMulti}
, #{diffRoofEnabled}
, #{orderFlg}
, #{tempFlg}
)
</insert>