| | |
| | | import org.springblade.modules.farm.service.FarmService; |
| | | import org.springblade.modules.farm.vo.FarmVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 农场控制器 |
| | | * @since 2022-05-10 |
| | | * |
| | | * @author zhongrj |
| | | * @since 2022-05-10 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | |
| | | public R update(@Valid @RequestBody Farm farm) { |
| | | farm.setUpdateTime(new Date()); |
| | | //坐标转换 |
| | | if (null!=farm.getPosition() && !farm.getPosition().equals("")) { |
| | | if (null != farm.getPosition() && !farm.getPosition().equals("")) { |
| | | //替换逗号为空格 |
| | | String sNull = farm.getPosition().replaceAll(",", " "); |
| | | //替换分号为逗号 |
| | |
| | | return R.status(farmService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @GetMapping("/SelectCount") |
| | | public R SelectCount() { |
| | | //农场数量 |
| | | Integer integer = farmService.selectCountFarm(); |
| | | //人员数量 |
| | | Integer integer1 = farmService.selectCountUser(); |
| | | Map map = new HashMap<>(); |
| | | map.put("ncnum", integer); |
| | | map.put("rynum", integer1); |
| | | return R.data(map); |
| | | } |
| | | |
| | | } |