refactor: 가대 상세 조회 api 수정
- method post로 수정 - request 데이터를 body json, list 형식으로 받아서 list size만큼 api 호출 후 response를 모아서 리턴
This commit is contained in:
parent
e8ac6ae01d
commit
9ed6307362
@ -12,12 +12,14 @@ 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;
|
||||
import com.interplug.qcast.biz.master.dto.trestle.ApiTrestleResponse;
|
||||
import com.interplug.qcast.biz.master.dto.trestle.detail.ApiTrestleDetailRequest;
|
||||
import com.interplug.qcast.biz.master.dto.trestle.detail.ApiTrestleDetailResponse;
|
||||
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.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -173,79 +175,29 @@ public class MasterController {
|
||||
}
|
||||
|
||||
@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);
|
||||
@PostMapping("/getTrestleDetailList")
|
||||
public ArrayList<ApiResponse<ApiTrestleDetailResponse>> getTrestleDetailList(
|
||||
@RequestBody List<ApiTrestleDetailRequest> reqList) {
|
||||
ArrayList<ApiResponse<ApiTrestleDetailResponse>> results = new ArrayList<>();
|
||||
for (ApiTrestleDetailRequest req : reqList) {
|
||||
ApiResponse<ApiTrestleDetailResponse> result =
|
||||
masterService.getTrestleDetailList(
|
||||
req.getModuleTpCd(),
|
||||
req.getRoofMatlCd(),
|
||||
req.getTrestleMkrCd(),
|
||||
req.getConstMthdCd(),
|
||||
req.getRoofBaseCd(),
|
||||
req.getIlluminationTp(),
|
||||
req.getInstHt(),
|
||||
req.getStdWindSpeed(),
|
||||
req.getStdSnowLd(),
|
||||
req.getInclCd(),
|
||||
req.getConstTp(),
|
||||
req.getMixMatlNo(),
|
||||
req.getRoofPitch());
|
||||
results.add(result);
|
||||
}
|
||||
|
||||
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());
|
||||
return results;
|
||||
}
|
||||
|
||||
@Operation(description = "PCS 메이커, 시리즈 조회한다.")
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.interplug.qcast.biz.master.dto.trestle.detail;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@ -9,40 +10,48 @@ import lombok.Setter;
|
||||
@Schema(description = "Api 가대 상세 조회 요청 객체")
|
||||
public class ApiTrestleDetailRequest {
|
||||
|
||||
@Schema(description = "Language코드")
|
||||
private String langCd;
|
||||
|
||||
@Schema(description = "모듈타입코드")
|
||||
@NotNull
|
||||
private String moduleTpCd;
|
||||
|
||||
@Schema(description = "지붕재코드")
|
||||
@NotNull
|
||||
private String roofMatlCd;
|
||||
|
||||
@Schema(description = "가대메이커코드")
|
||||
@NotNull
|
||||
private String trestleMkrCd;
|
||||
|
||||
@Schema(description = "공법코드")
|
||||
@NotNull
|
||||
private String constMthdCd;
|
||||
|
||||
@Schema(description = "지붕기초코드")
|
||||
@NotNull
|
||||
private String roofBaseCd;
|
||||
|
||||
@Schema(description = "면조도")
|
||||
@NotNull
|
||||
private String illuminationTp;
|
||||
|
||||
@Schema(description = "설치높이")
|
||||
@NotNull
|
||||
private String instHt;
|
||||
|
||||
@Schema(description = "풍속")
|
||||
@NotNull
|
||||
private String stdWindSpeed;
|
||||
|
||||
@Schema(description = "적설량")
|
||||
@NotNull
|
||||
private String stdSnowLd;
|
||||
|
||||
@Schema(description = "경사도코드")
|
||||
@NotNull
|
||||
private String inclCd;
|
||||
|
||||
@Schema(description = "시공법")
|
||||
@NotNull
|
||||
private String constTp;
|
||||
|
||||
@Schema(description = "혼합모듈번호")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user