dev #29

Merged
ysCha merged 40 commits from dev into dev-deploy 2025-05-26 17:01:12 +09:00
13 changed files with 663 additions and 241 deletions

3
.gitignore vendored
View File

@ -35,4 +35,5 @@ build/
.vscode/
### logs ###
qcast3/
qcast3/
src/test

View File

@ -2,18 +2,15 @@ package com.interplug.qcast.biz.community;
import com.interplug.qcast.biz.community.dto.BoardRequest;
import com.interplug.qcast.biz.community.dto.BoardResponse;
import com.interplug.qcast.biz.file.dto.FileRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@Slf4j
@RestController
@ -38,6 +35,13 @@ public class BoardController {
return boardService.getBoardDetail(boardRequest);
}
@Operation(description = "문의를 저장한다.")
@PostMapping("/saveQna")
@ResponseStatus(HttpStatus.OK)
public BoardResponse getBoardQnaSave(BoardRequest boardRequest, HttpServletRequest request) throws Exception {
return boardService.getBoardQnaSave(boardRequest, request);
}
@Operation(description = "커뮤니티(공지사항, FAQ, 자료다운로드) 파일 다운로드를 진행한다.")
@GetMapping("/file/download")
@ResponseStatus(HttpStatus.OK)

View File

@ -4,24 +4,36 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.interplug.qcast.biz.community.dto.BoardRequest;
import com.interplug.qcast.biz.community.dto.BoardResponse;
import com.interplug.qcast.biz.estimate.dto.EstimateApiResponse;
import com.interplug.qcast.biz.file.dto.FileRequest;
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.InterfaceQsp;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.core.io.InputStreamResource;
import org.springframework.http.*;
import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.StreamUtils;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.util.UriComponentsBuilder;
@Slf4j
@ -66,18 +78,39 @@ public class BoardService {
encodedSchTitle = URLEncoder.encode(boardRequest.getSchTitle(), StandardCharsets.UTF_8);
}
String url = QSP_API_URL + "/api/board/list";
String apiUrl =
UriComponentsBuilder.fromHttpUrl(url)
.queryParam("noticeNo", boardRequest.getNoticeNo())
.queryParam("schTitle", encodedSchTitle)
.queryParam("schNoticeTpCd", boardRequest.getSchNoticeTpCd())
.queryParam("schNoticeClsCd", boardRequest.getSchNoticeClsCd())
.queryParam("startRow", boardRequest.getStartRow())
.queryParam("endRow", boardRequest.getEndRow())
.queryParam("schMainYn", boardRequest.getSchMainYn())
.build()
.toUriString();
String url = null;
String apiUrl = null;
if("QNA".equals(boardRequest.getSchNoticeClsCd())) {
url = QSP_API_URL + "/api/qna/list";
apiUrl = UriComponentsBuilder.fromHttpUrl(url)
.queryParam("compCd", boardRequest.getCompCd())
.queryParam("storeId", boardRequest.getStoreId())
.queryParam("siteTpCd", boardRequest.getSiteTpCd())
.queryParam("schTitle", encodedSchTitle)
.queryParam("schRegId", boardRequest.getSchRegId())
.queryParam("schFromDt", boardRequest.getSchFromDt())
.queryParam("schToDt", boardRequest.getSchToDt())
.queryParam("startRow", boardRequest.getStartRow())
.queryParam("endRow", boardRequest.getEndRow())
.queryParam("loginId", boardRequest.getLoginId())
.queryParam("langCd", boardRequest.getLangCd())
.build()
.toUriString();
} else {
url = QSP_API_URL + "/api/board/list";
apiUrl = UriComponentsBuilder.fromHttpUrl(url)
.queryParam("noticeNo", boardRequest.getNoticeNo())
.queryParam("schTitle", encodedSchTitle)
.queryParam("schNoticeTpCd", boardRequest.getSchNoticeTpCd())
.queryParam("schNoticeClsCd", boardRequest.getSchNoticeClsCd())
.queryParam("startRow", boardRequest.getStartRow())
.queryParam("endRow", boardRequest.getEndRow())
.queryParam("schMainYn", boardRequest.getSchMainYn())
.build()
.toUriString();
}
/* [2]. QSP API CALL -> Response */
String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null);
@ -114,14 +147,26 @@ public class BoardService {
message.getMessage("common.message.required.data", "Notice No"));
}
/* [1]. QSP API (url + param) Setting */
String url = QSP_API_URL + "/api/board/detail";
String apiUrl =
UriComponentsBuilder.fromHttpUrl(url)
.queryParam("noticeNo", boardRequest.getNoticeNo())
.build()
.toUriString();
String url = null;
String apiUrl = null;
if("QNA".equals(boardRequest.getSchNoticeClsCd())) {
url = QSP_API_URL + "/api/qna/detail";
apiUrl = UriComponentsBuilder.fromHttpUrl(url)
.queryParam("qnaNo", boardRequest.getQnaNo())
.queryParam("compCd", boardRequest.getCompCd())
.queryParam("loginId", boardRequest.getLoginId())
.queryParam("langCd", boardRequest.getLangCd())
.build()
.toUriString();
} else {
/* [1]. QSP API (url + param) Setting */
url = QSP_API_URL + "/api/board/detail";
apiUrl = UriComponentsBuilder.fromHttpUrl(url)
.queryParam("noticeNo", boardRequest.getNoticeNo())
.build()
.toUriString();
}
/* [2]. QSP API CALL -> Response */
String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null);
@ -138,6 +183,138 @@ public class BoardService {
return response;
}
/**
* 게시판 저장 QSP -> Q.CAST3
*
* @param boardRequest
* @return
* @throws Exception
*/
public BoardResponse getBoardQnaSave(BoardRequest boardRequest, HttpServletRequest request) throws Exception {
BoardResponse response = null;
/* [0]. Validation Check */
if (boardRequest.getCompCd() == null || boardRequest.getCompCd().isEmpty()) {
// [msg] {0} is required input value.
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Comp Cd"));
}
if (boardRequest.getSiteTpCd() == null || boardRequest.getSiteTpCd().isEmpty()) {
// [msg] {0} is required input value.
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Site Type Cd"));
}
if (boardRequest.getQnaClsLrgCd() == null || boardRequest.getQnaClsLrgCd().isEmpty()) {
// [msg] {0} is required input value.
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Qna Cls Large Cd"));
}
if (boardRequest.getQnaClsMidCd() == null || boardRequest.getQnaClsMidCd().isEmpty()) {
// [msg] {0} is required input value.
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Qna Cls Mid Cd"));
}
if (boardRequest.getTitle() == null || boardRequest.getTitle().isEmpty()) {
// [msg] {0} is required input value.
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "title"));
}
if (boardRequest.getContents() == null || boardRequest.getContents().isEmpty()) {
// [msg] {0} is required input value.
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "contents"));
}
if (boardRequest.getRegId() == null || boardRequest.getRegId().isEmpty()) {
// [msg] {0} is required input value.
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Reg Id"));
}
if (boardRequest.getRegUserNm() == null || boardRequest.getRegUserNm().isEmpty()) {
// [msg] {0} is required input value.
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Reg User Nm"));
}
String url = null;
String apiUrl = null;
BoardResponse boardResponse = null;
if("QNA".equals(boardRequest.getSchNoticeClsCd())) {
url = QSP_API_URL + "/api/qna/save";
apiUrl = UriComponentsBuilder.fromHttpUrl(url)
.queryParam("siteTpCd", boardRequest.getSiteTpCd())
.queryParam("compCd", boardRequest.getCompCd())
.queryParam("regId", boardRequest.getRegId())
.queryParam("title", boardRequest.getTitle())
.queryParam("qnaClsLrgCd", boardRequest.getQnaClsLrgCd() )
.queryParam("qnaClsMidCd", boardRequest.getQnaClsMidCd())
.queryParam("qnaClsSmlCd", boardRequest.getQnaClsSmlCd())
.queryParam("contents", boardRequest.getContents())
.queryParam("storeId", boardRequest.getStoreId())
.queryParam("regUserNm", boardRequest.getRegUserNm())
.queryParam("regUserTelNo", boardRequest.getRegUserTelNo())
.queryParam("qstMail", boardRequest.getQstMail())
// .queryParam("files", multipartFileList)
.build()
.toUriString();
}
List<MultipartFile> multipartFileList = new ArrayList<>();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, List<MultipartFile>> mapMultipart = multipartRequest.getMultiFileMap();
String strParamKey;
for (String s : mapMultipart.keySet()) {
strParamKey = s;
multipartFileList.addAll(mapMultipart.get(strParamKey));
}
LinkedMultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
RestTemplate restTemplate = new RestTemplate();
String responseStr;
HttpStatus httpStatus = HttpStatus.CREATED;
for (MultipartFile file : multipartFileList) {
if (!file.isEmpty()) {
map.add("file", new MultipartInputStreamFileResource(file.getInputStream(), file.getOriginalFilename()));
}
}
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
HttpEntity<LinkedMultiValueMap<String, Object>> requestEntity = new HttpEntity<>(map, headers);
String strResponse = restTemplate.postForObject(apiUrl, requestEntity, String.class);
//String strResponse = interfaceQsp.callApi(HttpMethod.POST, apiUrl, multipartFileList);
if (!"".equals(strResponse)) {
com.fasterxml.jackson.databind.ObjectMapper om =
new com.fasterxml.jackson.databind.ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
response = om.readValue(strResponse, BoardResponse.class);
} else {
// [msg] No data
throw new QcastException(ErrorCode.NOT_FOUND, message.getMessage("common.message.no.data"));
}
return response;
}
/**
* 게시판 파일 다운로드 QSP -> Q.CAST3
*
@ -202,3 +379,23 @@ public class BoardService {
}
}
}
class MultipartInputStreamFileResource extends InputStreamResource {
private final String filename;
MultipartInputStreamFileResource(InputStream inputStream, String filename) {
super(inputStream);
this.filename = filename;
}
@Override
public String getFilename() {
return this.filename;
}
@Override
public long contentLength() throws IOException {
return -1; // we do not want to generally read the whole stream into memory ...
}
}

View File

@ -1,7 +1,13 @@
package com.interplug.qcast.biz.community.dto;
import com.interplug.qcast.biz.file.dto.FileRequest;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.servlet.http.HttpServletRequest;
import lombok.Getter;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@Getter
@Setter
@ -28,4 +34,37 @@ public class BoardRequest {
/** 메인여부 */
private String schMainYn;
//Company Code
private String compCd;
private String storeId;
//Site Type Code
private String siteTpCd;
private String loginId;
//등록자 아이디
private String schRegId;
//검색 시작일시
private String schFromDt;
//검색 끝일시
private String schToDt;
private String qnaNo;
private String langCd;
private String qnaClsLrgCd;
private String qnaClsMidCd;
private String qnaClsSmlCd;
private String contents;
private String regId;
private String title;
private String regUserNm;
private String regUserTelNo;
private String qstMail;
@Schema(description = "첨부파일 목록")
List<MultipartFile> fileList;
}

