Merge branch 'err-test' into dev

This commit is contained in:
yoosangwook 2025-02-13 10:05:04 +09:00
commit a8430a83fd
22 changed files with 528 additions and 460 deletions

View File

@ -23,38 +23,40 @@ public class CanvasBasicSettingController {
@Operation(description = "Canvas Basic Setting 정보를 조회 한다.") @Operation(description = "Canvas Basic Setting 정보를 조회 한다.")
@GetMapping("/canvas-basic-settings/by-object/{objectNo}") @GetMapping("/canvas-basic-settings/by-object/{objectNo}")
public List<CanvasBasicSettingResponse> selectCanvasBasicSetting(@PathVariable String objectNo) { public List<CanvasBasicSettingResponse> selectCanvasBasicSetting(@PathVariable String objectNo)
throws QcastException {
log.debug("Basic Setting 조회 ::::: " + objectNo); log.debug("Basic Setting 조회 ::::: " + objectNo);
return canvasBasicSettingService.selectCanvasBasicSetting(objectNo); return canvasBasicSettingService.selectCanvasBasicSetting(objectNo);
} }
@Operation(description = "Canvas Basic Setting 정보를 등록 한다.") @Operation(description = "Canvas Basic Setting 정보를 등록 한다.")
@PostMapping("/canvas-basic-settings") @PostMapping("/canvas-basic-settings")
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
public Map<String, String> insertCanvasBasicSetting(@RequestBody CanvasBasicSettingInfo csi) throws QcastException { public Map<String, String> insertCanvasBasicSetting(@RequestBody CanvasBasicSettingInfo csi)
throws QcastException {
log.debug("Basic Setting 등록 ::::: " + csi.getObjectNo()); log.debug("Basic Setting 등록 ::::: " + csi.getObjectNo());
return canvasBasicSettingService.insertCanvasBasicSetting(csi); return canvasBasicSettingService.insertCanvasBasicSetting(csi);
} }
@Operation(description = "지붕면 할당 정보를 등록 한다.") @Operation(description = "지붕면 할당 정보를 등록 한다.")
@PostMapping("/roof-allocation-settings") @PostMapping("/roof-allocation-settings")
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
public Map<String, String> insertRoofAllocSetting(@RequestBody RoofAllocationSettingInfo rasi) throws QcastException { public Map<String, String> insertRoofAllocSetting(@RequestBody RoofAllocationSettingInfo rasi)
throws QcastException {
log.debug("지붕면 할당 등록 ::::: " + rasi.getObjectNo()); log.debug("지붕면 할당 등록 ::::: " + rasi.getObjectNo());
return canvasBasicSettingService.insertRoofAllocSetting(rasi); return canvasBasicSettingService.insertRoofAllocSetting(rasi);
} }
@Operation(description = "Canvas 지붕재추가 Setting 정보를 삭제 한다.") @Operation(description = "Canvas 지붕재추가 Setting 정보를 삭제 한다.")
@DeleteMapping("/canvas-basic-settings/delete-RoofMaterials/{objectNo}") @DeleteMapping("/canvas-basic-settings/delete-RoofMaterials/{objectNo}")
@ResponseStatus(HttpStatus.NO_CONTENT) @ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteRoofMaterialsAdd(@PathVariable String objectNo) throws QcastException { public void deleteRoofMaterialsAdd(@PathVariable String objectNo) throws QcastException {
canvasBasicSettingService.deleteRoofMaterialsAdd(objectNo); canvasBasicSettingService.deleteRoofMaterialsAdd(objectNo);
} }
} }

View File

@ -1,14 +1,5 @@
package com.interplug.qcast.biz.canvasBasicSetting; package com.interplug.qcast.biz.canvasBasicSetting;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingInfo; import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingInfo;
import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingResponse; import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingResponse;
import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofAllocationInfo; import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofAllocationInfo;
@ -16,124 +7,133 @@ import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofAllocationSettingInfo;
import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofMaterialsAddInfo; import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofMaterialsAddInfo;
import com.interplug.qcast.config.Exception.ErrorCode; import com.interplug.qcast.config.Exception.ErrorCode;
import com.interplug.qcast.config.Exception.QcastException; import com.interplug.qcast.config.Exception.QcastException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j @Slf4j
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class CanvasBasicSettingService { public class CanvasBasicSettingService {
private final CanvasBasicSettingMapper canvasBasicSettingMapper; private final CanvasBasicSettingMapper canvasBasicSettingMapper;
// Canvas Basic Setting 조회(objectNo) // Canvas Basic Setting 조회(objectNo)
public List<CanvasBasicSettingResponse> selectCanvasBasicSetting(String objectNo) { public List<CanvasBasicSettingResponse> selectCanvasBasicSetting(String objectNo)
return canvasBasicSettingMapper.selectCanvasBasicSetting(objectNo); throws QcastException {
} try {
return canvasBasicSettingMapper.selectCanvasBasicSetting(objectNo);
} catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
}
}
// Canvas Basic Setting 등록 // Canvas Basic Setting 등록
public Map<String, String> insertCanvasBasicSetting(CanvasBasicSettingInfo csi) throws QcastException { public Map<String, String> insertCanvasBasicSetting(CanvasBasicSettingInfo csi)
throws QcastException {
Map<String, String> response = new HashMap<>(); Map<String, String> response = new HashMap<>();
if (csi.getObjectNo() == null) { if (csi.getObjectNo() == null) {
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
} }
try { try {
// 먼저 데이터가 존재하는지 확인 // 먼저 데이터가 존재하는지 확인
CanvasBasicSettingInfo cntData = canvasBasicSettingMapper.getCanvasBasicSettingCnt(csi.getObjectNo()); CanvasBasicSettingInfo cntData =
canvasBasicSettingMapper.getCanvasBasicSettingCnt(csi.getObjectNo());
log.debug("cntData ::::: " + cntData); log.debug("cntData ::::: " + cntData);
// 데이터가 존재하지 않으면 insert // 데이터가 존재하지 않으면 insert
if (cntData.getRoofCnt().intValue() < 1) { if (cntData.getRoofCnt().intValue() < 1) {
// 도면/치수/각도 정보 insert // 도면/치수/각도 정보 insert
canvasBasicSettingMapper.insertCanvasBasicSetting(csi); canvasBasicSettingMapper.insertCanvasBasicSetting(csi);
// for-each 루프를 사용하여 지붕재추가 Setting // for-each 루프를 사용하여 지붕재추가 Setting
for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) { for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) {
rma.setObjectNo(csi.getObjectNo()); rma.setObjectNo(csi.getObjectNo());
// 신규 지붕재추가 정보 insert // 신규 지붕재추가 정보 insert
canvasBasicSettingMapper.insertRoofMaterialsAdd(rma); canvasBasicSettingMapper.insertRoofMaterialsAdd(rma);
} }
response.put("objectNo", csi.getObjectNo()); } else {
response.put("returnMessage", "common.message.confirm.mark"); // 도면/치수/각도 정보 update
canvasBasicSettingMapper.updateCanvasBasicSetting(csi);
} else { // for-each 루프를 사용하여 지붕재추가 Setting
// 도면/치수/각도 정보 update for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) {
canvasBasicSettingMapper.updateCanvasBasicSetting(csi);
// for-each 루프를 사용하여 지붕재추가 Setting rma.setObjectNo(csi.getObjectNo());
for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) { // 신규 지붕재추가 정보 insert
canvasBasicSettingMapper.updateRoofMaterialsAdd(rma);
}
}
response.put("objectNo", csi.getObjectNo());
response.put("returnMessage", "common.message.confirm.mark");
rma.setObjectNo(csi.getObjectNo()); } catch (Exception e) {
// 신규 지붕재추가 정보 insert throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
canvasBasicSettingMapper.updateRoofMaterialsAdd(rma); }
}
response.put("objectNo", csi.getObjectNo()); // 생성된 objectNo 반환
response.put("returnMessage", "common.message.confirm.mark"); return response;
} }
} catch (Exception e) { // 지붕면 할당 Setting 등록
response.put("objectNo", csi.getObjectNo()); public Map<String, String> insertRoofAllocSetting(RoofAllocationSettingInfo rasi)
response.put("returnMessage", "common.message.save.error"); throws QcastException {
}
// 생성된 objectNo 반환 Map<String, String> response = new HashMap<>();
return response;
} if (rasi.getObjectNo() == null) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
}
// 지붕면 할당 Setting 등록 try {
public Map<String, String> insertRoofAllocSetting(RoofAllocationSettingInfo rasi) throws QcastException {
Map<String, String> response = new HashMap<>(); // 기존 지붕재추가 정보 삭제 insert
canvasBasicSettingMapper.deleteRoofMaterialsAdd(rasi.getObjectNo());
if (rasi.getObjectNo() == null) { // for-each 루프를 사용하여 지붕재추가 Setting
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); for (RoofAllocationInfo rai : rasi.getRoofAllocationList()) {
} rai.setObjectNo(rasi.getObjectNo());
canvasBasicSettingMapper.insertRoofAllocation(rai);
}
response.put("objectNo", rasi.getObjectNo());
response.put("returnMessage", "common.message.confirm.mark");
} catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
}
try { // 생성된 objectNo 반환
return response;
}
// 기존 지붕재추가 정보 삭제 insert // 지붕재추가 삭제
canvasBasicSettingMapper.deleteRoofMaterialsAdd(rasi.getObjectNo()); public void deleteRoofMaterialsAdd(String objectNo) throws QcastException {
// for-each 루프를 사용하여 지붕재추가 Setting if (objectNo == null || objectNo.trim().isEmpty()) {
for (RoofAllocationInfo rai : rasi.getRoofAllocationList()) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
rai.setObjectNo(rasi.getObjectNo()); }
canvasBasicSettingMapper.insertRoofAllocation(rai);
}
response.put("objectNo", rasi.getObjectNo());
response.put("returnMessage", "common.message.confirm.mark");
} catch (Exception e) {
response.put("objectNo", rasi.getObjectNo());
response.put("returnMessage", "common.message.save.error");
}
// 생성된 objectNo 반환 try {
return response; // 먼저 데이터가 존재하는지 확인
RoofMaterialsAddInfo cntData = canvasBasicSettingMapper.getRoofMaterialsCnt(objectNo);
}
// 지붕재추가 삭제
public void deleteRoofMaterialsAdd(String objectNo) throws QcastException {
if (objectNo == null || objectNo.trim().isEmpty()) {
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다.");
}
// 먼저 데이터가 존재하는지 확인
RoofMaterialsAddInfo cntData = canvasBasicSettingMapper.getRoofMaterialsCnt(objectNo);
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
if (cntData.getRoofCnt().intValue() > 0) {
canvasBasicSettingMapper.deleteRoofMaterialsAdd(objectNo);
} else {
throw new QcastException (ErrorCode.NOT_FOUND ,"삭제할 지붕재가 존재하지 않습니다.");
}
}
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
if (cntData.getRoofCnt().intValue() > 0) {
canvasBasicSettingMapper.deleteRoofMaterialsAdd(objectNo);
} else {
throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 지붕재가 존재하지 않습니다.");
}
} catch (Exception e) {
if (e instanceof QcastException) throw e;
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
}
}
} }

