Commit ecb84079858e5509c09597ec487158ae8e821c36
Merge branch 'branch_0808' of
http://192.168.1.195:9998/ZTEITS-Developers/zteits-bcp-portal.git into branch_0808 Conflicts: src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/parklotmanage/ParkLotManageController.java
Showing
9 changed files
with
368 additions
and
18 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/areamanage/AreaManageController.java
| ... | ... | @@ -5,15 +5,21 @@ import java.util.List; |
| 5 | 5 | import javax.servlet.http.HttpSession; |
| 6 | 6 | |
| 7 | 7 | import com.clouds.common.utils.ResultUtils; |
| 8 | +import com.clouds.common.web.SessionCommUtil; | |
| 8 | 9 | import com.clouds.common.web.vo.BizResultVO; |
| 9 | 10 | import com.clouds.common.web.vo.EasyUIDataGridVO; |
| 10 | 11 | import com.zteits.clouds.api.apibase.bean.BaseRequest; |
| 11 | 12 | import com.zteits.clouds.api.apibase.bean.BizResult; |
| 13 | +import com.zteits.clouds.api.dto.park.param.ParkInfoByAreaBlockIdsRequest; | |
| 12 | 14 | import com.zteits.clouds.api.dto.sys.AreaTreeDTO; |
| 15 | +import com.zteits.clouds.api.dto.sys.TbAreaDTO; | |
| 13 | 16 | import com.zteits.clouds.api.dto.sys.param.AreaBlockByOrgIdQueryRequest; |
| 17 | +import com.zteits.clouds.api.dto.sys.param.AreaBlockQueryByParentIdRequest; | |
| 18 | +import com.zteits.clouds.api.service.park.ParkingLotService; | |
| 14 | 19 | import com.zteits.clouds.api.service.sys.TbAreaService; |
| 15 | 20 | import io.swagger.annotations.Api; |
| 16 | 21 | import io.swagger.annotations.ApiOperation; |
| 22 | +import jdk.nashorn.internal.objects.annotations.Property; | |
| 17 | 23 | import org.slf4j.Logger; |
| 18 | 24 | import org.slf4j.LoggerFactory; |
| 19 | 25 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -45,6 +51,12 @@ public class AreaManageController { |
| 45 | 51 | @Autowired |
| 46 | 52 | private TbAreaService tbAreaService; |
| 47 | 53 | |
| 54 | + @Autowired | |
| 55 | + private ParkingLotService parkingLotService; | |
| 56 | + | |
| 57 | + @Autowired | |
| 58 | + private SessionCommUtil sessionCommUtil; | |
| 59 | + | |
| 48 | 60 | @ApiOperation("根据归属组织ID查询区域与区块树") |
| 49 | 61 | @PostMapping("/queryAreaAndBlockTree") |
| 50 | 62 | public BizResultVO<EasyUIDataGridVO<AreaTreeDTO>> queryAreaAndBlockTree(@RequestBody BaseRequest baseRequest) { |
| ... | ... | @@ -53,8 +65,7 @@ public class AreaManageController { |
| 53 | 65 | EasyUIDataGridVO<AreaTreeDTO> easyUIDataGridVO = new EasyUIDataGridVO<>(); |
| 54 | 66 | AreaBlockByOrgIdQueryRequest request = new AreaBlockByOrgIdQueryRequest(); |
| 55 | 67 | request.setSysCode(baseRequest.getSysCode()); |
| 56 | - // TODO 此处orgId 从当前登录操作人中取,现在先不限制 | |
| 57 | - request.setOrgId(1L); | |
| 68 | + request.setOrgId(sessionCommUtil.getUserInfo().getOrgId()); | |
| 58 | 69 | BizResult<List<AreaTreeDTO>> result = tbAreaService.queryAreaBlockByOrgId(request); |
| 59 | 70 | if (ResultUtils.isSuccess(result)) { |
| 60 | 71 | easyUIDataGridVO.setRows(result.getData()); |
| ... | ... | @@ -68,4 +79,26 @@ public class AreaManageController { |
| 68 | 79 | return resultVO; |
| 69 | 80 | } |
| 70 | 81 | |
| 82 | + @ApiOperation("根据区块ID查询区块下停车场数量") | |
| 83 | + @PostMapping("/queryParkInfoNumByAreaBlockIds") | |
| 84 | + public BizResultVO<Integer> queryParkInfoNumByAreaBlockIds(@RequestBody ParkInfoByAreaBlockIdsRequest request){ | |
| 85 | + BizResult<List<AreaTreeDTO>> bizResult = parkingLotService.queryParkInfoByAreaBlockIds(request); | |
| 86 | + BizResultVO<Integer> bizResultVO = new BizResultVO<>(); | |
| 87 | + Integer num; | |
| 88 | + if(ResultUtils.isSuccess(bizResult)){ | |
| 89 | + List<AreaTreeDTO> list = bizResult.getData(); | |
| 90 | + if(list != null){ | |
| 91 | + num = list.size(); | |
| 92 | + }else { | |
| 93 | + num = 0; | |
| 94 | + } | |
| 95 | + bizResultVO.setData(num); | |
| 96 | + }else{ | |
| 97 | + bizResultVO.setCode(bizResult.getErrCode().getCode()); | |
| 98 | + bizResultVO.setMsg(bizResult.getErrMsg()); | |
| 99 | + } | |
| 100 | + | |
| 101 | + return bizResultVO; | |
| 102 | + } | |
| 103 | + | |
| 71 | 104 | } | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthManageController.java
| ... | ... | @@ -135,6 +135,8 @@ public class BerthManageController extends BizController { |
| 135 | 135 | BerthManageRequest request = new BerthManageRequest(); |
| 136 | 136 | request.setSysCode(sysCode); |
| 137 | 137 | request.setPlNos(plNos); |
| 138 | + request.setParkTypes(parkTypes); | |
| 139 | + request.setParkAreaCodes(parkAreaCodes); | |
| 138 | 140 | request.setBaseRequest(new BaseInfo(1, 1000)); |
| 139 | 141 | |
| 140 | 142 | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/CloudsParDurationController.java
| 1 | 1 | package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; |
| 2 | 2 | |
| 3 | -import java.math.BigDecimal; | |
| 3 | +import java.text.ParseException; | |
| 4 | 4 | import java.text.SimpleDateFormat; |
| 5 | 5 | import java.util.ArrayList; |
| 6 | +import java.util.Date; | |
| 7 | +import java.util.HashMap; | |
| 6 | 8 | import java.util.List; |
| 9 | +import java.util.Map; | |
| 7 | 10 | |
| 8 | 11 | import javax.servlet.http.HttpServletRequest; |
| 9 | 12 | import javax.servlet.http.HttpServletResponse; |
| 10 | 13 | |
| 14 | +import org.apache.commons.collections.map.HashedMap; | |
| 11 | 15 | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| 12 | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | 17 | import org.springframework.util.CollectionUtils; |
| ... | ... | @@ -18,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestParam; |
| 18 | 22 | import org.springframework.web.bind.annotation.RestController; |
| 19 | 23 | |
| 20 | 24 | import com.alibaba.dubbo.common.utils.StringUtils; |
| 25 | +import com.clouds.common.utils.DateUtil; | |
| 21 | 26 | import com.clouds.common.utils.excle.ExcelUtil; |
| 22 | 27 | import com.clouds.common.utils.excle.ExcleFillDateManager; |
| 23 | 28 | import com.clouds.common.utils.excle.Layouter; |
| ... | ... | @@ -25,10 +30,8 @@ import com.clouds.common.web.BizController; |
| 25 | 30 | import com.clouds.common.web.vo.BizResultVO; |
| 26 | 31 | import com.zteits.clouds.api.apibase.bean.BizResult; |
| 27 | 32 | import com.zteits.clouds.api.apibase.bean.PageBean; |
| 28 | -import com.zteits.clouds.api.dto.clouds.dto.BillManageDTO; | |
| 29 | 33 | import com.zteits.clouds.api.dto.clouds.dto.ParkDurationDTO; |
| 30 | 34 | import com.zteits.clouds.api.dto.clouds.dto.ParkDurationForHourDTO; |
| 31 | -import com.zteits.clouds.api.dto.clouds.param.BillQueryRequest; | |
| 32 | 35 | import com.zteits.clouds.api.dto.clouds.param.ParkDurationRequest; |
| 33 | 36 | import com.zteits.clouds.api.service.clouds.CloudsParDurationService; |
| 34 | 37 | |
| ... | ... | @@ -44,12 +47,40 @@ public class CloudsParDurationController extends BizController{ |
| 44 | 47 | /** |
| 45 | 48 | * 企业云平台->停车时长折线图->按日.<br/> |
| 46 | 49 | * @return |
| 50 | + * @throws Exception | |
| 47 | 51 | */ |
| 48 | 52 | @ApiOperation("企业云平台->停车时长折线图->按日") |
| 49 | 53 | @PostMapping("/queryEchartsForParkDurationForDay") |
| 50 | - public BizResultVO<List<ParkDurationDTO>> queryEchartsForParkDurationForDay(@RequestBody ParkDurationRequest parkDurationRequest){ | |
| 51 | - BizResult<List<ParkDurationDTO>> result = cloudsParDurationService.queryEchartsForParkDurationForDay(parkDurationRequest); | |
| 52 | - return new BizResultVO<List<ParkDurationDTO>>(result); | |
| 54 | + public BizResultVO<Map<String,Object>> queryEchartsForParkDurationForDay(@RequestBody ParkDurationRequest parkDurationRequest,HttpServletResponse response) throws Exception{ | |
| 55 | + BizResult<Map<String,Object>> result = cloudsParDurationService.queryEchartsForParkDurationForDay(parkDurationRequest); | |
| 56 | + | |
| 57 | + return new BizResultVO<Map<String,Object>>(result); | |
| 58 | + } | |
| 59 | + | |
| 60 | + /** | |
| 61 | + * 获取2个时间的时间所有天数.<br/> | |
| 62 | + * @param parkDurationRequest | |
| 63 | + * @return | |
| 64 | + */ | |
| 65 | + public List<String> getTwoDaysDay(ParkDurationRequest parkDurationRequest){ | |
| 66 | + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | |
| 67 | + String beginTime = DateUtil.getDateString(parkDurationRequest.getParkOutBeginTime(),"yyyy-MM-dd"); | |
| 68 | + String endTime = DateUtil.getDateString(parkDurationRequest.getParkOutEndTime(),"yyyy-MM-dd"); | |
| 69 | + List<String> dateList =new ArrayList<String>(); | |
| 70 | + //获取开始结束之间的所有日期 | |
| 71 | + try { | |
| 72 | + List<Date> datas = DateUtil.getBetweenDates(format.parse(beginTime),format.parse(endTime)); | |
| 73 | + if(!CollectionUtils.isEmpty(datas)){ | |
| 74 | + for(Date e:datas){ | |
| 75 | + if(e != null){ | |
| 76 | + dateList.add(format.format(e)); | |
| 77 | + } | |
| 78 | + } | |
| 79 | + } | |
| 80 | + } catch (ParseException e) { | |
| 81 | + e.printStackTrace(); | |
| 82 | + } | |
| 83 | + return dateList; | |
| 53 | 84 | } |
| 54 | 85 | |
| 55 | 86 | /** |
| ... | ... | @@ -228,12 +259,13 @@ public class CloudsParDurationController extends BizController{ |
| 228 | 259 | /** |
| 229 | 260 | * 企业云平台->停车时长折线图->按日.<br/> |
| 230 | 261 | * @return |
| 262 | + * @throws Exception | |
| 231 | 263 | */ |
| 232 | 264 | @ApiOperation("企业云平台->停车时长折线图->按月") |
| 233 | 265 | @PostMapping("/queryEchartsForParkDurationForMonth") |
| 234 | - public BizResultVO<List<ParkDurationDTO>> queryEchartsForParkDurationForMonth(@RequestBody ParkDurationRequest parkDurationRequest){ | |
| 235 | - BizResult<List<ParkDurationDTO>> result = cloudsParDurationService.queryEchartsForParkDurationForMonth(parkDurationRequest); | |
| 236 | - return new BizResultVO<List<ParkDurationDTO>>(result); | |
| 266 | + public BizResultVO<Map<String,Object>> queryEchartsForParkDurationForMonth(@RequestBody ParkDurationRequest parkDurationRequest) throws Exception{ | |
| 267 | + BizResult<Map<String,Object>> result = cloudsParDurationService.queryEchartsForParkDurationForMonth(parkDurationRequest); | |
| 268 | + return new BizResultVO<Map<String,Object>>(result); | |
| 237 | 269 | } |
| 238 | 270 | |
| 239 | 271 | /** |
| ... | ... | @@ -298,4 +330,5 @@ public class CloudsParDurationController extends BizController{ |
| 298 | 330 | |
| 299 | 331 | |
| 300 | 332 | |
| 333 | + | |
| 301 | 334 | } | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/MonthBillManagementController.java
| ... | ... | @@ -255,7 +255,7 @@ public class MonthBillManagementController extends BizController { |
| 255 | 255 | throws Exception { |
| 256 | 256 | // 2.调用接口查询当前登录人管辖的停车场名称 |
| 257 | 257 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 258 | - List<String> plNos = userInfo.getOrgIds(); | |
| 258 | + List<String> plNos = userInfo.getPlNos(); | |
| 259 | 259 | // UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 260 | 260 | // List<String> plNos = new ArrayList<>(); |
| 261 | 261 | // if (userInfo != null) { |
| ... | ... | @@ -291,7 +291,7 @@ public class MonthBillManagementController extends BizController { |
| 291 | 291 | throws Exception { |
| 292 | 292 | // 2.调用接口查询当前登录人管辖的停车场名称 |
| 293 | 293 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 294 | - List<String> plNos = userInfo.getOrgIds(); | |
| 294 | + List<String> plNos = userInfo.getPlNos(); | |
| 295 | 295 | // List<String> plNos = new ArrayList<>(); |
| 296 | 296 | // if (userInfo != null) { |
| 297 | 297 | // TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); |
| ... | ... | @@ -441,7 +441,7 @@ public class MonthBillManagementController extends BizController { |
| 441 | 441 | billQueryRequest.setBaseRequest(new BaseInfo(1, 0)); |
| 442 | 442 | // 2.调用接口查询当前登录人管辖的停车场名称 |
| 443 | 443 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 444 | - List<String> plNos = userInfo.getOrgIds(); | |
| 444 | + List<String> plNos = userInfo.getPlNos(); | |
| 445 | 445 | // // 2.调用接口查询当前登录人管辖的停车场名称 |
| 446 | 446 | // UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 447 | 447 | // List<String> plNos = new ArrayList<>(); | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/ParkLotStatisticController.java
| ... | ... | @@ -118,7 +118,7 @@ public class ParkLotStatisticController { |
| 118 | 118 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 119 | 119 | List<String> plNos=Lists.newArrayList(); |
| 120 | 120 | if(null != userInfo){ |
| 121 | - plNos= userInfo.getOrgIds(); | |
| 121 | + plNos= userInfo.getPlNos(); | |
| 122 | 122 | } |
| 123 | 123 | // if(userInfo!=null){ |
| 124 | 124 | // TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/RealTimeMonitorController.java
| ... | ... | @@ -28,8 +28,10 @@ import com.zteits.clouds.api.apibase.bean.PageBean; |
| 28 | 28 | import com.zteits.clouds.api.apibase.constants.ErrorType; |
| 29 | 29 | import com.zteits.clouds.api.apibase.exception.BizException; |
| 30 | 30 | import com.zteits.clouds.api.dto.clouds.param.RealTimeMonitoringRequest; |
| 31 | +import com.zteits.clouds.api.dto.park.dto.BerthsDTO; | |
| 31 | 32 | import com.zteits.clouds.api.dto.park.dto.ParkOccupancyRateDTO; |
| 32 | 33 | import com.zteits.clouds.api.dto.park.dto.TpPEqpLogDTO; |
| 34 | +import com.zteits.clouds.api.dto.park.param.QueryBerthForPageRequest; | |
| 33 | 35 | import com.zteits.clouds.api.dto.sys.SysOpDTO; |
| 34 | 36 | import com.zteits.clouds.api.dto.sys.SysOrgDTO; |
| 35 | 37 | import com.zteits.clouds.api.dto.sys.SysRoleDTO; |
| ... | ... | @@ -38,6 +40,7 @@ import com.zteits.clouds.api.dto.sys.param.SysOpForPageRequest; |
| 38 | 40 | import com.zteits.clouds.api.dto.sys.param.SysOpSaveOrModfiyRequest; |
| 39 | 41 | import com.zteits.clouds.api.dto.sys.param.SysOrgPageQueryRequest; |
| 40 | 42 | import com.zteits.clouds.api.dto.sys.param.SysRolePageQueryRequest; |
| 43 | +import com.zteits.clouds.api.service.park.BerthManageService; | |
| 41 | 44 | import com.zteits.clouds.api.service.park.EqpBerthsService; |
| 42 | 45 | |
| 43 | 46 | import io.swagger.annotations.Api; |
| ... | ... | @@ -67,6 +70,8 @@ public class RealTimeMonitorController extends BizController { |
| 67 | 70 | |
| 68 | 71 | @Autowired |
| 69 | 72 | private EqpBerthsService eqpBerthsService; |
| 73 | + @Autowired | |
| 74 | + private BerthManageService berthManageService; | |
| 70 | 75 | |
| 71 | 76 | |
| 72 | 77 | /** |
| ... | ... | @@ -78,8 +83,8 @@ public class RealTimeMonitorController extends BizController { |
| 78 | 83 | * langlw 2017-08-30 |
| 79 | 84 | */ |
| 80 | 85 | @ApiOperation("分页查询停车场设备日志数据") |
| 81 | - @PostMapping("/queryOpsBySysCode") | |
| 82 | - public BizResultVO<EasyUIDataGridVO<TpPEqpLogDTO>> queryUsersPageList( | |
| 86 | + @PostMapping("/queryParkEqpForPageByPlNo") | |
| 87 | + public BizResultVO<EasyUIDataGridVO<TpPEqpLogDTO>> queryParkEqpForPageByPlNo( | |
| 83 | 88 | @RequestBody RealTimeMonitoringRequest request) |
| 84 | 89 | throws Exception { |
| 85 | 90 | logger.info("调用分页查询停车场设备日志数据dubbo服务入参:request={}"+JSONObject.toJSONString(request)); |
| ... | ... | @@ -109,4 +114,44 @@ public class RealTimeMonitorController extends BizController { |
| 109 | 114 | logger.info("调用分组查询停车场占用率dubbo服务返回信息:request={}"+JSONObject.toJSONString(result)); |
| 110 | 115 | return new BizResultVO<List<ParkOccupancyRateDTO>>(result); |
| 111 | 116 | } |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + /** | |
| 121 | + * 通过车位对象分页查询车位信息 | |
| 122 | + * query berths by berth for page | |
| 123 | + * langlw 2017-8-31 | |
| 124 | + * @param request | |
| 125 | + * @return | |
| 126 | + * @throws Exception | |
| 127 | + */ | |
| 128 | + @ApiOperation("通过车位对象分页查询车位信息") | |
| 129 | + @PostMapping("/queryBerthByBerthForPage") | |
| 130 | + public BizResultVO<EasyUIDataGridVO<BerthsDTO>> queryBerthByBerthForPage( | |
| 131 | + @RequestBody QueryBerthForPageRequest request) | |
| 132 | + throws Exception { | |
| 133 | + logger.info("通过车位对象分页查询车位信息dubbo服务入参:request={}"+JSONObject.toJSONString(request)); | |
| 134 | + BizResult<PageBean<BerthsDTO>> result = berthManageService.queryBerthByBerth(request); | |
| 135 | + logger.info("通过车位对象分页查询车位信息dubbo服务返回信息:response={}"+JSONObject.toJSONString(result)); | |
| 136 | + return returnJqGridData(result, BerthsDTO.class); | |
| 137 | + } | |
| 138 | + | |
| 139 | + /** | |
| 140 | + * 分组查询停车场占用率 | |
| 141 | + * | |
| 142 | + * @param request | |
| 143 | + * @return | |
| 144 | + * @throws Exception | |
| 145 | + * langlw 2017-08-31 | |
| 146 | + */ | |
| 147 | + @ApiOperation("分组查询停车场占用率") | |
| 148 | + @PostMapping("/queryParkBerthOccupancyRate") | |
| 149 | + public BizResultVO<List<ParkOccupancyRateDTO>> queryParkBerthOccupancyRate( | |
| 150 | + @RequestBody QueryBerthForPageRequest request) | |
| 151 | + throws Exception { | |
| 152 | + logger.info("调用分组查询停车场占用率dubbo服务入参:request={}"+JSONObject.toJSONString(request)); | |
| 153 | + BizResult<List<ParkOccupancyRateDTO>> result = berthManageService.queryParkOccupancyRate(request); | |
| 154 | + logger.info("调用分组查询停车场占用率dubbo服务返回信息:request={}"+JSONObject.toJSONString(result)); | |
| 155 | + return new BizResultVO<List<ParkOccupancyRateDTO>>(result); | |
| 156 | + } | |
| 112 | 157 | } | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/devicemanagement/PdaController.java
0 → 100644
| 1 | +package com.zteits.irain.portal.web.parkinglotcloudplatform.devicemanagement; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.util.ArrayList; | |
| 5 | +import java.util.List; | |
| 6 | + | |
| 7 | +import javax.servlet.http.HttpServletRequest; | |
| 8 | +import javax.servlet.http.HttpServletResponse; | |
| 9 | + | |
| 10 | +import org.apache.poi.xssf.usermodel.XSSFSheet; | |
| 11 | +import org.slf4j.Logger; | |
| 12 | +import org.slf4j.LoggerFactory; | |
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 14 | +import org.springframework.beans.factory.annotation.Value; | |
| 15 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 16 | +import org.springframework.web.bind.annotation.PostMapping; | |
| 17 | +import org.springframework.web.bind.annotation.RequestBody; | |
| 18 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 19 | +import org.springframework.web.bind.annotation.RestController; | |
| 20 | +import org.springframework.web.multipart.MultipartFile; | |
| 21 | + | |
| 22 | +import com.clouds.common.utils.DateUtil; | |
| 23 | +import com.clouds.common.utils.excle.ExcelReadUtil; | |
| 24 | +import com.clouds.common.utils.excle.ExcelUtil; | |
| 25 | +import com.clouds.common.utils.excle.ExcleFillDateManager; | |
| 26 | +import com.clouds.common.utils.excle.Layouter; | |
| 27 | +import com.clouds.common.web.BizController; | |
| 28 | +import com.clouds.common.web.vo.BizResultVO; | |
| 29 | +import com.clouds.common.web.vo.EasyUIDataGridVO; | |
| 30 | +import com.google.common.collect.Lists; | |
| 31 | +import com.xiaoleilu.hutool.util.CollectionUtil; | |
| 32 | +import com.zteits.clouds.api.apibase.bean.BizResult; | |
| 33 | +import com.zteits.clouds.api.apibase.bean.PageBean; | |
| 34 | +import com.zteits.clouds.api.apibase.constants.ErrorType; | |
| 35 | +import com.zteits.clouds.api.apibase.exception.BizException; | |
| 36 | +import com.zteits.clouds.api.dto.park.dto.TpPPdaDTO; | |
| 37 | +import com.zteits.clouds.api.dto.park.param.TpPPdaRequest; | |
| 38 | +import com.zteits.clouds.api.dto.park.param.TpPPdaSRequest; | |
| 39 | +import com.zteits.clouds.api.service.park.TpPPdaService; | |
| 40 | +import com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic.InOutParkStatisticController; | |
| 41 | + | |
| 42 | +import io.swagger.annotations.ApiOperation; | |
| 43 | + | |
| 44 | +/** | |
| 45 | + * PDA管理控制器 | |
| 46 | + * | |
| 47 | + * Copyright: Copyright (c) 2017 ZTE-ITS | |
| 48 | + * | |
| 49 | + * @ClassName: PdaController.java | |
| 50 | + * @Description: | |
| 51 | + * @version: v1.0.0 | |
| 52 | + * @author: wangbiao | |
| 53 | + * @date: 2017年8月31日 下午3:05:03 | |
| 54 | + * Modification History: | |
| 55 | + * Date Author Version Description | |
| 56 | + *---------------------------------------------------------* | |
| 57 | + * 2017年8月31日 wangbiao v1.0.0 创建 | |
| 58 | + */ | |
| 59 | +@RestController | |
| 60 | +public class PdaController extends BizController { | |
| 61 | + | |
| 62 | + private static final Logger logger = LoggerFactory.getLogger(InOutParkStatisticController.class); | |
| 63 | + | |
| 64 | + @Autowired | |
| 65 | + private TpPPdaService tpPPdaService; | |
| 66 | + | |
| 67 | + @Value("${project.syscode}") | |
| 68 | + private String sysCode; | |
| 69 | + | |
| 70 | + @ApiOperation("PDA信息信息") | |
| 71 | + @PostMapping("/queryPdaInfo4pabe") | |
| 72 | + public BizResultVO<EasyUIDataGridVO<TpPPdaDTO>> queryPdaInfo4pabe(@RequestBody TpPPdaRequest tpPPdaRequest, HttpServletRequest request, | |
| 73 | + HttpServletResponse response){ | |
| 74 | + BizResult<PageBean<TpPPdaDTO>> bizResult = new BizResult<PageBean<TpPPdaDTO>>(); | |
| 75 | + try { | |
| 76 | + tpPPdaRequest.setSysCode(sysCode); | |
| 77 | + bizResult = tpPPdaService.queryPdaInfo4pabe(tpPPdaRequest); | |
| 78 | + if(bizResult.isSuccess()){ | |
| 79 | + return returnJqGridData(bizResult, TpPPdaDTO.class); | |
| 80 | + } | |
| 81 | + } catch (Exception e) { | |
| 82 | + logger.debug("分页查询pda信息异常:{}",bizResult.getErrMsg()); | |
| 83 | + } | |
| 84 | + return new BizResultVO<EasyUIDataGridVO<TpPPdaDTO>>(); | |
| 85 | + } | |
| 86 | + | |
| 87 | + @ApiOperation("新增PDA信息信息") | |
| 88 | + @PostMapping("/insertPda") | |
| 89 | + public BizResultVO<Integer> insertPda(@RequestBody TpPPdaRequest tpPPdaRequest, HttpServletRequest request, | |
| 90 | + HttpServletResponse response){ | |
| 91 | + tpPPdaRequest.setSysCode(sysCode); | |
| 92 | + BizResult<Integer> bizResult = tpPPdaService.insertPda(tpPPdaRequest); | |
| 93 | + if(bizResult.isSuccess()){ | |
| 94 | + return new BizResultVO<Integer>(bizResult); | |
| 95 | + }else{ | |
| 96 | + logger.debug("新增PDA信息信息异常 :{}",bizResult.getErrMsg()); | |
| 97 | + } | |
| 98 | + return new BizResultVO<Integer>(); | |
| 99 | + } | |
| 100 | + | |
| 101 | + @ApiOperation("删除PDA信息信息") | |
| 102 | + @PostMapping("/deletePda") | |
| 103 | + public BizResultVO<Integer> deletePda(@RequestBody TpPPdaRequest tpPPdaRequest, HttpServletRequest request, | |
| 104 | + HttpServletResponse response){ | |
| 105 | + tpPPdaRequest.setSysCode(sysCode); | |
| 106 | + BizResult<Integer> bizResult = tpPPdaService.deletetPda(tpPPdaRequest); | |
| 107 | + if(bizResult.isSuccess()){ | |
| 108 | + return new BizResultVO<Integer>(bizResult); | |
| 109 | + }else{ | |
| 110 | + logger.debug("删除PDA信息信息异常 :{}",bizResult.getErrMsg()); | |
| 111 | + } | |
| 112 | + return new BizResultVO<Integer>(); | |
| 113 | + } | |
| 114 | + | |
| 115 | + @ApiOperation("删除PDA信息信息") | |
| 116 | + @PostMapping("/deleteBatchPda") | |
| 117 | + public BizResultVO<Integer> deleteBatchPda(@RequestBody TpPPdaSRequest tpPPdaSRequest, HttpServletRequest request, | |
| 118 | + HttpServletResponse response){ | |
| 119 | + tpPPdaSRequest.setSysCode(sysCode); | |
| 120 | + BizResult<Integer> bizResult = tpPPdaService.deleteBatchPda(tpPPdaSRequest); | |
| 121 | + if(bizResult.isSuccess()){ | |
| 122 | + return new BizResultVO<Integer>(bizResult); | |
| 123 | + }else{ | |
| 124 | + logger.debug("删除PDA信息信息异常 :{}",bizResult.getErrMsg()); | |
| 125 | + } | |
| 126 | + return new BizResultVO<Integer>(); | |
| 127 | + } | |
| 128 | + | |
| 129 | + @ApiOperation("根据id查询PDA信息") | |
| 130 | + @PostMapping("/queryPdaById") | |
| 131 | + public BizResultVO<TpPPdaDTO> queryPdaById(@RequestBody TpPPdaRequest tpPPdaRequest, HttpServletRequest request, | |
| 132 | + HttpServletResponse response){ | |
| 133 | + tpPPdaRequest.setSysCode(sysCode); | |
| 134 | + BizResult<TpPPdaDTO> bizResult = tpPPdaService.queryPdaById(tpPPdaRequest); | |
| 135 | + if(bizResult.isSuccess()){ | |
| 136 | + return new BizResultVO<TpPPdaDTO>(bizResult); | |
| 137 | + }else{ | |
| 138 | + logger.debug("根据id查询PDA信息异常 :{}",bizResult.getErrMsg()); | |
| 139 | + } | |
| 140 | + return new BizResultVO<TpPPdaDTO>(); | |
| 141 | + } | |
| 142 | + | |
| 143 | + @ApiOperation("修改PDA信息") | |
| 144 | + @PostMapping("/updatePda") | |
| 145 | + public BizResultVO<Integer> updatePda(@RequestBody TpPPdaRequest tpPPdaRequest, HttpServletRequest request, | |
| 146 | + HttpServletResponse response){ | |
| 147 | + tpPPdaRequest.setSysCode(sysCode); | |
| 148 | + BizResult<Integer> bizResult = tpPPdaService.updatePda(tpPPdaRequest); | |
| 149 | + if(bizResult.isSuccess()){ | |
| 150 | + return new BizResultVO<Integer>(bizResult); | |
| 151 | + }else{ | |
| 152 | + logger.debug("修改PDA信息异常 :{}",bizResult.getErrMsg()); | |
| 153 | + } | |
| 154 | + return new BizResultVO<Integer>(); | |
| 155 | + } | |
| 156 | + | |
| 157 | + @ApiOperation("pda信息导出excel") | |
| 158 | + @GetMapping("exportpdaExcel") | |
| 159 | + public void exportBerthInfoExcel(@RequestBody TpPPdaRequest tpPPdaRequest, HttpServletRequest requests, HttpServletResponse response) { | |
| 160 | + tpPPdaRequest.setSysCode(sysCode); | |
| 161 | + BizResult<List<TpPPdaDTO>> list = tpPPdaService.queryPdaInfo(tpPPdaRequest); | |
| 162 | + String[] title = new String[] { "序号","设备编号", "设备名称", "设备类型", "状态","持有人","资源描述" }; | |
| 163 | + String sheetName = "PDA信息"; | |
| 164 | + String fileName = sheetName+DateUtil.getDate(); | |
| 165 | + // 1.创建excel信息 | |
| 166 | + XSSFSheet workSheet = ExcelUtil.createExcel(fileName); | |
| 167 | + // 2.设置excel表头和表体 | |
| 168 | + Layouter.buildReport(workSheet, title, 0, 0); | |
| 169 | + // 3.填充数据 | |
| 170 | + List<Object[]> contentList = new ArrayList<Object[]>(); | |
| 171 | + int number = 1; | |
| 172 | + if(list.isSuccess() && CollectionUtil.isNotEmpty(list.getData())){ | |
| 173 | + for (TpPPdaDTO b : list.getData()) { | |
| 174 | + Object[] obj = new Object[title.length]; | |
| 175 | + int index = 0; | |
| 176 | + obj[index++] = number++; | |
| 177 | + obj[index++] = b.getId(); | |
| 178 | + obj[index++] = b.getPdaNo(); | |
| 179 | + obj[index++] = b.getPdaName(); | |
| 180 | + obj[index++] = b.getPdaType(); | |
| 181 | + obj[index++] = b.getPdaStatus(); | |
| 182 | + obj[index++] = b.getOwnerName(); | |
| 183 | + obj[index++] = b.getRemark(); | |
| 184 | + contentList.add(obj); | |
| 185 | + } | |
| 186 | + } | |
| 187 | + ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | |
| 188 | + fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); | |
| 189 | + // 4.excel输出配置 | |
| 190 | + ExcelUtil.write(response, workSheet, fileName); | |
| 191 | + } | |
| 192 | + | |
| 193 | + | |
| 194 | + @ApiOperation("pda信息 导入模板下载") | |
| 195 | + @GetMapping("exportpdaExcel") | |
| 196 | + public void exportModelExcel(HttpServletRequest requests, HttpServletResponse response) { | |
| 197 | + String[] title = new String[] { "设备编号", "设备名称", "设备类型","停车场编号","sim卡号","持有人编号","持有人名称","状态","资源描述" }; | |
| 198 | + String fileName = "PDA信息导入模板"; | |
| 199 | + // 1.创建excel信息 | |
| 200 | + XSSFSheet workSheet = ExcelUtil.createExcel(fileName); | |
| 201 | + // 2.设置excel表头和表体 | |
| 202 | + Layouter.buildReport(workSheet, title, 0, 0); | |
| 203 | + // 3.填充数据 | |
| 204 | + ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | |
| 205 | + fillUserManager.fillSalesOrga(workSheet, title, null, 2); | |
| 206 | + // 4.excel输出配置 | |
| 207 | + ExcelUtil.write(response, workSheet, fileName); | |
| 208 | + } | |
| 209 | + | |
| 210 | + | |
| 211 | + @PostMapping("/importPda") | |
| 212 | + public BizResultVO<Integer> importPda(@RequestParam(value="excelFile") MultipartFile file,HttpServletRequest request) throws IOException{ | |
| 213 | + if(file==null){ | |
| 214 | + throw new BizException(ErrorType.PARAMM_NULL, "导入文件不能为空"); | |
| 215 | + } | |
| 216 | + //读取Excel数据到List中 | |
| 217 | + List<ArrayList<String>> list = ExcelReadUtil.readExcel(file); | |
| 218 | + //list中存的就是excel中的数据,可以根据excel中每一列的值转换成你所需要的值(从0开始),如: | |
| 219 | + TpPPdaRequest tpPPdaRequest = null; | |
| 220 | + List<TpPPdaRequest> padList = Lists.newArrayList(); | |
| 221 | + for(ArrayList<String> arr:list){ | |
| 222 | + tpPPdaRequest= new TpPPdaRequest(); | |
| 223 | + tpPPdaRequest.setPdaNo(arr.get(0)); | |
| 224 | + padList.add(tpPPdaRequest); | |
| 225 | + } | |
| 226 | + TpPPdaSRequest TpPPdaSRequest = new TpPPdaSRequest(); | |
| 227 | + TpPPdaSRequest.setPadList(padList); | |
| 228 | + BizResult<Integer> rsInteger = tpPPdaService.insertBatchPda(TpPPdaSRequest); | |
| 229 | + return new BizResultVO<Integer>(rsInteger); | |
| 230 | + } | |
| 231 | + | |
| 232 | +} | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/parklotmanage/ParkLotManageController.java
| ... | ... | @@ -127,7 +127,7 @@ public class ParkLotManageController extends BizController{ |
| 127 | 127 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 128 | 128 | List<String> plNos =new ArrayList<>(); |
| 129 | 129 | if(null !=userInfo){ |
| 130 | - plNos = userInfo.getOrgIds(); | |
| 130 | + plNos = userInfo.getPlNos(); | |
| 131 | 131 | } |
| 132 | 132 | return plNos; |
| 133 | 133 | } | ... | ... |
src/main/resources/dubbo/dubbo-park-consumer.xml
| ... | ... | @@ -157,4 +157,9 @@ |
| 157 | 157 | <dubbo:reference id="berthManageService" interface="com.zteits.clouds.api.service.park.BerthManageService" |
| 158 | 158 | version="${spring.dubbo.provider.version}" |
| 159 | 159 | timeout="30000"/> |
| 160 | + | |
| 161 | + <!--企业云平台-设备管理 -pda管理--> | |
| 162 | + <dubbo:reference id="tpPPdaService" interface="com.zteits.clouds.api.service.park.TpPPdaService" | |
| 163 | + version="${spring.dubbo.provider.version}" | |
| 164 | + timeout="30000"/> | |
| 160 | 165 | </beans> |
| 161 | 166 | \ No newline at end of file | ... | ... |