elis 2 lat temu
rodzic
commit
a414bf92dd

+ 4 - 4
naqwzsjtj/naqwzsjtj/src/views/repair/RepairWorker.vue

@@ -6,7 +6,7 @@
         <el-button type="primary" class="add" @click="openAddWork">新增</el-button>
       </div>
       <div style="display: flex">
-        <el-input v-model.trim="query.canteenName" clearable placeholder="请输入食堂名称"
+        <el-input v-model.trim="query.nameOrNumb" clearable placeholder="请输入工人名称或手机号"
           style="margin: 0 10px; width: 200px" />
         <el-button type="primary" class="search" @click="searchData">搜索</el-button>
         <el-button type="primary" class="search" @click="reset" style="margin-left: 5px">重置</el-button>
@@ -89,7 +89,6 @@
 </template>
 
 <script>
-  import api from "../../api";
   import Repair from "@/api/repair";
 
 
@@ -107,7 +106,7 @@
         tableH: "calc(100vh - 230px)",
         // 搜索参数
         query: {
-          canteenName: "",
+          nameOrNumb: "",
         },
 
         // 列表数据
@@ -340,6 +339,7 @@
       // 获取列表数据
       getData() {
         let params = {
+            phoneNum:this.query.nameOrNumb,
             page:this.sorts.page-1,
             size:this.sorts.limit
         }
@@ -360,7 +360,7 @@
       },
       // 清空输入框
       reset() {
-        this.query.canteenName = "";
+        this.query.nameOrNumb = "";
         this.sorts.page = 1;
         this.getData();
       },

+ 135 - 39
naqwzsjtj/naqwzsjtj/src/views/repair/WorkOrder.vue

@@ -5,7 +5,7 @@
       <div>
       </div>
       <div style="display: flex">
-        <el-input v-model.trim="query.dishesName" clearable placeholder="请输入菜品名称" style="margin: 0 10px;width: 200px" />
+        <el-input v-model.trim="query.dishesName" clearable placeholder="请输入" style="margin: 0 10px;width: 200px" />
         <el-button type="primary" class="search" @click="searchData">搜索</el-button>
         <el-button type="primary" class="search" @click="reset" style="margin-left: 5px">重置</el-button>
       </div>
@@ -19,17 +19,22 @@
           {{ (sorts.page - 1) * sorts.limit + scope.$index + 1 }}
         </template>
       </el-table-column>
-      <el-table-column prop="canteenName" :show-overflow-tooltip="true" label="食堂名称" />
-      <el-table-column prop="dishesName" :show-overflow-tooltip="true" label="菜品名称" />
-      <el-table-column prop="score" label="评分" width="70" />
-      <el-table-column prop="evaluation" :show-overflow-tooltip="true" label="评论" />
+      <el-table-column prop="repairType" :show-overflow-tooltip="true" label="报修类型" />
+      <el-table-column prop="phoneNum" :show-overflow-tooltip="true" label="联系电话" />
+      <el-table-column prop="userDescription" :show-overflow-tooltip="true" label="问题描述" />
+<!--      <el-table-column prop="repairPic" :show-overflow-tooltip="true" label="报修照片" />-->
+      <el-table-column prop="status" :show-overflow-tooltip="true" :formatter = "statusFormat" label="状态" />
+      <el-table-column prop="maintenanceAddress" :show-overflow-tooltip="true" label="维修地址" />
+      <el-table-column prop="appointmentTime" :show-overflow-tooltip="true" label="预约上门时间" />
+      <el-table-column prop="workerId" :show-overflow-tooltip="true" :formatter = "getUserName" label="负责人" />
+<!--      <el-table-column prop="workerDescription" :show-overflow-tooltip="true" label="维修反馈" />-->
+<!--      <el-table-column prop="resultPic" :show-overflow-tooltip="true" label="维修确认单" />-->
       <el-table-column prop="createTime" :show-overflow-tooltip="true" label="创建时间" width="160" />
       <el-table-column prop="updateTime" :show-overflow-tooltip="true" label="更新时间" width="160" />
       <el-table-column label="操作" width="230">
         <template slot-scope="scope">
           <el-button class="but" type="primary" @click="info(scope.row)">详情</el-button>
-          <el-button class="but" type="warning" @click="markEvaluation(scope.row.id)">
-            标记</el-button>
+          <el-button class="but" type="warning" @click="assign(scope.row)">指派</el-button>
           <el-button class="but" type="danger" @click="handleDelete(scope.row.id, scope.$index)">删除
           </el-button>
         </template>
