From bf4d67474ff023a7e3ec6fb29b906a698a84f0c5 Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期四, 09 九月 2021 13:59:05 +0800
Subject: [PATCH] 物业报警相关提交

---
 springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyAlarmApi.java |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyAlarmApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyAlarmApi.java
index 623c957..952b4a0 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyAlarmApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyAlarmApi.java
@@ -1,13 +1,16 @@
 package com.panzhihua.service_property.api;
 
 
+import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.api.ApiController;
 import com.panzhihua.common.model.dtos.property.CommonPage;
 import com.panzhihua.common.model.vos.R;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO;
 import com.panzhihua.service_property.entity.ComPropertyAlarm;
 import com.panzhihua.service_property.service.ComPropertyAlarmService;
+import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -34,8 +37,8 @@
      * @param commonPage 查询实体
      * @return 所有数据
      */
-    @GetMapping("queryAll")
-    public R selectAll(CommonPage commonPage) {
+    @PostMapping("queryAll")
+    public R selectAll(@RequestBody CommonPage commonPage) {
         return this.comPropertyAlarmService.pageList(commonPage);
     }
 
@@ -47,28 +50,33 @@
      */
     @GetMapping("{id}")
     public R selectOne(@PathVariable("id") Integer id) {
-        return R.ok(this.comPropertyAlarmService.getById(id));
+        return this.comPropertyAlarmService.selectDetail(id);
     }
 
     /**
      * 新增数据
      *
-     * @param comPropertyAlarm 实体对象
+     * @param comPropertyAlarmVO 实体对象
      * @return 新增结果
      */
     @PostMapping
-    public R insert(@RequestBody ComPropertyAlarm comPropertyAlarm) {
+    public R insert(@RequestBody ComPropertyAlarmVO comPropertyAlarmVO) {
+        ComPropertyAlarm comPropertyAlarm=new ComPropertyAlarm();
+        BeanUtils.copyProperties(comPropertyAlarmVO,comPropertyAlarm);
+        comPropertyAlarm.setCreateTime(DateUtil.date());
         return R.ok(this.comPropertyAlarmService.save(comPropertyAlarm));
     }
 
     /**
      * 修改数据
      *
-     * @param comPropertyAlarm 实体对象
+     * @param comPropertyAlarmVO 实体对象
      * @return 修改结果
      */
     @PostMapping("/update")
-    public R update(@RequestBody ComPropertyAlarm comPropertyAlarm) {
+    public R update(@RequestBody ComPropertyAlarmVO comPropertyAlarmVO) {
+        ComPropertyAlarm comPropertyAlarm=new ComPropertyAlarm();
+        BeanUtils.copyProperties(comPropertyAlarmVO,comPropertyAlarm);
         return R.ok(this.comPropertyAlarmService.updateById(comPropertyAlarm));
     }
 

--
Gitblit v1.7.1