물건정보 API 주석 추가

This commit is contained in:
LAPTOP-L3VE7KK2\USER 2024-11-21 15:51:33 +09:00
parent 306d15f531
commit 1309504606
4 changed files with 373 additions and 161 deletions

View File

@ -1,27 +1,5 @@
package com.interplug.qcast.biz.estimate; package com.interplug.qcast.biz.estimate;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Service;
import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.DeserializationFeature;
import com.interplug.qcast.biz.estimate.dto.EstimateApiResponse; import com.interplug.qcast.biz.estimate.dto.EstimateApiResponse;
import com.interplug.qcast.biz.estimate.dto.EstimateCopyRequest; import com.interplug.qcast.biz.estimate.dto.EstimateCopyRequest;
@ -45,6 +23,7 @@ import com.interplug.qcast.biz.object.ObjectMapper;
import com.interplug.qcast.biz.object.dto.ObjectRequest; import com.interplug.qcast.biz.object.dto.ObjectRequest;
import com.interplug.qcast.biz.object.dto.ObjectResponse; import com.interplug.qcast.biz.object.dto.ObjectResponse;
import com.interplug.qcast.biz.pwrGnrSimulation.PwrGnrSimService; import com.interplug.qcast.biz.pwrGnrSimulation.PwrGnrSimService;
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimGuideResponse;
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRequest; import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRequest;
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimResponse; import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimResponse;
import com.interplug.qcast.config.Exception.ErrorCode; import com.interplug.qcast.config.Exception.ErrorCode;
@ -55,8 +34,30 @@ import com.interplug.qcast.util.InterfaceQsp;
import com.interplug.qcast.util.PdfUtil; import com.interplug.qcast.util.PdfUtil;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Service;
import org.springframework.web.util.UriComponentsBuilder;
@Slf4j @Slf4j
@Service @Service
@ -64,8 +65,7 @@ import lombok.extern.slf4j.Slf4j;
public class EstimateService { public class EstimateService {
private final InterfaceQsp interfaceQsp; private final InterfaceQsp interfaceQsp;
@Autowired @Autowired Messages message;
Messages message;
@Value("${file.ini.root.path}") @Value("${file.ini.root.path}")
private String baseDirPath; private String baseDirPath;
@ -82,8 +82,7 @@ public class EstimateService {
private final FileMapper fileMapper; private final FileMapper fileMapper;
@Autowired @Autowired private PwrGnrSimService pwrGnrSimService;
private PwrGnrSimService pwrGnrSimService;
/** /**
* QSP 1차점 price 관리 목록 조회 * QSP 1차점 price 관리 목록 조회
@ -95,25 +94,31 @@ public class EstimateService {
public EstimateApiResponse selectStorePriceList(PriceRequest priceRequest) throws Exception { public EstimateApiResponse selectStorePriceList(PriceRequest priceRequest) throws Exception {
// Validation // Validation
if (StringUtils.isEmpty(priceRequest.getSaleStoreId())) { if (StringUtils.isEmpty(priceRequest.getSaleStoreId())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Sale Store ID")); message.getMessage("common.message.required.data", "Sale Store ID"));
} }
if (StringUtils.isEmpty(priceRequest.getSapSalesStoreCd())) { if (StringUtils.isEmpty(priceRequest.getSapSalesStoreCd())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Sap Sale Store Code")); message.getMessage("common.message.required.data", "Sap Sale Store Code"));
} }
if (StringUtils.isEmpty(priceRequest.getDocTpCd())) { if (StringUtils.isEmpty(priceRequest.getDocTpCd())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Estimate Type")); message.getMessage("common.message.required.data", "Estimate Type"));
} }
EstimateApiResponse response = null; EstimateApiResponse response = null;
/* [1]. QSP API (url + param) Setting */ /* [1]. QSP API (url + param) Setting */
String url = QSP_API_URL + "/api/price/storePriceList"; String url = QSP_API_URL + "/api/price/storePriceList";
String apiUrl = UriComponentsBuilder.fromHttpUrl(url) String apiUrl =
.queryParam("saleStoreId", priceRequest.getSaleStoreId()) UriComponentsBuilder.fromHttpUrl(url)
.queryParam("sapSalesStoreCd", priceRequest.getSapSalesStoreCd()) .queryParam("saleStoreId", priceRequest.getSaleStoreId())
.queryParam("docTpCd", priceRequest.getDocTpCd()).build().toUriString(); .queryParam("sapSalesStoreCd", priceRequest.getSapSalesStoreCd())
.queryParam("docTpCd", priceRequest.getDocTpCd())
.build()
.toUriString();
/* [2]. QSP API CALL -> Response */ /* [2]. QSP API CALL -> Response */
String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null); String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null);
@ -141,22 +146,26 @@ public class EstimateService {
public EstimateApiResponse selectItemPriceList(PriceRequest priceRequest) throws Exception { public EstimateApiResponse selectItemPriceList(PriceRequest priceRequest) throws Exception {
// Validation // Validation
if (StringUtils.isEmpty(priceRequest.getSaleStoreId())) { if (StringUtils.isEmpty(priceRequest.getSaleStoreId())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Sale Store ID")); message.getMessage("common.message.required.data", "Sale Store ID"));
} }
if (StringUtils.isEmpty(priceRequest.getSapSalesStoreCd())) { if (StringUtils.isEmpty(priceRequest.getSapSalesStoreCd())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Sap Sale Store Code")); message.getMessage("common.message.required.data", "Sap Sale Store Code"));
} }
if (StringUtils.isEmpty(priceRequest.getPriceCd())) { if (StringUtils.isEmpty(priceRequest.getPriceCd())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Price Code")); message.getMessage("common.message.required.data", "Price Code"));
} }
EstimateApiResponse response = null; EstimateApiResponse response = null;
/* [1]. QSP API CALL -> Response */ /* [1]. QSP API CALL -> Response */
String strResponse = interfaceQsp.callApi(HttpMethod.POST, String strResponse =
QSP_API_URL + "/api//price/storePriceItemList", priceRequest); interfaceQsp.callApi(
HttpMethod.POST, QSP_API_URL + "/api//price/storePriceItemList", priceRequest);
if (!"".equals(strResponse)) { if (!"".equals(strResponse)) {
com.fasterxml.jackson.databind.ObjectMapper om = com.fasterxml.jackson.databind.ObjectMapper om =
@ -193,11 +202,13 @@ public class EstimateService {
public EstimateResponse selectEstimateDetail(String objectNo, String planNo) throws Exception { public EstimateResponse selectEstimateDetail(String objectNo, String planNo) throws Exception {
// Validation // Validation
if (StringUtils.isEmpty(objectNo)) { if (StringUtils.isEmpty(objectNo)) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Object No")); message.getMessage("common.message.required.data", "Object No"));
} }
if (StringUtils.isEmpty(planNo)) { if (StringUtils.isEmpty(planNo)) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Plan No")); message.getMessage("common.message.required.data", "Plan No"));
} }
@ -241,19 +252,23 @@ public class EstimateService {
public void insertEstimate(EstimateRequest estimateRequest) throws Exception { public void insertEstimate(EstimateRequest estimateRequest) throws Exception {
// Validation // Validation
if (StringUtils.isEmpty(estimateRequest.getObjectNo())) { if (StringUtils.isEmpty(estimateRequest.getObjectNo())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Object No")); message.getMessage("common.message.required.data", "Object No"));
} }
if (StringUtils.isEmpty(estimateRequest.getPlanNo())) { if (StringUtils.isEmpty(estimateRequest.getPlanNo())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Plan No")); message.getMessage("common.message.required.data", "Plan No"));
} }
if (StringUtils.isEmpty(estimateRequest.getSaleStoreId())) { if (StringUtils.isEmpty(estimateRequest.getSaleStoreId())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Sale Store ID")); message.getMessage("common.message.required.data", "Sale Store ID"));
} }
if (StringUtils.isEmpty(estimateRequest.getSapSalesStoreCd())) { if (StringUtils.isEmpty(estimateRequest.getSapSalesStoreCd())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Sap Sale Store Code")); message.getMessage("common.message.required.data", "Sap Sale Store Code"));
} }
@ -272,8 +287,8 @@ public class EstimateService {
ObjectResponse objectResponse = ObjectResponse objectResponse =
objectMapper.selectObjectDetail(estimateRequest.getObjectNo()); objectMapper.selectObjectDetail(estimateRequest.getObjectNo());
if (objectResponse != null) { if (objectResponse != null) {
estimateRequest estimateRequest.setWeatherPoint(
.setWeatherPoint(objectResponse.getPrefName() + " - " + objectResponse.getAreaName()); objectResponse.getPrefName() + " - " + objectResponse.getAreaName());
estimateRequest.setCharger(objectResponse.getReceiveUser()); estimateRequest.setCharger(objectResponse.getReceiveUser());
} }
@ -395,8 +410,10 @@ public class EstimateService {
bomItem.setUnit(itemResponse.getUnit()); bomItem.setUnit(itemResponse.getUnit());
bomItem.setPnowW(itemResponse.getPnowW()); bomItem.setPnowW(itemResponse.getPnowW());
bomItem.setSpecification(itemResponse.getPnowW()); bomItem.setSpecification(itemResponse.getPnowW());
bomItem.setAmount(String.valueOf(Integer.parseInt(itemResponse.getBomAmount()) bomItem.setAmount(
* Integer.parseInt(itemRequest.getAmount()))); String.valueOf(
Integer.parseInt(itemResponse.getBomAmount())
* Integer.parseInt(itemRequest.getAmount())));
bomItem.setBomAmount(itemResponse.getBomAmount()); bomItem.setBomAmount(itemResponse.getBomAmount());
bomItem.setUnitPrice(itemResponse.getSalePrice()); bomItem.setUnitPrice(itemResponse.getSalePrice());
bomItem.setSalePrice(itemResponse.getSalePrice()); bomItem.setSalePrice(itemResponse.getSalePrice());
@ -487,24 +504,29 @@ public class EstimateService {
String pcTypeNo = ""; String pcTypeNo = "";
for (ItemRequest itemRequest : itemList) { for (ItemRequest itemRequest : itemList) {
if (StringUtils.isEmpty(itemRequest.getDispOrder())) { if (StringUtils.isEmpty(itemRequest.getDispOrder())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Display Order")); message.getMessage("common.message.required.data", "Display Order"));
} }
if (StringUtils.isEmpty(itemRequest.getItemId())) { if (StringUtils.isEmpty(itemRequest.getItemId())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Item ID")); message.getMessage("common.message.required.data", "Item ID"));
} }
if (StringUtils.isEmpty(itemRequest.getAmount())) { if (StringUtils.isEmpty(itemRequest.getAmount())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Item Amount")); message.getMessage("common.message.required.data", "Item Amount"));
} }
// 수량 // 수량
BigDecimal amount = new BigDecimal( BigDecimal amount =
StringUtils.isEmpty(itemRequest.getAmount()) ? "0" : itemRequest.getAmount()); new BigDecimal(
StringUtils.isEmpty(itemRequest.getAmount()) ? "0" : itemRequest.getAmount());
// 아이템용량 // 아이템용량
BigDecimal pnowW = new BigDecimal( BigDecimal pnowW =
StringUtils.isEmpty(itemRequest.getPnowW()) ? "0" : itemRequest.getPnowW()); new BigDecimal(
StringUtils.isEmpty(itemRequest.getPnowW()) ? "0" : itemRequest.getPnowW());
// 모듈/PC 체크 // 모듈/PC 체크
if ("MODULE_".equals(itemRequest.getItemGroup())) { if ("MODULE_".equals(itemRequest.getItemGroup())) {
@ -573,7 +595,8 @@ public class EstimateService {
itemRequest.setPartAdd( itemRequest.setPartAdd(
!StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0"); !StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0");
itemRequest.setItemChangeFlg( itemRequest.setItemChangeFlg(
!StringUtils.isEmpty(itemRequest.getItemChangeFlg()) ? itemRequest.getItemChangeFlg() !StringUtils.isEmpty(itemRequest.getItemChangeFlg())
? itemRequest.getItemChangeFlg()
: "0"); : "0");
itemRequest.setUserId(estimateRequest.getUserId()); itemRequest.setUserId(estimateRequest.getUserId());
@ -612,11 +635,13 @@ public class EstimateService {
throws Exception { throws Exception {
// Validation // Validation
if (StringUtils.isEmpty(estimateCopyRequest.getObjectNo())) { if (StringUtils.isEmpty(estimateCopyRequest.getObjectNo())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Object No")); message.getMessage("common.message.required.data", "Object No"));
} }
if (StringUtils.isEmpty(estimateCopyRequest.getPlanNo())) { if (StringUtils.isEmpty(estimateCopyRequest.getPlanNo())) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Plan No")); message.getMessage("common.message.required.data", "Plan No"));
} }
// 응답 객체 // 응답 객체
@ -626,8 +651,8 @@ public class EstimateService {
ObjectRequest objectRequest = new ObjectRequest(); ObjectRequest objectRequest = new ObjectRequest();
objectRequest.setSaleStoreId(estimateCopyRequest.getCopySaleStoreId()); objectRequest.setSaleStoreId(estimateCopyRequest.getCopySaleStoreId());
objectRequest objectRequest.setReceiveUser(
.setReceiveUser(StringUtils.defaultString(estimateCopyRequest.getCopyReceiveUser())); StringUtils.defaultString(estimateCopyRequest.getCopyReceiveUser()));
objectRequest.setDelFlg("0"); objectRequest.setDelFlg("0");
objectRequest.setTempFlg("0"); objectRequest.setTempFlg("0");
objectRequest.setTempDelFlg("0"); objectRequest.setTempDelFlg("0");
@ -704,7 +729,8 @@ public class EstimateService {
itemRequest.setPartAdd( itemRequest.setPartAdd(
!StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0"); !StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0");
itemRequest.setItemChangeFlg( itemRequest.setItemChangeFlg(
!StringUtils.isEmpty(itemRequest.getItemChangeFlg()) ? itemRequest.getItemChangeFlg() !StringUtils.isEmpty(itemRequest.getItemChangeFlg())
? itemRequest.getItemChangeFlg()
: "0"); : "0");
itemRequest.setUserId(estimateCopyRequest.getUserId()); itemRequest.setUserId(estimateCopyRequest.getUserId());
@ -793,13 +819,14 @@ public class EstimateService {
* @param estimateRequest 견적서 엑셀 다운로드 요청 정보 * @param estimateRequest 견적서 엑셀 다운로드 요청 정보
* @throws Exception * @throws Exception
*/ */
public void excelDownload(HttpServletRequest request, HttpServletResponse response, public void excelDownload(
EstimateRequest estimateRequest) throws Exception { HttpServletRequest request, HttpServletResponse response, EstimateRequest estimateRequest)
throws Exception {
// file Name 명이 없는경우 // file Name 명이 없는경우
if (estimateRequest.getFileName() == null || "".equals(estimateRequest.getFileName())) { if (estimateRequest.getFileName() == null || "".equals(estimateRequest.getFileName())) {
estimateRequest estimateRequest.setFileName(
.setFileName("Quation_Detail_" + new SimpleDateFormat("yyyyMMdd").format(new Date())); "Quation_Detail_" + new SimpleDateFormat("yyyyMMdd").format(new Date()));
} }
EstimateResponse estimateResponse = new EstimateResponse(); EstimateResponse estimateResponse = new EstimateResponse();
@ -875,8 +902,8 @@ public class EstimateService {
List<ItemResponse> estimateItemList = estimateMapper.selectEstimateItemList(estimateRequest); List<ItemResponse> estimateItemList = estimateMapper.selectEstimateItemList(estimateRequest);
// 합산금액 계산 // 합산금액 계산
this.selectTotalPriceInfo(estimateResponse, estimateItemList, this.selectTotalPriceInfo(
estimateRequest.getSchUnitPriceFlg()); estimateResponse, estimateItemList, estimateRequest.getSchUnitPriceFlg());
int j = 1; int j = 1;
for (ItemResponse itemResponse : estimateItemList) { for (ItemResponse itemResponse : estimateItemList) {
@ -885,8 +912,8 @@ public class EstimateService {
// 문자열 통화로 변환 처리 // 문자열 통화로 변환 처리
itemResponse.setSalePrice( itemResponse.setSalePrice(
String.format("%1$,.0f", Double.parseDouble(itemResponse.getSalePrice()))); String.format("%1$,.0f", Double.parseDouble(itemResponse.getSalePrice())));
itemResponse itemResponse.setAmount(
.setAmount(String.format("%1$,.0f", Double.parseDouble(itemResponse.getAmount()))); String.format("%1$,.0f", Double.parseDouble(itemResponse.getAmount())));
itemResponse.setSaleTotPrice( itemResponse.setSaleTotPrice(
String.format("%1$,.0f", Double.parseDouble(itemResponse.getSaleTotPrice()))); String.format("%1$,.0f", Double.parseDouble(itemResponse.getSaleTotPrice())));
@ -900,14 +927,14 @@ public class EstimateService {
// 합산 문자열 통화로 변환 처리 // 합산 문자열 통화로 변환 처리
estimateResponse.setPkgYn("YJSS".equals(estimateResponse.getEstimateType()) ? "Y" : "N"); estimateResponse.setPkgYn("YJSS".equals(estimateResponse.getEstimateType()) ? "Y" : "N");
estimateResponse estimateResponse.setPkgNo(
.setPkgNo("YJSS".equals(estimateResponse.getEstimateType()) ? String.valueOf(j++) : ""); "YJSS".equals(estimateResponse.getEstimateType()) ? String.valueOf(j++) : "");
if ("YJSS".equals(estimateResponse.getEstimateType())) { if ("YJSS".equals(estimateResponse.getEstimateType())) {
estimateResponse estimateResponse.setPkgAsp(
.setPkgAsp(String.format("%1$,.0f", Double.parseDouble(estimateResponse.getPkgAsp()))); String.format("%1$,.0f", Double.parseDouble(estimateResponse.getPkgAsp())));
} }
estimateResponse estimateResponse.setTotVol(
.setTotVol(String.format("%1$,.0f", Double.parseDouble(estimateResponse.getTotVol()))); String.format("%1$,.0f", Double.parseDouble(estimateResponse.getTotVol())));
estimateResponse.setPkgTotPrice( estimateResponse.setPkgTotPrice(
String.format("%1$,.0f", Double.parseDouble(estimateResponse.getPkgTotPrice()))); String.format("%1$,.0f", Double.parseDouble(estimateResponse.getPkgTotPrice())));
estimateResponse.setSupplyPrice( estimateResponse.setSupplyPrice(
@ -929,11 +956,11 @@ public class EstimateService {
if (pwrGnrSimResponse != null) { if (pwrGnrSimResponse != null) {
try { try {
// 발전시뮬레이션 안내사항 조회 // 발전시뮬레이션 안내사항 조회
// PwrGnrSimGuideResponse pwrGnrSimGuideInfo = PwrGnrSimGuideResponse pwrGnrSimGuideInfo =
// pwrGnrSimService.selectPwrGnrSimulationGuideInfo(); pwrGnrSimService.selectPwrGnrSimulationGuideInfo();
// if (pwrGnrSimGuideInfo != null) { if (pwrGnrSimGuideInfo != null) {
// pwrGnrSimResponse.setGuideInfo(pwrGnrSimGuideInfo.getData()); pwrGnrSimResponse.setGuideInfo(pwrGnrSimGuideInfo.getData());
// } }
} catch (Exception e) { } catch (Exception e) {
} }
} }
@ -989,8 +1016,12 @@ public class EstimateService {
String excelTemplateNam = "excel_download_quotation_detail_template.xlsx"; String excelTemplateNam = "excel_download_quotation_detail_template.xlsx";
ExcelUtil excelUtil = new ExcelUtil(); ExcelUtil excelUtil = new ExcelUtil();
excelUtil.download(request, response, this.convertVoToMap(estimateResponse), excelUtil.download(
this.convertListToMap(estimateItemList), estimateRequest.getFileName(), request,
response,
this.convertVoToMap(estimateResponse),
this.convertListToMap(estimateItemList),
estimateRequest.getFileName(),
excelTemplateNam); excelTemplateNam);
} }
@ -1007,8 +1038,9 @@ public class EstimateService {
* @param unitPriceFlg 가격 표시 코드 * @param unitPriceFlg 가격 표시 코드
* @throws Exception * @throws Exception
*/ */
public void selectTotalPriceInfo(EstimateResponse estimateResponse, List<ItemResponse> itemList, public void selectTotalPriceInfo(
String unitPriceFlg) throws Exception { EstimateResponse estimateResponse, List<ItemResponse> itemList, String unitPriceFlg)
throws Exception {
BigDecimal totAmount = BigDecimal.ZERO; BigDecimal totAmount = BigDecimal.ZERO;
BigDecimal totVol = BigDecimal.ZERO; BigDecimal totVol = BigDecimal.ZERO;
BigDecimal pkgTotPrice = BigDecimal.ZERO; BigDecimal pkgTotPrice = BigDecimal.ZERO;
@ -1019,25 +1051,34 @@ public class EstimateService {
String estimateType = estimateResponse.getEstimateType(); String estimateType = estimateResponse.getEstimateType();
// 주택패키지 단가 // 주택패키지 단가
BigDecimal pkgAsp = new BigDecimal( BigDecimal pkgAsp =
StringUtils.isEmpty(estimateResponse.getPkgAsp()) ? "0" : estimateResponse.getPkgAsp()); new BigDecimal(
StringUtils.isEmpty(estimateResponse.getPkgAsp()) ? "0" : estimateResponse.getPkgAsp());
for (ItemResponse itemResponse : itemList) { for (ItemResponse itemResponse : itemList) {
// 수량 // 수량
BigDecimal amount = new BigDecimal( BigDecimal amount =
StringUtils.isEmpty(itemResponse.getAmount()) ? "0" : itemResponse.getAmount()); new BigDecimal(
StringUtils.isEmpty(itemResponse.getAmount()) ? "0" : itemResponse.getAmount());
// 판매가 // 판매가
BigDecimal salePrice = BigDecimal.ZERO; BigDecimal salePrice = BigDecimal.ZERO;
if ("1".equals(unitPriceFlg)) { if ("1".equals(unitPriceFlg)) {
salePrice = new BigDecimal( salePrice =
StringUtils.isEmpty(itemResponse.getUnitPrice()) ? "0" : itemResponse.getUnitPrice()); new BigDecimal(
StringUtils.isEmpty(itemResponse.getUnitPrice())
? "0"
: itemResponse.getUnitPrice());
} else { } else {
salePrice = new BigDecimal( salePrice =
StringUtils.isEmpty(itemResponse.getSalePrice()) ? "0" : itemResponse.getSalePrice()); new BigDecimal(
StringUtils.isEmpty(itemResponse.getSalePrice())
? "0"
: itemResponse.getSalePrice());
} }
// 아이템용량 // 아이템용량
BigDecimal pnowW = new BigDecimal( BigDecimal pnowW =
StringUtils.isEmpty(itemResponse.getPnowW()) ? "0" : itemResponse.getPnowW()); new BigDecimal(
StringUtils.isEmpty(itemResponse.getPnowW()) ? "0" : itemResponse.getPnowW());
// 아이템 단가 합산 // 아이템 단가 합산
itemResponse.setSaleTotPrice(String.valueOf(salePrice.multiply(amount))); itemResponse.setSaleTotPrice(String.valueOf(salePrice.multiply(amount)));
@ -1081,10 +1122,11 @@ public class EstimateService {
estimateResponse.setPkgTotPrice(String.valueOf(pkgTotPrice)); estimateResponse.setPkgTotPrice(String.valueOf(pkgTotPrice));
estimateResponse.setTotAmount(String.valueOf(totAmount.setScale(0, BigDecimal.ROUND_HALF_UP))); estimateResponse.setTotAmount(String.valueOf(totAmount.setScale(0, BigDecimal.ROUND_HALF_UP)));
estimateResponse.setTotVol(String.valueOf(totVol)); estimateResponse.setTotVol(String.valueOf(totVol));
estimateResponse.setTotVolKw(String estimateResponse.setTotVolKw(
.valueOf(totVol.multiply(new BigDecimal("0.001")).setScale(3, BigDecimal.ROUND_FLOOR))); String.valueOf(
estimateResponse totVol.multiply(new BigDecimal("0.001")).setScale(3, BigDecimal.ROUND_FLOOR)));
.setSupplyPrice(String.valueOf(supplyPrice.setScale(0, BigDecimal.ROUND_HALF_UP))); estimateResponse.setSupplyPrice(
String.valueOf(supplyPrice.setScale(0, BigDecimal.ROUND_HALF_UP)));
estimateResponse.setVatPrice(String.valueOf(vatPrice.setScale(0, BigDecimal.ROUND_HALF_UP))); estimateResponse.setVatPrice(String.valueOf(vatPrice.setScale(0, BigDecimal.ROUND_HALF_UP)));
estimateResponse.setTotPrice(String.valueOf(totPrice.setScale(0, BigDecimal.ROUND_HALF_UP))); estimateResponse.setTotPrice(String.valueOf(totPrice.setScale(0, BigDecimal.ROUND_HALF_UP)));
} }
@ -1137,8 +1179,9 @@ public class EstimateService {
EstimateApiResponse response = null; EstimateApiResponse response = null;
/* [1]. QSP API CALL -> Response */ /* [1]. QSP API CALL -> Response */
String strResponse = interfaceQsp.callApi(HttpMethod.POST, String strResponse =
QSP_API_URL + "/api/order/qcastQuotationSave", estimateSendRequest); interfaceQsp.callApi(
HttpMethod.POST, QSP_API_URL + "/api/order/qcastQuotationSave", estimateSendRequest);
if (!"".equals(strResponse)) { if (!"".equals(strResponse)) {
com.fasterxml.jackson.databind.ObjectMapper om = com.fasterxml.jackson.databind.ObjectMapper om =
@ -1155,7 +1198,7 @@ public class EstimateService {
for (EstimateSendResponse data : quoteList) { for (EstimateSendResponse data : quoteList) {
if (data.getObjectNo().equals(succ.get("objectNo")) if (data.getObjectNo().equals(succ.get("objectNo"))
&& data.getPlanNo().equals(succ.get("planNo"))) { && data.getPlanNo().equals(succ.get("planNo"))) {
data.setSyncFlg("1"); data.setSyncFlg(String.valueOf(succ.get("syncFlg")));
data.setDocNo(String.valueOf(succ.get("docNo"))); data.setDocNo(String.valueOf(succ.get("docNo")));
} }
} }
@ -1232,18 +1275,28 @@ public class EstimateService {
sb.append("<tr>"); sb.append("<tr>");
sb.append( sb.append(
"<td style='width:60px;'>" + StringUtils.defaultString(itemResponse.getNo()) + "</td>"); "<td style='width:60px;'>" + StringUtils.defaultString(itemResponse.getNo()) + "</td>");
sb.append("<td style='width:120px;text-align:left;'>" sb.append(
+ StringUtils.defaultString(itemResponse.getItemName()) + "</td>"); "<td style='width:120px;text-align:left;'>"
sb.append("<td style='width:120px;'>" + StringUtils.defaultString(itemResponse.getItemNo()) + StringUtils.defaultString(itemResponse.getItemName())
+ "</td>"); + "</td>");
sb.append("<td style='width:80px;text-align:right;'>" sb.append(
+ StringUtils.defaultString(itemResponse.getSalePrice()) + "</td>"); "<td style='width:120px;'>"
sb.append("<td style='width:60px;text-align:right;'>" + StringUtils.defaultString(itemResponse.getItemNo())
+ StringUtils.defaultString(itemResponse.getAmount()) + "</td>"); + "</td>");
sb.append(
"<td style='width:80px;text-align:right;'>"
+ StringUtils.defaultString(itemResponse.getSalePrice())
+ "</td>");
sb.append(
"<td style='width:60px;text-align:right;'>"
+ StringUtils.defaultString(itemResponse.getAmount())
+ "</td>");
sb.append( sb.append(
"<td style='width:60px;'>" + StringUtils.defaultString(itemResponse.getUnit()) + "</td>"); "<td style='width:60px;'>" + StringUtils.defaultString(itemResponse.getUnit()) + "</td>");
sb.append("<td style='width:80px;text-align:right;'>" sb.append(
+ StringUtils.defaultString(itemResponse.getSaleTotPrice()) + "</td>"); "<td style='width:80px;text-align:right;'>"
+ StringUtils.defaultString(itemResponse.getSaleTotPrice())
+ "</td>");
sb.append("</tr>"); sb.append("</tr>");
} }
if ("Y".equals(data.getPkgYn())) { if ("Y".equals(data.getPkgYn())) {
@ -1251,13 +1304,19 @@ public class EstimateService {
sb.append("<td style='width:60px;'>" + StringUtils.defaultString(data.getPkgNo()) + "</td>"); sb.append("<td style='width:60px;'>" + StringUtils.defaultString(data.getPkgNo()) + "</td>");
sb.append("<td style='width:120px;text-align:left;'>住宅 PKG</td>"); sb.append("<td style='width:120px;text-align:left;'>住宅 PKG</td>");
sb.append("<td style='width:120px;'>-</td>"); sb.append("<td style='width:120px;'>-</td>");
sb.append("<td style='width:80px;text-align:right;'>" sb.append(
+ StringUtils.defaultString(data.getPkgAsp()) + "</td>"); "<td style='width:80px;text-align:right;'>"
sb.append("<td style='width:60px;text-align:right;'>" + StringUtils.defaultString(data.getPkgAsp())
+ StringUtils.defaultString(data.getTotVol()) + "</td>"); + "</td>");
sb.append(
"<td style='width:60px;text-align:right;'>"
+ StringUtils.defaultString(data.getTotVol())
+ "</td>");
sb.append("<td style='width:60px;'>W</td>"); sb.append("<td style='width:60px;'>W</td>");
sb.append("<td style='width:80px;text-align:right;'>" sb.append(
+ StringUtils.defaultString(data.getPkgTotPrice()) + "</td>"); "<td style='width:80px;text-align:right;'>"
+ StringUtils.defaultString(data.getPkgTotPrice())
+ "</td>");
sb.append("</tr>"); sb.append("</tr>");
} }
elm = doc.getElementById("itemList_detail"); elm = doc.getElementById("itemList_detail");
@ -1280,10 +1339,14 @@ public class EstimateService {
sb = new StringBuilder(); sb = new StringBuilder();
for (NoteResponse noteResponse : data.getNoteList()) { for (NoteResponse noteResponse : data.getNoteList()) {
sb.append("<tr>"); sb.append("<tr>");
sb.append("<td style='text-align:left;'>" sb.append(
+ StringUtils.defaultString(noteResponse.getCodeNm()) + "</td>"); "<td style='text-align:left;'>"
sb.append("<td style='text-align:left;'>" + StringUtils.defaultString(noteResponse.getCodeNm())
+ StringUtils.defaultString(noteResponse.getRemarks()) + "</td>"); + "</td>");
sb.append(
"<td style='text-align:left;'>"
+ StringUtils.defaultString(noteResponse.getRemarks())
+ "</td>");
sb.append("</tr>"); sb.append("</tr>");
} }
elm = doc.getElementById("noteList_detail"); elm = doc.getElementById("noteList_detail");
@ -1292,8 +1355,11 @@ public class EstimateService {
// 도면 설정 // 도면 설정
elm = doc.getElementById("objectNo4"); elm = doc.getElementById("objectNo4");
elm.text(StringUtils.defaultString(data.getObjectNo()) + " (Plan No : " elm.text(
+ StringUtils.defaultString(data.getPlanNo()) + ")"); StringUtils.defaultString(data.getObjectNo())
+ " (Plan No : "
+ StringUtils.defaultString(data.getPlanNo())
+ ")");
elm = doc.getElementById("objectName"); elm = doc.getElementById("objectName");
elm.text(StringUtils.defaultString(data.getObjectName())); elm.text(StringUtils.defaultString(data.getObjectName()));
@ -1327,10 +1393,14 @@ public class EstimateService {
if (!"STAND_".equals(itemResponse.getItemGroup())) { if (!"STAND_".equals(itemResponse.getItemGroup())) {
sb.append("<tr>"); sb.append("<tr>");
sb.append("<td>" + (no++) + "</td>"); sb.append("<td>" + (no++) + "</td>");
sb.append("<td style='text-align:left;'>" sb.append(
+ StringUtils.defaultString(itemResponse.getItemNo()) + "</td>"); "<td style='text-align:left;'>"
sb.append("<td style='text-align:right;'>" + StringUtils.defaultString(itemResponse.getItemNo())
+ StringUtils.defaultString(itemResponse.getAmount()) + "</td>"); + "</td>");
sb.append(
"<td style='text-align:right;'>"
+ StringUtils.defaultString(itemResponse.getAmount())
+ "</td>");
sb.append("</tr>"); sb.append("</tr>");
} }
} }
@ -1344,8 +1414,12 @@ public class EstimateService {
sb.append("<tr>"); sb.append("<tr>");
sb.append("<td>" + (no++) + "</td>"); sb.append("<td>" + (no++) + "</td>");
sb.append( sb.append(
"<td style='text-align:left;'>" + StringUtils.defaultString(roofResponse.getItemNo()) "<td style='text-align:left;'>"
+ "[" + roofResponse.getPcModuleAmount() + "]" + "</td>"); + StringUtils.defaultString(roofResponse.getItemNo())
+ "["
+ roofResponse.getPcModuleAmount()
+ "]"
+ "</td>");
sb.append("</tr>"); sb.append("</tr>");
} }
elm = doc.getElementById("pcsItemList_detail"); elm = doc.getElementById("pcsItemList_detail");
@ -1359,8 +1433,10 @@ public class EstimateService {
sb.append("<td>" + StringUtils.defaultString(roofResponse.getRoofSurface()) + "</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getRoofSurface()) + "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getClassTypeName()) + "</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getClassTypeName()) + "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getAmount()) + "</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getAmount()) + "</td>");
sb.append("<td style='text-align:right;'>" sb.append(
+ StringUtils.defaultString(roofResponse.getVolKw()) + "</td>"); "<td style='text-align:right;'>"
+ StringUtils.defaultString(roofResponse.getVolKw())
+ "</td>");
sb.append("</tr>"); sb.append("</tr>");
} }
elm = doc.getElementById("surFaceList_detail"); elm = doc.getElementById("surFaceList_detail");
@ -1378,13 +1454,19 @@ public class EstimateService {
for (RoofResponse roofResponse : data.getRoofInfo().getRoofList()) { for (RoofResponse roofResponse : data.getRoofInfo().getRoofList()) {
sb.append("<tr>"); sb.append("<tr>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getRoofSurface()) + "</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getRoofSurface()) + "</td>");
sb.append("<td style='text-align:left;'>" sb.append(
+ StringUtils.defaultString(roofResponse.getRoofMaterialName()) + "</td>"); "<td style='text-align:left;'>"
+ StringUtils.defaultString(roofResponse.getRoofMaterialName())
+ "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getSlope()) + "寸</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getSlope()) + "寸</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getConstructSpecificationName()) sb.append(
+ "</td>"); "<td>"
sb.append("<td style='text-align:left;'>" + StringUtils.defaultString(roofResponse.getConstructSpecificationName())
+ StringUtils.defaultString(roofResponse.getSupportMethodName()) + "</td>"); + "</td>");
sb.append(
"<td style='text-align:left;'>"
+ StringUtils.defaultString(roofResponse.getSupportMethodName())
+ "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getSurfaceType()) + "</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getSurfaceType()) + "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getSetupHeight()) + "</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getSetupHeight()) + "</td>");
sb.append("</tr>"); sb.append("</tr>");
@ -1394,8 +1476,11 @@ public class EstimateService {
} }
elm = doc.getElementById("objectNo5"); elm = doc.getElementById("objectNo5");
elm.text(StringUtils.defaultString(data.getObjectNo()) + " (Plan No : " elm.text(
+ StringUtils.defaultString(data.getPlanNo()) + ")"); StringUtils.defaultString(data.getObjectNo())
+ " (Plan No : "
+ StringUtils.defaultString(data.getPlanNo())
+ ")");
elm = doc.getElementById("objectName5"); elm = doc.getElementById("objectName5");
elm.text(StringUtils.defaultString(data.getObjectName())); elm.text(StringUtils.defaultString(data.getObjectName()));
@ -1429,10 +1514,14 @@ public class EstimateService {
if ("STAND_".equals(itemResponse.getItemGroup())) { if ("STAND_".equals(itemResponse.getItemGroup())) {
sb.append("<tr>"); sb.append("<tr>");
sb.append("<td>" + (no++) + "</td>"); sb.append("<td>" + (no++) + "</td>");
sb.append("<td style='text-align:left;'>" sb.append(
+ StringUtils.defaultString(itemResponse.getItemNo()) + "</td>"); "<td style='text-align:left;'>"
sb.append("<td style='text-align:right;'>" + StringUtils.defaultString(itemResponse.getItemNo())
+ StringUtils.defaultString(itemResponse.getAmount()) + "</td>"); + "</td>");
sb.append(
"<td style='text-align:right;'>"
+ StringUtils.defaultString(itemResponse.getAmount())
+ "</td>");
sb.append("</tr>"); sb.append("</tr>");
} }
} }
@ -1444,13 +1533,19 @@ public class EstimateService {
for (RoofResponse roofResponse : data.getRoofInfo().getRoofList()) { for (RoofResponse roofResponse : data.getRoofInfo().getRoofList()) {
sb.append("<tr>"); sb.append("<tr>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getRoofSurface()) + "</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getRoofSurface()) + "</td>");
sb.append("<td style='text-align:left;'>" sb.append(
+ StringUtils.defaultString(roofResponse.getRoofMaterialName()) + "</td>"); "<td style='text-align:left;'>"
+ StringUtils.defaultString(roofResponse.getRoofMaterialName())
+ "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getSlope()) + "寸</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getSlope()) + "寸</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getConstructSpecificationName()) sb.append(
+ "</td>"); "<td>"
sb.append("<td style='text-align:left;'>" + StringUtils.defaultString(roofResponse.getConstructSpecificationName())
+ StringUtils.defaultString(roofResponse.getSupportMethodName()) + "</td>"); + "</td>");
sb.append(
"<td style='text-align:left;'>"
+ StringUtils.defaultString(roofResponse.getSupportMethodName())
+ "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getSurfaceType()) + "</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getSurfaceType()) + "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getSetupHeight()) + "</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getSetupHeight()) + "</td>");
sb.append("</tr>"); sb.append("</tr>");

View File

@ -60,18 +60,46 @@ public class ObjectService {
private final StoreFavoriteService storeFavoriteService; private final StoreFavoriteService storeFavoriteService;
/**
* 도도부현 목록 조회
*
* @return List<PrefResponse> 도도부현 목록
* @throws Exception
*/
public List<PrefResponse> selectPrefList() throws Exception { public List<PrefResponse> selectPrefList() throws Exception {
return objectMapper.selectPrefList(); return objectMapper.selectPrefList();
} }
/**
* 발전시뮬레이션 지역 목록 조회
*
* @param prefId 도도부현 코드
* @return List<PrefResponse> 발전시뮬레이션 지역 목록
* @throws Exception
*/
public List<PrefResponse> selectPrefAreaList(String prefId) throws Exception { public List<PrefResponse> selectPrefAreaList(String prefId) throws Exception {
return objectMapper.selectPrefAreaList(prefId); return objectMapper.selectPrefAreaList(prefId);
} }
/**
* 기준 풍속 목록 조회
*
* @param city 지역코드
* @return List<WindSpeedResponse> 기준 풍속 목록
* @throws Exception
*/
public List<WindSpeedResponse> selectWindSpeedList(String city) throws Exception { public List<WindSpeedResponse> selectWindSpeedList(String city) throws Exception {
return objectMapper.selectWindSpeedList(city); return objectMapper.selectWindSpeedList(city);
} }
/**
* 1차점 판매점 목록 조회
*
* @param saleStoreId 1차점 판매점 아이디
* @param userId 유저 아이디
* @return List<SaleStoreResponse> 1차점 판매점 목록
* @throws Exception
*/
public List<SaleStoreResponse> selectFirstSaleStoreList(String saleStoreId, String userId) public List<SaleStoreResponse> selectFirstSaleStoreList(String saleStoreId, String userId)
throws Exception { throws Exception {
// Validation // Validation
@ -96,6 +124,15 @@ public class ObjectService {
return storeList; return storeList;
} }
/**
* 하위 판매점 목록 조회
*
* @param saleStoreId 판매점 아이디
* @param firstFlg 1차점 판매점 여부
* @param userId 유저 아이디
* @return List<SaleStoreResponse> 하위 판매점 목록
* @throws Exception
*/
public List<SaleStoreResponse> selectSaleStoreList( public List<SaleStoreResponse> selectSaleStoreList(
String saleStoreId, String firstFlg, String userId) throws Exception { String saleStoreId, String firstFlg, String userId) throws Exception {
// Validation // Validation
@ -117,14 +154,35 @@ public class ObjectService {
return storeList; return storeList;
} }
/**
* 판매점 정보 상세 조회
*
* @param saleStoreId 판매점 아이디
* @return SaleStoreResponse 판매점 상세 정보
* @throws Exception
*/
public SaleStoreResponse selectSaleStoreInfo(String saleStoreId) throws Exception { public SaleStoreResponse selectSaleStoreInfo(String saleStoreId) throws Exception {
return objectMapper.selectSaleStoreInfo(saleStoreId); return objectMapper.selectSaleStoreInfo(saleStoreId);
} }
/**
* 물건정보 목록 조회
*
* @param objectRequest 물건정보 검색어 정보
* @return List<ObjectResponse> 물건정보 목록
* @throws Exception
*/
public List<ObjectResponse> selectObjectList(ObjectRequest objectRequest) throws Exception { public List<ObjectResponse> selectObjectList(ObjectRequest objectRequest) throws Exception {
return objectMapper.selectObjectList(objectRequest); return objectMapper.selectObjectList(objectRequest);
} }
/**
* 물건정보 상세 조회
*
* @param objectNo 물건번호
* @return ObjectResponse 물건정보 상세
* @throws Exception
*/
public ObjectResponse selectObjectDetail(String objectNo) throws Exception { public ObjectResponse selectObjectDetail(String objectNo) throws Exception {
// object 상세 정보 조회 // object 상세 정보 조회
ObjectResponse objectResponse = objectMapper.selectObjectDetail(objectNo); ObjectResponse objectResponse = objectMapper.selectObjectDetail(objectNo);
@ -141,6 +199,13 @@ public class ObjectService {
return objectResponse; return objectResponse;
} }
/**
* 물건정보 저장
*
* @param objectRequest 물건정보
* @return ObjectResponse 물건정보 저장 결과
* @throws Exception
*/
public ObjectResponse insertObject(ObjectRequest objectRequest) throws Exception { public ObjectResponse insertObject(ObjectRequest objectRequest) throws Exception {
int result = 0; int result = 0;
String objectNo = ""; String objectNo = "";
@ -157,9 +222,12 @@ public class ObjectService {
message.getMessage("common.message.required.data", "Sale Store Level")); message.getMessage("common.message.required.data", "Sale Store Level"));
} }
objectRequest.setSourceOrigin("QCAST_III");
// 물건번호 등록/조회 // 물건번호 등록/조회
if ("0".equals(objectRequest.getTempFlg())) { if ("0".equals(objectRequest.getTempFlg())) {
objectRequest.setDelFlg("0"); objectRequest.setDelFlg("1");
objectRequest.setOrgDelFlg("0");
objectRequest.setTempFlg("0"); objectRequest.setTempFlg("0");
objectRequest.setTempDelFlg("0"); objectRequest.setTempDelFlg("0");
@ -167,6 +235,7 @@ public class ObjectService {
objectNo = objectMapper.selectObjectNo(objectRequest); objectNo = objectMapper.selectObjectNo(objectRequest);
} else if ("1".equals(objectRequest.getTempFlg())) { } else if ("1".equals(objectRequest.getTempFlg())) {
objectRequest.setDelFlg("1"); objectRequest.setDelFlg("1");
objectRequest.setOrgDelFlg("1");
objectRequest.setTempFlg("1"); objectRequest.setTempFlg("1");
objectRequest.setTempDelFlg("0"); objectRequest.setTempDelFlg("0");
@ -183,10 +252,7 @@ public class ObjectService {
// 물건정보 등록 // 물건정보 등록
objectRequest.setAddress( objectRequest.setAddress(
objectRequest.getPrefName() ((!StringUtils.isEmpty(objectRequest.getAddress())) ? objectRequest.getAddress() : ""));
+ ((!StringUtils.isEmpty(objectRequest.getAddress()))
? objectRequest.getAddress()
: ""));
objectRequest.setAddresseeCompanyName( objectRequest.setAddresseeCompanyName(
objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit()); objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit());
objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit()); objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit());
@ -243,6 +309,13 @@ public class ObjectService {
return objectResponse; return objectResponse;
} }
/**
* 물건정보 수정
*
* @param objectRequest 물건정보
* @return ObjectResponse 물건정보 수정 결과
* @throws Exception
*/
public ObjectResponse updateObject(ObjectRequest objectRequest) throws Exception { public ObjectResponse updateObject(ObjectRequest objectRequest) throws Exception {
int result = 0; int result = 0;
boolean tempChgFlg = false; boolean tempChgFlg = false;
@ -273,10 +346,7 @@ public class ObjectService {
// 물건정보 수정 // 물건정보 수정
objectRequest.setAddress( objectRequest.setAddress(
objectRequest.getPrefName() ((!StringUtils.isEmpty(objectRequest.getAddress())) ? objectRequest.getAddress() : ""));
+ ((!StringUtils.isEmpty(objectRequest.getAddress()))
? objectRequest.getAddress()
: ""));
objectRequest.setAddresseeCompanyName( objectRequest.setAddresseeCompanyName(
objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit()); objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit());
objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit()); objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit());
@ -327,6 +397,13 @@ public class ObjectService {
return objectResponse; return objectResponse;
} }
/**
* 물건정보 삭제
*
* @param objectRequest 물건정보
* @return int 결과
* @throws Exception
*/
public int deleteObject(ObjectRequest objectRequest) throws Exception { public int deleteObject(ObjectRequest objectRequest) throws Exception {
int result = 0; int result = 0;
@ -376,6 +453,13 @@ public class ObjectService {
return result; return result;
} }
/**
* 신규 플랜정보 추가
*
* @param planRequest 플랜정보
* @return String 추가 플랜번호
* @throws Exception
*/
public String insertPlan(PlanRequest planRequest) throws Exception { public String insertPlan(PlanRequest planRequest) throws Exception {
// Validation // Validation
if (StringUtils.isEmpty(planRequest.getObjectNo())) { if (StringUtils.isEmpty(planRequest.getObjectNo())) {
@ -404,6 +488,12 @@ public class ObjectService {
return planRequest.getPlanNo(); return planRequest.getPlanNo();
} }
/**
* 플랜정보 삭제
*
* @param planRequest 플랜정보
* @throws Exception
*/
public void deletePlan(PlanRequest planRequest) throws Exception { public void deletePlan(PlanRequest planRequest) throws Exception {
// Validation // Validation
if (StringUtils.isEmpty(planRequest.getObjectNo())) { if (StringUtils.isEmpty(planRequest.getObjectNo())) {
@ -428,6 +518,13 @@ public class ObjectService {
objectMapper.deletePlan(planRequest); objectMapper.deletePlan(planRequest);
} }
/**
* 설계의뢰 목록 조회
*
* @param planReqRequest 설계의뢰 요청 정보
* @return PlanReqResponse 설계의뢰 응답 정보
* @throws Exception
*/
public PlanReqResponse selectPlanReqList(PlanReqRequest planReqRequest) throws Exception { public PlanReqResponse selectPlanReqList(PlanReqRequest planReqRequest) throws Exception {
// Validation // Validation
@ -512,6 +609,14 @@ public class ObjectService {
return response; return response;
} }
/**
* 물건정보 첨부파일 다운로드
*
* @param request Request
* @param response Response
* @param uploadRequest 첨부파일 요청 정보
* @throws Exception
*/
public void fileDownload( public void fileDownload(
HttpServletRequest request, HttpServletResponse response, UploadRequest uploadRequest) HttpServletRequest request, HttpServletResponse response, UploadRequest uploadRequest)
throws Exception { throws Exception {

View File

@ -90,6 +90,9 @@ public class ObjectRequest {
@Schema(description = "컨텐츠 파일경로") @Schema(description = "컨텐츠 파일경로")
private String contentsPath; private String contentsPath;
@Schema(description = "소스 원본")
private String sourceOrigin;
@Schema(description = "임시저장여부") @Schema(description = "임시저장여부")
private String tempFlg; private String tempFlg;
@ -102,6 +105,9 @@ public class ObjectRequest {
@Schema(description = "삭제여부") @Schema(description = "삭제여부")
private String delFlg; private String delFlg;
@Schema(description = "원본 삭제여부")
private String orgDelFlg;
@Schema(description = "사용자아이디") @Schema(description = "사용자아이디")
private String userId; private String userId;

View File

@ -213,7 +213,8 @@
INNER JOIN SALES_STORE_CTE T INNER JOIN SALES_STORE_CTE T
ON S.SALE_STORE_ID = T.SALE_STORE_ID ON S.SALE_STORE_ID = T.SALE_STORE_ID
</if> </if>
WHERE (O.DEL_FLG = '0' OR (O.TEMP_FLG = '1' AND O.TEMP_DEL_FLG = '0')) WHERE O.SOURCE_ORIGIN = 'QCAST_III'
AND (O.ORG_DEL_FLG = '0' OR (O.TEMP_FLG = '1' AND O.TEMP_DEL_FLG = '0'))
<if test='schObjectNo != null and schObjectNo != ""'> <if test='schObjectNo != null and schObjectNo != ""'>
AND O.OBJECT_NO LIKE '%' + #{schObjectNo} + '%' AND O.OBJECT_NO LIKE '%' + #{schObjectNo} + '%'
</if> </if>
@ -316,7 +317,8 @@
LEFT OUTER JOIN M_PREFECTURE_AREA PA LEFT OUTER JOIN M_PREFECTURE_AREA PA
ON O.AREA_ID = PA.AREA_ID ON O.AREA_ID = PA.AREA_ID
WHERE O.OBJECT_NO = #{objectNo} WHERE O.OBJECT_NO = #{objectNo}
AND (O.DEL_FLG = '0' OR (O.TEMP_FLG = '1' AND O.TEMP_DEL_FLG = '0')) AND O.SOURCE_ORIGIN = 'QCAST_III'
AND (O.ORG_DEL_FLG = '0' OR (O.TEMP_FLG = '1' AND O.TEMP_DEL_FLG = '0'))
</select> </select>
<select id="selectObjectNo" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest" resultType="String"> <select id="selectObjectNo" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest" resultType="String">
@ -442,8 +444,10 @@
, CON_TYPE , CON_TYPE
, COLD_REGION_FLG , COLD_REGION_FLG
, SALT_AREA_FLG , SALT_AREA_FLG
, SOURCE_ORIGIN
, TEMP_FLG , TEMP_FLG
, TEMP_DEL_FLG , TEMP_DEL_FLG
, ORG_DEL_FLG
) VALUES ( ) VALUES (
#{objectNo} #{objectNo}
, #{saleStoreId} , #{saleStoreId}
@ -486,8 +490,10 @@
, #{conType} , #{conType}
, #{coldRegionFlg} , #{coldRegionFlg}
, #{saltAreaFlg} , #{saltAreaFlg}
, 'QCAST_III'
, #{tempFlg} , #{tempFlg}
, #{tempDelFlg} , #{tempDelFlg}
, #{orgDelFlg}
) )
</insert> </insert>
@ -734,9 +740,9 @@
UPDATE T_OBJECT UPDATE T_OBJECT
SET SET
OBJECT_NO = #{newObjectNo} OBJECT_NO = #{newObjectNo}
, DEL_FLG = '0'
, TEMP_FLG = '0' , TEMP_FLG = '0'
, TEMP_DEL_FLG = '0' , TEMP_DEL_FLG = '0'
, ORG_DEL_FLG = '0'
WHERE OBJECT_NO = #{objectNo} WHERE OBJECT_NO = #{objectNo}
</update> </update>