Commit 9354b4b4aae10f4b6d8181c739eb5ccb30dd72aa
1 parent
f57e98ab
枚举值字典获取
Showing
2 changed files
with
26 additions
and
1 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/berthmanage/BerthManageController.java
| @@ -3,12 +3,15 @@ package com.zteits.irain.portal.web.parkinglotcloudplatform.berthmanage; | @@ -3,12 +3,15 @@ package com.zteits.irain.portal.web.parkinglotcloudplatform.berthmanage; | ||
| 3 | import java.text.SimpleDateFormat; | 3 | import java.text.SimpleDateFormat; |
| 4 | import java.util.ArrayList; | 4 | import java.util.ArrayList; |
| 5 | import java.util.Date; | 5 | import java.util.Date; |
| 6 | +import java.util.HashMap; | ||
| 6 | import java.util.List; | 7 | import java.util.List; |
| 8 | +import java.util.Map; | ||
| 7 | 9 | ||
| 8 | import javax.servlet.http.HttpServletRequest; | 10 | import javax.servlet.http.HttpServletRequest; |
| 9 | import javax.servlet.http.HttpServletResponse; | 11 | import javax.servlet.http.HttpServletResponse; |
| 10 | 12 | ||
| 11 | import org.apache.poi.xssf.usermodel.XSSFSheet; | 13 | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| 14 | +import org.springframework.beans.BeanUtils; | ||
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.stereotype.Controller; | 16 | import org.springframework.stereotype.Controller; |
| 14 | import org.springframework.web.bind.annotation.GetMapping; | 17 | import org.springframework.web.bind.annotation.GetMapping; |
| @@ -31,7 +34,10 @@ import com.zteits.clouds.api.apibase.bean.PageBean; | @@ -31,7 +34,10 @@ import com.zteits.clouds.api.apibase.bean.PageBean; | ||
| 31 | import com.zteits.clouds.api.apibase.exception.BizException; | 34 | import com.zteits.clouds.api.apibase.exception.BizException; |
| 32 | import com.zteits.clouds.api.dto.park.dto.BerthsDTO; | 35 | import com.zteits.clouds.api.dto.park.dto.BerthsDTO; |
| 33 | import com.zteits.clouds.api.dto.park.param.BerthManageRequest; | 36 | import com.zteits.clouds.api.dto.park.param.BerthManageRequest; |
| 37 | +import com.zteits.clouds.api.dto.sys.SysCodeValueDTO; | ||
| 38 | +import com.zteits.clouds.api.dto.sys.param.SysCodeValueByKindQueryRequest; | ||
| 34 | import com.zteits.clouds.api.service.park.BerthManageService; | 39 | import com.zteits.clouds.api.service.park.BerthManageService; |
| 40 | +import com.zteits.clouds.api.service.sys.SysCommonService; | ||
| 35 | 41 | ||
| 36 | import io.swagger.annotations.Api; | 42 | import io.swagger.annotations.Api; |
| 37 | import io.swagger.annotations.ApiOperation; | 43 | import io.swagger.annotations.ApiOperation; |
| @@ -57,6 +63,8 @@ import io.swagger.annotations.ApiOperation; | @@ -57,6 +63,8 @@ import io.swagger.annotations.ApiOperation; | ||
| 57 | public class BerthManageController extends BizController { | 63 | public class BerthManageController extends BizController { |
| 58 | @Autowired | 64 | @Autowired |
| 59 | private BerthManageService berthManageService; | 65 | private BerthManageService berthManageService; |
| 66 | + @Autowired | ||
| 67 | + private SysCommonService sysCommonService; | ||
| 60 | 68 | ||
| 61 | 69 | ||
| 62 | /** | 70 | /** |
| @@ -125,6 +133,18 @@ public class BerthManageController extends BizController { | @@ -125,6 +133,18 @@ public class BerthManageController extends BizController { | ||
| 125 | request.setBaseRequest(new BaseInfo(1, 1000)); | 133 | request.setBaseRequest(new BaseInfo(1, 1000)); |
| 126 | request.setSysCode(sysCode); | 134 | request.setSysCode(sysCode); |
| 127 | 135 | ||
| 136 | + //查询字典值 | ||
| 137 | + Map<String,String> codes = new HashMap<>(); | ||
| 138 | + SysCodeValueByKindQueryRequest codeValueRequest = new SysCodeValueByKindQueryRequest(); | ||
| 139 | + BeanUtils.copyProperties(request, codeValueRequest); | ||
| 140 | + codeValueRequest.setSysCodeKind("SYS_CODE_PARK_STYLE"); | ||
| 141 | + BizResult<List<SysCodeValueDTO>> codeValueDTO = sysCommonService.querySysCodeValueByKind(codeValueRequest); | ||
| 142 | + if(CollectionUtils.isNotEmpty(codeValueDTO.getData())){ | ||
| 143 | + for (SysCodeValueDTO dto : codeValueDTO.getData()) { | ||
| 144 | + codes.put(dto.getCodeValue(), dto.getCodeValueName()); | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | + | ||
| 128 | BizResult<PageBean<BerthsDTO>> bizResult = berthManageService.queryBerthByCondition(request); | 148 | BizResult<PageBean<BerthsDTO>> bizResult = berthManageService.queryBerthByCondition(request); |
| 129 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 149 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 130 | String[] title = new String[] { "序号","泊位编号", "所属停车场", "所属泊位区间", "停车方式" }; | 150 | String[] title = new String[] { "序号","泊位编号", "所属停车场", "所属泊位区间", "停车方式" }; |
| @@ -148,7 +168,7 @@ public class BerthManageController extends BizController { | @@ -148,7 +168,7 @@ public class BerthManageController extends BizController { | ||
| 148 | obj[index++] = b.getBerthNo(); | 168 | obj[index++] = b.getBerthNo(); |
| 149 | obj[index++] = b.getPlName(); | 169 | obj[index++] = b.getPlName(); |
| 150 | obj[index++] = b.getParkAreaName(); | 170 | obj[index++] = b.getParkAreaName(); |
| 151 | - obj[index++] = b.getParkType(); | 171 | + obj[index++] = codes.get(b.getParkType()); |
| 152 | contentList.add(obj); | 172 | contentList.add(obj); |
| 153 | } | 173 | } |
| 154 | ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | 174 | ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); |
src/main/resources/dubbo/dubbo-park-consumer.xml
| @@ -169,4 +169,9 @@ | @@ -169,4 +169,9 @@ | ||
| 169 | <!-- 地磁管理 --> | 169 | <!-- 地磁管理 --> |
| 170 | <dubbo:reference id="geomagneticManagementService" interface="com.zteits.clouds.api.service.park.GeomagneticManagementService" | 170 | <dubbo:reference id="geomagneticManagementService" interface="com.zteits.clouds.api.service.park.GeomagneticManagementService" |
| 171 | version="${spring.dubbo.provider.version}" timeout="30000"/> | 171 | version="${spring.dubbo.provider.version}" timeout="30000"/> |
| 172 | + | ||
| 173 | + <!-- sys 字典获取 --> | ||
| 174 | + <dubbo:reference id="sysCommonService" interface="com.zteits.clouds.api.service.sys.SysCommonService" | ||
| 175 | + version="${spring.dubbo.provider.version}" | ||
| 176 | + timeout="30000"/> | ||
| 172 | </beans> | 177 | </beans> |
| 173 | \ No newline at end of file | 178 | \ No newline at end of file |