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 | 3 | import java.text.SimpleDateFormat; |
| 4 | 4 | import java.util.ArrayList; |
| 5 | 5 | import java.util.Date; |
| 6 | +import java.util.HashMap; | |
| 6 | 7 | import java.util.List; |
| 8 | +import java.util.Map; | |
| 7 | 9 | |
| 8 | 10 | import javax.servlet.http.HttpServletRequest; |
| 9 | 11 | import javax.servlet.http.HttpServletResponse; |
| 10 | 12 | |
| 11 | 13 | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| 14 | +import org.springframework.beans.BeanUtils; | |
| 12 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | 16 | import org.springframework.stereotype.Controller; |
| 14 | 17 | import org.springframework.web.bind.annotation.GetMapping; |
| ... | ... | @@ -31,7 +34,10 @@ import com.zteits.clouds.api.apibase.bean.PageBean; |
| 31 | 34 | import com.zteits.clouds.api.apibase.exception.BizException; |
| 32 | 35 | import com.zteits.clouds.api.dto.park.dto.BerthsDTO; |
| 33 | 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 | 39 | import com.zteits.clouds.api.service.park.BerthManageService; |
| 40 | +import com.zteits.clouds.api.service.sys.SysCommonService; | |
| 35 | 41 | |
| 36 | 42 | import io.swagger.annotations.Api; |
| 37 | 43 | import io.swagger.annotations.ApiOperation; |
| ... | ... | @@ -57,6 +63,8 @@ import io.swagger.annotations.ApiOperation; |
| 57 | 63 | public class BerthManageController extends BizController { |
| 58 | 64 | @Autowired |
| 59 | 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 | 133 | request.setBaseRequest(new BaseInfo(1, 1000)); |
| 126 | 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 | 148 | BizResult<PageBean<BerthsDTO>> bizResult = berthManageService.queryBerthByCondition(request); |
| 129 | 149 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 130 | 150 | String[] title = new String[] { "序号","泊位编号", "所属停车场", "所属泊位区间", "停车方式" }; |
| ... | ... | @@ -148,7 +168,7 @@ public class BerthManageController extends BizController { |
| 148 | 168 | obj[index++] = b.getBerthNo(); |
| 149 | 169 | obj[index++] = b.getPlName(); |
| 150 | 170 | obj[index++] = b.getParkAreaName(); |
| 151 | - obj[index++] = b.getParkType(); | |
| 171 | + obj[index++] = codes.get(b.getParkType()); | |
| 152 | 172 | contentList.add(obj); |
| 153 | 173 | } |
| 154 | 174 | ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | ... | ... |
src/main/resources/dubbo/dubbo-park-consumer.xml
| ... | ... | @@ -169,4 +169,9 @@ |
| 169 | 169 | <!-- 地磁管理 --> |
| 170 | 170 | <dubbo:reference id="geomagneticManagementService" interface="com.zteits.clouds.api.service.park.GeomagneticManagementService" |
| 171 | 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 | 177 | </beans> |
| 173 | 178 | \ No newline at end of file | ... | ... |