알림 이력 조회 페이지

This commit is contained in:
Leeminha
2022-11-28 11:24:42 +09:00
parent 14645e161b
commit b611f30aee
11 changed files with 549 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ package kr.co.uplus.ez.api.sysMgt;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import kr.co.uplus.ez.api.homeMgt.dto.NoticeListReqDto;
import kr.co.uplus.ez.api.sysMgt.dto.*;
import kr.co.uplus.ez.common.components.ValidComponents;
import kr.co.uplus.ez.common.components.WebClientRequestService;
@@ -430,4 +431,19 @@ public class SysMgtController {
}
/**
* data: 2022. 11.23.
* auth: Lee minha
* desc: 알림 이력 조회
* @return
*/
@ApiOperation(value = "notiList", notes = "알림 이력 조회")
@RequestMapping(value = "/notiList", method = {RequestMethod.POST})
@ResponseBody
public NotiListResDto notiList(@RequestBody @Valid NotiListReqDto notiListReqDto) {
logger.info("Start notiList controller");
return sysService.notiList(notiListReqDto);
}
}

View File

@@ -1,6 +1,7 @@
package kr.co.uplus.ez.api.sysMgt;
import kr.co.uplus.ez.api.comm.dto.BatchChkDto;
import kr.co.uplus.ez.api.homeMgt.dto.NoticeListReqDto;
import kr.co.uplus.ez.api.sysMgt.dto.*;
import org.apache.ibatis.annotations.Mapper;
@@ -51,4 +52,8 @@ public interface SysMgtMapper {
public List<BatchDetail> batchDetailSelect(BatchDetailReqDto batchDetailReqDto); //배치 상세내용
int batchDetailCnt(BatchDetailReqDto batchDetailReqDto);
public List<NotiList> notiListSelect(NotiListReqDto notiListReqDto);
int notiListSelectCnt(NotiListReqDto notiListReqDto);
}

View File

@@ -1,6 +1,7 @@
package kr.co.uplus.ez.api.sysMgt;
import kr.co.uplus.ez.api.calculate.dto.CalcListResDto;
import kr.co.uplus.ez.api.homeMgt.dto.NoticeListReqDto;
import kr.co.uplus.ez.api.sysMgt.dto.*;
import kr.co.uplus.ez.common.data.ApiResponseCode;
import kr.co.uplus.ez.common.data.Paging;
@@ -471,6 +472,50 @@ public class SysMgtService {
return new BatchDetailResDto(ApiResponseCode.SUCCESS, batchDetailRes);
}
/**
* data : 2022. 11. 23.
* auth : Lee minha
* desc : 알림 이력 조회
* @param noticeListReqDto
* @return
*/
public NotiListResDto notiList(NotiListReqDto notiListReqDto) {
log.info("Start notiList Service");
SysMgtMapper sysmgtmapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
NotiListRes notiListRes = new NotiListRes();
String nowPage = String.valueOf(notiListReqDto.getPage());
int totalCnt = sysmgtmapper.notiListSelectCnt(notiListReqDto);
if (totalCnt == 0) {
notiListRes.setList(new ArrayList<>());
Paging paging = new Paging();
paging.setPage(nowPage);
paging.setTotalCnt(String.valueOf(totalCnt));
notiListRes.setPaging(paging);
return new NotiListResDto(ApiResponseCode.CM_NOT_FOUND, notiListRes);
}
int page = notiListReqDto.getPage();
int pagePerRows = notiListReqDto.getPagePerRows();
page = (page - 1) * pagePerRows;
notiListReqDto.setPage(page);
List<NotiList> notiList = sysmgtmapper.notiListSelect(notiListReqDto);
notiListRes.setList(notiList);
Paging paging = new Paging();
paging.setPage(nowPage);
paging.setTotalCnt(String.valueOf(totalCnt));
notiListRes.setPaging(paging);
log.info("End notiList Service");
return new NotiListResDto(ApiResponseCode.SUCCESS, notiListRes);
}
}

View File

@@ -0,0 +1,30 @@
package kr.co.uplus.ez.api.sysMgt.dto;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 알림 이력 조회 DTO
* @author Lee Minha
*/
@Data
public class NotiList {
private String sndYmd;
private String userSeq;
private String notiDiv;
private String notiSeq;
private String notiMsg;
private String webReqId;
private String regDt;
private String userId;
}

View File

