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.quotation.ApiQuotationItemResponse;
|
||||||
import com.interplug.qcast.biz.master.dto.roofmaterial.ApiRoofMaterialResponse;
|
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.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.biz.master.dto.trestle.detail.ApiTrestleDetailResponse;
|
||||||
import com.interplug.qcast.config.Exception.ErrorCode;
|
import com.interplug.qcast.config.Exception.ErrorCode;
|
||||||
import com.interplug.qcast.config.Exception.QcastException;
|
import com.interplug.qcast.config.Exception.QcastException;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -173,79 +175,29 @@ public class MasterController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Operation(description = "가대 상세 조회한다.")
|
@Operation(description = "가대 상세 조회한다.")
|
||||||
@GetMapping("/getTrestleDetailList")
|
@PostMapping("/getTrestleDetailList")
|
||||||
public ApiResponse<ApiTrestleDetailResponse> getTrestleDetailList(
|
public ArrayList<ApiResponse<ApiTrestleDetailResponse>> getTrestleDetailList(
|
||||||
@Parameter(description = "모듈타입코드") @RequestParam String moduleTpCd,
|
@RequestBody List<ApiTrestleDetailRequest> reqList) {
|
||||||
@Parameter(description = "지붕재코드") @RequestParam String roofMatlCd,
|
ArrayList<ApiResponse<ApiTrestleDetailResponse>> results = new ArrayList<>();
|
||||||
@Parameter(description = "가대메이커코드") @RequestParam String trestleMkrCd,
|
for (ApiTrestleDetailRequest req : reqList) {
|
||||||
@Parameter(description = "공법코드") @RequestParam String constMthdCd,
|
ApiResponse<ApiTrestleDetailResponse> result =
|
||||||
@Parameter(description = "지붕기초코드") @RequestParam String roofBaseCd,
|
masterService.getTrestleDetailList(
|
||||||
@Parameter(description = "면조도") @RequestParam String illuminationTp,
|
req.getModuleTpCd(),
|
||||||
@Parameter(description = "설치높이") @RequestParam String instHt,
|
req.getRoofMatlCd(),
|
||||||
@Parameter(description = "풍속") @RequestParam String stdWindSpeed,
|
req.getTrestleMkrCd(),
|
||||||
@Parameter(description = "적설량") @RequestParam String stdSnowLd,
|
req.getConstMthdCd(),
|
||||||
@Parameter(description = "경사도코드") @RequestParam String inclCd,
|
req.getRoofBaseCd(),
|
||||||
@Parameter(description = "시공법") @RequestParam String constTp,
|
req.getIlluminationTp(),
|
||||||
@Parameter(description = "혼합모듈번호") @RequestParam(required = false) Integer mixMatlNo,
|
req.getInstHt(),
|
||||||
@Parameter(description = "하제(망둥어)피치") @RequestParam(required = false) Integer roofPitch)
|
req.getStdWindSpeed(),
|
||||||
throws QcastException {
|
req.getStdSnowLd(),
|
||||||
|
req.getInclCd(),
|
||||||
if (moduleTpCd == null
|
req.getConstTp(),
|
||||||
|| moduleTpCd.trim().isEmpty()
|
req.getMixMatlNo(),
|
||||||
|| roofMatlCd == null
|
req.getRoofPitch());
|
||||||
|| roofMatlCd.trim().isEmpty()
|
results.add(result);
|
||||||
|| 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);
|
|
||||||
}
|
}
|
||||||
|
return results;
|
||||||
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 메이커, 시리즈 조회한다.")
|
@Operation(description = "PCS 메이커, 시리즈 조회한다.")
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.interplug.qcast.biz.master.dto.trestle.detail;
|
package com.interplug.qcast.biz.master.dto.trestle.detail;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
@ -9,40 +10,48 @@ import lombok.Setter;
|
|||||||
@Schema(description = "Api 가대 상세 조회 요청 객체")
|
@Schema(description = "Api 가대 상세 조회 요청 객체")
|
||||||
public class ApiTrestleDetailRequest {
|
public class ApiTrestleDetailRequest {
|
||||||
|
|
||||||
@Schema(description = "Language코드")
|
|
||||||
private String langCd;
|
|
||||||
|
|
||||||
@Schema(description = "모듈타입코드")
|
@Schema(description = "모듈타입코드")
|
||||||
|
@NotNull
|
||||||
private String moduleTpCd;
|
private String moduleTpCd;
|
||||||
|
|
||||||
@Schema(description = "지붕재코드")
|
@Schema(description = "지붕재코드")
|
||||||
|
@NotNull
|
||||||
private String roofMatlCd;
|
private String roofMatlCd;
|
||||||
|
|
||||||
@Schema(description = "가대메이커코드")
|
@Schema(description = "가대메이커코드")
|
||||||
|
@NotNull
|
||||||
private String trestleMkrCd;
|
private String trestleMkrCd;
|
||||||
|
|
||||||
@Schema(description = "공법코드")
|
@Schema(description = "공법코드")
|
||||||
|
@NotNull
|
||||||
private String constMthdCd;
|
private String constMthdCd;
|
||||||
|
|
||||||
@Schema(description = "지붕기초코드")
|
@Schema(description = "지붕기초코드")
|
||||||
|
@NotNull
|
||||||
private String roofBaseCd;
|
private String roofBaseCd;
|
||||||
|
|
||||||
@Schema(description = "면조도")
|
@Schema(description = "면조도")
|
||||||
|
@NotNull
|
||||||
private String illuminationTp;
|
private String illuminationTp;
|
||||||
|
|
||||||
@Schema(description = "설치높이")
|
@Schema(description = "설치높이")
|
||||||
|
@NotNull
|
||||||
private String instHt;
|
private String instHt;
|
||||||
|
|
||||||
@Schema(description = "풍속")
|
@Schema(description = "풍속")
|
||||||
|
@NotNull
|
||||||
private String stdWindSpeed;
|
private String stdWindSpeed;
|
||||||
|
|
||||||
@Schema(description = "적설량")
|
@Schema(description = "적설량")
|
||||||
|
@NotNull
|
||||||
private String stdSnowLd;
|
private String stdSnowLd;
|
||||||
|
|
||||||
@Schema(description = "경사도코드")
|
@Schema(description = "경사도코드")
|
||||||
|
@NotNull
|
||||||
private String inclCd;
|
private String inclCd;
|
||||||
|
|
||||||
@Schema(description = "시공법")
|
@Schema(description = "시공법")
|
||||||
|
@NotNull
|
||||||
private String constTp;
|
private String constTp;
|
||||||
|
|
||||||
@Schema(description = "혼합모듈번호")
|
@Schema(description = "혼합모듈번호")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user