Compare commits

...

8 Commits

7 changed files with 125 additions and 13 deletions

View File

@ -336,16 +336,19 @@ BoardResponse boardResponse = null;
/* [1]. QSP API (url + fileNo) Setting */ /* [1]. QSP API (url + fileNo) Setting */
String url = null; String url = null;
if("NO".equals(zipYn)) { if("NO".equals(zipYn)) {
url = QSP_API_URL + "/api/file/downloadFile2"; url = QSP_API_URL + "/api/file/downloadFile2?encodeFileNo=" + keyNo;
}else{ }else{
url = QSP_API_URL + "/api/file/downloadFile"; url = QSP_API_URL + "/api/file/downloadFile";
if ("Y".equals(zipYn)) {
url += "?noticeNo=" + keyNo;
} else {
url += "?fileNo=" + keyNo;
}
} }
if ("Y".equals(zipYn)) {
url += "?noticeNo=" + keyNo;
} else {
url += "?fileNo=" + keyNo;
}
/* [2]. QSP API CALL -> Response */ /* [2]. QSP API CALL -> Response */
Map<String, String> result = new HashMap<String, String>(); Map<String, String> result = new HashMap<String, String>();

View File

@ -103,4 +103,11 @@ public class EstimateController {
public EstimateApiResponse selectAgencyCustList(PriceRequest priceRequest) throws Exception { public EstimateApiResponse selectAgencyCustList(PriceRequest priceRequest) throws Exception {
return estimateService.selectAgencyCustList(priceRequest); return estimateService.selectAgencyCustList(priceRequest);
} }
@Operation(description = "견적서를 삭제한다.")
@PostMapping("/delete-estimate")
@ResponseStatus(HttpStatus.CREATED)
public void deleteEstimate(@RequestBody EstimateRequest estimateRequest) throws Exception {
estimateService.deleteEstimate(estimateRequest);
}
} }

View File

@ -146,4 +146,8 @@ public interface EstimateMapper {
// 견적서 수정일 변경 // 견적서 수정일 변경
public int updateEstimateLastEditDate(EstimateRequest estimateRequest); public int updateEstimateLastEditDate(EstimateRequest estimateRequest);
public int updateEstimateInit(EstimateRequest estimateRequest);
public int updateEstimateInfoInit(EstimateRequest estimateRequest);
} }

View File

@ -1490,6 +1490,7 @@ public class EstimateService {
pwrGnrSimResponse.setGuideInfo(pwrGnrSimGuideInfo.getData()); pwrGnrSimResponse.setGuideInfo(pwrGnrSimGuideInfo.getData());
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e.toString());
} }
} }
@ -1507,6 +1508,7 @@ public class EstimateService {
byte[] drawingImg1 = Util.toByteArray(imageInputStream); byte[] drawingImg1 = Util.toByteArray(imageInputStream);
estimateResponse.setDrawingImg1(drawingImg1); estimateResponse.setDrawingImg1(drawingImg1);
} }
log.debug("url1 ::: {}", url);
// File file = new File(drawingDirPath + File.separator + baseDrawingImgName + "_1.png"); // File file = new File(drawingDirPath + File.separator + baseDrawingImgName + "_1.png");
// if (file.exists()) { // if (file.exists()) {
// InputStream imageInputStream = // InputStream imageInputStream =
@ -1524,6 +1526,7 @@ public class EstimateService {
byte[] drawingImg2 = Util.toByteArray(imageInputStream2); byte[] drawingImg2 = Util.toByteArray(imageInputStream2);
estimateResponse.setDrawingImg2(drawingImg2); estimateResponse.setDrawingImg2(drawingImg2);
} }
log.debug("url2 ::: {}", url2);
// file = new File(drawingDirPath + File.separator + baseDrawingImgName + "_2.png"); // file = new File(drawingDirPath + File.separator + baseDrawingImgName + "_2.png");
// if (file.exists()) { // if (file.exists()) {
// InputStream imageInputStream2 = // InputStream imageInputStream2 =
@ -1625,7 +1628,7 @@ public class EstimateService {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error("Failed to excelDownload estimate. Request: {}", request, e);
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR); throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR);
} }
} }
@ -2324,4 +2327,47 @@ public class EstimateService {
return response; return response;
} }
/**
* 견적서 삭제 (복사이후 배치면 저장)
* @param estimateRequest
* @throws Exception
*/
public void deleteEstimate(EstimateRequest estimateRequest) throws Exception{
if (StringUtils.isEmpty(estimateRequest.getObjectNo())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Object No"));
}
if (StringUtils.isEmpty(estimateRequest.getPlanNo())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Plan No"));
}
if (StringUtils.isEmpty(estimateRequest.getSaleStoreId())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Sale Store ID"));
}
if (StringUtils.isEmpty(estimateRequest.getUserId())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "User ID"));
}
try {
// T_PLAN
int cnt = estimateMapper.updateEstimateInit(estimateRequest);
// T_PLAN_INFO
int cnt2 = estimateMapper.updateEstimateInfoInit(estimateRequest);
// 견적서 모든 아이템 제거
int cnt3 = estimateMapper.deleteEstimateItemList(estimateRequest);
int cnt4 = estimateMapper.deleteEstimateInfoItemList(estimateRequest);
} catch (Exception e) {
log.error("Failed to delete estimate. Request: {}", estimateRequest, e);
throw e; // 예외를 재던지기하여 상위 계층에서도 예외를 처리할 있도록
}
}
} }

View File

