feat:人脸角色审批
This commit is contained in:
1 parent
884cfa4b32
commit
de8d31cf46
15 files changed
+150
-193
No files matched your search
+18
-48
@@ -77,8 +77,7 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeApplyMapper, WalletRechargeApplyEntity>
|
||||
implements WalletRechargeApplyService {
|
||||
public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeApplyMapper, WalletRechargeApplyEntity> implements WalletRechargeApplyService {
|
||||
|
||||
static private final String TAG = "充值/扣款申请";
|
||||
|
||||
@@ -126,8 +125,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list.getRecords(),
|
||||
CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
@@ -239,8 +237,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
return R.failed();
|
||||
}
|
||||
list = list.stream().filter(v -> !ObjectUtil.isAllEmpty(v.getUsername(), v.getUserMobile(), v.getPrice()))
|
||||
.toList();
|
||||
list = list.stream().filter(v -> !ObjectUtil.isAllEmpty(v.getUsername(), v.getUserMobile(), v.getPrice())).toList();
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
return R.failed();
|
||||
}
|
||||
@@ -303,9 +300,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
if (i <= 0) {
|
||||
throw new RuntimeException("导入失败");
|
||||
}
|
||||
List<WalletRechargeImportEntity> batchSaveList = list.stream()
|
||||
.map(v -> WalletRechargeImportEntity.builder().price(v.getPriceNumber()).userId(v.getUserId())
|
||||
.userDeptId(v.getUserDeptId()).build()).toList();
|
||||
List<WalletRechargeImportEntity> batchSaveList = list.stream().map(v -> WalletRechargeImportEntity.builder().price(v.getPriceNumber()).userId(v.getUserId()).userDeptId(v.getUserDeptId()).build()).toList();
|
||||
batchSaveList.forEach(v -> v.setApplyId(insertObj.getId()));
|
||||
rechargeImportService.saveBatch(batchSaveList);
|
||||
return R.ok(null, MsgUtils.getMessage(ErrorCodes.SYS_USER_IMPORT_SUCCEED));
|
||||
@@ -320,9 +315,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
return;
|
||||
}
|
||||
String processId = dto.getProcessInstanceId();
|
||||
WalletRechargeApplyEntity detail = baseMapper.selectOne(new LambdaQueryWrapper<WalletRechargeApplyEntity>()
|
||||
.eq(WalletRechargeApplyEntity::getProcessId, processId)
|
||||
);
|
||||
WalletRechargeApplyEntity detail = baseMapper.selectOne(new LambdaQueryWrapper<WalletRechargeApplyEntity>().eq(WalletRechargeApplyEntity::getProcessId, processId));
|
||||
if (ObjectUtil.isEmpty(detail)) {
|
||||
return;
|
||||
}
|
||||
@@ -332,16 +325,10 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
}
|
||||
try {
|
||||
Boolean isConsent = flowUtil.isConsent(dto);
|
||||
String processStatus =
|
||||
isConsent ? TaskCheckStatusEnum.RESULT.getCode() : TaskCheckStatusEnum.REJECT.getCode();
|
||||
baseMapper.updateById(
|
||||
WalletRechargeApplyEntity.builder().id(detail.getId()).processTime(LocalDateTime.now())
|
||||
.processStatus(processStatus).build());
|
||||
String processStatus = isConsent ? TaskCheckStatusEnum.RESULT.getCode() : TaskCheckStatusEnum.REJECT.getCode();
|
||||
baseMapper.updateById(WalletRechargeApplyEntity.builder().id(detail.getId()).processTime(LocalDateTime.now()).processStatus(processStatus).build());
|
||||
if (isConsent) {
|
||||
List<WalletRechargeImportEntity> importList =
|
||||
rechargeImportService.list(new LambdaQueryWrapper<WalletRechargeImportEntity>()
|
||||
.eq(WalletRechargeImportEntity::getApplyId, detail.getId())
|
||||
);
|
||||
List<WalletRechargeImportEntity> importList = rechargeImportService.list(new LambdaQueryWrapper<WalletRechargeImportEntity>().eq(WalletRechargeImportEntity::getApplyId, detail.getId()));
|
||||
if (ObjectUtil.isEmpty(importList)) {
|
||||
return;
|
||||
}
|
||||
@@ -355,8 +342,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
if (ObjectUtil.isEmpty(wallet)) {
|
||||
continue;
|
||||
}
|
||||
walletTransactionService.addWalletBalance(wallet.getId(), v.getPrice(), String.valueOf(v.getId()),
|
||||
WalletBizEnum.BATCH);
|
||||
walletTransactionService.addWalletBalance(wallet.getId(), v.getPrice(), String.valueOf(v.getId()), WalletBizEnum.BATCH);
|
||||
}
|
||||
log.info("|{}|审批回调成功,dto:|{}", TAG, JSON.toJSONString(dto));
|
||||
}
|
||||
@@ -370,8 +356,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateBeforePrice(WalletRechargeApplyEntity detail) {
|
||||
if (ObjectUtil.isNotEmpty(detail.getProcessStatus()) || ObjectUtil.equals(detail.getProcessStatus(),
|
||||
TaskCheckStatusEnum.PADDING.getCode())) {
|
||||
if (ObjectUtil.isNotEmpty(detail.getProcessStatus()) || ObjectUtil.equals(detail.getProcessStatus(), TaskCheckStatusEnum.PADDING.getCode())) {
|
||||
return;
|
||||
}
|
||||
WalletTypeEntity walletType = walletTypeService.getById(detail.getWalletTypeId());
|
||||
@@ -380,10 +365,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
return;
|
||||
}
|
||||
String importTimeStr = LocalDateTimeUtil.format(detail.getImportTime(), DatePattern.NORM_MONTH_PATTERN);
|
||||
List<WalletRechargeImportEntity> importList =
|
||||
rechargeImportService.list(new LambdaQueryWrapper<WalletRechargeImportEntity>()
|
||||
.eq(WalletRechargeImportEntity::getApplyId, detail.getId())
|
||||
);
|
||||
List<WalletRechargeImportEntity> importList = rechargeImportService.list(new LambdaQueryWrapper<WalletRechargeImportEntity>().eq(WalletRechargeImportEntity::getApplyId, detail.getId()));
|
||||
if (ObjectUtil.isEmpty(importList)) {
|
||||
return;
|
||||
}
|
||||
@@ -395,8 +377,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
if (ObjectUtil.isEmpty(wallet)) {
|
||||
continue;
|
||||
}
|
||||
Integer price = walletTransactionMapper.getTransactionPriceCount(importTimeStr, wallet.getId(),
|
||||
WalletBizEnum.BATCH.getCode());
|
||||
Integer price = walletTransactionMapper.getTransactionPriceCount(importTimeStr, wallet.getId(), WalletBizEnum.BATCH.getCode());
|
||||
if (ObjectUtil.isNotEmpty(price)) {
|
||||
item.setBeforePrice(price);
|
||||
}
|
||||
@@ -418,9 +399,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
item.setUserMobile(v.getUserMobile());
|
||||
item.setUserDeptName(v.getUserDeptName());
|
||||
if (ObjectUtil.isNotEmpty(v.getPrice())) {
|
||||
String price =
|
||||
new BigDecimal(v.getPrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP)
|
||||
.toString();
|
||||
String price = new BigDecimal(v.getPrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString();
|
||||
item.setPrice(price);
|
||||
}
|
||||
result.add(item);
|
||||
@@ -453,22 +432,16 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
walletTypeDto.setWalletTypeIds(walletTypeIds);
|
||||
List<WalletTypeEntity> walletTypeList = walletTypeMapper.list(walletTypeDto);
|
||||
if (ObjectUtil.isNotEmpty(walletTypeList)) {
|
||||
WalletDataUtil.convertWalletTypeList(list,
|
||||
CollectionUtils.convertMap(walletTypeList, WalletTypeEntity::getId));
|
||||
WalletDataUtil.convertWalletTypeList(list, CollectionUtils.convertMap(walletTypeList, WalletTypeEntity::getId));
|
||||
}
|
||||
}
|
||||
// 审批流程
|
||||
if (dto.getIsFindCheckUser()) {
|
||||
List<String> processInstanceIds =
|
||||
list.stream().map(WalletRechargeApplyVo::getProcessId).filter(ObjectUtil::isNotEmpty).distinct()
|
||||
.toList();
|
||||
List<String> processInstanceIds = list.stream().map(WalletRechargeApplyVo::getProcessId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(processInstanceIds)) {
|
||||
List<TaskDto> taskList =
|
||||
flowUtil.queryProcessInstanceList(SecurityUtils.getUser().getId().toString(),
|
||||
processInstanceIds);
|
||||
List<TaskDto> taskList = flowUtil.queryProcessInstanceList(SecurityUtils.getUser().getId().toString(), processInstanceIds);
|
||||
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||
Map<String, TaskDto> taskMap =
|
||||
CollectionUtils.convertMap(taskList, TaskDto::getProcessInstanceId);
|
||||
Map<String, TaskDto> taskMap = CollectionUtils.convertMap(taskList, TaskDto::getProcessInstanceId);
|
||||
CollectionUtils.convertList(list, v -> {
|
||||
TaskDto task = taskMap.get(v.getProcessId());
|
||||
if (ObjectUtil.isNotEmpty(task)) {
|
||||
@@ -483,10 +456,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
}
|
||||
|
||||
private boolean isCheckData(Long walletId) {
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<WalletRechargeApplyEntity>()
|
||||
.eq(WalletRechargeApplyEntity::getUserId, walletId)
|
||||
.eq(WalletRechargeApplyEntity::getProcessStatus, NodeStatusEnum.JXZ.getCode())
|
||||
);
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<WalletRechargeApplyEntity>().eq(WalletRechargeApplyEntity::getUserId, walletId).eq(WalletRechargeApplyEntity::getProcessStatus, NodeStatusEnum.JXZ.getCode()));
|
||||
return count >= 3;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user