|
@ -30,23 +30,17 @@ import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.constant.BadgeConstant; |
|
|
import com.epmet.constant.BadgeConstant; |
|
|
import com.epmet.dao.BadgeDao; |
|
|
import com.epmet.dao.BadgeDao; |
|
|
import com.epmet.dto.BadgeDTO; |
|
|
import com.epmet.dto.BadgeDTO; |
|
|
|
|
|
import com.epmet.dto.ResiUserBadgeDTO; |
|
|
import com.epmet.dto.UserBadgeCertificateRecordDTO; |
|
|
import com.epmet.dto.UserBadgeCertificateRecordDTO; |
|
|
import com.epmet.dto.form.AddBadgeFormDTO; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.form.BadgeAuditFormDTO; |
|
|
|
|
|
import com.epmet.dto.form.BadgeFormDTO; |
|
|
|
|
|
import com.epmet.dto.form.EditBadgeFormDTO; |
|
|
|
|
|
import com.epmet.dto.result.BadgeAuditRecordResultDTO; |
|
|
import com.epmet.dto.result.BadgeAuditRecordResultDTO; |
|
|
import com.epmet.dto.result.BadgeAuditingResultDTO; |
|
|
import com.epmet.dto.result.BadgeAuditingResultDTO; |
|
|
import com.epmet.dto.form.UserBadgeUnitFormDTO; |
|
|
|
|
|
import com.epmet.dto.result.BadgeDetailResultDTO; |
|
|
import com.epmet.dto.result.BadgeDetailResultDTO; |
|
|
import com.epmet.dto.result.BadgeListResultDTO; |
|
|
import com.epmet.dto.result.BadgeListResultDTO; |
|
|
import com.epmet.entity.BadgeCertificationConfigEntity; |
|
|
import com.epmet.entity.BadgeCertificationConfigEntity; |
|
|
import com.epmet.entity.BadgeEntity; |
|
|
import com.epmet.entity.BadgeEntity; |
|
|
import com.epmet.redis.UserBadgeRedis; |
|
|
import com.epmet.redis.UserBadgeRedis; |
|
|
import com.epmet.service.BadgeCertificationConfigService; |
|
|
import com.epmet.service.*; |
|
|
import com.epmet.service.BadgeService; |
|
|
|
|
|
import com.epmet.service.UserBadgeCertificateRecordService; |
|
|
|
|
|
import com.epmet.service.UserBadgeService; |
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -70,6 +64,10 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp |
|
|
private UserBadgeCertificateRecordService userBadgeCertificateRecordService; |
|
|
private UserBadgeCertificateRecordService userBadgeCertificateRecordService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private UserBadgeRedis badgeRedis; |
|
|
private UserBadgeRedis badgeRedis; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private UserBadgeService userBadgeService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ResiUserBadgeService resiUserBadgeService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -127,7 +125,7 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp |
|
|
/** |
|
|
/** |
|
|
* 获取徽章列表 |
|
|
* 获取徽章列表 |
|
|
* |
|
|
* |
|
|
* @param customerId |
|
|
* @param customerId 客户ID |
|
|
* @return java.util.List<com.epmet.dto.result.BadgeListResultDTO> |
|
|
* @return java.util.List<com.epmet.dto.result.BadgeListResultDTO> |
|
|
* @author zhaoqifeng |
|
|
* @author zhaoqifeng |
|
|
* @date 2020/11/3 17:04 |
|
|
* @date 2020/11/3 17:04 |
|
@ -140,8 +138,8 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp |
|
|
/** |
|
|
/** |
|
|
* 添加徽章 |
|
|
* 添加徽章 |
|
|
* |
|
|
* |
|
|
* @param tokenDto |
|
|
* @param tokenDto token |
|
|
* @param formDTO |
|
|
* @param formDTO 入参 |
|
|
* @return void |
|
|
* @return void |
|
|
* @author zhaoqifeng |
|
|
* @author zhaoqifeng |
|
|
* @date 2020/11/4 10:09 |
|
|
* @date 2020/11/4 10:09 |
|
@ -168,16 +166,17 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp |
|
|
badgeList.add(badge); |
|
|
badgeList.add(badge); |
|
|
}); |
|
|
}); |
|
|
badgeCertificationConfigService.insertBatch(badgeList); |
|
|
badgeCertificationConfigService.insertBatch(badgeList); |
|
|
|
|
|
//更新Redis
|
|
|
if (BadgeConstant.ONLINE.equals(formDTO.getBadgeStatus())) { |
|
|
if (BadgeConstant.ONLINE.equals(formDTO.getBadgeStatus())) { |
|
|
//TODO 更新Redis
|
|
|
userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 徽章详情 |
|
|
* 徽章详情 |
|
|
* |
|
|
* |
|
|
* @param tokenDto |
|
|
* @param tokenDto token |
|
|
* @param formDTO |
|
|
* @param formDTO 入参 |
|
|
* @return com.epmet.dto.result.BadgeDetailResultDTO |
|
|
* @return com.epmet.dto.result.BadgeDetailResultDTO |
|
|
* @author zhaoqifeng |
|
|
* @author zhaoqifeng |
|
|
* @date 2020/11/4 14:25 |
|
|
* @date 2020/11/4 14:25 |
|
@ -193,8 +192,8 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp |
|
|
/** |
|
|
/** |
|
|
* 编辑徽章 |
|
|
* 编辑徽章 |
|
|
* |
|
|
* |
|
|
* @param tokenDto |
|
|
* @param tokenDto token |
|
|
* @param formDTO |
|
|
* @param formDTO 入参 |
|
|
* @return void |
|
|
* @return void |
|
|
* @author zhaoqifeng |
|
|
* @author zhaoqifeng |
|
|
* @date 2020/11/4 14:28 |
|
|
* @date 2020/11/4 14:28 |
|
@ -232,16 +231,15 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp |
|
|
badgeList.add(badge); |
|
|
badgeList.add(badge); |
|
|
}); |
|
|
}); |
|
|
badgeCertificationConfigService.saveConfig(tokenDto.getCustomerId(), formDTO.getBadgeId(), badgeList); |
|
|
badgeCertificationConfigService.saveConfig(tokenDto.getCustomerId(), formDTO.getBadgeId(), badgeList); |
|
|
if (BadgeConstant.OFFLINE.equals(formDTO.getBadgeStatus())) { |
|
|
//更新Redis
|
|
|
//TODO 更新Redis
|
|
|
userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId()); |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 删除徽章 |
|
|
* 删除徽章 |
|
|
* |
|
|
* |
|
|
* @param tokenDto |
|
|
* @param tokenDto token |
|
|
* @param formDTO |
|
|
* @param formDTO 入参 |
|
|
* @return void |
|
|
* @return void |
|
|
* @author zhaoqifeng |
|
|
* @author zhaoqifeng |
|
|
* @date 2020/11/4 15:34 |
|
|
* @date 2020/11/4 15:34 |
|
@ -254,9 +252,14 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp |
|
|
if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { |
|
|
if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { |
|
|
throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode()); |
|
|
throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode()); |
|
|
} |
|
|
} |
|
|
badgeEntity.setCustomerId(tokenDto.getCustomerId()); |
|
|
BadgeDTO badgeDTO = ConvertUtils.sourceToTarget(badgeEntity, BadgeDTO.class); |
|
|
badgeEntity.setDelFlag(NumConstant.ONE_STR); |
|
|
badgeDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
baseDao.insert(badgeEntity); |
|
|
badgeDTO.setDelFlag(NumConstant.ONE_STR); |
|
|
|
|
|
badgeDTO.setCreatedBy(tokenDto.getUserId()); |
|
|
|
|
|
badgeDTO.setCreatedTime(new Date()); |
|
|
|
|
|
badgeDTO.setUpdatedBy(tokenDto.getUserId()); |
|
|
|
|
|
badgeDTO.setUpdatedTime(new Date()); |
|
|
|
|
|
baseDao.insertBadge(badgeDTO); |
|
|
} else { |
|
|
} else { |
|
|
if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { |
|
|
if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { |
|
|
throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode()); |
|
|
throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode()); |
|
@ -264,14 +267,15 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp |
|
|
baseDao.deleteBadge(tokenDto.getCustomerId(), formDTO.getBadgeId()); |
|
|
baseDao.deleteBadge(tokenDto.getCustomerId(), formDTO.getBadgeId()); |
|
|
} |
|
|
} |
|
|
badgeCertificationConfigService.deleteConfig(tokenDto.getCustomerId(), formDTO.getBadgeId()); |
|
|
badgeCertificationConfigService.deleteConfig(tokenDto.getCustomerId(), formDTO.getBadgeId()); |
|
|
//TODO 更新Redis
|
|
|
//更新Redis
|
|
|
|
|
|
userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 待审核列表 |
|
|
* 待审核列表 |
|
|
* |
|
|
* |
|
|
* @param tokenDto |
|
|
* @param tokenDto token |
|
|
* @param formDTO |
|
|
* @param formDTO 入参 |
|
|
* @return java.util.List<com.epmet.dto.result.BadgeAuditingResultDTO> |
|
|
* @return java.util.List<com.epmet.dto.result.BadgeAuditingResultDTO> |
|
|
* @author zhaoqifeng |
|
|
* @author zhaoqifeng |
|
|
* @date 2020/11/5 9:50 |
|
|
* @date 2020/11/5 9:50 |
|
@ -280,17 +284,15 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp |
|
|
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()); |
|
|
list.forEach(item -> { |
|
|
list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); |
|
|
item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY); |
|
|
|
|
|
}); |
|
|
|
|
|
return list; |
|
|
return list; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 审核历史列表 |
|
|
* 审核历史列表 |
|
|
* |
|
|
* |
|
|
* @param tokenDto |
|
|
* @param tokenDto token |
|
|
* @param formDTO |
|
|
* @param formDTO 入参 |
|
|
* @return java.util.List<com.epmet.dto.result.BadgeAuditRecordResultDTO> |
|
|
* @return java.util.List<com.epmet.dto.result.BadgeAuditRecordResultDTO> |
|
|
* @author zhaoqifeng |
|
|
* @author zhaoqifeng |
|
|
* @date 2020/11/5 10:59 |
|
|
* @date 2020/11/5 10:59 |
|
@ -299,25 +301,22 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp |
|
|
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()); |
|
|
list.forEach(item -> { |
|
|
list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); |
|
|
item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY); |
|
|
|
|
|
}); |
|
|
|
|
|
return list; |
|
|
return list; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 审核 |
|
|
* 审核 |
|
|
* |
|
|
* |
|
|
* @param tokenDto |
|
|
* @param tokenDto token |
|
|
* @param formDTO |
|
|
* @param formDTO 入参 |
|
|
* @return void |
|
|
* @return void |
|
|
* @author zhaoqifeng |
|
|
* @author zhaoqifeng |
|
|
* @date 2020/11/5 11:08 |
|
|
* @date 2020/11/5 11:08 |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO) { |
|
|
public void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO) { |
|
|
UserBadgeCertificateRecordDTO dto = new UserBadgeCertificateRecordDTO(); |
|
|
UserBadgeCertificateRecordDTO dto = userBadgeCertificateRecordService.get(formDTO.getRecordId()); |
|
|
dto.setId(formDTO.getRecordId()); |
|
|
|
|
|
dto.setAuditStatus(formDTO.getAuditStatus()); |
|
|
dto.setAuditStatus(formDTO.getAuditStatus()); |
|
|
dto.setAuditRemark(formDTO.getAuditRemark()); |
|
|
dto.setAuditRemark(formDTO.getAuditRemark()); |
|
|
dto.setStaffId(tokenDto.getUserId()); |
|
|
dto.setStaffId(tokenDto.getUserId()); |
|
@ -325,8 +324,22 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp |
|
|
|
|
|
|
|
|
userBadgeCertificateRecordService.update(dto); |
|
|
userBadgeCertificateRecordService.update(dto); |
|
|
|
|
|
|
|
|
|
|
|
ResiUserBadgeDTO resiUserBadgeDTO = new ResiUserBadgeDTO(); |
|
|
|
|
|
resiUserBadgeDTO.setCustomerId(dto.getCustomerId()); |
|
|
|
|
|
resiUserBadgeDTO.setBadgeId(dto.getBadgeId()); |
|
|
|
|
|
resiUserBadgeDTO.setGridId(dto.getGridId()); |
|
|
|
|
|
resiUserBadgeDTO.setUserId(dto.getUserId()); |
|
|
|
|
|
resiUserBadgeDTO.setIsOpened(NumConstant.ZERO); |
|
|
|
|
|
resiUserBadgeDTO.setCertificationAutidStatus(dto.getAuditStatus()); |
|
|
|
|
|
resiUserBadgeService.save(resiUserBadgeDTO); |
|
|
|
|
|
|
|
|
if(BadgeConstant.APPROVED.equals(formDTO.getAuditStatus())) { |
|
|
if(BadgeConstant.APPROVED.equals(formDTO.getAuditStatus())) { |
|
|
//TODO 更新Redis
|
|
|
//更新Redis
|
|
|
|
|
|
OpenedOrClosedFormDTO openedOrClosedFormDTO = new OpenedOrClosedFormDTO(); |
|
|
|
|
|
openedOrClosedFormDTO.setCustomerId(dto.getCustomerId()); |
|
|
|
|
|
openedOrClosedFormDTO.setUserId(dto.getUserId()); |
|
|
|
|
|
openedOrClosedFormDTO.setBadgeId(dto.getBadgeId()); |
|
|
|
|
|
userBadgeService.openedOrClosed(openedOrClosedFormDTO); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|