2
0
Просмотр исходного кода

Merge branch 'master' of huangrui/CostAccount into dev

lijiaxi 4 лет назад
Родитель
Сommit
08c3b17416

+ 16 - 0
src/main/java/com/imed/costaccount/mapper/DepartmentProfitFileMapper.java

@@ -0,0 +1,16 @@
+package com.imed.costaccount.mapper;
+
+import com.imed.costaccount.model.DepartmentProfitFile;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 科室经营报表
+ * 
+ * @author huangrui
+ * @date 2021-08-30 13:40:57
+ */
+@Mapper
+public interface DepartmentProfitFileMapper extends BaseMapper<DepartmentProfitFile> {
+	
+}

+ 63 - 0
src/main/java/com/imed/costaccount/model/DepartmentProfitFile.java

@@ -0,0 +1,63 @@
+package com.imed.costaccount.model;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * 科室经营报表
+ * 
+ * @author huangrui
+ * @email 
+ * @date 2021-08-30 13:40:57
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("cost_department_profit_file")
+public class DepartmentProfitFile implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@TableId
+	private Long id;
+	/**
+	 * 年份
+	 */
+	private Integer year;
+	/**
+	 * 月份
+	 */
+	private Integer month;
+	/**
+	 * 报表类型:0.损益表、1.完全成本法表、2.变动成本表、3.全院损益表、4.全成本报表
+	 */
+	private Integer reportType;
+	/**
+	 * 报表名称 .xls
+	 */
+	private String reportName;
+	/**
+	 * 医院id
+	 */
+	private Long hospId;
+	/**
+	 * 创建时间
+	 */
+	private Long createTime;
+	/**
+	 * 删除时间
+	 */
+	@TableLogic(value = "0",delval = "UNIX_TIMESTAMP(NOW()) * 1000")
+	private Long deleteTime;
+
+}

+ 42 - 0
src/main/java/com/imed/costaccount/model/vo/DepartmentProfitFileVO.java

@@ -0,0 +1,42 @@
+package com.imed.costaccount.model.vo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+ * @author 李加喜
+ * @Package com.imed.costaccount.model.vo
+ * @date 2021-08-30 14:11
+ */
+@Data
+@ApiModel("全员其他收支设置分页返回实体类")
+public class DepartmentProfitFileVO {
+    /**
+     * 主键
+     */
+    private Long id;
+    /**
+     * 年份
+     */
+    private Integer year;
+    /**
+     * 月份
+     */
+    private Integer month;
+    /**
+     * 报表类型:0.损益表、1.完全成本法表、2.变动成本表、3.全院损益表、4.全成本报表
+     */
+    private Integer reportType;
+    /**
+     * 报表名称 .xls
+     */
+    private String reportName;
+    /**
+     * 创建时间
+     */
+    private Long createTime;
+    /**
+     * 更新时间
+     */
+    private String  updateTime;
+}

+ 1 - 3
src/main/java/com/imed/costaccount/service/CostCostingCollectionService.java

@@ -1,9 +1,7 @@
 package com.imed.costaccount.service;
 
-import cn.hutool.poi.excel.ExcelWriter;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.imed.costaccount.model.CostCostingCollection;
-import org.apache.poi.ss.usermodel.Sheet;
 
 /**
  * 成本数据归集后列表
@@ -20,6 +18,6 @@ public interface CostCostingCollectionService extends IService<CostCostingCollec
      * @param sheet
      * @return
      */
-    ExcelWriter getShareReportTemplate(ExcelWriter writer, Integer shareNumber, Sheet sheet);
+//    ExcelWriter getShareReportTemplate(ExcelWriter writer, Integer shareNumber, Sheet sheet);
 }
 

+ 26 - 0
src/main/java/com/imed/costaccount/service/DepartmentProfitFileService.java

@@ -0,0 +1,26 @@
+package com.imed.costaccount.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.imed.costaccount.common.util.PageUtils;
+import com.imed.costaccount.model.DepartmentProfitFile;
+
+/**
+ * 科室经营报表
+ *
+ * @author huangrui
+ * @email 
+ * @date 2021-08-30 13:40:57
+ */
+public interface DepartmentProfitFileService extends IService<DepartmentProfitFile> {
+    /**
+     * 分页查询进行报表记录
+     * @param current 当前页
+     * @param pageSize 每一页大小
+     * @param date 时间xxx-xx-xx
+     * @param reportName 报表名称
+     * @param hospId 医院Id
+     * @return
+     */
+    PageUtils queryList(Integer current, Integer pageSize, String date, String reportName, Long hospId);
+}
+

+ 489 - 498
src/main/java/com/imed/costaccount/service/impl/CostCostingCollectionServiceImpl.java

@@ -1,22 +1,13 @@
 package com.imed.costaccount.service.impl;
 
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.poi.excel.ExcelWriter;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.imed.costaccount.common.exception.CostException;
-import com.imed.costaccount.constants.NumberConstant;
 import com.imed.costaccount.mapper.CostCostingCollectionMapper;
 import com.imed.costaccount.model.CostCostingCollection;
-import com.imed.costaccount.model.vo.*;
 import com.imed.costaccount.service.CostCostingCollectionService;
 import com.imed.costaccount.service.CostShareLevelService;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.poi.ss.usermodel.Sheet;
 import org.springframework.stereotype.Service;
 
-import java.util.*;
-import java.util.stream.Collectors;
-
 @Slf4j
 @Service("costCostingCollectionService")
 public class CostCostingCollectionServiceImpl extends ServiceImpl<CostCostingCollectionMapper, CostCostingCollection> implements CostCostingCollectionService {
@@ -27,514 +18,514 @@ public class CostCostingCollectionServiceImpl extends ServiceImpl<CostCostingCol
         this.costShareLevelService = costShareLevelService;
     }
 
