From 32cbe06ec61a697eed6b54b3835f955174aa3ae0 Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Thu, 24 Dec 2020 11:17:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=94=E5=9B=9E=E6=9C=89?= =?UTF-8?q?=E6=95=88=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=BB=8A=E5=A4=A9=E4=BB=A5=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fantang/controller/ClientController.java | 2 +- .../service/impl/FtOrderDaoServiceImpl.java | 1 + .../impl/FtStaffInfoDaoServiceImpl.java | 26 ++++++++++++------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java index ac9d8ccb9..88ad2a36b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java @@ -93,7 +93,7 @@ public class ClientController extends BaseController { * param JSONObject staffId: 员工id * return */ - @GetMapping("/getAvailableStopOrder") + @PostMapping("/getAvailableStopOrder") public AjaxResult getAvailableStopOrder(@RequestBody JSONObject params) { return AjaxResult.success(orderDaoService.getAvailableStopOrder(params.getLong("staffId"))); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java index 57baec15f..e33f49adf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java @@ -63,6 +63,7 @@ public class FtOrderDaoServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq("staff_id", staffId); + wrapper.ge("order_date", new Date()); List daos = this.baseMapper.selectList(wrapper); return AjaxResult.success(daos); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffInfoDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffInfoDaoServiceImpl.java index dddd442f0..06a4bda38 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffInfoDaoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffInfoDaoServiceImpl.java @@ -28,16 +28,22 @@ public class FtStaffInfoDaoServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("tel", tel); - queryWrapper.eq("password", password); - FtStaffInfoDao dao = this.baseMapper.selectOne(queryWrapper); - if (dao == null) - return AjaxResult.error(-1, "查无记录"); - dao.setLoginFlag(true); - dao.setToken(IdUtils.fastUUID()); - this.baseMapper.updateById(dao); - return AjaxResult.success(dao); + // 查询是否有该员工 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("tel", tel); + FtStaffInfoDao dao = this.baseMapper.selectOne(wrapper); + if (dao == null) { + return AjaxResult.error(-2, "无该员工信息"); + } else { + wrapper.eq("password", password); + dao = this.baseMapper.selectOne(wrapper); + if (dao == null) + return AjaxResult.error(-1, "密码错误"); + dao.setLoginFlag(true); + dao.setToken(IdUtils.fastUUID()); + this.baseMapper.updateById(dao); + return AjaxResult.success(dao); + } } @Override