|
|
@@ -19,6 +19,7 @@ import com.kcim.service.ResponsibilityDepartmentService;
|
|
|
import com.kcim.service.SqlService;
|
|
|
import com.kcim.vo.*;
|
|
|
import com.kcim.web.reponse.ProjectCostResponse;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -47,6 +48,7 @@ import static com.kcim.service.impl.DrugMaterialCalculateServiceImpl.getVisitNoR
|
|
|
**/
|
|
|
@Service("ProjectCostService")
|
|
|
@Slf4j
|
|
|
+@AllArgsConstructor
|
|
|
public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
private static final Integer LIMIT = 1000;
|
|
|
ResponsibilityRepository responsibilityRepository;
|
|
|
@@ -69,6 +71,8 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
* 科室损益
|
|
|
*/
|
|
|
CostDepartmentProfitRepository costDepartmentProfitRepository;
|
|
|
+
|
|
|
+ CostDepartmentProfitAccountRepository costDepartmentProfitAccountRepository;
|
|
|
/**
|
|
|
* 项目分摊参数设置
|
|
|
*/
|
|
|
@@ -76,6 +80,8 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
|
|
|
ComputeShareParamRepository computeShareParamRepository;
|
|
|
|
|
|
+ ComputeProjectCostAccountRepository projectCostAccountRepository;
|
|
|
+
|
|
|
ItemRepository itemRepository;
|
|
|
|
|
|
ResponsibilityDepartmentRepository responsibilityDepartmentRepository;
|
|
|
@@ -104,34 +110,34 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
|
|
|
ResponsibilityDepartmentService responsibilityDepartmentService;
|
|
|
|
|
|
- public ProjectCostServiceImpl(ResponsibilityDepartmentService responsibilityDepartmentService,SqlService sqlService,ResponsibilityRepository responsibilityRepository, ComputeProjectCostRepository repository, ComputeProjectCostDetailRepository detailRepository, ComputeProjectGroupCostDetailRepository groupDetailRepository, ImportPatientItemRepository importPatientItemRepository, ShareParamCostRepository shareParamCostRepository, ShareParamCostDetailRepository shareParamCostDetailRepository, CostDepartmentProfitRepository costDepartmentProfitRepository, ShareParamTypeMapRepository shareParamTypeMapRepository, ComputeShareParamRepository computeShareParamRepository, ItemRepository itemRepository, ResponsibilityDepartmentRepository responsibilityDepartmentRepository, CenterService centerService, ComputePatientProjectCostRepository computePatientProjectCostRepository, ComputePatientProjectCostDetailRepository computePatientProjectCostDetailRepository, ComputePatientProjectGroupCostDetailRepository computePatientProjectGroupCostDetailRepository, ComputeStandShareParamRepository computeStandShareParamRepository, ComputeStandProjectCostRepository standProjectCostRepository, ComputeStandProjectCostDetailRepository standProjectCostDetailRepository, ComputeStandProjectGroupCostDetailRepository standProjectGroupCostDetailRepository, ComputeStandPatientProjectCostRepository computeStandPatientProjectCostRepository, ComputeStandPatientProjectCostDetailRepository computeStandPatientProjectCostDetailRepository, ComputeStandPatientProjectGroupCostDetailRepository computeStandPatientProjectGroupCostDetailRepository) {
|
|
|
- this.responsibilityRepository = responsibilityRepository;
|
|
|
- this.repository = repository;
|
|
|
- this.sqlService = sqlService;
|
|
|
-
|
|
|
- this.detailRepository = detailRepository;
|
|
|
- this.groupDetailRepository = groupDetailRepository;
|
|
|
- this.importPatientItemRepository = importPatientItemRepository;
|
|
|
- this.shareParamCostRepository = shareParamCostRepository;
|
|
|
- this.shareParamCostDetailRepository = shareParamCostDetailRepository;
|
|
|
- this.costDepartmentProfitRepository = costDepartmentProfitRepository;
|
|
|
- this.shareParamTypeMapRepository = shareParamTypeMapRepository;
|
|
|
- this.computeShareParamRepository = computeShareParamRepository;
|
|
|
- this.itemRepository = itemRepository;
|
|
|
- this.responsibilityDepartmentRepository = responsibilityDepartmentRepository;
|
|
|
- this.centerService = centerService;
|
|
|
- this.computePatientProjectCostRepository = computePatientProjectCostRepository;
|
|
|
- this.computePatientProjectCostDetailRepository = computePatientProjectCostDetailRepository;
|
|
|
- this.computePatientProjectGroupCostDetailRepository = computePatientProjectGroupCostDetailRepository;
|
|
|
- this.computeStandShareParamRepository = computeStandShareParamRepository;
|
|
|
- this.standProjectCostRepository = standProjectCostRepository;
|
|
|
- this.standProjectCostDetailRepository = standProjectCostDetailRepository;
|
|
|
- this.standProjectGroupCostDetailRepository = standProjectGroupCostDetailRepository;
|
|
|
- this.computeStandPatientProjectCostRepository = computeStandPatientProjectCostRepository;
|
|
|
- this.computeStandPatientProjectCostDetailRepository = computeStandPatientProjectCostDetailRepository;
|
|
|
- this.computeStandPatientProjectGroupCostDetailRepository = computeStandPatientProjectGroupCostDetailRepository;
|
|
|
- this.responsibilityDepartmentService=responsibilityDepartmentService;
|
|
|
- }
|
|
|
+// public ProjectCostServiceImpl(ResponsibilityDepartmentService responsibilityDepartmentService,SqlService sqlService,ResponsibilityRepository responsibilityRepository, ComputeProjectCostRepository repository, ComputeProjectCostDetailRepository detailRepository, ComputeProjectGroupCostDetailRepository groupDetailRepository, ImportPatientItemRepository importPatientItemRepository, ShareParamCostRepository shareParamCostRepository, ShareParamCostDetailRepository shareParamCostDetailRepository, CostDepartmentProfitRepository costDepartmentProfitRepository, ShareParamTypeMapRepository shareParamTypeMapRepository, ComputeShareParamRepository computeShareParamRepository, ItemRepository itemRepository, ResponsibilityDepartmentRepository responsibilityDepartmentRepository, CenterService centerService, ComputePatientProjectCostRepository computePatientProjectCostRepository, ComputePatientProjectCostDetailRepository computePatientProjectCostDetailRepository, ComputePatientProjectGroupCostDetailRepository computePatientProjectGroupCostDetailRepository, ComputeStandShareParamRepository computeStandShareParamRepository, ComputeStandProjectCostRepository standProjectCostRepository, ComputeStandProjectCostDetailRepository standProjectCostDetailRepository, ComputeStandProjectGroupCostDetailRepository standProjectGroupCostDetailRepository, ComputeStandPatientProjectCostRepository computeStandPatientProjectCostRepository, ComputeStandPatientProjectCostDetailRepository computeStandPatientProjectCostDetailRepository, ComputeStandPatientProjectGroupCostDetailRepository computeStandPatientProjectGroupCostDetailRepository) {
|
|
|
+// this.responsibilityRepository = responsibilityRepository;
|
|
|
+// this.repository = repository;
|
|
|
+// this.sqlService = sqlService;
|
|
|
+//
|
|
|
+// this.detailRepository = detailRepository;
|
|
|
+// this.groupDetailRepository = groupDetailRepository;
|
|
|
+// this.importPatientItemRepository = importPatientItemRepository;
|
|
|
+// this.shareParamCostRepository = shareParamCostRepository;
|
|
|
+// this.shareParamCostDetailRepository = shareParamCostDetailRepository;
|
|
|
+// this.costDepartmentProfitRepository = costDepartmentProfitRepository;
|
|
|
+// this.shareParamTypeMapRepository = shareParamTypeMapRepository;
|
|
|
+// this.computeShareParamRepository = computeShareParamRepository;
|
|
|
+// this.itemRepository = itemRepository;
|
|
|
+// this.responsibilityDepartmentRepository = responsibilityDepartmentRepository;
|
|
|
+// this.centerService = centerService;
|
|
|
+// this.computePatientProjectCostRepository = computePatientProjectCostRepository;
|
|
|
+// this.computePatientProjectCostDetailRepository = computePatientProjectCostDetailRepository;
|
|
|
+// this.computePatientProjectGroupCostDetailRepository = computePatientProjectGroupCostDetailRepository;
|
|
|
+// this.computeStandShareParamRepository = computeStandShareParamRepository;
|
|
|
+// this.standProjectCostRepository = standProjectCostRepository;
|
|
|
+// this.standProjectCostDetailRepository = standProjectCostDetailRepository;
|
|
|
+// this.standProjectGroupCostDetailRepository = standProjectGroupCostDetailRepository;
|
|
|
+// this.computeStandPatientProjectCostRepository = computeStandPatientProjectCostRepository;
|
|
|
+// this.computeStandPatientProjectCostDetailRepository = computeStandPatientProjectCostDetailRepository;
|
|
|
+// this.computeStandPatientProjectGroupCostDetailRepository = computeStandPatientProjectGroupCostDetailRepository;
|
|
|
+// this.responsibilityDepartmentService=responsibilityDepartmentService;
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 项目成本计算分页查询
|
|
|
@@ -467,20 +473,44 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
if (CollectionUtils.isEmpty(shareParamCostVos)){
|
|
|
throw new CostException("没有项目分摊配置信息无法分摊,请联系管理员");
|
|
|
}
|
|
|
+ //按成本列代码分组
|
|
|
+ Map<String, List<ShareParamCostVo>> shareParamCostMap = shareParamCostVos.stream().collect(Collectors.groupingBy(ShareParamCostVo::getColumnCode));
|
|
|
|
|
|
//获取科室损益报表数据
|
|
|
List<CostDepartmentProfit> costDepartmentProfits = costDepartmentProfitRepository.getDepartmentProfit(computeDate);
|
|
|
if (CollectionUtils.isEmpty(costDepartmentProfits)){
|
|
|
throw new CostException("未进行科室损益计算,请先进行科室损益计算,当前计算中止");
|
|
|
}
|
|
|
+ //按报表类型+报表编码+责任中心分组
|
|
|
+ Map<String, List<CostDepartmentProfit>> deptProfitGroup =costDepartmentProfits.stream().collect(Collectors.groupingBy(
|
|
|
+ cost ->String.format("%s-%s-%s",cost.getShareType(),cost.getReportNum(),cost.getResponsibilityCode())));
|
|
|
+
|
|
|
+ //获取科室损益的会计科目金额
|
|
|
+ List<CostDepartmentProfitAccount> deptPriftAccountList = costDepartmentProfitAccountRepository.getList(computeDate);
|
|
|
+ Map<Long, List<CostDepartmentProfitAccount>> deptPriftAccountMap;
|
|
|
+ if(CollectionUtils.isEmpty(deptPriftAccountList)){
|
|
|
+ deptPriftAccountMap = new HashMap<>();
|
|
|
+ }else{
|
|
|
+ deptPriftAccountMap= deptPriftAccountList.stream().collect(Collectors.groupingBy(CostDepartmentProfitAccount::getDeptProfitId));
|
|
|
+ }
|
|
|
|
|
|
+ //获取责任中心的医疗服务项目字典
|
|
|
+ List<Item> itemList = itemRepository.getRespItemList();
|
|
|
+ Map<String, Map<String, List<Item>>> respItemGroup = itemList.stream()
|
|
|
+ .collect(Collectors.groupingBy(Item::getResponsibilityCode,
|
|
|
+ Collectors.groupingBy(Item::getCode)));
|
|
|
|
|
|
//项目成本分摊配置主表信息(项目成本列配置)
|
|
|
List<ShareParamCost> ShareParamCosts = shareParamCostRepository.getList(null);
|
|
|
+ Map<String, List<ShareParamCost>> shareParamCostGroup = ShareParamCosts.stream().collect(Collectors.groupingBy(ShareParamCost::getItemType));
|
|
|
//分摊参数信息
|
|
|
List<ComputeShareParamDetailVo> computeShareParamDetails = computeShareParamRepository.getComputeShareParamDetail(computeDate);
|
|
|
+ Map<String, List<ComputeShareParamDetailVo>> shareParamDetailValueGroup = computeShareParamDetails.stream().collect(Collectors.groupingBy(
|
|
|
+ cost -> String.format("%s-%s-%s", cost.getResponsibilityCode(), cost.getItemType(), cost.getCode())));
|
|
|
//分摊参数按责任中心汇总信息
|
|
|
List<ComputeShareParamDetailVo> computeShareParamDetailGroup = computeShareParamRepository.getComputeShareParamDetailGroup(computeDate);
|
|
|
+ Map<String, List<ComputeShareParamDetailVo>> shareParamDetailGroup = computeShareParamDetailGroup.stream().collect(Collectors.groupingBy(
|
|
|
+ cost -> String.format("%s-%s-%s", cost.getItemType(), cost.getShareParamCode(), cost.getResponsibilityCode())));
|
|
|
//要计算的科室收费项目
|
|
|
List<ComputeShareParamDetailVo> computeResponsibilityItems = computeShareParamRepository.getComputeResponsibilityItem(computeDate);
|
|
|
|
|
|
@@ -493,16 +523,17 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
//按项目类别+责任中心代码+项目代码逐个计算项目分摊金额
|
|
|
computeResponsibilityItems.stream().forEach(responsibilityItem->{
|
|
|
//创建项目成本主表对象
|
|
|
- ComputeProjectCost projectCost = createComputeProjectCost(computeDate, currentUser, responsibilityItem);
|
|
|
+ ComputeProjectCost projectCost = createComputeProjectCost(computeDate, currentUser, responsibilityItem,respItemGroup);
|
|
|
computeProjectCosts.add(projectCost);
|
|
|
+ String shareParamDetailValueKey = String.format("%s-%s-%s", projectCost.getResponsibilityCode(),projectCost.getItemType(), projectCost.getCode());
|
|
|
//获取项目对应分摊参数数值
|
|
|
- List<ComputeShareParamDetailVo> itemShareParams = computeShareParamDetails.stream().filter(shareParamGroup -> shareParamGroup.getResponsibilityCode().equals(projectCost.getResponsibilityCode())
|
|
|
- && shareParamGroup.getCode().equals(projectCost.getCode()) && shareParamGroup.getItemType().equals(projectCost.getItemType())).collect(Collectors.toList());
|
|
|
+ List<ComputeShareParamDetailVo> itemShareParams =shareParamDetailValueGroup.get(shareParamDetailValueKey);
|
|
|
if (CollectionUtils.isEmpty(itemShareParams)){
|
|
|
throw new CostException(String.format("找不到项目的[%s-%s]对应的分摊分摊参数,请重新计算分摊参数",projectCost.getItemType(),projectCost.getName()));
|
|
|
}
|
|
|
+ Map<String, List<ComputeShareParamDetailVo>> respShareParamValueMap = itemShareParams.stream().collect(Collectors.groupingBy(ComputeShareParamDetailVo::getShareParamCode));
|
|
|
//取项目对应的分摊配置
|
|
|
- List<ShareParamCost> itemShareParamCost = ShareParamCosts.stream().filter(shareParamCost -> shareParamCost.getItemType().equals(projectCost.getItemType())).collect(Collectors.toList());
|
|
|
+ List<ShareParamCost> itemShareParamCost =shareParamCostGroup.get(projectCost.getItemType());
|
|
|
if (CollectionUtils.isEmpty(itemShareParamCost)){
|
|
|
throw new CostException(String.format("类型[%s]没有对应分摊配置,请联系管理员",projectCost.getItemType()));
|
|
|
}
|
|
|
@@ -510,7 +541,7 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
//按项目分摊配置计算项目的所有项目成本列的分摊金额
|
|
|
itemShareParamCost.stream().forEach(shareParamCost->{
|
|
|
ComputeProjectCostDetail cmputeProjectCostDetail=createComputeProjectCostDetail(computeDate, currentUser,incomeShareParam,responsibilityItem,projectCost,
|
|
|
- shareParamCost,shareParamCostVos,itemShareParams,computeShareParamDetailGroup,costDepartmentProfits);
|
|
|
+ shareParamCost,shareParamCostMap,respShareParamValueMap,shareParamDetailGroup, deptProfitGroup, deptPriftAccountMap);
|
|
|
computeProjectCostDetailChilds.add(cmputeProjectCostDetail);
|
|
|
});
|
|
|
computeProjectCostDetails.addAll(computeProjectCostDetailChilds);
|
|
|
@@ -537,22 +568,54 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
repository.removeByComputeDate(computeDate, currentUser);
|
|
|
detailRepository.removeByComputeDate(computeDate, currentUser);
|
|
|
groupDetailRepository.removeByComputeDate(computeDate, currentUser);
|
|
|
+ projectCostAccountRepository.removeByComputeDate(computeDate, currentUser);
|
|
|
|
|
|
//保存项目分摊主表对象数据
|
|
|
repository.saveBatch(computeProjectCosts, 500);
|
|
|
if (!CollectionUtils.isEmpty(computeProjectCostDetails)) {
|
|
|
//保存项目分摊明细表对象数据
|
|
|
computeProjectCostDetails.stream().forEach(projectCostDetail->projectCostDetail.setProjectCostId(projectCostDetail.getComputeProjectCost().getId()));
|
|
|
- detailRepository.saveBatch(computeProjectCostDetails, 500);
|
|
|
+ detailRepository.batchInsert(computeProjectCostDetails);
|
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(computeProjectGroupCostDetails)) {
|
|
|
//保存项目分摊汇总表对象数据
|
|
|
computeProjectGroupCostDetails.stream().forEach(projectCostDetail->projectCostDetail.setProjectCostId(projectCostDetail.getComputeProjectCost().getId()));
|
|
|
- groupDetailRepository.saveBatch(computeProjectGroupCostDetails, 500);
|
|
|
+ groupDetailRepository.batchInsert(computeProjectGroupCostDetails);
|
|
|
}
|
|
|
+ //保存项目成本对应的会计科目信息
|
|
|
+ saveProjectCostAccountList(computeProjectCosts);
|
|
|
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存项目成本对应的会计科目信息
|
|
|
+ * @param computeProjectCosts
|
|
|
+ */
|
|
|
+ public void saveProjectCostAccountList(List<ComputeProjectCost> computeProjectCosts){
|
|
|
+ List<ComputeProjectCostAccount> projectCostAccountList=new ArrayList<>();
|
|
|
+ for (ComputeProjectCost projectCost : computeProjectCosts) {
|
|
|
+ List<ComputeProjectCostAccount> itemAccountList =new ArrayList<>();
|
|
|
+ itemAccountList.addAll(projectCost.getProjectCostAccountMap().values());
|
|
|
+ if (CollectionUtils.isEmpty(itemAccountList)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ itemAccountList.forEach(itemAccount->{
|
|
|
+ itemAccount.setProjectCostId(projectCost.getId());
|
|
|
+ //计算单个项目的金额
|
|
|
+ if(BigDecimal.ZERO.compareTo(projectCost.getQuantity()) == NumberConstant.ZERO){
|
|
|
+ itemAccount.setComputeSingleResult(BigDecimal.ZERO);
|
|
|
+ }else{
|
|
|
+ BigDecimal divide = itemAccount.getComputeResult().divide(projectCost.getQuantity(), NumberConstant.FOUR, RoundingMode.HALF_UP);
|
|
|
+ itemAccount.setComputeSingleResult(divide);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ projectCostAccountList.addAll(itemAccountList);
|
|
|
+ }
|
|
|
+ if(CollectionUtils.isEmpty(projectCostAccountList)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
+ projectCostAccountRepository.batchInsert(projectCostAccountList);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -579,7 +642,7 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
* @param responsibilityItem
|
|
|
* @return
|
|
|
*/
|
|
|
- public ComputeProjectCost createComputeProjectCost(String computeDate,SessionUserVO currentUser,ComputeShareParamDetailVo responsibilityItem){
|
|
|
+ public ComputeProjectCost createComputeProjectCost(String computeDate,SessionUserVO currentUser,ComputeShareParamDetailVo responsibilityItem,Map<String, Map<String, List<Item>>> respItemGroup){
|
|
|
//主表公共对象
|
|
|
ComputeProjectCost computeProjectCost = new ComputeProjectCost();
|
|
|
computeProjectCost.setComputeDate(computeDate);
|
|
|
@@ -589,8 +652,14 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
computeProjectCost.setCode(responsibilityItem.getCode());
|
|
|
computeProjectCost.setName(responsibilityItem.getName());
|
|
|
computeProjectCost.setItemType(responsibilityItem.getItemType());
|
|
|
+ computeProjectCost.setQuantity(responsibilityItem.getNum());
|
|
|
computeProjectCost.setResponsibilityCode(responsibilityItem.getResponsibilityCode());
|
|
|
computeProjectCost.setResponsibilityName(responsibilityItem.getResponsibilityName());
|
|
|
+ Map<String, List<Item>> stringListMap = respItemGroup.get(responsibilityItem.getResponsibilityCode());
|
|
|
+ if(stringListMap!=null&&stringListMap.containsKey(responsibilityItem.getCode())){
|
|
|
+ computeProjectCost.setStandItemCode(stringListMap.get(responsibilityItem.getCode()).get(NumberConstant.ZERO).getStandItemCode());
|
|
|
+ }
|
|
|
+ computeProjectCost.setProjectCostAccountMap(new HashMap<>());
|
|
|
return computeProjectCost;
|
|
|
}
|
|
|
|
|
|
@@ -607,9 +676,17 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
* @param costDepartmentProfits 科室损益数据
|
|
|
* @return
|
|
|
*/
|
|
|
- public ComputeProjectCostDetail createComputeProjectCostDetail(String computeDate,SessionUserVO currentUser,ShareParamTypeMap incomeShareParam,ComputeShareParamDetailVo responsibilityItem,ComputeProjectCost computeProjectCost,ShareParamCost shareParamCost,
|
|
|
- List<ShareParamCostVo> shareParamCostVos,List<ComputeShareParamDetailVo> computeShareParamDetails ,
|
|
|
- List<ComputeShareParamDetailVo> computeShareParamDetailGroup,List<CostDepartmentProfit> costDepartmentProfits){
|
|
|
+ public ComputeProjectCostDetail createComputeProjectCostDetail(String computeDate,
|
|
|
+ SessionUserVO currentUser,
|
|
|
+ ShareParamTypeMap incomeShareParam,
|
|
|
+ ComputeShareParamDetailVo responsibilityItem,
|
|
|
+ ComputeProjectCost computeProjectCost,
|
|
|
+ ShareParamCost shareParamCost,
|
|
|
+ Map<String, List<ShareParamCostVo>> shareParamCostVos,
|
|
|
+ Map<String, List<ComputeShareParamDetailVo>> computeShareParamDetails ,
|
|
|
+ Map<String, List<ComputeShareParamDetailVo>> computeShareParamDetailGroup,
|
|
|
+ Map<String, List<CostDepartmentProfit>> costDepartmentProfits,
|
|
|
+ Map<Long, List<CostDepartmentProfitAccount>> deptPriftAccountMap){
|
|
|
//明细表公共对象
|
|
|
ComputeProjectCostDetail costDetail = new ComputeProjectCostDetail();
|
|
|
costDetail.setComputeDate(computeDate);
|
|
|
@@ -620,16 +697,15 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
costDetail.setCostColumnCode(shareParamCost.getColumnCode());
|
|
|
costDetail.setCostColumnType(shareParamCost.getColumnType());
|
|
|
//获取对应分摊配置明细
|
|
|
- List<ShareParamCostVo> shareParamDetails = shareParamCostVos.stream().filter(shareParamDetail -> shareParamDetail.getColumnCode().equals(shareParamCost.getColumnCode())).collect(Collectors.toList());
|
|
|
+ List<ShareParamCostVo> shareParamDetails = shareParamCostVos.get(shareParamCost.getColumnCode());
|
|
|
if (CollectionUtils.isEmpty(shareParamDetails)){
|
|
|
throw new CostException(String.format("[%s]没有对应分摊配置,请联系管理员",shareParamCost.getColumnName()));
|
|
|
}
|
|
|
+ String profitKey = String.format("%s-%s-%s",shareParamCost.getReportType(),shareParamCost.getProfitNum(),computeProjectCost.getResponsibilityCode());
|
|
|
//根据主表配置找到对应的科室损益数据
|
|
|
- Optional<CostDepartmentProfit> firstDepartmentProfit = costDepartmentProfits.stream().filter(departmentProfit -> String.valueOf(departmentProfit.getShareType()).equals(shareParamCost.getReportType()) &&
|
|
|
- String.valueOf(departmentProfit.getReportNum()).equals(shareParamCost.getProfitNum()) &&
|
|
|
- departmentProfit.getResponsibilityCode().equals(computeProjectCost.getResponsibilityCode())).findFirst();
|
|
|
+ List<CostDepartmentProfit> departmentProfitList = costDepartmentProfits.get(profitKey);
|
|
|
//没有对应的损益项目数据或者损益项目金额为0
|
|
|
- if(!firstDepartmentProfit.isPresent()||firstDepartmentProfit.get().getAmount().equals(BigDecimal.ZERO)){
|
|
|
+ if(CollectionUtils.isEmpty(departmentProfitList)|| departmentProfitList.get(NumberConstant.ZERO).getAmount().equals(BigDecimal.ZERO)){
|
|
|
costDetail.setComputeResult(BigDecimal.ZERO);
|
|
|
costDetail.setComputeSingleResult(BigDecimal.ZERO);
|
|
|
costDetail.setStandComputeResult(BigDecimal.ZERO);
|
|
|
@@ -637,13 +713,13 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
return costDetail;
|
|
|
}
|
|
|
//按项目分摊配置计算项目的一个项目成本列的分摊金额
|
|
|
- BigDecimal itemAllocationAmount=calcItemAllocationAmount(incomeShareParam,computeProjectCost,firstDepartmentProfit.get(),
|
|
|
- shareParamDetails,computeShareParamDetailGroup,computeShareParamDetails);
|
|
|
+ BigDecimal itemAllocationAmount=calcItemAllocationAmount(incomeShareParam,computeProjectCost, departmentProfitList.get(NumberConstant.ZERO),
|
|
|
+ shareParamDetails,computeShareParamDetailGroup,computeShareParamDetails,deptPriftAccountMap);
|
|
|
costDetail.setComputeResult(itemAllocationAmount);
|
|
|
|
|
|
//按项目分摊配置计算项目的一个项目成本列的标准法分摊金额
|
|
|
- BigDecimal itemStandAllocationAmount=calcItemStandAllocationAmount(incomeShareParam,computeProjectCost,firstDepartmentProfit.get(),
|
|
|
- shareParamDetails,computeShareParamDetailGroup,computeShareParamDetails);
|
|
|
+ BigDecimal itemStandAllocationAmount=calcItemStandAllocationAmount(incomeShareParam,computeProjectCost, departmentProfitList.get(NumberConstant.ZERO),
|
|
|
+ shareParamDetails,computeShareParamDetailGroup,computeShareParamDetails,deptPriftAccountMap);
|
|
|
costDetail.setStandComputeResult(itemStandAllocationAmount);
|
|
|
|
|
|
//项目没有数量时,单个项目的分摊金额为0
|
|
|
@@ -667,44 +743,118 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
* @param computeShareParamDetails 分摊参数计算明细
|
|
|
* @return
|
|
|
*/
|
|
|
- public BigDecimal calcItemAllocationAmount(ShareParamTypeMap incomeShareParam,ComputeProjectCost computeProjectCost,CostDepartmentProfit costDepartmentProfit,List<ShareParamCostVo> shareParamCostVos,
|
|
|
- List<ComputeShareParamDetailVo> computeShareParamDetailGroup,List<ComputeShareParamDetailVo> computeShareParamDetails){
|
|
|
+ public BigDecimal calcItemAllocationAmount(ShareParamTypeMap incomeShareParam,
|
|
|
+ ComputeProjectCost computeProjectCost,
|
|
|
+ CostDepartmentProfit costDepartmentProfit,
|
|
|
+ List<ShareParamCostVo> shareParamCostVos,
|
|
|
+ Map<String, List<ComputeShareParamDetailVo>> computeShareParamDetailGroup,
|
|
|
+ Map<String, List<ComputeShareParamDetailVo>> computeShareParamDetails,
|
|
|
+ Map<Long, List<CostDepartmentProfitAccount>> deptPriftAccountMap) {
|
|
|
BigDecimal itemAllocationAmount=BigDecimal.ZERO;
|
|
|
//按配置计算每个参数分摊金额
|
|
|
- for (ShareParamCostVo shareParamCostVo : shareParamCostVos) {//获取参数对应的责任中心汇总数据
|
|
|
- Optional<ComputeShareParamDetailVo> firstShareParamGroup = computeShareParamDetailGroup.stream().filter(shareParamGroup -> shareParamGroup.getItemType().equals(computeProjectCost.getItemType()) &&
|
|
|
- shareParamGroup.getResponsibilityCode().equals(computeProjectCost.getResponsibilityCode()) && shareParamGroup.getShareParamCode().equals(shareParamCostVo.getShareParamCode())).findFirst();
|
|
|
+ for (ShareParamCostVo shareParamCostVo : shareParamCostVos) {
|
|
|
+ //获取参数对应的责任中心汇总数据
|
|
|
+ String shareParamKey = String.format("%s-%s-%s",computeProjectCost.getItemType(),shareParamCostVo.getShareParamCode(),computeProjectCost.getResponsibilityCode());
|
|
|
+ List<ComputeShareParamDetailVo> shareParamTotalValueList = computeShareParamDetailGroup.get(shareParamKey);
|
|
|
//责任中心的汇总数据为0时,按项目收入分摊
|
|
|
- if (!firstShareParamGroup.isPresent() || firstShareParamGroup.get().getComputeResult().compareTo(BigDecimal.ZERO) == NumberConstant.ZERO) {
|
|
|
+ if (CollectionUtils.isEmpty(shareParamTotalValueList)|| shareParamTotalValueList.get(NumberConstant.ZERO).getComputeResult().compareTo(BigDecimal.ZERO) == NumberConstant.ZERO) {
|
|
|
//获取项目对应的收入数据
|
|
|
- Optional<ComputeShareParamDetailVo> firstComputeShareParamDetail = computeShareParamDetails.stream().filter(computeShareParamDetailVo ->
|
|
|
- computeShareParamDetailVo.getShareParamCode().equals(incomeShareParam.getShareParamCode())).findFirst();
|
|
|
- if (!firstComputeShareParamDetail.isPresent()) {
|
|
|
+ List<ComputeShareParamDetailVo> computeShareParamDetailList = computeShareParamDetails.get(incomeShareParam.getShareParamCode());
|
|
|
+ if (CollectionUtils.isEmpty(computeShareParamDetailList)) {
|
|
|
throw new CostException(String.format("[%s-%s]没有收入数据无法分摊,请检查对应的收费项目数据及分摊参数计算结果数据", computeProjectCost.getResponsibilityName(), computeProjectCost.getName()));
|
|
|
}
|
|
|
- //找到项目收入的责任中心汇总数据
|
|
|
- ComputeShareParamDetailVo incomeShareParamGroup = computeShareParamDetailGroup.stream().filter(shareParamGroup -> shareParamGroup.getItemType().equals(computeProjectCost.getItemType()) &&
|
|
|
- shareParamGroup.getResponsibilityCode().equals(computeProjectCost.getResponsibilityCode()) && shareParamGroup.getShareParamCode().equals(incomeShareParam.getShareParamCode())).findFirst().get();
|
|
|
- //分摊金额=损益项目金额*分摊参数占比*收入/责任中心总收入
|
|
|
- BigDecimal paramAllocationAmount = costDepartmentProfit.getAmount().multiply(shareParamCostVo.getPercent()).multiply(firstComputeShareParamDetail.get().getComputeResult())
|
|
|
- .divide(incomeShareParamGroup.getComputeResult(), NumberConstant.FOUR, RoundingMode.HALF_UP);
|
|
|
- itemAllocationAmount = itemAllocationAmount.add(paramAllocationAmount);
|
|
|
+ String incomeShareParamKey = String.format("%s-%s-%s",computeProjectCost.getItemType(),incomeShareParam.getShareParamCode(),computeProjectCost.getResponsibilityCode());
|
|
|
+ //有对应的收入数据
|
|
|
+ if(computeShareParamDetailGroup.containsKey(incomeShareParamKey)){
|
|
|
+ //找到项目收入的责任中心汇总数据
|
|
|
+ List<ComputeShareParamDetailVo> incomeShareParamGroup = computeShareParamDetailGroup.get(incomeShareParamKey);
|
|
|
+ //分摊金额=损益项目金额*分摊参数占比*收入/责任中心总收入
|
|
|
+ BigDecimal paramAllocationAmount = costDepartmentProfit.getAmount().multiply(shareParamCostVo.getPercent()).multiply(computeShareParamDetailList.get(NumberConstant.ZERO).getComputeResult())
|
|
|
+ .divide(incomeShareParamGroup.get(NumberConstant.ZERO).getComputeResult(), NumberConstant.FOUR, RoundingMode.HALF_UP);
|
|
|
+ itemAllocationAmount = itemAllocationAmount.add(paramAllocationAmount);
|
|
|
+ //计算项目对应的会计科目金额
|
|
|
+ calcProjectAccountAmount( computeProjectCost, costDepartmentProfit, shareParamCostVo, computeShareParamDetailList.get(NumberConstant.ZERO),incomeShareParamGroup.get(NumberConstant.ZERO), deptPriftAccountMap,NumberConstant.ONE ) ;
|
|
|
+ }
|
|
|
} else {
|
|
|
+
|
|
|
//获取项目对应的分摊参数数据
|
|
|
- Optional<ComputeShareParamDetailVo> firstComputeShareParamDetail = computeShareParamDetails.stream().filter(computeShareParamDetailVo ->
|
|
|
- computeShareParamDetailVo.getShareParamCode().equals(shareParamCostVo.getShareParamCode())).findFirst();
|
|
|
- if (!firstComputeShareParamDetail.isPresent()) {
|
|
|
+ List<ComputeShareParamDetailVo> computeShareParamDetailList = computeShareParamDetails.get(shareParamCostVo.getShareParamCode());
|
|
|
+ if (CollectionUtils.isEmpty(computeShareParamDetailList)) {
|
|
|
throw new CostException(String.format("[%s-%s]没有收入数据无法分摊,请检查对应的收费项目数据", computeProjectCost.getResponsibilityName(), computeProjectCost.getName()));
|
|
|
}
|
|
|
//分摊金额=损益项目金额*分摊参数占比*分摊参数数值/责任中心总分摊参数数值
|
|
|
- BigDecimal paramAllocationAmount = costDepartmentProfit.getAmount().multiply(shareParamCostVo.getPercent()).multiply(firstComputeShareParamDetail.get().getComputeResult())
|
|
|
- .divide(firstShareParamGroup.get().getComputeResult(), NumberConstant.FOUR, RoundingMode.HALF_UP);
|
|
|
+ BigDecimal paramAllocationAmount = costDepartmentProfit.getAmount().multiply(shareParamCostVo.getPercent()).multiply(computeShareParamDetailList.get(NumberConstant.ZERO).getComputeResult())
|
|
|
+ .divide(shareParamTotalValueList.get(NumberConstant.ZERO).getComputeResult(), NumberConstant.FOUR, RoundingMode.HALF_UP);
|
|
|
itemAllocationAmount = itemAllocationAmount.add(paramAllocationAmount);
|
|
|
+ //计算项目对应的会计科目金额
|
|
|
+ calcProjectAccountAmount( computeProjectCost, costDepartmentProfit, shareParamCostVo, computeShareParamDetailList.get(NumberConstant.ZERO), shareParamTotalValueList.get(NumberConstant.ZERO), deptPriftAccountMap,NumberConstant.ONE );
|
|
|
}
|
|
|
}
|
|
|
return itemAllocationAmount;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 计算项目对应的会计科目金额
|
|
|
+ * @param computeProjectCost
|
|
|
+ * @param costDepartmentProfit
|
|
|
+ * @param shareParamCostVo
|
|
|
+ * @param shareParamValueVo
|
|
|
+ * @param shareParamTotalValueVo
|
|
|
+ * @param deptPriftAccountMap
|
|
|
+ * @param calcType 1:计算项目金额 2:计算项目标准金额
|
|
|
+ */
|
|
|
+ public void calcProjectAccountAmount(ComputeProjectCost computeProjectCost,
|
|
|
+ CostDepartmentProfit costDepartmentProfit,
|
|
|
+ ShareParamCostVo shareParamCostVo,
|
|
|
+ ComputeShareParamDetailVo shareParamValueVo,
|
|
|
+ ComputeShareParamDetailVo shareParamTotalValueVo,
|
|
|
+ Map<Long,List<CostDepartmentProfitAccount>> deptPriftAccountMap,
|
|
|
+ Integer calcType){
|
|
|
+ List<CostDepartmentProfitAccount> costDepartmentProfitAccounts = deptPriftAccountMap.get(costDepartmentProfit.getId());
|
|
|
+ if(CollectionUtils.isEmpty(costDepartmentProfitAccounts)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //排除掉无效数据
|
|
|
+ if(StringUtils.isEmpty(computeProjectCost.getStandItemCode())){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (CostDepartmentProfitAccount costDepartmentProfitAccount : costDepartmentProfitAccounts) {
|
|
|
+ ComputeProjectCostAccount computeProjectCostAccount = new ComputeProjectCostAccount();
|
|
|
+ computeProjectCostAccount.setProjectCostId(computeProjectCost.getId())
|
|
|
+ .setStandItemCode(computeProjectCost.getStandItemCode())
|
|
|
+ .setAccountType(costDepartmentProfitAccount.getAccountType())
|
|
|
+ .setCostType(costDepartmentProfitAccount.getCostType())
|
|
|
+ .setHospId(costDepartmentProfit.getHospId())
|
|
|
+ .setComputeDate(computeProjectCost.getComputeDate())
|
|
|
+ .setCreateUser(computeProjectCost.getCreateUser())
|
|
|
+ .setCreateTime(new Date())
|
|
|
+ .setUpdateUser(computeProjectCost.getUpdateUser())
|
|
|
+ .setUpdateTime(new Date())
|
|
|
+ .setDelFlag(NumberConstant.ZERO);
|
|
|
+
|
|
|
+ BigDecimal paramAllocationAmount = BigDecimal.ZERO;
|
|
|
+ if(BigDecimal.ZERO.compareTo(shareParamTotalValueVo.getComputeResult())!=NumberConstant.ZERO){
|
|
|
+ paramAllocationAmount = costDepartmentProfitAccount.getAmount().multiply(shareParamCostVo.getPercent()).multiply(shareParamValueVo.getComputeResult())
|
|
|
+ .divide(shareParamTotalValueVo.getComputeResult(), NumberConstant.FOUR, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+ computeProjectCostAccount.setComputeResult(paramAllocationAmount);
|
|
|
+ String accountKey=String.format("%s-%s",computeProjectCostAccount.getCostType(),computeProjectCostAccount.getAccountType());
|
|
|
+ //判断当前科目是否已经存在
|
|
|
+ if(computeProjectCost.getProjectCostAccountMap().containsKey(accountKey)){
|
|
|
+ ComputeProjectCostAccount itemAccount = computeProjectCost.getProjectCostAccountMap().get(accountKey);
|
|
|
+ if(NumberConstant.ONE.equals(calcType)){
|
|
|
+ itemAccount.setComputeResult(itemAccount.getComputeResult().add(computeProjectCostAccount.getComputeResult()));
|
|
|
+ }else {
|
|
|
+ itemAccount.setStandComputeResult(itemAccount.getStandComputeResult().add(computeProjectCostAccount.getComputeResult()));
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ computeProjectCost.getProjectCostAccountMap().put(accountKey,computeProjectCostAccount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 计算项目标准法的分摊金额
|
|
|
* @param computeProjectCost 主表对象
|
|
|
@@ -714,40 +864,50 @@ public class ProjectCostServiceImpl implements ProjectCostService {
|
|
|
* @param computeShareParamDetails 分摊参数计算明细
|
|
|
* @return
|
|
|
*/
|
|
|
- public BigDecimal calcItemStandAllocationAmount(ShareParamTypeMap incomeShareParam,ComputeProjectCost computeProjectCost,CostDepartmentProfit costDepartmentProfit,List<ShareParamCostVo> shareParamCostVos,
|
|
|
- List<ComputeShareParamDetailVo> computeShareParamDetailGroup,List<ComputeShareParamDetailVo> computeShareParamDetails){
|
|
|
+ public BigDecimal calcItemStandAllocationAmount(ShareParamTypeMap incomeShareParam,
|
|
|
+ ComputeProjectCost computeProjectCost,
|
|
|
+ CostDepartmentProfit costDepartmentProfit,
|
|
|
+ List<ShareParamCostVo> shareParamCostVos,
|
|
|
+ Map<String, List<ComputeShareParamDetailVo>> computeShareParamDetailGroup,
|
|
|
+ Map<String, List<ComputeShareParamDetailVo>> computeShareParamDetails,
|
|
|
+ Map<Long, List<CostDepartmentProfitAccount>> deptPriftAccountMap){
|
|
|
BigDecimal itemAllocationAmount=BigDecimal.ZERO;
|
|
|
//按配置计算每个参数分摊金额
|
|
|
for (ShareParamCostVo shareParamCostVo : shareParamCostVos) {
|
|
|
//获取参数对应的责任中心汇总数据
|
|
|
- Optional<ComputeShareParamDetailVo> firstShareParamGroup = computeShareParamDetailGroup.stream().filter(shareParamGroup -> shareParamGroup.getItemType().equals(computeProjectCost.getItemType()) &&
|
|
|
- shareParamGroup.getResponsibilityCode().equals(computeProjectCost.getResponsibilityCode()) && shareParamGroup.getShareParamCode().equals(shareParamCostVo.getShareParamCode())).findFirst();
|
|
|
+ String shareParamKey = String.format("%s-%s-%s",computeProjectCost.getItemType(),shareParamCostVo.getShareParamCode(),computeProjectCost.getResponsibilityCode());
|
|
|
+ List<ComputeShareParamDetailVo> shareParamTotalValueList = computeShareParamDetailGroup.get(shareParamKey);
|
|
|
//责任中心的汇总数据为0时,按项目收入分摊
|
|
|
- if (!firstShareParamGroup.isPresent() || firstShareParamGroup.get().getStandComputeResult().compareTo(BigDecimal.ZERO) == NumberConstant.ZERO) {
|
|
|
+ if (CollectionUtils.isEmpty(shareParamTotalValueList)|| shareParamTotalValueList.get(NumberConstant.ZERO).getStandComputeResult().compareTo(BigDecimal.ZERO) == NumberConstant.ZERO) {
|
|
|
//获取项目对应的收入数据
|
|
|
- Optional<ComputeShareParamDetailVo> firstComputeShareParamDetail = computeShareParamDetails.stream().filter(computeShareParamDetailVo ->
|
|
|
- computeShareParamDetailVo.getShareParamCode().equals(incomeShareParam.getShareParamCode())).findFirst();
|
|
|
- if (!firstComputeShareParamDetail.isPresent()) {
|
|
|
+ List<ComputeShareParamDetailVo> computeShareParamDetailList = computeShareParamDetails.get(incomeShareParam.getShareParamCode());
|
|
|
+ if (CollectionUtils.isEmpty(computeShareParamDetailList)) {
|
|
|
throw new CostException(String.format("[%s-%s]没有收入数据无法分摊,请检查对应的收费项目数据及分摊参数计算结果数据", computeProjectCost.getResponsibilityName(), computeProjectCost.getName()));
|
|
|
}
|
|
|
- //找到项目收入的责任中心汇总数据
|
|
|
- ComputeShareParamDetailVo incomeShareParamGroup = computeShareParamDetailGroup.stream().filter(shareParamGroup -> shareParamGroup.getItemType().equals(computeProjectCost.getItemType()) &&
|
|
|
- shareParamGroup.getResponsibilityCode().equals(computeProjectCost.getResponsibilityCode()) && shareParamGroup.getShareParamCode().equals(incomeShareParam.getShareParamCode())).findFirst().get();
|
|
|
- //分摊金额=损益项目金额*分摊参数占比*收入/责任中心总收入
|
|
|
- BigDecimal paramAllocationAmount = costDepartmentProfit.getAmount().multiply(shareParamCostVo.getPercent()).multiply(firstComputeShareParamDetail.get().getStandComputeResult())
|
|
|
- .divide(incomeShareParamGroup.getStandComputeResult(), NumberConstant.FOUR, RoundingMode.HALF_UP);
|
|
|
- itemAllocationAmount = itemAllocationAmount.add(paramAllocationAmount);
|
|
|
+ String incomeShareParamKey = String.format("%s-%s-%s",computeProjectCost.getItemType(),incomeShareParam.getShareParamCode(),computeProjectCost.getResponsibilityCode());
|
|
|
+ //有对应的收入数据
|
|
|
+ if(computeShareParamDetailGroup.containsKey(incomeShareParamKey)){
|
|
|
+ //找到项目收入的责任中心汇总数据
|
|
|
+ List<ComputeShareParamDetailVo> incomeShareParamGroup = computeShareParamDetailGroup.get(incomeShareParamKey);
|
|
|
+ //分摊金额=损益项目金额*分摊参数占比*收入/责任中心总收入
|
|
|
+ BigDecimal paramAllocationAmount = costDepartmentProfit.getAmount().multiply(shareParamCostVo.getPercent()).multiply(computeShareParamDetailList.get(NumberConstant.ZERO).getStandComputeResult())
|
|
|
+ .divide(incomeShareParamGroup.get(NumberConstant.ZERO).getStandComputeResult(), NumberConstant.FOUR, RoundingMode.HALF_UP);
|
|
|
+ itemAllocationAmount = itemAllocationAmount.add(paramAllocationAmount);
|
|
|
+ //计算项目对应的会计科目金额
|
|
|
+ calcProjectAccountAmount( computeProjectCost, costDepartmentProfit, shareParamCostVo, computeShareParamDetailList.get(NumberConstant.ZERO),incomeShareParamGroup.get(NumberConstant.ZERO), deptPriftAccountMap,NumberConstant.ONE ) ;
|
|
|
+ }
|
|
|
} else {
|
|
|
//获取项目对应的分摊参数数据
|
|
|
- Optional<ComputeShareParamDetailVo> firstComputeShareParamDetail = computeShareParamDetails.stream().filter(computeShareParamDetailVo ->
|
|
|
- computeShareParamDetailVo.getShareParamCode().equals(shareParamCostVo.getShareParamCode())).findFirst();
|
|
|
- if (!firstComputeShareParamDetail.isPresent()) {
|
|
|
+ List<ComputeShareParamDetailVo> computeShareParamDetailList = computeShareParamDetails.get(shareParamCostVo.getShareParamCode());
|
|
|
+ if (CollectionUtils.isEmpty(computeShareParamDetailList)) {
|
|
|
throw new CostException(String.format("[%s-%s]没有收入数据无法分摊,请检查对应的收费项目数据", computeProjectCost.getResponsibilityName(), computeProjectCost.getName()));
|
|
|
}
|
|
|
//分摊金额=损益项目金额*分摊参数占比*分摊参数数值/责任中心总分摊参数数值
|
|
|
- BigDecimal paramAllocationAmount = costDepartmentProfit.getAmount().multiply(shareParamCostVo.getPercent()).multiply(firstComputeShareParamDetail.get().getStandComputeResult())
|
|
|
- .divide(firstShareParamGroup.get().getStandComputeResult(), NumberConstant.FOUR, RoundingMode.HALF_UP);
|
|
|
+ BigDecimal paramAllocationAmount = costDepartmentProfit.getAmount().multiply(shareParamCostVo.getPercent()).multiply(computeShareParamDetailList.get(NumberConstant.ZERO).getStandComputeResult())
|
|
|
+ .divide(shareParamTotalValueList.get(NumberConstant.ZERO).getStandComputeResult(), NumberConstant.FOUR, RoundingMode.HALF_UP);
|
|
|
itemAllocationAmount = itemAllocationAmount.add(paramAllocationAmount);
|
|
|
+ //计算项目对应的会计科目金额
|
|
|
+ calcProjectAccountAmount( computeProjectCost, costDepartmentProfit, shareParamCostVo, computeShareParamDetailList.get(NumberConstant.ZERO), shareParamTotalValueList.get(NumberConstant.ZERO), deptPriftAccountMap,NumberConstant.ONE );
|
|
|
}
|
|
|
}
|
|
|
return itemAllocationAmount;
|