-    /**
-     * 分摊后报表输出
-     *
-     * @param writer
-     * @param shareNumber
-     * @param sheet
-     * @return
-     */
-    @Override
-    public ExcelWriter getShareReportTemplate(ExcelWriter writer, Integer shareNumber, Sheet sheet) {
-        // 需要封装两个  分摊层级责任中心集合  目标层级责任中心
-        // 分摊层级责任中心集合
-//        LinkedList<SplitLevelVO> splitLevelVOLinkedList = new LinkedList<>();
-//        // 目标层级责任中心集合
-//        LinkedList<TargetSplitLevelVO> targetSplitLevelVOLinkedList = new LinkedList<>();
-//        setMockData(splitLevelVOLinkedList, targetSplitLevelVOLinkedList);
-        List<CostCostingVO> costCostingVOS = setMockDa();
-        Map<String, List<CostCostingVO>> responsibilityMap = costCostingVOS.stream().collect(Collectors.groupingBy(CostCostingVO::getResponsibilityCode));
-//        Map<String, String> collect = costCostingVOS.stream().collect(Collectors.toMap(CostCostingVO::getResponsibilityCode, CostCostingVO::getAccountCode));
-        Map<String, List<CostCostingVO>> targetResponsibilityMap = costCostingVOS.stream().collect(Collectors.groupingBy(CostCostingVO::getTargetResponsibilityCode));
-        Map<String, CostCostingVO> allAccMap = costCostingVOS.stream().collect(Collectors.toMap(k -> k.getResponsibilityName()+k.getAccountName()+k.getTargetResponsibilityName()+k.getShareParamName(), synOne -> synOne));
-        Map<String, CostCostingVO> allAliMap = costCostingVOS.stream().collect(Collectors.toMap(k -> k.getResponsibilityName()+k.getAlias()+k.getTargetResponsibilityName()+k.getShareParamName(), synOne -> synOne));
-        // 当前责任中心下面有几个会计科目  后面进行合并使用
-        int numResponsibility;
-        // 从第几列开始编写数据
-        int column = shareNumber + 4;
-        // 总共有多少个单元格
-//        Integer shareLevelGrid = 0;
-        Set<String> keySet = responsibilityMap.keySet();
-        for (String key : keySet) {
-            List<CostCostingVO> costCostingVOS1 = responsibilityMap.get(key);
-            Map<String, CostCostingVO> linkedHashMap = new LinkedHashMap<>();
-            costCostingVOS1.forEach(i -> {
-                String s = i.getResponsibilityCode() + i.getAccountCode();
-                if (!linkedHashMap.containsKey(s)) {
-                    linkedHashMap.put(s, i);
-                }
-            });
-            numResponsibility = linkedHashMap.size();
-            if (numResponsibility >= NumberConstant.TWO) {
-                // 需要合并单元格
-//                writer.merge(0, 0, column, column + numResponsibility - 1, costCostingVOS1.get(0).getResponsibilityName(), false);
-                // 设置对应的会计科目或者别名
-                Set<String> strings = linkedHashMap.keySet();
-                for (String s : strings) {
-                    CostCostingVO costCostingVO = linkedHashMap.get(s);
-                    if (StrUtil.isBlank(costCostingVO.getAlias())) {
-                        writer.writeCellValue(column,0,costCostingVO.getResponsibilityName());
-                        // 别名不存在
-                        writer.writeCellValue(column, 1, costCostingVO.getAccountName());
-                    } else {
-                        // 不为空 设置别名
-                        writer.writeCellValue(column,0,costCostingVO.getResponsibilityName());
-                        writer.writeCellValue(column, 1, costCostingVO.getAlias());
-                    }
-                    writer.writeCellValue(column, 2, costCostingVO.getAmount());
-                    column++;
-                }
-//                for (int j=0;j<numResponsibility;j++){
-//                    CostCostingVO costCostingVO = costCostingVOS1.get(j);
-//                    if (StrUtil.isBlank(costCostingVO.getAlias())){
+//    /**
+//     * 分摊后报表输出
+//     * 测试数据
+//     * @param writer
+//     * @param shareNumber
+//     * @param sheet
+//     * @return
+//     */
+//    @Override
+//    public ExcelWriter getShareReportTemplate(ExcelWriter writer, Integer shareNumber, Sheet sheet) {
+//        // 需要封装两个  分摊层级责任中心集合  目标层级责任中心
+//        // 分摊层级责任中心集合
+////        LinkedList<SplitLevelVO> splitLevelVOLinkedList = new LinkedList<>();
+////        // 目标层级责任中心集合
+////        LinkedList<TargetSplitLevelVO> targetSplitLevelVOLinkedList = new LinkedList<>();
+////        setMockData(splitLevelVOLinkedList, targetSplitLevelVOLinkedList);
+//        List<CostCostingVO> costCostingVOS = setMockDa();
+//        Map<String, List<CostCostingVO>> responsibilityMap = costCostingVOS.stream().collect(Collectors.groupingBy(CostCostingVO::getResponsibilityCode));
+////        Map<String, String> collect = costCostingVOS.stream().collect(Collectors.toMap(CostCostingVO::getResponsibilityCode, CostCostingVO::getAccountCode));
+//        Map<String, List<CostCostingVO>> targetResponsibilityMap = costCostingVOS.stream().collect(Collectors.groupingBy(CostCostingVO::getTargetResponsibilityCode));
+//        Map<String, CostCostingVO> allAccMap = costCostingVOS.stream().collect(Collectors.toMap(k -> k.getResponsibilityName()+k.getAccountName()+k.getTargetResponsibilityName()+k.getShareParamName(), synOne -> synOne));
+//        Map<String, CostCostingVO> allAliMap = costCostingVOS.stream().collect(Collectors.toMap(k -> k.getResponsibilityName()+k.getAlias()+k.getTargetResponsibilityName()+k.getShareParamName(), synOne -> synOne));
+//        // 当前责任中心下面有几个会计科目  后面进行合并使用
+//        int numResponsibility;
+//        // 从第几列开始编写数据
+//        int column = shareNumber + 4;
+//        // 总共有多少个单元格
+////        Integer shareLevelGrid = 0;
+//        Set<String> keySet = responsibilityMap.keySet();
+//        for (String key : keySet) {
+//            List<CostCostingVO> costCostingVOS1 = responsibilityMap.get(key);
+//            Map<String, CostCostingVO> linkedHashMap = new LinkedHashMap<>();
+//            costCostingVOS1.forEach(i -> {
+//                String s = i.getResponsibilityCode() + i.getAccountCode();
+//                if (!linkedHashMap.containsKey(s)) {
+//                    linkedHashMap.put(s, i);
+//                }
+//            });
+//            numResponsibility = linkedHashMap.size();
+//            if (numResponsibility >= NumberConstant.TWO) {
+//                // 需要合并单元格
+////                writer.merge(0, 0, column, column + numResponsibility - 1, costCostingVOS1.get(0).getResponsibilityName(), false);
+//                // 设置对应的会计科目或者别名
+//                Set<String> strings = linkedHashMap.keySet();
+//                for (String s : strings) {
+//                    CostCostingVO costCostingVO = linkedHashMap.get(s);
+//                    if (StrUtil.isBlank(costCostingVO.getAlias())) {
+//                        writer.writeCellValue(column,0,costCostingVO.getResponsibilityName());
 //                        // 别名不存在
-//                        writer.writeCellValue(j+column,1,costCostingVO.getAccountName());
-//                    }else {
+//                        writer.writeCellValue(column, 1, costCostingVO.getAccountName());
+//                    } else {
 //                        // 不为空 设置别名
-//                        writer.writeCellValue(j+column,1,costCostingVO.getAlias());
-//                    }
-//                    writer.writeCellValue(j+column,2,costCostingVO.getAmount());
-//                }
-//                column+=numResponsibility;
-            } else {
-                // 不需要合并单元格
-                writer.writeCellValue(column, 0, costCostingVOS1.get(0).getResponsibilityName());
-                writer.writeCellValue(column, 1, costCostingVOS1.get(0).getAccountName());
-                writer.writeCellValue(column, 2, costCostingVOS1.get(0).getAmount());
-                column++;
-            }
-        }
-//        for (int i=0; i< responsibilityMap.size();i++){
-        // 判断当前当成的责任中心对应的分摊参数的数量
-//            List<CostCostingVO> costCostingVOS1 = responsibilityMap.get(responsibilityCode);
-//            numResponsibility=costCostingVOS1.size();
-//            shareLevelGrid+=numResponsibility;
-//            if (numResponsibility>= NumberConstant.TWO){
-//                writer.merge(0,0,column,column+numResponsibility-1,costCostingVOS1.get(0).getResponsibilityName(),false);
-//                // 设置对应的会计科目或者金额
-//                for (int j=0;j<numResponsibility;j++){
-//                    CostCostingVO costCostingVO = costCostingVOS1.get(j);
-//                    if (StrUtil.isBlank(costCostingVO.getAlias())){
-//                        // 别名不存在的时候
-//                        writer.writeCellValue(j+column,1,costCostingVO.getAccountName());
-//                    }else {
-//                        // 为空的话设置别名
-//                        writer.writeCellValue(j+column,1,costCostingVO.getAlias());
+//                        writer.writeCellValue(column,0,costCostingVO.getResponsibilityName());
+//                        writer.writeCellValue(column, 1, costCostingVO.getAlias());
 //                    }
-//                    writer.writeCellValue(j+column,2,costCostingVO.getAccountName());
+//                    writer.writeCellValue(column, 2, costCostingVO.getAmount());
+//                    column++;
 //                }
-//                column+=numResponsibility;
-//            }else {
-//                writer.writeCellValue(column,0,costCostingVOS1.get(0).getResponsibilityName());
-//                writer.writeCellValue(column,1,costCostingVOS1.get(0).getAccountName());
-//                writer.writeCellValue(column,2,costCostingVOS1.get(0).getMoney());
+////                for (int j=0;j<numResponsibility;j++){
+////                    CostCostingVO costCostingVO = costCostingVOS1.get(j);
+////                    if (StrUtil.isBlank(costCostingVO.getAlias())){
+////                        // 别名不存在
+////                        writer.writeCellValue(j+column,1,costCostingVO.getAccountName());
+////                    }else {
+////                        // 不为空 设置别名
+////                        writer.writeCellValue(j+column,1,costCostingVO.getAlias());
+////                    }
+////                    writer.writeCellValue(j+column,2,costCostingVO.getAmount());
+////                }
+////                column+=numResponsibility;
+//            } else {
+//                // 不需要合并单元格
+//                writer.writeCellValue(column, 0, costCostingVOS1.get(0).getResponsibilityName());
+//                writer.writeCellValue(column, 1, costCostingVOS1.get(0).getAccountName());
+//                writer.writeCellValue(column, 2, costCostingVOS1.get(0).getAmount());
 //                column++;
 //            }
 //        }
-        // 设置单元格合并
-        for (int j = 1; j <= shareNumber; j++) {
-            writer.merge(0, 1, j, j, "第" + j + "次分摊", false);
-        }
-        // 目标责任集合
-        writer.passCurrentRow();
-        // 从第三行开始
-        int num = 3;
-        Set<String> targetSet = targetResponsibilityMap.keySet();
-        for (String target : targetSet) {
-            List<CostCostingVO> costCostingVOS1 = targetResponsibilityMap.get(target);
-            Map<String, CostCostingVO> linkedHashMap = new LinkedHashMap<>();
-            costCostingVOS1.forEach(i -> {
-                String s = i.getTargetResponsibilityCode() + i.getShareParamName();
-                if (!linkedHashMap.containsKey(s)) {
-                    linkedHashMap.put(s, i);
-                }
-            });
-            int shareParamSize = linkedHashMap.size();
-            if (shareParamSize >= NumberConstant.TWO) {
-                // 责任中心
-                CostCostingVO costCostingVO = costCostingVOS1.get(0);
-//                writer.merge(num, num + shareParamSize - 1, 0, 0, costCostingVO.getTargetResponsibilityName(), false);
-                // 设置第几次分摊的值
-                for (int k = 0; k < shareNumber; k++) {
-                    writer.merge(num, num + shareParamSize - 1, k + 1, k + 1, costCostingVO.getTargetShareMoneys().get(k), false);
-                }
-                // 设置对应的分摊参数值
-                Set<String> strings = linkedHashMap.keySet();
-                for (String s : strings) {
-                    CostCostingVO costCostingVO1 = linkedHashMap.get(s);
-                    writer.writeCellValue(0,num,costCostingVO1.getTargetResponsibilityName());
-                    writer.writeCellValue(shareNumber + 1, num, costCostingVO1.getShareParamName());
-                    writer.writeCellValue(shareNumber + 2, num, costCostingVO1.getShareValue());
-                    writer.writeCellValue(shareNumber + 3, num, costCostingVO1.getShareParamProportion());
-                    for (int m=shareNumber+4;m<column;m++){
-                        // x是m y是num
-                        // 获取当前这一列对应的责任中心 以及会计科目
-                        // 第一行责任中心
-                        String responsibilityName = sheet.getRow(0).getCell(m).getStringCellValue();
-                        // 第二行的会计科目或者
-                        String accountNameOrAlias = sheet.getRow(1).getCell(m).getStringCellValue();
-                        // 这一行的目标责任中心
-                        String otherResponsibilityName = sheet.getRow(num).getCell(0).getStringCellValue();
-                        // 分摊参数
-                        String shareName = sheet.getRow(num).getCell(shareNumber + 1).getStringCellValue();
-                        CostCostingVO costCostingVO2 = allAccMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
-                        CostCostingVO costCostingVO3 = allAliMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
-                        if (Objects.nonNull(costCostingVO2)){
-                            writer.writeCellValue(m,num,costCostingVO2.getMoney());
-                        }else if (Objects.nonNull(costCostingVO3)){
-                            writer.writeCellValue(m,num,costCostingVO3.getMoney());
-                        }else {
-                            throw new CostException(500,"数据异常");
-                        }
-                        // 第二行的会计科目/别名
-//                        System.out.println(responsibilityName+"--"+accountNameOrAlias+"--"+otherResponsibilityName+"--"+shareName);
-                    }
-                    num++;
-                }
-            }
-            if (shareParamSize < NumberConstant.TWO) {
-                writer.writeCellValue(0, num, costCostingVOS1.get(0).getTargetResponsibilityName());
-                for (int k = 0; k < shareNumber; k++) {
-                    writer.writeCellValue(k + 1, num, costCostingVOS1.get(0).getTargetShareMoneys().get(k));
-                }
-                writer.writeCellValue(shareNumber + 1, num, costCostingVOS1.get(0).getShareParamName());
-                writer.writeCellValue(shareNumber + 2, num, costCostingVOS1.get(0).getShareValue());
-                writer.writeCellValue(shareNumber + 3, num, costCostingVOS1.get(0).getShareParamProportion());
-                //TODO 金额没有写
-                for (int m=shareNumber+4;m<column;m++){
-                    // x是m y是num
-                    // 获取当前这一列对应的责任中心 以及会计科目
-                    // 第一行责任中心
-                    String responsibilityName = sheet.getRow(0).getCell(m).getStringCellValue();
-                    // 第二行的会计科目或者
-                    String accountNameOrAlias = sheet.getRow(1).getCell(m).getStringCellValue();
-                    // 这一行的目标责任中心
-                    String otherResponsibilityName = sheet.getRow(num).getCell(0).getStringCellValue();
-                    // 分摊参数
-                    String shareName = sheet.getRow(num).getCell(shareNumber + 1).getStringCellValue();
-                    CostCostingVO costCostingVO2 = allAccMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
-                    CostCostingVO costCostingVO3 = allAliMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
-                    if (Objects.nonNull(costCostingVO2)){
-                        writer.writeCellValue(m,num,costCostingVO2.getMoney());
-                    }else if (Objects.nonNull(costCostingVO3)){
-                        writer.writeCellValue(m,num,costCostingVO3.getMoney());
-                    }else {
-                        throw new CostException(500,"数据异常");
-                    }
-                    // 第二行的会计科目/别名
-                    System.out.println(responsibilityName+"--"+accountNameOrAlias+"--"+otherResponsibilityName+"--"+shareName);
-                }
-                num++;
-            }
-        }
-//        for (int j=0;j<targetResponsibilityList.size();j++){
-//            String targetResponsibilityCode = targetResponsibilityList.get(j);
-//            // 需要判断是否需要合并单元格
-//            List<CostCostingVO> costingVOList = targetResponsibilityMap.get(targetResponsibilityCode);
-//            // 当前责任中心下面有多少个分摊参数
-//            int shareParamSize=costingVOList.size();
-//            if (shareParamSize>=NumberConstant.TWO){
-//                //设置责任中心
-//                CostCostingVO costCostingVO = costingVOList.get(0);
-//                writer.merge(j+num,j+num+shareParamSize-1,0,0,costCostingVO.getResponsibilityName(),false);
-//                // 设置第一次分摊参数值
-//                for (int k=0;k<shareNumber;k++){
-//                    writer.merge(j+num,j+num+shareParamSize-1,k+1,k+1,costCostingVO.getTargetShareMoneys().get(k),false);
-//
+////        for (int i=0; i< responsibilityMap.size();i++){
+//        // 判断当前当成的责任中心对应的分摊参数的数量
+////            List<CostCostingVO> costCostingVOS1 = responsibilityMap.get(responsibilityCode);
+////            numResponsibility=costCostingVOS1.size();
+////            shareLevelGrid+=numResponsibility;
+////            if (numResponsibility>= NumberConstant.TWO){
+////                writer.merge(0,0,column,column+numResponsibility-1,costCostingVOS1.get(0).getResponsibilityName(),false);
+////                // 设置对应的会计科目或者金额
+////                for (int j=0;j<numResponsibility;j++){
+////                    CostCostingVO costCostingVO = costCostingVOS1.get(j);
+////                    if (StrUtil.isBlank(costCostingVO.getAlias())){
+////                        // 别名不存在的时候
+////                        writer.writeCellValue(j+column,1,costCostingVO.getAccountName());
+////                    }else {
+////                        // 为空的话设置别名
+////                        writer.writeCellValue(j+column,1,costCostingVO.getAlias());
+////                    }
+////                    writer.writeCellValue(j+column,2,costCostingVO.getAccountName());
+////                }
+////                column+=numResponsibility;
+////            }else {
+////                writer.writeCellValue(column,0,costCostingVOS1.get(0).getResponsibilityName());
+////                writer.writeCellValue(column,1,costCostingVOS1.get(0).getAccountName());
+////                writer.writeCellValue(column,2,costCostingVOS1.get(0).getMoney());
+////                column++;
+////            }
+////        }
+//        // 设置单元格合并
+//        for (int j = 1; j <= shareNumber; j++) {
+//            writer.merge(0, 1, j, j, "第" + j + "次分摊", false);
+//        }
+//        // 目标责任集合
+//        writer.passCurrentRow();
+//        // 从第三行开始
+//        int num = 3;
+//        Set<String> targetSet = targetResponsibilityMap.keySet();
+//        for (String target : targetSet) {
+//            List<CostCostingVO> costCostingVOS1 = targetResponsibilityMap.get(target);
+//            Map<String, CostCostingVO> linkedHashMap = new LinkedHashMap<>();
+//            costCostingVOS1.forEach(i -> {
+//                String s = i.getTargetResponsibilityCode() + i.getShareParamName();
+//                if (!linkedHashMap.containsKey(s)) {
+//                    linkedHashMap.put(s, i);
+//                }
+//            });
+//            int shareParamSize = linkedHashMap.size();
+//            if (shareParamSize >= NumberConstant.TWO) {
+//                // 责任中心
+//                CostCostingVO costCostingVO = costCostingVOS1.get(0);
+////                writer.merge(num, num + shareParamSize - 1, 0, 0, costCostingVO.getTargetResponsibilityName(), false);
+//                // 设置第几次分摊的值
+//                for (int k = 0; k < shareNumber; k++) {
+//                    writer.merge(num, num + shareParamSize - 1, k + 1, k + 1, costCostingVO.getTargetShareMoneys().get(k), false);
 //                }
 //                // 设置对应的分摊参数值
-//                for (int i=0;i<shareParamSize;i++){
-//                    // 设置分摊参数
-//                    CostCostingVO costCostingVO1 = costingVOList.get(i);
-//                    int row=j+num+i;
-//                    writer.writeCellValue(shareNumber+1,row,costCostingVO1.getShareParamName());
-//                    writer.writeCellValue(shareNumber+2,row,costCostingVO1.getShareValue());
-//                    writer.writeCellValue(shareNumber+3,row,costCostingVO1.getShareParamProportion());
-//                    //TODO 金额没有写
-////                    for (int k=shareNumber+4;k<shareLevelGrid+6;k++){
-////                        writer.writeCellValue(k,row,"0.1111");
-////                    }
+//                Set<String> strings = linkedHashMap.keySet();
+//                for (String s : strings) {
+//                    CostCostingVO costCostingVO1 = linkedHashMap.get(s);
+//                    writer.writeCellValue(0,num,costCostingVO1.getTargetResponsibilityName());
+//                    writer.writeCellValue(shareNumber + 1, num, costCostingVO1.getShareParamName());
+//                    writer.writeCellValue(shareNumber + 2, num, costCostingVO1.getShareValue());
+//                    writer.writeCellValue(shareNumber + 3, num, costCostingVO1.getShareParamProportion());
+//                    for (int m=shareNumber+4;m<column;m++){
+//                        // x是m y是num
+//                        // 获取当前这一列对应的责任中心 以及会计科目
+//                        // 第一行责任中心
+//                        String responsibilityName = sheet.getRow(0).getCell(m).getStringCellValue();
+//                        // 第二行的会计科目或者
+//                        String accountNameOrAlias = sheet.getRow(1).getCell(m).getStringCellValue();
+//                        // 这一行的目标责任中心
+//                        String otherResponsibilityName = sheet.getRow(num).getCell(0).getStringCellValue();
+//                        // 分摊参数
+//                        String shareName = sheet.getRow(num).getCell(shareNumber + 1).getStringCellValue();
+//                        CostCostingVO costCostingVO2 = allAccMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
+//                        CostCostingVO costCostingVO3 = allAliMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
+//                        if (Objects.nonNull(costCostingVO2)){
+//                            writer.writeCellValue(m,num,costCostingVO2.getMoney());
+//                        }else if (Objects.nonNull(costCostingVO3)){
+//                            writer.writeCellValue(m,num,costCostingVO3.getMoney());
+//                        }else {
+//                            throw new CostException(500,"数据异常");
+//                        }
+//                        // 第二行的会计科目/别名
+////                        System.out.println(responsibilityName+"--"+accountNameOrAlias+"--"+otherResponsibilityName+"--"+shareName);
+//                    }
+//                    num++;
 //                }
-//
 //            }
-//            num+=shareParamSize-1;
-//            if (shareParamSize<NumberConstant.TWO){
-//                writer.writeCellValue(0, j + num, costingVOList.get(0).getResponsibilityName());
-//                for (int k=0;k<shareNumber;k++){
-//                    writer.merge(j+num,j+num+shareParamSize-1,k+1,k+1,costingVOList.get(0).getTargetShareMoneys().get(k),false);
+//            if (shareParamSize < NumberConstant.TWO) {
+//                writer.writeCellValue(0, num, costCostingVOS1.get(0).getTargetResponsibilityName());
+//                for (int k = 0; k < shareNumber; k++) {
+//                    writer.writeCellValue(k + 1, num, costCostingVOS1.get(0).getTargetShareMoneys().get(k));
 //                }
-//                writer.writeCellValue(shareNumber+1,j+num,costingVOList.get(0).getShareParamName());
-//                writer.writeCellValue(shareNumber+2,j+num,costingVOList.get(0).getShareValue());
-//                writer.writeCellValue(shareNumber+3,j+num,costingVOList.get(0).getShareParamProportion());
-//                // TODO 金额暂时不设置
-////                for (int k=shareNumber+4;k<shareLevelGrid+6;k++){
-////                    writer.writeCellValue(k,j+num,"0.3456");
-////                }
+//                writer.writeCellValue(shareNumber + 1, num, costCostingVOS1.get(0).getShareParamName());
+//                writer.writeCellValue(shareNumber + 2, num, costCostingVOS1.get(0).getShareValue());
+//                writer.writeCellValue(shareNumber + 3, num, costCostingVOS1.get(0).getShareParamProportion());
+//                //TODO 金额没有写
+//                for (int m=shareNumber+4;m<column;m++){
+//                    // x是m y是num
+//                    // 获取当前这一列对应的责任中心 以及会计科目
+//                    // 第一行责任中心
+//                    String responsibilityName = sheet.getRow(0).getCell(m).getStringCellValue();
+//                    // 第二行的会计科目或者
+//                    String accountNameOrAlias = sheet.getRow(1).getCell(m).getStringCellValue();
+//                    // 这一行的目标责任中心
+//                    String otherResponsibilityName = sheet.getRow(num).getCell(0).getStringCellValue();
+//                    // 分摊参数
+//                    String shareName = sheet.getRow(num).getCell(shareNumber + 1).getStringCellValue();
+//                    CostCostingVO costCostingVO2 = allAccMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
+//                    CostCostingVO costCostingVO3 = allAliMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
+//                    if (Objects.nonNull(costCostingVO2)){
+//                        writer.writeCellValue(m,num,costCostingVO2.getMoney());
+//                    }else if (Objects.nonNull(costCostingVO3)){
+//                        writer.writeCellValue(m,num,costCostingVO3.getMoney());
+//                    }else {
+//                        throw new CostException(500,"数据异常");
+//                    }
+//                    // 第二行的会计科目/别名
+//                    System.out.println(responsibilityName+"--"+accountNameOrAlias+"--"+otherResponsibilityName+"--"+shareName);
+//                }
+//                num++;
 //            }
-//
 //        }
-        // TODO 统一设置列宽  处理中文问题
-        for (int i = 0; i < 30; i++) {
-            // 调整每一列宽度
-            sheet.autoSizeColumn((short) i);
-            // 解决自动设置列宽中文失效的问题
-            sheet.setColumnWidth(i, sheet.getColumnWidth(i) * 13 / 10);
-        }
-        // todo 合并单元格
-        return writer;
-    }
-
-//    private void setMockData(LinkedList<SplitLevelVO> splitLevelVOLinkedList, LinkedList<TargetSplitLevelVO> targetSplitLevelVOLinkedList) {
-//        // 设置分摊层级责任中心数据
-//        SplitLevelVO splitLevelVO = new SplitLevelVO();
-//        splitLevelVO.setResponsibilityName("责任中心1");
-//        splitLevelVO.setResponsibilityCode("zr1");
-//        LinkedList<ResponsibilityAccountVO> responsibilityAccountVOS = new LinkedList<>();
+////        for (int j=0;j<targetResponsibilityList.size();j++){
+////            String targetResponsibilityCode = targetResponsibilityList.get(j);
+////            // 需要判断是否需要合并单元格
+////            List<CostCostingVO> costingVOList = targetResponsibilityMap.get(targetResponsibilityCode);
+////            // 当前责任中心下面有多少个分摊参数
+////            int shareParamSize=costingVOList.size();
+////            if (shareParamSize>=NumberConstant.TWO){
+////                //设置责任中心
+////                CostCostingVO costCostingVO = costingVOList.get(0);
+////                writer.merge(j+num,j+num+shareParamSize-1,0,0,costCostingVO.getResponsibilityName(),false);
+////                // 设置第一次分摊参数值
+////                for (int k=0;k<shareNumber;k++){
+////                    writer.merge(j+num,j+num+shareParamSize-1,k+1,k+1,costCostingVO.getTargetShareMoneys().get(k),false);
+////
+////                }
+////                // 设置对应的分摊参数值
+////                for (int i=0;i<shareParamSize;i++){
+////                    // 设置分摊参数
+////                    CostCostingVO costCostingVO1 = costingVOList.get(i);
+////                    int row=j+num+i;
+////                    writer.writeCellValue(shareNumber+1,row,costCostingVO1.getShareParamName());
+////                    writer.writeCellValue(shareNumber+2,row,costCostingVO1.getShareValue());
+////                    writer.writeCellValue(shareNumber+3,row,costCostingVO1.getShareParamProportion());
+////                    //TODO 金额没有写
+//////                    for (int k=shareNumber+4;k<shareLevelGrid+6;k++){
+//////                        writer.writeCellValue(k,row,"0.1111");
+//////                    }
+////                }
+////
+////            }
+////            num+=shareParamSize-1;
+////            if (shareParamSize<NumberConstant.TWO){
+////                writer.writeCellValue(0, j + num, costingVOList.get(0).getResponsibilityName());
+////                for (int k=0;k<shareNumber;k++){
+////                    writer.merge(j+num,j+num+shareParamSize-1,k+1,k+1,costingVOList.get(0).getTargetShareMoneys().get(k),false);
+////                }
+////                writer.writeCellValue(shareNumber+1,j+num,costingVOList.get(0).getShareParamName());
+////                writer.writeCellValue(shareNumber+2,j+num,costingVOList.get(0).getShareValue());
+////                writer.writeCellValue(shareNumber+3,j+num,costingVOList.get(0).getShareParamProportion());
+////                // TODO 金额暂时不设置
+//////                for (int k=shareNumber+4;k<shareLevelGrid+6;k++){
+//////                    writer.writeCellValue(k,j+num,"0.3456");
+//////                }
+////            }
+////
+////        }
+//        // TODO 统一设置列宽  处理中文问题
+//        for (int i = 0; i < 30; i++) {
+//            // 调整每一列宽度
+//            sheet.autoSizeColumn((short) i);
+//            // 解决自动设置列宽中文失效的问题
+//            sheet.setColumnWidth(i, sheet.getColumnWidth(i) * 13 / 10);
+//        }
+//        // todo 合并单元格
+//        return writer;
+//    }
+//
+////    private void setMockData(LinkedList<SplitLevelVO> splitLevelVOLinkedList, LinkedList<TargetSplitLevelVO> targetSplitLevelVOLinkedList) {
+////        // 设置分摊层级责任中心数据
+////        SplitLevelVO splitLevelVO = new SplitLevelVO();
+////        splitLevelVO.setResponsibilityName("责任中心1");
+////        splitLevelVO.setResponsibilityCode("zr1");
+////        LinkedList<ResponsibilityAccountVO> responsibilityAccountVOS = new LinkedList<>();
+////
+////        ResponsibilityAccountVO responsibilityAccountVO = new ResponsibilityAccountVO();
+////        responsibilityAccountVO.setAccountingNames("其他费用,资产改良及摊销");
+////        responsibilityAccountVO.setAccountingCodes("1825,1824");
+////        responsibilityAccountVO.setAccountingIds("57,56");
+////        responsibilityAccountVO.setMoney("12.6666");
+////        responsibilityAccountVOS.add(responsibilityAccountVO);
+////
+////        ResponsibilityAccountVO responsibilityAccountVORequest = new ResponsibilityAccountVO();
+////        responsibilityAccountVORequest.setAccountingNames("低值易耗品");
+////        responsibilityAccountVORequest.setAccountingCodes("1822");
+////        responsibilityAccountVORequest.setAccountingIds("54");
+////        responsibilityAccountVORequest.setAlias("设置了别名");
+////        responsibilityAccountVORequest.setMoney("12.1111");
+////        responsibilityAccountVOS.add(responsibilityAccountVORequest);
+////        splitLevelVO.setResponsibilityAccountVOList(responsibilityAccountVOS);
+////        splitLevelVOLinkedList.add(splitLevelVO);
+////
+////        SplitLevelVO splitLevelVO1 = new SplitLevelVO();
+////        splitLevelVO1.setResponsibilityName("责任中心2");
+////        splitLevelVO1.setResponsibilityCode("zr2");
+////        LinkedList<ResponsibilityAccountVO> responsibilityAccountVOS1 = new LinkedList<>();
+////        ResponsibilityAccountVO responsibilityAccountVORequest1 = new ResponsibilityAccountVO();
+////        responsibilityAccountVORequest1.setAccountingNames("低值易耗品");
+////        responsibilityAccountVORequest1.setAccountingCodes("1822");
+////        responsibilityAccountVORequest1.setAccountingIds("54");
+////        responsibilityAccountVORequest1.setAlias("设置的别名");
+////        responsibilityAccountVORequest1.setMoney("12.1111");
+////        responsibilityAccountVOS1.add(responsibilityAccountVORequest1);
+////        splitLevelVO1.setResponsibilityAccountVOList(responsibilityAccountVOS1);
+////        splitLevelVOLinkedList.add(splitLevelVO1);
+////
+////        TargetSplitLevelVO targetSplitLevelVO = new TargetSplitLevelVO();
+////        targetSplitLevelVO.setResponsibilityCode("zr1");
+////        targetSplitLevelVO.setResponsibilityName("责任中心1");
+////        targetSplitLevelVO.setOneShareMoney("100.1111");
+////        targetSplitLevelVO.setTwoShareMoney("200.1111");
+////        targetSplitLevelVO.setThreeShareMoney("300.1111");
+////        LinkedList<TargetShareParamValue> targetShareParamValueLinkedList = new LinkedList<>();
+////        TargetShareParamValue targetShareParamValue = new TargetShareParamValue();
+////        targetShareParamValue.setShareParamName("员工费");
+////        targetShareParamValue.setShareParamCode("A11");
+////        targetShareParamValue.setShareParamValue("66");
+////        targetShareParamValue.setShareParamProportion("0.1111");
+////        targetShareParamValueLinkedList.add(targetShareParamValue);
+////        TargetShareParamValue targetShareParamValueRequest = new TargetShareParamValue();
+////        targetShareParamValueRequest.setShareParamName("医疗收入");
+////        targetShareParamValueRequest.setShareParamCode("A22");
+////        targetShareParamValueRequest.setShareParamValue("77");
+////        targetShareParamValueRequest.setShareParamProportion("0.4444");
+////        targetShareParamValueLinkedList.add(targetShareParamValueRequest);
+////        targetSplitLevelVO.setTargetShareParamValueList(targetShareParamValueLinkedList);
+////        targetSplitLevelVOLinkedList.add(targetSplitLevelVO);
+////
+////        TargetSplitLevelVO targetSplitLevelVORequest = new TargetSplitLevelVO();
+////        targetSplitLevelVORequest.setResponsibilityCode("zr2");
+////        targetSplitLevelVORequest.setResponsibilityName("责任中心2");
+////        targetSplitLevelVORequest.setOneShareMoney("102.1111");
+////        targetSplitLevelVORequest.setTwoShareMoney("202.1111");
+////        targetSplitLevelVORequest.setThreeShareMoney("300.1111");
+////        LinkedList<TargetShareParamValue> targetShareParamValueLinkedList1 = new LinkedList<>();
+////        TargetShareParamValue targetShareParamValue1 = new TargetShareParamValue();
+////        targetShareParamValue1.setShareParamName("水费");
+////        targetShareParamValue1.setShareParamCode("A66");
+////        targetShareParamValue1.setShareParamValue("777");
+////        targetShareParamValue1.setShareParamProportion("0.777");
+////        targetShareParamValueLinkedList1.add(targetShareParamValue1);
+////        targetSplitLevelVORequest.setTargetShareParamValueList(targetShareParamValueLinkedList1);
+////        targetSplitLevelVOLinkedList.add(targetSplitLevelVORequest);
+////
+////    }
+//
+//    private List<CostCostingVO> setMockDa() {
+//        List<CostCostingVO> costCostingVOS = new LinkedList<>();
+//        CostCostingVO costCostingVO = new CostCostingVO();
+//        costCostingVO.setResponsibilityCode("zr1");
+//        costCostingVO.setResponsibilityName("责任中心1");
+//        costCostingVO.setAccountCode("A11");
+//        costCostingVO.setAccountName("人事费用");
+//        costCostingVO.setAmount("800");
+//        costCostingVO.setTargetResponsibilityCode("tzr1");
+//        costCostingVO.setTargetResponsibilityName("目标责任中心1");
+//        List<String> strings = new ArrayList<>();
+//        strings.add("1000");
+//        strings.add("2000");
+//        costCostingVO.setTargetShareMoneys(strings);
+//        costCostingVO.setShareParamName("员工数");
+//        costCostingVO.setShareValue("3");
+//        costCostingVO.setShareParamProportion("0.3344");
+//        costCostingVO.setMoney("5.28");
+//        costCostingVOS.add(costCostingVO);
+//
+//        CostCostingVO costCostingVO1 = new CostCostingVO();
+//        costCostingVO1.setResponsibilityCode("zr1");
+//        costCostingVO1.setResponsibilityName("责任中心1");
+//        // 会计科目可能为空
+//        costCostingVO1.setAccountCode("A12");
+//        costCostingVO1.setAccountName("其他费用");
+//        costCostingVO1.setAmount("600");
+//        costCostingVO1.setAlias("设置的别名");
+//        costCostingVO1.setTargetResponsibilityCode("tzr1");
+//        costCostingVO1.setTargetResponsibilityName("目标责任中心1");
+//        List<String> strings1 = new ArrayList<>();
+//        strings1.add("1000");
+//        strings1.add("2000");
+//        costCostingVO1.setTargetShareMoneys(strings);
+//        costCostingVO1.setShareParamName("员工数");
+//        costCostingVO1.setShareValue("3");
+//        costCostingVO1.setShareParamProportion("0.3344");
+//        costCostingVO1.setMoney("0.88");
+//        costCostingVOS.add(costCostingVO1);
+//
+//        CostCostingVO costCostingVO2 = new CostCostingVO();
+//        costCostingVO2.setResponsibilityCode("zr1");
+//        costCostingVO2.setResponsibilityName("责任中心1");
+//        // 会计科目可能为空
+//        costCostingVO2.setAccountCode("A11");
+//        costCostingVO2.setAccountName("人事费用");
+//        costCostingVO2.setAmount("800");
+//        costCostingVO2.setTargetResponsibilityCode("tzr1");
+//        costCostingVO2.setTargetResponsibilityName("目标责任中心1");
+//        List<String> strings2 = new ArrayList<>();
+//        strings2.add("1000");
+//        strings2.add("2000");
+//        costCostingVO2.setTargetShareMoneys(strings);
+//        costCostingVO2.setShareParamName("医疗收入");
+//        costCostingVO2.setShareValue("95");
+//        costCostingVO2.setShareParamProportion("0.19");
+//        costCostingVO2.setMoney("0.55");
+//        costCostingVOS.add(costCostingVO2);
 //