@ -280,7 +280,8 @@ public class PwrGnrSimService {
try { try {
pwrGnrSimRes = this.calcResults(pwrGnrSimReq, roofLength); pwrGnrSimRes = this.calcResults(pwrGnrSimReq, roofLength);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error(e.toString());
//e.printStackTrace();
} }
// DecimalFormat 객체 생성 // DecimalFormat 객체 생성
@ -497,7 +498,9 @@ public class PwrGnrSimService {
} }
// 결과 확인용 // 결과 확인용
System.err.println("hatsudenryou_all 결과 ::: " + Arrays.toString(hatsudenryou_all)); //System.err.println("hatsudenryou_all 결과 ::: " + Arrays.toString(hatsudenryou_all));
log.debug("hatsudenryou_all ::: " + Arrays.toString(hatsudenryou_all));
// System.err.println("hatsudenryou_all_snow 결과 ::: " + // System.err.println("hatsudenryou_all_snow 결과 ::: " +
// Arrays.toString(hatsudenryou_all_snow)); // Arrays.toString(hatsudenryou_all_snow));
// System.err.println( // System.err.println(
@ -615,7 +618,7 @@ public class PwrGnrSimService {
double[] peakcutResult = new double[2]; double[] peakcutResult = new double[2];
peakcutResult[0] = amp_peakcut_result; peakcutResult[0] = amp_peakcut_result;
peakcutResult[1] = Math.min(watt_peakcut_result, amp_peakcut_result); peakcutResult[1] = Math.min(watt_peakcut_result, amp_peakcut_result);
log.debug("peakcutResult ::: {}", peakcutResult);
return peakcutResult; return peakcutResult;
} }
@ -1183,13 +1186,13 @@ public class PwrGnrSimService {
i++; i++;
} }
log.error(Arrays.toString(IsbyTotal)); log.debug(Arrays.toString(IsbyTotal));
// 직달, 산란, 지면 반사를 매월 합계 // 직달, 산란, 지면 반사를 매월 합계
for (int m = 0; m < 12; m++) { for (int m = 0; m < 12; m++) {
shamenNissha[m] = IsbyTotal[m] + IbbyTotal[m] + IrbyTotal[m]; shamenNissha[m] = IsbyTotal[m] + IbbyTotal[m] + IrbyTotal[m];
} }
} }
log.debug("shamenNissha ::: {}", shamenNissha);
return shamenNissha; return shamenNissha;
} }

View File

@ -64,7 +64,7 @@ file:
root.path: /home/development/public/files root.path: /home/development/public/files
ini.root.path: /home/development/public/files/NewEstimate ini.root.path: /home/development/public/files/NewEstimate
ini.base.filename: 料金シミュレーション.ini ini.base.filename: 料金シミュレーション.ini
ini.drawing.img.path: /home/development/public/files/NewEstimate/Drawing ini.drawing.img.path: https://files.hanasys.jp/Drawing
front: front:
url: http://1.248.227.176:3000 url: http://1.248.227.176:3000

View File

@ -729,6 +729,32 @@
AND PLAN_NO = #{planNo} AND PLAN_NO = #{planNo}
</update> </update>
<update id="updateEstimateInit" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest">
/* sqlid : com.interplug.qcast.biz.estimate.updateEstimate */
UPDATE T_PLAN
SET
CONSTRUCT_SPECIFICATION = NULL
,SETUP_HEIGHT = NULL
,WEATHER_POINT = NULL
,SLOPE = NULL
,ROOF_MATERIAL_ID = NULL
,SUPPORT_METHOD_ID = NULL
,MODULE_MODEL = NULL
,DRAWING_ESTIMATE_CREATE_DATE = NULL
,ESTIMATE_VALIDITY_TERM = NULL
,CAPACITY = NULL
,SNOWFALL = NULL
,STANDARD_WIND_SPEED_ID = NULL
,PC_TYPE_NO = NULL
,ROOF_MATERIAL_ID_MULTI = NULL
,SUPPORT_MEAKER_MULTI = NULL
,SUPPORT_METHOD_ID_MULTI = NULL
,LAST_EDIT_DATETIME = GETDATE()
,LAST_EDIT_USER = #{userId}
WHERE OBJECT_NO = #{objectNo}
AND PLAN_NO = #{planNo}
</update>
<update id="updateEstimateInfoReset" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest"> <update id="updateEstimateInfoReset" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest">
/* sqlid : com.interplug.qcast.biz.estimate.updateEstimateInfoReset */ /* sqlid : com.interplug.qcast.biz.estimate.updateEstimateInfoReset */
UPDATE T_PLAN_INFO UPDATE T_PLAN_INFO
@ -745,6 +771,29 @@
AND PLAN_NO = #{planNo} AND PLAN_NO = #{planNo}
</update> </update>
<update id="updateEstimateInfoInit" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest">
/* sqlid : com.interplug.qcast.biz.estimate.updateEstimateInfoReset */
UPDATE T_PLAN_INFO
SET
CONSTRUCT_SPECIFICATION_MULTI = NULL
, SURFACE_TYPE = NULL
, ANGLE = NULL
, ESTIMATE_DATE = NULL
, ESTIMATE_TYPE = NULL
, FILE_FLG = 0
, ESTIMATE_OPTION = NULL
, PKG_ASP = NULL
, DOC_NO = NULL
, PRICE_CD = NULL
, REMARKS = NULL
, TEMP_FLG = 1
, LOCK_FLG = 0
, SYNC_FLG = NULL
, SEC_SAP_SALES_STORE_CD = NULL
WHERE OBJECT_NO = #{objectNo}
AND PLAN_NO = #{planNo}
</update>
<update id="updateEstimateLock" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest"> <update id="updateEstimateLock" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest">
/* sqlid : com.interplug.qcast.biz.estimate.updateEstimateLock */ /* sqlid : com.interplug.qcast.biz.estimate.updateEstimateLock */
UPDATE T_PLAN_INFO UPDATE T_PLAN_INFO