View File

@ -4,11 +4,13 @@ import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.parameters.Parameter;
import io.swagger.v3.oas.models.servers.Server;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springdoc.core.customizers.OpenApiCustomizer;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
@ -20,30 +22,51 @@ public class SwaggerConfig {
@Autowired Environment env;
@Value("${swagger.url}")
private String swaggerUrl;
@Bean
public OpenAPI baseApi() {
String activeProfile = env.getProperty("spring.profiles.active");
if (log.isDebugEnabled()) {
log.debug("Active profile: {}", activeProfile);
}
Server server = new Server();
server.setUrl(swaggerUrl);
OpenAPI openAPI = new OpenAPI();
openAPI.info(
new Info().title("QCast API").version("1.0").description("QCast API Documentation"));
openAPI
.info(new Info().title("QCast API").version("1.0").description("QCast API Documentation"))
.addServersItem(server);
return openAPI;
}
@Bean
public GroupedOpenApi allApi() {
return GroupedOpenApi.builder().group("ALL").packagesToScan("com.interplug.qcast.biz").addOpenApiCustomizer(openApiCustomizer()).build();
return GroupedOpenApi.builder()
.group("ALL")
.packagesToScan("com.interplug.qcast.biz")
.addOpenApiCustomizer(openApiCustomizer())
.build();
}
@Bean
public OpenApiCustomizer openApiCustomizer() {
Parameter lang = new Parameter().name("lang").description("Language").in("header").schema(new StringSchema());
return openApi -> openApi.getPaths().values().forEach(
pathItem -> pathItem.readOperations().forEach(
operation -> operation.addParametersItem(lang)
)
);
Parameter lang =
new Parameter()
.name("lang")
.description("Language")
.in("header")
.schema(new StringSchema());
return openApi ->
openApi
.getPaths()
.values()
.forEach(
pathItem ->
pathItem
.readOperations()
.forEach(operation -> operation.addParametersItem(lang)));
}
}

