| | |
| | | |
| | | /** |
| | | * 能量统计 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectTreeNum") |
| | |
| | | |
| | | /** |
| | | * 拾取能量 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | int i1 = n + a; |
| | | String i = String.valueOf(i1); |
| | | energyTreeService.updateEnergyTreeId(i,identification); |
| | | return R.success("拾取成功"); |
| | | } |
| | | |
| | | /** |
| | | * 拾取能量 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateEnergyIds") |
| | | public R updateEnergyId(@Valid @RequestBody Energy energy) { |
| | | |
| | | energyService.updateEnergyIds(energy.getId(), energy.getIdentification()); |
| | | //能量树 |
| | | String nums = energyTreeService.selectNum(energy.getIdentification()); |
| | | Integer a = Integer.valueOf(nums); |
| | | Integer n = Integer.valueOf(energy.getNum()); |
| | | int i1 = n + a; |
| | | String i = String.valueOf(i1); |
| | | energyTreeService.updateEnergyTreeId(i, energy.getIdentification()); |
| | | return R.success("拾取成功"); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 每天23点自动拾取能量 |
| | | * |
| | | */ |
| | | @PostMapping("/pickup") |
| | | public void pickup(String ids,String time,String identification) { |
| | |
| | | energyTreeService.updateEnergyTreeId(num,identification); |
| | | } |
| | | |
| | | /** |
| | | * 浇水 |
| | | * |
| | | * @param energy |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateTre") |
| | | public R updateTre(@Valid @RequestBody Energy energy) { |
| | | //能量树 |
| | | String nums = energyTreeService.selectNum(energy.getIdentification()); |
| | | Integer a = Integer.valueOf(nums); |
| | | int i1 = a+1; |
| | | String i = String.valueOf(i1); |
| | | energyTreeService.updateEnergyTreeId(i, energy.getIdentification()); |
| | | String nu = energyTreeService.selectNum(energy.getIdentification()); |
| | | return R.data(nu); |
| | | } |
| | | } |