Compare commits

..

No commits in common. "b230529537fffc144d1dcb9836f35e25d386ebcc" and "7211101ac52aa4ca2978125257b4be424cfab995" have entirely different histories.

24 changed files with 68 additions and 235 deletions

View File

@ -4,7 +4,6 @@ import com.interplug.qcast.biz.estimate.EstimateService;
import com.interplug.qcast.biz.estimate.dto.EstimateSyncResponse; import com.interplug.qcast.biz.estimate.dto.EstimateSyncResponse;
import com.interplug.qcast.biz.estimate.dto.PlanSyncResponse; import com.interplug.qcast.biz.estimate.dto.PlanSyncResponse;
import com.interplug.qcast.util.InterfaceQsp; import com.interplug.qcast.util.InterfaceQsp;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.springframework.batch.core.Job; import org.springframework.batch.core.Job;
@ -78,8 +77,7 @@ public class EstimateSyncConfiguration implements JobExecutionListener {
@Bean @Bean
public ItemWriter<PlanSyncResponse> estimateSyncWriter() { public ItemWriter<PlanSyncResponse> estimateSyncWriter() {
return items -> { return items -> {
List<PlanSyncResponse> planList = new ArrayList<>(items.getItems()); estimateService.setEstimateSyncSave((List<PlanSyncResponse>) items.getItems());
estimateService.setEstimateSyncSave(planList);
}; };
} }
} }

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.interplug.qcast.biz.estimate.EstimateService; import com.interplug.qcast.biz.estimate.EstimateService;
import com.interplug.qcast.biz.estimate.dto.PlanSyncResponse; import com.interplug.qcast.biz.estimate.dto.PlanSyncResponse;
import com.interplug.qcast.util.InterfaceQsp; import com.interplug.qcast.util.InterfaceQsp;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.springframework.batch.core.Job; import org.springframework.batch.core.Job;
@ -75,7 +74,7 @@ public class PlanConfrimConfiguration implements JobExecutionListener {
@Bean @Bean
public ItemWriter<PlanSyncResponse> planConfirmWriter() { public ItemWriter<PlanSyncResponse> planConfirmWriter() {
return items -> { return items -> {
estimateService.setPlanConfirmSyncSave(new ArrayList<>(items.getItems())); estimateService.setPlanConfirmSyncSave((List<PlanSyncResponse>) items.getItems());
}; };
} }
} }

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.interplug.qcast.biz.displayItem.DisplayItemService; import com.interplug.qcast.biz.displayItem.DisplayItemService;
import com.interplug.qcast.biz.displayItem.dto.BomSyncResponse; import com.interplug.qcast.biz.displayItem.dto.BomSyncResponse;
import com.interplug.qcast.util.InterfaceQsp; import com.interplug.qcast.util.InterfaceQsp;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.springframework.batch.core.Job; import org.springframework.batch.core.Job;
@ -75,7 +74,7 @@ public class BomConfiguration implements JobExecutionListener {
@Bean @Bean
public ItemWriter<BomSyncResponse> bomWriter() { public ItemWriter<BomSyncResponse> bomWriter() {
return items -> { return items -> {
displayItemService.setBomSyncSave(new ArrayList<>(items.getItems())); displayItemService.setBomSyncSave((List<BomSyncResponse>) items.getItems());
}; };
} }
} }

View File

@ -103,7 +103,7 @@ public class MaterialConfiguration implements JobExecutionListener {
@Bean @Bean
public ItemWriter<ItemSyncResponse> materialWriter() { public ItemWriter<ItemSyncResponse> materialWriter() {
return items -> { return items -> {
displayItemService.setItemSyncSave(new ArrayList<>(items.getItems())); displayItemService.setItemSyncSave((List<ItemSyncResponse>) items.getItems());
}; };
} }
} }

View File