View File

@ -0,0 +1,68 @@
#server
server:
port: 8080
#spring
spring:
datasource:
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jdbc-url: jdbc:log4jdbc:sqlserver://1.248.227.176:1433;databaseName=NEWPVCAD;encrypt=true;trustServerCertificate=true
username: pvDBuser
password: ENC(W7owprYnvf7vqwO6Piw4dHfVBCSxE4Ck)
maximum-pool-size: 4
pool-name: Master-HikariPool
# datasource:
# master:
# driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
# jdbc-url: jdbc:log4jdbc:sqlserver://1.248.227.176:1433;databaseName=NEWPVCAD;encrypt=true;trustServerCertificate=true
# username: pvDBuser
# password: ENC(W7owprYnvf7vqwO6Piw4dHfVBCSxE4Ck)
# maximum-pool-size: 4
# pool-name: Master-HikariPool
# read:
# driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
# jdbc-url: jdbc:log4jdbc:sqlserver://1.248.227.176:1433;databaseName=NEWPVCAD;encrypt=true;trustServerCertificate=true
# username: pvDBuser
# password: ENC(W7owprYnvf7vqwO6Piw4dHfVBCSxE4Ck)
# maximum-pool-size: 4
# pool-name: Read-HikariPool
jackson:
time-zone: Asia/Seoul
batch:
jdbc:
initialize-schema: never
job:
names: ${job.name:NONE}
enabled: false
profiles:
scheduler: Y
#QSP url 하나시스운영 #https://jp.qsalesplatform.com
#QSP url 하나시스개발 #https://121.168.9.37:8080
#QSP url interplug dev #http://1.248.227.176:8120
qsp:
url: http://1.248.227.176:8120
master-store-batch-url: /api/master/storeAdditionalInfo
master-material-batch-url: /api/master/materialList
master-bom-batch-url: /api/master/bomList
master-business-charger-batch-url: /api/user/businessChargerList
master-admin-user-batch-url: /api/admin/userList
master-price-batch-url: /api/master/priceList
simulation-guide-info-url: /api/simulation/guideInfo
aes256.key: jpqcellQ123456!!
auto.login.aes256.key: _autoL!!
system-commonCode-batch-url: /api/system/commonCodeListData
master-special-note-disp-item-batch-url: /api/master/quotationDispItemInfo
estimate-plan-confirm-batch-url: /api/order/planConfirmListData
estimate-sync-batch-url: /api/order/qcastQuotationSave
#File
file:
root.path: C:\\
ini.root.path: C:\\NewEstimate
ini.base.filename: 料金シミュレーション.ini
ini.drawing.img.path: https://files.hanasys.jp/Drawing
front:
url: http://1.248.227.176:3000
swagger.url: http://localhost:38080

