ソースを参照

feat:“添加DIY花型查询接口,上传花型数目接口”

soobin 1 年間 前
コミット
0714f3a53c

+ 21 - 0
src/main/java/com/szwl/controller/IndexController.java

@@ -1996,5 +1996,26 @@ public class IndexController {
         return "success";
     }
 
+    /**
+     * 花型数目 开机时上传
+     *
+     * @param clientId  个推
+
+     * @return
+     */
+    @RequestMapping(value = "/flowerNumber", method = RequestMethod.POST, produces = "text/html;charset=utf-8")
+    @ResponseBody
+    public String flowerNumber(String clientId, String flowerNumber){
+        if(!StringUtils.isEmpty(flowerNumber)){
+            LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
+            query.eq(TEquipment::getClientId,clientId);
+            TEquipment equipment = equipmentService.getOne(query);
+            equipment.setFlowers(flowerNumber);
+            equipmentService.updateById(equipment);
+            return "success";
+        }
+        return "fail";
+    }
+
 }
 

+ 14 - 0
src/main/java/com/szwl/controller/TEquipmentController.java

@@ -250,6 +250,7 @@ public class TEquipmentController {
                 equipmentDTO.setCandyGeneratorTm(equipmentDesc.getCandyGeneratorTm());
                 equipmentDTO.setOutsideHd(equipmentDesc.getOutsideHd());
                 equipmentDTO.setOutsideTm(equipmentDesc.getOutsideTm());
+                equipmentDTO.setDiyFlowerStatus(equipmentDesc.getDiyFlowerStatus());
             }
 
         }
@@ -277,6 +278,7 @@ public class TEquipmentController {
             equipmentDTO.setCandyGeneratorTm(equipmentDesc.getCandyGeneratorTm());
             equipmentDTO.setOutsideHd(equipmentDesc.getOutsideHd());
             equipmentDTO.setOutsideTm(equipmentDesc.getOutsideTm());
+            equipmentDTO.setDiyFlowerStatus(equipmentDesc.getDiyFlowerStatus());
         }
         String messageReceiver = equipment.getMessageReceiver();
         if (StringUtils.isNotEmpty(messageReceiver)) {
@@ -1649,5 +1651,17 @@ public class TEquipmentController {
 //        tDiyFlowerService.updateBatchById(products);
         return R.ok(null,"修改请求发送成功");
     }
+
+    @ApiOperation(value = "查询DIY花型列表信息")
+    @GetMapping("/selectDIYFlowers")
+    public ResponseModel<?> selectDIYFlowers(String equipmentId){
+        if (StringUtils.isEmpty(equipmentId)) {
+            return R.fail(ResponseCodesEnum.A0001, "参数有空");
+        }
+        LambdaQueryWrapper<TDiyFlower> query = Wrappers.lambdaQuery();
+        query.eq(TDiyFlower::getEquipmentId,Long.valueOf(equipmentId));
+        List<TDiyFlower> list = tDiyFlowerService.list(query);
+        return R.ok(list);
+    }
 }
 

+ 11 - 0
src/main/java/com/szwl/model/bean/TEquipmentDTO.java

@@ -122,6 +122,9 @@ public class TEquipmentDTO extends TEquipment {
     @ApiModelProperty(value = "柜外湿度")
     private String outsideHd;
 
+    @ApiModelProperty(value = "DIY花型功能开关,0:关闭,1:开启")
+    private String diyFlowerStatus;
+
     public Long getCupQuantity() {
         return cupQuantity;
     }
@@ -330,4 +333,12 @@ public class TEquipmentDTO extends TEquipment {
     public void setOutsideHd(String outsideHd) {
         this.outsideHd = outsideHd;
     }
+
+    public String getDiyFlowerStatus() {
+        return diyFlowerStatus;
+    }
+
+    public void setDiyFlowerStatus(String diyFlowerStatus) {
+        this.diyFlowerStatus = diyFlowerStatus;
+    }
 }