|
@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.kcim.common.constants.NumberConstant;
|
|
import com.kcim.common.constants.NumberConstant;
|
|
|
|
+import com.kcim.common.constants.SQLParameter;
|
|
|
|
+import com.kcim.common.enums.CustomSqlTypeEnum;
|
|
import com.kcim.common.exception.CostException;
|
|
import com.kcim.common.exception.CostException;
|
|
import com.kcim.common.util.BeanUtil;
|
|
import com.kcim.common.util.BeanUtil;
|
|
import com.kcim.common.util.JacksonUtil;
|
|
import com.kcim.common.util.JacksonUtil;
|
|
@@ -51,20 +53,19 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
private final ResponsibilityRepository responsibilityRepository;
|
|
private final ResponsibilityRepository responsibilityRepository;
|
|
private final CenterService centerService;
|
|
private final CenterService centerService;
|
|
|
|
|
|
- public AllocationServiceImpl(CostCostingGroupService costCostingGroupService,
|
|
|
|
- CostShareLevelService shareLevelService,
|
|
|
|
- ResponsibilityService responsibilityService,
|
|
|
|
- CostAccountShareService accountShareService,
|
|
|
|
- ShareParamValueService shareParamValueService, CostShareParamService shareParamService, AllocationQueryService allocationQueryService, AllocationQueryService allocationQueryService1, ResponsibilityRepository responsibilityRepository, CenterService centerService) {
|
|
|
|
|
|
+ private final SqlService sqlService;
|
|
|
|
+
|
|
|
|
+ public AllocationServiceImpl(CostCostingGroupService costCostingGroupService, CostShareLevelService shareLevelService, ResponsibilityService responsibilityService, CostAccountShareService accountShareService, ShareParamValueService shareParamValueService, CostShareParamService shareParamService, AllocationQueryService allocationQueryService, ResponsibilityRepository responsibilityRepository, CenterService centerService, SqlService sqlService) {
|
|
this.costCostingGroupService = costCostingGroupService;
|
|
this.costCostingGroupService = costCostingGroupService;
|
|
this.shareLevelService = shareLevelService;
|
|
this.shareLevelService = shareLevelService;
|
|
this.responsibilityService = responsibilityService;
|
|
this.responsibilityService = responsibilityService;
|
|
this.accountShareService = accountShareService;
|
|
this.accountShareService = accountShareService;
|
|
this.shareParamValueService = shareParamValueService;
|
|
this.shareParamValueService = shareParamValueService;
|
|
this.shareParamService = shareParamService;
|
|
this.shareParamService = shareParamService;
|
|
- this.allocationQueryService = allocationQueryService1;
|
|
|
|
|
|
+ this.allocationQueryService = allocationQueryService;
|
|
this.responsibilityRepository = responsibilityRepository;
|
|
this.responsibilityRepository = responsibilityRepository;
|
|
this.centerService = centerService;
|
|
this.centerService = centerService;
|
|
|
|
+ this.sqlService = sqlService;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -242,6 +243,16 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
|
|
|
|
// 入cost_allocation_query 表 便于后续操作
|
|
// 入cost_allocation_query 表 便于后续操作
|
|
this.saveAllocationQuery(list, hospId, startDTO.getYear(), startDTO.getMonth(),shareLevelVOs,accountShareList);
|
|
this.saveAllocationQuery(list, hospId, startDTO.getYear(), startDTO.getMonth(),shareLevelVOs,accountShareList);
|
|
|
|
+
|
|
|
|
+ Map<String,String> sqlParameter = new HashMap<>();
|
|
|
|
+ if(startDTO.getMonth()<10){
|
|
|
|
+ sqlParameter.put(SQLParameter.COMPUTE_DATE_CODE,startDTO.getYear()+"-0"+startDTO.getMonth());
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ sqlParameter.put(SQLParameter.COMPUTE_DATE_CODE,startDTO.getYear()+"-"+startDTO.getMonth());
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ sqlService.autoExecuteSql(CustomSqlTypeEnum.COST_ALLOCATION_CALC.getCode(),sqlParameter);
|
|
}
|
|
}
|
|
|
|
|
|
private void removeData(StartDTO startDTO, Long hospId) {
|
|
private void removeData(StartDTO startDTO, Long hospId) {
|