Browse Source

后台控制层

elis 2 years ago
parent
commit
bbf4c7e881

+ 13 - 0
naqwzsjtj/naqwzsjtj/src/api/repair.js

@@ -0,0 +1,13 @@
+import request from '../utils/request'
+
+export default {
+    /**
+     * 检查微信用户是否存在
+     * 
+     * @param {{phoneNum: string}} data
+     * @returns 
+     */
+  hasWxUser(data) {
+    return request.get('repair/hasWxUser', data)
+  }
+}

+ 46 - 324
naqwzsjtj/naqwzsjtj/src/views/repair/RepairWorker.vue

@@ -23,11 +23,10 @@
           {{ (sorts.page - 1) * sorts.limit + scope.$index + 1 }}
         </template>
       </el-table-column>
-      <el-table-column prop="canteenName" label="食堂名称" :show-overflow-tooltip="true" min-width="160" />
-      <el-table-column prop="founder" :show-overflow-tooltip="true" label="创建人" />
-      <el-table-column prop="principal" :show-overflow-tooltip="true" label="负责人" />
-      <el-table-column prop="complaintPhone" :show-overflow-tooltip="true" label="投诉电话" />
-      <el-table-column prop="takeoutPhone" :show-overflow-tooltip="true" label="外卖电话" />
+      <el-table-column prop="canteenName" label="姓名" :show-overflow-tooltip="true" min-width="160" />
+      <el-table-column prop="founder" :show-overflow-tooltip="true" label="负责区域" />
+      <el-table-column prop="principal" :show-overflow-tooltip="true" label="联系电话" />
+      <el-table-column prop="complaintPhone" :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="140">
@@ -46,73 +45,37 @@
       </el-pagination>
     </div>
     <!-- 新增/编辑食堂 -->
-    <el-dialog :visible.sync="workDialog" width="40%" class="detailDialog" :close-on-click-modal="false" top="40px">
+    <el-dialog :visible.sync="workDialog" width="35%" class="detailDialog" :close-on-click-modal="false" top="200px">
       <div slot="title">
         <div class="addTitle">{{ workTitle }}</div>
       </div>
-      <div style="height: 65vh; overflow: auto; padding-right: 20px">
+      <div style="height: 25vh; overflow: auto; padding-right: 20px">
         <el-form :model="postManagement" label-width="80px">
           <el-row>
             <el-col :span="22">
-              <el-form-item class="input-star" label="食堂名称" prop="canteenName">
-                <el-input v-model="postManagement.canteenName" placeholder="请输入食堂名称">
+              <el-form-item class="input-star" label="姓名" prop="name">
+                <el-input v-model="postManagement.name" placeholder="请输入工人姓名">
                 </el-input>
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="22">
-              <el-form-item class="input-star" label="供应时间" prop="url">
-                <el-select v-model="postManagement.supplyTimeId" @change="timeNodeChange" @remove-tag="timeNodeChange"
-                  @visible-change="timeNodeChange" multiple placeholder="请选择" style="width: 100%">
-                  <el-option-group v-for="group in timeNodeOptions" :key="group.label" :label="group.label">
-                    <el-option v-for="item in group.options" :key="item.id" :label="
-                        item.supplyStartTime +
-                        ' —— ' +
-                        item.supplyEndTime +
-                        ' (' +
-                        group.label +
-                        ')'
-                      " :value="item.id" :disabled="item.disabled">
-                    </el-option>
-                  </el-option-group>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="22">
-              <el-form-item class="input-star" label="负责人" prop="principal">
-                <el-input v-model="postManagement.principal" maxlength="32" placeholder="请输入食堂负责人">
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="22">
-              <el-form-item class="input-star" label="投诉电话" prop="complaintPhone">
-                <el-input v-model="postManagement.complaintPhone" placeholder="请输入食堂投诉电话" maxlength="12">
+              <el-form-item class="input-star" label="负责区域" prop="region">
+                <el-input v-model="postManagement.region" maxlength="32" placeholder="请输入工人负责区域">
                 </el-input>
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
-            <el-col :span="22">
-              <el-form-item label="外卖电话" prop="takeoutPhone">
-                <el-input v-model="postManagement.takeoutPhone" placeholder="请输入外卖电话" maxlength="12">
+            <el-col :span="16">
+              <el-form-item class="input-star" label="联系电话" prop="phoneNum">
+                <el-input v-model="postManagement.phoneNum" placeholder="请输入工人电话" maxlength="12">
                 </el-input>
               </el-form-item>
             </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="24">
