Merge branch 'dev' into feature/qcast-231

This commit is contained in:
DESKTOP-6ARNG1Q\dlsgk 2025-01-14 09:31:37 +09:00
commit 172bcbf128
10 changed files with 124 additions and 100 deletions

View File

@ -2,16 +2,14 @@ package com.interplug.qcast.biz.canvasBasicSetting;
import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingInfo;
import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingResponse;
import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofAllocationSettingInfo;
import com.interplug.qcast.config.Exception.QcastException;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
@ -43,13 +41,13 @@ public class CanvasBasicSettingController {
}
@Operation(description = "지붕면 할당 정보를 등록 한다.")
@PostMapping("/roof-allocation-settings/")
@PostMapping("/roof-allocation-settings")
@ResponseStatus(HttpStatus.CREATED)
public Map<String, String> insertRoofAllocSetting(@RequestBody CanvasBasicSettingInfo rai) throws QcastException {
public Map<String, String> insertRoofAllocSetting(@RequestBody RoofAllocationSettingInfo rasi) throws QcastException {
log.debug("지붕면 할당 등록 ::::: " + rai.getObjectNo());
log.debug("지붕면 할당 등록 ::::: " + rasi.getObjectNo());
return canvasBasicSettingService.insertRoofAllocSetting(rai);
return canvasBasicSettingService.insertRoofAllocSetting(rasi);
}
@Operation(description = "Canvas 지붕재추가 Setting 정보를 삭제 한다.")

View File

@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingInfo;
import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingResponse;
import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofAllocationInfo;
import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofAllocationSettingInfo;
import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofMaterialsAddInfo;
import com.interplug.qcast.config.Exception.ErrorCode;
import com.interplug.qcast.config.Exception.QcastException;
@ -86,34 +87,28 @@ public class CanvasBasicSettingService {
}
// 지붕면 할당 Setting 등록
public Map<String, String> insertRoofAllocSetting(CanvasBasicSettingInfo csi) throws QcastException {
public Map<String, String> insertRoofAllocSetting(RoofAllocationSettingInfo rasi) throws QcastException {
Map<String, String> response = new HashMap<>();
if (csi.getObjectNo() == null) {
if (rasi.getObjectNo() == null) {
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다.");
}
try {
// 기존 지붕재추가 정보 삭제 insert
canvasBasicSettingMapper.deleteRoofMaterialsAdd(csi.getObjectNo());
canvasBasicSettingMapper.deleteRoofMaterialsAdd(rasi.getObjectNo());
int roofSeq = 0;
// for-each 루프를 사용하여 지붕재추가 Setting
for (RoofAllocationInfo rai : csi.getRoofAllocationList()) {
rai.setObjectNo(csi.getObjectNo());
rai.setRoofSeq(roofSeq++); //roofSeq는 순차적으로 새로 생성하여 insert
// 신규 지붕재추가 정보 insert
for (RoofAllocationInfo rai : rasi.getRoofAllocationList()) {
rai.setObjectNo(rasi.getObjectNo());
canvasBasicSettingMapper.insertRoofAllocation(rai);
}
response.put("objectNo", csi.getObjectNo());
response.put("objectNo", rasi.getObjectNo());
response.put("returnMessage", "common.message.confirm.mark");
} catch (Exception e) {
response.put("objectNo", csi.getObjectNo());
response.put("objectNo", rasi.getObjectNo());
response.put("returnMessage", "common.message.save.error");
}

View File

@ -18,5 +18,4 @@ public class CanvasBasicSettingInfo {
private Date lastEditDatetime; //수정일시
private List<RoofMaterialsAddInfo> roofMaterialsAddList;
private List<RoofAllocationInfo> roofAllocationList;
}

View File

@ -0,0 +1,17 @@
package com.interplug.qcast.biz.canvasBasicSetting.dto;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class RoofAllocationSettingInfo {
private String objectNo; //견적서 번호
private Integer roofSizeSet; //치수(복사도/실측값/육지붕)
private String roofAngleSet; //각도(경사/각도)
private List<RoofAllocationInfo> roofAllocationList;
}

View File

@ -108,6 +108,9 @@ public interface EstimateMapper {
// 견적서 복사
public int insertEstimateCopy(EstimateCopyRequest estimateCopyRequest);
// 견적서 도면 아이템 복사
public int insertEstimateDrawingItemCopy(EstimateCopyRequest estimateCopyRequest);
// Plan 확정 동기화
public int updatePlanConfirmSync(PlanSyncResponse planSyncData);
}

View File

@ -784,6 +784,7 @@ public class EstimateService {
itemRequest.setPkgMaterialFlg(itemResponse.getPkgMaterialFlg());
itemRequest.setFileUploadFlg(itemResponse.getFileUploadFlg());
itemRequest.setItemGroup(itemResponse.getItemGroup());
itemRequest.setOpenFlg(itemResponse.getOpenFlg());
break;
}
@ -810,7 +811,7 @@ public class EstimateService {
estimateMapper.insertEstimateItem(itemRequest);
}
// [6]. 견적서 지붕재 복사
// [6]. 견적서 지붕재 도면 초기 데이터 복사
List<RoofResponse> roofList = estimateMapper.selectEstimateRoofList(estimateRequest);
List<RoofResponse> roofItemList = estimateMapper.selectEstimateRoofItemList(estimateRequest);
List<ItemResponse> circuitItemList =
@ -868,9 +869,13 @@ public class EstimateService {
estimateMapper.insertEstimateCircuitItem(circuitItemRequest);
}
// 도면 초기 데이타 복사(초기화 위해 필요)
estimateMapper.insertEstimateDrawingItemCopy(estimateCopyRequest);
// [7]. 견적서 도면 복사 (추후 개발 필요)
// [8]. QSP Q.CAST SEND API
/*
List<EstimateSendResponse> resultList = new ArrayList<EstimateSendResponse>();
estimateRequest.setObjectNo(estimateCopyRequest.getCopyObjectNo());
estimateRequest.setPlanNo(estimateCopyRequest.getCopyPlanNo());
@ -885,6 +890,7 @@ public class EstimateService {
estimateMapper.updateEstimateApi(estimateRequest);
}
*/
} catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR);
@ -960,6 +966,7 @@ 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);

View File

@ -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,38 @@ 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 {
@PostMapping("/getTrestleDetailList")
public ArrayList<ApiResponse<ApiTrestleDetailResponse>> getTrestleDetailList(
@RequestBody List<ApiTrestleDetailRequest> reqList) {
ArrayList<ApiResponse<ApiTrestleDetailResponse>> results = new ArrayList<>();
for (ApiTrestleDetailRequest req : reqList) {
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);
ApiResponse<ApiTrestleDetailResponse> response =
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());
ApiTrestleDetailResponse data = response.getData();
data.setRoofIndex(req.getRoofIndex()); // roofIndex 추가하기 위함
ApiResultResponse resultCode = response.getResult();
ApiResponse<ApiTrestleDetailResponse> resultResponse = new ApiResponse<>();
resultResponse.setData(data);
resultResponse.setResult(resultCode);
results.add(resultResponse);
}
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 메이커, 시리즈 조회한다.")
@ -264,7 +225,7 @@ public class MasterController {
}
@Operation(description = "시리즈 중 자동으로 추천 PCS 정보 조회한다.")
@PostMapping("/pcsAutoRecommendList")
@PostMapping("/getPcsAutoRecommendList")
public ApiResponse<ApiPcsAutoRecommendResponse> getPcsAutoRecommendList(
@RequestBody ApiPcsAutoRecommendRequest autoRecommendRequest) {
return masterService.getPcsAutoRecommendList(autoRecommendRequest);

View File

@ -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 = "혼합모듈번호")
@ -50,4 +59,7 @@ public class ApiTrestleDetailRequest {
@Schema(description = "하제(망둥어)피치")
private Integer roofPitch;
@Schema(description = "지붕index 번호")
private String roofIndex;
}

View File

@ -13,6 +13,9 @@ import lombok.Setter;
@Schema(description = "Api 가대 상세 조회 응답 객체")
public class ApiTrestleDetailResponse {
@Schema(description = "지붕index")
private String roofIndex;
@Schema(description = "랙여부")
private String rackYn;

View File

@ -1011,6 +1011,8 @@
, CONSTRUCT_SPECIFICATION_MULTI
, SURFACE_TYPE
, ANGLE
, TEMP_FLG
, LOCK_FLG
, SYNC_FLG
, CREATE_DATETIME
, CREATE_USER
@ -1062,6 +1064,8 @@
, P.CONSTRUCT_SPECIFICATION_MULTI
, P.SURFACE_TYPE
, P.ANGLE
, '1' AS TEMP_FLG
, '0' AS LOCK_FLG
, '0' AS SYNC_FLG
, GETDATE() AS CREATE_DATETIME
, #{userId} AS CREATE_USER
@ -1071,6 +1075,31 @@
AND P.DEL_FLG = '0'
</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
(
OBJECT_NO
, PLAN_NO
, DISP_ORDER
, ITEM_ID
, AMOUNT
, LAST_EDIT_DATETIME
, LAST_EDIT_USER
)
SELECT
#{copyObjectNo} AS OBJECT_NO
, #{copyPlanNo} AS PLAN_NO
, PDE.DISP_ORDER
, PDE.ITEM_ID
, PDE.AMOUNT
, GETDATE() AS LAST_EDIT_DATETIME
, #{userId} AS LAST_EDIT_USER
FROM T_PART_DRAWING_ESTIMATE PDE WITH (NOLOCK)
WHERE PDE.OBJECT_NO = #{objectNo}
AND PDE.PLAN_NO = #{planNo}
</insert>
<update id="updatePlanConfirmSync" parameterType="com.interplug.qcast.biz.estimate.dto.PlanSyncResponse">
/* sqlid : com.interplug.qcast.biz.estimate.updatePlanConfirmSync */
UPDATE T_PLAN