Commit 2c560143 authored by zhangwanglin's avatar zhangwanglin

基金申报重复提交

parent 2e04f8f9
......@@ -275,12 +275,7 @@ public class AccountController {
*/
@PostMapping("/accountsFreeCommit")
public Result accountsFreeCommit(Long accountsDetailId) {
int result = accountService.accountsFreeCommit(accountsDetailId);
if (result > 0) {
return Result.success();
} else {
return Result.failed("该记录已不可申报,请联系管理员");
}
return accountService.accountsFreeCommit(accountsDetailId);
}
/**
......
......@@ -58,7 +58,7 @@ public interface AccountService extends IService<ChDisabAccounts> {
int deleteAccountsDetail(Long accountsDetailId,Long freeRdId);
int accountsFreeCommit(Long accountsDetailId);
Result accountsFreeCommit(Long accountsDetailId);
int delayAccountCommit(Long accountsDetailId,Short status);
......
......@@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -840,27 +841,37 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
@Transactional(rollbackFor = Exception.class)
public int accountsFreeCommit(Long accountsDetailId){
public Result accountsFreeCommit(Long accountsDetailId){
log.info("accountsFreeCommit=========accountsDetailId:{}",accountsDetailId);
ChDisabDetailAccounts chDisabDetailAccountsDTO = chDisabAccountsDetailMapper.selectById(accountsDetailId);
log.info("accountsFreeCommit=========chDisabDetailAccountsDTO:{}",JSON.toJSONString(chDisabDetailAccountsDTO));
BigDecimal allCost = chDisabDetailAccountsDTO.getAccountsAllCost();
BigDecimal overallCost = chDisabDetailAccountsDTO.getAccountsOverallCost();
BigDecimal personalCost = chDisabDetailAccountsDTO.getAccountsPersonalCost();
Short status = chDisabDetailAccountsDTO.getStatus();
if(status == 1 ){
log.info("{},已完成申报", accountsDetailId);
return Result.failed("已完成申报,请勿重复提交");
}
Long accountsId = chDisabDetailAccountsDTO.getAccountsId();
ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(accountsId);
log.info("accountsFreeCommit====before=====chDisabAccountDTO:{}",JSON.toJSONString(chDisabAccountDTO));
Short accountsStatus = chDisabAccountDTO.getAccountsStatus();
if(accountsStatus > 1){
log.info("{},已完成审核",accountsDetailId);
return -1;
log.info("{},已完成审核", accountsDetailId);
return Result.failed("机构已完成审核,不能再进行申报");
}
if(chDisabAccountDTO !=null){
BigDecimal accountAllCost = chDisabAccountDTO.getAllCost();
BigDecimal accountOverallCost = chDisabAccountDTO.getOverallCost();
BigDecimal accountPersonalCost = chDisabAccountDTO.getPersonalCost();
chDisabAccountDTO.setAllCost(accountAllCost.add(allCost));
BigDecimal addAllCost = accountAllCost.add(allCost);
chDisabAccountDTO.setAllCost(addAllCost);
chDisabAccountDTO.setOverallCost(accountOverallCost.add(overallCost));
chDisabAccountDTO.setPersonalCost(accountPersonalCost.add(personalCost));
chDisabAccountDTO.setAccountsStatus((short)1);
log.info("accountsFreeCommit====accountsDetailId:{},累加前费用:{},申报费用:{},累加后费用:{}",accountsDetailId,accountAllCost,allCost,addAllCost);
disabAccountsMapper.updateById(chDisabAccountDTO);
}
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
......@@ -868,15 +879,23 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts.setStatus(((short)1));
chDisabDetailAccounts.setDeclarationTime(new Date());
chDisabDetailAccounts.setLcd(new Date());
log.info("accountsFreeCommit=====after====chDisabDetailAccountsDTO:{}",JSON.toJSONString(chDisabDetailAccounts));
int result = chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
return result;
if (result > 0) {
return Result.success();
} else {
return Result.failed("操作失败");
}
}
@Override
public int delayAccountCommit(Long accountsDetailId,Short status){
// 暂缓需要将当月的钱减掉
ChDisabDetailAccounts chDisabDetailAccountDTO = chDisabAccountsDetailMapper.selectById(accountsDetailId);
log.info("delayAccountCommit====before=====chDisabDetailAccountDTO:{}",JSON.toJSONString(chDisabDetailAccountDTO));
Long accountsId = chDisabDetailAccountDTO.getAccountsId();
BigDecimal accountsAllCost = chDisabDetailAccountDTO.getAccountsAllCost();
BigDecimal accountsOverallCost = chDisabDetailAccountDTO.getAccountsOverallCost();
......@@ -884,6 +903,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BigDecimal deductionAmount = chDisabDetailAccountDTO.getDeductionAmount();
BigDecimal reissueAmount = chDisabDetailAccountDTO.getReissueAmount();
ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(accountsId);
log.info("delayAccountCommit====before=====chDisabAccountDTO:{}",JSON.toJSONString(chDisabAccountDTO));
BigDecimal allCost = chDisabAccountDTO.getAllCost();
BigDecimal overallCost = chDisabAccountDTO.getOverallCost();
BigDecimal personalCost = chDisabAccountDTO.getPersonalCost();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment