|
|
@@ -193,9 +193,39 @@ public class DistributionCashWithdrawalServiceImpl extends ServiceImpl<Distribut
|
|
|
@Override
|
|
|
public List<DistributionCheckVo> queryCheckList(DistributionCheckQueryBo bo) {
|
|
|
List<DistributionCheckVo> checkVos = baseMapper.queryCheckList(bo);
|
|
|
+ //是否显示打款
|
|
|
+ DistributionCheckHandleBo check = new DistributionCheckHandleBo();
|
|
|
+ check.setAuditorId(bo.getAuditorId());
|
|
|
+ check.setAuditor(bo.getAuditor());
|
|
|
+ Integer cashier = validCashier(check, "cashier");
|
|
|
+ checkVos.forEach(item -> {
|
|
|
+ item.setCashier(cashier);
|
|
|
+ });
|
|
|
return checkVos;
|
|
|
}
|
|
|
|
|
|
+ private Integer validCashier(DistributionCheckHandleBo bo, String roleKey) {
|
|
|
+ if (bo.getAuditor().equals("admin")){
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ SysRole edu = iSysRoleService.getOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleKey, roleKey));
|
|
|
+ if (ObjectUtils.isNull(edu)){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ List<SysUserRole> list = iSysUserRoleService
|
|
|
+ .list(new LambdaQueryWrapper<SysUserRole>()
|
|
|
+ .eq(SysUserRole::getRoleId, edu.getRoleId()));
|
|
|
+ if (CollectionUtils.isEmpty(list)){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ List<SysUser> sysUsers = iSysUserService.listByIds(list.stream().map(SysUserRole::getUserId).collect(Collectors.toList()));
|
|
|
+ if (sysUsers.stream().noneMatch(item -> item.getUserId().equals(bo.getAuditorId()))){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public boolean checkHandle(DistributionCheckHandleBo bo) {
|
|
|
DistributionCashWithdrawal warning = getById(bo.getCwId());
|
|
|
@@ -279,7 +309,11 @@ public class DistributionCashWithdrawalServiceImpl extends ServiceImpl<Distribut
|
|
|
if(Validator.isEmpty(seller)||Validator.isEmpty(seller.getGzhOpenId())){
|
|
|
throw new CustomException("非法业务员或不存在openID");
|
|
|
}
|
|
|
-
|
|
|
+ //校验打款权限
|
|
|
+ DistributionCheckHandleBo check = new DistributionCheckHandleBo();
|
|
|
+ check.setAuditor(bo.getAuditor());
|
|
|
+ check.setAuditorId(bo.getAuditorId());
|
|
|
+ validPermission(check,"cashier");
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
Long nowTime = DateUtils.getNowTime();
|
|
|
String sign = ToolsUtils.EncoderByMd5(withdrawal.getCwSn()+nowTime.toString()+"pubilc2022");
|