@@ -50,65 +55,101 @@
         <el-form :model="postManagement" label-width="140px">
           <el-row>
             <el-col :span="12">
-              <el-form-item label="食堂名称">
-                <el-input v-model="postManagement.canteenName" :readonly="true"></el-input>
+              <el-form-item label="报修类型">
+                <el-input v-model="postManagement.repairType" :readonly="true"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="菜品名称">
-                <el-input v-model="postManagement.dishesName" :readonly="true"></el-input>
+              <el-form-item label="联系电话">
+                <el-input v-model="postManagement.phoneNum" :readonly="true"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="12">
-              <el-form-item label="评分">
-                <el-input v-model="postManagement.score" :readonly="true"></el-input>
+              <el-form-item label="维修地址">
+                <el-input type="textarea"
+                          :autosize="{ minRows: 2, maxRows: 4}" v-model="postManagement.maintenanceAddress" :readonly="true"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="评论人">
-                <el-input v-model="postManagement.nickName" :readonly="true"></el-input>
+              <el-form-item label="预约上门时间">
+                <el-input v-model="postManagement.appointmentTime" :readonly="true"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
+
           <el-row>
             <el-col :span="24">
-              <el-form-item label="评论">
-                <el-input type="textarea" v-model="postManagement.evaluation" :autosize="{ minRows: 4, maxRows: 6}"
-                  resize="none" :readonly="true"></el-input>
+              <el-form-item label="问题描述">
+                <el-input type="textarea"
+                          :autosize="{ minRows: 2, maxRows: 4}"
+                          v-model="postManagement.userDescription" :readonly="true"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="24">
-              <el-form-item label="评论图">
-                <el-image style="width:100px; height:100px;margin:0 5px 0 10px;" v-for="(urls,index) in photoUrl"
-                  :key="index" :src="urls" :preview-src-list="photoUrl">
-                </el-image>
+              <el-image style="width:100px; height:100px;margin:0 5px 0 10px;" v-for="(urls,index) in repair_pic"
+                        :key="index" :src="urls" :preview-src-list="repair_pic">
+              </el-image>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="维修负责人">
+                <el-input v-model="postManagement.userDescription" :readonly="true"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
-
+          <el-row>
+            <el-col :span="24">
+              <el-form-item label="维修反馈">
+                <el-input type="textarea"
+                          :autosize="{ minRows: 2, maxRows: 4}" v-model="postManagement.userDescription" :readonly="true"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <el-image style="width:100px; height:100px;margin:0 5px 0 10px;" v-for="(urls,index) in result_pic"
+                        :key="index" :src="urls" :preview-src-list="result_pic">
+              </el-image>
+            </el-col>
+          </el-row>
         </el-form>
       </div>
       <div slot="footer" class="dialog-footer">
         <el-button @click="workDialog = false" size="mini">返回</el-button>
       </div>
     </el-dialog>
+    <el-dialog :visible.sync="assignDialog" width="50%"  class="detailDialog" :close-on-click-modal="false" top="40px">
+      <div slot="title">
+        <div class="addTitle">{{ workTitle }}</div>
+      </div>
+      <workerDialog ref="workerDialog"/>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="setUserToOrder"  size="mini">确认</el-button>
+        <el-button @click="assignDialog = false" size="mini">返回</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-  import api from '../../api'
+  import Repair from "@/api/repair";
 
