|
|
@@ -23,7 +23,9 @@ import com.zhongzheng.modules.top.order.domain.TopOrderBankPay;
|
|
|
import com.zhongzheng.modules.top.order.mapper.TopOrderBankPayMapper;
|
|
|
import com.zhongzheng.modules.top.order.service.ITopOrderBankPayService;
|
|
|
import com.zhongzheng.modules.top.order.vo.TopOrderBankPayVo;
|
|
|
+import com.zhongzheng.modules.top.user.domain.TopSysRole;
|
|
|
import com.zhongzheng.modules.top.user.domain.TopSysUserRole;
|
|
|
+import com.zhongzheng.modules.top.user.service.ITopSysRoleService;
|
|
|
import com.zhongzheng.modules.top.user.service.ITopSysUserRoleService;
|
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
|
import org.slf4j.Logger;
|
|
|
@@ -60,6 +62,9 @@ public class TopOrderBankPayServiceImpl extends ServiceImpl<TopOrderBankPayMappe
|
|
|
@Autowired
|
|
|
private ITopSysUserRoleService topSysUserRoleService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ITopSysRoleService iTopSysRoleService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ITopDivideLogService iTopDivideLogService;
|
|
|
|
|
|
@@ -156,12 +161,20 @@ public class TopOrderBankPayServiceImpl extends ServiceImpl<TopOrderBankPayMappe
|
|
|
//校验当前角色审核权限
|
|
|
List<TopSysUserRole> userRoleList = topSysUserRoleService.list(new LambdaQueryWrapper<TopSysUserRole>().eq(TopSysUserRole::getUserId, bo.getLoginId()));
|
|
|
if (CollectionUtils.isEmpty(userRoleList) && !bo.getLoginName().equals("admin")) {
|
|
|
- throw new CustomException("当前账号没有审核权限");
|
|
|
+ throw new CustomException("当前账号没有操作权限");
|
|
|
}
|
|
|
List<Long> roleIds = userRoleList.stream().map(TopSysUserRole::getRoleId).collect(Collectors.toList());
|
|
|
TopDivideLog divideLog = iTopDivideLogService.getOne(new LambdaQueryWrapper<TopDivideLog>()
|
|
|
.eq(TopDivideLog::getId, bo.getDivideLogId()));
|
|
|
-
|
|
|
+ TopSysRole sysRole = iTopSysRoleService.getOne(new LambdaQueryWrapper<TopSysRole>()
|
|
|
+ .eq(TopSysRole::getRoleName, "出纳")
|
|
|
+ .eq(TopSysRole::getStatus, 1).last("limit 1"));
|
|
|
+ if(Validator.isEmpty(sysRole)){
|
|
|
+ throw new CustomException("当前系统没有出纳角色");
|
|
|
+ }
|
|
|
+ if (!roleIds.contains(sysRole.getRoleId()) && !bo.getLoginName().equals("admin") ) {
|
|
|
+ throw new CustomException("当前账号没有审核权限");
|
|
|
+ }
|
|
|
if(Validator.isEmpty(divideLog)){
|
|
|
throw new CustomException("审核数据错误");
|
|
|
}
|
|
|
@@ -176,9 +189,6 @@ public class TopOrderBankPayServiceImpl extends ServiceImpl<TopOrderBankPayMappe
|
|
|
if(!divideLogFirst.getId().equals(divideLog.getId())){
|
|
|
throw new CustomException("存在历史未支付月份");
|
|
|
}
|
|
|
- if (!bo.getLoginName().equals("admin") ) {
|
|
|
- throw new CustomException("当前账号没有审核权限");
|
|
|
- }
|
|
|
/*if (!roleIds.contains(checkLog.getRoleId()) && !bo.getLoginName().equals("admin") ) {
|
|
|
throw new CustomException("当前账号没有审核权限");
|
|
|
}*/
|