|
@@ -1,6 +1,7 @@
|
|
|
package org.dromara.backstage.payment.service.impl;
|
|
package org.dromara.backstage.payment.service.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.lang.UUID;
|
|
import cn.hutool.core.lang.UUID;
|
|
@@ -14,6 +15,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
|
|
+import org.dromara.backstage.basics.domain.bo.PtCardtypeBo;
|
|
|
import org.dromara.backstage.basics.domain.vo.PtCardtypeVo;
|
|
import org.dromara.backstage.basics.domain.vo.PtCardtypeVo;
|
|
|
import org.dromara.backstage.basics.service.IPtCardtypeService;
|
|
import org.dromara.backstage.basics.service.IPtCardtypeService;
|
|
|
import org.dromara.backstage.cardCenter.domain.bo.PtCardBo;
|
|
import org.dromara.backstage.cardCenter.domain.bo.PtCardBo;
|
|
@@ -90,7 +92,7 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public PtUserAccountVo queryById(Long userId) {
|
|
public PtUserAccountVo queryById(Long userId) {
|
|
|
- PtUserAccountVo vo = TenantHelper.ignore(()->baseMapper.selectVoById(userId));
|
|
|
|
|
|
|
+ PtUserAccountVo vo = TenantHelper.ignore(() -> baseMapper.selectVoById(userId));
|
|
|
if (vo != null && ObjectUtil.isNotEmpty(vo.getDeptId())) {
|
|
if (vo != null && ObjectUtil.isNotEmpty(vo.getDeptId())) {
|
|
|
RemoteDeptVo remoteDeptVo = remoteDeptService.selectDeptById(vo.getDeptId());
|
|
RemoteDeptVo remoteDeptVo = remoteDeptService.selectDeptById(vo.getDeptId());
|
|
|
vo.setDeptName(remoteDeptVo.getDeptName());
|
|
vo.setDeptName(remoteDeptVo.getDeptName());
|
|
@@ -147,10 +149,18 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
LambdaQueryWrapper<PtUserAccount> lqw = buildQueryWrapper(bo);
|
|
LambdaQueryWrapper<PtUserAccount> lqw = buildQueryWrapper(bo);
|
|
|
List<PtUserAccountVo> accountVoList = baseMapper.selectVoList(lqw);
|
|
List<PtUserAccountVo> accountVoList = baseMapper.selectVoList(lqw);
|
|
|
List<RemoteDeptVo> deptVoList = remoteDeptService.selectDeptList();
|
|
List<RemoteDeptVo> deptVoList = remoteDeptService.selectDeptList();
|
|
|
- accountVoList.forEach(p->{
|
|
|
|
|
|
|
+ PtCardtypeBo cardTypeBo = new PtCardtypeBo();
|
|
|
|
|
+ cardTypeBo.setStatus("0");
|
|
|
|
|
+
|
|
|
|
|
+ List<PtCardtypeVo> cardTypeVos = cardTypeService.queryList(cardTypeBo);
|
|
|
|
|
+ accountVoList.forEach(p -> {
|
|
|
String deptName = deptVoList.parallelStream().filter(k -> k.getDeptId().equals(p.getDeptId()))
|
|
String deptName = deptVoList.parallelStream().filter(k -> k.getDeptId().equals(p.getDeptId()))
|
|
|
- .findFirst().map(RemoteDeptVo::getDeptName).orElse("未知部门");
|
|
|
|
|
|
|
+ .findFirst().map(RemoteDeptVo::getDeptName).orElse("未知部门");
|
|
|
p.setDeptName(deptName);
|
|
p.setDeptName(deptName);
|
|
|
|
|
+
|
|
|
|
|
+ String cardTypeNme = cardTypeVos.parallelStream().filter(k -> k.getCode().equals(p.getCardType()))
|
|
|
|
|
+ .findFirst().map(PtCardtypeVo::getTypeName).orElse("未知卡类");
|
|
|
|
|
+ p.setCardTypeName(cardTypeNme);
|
|
|
});
|
|
});
|
|
|
return accountVoList;
|
|
return accountVoList;
|
|
|
}
|
|
}
|
|
@@ -164,18 +174,18 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
LambdaQueryWrapper<PtUserAccount> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<PtUserAccount> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(bo.getUserId() != null, PtUserAccount::getUserId, bo.getUserId());
|
|
lqw.eq(bo.getUserId() != null, PtUserAccount::getUserId, bo.getUserId());
|
|
|
lqw.eq(bo.getPostId() != null, PtUserAccount::getPostId, bo.getPostId());
|
|
lqw.eq(bo.getPostId() != null, PtUserAccount::getPostId, bo.getPostId());
|
|
|
- lqw.eq(bo.getDeptId() != null, PtUserAccount::getDeptId, bo.getDeptId());
|
|
|
|
|
|
|
+ lqw.eq(bo.getDeptId() != null, PtUserAccount::getDeptId, bo.getDeptId());
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getUserName()), PtUserAccount::getUserName, bo.getUserName());
|
|
lqw.like(StringUtils.isNotBlank(bo.getUserName()), PtUserAccount::getUserName, bo.getUserName());
|
|
|
// lqw.eq(StringUtils.isNotBlank(bo.getPassword()), PtUserAccount::getPassword, bo.getPassword());
|
|
// lqw.eq(StringUtils.isNotBlank(bo.getPassword()), PtUserAccount::getPassword, bo.getPassword());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getUserNumb()), PtUserAccount::getUserNumb, bo.getUserNumb());
|
|
lqw.eq(StringUtils.isNotBlank(bo.getUserNumb()), PtUserAccount::getUserNumb, bo.getUserNumb());
|
|
|
// lqw.like(StringUtils.isNotBlank(bo.getNickName()), PtUserAccount::getNickName, bo.getNickName());
|
|
// lqw.like(StringUtils.isNotBlank(bo.getNickName()), PtUserAccount::getNickName, bo.getNickName());
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getRealName()), PtUserAccount::getRealName, bo.getRealName());
|
|
lqw.like(StringUtils.isNotBlank(bo.getRealName()), PtUserAccount::getRealName, bo.getRealName());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getSex()), PtUserAccount::getSex, bo.getSex());
|
|
lqw.eq(StringUtils.isNotBlank(bo.getSex()), PtUserAccount::getSex, bo.getSex());
|
|
|
- if(StringUtils.isNotBlank(bo.getCategory())){
|
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getCategory())) {
|
|
|
List<String> list = Arrays.asList(bo.getCategory().split(","));
|
|
List<String> list = Arrays.asList(bo.getCategory().split(","));
|
|
|
- if(list.size()>1){
|
|
|
|
|
|
|
+ if (list.size() > 1) {
|
|
|
lqw.in(StringUtils.isNotBlank(bo.getCategory()), PtUserAccount::getCategory, list);
|
|
lqw.in(StringUtils.isNotBlank(bo.getCategory()), PtUserAccount::getCategory, list);
|
|
|
- } else{
|
|
|
|
|
|
|
+ } else {
|
|
|
lqw.eq(PtUserAccount::getCategory, bo.getCategory());
|
|
lqw.eq(PtUserAccount::getCategory, bo.getCategory());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -502,7 +512,7 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
|
|
|
|
|
if (ObjUtil.isNotNull(redisList) && !redisList.isEmpty()) {
|
|
if (ObjUtil.isNotNull(redisList) && !redisList.isEmpty()) {
|
|
|
vo = redisList.stream().filter(p -> Objects.equals(p.getRealName(), realName)
|
|
vo = redisList.stream().filter(p -> Objects.equals(p.getRealName(), realName)
|
|
|
- && Objects.equals(p.getUserNumb(),userNumb)).findFirst().orElse(null);
|
|
|
|
|
|
|
+ && Objects.equals(p.getUserNumb(), userNumb)).findFirst().orElse(null);
|
|
|
if (ObjUtil.isNotNull(vo)) {
|
|
if (ObjUtil.isNotNull(vo)) {
|
|
|
return vo;
|
|
return vo;
|
|
|
}
|
|
}
|
|
@@ -530,39 +540,19 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
bo.setUserNo(userNo);
|
|
bo.setUserNo(userNo);
|
|
|
return this.selectVoOneByBo(bo);
|
|
return this.selectVoOneByBo(bo);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public PtUserAccountVo getUserAccountVoByUserNumb(String userNumb) {
|
|
public PtUserAccountVo getUserAccountVoByUserNumb(String userNumb) {
|
|
|
- PtUserAccountVo vo;
|
|
|
|
|
- List<PtUserAccountVo> redisList = RedisUtils.getCacheList(CacheNames.PT_USER_ACCOUNT);
|
|
|
|
|
-
|
|
|
|
|
- if (ObjUtil.isNotNull(redisList) && !redisList.isEmpty()) {
|
|
|
|
|
- vo = redisList.stream().filter(p -> Objects.equals(p.getUserNumb(), userNumb)).findFirst().orElse(null);
|
|
|
|
|
- if (ObjUtil.isNotNull(vo)) {
|
|
|
|
|
- return vo;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
PtUserAccountBo bo = new PtUserAccountBo();
|
|
PtUserAccountBo bo = new PtUserAccountBo();
|
|
|
bo.setUserNumb(userNumb);
|
|
bo.setUserNumb(userNumb);
|
|
|
return this.selectVoOneByBo(bo);
|
|
return this.selectVoOneByBo(bo);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public PtUserAccountVo selectVoOneByBo(PtUserAccountBo bo) {
|
|
public PtUserAccountVo selectVoOneByBo(PtUserAccountBo bo) {
|
|
|
List<PtUserAccountVo> list = this.queryList(bo);
|
|
List<PtUserAccountVo> list = this.queryList(bo);
|
|
|
if (ObjectUtil.isNotEmpty(list) && !list.isEmpty()) {
|
|
if (ObjectUtil.isNotEmpty(list) && !list.isEmpty()) {
|
|
|
- PtUserAccountVo vo = list.get(0);
|
|
|
|
|
- if (vo != null) {
|
|
|
|
|
- String deptName = remoteDeptService.selectDeptNameByIds(vo.getDeptId().toString());
|
|
|
|
|
- vo.setDeptName(deptName);
|
|
|
|
|
-
|
|
|
|
|
- PtCardtypeVo cardTypeVo = cardTypeService.queryByCode(vo.getCardType());
|
|
|
|
|
- if (cardTypeVo != null) {
|
|
|
|
|
- vo.setCardTypeName(cardTypeVo.getTypeName());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- RedisUtils.addCacheList(CacheNames.PT_USER_ACCOUNT, vo);
|
|
|
|
|
- return vo;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return list.get(0);
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -571,19 +561,22 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
public YcTraineeVo selectTraineeByBo(PtUserAccountBo bo, Date doingDate) {
|
|
public YcTraineeVo selectTraineeByBo(PtUserAccountBo bo, Date doingDate) {
|
|
|
return TenantHelper.ignore(() -> baseMapper.selectTraineeByBo(bo, doingDate));
|
|
return TenantHelper.ignore(() -> baseMapper.selectTraineeByBo(bo, doingDate));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 删除指定部门下的一卡通账户信息
|
|
* 删除指定部门下的一卡通账户信息
|
|
|
- * @param deptId 部门Id
|
|
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param deptId 部门Id
|
|
|
* @param operatorId 操作员Id
|
|
* @param operatorId 操作员Id
|
|
|
* @return 删除结果
|
|
* @return 删除结果
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public int deleteByDeptId(Long deptId, Long operatorId) {
|
|
public int deleteByDeptId(Long deptId, Long operatorId) {
|
|
|
LambdaUpdateWrapper<PtUserAccount> luw = new LambdaUpdateWrapper<PtUserAccount>().set(PtUserAccount::getDelFlag, DefaultConstants.DELETED)
|
|
LambdaUpdateWrapper<PtUserAccount> luw = new LambdaUpdateWrapper<PtUserAccount>().set(PtUserAccount::getDelFlag, DefaultConstants.DELETED)
|
|
|
- .set(PtUserAccount::getUpdateBy, operatorId)
|
|
|
|
|
- .eq(PtUserAccount::getDeptId, deptId);
|
|
|
|
|
|
|
+ .set(PtUserAccount::getUpdateBy, operatorId)
|
|
|
|
|
+ .eq(PtUserAccount::getDeptId, deptId);
|
|
|
return baseMapper.update(null, luw);
|
|
return baseMapper.update(null, luw);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 根据第三方Id删除人员账户信息
|
|
* 根据第三方Id删除人员账户信息
|
|
|
*
|
|
*
|
|
@@ -603,9 +596,9 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
// 如果存在账户信息,则先注销卡片
|
|
// 如果存在账户信息,则先注销卡片
|
|
|
ptCardService.cancelCard(userId, operatorId);
|
|
ptCardService.cancelCard(userId, operatorId);
|
|
|
LambdaUpdateWrapper<PtUserAccount> luw = new LambdaUpdateWrapper<PtUserAccount>().set(PtUserAccount::getDelFlag, DefaultConstants.DELETED)
|
|
LambdaUpdateWrapper<PtUserAccount> luw = new LambdaUpdateWrapper<PtUserAccount>().set(PtUserAccount::getDelFlag, DefaultConstants.DELETED)
|
|
|
- .set(PtUserAccount::getUpdateBy, operatorId)
|
|
|
|
|
- .eq(PtUserAccount::getDeptId, deptId)
|
|
|
|
|
- .eq(PtUserAccount::getDeptId, deptId);
|
|
|
|
|
|
|
+ .set(PtUserAccount::getUpdateBy, operatorId)
|
|
|
|
|
+ .eq(PtUserAccount::getDeptId, deptId)
|
|
|
|
|
+ .eq(PtUserAccount::getDeptId, deptId);
|
|
|
return baseMapper.update(null, luw);
|
|
return baseMapper.update(null, luw);
|
|
|
}
|
|
}
|
|
|
return 0;
|
|
return 0;
|
|
@@ -613,16 +606,16 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public PtUserAccount4SelectVo getCardInfoByFactoryId(String factoryId) {
|
|
public PtUserAccount4SelectVo getCardInfoByFactoryId(String factoryId) {
|
|
|
- if (StringUtils.isBlank(factoryId)){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(factoryId)) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
List<PtUserAccount4SelectVo> list = baseMapper.getCardInfoByFactoryId(factoryId);
|
|
List<PtUserAccount4SelectVo> list = baseMapper.getCardInfoByFactoryId(factoryId);
|
|
|
- if (list.isEmpty()){
|
|
|
|
|
|
|
+ if (list.isEmpty()) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
PtUserAccount4SelectVo res = list.get(0);
|
|
PtUserAccount4SelectVo res = list.get(0);
|
|
|
- if(StringUtils.isNotBlank(res.getCardStatus())){
|
|
|
|
|
- String cardStatusName = dictService.getDictLabel("KZT", res.getCardStatus());
|
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(res.getCardStatus())) {
|
|
|
|
|
+ String cardStatusName = dictService.getDictLabel("KZT", res.getCardStatus());
|
|
|
res.setCardStatus(cardStatusName);
|
|
res.setCardStatus(cardStatusName);
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
@@ -642,17 +635,17 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
LambdaQueryWrapper<PtUserAccount> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<PtUserAccount> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(userId != null, PtUserAccount::getUserId, userId);
|
|
lqw.eq(userId != null, PtUserAccount::getUserId, userId);
|
|
|
List<PtUserAccountVo> userAccounts = baseMapper.selectVoList(lqw);
|
|
List<PtUserAccountVo> userAccounts = baseMapper.selectVoList(lqw);
|
|
|
- if(CollectionUtil.isEmpty(userAccounts)){
|
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(userAccounts)) {
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
// 正常卡信息
|
|
// 正常卡信息
|
|
|
PtCardBo ptCardBo = new PtCardBo();
|
|
PtCardBo ptCardBo = new PtCardBo();
|
|
|
ptCardBo.setStatus(CardStatusEnum.NORMAL.code().toString());
|
|
ptCardBo.setStatus(CardStatusEnum.NORMAL.code().toString());
|
|
|
- if(userId != null){
|
|
|
|
|
|
|
+ if (userId != null) {
|
|
|
ptCardBo.setUserId(userId);
|
|
ptCardBo.setUserId(userId);
|
|
|
}
|
|
}
|
|
|
List<PtCardVo> cards = ptCardService.getList(ptCardBo);
|
|
List<PtCardVo> cards = ptCardService.getList(ptCardBo);
|
|
|
- if(CollectionUtil.isEmpty(cards)){
|
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(cards)) {
|
|
|
return userAccounts;
|
|
return userAccounts;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -664,11 +657,11 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
Optional<PtCardVo> first = cards.stream()
|
|
Optional<PtCardVo> first = cards.stream()
|
|
|
.filter(p -> Objects.equals(p.getUserId(), id))
|
|
.filter(p -> Objects.equals(p.getUserId(), id))
|
|
|
.sorted(Comparator.comparing(PtCardVo::getChangeTime).reversed()).findFirst();
|
|
.sorted(Comparator.comparing(PtCardVo::getChangeTime).reversed()).findFirst();
|
|
|
- if(first.isPresent()){
|
|
|
|
|
|
|
+ if (first.isPresent()) {
|
|
|
ptCardVo = first.get();
|
|
ptCardVo = first.get();
|
|
|
}
|
|
}
|
|
|
userAccount.setCard(ptCardVo);
|
|
userAccount.setCard(ptCardVo);
|
|
|
- userAccount.setFacePicUrl(photoPrefix+userAccount.getPhoto());
|
|
|
|
|
|
|
+ userAccount.setFacePicUrl(photoPrefix + userAccount.getPhoto());
|
|
|
|
|
|
|
|
res.add(userAccount);
|
|
res.add(userAccount);
|
|
|
}
|
|
}
|