-              <el-form-item label="食堂图片" prop="url"> </el-form-item>
-              <el-upload element-loading-text="数据上传中请等待..." action="" :on-change="handleChange" :multiple="false"
-                :auto-upload="false" :http-request="saveWork" list-type="picture-card"
-                accept="image/png,image/jpg,image/jpeg,image/bmp" :show-file-list="true" :file-list="fileList"
-                :on-remove="picRemove">
-                <i class="el-icon-plus"></i>
-              </el-upload>
+            <el-col :span="8" >
+              <el-button @click="hasWxUser" style="margin-left: 40px;" type="primary">检索</el-button>
             </el-col>
           </el-row>
         </el-form>
@@ -127,10 +90,9 @@
 
 <script>
   import api from "../../api";
+  import Repair from "@/api/repair";
 
 
-  import CONFIG from "../../../vue.config"
-
   export default {
     name: "CanteenManage",
     created() {
@@ -147,33 +109,7 @@
         query: {
           canteenName: "",
         },
-        // 所有时间节点
-        timeNodeList: [],
-        // 整体分组
-        timeNodeOptions: [],
-        // 4个时间段分组
-        timeNodeOption1: {
-          label: "早餐",
-          options: [],
-        },
-        timeNodeOption2: {
-          label: "中餐",
-          options: [],
-        },
-        timeNodeOption3: {
-          label: "晚餐",
-          options: [],
-        },
-        timeNodeOption4: {
-          label: "外卖",
-          options: [],
-        },
-        // 早餐列表
-        timeNodeList1: [],
-        // 中餐列表
-        timeNodeList2: [],
-        timeNodeList3: [],
-        timeNodeList4: [],
+
         // 列表数据
         tableData: [],
         // 总数
@@ -181,15 +117,12 @@
         //新增/编辑食堂界面
         workDialog: false,
         //新增/编辑食堂标题
-        workTitle: "新增食堂",
+        workTitle: "新增工人",
         // 新增/编辑表单
         postManagement: {
-          canteenName: "",
-          canteenPhotoPath: "",
-          supplyTimeId: [],
-          principal: "",
-          complaint_phone: "",
-          takeout_phone: "",
+          name: "",
+          region: "",
+          phoneNum: "",
         },
         // 分页
         sorts: {
@@ -203,20 +136,19 @@
       };
     },
     methods: {
-      // 删除文件
-      picRemove(file, fileList) {
-        if (this.postManagement.canteenPhotoPath) {
-          let temp = this.postManagement.canteenPhotoPath.split(",");
-          for (let i = 0; i < temp.length; i++) {
-            if (temp[i] == file.name) {
-              temp[i] = temp[i] + "x";
-              break;
-            }
-          }
-          this.postManagement.canteenPhotoPath = temp.join(",");
-        }
-        this.uploadFiles = fileList;
+
+      /**
+       * 检索当前手机号是否存在微信用户
+       */
+      hasWxUser(){
+        console.log(123);
+        Repair.hasWxUser({
+          "phoneNum":this.postManagement.phoneNum
+        }).then((r)=>{
+          console.log(r);
+        })
       },
+
       // 列表排序
       compare(property) {
         return function (a, b) {
@@ -225,130 +157,7 @@
           return value1 - value2;
         };
       },
-      // 供应时间按早中晚外卖排序
-      supplyTimeIdSort() {
-        // 存在供应时间才排序
-        if (
-          this.postManagement.supplyTimeId &&
-          this.postManagement.supplyTimeId.length > 0
-        ) {
-          let supplyList = this.postManagement.supplyTimeId;
-          let supplyData = [];
-          supplyList.forEach((id) => {
-            let node = this.timeNodeList.find((item) => item.id === id)
-            if (node) {
-              supplyData.push(node);
-            }
-
-          });
-          supplyData = supplyData.sort(this.compare("timeNode"));
-          this.postManagement.supplyTimeId = [];
-          supplyData.forEach((item) => {
-            this.postManagement.supplyTimeId.push(item.id);
-          });
-        }
-      },
-      // 根据选择的时间节点,保证同一组选项只能选择一个
-      timeNodeChange() {
-        // 排序
-        this.supplyTimeIdSort();
-        // 分别代表早中晚快递选择的数量
-        let timeNodeNum1 = 0;
-        let timeNodeNum2 = 0;
-        let timeNodeNum3 = 0;
-        let timeNodeNum4 = 0;
-        if (
-          this.postManagement.supplyTimeId &&
-          this.postManagement.supplyTimeId.length > 0
-        ) {
-          // 遍历已选择的选项
-          this.postManagement.supplyTimeId.forEach((item) => {
-            let index = this.timeNodeList.findIndex(function (node) {
-              return item === node.id;
-            });
-            // 找到时间节点类型
-            if (index !== -1) {
-              let nodeType = this.timeNodeList[index].timeNode;
-              switch (nodeType) {
-                case 1:
-                  timeNodeNum1++;
-                  break;
-                case 2:
-                  timeNodeNum2++;
-                  break;
-                case 3:
-                  timeNodeNum3++;
-                  break;
-                case 4:
-                  timeNodeNum4++;
-                  break;
-              }
-            }
-          });
-        }
-        if (timeNodeNum1 > 0) {
-          this.timeNodeList1.forEach((node1) => {
-            node1.disabled = true;
-          });
-        } else {
-          this.timeNodeList1.forEach((node1) => {
-            node1.disabled = false;
-          });
-        }
-        if (timeNodeNum2 > 0) {
-          this.timeNodeList2.forEach((node1) => {
-            node1.disabled = true;
-          });
-        } else {
-          this.timeNodeList2.forEach((node1) => {
-            node1.disabled = false;
-          });
-        }
-        if (timeNodeNum3 > 0) {
-          this.timeNodeList3.forEach((node1) => {
-            node1.disabled = true;
-          });
-        } else {
-          this.timeNodeList3.forEach((node1) => {
-            node1.disabled = false;
-          });
-        }
-        if (timeNodeNum4 > 0) {
-          this.timeNodeList4.forEach((node1) => {
-            node1.disabled = true;
-          });
-        } else {
-          this.timeNodeList4.forEach((node1) => {
-            node1.disabled = false;
-          });
-        }
-      },
-      // 监听文件上传改变
-      handleChange(file, fileList) {
-        if (file.raw.type === 'image/png' || file.raw.type === 'image/jpg' || file.raw.type ===
-          'image/jpeg' ||
-          file.raw.type === 'image/bmp') {
-          this.uploadFiles = fileList;
-        } else {
-          this.$message.error('只能上传jpg或png或bmp或jpeg格式!');
-          fileList.splice(-1);
-        }
-      },
-      //打开新增食堂界面
-      openAddWork() {
-        api
-          .supplyTimeList()
-          .then((r) => {
-            if (r.data.result) {
-              // 拿到时间节点,并分组
-              this.updateTimeNodeGroup(r.data.data);
-            } else {
-              this.$message.error("获取时间节点列表失败");
-            }
-          })
-          .catch(() => {
-            this.$message.error("获取时间节点列表失败");
-          });
+      openAddWork(){
         this.postManagement = {
           canteenName: "",
           canteenPhotoPath: "",
@@ -357,106 +166,19 @@
           complaint_phone: "",
           takeout_phone: "",
         };
-        this.fileList = [];
-        this.workTitle = "新增食堂";
-        this.workDialog = true;
-      },
-      //打开修改食堂界面
-      openModifyWorkDialog(data) {
-        api
-          .supplyTimeList()
-          .then((r) => {
-            if (r.data.result) {
-              // 拿到时间节点列表,并分组
-              this.updateTimeNodeGroup(r.data.data);
-              this.postManagement = JSON.parse(JSON.stringify(data));
-              if (
-                this.postManagement.supplyTimeId &&
-                this.postManagement.supplyTimeId !== ""
-              ) {
-                this.postManagement.supplyTimeId =
-                  this.postManagement.supplyTimeId.split(",");
-              }
-              this.timeNodeChange();
-              this.fileList = [];
-              let params = {
-                picId: this.postManagement.canteenPhotoPath,
-              };
-              if (params.picId && params.picId !== "") {
-                api
-                  .getFoodPicByPicId({
-                    params,
-                  })
-                  .then((res) => {
-                    if (res.data.result) {
-                      this.fileList = res.data.data.map((item) => {
-                        return {
-                          url: this.imgUrl + item.path,
-                          name: item.id,
-                        };
-                      });
-                    }
-                  });
-              }
-
-            } else {
-              this.$message.error("获取时间节点列表失败2");
-            }
-          })
-          .catch(() => {
-            this.$message.error("获取时间节点列表失败1");
-          });
-        this.workTitle = "编辑食堂";
-        this.postManagement = JSON.parse(JSON.stringify(data));
+        this.workTitle = "新增工人";
         this.workDialog = true;
       },
-      // 更新时间节点的分组
-      updateTimeNodeGroup(data) {
-        this.timeNodeList = data;
-        this.timeNodeList1 = this.timeNodeList.filter((item) => {
-          return item.timeNode === 1;
-        });
-        this.timeNodeList2 = this.timeNodeList.filter((item) => {
-          return item.timeNode === 2;
-        });
-        this.timeNodeList3 = this.timeNodeList.filter((item) => {
-          return item.timeNode === 3;
-        });
-        this.timeNodeList4 = this.timeNodeList.filter((item) => {
-          return item.timeNode === 4;
-        });
-        this.timeNodeOption1.options = this.timeNodeList1;
-        this.timeNodeOption2.options = this.timeNodeList2;
-        this.timeNodeOption3.options = this.timeNodeList3;
-        this.timeNodeOption4.options = this.timeNodeList4;
-        this.timeNodeOptions = [];
-        this.timeNodeOptions.push(
-          this.timeNodeOption1,
-          this.timeNodeOption2,
-          this.timeNodeOption3,
-          this.timeNodeOption4
-        );
-      },
-      isMobile(value) {
-        if (!value || value === "") {
-          return false;
-        }
-        const mobileReg =
-          /^(([1][3,4,5,7,8]\d{9})|([0]\d{10,11})|(\d{7,8})|(\d{4}|\d{3})-(\d{7,8}))$/;
-        if (!mobileReg.test(value)) {
-          return false;
-        }
-        return true;
-      },
-      isTel(value) {
-        if (!value || value === "") {
-          return false;
-        }
-        const phoneReg = /^\d{3}-\d{8}|\d{4}-\d{7}$/;
-        if (!phoneReg.test(value)) {
-          return false;
+      // 监听文件上传改变
+      handleChange(file, fileList) {
+        if (file.raw.type === 'image/png' || file.raw.type === 'image/jpg' || file.raw.type ===
+          'image/jpeg' ||
+          file.raw.type === 'image/bmp') {
+          this.uploadFiles = fileList;
+        } else {
+          this.$message.error('只能上传jpg或png或bmp或jpeg格式!');
+          fileList.splice(-1);
         }
-        return true;
       },
       // 保存
       saveWork() {
@@ -530,7 +252,7 @@
               }
             })
             .catch(() => {
-              this.$message.error(r.data.msg);
+              // this.$message.error(r.data.msg);
             });
         } else {
           // 新增食堂
@@ -547,7 +269,7 @@
               }
             })
             .catch(() => {
-              this.$message.error(r.data.msg);
+              // this.$message.error(r.data.msg);
             });
         }
       },

