WzHouseMaintenaCostController.java 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  1. package com.example.controller.gdc;
  2. import com.example.config.annotation.IgnoreAuth;
  3. import com.example.pojo.gdc.OtnAreaEntity;
  4. import com.example.pojo.gdc.WzHouseMaintEntity;
  5. import com.example.service.gdc.WzHouseMaintService;
  6. import com.example.service.gdc.WzHouseMaintenaCostService;
  7. import com.example.service.gdc.WzOtnAreaService;
  8. import com.example.utils.excel.ExcelExport;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.web.bind.annotation.GetMapping;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.RestController;
  13. import javax.servlet.http.HttpServletResponse;
  14. import java.math.BigDecimal;
  15. import java.text.DateFormat;
  16. import java.text.SimpleDateFormat;
  17. import java.util.ArrayList;
  18. import java.util.Date;
  19. import java.util.HashMap;
  20. import java.util.List;
  21. import java.util.Map;
  22. @RestController
  23. @RequestMapping("/house-car/house/dist/api/wzHouseMaintenaCost")
  24. public class WzHouseMaintenaCostController {
  25. @Autowired
  26. private WzOtnAreaService otnAreaService;
  27. @Autowired
  28. private WzHouseMaintenaCostService wzHouseMaintenaCostService;
  29. @Autowired
  30. private WzHouseMaintService wzHouseMaintService;
  31. // @Autowired
  32. // private WzStrategyService wzStrategyService;
  33. // /**
  34. // * 查看列表
  35. // */
  36. // @RequestMapping("/list")
  37. // @IgnoreAuth
  38. // public R list(@RequestBody PageMap pageMap) {
  39. // //查询列表数据
  40. // Query query = new Query(pageMap);
  41. // List<WzHouseMaintenaCostEntity> resultList = wzHouseMaintenaCostService.queryList(query);
  42. // Query query1 = new Query(pageMap);
  43. // int total = wzHouseMaintenaCostService.queryTotal(query1);
  44. // PageUtils pageUtil = new PageUtils(resultList, total, query.getLimit(), query.getPage());
  45. // return R.ok().put("page", pageUtil);
  46. // }
  47. // /**
  48. // * 查看列表
  49. // */
  50. // @RequestMapping("/list1")
  51. // @IgnoreAuth
  52. // public R list1(@RequestBody PageMap pageMap) {
  53. // //查询列表数据
  54. // Query query = new Query(pageMap);
  55. // List<WzHouseMaintenaCostEntity> resultList = wzHouseMaintenaCostService.queryList1(query);
  56. // //每平方米维修单价
  57. // for (WzHouseMaintenaCostEntity wzHouseMaintenaCostEntity : resultList) {
  58. // wzHouseMaintenaCostEntity.setAveragePrice(formatDouble(wzHouseMaintenaCostEntity.getAveragePrice()));
  59. // }
  60. // Query query1 = new Query(pageMap);
  61. // int total = wzHouseMaintenaCostService.queryTotal1(query1);
  62. // PageUtils pageUtil = new PageUtils(resultList, total, query.getLimit(), query.getPage());
  63. // return R.ok().put("page", pageUtil);
  64. // }
  65. // @RequestMapping("/queryVoList")
  66. // @IgnoreAuth
  67. // public R queryVoList(@RequestBody PageMap pageMap) {
  68. // //查询列表数据
  69. // Query query = new Query(pageMap);
  70. // List<WzHouseMaintenaCostEntity> resultList = wzHouseMaintenaCostService.queryList(query);
  71. // int total = wzHouseMaintenaCostService.queryTotal(query);
  72. // PageUtils pageUtil = new PageUtils(resultList, total, query.getLimit(), query.getPage());
  73. // return R.ok().put("page", pageUtil);
  74. // }
  75. // @RequestMapping("/queryEchart")
  76. // @IgnoreAuth
  77. // public R queryEchart(@RequestBody PageMap pageMap) {
  78. // //查询列表数据
  79. // List<WzHouseMaintenaCostEntity> alllist = wzHouseMaintenaCostService.queryList1(pageMap.getMap());
  80. // //全省节点
  81. // HouseCostVo province = new HouseCostVo();
  82. // province.setCounty("全省");
  83. // province.setCity("全省");
  84. //
  85. // double aProjectCost = 0l;
  86. // double aSmallCost = 0l;
  87. // double aWarnCost = 0l;
  88. // double aProCost = 0l;
  89. // double aOtherCost = 0l;
  90. // double aAllCost = 0l;
  91. // //按地市进行划分
  92. // Map<String, List<WzHouseMaintenaCostEntity>> cityMap = new HashMap<>();
  93. // for (WzHouseMaintenaCostEntity entity : alllist) {
  94. // if (entity.getCity() == null) continue;
  95. // List<WzHouseMaintenaCostEntity> list;
  96. // if (cityMap.get(entity.getCity()) != null) {
  97. // list = cityMap.get(entity.getCity());
  98. // list.add(entity);
  99. // } else {
  100. // list = new ArrayList<>();
  101. // list.add(entity);
  102. // }
  103. // cityMap.put(entity.getCity(), list);
  104. // }
  105. // //按区进行划分
  106. // List<HouseCostVo> resultList = new ArrayList<>();
  107. // List<HouseCostVo> cityList = new ArrayList<>();
  108. // for (Map.Entry<String, List<WzHouseMaintenaCostEntity>> entry : cityMap.entrySet()) {
  109. // List<WzHouseMaintenaCostEntity> list = entry.getValue();
  110. // //县的Map集合
  111. // Map<String, List<WzHouseMaintenaCostEntity>> countyMap = new HashMap<>();
  112. // for (WzHouseMaintenaCostEntity leaveUseVo : list) {
  113. // if (countyMap.get(leaveUseVo.getCounty()) != null) {
  114. // list = countyMap.get(leaveUseVo.getCounty());
  115. // list.add(leaveUseVo);
  116. // } else {
  117. // list = new ArrayList<>();
  118. // list.add(leaveUseVo);
  119. // }
  120. // countyMap.put(leaveUseVo.getCounty(), list);
  121. // }
  122. //
  123. // List<HouseCostVo> countyList = new ArrayList<>();
  124. // double cityProjectCost = 0l;
  125. // double citySmallCost = 0l;
  126. // double cityWarnCost = 0l;
  127. // double cityProCost = 0l;
  128. // double cityOtherCost = 0l;
  129. // double cityAllCost = 0l;
  130. // for (Map.Entry<String, List<WzHouseMaintenaCostEntity>> countyEntry : countyMap.entrySet()) {
  131. // double projectCost = 0l;
  132. // double smallCost = 0l;
  133. // double warnCost = 0l;
  134. // double proCost = 0l;
  135. // double otherCost = 0l;
  136. // double allCost = 0l;
  137. //
  138. // HouseCostVo county = new HouseCostVo();
  139. // for (WzHouseMaintenaCostEntity leaveUseVo : countyEntry.getValue()) {
  140. // county.setCity(leaveUseVo.getCounty());
  141. // if (leaveUseVo.getRepairType().equals("项目制维修")) {
  142. // projectCost += leaveUseVo.getErpCreditedAmount();
  143. // cityProjectCost += leaveUseVo.getErpCreditedAmount();
  144. // aProjectCost += leaveUseVo.getErpCreditedAmount();
  145. // allCost +=leaveUseVo.getErpCreditedAmount();
  146. // cityAllCost +=leaveUseVo.getErpCreditedAmount();
  147. // aAllCost +=leaveUseVo.getErpCreditedAmount();
  148. // } else if (leaveUseVo.getRepairType().equals("零星维修")) {
  149. // smallCost += leaveUseVo.getErpCreditedAmount();
  150. // citySmallCost += leaveUseVo.getErpCreditedAmount();
  151. // aSmallCost += leaveUseVo.getErpCreditedAmount();
  152. // allCost +=leaveUseVo.getErpCreditedAmount();
  153. // cityAllCost +=leaveUseVo.getErpCreditedAmount();
  154. // aAllCost +=leaveUseVo.getErpCreditedAmount();
  155. // } else if (leaveUseVo.getRepairType().equals("应急维修")) {
  156. // warnCost += leaveUseVo.getErpCreditedAmount();
  157. // cityWarnCost += leaveUseVo.getErpCreditedAmount();
  158. // aWarnCost += leaveUseVo.getErpCreditedAmount();
  159. // allCost +=leaveUseVo.getErpCreditedAmount();
  160. // cityAllCost +=leaveUseVo.getErpCreditedAmount();
  161. // aAllCost +=leaveUseVo.getErpCreditedAmount();
  162. // } else if (leaveUseVo.getRepairType().equals("安防费用")) {
  163. // proCost += leaveUseVo.getErpCreditedAmount();
  164. // cityProCost += leaveUseVo.getErpCreditedAmount();
  165. // aProCost += leaveUseVo.getErpCreditedAmount();
  166. // allCost +=leaveUseVo.getErpCreditedAmount();
  167. // cityAllCost +=leaveUseVo.getErpCreditedAmount();
  168. // aAllCost +=leaveUseVo.getErpCreditedAmount();
  169. // } else {
  170. // if(leaveUseVo.getRepairType().contains("预提冲销")){
  171. // continue;
  172. // }
  173. // otherCost += leaveUseVo.getErpCreditedAmount();
  174. // cityOtherCost += leaveUseVo.getErpCreditedAmount();
  175. // aOtherCost += leaveUseVo.getErpCreditedAmount();
  176. // }
  177. //// allCost += projectCost + smallCost + warnCost + proCost + otherCost;
  178. //// cityAllCost += cityProjectCost + citySmallCost + cityWarnCost + cityProCost + cityOtherCost;
  179. //// aAllCost += aProjectCost + aSmallCost + aWarnCost + aProCost + aOtherCost;
  180. //
  181. // }
  182. // county.setProjectCost(formatDouble(projectCost));
  183. // county.setProCost(formatDouble(proCost));
  184. // county.setOtherCost(formatDouble(otherCost));
  185. // county.setSmallCost(formatDouble(smallCost));
  186. // county.setWarnCost(formatDouble(warnCost));
  187. // county.setAllCost(formatDouble(allCost));
  188. // countyList.add(county);
  189. // }
  190. //
  191. // List<HouseCostVo> orderCountyList = new ArrayList<>();
  192. // try {
  193. // //对countList 进行排序
  194. // String city = list.get(0).getCity();
  195. // if (city.contains("市")) {
  196. // city = city.split("市")[0];
  197. // }
  198. // OtnAreaEntity area = otnAreaService.queryObject(city);
  199. // List<OtnAreaEntity> countyAreaList = otnAreaService.getCityOption(area.getId());
  200. // int i=0;
  201. // for (OtnAreaEntity otnAreaEntity : countyAreaList) {
  202. // for (HouseCostVo wzCity : countyList) {
  203. // if (otnAreaEntity.getName().equals(wzCity.getCity())) {
  204. // i++;
  205. // wzCity.setFlag(i%2==0);
  206. // orderCountyList.add(wzCity);
  207. // }
  208. // }
  209. // }
  210. // } catch (Exception e) {
  211. // orderCountyList = countyList;
  212. // e.printStackTrace();
  213. // }
  214. //
  215. // HouseCostVo parent = new HouseCostVo();
  216. // parent.setProCost(formatDouble(cityProCost));
  217. // parent.setWarnCost(formatDouble(cityWarnCost));
  218. // parent.setProjectCost(formatDouble(cityProjectCost));
  219. // parent.setOtherCost(formatDouble(cityOtherCost));
  220. // parent.setSmallCost(formatDouble(citySmallCost));
  221. // parent.setAllCost(formatDouble(cityAllCost));
  222. // parent.setCity(list.get(0).getCity());
  223. // parent.setChildren(orderCountyList);
  224. // cityList.add(parent);
  225. // }
  226. //
  227. // //对cityList 进行排序
  228. // List<OtnAreaEntity> areaList = otnAreaService.getCityOption("018");
  229. // List<HouseCostVo> orderList = new ArrayList<>();
  230. // int i=0;
  231. // for (OtnAreaEntity otnAreaEntity : areaList) {
  232. // for (HouseCostVo wzCity : cityList) {
  233. // if (wzCity.getCity().contains(otnAreaEntity.getName())) {
  234. // wzCity.setFlag(i%2==0);
  235. // orderList.add(wzCity);
  236. // i++;
  237. // }
  238. // }
  239. // }
  240. //
  241. // province.setChildren(orderList);
  242. // province.setAllCost(formatDouble(aAllCost));
  243. // province.setSmallCost(formatDouble(aSmallCost));
  244. // province.setOtherCost(formatDouble(aOtherCost));
  245. // province.setProjectCost(formatDouble(aProjectCost));
  246. // province.setProCost(formatDouble(aProCost));
  247. // province.setWarnCost(formatDouble(aWarnCost));
  248. // resultList.add(province);
  249. //
  250. // PageUtils pageUtil = new PageUtils(resultList, 0, 10, 10);
  251. // return R.ok().put("page", pageUtil);
  252. // }
  253. /**
  254. * 同维修内容频次统计
  255. */
  256. // @RequestMapping("/queryHighFrequency")
  257. // @IgnoreAuth
  258. // public R queryHighFrequency(@RequestBody PageMap pageMap) {
  259. // Query query = new Query(pageMap);
  260. // List<HighFrequencyVo> highPriceList = wzHouseMaintenaCostService.queryHighFrequency(query);
  261. //
  262. // Query query1 = new Query(pageMap);
  263. // query1.put("sidx","num");
  264. // query1.put("order","desc");
  265. // query1.put("limit",20);
  266. // query1.put("page",1);
  267. // query1.put("offset",0);
  268. // List<HighFrequencyVo> allhighPriceList = wzHouseMaintenaCostService.queryHighFrequency(query1);
  269. //
  270. // int i=1;
  271. // for (HighFrequencyVo highFrequencyVo : allhighPriceList) {
  272. // highFrequencyVo.setOrder(i);
  273. // i++;
  274. // }
  275. // for (HighFrequencyVo highFrequencyVo : highPriceList) {
  276. // for (HighFrequencyVo item : allhighPriceList) {
  277. // if(item.getBuildingAlias()==null&&highFrequencyVo.getBuildingAlias()!=null){
  278. // continue;
  279. // }
  280. // if(item.getBuildingAlias()!=null&&highFrequencyVo.getBuildingAlias()==null){
  281. // continue;
  282. // }
  283. // if(item.getCity()==null&&highFrequencyVo.getCity()!=null){
  284. // continue;
  285. // }
  286. // if(item.getCity()!=null&&highFrequencyVo.getCity()==null){
  287. // continue;
  288. // }
  289. // if(item.getRepairType()==null&&highFrequencyVo.getRepairType()!=null){
  290. // continue;
  291. // }
  292. // if(item.getRepairType()!=null&&highFrequencyVo.getRepairType()==null){
  293. // continue;
  294. // }
  295. // if(((item.getCity()==null&&highFrequencyVo.getCity()==null)||item.getCity().equals(highFrequencyVo.getCity()))
  296. // &&((item.getBuildingAlias()==null&&highFrequencyVo.getBuildingAlias()==null)||item.getBuildingAlias().equals(highFrequencyVo.getBuildingAlias()))
  297. // &&((item.getRepairType()==null&&highFrequencyVo.getRepairType()==null)||item.getRepairType().equals(highFrequencyVo.getRepairType()))){
  298. // highFrequencyVo.setOrder(item.getOrder());
  299. // break;
  300. // }
  301. // }
  302. // }
  303. // PageUtils pageUtil = new PageUtils(highPriceList, 20, 10, 10);
  304. // return R.ok().put("page", pageUtil);
  305. // }
  306. /**
  307. * 维修异常监控_房产3年无维修清单excel
  308. */
  309. @GetMapping("/excel")
  310. @IgnoreAuth
  311. public void excel(String name,
  312. String statisticalMonth,
  313. String buildingNameAlias,
  314. String investmentEntity,
  315. String city,
  316. String county,
  317. String code,
  318. HttpServletResponse response) {
  319. Map<String, Object> map = new HashMap<>();
  320. if(statisticalMonth==null||statisticalMonth.equals("")||statisticalMonth.equals("undefined")){
  321. }else{
  322. map.put("statisticalMonth",statisticalMonth);
  323. }
  324. if(investmentEntity==null||investmentEntity.equals("")||investmentEntity.equals("undefined")){
  325. }else{
  326. map.put("investmentEntity",investmentEntity);
  327. }
  328. if(code==null||code.equals("")||code.equals("undefined")){
  329. }else{
  330. map.put("code",code);
  331. }
  332. if (buildingNameAlias != null) {
  333. map.put("buildingNameAlias", buildingNameAlias);
  334. }
  335. if (city != null) {
  336. map.put("city", city);
  337. }
  338. if (county != null) {
  339. map.put("county", county);
  340. }
  341. DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
  342. ExcelExport ee1 = new ExcelExport("报表" + df.format(new Date()));
  343. //判定是闲置管理还是记录
  344. // if (name.contains("相同维修频次统计")) {
  345. // ee1 = new ExcelExport("维修异常监控_相同维修频次统计" + df.format(new Date()));
  346. // responseTab1(df, ee1, map);
  347. // ee1.export(response);
  348. // } else if (name.contains("高总价统计")) {
  349. // ee1 = new ExcelExport("维修异常监控_高总价统计" + df.format(new Date()));
  350. // responseTab2(df,ee1,map);
  351. // ee1.export(response);
  352. // } else if (name.contains("高额日常零星维修")) {
  353. // ee1 = new ExcelExport("维修异常监控_高额日常零星维修" + df.format(new Date()));
  354. // responseTab3(df,ee1,map);
  355. // ee1.export(response);
  356. // } else if (name.contains("不可用发生维修费")) {
  357. // ee1 = new ExcelExport("维修异常监控_闲置+不可用发生维修费" + df.format(new Date()));
  358. // responseTab4(df,ee1,map);
  359. // ee1.export(response);
  360. // } else
  361. if (name.contains("房产3年无维修")) {
  362. ee1 = new ExcelExport("维修异常监控_房产3年无维修" + df.format(new Date()));
  363. responseTab5(df,ee1,map);
  364. ee1.export(response);
  365. }
  366. // else if (name.contains("维修费统计")){
  367. // ee1 = new ExcelExport("房屋维修_维修费统计" + df.format(new Date()));
  368. // responseTab6(df,ee1,map);
  369. // ee1.export(response);
  370. // }else if (name.contains("维修费详表")){
  371. // ee1 = new ExcelExport("房屋维修_维修费记录" + df.format(new Date()));
  372. // responseTab7(df,ee1,map);
  373. // ee1.export(response);
  374. // }
  375. }
  376. // public void responseTab1(DateFormat df, ExcelExport ee1, Map<String, Object> map1) {
  377. // Query query = new Query(map1);
  378. // List<HighFrequencyVo> resultList = wzHouseMaintenaCostService.queryHighFrequency(query);
  379. //
  380. // Query query1 = new Query(map1);
  381. // query1.put("sidx","num");
  382. // query1.put("order","desc");
  383. // query1.put("limit",20);
  384. // query1.put("page",1);
  385. // query1.put("offset",0);
  386. // List<HighFrequencyVo> allhighPriceList = wzHouseMaintenaCostService.queryHighFrequency(query1);
  387. //
  388. // int j=1;
  389. // for (HighFrequencyVo highFrequencyVo : allhighPriceList) {
  390. // highFrequencyVo.setOrder(j);
  391. // j++;
  392. // }
  393. // for (HighFrequencyVo highFrequencyVo : resultList) {
  394. // for (HighFrequencyVo item : allhighPriceList) {
  395. // if(item.getBuildingAlias()==null&&highFrequencyVo.getBuildingAlias()!=null){
  396. // continue;
  397. // }
  398. // if(item.getBuildingAlias()!=null&&highFrequencyVo.getBuildingAlias()==null){
  399. // continue;
  400. // }
  401. // if(item.getCity()==null&&highFrequencyVo.getCity()!=null){
  402. // continue;
  403. // }
  404. // if(item.getCity()!=null&&highFrequencyVo.getCity()==null){
  405. // continue;
  406. // }
  407. // if(item.getRepairType()==null&&highFrequencyVo.getRepairType()!=null){
  408. // continue;
  409. // }
  410. // if(item.getRepairType()!=null&&highFrequencyVo.getRepairType()==null){
  411. // continue;
  412. // }
  413. // if(((item.getCity()==null&&highFrequencyVo.getCity()==null)||item.getCity().equals(highFrequencyVo.getCity()))
  414. // &&((item.getBuildingAlias()==null&&highFrequencyVo.getBuildingAlias()==null)||item.getBuildingAlias().equals(highFrequencyVo.getBuildingAlias()))
  415. // &&((item.getRepairType()==null&&highFrequencyVo.getRepairType()==null)||item.getRepairType().equals(highFrequencyVo.getRepairType()))){
  416. // highFrequencyVo.setOrder(item.getOrder());
  417. // break;
  418. // }
  419. // }
  420. // }
  421. // List<Object> colList = new ArrayList();;
  422. // List<Object[]> allList = new ArrayList();
  423. // for (int i = 0; i < resultList.size(); i++) {
  424. // colList = new ArrayList();
  425. // colList.add(resultList.get(i).getCity());
  426. // colList.add(resultList.get(i).getBuildingAlias());
  427. // colList.add(resultList.get(i).getRepairType());
  428. // colList.add(resultList.get(i).getTime());
  429. // colList.add(resultList.get(i).getNum());
  430. // colList.add(resultList.get(i).getOrder());
  431. // allList.add(colList.toArray());
  432. //
  433. // }
  434. // String[] header = new String[]{
  435. // "单位",
  436. // "维修建筑",
  437. // "维修类型",
  438. // "时间",
  439. // "发生频率",
  440. // "排名"
  441. // };
  442. // ee1.addSheetByArray(df.format(new Date()) + "清单", allList, header);
  443. // }
  444. /**
  445. * 高总价维修统计
  446. */
  447. // public void responseTab2(DateFormat df, ExcelExport ee1, Map<String, Object> map1) {
  448. // Query query = new Query(map1);
  449. // List<WzHouseMaintenaCostEntity> resultList = wzHouseMaintenaCostService.queryHighPrice(query);
  450. // List<Object> colList;
  451. // List<Object[]> allList = new ArrayList();
  452. // for (int i = 0; i < resultList.size(); i++) {
  453. // colList = new ArrayList();
  454. // colList.add(resultList.get(i).getStatisticalMonth());
  455. // colList.add(resultList.get(i).getCity());
  456. // colList.add(resultList.get(i).getCounty());
  457. // colList.add(resultList.get(i).getBuildingAlias());
  458. // colList.add(resultList.get(i).getRepairType());
  459. // colList.add(resultList.get(i).getRepairContent());
  460. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getErpCreditedAmount(),true));
  461. // colList.add(resultList.get(i).getStandardAddress());
  462. // colList.add(resultList.get(i).getBuildingUse());
  463. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingArea(),true));
  464. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaUseArea(),true));
  465. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaRentArea(),true));
  466. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaUnavailable(),true));
  467. // allList.add(colList.toArray());
  468. // }
  469. // String[] header = new String[]{
  470. // "入账日期",
  471. // "二级单位",
  472. // "三级单位",
  473. // "建筑别名",
  474. // "维修类型",
  475. // "维修内容",
  476. // "erp入账金额元",
  477. // "标准地址",
  478. // "建筑用途",
  479. // "建筑面积㎡",
  480. // "建筑面积自用㎡",
  481. // "建筑面积出租㎡",
  482. // "建筑面积闲置㎡"
  483. // };
  484. // ee1.addSheetByArray(df.format(new Date()) + "清单", allList, header);
  485. // }
  486. // public void responseTab3(DateFormat df, ExcelExport ee1, Map<String, Object> map1) {
  487. // map1.put("repairType", "零星维修");
  488. // map1.put("erpCreditedAmount", 10000);
  489. // Query query=new Query(map1);
  490. // List<DailyModifyVo> resultList = wzHouseMaintenaCostService.queryDailyModify(query);
  491. //
  492. // List<Object> colList = new ArrayList();;
  493. // List<Object[]> allList = new ArrayList();
  494. // for (int i = 0; i < resultList.size(); i++) {
  495. // colList = new ArrayList();
  496. // colList.add(resultList.get(i).getCity());
  497. // colList.add(resultList.get(i).getBuildingAlias());
  498. // colList.add(resultList.get(i).getDate());
  499. // colList.add(resultList.get(i).getRepairType());
  500. // colList.add(resultList.get(i).getRepairContent());
  501. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getErpMoney(),true));
  502. // colList.add(resultList.get(i).getNum());
  503. // allList.add(colList.toArray());
  504. //
  505. // }
  506. // String[] header = new String[]{
  507. // "单位",
  508. // "维修建筑",
  509. // "维修时间",
  510. // "维修类型",
  511. // "维修内容",
  512. // "维修金额",
  513. // "本年超万元次数"
  514. // };
  515. // ee1.addSheetByArray(df.format(new Date()) + "清单", allList, header);
  516. // }
  517. // public void responseTab4(DateFormat df, ExcelExport ee1, Map<String, Object> map1) {
  518. // List<WzHouseMaintenaCostEntity> resultList = wzHouseMaintenaCostService.queryList(map1);
  519. // List<Object> colList = new ArrayList();;
  520. // List<Object[]> allList = new ArrayList();
  521. // for (int i = 0; i < resultList.size(); i++) {
  522. // colList = new ArrayList();
  523. // colList.add(resultList.get(i).getStatisticalMonth());
  524. // colList.add(resultList.get(i).getCity());
  525. // colList.add(resultList.get(i).getCounty());
  526. // colList.add(resultList.get(i).getBuildingAlias());
  527. // colList.add(resultList.get(i).getRepairType());
  528. // colList.add(resultList.get(i).getRepairContent());
  529. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getErpCreditedAmount(),true));
  530. // colList.add(resultList.get(i).getStandardAddress());
  531. // colList.add(resultList.get(i).getUseState());
  532. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingArea(),true));
  533. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaUseArea(),true));
  534. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaRentArea(),true));
  535. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaIdelArea(),true));
  536. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaUnavailable(),true));
  537. // allList.add(colList.toArray());
  538. //
  539. // }
  540. // String[] header = new String[]{
  541. // "入账日期",
  542. // "二级单位",
  543. // "三级单位",
  544. // "建筑别名",
  545. // "维修类型",
  546. // "维修内容",
  547. // "erp入账金额元",
  548. // "标准地址",
  549. // "使用状态",
  550. // "建筑面积㎡",
  551. // "建筑面积自用㎡",
  552. // "建筑面积出租㎡",
  553. // "建筑面积闲置㎡",
  554. // "建筑面积不可使用㎡"
  555. // };
  556. // ee1.addSheetByArray(df.format(new Date()) + "清单", allList, header);
  557. // }
  558. public void responseTab5(DateFormat df, ExcelExport ee1, Map<String, Object> map1) {
  559. List<WzHouseMaintEntity> list = wzHouseMaintService.queryList(map1);
  560. //对cityList 进行排序
  561. List<OtnAreaEntity> areaList = otnAreaService.getCityOption("018");
  562. List<WzHouseMaintEntity> resultList = new ArrayList<>();
  563. for (OtnAreaEntity otnAreaEntity : areaList) {
  564. for (WzHouseMaintEntity wzCity : list) {
  565. if (wzCity.getCity().contains(otnAreaEntity.getName())) {
  566. wzCity.setAll();
  567. resultList.add(wzCity);
  568. }
  569. }
  570. }
  571. List<Object> colList;
  572. List<Object[]> allList = new ArrayList();
  573. for (int i = 0; i < resultList.size(); i++) {
  574. colList = new ArrayList();
  575. colList.add(resultList.get(i).getCity());
  576. colList.add("");
  577. colList.add(resultList.get(i).getHouseAgeLessThanTwenty());
  578. colList.add(resultList.get(i).getHouseAgeBetweentTewntyAndForty());
  579. colList.add(resultList.get(i).getHouseAgeMoreThanFortyOne());
  580. colList.add(resultList.get(i).getHouseAll());
  581. colList.add("");
  582. colList.add(resultList.get(i).getBuildingAgeLessThanTwenty());
  583. colList.add(resultList.get(i).getBuildingAgeBetweentTewntyAndForty());
  584. colList.add(resultList.get(i).getBuildingAgeMoreThanFortyOne());
  585. colList.add(resultList.get(i).getBuildingAll());
  586. allList.add(colList.toArray());
  587. }
  588. String[] header = new String[]{
  589. "单位",
  590. "主业用房",
  591. "房龄<20年",
  592. "房龄21~40年",
  593. "房龄>41年",
  594. "总计",
  595. "全部建筑",
  596. "房龄<20年",
  597. "房龄21~40年",
  598. "房龄>41年",
  599. "总计"
  600. };
  601. ee1.addSheetByArray(df.format(new Date()) + "清单", allList, header);
  602. }
  603. /**
  604. * 高总价统计
  605. */
  606. // @RequestMapping("/queryHighPrice")
  607. // @IgnoreAuth
  608. // public R queryHighPrice(@RequestBody PageMap pageMap) {
  609. // Query query = new Query(pageMap);
  610. // WzStrategyEntity objectByType = wzStrategyService.getObjectByType();
  611. // int value=0;
  612. // if(objectByType!=null){
  613. // String[] values=objectByType.getValue().split(",");
  614. // value=Integer.valueOf(values[2]);
  615. // query.put("erpCreditedAmount", value);
  616. // }
  617. // List<WzHouseMaintenaCostEntity> highPriceList = wzHouseMaintenaCostService.queryHighPrice(query);
  618. // PageUtils pageUtil = new PageUtils(highPriceList, highPriceList.size(), 10, 10);
  619. // return R.ok().put("page", pageUtil);
  620. // }
  621. /**
  622. * 日常零星维修
  623. */
  624. // @RequestMapping("/queryDailyModify")
  625. // @IgnoreAuth
  626. // public R queryDailyModify(@RequestBody PageMap pageMap) {
  627. // Query query = new Query(pageMap);
  628. // Query query1 = new Query(pageMap);
  629. // //获取配置参数
  630. // int value=10000;
  631. // WzStrategyEntity objectByType = wzStrategyService.getObjectByType();
  632. // if(objectByType!=null){
  633. // String[] values=objectByType.getValue().split(",");
  634. // value=Integer.valueOf(values[3]);
  635. // query.put("erpCreditedAmount", value);
  636. // query1.put("erpCreditedAmount", value);
  637. // }
  638. // query.put("repairType", "零星维修");
  639. // List<DailyModifyVo> highPriceList = wzHouseMaintenaCostService.queryDailyModify(query);
  640. // query1.put("repairType", "零星维修");
  641. //
  642. // int total = wzHouseMaintenaCostService.queryDailyModifyTotal(query1);
  643. // PageUtils pageUtil = new PageUtils(highPriceList, total, 10, 10);
  644. // return R.ok().put("page", pageUtil);
  645. // }
  646. /**
  647. * 闲置+不可用发生维修费
  648. */
  649. // @RequestMapping("/queryHappenCost")
  650. // @IgnoreAuth
  651. // public R queryHappenCost(@RequestBody PageMap pageMap) {
  652. // Query query = new Query(pageMap);
  653. // query.put("useAreaSelfUseArea", 0);
  654. // query.put("useAreaRentArea", 0);
  655. // List<WzHouseMaintenaCostEntity> highPriceList = wzHouseMaintenaCostService.queryList(query);
  656. // Query query1 = new Query(pageMap);
  657. // query1.put("useAreaSelfUseArea", 0);
  658. // query1.put("useAreaRentArea", 0);
  659. // int total = wzHouseMaintenaCostService.queryTotal(query1);
  660. // PageUtils pageUtil = new PageUtils(highPriceList, total, 10, 10);
  661. // return R.ok().put("page", pageUtil);
  662. // }
  663. // /**
  664. // * 获取局址别名
  665. // */
  666. // @RequestMapping("/getBuildingNameCode")
  667. // @IgnoreAuth
  668. // public R getBuildingNameCode(@RequestBody PageMap pageMap) {
  669. // //查询列表数据
  670. // Query query = new Query(pageMap);
  671. // List<String> list = wzHouseMaintenaCostService.getBuildingNameCode(query);
  672. // Query query1 = new Query(pageMap);
  673. // int total = wzHouseMaintenaCostService.queryBuildDetailByCodeTotal(query1);
  674. // PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());
  675. // return R.ok().put("page", pageUtil);
  676. // }
  677. //
  678. //
  679. // /**
  680. // * 获取局址别名
  681. // */
  682. // @RequestMapping("/getBuildingNameAlias")
  683. // @IgnoreAuth
  684. // public R getBuildingNameAlias(@RequestBody PageMap pageMap) {
  685. // //查询列表数据
  686. // Query query = new Query(pageMap);
  687. // List<String> list = wzHouseMaintenaCostService.getBuildingNameAlias(query);
  688. // Query query1 = new Query(pageMap);
  689. // int total = wzHouseMaintenaCostService.getBuildingNameAliasTotal(query1);
  690. // PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());
  691. // return R.ok().put("page", pageUtil);
  692. // }
  693. // public void responseTab6(DateFormat df, ExcelExport ee1, Map<String, Object> map1){
  694. // List<WzHouseMaintenaCostEntity> alllist = wzHouseMaintenaCostService.queryList1(map1);
  695. // //全省节点
  696. // HouseCostVo province = new HouseCostVo();
  697. // province.setCounty("全省");
  698. // province.setCity("全省");
  699. //
  700. // double aProjectCost = 0l;
  701. // double aSmallCost = 0l;
  702. // double aWarnCost = 0l;
  703. // double aProCost = 0l;
  704. // double aOtherCost = 0l;
  705. // double aAllCost = 0l;
  706. // //按地市进行划分
  707. // Map<String, List<WzHouseMaintenaCostEntity>> cityMap = new HashMap<>();
  708. // for (WzHouseMaintenaCostEntity entity : alllist) {
  709. // if (entity.getCity() == null) continue;
  710. // List<WzHouseMaintenaCostEntity> list;
  711. // if (cityMap.get(entity.getCity()) != null) {
  712. // list = cityMap.get(entity.getCity());
  713. // list.add(entity);
  714. // } else {
  715. // list = new ArrayList<>();
  716. // list.add(entity);
  717. // }
  718. // cityMap.put(entity.getCity(), list);
  719. // }
  720. // //按区进行划分
  721. // List<HouseCostVo> resultList = new ArrayList<>();
  722. // List<HouseCostVo> cityList = new ArrayList<>();
  723. // for (Map.Entry<String, List<WzHouseMaintenaCostEntity>> entry : cityMap.entrySet()) {
  724. // List<WzHouseMaintenaCostEntity> list = entry.getValue();
  725. // //县的Map集合
  726. // Map<String, List<WzHouseMaintenaCostEntity>> countyMap = new HashMap<>();
  727. // for (WzHouseMaintenaCostEntity leaveUseVo : list) {
  728. // if (countyMap.get(leaveUseVo.getCounty()) != null) {
  729. // list = countyMap.get(leaveUseVo.getCounty());
  730. // list.add(leaveUseVo);
  731. // } else {
  732. // list = new ArrayList<>();
  733. // list.add(leaveUseVo);
  734. // }
  735. // countyMap.put(leaveUseVo.getCounty(), list);
  736. // }
  737. //
  738. // List<HouseCostVo> countyList = new ArrayList<>();
  739. // double cityProjectCost = 0l;
  740. // double citySmallCost = 0l;
  741. // double cityWarnCost = 0l;
  742. // double cityProCost = 0l;
  743. // double cityOtherCost = 0l;
  744. // double cityAllCost = 0l;
  745. // for (Map.Entry<String, List<WzHouseMaintenaCostEntity>> countyEntry : countyMap.entrySet()) {
  746. // double projectCost = 0l;
  747. // double smallCost = 0l;
  748. // double warnCost = 0l;
  749. // double proCost = 0l;
  750. // double otherCost = 0l;
  751. // double allCost = 0l;
  752. //
  753. // HouseCostVo county = new HouseCostVo();
  754. // for (WzHouseMaintenaCostEntity leaveUseVo : countyEntry.getValue()) {
  755. // county.setCity(leaveUseVo.getCounty());
  756. // if (leaveUseVo.getRepairType().equals("项目制维修")) {
  757. // projectCost += leaveUseVo.getErpCreditedAmount();
  758. // cityProjectCost += leaveUseVo.getErpCreditedAmount();
  759. // aProjectCost += leaveUseVo.getErpCreditedAmount();
  760. // allCost +=leaveUseVo.getErpCreditedAmount();
  761. // cityAllCost +=leaveUseVo.getErpCreditedAmount();
  762. // aAllCost +=leaveUseVo.getErpCreditedAmount();
  763. // } else if (leaveUseVo.getRepairType().equals("零星维修")) {
  764. // smallCost += leaveUseVo.getErpCreditedAmount();
  765. // citySmallCost += leaveUseVo.getErpCreditedAmount();
  766. // aSmallCost += leaveUseVo.getErpCreditedAmount();
  767. // allCost +=leaveUseVo.getErpCreditedAmount();
  768. // cityAllCost +=leaveUseVo.getErpCreditedAmount();
  769. // aAllCost +=leaveUseVo.getErpCreditedAmount();
  770. // } else if (leaveUseVo.getRepairType().equals("应急维修")) {
  771. // warnCost += leaveUseVo.getErpCreditedAmount();
  772. // cityWarnCost += leaveUseVo.getErpCreditedAmount();
  773. // aWarnCost += leaveUseVo.getErpCreditedAmount();
  774. // allCost +=leaveUseVo.getErpCreditedAmount();
  775. // cityAllCost +=leaveUseVo.getErpCreditedAmount();
  776. // aAllCost +=leaveUseVo.getErpCreditedAmount();
  777. // } else if (leaveUseVo.getRepairType().equals("安防费用")) {
  778. // proCost += leaveUseVo.getErpCreditedAmount();
  779. // cityProCost += leaveUseVo.getErpCreditedAmount();
  780. // aProCost += leaveUseVo.getErpCreditedAmount();
  781. // allCost +=leaveUseVo.getErpCreditedAmount();
  782. // cityAllCost +=leaveUseVo.getErpCreditedAmount();
  783. // aAllCost +=leaveUseVo.getErpCreditedAmount();
  784. // } else {
  785. // if(leaveUseVo.getRepairType().contains("预提冲销")){
  786. // continue;
  787. // }
  788. // otherCost += leaveUseVo.getErpCreditedAmount();
  789. // cityOtherCost += leaveUseVo.getErpCreditedAmount();
  790. // aOtherCost += leaveUseVo.getErpCreditedAmount();
  791. // }
  792. //// allCost += projectCost + smallCost + warnCost + proCost + otherCost;
  793. //// cityAllCost += cityProjectCost + citySmallCost + cityWarnCost + cityProCost + cityOtherCost;
  794. //// aAllCost += aProjectCost + aSmallCost + aWarnCost + aProCost + aOtherCost;
  795. //
  796. // }
  797. // county.setProjectCost(formatDouble(projectCost));
  798. // county.setProCost(formatDouble(proCost));
  799. // county.setOtherCost(formatDouble(otherCost));
  800. // county.setSmallCost(formatDouble(smallCost));
  801. // county.setWarnCost(formatDouble(warnCost));
  802. // county.setAllCost(formatDouble(allCost));
  803. // countyList.add(county);
  804. // }
  805. //
  806. // List<HouseCostVo> orderCountyList = new ArrayList<>();
  807. // try {
  808. // //对countList 进行排序
  809. // String city = list.get(0).getCity();
  810. // if (city.contains("市")) {
  811. // city = city.split("市")[0];
  812. // }
  813. // OtnAreaEntity area = otnAreaService.queryObject(city);
  814. // List<OtnAreaEntity> countyAreaList = otnAreaService.getCityOption(area.getId());
  815. // int i=0;
  816. // for (OtnAreaEntity otnAreaEntity : countyAreaList) {
  817. // for (HouseCostVo wzCity : countyList) {
  818. // if (otnAreaEntity.getName().equals(wzCity.getCity())) {
  819. // i++;
  820. // wzCity.setFlag(i%2==0);
  821. // orderCountyList.add(wzCity);
  822. // }
  823. // }
  824. // }
  825. // } catch (Exception e) {
  826. // orderCountyList = countyList;
  827. // e.printStackTrace();
  828. // }
  829. //
  830. // HouseCostVo parent = new HouseCostVo();
  831. // parent.setProCost(formatDouble(cityProCost));
  832. // parent.setWarnCost(formatDouble(cityWarnCost));
  833. // parent.setProjectCost(formatDouble(cityProjectCost));
  834. // parent.setOtherCost(formatDouble(cityOtherCost));
  835. // parent.setSmallCost(formatDouble(citySmallCost));
  836. // parent.setAllCost(formatDouble(cityAllCost));
  837. // parent.setCity(list.get(0).getCity());
  838. // parent.setChildren(orderCountyList);
  839. // cityList.add(parent);
  840. // }
  841. //
  842. // //对cityList 进行排序
  843. // List<OtnAreaEntity> areaList = otnAreaService.getCityOption("018");
  844. // List<HouseCostVo> orderList = new ArrayList<>();
  845. // for (OtnAreaEntity otnAreaEntity : areaList) {
  846. // for (HouseCostVo wzCity : cityList) {
  847. // if (wzCity.getCity().contains(otnAreaEntity.getName())) {
  848. // orderList.add(wzCity);
  849. // }
  850. // }
  851. // }
  852. //
  853. // province.setChildren(orderList);
  854. // province.setAllCost(formatDouble(aAllCost));
  855. // province.setSmallCost(formatDouble(aSmallCost));
  856. // province.setOtherCost(formatDouble(aOtherCost));
  857. // province.setProjectCost(formatDouble(aProjectCost));
  858. // province.setProCost(formatDouble(aProCost));
  859. // province.setWarnCost(formatDouble(aWarnCost));
  860. // resultList.add(province);
  861. //
  862. // List<Object> colList=new ArrayList();;
  863. // List<Object[]> allList = new ArrayList();
  864. // for (int i = 0; i < resultList.size(); i++) {
  865. //
  866. // if(resultList.get(i).getCity().contains("省")){
  867. // colList = new ArrayList();
  868. // colList.add(resultList.get(i).getCity());
  869. // colList.add("");
  870. // colList.add("");
  871. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getProjectCost(),true));
  872. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getSmallCost(),true));
  873. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getWarnCost(),true));
  874. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getAllCost(),true));
  875. // allList.add(colList.toArray());
  876. //
  877. // //处理城市的
  878. // List<HouseCostVo> cityList1=resultList.get(i).getChildren();
  879. // for (HouseCostVo floorNoUserVo : cityList1) {
  880. // colList = new ArrayList();
  881. // colList.add("");
  882. // colList.add(floorNoUserVo.getCity());
  883. // colList.add("");
  884. // colList.add(WzHouseMaintenaCostController.toThousands(floorNoUserVo.getProjectCost(),true));
  885. // colList.add(WzHouseMaintenaCostController.toThousands(floorNoUserVo.getSmallCost(),true));
  886. // colList.add(WzHouseMaintenaCostController.toThousands(floorNoUserVo.getWarnCost(),true));
  887. // colList.add(WzHouseMaintenaCostController.toThousands(floorNoUserVo.getAllCost(),true));
  888. // allList.add(colList.toArray());
  889. // //处理县城的
  890. // List<HouseCostVo> countyList1 = floorNoUserVo.getChildren();
  891. // for (HouseCostVo noUserVo : countyList1) {
  892. // colList = new ArrayList();
  893. // colList.add("");
  894. // colList.add("");
  895. // colList.add(noUserVo.getCity());
  896. // colList.add(WzHouseMaintenaCostController.toThousands(noUserVo.getProjectCost(),true));
  897. // colList.add(WzHouseMaintenaCostController.toThousands(noUserVo.getSmallCost(),true));
  898. // colList.add(WzHouseMaintenaCostController.toThousands(noUserVo.getWarnCost(),true));
  899. // colList.add(WzHouseMaintenaCostController.toThousands(noUserVo.getAllCost(),true));
  900. // allList.add(colList.toArray());
  901. // }
  902. // }
  903. // }
  904. // }
  905. // String[] header = new String[]{
  906. // "资产所属单位(一级)",
  907. // "资产所属单位(二级)",
  908. // "资产所属单位(三级)",
  909. // "项目制维修(元)",
  910. // "零星维修(元)",
  911. // "应急维修(元)",
  912. // "总计(元)"
  913. // };
  914. // ee1.addSheetByArray("房屋维修_维修费统计"+df.format(new Date()) + "清单", allList, header);
  915. //
  916. // }
  917. //
  918. // public void responseTab7(DateFormat df, ExcelExport ee1, Map<String, Object> map1){
  919. //
  920. // List<WzHouseMaintenaCostEntity> resultList = wzHouseMaintenaCostService.queryList1(map1);
  921. // //每平方米维修单价
  922. // for (WzHouseMaintenaCostEntity wzHouseMaintenaCostEntity : resultList) {
  923. // wzHouseMaintenaCostEntity.setAveragePrice(formatDouble(wzHouseMaintenaCostEntity.dealPrice(wzHouseMaintenaCostEntity)));
  924. // }
  925. //
  926. // List<Object> colList;
  927. // List<Object[]> allList = new ArrayList();
  928. // for (int i = 0; i < resultList.size(); i++) {
  929. // colList = new ArrayList();
  930. // colList.add(resultList.get(i).getBuildingId());
  931. // colList.add(resultList.get(i).getStatisticalMonth());
  932. // colList.add(resultList.get(i).getRepairType());
  933. // colList.add(resultList.get(i).getRepairContent());
  934. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getErpCreditedAmount(),true));
  935. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getAveragePrice(),true));
  936. // colList.add(resultList.get(i).getCity());
  937. // colList.add(resultList.get(i).getCounty());
  938. // colList.add(resultList.get(i).getBuildingAddressNumber());
  939. // colList.add(resultList.get(i).getBuildingNnameAlias());
  940. // colList.add(resultList.get(i).getStandardAddress());
  941. // colList.add(resultList.get(i).getCityGrade());
  942. // colList.add(resultList.get(i).getCityArea());
  943. // colList.add(resultList.get(i).getInvestmentEntity());
  944. // colList.add(resultList.get(i).getManagementHierarchy());
  945. // colList.add(resultList.get(i).getBuildingStructure());
  946. // colList.add(resultList.get(i).getUseState());
  947. // colList.add(resultList.get(i).getBuildingUse());
  948. // colList.add(resultList.get(i).getOwnershipStatus());
  949. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingFloorArea(),true));
  950. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingArea(),true));
  951. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaUseArea(),true));
  952. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaRentArea(),true));
  953. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaIdelArea(),true));
  954. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaUnavailable(),true));
  955. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getUseArea(),true));
  956. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getUseAreaSelfUseArea(),true));
  957. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getUseAreaRentArea(),true));
  958. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getUseAreaIdelArea(),true));
  959. // colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getUseAreaUnavailableArea(),true));
  960. // allList.add(colList.toArray());
  961. // }
  962. // String[] header = new String[]{
  963. // "建筑id基本信息",
  964. // "入账日期",
  965. // "维修类型",
  966. // "维修内容",
  967. // "erp入账金额元",
  968. // "每平方米维修单价",
  969. // "资产所属单位二级",
  970. // "资产所属单位三级",
  971. // "局址编号",
  972. // "局址别名",
  973. // "标准地址",
  974. // "城市等级",
  975. // "城市区域",
  976. // "投资主体",
  977. // "管理层级",
  978. // "房屋结构",
  979. // "使用状况",
  980. // "建筑用途",
  981. // "权属状态",
  982. // "建筑占地面积㎡",
  983. // "建筑面积㎡",
  984. // "建筑面积自用㎡",
  985. // "建筑面积出租㎡",
  986. // "建筑面积闲置㎡",
  987. // "建筑面积不可使用㎡",
  988. // "使用面积㎡",
  989. // "使用面积自用㎡",
  990. // "使用面积出租㎡",
  991. // "使用面积闲置㎡",
  992. // "使用面积不可使用㎡"
  993. // };
  994. // ee1.addSheetByArray(df.format(new Date()) + "清单", allList, header);
  995. // }
  996. // public double formatDouble(double num) {
  997. // DecimalFormat format2 = new DecimalFormat("#.00");
  998. // String str2 = format2.format(num);
  999. // double avera = Double.parseDouble(str2);
  1000. // return avera;
  1001. // }
  1002. public static String toThousands(Object number,boolean flag) {
  1003. if(number==null){
  1004. return "";
  1005. }
  1006. String num=number.toString();
  1007. if(num.contains("E")){
  1008. BigDecimal decimal=new BigDecimal(num);
  1009. BigDecimal decimal1 = decimal.setScale(4, 2);
  1010. num=decimal1.toString();
  1011. }
  1012. String[] snum=num.split("\\.");
  1013. num=snum[0];
  1014. String result = "";
  1015. int counter = 0;
  1016. for (int i = num.length() - 1; i >= 0; i--) {
  1017. counter++;
  1018. result = num.charAt(i) + result;
  1019. if (counter % 3==0 && i != 0) {
  1020. result = ',' + result;
  1021. }
  1022. }
  1023. if(snum.length<2){
  1024. if(flag){
  1025. return result+".00";
  1026. }else{
  1027. return result;
  1028. }
  1029. }
  1030. if(snum[1].length()==1){
  1031. snum[1]+="0";
  1032. }
  1033. if(snum[1].length()>2){
  1034. snum[1]=snum[1].substring(0,2);
  1035. }
  1036. return result+"."+snum[1];
  1037. }
  1038. }