-//        ResponsibilityAccountVO responsibilityAccountVO = new ResponsibilityAccountVO();
-//        responsibilityAccountVO.setAccountingNames("其他费用,资产改良及摊销");
-//        responsibilityAccountVO.setAccountingCodes("1825,1824");
-//        responsibilityAccountVO.setAccountingIds("57,56");
-//        responsibilityAccountVO.setMoney("12.6666");
-//        responsibilityAccountVOS.add(responsibilityAccountVO);
+//        CostCostingVO costCostingVO3 = new CostCostingVO();
+//        costCostingVO3.setResponsibilityCode("zr1");
+//        costCostingVO3.setResponsibilityName("责任中心1");
+//        costCostingVO3.setAccountCode("A12");
+//        costCostingVO3.setAccountName("其他费用");
+//        costCostingVO3.setAmount("600");
+//        costCostingVO3.setAlias("设置的别名");
+//        costCostingVO3.setTargetResponsibilityCode("tzr1");
+//        costCostingVO3.setTargetResponsibilityName("目标责任中心1");
+//        List<String> strings3 = new ArrayList<>();
+//        strings3.add("1000");
+//        strings3.add("2000");
+//        costCostingVO3.setTargetShareMoneys(strings);
+//        costCostingVO3.setShareParamName("医疗收入");
+//        costCostingVO3.setShareValue("95");
+//        costCostingVO3.setShareParamProportion("0.19");
+//        costCostingVO3.setMoney("0.44");
+//        costCostingVOS.add(costCostingVO3);
 //
