From 47b20dbb8f81f2a3ac113a7e209a8b4d1cb0146d Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期一, 13 九月 2021 14:35:44 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/test' into test

---
 springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComPropertyRepairApi.java |   97 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 97 insertions(+), 0 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComPropertyRepairApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComPropertyRepairApi.java
new file mode 100644
index 0000000..a4039fc
--- /dev/null
+++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComPropertyRepairApi.java
@@ -0,0 +1,97 @@
+package com.panzhihua.applets.api;
+
+import cn.hutool.core.date.DateUtil;
+import com.panzhihua.common.controller.BaseController;
+import com.panzhihua.common.model.dtos.property.CommonPage;
+import com.panzhihua.common.model.vos.R;
+import com.panzhihua.common.model.vos.property.ComPropertyRepairVO;
+import com.panzhihua.common.service.property.PropertyService;
+import com.panzhihua.common.utlis.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@Slf4j
+@RestController
+@RequestMapping("propertyRepair")
+@Api(tags = "物业报修api")
+public class ComPropertyRepairApi extends BaseController {
+    @Resource
+    private PropertyService propertyService;
+
+    /**
+     * 分页查询所有数据
+     * @return 所有数据
+     */
+    @ApiOperation("小程序列表接口")
+    @PostMapping("/queryAll")
+    public R selectAll(@RequestBody CommonPage commonPage) {
+        commonPage.setUserId(this.getUserId());
+        return this.propertyService.comPropertyRepairSelectAll(commonPage);
+    }
+
+    /**
+     * 小程序添加报修
+     * @param comPropertyRepairVO
+     * @return
+     */
+    @ApiOperation("小程序添加报修")
+    @PostMapping
+    public R insert(@RequestBody ComPropertyRepairVO comPropertyRepairVO) {
+        comPropertyRepairVO.setCreateTime(DateUtil.date());
+        comPropertyRepairVO.setCreateBy(this.getUserId());
+        comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.dcl);
+        return this.propertyService.comPropertyRepairInsert(comPropertyRepairVO);
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param comPropertyRepairVO 实体对象
+     * @return 修改结果
+     */
+    @ApiOperation("小程序修改报修")
+    @PostMapping("/update")
+    public R update(@RequestBody ComPropertyRepairVO comPropertyRepairVO) {
+        if(comPropertyRepairVO!=null&& StringUtils.isNotEmpty(comPropertyRepairVO.getFeedbackContent())){
+            comPropertyRepairVO.setFeedbackBy(this.getUserId());
+            comPropertyRepairVO.setFeedbackTime(DateUtil.date());
+            comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.dpj);
+        }
+        if(comPropertyRepairVO!=null&&StringUtils.isNotEmpty(comPropertyRepairVO.getReplyContent())){
+            comPropertyRepairVO.setReplyTime(DateUtil.date());
+            comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.yjs);
+        }
+        return this.propertyService.comPropertyRepairUpdate(comPropertyRepairVO);
+    }
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @ApiOperation("详情接口")
+    @GetMapping("/{id}")
+    public R selectOne(@PathVariable("id") Integer id) {
+        return this.propertyService.comPropertyRepairSelectOne(id);
+    }
+
+    /**
+     * 删除数据
+     *
+     * @param id 主键结合
+     * @return 删除结果
+     */
+    @ApiOperation("删除接口")
+    @GetMapping("del")
+    public R delete(@RequestParam("id") Long id) {
+        return this.propertyService.comPropertyRepairDelete(id);
+    }
+
+}

--
Gitblit v1.7.1