Browse Source

徽章审核添加 网格Id 参数,缺少参数校验

dev_shibei_match
jianjun 5 years ago
parent
commit
1f4d8927b7
  1. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java
  2. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java
  3. 65
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java
  4. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java
  5. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java

@ -63,6 +63,7 @@ public class FactIndexController {
* @Description 按月查询各项指标数据 * @Description 按月查询各项指标数据
* @author sun * @author sun
*/ */
@PostMapping("index/ablitylist") @PostMapping("index/ablitylist")
public Result<List<AblityListResultDTO>> ablityList(@RequestBody AblityListFormDTO formDTO) { public Result<List<AblityListResultDTO>> ablityList(@RequestBody AblityListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class);

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java

@ -21,4 +21,8 @@ public class BadgeFormDTO implements Serializable {
* 每页显示数量 * 每页显示数量
*/ */
private Integer pageSize = 20; private Integer pageSize = 20;
/**
* 网格Id
*/
private String gridId;
} }

65
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java

@ -19,15 +19,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.BadgeDTO; import com.epmet.dto.BadgeDTO;
import com.epmet.dto.result.BadgeAuditRecordResultDTO; import com.epmet.dto.result.*;
import com.epmet.dto.result.BadgeAuditingResultDTO;
import com.epmet.dto.result.BadgeDetailResultDTO;
import com.epmet.dto.result.BadgeListResultDTO;
import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.entity.BadgeEntity; import com.epmet.entity.BadgeEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName;
import java.util.List; import java.util.List;
@ -42,103 +37,114 @@ public interface BadgeDao extends BaseDao<BadgeEntity> {
/** /**
* 获取徽章列表 * 获取徽章列表
* @author zhaoqifeng *
* @date 2020/11/3 17:30
* @param customerId * @param customerId
* @return java.util.List<com.epmet.dto.result.BadgeListResultDTO> * @return java.util.List<com.epmet.dto.result.BadgeListResultDTO>
* @author zhaoqifeng
* @date 2020/11/3 17:30
*/ */
List<BadgeListResultDTO> selectList(@Param("customerId") String customerId); List<BadgeListResultDTO> selectList(@Param("customerId") String customerId);
/** /**
* 重名校验 * 重名校验
* @author zhaoqifeng *
* @date 2020/11/4 10:40
* @param customerId * @param customerId
* @param badgeName * @param badgeName
* @return java.util.List<com.epmet.dto.result.BadgeListResultDTO> * @return java.util.List<com.epmet.dto.result.BadgeListResultDTO>
* @author zhaoqifeng
* @date 2020/11/4 10:40
*/ */
List<BadgeListResultDTO> getDuplicateName(@Param("customerId") String customerId, @Param("badgeName") String badgeName); List<BadgeListResultDTO> getDuplicateName(@Param("customerId") String customerId, @Param("badgeName") String badgeName);
/** /**
* 编辑重名校验 * 编辑重名校验
* @author zhaoqifeng *
* @date 2020/11/4 15:09
* @param customerId * @param customerId
* @param badgeId * @param badgeId
* @param badgeName * @param badgeName
* @return java.util.List<com.epmet.dto.result.BadgeListResultDTO> * @return java.util.List<com.epmet.dto.result.BadgeListResultDTO>
* @author zhaoqifeng
* @date 2020/11/4 15:09
*/ */
List<BadgeListResultDTO> getDuplicateNameForEdit(@Param("customerId") String customerId, @Param("badgeId") String badgeId, List<BadgeListResultDTO> getDuplicateNameForEdit(@Param("customerId") String customerId, @Param("badgeId") String badgeId,
@Param("badgeName") String badgeName); @Param("badgeName") String badgeName);
/** /**
* 获取徽章详情 * 获取徽章详情
* @author zhaoqifeng *
* @date 2020/11/4 14:30
* @param customerId * @param customerId
* @param badgeId * @param badgeId
* @return com.epmet.dto.result.BadgeDetailResultDTO * @return com.epmet.dto.result.BadgeDetailResultDTO
* @author zhaoqifeng
* @date 2020/11/4 14:30
*/ */
BadgeDetailResultDTO selectDetail(@Param("customerId") String customerId, @Param("badgeId") String badgeId); BadgeDetailResultDTO selectDetail(@Param("customerId") String customerId, @Param("badgeId") String badgeId);
/** /**
* 获取徽章信息 * 获取徽章信息
* @author zhaoqifeng *
* @date 2020/11/4 15:16
* @param customerId * @param customerId
* @param badgeId * @param badgeId
* @return com.epmet.entity.BadgeEntity * @return com.epmet.entity.BadgeEntity
* @author zhaoqifeng
* @date 2020/11/4 15:16
*/ */
BadgeEntity selectBadgeInfo(@Param("customerId") String customerId, @Param("badgeId") String badgeId); BadgeEntity selectBadgeInfo(@Param("customerId") String customerId, @Param("badgeId") String badgeId);
/** /**
* 更新徽章信息 * 更新徽章信息
* @author zhaoqifeng *
* @date 2020/11/4 15:38
* @param entity * @param entity
* @return void * @return void
* @author zhaoqifeng
* @date 2020/11/4 15:38
*/ */
void updateBadge(BadgeEntity entity); void updateBadge(BadgeEntity entity);
/** /**
* 删除徽章信息 * 删除徽章信息
* @author zhaoqifeng *
* @date 2020/11/4 15:39
* @param customerId * @param customerId
* @param badgeId * @param badgeId
* @return void * @return void
* @author zhaoqifeng
* @date 2020/11/4 15:39
*/ */
void deleteBadge(@Param("customerId") String customerId, @Param("badgeId") String badgeId); void deleteBadge(@Param("customerId") String customerId, @Param("badgeId") String badgeId);
/** /**
* 待审核列表 * 待审核列表
* @author zhaoqifeng *
* @date 2020/11/5 10:01
* @param customerId * @param customerId
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @param gridId
* @return java.util.List<com.epmet.dto.result.BadgeAuditingResultDTO> * @return java.util.List<com.epmet.dto.result.BadgeAuditingResultDTO>
* @author zhaoqifeng
* @date 2020/11/5 10:01
*/ */
List<BadgeAuditingResultDTO> selectAuditingList(@Param("customerId") String customerId, @Param("pageNo") Integer pageNo, List<BadgeAuditingResultDTO> selectAuditingList(@Param("customerId") String customerId, @Param("pageNo") Integer pageNo,
@Param("pageSize") Integer pageSize); @Param("pageSize") Integer pageSize, @Param("gridId") String gridId);
/** /**
* 审核历史列表 * 审核历史列表
* @author zhaoqifeng *
* @date 2020/11/5 11:01
* @param customerId * @param customerId
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @param gridId
* @return java.util.List<com.epmet.dto.result.BadgeAuditRecordResultDTO> * @return java.util.List<com.epmet.dto.result.BadgeAuditRecordResultDTO>
* @author zhaoqifeng
* @date 2020/11/5 11:01
*/ */
List<BadgeAuditRecordResultDTO> selectAuditRecord(@Param("customerId") String customerId, @Param("pageNo") Integer pageNo, List<BadgeAuditRecordResultDTO> selectAuditRecord(@Param("customerId") String customerId, @Param("pageNo") Integer pageNo,
@Param("pageSize") Integer pageSize); @Param("pageSize") Integer pageSize, @Param("gridId") String gridId);
/** /**
* @Description 查询客户的徽章
* @param customerId * @param customerId
* @return java.util.List<com.epmet.dto.result.UserBadgeListResultDTO> * @return java.util.List<com.epmet.dto.result.UserBadgeListResultDTO>
* @Description 查询客户的徽章
* @author wangc * @author wangc
* @date 2020.11.05 15:50 * @date 2020.11.05 15:50
*/ */
@ -146,10 +152,11 @@ public interface BadgeDao extends BaseDao<BadgeEntity> {
/** /**
* 插入数据 * 插入数据
* @author zhaoqifeng *
* @date 2020/11/6 14:46
* @param entity * @param entity
* @return void * @return void
* @author zhaoqifeng
* @date 2020/11/6 14:46
*/ */
void insertBadge(BadgeDTO dto); void insertBadge(BadgeDTO dto);
} }

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java

@ -21,13 +21,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.constant.BadgeConstant; import com.epmet.constant.BadgeConstant;
import com.epmet.constant.BadgeMessageConstant; import com.epmet.constant.BadgeMessageConstant;
import com.epmet.constant.UserConstant; import com.epmet.constant.UserConstant;
@ -289,7 +289,7 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
@Override @Override
public List<BadgeAuditingResultDTO> auditingList(TokenDto tokenDto, BadgeFormDTO formDTO) { public List<BadgeAuditingResultDTO> auditingList(TokenDto tokenDto, BadgeFormDTO formDTO) {
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
List<BadgeAuditingResultDTO> list = baseDao.selectAuditingList(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); List<BadgeAuditingResultDTO> list = baseDao.selectAuditingList(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize(), formDTO.getGridId());
list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY));
return list; return list;
} }
@ -306,7 +306,7 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
@Override @Override
public List<BadgeAuditRecordResultDTO> auditRecord(TokenDto tokenDto, BadgeFormDTO formDTO) { public List<BadgeAuditRecordResultDTO> auditRecord(TokenDto tokenDto, BadgeFormDTO formDTO) {
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
List<BadgeAuditRecordResultDTO> list = baseDao.selectAuditRecord(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); List<BadgeAuditRecordResultDTO> list = baseDao.selectAuditRecord(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize(), formDTO.getGridId());
list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY));
return list; return list;
} }

2
epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml

@ -169,6 +169,7 @@
AUDIT_STATUS = 'auditing' AUDIT_STATUS = 'auditing'
AND ubcr.DEL_FLAG = '0' AND ubcr.DEL_FLAG = '0'
AND ubcr.CUSTOMER_ID = #{customerId} AND ubcr.CUSTOMER_ID = #{customerId}
AND ubcr.GRID_ID = #{gridId}
ORDER BY ubcr.CREATED_TIME DESC ORDER BY ubcr.CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize} LIMIT #{pageNo}, #{pageSize}
</select> </select>
@ -202,6 +203,7 @@
AUDIT_STATUS != 'auditing' AUDIT_STATUS != 'auditing'
AND ubcr.DEL_FLAG = '0' AND ubcr.DEL_FLAG = '0'
AND ubcr.CUSTOMER_ID = #{customerId} AND ubcr.CUSTOMER_ID = #{customerId}
AND ubcr.GRID_ID = #{gridId}
ORDER BY ubcr.CREATED_TIME DESC ORDER BY ubcr.CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize} LIMIT #{pageNo}, #{pageSize}
</select> </select>

Loading…
Cancel
Save