-//        ResponsibilityAccountVO responsibilityAccountVORequest = new ResponsibilityAccountVO();
-//        responsibilityAccountVORequest.setAccountingNames("低值易耗品");
-//        responsibilityAccountVORequest.setAccountingCodes("1822");
-//        responsibilityAccountVORequest.setAccountingIds("54");
-//        responsibilityAccountVORequest.setAlias("设置了别名");
-//        responsibilityAccountVORequest.setMoney("12.1111");
-//        responsibilityAccountVOS.add(responsibilityAccountVORequest);
-//        splitLevelVO.setResponsibilityAccountVOList(responsibilityAccountVOS);
-//        splitLevelVOLinkedList.add(splitLevelVO);
+//        CostCostingVO costCostingVO5 = new CostCostingVO();
+//        costCostingVO5.setResponsibilityCode("zr2");
+//        costCostingVO5.setResponsibilityName("责任中心2");
+//        costCostingVO5.setAccountCode("A13");
+//        costCostingVO5.setAccountName("责任费用");
+//        costCostingVO5.setAmount("900");
+//        costCostingVO5.setTargetResponsibilityCode("tzr2");
+//        costCostingVO5.setTargetResponsibilityName("目标责任中心2");
+//        List<String> strings5 = new ArrayList<>();
+//        strings5.add("1000");
+//        strings5.add("2000");
+//        costCostingVO5.setTargetShareMoneys(strings5);
+//        costCostingVO5.setShareParamName("麻醉科收入");
+//        costCostingVO5.setShareValue("100");
+//        costCostingVO5.setShareParamProportion("0.188");
+//        costCostingVO5.setMoney("1.11");
+//        costCostingVOS.add(costCostingVO5);
 //