@@ -0,0 +1,47 @@
package kr.co.uplus.ez.api.sysMgt.dto;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@SuppressWarnings("serial")
@Data
public class NotiListReqDto implements Serializable{
//검색 시작일
private String startDt;
//검색 종료일
private String endDt;
@NotNull
@ApiModelProperty(example = "50", name = "페이지당 조회할 목록 수", dataType = "String")
private int pagePerRows;
@NotNull
@ApiModelProperty(example = "1", name = "현재 페이지", dataType = "int")
private int page;
//유저 ID
private String userId;
//웹 요청 ID
private String webReqId;
//요청 코드 (01: 종량 전환 알림. 02: 이월 소멸 알림)
private String notiDiv;
//검색어
private String search;
//검색 유형
private String srchGbn;
//검색 유형
private String srchGbn2;
}

View File

@@ -0,0 +1,15 @@
package kr.co.uplus.ez.api.sysMgt.dto;
import java.io.Serializable;
import java.util.List;
import kr.co.uplus.ez.common.data.Paging;
import lombok.Data;
@SuppressWarnings("serial")
@Data
public class NotiListRes implements Serializable{
private Paging paging;
private List<NotiList> list;
}

View File

@@ -0,0 +1,30 @@
package kr.co.uplus.ez.api.sysMgt.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 NotiListResDto extends ResponseMessage implements Serializable{
private NotiListRes data;
public NotiListResDto() {
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
}
public NotiListResDto(ApiResponseCode returnStr) {
this.retCode = returnStr.getResultCode();
this.retMsg = returnStr.getResultMsg();
}
public NotiListResDto(ApiResponseCode returnStr, NotiListRes data) {
this.retCode = returnStr.getResultCode();
this.retMsg = returnStr.getResultMsg();
this.data = data;
}
}

View File

@@ -504,5 +504,82 @@
</if>
</select>
<select id="notiListSelect" parameterType="kr.co.uplus.ez.api.sysMgt.dto.NotiListReqDto" resultType="kr.co.uplus.ez.api.sysMgt.dto.NotiList">
/* sysMgt-mapper.xml(notiListSelect) 알림 이력 조회*/
SELECT
enh.SND_YMD,
esu.USER_ID,
CASE
WHEN enh.NOTI_DIV = '01' THEN '종량 전환 알림'
WHEN enh.NOTI_DIV = '02' THEN '이월 소멸 알림'
ELSE enh.NOTI_DIV
END NOTI_DIV,
enh.NOTI_DIV,
enh.NOTI_SEQ,
enh.NOTI_MSG,
enh.WEB_REQ_ID,
enh.REG_DT
FROM
hubez_common.EZ_NOTI_HIST enh
INNER JOIN
hubez_common.EZ_SVC_USER esu ON enh.USER_SEQ = esu.USER_SEQ
WHERE
1=1
<if test = "startDt != null and endDt != null">
AND DATE_FORMAT(enh.SND_YMD,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDt},'%Y-%m-%d') AND DATE_FORMAT(#{endDt},'%Y-%m-%d')
</if>
<if test = "srchGbn != null and srchGbn != ''">
<if test= "srchGbn == '01'">
AND esu.USER_ID LIKE CONCAT ('%',#{search},'%')
</if>
<if test = "srchGbn == '02'">
AND enh.WEB_REQ_ID LIKE CONCAT ('%',#{search},'%')
</if>
</if>
<if test = "srchGbn2 != null and srchGbn2 != ''">
<if test= "srchGbn2 == '01'">
AND enh.NOTI_DIV = '01'
</if>
<if test= "srchGbn2 == '02'">
AND enh.NOTI_DIV = '02'
</if>
</if>
ORDER BY
enh.REG_DT desc
LIMIT #{page}, #{pagePerRows}
</select>
<select id="notiListSelectCnt" parameterType="kr.co.uplus.ez.api.sysMgt.dto.NotiListReqDto" resultType="int">
/* sysMgt-mapper.xml(notiListSelect) 알림 이력 조회 카운트*/
SELECT
COUNT(1)
FROM
hubez_common.EZ_NOTI_HIST enh
INNER JOIN
hubez_common.EZ_SVC_USER esu ON enh.USER_SEQ = esu.USER_SEQ
WHERE
1=1
<if test = "startDt != null and endDt != null">
AND DATE_FORMAT(enh.SND_YMD,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDt},'%Y-%m-%d') AND DATE_FORMAT(#{endDt},'%Y-%m-%d')
</if>
<if test = "srchGbn != null and srchGbn != ''">
<if test= "srchGbn == '01'">
AND esu.USER_ID LIKE CONCAT ('%',#{search},'%')
</if>
<if test = "srchGbn == '02'">
AND enh.WEB_REQ_ID LIKE CONCAT ('%',#{search},'%')
</if>
</if>
<if test = "srchGbn2 != null and srchGbn2 != ''">
<if test= "srchGbn2 == '01'">
AND enh.NOTI_DIV = '01'
</if>
<if test= "srchGbn2 == '02'">
AND enh.NOTI_DIV = '02'
</if>
</if>
</select>
</mapper>