|
@@ -1,14 +1,540 @@
|
|
|
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 {
|
|
|
|
|
|
+ private final CostShareLevelService costShareLevelService;
|
|
|
|
|
|
+ public CostCostingCollectionServiceImpl(CostShareLevelService costShareLevelService) {
|
|
|
+ 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())){
|
|
|
+// // 别名不存在
|
|
|
+// 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 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);
|
|
|
+ }
|
|
|
+ // 设置对应的分摊参数值
|
|
|
+ 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<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);
|
|
|
+
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 科室
|
|
|
+ */
|
|
|
}
|