-//        SplitLevelVO splitLevelVO1 = new SplitLevelVO();
-//        splitLevelVO1.setResponsibilityName("责任中心2");
-//        splitLevelVO1.setResponsibilityCode("zr2");
-//        LinkedList<ResponsibilityAccountVO> responsibilityAccountVOS1 = new LinkedList<>();
-//        ResponsibilityAccountVO responsibilityAccountVORequest1 = new ResponsibilityAccountVO();
-//        responsibilityAccountVORequest1.setAccountingNames("低值易耗品");
-//        responsibilityAccountVORequest1.setAccountingCodes("1822");
-//        responsibilityAccountVORequest1.setAccountingIds("54");
-//        responsibilityAccountVORequest1.setAlias("设置的别名");
-//        responsibilityAccountVORequest1.setMoney("12.1111");
-//        responsibilityAccountVOS1.add(responsibilityAccountVORequest1);
-//        splitLevelVO1.setResponsibilityAccountVOList(responsibilityAccountVOS1);
-//        splitLevelVOLinkedList.add(splitLevelVO1);
+//        CostCostingVO costCostingVO6 = new CostCostingVO();
+//        costCostingVO6.setResponsibilityCode("zr1");
+//        costCostingVO6.setResponsibilityName("责任中心1");
+//        // 会计科目可能为空
+//        costCostingVO6.setAccountCode("A11");
+//        costCostingVO6.setAccountName("人事费用");
+//        costCostingVO6.setAmount("800");
+//        costCostingVO6.setTargetResponsibilityCode("tzr2");
+//        costCostingVO6.setTargetResponsibilityName("目标责任中心2");
+//        List<String> strings6 = new ArrayList<>();
+//        strings6.add("1000");
+//        strings6.add("2000");
+//        costCostingVO6.setTargetShareMoneys(strings6);
+//        costCostingVO6.setShareParamName("麻醉科收入");
+//        costCostingVO6.setShareValue("100");
+//        costCostingVO6.setShareParamProportion("0.18");
+//        costCostingVO6.setMoney("0.33");
+//        costCostingVOS.add(costCostingVO6);
 //
