|
@@ -3,15 +3,6 @@ package com.zhongzheng.modules.distribution.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import com.zhongzheng.common.exception.CustomException;
|
|
|
-import com.zhongzheng.common.type.EncryptHandler;
|
|
|
-import com.zhongzheng.common.utils.DateUtils;
|
|
|
-import com.zhongzheng.modules.distribution.bo.DistributionCashLogAddBo;
|
|
|
-import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalAddBo;
|
|
|
-import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalEditBo;
|
|
|
-import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalQueryBo;
|
|
|
-import com.zhongzheng.modules.distribution.domain.DistributionCashWithdrawal;
|
|
|
-import com.zhongzheng.modules.distribution.domain.DistributionSeller;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
@@ -25,14 +16,12 @@ import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.modules.distribution.bo.*;
|
|
|
import com.zhongzheng.modules.distribution.domain.DistributionCashWithdrawal;
|
|
|
import com.zhongzheng.modules.distribution.domain.DistributionCheck;
|
|
|
+import com.zhongzheng.modules.distribution.domain.DistributionSeller;
|
|
|
import com.zhongzheng.modules.distribution.mapper.DistributionCashWithdrawalMapper;
|
|
|
import com.zhongzheng.modules.distribution.service.IDistributionCashLogService;
|
|
|
import com.zhongzheng.modules.distribution.service.IDistributionCashWithdrawalService;
|
|
|
-import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
|
|
|
-import com.zhongzheng.modules.distribution.vo.DistributionCashWithdrawalVo;
|
|
|
-import com.zhongzheng.modules.distribution.vo.DistributionSellerVo;
|
|
|
-import com.zhongzheng.modules.user.domain.User;
|
|
|
import com.zhongzheng.modules.distribution.service.IDistributionCheckService;
|
|
|
+import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
|
|
|
import com.zhongzheng.modules.distribution.vo.DistributionCashWithdrawalVo;
|
|
|
import com.zhongzheng.modules.distribution.vo.DistributionCheckDetailVo;
|
|
|
import com.zhongzheng.modules.distribution.vo.DistributionCheckVo;
|
|
@@ -60,9 +49,9 @@ public class DistributionCashWithdrawalServiceImpl extends ServiceImpl<Distribut
|
|
|
|
|
|
@Autowired
|
|
|
private IDistributionSellerService iDistributionSellerService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private IDistributionCashLogService iDistributionCashLogService;
|
|
|
+ @Autowired
|
|
|
private ISysRoleService iSysRoleService;
|
|
|
@Autowired
|
|
|
public ISysUserService iSysUserService;
|
|
@@ -198,7 +187,7 @@ public class DistributionCashWithdrawalServiceImpl extends ServiceImpl<Distribut
|
|
|
@Override
|
|
|
public boolean checkHandle(DistributionCheckHandleBo bo) {
|
|
|
DistributionCashWithdrawal warning = getById(bo.getCwId());
|
|
|
- if (ObjectUtils.isNotNull(warning)){
|
|
|
+ if (ObjectUtils.isNull(warning)){
|
|
|
throw new CustomException("提现记录获取失败!");
|
|
|
}
|
|
|
// validStatus(bo,warning);
|
|
@@ -210,7 +199,7 @@ public class DistributionCashWithdrawalServiceImpl extends ServiceImpl<Distribut
|
|
|
String roleKey2 = "accounting";
|
|
|
String roleKey3 = "boss";
|
|
|
Integer checkStatus = 0;
|
|
|
- if (bo.getCheckStatus() == 1){
|
|
|
+ if (bo.getCheckStatus() == 0){
|
|
|
//一审教务
|
|
|
validPermission(bo,roleKey1);
|
|
|
if (bo.getCheckResult() == 1){
|
|
@@ -220,10 +209,10 @@ public class DistributionCashWithdrawalServiceImpl extends ServiceImpl<Distribut
|
|
|
}else {
|
|
|
//拒绝 打回上一层
|
|
|
addNextAuditor(check,1,roleKey1);
|
|
|
- checkStatus = 0;
|
|
|
+ checkStatus = -1;
|
|
|
}
|
|
|
}
|
|
|
- if (bo.getCheckStatus() == 2){
|
|
|
+ if (bo.getCheckStatus() == 1){
|
|
|
//二审财务
|
|
|
validPermission(bo,roleKey2);
|
|
|
if (bo.getCheckResult() == 1){
|
|
@@ -233,10 +222,10 @@ public class DistributionCashWithdrawalServiceImpl extends ServiceImpl<Distribut
|
|
|
}else {
|
|
|
//拒绝 打回上一层
|
|
|
addNextAuditor(check,1,roleKey1);
|
|
|
- checkStatus = 1;
|
|
|
+ checkStatus = 0;
|
|
|
}
|
|
|
}
|
|
|
- if (bo.getCheckStatus() == 3){
|
|
|
+ if (bo.getCheckStatus() == 2){
|
|
|
//三审老板
|
|
|
validPermission(bo,roleKey3);
|
|
|
if (bo.getCheckResult() == 1){
|
|
@@ -245,7 +234,7 @@ public class DistributionCashWithdrawalServiceImpl extends ServiceImpl<Distribut
|
|
|
}else {
|
|
|
//拒绝 打回上一层
|
|
|
addNextAuditor(check,2,roleKey2);
|
|
|
- checkStatus = 2;
|
|
|
+ checkStatus = 1;
|
|
|
}
|
|
|
}
|
|
|
//保存审核记录
|
|
@@ -276,7 +265,9 @@ public class DistributionCashWithdrawalServiceImpl extends ServiceImpl<Distribut
|
|
|
}
|
|
|
|
|
|
private void validPermission(DistributionCheckHandleBo bo,String roleKey) {
|
|
|
-
|
|
|
+ if (bo.getAuditor().equals("admin")){
|
|
|
+ return;
|
|
|
+ }
|
|
|
SysRole edu = iSysRoleService.getOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleKey, roleKey));
|
|
|
if (ObjectUtils.isNull(edu)){
|
|
|
throw new CustomException("没有当前审核角色");
|