Commit ebf8776e by jianshuqin

增加功能:费用单增加费用大类

parent 93687176
...@@ -19,6 +19,9 @@ public class CostTypeImportExcelItem { ...@@ -19,6 +19,9 @@ public class CostTypeImportExcelItem {
@ExcelProperty("费用类别") @ExcelProperty("费用类别")
private String typeName; private String typeName;
@ExcelProperty("费用大类")
private String categoryName;
@ExcelProperty("费用类别描述") @ExcelProperty("费用类别描述")
private String typeDesc; private String typeDesc;
......
...@@ -293,6 +293,7 @@ public class CostDomain implements Serializable { ...@@ -293,6 +293,7 @@ public class CostDomain implements Serializable {
this.setTypeId(costTypeDomain.getId()); this.setTypeId(costTypeDomain.getId());
this.setTypeNo(costTypeDomain.getTypeNo()); this.setTypeNo(costTypeDomain.getTypeNo());
this.setTypeName(costTypeDomain.getTypeName()); this.setTypeName(costTypeDomain.getTypeName());
this.setCategoryName(costTypeDomain.getCategoryName());
AccountingSubjectMapper accountingSubjectMapper = SpringContextUtil.getBean(AccountingSubjectMapper.class); AccountingSubjectMapper accountingSubjectMapper = SpringContextUtil.getBean(AccountingSubjectMapper.class);
AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId()); AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId());
...@@ -357,6 +358,7 @@ public class CostDomain implements Serializable { ...@@ -357,6 +358,7 @@ public class CostDomain implements Serializable {
// 回调必要的key参数(DetailKey)不能为空; // 回调必要的key参数(DetailKey)不能为空;
req.setDetailKey(detailKey); req.setDetailKey(detailKey);
req.setTypeName(this.getTypeName()); req.setTypeName(this.getTypeName());
req.setCategoryName(this.getCategoryName());
req.setProject(this.getProject()); req.setProject(this.getProject());
req.setProjectDate(this.getProjectDate()); req.setProjectDate(this.getProjectDate());
......
...@@ -200,6 +200,7 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -200,6 +200,7 @@ public class CostApiServiceImpl implements CostApiService {
} }
costDomain.setTypeNo(costTypeDomain.getTypeNo()); costDomain.setTypeNo(costTypeDomain.getTypeNo());
costDomain.setTypeName(costTypeDomain.getTypeName()); costDomain.setTypeName(costTypeDomain.getTypeName());
costDomain.setCategoryName(costTypeDomain.getCategoryName());
costDomain.setAccountingSubjectId(costTypeDomain.getAccountingSubjectId()); costDomain.setAccountingSubjectId(costTypeDomain.getAccountingSubjectId());
costDomain.setAccountingSubjectNo(costTypeDomain.getAccountingSubjectNo()); costDomain.setAccountingSubjectNo(costTypeDomain.getAccountingSubjectNo());
costDomain.setNsAccountingSubjectId(costTypeDomain.getNsAccountingSubjectId()); costDomain.setNsAccountingSubjectId(costTypeDomain.getNsAccountingSubjectId());
...@@ -251,6 +252,7 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -251,6 +252,7 @@ public class CostApiServiceImpl implements CostApiService {
} }
costDomain.setTypeNo(costTypeDomain.getTypeNo()); costDomain.setTypeNo(costTypeDomain.getTypeNo());
costDomain.setTypeName(costTypeDomain.getTypeName()); costDomain.setTypeName(costTypeDomain.getTypeName());
costDomain.setCategoryName(costTypeDomain.getCategoryName());
costDomain.setAccountingSubjectId(costTypeDomain.getAccountingSubjectId()); costDomain.setAccountingSubjectId(costTypeDomain.getAccountingSubjectId());
costDomain.setAccountingSubjectNo(costTypeDomain.getAccountingSubjectNo()); costDomain.setAccountingSubjectNo(costTypeDomain.getAccountingSubjectNo());
costDomain.setNsAccountingSubjectId(costTypeDomain.getNsAccountingSubjectId()); costDomain.setNsAccountingSubjectId(costTypeDomain.getNsAccountingSubjectId());
......
...@@ -99,6 +99,7 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail ...@@ -99,6 +99,7 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
costDetailDomain.setTypeId(costTypeDomain.getId()); costDetailDomain.setTypeId(costTypeDomain.getId());
costDetailDomain.setTypeNo(costTypeDomain.getTypeNo()); costDetailDomain.setTypeNo(costTypeDomain.getTypeNo());
costDetailDomain.setTypeName(costTypeDomain.getTypeName()); costDetailDomain.setTypeName(costTypeDomain.getTypeName());
costDetailDomain.setCategoryName(costTypeDomain.getCategoryName());
costDetailDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo()); costDetailDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo());
costDetailDomain.setAccountingSubjectName(accountingSubject.getName()); costDetailDomain.setAccountingSubjectName(accountingSubject.getName());
} }
......
...@@ -82,6 +82,7 @@ public class CostTypeImportExcelItemListener extends AnalysisEventListener<CostT ...@@ -82,6 +82,7 @@ public class CostTypeImportExcelItemListener extends AnalysisEventListener<CostT
costTypeDomain = new CostTypeDomain(); costTypeDomain = new CostTypeDomain();
costTypeDomain.setTypeNo(IdWorker.getIdStr()); costTypeDomain.setTypeNo(IdWorker.getIdStr());
costTypeDomain.setTypeName(item.getTypeName()); costTypeDomain.setTypeName(item.getTypeName());
costTypeDomain.setCategoryName(item.getCategoryName());
costTypeDomain.setDescription(item.getTypeDesc()); costTypeDomain.setDescription(item.getTypeDesc());
costTypeDomain.setAccountingSubjectId(accountingSubject.getId()); costTypeDomain.setAccountingSubjectId(accountingSubject.getId());
costTypeDomain.setCostTemplateType(costTemplateType); costTypeDomain.setCostTemplateType(costTemplateType);
......
...@@ -185,6 +185,7 @@ public abstract class AbstractCostService implements CostService { ...@@ -185,6 +185,7 @@ public abstract class AbstractCostService implements CostService {
if (accountingSubject != null) { if (accountingSubject != null) {
costDomain.setTypeNo(costDomain.getTypeNo()); costDomain.setTypeNo(costDomain.getTypeNo());
costDomain.setTypeName(costTypeDomain.getTypeName()); costDomain.setTypeName(costTypeDomain.getTypeName());
costDomain.setCategoryName(costTypeDomain.getCategoryName());
costDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo()); costDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo());
costDomain.setAccountingSubjectName(accountingSubject.getName()); costDomain.setAccountingSubjectName(accountingSubject.getName());
} }
......
...@@ -59,6 +59,7 @@ public class PayCostServiceImpl extends AbstractCostService implements CostServi ...@@ -59,6 +59,7 @@ public class PayCostServiceImpl extends AbstractCostService implements CostServi
CostDetailDomain detailDomain = cost.getCostDetailDomainList().get(0); CostDetailDomain detailDomain = cost.getCostDetailDomainList().get(0);
req.setProject(detailDomain.getProject()); req.setProject(detailDomain.getProject());
req.setProjectDate(detailDomain.getProjectDate()); req.setProjectDate(detailDomain.getProjectDate());
req.setCategoryName(detailDomain.getCategoryName());
} }
log.info("提交出纳参数:{}", JsonUtilByFsJson.beanToJson(req)); log.info("提交出纳参数:{}", JsonUtilByFsJson.beanToJson(req));
......
package com.blt.other.module.cost.service.impl.costplan; package com.blt.other.module.cost.service.impl.costplan;
import com.bailuntec.common.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
...@@ -75,6 +76,9 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme ...@@ -75,6 +76,9 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme
BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY"); BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY");
costDomain.setToRmbRate(toRmbRate); costDomain.setToRmbRate(toRmbRate);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP)); costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
if(StringUtils.isBlank(costDomain.getCategoryName())){
costDomain.setCategoryName((StringUtils.isNotBlank(costDomain.getProject()) && !costDomain.getProject().equals("集团") ? "管理成本" : "日常费用"));
}
int insert = costDao.insert(costDomain); int insert = costDao.insert(costDomain);
costLogService.save(costDomain.getCostNo(), costDomain.getCreateUserid(), "由费用计划:" + costDomain.getCostPlanNo() + " 生成借支单"); costLogService.save(costDomain.getCostNo(), costDomain.getCreateUserid(), "由费用计划:" + costDomain.getCostPlanNo() + " 生成借支单");
......
package com.blt.other.module.cost.service.impl.costplan; package com.blt.other.module.cost.service.impl.costplan;
import com.bailuntec.common.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
...@@ -102,7 +103,9 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme ...@@ -102,7 +103,9 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY"); BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY");
costDomain.setToRmbRate(toRmbRate); costDomain.setToRmbRate(toRmbRate);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP)); costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
if(StringUtils.isBlank(costDomain.getCategoryName())){
costDomain.setCategoryName((StringUtils.isNotBlank(costDomain.getProject()) && !costDomain.getProject().equals("集团") ? "管理成本" : "日常费用"));
}
costDao.insert(costDomain); costDao.insert(costDomain);
//更新借支单申请归还金额 //更新借支单申请归还金额
...@@ -128,6 +131,9 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme ...@@ -128,6 +131,9 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY"); BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY");
costDomain.setToRmbRate(toRmbRate); costDomain.setToRmbRate(toRmbRate);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP)); costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
if(StringUtils.isNotBlank(costDomain.getCategoryName())){
costDomain.setCategoryName((StringUtils.isNotBlank(costDomain.getProject()) && !costDomain.getProject().equals("集团") ? "管理成本" : "日常费用"));
}
costDao.insert(costDomain); costDao.insert(costDomain);
...@@ -225,7 +231,9 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme ...@@ -225,7 +231,9 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
BigDecimal toRmbRate1 = CurUtils.getCur(costDomain.getDic(), "CNY"); BigDecimal toRmbRate1 = CurUtils.getCur(costDomain.getDic(), "CNY");
costDomain.setToRmbRate(toRmbRate1); costDomain.setToRmbRate(toRmbRate1);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate1).setScale(2, BigDecimal.ROUND_HALF_UP)); costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate1).setScale(2, BigDecimal.ROUND_HALF_UP));
if(StringUtils.isBlank(costDomain.getCategoryName())){
costDomain.setCategoryName((StringUtils.isNotBlank(costDomain.getProject()) && !costDomain.getProject().equals("集团") ? "管理成本" : "日常费用"));
}
costDao.insert(costDomain); costDao.insert(costDomain);
//更新借支单申请归还金额 //更新借支单申请归还金额
......
package com.blt.other.module.cost.service.impl.costplan; package com.blt.other.module.cost.service.impl.costplan;
import com.bailuntec.common.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
...@@ -124,6 +125,11 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement ...@@ -124,6 +125,11 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
// 生成付款费用详情单 // 生成付款费用详情单
for (CostDetailDomain costDetail : costDetailDomains) { for (CostDetailDomain costDetail : costDetailDomains) {
costDetail.setCostNo(costNo); costDetail.setCostNo(costNo);
if(StringUtils.isNotBlank(costTypeDomain.getCategoryName())){
costDetail.setCategoryName(costTypeDomain.getCategoryName());
} else {
costDetail.setCategoryName((StringUtils.isNotBlank(costDetail.getProject()) && !costDetail.getProject().equals("集团") ? "管理成本" : "日常费用"));
}
// 生成付款费用详情 // 生成付款费用详情
costDetailDao.insert(costDetail); costDetailDao.insert(costDetail);
} }
......
package com.blt.other.module.cost.service.impl.costplan; package com.blt.other.module.cost.service.impl.costplan;
import com.bailuntec.common.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
...@@ -75,6 +76,9 @@ public class CostPlanNewReceiptServiceImpl extends AbstractCostPlanService imple ...@@ -75,6 +76,9 @@ public class CostPlanNewReceiptServiceImpl extends AbstractCostPlanService imple
BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY"); BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY");
costDomain.setToRmbRate(toRmbRate); costDomain.setToRmbRate(toRmbRate);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP)); costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
if(StringUtils.isBlank(costDomain.getCategoryName())){
costDomain.setCategoryName((StringUtils.isNotBlank(costDomain.getProject()) && !costDomain.getProject().equals("集团") ? "管理成本" : "日常费用"));
}
Integer insert = costDao.insert(costDomain); Integer insert = costDao.insert(costDomain);
// 记录日志 // 记录日志
......
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