src/main/java/com/smartearth/poiexcel/controller/DkController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/smartearth/poiexcel/service/DkService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/smartearth/poiexcel/controller/DkController.java
@@ -7,6 +7,7 @@ import com.smartearth.poiexcel.entity.DkEntity; import com.smartearth.poiexcel.entity.ResponseMsg; import com.smartearth.poiexcel.mapper.DkMapper; import com.smartearth.poiexcel.service.DkService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -30,6 +31,9 @@ public class DkController extends BaseController { @Resource DkMapper dkMapper; @Resource DkService dkService; @ApiOperation(value = "å页æ¥è¯¢å°å") @ApiImplicitParams({ @@ -75,7 +79,10 @@ int rows = 0; for (DkEntity dk : list) { //boolean flag boolean flag = dkService.updateByBh(dk); if (flag) { rows += dkMapper.updateById(dk); } } return success(rows); @@ -88,8 +95,21 @@ @GetMapping(value = "/updateByCoord") public ResponseMsg<Object> updateByCoord() { try { int rows = 0; QueryWrapper<DkEntity> wrapper = new QueryWrapper<>(); wrapper.apply("length(dikuaibianhao) > 0"); List<DkEntity> list = dkMapper.selectList(wrapper); if (null == list || list.isEmpty()) { return success("没éè¦æ´æ°çå°å", 0); } int rows = 0; for (DkEntity dk : list) { boolean flag = dkService.updateByCoord(dk); if (flag) { rows += dkMapper.updateById(dk); } } return success(rows); } catch (Exception ex) { src/main/java/com/smartearth/poiexcel/service/DkService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,45 @@ package com.smartearth.poiexcel.service; import com.smartearth.poiexcel.entity.DkEntity; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.stereotype.Service; /** * å°åæå¡ç±» * @author WWW * @date 2023-10-05 */ @Service @SuppressWarnings("ALL") public class DkService { private final static Log log = LogFactory.getLog(DkService.class); /** * æ ¹æ®ç¼å·æ´æ° */ public boolean updateByBh(DkEntity dk) { try { // return true; } catch (Exception ex) { log.error(ex.getMessage(), ex); return false; } } /** * æ ¹æ®åæ æ´æ° */ public boolean updateByCoord(DkEntity dk) { try { // return true; } catch (Exception ex) { log.error(ex.getMessage(), ex); return false; } } }