|
@@ -12,6 +12,7 @@ import com.imed.costaccount.common.util.*;
|
|
|
import com.imed.costaccount.constants.NumberConstant;
|
|
|
import com.imed.costaccount.common.enums.DateStyleEnum;
|
|
|
import com.imed.costaccount.mapper.AllocationMapper;
|
|
|
+import com.imed.costaccount.mapper.AllocationQueryMapper;
|
|
|
import com.imed.costaccount.mapper.CostCostingGroupMapper;
|
|
|
import com.imed.costaccount.model.*;
|
|
|
import com.imed.costaccount.model.vo.*;
|
|
@@ -42,19 +43,21 @@ public class CostCostingGroupServiceImpl extends ServiceImpl<CostCostingGroupMap
|
|
|
private final ResponsibilityService responsibilityService;
|
|
|
|
|
|
private final AllocationMapper allocationMapper;
|
|
|
+ private final AllocationQueryMapper allocationQueryMapper;
|
|
|
|
|
|
|
|
|
public CostCostingGroupServiceImpl(CostIncomeGroupServiceImpl costIncomeGroupService,
|
|
|
AccountingService accountingService,
|
|
|
AccountingProductService accountingProductService,
|
|
|
CostIncomeFileService costIncomeFileService,
|
|
|
- ResponsibilityService responsibilityService, AllocationMapper allocationMapper) {
|
|
|
+ ResponsibilityService responsibilityService, AllocationMapper allocationMapper, AllocationQueryMapper allocationQueryMapper) {
|
|
|
this.costIncomeGroupService = costIncomeGroupService;
|
|
|
this.accountingService = accountingService;
|
|
|
this.accountingProductService = accountingProductService;
|
|
|
this.costIncomeFileService = costIncomeFileService;
|
|
|
this.responsibilityService = responsibilityService;
|
|
|
this.allocationMapper = allocationMapper;
|
|
|
+ this.allocationQueryMapper = allocationQueryMapper;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -450,4 +453,29 @@ public class CostCostingGroupServiceImpl extends ServiceImpl<CostCostingGroupMap
|
|
|
.eq(CostCostingGroup::getHospId, hospId)
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 撤销分摊
|
|
|
+ *
|
|
|
+ * @param year
|
|
|
+ * @param month
|
|
|
+ * @param hospId
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
|
|
+ public void cancelAllocation(Integer year, Integer month, Long hospId) {
|
|
|
+ allocationMapper.delete(
|
|
|
+ new LambdaQueryWrapper<Allocation>()
|
|
|
+ .eq(Allocation::getDateYear, year)
|
|
|
+ .eq(Allocation::getDateMonth, month)
|
|
|
+ .eq(Allocation::getHospId, hospId)
|
|
|
+ );
|
|
|
+
|
|
|
+ allocationQueryMapper.delete(
|
|
|
+ new LambdaQueryWrapper<AllocationQuery>()
|
|
|
+ .eq(AllocationQuery::getDateYear, year)
|
|
|
+ .eq(AllocationQuery::getDateMonth, month)
|
|
|
+ .eq(AllocationQuery::getHospId, hospId)
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|