견적서 지붕재 시공방법 경우의 수 중복 제거 처리
This commit is contained in:
parent
168e5e35fc
commit
928a8be6a5
@ -221,6 +221,7 @@ public class EstimateService {
|
||||
message.getMessage("common.message.required.data", "Plan No"));
|
||||
}
|
||||
|
||||
String splitStr = "、";
|
||||
EstimateRequest estimateRequest = new EstimateRequest();
|
||||
estimateRequest.setObjectNo(objectNo);
|
||||
estimateRequest.setPlanNo(planNo);
|
||||
@ -232,6 +233,47 @@ public class EstimateService {
|
||||
throw new QcastException(ErrorCode.NOT_FOUND, message.getMessage("common.message.no.data"));
|
||||
} else {
|
||||
|
||||
// Plan에서 지붕재, 시공방법 동일 데이타 중복 제거
|
||||
String roofCheckDatas = "";
|
||||
String roofMaterialIdMultis = "";
|
||||
String constructSpecificationMultis = "";
|
||||
String orgRoofMaterialIdMultis = response.getRoofMaterialIdMulti();
|
||||
String orgConstructSpecificationMultis = response.getConstructSpecificationMulti();
|
||||
|
||||
if (!StringUtils.isEmpty(orgRoofMaterialIdMultis)
|
||||
&& !StringUtils.isEmpty(orgConstructSpecificationMultis)) {
|
||||
String[] arrOrgRoofMaterialIdMultis = orgRoofMaterialIdMultis.split(splitStr);
|
||||
String[] arrOrgConstructSpecificationMultis =
|
||||
orgConstructSpecificationMultis.split(splitStr);
|
||||
|
||||
if (arrOrgRoofMaterialIdMultis.length == arrOrgConstructSpecificationMultis.length) {
|
||||
for (int i = 0; i < arrOrgRoofMaterialIdMultis.length; i++) {
|
||||
|
||||
if (!roofCheckDatas.contains(
|
||||
arrOrgRoofMaterialIdMultis[i] + "_" + arrOrgConstructSpecificationMultis[i])) {
|
||||
roofMaterialIdMultis +=
|
||||
StringUtils.isEmpty(roofMaterialIdMultis)
|
||||
? arrOrgRoofMaterialIdMultis[i]
|
||||
: splitStr + arrOrgRoofMaterialIdMultis[i];
|
||||
constructSpecificationMultis +=
|
||||
StringUtils.isEmpty(constructSpecificationMultis)
|
||||
? arrOrgConstructSpecificationMultis[i]
|
||||
: splitStr + arrOrgConstructSpecificationMultis[i];
|
||||
}
|
||||
|
||||
roofCheckDatas +=
|
||||
arrOrgRoofMaterialIdMultis[i] + "_" + arrOrgConstructSpecificationMultis[i];
|
||||
}
|
||||
|
||||
if (!StringUtils.isEmpty(roofMaterialIdMultis)) {
|
||||
response.setRoofMaterialIdMulti(roofMaterialIdMultis);
|
||||
}
|
||||
if (!StringUtils.isEmpty(roofMaterialIdMultis)) {
|
||||
response.setConstructSpecificationMulti(constructSpecificationMultis);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 아이템 목록 조회
|
||||
List<ItemResponse> estimateItemList = estimateMapper.selectEstimateItemList(estimateRequest);
|
||||
response.setItemList(estimateItemList);
|
||||
|
||||
@ -209,6 +209,8 @@ public class ObjectService {
|
||||
* @throws Exception
|
||||
*/
|
||||
public ObjectResponse selectObjectDetail(String objectNo) throws Exception {
|
||||
String splitStr = "、";
|
||||
|
||||
// object 상세 정보 조회
|
||||
ObjectResponse objectResponse = objectMapper.selectObjectDetail(objectNo);
|
||||
|
||||
@ -218,6 +220,49 @@ public class ObjectService {
|
||||
planRequest.setObjectNo(objectNo);
|
||||
List<PlanResponse> planList = objectMapper.selectPlanList(planRequest);
|
||||
|
||||
// Plan 목록에서 지붕재, 시공방법 동일 데이타 중복 제거
|
||||
for (PlanResponse planResponse : planList) {
|
||||
String roofCheckDatas = "";
|
||||
String roofMaterialIdMultis = "";
|
||||
String constructSpecificationMultis = "";
|
||||
String orgRoofMaterialIdMultis = planResponse.getRoofMaterialIdMulti();
|
||||
String orgConstructSpecificationMultis = planResponse.getConstructSpecificationMulti();
|
||||
|
||||
if (!StringUtils.isEmpty(orgRoofMaterialIdMultis)
|
||||
&& !StringUtils.isEmpty(orgConstructSpecificationMultis)) {
|
||||
String[] arrOrgRoofMaterialIdMultis = orgRoofMaterialIdMultis.split(splitStr);
|
||||
String[] arrOrgConstructSpecificationMultis =
|
||||
orgConstructSpecificationMultis.split(splitStr);
|
||||
|
||||
if (arrOrgRoofMaterialIdMultis.length == arrOrgConstructSpecificationMultis.length) {
|
||||
for (int i = 0; i < arrOrgRoofMaterialIdMultis.length; i++) {
|
||||
|
||||
if (!roofCheckDatas.contains(
|
||||
arrOrgRoofMaterialIdMultis[i] + "_" + arrOrgConstructSpecificationMultis[i])) {
|
||||
roofMaterialIdMultis +=
|
||||
StringUtils.isEmpty(roofMaterialIdMultis)
|
||||
? arrOrgRoofMaterialIdMultis[i]
|
||||
: splitStr + arrOrgRoofMaterialIdMultis[i];
|
||||
constructSpecificationMultis +=
|
||||
StringUtils.isEmpty(constructSpecificationMultis)
|
||||
? arrOrgConstructSpecificationMultis[i]
|
||||
: splitStr + arrOrgConstructSpecificationMultis[i];
|
||||
}
|
||||
|
||||
roofCheckDatas +=
|
||||
arrOrgRoofMaterialIdMultis[i] + "_" + arrOrgConstructSpecificationMultis[i];
|
||||
}
|
||||
|
||||
if (!StringUtils.isEmpty(roofMaterialIdMultis)) {
|
||||
planResponse.setRoofMaterialIdMulti(roofMaterialIdMultis);
|
||||
}
|
||||
if (!StringUtils.isEmpty(roofMaterialIdMultis)) {
|
||||
planResponse.setConstructSpecificationMulti(constructSpecificationMultis);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
objectResponse.setPlanList(planList);
|
||||
}
|
||||
|
||||
|
||||
@ -89,6 +89,9 @@ public class PlanResponse {
|
||||
@Schema(description = "파워컨디셔너")
|
||||
private String pcTypeNo;
|
||||
|
||||
@Schema(description = "가대")
|
||||
private String standTypeNo;
|
||||
|
||||
@Schema(description = "북면설치여부")
|
||||
private String northArrangement;
|
||||
|
||||
|
||||
@ -443,6 +443,15 @@
|
||||
, T.CONSTRUCT_SPECIFICATION_MULTI
|
||||
, T.TEMP_FLG
|
||||
, (SELECT SALE_STORE_ID FROM M_USER WHERE USER_ID = O.CREATE_USER) AS CREATE_SALE_STORE_ID
|
||||
, STUFF((
|
||||
SELECT '、' + PE.ITEM_NO
|
||||
FROM T_PART_ESTIMATE PE WITH (NOLOCK)
|
||||
INNER JOIN M_ITEM I WITH (NOLOCK)
|
||||
ON PE.ITEM_ID = I.ITEM_ID
|
||||
WHERE PE.OBJECT_NO = T.OBJECT_NO AND PE.PLAN_NO = T.PLAN_NO
|
||||
AND I.ITEM_GROUP = 'STAND_'
|
||||
FOR XML PATH('')),1,1,''
|
||||
) AS STAND_TYPE_NO
|
||||
FROM T_PLAN T WITH (NOLOCK)
|
||||
INNER JOIN T_OBJECT O WITH (NOLOCK)
|
||||
ON T.OBJECT_NO = O.OBJECT_NO
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user