[1226] 새로고침 지붕재 리셋 하제비치
This commit is contained in:
parent
7c378ae369
commit
e1e4c52264
@ -42,4 +42,6 @@ public interface CanvasBasicSettingMapper {
|
||||
// Canvas 지붕재추가 Setting 삭제
|
||||
public void deleteRoofMaterialsAdd(String objectNo, Integer planNo);
|
||||
|
||||
// Canvas 하제비치 update
|
||||
public void updateHajebichRoofMaterialsAdd(CanvasBasicSettingResponse canvasBasicSettingResponse);
|
||||
}
|
||||
@ -1,18 +1,29 @@
|
||||
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.estimate.dto.EstimateApiResponse;
|
||||
import com.interplug.qcast.config.Exception.ErrorCode;
|
||||
import com.interplug.qcast.config.Exception.QcastException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
public class CanvasPopupStatusService {
|
||||
|
||||
private final CanvasPopupStatusMapper canvasPopupStatusMapper;
|
||||
private final CanvasBasicSettingMapper canvasBasicSettingMapper;
|
||||
|
||||
/**
|
||||
* Canvas Popup Status 조회
|
||||
@ -44,6 +55,53 @@ public class CanvasPopupStatusService {
|
||||
} else {
|
||||
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 = "캔버스 팝업 상태 데이터")
|
||||
private String popupStatus;
|
||||
|
||||
@Schema(description = "하제비치")
|
||||
private String hajebichi;
|
||||
|
||||
}
|
||||
|
||||
@ -227,4 +227,12 @@
|
||||
AND plan_no = #{planNo}
|
||||
</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>
|
||||
@ -11,7 +11,8 @@
|
||||
object_no,
|
||||
plan_no,
|
||||
popup_type,
|
||||
popup_status
|
||||
popup_status,
|
||||
#{hajebichi} AS hajebichi
|
||||
FROM T_CANVAS_POPUP_STATUS
|
||||
WHERE object_no = #{objectNo}
|
||||
AND plan_no = #{planNo}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user