+ 2 - 43
naqwzsjtj/naqwzsjtj/src/views/repair/WorkOrder.vue

@@ -122,15 +122,7 @@
         tableData: [],
         // 总数
         total: 0,
-        //详情界面
-        workDialog: false,
-        //详情标题
-        workTitle: '详情',
-        // 详情表单
-        postManagement: {
-          dishesName: ''
-        },
-        photoUrl: [],
+
         // 分页
         sorts: {
           page: 1,
@@ -151,40 +143,7 @@
         this.sorts.page = currentPage;
         this.getData();
       },
-      // 违规标记
-      markEvaluation(id) {
-        this.$confirm("是否标记违规?", "提示", {
-          cancelButtonClass: "btn-custom-cancel",
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          let params = {
-            "id": id
-          };
-          api.markEvaluation({
-            params
-          }).then(res => {
-            if (res.data.result) {
-              this.$message({
-                type: 'success',
-                message: '标记成功!'
-              });
-              this.getData();
-            } else {
-              this.$message({
-                type: 'info',
-                message: '标记失败!'
-              });
-            }
-          })
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消标记'
-          });
-        })
-      },
+
       // 详情
       info: function (data) {
         this.workTitle = "详情";

+ 7 - 1
nngkxxdp/src/main/java/com/example/nngkxxdp/program/controller/SRepairController.java

@@ -3,8 +3,10 @@ package com.example.nngkxxdp.program.controller;
 
 import com.example.nngkxxdp.program.entity.SRepair;
 import com.example.nngkxxdp.program.service.SRepairService;
+import org.jsoup.internal.StringUtil;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageRequest;
+import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 
@@ -15,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
  * @since 2023-03-20 14:36:16
  */
 @RestController
-@RequestMapping("sRepair")
+@RequestMapping("repair")
 public class SRepairController {
     /**
      * 服务对象
@@ -25,6 +27,10 @@ public class SRepairController {
     public SRepairController(SRepairService sRepairService) {
         this.sRepairService = sRepairService;
     }
+
+
+
+
     /**
      * 分页查询
      *

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

@@ -3,6 +3,7 @@ package com.example.nngkxxdp.program.controller;
 
 import com.example.nngkxxdp.program.entity.SWorker;
 import com.example.nngkxxdp.program.service.SWorkerService;
+import org.jsoup.internal.StringUtil;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.http.ResponseEntity;
@@ -15,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
  * @since 2023-03-20 14:38:05
  */
 @RestController
-@RequestMapping("sWorker")
+@RequestMapping("worker")
 public class SWorkerController {
     /**
      * 服务对象
@@ -25,6 +26,15 @@ public class SWorkerController {
     public SWorkerController(SWorkerService sWorkerService) {
         this.sWorkerService = sWorkerService;
     }
+
+
+    @GetMapping("hasWxUser")
+    public ResponseEntity<Boolean> hasWxUser(String phoneNum){
+        if (StringUtil.isBlank(phoneNum)){
+            return ResponseEntity.ok(false);
+        }
+        return ResponseEntity.ok(sWorkerService.hasWxUser(phoneNum));
+    }
     /**
      * 分页查询
      *

+ 4 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/program/dao/AppletUserDao.java

@@ -1,6 +1,8 @@
 package com.example.nngkxxdp.program.dao;
 
 import com.example.nngkxxdp.program.entity.AppletUser;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.Map;
 
@@ -9,6 +11,7 @@ import java.util.Map;
  * @date 2022年10月11日 15:56:23
  * @describe
  */
+@Mapper
 public interface AppletUserDao {
 
     AppletUser queryByUserId(Long userId);
@@ -40,4 +43,5 @@ public interface AppletUserDao {
      */
     String queryUserHlToken(String userId);
 
+    Integer findUser(@Param("phoneNum") String phoneNum);
 }

+ 5 - 2
nngkxxdp/src/main/java/com/example/nngkxxdp/program/service/Impl/SRepairServiceImpl.java

@@ -1,6 +1,7 @@
 package com.example.nngkxxdp.program.service.Impl;
 
 
+import com.example.nngkxxdp.program.dao.AppletUserDao;
 import com.example.nngkxxdp.program.dao.SRepairDao;
 import com.example.nngkxxdp.program.entity.SRepair;
 import com.example.nngkxxdp.program.service.SRepairService;
@@ -9,8 +10,6 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageImpl;
 import org.springframework.data.domain.PageRequest;
 
-import javax.annotation.Resource;
-
 /**
  * (SRepair)表服务实现类
  *
@@ -21,6 +20,8 @@ import javax.annotation.Resource;
 public class SRepairServiceImpl implements SRepairService {
     
     private final SRepairDao sRepairDao;
+
+
     
     public SRepairServiceImpl(SRepairDao sRepairDao) {
         this.sRepairDao = sRepairDao;
@@ -83,4 +84,6 @@ public class SRepairServiceImpl implements SRepairService {
     public boolean deleteById(Integer id) {
         return this.sRepairDao.deleteById(id) > 0;
     }
+
+
 }

+ 13 - 3
nngkxxdp/src/main/java/com/example/nngkxxdp/program/service/Impl/SWorkerServiceImpl.java

@@ -1,6 +1,8 @@
 package com.example.nngkxxdp.service.impl;
 
 
+import cn.hutool.core.lang.UUID;
+import com.example.nngkxxdp.program.dao.AppletUserDao;
 import com.example.nngkxxdp.program.dao.SWorkerDao;
 import com.example.nngkxxdp.program.entity.SWorker;
 import com.example.nngkxxdp.program.service.SWorkerService;
@@ -9,8 +11,6 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageImpl;
 import org.springframework.data.domain.PageRequest;
 
-import javax.annotation.Resource;
-
 /**
  * (SWorker)表服务实现类
  *
@@ -21,9 +21,11 @@ import javax.annotation.Resource;
 public class SWorkerServiceImpl implements SWorkerService {
     
     private final SWorkerDao sWorkerDao;
+    private final AppletUserDao appletUserDao;
     
-    public SWorkerServiceImpl(SWorkerDao sWorkerDao) {
+    public SWorkerServiceImpl(SWorkerDao sWorkerDao, AppletUserDao appletUserDao) {
         this.sWorkerDao = sWorkerDao;
+        this.appletUserDao = appletUserDao;
     }
     /**
      * 通过ID查询单条数据
@@ -57,6 +59,8 @@ public class SWorkerServiceImpl implements SWorkerService {
      */
     @Override
     public SWorker insert(SWorker sWorker) {
+        sWorker.setId(UUID.randomUUID().toString(true));
+        sWorker.setStatus(0);
         this.sWorkerDao.insert(sWorker);
         return sWorker;
     }
@@ -83,4 +87,10 @@ public class SWorkerServiceImpl implements SWorkerService {
     public boolean deleteById(String id) {
         return this.sWorkerDao.deleteById(id) > 0;
     }
+
+    @Override
+    public boolean hasWxUser(String phoneNum) {
+        Integer count = appletUserDao.findUser(phoneNum);
+        return  count>0;
+    }
 }

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

@@ -54,4 +54,5 @@ public interface SRepairService {
      */
     boolean deleteById(Integer id);
 
+
 }

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

@@ -54,4 +54,5 @@ public interface SWorkerService {
      */
     boolean deleteById(String id);
 
+    boolean hasWxUser(String phoneNum);
 }

+ 4 - 0
nngkxxdp/src/main/resources/mapper/AppletUserDao.xml

@@ -103,4 +103,8 @@
         from  applet_user
         where id = #{userId}
     </select>
+    <select id="findUser" resultType="int">
+        select count(*) from applet_user
+        where telephone=#{phoneNum}
+    </select>
 </mapper>

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

@@ -90,7 +90,7 @@
     <!--新增所有列-->
     <insert id="insert" keyProperty="id" useGeneratedKeys="true">
         insert into s_worker(name, region, phone_num, status, create_time, update_time, is_del)
-        values (#{name}, #{region}, #{phoneNum}, #{status}, #{createTime}, #{updateTime}, #{isDel})
+        values (#{name}, #{region}, #{phoneNum}, #{status}, Now(), Now(), 0)
     </insert>
 
     <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">