View File

@ -1,14 +1,12 @@
package com.interplug.qcast.biz.canvasGridSetting; package com.interplug.qcast.biz.canvasGridSetting;
import com.interplug.qcast.biz.canvasGridSetting.dto.CanvasGridSettingInfo; import com.interplug.qcast.biz.canvasGridSetting.dto.CanvasGridSettingInfo;
import com.interplug.qcast.config.Exception.QcastException;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.Map;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.Map;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -22,21 +20,22 @@ public class CanvasGridSettingController {
@Operation(description = "Canvas Grid Setting 정보를 조회 한다.") @Operation(description = "Canvas Grid Setting 정보를 조회 한다.")
@GetMapping("/canvas-grid-settings/by-object/{objectNo}") @GetMapping("/canvas-grid-settings/by-object/{objectNo}")
public CanvasGridSettingInfo selectCanvasGridSetting(@PathVariable String objectNo) { public CanvasGridSettingInfo selectCanvasGridSetting(@PathVariable String objectNo)
throws QcastException {
log.debug("Grid Setting 조회 ::::: " + objectNo); log.debug("Grid Setting 조회 ::::: " + objectNo);
return canvasGridSettingService.selectCanvasGridSetting(objectNo); return canvasGridSettingService.selectCanvasGridSetting(objectNo);
} }
@Operation(description = "Canvas Grid Setting 정보를 등록 한다.") @Operation(description = "Canvas Grid Setting 정보를 등록 한다.")
@PostMapping("/canvas-grid-settings") @PostMapping("/canvas-grid-settings")
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
public Map<String, String> insertCanvasGridStatus(@RequestBody CanvasGridSettingInfo csi) { public Map<String, String> insertCanvasGridStatus(@RequestBody CanvasGridSettingInfo csi)
throws QcastException {
log.debug("Grid Setting 등록 ::::: " + csi.getObjectNo()); log.debug("Grid Setting 등록 ::::: " + csi.getObjectNo());
return canvasGridSettingService.insertCanvasGridSetting(csi); return canvasGridSettingService.insertCanvasGridSetting(csi);
} }
} }

View File

@ -1,43 +1,44 @@
package com.interplug.qcast.biz.canvasGridSetting; package com.interplug.qcast.biz.canvasGridSetting;
import com.interplug.qcast.biz.canvasGridSetting.dto.CanvasGridSettingInfo; import com.interplug.qcast.biz.canvasGridSetting.dto.CanvasGridSettingInfo;
import com.interplug.qcast.config.Exception.ErrorCode;
import lombok.RequiredArgsConstructor; import com.interplug.qcast.config.Exception.QcastException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class CanvasGridSettingService { public class CanvasGridSettingService {
private final CanvasGridSettingMapper canvasGridSettingMapper; private final CanvasGridSettingMapper canvasGridSettingMapper;
// Canvas Setting 조회(objectNo) // Canvas Setting 조회(objectNo)
public CanvasGridSettingInfo selectCanvasGridSetting(String objectNo) { public CanvasGridSettingInfo selectCanvasGridSetting(String objectNo) throws QcastException {
return canvasGridSettingMapper.selectCanvasGridSetting(objectNo); try {
} return canvasGridSettingMapper.selectCanvasGridSetting(objectNo);
} catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
}
}
// Canvas Setting 등록 // Canvas Setting 등록
public Map<String, String> insertCanvasGridSetting(CanvasGridSettingInfo csi) { public Map<String, String> insertCanvasGridSetting(CanvasGridSettingInfo csi)
throws QcastException {
Map<String, String> response = new HashMap<>(); Map<String, String> response = new HashMap<>();
try { try {
canvasGridSettingMapper.insertCanvasGridSetting(csi); canvasGridSettingMapper.insertCanvasGridSetting(csi);
response.put("objectNo", csi.getObjectNo()); response.put("objectNo", csi.getObjectNo());
response.put("returnMessage", "common.message.confirm.mark"); response.put("returnMessage", "common.message.confirm.mark");
} catch (Exception e) { } catch (Exception e) {
response.put("objectNo", csi.getObjectNo()); throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
response.put("returnMessage", "common.message.save.error"); }
}
// 생성된 objectNo 반환
return response;
}
// 생성된 objectNo 반환
return response;
}
} }

