| | |
| | | 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; |
| | |
| | | public class DkController extends BaseController { |
| | | @Resource |
| | | DkMapper dkMapper; |
| | | |
| | | @Resource |
| | | DkService dkService; |
| | | |
| | | @ApiOperation(value = "分页查询地块") |
| | | @ApiImplicitParams({ |
| | |
| | | |
| | | int rows = 0; |
| | | for (DkEntity dk : list) { |
| | | //boolean flag |
| | | boolean flag = dkService.updateByBh(dk); |
| | | if (flag) { |
| | | rows += dkMapper.updateById(dk); |
| | | } |
| | | } |
| | | |
| | | return success(rows); |
| | |
| | | @GetMapping(value = "/updateByCoord") |
| | | public ResponseMsg<Object> updateByCoord() { |
| | | try { |
| | | int rows = 0; |
| | | QueryWrapper<DkEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.apply("point_area is null and lng is not null and lat is not null"); |
| | | |
| | | 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) { |