View File

@ -6,9 +6,13 @@ server:
spring:
datasource:
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
#내부 개발계 DB
jdbc-url: jdbc:log4jdbc:sqlserver://1.248.227.176:1433;databaseName=NEWPVCAD;encrypt=true;trustServerCertificate=true
username: pvDBuser
password: ENC(W7owprYnvf7vqwO6Piw4dHfVBCSxE4Ck)
#한화 개발계 DB
#jdbc-url: jdbc:log4jdbc:sqlserver://192.168.200.220:1433;databaseName=NEWPVCAD;encrypt=false;trustServerCertificate=false
#password: ENC(Zc3J45rtPR/uQDeDOcrnF/iGLlU6U3y6)
username: pvDBuser
maximum-pool-size: 4
pool-name: Master-HikariPool
# datasource:
@ -37,9 +41,11 @@ spring:
profiles:
scheduler: Y
#QSP
#QSP url 하나시스운영 #https://jp.qsalesplatform.com
#QSP url 하나시스개발 #https://121.168.9.37:8080
#QSP url interplug dev #http://1.248.227.176:8120
qsp:
url: http://1.248.227.176:8120
url: http://121.168.9.37:8080
master-store-batch-url: /api/master/storeAdditionalInfo
master-material-batch-url: /api/master/materialList
master-bom-batch-url: /api/master/bomList
@ -58,7 +64,9 @@ file:
root.path: /home/development/public/files
ini.root.path: /home/development/public/files/NewEstimate
ini.base.filename: 料金シミュレーション.ini
ini.drawing.img.path: /home/development/public/files/NewEstimate/Drawing
ini.drawing.img.path: https://files.hanasys.jp/Drawing
front:
url: http://1.248.227.176:3000
url: http://1.248.227.176:3000
swagger.url: https://dev-api.hanasys.jp

View File

