mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 02:32:20 +09:00
admin Chrglist 수정/삭제부분+ Vue
This commit is contained in:
@@ -31,6 +31,8 @@ import kr.co.uplus.ez.api.custMgt.dto.CarryOverListReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.CarryOverListResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.ChrgListReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.ChrgListResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.DeleteChrgReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.DeleteChrgResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.DeleteMemoReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.DeleteMemoResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.DeleteUserReqDto;
|
||||
@@ -59,6 +61,8 @@ import kr.co.uplus.ez.api.custMgt.dto.UpdateAdminInfoReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.UpdateAdminInfoResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.UpdateAdminInfoTotalReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.UpdateAdminInfoTotalResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.UpdateChrgReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.UpdateChrgResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.UpdateUserReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.UpdateUserResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.UserLmtListExcelReqDto;
|
||||
@@ -68,6 +72,7 @@ import kr.co.uplus.ez.api.custMgt.dto.UserLmtListResDto;
|
||||
import kr.co.uplus.ez.common.components.ValidComponents;
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ApiResponseMessage;
|
||||
import lombok.val;
|
||||
|
||||
/**
|
||||
* 고객관리 Controller.
|
||||
@@ -528,6 +533,47 @@ public class CustMgtController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* date : 2023. 3. 15.
|
||||
* auth : won
|
||||
* desc : 충전관리 수정
|
||||
* @param UpdateChrgReqDto
|
||||
* @return UpdateChrgResDto
|
||||
*/
|
||||
@ApiOperation(value="updateChrg", notes = "충전관리 수정")
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS")
|
||||
})
|
||||
@RequestMapping(value="/updateChrg", method= {RequestMethod.POST})
|
||||
@ResponseBody
|
||||
public UpdateChrgResDto updateChrg(@RequestBody @Valid UpdateChrgReqDto updateChrgReqDto, BindingResult bindingResult) {
|
||||
if(validComponents.validParameter(bindingResult)) {
|
||||
return new UpdateChrgResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
return custService.UpdateChrg(updateChrgReqDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 3. 15.
|
||||
* auth : won
|
||||
* desc : 충전관리 삭제
|
||||
* @param DeleteChrgReqDto
|
||||
* @return DeleteChrgResDto
|
||||
*/
|
||||
@ApiOperation(value="deleteChrg", notes = "충전관리 수정")
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS")
|
||||
})
|
||||
@RequestMapping(value="/deleteChrg", method= {RequestMethod.POST})
|
||||
@ResponseBody
|
||||
public DeleteChrgResDto deleteChrg(@RequestBody @Valid DeleteChrgReqDto deleteChrgReqDto, BindingResult bindingResult) {
|
||||
if(validComponents.validParameter(bindingResult)) {
|
||||
return new DeleteChrgResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
return custService.DeleteChrg(deleteChrgReqDto);
|
||||
}
|
||||
|
||||
|
||||
/*2023-03-07 add request 부분
|
||||
*
|
||||
* date : 2023. 1. 1.
|
||||
|
||||
@@ -117,7 +117,13 @@ public interface CustMgtMapper {
|
||||
/**이용자 충전번호 */
|
||||
String getChrgSeq();
|
||||
/**충전관리 등록 */
|
||||
void insertChrgInfo(InsertChrgReqDto insertChrgReqDto);
|
||||
void insertChrgInfo(ChrgInfo chrgInfo);
|
||||
/**충전관리 수정 */
|
||||
void updateChrg(@Valid UpdateChrgReqDto updateChrgReqDto);
|
||||
/**충전관리 수정후 등록 */
|
||||
void addChrg(@Valid ChrgInfo chrgInfo);
|
||||
/**충전관리 삭제 */
|
||||
void deleteChrg(@Valid DeleteChrgReqDto deleteChrgReqDto);
|
||||
|
||||
|
||||
//2023-03-07 add request 부분
|
||||
|
||||
@@ -1026,18 +1026,15 @@ public class CustMgtService {
|
||||
*/
|
||||
public InsertChrgResDto InsertChrg(@Valid InsertChrgReqDto insertChrgReqDto) {
|
||||
CustMgtMapper custMgtMapper = sqlSessionMaster.getMapper(CustMgtMapper.class);
|
||||
Map<Object, Object> reqMap = new HashMap<Object,Object>();
|
||||
|
||||
String userId = insertChrgReqDto.getUserId();
|
||||
|
||||
// // 1. 사용자 유무 확인
|
||||
// int getUserIdCount = custMgtMapper.getUserIdCount(insertChrgReqDto.getUserId());
|
||||
//
|
||||
// if (getUserIdCount < 1) {
|
||||
// return new InsertChrgResDto(ApiResponseCode.CE_DUPLICATE_ID);
|
||||
// return new InsertChrgResDto(ApiResponseCode.CM_NOT_FOUND);
|
||||
// }
|
||||
|
||||
// // 1. 사용자 유무 확인
|
||||
// 1. 사용자 유무 확인
|
||||
SvcUserInfo svcUserInfo = custMgtMapper.selectSvcUserInfo(insertChrgReqDto.getUserId());
|
||||
|
||||
if (svcUserInfo == null) {
|
||||
@@ -1068,10 +1065,59 @@ public class CustMgtService {
|
||||
chrgInfo.setRegId(regId); //로그인 ID
|
||||
chrgInfo.setChgId(regId); //로그인 ID
|
||||
|
||||
custMgtMapper.insertChrgInfo(insertChrgReqDto);
|
||||
custMgtMapper.insertChrgInfo(chrgInfo);
|
||||
|
||||
return new InsertChrgResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 3. 15.
|
||||
* auth : won
|
||||
* desc : 충전관리 수정
|
||||
* @param UpdateChrgReqDto
|
||||
* @return UpdateChrgResDto
|
||||
*/
|
||||
public UpdateChrgResDto UpdateChrg(@Valid UpdateChrgReqDto updateChrgReqDto) {
|
||||
|
||||
CustMgtMapper custMgtMapper = sqlSessionMaster.getMapper(CustMgtMapper.class);
|
||||
|
||||
// 1. 사용여부 update
|
||||
custMgtMapper.updateChrg(updateChrgReqDto);
|
||||
|
||||
// 2. 새 정보 insert
|
||||
String chrgSeq = custMgtMapper.getChrgSeq();
|
||||
String userSeq = custMgtMapper.getUserSeq();
|
||||
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
UserDetails userDetails = (UserDetails) principal;
|
||||
String regId = userDetails.getUsername();
|
||||
|
||||
ChrgInfo chrgInfo = new ChrgInfo();
|
||||
chrgInfo.setChrgSeq(chrgSeq);
|
||||
chrgInfo.setUserSeq(userSeq);
|
||||
chrgInfo.setChrgDiv(updateChrgReqDto.getChrdDiv());
|
||||
chrgInfo.setStartDt(updateChrgReqDto.getStartDt());
|
||||
chrgInfo.setEndDt(updateChrgReqDto.getEndDt());
|
||||
chrgInfo.setChrgAmt(updateChrgReqDto.getChrgAmt());
|
||||
chrgInfo.setRegId(regId); //로그인 ID
|
||||
chrgInfo.setChgId(regId); //로그인 ID
|
||||
|
||||
custMgtMapper.addChrg(chrgInfo);
|
||||
|
||||
return new UpdateChrgResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 3. 15.
|
||||
* auth : won
|
||||
* desc : 충전관리 삭제
|
||||
* @param DeleteChrgReqDto
|
||||
* @return DeleteChrgResDto
|
||||
*/
|
||||
public DeleteChrgResDto DeleteChrg(@Valid DeleteChrgReqDto deleteChrgReqDto) {
|
||||
CustMgtMapper custMgtMapper = sqlSessionMaster.getMapper(CustMgtMapper.class);
|
||||
custMgtMapper.deleteChrg(deleteChrgReqDto);
|
||||
return new DeleteChrgResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
/* 2023-03-07 add request 부분
|
||||
* date : 2023. 1. 1.
|
||||
|
||||
@@ -14,7 +14,7 @@ public class ChrgListReqDto implements Serializable{
|
||||
@ApiModelProperty(example = "조회 종료 날짜", name = "조회 종료 날짜", notes = "YYYYMM", dataType = "String")
|
||||
private String endDt;
|
||||
@ApiModelProperty(example = "상세검색", name = "상세검색", notes = "항목 : 고객사명(01)/가입번호(02)/서비스ID(03)", dataType = "String")
|
||||
private String searchType3;
|
||||
private String searchType1;
|
||||
@ApiModelProperty(example = "검색어 (입력항목)", name = "검색어 (입력항목)", dataType = "String")
|
||||
private String searchText1;
|
||||
@ApiModelProperty(example = "페이지당 조회할 목록 수", name = "페이지당 조회할 목록 수", dataType = "String")
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package kr.co.uplus.ez.api.custMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class DeleteChrgReqDto implements Serializable{
|
||||
|
||||
@ApiModelProperty(example = "사용여부", name = "사용여부", dataType = "String")
|
||||
private String useYn;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package kr.co.uplus.ez.api.custMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ResponseMessage;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class DeleteChrgResDto extends ResponseMessage implements Serializable{
|
||||
|
||||
private Object data;
|
||||
|
||||
public DeleteChrgResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public DeleteChrgResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public DeleteChrgResDto(ApiResponseCode returnStr, Object data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package kr.co.uplus.ez.api.custMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class UpdateChrgReqDto implements Serializable{
|
||||
|
||||
@ApiModelProperty(example = "고객사명", name = "고객사명", dataType = "String")
|
||||
private String custNm;
|
||||
@ApiModelProperty(example = "고객명", name = "고객명", dataType = "String")
|
||||
private String userId;
|
||||
@ApiModelProperty(example = "충전구분", name = "충전구분", dataType = "String")
|
||||
private String chrdDiv;
|
||||
@ApiModelProperty(example = "충전시작일", name = "충전시작일", dataType = "String")
|
||||
private String startDt;
|
||||
@ApiModelProperty(example = "충전종료일", name = "충전종료일", dataType = "String")
|
||||
private String endDt;
|
||||
@ApiModelProperty(example = "충전금액", name = "충전금액", dataType = "String")
|
||||
private String chrgAmt;
|
||||
@ApiModelProperty(example = "사용여부", name = "사용여부", dataType = "String")
|
||||
private String useYn;
|
||||
@ApiModelProperty(example = "사업자명", name = "사업자명", dataType = "String")
|
||||
private String bizrNo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package kr.co.uplus.ez.api.custMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ResponseMessage;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class UpdateChrgResDto extends ResponseMessage implements Serializable{
|
||||
|
||||
private Object data;
|
||||
|
||||
public UpdateChrgResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public UpdateChrgResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public UpdateChrgResDto(ApiResponseCode returnStr, Object data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import lombok.Data;
|
||||
@Data
|
||||
public class UserLmtList implements Serializable {
|
||||
|
||||
@ApiModelProperty(example = "리스트 번호", name = "리스트 번호", dataType = "Integer")
|
||||
private Integer no;
|
||||
@ApiModelProperty(example = "이용자일련번호", name = "이용자일련번호", dataType = "String")
|
||||
private String userSeq;
|
||||
@ApiModelProperty(example = "한도년월", name = "한도년월", dataType = "String")
|
||||
|
||||
@@ -1145,7 +1145,7 @@
|
||||
</update>
|
||||
|
||||
<!-- 충전관리 목록 조회 -->
|
||||
<select id="selectChrgList">
|
||||
<select id="selectChrgList" parameterType="kr.co.uplus.ez.api.custMgt.dto.ChrgListReqDto" resultType="kr.co.uplus.ez.api.custMgt.dto.ChrgListResDto">
|
||||
SELECT
|
||||
@ROWNUM := @ROWNUM + 1 AS NO
|
||||
, eci.CUST_NM
|
||||
@@ -1167,14 +1167,14 @@
|
||||
<if test="endDt != null and endDt != ''">
|
||||
AND esi.SUBS_DT <![CDATA[ <= ]]> STR_TO_DATE(concat(REPLACE(#{endDt}, '-', '' ),'235959'), '%Y%m%')
|
||||
</if>
|
||||
<if test="searchType3 != null and searchType3 != ''">
|
||||
<if test="searchType3 == '01' and searchText1 != null and searchText1 != ''">
|
||||
<if test="searchType1 != null and searchType1 != ''">
|
||||
<if test="searchType1 == '01' and searchText1 != null and searchText1 != ''">
|
||||
AND UPPER(eci.CUST_NM) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
|
||||
</if>
|
||||
<if test="searchType3 == '02' and searchText1 != null and searchText1 != ''">
|
||||
<if test="searchType1 == '02' and searchText1 != null and searchText1 != ''">
|
||||
AND UPPER(eci.BIZRNO) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
|
||||
</if>
|
||||
<if test="searchType3 == '03' and searchText1 != null and searchText1 != ''">
|
||||
<if test="searchType1 == '03' and searchText1 != null and searchText1 != ''">
|
||||
AND UPPER(esu.USER_ID) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
|
||||
</if>
|
||||
</if>
|
||||
@@ -1247,7 +1247,7 @@
|
||||
, NOW()
|
||||
, #{regId}
|
||||
, NOW()
|
||||
)
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="deleteChrg">
|
||||
|
||||
Reference in New Issue
Block a user