|
@@ -123,31 +123,49 @@ public class UserAccountProfitServiceImpl extends ServiceImpl<UserAccountProfitM
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional
|
|
public ResultData editCashOutState(CashOutRecordStateReq req){
|
|
public ResultData editCashOutState(CashOutRecordStateReq req){
|
|
if(req.getId()==null|| req.getId()<=0)
|
|
if(req.getId()==null|| req.getId()<=0)
|
|
return ResultData.getFailResult("id不能为空");
|
|
return ResultData.getFailResult("id不能为空");
|
|
if(req.getState()==null)
|
|
if(req.getState()==null)
|
|
return ResultData.getFailResult("state不能为空");
|
|
return ResultData.getFailResult("state不能为空");
|
|
- CashOutRecord cashOutRecord=new CashOutRecord();
|
|
|
|
- cashOutRecord.setId(req.getId());
|
|
|
|
- if(req.getState().equals(Short.valueOf("5"))){//拒绝提现
|
|
|
|
- cashOutRecord.setState(req.getState());
|
|
|
|
- cashOutRecord.setReviewRemarks(req.getReviewRemarks());
|
|
|
|
- cashOutRecordMapper.updateById(cashOutRecord);
|
|
|
|
- }else if(req.getState().equals(Short.valueOf("1"))){//从新发起钉钉审批
|
|
|
|
- cashOutRecord.setState((short)2);
|
|
|
|
- cashOutRecord.setProcessInstanceId("");
|
|
|
|
- cashOutRecordMapper.updateById(cashOutRecord);
|
|
|
|
- CashOutRecord existCashOutRecord=cashOutRecordMapper.selectById(req.getId());
|
|
|
|
- List<CalculationProfit> profitList=calculationProfitMapper.getListOfCashOutId(req.getId());
|
|
|
|
- this.sendCashOutMQ(existCashOutRecord,new Date(),profitList);
|
|
|
|
- }else if(req.getState().equals(Short.valueOf("2"))){//审批中
|
|
|
|
- cashOutRecord.setState(req.getState());
|
|
|
|
- cashOutRecord.setProcessInstanceId(req.getProcessInstanceId());
|
|
|
|
- cashOutRecordMapper.updateById(cashOutRecord);
|
|
|
|
- }else {
|
|
|
|
- cashOutRecord.setState(req.getState());
|
|
|
|
- cashOutRecordMapper.updateById(cashOutRecord);
|
|
|
|
|
|
+ CashOutRecord existCashOutRecord=cashOutRecordMapper.selectById(req.getId());
|
|
|
|
+ if(existCashOutRecord!=null){
|
|
|
|
+ Date actionTme=new Date();
|
|
|
|
+ CashOutRecord cashOutRecord=new CashOutRecord();
|
|
|
|
+ cashOutRecord.setId(req.getId());
|
|
|
|
+ cashOutRecord.setEditTime(actionTme);
|
|
|
|
+ if(req.getState().equals(Short.valueOf("5"))){//拒绝提现
|
|
|
|
+ cashOutRecord.setState(req.getState());
|
|
|
|
+ cashOutRecord.setReviewRemarks(req.getReviewRemarks());
|
|
|
|
+ cashOutRecordMapper.updateById(cashOutRecord);
|
|
|
|
+ calculationProfitMapper.editCashOutState(req.getId(),actionTme,1);
|
|
|
|
+ QueryWrapper<UserAccountProfit> profitQuery = new QueryWrapper<>();
|
|
|
|
+ profitQuery.eq("unionid", existCashOutRecord.getUnionid());
|
|
|
|
+ List<UserAccountProfit>accountProfitList=userAccountProfitMapper.selectList(profitQuery);
|
|
|
|
+ userAccountProfitMapper.cashOutDisagreeById(existCashOutRecord.getAmount(),actionTme,accountProfitList.get(0).getId());
|
|
|
|
+ }else if(req.getState().equals(Short.valueOf("1"))){//从新发起钉钉审批
|
|
|
|
+ cashOutRecord.setState((short)2);
|
|
|
|
+ cashOutRecord.setProcessInstanceId("");
|
|
|
|
+ cashOutRecordMapper.updateById(cashOutRecord);
|
|
|
|
+ List<CalculationProfit> profitList=calculationProfitMapper.getListOfCashOutId(req.getId());
|
|
|
|
+ this.sendCashOutMQ(existCashOutRecord,new Date(),profitList);
|
|
|
|
+ }else if(req.getState().equals(Short.valueOf("2"))){//审批中
|
|
|
|
+ cashOutRecord.setState(req.getState());
|
|
|
|
+ cashOutRecord.setProcessInstanceId(req.getProcessInstanceId());
|
|
|
|
+ cashOutRecordMapper.updateById(cashOutRecord);
|
|
|
|
+ }else if(req.getState().equals(Short.valueOf("4"))){//已完成
|
|
|
|
+ cashOutRecord.setState(req.getState());
|
|
|
|
+ cashOutRecordMapper.updateById(cashOutRecord);
|
|
|
|
+ calculationProfitMapper.editCashOutState(req.getId(),actionTme,4);
|
|
|
|
+ QueryWrapper<UserAccountProfit> profitQuery = new QueryWrapper<>();
|
|
|
|
+ profitQuery.eq("unionid", existCashOutRecord.getUnionid());
|
|
|
|
+ List<UserAccountProfit>accountProfitList=userAccountProfitMapper.selectList(profitQuery);
|
|
|
|
+ userAccountProfitMapper.cashOutAgreeById(existCashOutRecord.getAmount(),actionTme,accountProfitList.get(0).getId());
|
|
|
|
+ }else {
|
|
|
|
+ cashOutRecord.setState(req.getState());
|
|
|
|
+ cashOutRecordMapper.updateById(cashOutRecord);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return ResultData.getSuccessResult("操作成功");
|
|
return ResultData.getSuccessResult("操作成功");
|
|
}
|
|
}
|