CostCostingCollectionServiceImpl.java 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. package com.imed.costaccount.service.impl;
  2. import cn.hutool.core.util.StrUtil;
  3. import cn.hutool.poi.excel.ExcelWriter;
  4. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  5. import com.imed.costaccount.common.exception.CostException;
  6. import com.imed.costaccount.constants.NumberConstant;
  7. import com.imed.costaccount.mapper.CostCostingCollectionMapper;
  8. import com.imed.costaccount.model.CostCostingCollection;
  9. import com.imed.costaccount.model.vo.*;
  10. import com.imed.costaccount.service.CostCostingCollectionService;
  11. import com.imed.costaccount.service.CostShareLevelService;
  12. import lombok.extern.slf4j.Slf4j;
  13. import org.apache.poi.ss.usermodel.Sheet;
  14. import org.springframework.stereotype.Service;
  15. import java.util.*;
  16. import java.util.stream.Collectors;
  17. @Slf4j
  18. @Service("costCostingCollectionService")
  19. public class CostCostingCollectionServiceImpl extends ServiceImpl<CostCostingCollectionMapper, CostCostingCollection> implements CostCostingCollectionService {
  20. private final CostShareLevelService costShareLevelService;
  21. public CostCostingCollectionServiceImpl(CostShareLevelService costShareLevelService) {
  22. this.costShareLevelService = costShareLevelService;
  23. }
  24. /**
  25. * 分摊后报表输出
  26. *
  27. * @param writer
  28. * @param shareNumber
  29. * @param sheet
  30. * @return
  31. */
  32. @Override
  33. public ExcelWriter getShareReportTemplate(ExcelWriter writer, Integer shareNumber, Sheet sheet) {
  34. // 需要封装两个 分摊层级责任中心集合 目标层级责任中心
  35. // 分摊层级责任中心集合
  36. // LinkedList<SplitLevelVO> splitLevelVOLinkedList = new LinkedList<>();
  37. // // 目标层级责任中心集合
  38. // LinkedList<TargetSplitLevelVO> targetSplitLevelVOLinkedList = new LinkedList<>();
  39. // setMockData(splitLevelVOLinkedList, targetSplitLevelVOLinkedList);
  40. List<CostCostingVO> costCostingVOS = setMockDa();
  41. Map<String, List<CostCostingVO>> responsibilityMap = costCostingVOS.stream().collect(Collectors.groupingBy(CostCostingVO::getResponsibilityCode));
  42. // Map<String, String> collect = costCostingVOS.stream().collect(Collectors.toMap(CostCostingVO::getResponsibilityCode, CostCostingVO::getAccountCode));
  43. Map<String, List<CostCostingVO>> targetResponsibilityMap = costCostingVOS.stream().collect(Collectors.groupingBy(CostCostingVO::getTargetResponsibilityCode));
  44. Map<String, CostCostingVO> allAccMap = costCostingVOS.stream().collect(Collectors.toMap(k -> k.getResponsibilityName()+k.getAccountName()+k.getTargetResponsibilityName()+k.getShareParamName(), synOne -> synOne));
  45. Map<String, CostCostingVO> allAliMap = costCostingVOS.stream().collect(Collectors.toMap(k -> k.getResponsibilityName()+k.getAlias()+k.getTargetResponsibilityName()+k.getShareParamName(), synOne -> synOne));
  46. // 当前责任中心下面有几个会计科目 后面进行合并使用
  47. int numResponsibility;
  48. // 从第几列开始编写数据
  49. int column = shareNumber + 4;
  50. // 总共有多少个单元格
  51. // Integer shareLevelGrid = 0;
  52. Set<String> keySet = responsibilityMap.keySet();
  53. for (String key : keySet) {
  54. List<CostCostingVO> costCostingVOS1 = responsibilityMap.get(key);
  55. Map<String, CostCostingVO> linkedHashMap = new LinkedHashMap<>();
  56. costCostingVOS1.forEach(i -> {
  57. String s = i.getResponsibilityCode() + i.getAccountCode();
  58. if (!linkedHashMap.containsKey(s)) {
  59. linkedHashMap.put(s, i);
  60. }
  61. });
  62. numResponsibility = linkedHashMap.size();
  63. if (numResponsibility >= NumberConstant.TWO) {
  64. // 需要合并单元格
  65. // writer.merge(0, 0, column, column + numResponsibility - 1, costCostingVOS1.get(0).getResponsibilityName(), false);
  66. // 设置对应的会计科目或者别名
  67. Set<String> strings = linkedHashMap.keySet();
  68. for (String s : strings) {
  69. CostCostingVO costCostingVO = linkedHashMap.get(s);
  70. if (StrUtil.isBlank(costCostingVO.getAlias())) {
  71. writer.writeCellValue(column,0,costCostingVO.getResponsibilityName());
  72. // 别名不存在
  73. writer.writeCellValue(column, 1, costCostingVO.getAccountName());
  74. } else {
  75. // 不为空 设置别名
  76. writer.writeCellValue(column,0,costCostingVO.getResponsibilityName());
  77. writer.writeCellValue(column, 1, costCostingVO.getAlias());
  78. }
  79. writer.writeCellValue(column, 2, costCostingVO.getAmount());
  80. column++;
  81. }
  82. // for (int j=0;j<numResponsibility;j++){
  83. // CostCostingVO costCostingVO = costCostingVOS1.get(j);
  84. // if (StrUtil.isBlank(costCostingVO.getAlias())){
  85. // // 别名不存在
  86. // writer.writeCellValue(j+column,1,costCostingVO.getAccountName());
  87. // }else {
  88. // // 不为空 设置别名
  89. // writer.writeCellValue(j+column,1,costCostingVO.getAlias());
  90. // }
  91. // writer.writeCellValue(j+column,2,costCostingVO.getAmount());
  92. // }
  93. // column+=numResponsibility;
  94. } else {
  95. // 不需要合并单元格
  96. writer.writeCellValue(column, 0, costCostingVOS1.get(0).getResponsibilityName());
  97. writer.writeCellValue(column, 1, costCostingVOS1.get(0).getAccountName());
  98. writer.writeCellValue(column, 2, costCostingVOS1.get(0).getAmount());
  99. column++;
  100. }
  101. }
  102. // for (int i=0; i< responsibilityMap.size();i++){
  103. // 判断当前当成的责任中心对应的分摊参数的数量
  104. // List<CostCostingVO> costCostingVOS1 = responsibilityMap.get(responsibilityCode);
  105. // numResponsibility=costCostingVOS1.size();
  106. // shareLevelGrid+=numResponsibility;
  107. // if (numResponsibility>= NumberConstant.TWO){
  108. // writer.merge(0,0,column,column+numResponsibility-1,costCostingVOS1.get(0).getResponsibilityName(),false);
  109. // // 设置对应的会计科目或者金额
  110. // for (int j=0;j<numResponsibility;j++){
  111. // CostCostingVO costCostingVO = costCostingVOS1.get(j);
  112. // if (StrUtil.isBlank(costCostingVO.getAlias())){
  113. // // 别名不存在的时候
  114. // writer.writeCellValue(j+column,1,costCostingVO.getAccountName());
  115. // }else {
  116. // // 为空的话设置别名
  117. // writer.writeCellValue(j+column,1,costCostingVO.getAlias());
  118. // }
  119. // writer.writeCellValue(j+column,2,costCostingVO.getAccountName());
  120. // }
  121. // column+=numResponsibility;
  122. // }else {
  123. // writer.writeCellValue(column,0,costCostingVOS1.get(0).getResponsibilityName());
  124. // writer.writeCellValue(column,1,costCostingVOS1.get(0).getAccountName());
  125. // writer.writeCellValue(column,2,costCostingVOS1.get(0).getMoney());
  126. // column++;
  127. // }
  128. // }
  129. // 设置单元格合并
  130. for (int j = 1; j <= shareNumber; j++) {
  131. writer.merge(0, 1, j, j, "第" + j + "次分摊", false);
  132. }
  133. // 目标责任集合
  134. writer.passCurrentRow();
  135. // 从第三行开始
  136. int num = 3;
  137. Set<String> targetSet = targetResponsibilityMap.keySet();
  138. for (String target : targetSet) {
  139. List<CostCostingVO> costCostingVOS1 = targetResponsibilityMap.get(target);
  140. Map<String, CostCostingVO> linkedHashMap = new LinkedHashMap<>();
  141. costCostingVOS1.forEach(i -> {
  142. String s = i.getTargetResponsibilityCode() + i.getShareParamName();
  143. if (!linkedHashMap.containsKey(s)) {
  144. linkedHashMap.put(s, i);
  145. }
  146. });
  147. int shareParamSize = linkedHashMap.size();
  148. if (shareParamSize >= NumberConstant.TWO) {
  149. // 责任中心
  150. CostCostingVO costCostingVO = costCostingVOS1.get(0);
  151. // writer.merge(num, num + shareParamSize - 1, 0, 0, costCostingVO.getTargetResponsibilityName(), false);
  152. // 设置第几次分摊的值
  153. for (int k = 0; k < shareNumber; k++) {
  154. writer.merge(num, num + shareParamSize - 1, k + 1, k + 1, costCostingVO.getTargetShareMoneys().get(k), false);
  155. }
  156. // 设置对应的分摊参数值
  157. Set<String> strings = linkedHashMap.keySet();
  158. for (String s : strings) {
  159. CostCostingVO costCostingVO1 = linkedHashMap.get(s);
  160. writer.writeCellValue(0,num,costCostingVO1.getTargetResponsibilityName());
  161. writer.writeCellValue(shareNumber + 1, num, costCostingVO1.getShareParamName());
  162. writer.writeCellValue(shareNumber + 2, num, costCostingVO1.getShareValue());
  163. writer.writeCellValue(shareNumber + 3, num, costCostingVO1.getShareParamProportion());
  164. for (int m=shareNumber+4;m<column;m++){
  165. // x是m y是num
  166. // 获取当前这一列对应的责任中心 以及会计科目
  167. // 第一行责任中心
  168. String responsibilityName = sheet.getRow(0).getCell(m).getStringCellValue();
  169. // 第二行的会计科目或者
  170. String accountNameOrAlias = sheet.getRow(1).getCell(m).getStringCellValue();
  171. // 这一行的目标责任中心
  172. String otherResponsibilityName = sheet.getRow(num).getCell(0).getStringCellValue();
  173. // 分摊参数
  174. String shareName = sheet.getRow(num).getCell(shareNumber + 1).getStringCellValue();
  175. CostCostingVO costCostingVO2 = allAccMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
  176. CostCostingVO costCostingVO3 = allAliMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
  177. if (Objects.nonNull(costCostingVO2)){
  178. writer.writeCellValue(m,num,costCostingVO2.getMoney());
  179. }else if (Objects.nonNull(costCostingVO3)){
  180. writer.writeCellValue(m,num,costCostingVO3.getMoney());
  181. }else {
  182. throw new CostException(500,"数据异常");
  183. }
  184. // 第二行的会计科目/别名
  185. // System.out.println(responsibilityName+"--"+accountNameOrAlias+"--"+otherResponsibilityName+"--"+shareName);
  186. }
  187. num++;
  188. }
  189. }
  190. if (shareParamSize < NumberConstant.TWO) {
  191. writer.writeCellValue(0, num, costCostingVOS1.get(0).getTargetResponsibilityName());
  192. for (int k = 0; k < shareNumber; k++) {
  193. writer.writeCellValue(k + 1, num, costCostingVOS1.get(0).getTargetShareMoneys().get(k));
  194. }
  195. writer.writeCellValue(shareNumber + 1, num, costCostingVOS1.get(0).getShareParamName());
  196. writer.writeCellValue(shareNumber + 2, num, costCostingVOS1.get(0).getShareValue());
  197. writer.writeCellValue(shareNumber + 3, num, costCostingVOS1.get(0).getShareParamProportion());
  198. //TODO 金额没有写
  199. for (int m=shareNumber+4;m<column;m++){
  200. // x是m y是num
  201. // 获取当前这一列对应的责任中心 以及会计科目
  202. // 第一行责任中心
  203. String responsibilityName = sheet.getRow(0).getCell(m).getStringCellValue();
  204. // 第二行的会计科目或者
  205. String accountNameOrAlias = sheet.getRow(1).getCell(m).getStringCellValue();
  206. // 这一行的目标责任中心
  207. String otherResponsibilityName = sheet.getRow(num).getCell(0).getStringCellValue();
  208. // 分摊参数
  209. String shareName = sheet.getRow(num).getCell(shareNumber + 1).getStringCellValue();
  210. CostCostingVO costCostingVO2 = allAccMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
  211. CostCostingVO costCostingVO3 = allAliMap.get(responsibilityName + accountNameOrAlias + otherResponsibilityName + shareName);
  212. if (Objects.nonNull(costCostingVO2)){
  213. writer.writeCellValue(m,num,costCostingVO2.getMoney());
  214. }else if (Objects.nonNull(costCostingVO3)){
  215. writer.writeCellValue(m,num,costCostingVO3.getMoney());
  216. }else {
  217. throw new CostException(500,"数据异常");
  218. }
  219. // 第二行的会计科目/别名
  220. System.out.println(responsibilityName+"--"+accountNameOrAlias+"--"+otherResponsibilityName+"--"+shareName);
  221. }
  222. num++;
  223. }
  224. }
  225. // for (int j=0;j<targetResponsibilityList.size();j++){
  226. // String targetResponsibilityCode = targetResponsibilityList.get(j);
  227. // // 需要判断是否需要合并单元格
  228. // List<CostCostingVO> costingVOList = targetResponsibilityMap.get(targetResponsibilityCode);
  229. // // 当前责任中心下面有多少个分摊参数
  230. // int shareParamSize=costingVOList.size();
  231. // if (shareParamSize>=NumberConstant.TWO){
  232. // //设置责任中心
  233. // CostCostingVO costCostingVO = costingVOList.get(0);
  234. // writer.merge(j+num,j+num+shareParamSize-1,0,0,costCostingVO.getResponsibilityName(),false);
  235. // // 设置第一次分摊参数值
  236. // for (int k=0;k<shareNumber;k++){
  237. // writer.merge(j+num,j+num+shareParamSize-1,k+1,k+1,costCostingVO.getTargetShareMoneys().get(k),false);
  238. //
  239. // }
  240. // // 设置对应的分摊参数值
  241. // for (int i=0;i<shareParamSize;i++){
  242. // // 设置分摊参数
  243. // CostCostingVO costCostingVO1 = costingVOList.get(i);
  244. // int row=j+num+i;
  245. // writer.writeCellValue(shareNumber+1,row,costCostingVO1.getShareParamName());
  246. // writer.writeCellValue(shareNumber+2,row,costCostingVO1.getShareValue());
  247. // writer.writeCellValue(shareNumber+3,row,costCostingVO1.getShareParamProportion());
  248. // //TODO 金额没有写
  249. //// for (int k=shareNumber+4;k<shareLevelGrid+6;k++){
  250. //// writer.writeCellValue(k,row,"0.1111");
  251. //// }
  252. // }
  253. //
  254. // }
  255. // num+=shareParamSize-1;
  256. // if (shareParamSize<NumberConstant.TWO){
  257. // writer.writeCellValue(0, j + num, costingVOList.get(0).getResponsibilityName());
  258. // for (int k=0;k<shareNumber;k++){
  259. // writer.merge(j+num,j+num+shareParamSize-1,k+1,k+1,costingVOList.get(0).getTargetShareMoneys().get(k),false);
  260. // }
  261. // writer.writeCellValue(shareNumber+1,j+num,costingVOList.get(0).getShareParamName());
  262. // writer.writeCellValue(shareNumber+2,j+num,costingVOList.get(0).getShareValue());
  263. // writer.writeCellValue(shareNumber+3,j+num,costingVOList.get(0).getShareParamProportion());
  264. // // TODO 金额暂时不设置
  265. //// for (int k=shareNumber+4;k<shareLevelGrid+6;k++){
  266. //// writer.writeCellValue(k,j+num,"0.3456");
  267. //// }
  268. // }
  269. //
  270. // }
  271. // TODO 统一设置列宽 处理中文问题
  272. for (int i = 0; i < 30; i++) {
  273. // 调整每一列宽度
  274. sheet.autoSizeColumn((short) i);
  275. // 解决自动设置列宽中文失效的问题
  276. sheet.setColumnWidth(i, sheet.getColumnWidth(i) * 13 / 10);
  277. }
  278. // todo 合并单元格
  279. return writer;
  280. }
  281. // private void setMockData(LinkedList<SplitLevelVO> splitLevelVOLinkedList, LinkedList<TargetSplitLevelVO> targetSplitLevelVOLinkedList) {
  282. // // 设置分摊层级责任中心数据
  283. // SplitLevelVO splitLevelVO = new SplitLevelVO();
  284. // splitLevelVO.setResponsibilityName("责任中心1");
  285. // splitLevelVO.setResponsibilityCode("zr1");
  286. // LinkedList<ResponsibilityAccountVO> responsibilityAccountVOS = new LinkedList<>();
  287. //
  288. // ResponsibilityAccountVO responsibilityAccountVO = new ResponsibilityAccountVO();
  289. // responsibilityAccountVO.setAccountingNames("其他费用,资产改良及摊销");
  290. // responsibilityAccountVO.setAccountingCodes("1825,1824");
  291. // responsibilityAccountVO.setAccountingIds("57,56");
  292. // responsibilityAccountVO.setMoney("12.6666");
  293. // responsibilityAccountVOS.add(responsibilityAccountVO);
  294. //
  295. // ResponsibilityAccountVO responsibilityAccountVORequest = new ResponsibilityAccountVO();
  296. // responsibilityAccountVORequest.setAccountingNames("低值易耗品");
  297. // responsibilityAccountVORequest.setAccountingCodes("1822");
  298. // responsibilityAccountVORequest.setAccountingIds("54");
  299. // responsibilityAccountVORequest.setAlias("设置了别名");
  300. // responsibilityAccountVORequest.setMoney("12.1111");
  301. // responsibilityAccountVOS.add(responsibilityAccountVORequest);
  302. // splitLevelVO.setResponsibilityAccountVOList(responsibilityAccountVOS);
  303. // splitLevelVOLinkedList.add(splitLevelVO);
  304. //
  305. // SplitLevelVO splitLevelVO1 = new SplitLevelVO();
  306. // splitLevelVO1.setResponsibilityName("责任中心2");
  307. // splitLevelVO1.setResponsibilityCode("zr2");
  308. // LinkedList<ResponsibilityAccountVO> responsibilityAccountVOS1 = new LinkedList<>();
  309. // ResponsibilityAccountVO responsibilityAccountVORequest1 = new ResponsibilityAccountVO();
  310. // responsibilityAccountVORequest1.setAccountingNames("低值易耗品");
  311. // responsibilityAccountVORequest1.setAccountingCodes("1822");
  312. // responsibilityAccountVORequest1.setAccountingIds("54");
  313. // responsibilityAccountVORequest1.setAlias("设置的别名");
  314. // responsibilityAccountVORequest1.setMoney("12.1111");
  315. // responsibilityAccountVOS1.add(responsibilityAccountVORequest1);
  316. // splitLevelVO1.setResponsibilityAccountVOList(responsibilityAccountVOS1);
  317. // splitLevelVOLinkedList.add(splitLevelVO1);
  318. //
  319. // TargetSplitLevelVO targetSplitLevelVO = new TargetSplitLevelVO();
  320. // targetSplitLevelVO.setResponsibilityCode("zr1");
  321. // targetSplitLevelVO.setResponsibilityName("责任中心1");
  322. // targetSplitLevelVO.setOneShareMoney("100.1111");
  323. // targetSplitLevelVO.setTwoShareMoney("200.1111");
  324. // targetSplitLevelVO.setThreeShareMoney("300.1111");
  325. // LinkedList<TargetShareParamValue> targetShareParamValueLinkedList = new LinkedList<>();
  326. // TargetShareParamValue targetShareParamValue = new TargetShareParamValue();
  327. // targetShareParamValue.setShareParamName("员工费");
  328. // targetShareParamValue.setShareParamCode("A11");
  329. // targetShareParamValue.setShareParamValue("66");
  330. // targetShareParamValue.setShareParamProportion("0.1111");
  331. // targetShareParamValueLinkedList.add(targetShareParamValue);
  332. // TargetShareParamValue targetShareParamValueRequest = new TargetShareParamValue();
  333. // targetShareParamValueRequest.setShareParamName("医疗收入");
  334. // targetShareParamValueRequest.setShareParamCode("A22");
  335. // targetShareParamValueRequest.setShareParamValue("77");
  336. // targetShareParamValueRequest.setShareParamProportion("0.4444");
  337. // targetShareParamValueLinkedList.add(targetShareParamValueRequest);
  338. // targetSplitLevelVO.setTargetShareParamValueList(targetShareParamValueLinkedList);
  339. // targetSplitLevelVOLinkedList.add(targetSplitLevelVO);
  340. //
  341. // TargetSplitLevelVO targetSplitLevelVORequest = new TargetSplitLevelVO();
  342. // targetSplitLevelVORequest.setResponsibilityCode("zr2");
  343. // targetSplitLevelVORequest.setResponsibilityName("责任中心2");
  344. // targetSplitLevelVORequest.setOneShareMoney("102.1111");
  345. // targetSplitLevelVORequest.setTwoShareMoney("202.1111");
  346. // targetSplitLevelVORequest.setThreeShareMoney("300.1111");
  347. // LinkedList<TargetShareParamValue> targetShareParamValueLinkedList1 = new LinkedList<>();
  348. // TargetShareParamValue targetShareParamValue1 = new TargetShareParamValue();
  349. // targetShareParamValue1.setShareParamName("水费");
  350. // targetShareParamValue1.setShareParamCode("A66");
  351. // targetShareParamValue1.setShareParamValue("777");
  352. // targetShareParamValue1.setShareParamProportion("0.777");
  353. // targetShareParamValueLinkedList1.add(targetShareParamValue1);
  354. // targetSplitLevelVORequest.setTargetShareParamValueList(targetShareParamValueLinkedList1);
  355. // targetSplitLevelVOLinkedList.add(targetSplitLevelVORequest);
  356. //
  357. // }
  358. private List<CostCostingVO> setMockDa() {
  359. List<CostCostingVO> costCostingVOS = new LinkedList<>();
  360. CostCostingVO costCostingVO = new CostCostingVO();
  361. costCostingVO.setResponsibilityCode("zr1");
  362. costCostingVO.setResponsibilityName("责任中心1");
  363. costCostingVO.setAccountCode("A11");
  364. costCostingVO.setAccountName("人事费用");
  365. costCostingVO.setAmount("800");
  366. costCostingVO.setTargetResponsibilityCode("tzr1");
  367. costCostingVO.setTargetResponsibilityName("目标责任中心1");
  368. List<String> strings = new ArrayList<>();
  369. strings.add("1000");
  370. strings.add("2000");
  371. costCostingVO.setTargetShareMoneys(strings);
  372. costCostingVO.setShareParamName("员工数");
  373. costCostingVO.setShareValue("3");
  374. costCostingVO.setShareParamProportion("0.3344");
  375. costCostingVO.setMoney("5.28");
  376. costCostingVOS.add(costCostingVO);
  377. CostCostingVO costCostingVO1 = new CostCostingVO();
  378. costCostingVO1.setResponsibilityCode("zr1");
  379. costCostingVO1.setResponsibilityName("责任中心1");
  380. // 会计科目可能为空
  381. costCostingVO1.setAccountCode("A12");
  382. costCostingVO1.setAccountName("其他费用");
  383. costCostingVO1.setAmount("600");
  384. costCostingVO1.setAlias("设置的别名");
  385. costCostingVO1.setTargetResponsibilityCode("tzr1");
  386. costCostingVO1.setTargetResponsibilityName("目标责任中心1");
  387. List<String> strings1 = new ArrayList<>();
  388. strings1.add("1000");
  389. strings1.add("2000");
  390. costCostingVO1.setTargetShareMoneys(strings);
  391. costCostingVO1.setShareParamName("员工数");
  392. costCostingVO1.setShareValue("3");
  393. costCostingVO1.setShareParamProportion("0.3344");
  394. costCostingVO1.setMoney("0.88");
  395. costCostingVOS.add(costCostingVO1);
  396. CostCostingVO costCostingVO2 = new CostCostingVO();
  397. costCostingVO2.setResponsibilityCode("zr1");
  398. costCostingVO2.setResponsibilityName("责任中心1");
  399. // 会计科目可能为空
  400. costCostingVO2.setAccountCode("A11");
  401. costCostingVO2.setAccountName("人事费用");
  402. costCostingVO2.setAmount("800");
  403. costCostingVO2.setTargetResponsibilityCode("tzr1");
  404. costCostingVO2.setTargetResponsibilityName("目标责任中心1");
  405. List<String> strings2 = new ArrayList<>();
  406. strings2.add("1000");
  407. strings2.add("2000");
  408. costCostingVO2.setTargetShareMoneys(strings);
  409. costCostingVO2.setShareParamName("医疗收入");
  410. costCostingVO2.setShareValue("95");
  411. costCostingVO2.setShareParamProportion("0.19");
  412. costCostingVO2.setMoney("0.55");
  413. costCostingVOS.add(costCostingVO2);
  414. CostCostingVO costCostingVO3 = new CostCostingVO();
  415. costCostingVO3.setResponsibilityCode("zr1");
  416. costCostingVO3.setResponsibilityName("责任中心1");
  417. costCostingVO3.setAccountCode("A12");
  418. costCostingVO3.setAccountName("其他费用");
  419. costCostingVO3.setAmount("600");
  420. costCostingVO3.setAlias("设置的别名");
  421. costCostingVO3.setTargetResponsibilityCode("tzr1");
  422. costCostingVO3.setTargetResponsibilityName("目标责任中心1");
  423. List<String> strings3 = new ArrayList<>();
  424. strings3.add("1000");
  425. strings3.add("2000");
  426. costCostingVO3.setTargetShareMoneys(strings);
  427. costCostingVO3.setShareParamName("医疗收入");
  428. costCostingVO3.setShareValue("95");
  429. costCostingVO3.setShareParamProportion("0.19");
  430. costCostingVO3.setMoney("0.44");
  431. costCostingVOS.add(costCostingVO3);
  432. CostCostingVO costCostingVO5 = new CostCostingVO();
  433. costCostingVO5.setResponsibilityCode("zr2");
  434. costCostingVO5.setResponsibilityName("责任中心2");
  435. costCostingVO5.setAccountCode("A13");
  436. costCostingVO5.setAccountName("责任费用");
  437. costCostingVO5.setAmount("900");
  438. costCostingVO5.setTargetResponsibilityCode("tzr2");
  439. costCostingVO5.setTargetResponsibilityName("目标责任中心2");
  440. List<String> strings5 = new ArrayList<>();
  441. strings5.add("1000");
  442. strings5.add("2000");
  443. costCostingVO5.setTargetShareMoneys(strings5);
  444. costCostingVO5.setShareParamName("麻醉科收入");
  445. costCostingVO5.setShareValue("100");
  446. costCostingVO5.setShareParamProportion("0.188");
  447. costCostingVO5.setMoney("1.11");
  448. costCostingVOS.add(costCostingVO5);
  449. CostCostingVO costCostingVO6 = new CostCostingVO();
  450. costCostingVO6.setResponsibilityCode("zr1");
  451. costCostingVO6.setResponsibilityName("责任中心1");
  452. // 会计科目可能为空
  453. costCostingVO6.setAccountCode("A11");
  454. costCostingVO6.setAccountName("人事费用");
  455. costCostingVO6.setAmount("800");
  456. costCostingVO6.setTargetResponsibilityCode("tzr2");
  457. costCostingVO6.setTargetResponsibilityName("目标责任中心2");
  458. List<String> strings6 = new ArrayList<>();
  459. strings6.add("1000");
  460. strings6.add("2000");
  461. costCostingVO6.setTargetShareMoneys(strings6);
  462. costCostingVO6.setShareParamName("麻醉科收入");
  463. costCostingVO6.setShareValue("100");
  464. costCostingVO6.setShareParamProportion("0.18");
  465. costCostingVO6.setMoney("0.33");
  466. costCostingVOS.add(costCostingVO6);
  467. CostCostingVO costCostingVO7 = new CostCostingVO();
  468. costCostingVO7.setResponsibilityCode("zr1");
  469. costCostingVO7.setResponsibilityName("责任中心1");
  470. costCostingVO7.setAccountCode("A12");
  471. costCostingVO7.setAccountName("其他费用");
  472. costCostingVO7.setAmount("600");
  473. costCostingVO7.setAlias("设置的别名");
  474. costCostingVO7.setTargetResponsibilityCode("tzr2");
  475. costCostingVO7.setTargetResponsibilityName("目标责任中心2");
  476. List<String> strings7 = new ArrayList<>();
  477. strings7.add("1000");
  478. strings7.add("2000");
  479. costCostingVO7.setTargetShareMoneys(strings);
  480. costCostingVO7.setShareParamName("麻醉科收入");
  481. costCostingVO7.setShareValue("100");
  482. costCostingVO7.setShareParamProportion("0.18");
  483. costCostingVO7.setMoney("0.22");
  484. costCostingVOS.add(costCostingVO7);
  485. CostCostingVO costCostingVO8 = new CostCostingVO();
  486. costCostingVO8.setResponsibilityCode("zr2");
  487. costCostingVO8.setResponsibilityName("责任中心2");
  488. costCostingVO8.setAccountCode("A13");
  489. costCostingVO8.setAccountName("责任费用");
  490. costCostingVO8.setAmount("900");
  491. costCostingVO8.setTargetResponsibilityCode("tzr1");
  492. costCostingVO8.setTargetResponsibilityName("目标责任中心1");
  493. List<String> strings8 = new ArrayList<>();
  494. strings8.add("1000");
  495. strings8.add("2000");
  496. costCostingVO8.setTargetShareMoneys(strings8);
  497. costCostingVO8.setShareParamName("员工数");
  498. costCostingVO8.setShareValue("3");
  499. costCostingVO8.setShareParamProportion("0.3344");
  500. costCostingVO8.setMoney("1.55");
  501. costCostingVOS.add(costCostingVO8);
  502. CostCostingVO costCostingVO9 = new CostCostingVO();
  503. costCostingVO9.setResponsibilityCode("zr2");
  504. costCostingVO9.setResponsibilityName("责任中心2");
  505. costCostingVO9.setAccountCode("A13");
  506. costCostingVO9.setAccountName("责任费用");
  507. costCostingVO9.setAmount("900");
  508. costCostingVO9.setTargetResponsibilityCode("tzr1");
  509. costCostingVO9.setTargetResponsibilityName("目标责任中心1");
  510. List<String> strings9 = new ArrayList<>();
  511. strings9.add("1000");
  512. strings9.add("2000");
  513. costCostingVO9.setTargetShareMoneys(strings9);
  514. costCostingVO9.setShareParamName("医疗收入");
  515. costCostingVO9.setShareValue("95");
  516. costCostingVO9.setShareParamProportion("0.19");
  517. costCostingVO9.setMoney("2.66");
  518. costCostingVOS.add(costCostingVO9);
  519. return costCostingVOS;
  520. }
  521. /**
  522. * 科室
  523. */
  524. }