@ -4,7 +4,6 @@ import com.interplug.qcast.biz.displayItem.DisplayItemService;
import com.interplug.qcast.biz.displayItem.dto.PriceItemSyncResponse; import com.interplug.qcast.biz.displayItem.dto.PriceItemSyncResponse;
import com.interplug.qcast.biz.displayItem.dto.PriceSyncResponse; import com.interplug.qcast.biz.displayItem.dto.PriceSyncResponse;
import com.interplug.qcast.util.InterfaceQsp; import com.interplug.qcast.util.InterfaceQsp;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.function.Consumer; import java.util.function.Consumer;
@ -142,7 +141,7 @@ public class PriceJobConfiguration implements JobExecutionListener {
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) { private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
return items -> { return items -> {
try { try {
List<T> itemList = new ArrayList<>(items.getItems()); List<T> itemList = (List<T>) items.getItems();
processor.accept(itemList); processor.accept(itemList);
log.info("{}Writer: {} items 처리 완료", writerName, items.size()); log.info("{}Writer: {} items 처리 완료", writerName, items.size());
} catch (Exception e) { } catch (Exception e) {

View File

@ -5,7 +5,6 @@ import com.interplug.qcast.biz.specialNote.dto.SpecialNoteItemRequest;
import com.interplug.qcast.biz.specialNote.dto.SpecialNoteRequest; import com.interplug.qcast.biz.specialNote.dto.SpecialNoteRequest;
import com.interplug.qcast.biz.specialNote.dto.SpecialNoteSyncResponse; import com.interplug.qcast.biz.specialNote.dto.SpecialNoteSyncResponse;
import com.interplug.qcast.util.InterfaceQsp; import com.interplug.qcast.util.InterfaceQsp;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.function.Consumer; import java.util.function.Consumer;
@ -158,7 +157,7 @@ public class SpecialNoteDispItemJobConfiguration implements JobExecutionListener
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) { private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
return items -> { return items -> {
try { try {
List<T> itemList = new ArrayList<>(items.getItems()); List<T> itemList = (List<T>) items.getItems();
processor.accept(itemList); processor.accept(itemList);
log.info("{}Writer: {} items 처리 완료", writerName, items.size()); log.info("{}Writer: {} items 처리 완료", writerName, items.size());
} catch (Exception e) { } catch (Exception e) {

View File

@ -10,7 +10,6 @@ import com.interplug.qcast.biz.user.dto.StoreSyncResponse;
import com.interplug.qcast.biz.user.dto.StoreSyncResquest; import com.interplug.qcast.biz.user.dto.StoreSyncResquest;
import com.interplug.qcast.biz.user.dto.UserRequest; import com.interplug.qcast.biz.user.dto.UserRequest;
import com.interplug.qcast.util.InterfaceQsp; import com.interplug.qcast.util.InterfaceQsp;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.function.Consumer; import java.util.function.Consumer;
@ -213,7 +212,7 @@ public class StoreJobConfiguration implements JobExecutionListener {
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) { private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
return items -> { return items -> {
try { try {
List<T> itemList = new ArrayList<>(items.getItems()); List<T> itemList = (List<T>) items.getItems();
processor.accept(itemList); processor.accept(itemList);
log.info("{}Writer: {} items 처리 완료", writerName, items.size()); log.info("{}Writer: {} items 처리 완료", writerName, items.size());
} catch (Exception e) { } catch (Exception e) {

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.interplug.qcast.biz.user.UserService; import com.interplug.qcast.biz.user.UserService;
import com.interplug.qcast.biz.user.dto.AdminUserSyncResponse; import com.interplug.qcast.biz.user.dto.AdminUserSyncResponse;
import com.interplug.qcast.util.InterfaceQsp; import com.interplug.qcast.util.InterfaceQsp;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.springframework.batch.core.Job; import org.springframework.batch.core.Job;
@ -83,7 +82,7 @@ public class AdminUserConfiguration implements JobExecutionListener {
@Bean @Bean
public ItemWriter<AdminUserSyncResponse> adminUserWriter() { public ItemWriter<AdminUserSyncResponse> adminUserWriter() {
return items -> { return items -> {
userService.setAdminUserSyncSave(new ArrayList<>(items.getItems())); userService.setAdminUserSyncSave((List<AdminUserSyncResponse>) items.getItems());
}; };
} }
} }

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.interplug.qcast.biz.user.UserService; import com.interplug.qcast.biz.user.UserService;
import com.interplug.qcast.biz.user.dto.BusinessChargerSyncResponse; import com.interplug.qcast.biz.user.dto.BusinessChargerSyncResponse;
import com.interplug.qcast.util.InterfaceQsp; import com.interplug.qcast.util.InterfaceQsp;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.springframework.batch.core.Job; import org.springframework.batch.core.Job;
@ -79,7 +78,7 @@ public class BusinessChargerConfiguration implements JobExecutionListener {
@Bean @Bean
public ItemWriter<BusinessChargerSyncResponse> businessChargerWriter() { public ItemWriter<BusinessChargerSyncResponse> businessChargerWriter() {
return items -> { return items -> {
userService.setBusinessChargerSyncSave(new ArrayList<>(items.getItems())); userService.setBusinessChargerSyncSave((List<BusinessChargerSyncResponse>) items.getItems());
}; };
} }
} }

View File

@ -1,6 +1,5 @@
package com.interplug.qcast.batch.system; package com.interplug.qcast.batch.system;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.function.Consumer; import java.util.function.Consumer;
@ -127,7 +126,7 @@ public class CommonCodeConfiguration implements JobExecutionListener {
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) { private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
return items -> { return items -> {
try { try {
List<T> itemList = new ArrayList<>(items.getItems()); List<T> itemList = (List<T>) items.getItems();
processor.accept(itemList); processor.accept(itemList);
log.info("{}Writer: {} items 처리 완료", writerName, items.size()); log.info("{}Writer: {} items 처리 완료", writerName, items.size());
} catch (Exception e) { } catch (Exception e) {

View File

@ -19,8 +19,8 @@ import java.util.stream.Collectors;
import com.interplug.qcast.biz.canvaspopupstatus.CanvasPopupStatusService; import com.interplug.qcast.biz.canvaspopupstatus.CanvasPopupStatusService;
import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus; import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus;
import com.interplug.qcast.biz.estimate.dto.*; import com.interplug.qcast.biz.estimate.dto.*;
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRoofResponse; import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRoofResponse;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
@ -32,6 +32,7 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element; import org.jsoup.nodes.Element;
import org.jxls.util.Util;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
@ -325,16 +326,6 @@ public class EstimateService {
List<ItemRequest> itemList = estimateRequest.getItemList(); List<ItemRequest> itemList = estimateRequest.getItemList();
if (itemList == null || itemList.isEmpty()) { if (itemList == null || itemList.isEmpty()) {
try {
Map<String, String> errReq = new HashMap<>();
errReq.put("objectNo", estimateRequest.getObjectNo());
errReq.put("planNo", estimateRequest.getPlanNo());
errReq.put("rejectRsn", "itemList is empty");
errReq.put("regId", estimateRequest.getUserId());
interfaceQsp.callApi(HttpMethod.POST, QSP_API_URL + "/api/master/quotationErrSave", errReq);
} catch (Exception e) {
log.warn("quotationErrSave failed: {}", e.getMessage());
}
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "itemList")); message.getMessage("common.message.required.data", "itemList"));
} }
@ -1412,9 +1403,9 @@ public class EstimateService {
String classTypeName = ""; String classTypeName = "";
if ("0".equals(roofVol.getClassType())) { if ("0".equals(roofVol.getClassType())) {
classTypeName = new BigDecimal(StringUtils.defaultString(roofVol.getSlope(), "0")).stripTrailingZeros().toPlainString() + ""; classTypeName = roofVol.getSlope() + "";
} else { } else {
classTypeName = new BigDecimal(StringUtils.defaultString(roofVol.getAngle(), "0")).stripTrailingZeros().toPlainString() + "º"; classTypeName = roofVol.getAngle() + "º";
} }
roofVol.setClassTypeName(classTypeName); roofVol.setClassTypeName(classTypeName);
@ -1424,15 +1415,6 @@ public class EstimateService {
roofInfoResponse.setModuleTotAmount(String.valueOf(moduleTotAmount)); roofInfoResponse.setModuleTotAmount(String.valueOf(moduleTotAmount));
roofInfoResponse.setModuleTotVolKw(String.valueOf(moduleTotVolKw)); roofInfoResponse.setModuleTotVolKw(String.valueOf(moduleTotVolKw));
for (RoofResponse roof : roofList) {
String roofClassTypeName = "";
if ("0".equals(roof.getClassType())) {
roofClassTypeName = new BigDecimal(StringUtils.defaultString(roof.getSlope(), "0")).stripTrailingZeros().toPlainString() + "";
} else {
roofClassTypeName = new BigDecimal(StringUtils.defaultString(roof.getAngle(), "0")).stripTrailingZeros().toPlainString() + "º";
}
roof.setClassTypeName(roofClassTypeName);
}
roofInfoResponse.setRoofList(roofList); roofInfoResponse.setRoofList(roofList);
roofInfoResponse.setCircuitItemList(circuitItemList); roofInfoResponse.setCircuitItemList(circuitItemList);
roofInfoResponse.setRoofVolList(roofVolList); roofInfoResponse.setRoofVolList(roofVolList);
@ -1463,7 +1445,7 @@ public class EstimateService {
InputStream imageInputStream = getClass().getResourceAsStream(imagePath); InputStream imageInputStream = getClass().getResourceAsStream(imagePath);
if (imageInputStream != null) { if (imageInputStream != null) {
byte[] degImg = imageInputStream.readAllBytes(); byte[] degImg = Util.toByteArray(imageInputStream);
roofInfoResponse.setCompasDegImg(degImg); roofInfoResponse.setCompasDegImg(degImg);
imageInputStream.close(); imageInputStream.close();
} else { } else {
@ -2006,7 +1988,7 @@ public class EstimateService {
if ("YJSS".equals(estimateType)) { if ("YJSS".equals(estimateType)) {
pkgTotPrice = pkgAsp.multiply(totVol); pkgTotPrice = pkgAsp.multiply(totVol);
pkgTotPrice = pkgTotPrice.setScale(0, RoundingMode.HALF_UP); pkgTotPrice = pkgTotPrice.setScale(0, BigDecimal.ROUND_HALF_UP);
supplyPrice = supplyPrice.add(pkgTotPrice); supplyPrice = supplyPrice.add(pkgTotPrice);
} }
@ -2016,14 +1998,14 @@ public class EstimateService {
totPrice = totPrice.add(supplyPrice.add(vatPrice)); totPrice = totPrice.add(supplyPrice.add(vatPrice));
estimateResponse.setPkgTotPrice(String.valueOf(pkgTotPrice)); estimateResponse.setPkgTotPrice(String.valueOf(pkgTotPrice));
estimateResponse.setTotAmount(String.valueOf(totAmount.setScale(0, RoundingMode.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(String
.valueOf(totVol.multiply(new BigDecimal("0.001")).setScale(3, RoundingMode.FLOOR))); .valueOf(totVol.multiply(new BigDecimal("0.001")).setScale(3, BigDecimal.ROUND_FLOOR)));
estimateResponse estimateResponse
.setSupplyPrice(String.valueOf(supplyPrice.setScale(0, RoundingMode.HALF_UP))); .setSupplyPrice(String.valueOf(supplyPrice.setScale(0, BigDecimal.ROUND_HALF_UP)));
estimateResponse.setVatPrice(String.valueOf(vatPrice.setScale(0, RoundingMode.HALF_UP))); estimateResponse.setVatPrice(String.valueOf(vatPrice.setScale(0, BigDecimal.ROUND_HALF_UP)));
estimateResponse.setTotPrice(String.valueOf(totPrice.setScale(0, RoundingMode.HALF_UP))); estimateResponse.setTotPrice(String.valueOf(totPrice.setScale(0, BigDecimal.ROUND_HALF_UP)));
} }
private static final Set<String> EXCEL_ITEM_NUMBER_FIELDS = new HashSet<>( private static final Set<String> EXCEL_ITEM_NUMBER_FIELDS = new HashSet<>(
@ -2333,11 +2315,9 @@ public class EstimateService {
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
response = om.readValue(strResponse, EstimateApiResponse.class); response = om.readValue(strResponse, EstimateApiResponse.class);
@SuppressWarnings("unchecked")
Map<String, Object> result = (Map<String, Object>) response.getData(); Map<String, Object> result = (Map<String, Object>) response.getData();
if (result != null) { if (result != null) {
@SuppressWarnings("unchecked")
List<Map<String, Object>> succList = List<Map<String, Object>> succList =
(List<Map<String, Object>>) result.get("successList"); (List<Map<String, Object>>) result.get("successList");
for (Map<String, Object> succ : succList) { for (Map<String, Object> succ : succList) {
@ -2606,7 +2586,7 @@ public class EstimateService {
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("<td style='text-align:left;'>"
+ StringUtils.defaultString(roofResponse.getRoofMaterialName()) + "</td>"); + StringUtils.defaultString(roofResponse.getRoofMaterialName()) + "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getClassTypeName()) + "</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getSlope()) + "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getConstructSpecificationName()) sb.append("<td>" + StringUtils.defaultString(roofResponse.getConstructSpecificationName())
+ "</td>"); + "</td>");
sb.append("<td style='text-align:left;'>" sb.append("<td style='text-align:left;'>"
@ -2686,7 +2666,7 @@ public class EstimateService {
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("<td style='text-align:left;'>"
+ StringUtils.defaultString(roofResponse.getRoofMaterialName()) + "</td>"); + StringUtils.defaultString(roofResponse.getRoofMaterialName()) + "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getClassTypeName()) + "</td>"); sb.append("<td>" + StringUtils.defaultString(roofResponse.getSlope()) + "</td>");
sb.append("<td>" + StringUtils.defaultString(roofResponse.getConstructSpecificationName()) sb.append("<td>" + StringUtils.defaultString(roofResponse.getConstructSpecificationName())
+ "</td>"); + "</td>");
sb.append("<td style='text-align:left;'>" sb.append("<td style='text-align:left;'>"
@ -3012,7 +2992,7 @@ public class EstimateService {
} }
} }
try (InputStream imageInputStream = connection.getInputStream()) { try (InputStream imageInputStream = connection.getInputStream()) {
return imageInputStream.readAllBytes(); return Util.toByteArray(imageInputStream);
} }
} catch (Exception e) { } catch (Exception e) {
log.warn("Failed to load drawing image. url={}", url, e); log.warn("Failed to load drawing image. url={}", url, e);

View File

@ -59,34 +59,6 @@ public class LoginController {
return loginService.getLogin(loginUser); return loginService.getLogin(loginUser);
} }
/**
* Q.CAST III에 자동 로그인하여 사용자 정보를 획득한다.
*
* @param loginUser LoginUser
* @return UserLoginResponse
* @throws Exception
*/
@Operation(description = "Q.CAST III에 자동 로그인하여 사용자 정보를 획득한다.")
@PostMapping("/v1.0/autoLogin")
@ResponseStatus(HttpStatus.CREATED)
public UserLoginResponse autoLogin(@RequestBody LoginUser loginUser) throws Exception {
return loginService.getAutoLogin(loginUser);
}
/**
* Q.CAST III에서 로그아웃한다.
*
* @param loginUser LoginUser
* @return DefaultResponse
* @throws Exception
*/
@Operation(description = "Q.CAST III에서 로그아웃한다.")
@PostMapping("/v1.0/logout")
@ResponseStatus(HttpStatus.CREATED)
public DefaultResponse logout(@RequestBody LoginUser loginUser) throws Exception {
return loginService.getLogout(loginUser);
}
@PostMapping("/v1.0/user") @PostMapping("/v1.0/user")
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
public UserResponse getUser(@RequestBody LoginUser loginUser) { public UserResponse getUser(@RequestBody LoginUser loginUser) {

View File

@ -50,31 +50,6 @@ public class LoginService {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Password")); message.getMessage("common.message.required.data", "Password"));
return callLoginApi(loginUser, "LOGIN");
}
/**
* 자동 로그인 처리
*
* @param loginUser LoginUser
* @return UserLoginResponse
* @throws Exception
*/
public UserLoginResponse getAutoLogin(LoginUser loginUser) throws Exception {
if (loginUser.getLoginId() == null || "".equals(loginUser.getLoginId()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Login Id"));
return callLoginApi(loginUser, "AUTO_LOGIN");
}
private UserLoginResponse callLoginApi(LoginUser loginUser, String actLog) throws Exception {
loginUser.setAccsSiteCd("DESIGN");
loginUser.setActLog(actLog);
String sessionId = UUID.randomUUID().toString();
loginUser.setRequestId(sessionId);
UserLoginResponse userLoginResponse = null; UserLoginResponse userLoginResponse = null;
// QSP API Call.. // QSP API Call..
@ -92,43 +67,12 @@ public class LoginService {
if (userLoginResponse != null if (userLoginResponse != null
&& userLoginResponse.getResult() != null && userLoginResponse.getResult() != null
&& "S".equalsIgnoreCase(userLoginResponse.getResult().getResultCode())) { && "S".equalsIgnoreCase(userLoginResponse.getResult().getResultCode())) {
userLoginResponse.setSessionId(sessionId); userLoginResponse.setSessionId(UUID.randomUUID().toString());
} }
return userLoginResponse; return userLoginResponse;
} }
/**
* 로그아웃 처리
*
* @param loginUser LoginUser
* @return DefaultResponse
* @throws Exception
*/
public DefaultResponse getLogout(LoginUser loginUser) throws Exception {
if (loginUser.getLoginId() == null || "".equals(loginUser.getLoginId()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Login Id"));
loginUser.setAccsSiteCd("DESIGN");
loginUser.setActLog("LOGOUT");
// QSP API Call..
// Q.CAST 로그아웃
// post
// /api/user/logout
DefaultResponse defaultResponse = null;
String strResponse =
interfaceQsp.callApi(HttpMethod.POST, qspUrl + "/api/user/logout", loginUser);
if (!"".equals(strResponse)) {
ObjectMapper om =
new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
defaultResponse = om.readValue(strResponse, DefaultResponse.class);
}
return defaultResponse;
}
public UserResponse getUser(LoginUser loginUser) { public UserResponse getUser(LoginUser loginUser) {
return loginMapper.getUser(loginUser); return loginMapper.getUser(loginUser);
} }

View File

@ -6,7 +6,4 @@ import lombok.Data;
public class LoginUser { public class LoginUser {
private String loginId; // Login Id private String loginId; // Login Id
private String pwd; // Password private String pwd; // Password
private String accsSiteCd; // Access Site Code (QSP, QORDER, QMUSUBI_DESIGN, QREAD, QWARRANTY, QPARTNERS)
private String actLog; // Action Log (LOGIN, AUTO_LOGIN, LOGOUT)
private String requestId; // Request ID <= Unique ID
} }

View File

@ -28,6 +28,4 @@ public class UserResponse {
private String custNm; private String custNm;
//시공사 번호 //시공사 번호
private String builderNo; private String builderNo;
private String builderNm; // Builder Name
private String builderId; // Builder Id
} }

View File

@ -63,13 +63,6 @@ public class ObjectController {
return objectService.selectSaleStoreList(saleStoreId, firstFlg, userId); return objectService.selectSaleStoreList(saleStoreId, firstFlg, userId);
} }
@Operation(description = "1차점 ID 및 판매점명을 조회한다. (saleStoreLevel=2 인 경우)")
@GetMapping("/saleStore/{saleStoreId}/firstAgent")
@ResponseStatus(HttpStatus.OK)
public SaleStoreResponse selectFirstAgentInfo(@PathVariable String saleStoreId) throws Exception {
return objectService.selectFirstAgentInfo(saleStoreId);
}
@Operation(description = "물건정보 목록을 조회한다.") @Operation(description = "물건정보 목록을 조회한다.")
@GetMapping("/list") @GetMapping("/list")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)

View File

@ -25,9 +25,6 @@ public interface ObjectMapper {
// 판매점 정보 조회 // 판매점 정보 조회
public SaleStoreResponse selectSaleStoreInfo(String saleStoreId); public SaleStoreResponse selectSaleStoreInfo(String saleStoreId);
// 1차점 ID/ 조회 (saleStoreLevel = '2' 경우)
public SaleStoreResponse selectFirstAgentInfo(String saleStoreId);
// 물건정보 메인 목록 조회 // 물건정보 메인 목록 조회
public List<ObjectResponse> selectObjectMainList(ObjectRequest objectRequest); public List<ObjectResponse> selectObjectMainList(ObjectRequest objectRequest);

View File

@ -166,14 +166,6 @@ public class ObjectService {
return objectMapper.selectSaleStoreInfo(saleStoreId); return objectMapper.selectSaleStoreInfo(saleStoreId);
} }
public SaleStoreResponse selectFirstAgentInfo(String saleStoreId) throws Exception {
SaleStoreResponse result = objectMapper.selectFirstAgentInfo(saleStoreId);
if (result == null) {
throw new QcastException(ErrorCode.NOT_FOUND, message.getMessage("common.message.no.data"));
}
return result;
}
/** /**
* 물건정보 메인 목록 조회 * 물건정보 메인 목록 조회
* *
@ -349,11 +341,8 @@ public class ObjectService {
// 물건정보 등록 // 물건정보 등록
objectRequest.setAddress( objectRequest.setAddress(
((!StringUtils.isEmpty(objectRequest.getAddress())) ? objectRequest.getAddress() : "")); ((!StringUtils.isEmpty(objectRequest.getAddress())) ? objectRequest.getAddress() : ""));
String addresseeCompanyName = objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit(); objectRequest.setAddresseeCompanyName(
if (addresseeCompanyName.length() > 50) { objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit());
addresseeCompanyName = addresseeCompanyName.substring(0, 50);
}
objectRequest.setAddresseeCompanyName(addresseeCompanyName);
objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit()); objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit());
objectRequest.setContentsPath(baseDirPath + "\\\\" + objectRequest.getObjectNo()); objectRequest.setContentsPath(baseDirPath + "\\\\" + objectRequest.getObjectNo());
result += objectMapper.insertObject(objectRequest); result += objectMapper.insertObject(objectRequest);
@ -389,7 +378,6 @@ public class ObjectService {
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
response = om.readValue(strResponse, PlanReqResponse.class); response = om.readValue(strResponse, PlanReqResponse.class);
@SuppressWarnings("unchecked")
Map<String, Object> map = (Map<String, Object>) response.getResult(); Map<String, Object> map = (Map<String, Object>) response.getResult();
if ("E".equals(String.valueOf(map.get("resultCode")))) { if ("E".equals(String.valueOf(map.get("resultCode")))) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR,
@ -444,11 +432,8 @@ public class ObjectService {
// 물건정보 수정 // 물건정보 수정
objectRequest.setAddress( objectRequest.setAddress(
((!StringUtils.isEmpty(objectRequest.getAddress())) ? objectRequest.getAddress() : "")); ((!StringUtils.isEmpty(objectRequest.getAddress())) ? objectRequest.getAddress() : ""));
String addresseeCompanyName2 = objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit(); objectRequest.setAddresseeCompanyName(
if (addresseeCompanyName2.length() > 50) { objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit());
addresseeCompanyName2 = addresseeCompanyName2.substring(0, 50);
}
objectRequest.setAddresseeCompanyName(addresseeCompanyName2);
objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit()); objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit());
objectRequest.setContentsPath(baseDirPath + "\\\\" objectRequest.setContentsPath(baseDirPath + "\\\\"
+ (tempChgFlg ? objectRequest.getNewObjectNo() : objectRequest.getObjectNo())); + (tempChgFlg ? objectRequest.getNewObjectNo() : objectRequest.getObjectNo()));
@ -479,7 +464,6 @@ public class ObjectService {
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
response = om.readValue(strResponse, PlanReqResponse.class); response = om.readValue(strResponse, PlanReqResponse.class);
@SuppressWarnings("unchecked")
Map<String, Object> map = (Map<String, Object>) response.getResult(); Map<String, Object> map = (Map<String, Object>) response.getResult();
if ("E".equals(String.valueOf(map.get("resultCode")))) { if ("E".equals(String.valueOf(map.get("resultCode")))) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR,
@ -561,7 +545,6 @@ public class ObjectService {
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
response = om.readValue(strResponse, PlanReqResponse.class); response = om.readValue(strResponse, PlanReqResponse.class);
@SuppressWarnings("unchecked")
Map<String, Object> map = (Map<String, Object>) response.getResult(); Map<String, Object> map = (Map<String, Object>) response.getResult();
if ("E".equals(String.valueOf(map.get("resultCode")))) { if ("E".equals(String.valueOf(map.get("resultCode")))) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR,

View File

@ -24,9 +24,6 @@ public class SaleStoreResponse {
@Schema(description = "1차점판매점ID") @Schema(description = "1차점판매점ID")
private String firstAgentId; private String firstAgentId;
@Schema(description = "1차점판매점명")
private String firstAgentName;
@Schema(description = "영업사원명") @Schema(description = "영업사원명")
private String businessCharger; private String businessCharger;

View File

@ -3,7 +3,7 @@ package com.interplug.qcast.config.json;
import com.fasterxml.jackson.core.SerializableString; import com.fasterxml.jackson.core.SerializableString;
import com.fasterxml.jackson.core.io.CharacterEscapes; import com.fasterxml.jackson.core.io.CharacterEscapes;
import com.fasterxml.jackson.core.io.SerializedString; import com.fasterxml.jackson.core.io.SerializedString;
import org.springframework.web.util.HtmlUtils; import org.apache.commons.lang3.StringEscapeUtils;
/** /**
* <pre> * <pre>
@ -50,7 +50,7 @@ public class HtmlCharacterEscapes extends CharacterEscapes {
sb.append(String.format("%04x", ch)); sb.append(String.format("%04x", ch));
serializedString = new SerializedString(sb.toString()); serializedString = new SerializedString(sb.toString());
} else { } else {
serializedString = new SerializedString(HtmlUtils.htmlEscape(Character.toString(charAt))); serializedString = new SerializedString(StringEscapeUtils.escapeHtml4(Character.toString(charAt)));
} }
return serializedString; return serializedString;

View File

@ -53,7 +53,6 @@ public class InterfaceQsp {
// GET 요청 requestObject를 쿼리 스트링으로 변환 // GET 요청 requestObject를 쿼리 스트링으로 변환
if (HttpMethod.GET.equals(httpMethod) && requestObject != null) { if (HttpMethod.GET.equals(httpMethod) && requestObject != null) {
ObjectMapper om = new ObjectMapper(); ObjectMapper om = new ObjectMapper();
@SuppressWarnings("unchecked")
Map<String, Object> params = om.convertValue(requestObject, Map.class); // Object -> Map 변환 Map<String, Object> params = om.convertValue(requestObject, Map.class); // Object -> Map 변환
String queryString = String queryString =
params.entrySet().stream() params.entrySet().stream()
@ -160,17 +159,11 @@ public class InterfaceQsp {
} }
} }
if (responseObject == null) { if (responseObject == null) {
@SuppressWarnings("unchecked") return (T) dataJson;
T result = (T) dataJson;
return result;
} else if (responseObject instanceof Class<?>) { } else if (responseObject instanceof Class<?>) {
@SuppressWarnings("unchecked") return om.readValue(dataJson, (Class<T>) responseObject);
Class<T> responseClass = (Class<T>) responseObject;
return om.readValue(dataJson, responseClass);
} else if (responseObject instanceof TypeReference<?>) { } else if (responseObject instanceof TypeReference<?>) {
@SuppressWarnings("unchecked") return om.readValue(dataJson, (TypeReference<T>) responseObject);
TypeReference<T> responseType = (TypeReference<T>) responseObject;
return om.readValue(dataJson, responseType);
} else { } else {
throw new IllegalArgumentException("Unsupported responseType"); throw new IllegalArgumentException("Unsupported responseType");
} }

View File

@ -140,17 +140,6 @@
WHERE A.SALE_STORE_ID = #{saleStoreId} WHERE A.SALE_STORE_ID = #{saleStoreId}
</select> </select>
<select id="selectFirstAgentInfo" parameterType="String" resultType="com.interplug.qcast.biz.object.dto.SaleStoreResponse">
/* sqlid : com.interplug.qcast.biz.object.selectFirstAgentInfo */
SELECT
A.FIRST_AGENT_ID
, (SELECT SALE_STORE_NAME FROM M_SALES_STORE WITH(NOLOCK) WHERE SALE_STORE_ID = A.FIRST_AGENT_ID AND APPROVE_FLG = '2' AND DEL_FLG = '0') AS FIRST_AGENT_NAME
FROM M_SALES_STORE A WITH(NOLOCK)
WHERE A.SALE_STORE_ID = #{saleStoreId}
AND A.SALE_STORE_LEVEL = '2'
AND A.DEL_FLG = '0'
</select>
<select id="selectObjectMainList" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest" resultType="com.interplug.qcast.biz.object.dto.ObjectResponse"> <select id="selectObjectMainList" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest" resultType="com.interplug.qcast.biz.object.dto.ObjectResponse">
/* sqlid : com.interplug.qcast.biz.object.selectObjectMainList */ /* sqlid : com.interplug.qcast.biz.object.selectObjectMainList */