View File

@ -2,14 +2,11 @@ package com.interplug.qcast.biz.canvasSetting;
import com.interplug.qcast.biz.canvasSetting.dto.CanvasSettingInfo; import com.interplug.qcast.biz.canvasSetting.dto.CanvasSettingInfo;
import com.interplug.qcast.config.Exception.QcastException; import com.interplug.qcast.config.Exception.QcastException;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.Map;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.Map;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -23,30 +20,31 @@ public class CanvasSettingController {
@Operation(description = "Canvas Setting 정보를 조회 한다.") @Operation(description = "Canvas Setting 정보를 조회 한다.")
@GetMapping("/canvas-settings/by-object/{objectNo}") @GetMapping("/canvas-settings/by-object/{objectNo}")
public CanvasSettingInfo selectCanvasSetting(@PathVariable String objectNo) { public CanvasSettingInfo selectCanvasSetting(@PathVariable String objectNo)
throws QcastException {
log.debug("Setting 조회 ::::: " + objectNo); log.debug("Setting 조회 ::::: " + objectNo);
return canvasSettingService.selectCanvasSetting(objectNo); return canvasSettingService.selectCanvasSetting(objectNo);
} }
@Operation(description = "Canvas Setting 정보를 등록 한다.") @Operation(description = "Canvas Setting 정보를 등록 한다.")
@PostMapping("/canvas-settings") @PostMapping("/canvas-settings")
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
public Map<String, String> insertCanvasSetting(@RequestBody CanvasSettingInfo csi) throws QcastException { public Map<String, String> insertCanvasSetting(@RequestBody CanvasSettingInfo csi)
throws QcastException {
log.debug("Setting 등록 ::::: " + csi.getObjectNo()); log.debug("Setting 등록 ::::: " + csi.getObjectNo());
return canvasSettingService.insertCanvasSetting(csi); return canvasSettingService.insertCanvasSetting(csi);
} }
@Operation(description = "Canvas Setting 정보를 수정 한다.") @Operation(description = "Canvas Setting 정보를 수정 한다.")
@PutMapping("/canvas-settings") @PutMapping("/canvas-settings")
public void updateCanvasStatus(@RequestBody CanvasSettingInfo csi) { public void updateCanvasStatus(@RequestBody CanvasSettingInfo csi) throws QcastException {
log.debug("Setting 수정 ::::: " + csi.getObjectNo()); log.debug("Setting 수정 ::::: " + csi.getObjectNo());
canvasSettingService.updateCanvasSetting(csi); canvasSettingService.updateCanvasSetting(csi);
} }
} }

View File

@ -3,65 +3,61 @@ package com.interplug.qcast.biz.canvasSetting;
import com.interplug.qcast.biz.canvasSetting.dto.CanvasSettingInfo; import com.interplug.qcast.biz.canvasSetting.dto.CanvasSettingInfo;
import com.interplug.qcast.config.Exception.ErrorCode; import com.interplug.qcast.config.Exception.ErrorCode;
import com.interplug.qcast.config.Exception.QcastException; import com.interplug.qcast.config.Exception.QcastException;
import lombok.RequiredArgsConstructor;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class CanvasSettingService { public class CanvasSettingService {
private final CanvasSettingMapper canvasSettingMapper; private final CanvasSettingMapper canvasSettingMapper;
// Canvas Setting 조회(objectNo) // Canvas Setting 조회(objectNo)
public CanvasSettingInfo selectCanvasSetting(String objectNo) { public CanvasSettingInfo selectCanvasSetting(String objectNo) throws QcastException {
return canvasSettingMapper.selectCanvasSetting(objectNo); try {
} return canvasSettingMapper.selectCanvasSetting(objectNo);
} catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
}
}
// Canvas Setting 등록 // Canvas Setting 등록
public Map<String, String> insertCanvasSetting(CanvasSettingInfo csi) throws QcastException { public Map<String, String> insertCanvasSetting(CanvasSettingInfo csi) throws QcastException {
Map<String, String> response = new HashMap<>(); Map<String, String> response = new HashMap<>();
if (csi.getObjectNo() == null) { if (csi.getObjectNo() == null) {
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
} }
try { try {
// 먼저 데이터가 존재하는지 확인 // 먼저 데이터가 존재하는지 확인
CanvasSettingInfo cntData = canvasSettingMapper.getCanvasSettingCnt(csi.getObjectNo()); CanvasSettingInfo cntData = canvasSettingMapper.getCanvasSettingCnt(csi.getObjectNo());
// 데이터가 존재하지 않으면 insert // 데이터가 존재하지 않으면 insert
if (cntData.getCnt().intValue() < 1) { if (cntData.getCnt().intValue() < 1) {
canvasSettingMapper.insertCanvasSetting(csi); canvasSettingMapper.insertCanvasSetting(csi);
} else {
canvasSettingMapper.updateCanvasSetting(csi);
}
response.put("objectNo", csi.getObjectNo());
response.put("returnMessage", "common.message.confirm.mark");
} catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
}
response.put("objectNo", csi.getObjectNo()); // 생성된 objectNo 반환
response.put("returnMessage", "common.message.confirm.mark"); return response;
}
} else {
canvasSettingMapper.updateCanvasSetting(csi);
response.put("objectNo", csi.getObjectNo());
response.put("returnMessage", "common.message.confirm.mark");
}
} catch (Exception e) {
response.put("objectNo", csi.getObjectNo());
response.put("returnMessage", "common.message.save.error");
}
// 생성된 objectNo 반환
return response;
}
// Canvas Setting 수정
public void updateCanvasSetting(CanvasSettingInfo csi) {
canvasSettingMapper.updateCanvasSetting(csi);
}
// Canvas Setting 수정
public void updateCanvasSetting(CanvasSettingInfo csi) throws QcastException {
try {
canvasSettingMapper.updateCanvasSetting(csi);
} catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
}
}
} }

View File