@ -6,9 +6,13 @@ server:
spring:
datasource:
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
#내부 개발계 DB
jdbc-url: jdbc:log4jdbc:sqlserver://1.248.227.176:1433;databaseName=NEWPVCAD;encrypt=true;trustServerCertificate=true
username: pvDBuser
password: ENC(W7owprYnvf7vqwO6Piw4dHfVBCSxE4Ck)
#한화 개발계 DB
#jdbc-url: jdbc:log4jdbc:sqlserver://192.168.200.220:1433;databaseName=NEWPVCAD;encrypt=false;trustServerCertificate=false
#password: ENC(Zc3J45rtPR/uQDeDOcrnF/iGLlU6U3y6)
username: pvDBuser
maximum-pool-size: 4
pool-name: Master-HikariPool
# datasource:
@ -39,7 +43,7 @@ spring:
#QSP
qsp:
url: http://localhost:8120
url: http://1.248.227.176:8120
master-store-batch-url: /api/master/storeAdditionalInfo
master-material-batch-url: /api/master/materialList
master-bom-batch-url: /api/master/bomList

View File

@ -37,9 +37,11 @@ spring:
profiles:
scheduler: Y
#QSP # http://jp.qsalesplatform.com
#QSP url 하나시스운영 #https://jp.qsalesplatform.com
#QSP url 하나시스개발 #https://121.168.9.37:8080
#QSP url interplug dev #http://1.248.227.176:8120
qsp:
url: http://1.248.227.176:8120
url: http://121.168.9.37:8080
master-store-batch-url: /api/master/storeAdditionalInfo
master-material-batch-url: /api/master/materialList
master-bom-batch-url: /api/master/bomList
@ -58,7 +60,9 @@ file:
root.path: /home/production/public/files
ini.root.path: /home/production/public/files/NewEstimate
ini.base.filename: 料金シミュレーション.ini
ini.drawing.img.path: /home/production/public/files/NewEstimate/Drawing
ini.drawing.img.path: https://files.hanasys.jp/Drawing
front:
url: https://hanasys.jp
url: https://hanasys.jp
swagger.url: https://api.hanasys.jp

View File

@ -44,6 +44,13 @@ spring:
names: ${job.name:NONE}
enabled: false
cloud:
openfeign:
client:
config:
default:
logger-level: HEADERS
management:
endpoints:
enabled-by-default: false
@ -65,7 +72,7 @@ file:
root.path: /home/development/public/files
ini.root.path: /home/development/public/files/NewEstimate
ini.base.filename: 料金シミュレーション.ini
ini.drawing.img.path: /home/development/public/files/NewEstimate/Drawing
ini.drawing.img.path: https://files.hanasys.jp/Drawing
# log
logging:
@ -75,3 +82,4 @@ springdoc:
swagger-ui:
operations-sorter: alpha
swagger.url: http://localhost:8080

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.padual.com/java/logback.xsd">
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<springProperty scope="context" name="ACTIVE_PROFILE" source="spring.profiles.active"/>
<property name="LOG_HOME" value="c:/qcast3/logs/api/"/>
<property name="LOG_FILE" value="${LOG_HOME}${ACTIVE_PROFILE}.qcast.api"/>
<property name="LOG_FILE_EXT" value=".log"/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>${CONSOLE_LOG_CHARSET}</charset>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE}${LOG_FILE_EXT}</file>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>${FILE_LOG_CHARSET}</charset>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE}.%d{yyyy-MM-dd}${LOG_FILE_EXT}</fileNamePattern>
</rollingPolicy>
</appender>
<logger name="jdbc" level="warn"/>
<logger name="com.zaxxer.hikari" level="info"/>
<logger name="jdbc.sqltiming" level="debug"/>
<logger name="com.interplug.qcast" level="debug"/>
<root level="warn">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
</configuration>

View File

@ -362,7 +362,12 @@
<select id="selectEstimateRoofCertVolKw" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest" resultType="String">
/* sqlid : com.interplug.qcast.biz.estimate.selectEstimateRoofCertVolKw */
SELECT
FORMAT(ISNULL(SUM(CASE WHEN T.MODULE_VOL_KW <![CDATA[ <= ]]> T.PC_VOL_KW THEN T.MODULE_VOL_KW ELSE T.PC_VOL_KW END), 0), '#,##0.000') AS CERT_VOL_KW
-- FORMAT(ISNULL(SUM(CASE WHEN T.MODULE_VOL_KW <![CDATA[ <= ]]> T.PC_VOL_KW THEN T.MODULE_VOL_KW ELSE T.PC_VOL_KW END), 0), '#,##0.000') AS CERT_VOL_KW
REPLACE(CONVERT(VARCHAR, CAST(ISNULL(SUM(
CASE
WHEN T.MODULE_VOL_KW <![CDATA[ <= ]]> T.PC_VOL_KW THEN T.MODULE_VOL_KW
ELSE T.PC_VOL_KW
END), 0) AS NUMERIC(18, 3)), 1), ',', '') AS CERT_VOL_KW
FROM
(
SELECT