|
@@ -1,132 +0,0 @@
|
|
-package com.imed.costaccount.model;
|
|
|
|
-
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
-import com.imed.costaccount.common.exception.CostException;
|
|
|
|
-import com.imed.costaccount.service.*;
|
|
|
|
-import io.swagger.annotations.ApiModel;
|
|
|
|
-import lombok.Data;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
|
-
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * @author 李加喜
|
|
|
|
- * @Package com.imed.costaccount.model
|
|
|
|
- * @date 2021-08-10 17:15
|
|
|
|
- */
|
|
|
|
-@Data
|
|
|
|
-@ApiModel("获取数据")
|
|
|
|
-public class GetCheckData {
|
|
|
|
- @Autowired
|
|
|
|
- private DepartmentService departmentService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private ResponsibilityService responsibilityService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private ProductService productService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private AccountingService accountingService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private ResponsibilityDepartmentService responsibilityDepartmentService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private CostIncomeGroupSetService costIncomeGroupSetService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private AccountingProductService accountingProductService;
|
|
|
|
- private Long hospId;
|
|
|
|
- private Map<String, Department> departmentMap;
|
|
|
|
- private Map<String, Product> productMap;
|
|
|
|
- private Map<Long, Responsibility> responsibilityMap;
|
|
|
|
- private Map<Long, Accounting> accountingMap;
|
|
|
|
- private Map<Long, Long> responsibilityDepMap;
|
|
|
|
- private Map<Long, Long> accountProMap;
|
|
|
|
- private Map<Integer, CostIncomeGroupSet> incomeGroupSetMap;
|
|
|
|
-
|
|
|
|
- public GetCheckData(Long hospId) {
|
|
|
|
- this.hospId = hospId;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 根据科室Code+Name获取指定科室
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public Map<String, Department> getDepartmentMap() {
|
|
|
|
- return departmentMap;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 根据Product的Code+name 获取product
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public Map<String, Product> getProductMap() {
|
|
|
|
- return productMap;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 根据id获取责任中心
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public Map<Long, Responsibility> getResponsibilityMap() {
|
|
|
|
- return responsibilityMap;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 根据id后去会计科目
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public Map<Long, Accounting> getAccountingMap() {
|
|
|
|
- return accountingMap;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 根据科室的id获取责任中心的Id
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public Map<Long, Long> getResponsibilityDepMap() {
|
|
|
|
- return responsibilityDepMap;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 根据成本项目id获取会计科目Id
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public Map<Long, Long> getAccountProMap() {
|
|
|
|
- return accountProMap;
|
|
|
|
- }
|
|
|
|
- public Map<Integer, CostIncomeGroupSet> getIncomeGroupSetMap() {
|
|
|
|
- return incomeGroupSetMap;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 根据开单科室状态科执行科室状态返回设置数据
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- public GetCheckData invoke() {
|
|
|
|
- departmentMap = departmentService.list(new QueryWrapper<Department>().lambda().eq(Department::getHospId, hospId)).stream().collect(Collectors.toMap(k -> k.getDepartmentCode() + k.getDepartmentName(), synOe -> synOe));
|
|
|
|
- productMap = productService.list(new QueryWrapper<Product>().lambda().eq(Product::getHospId, hospId)).stream().collect(Collectors.toMap(k -> k.getProductCode() + k.getProductName(), synOe -> synOe));
|
|
|
|
- responsibilityMap = responsibilityService.list(new QueryWrapper<Responsibility>().lambda().eq(Responsibility::getHospId, hospId)).stream().collect(Collectors.toMap(Responsibility::getId, synOe -> synOe));
|
|
|
|
- accountingMap = accountingService.list(new QueryWrapper<Accounting>().lambda().eq(Accounting::getHospId, hospId)).stream().collect(Collectors.toMap(Accounting::getId, synOe -> synOe));
|
|
|
|
- incomeGroupSetMap = costIncomeGroupSetService.list(new QueryWrapper<CostIncomeGroupSet>().lambda().eq(CostIncomeGroupSet::getHospId, hospId)).stream().collect(Collectors.toMap(k -> k.getOpenDepartmentStatus() + k.getStartDepartmentStatus(), synOe -> synOe));
|
|
|
|
- List<ResponsibilityDepartment> responsibilityDepartmentList = responsibilityDepartmentService.list(new QueryWrapper<ResponsibilityDepartment>().lambda()
|
|
|
|
- .eq(ResponsibilityDepartment::getHospId, hospId));
|
|
|
|
- if (CollectionUtils.isEmpty(responsibilityDepartmentList)) {
|
|
|
|
- throw new CostException(500, "没有科室责任中心对照数据");
|
|
|
|
- }
|
|
|
|
- List<AccountingProduct> accountingProductList = accountingProductService.list(new QueryWrapper<AccountingProduct>().lambda().eq(AccountingProduct::getHospId, hospId));
|
|
|
|
- if (CollectionUtils.isEmpty(accountingProductList)) {
|
|
|
|
- throw new CostException(500, "没有成本会计对照数据");
|
|
|
|
- }
|
|
|
|
- responsibilityDepMap = responsibilityDepartmentList.stream().collect(Collectors.toMap(ResponsibilityDepartment::getDepartmentId, ResponsibilityDepartment::getResponsibilityId));
|
|
|
|
- accountProMap = accountingProductList.stream().collect(Collectors.toMap(AccountingProduct::getProductId, AccountingProduct::getAccountingId));
|
|
|
|
-
|
|
|
|
- return this;
|
|
|
|
- }
|
|
|
|
-}
|
|
|