|
@@ -8,18 +8,12 @@ import com.ruoyi.common.exception.ServiceException;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.bean.BeanValidators;
|
|
import com.ruoyi.common.utils.bean.BeanValidators;
|
|
-import com.ruoyi.web.work.domain.Company;
|
|
|
|
-import com.ruoyi.web.work.domain.Platform;
|
|
|
|
-import com.ruoyi.web.work.domain.Statement;
|
|
|
|
-import com.ruoyi.web.work.domain.StatementDetail;
|
|
|
|
|
|
+import com.ruoyi.web.work.domain.*;
|
|
import com.ruoyi.web.work.domain.dto.RejectDto;
|
|
import com.ruoyi.web.work.domain.dto.RejectDto;
|
|
import com.ruoyi.web.work.domain.dto.StatementDto;
|
|
import com.ruoyi.web.work.domain.dto.StatementDto;
|
|
import com.ruoyi.web.work.mapper.StatementDetailMapper;
|
|
import com.ruoyi.web.work.mapper.StatementDetailMapper;
|
|
import com.ruoyi.web.work.mapper.StatementMapper;
|
|
import com.ruoyi.web.work.mapper.StatementMapper;
|
|
-import com.ruoyi.web.work.service.ICommonService;
|
|
|
|
-import com.ruoyi.web.work.service.ICompanyService;
|
|
|
|
-import com.ruoyi.web.work.service.IStatementDetailService;
|
|
|
|
-import com.ruoyi.web.work.service.IStatementService;
|
|
|
|
|
|
+import com.ruoyi.web.work.service.*;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -57,6 +51,9 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
|
|
@Autowired
|
|
@Autowired
|
|
private ICommonService commonService;
|
|
private ICommonService commonService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IRecordService recordService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<Statement> selectList(Statement statement) {
|
|
public List<Statement> selectList(Statement statement) {
|
|
return statementMapper.selectList(statement);
|
|
return statementMapper.selectList(statement);
|
|
@@ -233,9 +230,9 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
+ @Transactional
|
|
@Override
|
|
@Override
|
|
- public AjaxResult payOk(Long id){
|
|
|
|
|
|
+ public AjaxResult payOk(Long id) throws ServerException {
|
|
Statement statement = statementMapper.calculate(id);
|
|
Statement statement = statementMapper.calculate(id);
|
|
if (statement == null) {
|
|
if (statement == null) {
|
|
return AjaxResult.error("发放业务不存在");
|
|
return AjaxResult.error("发放业务不存在");
|
|
@@ -261,6 +258,14 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
|
|
if (!statementDetailMapper.updateState(statement.getId())) {
|
|
if (!statementDetailMapper.updateState(statement.getId())) {
|
|
throw new ServiceException("更新结算单失败,请联系管理员");
|
|
throw new ServiceException("更新结算单失败,请联系管理员");
|
|
}
|
|
}
|
|
|
|
+ Record record=new Record();
|
|
|
|
+ record.setType(2);
|
|
|
|
+ record.setCompanyId(statement.getCompanyId());
|
|
|
|
+ record.setOpId(statement.getId());
|
|
|
|
+ record.setMoney(statement.getMoney());
|
|
|
|
+ if (!recordService.save(record)) {
|
|
|
|
+ throw new ServerException("添加发放记录失败,请联系管理员");
|
|
|
|
+ }
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
}
|
|
}
|