+  import WorkerDialog from "@/views/repair/components/WorkerDialog.vue";
   export default {
     name: 'EvaluationManage',
+    components: { WorkerDialog },
     created() {
       this.getData()
     },
     data() {
       return {
+        workDialog:false,
+        assignDialog:false,
         imgUrl: process.env.VUE_APP_IMG_URL,
         tableStyle: {
           textAlign: 'center',
@@ -122,15 +163,48 @@
         tableData: [],
         // 总数
         total: 0,
-
+        postManagement:{},
+        repair_pic : [],
+        result_pic : [],
         // 分页
         sorts: {
           page: 1,
           limit: 10,
         },
+        tableDataOne:{}
       }
     },
     methods: {
+      statusFormat(data){
+        switch (data.status) {
+          case 0:
+            return '待审核'
+          case 1:
+            return '待维修'
+          case 3:
+            return '已完成'
+          case -1:
+            return '维修失败'
+        }
+      },
+      setUserToOrder(){
+        let worker = this.$refs.workerDialog.tableDataOne;
+        let  params = {
+          workerId : worker.id,
+          repairId : this.postManagement.id
+        }
+        Repair.setAssign({params}).then(r=>{
+          console.log(r);
+        })
+        this.assignDialog = false;
+      },
+      getUserName(data){
+        let params =  {
+          workerId:data.workerId
+        }
+          // ...
+        return 0
+      },
       //切换列表条数
       handleSizeChange(pageSize) {
         this.sorts.limit = pageSize
@@ -146,24 +220,44 @@
 
       // 详情
       info: function (data) {
-        this.workTitle = "详情";
+        this.workTitle = "工单详情";
         this.postManagement = JSON.parse(JSON.stringify(data));
-        this.photoUrl = [];
-        if (this.postManagement.photoPath) {
+        this.repair_pic = [];
+        this.result_pic = [];
+        if (this.postManagement.repairPic) {
           let params = {
-            picId: this.postManagement.photoPath
+            picId: this.postManagement.repairPic
           }
-          api.getFoodPicByPicId({
+          Repair.getFoodPicByPicId({
             params
           }).then(r => {
             for (let i = 0; i < r.data.data.length; i++) {
-              this.photoUrl.push(this.imgUrl + r.data.data[i].path)
+              this.repair_pic.push(this.imgUrl + r.data.data[i].path)
             }
-            this.workDialog = true;
           })
-        } else {
-          this.workDialog = true;
         }
+
+        if (this.postManagement.resultPic) {
+          let params = {
+            picId: this.postManagement.resultPic
+          }
+          Repair.getFoodPicByPicId({
+            params
+          }).then(r => {
+            for (let i = 0; i < r.data.data.length; i++) {
+              this.repair_pic.push(this.imgUrl + r.data.data[i].path)
+            }
+          })
+        }
+        this.workDialog = true;
+
+      },
+      assign(data){
+        console.log(data);
+        this.workTitle = "工单指派";
+        this.postManagement = JSON.parse(JSON.stringify(data));
+        this.assignDialog = true;
+        // this.tableDataOne = data;
       },
       // 删除
       handleDelete(id, index) {
@@ -202,13 +296,15 @@
       },
       // 获取列表数据
       getData() {
-        api.queryEvaluationByPage({
-          page: this.sorts.page,
+        let params = {
+          page: this.sorts.page-1,
           size: this.sorts.limit,
-          dishesName: this.query.dishesName
+        }
+        Repair.queryByRepair({
+          params
         }).then(r => {
-          this.total = r.data.data.totalElements
-          this.tableData = r.data.data.content
+          this.total = r.data.totalElements
+          this.tableData = r.data.content
         })
       },
       // 搜索

+ 286 - 0
naqwzsjtj/naqwzsjtj/src/views/repair/components/WorkerDialog.vue

@@ -0,0 +1,286 @@
+<template>
+  <div style="">
+    <div style="display: flex; justify-content: space-between; margin-bottom: 10px">
+      <div style="display: flex">
+        <el-input v-model.trim="query.nameOrNumb" clearable placeholder="请输入工人名称或手机号"
+                  style="margin: 0 10px; width: 200px" />
+        <el-button type="primary" class="search" @click="searchData">搜索</el-button>
+        <el-button type="primary" class="search" @click="reset" style="margin-left: 5px">重置</el-button>
+      </div>
+    </div>
+    <!--表格-->
+    <el-table :data="tableData" border ref="multipleTable" :height="tableH" stripe
+              :header-cell-style="{
+                background: '#e5e8ed',
+                color: '#666',
+                textAlign: 'center',
+                }"
+              highlight-current-row
+              @current-change="selectOne"
+              :cell-style="tableStyle"
+              style="cursor: default">
+
+      <el-table-column prop="name" label="姓名" :show-overflow-tooltip="true" />
+      <el-table-column prop="phoneNum" :show-overflow-tooltip="true" label="联系电话" />
+    </el-table>
+    <div class="block">
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="sorts.page"
+                     :page-sizes="[10, 20, 30, 40, 50]" :page-size="sorts.limit" layout="prev, pager,next,jumper,total,sizes"
+                     :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+<script>
+import Repair from "@/api/repair";
+export default {
+  name: "workerDialog",
+  created() {
+    this.getData();
+  },
+  data() {
+    return {
+      imgUrl: process.env.VUE_APP_IMG_URL,
+      tableStyle: {
+        textAlign: "center",
+      },
+      tableH: "calc(70vh - 230px)",
+      // 搜索参数
+      query: {
+        nameOrNumb: "",
+      },
+      // 列表数据
+      tableData: [],
+      // 总数
+      total: 0,
+      // 分页
+      sorts: {
+        page: 1,
+        limit: 10,
+      },
+      tableDataOne: {}
+    };
+  },
+  methods: {
+    // 列表排序
+    compare(property) {
+      return function (a, b) {
+        var value1 = a[property];
+        var value2 = b[property];
+        return value1 - value2;
+      };
+    },
+    selectOne(currentRow, oldCurrentRow){
+      this.tableDataOne = currentRow
+    },
+    //切换列表条数
+    handleSizeChange(pageSize) {
+      this.sorts.limit = pageSize;
+      this.sorts.page = 1;
+      this.getData();
+    },
+    //切换页码
+    handleCurrentChange(currentPage) {
+      this.$refs.multipleTable.bodyWrapper.scrollTop = 0;
+      this.sorts.page = currentPage;
+      this.getData();
+    },
+
+    // 获取列表数据
+    getData() {
+      let params = {
+        phoneNum:this.query.nameOrNumb,
+        page:this.sorts.page-1,
+        size:this.sorts.limit
+      }
+      Repair
+        .queryByPage({
+          params
+        })
+        .then((r) => {
+          console.log(r);
+          this.total = r.data.totalElements
+          this.tableData = r.data.content
+        });
+    },
+    // 搜索
+    searchData() {
+      this.sorts.page = 1;
+      this.getData();
+    },
+    // 清空输入框
+    reset() {
+      this.query.nameOrNumb = "";
+      this.sorts.page = 1;
+      this.getData();
+    },
+  },
+};
+</script>
+
+<style>
+/* 全局取消按钮 */
+.btn-custom-cancel {
+  margin-left: 10px !important;
+  float: right;
+}
+</style>
+
+<style scoped lang="less">
+/* 禁用后的勾选*/
+/deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
+  border-color: #def5cb;
+}
+
+/deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
+  background-color: #157de9;
+  border-color: #dcdfe6;
+}
+
+/deep/ .el-dialog__body {
+  padding: 0 0 30px 20px;
+  color: #606266;
+  font-size: 14px;
+  word-break: break-all;
+}
+
+/deep/ .el-dialog {
+  margin: 0 auto 0;
+}
+
+/deep/ .el-form-item__label {
+  padding: 0;
+}
+
+.yxnaContent {
+  padding: 10px;
+}
+
+.addTitle {
+  font-size: 18px;
+  font-weight: bold;
+  margin-bottom: 10px;
+}
+
+.add {
+  width: 66px;
+  height: 38px;
+  margin-left: 0;
+}
+
+/deep/ .el-col-12 {
+  width: 50%;
+  text-align: left;
+}
+
+.search {
+  width: 66px;
+  height: 38px;
+  margin-left: 0;
+}
+
+/deep/ .el-form-item__label {
+  // height: 40px;
+  // width: 110px;
+  // background-color: #fafafa;
+  text-align: center;
+  // border: 1px solid #dcdfe6;
+  // border-radius: 2px 0 0 2px;
+}
+
+/deep/ .el-button.is-disabled {
+  color: #c0c4cc !important;
+}
+
+/deep/.el-button--primary.is-disabled {
+  color: #fff !important;
+}
+
+/deep/ .el-input__inner {
+  border-radius: 2px 0 0 2px;
+}
+
+.el-select>.el-input {
+  width: 200px;
+}
+
+/deep/ .el-textarea__inner {
+  height: 100px;
+}
+
+/deep/ .el-dialog__title {
+  font-size: 14px;
+}
+
+/deep/ .el-pagination__total {
+  margin-left: 10px !important;
+}
+
+.el-pagination {
+  margin: 0;
+  margin-top: 10px;
+  /* position: fixed;
+      left: 13rem; */
+}
+
+/deep/ .el-table--scrollable-x .el-table__body-wrapper {
+  z-index: 2;
+}
+
+.imgBox {
+  width: 100%;
+  /*height: 55vh;*/
+  height: 100%;
+}
+
+.but {
+  width: 36px;
+  height: 22px;
+  padding: 0;
+  font-size: 12px;
+}
+
+.el-checkbox {
+  margin: 0;
+  margin-right: 10px;
+}
+
+/deep/ .bewrite>.el-form-item__label {
+  width: 100%;
+  text-align: left;
+  padding-left: 21px;
+}
+
+/deep/ .el-form--inline .el-form-item {
+  margin-right: 0px;
+}
+
+/deep/ [data-v-2cde7735] .el-form-item__label {
+  border: 1px solid #dcdfe6;
+  /*border-right: transparent;*/
+}
+
+/*    空白框*/
+/deep/ .formTempBox {
+  height: 38px;
+  border: 1px solid #dcdfe6;
+  width: 100%;
+  border-left: transparent;
+  background-color: #fafafa;
+}
+
+/deep/ .el-select__tags .el-select__tags-text {
+  font-size: 14px;
+}
+
+/deep/ .input-star>.el-form-item__label:before {
+  content: "*";
+  color: #f56c6c;
+  margin-right: 4px;
+}
+
+// 去除上传组件动画过渡效果
+/deep/ .el-upload-list__item {
+  transition: none !important;
+}
+</style>

+ 0 - 96
nngkxxdp/src/main/java/com/example/nngkxxdp/controller/SWorkereeController.java

@@ -1,96 +0,0 @@
-package com.example.nngkxxdp.controller;
-
-
-import com.example.nngkxxdp.program.entity.SWorker;
-import com.example.nngkxxdp.program.entity.vo.WorkerPageVo;
-import com.example.nngkxxdp.program.service.SWorkerService;
-import lombok.AllArgsConstructor;
-import org.jsoup.internal.StringUtil;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * (SWorker)表控制层
- *
- * @author elis
- * @since 2023-03-20 14:38:05
- */
-@RestController
-@AllArgsConstructor
-@RequestMapping("worker1")
-public class SWorkereeController {
-    /**
-     * 服务对象
-     */
-    
-    private final SWorkerService sWorkerService;
-
-
-    @GetMapping("/hasWxUser")
-    public ResponseEntity<Boolean> hasWxUser(String phoneNum){
-        System.out.println(phoneNum);
-        if (StringUtil.isBlank(phoneNum)){
-            return ResponseEntity.ok(false);
-        }
-        return ResponseEntity.ok(sWorkerService.hasWxUser(phoneNum));
-    }
-    /**
-     * 分页查询
-     *
-     * @param sWorker 请求体
-     * @return 查询结果
-     */
-    @GetMapping("queryByPage")
-    public ResponseEntity<Page<SWorker>> queryByPage(WorkerPageVo sWorker) {
-        System.out.println(sWorker);
-        return ResponseEntity.ok(this.sWorkerService.queryByPage(sWorker.getSWorker(), PageRequest.of(sWorker.getPage(),sWorker.getSize())));
-    }
-
-    /**
-     * 通过主键查询单条数据
-     *
-     * @param id 主键
-     * @return 单条数据
-     */
-    @GetMapping("{id}")
-    public ResponseEntity<SWorker> queryById(@PathVariable("id") String id) {
-        return ResponseEntity.ok(this.sWorkerService.queryById(id));
-    }
-
-    /**
-     * 新增数据
-     *
-     * @param sWorker 实体
-     * @return 新增结果
-     */
-    @PostMapping("add")
-    public ResponseEntity<SWorker> add(SWorker sWorker) {
-        return ResponseEntity.ok(this.sWorkerService.insert(sWorker));
-    }
-
-    /**
-     * 编辑数据
-     *
-     * @param sWorker 实体
-     * @return 编辑结果
-     */
-    @PutMapping
-    public ResponseEntity<SWorker> edit(SWorker sWorker) {
-        return ResponseEntity.ok(this.sWorkerService.update(sWorker));
-    }
-
-    /**
-     * 删除数据
-     *
-     * @param id 主键
-     * @return 删除是否成功
-     */
-    @DeleteMapping
-    public ResponseEntity<Boolean> deleteById(String id) {
-        return ResponseEntity.ok(this.sWorkerService.deleteById(id));
-    }
-
-}
-

+ 25 - 9
nngkxxdp/src/main/java/com/example/nngkxxdp/program/controller/SRepairController.java

@@ -1,13 +1,22 @@
 package com.example.nngkxxdp.program.controller;
 
 
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.log.Log;
 import com.example.nngkxxdp.program.entity.SRepair;
+import com.example.nngkxxdp.program.entity.vo.RepairPageVo;
 import com.example.nngkxxdp.program.service.SRepairService;
+import com.example.nngkxxdp.util.ConstStr;
+import com.example.nngkxxdp.util.SendUtil;
+import org.apache.xmlbeans.impl.xb.xsdschema.Public;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Map;
+
 /**
  * (SRepair)表控制层
  *
@@ -27,18 +36,16 @@ public class SRepairController {
     }
 
 
-
-
     /**
-     * 分页查询
      *
-     * @param sRepair 筛选条件
-     * @param pageRequest      分页对象
-     * @return 查询结果
+     * @param repairPageVo
+     * @return
      */
-    @GetMapping
-    public ResponseEntity<Page<SRepair>> queryByPage(SRepair sRepair, PageRequest pageRequest) {
-        return ResponseEntity.ok(this.sRepairService.queryByPage(sRepair, pageRequest));
+    @GetMapping("queryByPage")
+    public ResponseEntity<Page<SRepair>> queryByPage(RepairPageVo repairPageVo) {
+        SRepair sRepair = new SRepair();
+
+        return ResponseEntity.ok(sRepairService.queryByPage(sRepair, PageRequest.of(repairPageVo.getPage(),repairPageVo.getSize())));
     }
 
     /**
@@ -74,6 +81,15 @@ public class SRepairController {
         return ResponseEntity.ok(this.sRepairService.update(sRepair));
     }
 
+    @GetMapping("setAssign")
+    public Map<String,Object> setAssign(String workerId,String repairId){
+
+        if (StrUtil.hasEmpty(workerId,repairId)){
+            return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
+        }
+        return sRepairService.setAssign(workerId, repairId);
+    }
+
     /**
      * 删除数据
      *

+ 11 - 2
nngkxxdp/src/main/java/com/example/nngkxxdp/program/controller/SWorkerController.java

@@ -1,6 +1,7 @@
 package com.example.nngkxxdp.program.controller;
 
 
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.example.nngkxxdp.program.entity.SWorker;
 import com.example.nngkxxdp.program.entity.vo.WorkerPageVo;
@@ -49,10 +50,18 @@ public class SWorkerController {
      */
     @GetMapping("queryByPage")
     public ResponseEntity<Page<SWorker>> queryByPage(WorkerPageVo sWorker) {
-        System.out.println(sWorker);
-        return ResponseEntity.ok(this.sWorkerService.queryByPage(sWorker.getSWorker(), PageRequest.of(sWorker.getPage(),sWorker.getSize())));
+        SWorker sWorker1 = new SWorker();
+        if (ObjectUtil.isNotEmpty(sWorker.getPhoneNum())){
+            sWorker1.setPhoneNum(sWorker.getPhoneNum());
+        }
+        return ResponseEntity.ok(
+                this.sWorkerService.queryByPage(
+                        sWorker1, PageRequest.of(sWorker.getPage(),sWorker.getSize()))
+        );
     }
 
+
+
     /**
      * 通过主键查询单条数据
      *

+ 4 - 16
nngkxxdp/src/main/java/com/example/nngkxxdp/program/controller/WorkerMiniController.java

@@ -41,26 +41,14 @@ public class WorkerMiniController {
         return SendUtil.send(false, ConstStr.ADD_FAILED);
     }
 
-
-
-//    @GetMapping("/myOrder")
-//    public Map<String, Object> myOrders(String id,Integer status){
-//        if (StrUtil.isEmpty(id)){
-//            return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
-//        }
-//        if (ObjectUtil.isEmpty(status)){
-//            status = 0;
-//        }
-//        return SendUtil.send(true, ConstStr.RESULT_SUCCESS, service.myOrder(id,status));
-//    }
-
     /**
      *
      * @param page
      * @param limit
-     * @param isUser 普通用户查询
-     * @param todo 待办查询
-     * @param close 已完成查询
+     * @param userId
+     * @param isUser 普通用户
+     * @param todo 工人待办
+     * @param close 工人完结
      * @return
      */
     @GetMapping("/myOrder")

+ 1 - 1
nngkxxdp/src/main/java/com/example/nngkxxdp/program/dao/SRepairDao.java

@@ -32,7 +32,7 @@ public interface SRepairDao {
      * @param pageable         分页对象
      * @return 对象列表
      */
-    List<SRepair> queryAllByLimit(SRepair sRepair, @Param("pageable") Pageable pageable);
+    List<SRepair> queryAllByLimit(@Param("sRepair")SRepair sRepair, @Param("pageable") Pageable pageable);
 
     /**
      * 统计总行数

+ 1 - 1
nngkxxdp/src/main/java/com/example/nngkxxdp/program/entity/SRepair.java

@@ -31,7 +31,7 @@ public class SRepair implements Serializable {
     
     private String resultPic;
     
-    private Integer workerId;
+    private String workerId;
     
     private Date createTime;
     

+ 4 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/program/entity/SWorker.java

@@ -45,6 +45,10 @@ public class SWorker implements Serializable {
      */
     private Integer isDel;
 
+    private String wxUserId;
+
+    private Integer role;
+
 
 
 

+ 17 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/program/entity/vo/RepairPageVo.java

@@ -0,0 +1,17 @@
+package com.example.nngkxxdp.program.entity.vo;
+
+import com.example.nngkxxdp.program.entity.SRepair;
+import com.example.nngkxxdp.program.entity.SWorker;
+import lombok.Data;
+
+/**
+ * @author elis
+ */
+@Data
+public class RepairPageVo {
+
+
+    private Integer page;
+
+    private Integer size;
+}

+ 0 - 2
nngkxxdp/src/main/java/com/example/nngkxxdp/program/entity/vo/WorkerPageVo.java

@@ -9,8 +9,6 @@ import lombok.Data;
 @Data
 public class WorkerPageVo {
 
-    private SWorker sWorker;
-
     private String phoneNum;
 
     private Integer page;

+ 21 - 1
nngkxxdp/src/main/java/com/example/nngkxxdp/program/service/Impl/SRepairServiceImpl.java

@@ -3,11 +3,14 @@ package com.example.nngkxxdp.program.service.Impl;
 
 import cn.hutool.core.io.FileTypeUtil;
 import cn.hutool.core.lang.UUID;
+import cn.hutool.core.util.ObjectUtil;
 import com.example.nngkxxdp.dao.FileDao;
 import com.example.nngkxxdp.entity.SFile;
 import com.example.nngkxxdp.program.dao.SRepairDao;
 import com.example.nngkxxdp.program.entity.SRepair;
+import com.example.nngkxxdp.program.entity.SWorker;
 import com.example.nngkxxdp.program.service.SRepairService;
+import com.example.nngkxxdp.program.service.SWorkerService;
 import com.example.nngkxxdp.util.Blank;
 import com.example.nngkxxdp.util.ConstStr;
 import com.example.nngkxxdp.util.SendUtil;
@@ -38,10 +41,13 @@ public class SRepairServiceImpl implements SRepairService {
     private final FileDao fileDao;
     @Value("${file.location}")
     private String location;
+
+    private final SWorkerService sWorkerService;
     
-    public SRepairServiceImpl(SRepairDao sRepairDao, FileDao fileDao) {
+    public SRepairServiceImpl(SRepairDao sRepairDao, FileDao fileDao, SWorkerService sWorkerService) {
         this.sRepairDao = sRepairDao;
         this.fileDao = fileDao;
+        this.sWorkerService = sWorkerService;
     }
     /**
      * 通过ID查询单条数据
@@ -236,4 +242,18 @@ public class SRepairServiceImpl implements SRepairService {
         }
         return SendUtil.send(true,sRepairDao.update(sRepair)>0);
     }
+
+    @Override
+    public Map<String, Object> setAssign(String workerId, String repairId) {
+        SWorker sWorker = sWorkerService.queryById(workerId);
+        if (ObjectUtil.isEmpty(sWorker)){
+            return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
+        }
+        SRepair sRepair = new SRepair();
+        sRepair.setId(repairId);
+        sRepair.setStatus(2);
+        sRepair.setWorkerId(sWorker.getWxUserId());
+        int update = sRepairDao.update(sRepair);
+        return SendUtil.send(true,"",update > 0);
+    }
 }

+ 1 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/program/service/SRepairService.java

@@ -68,4 +68,5 @@ public interface SRepairService {
     Map<String, Object> closeOrder(MultipartFile[] files, SRepair sRepair) throws IOException;
 
 
+    Map<String, Object> setAssign(String workerId, String repairId);
 }

+ 24 - 36
nngkxxdp/src/main/resources/mapper/SRepairDao.xml

@@ -32,57 +32,49 @@
     <!--查询指定行数据-->
     <select id="queryAllByLimit" resultMap="SRepairMap">
         select
-          id, repair_type, user_description, repair_pic, phone_num, status, worker_description, result_pic, worker_id, create_time, update_time, is_del,user_id,appointment_time,maintenance_address
+          id, repair_type, user_description, repair_pic, phone_num, status, worker_description, result_pic, worker_id, create_time, update_time,user_id,appointment_time,maintenance_address
         from s_repair
         <where>
-            <if test="id != null">
-                and id = #{id}
+            <if test="sRepair.repairType != null">
+                and repair_type = #{sRepair.repairType}
             </if>
-            <if test="repairType != null">
-                and repair_type = #{repairType}
+            <if test="sRepair.userDescription != null and sRepair.userDescription != ''">
+                and user_description = #{sRepair.userDescription}
             </if>
-            <if test="userDescription != null and userDescription != ''">
-                and user_description = #{userDescription}
+            <if test="sRepair.repairPic != null and sRepair.repairPic != ''">
+                and repair_pic = #{sRepair.repairPic}
             </if>
-            <if test="repairPic != null and repairPic != ''">
-                and repair_pic = #{repairPic}
+            <if test="sRepair.phoneNum != null">
+                and phone_num = #{sRepair.phoneNum}
             </if>
-            <if test="phoneNum != null">
-                and phone_num = #{phoneNum}
-            </if>
-            <if test="status != null">
-                and status = #{status}
-            </if>
-            <if test="workerDescription != null and workerDescription != ''">
-                and worker_description = #{workerDescription}
+            <if test="sRepair.status != null">
+                and status = #{sRepair.status}
             </if>
-            <if test="resultPic != null and resultPic != ''">
-                and result_pic = #{resultPic}
+            <if test="sRepair.workerDescription != null and sRepair.workerDescription != ''">
+                and worker_description = #{sRepair.workerDescription}
             </if>
-            <if test="workerId != null">
-                and worker_id = #{workerId}
+            <if test="sRepair.resultPic != null and sRepair.resultPic != ''">
+                and result_pic = #{sRepair.resultPic}
             </if>
-            <if test="createTime != null">
-                and create_time = #{createTime}
+            <if test="sRepair.workerId != null">
+                and worker_id = #{sRepair.workerId}
             </if>
-            <if test="updateTime != null">
-                and update_time = #{updateTime}
+            <if test="sRepair.createTime != null">
+                and create_time = #{sRepair.createTime}
             </if>
-            <if test="isDel != null">
-                and is_del = #{isDel}
+            <if test="sRepair.updateTime != null">
+                and update_time = #{sRepair.updateTime}
             </if>
+                and is_del = 0
         </where>
         limit #{pageable.offset}, #{pageable.pageSize}
     </select>
 
     <!--统计总行数-->
     <select id="count" resultType="java.lang.Long">
-        select count(1)
+        select count(*)
         from s_repair
         <where>
-            <if test="id != null">
-                and id = #{id}
-            </if>
             <if test="repairType != null">
                 and repair_type = #{repairType}
             </if>
@@ -113,9 +105,7 @@
             <if test="updateTime != null">
                 and update_time = #{updateTime}
             </if>
-            <if test="isDel != null">
-                and is_del = #{isDel}
-            </if>
+            and is_del = 0
         </where>
     </select>
 
@@ -217,7 +207,6 @@
             #{s}
         </foreach>
         limit #{page}, #{limit}
-
     </select>
 
     <select id="getUserOrder" resultMap="SRepairMap">
@@ -226,7 +215,6 @@
         from s_repair
         where user_id = #{userId} AND is_del = 0
         limit #{page}, #{limit}
-
     </select>
 
 </mapper>

+ 3 - 1
nngkxxdp/src/main/resources/mapper/SWorkerDao.xml

@@ -11,12 +11,14 @@
         <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
         <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
         <result property="isDel" column="is_del" jdbcType="INTEGER"/>
+        <result property="wxUserId" column="wx_user_id" jdbcType="VARCHAR"/>
+        <result property="role" column="is_del" jdbcType="INTEGER"/>
     </resultMap>
 
     <!--查询单个-->
     <select id="queryById" resultMap="SWorkerMap">
         select
-          id, name, region, phone_num, status, create_time, update_time, is_del
+          id, name, region, phone_num, status, create_time, update_time, is_del,wx_user_id,role
         from s_worker
         where id = #{id}
     </select>

+ 0 - 1
nngkxxdp/src/main/resources/static/district/sy_mobile.html

@@ -520,7 +520,6 @@
                                 <p class="flex_text">直饮水点</p>
                             </div>
                         </li>
-                        <li></li>
                     </ul>
                 </div>
             </div>