-//        TargetSplitLevelVO targetSplitLevelVO = new TargetSplitLevelVO();
-//        targetSplitLevelVO.setResponsibilityCode("zr1");
-//        targetSplitLevelVO.setResponsibilityName("责任中心1");
-//        targetSplitLevelVO.setOneShareMoney("100.1111");
-//        targetSplitLevelVO.setTwoShareMoney("200.1111");
-//        targetSplitLevelVO.setThreeShareMoney("300.1111");
-//        LinkedList<TargetShareParamValue> targetShareParamValueLinkedList = new LinkedList<>();
-//        TargetShareParamValue targetShareParamValue = new TargetShareParamValue();
-//        targetShareParamValue.setShareParamName("员工费");
-//        targetShareParamValue.setShareParamCode("A11");
-//        targetShareParamValue.setShareParamValue("66");
-//        targetShareParamValue.setShareParamProportion("0.1111");
-//        targetShareParamValueLinkedList.add(targetShareParamValue);
-//        TargetShareParamValue targetShareParamValueRequest = new TargetShareParamValue();
-//        targetShareParamValueRequest.setShareParamName("医疗收入");
-//        targetShareParamValueRequest.setShareParamCode("A22");
-//        targetShareParamValueRequest.setShareParamValue("77");
-//        targetShareParamValueRequest.setShareParamProportion("0.4444");
-//        targetShareParamValueLinkedList.add(targetShareParamValueRequest);
-//        targetSplitLevelVO.setTargetShareParamValueList(targetShareParamValueLinkedList);
-//        targetSplitLevelVOLinkedList.add(targetSplitLevelVO);
+//        CostCostingVO costCostingVO7 = new CostCostingVO();
+//        costCostingVO7.setResponsibilityCode("zr1");
+//        costCostingVO7.setResponsibilityName("责任中心1");
+//        costCostingVO7.setAccountCode("A12");
+//        costCostingVO7.setAccountName("其他费用");
+//        costCostingVO7.setAmount("600");
+//        costCostingVO7.setAlias("设置的别名");
+//        costCostingVO7.setTargetResponsibilityCode("tzr2");
+//        costCostingVO7.setTargetResponsibilityName("目标责任中心2");
+//        List<String> strings7 = new ArrayList<>();
+//        strings7.add("1000");
+//        strings7.add("2000");
+//        costCostingVO7.setTargetShareMoneys(strings);
+//        costCostingVO7.setShareParamName("麻醉科收入");
+//        costCostingVO7.setShareValue("100");
+//        costCostingVO7.setShareParamProportion("0.18");
+//        costCostingVO7.setMoney("0.22");
+//        costCostingVOS.add(costCostingVO7);
 //
-//        TargetSplitLevelVO targetSplitLevelVORequest = new TargetSplitLevelVO();
-//        targetSplitLevelVORequest.setResponsibilityCode("zr2");
-//        targetSplitLevelVORequest.setResponsibilityName("责任中心2");
-//        targetSplitLevelVORequest.setOneShareMoney("102.1111");
-//        targetSplitLevelVORequest.setTwoShareMoney("202.1111");
-//        targetSplitLevelVORequest.setThreeShareMoney("300.1111");
-//        LinkedList<TargetShareParamValue> targetShareParamValueLinkedList1 = new LinkedList<>();
-//        TargetShareParamValue targetShareParamValue1 = new TargetShareParamValue();
-//        targetShareParamValue1.setShareParamName("水费");
-//        targetShareParamValue1.setShareParamCode("A66");
-//        targetShareParamValue1.setShareParamValue("777");
-//        targetShareParamValue1.setShareParamProportion("0.777");
-//        targetShareParamValueLinkedList1.add(targetShareParamValue1);
-//        targetSplitLevelVORequest.setTargetShareParamValueList(targetShareParamValueLinkedList1);
-//        targetSplitLevelVOLinkedList.add(targetSplitLevelVORequest);
+//        CostCostingVO costCostingVO8 = new CostCostingVO();
+//        costCostingVO8.setResponsibilityCode("zr2");
+//        costCostingVO8.setResponsibilityName("责任中心2");
+//        costCostingVO8.setAccountCode("A13");
+//        costCostingVO8.setAccountName("责任费用");
+//        costCostingVO8.setAmount("900");
+//        costCostingVO8.setTargetResponsibilityCode("tzr1");
+//        costCostingVO8.setTargetResponsibilityName("目标责任中心1");
+//        List<String> strings8 = new ArrayList<>();
+//        strings8.add("1000");
+//        strings8.add("2000");
+//        costCostingVO8.setTargetShareMoneys(strings8);
+//        costCostingVO8.setShareParamName("员工数");
+//        costCostingVO8.setShareValue("3");
+//        costCostingVO8.setShareParamProportion("0.3344");
+//        costCostingVO8.setMoney("1.55");
+//        costCostingVOS.add(costCostingVO8);
 //
+//        CostCostingVO costCostingVO9 = new CostCostingVO();
+//        costCostingVO9.setResponsibilityCode("zr2");
+//        costCostingVO9.setResponsibilityName("责任中心2");
+//        costCostingVO9.setAccountCode("A13");
+//        costCostingVO9.setAccountName("责任费用");
+//        costCostingVO9.setAmount("900");
+//        costCostingVO9.setTargetResponsibilityCode("tzr1");
+//        costCostingVO9.setTargetResponsibilityName("目标责任中心1");
+//        List<String> strings9 = new ArrayList<>();
+//        strings9.add("1000");
+//        strings9.add("2000");
+//        costCostingVO9.setTargetShareMoneys(strings9);
+//        costCostingVO9.setShareParamName("医疗收入");
+//        costCostingVO9.setShareValue("95");
+//        costCostingVO9.setShareParamProportion("0.19");
+//        costCostingVO9.setMoney("2.66");
+//        costCostingVOS.add(costCostingVO9);
+//        return costCostingVOS;
 //    }
