dev #465
@ -1412,9 +1412,9 @@ public class EstimateService {
|
||||
|
||||
String classTypeName = "";
|
||||
if ("0".equals(roofVol.getClassType())) {
|
||||
classTypeName = roofVol.getSlope() + "寸";
|
||||
classTypeName = new BigDecimal(StringUtils.defaultString(roofVol.getSlope(), "0")).stripTrailingZeros().toPlainString() + "寸";
|
||||
} else {
|
||||
classTypeName = roofVol.getAngle() + "º";
|
||||
classTypeName = new BigDecimal(StringUtils.defaultString(roofVol.getAngle(), "0")).stripTrailingZeros().toPlainString() + "º";
|
||||
}
|
||||
roofVol.setClassTypeName(classTypeName);
|
||||
|
||||
@ -1424,6 +1424,15 @@ public class EstimateService {
|
||||
roofInfoResponse.setModuleTotAmount(String.valueOf(moduleTotAmount));
|
||||
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.setCircuitItemList(circuitItemList);
|
||||
roofInfoResponse.setRoofVolList(roofVolList);
|
||||
@ -2597,7 +2606,7 @@ public class EstimateService {
|
||||
sb.append("<td>" + StringUtils.defaultString(roofResponse.getRoofSurface()) + "</td>");
|
||||
sb.append("<td style='text-align:left;'>"
|
||||
+ StringUtils.defaultString(roofResponse.getRoofMaterialName()) + "</td>");
|
||||
sb.append("<td>" + StringUtils.defaultString(roofResponse.getSlope()) + "寸</td>");
|
||||
sb.append("<td>" + StringUtils.defaultString(roofResponse.getClassTypeName()) + "</td>");
|
||||
sb.append("<td>" + StringUtils.defaultString(roofResponse.getConstructSpecificationName())
|
||||
+ "</td>");
|
||||
sb.append("<td style='text-align:left;'>"
|
||||
@ -2677,7 +2686,7 @@ public class EstimateService {
|
||||
sb.append("<td>" + StringUtils.defaultString(roofResponse.getRoofSurface()) + "</td>");
|
||||
sb.append("<td style='text-align:left;'>"
|
||||
+ StringUtils.defaultString(roofResponse.getRoofMaterialName()) + "</td>");
|
||||
sb.append("<td>" + StringUtils.defaultString(roofResponse.getSlope()) + "寸</td>");
|
||||
sb.append("<td>" + StringUtils.defaultString(roofResponse.getClassTypeName()) + "</td>");
|
||||
sb.append("<td>" + StringUtils.defaultString(roofResponse.getConstructSpecificationName())
|
||||
+ "</td>");
|
||||
sb.append("<td style='text-align:left;'>"
|
||||
|
||||
@ -59,6 +59,34 @@ public class LoginController {
|
||||
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")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public UserResponse getUser(@RequestBody LoginUser loginUser) {
|
||||
|
||||
@ -1,24 +1,24 @@
|
||||
package com.interplug.qcast.biz.login;
|
||||
|
||||
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 com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.interplug.qcast.biz.login.dto.JoinUser;
|
||||
import com.interplug.qcast.biz.login.dto.LoginUser;
|
||||
import com.interplug.qcast.biz.login.dto.UserLoginResponse;
|
||||
import com.interplug.qcast.biz.login.dto.UserPassword;
|
||||
import com.interplug.qcast.biz.login.dto.UserResponse;
|
||||
import com.interplug.qcast.config.Exception.ErrorCode;
|
||||
import com.interplug.qcast.config.Exception.QcastException;
|
||||
import com.interplug.qcast.config.message.Messages;
|
||||
import com.interplug.qcast.util.DefaultResponse;
|
||||
import com.interplug.qcast.util.InterfaceQsp;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.interplug.qcast.biz.login.dto.JoinUser;
|
||||
import com.interplug.qcast.biz.login.dto.LoginUser;
|
||||
import com.interplug.qcast.biz.login.dto.UserLoginResponse;
|
||||
import com.interplug.qcast.biz.login.dto.UserPassword;
|
||||
import com.interplug.qcast.biz.login.dto.UserResponse;
|
||||
import com.interplug.qcast.config.Exception.ErrorCode;
|
||||
import com.interplug.qcast.config.Exception.QcastException;
|
||||
import com.interplug.qcast.config.message.Messages;
|
||||
import com.interplug.qcast.util.DefaultResponse;
|
||||
import com.interplug.qcast.util.InterfaceQsp;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@ -50,6 +50,31 @@ public class LoginService {
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
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;
|
||||
|
||||
// QSP API Call..
|
||||
@ -58,20 +83,51 @@ public class LoginService {
|
||||
// /api/user/login
|
||||
String strResponse =
|
||||
interfaceQsp.callApi(HttpMethod.POST, qspUrl + "/api/user/login", loginUser);
|
||||
if (!"".equals(strResponse)) {
|
||||
ObjectMapper om =
|
||||
new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
userLoginResponse = om.readValue(strResponse, UserLoginResponse.class);
|
||||
}
|
||||
|
||||
if (userLoginResponse != null
|
||||
&& userLoginResponse.getResult() != null
|
||||
&& "S".equalsIgnoreCase(userLoginResponse.getResult().getResultCode())) {
|
||||
userLoginResponse.setSessionId(UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
return userLoginResponse;
|
||||
}
|
||||
if (!"".equals(strResponse)) {
|
||||
ObjectMapper om =
|
||||
new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
userLoginResponse = om.readValue(strResponse, UserLoginResponse.class);
|
||||
}
|
||||
|
||||
if (userLoginResponse != null
|
||||
&& userLoginResponse.getResult() != null
|
||||
&& "S".equalsIgnoreCase(userLoginResponse.getResult().getResultCode())) {
|
||||
userLoginResponse.setSessionId(sessionId);
|
||||
}
|
||||
|
||||
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) {
|
||||
return loginMapper.getUser(loginUser);
|
||||
|
||||
@ -6,4 +6,7 @@ import lombok.Data;
|
||||
public class LoginUser {
|
||||
private String loginId; // Login Id
|
||||
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
|
||||
}
|
||||
|
||||
@ -28,4 +28,6 @@ public class UserResponse {
|
||||
private String custNm;
|
||||
//시공사 번호
|
||||
private String builderNo;
|
||||
private String builderNm; // Builder Name
|
||||
private String builderId; // Builder Id
|
||||
}
|
||||
|
||||
@ -349,8 +349,11 @@ public class ObjectService {
|
||||
// 물건정보 등록
|
||||
objectRequest.setAddress(
|
||||
((!StringUtils.isEmpty(objectRequest.getAddress())) ? objectRequest.getAddress() : ""));
|
||||
objectRequest.setAddresseeCompanyName(
|
||||
objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit());
|
||||
String addresseeCompanyName = objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit();
|
||||
if (addresseeCompanyName.length() > 50) {
|
||||
addresseeCompanyName = addresseeCompanyName.substring(0, 50);
|
||||
}
|
||||
objectRequest.setAddresseeCompanyName(addresseeCompanyName);
|
||||
objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit());
|
||||
objectRequest.setContentsPath(baseDirPath + "\\\\" + objectRequest.getObjectNo());
|
||||
result += objectMapper.insertObject(objectRequest);
|
||||
@ -441,8 +444,11 @@ public class ObjectService {
|
||||
// 물건정보 수정
|
||||
objectRequest.setAddress(
|
||||
((!StringUtils.isEmpty(objectRequest.getAddress())) ? objectRequest.getAddress() : ""));
|
||||
objectRequest.setAddresseeCompanyName(
|
||||
objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit());
|
||||
String addresseeCompanyName2 = objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit();
|
||||
if (addresseeCompanyName2.length() > 50) {
|
||||
addresseeCompanyName2 = addresseeCompanyName2.substring(0, 50);
|
||||
}
|
||||
objectRequest.setAddresseeCompanyName(addresseeCompanyName2);
|
||||
objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit());
|
||||
objectRequest.setContentsPath(baseDirPath + "\\\\"
|
||||
+ (tempChgFlg ? objectRequest.getNewObjectNo() : objectRequest.getObjectNo()));
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user