From 4c7ec998e3d5f848ad55f0944aaf4880528f24e5 Mon Sep 17 00:00:00 2001 From: Jaeyoung Lee Date: Wed, 11 Sep 2024 16:45:02 +0900 Subject: [PATCH 1/5] =?UTF-8?q?logback=20=EC=84=A4=EC=A0=95=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/logback/logback-dev.xml | 6 +++--- src/main/resources/logback/logback-local.xml | 6 +++--- src/main/resources/logback/logback-prd.xml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/resources/logback/logback-dev.xml b/src/main/resources/logback/logback-dev.xml index e801d9e5..93b1ae5a 100644 --- a/src/main/resources/logback/logback-dev.xml +++ b/src/main/resources/logback/logback-dev.xml @@ -3,8 +3,8 @@ xsi:noNamespaceSchemaLocation="http://www.padual.com/java/logback.xsd"> - - + + @@ -33,7 +33,7 @@ - + \ No newline at end of file diff --git a/src/main/resources/logback/logback-local.xml b/src/main/resources/logback/logback-local.xml index e801d9e5..2b75f05f 100644 --- a/src/main/resources/logback/logback-local.xml +++ b/src/main/resources/logback/logback-local.xml @@ -3,8 +3,8 @@ xsi:noNamespaceSchemaLocation="http://www.padual.com/java/logback.xsd"> - - + + @@ -33,7 +33,7 @@ - + \ No newline at end of file diff --git a/src/main/resources/logback/logback-prd.xml b/src/main/resources/logback/logback-prd.xml index e801d9e5..e0b969ee 100644 --- a/src/main/resources/logback/logback-prd.xml +++ b/src/main/resources/logback/logback-prd.xml @@ -3,8 +3,8 @@ xsi:noNamespaceSchemaLocation="http://www.padual.com/java/logback.xsd"> - - + + @@ -33,7 +33,7 @@ - + \ No newline at end of file From 623530fd89761f6a2cef21b622bc903c07480d9f Mon Sep 17 00:00:00 2001 From: "LAPTOP-L3VE7KK2\\USER" Date: Wed, 11 Sep 2024 17:38:42 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=20API=20=EA=B0=9C=EB=B0=9C=20(=EC=9E=84?= =?UTF-8?q?=EC=8B=9C=EC=A0=80=EC=9E=A5,=20=EC=82=AD=EC=A0=9C,=20=EB=8F=84?= =?UTF-8?q?=EB=8F=84=EB=B6=80=ED=98=84,=20=EC=A7=80=EC=97=AD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qcast/biz/object/ObjectController.java | 43 ++-- .../qcast/biz/object/ObjectMapper.java | 22 +- .../qcast/biz/object/ObjectService.java | 138 +++++++++--- .../qcast/biz/object/dto/ObjectRequest.java | 58 ++++- .../qcast/biz/object/dto/ObjectResponse.java | 43 ++++ .../qcast/biz/object/dto/PlanRequest.java | 34 +++ .../qcast/biz/object/dto/PlanResponse.java | 34 +++ .../qcast/biz/object/dto/PrefResponse.java | 16 ++ .../biz/object/dto/SaleStoreResponse.java | 20 ++ .../resources/mappers/object/objectMapper.xml | 198 ++++++++++++++---- 10 files changed, 512 insertions(+), 94 deletions(-) create mode 100644 src/main/java/com/interplug/qcast/biz/object/dto/PrefResponse.java create mode 100644 src/main/java/com/interplug/qcast/biz/object/dto/SaleStoreResponse.java diff --git a/src/main/java/com/interplug/qcast/biz/object/ObjectController.java b/src/main/java/com/interplug/qcast/biz/object/ObjectController.java index 61df884e..218293f0 100644 --- a/src/main/java/com/interplug/qcast/biz/object/ObjectController.java +++ b/src/main/java/com/interplug/qcast/biz/object/ObjectController.java @@ -1,8 +1,6 @@ package com.interplug.qcast.biz.object; -import com.interplug.qcast.biz.object.dto.ObjectRequest; -import com.interplug.qcast.biz.object.dto.ObjectResponse; -import com.interplug.qcast.biz.object.dto.PlanRequest; +import com.interplug.qcast.biz.object.dto.*; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @@ -21,50 +19,71 @@ public class ObjectController { // @Autowired private ObjectService objectService; private final ObjectService objectService; + @Operation(description = "물건정보 도도부현을 조회한다.") + @GetMapping("/prefecture/list") + @ResponseStatus(HttpStatus.OK) + public List selectPrefList() throws Exception { + return objectService.selectPrefList(); + } + + @Operation(description = "물건정보 도도부현 발전시뮬레이션 지역을 조회한다.") + @GetMapping("/prefecture/{prefId}/list") + @ResponseStatus(HttpStatus.OK) + public List selectPrefAreaList(@PathVariable String prefId) throws Exception { + return objectService.selectPrefAreaList(prefId); + } + + @Operation(description = "판매점 목록을 조회한다.") + @GetMapping("/saleStore/{saleStoreId}/list") + @ResponseStatus(HttpStatus.OK) + public List selectSaleStoreList(@PathVariable String saleStoreId) throws Exception { + return objectService.selectSaleStoreList(saleStoreId); + } + @Operation(description = "물건정보 목록을 조회한다.") - @GetMapping("/v1.0/object") + @GetMapping("/list") @ResponseStatus(HttpStatus.OK) public List selectObjectList(ObjectRequest objectRequest) throws Exception { return objectService.selectObjectList(objectRequest); } @Operation(description = "물건정보 상세를 조회한다.") - @GetMapping("/v1.0/object/{objectNo}") + @GetMapping("/{objectNo}/detail") @ResponseStatus(HttpStatus.OK) public ObjectResponse selectObjectDetail(@PathVariable String objectNo) throws Exception { return objectService.selectObjectDetail(objectNo); } @Operation(description = "물건정보을 저장한다.") - @PostMapping("/v1.0/object") + @PostMapping("/save-object") @ResponseStatus(HttpStatus.CREATED) public ObjectResponse insertObject(@RequestBody ObjectRequest objectRequest) throws Exception { return objectService.insertObject(objectRequest); } @Operation(description = "물건정보을 수정한다.") - @PutMapping("/v1.0/object") + @PutMapping("/save-object") @ResponseStatus(HttpStatus.CREATED) - public void updateObject(@RequestBody ObjectRequest objectRequest) throws Exception { - int reust = objectService.updateObject(objectRequest); + public ObjectResponse updateObject(@RequestBody ObjectRequest objectRequest) throws Exception { + return objectService.updateObject(objectRequest); } @Operation(description = "물건정보을 삭제한다.") - @DeleteMapping("/v1.0/object/{objectNo}") + @DeleteMapping("/{objectNo}") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteObject(@PathVariable String objectNo) throws Exception { objectService.deleteObject(objectNo); } @Operation(description = "물건정보의 플랜정보를 추가한다.") - @PostMapping("/v1.0/object/plan") + @PostMapping("/add-plan") @ResponseStatus(HttpStatus.CREATED) public void insertPlan(@RequestBody PlanRequest planRequest) throws Exception { objectService.insertPlan(planRequest); } @Operation(description = "물건정보의 플랜정보를 삭제한다.") - @DeleteMapping("/v1.0/object/plan/{objectNo}/{planNo}") + @DeleteMapping("/plan/{objectNo}/{planNo}") @ResponseStatus(HttpStatus.NO_CONTENT) public void deletePlan(@PathVariable String objectNo, @PathVariable String planNo) throws Exception { PlanRequest planRequest = new PlanRequest(); diff --git a/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java b/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java index 934f7f2d..3ea351a8 100644 --- a/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java +++ b/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java @@ -1,15 +1,23 @@ package com.interplug.qcast.biz.object; -import com.interplug.qcast.biz.object.dto.ObjectRequest; -import com.interplug.qcast.biz.object.dto.ObjectResponse; -import com.interplug.qcast.biz.object.dto.PlanRequest; -import com.interplug.qcast.biz.object.dto.PlanResponse; +import com.interplug.qcast.biz.object.dto.*; import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper interface ObjectMapper { + // 도도부현 목록 조회 + public List selectPrefList(); + + // 도도부현 지역 조회 + public List selectPrefAreaList(String prefId); + + // 모든 판매점 목록 조회 + public List selectSaleStoreAllList(); + + // 판매점 목록 조회 + public List selectSaleStoreList(String saleStoreId); // 물건정보 목록 조회 public List selectObjectList(ObjectRequest objectRequest); @@ -43,4 +51,10 @@ interface ObjectMapper { // 플랜정보 삭제(물리 삭제) public int deletePlan(PlanRequest planRequest); + + // 물건정보 물건번호 변경 + public int updateObjectNoChange(ObjectRequest objectRequest); + + // 플랜정보 물건번호 변경 + public int updatePlanObjectNoChange(ObjectRequest objectRequest); } diff --git a/src/main/java/com/interplug/qcast/biz/object/ObjectService.java b/src/main/java/com/interplug/qcast/biz/object/ObjectService.java index 5c7cb7f5..a2363c8e 100644 --- a/src/main/java/com/interplug/qcast/biz/object/ObjectService.java +++ b/src/main/java/com/interplug/qcast/biz/object/ObjectService.java @@ -1,13 +1,10 @@ package com.interplug.qcast.biz.object; -import com.interplug.qcast.QCastApplication; -import com.interplug.qcast.biz.object.dto.ObjectRequest; -import com.interplug.qcast.biz.object.dto.ObjectResponse; -import com.interplug.qcast.biz.object.dto.PlanRequest; -import com.interplug.qcast.biz.object.dto.PlanResponse; +import com.interplug.qcast.biz.object.dto.*; import io.micrometer.common.util.StringUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.RandomStringUtils; import org.ini4j.Wini; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -16,6 +13,7 @@ import java.io.*; import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; import java.util.List; @@ -23,29 +21,50 @@ import java.util.List; @Service @RequiredArgsConstructor public class ObjectService { - private final ObjectMapper objectMapper; - private final QCastApplication qCastApplication; - @Value("${file.ini.root.path}") private String baseDirPath; @Value("${file.ini.base.filename}") private String baseFileName; + private final ObjectMapper objectMapper; + + public List selectPrefList() throws Exception { + return objectMapper.selectPrefList(); + } + + public List selectPrefAreaList(String prefId) throws Exception { + return objectMapper.selectPrefAreaList(prefId); + } + + public List selectSaleStoreList(String saleStoreId) throws Exception { + if ("T01".equals(saleStoreId)) { + return objectMapper.selectSaleStoreAllList(); + } else { + return objectMapper.selectSaleStoreList(saleStoreId); + } + } + public List selectObjectList(ObjectRequest objectRequest) throws Exception { return objectMapper.selectObjectList(objectRequest); } public ObjectResponse selectObjectDetail(String objectNo) throws Exception { - ObjectResponse objectResponse = new ObjectResponse(); - // object 상세 정보 조회 - objectResponse = objectMapper.selectObjectDetail(objectNo); - // 기본 플랜번호 셋팅 - objectResponse.setPlanNo("1"); + ObjectResponse objectResponse = objectMapper.selectObjectDetail(objectNo); if (objectResponse != null) { + // 기본 플랜번호 셋팅 + objectResponse.setPlanNo("1"); + // ini 파일 읽어 Response 객체 담기 this.objectFileInfo(objectResponse); + + // Plan 목록 조회 + PlanRequest planRequest = new PlanRequest(); + planRequest.setObjectNo(objectNo); + List planList = objectMapper.selectPlanList(planRequest); + + objectResponse.setPlanList(planList); } return objectResponse; @@ -53,10 +72,30 @@ public class ObjectService { public ObjectResponse insertObject(ObjectRequest objectRequest) throws Exception { int result = 0; + String objectNo = ""; // 물건번호 등록/조회 - result += objectMapper.insertObjectNo(objectRequest); - String objectNo = objectMapper.selectObjectNo(objectRequest); + if ("0".equals(objectRequest.getTempFlg())) { + objectRequest.setDelFlg("0"); + objectRequest.setTempFlg("0"); + objectRequest.setTempDelFlg("0"); + + result += objectMapper.insertObjectNo(objectRequest); + objectNo = objectMapper.selectObjectNo(objectRequest); + } else if ("1".equals(objectRequest.getTempFlg())) { + objectRequest.setDelFlg("1"); + objectRequest.setTempFlg("1"); + objectRequest.setTempDelFlg("0"); + + // 임시저장인 경우 임시 물건번호 생성 yyyymmddhh24missSSS_랜덤문자 3개 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + Calendar dateTime = Calendar.getInstance(); + objectNo = sdf.format(dateTime.getTime()); + + objectNo = "T" + objectNo.substring(2) + RandomStringUtils.randomAlphanumeric(3); + objectNo = objectNo.toUpperCase(); + } + objectRequest.setObjectNo(objectNo); // 물건정보 등록 @@ -91,29 +130,57 @@ public class ObjectService { return objectResponse; } - public int updateObject(ObjectRequest objectRequest) throws Exception { + public ObjectResponse updateObject(ObjectRequest objectRequest) throws Exception { int result = 0; + boolean tempChgFlg = false; - // 물건정보 수정 - objectRequest.setAddress(objectRequest.getPrefName() + ((!StringUtils.isEmpty(objectRequest.getAddress())) ? objectRequest.getAddress() : "")); - objectRequest.setAddresseeCompanyName(objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit()); - objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit()); - objectRequest.setContentsPath(baseDirPath + "\\\\" + objectRequest.getObjectNo()); - result += objectMapper.updateObject(objectRequest); + // object 상세 정보 조회 + ObjectResponse objectResponse = objectMapper.selectObjectDetail(objectRequest.getObjectNo()); - // Plan 목록 조회 - PlanRequest planRequest = new PlanRequest(); - planRequest.setObjectNo(objectRequest.getObjectNo()); - List planList = objectMapper.selectPlanList(planRequest); + if (objectResponse != null) { + // 임시저장에서 저장상태 바뀌었는지 확인 + if ("1".equals(objectResponse.getTempFlg()) && "0".equals(objectRequest.getTempFlg())) { + tempChgFlg = true; - for (PlanResponse planResponse : planList) { - objectRequest.setPlanNo(planResponse.getPlanNo()); + result += objectMapper.insertObjectNo(objectRequest); + objectRequest.setNewObjectNo(objectMapper.selectObjectNo(objectRequest)); + } - // ini 파일 수정 - this.objectFileSave(objectRequest); + // 물건정보 수정 + objectRequest.setAddress(objectRequest.getPrefName() + ((!StringUtils.isEmpty(objectRequest.getAddress())) ? objectRequest.getAddress() : "")); + objectRequest.setAddresseeCompanyName(objectRequest.getObjectName() + ' ' + objectRequest.getObjectNameOmit()); + objectRequest.setAddresseeCompanyNameOmit(objectRequest.getObjectNameOmit()); + objectRequest.setContentsPath(baseDirPath + "\\\\" + (tempChgFlg ? objectRequest.getNewObjectNo() : objectRequest.getObjectNo())); + result += objectMapper.updateObject(objectRequest); + + // Plan 목록 조회 + PlanRequest planRequest = new PlanRequest(); + planRequest.setObjectNo(objectRequest.getObjectNo()); + List planList = objectMapper.selectPlanList(planRequest); + + for (PlanResponse planResponse : planList) { + objectRequest.setPlanNo(planResponse.getPlanNo()); + + // ini 파일 수정 + this.objectFileSave(objectRequest); + } + + // 임시저장에서 저장상태로 돌리기 + if (tempChgFlg) { + objectMapper.updateObjectNoChange(objectRequest); + objectMapper.updatePlanObjectNoChange(objectRequest); + + // 임시저장 폴더명 생성 물건번호명으로 교체 + File file = new File(baseDirPath + File.separator + objectRequest.getObjectNo()); + if (file.exists()) { + file.renameTo(new File (baseDirPath + File.separator + objectRequest.getNewObjectNo())); + } + } } - return result; + // 모든 변경 완료 후 재호출 + objectResponse = objectMapper.selectObjectDetail((tempChgFlg ? objectRequest.getNewObjectNo() : objectRequest.getObjectNo())); + return objectResponse; } public int deleteObject(String objectNo) throws Exception { @@ -196,11 +263,14 @@ public class ObjectService { // 도도부현 코드 objectFileSetting(iniFile, groupKey, "都道府県コード", objectRequest.getPrefId()); // 물건번호 - objectFileSetting(iniFile, groupKey, "物件コード", objectRequest.getObjectNo()); + objectFileSetting(iniFile, groupKey, "物件コード", !StringUtils.isEmpty(objectRequest.getNewObjectNo()) ? objectRequest.getNewObjectNo() : objectRequest.getObjectNo()); // 최종 일본어 형식으로 저장 - iniFile.store(new OutputStreamWriter(new FileOutputStream(dirPath + File.separator + baseFileName), "MS932")); + OutputStreamWriter output = new OutputStreamWriter(new FileOutputStream(dirPath + File.separator + baseFileName), "MS932"); + iniFile.store(output); + output.close(); + input.close(); } catch (Exception e) { log.error(e.getMessage()); throw new RuntimeException(e.getMessage()); @@ -256,6 +326,8 @@ public class ObjectService { if (!StringUtils.isEmpty(iniFile.get(groupKey, "寒冷地域"))) { objectResponse.setColdAreaChk(iniFile.get(groupKey, "寒冷地域")); } + + input.close(); } } catch (Exception e) { diff --git a/src/main/java/com/interplug/qcast/biz/object/dto/ObjectRequest.java b/src/main/java/com/interplug/qcast/biz/object/dto/ObjectRequest.java index 011cd182..0c50cf73 100644 --- a/src/main/java/com/interplug/qcast/biz/object/dto/ObjectRequest.java +++ b/src/main/java/com/interplug/qcast/biz/object/dto/ObjectRequest.java @@ -1,60 +1,114 @@ package com.interplug.qcast.biz.object.dto; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data public class ObjectRequest { // 물건정보 ini 파일 설정 순서에 맞쳐 셋팅 + @Schema(description = "판매점명") private String saleStoreName; + @Schema(description = "경칭") private String objectNameOmit; + @Schema(description = "안건명 후리가나") private String objectNameKana; + @Schema(description = "안건명") private String objectName; + @Schema(description = "담당자") private String receiveUser; + @Schema(description = "우편번호") private String zipNo; + @Schema(description = "도도부현명") private String prefName; + @Schema(description = "주소") private String address; + @Schema(description = "발전시뮬레이션 지역") private String powerSimArea; + @Schema(description = "판매오더명") private String workName; + @Schema(description = "부동산 분류코드명") private String objectStatusName; + @Schema(description = "메모") private String remarks; + @Schema(description = "설치높이") private String installHeight; + @Schema(description = "기준풍속") private String windSpeed; + @Schema(description = "수직적설량") private String snowCover; + @Schema(description = "면조도구분") private String surfaceType; + @Schema(description = "전력계약구분") private String powerConTerms; + @Schema(description = "염해지역 아이템사용 여부") private String saltAreaChk; + @Schema(description = "한랭지 대책여부") private String coldAreaChk; + @Schema(description = "판매오더코드") private String workNo; + @Schema(description = "부동산 분류코드") private String objectStatusId; + @Schema(description = "도도부현코드") private String prefId; + @Schema(description = "물건번호") private String objectNo; + @Schema(description = "생성 물건번호") + private String newObjectNo; - // 그외 물건정보 + // 그외 물건정보 + @Schema(description = "판매점ID") private String saleStoreId; + @Schema(description = "배송회사명") private String addresseeCompanyName; + @Schema(description = "배송회사 경칭") private String addresseeCompanyNameOmit; + @Schema(description = "컨텐츠 파일경로") private String contentsPath; + @Schema(description = "임시저장여부") + private String tempFlg; + @Schema(description = "임시저장 삭제여부") + private String tempDelFlg; + @Schema(description = "임시저장->저장 변경여부") + private String tempChgFlg; + @Schema(description = "삭제여부") private String delFlg; + @Schema(description = "사용자아이디") private String userId; // 플랜정보 + @Schema(description = "플랜번호") private String planNo; // 검색정보 + @Schema(description = "검색 - 물건번호") private String schObjectNo; + @Schema(description = "검색 - 판매점ID") private String schSaleStoreId; + @Schema(description = "검색 - 주소") private String schAddress; + @Schema(description = "검색 - 안건명") private String schObjectName; + @Schema(description = "검색 - 판매점명") private String schSaleStoreName; + @Schema(description = "검색 - 사양확장일여부") private String schSpecDateYn; + @Schema(description = "검색 - 담당자") private String schReceiveUser; + @Schema(description = "검색 - 견적처") private String schDispCompanyName; - + @Schema(description = "검색 - 날짜구분") private String schDateType; + @Schema(description = "검색 - 시작일") private String schFromDt; + @Schema(description = "검색 - 종료일") private String schToDt; + @Schema(description = "검색 - 정렬순서") + private String schSortType; // 페이징정보 + @Schema(description = "시작 Row") private String startRow; + @Schema(description = "종료 Row") private String endRow; } diff --git a/src/main/java/com/interplug/qcast/biz/object/dto/ObjectResponse.java b/src/main/java/com/interplug/qcast/biz/object/dto/ObjectResponse.java index 615abf98..a0116f26 100644 --- a/src/main/java/com/interplug/qcast/biz/object/dto/ObjectResponse.java +++ b/src/main/java/com/interplug/qcast/biz/object/dto/ObjectResponse.java @@ -1,52 +1,95 @@ package com.interplug.qcast.biz.object.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; +import java.util.List; + //@Data @Getter @Setter public class ObjectResponse { // 물건정보 + @Schema(description = "물건번호") private String objectNo; + @Schema(description = "판매점ID") private String saleStoreId; + @Schema(description = "판매점명") private String saleStoreName; + @Schema(description = "판매오더코드") private String workNo; + @Schema(description = "부동산 분류코드") private String objectStatusId; + @Schema(description = "안건명") private String objectName; + @Schema(description = "경칭") private String objectNameOmit; + @Schema(description = "안건명 후리가나") private String objectNameKana; + @Schema(description = "우편번호") private String zipNo; + @Schema(description = "도도부현코드") private String prefId; + @Schema(description = "주소") private String address; + @Schema(description = "메모") private String remarks; + @Schema(description = "동일물건정보") private String sameObjectInfo; + @Schema(description = "배송회사명") private String receiveCompanyName; + @Schema(description = "담당자") private String receiveUser; + @Schema(description = "컨텐츠 파일경로") private String contentsPath; + @Schema(description = "사양확정일") private String specDate; + @Schema(description = "견적처") private String dispCompanyName; + @Schema(description = "임시저장여부") + private String tempFlg; + @Schema(description = "생성일") private String createDatetime; + @Schema(description = "생성자") private String createUserName; + @Schema(description = "갱신일") private String lastEditDatetime; + @Schema(description = "갱신자") private String lastEditUserName; // ini 설정정보 + @Schema(description = "발전시뮬레이션 지역") private String powerSimArea; + @Schema(description = "기준풍속") private String windSpeed; + @Schema(description = "수직적설량") private String snowCover; + @Schema(description = "면조도구분") private String surfaceType; + @Schema(description = "설치높이") private String installHeight; + @Schema(description = "전력계약구분") private String powerConTerms; + @Schema(description = "한랭지 대책여부") private String coldAreaChk; + @Schema(description = "염해지역 아이템사용 여부") private String saltAreaChk; // 플랜정보 + @Schema(description = "플랜번호") private String planNo; + @Schema(description = "플랜 전체 건수") private String planTotCnt; + + // 플랜목록 + @Schema(description = "플랜목록") + private List planList; // 페이징 정보 + @Schema(description = "Row Number") private Integer rowNumber; + @Schema(description = "전체 건수") private Integer totCnt; } diff --git a/src/main/java/com/interplug/qcast/biz/object/dto/PlanRequest.java b/src/main/java/com/interplug/qcast/biz/object/dto/PlanRequest.java index 37edc3eb..f19fff86 100644 --- a/src/main/java/com/interplug/qcast/biz/object/dto/PlanRequest.java +++ b/src/main/java/com/interplug/qcast/biz/object/dto/PlanRequest.java @@ -1,40 +1,74 @@ package com.interplug.qcast.biz.object.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data public class PlanRequest { + @Schema(description = "물건번호") private String objectNo; + @Schema(description = "플랜번호") private String planNo; + @Schema(description = "시공방법") private String constructSpecification; + @Schema(description = "설치높이") private String setupHeight; + @Schema(description = "날씨포인트") private String weatherPoint; + @Schema(description = "날씨포인트") private String roofKindId; + @Schema(description = "경사") private String slope; + @Schema(description = "지붕재 아이템 CLASS ID") private String roofMaterialClassId; + @Schema(description = "지붕재 아이템 ID") private String roofMaterialId; + @Schema(description = "가대 설치 ID") private String supportMethodId; + @Schema(description = "모델") private String moduleModel; + @Schema(description = "담당자") private String charger; + @Schema(description = "견적서 유효기간") private String estimateValidityTerm; + @Schema(description = "결정 플랜") private String decisionPlan; + @Schema(description = "넘버") private String number; + @Schema(description = "시스템용량") private String capacity; + @Schema(description = "강설량") private String snowfall; + @Schema(description = "표준풍속검사") private String standardWindSpeedCheck; + @Schema(description = "옵션커버") private String optionCover; + @Schema(description = "한화여부") private String hanwfaFlg; + @Schema(description = "기준종류ID") private String standKindId; + @Schema(description = "기준풍속ID") private String standardWindSpeedId; + @Schema(description = "가대 메이커") private String supportMeaker; + @Schema(description = "소비세ID") private String consumptionTaxId; + @Schema(description = "상태코드") private String status; + @Schema(description = "사용자아이디") private String userId; + @Schema(description = "삭제여부") private String delFlg; + @Schema(description = "파워컨디셔너") private String pcTypeNo; + @Schema(description = "북면설치여부") private String northArrangement; + @Schema(description = "지붕재") private String roofMaterialIdMulti; + @Schema(description = "가대") private String supportMethodIdMulti; + @Schema(description = "가대 메이커") private String supportMeakerMulti; + @Schema(description = "다른 지붕재여부") private String diffRoofEnabled; } diff --git a/src/main/java/com/interplug/qcast/biz/object/dto/PlanResponse.java b/src/main/java/com/interplug/qcast/biz/object/dto/PlanResponse.java index 592788ff..0fa5e12b 100644 --- a/src/main/java/com/interplug/qcast/biz/object/dto/PlanResponse.java +++ b/src/main/java/com/interplug/qcast/biz/object/dto/PlanResponse.java @@ -1,40 +1,74 @@ package com.interplug.qcast.biz.object.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data public class PlanResponse { + @Schema(description = "물건번호") private String objectNo; + @Schema(description = "플랜번호") private String planNo; + @Schema(description = "시공방법") private String constructSpecification; + @Schema(description = "설치높이") private String setupHeight; + @Schema(description = "날씨포인트") private String weatherPoint; + @Schema(description = "날씨포인트") private String roofKindId; + @Schema(description = "경사") private String slope; + @Schema(description = "지붕재 아이템 CLASS ID") private String roofMaterialClassId; + @Schema(description = "지붕재 아이템 ID") private String roofMaterialId; + @Schema(description = "가대 설치 ID") private String supportMethodId; + @Schema(description = "모델") private String moduleModel; + @Schema(description = "담당자") private String charger; + @Schema(description = "견적서 유효기간") private String estimateValidityTerm; + @Schema(description = "결정 플랜") private String decisionPlan; + @Schema(description = "넘버") private String number; + @Schema(description = "시스템용량") private String capacity; + @Schema(description = "강설량") private String snowfall; + @Schema(description = "표준풍속검사") private String standardWindSpeedCheck; + @Schema(description = "옵션커버") private String optionCover; + @Schema(description = "한화여부") private String hanwfaFlg; + @Schema(description = "기준종류ID") private String standKindId; + @Schema(description = "기준풍속ID") private String standardWindSpeedId; + @Schema(description = "가대 메이커") private String supportMeaker; + @Schema(description = "소비세ID") private String consumptionTaxId; + @Schema(description = "상태코드") private String status; + @Schema(description = "사용자아이디") private String userId; + @Schema(description = "삭제여부") private String delFlg; + @Schema(description = "파워컨디셔너") private String pcTypeNo; + @Schema(description = "북면설치여부") private String northArrangement; + @Schema(description = "지붕재") private String roofMaterialIdMulti; + @Schema(description = "가대") private String supportMethodIdMulti; + @Schema(description = "가대 메이커") private String supportMeakerMulti; + @Schema(description = "다른 지붕재여부") private String diffRoofEnabled; } diff --git a/src/main/java/com/interplug/qcast/biz/object/dto/PrefResponse.java b/src/main/java/com/interplug/qcast/biz/object/dto/PrefResponse.java new file mode 100644 index 00000000..c3e065c0 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/object/dto/PrefResponse.java @@ -0,0 +1,16 @@ +package com.interplug.qcast.biz.object.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +//@Data +@Getter +@Setter +public class PrefResponse { + // 물건정보 + @Schema(description = "도도부현ID") + private String prefId; + @Schema(description = "도도부현명/지역명") + private String prefName; +} diff --git a/src/main/java/com/interplug/qcast/biz/object/dto/SaleStoreResponse.java b/src/main/java/com/interplug/qcast/biz/object/dto/SaleStoreResponse.java new file mode 100644 index 00000000..3beace07 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/object/dto/SaleStoreResponse.java @@ -0,0 +1,20 @@ +package com.interplug.qcast.biz.object.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +//@Data +@Getter +@Setter +public class SaleStoreResponse { + // 판매점정보 + @Schema(description = "1차점판매점 여부") + private String firstAgentYn; + @Schema(description = "판매점ID") + private String saleStoreId; + @Schema(description = "판매점명") + private String saleStoreName; + @Schema(description = "판매점레벨") + private String saleStoreLevel; +} diff --git a/src/main/resources/mappers/object/objectMapper.xml b/src/main/resources/mappers/object/objectMapper.xml index 9e84c9ad..c40175f6 100644 --- a/src/main/resources/mappers/object/objectMapper.xml +++ b/src/main/resources/mappers/object/objectMapper.xml @@ -2,20 +2,92 @@ - + /* sqlid : com.interplug.qcast.biz.object.selectPrefList */ + SELECT + P.PREF_ID + , P.PREF_NAME + FROM M_PREFECTURE P WITH (NOLOCK) + ORDER BY P.DISP_ORDER ASC + + + + + + + + + + + @@ -40,8 +54,10 @@ SALE_STORE_ID , SALE_STORE_NAME , SALE_STORE_LEVEL + , FIRST_AGENT_ID FROM M_SALES_STORE WITH(NOLOCK) - WHERE DEL_FLG = '0' + WHERE APPROVE_FLG = '2' + AND DEL_FLG = '0' AND SALE_STORE_ID = #{saleStoreId} UNION ALL @@ -49,10 +65,12 @@ A.SALE_STORE_ID , A.SALE_STORE_NAME , A.SALE_STORE_LEVEL + , A.FIRST_AGENT_ID FROM M_SALES_STORE A WITH(NOLOCK) INNER JOIN SALES_STORE_CTE B ON A.PARENT_SALE_AGENT_ID = B.SALE_STORE_ID - WHERE A.DEL_FLG = '0' + WHERE A.APPROVE_FLG = '2' + AND A.DEL_FLG = '0' ) SELECT @@ -60,15 +78,18 @@ , A.SALE_STORE_ID , A.SALE_STORE_NAME , A.SALE_STORE_LEVEL + , A.FIRST_AGENT_ID FROM M_SALES_STORE A - WHERE (SALE_STORE_ID = (SELECT FIRST_AGENT_ID FROM M_SALES_STORE WHERE SALE_STORE_ID = #{saleStoreId} AND DEL_FLG = '0') OR (SALE_STORE_ID = #{saleStoreId} AND SALE_STORE_LEVEL = '1')) + WHERE SALE_STORE_ID = (SELECT FIRST_AGENT_ID FROM M_SALES_STORE WHERE SALE_STORE_ID = #{saleStoreId} AND DEL_FLG = '0') + AND APPROVE_FLG = '2' AND DEL_FLG = '0' UNION ALL SELECT - 'N' AS FIRST_AGENT_YN + CASE WHEN SALE_STORE_LEVEL = '1' THEN 'Y' ELSE 'N' END AS FIRST_AGENT_YN , A.SALE_STORE_ID , A.SALE_STORE_NAME , A.SALE_STORE_LEVEL + , A.FIRST_AGENT_ID FROM SALES_STORE_CTE A @@ -81,7 +102,8 @@ , SALE_STORE_LEVEL , PARENT_SALE_AGENT_ID FROM M_SALES_STORE WITH(NOLOCK) - WHERE DEL_FLG = '0' + WHERE APPROVE_FLG = '2' + AND DEL_FLG = '0' AND SALE_STORE_ID = #{saleStoreId} UNION ALL @@ -92,7 +114,8 @@ FROM M_SALES_STORE A WITH(NOLOCK) INNER JOIN SALES_STORE_CTE B ON A.PARENT_SALE_AGENT_ID = B.SALE_STORE_ID - WHERE A.DEL_FLG = '0' + WHERE A.APPROVE_FLG = '2' + AND A.DEL_FLG = '0' ) SELECT @@ -118,7 +141,7 @@ , O.ZIP_NO , O.ADDRESS , O.RECEIVE_USER - , O.SPEC_DATE + , O.SPECIFICATION_CONFIRM_DATE , O.CREATE_DATETIME , O.LAST_EDIT_DATETIME , S.SALE_STORE_NAME @@ -138,6 +161,9 @@ AND O.SALE_STORE_ID LIKE '%' + #{schSaleStoreId} + '%' + + AND O.SALE_STORE_ID = #{schSelSaleStoreId} + AND O.ADDRESS LIKE '%' + #{schAddress} + '%' @@ -149,10 +175,10 @@ - AND O.SPEC_DATE IS NOT NULL + AND O.SPECIFICATION_CONFIRM_DATE IS NOT NULL - AND O.SPEC_DATE IS NULL + AND O.SPECIFICATION_CONFIRM_DATE IS NULL @@ -195,6 +221,7 @@ , O.SAME_OBJECT_INFO , O.RECEIVE_COMPANY_NAME , O.RECEIVE_USER + , O.SPECIFICATION_CONFIRM_DATE , O.CONTENTS_PATH , O.TEMP_FLG FROM T_OBJECT O WITH (NOLOCK) @@ -255,6 +282,7 @@ , T.SUPPORT_METHOD_ID_MULTI , T.SUPPORT_MEAKER_MULTI , T.DIFF_ROOF_ENABLED + , T.ORDER_FLG FROM T_PLAN T WITH (NOLOCK) WHERE T.OBJECT_NO = #{objectNo} AND T.DEL_FLG = '0' @@ -441,42 +469,44 @@ , SUPPORT_METHOD_ID_MULTI , SUPPORT_MEAKER_MULTI , DIFF_ROOF_ENABLED + , ORDER_FLG ) VALUES ( - #{objectNo} - , #{planNo} - , #{constructSpecification} - , #{setupHeight} - , #{weatherPoint} - , #{roofKindId} - , #{slope} - , #{roofMaterialClassId} - , #{roofMaterialId} - , #{supportMethodId} - , #{moduleModel} - , (SELECT RECEIVE_USER FROM T_OBJECT WHERE OBJECT_NO = #{objectNo}) - , #{estimateValidityTerm} - , CASE WHEN #{planNo} = '1' THEN '1' ELSE '0' END - , #{number} - , #{capacity} - , #{snowfall} - , #{standardWindSpeedCheck} - , #{optionCover} - , #{hanwfaFlg} - , #{standKindId} - , #{standardWindSpeedId} - , #{supportMeaker} - , #{consumptionTaxId} - , #{status} - , GETDATE() - , #{userId} - , #{delFlg} - , #{pcTypeNo} - , #{northArrangement} - , #{roofMaterialIdMulti} - , #{supportMethodIdMulti} - , #{supportMeakerMulti} - , #{diffRoofEnabled} - ) + #{objectNo} + , #{planNo} + , #{constructSpecification} + , #{setupHeight} + , #{weatherPoint} + , #{roofKindId} + , #{slope} + , #{roofMaterialClassId} + , #{roofMaterialId} + , #{supportMethodId} + , #{moduleModel} + , (SELECT RECEIVE_USER FROM T_OBJECT WHERE OBJECT_NO = #{objectNo}) + , #{estimateValidityTerm} + , CASE WHEN #{planNo} = '1' THEN '1' ELSE '0' END + , #{number} + , #{capacity} + , #{snowfall} + , #{standardWindSpeedCheck} + , #{optionCover} + , #{hanwfaFlg} + , #{standKindId} + , #{standardWindSpeedId} + , #{supportMeaker} + , #{consumptionTaxId} + , #{status} + , GETDATE() + , #{userId} + , #{delFlg} + , #{pcTypeNo} + , #{northArrangement} + , #{roofMaterialIdMulti} + , #{supportMethodIdMulti} + , #{supportMeakerMulti} + , #{diffRoofEnabled} + , #{orderFlg} + )