-
-    private List<CostCostingVO> setMockDa() {
-        List<CostCostingVO> costCostingVOS = new LinkedList<>();
-        CostCostingVO costCostingVO = new CostCostingVO();
-        costCostingVO.setResponsibilityCode("zr1");
-        costCostingVO.setResponsibilityName("责任中心1");
-        costCostingVO.setAccountCode("A11");
-        costCostingVO.setAccountName("人事费用");
-        costCostingVO.setAmount("800");
-        costCostingVO.setTargetResponsibilityCode("tzr1");
-        costCostingVO.setTargetResponsibilityName("目标责任中心1");
-        List<String> strings = new ArrayList<>();
-        strings.add("1000");
-        strings.add("2000");
-        costCostingVO.setTargetShareMoneys(strings);
-        costCostingVO.setShareParamName("员工数");
-        costCostingVO.setShareValue("3");
-        costCostingVO.setShareParamProportion("0.3344");
-        costCostingVO.setMoney("5.28");
-        costCostingVOS.add(costCostingVO);
-
-        CostCostingVO costCostingVO1 = new CostCostingVO();
-        costCostingVO1.setResponsibilityCode("zr1");
-        costCostingVO1.setResponsibilityName("责任中心1");
-        // 会计科目可能为空
-        costCostingVO1.setAccountCode("A12");
-        costCostingVO1.setAccountName("其他费用");
-        costCostingVO1.setAmount("600");
-        costCostingVO1.setAlias("设置的别名");
-        costCostingVO1.setTargetResponsibilityCode("tzr1");
-        costCostingVO1.setTargetResponsibilityName("目标责任中心1");
-        List<String> strings1 = new ArrayList<>();
-        strings1.add("1000");
-        strings1.add("2000");
-        costCostingVO1.setTargetShareMoneys(strings);
-        costCostingVO1.setShareParamName("员工数");
-        costCostingVO1.setShareValue("3");
-        costCostingVO1.setShareParamProportion("0.3344");
-        costCostingVO1.setMoney("0.88");
-        costCostingVOS.add(costCostingVO1);
-
-        CostCostingVO costCostingVO2 = new CostCostingVO();
-        costCostingVO2.setResponsibilityCode("zr1");
-        costCostingVO2.setResponsibilityName("责任中心1");
-        // 会计科目可能为空
-        costCostingVO2.setAccountCode("A11");
-        costCostingVO2.setAccountName("人事费用");
-        costCostingVO2.setAmount("800");
-        costCostingVO2.setTargetResponsibilityCode("tzr1");
-        costCostingVO2.setTargetResponsibilityName("目标责任中心1");
-        List<String> strings2 = new ArrayList<>();
-        strings2.add("1000");
-        strings2.add("2000");
-        costCostingVO2.setTargetShareMoneys(strings);
-        costCostingVO2.setShareParamName("医疗收入");
-        costCostingVO2.setShareValue("95");
-        costCostingVO2.setShareParamProportion("0.19");
-        costCostingVO2.setMoney("0.55");
-        costCostingVOS.add(costCostingVO2);
-
-        CostCostingVO costCostingVO3 = new CostCostingVO();
-        costCostingVO3.setResponsibilityCode("zr1");
-        costCostingVO3.setResponsibilityName("责任中心1");
-        costCostingVO3.setAccountCode("A12");
-        costCostingVO3.setAccountName("其他费用");
-        costCostingVO3.setAmount("600");
-        costCostingVO3.setAlias("设置的别名");
-        costCostingVO3.setTargetResponsibilityCode("tzr1");
-        costCostingVO3.setTargetResponsibilityName("目标责任中心1");
-        List<String> strings3 = new ArrayList<>();
-        strings3.add("1000");
-        strings3.add("2000");
-        costCostingVO3.setTargetShareMoneys(strings);
-        costCostingVO3.setShareParamName("医疗收入");
-        costCostingVO3.setShareValue("95");
-        costCostingVO3.setShareParamProportion("0.19");
-        costCostingVO3.setMoney("0.44");
-        costCostingVOS.add(costCostingVO3);
-
-        CostCostingVO costCostingVO5 = new CostCostingVO();
-        costCostingVO5.setResponsibilityCode("zr2");
-        costCostingVO5.setResponsibilityName("责任中心2");
-        costCostingVO5.setAccountCode("A13");
-        costCostingVO5.setAccountName("责任费用");
-        costCostingVO5.setAmount("900");
-        costCostingVO5.setTargetResponsibilityCode("tzr2");
-        costCostingVO5.setTargetResponsibilityName("目标责任中心2");
-        List<String> strings5 = new ArrayList<>();
-        strings5.add("1000");
-        strings5.add("2000");
-        costCostingVO5.setTargetShareMoneys(strings5);
-        costCostingVO5.setShareParamName("麻醉科收入");
-        costCostingVO5.setShareValue("100");
-        costCostingVO5.setShareParamProportion("0.188");
-        costCostingVO5.setMoney("1.11");
-        costCostingVOS.add(costCostingVO5);
-
-        CostCostingVO costCostingVO6 = new CostCostingVO();
-        costCostingVO6.setResponsibilityCode("zr1");
-        costCostingVO6.setResponsibilityName("责任中心1");
-        // 会计科目可能为空
-        costCostingVO6.setAccountCode("A11");
-        costCostingVO6.setAccountName("人事费用");
-        costCostingVO6.setAmount("800");
-        costCostingVO6.setTargetResponsibilityCode("tzr2");
-        costCostingVO6.setTargetResponsibilityName("目标责任中心2");
-        List<String> strings6 = new ArrayList<>();
-        strings6.add("1000");
-        strings6.add("2000");
-        costCostingVO6.setTargetShareMoneys(strings6);
-        costCostingVO6.setShareParamName("麻醉科收入");
-        costCostingVO6.setShareValue("100");
-        costCostingVO6.setShareParamProportion("0.18");
-        costCostingVO6.setMoney("0.33");
-        costCostingVOS.add(costCostingVO6);
-
-        CostCostingVO costCostingVO7 = new CostCostingVO();
-        costCostingVO7.setResponsibilityCode("zr1");
-        costCostingVO7.setResponsibilityName("责任中心1");
-        costCostingVO7.setAccountCode("A12");
-        costCostingVO7.setAccountName("其他费用");
-        costCostingVO7.setAmount("600");
-        costCostingVO7.setAlias("设置的别名");
-        costCostingVO7.setTargetResponsibilityCode("tzr2");
-        costCostingVO7.setTargetResponsibilityName("目标责任中心2");
-        List<String> strings7 = new ArrayList<>();
-        strings7.add("1000");
-        strings7.add("2000");
-        costCostingVO7.setTargetShareMoneys(strings);
-        costCostingVO7.setShareParamName("麻醉科收入");
-        costCostingVO7.setShareValue("100");
-        costCostingVO7.setShareParamProportion("0.18");
-        costCostingVO7.setMoney("0.22");
-        costCostingVOS.add(costCostingVO7);
-
-        CostCostingVO costCostingVO8 = new CostCostingVO();
-        costCostingVO8.setResponsibilityCode("zr2");
-        costCostingVO8.setResponsibilityName("责任中心2");
-        costCostingVO8.setAccountCode("A13");
-        costCostingVO8.setAccountName("责任费用");
-        costCostingVO8.setAmount("900");
-        costCostingVO8.setTargetResponsibilityCode("tzr1");
-        costCostingVO8.setTargetResponsibilityName("目标责任中心1");
-        List<String> strings8 = new ArrayList<>();
-        strings8.add("1000");
-        strings8.add("2000");
-        costCostingVO8.setTargetShareMoneys(strings8);
-        costCostingVO8.setShareParamName("员工数");
-        costCostingVO8.setShareValue("3");
-        costCostingVO8.setShareParamProportion("0.3344");
-        costCostingVO8.setMoney("1.55");
-        costCostingVOS.add(costCostingVO8);
-
-        CostCostingVO costCostingVO9 = new CostCostingVO();
-        costCostingVO9.setResponsibilityCode("zr2");
-        costCostingVO9.setResponsibilityName("责任中心2");
-        costCostingVO9.setAccountCode("A13");
-        costCostingVO9.setAccountName("责任费用");
-        costCostingVO9.setAmount("900");
-        costCostingVO9.setTargetResponsibilityCode("tzr1");
-        costCostingVO9.setTargetResponsibilityName("目标责任中心1");
-        List<String> strings9 = new ArrayList<>();
-        strings9.add("1000");
-        strings9.add("2000");
-        costCostingVO9.setTargetShareMoneys(strings9);
-        costCostingVO9.setShareParamName("医疗收入");
-        costCostingVO9.setShareValue("95");
-        costCostingVO9.setShareParamProportion("0.19");
-        costCostingVO9.setMoney("2.66");
-        costCostingVOS.add(costCostingVO9);
-        return costCostingVOS;
-    }
-    /**
-     * 科室
-     */
+//    /**
+//     * 科室
+//     */
 }

+ 29 - 9
src/main/java/com/imed/costaccount/service/impl/CostDepartmentProfitServiceImpl.java

