洪城义警-正式版后台
tangzy
2022-02-10 62f71c8d96430f336ad961011647b9f9dcdebb15
src/main/java/org/springblade/modules/energy/controller/EnergyController.java
@@ -139,6 +139,7 @@
   /**
    * 能量统计
    *
    * @return
    */
   @PostMapping("/selectTreeNum")
@@ -153,6 +154,7 @@
   /**
    * 拾取能量
    *
    * @param id
    * @return
    */
@@ -167,6 +169,25 @@
      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("拾取成功");
   }
@@ -188,7 +209,6 @@
   /**
    * 每天23点自动拾取能量
    *
    */
   @PostMapping("/pickup")
   public void pickup(String ids,String time,String identification) {
@@ -208,4 +228,21 @@
      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);
   }
}