[1226] 새로고침 지붕재 리셋 하제비치 #219
@ -42,4 +42,6 @@ public interface CanvasBasicSettingMapper {
|
|||||||
// Canvas 지붕재추가 Setting 삭제
|
// Canvas 지붕재추가 Setting 삭제
|
||||||
public void deleteRoofMaterialsAdd(String objectNo, Integer planNo);
|
public void deleteRoofMaterialsAdd(String objectNo, Integer planNo);
|
||||||
|
|
||||||
|
// Canvas 하제비치 update
|
||||||
|
public void updateHajebichRoofMaterialsAdd(CanvasBasicSettingResponse canvasBasicSettingResponse);
|
||||||
}
|
}
|
||||||
@ -1,18 +1,29 @@
|
|||||||
package com.interplug.qcast.biz.canvaspopupstatus;
|
package com.interplug.qcast.biz.canvaspopupstatus;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.interplug.qcast.biz.canvasBasicSetting.CanvasBasicSettingMapper;
|
||||||
|
import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingResponse;
|
||||||
import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus;
|
import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus;
|
||||||
|
import com.interplug.qcast.biz.estimate.dto.EstimateApiResponse;
|
||||||
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 lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public class CanvasPopupStatusService {
|
public class CanvasPopupStatusService {
|
||||||
|
|
||||||
private final CanvasPopupStatusMapper canvasPopupStatusMapper;
|
private final CanvasPopupStatusMapper canvasPopupStatusMapper;
|
||||||
|
private final CanvasBasicSettingMapper canvasBasicSettingMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Canvas Popup Status 조회
|
* Canvas Popup Status 조회
|
||||||
@ -44,6 +55,53 @@ public class CanvasPopupStatusService {
|
|||||||
} else {
|
} else {
|
||||||
updateCanvasPopupStatus(cps);
|
updateCanvasPopupStatus(cps);
|
||||||
}
|
}
|
||||||
|
//기초정보 업데이트 (roofHajebichi)
|
||||||
|
|
||||||
|
String hajebichi = cps.getHajebichi();
|
||||||
|
if(hajebichi != null && !hajebichi.isEmpty()){
|
||||||
|
CanvasBasicSettingResponse canvasBasicSettingResponse = new CanvasBasicSettingResponse();
|
||||||
|
canvasBasicSettingResponse.setObjectNo(cps.getObjectNo());
|
||||||
|
canvasBasicSettingResponse.setPlanNo(cps.getPlanNo());
|
||||||
|
canvasBasicSettingResponse.setRoofHajebichi(Integer.valueOf(hajebichi));
|
||||||
|
canvasBasicSettingMapper.updateHajebichRoofMaterialsAdd(canvasBasicSettingResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// String popupStatus = cps.getPopupStatus();
|
||||||
|
// List<Integer> hajebichiList = new ArrayList<>();//getHajebichiValues(popupStatus, 0, 1); // roofIndex=0, planNo=1인 hajebichi 값들 조회
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// ObjectMapper mapper = new ObjectMapper();
|
||||||
|
// JsonNode rootNode = mapper.readTree(popupStatus);
|
||||||
|
// JsonNode roofConstructions = rootNode.get("roofConstructions");
|
||||||
|
// if (roofConstructions.isArray()) {
|
||||||
|
// for (JsonNode construction : roofConstructions) {
|
||||||
|
// JsonNode addRoof = construction.get("addRoof");
|
||||||
|
// if (addRoof != null
|
||||||
|
// && addRoof.get("roofIndex").asInt() == 0
|
||||||
|
// && addRoof.get("planNo").asInt() == cps.getPlanNo()) {
|
||||||
|
// hajebichiList.add(addRoof.get("hajebichi").asInt());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// } catch (JsonProcessingException e) {
|
||||||
|
// throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, "JSON 파싱 오류");
|
||||||
|
// }
|
||||||
|
// if(!hajebichiList.isEmpty()){
|
||||||
|
// CanvasBasicSettingResponse canvasBasicSettingResponse = new CanvasBasicSettingResponse();
|
||||||
|
// canvasBasicSettingResponse.setObjectNo(cps.getObjectNo());
|
||||||
|
// canvasBasicSettingResponse.setPlanNo(cps.getPlanNo());
|
||||||
|
// canvasBasicSettingResponse.setRoofHajebichi(hajebichiList.get(0));
|
||||||
|
//
|
||||||
|
|
||||||
|
// if(canvasBasicSettingResponse.getRoofHajebichi() > 0){
|
||||||
|
// canvasBasicSettingMapper.updateHajebichRoofMaterialsAdd(canvasBasicSettingResponse);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -25,4 +25,8 @@ public class CanvasPopupStatus {
|
|||||||
|
|
||||||
@Schema(description = "캔버스 팝업 상태 데이터")
|
@Schema(description = "캔버스 팝업 상태 데이터")
|
||||||
private String popupStatus;
|
private String popupStatus;
|
||||||
|
|
||||||
|
@Schema(description = "하제비치")
|
||||||
|
private String hajebichi;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -227,4 +227,12 @@
|
|||||||
AND plan_no = #{planNo}
|
AND plan_no = #{planNo}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<update id="updateHajebichRoofMaterialsAdd" parameterType="com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingResponse">
|
||||||
|
/* sqlid : updateHajebichRoofMaterialsAdd */
|
||||||
|
UPDATE TB_CANVAS_ROOF_MATERIALS_ADD
|
||||||
|
SET roof_hajebichi = #{roofHajebichi}
|
||||||
|
WHERE object_no = #{objectNo}
|
||||||
|
AND plan_no = #{planNo}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -11,7 +11,8 @@
|
|||||||
object_no,
|
object_no,
|
||||||
plan_no,
|
plan_no,
|
||||||
popup_type,
|
popup_type,
|
||||||
popup_status
|
popup_status,
|
||||||
|
#{hajebichi} AS hajebichi
|
||||||
FROM T_CANVAS_POPUP_STATUS
|
FROM T_CANVAS_POPUP_STATUS
|
||||||
WHERE object_no = #{objectNo}
|
WHERE object_no = #{objectNo}
|
||||||
AND plan_no = #{planNo}
|
AND plan_no = #{planNo}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user