@ -8,6 +8,7 @@ import com.interplug.qcast.config.Exception.QcastException;
import java.util.List; import java.util.List;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@ -18,10 +19,15 @@ public class CanvasStatusService {
public List<CanvasStatusResponse> selectAllCanvasStatus(String userId) throws QcastException { public List<CanvasStatusResponse> selectAllCanvasStatus(String userId) throws QcastException {
List<CanvasStatusResponse> result = null; List<CanvasStatusResponse> result = null;
if (userId != null && !userId.trim().isEmpty()) { try {
result = canvasStatusMapper.selectAllCanvasStatus(userId); if (userId != null && !userId.trim().isEmpty()) {
} else { result = canvasStatusMapper.selectAllCanvasStatus(userId);
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); } else {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
}
} catch (Exception e) {
if (e instanceof QcastException) throw e;
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
} }
return result; return result;
@ -32,10 +38,15 @@ public class CanvasStatusService {
throws QcastException { throws QcastException {
List<CanvasStatusResponse> result = null; List<CanvasStatusResponse> result = null;
if (objectNo != null && !objectNo.trim().isEmpty()) { try {
result = canvasStatusMapper.selectObjectNoCanvasStatus(objectNo); if (objectNo != null && !objectNo.trim().isEmpty()) {
} else { result = canvasStatusMapper.selectObjectNoCanvasStatus(objectNo);
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); } else {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
}
} catch (Exception e) {
if (e instanceof QcastException) throw e;
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
} }
return result; return result;
@ -56,7 +67,7 @@ public class CanvasStatusService {
id = maxId.get(0).getId(); id = maxId.get(0).getId();
} catch (Exception e) { } catch (Exception e) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "캔버스 등록 중 오류 발생"); throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
} }
// 생성된 id 반환 // 생성된 id 반환
@ -70,14 +81,19 @@ public class CanvasStatusService {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
} }
// 먼저 데이터가 존재하는지 확인 try {
List<CanvasStatusResponse> existingStatus = canvasStatusMapper.getIdCanvasStatus(cs.getId()); // 먼저 데이터가 존재하는지 확인
List<CanvasStatusResponse> existingStatus = canvasStatusMapper.getIdCanvasStatus(cs.getId());
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐 // 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
if (existingStatus.size() > 0) { if (existingStatus.size() > 0) {
canvasStatusMapper.updateCanvasStatus(cs); canvasStatusMapper.updateCanvasStatus(cs);
} else { } else {
throw new QcastException(ErrorCode.NOT_FOUND, "수정할 캔버스가 존재하지 않습니다."); throw new QcastException(ErrorCode.NOT_FOUND, "수정할 캔버스가 존재하지 않습니다.");
}
} catch (Exception e) {
if (e instanceof QcastException) throw e;
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
} }
} }
@ -88,15 +104,20 @@ public class CanvasStatusService {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
} }
// 먼저 데이터가 존재하는지 확인 try {
List<CanvasStatusResponse> existingStatus = // 먼저 데이터가 존재하는지 확인
canvasStatusMapper.getObjectNoCanvasStatus(objectNo); List<CanvasStatusResponse> existingStatus =
canvasStatusMapper.getObjectNoCanvasStatus(objectNo);
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐 // 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
if (existingStatus.size() > 0) { if (existingStatus.size() > 0) {
canvasStatusMapper.deleteObjectNoCanvasStatus(objectNo); canvasStatusMapper.deleteObjectNoCanvasStatus(objectNo);
} else { } else {
throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 캔버스가 존재하지 않습니다."); throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 캔버스가 존재하지 않습니다.");
}
} catch (Exception e) {
if (e instanceof QcastException) throw e;
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
} }
} }
@ -107,20 +128,26 @@ public class CanvasStatusService {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
} }
// 먼저 데이터가 존재하는지 확인 try {
List<CanvasStatusResponse> existingStatus = canvasStatusMapper.getIdCanvasStatus(id); // 먼저 데이터가 존재하는지 확인
List<CanvasStatusResponse> existingStatus = canvasStatusMapper.getIdCanvasStatus(id);
// 데이터가 존재하지 않으면 처리하지 않고 예외를 던짐 // 데이터가 존재하지 않으면 처리하지 않고 예외를 던짐
if (existingStatus.size() > 0) { if (existingStatus.size() > 0) {
// 데이터를 삭제하는 기존 방식에서 데이터를 삭제하지 않고 deleted 데이터를 바꾸는 방식으로 변경 (2025.02.11) // 데이터를 삭제하는 기존 방식에서 데이터를 삭제하지 않고 deleted 데이터를 바꾸는 방식으로 변경 (2025.02.11)
// canvasStatusMapper.deleteIdCanvasStatus(id); // canvasStatusMapper.deleteIdCanvasStatus(id);
canvasStatusMapper.updateDeletedCanvasStatus(id); canvasStatusMapper.updateDeletedCanvasStatus(id);
} else { } else {
throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 캔버스가 존재하지 않습니다."); throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 캔버스가 존재하지 않습니다.");
}
} catch (Exception e) {
if (e instanceof QcastException) throw e;
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
} }
} }
// 캔버스 복사 등록 // 캔버스 복사 등록
@Transactional
public int copyCanvasStatus(CanvasStatusCopyRequest cs) throws QcastException { public int copyCanvasStatus(CanvasStatusCopyRequest cs) throws QcastException {
try { try {
canvasStatusMapper.copyCanvasStatus(cs); canvasStatusMapper.copyCanvasStatus(cs);

View File

@ -5,9 +5,11 @@ import com.interplug.qcast.config.Exception.ErrorCode;
import com.interplug.qcast.config.Exception.QcastException; import com.interplug.qcast.config.Exception.QcastException;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Transactional(readOnly = true)
public class CanvasPopupStatusService { public class CanvasPopupStatusService {
private final CanvasPopupStatusMapper canvasPopupStatusMapper; private final CanvasPopupStatusMapper canvasPopupStatusMapper;
@ -34,6 +36,7 @@ public class CanvasPopupStatusService {
* @param cps 저장할 CanvasPopupStatus 객체 * @param cps 저장할 CanvasPopupStatus 객체
* @throws QcastException 저장 예외 발생 * @throws QcastException 저장 예외 발생
*/ */
@Transactional
public void saveCanvasPopupStatus(CanvasPopupStatus cps) throws QcastException { public void saveCanvasPopupStatus(CanvasPopupStatus cps) throws QcastException {
CanvasPopupStatus chk = canvasPopupStatusMapper.selectCanvasPopupStatus(cps); CanvasPopupStatus chk = canvasPopupStatusMapper.selectCanvasPopupStatus(cps);
if (chk == null) { if (chk == null) {
@ -49,6 +52,7 @@ public class CanvasPopupStatusService {
* @param cps 생성할 CanvasPopupStatus 객체 * @param cps 생성할 CanvasPopupStatus 객체
* @throws QcastException 생성 예외 발생 * @throws QcastException 생성 예외 발생
*/ */
@Transactional
public void createCanvasPopupStatus(CanvasPopupStatus cps) throws QcastException { public void createCanvasPopupStatus(CanvasPopupStatus cps) throws QcastException {
try { try {
canvasPopupStatusMapper.insertCanvasPopupStatus(cps); canvasPopupStatusMapper.insertCanvasPopupStatus(cps);

View File

@ -1,15 +1,15 @@
package com.interplug.qcast.biz.commCode; package com.interplug.qcast.biz.commCode;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Service;
import com.interplug.qcast.biz.commCode.dto.CodeReq; import com.interplug.qcast.biz.commCode.dto.CodeReq;
import com.interplug.qcast.biz.commCode.dto.CodeRes; import com.interplug.qcast.biz.commCode.dto.CodeRes;
import com.interplug.qcast.biz.commCode.dto.CommCodeRes; import com.interplug.qcast.biz.commCode.dto.CommCodeRes;
import com.interplug.qcast.biz.commCode.dto.DetailCodeRequest; import com.interplug.qcast.biz.commCode.dto.DetailCodeRequest;
import com.interplug.qcast.biz.commCode.dto.HeadCodeRequest; import com.interplug.qcast.biz.commCode.dto.HeadCodeRequest;
import java.util.ArrayList;
import java.util.List;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j @Slf4j
@Service @Service
@ -53,15 +53,20 @@ public class CommCodeService {
public List<CommCodeRes> selectQcastCommCode() { public List<CommCodeRes> selectQcastCommCode() {
List<CodeRes> result = commCodeMapper.selectQcastCommCode(); List<CodeRes> result = commCodeMapper.selectQcastCommCode();
List<CommCodeRes> commCodeList = new ArrayList<>(); List<CommCodeRes> commCodeList = new ArrayList<>();
result.forEach(cr -> { result.forEach(
commCodeList.add(CommCodeRes.builder().clHeadCd(cr.getClHeadCd()).clCode(cr.getClCode()) cr -> {
.clCodeNm(cr.getClCodeNm()).clCodeJp(cr.getClCodeJp()).clPriority(cr.getClPriority()) commCodeList.add(
.build()); CommCodeRes.builder()
}); .clHeadCd(cr.getClHeadCd())
.clCode(cr.getClCode())
.clCodeNm(cr.getClCodeNm())
.clCodeJp(cr.getClCodeJp())
.clPriority(cr.getClPriority())
.build());
});
return commCodeList; return commCodeList;
} }
/** /**
* 헤더코드 동기화 * 헤더코드 동기화
* *
@ -81,7 +86,6 @@ public class CommCodeService {
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
} }
} }
} }
@ -104,8 +108,6 @@ public class CommCodeService {
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
} }
} }
} }
} }

View File

@ -1,12 +1,5 @@
package com.interplug.qcast.biz.community; package com.interplug.qcast.biz.community;
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 com.interplug.qcast.biz.community.dto.BoardRequest; import com.interplug.qcast.biz.community.dto.BoardRequest;
import com.interplug.qcast.biz.community.dto.BoardResponse; import com.interplug.qcast.biz.community.dto.BoardResponse;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@ -14,6 +7,13 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; 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;
@Slf4j @Slf4j
@RestController @RestController
@ -41,9 +41,11 @@ public class BoardController {
@Operation(description = "커뮤니티(공지사항, FAQ, 자료다운로드) 파일 다운로드를 진행한다.") @Operation(description = "커뮤니티(공지사항, FAQ, 자료다운로드) 파일 다운로드를 진행한다.")
@GetMapping("/file/download") @GetMapping("/file/download")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
public void getFileDownload(HttpServletResponse response, public void getFileDownload(
@RequestParam(required = true) String keyNo, @RequestParam String zipYn) throws Exception { HttpServletResponse response,
@RequestParam(required = true) String keyNo,
@RequestParam String zipYn)
throws Exception {
boardService.getFileDownload(response, keyNo, zipYn); boardService.getFileDownload(response, keyNo, zipYn);
} }
} }

View File

@ -1,17 +1,5 @@
package com.interplug.qcast.biz.community; package com.interplug.qcast.biz.community;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Service;
import org.springframework.util.StreamUtils;
import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.interplug.qcast.biz.community.dto.BoardRequest; import com.interplug.qcast.biz.community.dto.BoardRequest;
@ -21,8 +9,20 @@ import com.interplug.qcast.config.Exception.QcastException;
import com.interplug.qcast.config.message.Messages; import com.interplug.qcast.config.message.Messages;
import com.interplug.qcast.util.InterfaceQsp; import com.interplug.qcast.util.InterfaceQsp;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; 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 org.springframework.util.StreamUtils;
import org.springframework.web.util.UriComponentsBuilder;
@Slf4j @Slf4j
@Service @Service
@ -30,8 +30,7 @@ import lombok.extern.slf4j.Slf4j;
public class BoardService { public class BoardService {
private final InterfaceQsp interfaceQsp; private final InterfaceQsp interfaceQsp;
@Autowired @Autowired Messages message;
Messages message;
@Value("${qsp.url}") @Value("${qsp.url}")
private String QSP_API_URL; private String QSP_API_URL;
@ -50,12 +49,14 @@ public class BoardService {
/* [0]. Validation Check */ /* [0]. Validation Check */
if ("".equals(boardRequest.getSchNoticeClsCd())) { if ("".equals(boardRequest.getSchNoticeClsCd())) {
// [msg] {0} is required input value. // [msg] {0} is required input value.
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Notice Cls Code")); message.getMessage("common.message.required.data", "Notice Cls Code"));
} }
if ("".equals(boardRequest.getSchNoticeTpCd())) { if ("".equals(boardRequest.getSchNoticeTpCd())) {
// [msg] {0} is required input value. // [msg] {0} is required input value.
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Notice Type Code")); message.getMessage("common.message.required.data", "Notice Type Code"));
} }
@ -66,14 +67,17 @@ public class BoardService {
} }
String url = QSP_API_URL + "/api/board/list"; String url = QSP_API_URL + "/api/board/list";
String apiUrl = UriComponentsBuilder.fromHttpUrl(url) String apiUrl =
.queryParam("noticeNo", boardRequest.getNoticeNo()).queryParam("schTitle", encodedSchTitle) UriComponentsBuilder.fromHttpUrl(url)
.queryParam("schNoticeTpCd", boardRequest.getSchNoticeTpCd()) .queryParam("noticeNo", boardRequest.getNoticeNo())
.queryParam("schNoticeClsCd", boardRequest.getSchNoticeClsCd()) .queryParam("schTitle", encodedSchTitle)
.queryParam("startRow", boardRequest.getStartRow()) .queryParam("schNoticeTpCd", boardRequest.getSchNoticeTpCd())
.queryParam("endRow", boardRequest.getEndRow()) .queryParam("schNoticeClsCd", boardRequest.getSchNoticeClsCd())
.queryParam("schMainYn", boardRequest.getSchMainYn()).build().toUriString(); .queryParam("startRow", boardRequest.getStartRow())
.queryParam("endRow", boardRequest.getEndRow())
.queryParam("schMainYn", boardRequest.getSchMainYn())
.build()
.toUriString();
/* [2]. QSP API CALL -> Response */ /* [2]. QSP API CALL -> Response */
String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null); String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null);
@ -105,14 +109,18 @@ public class BoardService {
/* [0]. Validation Check */ /* [0]. Validation Check */
if (boardRequest.getNoticeNo() == null) { if (boardRequest.getNoticeNo() == null) {
// [msg] {0} is required input value. // [msg] {0} is required input value.
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Notice No")); message.getMessage("common.message.required.data", "Notice No"));
} }
/* [1]. QSP API (url + param) Setting */ /* [1]. QSP API (url + param) Setting */
String url = QSP_API_URL + "/api/board/detail"; String url = QSP_API_URL + "/api/board/detail";
String apiUrl = UriComponentsBuilder.fromHttpUrl(url) String apiUrl =
.queryParam("noticeNo", boardRequest.getNoticeNo()).build().toUriString(); UriComponentsBuilder.fromHttpUrl(url)
.queryParam("noticeNo", boardRequest.getNoticeNo())
.build()
.toUriString();
/* [2]. QSP API CALL -> Response */ /* [2]. QSP API CALL -> Response */
String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null); String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null);
@ -144,8 +152,8 @@ public class BoardService {
if ("".equals(keyNo)) { if ("".equals(keyNo)) {
// [msg] {0} is required input value. // [msg] {0} is required input value.
String arg = "Y".equals(zipYn) ? "Notice No" : "File No"; String arg = "Y".equals(zipYn) ? "Notice No" : "File No";
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
message.getMessage("common.message.required.data", arg)); ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", arg));
} }
/* [1]. QSP API (url + fileNo) Setting */ /* [1]. QSP API (url + fileNo) Setting */
@ -165,9 +173,11 @@ public class BoardService {
/* [3]. API 응답 파일 처리 */ /* [3]. API 응답 파일 처리 */
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition"); response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setContentType( response.setContentType(
!"".equals(result.get("type")) && result.get("type") != null ? result.get("type") !"".equals(result.get("type")) && result.get("type") != null
? result.get("type")
: "application/octet-stream"); : "application/octet-stream");
response.setHeader("Content-Disposition", response.setHeader(
"Content-Disposition",
!"".equals(result.get("disposition")) && result.get("disposition") != null !"".equals(result.get("disposition")) && result.get("disposition") != null
? result.get("disposition") ? result.get("disposition")
: "attachment;"); : "attachment;");
@ -180,14 +190,15 @@ public class BoardService {
} catch (Exception e) { } catch (Exception e) {
// [msg] File download error // [msg] File download error
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, throw new QcastException(
ErrorCode.INTERNAL_SERVER_ERROR,
message.getMessage("common.message.file.download.error")); message.getMessage("common.message.file.download.error"));
} }
} else { } else {
// [msg] File does not exist. // [msg] File does not exist.
throw new QcastException(ErrorCode.NOT_FOUND, throw new QcastException(
message.getMessage("common.message.file.download.exists")); ErrorCode.NOT_FOUND, message.getMessage("common.message.file.download.exists"));
} }
} }
} }

View File

@ -4,6 +4,7 @@ import com.interplug.qcast.biz.displayItem.dto.DisplayItemRequest;
import com.interplug.qcast.biz.displayItem.dto.ItemDetailResponse; import com.interplug.qcast.biz.displayItem.dto.ItemDetailResponse;
import com.interplug.qcast.biz.displayItem.dto.ItemRequest; import com.interplug.qcast.biz.displayItem.dto.ItemRequest;
import com.interplug.qcast.biz.displayItem.dto.ItemResponse; import com.interplug.qcast.biz.displayItem.dto.ItemResponse;
import com.interplug.qcast.config.Exception.QcastException;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List; import java.util.List;
@ -30,13 +31,13 @@ public class DisplayItemController {
* 전시제품 정보 등록/수정 * 전시제품 정보 등록/수정
* *
* @param displayItemRequest * @param displayItemRequest
* @throws Exception * @throws QcastException
*/ */
@Operation(description = "전시제품 정보를 등록/수정한다. (동기화)") @Operation(description = "전시제품 정보를 등록/수정한다. (동기화)")
@PostMapping("/display-item-save") @PostMapping("/display-item-save")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
public void setStoreDisplayItemSave(@RequestBody DisplayItemRequest displayItemRequest) public void setStoreDisplayItemSave(@RequestBody DisplayItemRequest displayItemRequest)
throws Exception { throws QcastException {
displayItemService.setStoreDisplayItemSave(displayItemRequest); displayItemService.setStoreDisplayItemSave(displayItemRequest);
} }
@ -45,12 +46,13 @@ public class DisplayItemController {
* *
* @param itemRequest * @param itemRequest
* @return * @return
* @throws Exception * @throws QcastException
*/ */
@Operation(description = "제품 목록을 조회한다.") @Operation(description = "제품 목록을 조회한다.")
@PostMapping("/item-list") @PostMapping("/item-list")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
public List<ItemResponse> getItemList(@RequestBody ItemRequest itemRequest) throws Exception { public List<ItemResponse> getItemList(@RequestBody ItemRequest itemRequest)
throws QcastException {
return displayItemService.getItemList(itemRequest); return displayItemService.getItemList(itemRequest);
} }
@ -59,12 +61,12 @@ public class DisplayItemController {
* *
* @param itemId * @param itemId
* @return * @return
* @throws Exception * @throws QcastException
*/ */
@Operation(description = "제품 상세 정보를 조회한다.") @Operation(description = "제품 상세 정보를 조회한다.")
@GetMapping("/item-detail") @GetMapping("/item-detail")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
public ItemDetailResponse getItemDetail(@RequestParam String itemId) throws Exception { public ItemDetailResponse getItemDetail(@RequestParam String itemId) throws QcastException {
return displayItemService.getItemDetail(itemId); return displayItemService.getItemDetail(itemId);
} }
} }

View File

@ -4,6 +4,8 @@ import com.interplug.qcast.biz.displayItem.dto.*;
import com.interplug.qcast.biz.estimate.EstimateMapper; import com.interplug.qcast.biz.estimate.EstimateMapper;
import com.interplug.qcast.biz.estimate.dto.NoteRequest; import com.interplug.qcast.biz.estimate.dto.NoteRequest;
import com.interplug.qcast.biz.estimate.dto.NoteResponse; import com.interplug.qcast.biz.estimate.dto.NoteResponse;
import com.interplug.qcast.config.Exception.ErrorCode;
import com.interplug.qcast.config.Exception.QcastException;
import io.micrometer.common.util.StringUtils; import io.micrometer.common.util.StringUtils;
import java.util.List; import java.util.List;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -23,10 +25,14 @@ public class DisplayItemService {
* 판매점 노출 아이템 정보 저장 * 판매점 노출 아이템 정보 저장
* *
* @param displayItemRequest * @param displayItemRequest
* @throws Exception * @throws QcastException
*/ */
public void setStoreDisplayItemSave(DisplayItemRequest displayItemRequest) throws Exception { public void setStoreDisplayItemSave(DisplayItemRequest displayItemRequest) throws QcastException {
displayItemMapper.setStoreDisplayItemSave(displayItemRequest); try {
displayItemMapper.setStoreDisplayItemSave(displayItemRequest);
} catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
}
} }
/** /**
@ -34,9 +40,14 @@ public class DisplayItemService {
* *
* @param itemRequest * @param itemRequest
* @return * @return
* @throws QcastException
*/ */
public List<ItemResponse> getItemList(ItemRequest itemRequest) { public List<ItemResponse> getItemList(ItemRequest itemRequest) throws QcastException {
return displayItemMapper.getItemList(itemRequest); try {
return displayItemMapper.getItemList(itemRequest);
} catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
}
} }
/** /**
@ -45,36 +56,39 @@ public class DisplayItemService {
* @param itemId * @param itemId
* @return * @return
*/ */
public ItemDetailResponse getItemDetail(String itemId) { public ItemDetailResponse getItemDetail(String itemId) throws QcastException {
try {
ItemDetailResponse itemDetailResponse = displayItemMapper.getItemDetail(itemId);
ItemDetailResponse itemDetailResponse = displayItemMapper.getItemDetail(itemId); if (itemDetailResponse != null) {
// BOM 헤더 아이템인 경우 BOM List를 내려준다.
if ("ERLA".equals(itemDetailResponse.getItemCtgGr())) {
List<ItemResponse> itemBomList = displayItemMapper.selectItemBomList(itemId);
if (itemDetailResponse != null) { itemDetailResponse.setItemBomList(itemBomList);
// BOM 헤더 아이템인 경우 BOM List를 내려준다. }
if ("ERLA".equals(itemDetailResponse.getItemCtgGr())) {
List<ItemResponse> itemBomList = displayItemMapper.selectItemBomList(itemId);
itemDetailResponse.setItemBomList(itemBomList); // 견적특이사항 관련 데이터 셋팅
String[] arrItemId = {itemId};
NoteRequest noteRequest = new NoteRequest();
noteRequest.setArrItemId(arrItemId);
noteRequest.setSchSpnTypeCd("PROD");
List<NoteResponse> noteItemList = estimateMapper.selectEstimateNoteItemList(noteRequest);
String spnAttrCds = "";
for (NoteResponse noteResponse : noteItemList) {
spnAttrCds += !StringUtils.isEmpty(spnAttrCds) ? "" : "";
spnAttrCds += noteResponse.getCode();
}
itemDetailResponse.setSpnAttrCds(spnAttrCds);
} }
// 견적특이사항 관련 데이터 셋팅 return itemDetailResponse;
String[] arrItemId = {itemId}; } catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, e.getMessage());
NoteRequest noteRequest = new NoteRequest();
noteRequest.setArrItemId(arrItemId);
noteRequest.setSchSpnTypeCd("PROD");
List<NoteResponse> noteItemList = estimateMapper.selectEstimateNoteItemList(noteRequest);
String spnAttrCds = "";
for (NoteResponse noteResponse : noteItemList) {
spnAttrCds += !StringUtils.isEmpty(spnAttrCds) ? "" : "";
spnAttrCds += noteResponse.getCode();
}
itemDetailResponse.setSpnAttrCds(spnAttrCds);
} }
return itemDetailResponse;
} }
/** /**
@ -144,5 +158,4 @@ public class DisplayItemService {
} }
} }
} }
} }

View File

@ -74,5 +74,4 @@ public class ExcelDownController {
log.error(e.getMessage()); log.error(e.getMessage());
} }
} }
} }

View File

@ -51,7 +51,7 @@ public class FileController {
public List<FileRequest> fileUpload( public List<FileRequest> fileUpload(
HttpServletRequest request, HttpServletResponse response, FileRequest fileRequest) HttpServletRequest request, HttpServletResponse response, FileRequest fileRequest)
throws Exception { throws Exception {
return fileService.fileUpload(request,fileRequest); return fileService.fileUpload(request, fileRequest);
} }
@Operation(description = "파일을 삭제 한다.") @Operation(description = "파일을 삭제 한다.")

View File

@ -1,21 +1,5 @@
package com.interplug.qcast.biz.login; package com.interplug.qcast.biz.login;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import com.interplug.qcast.biz.login.dto.JoinUser; import com.interplug.qcast.biz.login.dto.JoinUser;
import com.interplug.qcast.biz.login.dto.LoginUser; import com.interplug.qcast.biz.login.dto.LoginUser;
import com.interplug.qcast.biz.login.dto.UserLoginResponse; import com.interplug.qcast.biz.login.dto.UserLoginResponse;
@ -26,8 +10,24 @@ import com.interplug.qcast.config.Exception.QcastException;
import com.interplug.qcast.config.message.Messages; import com.interplug.qcast.config.message.Messages;
import com.interplug.qcast.util.DefaultResponse; import com.interplug.qcast.util.DefaultResponse;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
@Slf4j @Slf4j
@RestController @RestController
@ -37,8 +37,7 @@ public class LoginController {
// @Autowired private LoginService loginService; // @Autowired private LoginService loginService;
private final LoginService loginService; private final LoginService loginService;
@Autowired @Autowired Messages message;
Messages message;
@Value("${qsp.aes256.key}") @Value("${qsp.aes256.key}")
String loginPasswordAesKey; String loginPasswordAesKey;
@ -46,7 +45,6 @@ public class LoginController {
@Value("${qsp.auto.login.aes256.key}") @Value("${qsp.auto.login.aes256.key}")
String autoLoginAesKey; String autoLoginAesKey;
/** /**
* Q.CAST III에 로그인하여 사용자 정보를 획득한다. * Q.CAST III에 로그인하여 사용자 정보를 획득한다.
* *
@ -121,7 +119,8 @@ public class LoginController {
String loginEncryptId = ""; String loginEncryptId = "";
if ("".equals(loginUser.getLoginId()) || loginUser.getLoginId() == null) { if ("".equals(loginUser.getLoginId()) || loginUser.getLoginId() == null) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "User Id")); message.getMessage("common.message.required.data", "User Id"));
} }
@ -136,16 +135,19 @@ public class LoginController {
byte[] keyData = loginPasswordAesKey.getBytes(); byte[] keyData = loginPasswordAesKey.getBytes();
SecretKey secureKey = new SecretKeySpec(keyData, "AES"); SecretKey secureKey = new SecretKeySpec(keyData, "AES");
Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding"); Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding");
c.init(Cipher.ENCRYPT_MODE, secureKey, c.init(
Cipher.ENCRYPT_MODE,
secureKey,
new IvParameterSpec(encryptKey.substring(0, 16).getBytes())); new IvParameterSpec(encryptKey.substring(0, 16).getBytes()));
byte[] encrypted = c.doFinal(loginUser.getLoginId().getBytes("UTF-8")); byte[] encrypted = c.doFinal(loginUser.getLoginId().getBytes("UTF-8"));
// [2]. 암호화 셋팅 // [2]. 암호화 셋팅
loginEncryptId = new String(Base64.getEncoder().encode(encrypted));; loginEncryptId = new String(Base64.getEncoder().encode(encrypted));
;
} catch (Exception e) { } catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, throw new QcastException(
message.getMessage("common.message.error")); ErrorCode.INTERNAL_SERVER_ERROR, message.getMessage("common.message.error"));
} }
return loginEncryptId; return loginEncryptId;
@ -165,7 +167,8 @@ public class LoginController {
String loginDecryptId = ""; String loginDecryptId = "";
if ("".equals(loginUser.getLoginId()) || loginUser.getLoginId() == null) { if ("".equals(loginUser.getLoginId()) || loginUser.getLoginId() == null) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "User Id")); message.getMessage("common.message.required.data", "User Id"));
} }
@ -180,7 +183,9 @@ public class LoginController {
byte[] keyData = loginPasswordAesKey.getBytes(); byte[] keyData = loginPasswordAesKey.getBytes();
SecretKey secureKey = new SecretKeySpec(keyData, "AES"); SecretKey secureKey = new SecretKeySpec(keyData, "AES");
Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding"); Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding");
c.init(Cipher.DECRYPT_MODE, secureKey, c.init(
Cipher.DECRYPT_MODE,
secureKey,
new IvParameterSpec(decryptKey.substring(0, 16).getBytes("UTF-8"))); new IvParameterSpec(decryptKey.substring(0, 16).getBytes("UTF-8")));
byte[] byteStr = Base64.getDecoder().decode(loginUser.getLoginId().getBytes()); byte[] byteStr = Base64.getDecoder().decode(loginUser.getLoginId().getBytes());
@ -189,11 +194,10 @@ public class LoginController {
loginDecryptId = new String(c.doFinal(byteStr), "UTF-8"); loginDecryptId = new String(c.doFinal(byteStr), "UTF-8");
} catch (Exception e) { } catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, throw new QcastException(
message.getMessage("common.message.error")); ErrorCode.INTERNAL_SERVER_ERROR, message.getMessage("common.message.error"));
} }
return loginDecryptId; return loginDecryptId;
} }
} }

View File

@ -1,9 +1,5 @@
package com.interplug.qcast.biz.login; 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.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.interplug.qcast.biz.login.dto.JoinUser; import com.interplug.qcast.biz.login.dto.JoinUser;
@ -18,6 +14,10 @@ import com.interplug.qcast.util.DefaultResponse;
import com.interplug.qcast.util.InterfaceQsp; import com.interplug.qcast.util.InterfaceQsp;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; 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;
@Slf4j @Slf4j
@Service @Service
@ -30,8 +30,7 @@ public class LoginService {
@Value("${qsp.url}") @Value("${qsp.url}")
private String qspUrl; private String qspUrl;
@Autowired @Autowired Messages message;
Messages message;
/** /**
* 로그인 처리 * 로그인 처리
@ -42,11 +41,13 @@ public class LoginService {
*/ */
public UserLoginResponse getLogin(LoginUser loginUser) throws Exception { public UserLoginResponse getLogin(LoginUser loginUser) throws Exception {
if (loginUser.getLoginId() == null || "".equals(loginUser.getLoginId())) if (loginUser.getLoginId() == null || "".equals(loginUser.getLoginId()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Login Id")); message.getMessage("common.message.required.data", "Login Id"));
if (loginUser.getPwd() == null || "".equals(loginUser.getPwd())) if (loginUser.getPwd() == null || "".equals(loginUser.getPwd()))
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"));
UserLoginResponse userLoginResponse = null; UserLoginResponse userLoginResponse = null;
@ -79,35 +80,42 @@ public class LoginService {
*/ */
public DefaultResponse joinUser(JoinUser joinUser) throws Exception { public DefaultResponse joinUser(JoinUser joinUser) throws Exception {
if (joinUser.getStoreQcastNm() == null || "".equals(joinUser.getStoreQcastNm())) if (joinUser.getStoreQcastNm() == null || "".equals(joinUser.getStoreQcastNm()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Store QCast Name")); message.getMessage("common.message.required.data", "Store QCast Name"));
if (joinUser.getStoreQcastNmKana() == null || "".equals(joinUser.getStoreQcastNmKana())) if (joinUser.getStoreQcastNmKana() == null || "".equals(joinUser.getStoreQcastNmKana()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Store QCast Name Kana")); message.getMessage("common.message.required.data", "Store QCast Name Kana"));
if (joinUser.getPostCd() == null || "".equals(joinUser.getPostCd())) if (joinUser.getPostCd() == null || "".equals(joinUser.getPostCd()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Postal Code")); message.getMessage("common.message.required.data", "Postal Code"));
if (joinUser.getAddr() == null || "".equals(joinUser.getAddr())) if (joinUser.getAddr() == null || "".equals(joinUser.getAddr()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Address")); message.getMessage("common.message.required.data", "Address"));
if (joinUser.getTelNo() == null || "".equals(joinUser.getTelNo())) if (joinUser.getTelNo() == null || "".equals(joinUser.getTelNo()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Telephone")); message.getMessage("common.message.required.data", "Telephone"));
if (joinUser.getFax() == null || "".equals(joinUser.getFax())) if (joinUser.getFax() == null || "".equals(joinUser.getFax()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
message.getMessage("common.message.required.data", "Fax")); ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Fax"));
if (joinUser.getUserInfo().getUserId() == null || "".equals(joinUser.getUserInfo().getUserId())) if (joinUser.getUserInfo().getUserId() == null || "".equals(joinUser.getUserInfo().getUserId()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "User Id")); message.getMessage("common.message.required.data", "User Id"));
if (joinUser.getUserInfo().getUserNm() == null || "".equals(joinUser.getUserInfo().getUserNm())) if (joinUser.getUserInfo().getUserNm() == null || "".equals(joinUser.getUserInfo().getUserNm()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Name")); message.getMessage("common.message.required.data", "Name"));
// if (joinUser.getUserInfo().getUserNmKana() == null // if (joinUser.getUserInfo().getUserNmKana() == null
@ -116,15 +124,17 @@ public class LoginService {
// message.getMessage("common.message.required.data", "Name Kana")); // message.getMessage("common.message.required.data", "Name Kana"));
if (joinUser.getUserInfo().getTelNo() == null || "".equals(joinUser.getUserInfo().getTelNo())) if (joinUser.getUserInfo().getTelNo() == null || "".equals(joinUser.getUserInfo().getTelNo()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Telephone")); message.getMessage("common.message.required.data", "Telephone"));
if (joinUser.getUserInfo().getFax() == null || "".equals(joinUser.getUserInfo().getFax())) if (joinUser.getUserInfo().getFax() == null || "".equals(joinUser.getUserInfo().getFax()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
message.getMessage("common.message.required.data", "Fax")); ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Fax"));
if (joinUser.getUserInfo().getEmail() == null || "".equals(joinUser.getUserInfo().getEmail())) if (joinUser.getUserInfo().getEmail() == null || "".equals(joinUser.getUserInfo().getEmail()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "E-Mail")); message.getMessage("common.message.required.data", "E-Mail"));
// QSP API Call.. // QSP API Call..
@ -152,11 +162,13 @@ public class LoginService {
*/ */
public DefaultResponse initPassword(UserPassword userPassword) throws Exception { public DefaultResponse initPassword(UserPassword userPassword) throws Exception {
if (userPassword.getLoginId() == null || "".equals(userPassword.getLoginId())) if (userPassword.getLoginId() == null || "".equals(userPassword.getLoginId()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Login Id")); message.getMessage("common.message.required.data", "Login Id"));
if (userPassword.getEmail() == null || "".equals(userPassword.getEmail())) if (userPassword.getEmail() == null || "".equals(userPassword.getEmail()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "E-Mail")); message.getMessage("common.message.required.data", "E-Mail"));
// QSP API Call.. // QSP API Call..
@ -184,15 +196,18 @@ public class LoginService {
*/ */
public DefaultResponse changePassword(UserPassword userPassword) throws Exception { public DefaultResponse changePassword(UserPassword userPassword) throws Exception {
if (userPassword.getLoginId() == null || "".equals(userPassword.getLoginId())) if (userPassword.getLoginId() == null || "".equals(userPassword.getLoginId()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Login Id")); message.getMessage("common.message.required.data", "Login Id"));
if (userPassword.getChgType() == null || "".equals(userPassword.getChgType())) if (userPassword.getChgType() == null || "".equals(userPassword.getChgType()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Change Type (I :Init , C: Change)")); message.getMessage("common.message.required.data", "Change Type (I :Init , C: Change)"));
if (userPassword.getChgPwd() == null || "".equals(userPassword.getChgPwd())) if (userPassword.getChgPwd() == null || "".equals(userPassword.getChgPwd()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Change Password")); message.getMessage("common.message.required.data", "Change Password"));
// QSP API Call.. // QSP API Call..

View File

@ -34,5 +34,4 @@ public class MyInfoController {
public MyInfoResponse getMyInfo(@ModelAttribute MyInfoRequest myInfoRequest) { public MyInfoResponse getMyInfo(@ModelAttribute MyInfoRequest myInfoRequest) {
return myInfoService.getMyInfo(myInfoRequest); return myInfoService.getMyInfo(myInfoRequest);
} }
} }

View File

@ -22,5 +22,4 @@ public class MyInfoService {
public MyInfoResponse getMyInfo(MyInfoRequest myInfoRequest) { public MyInfoResponse getMyInfo(MyInfoRequest myInfoRequest) {
return myInfoMapper.selectMyInfo(myInfoRequest); return myInfoMapper.selectMyInfo(myInfoRequest);
} }
} }

View File

@ -49,5 +49,4 @@ public class SpecialNoteController {
throws Exception { throws Exception {
specialNoteService.setSpecialNoteItemSave(specialNoteItemRequest); specialNoteService.setSpecialNoteItemSave(specialNoteItemRequest);
} }
} }

View File

@ -69,5 +69,4 @@ public class SpecialNoteService {
} }
} }
} }
} }

View File

@ -32,10 +32,8 @@ public class StoreFavoriteController {
int resultCnt = storeFavService.setStoreFavoriteSave(req); int resultCnt = storeFavService.setStoreFavoriteSave(req);
if (resultCnt > 0) if (resultCnt > 0) userResponse.setCode("200");
userResponse.setCode("200"); else userResponse.setCode("500");
else
userResponse.setCode("500");
return userResponse; return userResponse;
} }
@ -47,5 +45,4 @@ public class StoreFavoriteController {
throws Exception { throws Exception {
return storeFavService.getStoreFavoriteList(req); return storeFavService.getStoreFavoriteList(req);
} }
} }