123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768 |
- package com.example.controller;
- import com.example.config.annotation.IgnoreAuth;
- import com.example.entity.OtnAreaEntity;
- import com.example.entity.WzLandManageDetailsEntity;
- import com.example.entity.vo.floormanager.FloorNoUserVo;
- import com.example.entity.vo.housemanager.HouseYearVo;
- import com.example.service.WzLandManageDetailsService;
- import com.example.service.WzOtnAreaService;
- import com.example.utils.PageMap;
- import com.example.utils.PageUtils;
- import com.example.utils.Query;
- import com.example.utils.R;
- import com.example.utils.excel.ExcelExport;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import javax.servlet.http.HttpServletResponse;
- import java.text.DateFormat;
- import java.text.DecimalFormat;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.Calendar;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- @RestController
- @RequestMapping("/house-car/house/dist/api/WzLandManageDetails")
- public class WzLandManageDetailsController {
- @Autowired
- private WzLandManageDetailsService wzLandManageDetailsService;
- @Autowired
- private WzOtnAreaService otnAreaService;
- // @RequestMapping("/list")
- // @IgnoreAuth
- // public R list(@RequestBody PageMap pageMap) {
- // //查询列表数据
- // Query query = new Query(pageMap);
- //
- // int repeatNum=0;
- // //全省节点
- // FloorNoUserVo province=new FloorNoUserVo();
- // province.setCity("全省");
- // province.setCounty("全省");
- //
- // List<FloorNoUserVo> leaveUseVoList = wzLandManageDetailsService.queryLeaveUseList(pageMap.getMap());
- // Map<String,List<FloorNoUserVo>> map=new HashMap<>();
- // for (FloorNoUserVo leaveUseVo : leaveUseVoList) {
- // double avera=0l;
- // if(leaveUseVo.getBuildingAreaIdelArea()+leaveUseVo.getBuildingAreaRentArea()==0){
- // avera=0;
- // }else{
- // avera=leaveUseVo.getBuildingAreaIdelArea()/(leaveUseVo.getBuildingAreaIdelArea()+leaveUseVo.getBuildingAreaRentArea());
- // avera=formatDouble(avera)*100;
- // }
- // leaveUseVo.setAverage(avera);
- // List<FloorNoUserVo> list;
- // if(map.get(leaveUseVo.getCity())!=null){
- // list=map.get(leaveUseVo.getCity());
- // list.add(leaveUseVo);
- // }else{
- // list=new ArrayList<>();
- // list.add(leaveUseVo);
- // }
- // map.put(leaveUseVo.getCity(),list);
- // }
- // List<FloorNoUserVo> resultList=new ArrayList<>();
- // List<FloorNoUserVo> cityList=new ArrayList<>();
- // double abuildingAreaIdelArea=0l;
- // double abuildingAreaRentArea=0l;
- // double abuildArea=0l;
- // double abuildingAreaUnavailable=0l;
- // double abuildingAreaUseArea=0l;
- //
- // for(Map.Entry<String,List<FloorNoUserVo>> entry:map.entrySet()) {
- //
- // List<FloorNoUserVo> list = entry.getValue();
- // //对该list相同的县进行统计
- // Map<String, List<FloorNoUserVo>> countyMap = new HashMap<>();
- // for (FloorNoUserVo leaveUseVo : list) {
- // if (countyMap.get(leaveUseVo.getCounty()) != null) {
- // list = countyMap.get(leaveUseVo.getCounty());
- // list.add(leaveUseVo);
- // } else {
- // list = new ArrayList<>();
- // list.add(leaveUseVo);
- // }
- // countyMap.put(leaveUseVo.getCounty(), list);
- // }
- //
- // List<FloorNoUserVo> countyList = new ArrayList<>();
- // double citybuildingAreaIdelArea = 0l;
- // double citybuildingAreaRentArea = 0l;
- // double citybuildArea = 0l;
- // double citybuildingAreaUnavailable = 0l;
- // double citybuildingAreaUseArea = 0l;
- // for (Map.Entry<String, List<FloorNoUserVo>> countyEntry : countyMap.entrySet()) {
- // double buildingAreaIdelArea = 0l;
- // double buildingAreaRentArea = 0l;
- // double buildArea = 0l;
- // double buildingAreaUnavailable = 0l;
- // double buildingAreaUseArea = 0l;
- //
- // String reapStr="";
- // if (countyEntry.getKey().equals("市本部")){
- // reapStr="市本部"+repeatNum;
- // repeatNum++;
- // }
- //
- // FloorNoUserVo county = new FloorNoUserVo();
- // for (FloorNoUserVo leaveUseVo : countyEntry.getValue()) {
- // county.setCity(leaveUseVo.getCounty());
- // county.setCounty(leaveUseVo.getCounty());
- // if(!reapStr.equals("")){
- // county.setCity(reapStr);
- // county.setCounty(reapStr);
- // county.setCountyName(reapStr);
- // }
- //
- // buildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
- // buildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
- // buildArea += leaveUseVo.getBuildingArea();
- // buildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
- // buildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
- //
- // citybuildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
- // citybuildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
- // citybuildArea += leaveUseVo.getBuildingArea();
- // citybuildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
- // citybuildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
- //
- // abuildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
- // abuildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
- // abuildArea += leaveUseVo.getBuildingArea();
- // abuildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
- // abuildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
- // }
- // double avera=0;
- // if(buildingAreaIdelArea+buildingAreaRentArea==0){
- // avera=0;
- // }else{
- // try{
- // avera=formatDouble(buildingAreaIdelArea/(buildingAreaRentArea+buildingAreaIdelArea))*100;
- // }catch (Exception e){
- // e.printStackTrace();
- // }
- //
- // }
- // county.setBuildingArea(formatDouble(buildArea));
- // county.setBuildingAreaIdelArea(formatDouble(buildingAreaIdelArea));
- // county.setBuildingAreaUnavailable(formatDouble(buildingAreaUnavailable));
- // county.setBuildingAreaUseArea(formatDouble(buildingAreaUseArea));
- // county.setBuildingAreaRentArea(formatDouble(buildingAreaRentArea));
- // county.setAverage(formatDouble(avera));
- // countyList.add(county);
- // }
- // List<FloorNoUserVo> orderCountyList=new ArrayList<>();
- // try{
- // //对countList 进行排序
- // OtnAreaEntity area=otnAreaService.queryObject(list.get(0).getCity());
- // List<OtnAreaEntity> countyAreaList=otnAreaService.getCityOption(area.getId());
- // int i=0;
- // for (OtnAreaEntity otnAreaEntity : countyAreaList) {
- // for (FloorNoUserVo wzCity : countyList) {
- // if(wzCity.getCity().contains(otnAreaEntity.getName())){
- // i++;
- // wzCity.setFlag(i%2==0);
- // orderCountyList.add(wzCity);
- // }
- // }
- // }
- // }catch (Exception e){
- // orderCountyList=countyList;
- // e.printStackTrace();
- // }
- //
- //
- // double avera;
- // if(citybuildingAreaRentArea+citybuildingAreaIdelArea==0){
- // avera=0;
- // }else{
- // avera=formatDouble(citybuildingAreaIdelArea/(citybuildingAreaRentArea+citybuildingAreaIdelArea))*100;
- // }
- //
- // FloorNoUserVo parent = new FloorNoUserVo();
- // parent.setBuildingArea(formatDouble(citybuildArea));
- // parent.setBuildingAreaIdelArea(formatDouble(citybuildingAreaIdelArea));
- // parent.setBuildingAreaUnavailable(formatDouble(citybuildingAreaUnavailable));
- // parent.setBuildingAreaUseArea(formatDouble(citybuildingAreaUseArea));
- // parent.setBuildingAreaRentArea(formatDouble(citybuildingAreaRentArea));
- // parent.setCity(list.get(0).getCity());
- // parent.setCountyName(list.get(0).getCityName());
- // parent.setAverage(formatDouble(avera));
- // parent.setChildren(orderCountyList);
- // cityList.add(parent);
- // }
- //
- // //对cityList 进行排序
- // List<OtnAreaEntity> areaList=otnAreaService.getCityOption("018");
- // List<FloorNoUserVo> orderList=new ArrayList<>();
- // int i=0;
- // for (OtnAreaEntity otnAreaEntity : areaList) {
- // for (FloorNoUserVo wzCity : cityList) {
- // if(wzCity.getCity().contains(otnAreaEntity.getName())){
- // wzCity.setFlag(i%2==0);
- // orderList.add(wzCity);
- // i++;
- // }
- // }
- // }
- //
- // double aavera;
- // if(abuildingAreaRentArea+abuildingAreaIdelArea==0){
- // aavera=0;
- // }else{
- // aavera=formatDouble(abuildingAreaIdelArea/(abuildingAreaRentArea+abuildingAreaIdelArea))*100;
- // }
- // province.setBuildingArea(formatDouble(abuildArea));
- // province.setBuildingAreaIdelArea(formatDouble(abuildingAreaIdelArea));
- // province.setBuildingAreaUnavailable(formatDouble(abuildingAreaUnavailable));
- // province.setBuildingAreaUseArea(formatDouble(abuildingAreaUseArea));
- // province.setBuildingAreaRentArea(formatDouble(abuildingAreaRentArea));
- // province.setAverage(formatDouble(aavera));
- // province.setChildren(orderList);
- // resultList.add(province);
- //
- // int total = wzLandManageDetailsService.queryTotal(query);
- // PageUtils pageUtil = new PageUtils(resultList, total, query.getLimit(), query.getPage());
- // return R.ok().put("page", pageUtil);
- // }
- @RequestMapping("/queryHouseYear")
- @IgnoreAuth
- public R queryHouseYear(@RequestBody PageMap pageMap) {
- //查询列表数据
- Query query = new Query(pageMap);
- List<FloorNoUserVo> leaveUseVoList = wzLandManageDetailsService.queryLeaveUseList(query);
- Map<String,List<FloorNoUserVo>> map=new HashMap<>();
- for (FloorNoUserVo leaveUseVo : leaveUseVoList) {
- double avera=leaveUseVo.getBuildingAreaIdelArea()/(leaveUseVo.getBuildingAreaIdelArea()+leaveUseVo.getBuildingAreaRentArea());
- avera=formatDouble(avera);
- leaveUseVo.setAverage(avera);
- Calendar cal1=Calendar.getInstance();
- cal1.setTime(leaveUseVo.getBuildingStartyear());
- int year1=cal1.get(Calendar.YEAR);
- Calendar cal2=Calendar.getInstance();
- cal2.setTime(new Date());
- int year2=cal2.get(Calendar.YEAR);
- int num=year2-year1;
- leaveUseVo.setHouseYearNum(num);
- List<FloorNoUserVo> list;
- if(map.get(leaveUseVo.getCity())!=null){
- list=map.get(leaveUseVo.getCity());
- list.add(leaveUseVo);
- }else{
- list=new ArrayList<>();
- list.add(leaveUseVo);
- }
- map.put(leaveUseVo.getCity(),list);
- }
- List<HouseYearVo> resultList=new ArrayList<>();
- for(Map.Entry<String,List<FloorNoUserVo>> entry:map.entrySet()){
- List<FloorNoUserVo> list=entry.getValue();
- //对该list相同的县进行统计
- Map<String,List<FloorNoUserVo>> leaveMap=new HashMap<>();
- for (FloorNoUserVo leaveUseVo : list) {
- if(leaveMap.get(leaveUseVo.getCounty())!=null){
- list=leaveMap.get(leaveUseVo.getCounty());
- list.add(leaveUseVo);
- }else{
- list=new ArrayList<>();
- list.add(leaveUseVo);
- }
- leaveMap.put(leaveUseVo.getCounty(),list);
- }
- List<HouseYearVo> houseYearVoList=new ArrayList<>();
- for (Map.Entry<String,List<FloorNoUserVo>> entry1:leaveMap.entrySet()){
- List<FloorNoUserVo> value = entry1.getValue();
- HouseYearVo yearVo=new HouseYearVo();
- yearVo.setCity(value.get(0).getCity());
- yearVo.setCityName(value.get(0).getCityName());
- yearVo.setCounty(value.get(0).getCounty());
- yearVo.setCountyName(value.get(0).getCountyName());
- for (FloorNoUserVo leaveUseVo : value) {
- }
- houseYearVoList.add(yearVo);
- }
- HouseYearVo parent=new HouseYearVo();
- parent.setCity(houseYearVoList.get(0).getCity());
- parent.setCountyName(houseYearVoList.get(0).getCityName());
- parent.setChildren(houseYearVoList);
- resultList.add(parent);
- }
- int total = wzLandManageDetailsService.queryTotal(query);
- PageUtils pageUtil = new PageUtils(resultList, total, query.getLimit(), query.getPage());
- return R.ok().put("page", pageUtil);
- }
- // /**
- // * 土地记录
- // */
- // @RequestMapping("/queryLandDetail")
- // @IgnoreAuth
- // public R queryHouseDetail(@RequestBody PageMap pageMap) {
- // //查询列表数据
- // Query query = new Query(pageMap);
- // List<WzLandManageDetailsEntity> list = wzLandManageDetailsService.queryList(query);
- // Query query1 = new Query(pageMap);
- // int total = wzLandManageDetailsService.queryTotal(query1);
- // PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());
- // return R.ok().put("page", pageUtil);
- // }
- /**
- * 土地记录
- */
- @RequestMapping("/queryLandDetailByCode")
- @IgnoreAuth
- public R queryHouseDetailByCode(@RequestBody PageMap pageMap) {
- //查询列表数据
- // Query query = new Query(pageMap);
- Map<String,Object> query=new HashMap<>();
- query.putAll(pageMap.getMap());
- List<WzLandManageDetailsEntity> list = wzLandManageDetailsService.queryList(query);
- Query query1 = new Query(pageMap);
- int total = wzLandManageDetailsService.queryTotal(query1);
- PageUtils pageUtil = new PageUtils(list, total, 0, 0);
- return R.ok().put("page", pageUtil);
- }
- /**
- * 清单excel
- *
- * @param response
- */
- @GetMapping("/excel")
- @IgnoreAuth
- public void excel(String name,String buildingNameAlias,String city,String county, HttpServletResponse response) {
- DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
- ExcelExport ee1 = new ExcelExport("报表" + df.format(new Date()));
- Map<String,Object> map=new HashMap<>();
- if(buildingNameAlias!=null){
- map.put("buildingNameAlias",buildingNameAlias);
- }
- if(city!=null){
- map.put("city",city);
- }
- if(county!=null){
- map.put("county",county);
- }
- //判定是闲置管理还是记录
- if(name.contains("记录")){
- ee1 = new ExcelExport("土地管理_土地记录" + df.format(new Date()));
- responseLandDetail(df,ee1,map);
- ee1.export(response);
- }else{
- ee1 = new ExcelExport("土地管理_闲置管理" + df.format(new Date()));
- responseLandEchart(df,ee1,map);
- ee1.export(response);
- }
- }
- public void responseLandEchart(DateFormat df, ExcelExport ee1, Map<String, Object> map1){
- try {
- int repeatNum=0;
- //全省节点
- FloorNoUserVo province=new FloorNoUserVo();
- province.setCity("全省");
- province.setCounty("全省");
- List<FloorNoUserVo> leaveUseVoList = wzLandManageDetailsService.queryLeaveUseList(map1);
- Map<String,List<FloorNoUserVo>> map=new HashMap<>();
- for (FloorNoUserVo leaveUseVo : leaveUseVoList) {
- double avera=0l;
- if(leaveUseVo.getBuildingAreaIdelArea()+leaveUseVo.getBuildingAreaRentArea()==0){
- avera=0;
- }else{
- avera=leaveUseVo.getBuildingAreaIdelArea()/(leaveUseVo.getBuildingAreaIdelArea()+leaveUseVo.getBuildingAreaRentArea());
- avera=formatDouble(avera)*100;
- }
- leaveUseVo.setAverage(avera);
- List<FloorNoUserVo> list;
- if(map.get(leaveUseVo.getCity())!=null){
- list=map.get(leaveUseVo.getCity());
- list.add(leaveUseVo);
- }else{
- list=new ArrayList<>();
- list.add(leaveUseVo);
- }
- map.put(leaveUseVo.getCity(),list);
- }
- List<FloorNoUserVo> resultList=new ArrayList<>();
- List<FloorNoUserVo> cityList=new ArrayList<>();
- double abuildingAreaIdelArea=0l;
- double abuildingAreaRentArea=0l;
- double abuildArea=0l;
- double abuildingAreaUnavailable=0l;
- double abuildingAreaUseArea=0l;
- for(Map.Entry<String,List<FloorNoUserVo>> entry:map.entrySet()) {
- List<FloorNoUserVo> list = entry.getValue();
- //对该list相同的县进行统计
- Map<String, List<FloorNoUserVo>> countyMap = new HashMap<>();
- for (FloorNoUserVo leaveUseVo : list) {
- if (countyMap.get(leaveUseVo.getCounty()) != null) {
- list = countyMap.get(leaveUseVo.getCounty());
- list.add(leaveUseVo);
- } else {
- list = new ArrayList<>();
- list.add(leaveUseVo);
- }
- countyMap.put(leaveUseVo.getCounty(), list);
- }
- List<FloorNoUserVo> countyList = new ArrayList<>();
- double citybuildingAreaIdelArea = 0l;
- double citybuildingAreaRentArea = 0l;
- double citybuildArea = 0l;
- double citybuildingAreaUnavailable = 0l;
- double citybuildingAreaUseArea = 0l;
- for (Map.Entry<String, List<FloorNoUserVo>> countyEntry : countyMap.entrySet()) {
- double buildingAreaIdelArea = 0l;
- double buildingAreaRentArea = 0l;
- double buildArea = 0l;
- double buildingAreaUnavailable = 0l;
- double buildingAreaUseArea = 0l;
- String reapStr="";
- if (countyEntry.getKey().equals("市本部")){
- reapStr="市本部"+repeatNum;
- repeatNum++;
- }
- FloorNoUserVo county = new FloorNoUserVo();
- for (FloorNoUserVo leaveUseVo : countyEntry.getValue()) {
- county.setCity(leaveUseVo.getCounty());
- county.setCounty(leaveUseVo.getCounty());
- if(!reapStr.equals("")){
- county.setCity(reapStr);
- county.setCounty(reapStr);
- county.setCountyName(reapStr);
- }
- buildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
- buildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
- buildArea += leaveUseVo.getBuildingArea();
- buildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
- buildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
- citybuildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
- citybuildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
- citybuildArea += leaveUseVo.getBuildingArea();
- citybuildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
- citybuildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
- abuildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
- abuildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
- abuildArea += leaveUseVo.getBuildingArea();
- abuildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
- abuildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
- }
- double avera=0;
- if(buildingAreaIdelArea+buildingAreaRentArea==0){
- avera=0;
- }else{
- try{
- avera=formatDouble(buildingAreaIdelArea/(buildingAreaRentArea+buildingAreaIdelArea))*100;
- }catch (Exception e){
- e.printStackTrace();
- }
- }
- county.setBuildingArea(formatDouble(buildArea));
- county.setBuildingAreaIdelArea(formatDouble(buildingAreaIdelArea));
- county.setBuildingAreaUnavailable(formatDouble(buildingAreaUnavailable));
- county.setBuildingAreaUseArea(formatDouble(buildingAreaUseArea));
- county.setBuildingAreaRentArea(formatDouble(buildingAreaRentArea));
- county.setAverage(formatDouble(avera));
- countyList.add(county);
- }
- List<FloorNoUserVo> orderCountyList=new ArrayList<>();
- try{
- //对countList 进行排序
- OtnAreaEntity area=otnAreaService.queryObject(list.get(0).getCity());
- List<OtnAreaEntity> countyAreaList=otnAreaService.getCityOption(area.getId());
- for (OtnAreaEntity otnAreaEntity : countyAreaList) {
- for (FloorNoUserVo wzCity : countyList) {
- if(wzCity.getCity().contains(otnAreaEntity.getName())){
- orderCountyList.add(wzCity);
- }
- }
- }
- }catch (Exception e){
- orderCountyList=countyList;
- e.printStackTrace();
- }
- double avera;
- if(citybuildingAreaRentArea+citybuildingAreaIdelArea==0){
- avera=0;
- }else{
- avera=formatDouble(citybuildingAreaIdelArea/(citybuildingAreaRentArea+citybuildingAreaIdelArea))*100;
- }
- FloorNoUserVo parent = new FloorNoUserVo();
- parent.setBuildingArea(formatDouble(citybuildArea));
- parent.setBuildingAreaIdelArea(formatDouble(citybuildingAreaIdelArea));
- parent.setBuildingAreaUnavailable(formatDouble(citybuildingAreaUnavailable));
- parent.setBuildingAreaUseArea(formatDouble(citybuildingAreaUseArea));
- parent.setBuildingAreaRentArea(formatDouble(citybuildingAreaRentArea));
- parent.setCity(list.get(0).getCity());
- parent.setCountyName(list.get(0).getCityName());
- parent.setAverage(formatDouble(avera));
- parent.setChildren(orderCountyList);
- cityList.add(parent);
- }
- //对cityList 进行排序
- List<OtnAreaEntity> areaList=otnAreaService.getCityOption("018");
- List<FloorNoUserVo> orderList=new ArrayList<>();
- for (OtnAreaEntity otnAreaEntity : areaList) {
- for (FloorNoUserVo wzCity : cityList) {
- if(otnAreaEntity.getName().equals(wzCity.getCity())){
- orderList.add(wzCity);
- }
- }
- }
- double aavera;
- if(abuildingAreaRentArea+abuildingAreaIdelArea==0){
- aavera=0;
- }else{
- aavera=formatDouble(abuildingAreaIdelArea/(abuildingAreaRentArea+abuildingAreaIdelArea))*100;
- }
- province.setBuildingArea(formatDouble(abuildArea));
- province.setBuildingAreaIdelArea(formatDouble(abuildingAreaIdelArea));
- province.setBuildingAreaUnavailable(formatDouble(abuildingAreaUnavailable));
- province.setBuildingAreaUseArea(formatDouble(abuildingAreaUseArea));
- province.setBuildingAreaRentArea(formatDouble(abuildingAreaRentArea));
- province.setAverage(formatDouble(aavera));
- province.setChildren(orderList);
- resultList.add(province);
- List<Object> colList=new ArrayList();;
- List<Object[]> allList = new ArrayList();
- for (int i = 0; i < resultList.size(); i++) {
- if(resultList.get(i).getCity().contains("省")){
- colList = new ArrayList();
- colList.add(resultList.get(i).getCity());
- colList.add("");
- colList.add("");
- colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaUnavailable(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaUseArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaIdelArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getBuildingAreaRentArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(resultList.get(i).getAverage(),true));
- allList.add(colList.toArray());
- //处理城市的
- List<FloorNoUserVo> cityList1=resultList.get(i).getChildren();
- for (FloorNoUserVo floorNoUserVo : cityList1) {
- colList = new ArrayList();
- colList.add("");
- colList.add(floorNoUserVo.getCity());
- colList.add("");
- colList.add(WzHouseMaintenaCostController.toThousands(floorNoUserVo.getBuildingArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(floorNoUserVo.getBuildingAreaUnavailable(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(floorNoUserVo.getBuildingAreaUseArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(floorNoUserVo.getBuildingAreaIdelArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(floorNoUserVo.getBuildingAreaRentArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(floorNoUserVo.getAverage(),true));
- allList.add(colList.toArray());
- //处理县城的
- List<FloorNoUserVo> countyList1=floorNoUserVo.getChildren();
- for (FloorNoUserVo noUserVo : countyList1) {
- colList = new ArrayList();
- colList.add("");
- colList.add("");
- colList.add(noUserVo.getCity());
- colList.add(WzHouseMaintenaCostController.toThousands(noUserVo.getBuildingArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(noUserVo.getBuildingAreaUnavailable(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(noUserVo.getBuildingAreaUseArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(noUserVo.getBuildingAreaIdelArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(noUserVo.getBuildingAreaRentArea(),true));
- colList.add(WzHouseMaintenaCostController.toThousands(noUserVo.getAverage(),true));
- allList.add(colList.toArray());
- }
- }
- }
- }
- String[] header = new String[]{
- "资产所属单位(一级)",
- "资产所属单位(二级)",
- "资产所属单位(三级)",
- "总面积",
- "不可使用面积",
- "自用面积",
- "闲置面积",
- "出租面积",
- "闲置率"
- };
- ee1.addSheetByArray(df.format(new Date()) + "清单", allList, header);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void responseLandDetail(DateFormat df, ExcelExport ee1, Map<String, Object> map){
- try {
- List<WzLandManageDetailsEntity> list = wzLandManageDetailsService.queryList(map);
- List<Object> colList;
- List<Object[]> allList = new ArrayList();
- for (int i = 0; i < list.size(); i++) {
- colList = new ArrayList();
- colList.add(list.get(i).getProvince());
- colList.add(list.get(i).getCity());
- colList.add(list.get(i).getCounty());
- colList.add(list.get(i).getLandAlias());
- colList.add(list.get(i).getLandNature());
- colList.add(list.get(i).getUsageRightsType());
- colList.add(list.get(i).getLandUse());
- colList.add(list.get(i).getGetDate());
- colList.add(list.get(i).getIdelLandBegindate());
- colList.add(list.get(i).getBuildingNameAlias());
- colList.add(list.get(i).getStandardAddress());
- colList.add(list.get(i).getInvestmentEntity()); //投资主体
- colList.add(list.get(i).getManagementHierarchy()); //管理层级
- colList.add(list.get(i).getOwnershipStatus()); //权属状态
- colList.add(list.get(i).getUseState()); //使用状态
- colList.add(list.get(i).getTotalLandArea()); //土地总面积(㎡)
- colList.add(list.get(i).getLandSelfUseArea()); //土地自用面积(㎡)
- colList.add(list.get(i).getIdelLandBegindate()); //土地闲置面积(㎡)
- colList.add(list.get(i).getLandRentUseArea()); //土地出租面积(㎡)
- colList.add(list.get(i).getLanNoUnavailableArea()); //土地不可使用面积(㎡)
- colList.add(list.get(i).getLandCertificate()); //是否有土地证
- colList.add(list.get(i).getNoLandCertificateReason()); //无土地证原因
- colList.add(list.get(i).getProtectLandRisk()); //是否有保地风险
- colList.add(list.get(i).getClearingLand()); //是否空地
- colList.add(list.get(i).getCourtyard()); //是否有院落
- colList.add(list.get(i).getUnrelatedAssets()); //未关联资产
- colList.add(list.get(i).getAssetCode()); //资产编号
- colList.add(list.get(i).getAstsLabe()); //资产标签号
- colList.add(list.get(i).getResponsibleDepartment()); //责任部门
- colList.add(list.get(i).getResponsiblePerson()); //责任人
- colList.add(list.get(i).getBuildingLongitude()); //经度
- colList.add(list.get(i).getBuildingDimension()); //纬度
- colList.add(list.get(i).getBuildingActualPropertyOwner()); //实际产权人
- colList.add(list.get(i).getSpecialInstructions()); //特殊说明
- colList.add(list.get(i).getUseAreaIdelArea()); //使用面积-闲置(㎡)
- colList.add(list.get(i).getUseAreaUnavailableArea()); //使用面积-不可使用(㎡)
- colList.add(list.get(i).getLandManageName()); //楼长姓名
- colList.add(list.get(i).getLandManageCompany()); //楼长所在单位
- colList.add(list.get(i).getLandLongitude()); //土地经度
- colList.add(list.get(i).getLandDimension()); //土地纬度
- colList.add(list.get(i).getLandActualPropertyOwner()); //土地实际产权人
- allList.add(colList.toArray());
- }
- String[] header = new String[]{
- "资产所属单位(一级)",
- "资产所属单位(二级)",
- "资产所属单位(三级)",
- "土地别名",
- "土地性质",
- "使用权类型",
- "地类用途",
- "取得日期",
- "闲置开始时间",
- "局址别名",
- "标准地址",
- "投资主体",
- "管理层级",
- "权属状态",
- "使用状态",
- "土地总面积(㎡)",
- "土地自用面积(㎡)",
- "土地闲置面积(㎡)",
- "土地出租面积(㎡)",
- "土地不可使用面积(㎡)",
- "是否有土地证",
- "无土地证原因",
- "是否有保地风险",
- "是否空地",
- "是否有院落",
- "未关联资产",
- "资产编号",
- "资产标签号",
- "责任部门",
- "责任人",
- "经度",
- "纬度",
- "实际产权人",
- "特殊说明",
- "使用面积-闲置(㎡)",
- "使用面积-不可使用(㎡)",
- "楼长姓名",
- "楼长所在单位",
- "土地经度",
- "土地纬度",
- "土地实际产权人"
- };
- ee1.addSheetByArray(df.format(new Date()) + "清单", allList, header);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public double formatDouble(double num){
- DecimalFormat format2 = new DecimalFormat("#.0000");
- String str2 = format2.format(num);
- double avera = Double.parseDouble(str2);
- return avera;
- }
- // /**
- // * 获取局址别名
- // */
- // @RequestMapping("/getBuildingNameCode")
- // @IgnoreAuth
- // public R getBuildingNameCode(@RequestBody PageMap pageMap) {
- // //查询列表数据
- // Query query = new Query(pageMap);
- // List<String> list = wzLandManageDetailsService.getBuildingNameCode(query);
- // Query query1 = new Query(pageMap);
- // int total = wzLandManageDetailsService.queryBuildingNameCodeTotal(query1);
- // PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());
- // return R.ok().put("page", pageUtil);
- // }
- //
- // /**
- // * 获取局址别名
- // */
- // @RequestMapping("/getBuildingNameAlias")
- // @IgnoreAuth
- // public R getBuildingNameAlias(@RequestBody PageMap pageMap) {
- // //查询列表数据
- // Query query = new Query(pageMap);
- // List<String> list = wzLandManageDetailsService.getBuildingNameAlias(query);
- // Query query1 = new Query(pageMap);
- // int total = wzLandManageDetailsService.getBuildingNameAliasTotal(query1);
- // PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());
- // return R.ok().put("page", pageUtil);
- // }
- }
|