Commit a6132677bfa4b14ade3684f6955dddbf458c24d1
1 parent
ba1af3fd
修复sq当前时间格式
Showing
3 changed files
with
39 additions
and
23 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/RoadStreetController.java
| ... | ... | @@ -82,10 +82,9 @@ public class RoadStreetController { |
| 82 | 82 | |
| 83 | 83 | @GetMapping("/list") |
| 84 | 84 | @Operation(summary = "获得街道列表") |
| 85 | - @Parameter(name = "busi_line", description = "业务线", required = true, example = "1024") | |
| 86 | 85 | @PreAuthorize("@ss.hasPermission('garden:road-street:query')") |
| 87 | - public CommonResult<List<RoadStreetRespVO>> getRoadStreet(@RequestParam("busi_line") @NotBlank String busiLine) { | |
| 88 | - List<RoadStreetDO> roadStreet = roadStreetService.getRoadStreetList(busiLine); | |
| 86 | + public CommonResult<List<RoadStreetRespVO>> getRoadStreet() { | |
| 87 | + List<RoadStreetDO> roadStreet = roadStreetService.getRoadStreetList(null); | |
| 89 | 88 | return success(BeanUtils.toBean(roadStreet, RoadStreetRespVO.class)); |
| 90 | 89 | } |
| 91 | 90 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/PlanConstants.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadStreetServiceImpl.java
| 1 | 1 | package com.zteits.urbanops.module.garden.service.road; |
| 2 | 2 | |
| 3 | -import cn.hutool.core.collection.CollUtil; | |
| 4 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 5 | -import org.springframework.stereotype.Service; | |
| 6 | -import jakarta.annotation.Resource; | |
| 7 | -import org.springframework.validation.annotation.Validated; | |
| 8 | -import org.springframework.transaction.annotation.Transactional; | |
| 9 | - | |
| 10 | -import java.util.*; | |
| 11 | - | |
| 12 | -import com.zteits.urbanops.module.garden.controller.admin.road.vo.*; | |
| 13 | -import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadStreetDO; | |
| 3 | +import com.zteits.urbanops.framework.common.biz.system.dict.DictDataCommonApi; | |
| 4 | +import com.zteits.urbanops.framework.common.biz.system.dict.dto.DictDataRespDTO; | |
| 14 | 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 15 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 16 | 6 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 17 | - | |
| 7 | +import com.zteits.urbanops.module.garden.controller.admin.road.vo.RoadStreetPageReqVO; | |
| 8 | +import com.zteits.urbanops.module.garden.controller.admin.road.vo.RoadStreetSaveReqVO; | |
| 9 | +import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadStreetDO; | |
| 18 | 10 | import com.zteits.urbanops.module.garden.dal.mysql.road.RoadStreetMapper; |
| 11 | +import jakarta.annotation.Resource; | |
| 12 | +import org.springframework.stereotype.Service; | |
| 13 | +import org.springframework.validation.annotation.Validated; | |
| 14 | + | |
| 15 | +import java.util.ArrayList; | |
| 16 | +import java.util.List; | |
| 19 | 17 | |
| 20 | -import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 21 | -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; | |
| 22 | -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | |
| 23 | -import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; | |
| 18 | +import static com.zteits.urbanops.module.garden.enums.PlanConstants.STREET_BELONG; | |
| 24 | 19 | |
| 25 | 20 | /** |
| 26 | 21 | * 街道 Service 实现类 |
| ... | ... | @@ -34,6 +29,9 @@ public class RoadStreetServiceImpl implements RoadStreetService { |
| 34 | 29 | @Resource |
| 35 | 30 | private RoadStreetMapper roadStreetMapper; |
| 36 | 31 | |
| 32 | + @Resource | |
| 33 | + private DictDataCommonApi dictDataCommonApi; | |
| 34 | + | |
| 37 | 35 | @Override |
| 38 | 36 | public Long createRoadStreet(RoadStreetSaveReqVO createReqVO) { |
| 39 | 37 | // 插入 |
| ... | ... | @@ -86,9 +84,25 @@ public class RoadStreetServiceImpl implements RoadStreetService { |
| 86 | 84 | |
| 87 | 85 | @Override |
| 88 | 86 | public List<RoadStreetDO> getRoadStreetList(String busiLine) { |
| 89 | - QueryWrapper<RoadStreetDO> sql = new QueryWrapper<>(); | |
| 90 | - sql.lambda().eq(RoadStreetDO::getBusiLine, busiLine).eq(RoadStreetDO::getDeleted,0); | |
| 91 | - return roadStreetMapper.selectList(sql); | |
| 87 | + List<RoadStreetDO> respList = new ArrayList<>(); | |
| 88 | + //从数据字典中获取 | |
| 89 | + List<DictDataRespDTO> dictDataList = dictDataCommonApi.getDictDataList(STREET_BELONG); | |
| 90 | + if(org.springframework.util.CollectionUtils.isEmpty(dictDataList)){ | |
| 91 | + return respList; | |
| 92 | + } | |
| 93 | + | |
| 94 | + dictDataList.forEach(dictData -> { | |
| 95 | + RoadStreetDO roadStreet = new RoadStreetDO(); | |
| 96 | + roadStreet.setStreetId(dictData.getValue()); | |
| 97 | + roadStreet.setStreetName(dictData.getLabel()); | |
| 98 | + respList.add(roadStreet); | |
| 99 | + }); | |
| 100 | + | |
| 101 | +// QueryWrapper<RoadStreetDO> sql = new QueryWrapper<>(); | |
| 102 | +// sql.lambda().eq(RoadStreetDO::getBusiLine, busiLine).eq(RoadStreetDO::getDeleted,0); | |
| 103 | +// return roadStreetMapper.selectList(sql); | |
| 104 | + | |
| 105 | + return respList; | |
| 92 | 106 | } |
| 93 | 107 | |
| 94 | 108 | } |
| 95 | 109 | \ No newline at end of file | ... | ... |