| | |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.farm.entity.Farm; |
| | | import org.springblade.modules.farm.vo.FarmVO; |
| | | import org.springblade.modules.resource.endpoint.OssEndpoint; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | private final ILandService landService; |
| | | private final IDictBizService dictService; |
| | | private final OssEndpoint ossEndpoint; |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | } else { |
| | | v1 = (double) Math.round(area * 100) / 100; |
| | | } |
| | | |
| | | //图片转换上传 |
| | | if (null!=land.getUrl() && !land.getUrl().equals("")){ |
| | | try { |
| | | //上传 |
| | | String url = ossEndpoint.uploadBase64String(land.getUrl()); |
| | | //回填url |
| | | land.setUrl(url); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | land.setLandArea(String.valueOf(v1)); |
| | | land.setType(1); |
| | | return R.status(landService.saveLandInfo(land)); |
| | |
| | | } else { |
| | | v1 = (double) Math.round(area * 100) / 100; |
| | | } |
| | | |
| | | //图片转换上传 |
| | | if (null!=land.getUrl() && !land.getUrl().equals("")){ |
| | | try { |
| | | //上传 |
| | | String url = ossEndpoint.uploadBase64String(land.getUrl()); |
| | | //回填url |
| | | land.setUrl(url); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | land.setLandArea(String.valueOf(v1)); |
| | | land.setType(1); |
| | | return R.status(landService.updateLandById(land)); |