@@ -242,14 +242,28 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
      */
     @Override
     public void getDepartmentProfit(ExcelWriter writer, Sheet sheet, String date) {
-        int year = 0;
-        int month = 0;
-        if (StrUtil.isNotBlank(date)) {
-            Date dateTime = DateUtils.StringToDate(date, DateStyleEnum.YYYY_MM_DD);
-            year = DateUtil.year(dateTime);
-            month = DateUtil.month(dateTime) + 1;
-        }
         Long hospId = UserContext.getHospId();
+
+        UserContext.getHospId();
+        //先展示所有责任中心  非汇总中心 收益中心的责任中心
+        // 查询所有的节点
+        List<Responsibility> responsibilityList = responsibilityService.list(new QueryWrapper<Responsibility>().lambda().eq(Responsibility::getHospId, hospId));
+        if (CollUtil.isEmpty(responsibilityList)){
+            throw new CostException(500,"责任中心不存在");
+        }
+        // 所有的叶子
+        Map<Long, List<Responsibility>> responsibilityMap = responsibilityList.stream().collect(Collectors.groupingBy(Responsibility::getParentId));
+        List<Responsibility> responsibilities = responsibilityList.stream().filter(i -> NumberConstant.TWO.equals(i.getIsGatherCenter()) && NumberConstant.ONE.equals(i.getResponsibilityType())).collect(Collectors.toList());
+        Map<Long, List<Responsibility>> responsibilityParentMap = responsibilities.stream().collect(Collectors.groupingBy(Responsibility::getParentId));
+        Set<Long> keySet = responsibilityParentMap.keySet();
+        for (Long parentId:keySet){
+            // 同一父节点的叶子节点数据
+            List<Responsibility> list = responsibilityParentMap.get(parentId);
+
+        }
+        DateTime dateTime = DateUtil.parse(date);
+        int year = DateUtil.year(dateTime);
+        int month = DateUtil.month(dateTime)+1;
         List<CostDepartmentProfit> costDepartmentProfitList = this.list(new QueryWrapper<CostDepartmentProfit>().lambda().eq(CostDepartmentProfit::getHospId, hospId).eq(StrUtil.isNotBlank(date), CostDepartmentProfit::getYear, year).eq(StrUtil.isNotBlank(date), CostDepartmentProfit::getMonth, month));
         // 16个责任中心名称
         List<String> responsibilityNameList = costDepartmentProfitList.stream().map(CostDepartmentProfit::getResponsibilityName).distinct().sorted().collect(Collectors.toList());
@@ -257,8 +271,14 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
         for (int i = 0; i < responsibilityNameList.size(); i++) {
             String responsibilityName = responsibilityNameList.get(i);
             List<CostDepartmentProfit> departmentProfits = responsibilityNameMap.get(responsibilityName);
-            writer.merge(0, 2, 0, departmentProfits.size() + 2, responsibilityName, false);
+            for (int j=0;j<departmentProfits.size();j++){
+                String responsibilityName1 = departmentProfits.get(j).getResponsibilityName();
+//                departmentProfits.get(j).get
+                // 第一行
+//                writer.writeCellValue(0,j+2,
+            }
         }
+        // 合并留在最后
         System.out.println(responsibilityNameList);
     }
 
@@ -270,7 +290,7 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
     private BigDecimal setAccountReportData(CostDepartmentProfitVO i, List<IncomeCollection> list, List<AllocationQueryReportVO> allocationQueryReportVOList, Map<Long, List<ReportRelation>> reportRelationMap) {
         // 在报表关联里面查询当前报表关联的
         Long reportId = i.getReportId();
-        List<ReportRelation> reportRelationList = reportRelationMap.get(i.getReportId());
+        List<ReportRelation> reportRelationList = reportRelationMap.get(reportId);
         AtomicReference<BigDecimal> sum = new AtomicReference<>(new BigDecimal("0.000"));
         if (CollUtil.isNotEmpty(reportRelationList)) {
             // 获取对应的会计科目信息  筛选会计科目的Code

+ 54 - 0
src/main/java/com/imed/costaccount/service/impl/DepartmentProfitFileServiceImpl.java

@@ -0,0 +1,54 @@
+package com.imed.costaccount.service.impl;
+
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.imed.costaccount.common.util.BeanUtil;
+import com.imed.costaccount.common.util.PageUtils;
+import com.imed.costaccount.mapper.DepartmentProfitFileMapper;
+import com.imed.costaccount.model.DepartmentProfitFile;
+import com.imed.costaccount.model.vo.DepartmentProfitFileVO;
+import com.imed.costaccount.service.DepartmentProfitFileService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service("departmentProfitFileService")
+public class DepartmentProfitFileServiceImpl extends ServiceImpl<DepartmentProfitFileMapper, DepartmentProfitFile> implements DepartmentProfitFileService {
+
+
+    /**
+     * 分页查询进行报表记录
+     *
+     * @param current    当前页
+     * @param pageSize   每一页大小
+     * @param date       时间xxx-xx-xx
+     * @param reportName 报表名称
+     * @param hospId     医院Id
+     * @return
+     */
+    @Override
+    public PageUtils queryList(Integer current, Integer pageSize, String date, String reportName, Long hospId) {
+        DateTime dateTime = DateUtil.parse(date);
+        int dateYear = DateUtil.year(dateTime);
+        int month=DateUtil.month(dateTime)+1;
+        Page<DepartmentProfitFile> profitFilePage = new Page<>(current, pageSize);
+        Page<DepartmentProfitFile> pages = this.page(profitFilePage, new QueryWrapper<DepartmentProfitFile>()
+                .lambda()
+                .eq(DepartmentProfitFile::getHospId, hospId).like(StrUtil.isNotBlank(reportName), DepartmentProfitFile::getReportName, reportName)
+                .eq(StrUtil.isNotBlank(date), DepartmentProfitFile::getYear, dateYear).eq(StrUtil.isNotBlank(date), DepartmentProfitFile::getMonth, month));
+        List<DepartmentProfitFile> records = pages.getRecords();
+        List<DepartmentProfitFileVO> departmentProfitFileVOList = BeanUtil.convertList(records, DepartmentProfitFileVO.class);
+        departmentProfitFileVOList.forEach(i->{
+            i.setUpdateTime(DateUtil.format(DateUtil.date(i.getCreateTime()),"yyyy-MM-dd HH:mm:ss"));
+        });
+        PageUtils pageUtils = new PageUtils(pages);
+        pageUtils.setList(departmentProfitFileVOList);
+        return pageUtils;
+    }
+
+}

+ 1 - 1
src/main/java/com/imed/costaccount/web/CostDepartmentProfitController.java

@@ -35,7 +35,7 @@ public class CostDepartmentProfitController {
             @ApiImplicitParam(name = "current", value = "当前页", required = true),
             @ApiImplicitParam(name = "pageSize", value = "当前页大小", required = true),
             @ApiImplicitParam(name = "responsibilityCode", value = "责任中心代码", required = false),
-            @ApiImplicitParam(name = "date", value = "年月yyyy-MM-dd")
+            @ApiImplicitParam(name = "date", value = "年月yyyy-MM-dd",required = false)
     })
     public Result list(@RequestParam(value = "current", defaultValue = "1") Integer current,
                        @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,

+ 89 - 0
src/main/java/com/imed/costaccount/web/DepartmentProfitFileController.java

@@ -0,0 +1,89 @@
+package com.imed.costaccount.web;
+
+import com.imed.costaccount.common.util.PageUtils;
+import com.imed.costaccount.common.util.Result;
+import com.imed.costaccount.common.util.UserContext;
+import com.imed.costaccount.model.DepartmentProfitFile;
+import com.imed.costaccount.service.DepartmentProfitFileService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+
+
+/**
+ * 科室经营报表
+ *
+ * @author huangrui
+ * @date 2021-08-30 13:40:57
+ */
+@RestController
+@RequestMapping("/costAccount/departmentprofitfile")
+@Api(tags = "科室经营报表")
+public class DepartmentProfitFileController {
+    @Autowired
+    private DepartmentProfitFileService departmentProfitFileService;
+
+    /**
+     * 分页查询列表
+     * 查询的是
+     */
+    @GetMapping("/list")
+    @ApiOperation("查询科室经营报表记录")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "current",value = "当前页",required = true),
+            @ApiImplicitParam(name = "pageSize",value = "当前页大小",required = true),
+            @ApiImplicitParam(name = "date",value = "年月日 xxx-xx-xx",required = false),
+            @ApiImplicitParam(name = "reportName",value = "报表名称",required = false)
+    })
+    public Result list(@RequestParam(value = "current", defaultValue = "1") Integer current,
+                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
+                       @RequestParam(value = "date",required = false) String date,
+                       @RequestParam(value = "reportName",required = false) String reportName){
+        Long hospId = UserContext.getHospId();
+        PageUtils pageUtils= departmentProfitFileService.queryList(current,pageSize,date,reportName,hospId);
+        return Result.ok(pageUtils);
+    }
+
+
+    /**
+     * 信息
+     */
+    @RequestMapping("/info/{id}")
+    public Result info(@PathVariable("id") Long id){
+		DepartmentProfitFile departmentProfitFile = departmentProfitFileService.getById(id);
+        return Result.ok(departmentProfitFile);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    public Result save(@RequestBody DepartmentProfitFile departmentProfitFile){
+		departmentProfitFileService.save(departmentProfitFile);
+        return Result.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    public Result update(@RequestBody DepartmentProfitFile departmentProfitFile){
+		departmentProfitFileService.updateById(departmentProfitFile);
+        return Result.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    public Result delete(@RequestBody Long[] ids){
+		departmentProfitFileService.removeByIds(Arrays.asList(ids));
+        return Result.ok();
+    }
+
+}

+ 19 - 0
src/main/resources/mapper/DepartmentProfitFileMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.imed.costaccount.mapper.DepartmentProfitFileMapper">
+
+	<!-- 可根据自己的需求,是否要使用 -->
+    <resultMap type="com.imed.costaccount.model.DepartmentProfitFile" id="departmentProfitFileMap">
+        <result property="id" column="id"/>
+        <result property="year" column="year"/>
+        <result property="month" column="month"/>
+        <result property="reportType" column="report_type"/>
+        <result property="reportName" column="report_name"/>
+        <result property="hospId" column="hosp_id"/>
+        <result property="createTime" column="create_time"/>
+        <result property="deleteTime" column="delete_time"/>
+    </resultMap>
+
+
+</mapper>