From 4cb7ae256e29b5923d465664094274df2fdd698a Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Wed, 9 Dec 2020 17:48:05 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E5=91=98=E5=B7=A5=E7=AB=AF=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fantang/controller/ClientController.java | 17 ++++++++++++----- .../fantang/service/IFtStaffInfoDaoService.java | 2 ++ .../service/impl/FtStaffInfoDaoServiceImpl.java | 13 +++++++++++++ 3 files changed, 27 insertions(+), 5 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 44dae9d24..99617713b 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 @@ -2,11 +2,15 @@ package com.ruoyi.system.fantang.controller; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.system.fantang.domain.FtStaffInfoDao; import com.ruoyi.system.fantang.service.IFtConfigDaoService; +import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.Map; + @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController @RequestMapping("/client_api/staff") @@ -17,6 +21,9 @@ public class ClientController extends BaseController { @Autowired private IFtConfigDaoService iFtConfigDaoService; + @Autowired + private IFtStaffInfoDaoService staffInfoDaoService; + @GetMapping("/getDinnerTimeSetting") public AjaxResult getDinnerTimeSetting() { return AjaxResult.success(iFtConfigDaoService.getDinnerTimeSetting()); @@ -52,12 +59,12 @@ public class ClientController extends BaseController { return AjaxResult.success("推送个人配置"); } - @PostMapping("/login") - public AjaxResult login() { - return AjaxResult.success("登录成功"); + @GetMapping("/login") + public AjaxResult login(String tel, String password) { + return staffInfoDaoService.login(tel, password); } - @PostMapping("/logout") - public AjaxResult logout() { + @PostMapping("/logout/{staffId}") + public AjaxResult logout(@PathVariable("staffId") Long staffId) { return AjaxResult.success("登录成功"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffInfoDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffInfoDaoService.java index f2b47f49a..6f810f9b2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffInfoDaoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffInfoDaoService.java @@ -1,6 +1,7 @@ package com.ruoyi.system.fantang.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.fantang.domain.FtStaffInfoDao; import java.util.List; @@ -15,4 +16,5 @@ public interface IFtStaffInfoDaoService extends IService { List selectStaffInfoWithDepart(); + AjaxResult login(String tel, String password); } 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 a86bd22f4..60e6e7391 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 @@ -1,6 +1,8 @@ package com.ruoyi.system.fantang.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.fantang.domain.FtStaffInfoDao; import com.ruoyi.system.fantang.mapper.FtStaffInfoDaoMapper; import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService; @@ -22,4 +24,15 @@ 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, "查无记录"); + return AjaxResult.success(dao); + } } From 84125a0f7282baf2fdf6cf97f8f5689ab88d5791 Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Thu, 10 Dec 2020 09:57:29 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=91=98=E5=B7=A5?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E8=A1=A8=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/system/fantang/domain/FtStaffInfoDao.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffInfoDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffInfoDao.java index 7a648ce02..b892b5120 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffInfoDao.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffInfoDao.java @@ -123,4 +123,10 @@ public class FtStaffInfoDao { * 手机号码 */ private String tel; + + private String token; + + private Boolean loginFlag; + + private Long expiredFlag; } \ No newline at end of file From cb8614201de4a708edc2f287f329899877984dd7 Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Thu, 10 Dec 2020 13:33:17 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E5=99=A8=EF=BC=8C=E5=AE=9A=E6=97=B6=E7=94=9F=E6=88=90=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E8=AE=A2=E9=A4=90=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/quartz/task/FtGenerateOrderTask.java | 10 ++++++++++ .../ruoyi/system/fantang/mapper/FtOrderDaoMapper.java | 3 +++ .../fantang/service/impl/FtOrderDaoServiceImpl.java | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/FtGenerateOrderTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/FtGenerateOrderTask.java index c6d33c094..ad1db65bf 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/FtGenerateOrderTask.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/FtGenerateOrderTask.java @@ -2,6 +2,7 @@ package com.ruoyi.quartz.task; import com.ruoyi.system.fantang.mapper.FtReportMealVoMapper; import com.ruoyi.system.fantang.service.impl.FtFoodDemandDaoServiceImpl; +import com.ruoyi.system.fantang.service.impl.FtOrderDaoServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -19,6 +20,9 @@ public class FtGenerateOrderTask { @Autowired private FtReportMealVoMapper ftReportMealVoMapper; + @Autowired + private FtOrderDaoServiceImpl orderDaoService; + public void GenerateOrderTask() { System.out.println("执行生成一条病患默认订餐配置记录"); foodDemandDaoService.GenerateOrderForNewPatient(); @@ -28,4 +32,10 @@ public class FtGenerateOrderTask { System.out.println("生成次日病患报餐记录"); ftReportMealVoMapper.insertTomorrowReportMeal(); } + + // 生成次日员工订餐记录 + public void GenerateStaffTomorrowOrder() { + System.out.println("生成次日员工订餐记录"); + orderDaoService.GenerateStaffTomorrowOrder(); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java index d927dee87..b246f45eb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.system.fantang.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.fantang.domain.FtOrderDao; +import org.apache.ibatis.annotations.Insert; /** * 订单管理Mapper接口 @@ -11,4 +12,6 @@ import com.ruoyi.system.fantang.domain.FtOrderDao; */ public interface FtOrderDaoMapper extends BaseMapper { + @Insert("insert into ft_order (order_type, staff_id, order_src, create_at, order_date) select type as order_type, b.staff_id, 1 as order_src, now() as create_at, date_add(now(), interval 1 day) as order_date from ft_staff_demand b where b.demand_mode = 1") + void GenerateStaffTomorrowOrder(); } 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 b1159e872..1779ddcc9 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 @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.system.fantang.domain.FtOrderDao; import com.ruoyi.system.fantang.mapper.FtOrderDaoMapper; import com.ruoyi.system.fantang.service.IFtOrderDaoService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** @@ -15,4 +16,8 @@ import org.springframework.stereotype.Service; @Service public class FtOrderDaoServiceImpl extends ServiceImpl implements IFtOrderDaoService { + public void GenerateStaffTomorrowOrder() { + this.baseMapper.GenerateStaffTomorrowOrder(); + + } } From 89d06362a76e49673b2f7bee24c374eec3d4e9dd Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Thu, 10 Dec 2020 17:57:56 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=91=98=E5=B7=A5?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8A=A5=E9=A4=90sql=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=AE=A1=E7=AE=97=E6=9C=80=E6=96=B0=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java index b246f45eb..b5e2c28cf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java @@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Insert; */ public interface FtOrderDaoMapper extends BaseMapper { - @Insert("insert into ft_order (order_type, staff_id, order_src, create_at, order_date) select type as order_type, b.staff_id, 1 as order_src, now() as create_at, date_add(now(), interval 1 day) as order_date from ft_staff_demand b where b.demand_mode = 1") + @Insert("insert into ft_order (order_type, staff_id, order_src, create_at, order_date, order_list, total_price) select type as order_type, staff_id, 1 as order_src, now() as create_at, date_add(now(), interval 1 day) as order_date, foods, (select sum(price) from ft_food f where FIND_IN_SET(f.food_id,d.foods)) as price from ft_staff_demand d where d.demand_mode = 1") void GenerateStaffTomorrowOrder(); } From 9e1f48d9d87986670e7f892f7a2696b408bf9df6 Mon Sep 17 00:00:00 2001 From: "28353131@qq.com" <28353131@qq.com> Date: Thu, 10 Dec 2020 21:43:33 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=AE=B0=E5=BD=95=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=8A=B6=E6=80=81=EF=BC=8C=E8=BF=94=E5=9B=9Euuid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fantang/service/impl/FtStaffInfoDaoServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) 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 60e6e7391..91e5d82e9 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 @@ -3,6 +3,7 @@ package com.ruoyi.system.fantang.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.system.fantang.domain.FtStaffInfoDao; import com.ruoyi.system.fantang.mapper.FtStaffInfoDaoMapper; import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService; @@ -33,6 +34,9 @@ public class FtStaffInfoDaoServiceImpl extends ServiceImpl Date: Thu, 10 Dec 2020 22:45:45 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E5=91=98=E5=B7=A5=E8=AE=A2=E9=A4=90?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E8=8E=B7=E5=8F=96=E9=85=8D=E7=BD=AE=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fantang/controller/ClientController.java | 30 +++++++++++++++---- .../fantang/domain/FtStaffDemandDao.java | 4 +-- .../service/IFtStaffDemandDaoService.java | 6 +++- .../service/IFtStaffInfoDaoService.java | 2 ++ .../impl/FtStaffDemandDaoServiceImpl.java | 23 ++++++++++++++ .../impl/FtStaffInfoDaoServiceImpl.java | 12 ++++++++ 6 files changed, 68 insertions(+), 9 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 99617713b..1b5115e94 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 @@ -1,14 +1,17 @@ package com.ruoyi.system.fantang.controller; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.fantang.domain.FtStaffInfoDao; import com.ruoyi.system.fantang.service.IFtConfigDaoService; +import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService; import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; import java.util.Map; @RequiredArgsConstructor(onConstructor_ = @Autowired) @@ -24,6 +27,9 @@ public class ClientController extends BaseController { @Autowired private IFtStaffInfoDaoService staffInfoDaoService; + @Autowired + private IFtStaffDemandDaoService staffDemandDaoService; + @GetMapping("/getDinnerTimeSetting") public AjaxResult getDinnerTimeSetting() { return AjaxResult.success(iFtConfigDaoService.getDinnerTimeSetting()); @@ -49,13 +55,17 @@ public class ClientController extends BaseController { return AjaxResult.success("调用提交订单成功"); } + // 获取配置信息 @GetMapping("/getConfiguration/{staffId}") public AjaxResult getConfiguration(@PathVariable("staffId") Integer staffId) { + staffDemandDaoService.getConfiguration(staffId); return AjaxResult.success("调用个人配置"); } - @PostMapping("/postConfiguration") - public AjaxResult postConfiguration() { + // 获取配置信息 + @PostMapping("/postConfiguration/{staffId}") + public AjaxResult postConfiguration(@PathVariable("staffId") Long staffId) { + return AjaxResult.success("推送个人配置"); } @@ -65,6 +75,7 @@ public class ClientController extends BaseController { } @PostMapping("/logout/{staffId}") public AjaxResult logout(@PathVariable("staffId") Long staffId) { + staffInfoDaoService.logout(staffId); return AjaxResult.success("登录成功"); } @@ -82,20 +93,27 @@ public class ClientController extends BaseController { public AjaxResult getOtherProduct() { return null; } - @GetMapping("/postProductOrder") + @PostMapping("/postProductOrder") public AjaxResult postProductOrder() { return null; } - @GetMapping("/postCurrentOrder") + @PostMapping("/postCurrentOrder") public AjaxResult postCurrentOrder() { return null; } - @GetMapping("/postStopOrder") + @PostMapping("/postStopOrder") public AjaxResult postStopOrder() { return null; } - @GetMapping("/postRestoreOrder") + @PostMapping("/postRestoreOrder") public AjaxResult postRestoreOrder() { return null; } + + @PostMapping("/setDemandMode") + public AjaxResult setDemandMode(@RequestBody JSONObject params) { + Long id = params.getLong("id"); + Boolean demandMode = params.getBoolean("demandModeFlag"); + return staffDemandDaoService.setDemandMode(id, demandMode); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffDemandDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffDemandDao.java index 7e137d050..f97266f59 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffDemandDao.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffDemandDao.java @@ -38,7 +38,7 @@ private static final long serialVersionUID=1L; /** 员工 id */ @Excel(name = "员工 id") - private Long staffId; + private Integer staffId; /** 正餐清单 */ @Excel(name = "正餐清单") @@ -74,7 +74,7 @@ private static final long serialVersionUID=1L; /** 报餐模式 */ @Excel(name = "报餐模式") - private Integer demandMode; + private Boolean demandMode; /** 停用标志 */ @Excel(name = "停用标志") diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffDemandDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffDemandDaoService.java index 3e4fa3ddc..a2eb747df 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffDemandDaoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffDemandDaoService.java @@ -1,14 +1,18 @@ package com.ruoyi.system.fantang.service; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.fantang.domain.FtStaffDemandDao; import com.baomidou.mybatisplus.extension.service.IService; /** * 员工报餐Service接口 * - * @author ft + * @author 陈智兴 * @date 2020-12-07 */ public interface IFtStaffDemandDaoService extends IService { + AjaxResult getConfiguration(Integer staffId); + + AjaxResult setDemandMode(Long id, Boolean demandModeFlag); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffInfoDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffInfoDaoService.java index 6f810f9b2..2720880d5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffInfoDaoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffInfoDaoService.java @@ -17,4 +17,6 @@ public interface IFtStaffInfoDaoService extends IService { List selectStaffInfoWithDepart(); AjaxResult login(String tel, String password); + + AjaxResult logout(Long staffId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffDemandDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffDemandDaoServiceImpl.java index 8162df1ce..65aa3a6ca 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffDemandDaoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffDemandDaoServiceImpl.java @@ -1,5 +1,7 @@ package com.ruoyi.system.fantang.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.ruoyi.common.core.domain.AjaxResult; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.system.fantang.mapper.FtStaffDemandDaoMapper; @@ -15,4 +17,25 @@ import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService; @Service public class FtStaffDemandDaoServiceImpl extends ServiceImpl implements IFtStaffDemandDaoService { + @Override + public AjaxResult getConfiguration(Integer staffId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("staff_id", staffId); + FtStaffDemandDao dao = this.baseMapper.selectOne(wrapper); + if (dao == null) + return AjaxResult.error("获取个人配置信息错误"); + return AjaxResult.success(dao); + } + + @Override + public AjaxResult setDemandMode(Long id, Boolean demandMode) { + FtStaffDemandDao dao = new FtStaffDemandDao(); + dao.setId(id); + dao.setDemandMode(demandMode); + int ret = this.baseMapper.updateById(dao); + if (ret == 0) + return AjaxResult.error("更新订餐状态失败"); + return AjaxResult.success(); + } + } 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 91e5d82e9..42bee926d 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 @@ -39,4 +39,16 @@ public class FtStaffInfoDaoServiceImpl extends ServiceImpl Date: Fri, 11 Dec 2020 11:10:28 +0800 Subject: [PATCH 07/10] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8D=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E7=99=BB=E5=BD=95=E6=9B=B4=E6=96=B0=E7=8A=B6=E6=80=81?= =?UTF-8?q?bug=202=E3=80=81=E8=BF=94=E5=9B=9E=E9=85=8D=E7=BD=AE=E4=BF=A1?= =?UTF-8?q?=E6=81=AFbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fantang/controller/ClientController.java | 34 ++++++++++++++++--- .../system/fantang/domain/FtStaffInfoDao.java | 2 +- .../fantang/mapper/FtStaffInfoDaoMapper.java | 4 +++ .../service/IFtStaffDemandDaoService.java | 2 +- .../impl/FtStaffDemandDaoServiceImpl.java | 2 +- .../impl/FtStaffInfoDaoServiceImpl.java | 4 +-- 6 files changed, 38 insertions(+), 10 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 1b5115e94..c0fc78090 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 @@ -1,16 +1,19 @@ package com.ruoyi.system.fantang.controller; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.fantang.domain.FtStaffInfoDao; import com.ruoyi.system.fantang.service.IFtConfigDaoService; +import com.ruoyi.system.fantang.service.IFtOrderDaoService; import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService; import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.Date; import java.util.List; import java.util.Map; @@ -30,6 +33,9 @@ public class ClientController extends BaseController { @Autowired private IFtStaffDemandDaoService staffDemandDaoService; + @Autowired + private IFtOrderDaoService orderDaoService; + @GetMapping("/getDinnerTimeSetting") public AjaxResult getDinnerTimeSetting() { return AjaxResult.success(iFtConfigDaoService.getDinnerTimeSetting()); @@ -41,7 +47,7 @@ public class ClientController extends BaseController { } @GetMapping("/getWeekMenu") - public AjaxResult getWeekMenu(){ + public AjaxResult getWeekMenu() { return AjaxResult.success("调用每周菜谱成功"); } @@ -50,16 +56,29 @@ public class ClientController extends BaseController { return AjaxResult.success("调用有效订单成功"); } + /** + * 推送订单信息 + * + * @param params + * @return + */ @PostMapping("/PostOrder") - public AjaxResult postOrder() { + public AjaxResult postOrder(JSONArray params) { +// for(int i : params.size()) { +// +// } +// Long staffId = params.getLong("staffId"); +// Integer type = params.getInteger("type"); +// Date demandDate = params.getDate("demandDate"); +// orderDaoService.postOrder(); + return AjaxResult.success("调用提交订单成功"); } // 获取配置信息 @GetMapping("/getConfiguration/{staffId}") - public AjaxResult getConfiguration(@PathVariable("staffId") Integer staffId) { - staffDemandDaoService.getConfiguration(staffId); - return AjaxResult.success("调用个人配置"); + public AjaxResult getConfiguration(@PathVariable("staffId") Long staffId) { + return AjaxResult.success(staffDemandDaoService.getConfiguration(staffId)); } // 获取配置信息 @@ -73,6 +92,7 @@ public class ClientController extends BaseController { public AjaxResult login(String tel, String password) { return staffInfoDaoService.login(tel, password); } + @PostMapping("/logout/{staffId}") public AjaxResult logout(@PathVariable("staffId") Long staffId) { staffInfoDaoService.logout(staffId); @@ -93,18 +113,22 @@ public class ClientController extends BaseController { public AjaxResult getOtherProduct() { return null; } + @PostMapping("/postProductOrder") public AjaxResult postProductOrder() { return null; } + @PostMapping("/postCurrentOrder") public AjaxResult postCurrentOrder() { return null; } + @PostMapping("/postStopOrder") public AjaxResult postStopOrder() { return null; } + @PostMapping("/postRestoreOrder") public AjaxResult postRestoreOrder() { return null; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffInfoDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffInfoDao.java index b892b5120..4dd1fd3cb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffInfoDao.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffInfoDao.java @@ -128,5 +128,5 @@ public class FtStaffInfoDao { private Boolean loginFlag; - private Long expiredFlag; + private String expired; } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtStaffInfoDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtStaffInfoDaoMapper.java index c14f2cb70..f80cf3230 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtStaffInfoDaoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtStaffInfoDaoMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.system.fantang.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.fantang.domain.FtStaffInfoDao; import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; import java.util.List; @@ -16,4 +17,7 @@ public interface FtStaffInfoDaoMapper extends BaseMapper { @Select("SELECT a.*, b.depart_name from ft_staff_info a LEFT JOIN ft_depart b on a.depart_id = b.depart_id where staff_type = 1") List selectStaffInfoWithDepart(); + + @Update("update ft_staff_info set token=#{token}, login_flag=1 where staff_id=#{staff_id}") + void updateLoginStatus(FtStaffInfoDao dao); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffDemandDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffDemandDaoService.java index a2eb747df..9e46b453f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffDemandDaoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtStaffDemandDaoService.java @@ -12,7 +12,7 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IFtStaffDemandDaoService extends IService { - AjaxResult getConfiguration(Integer staffId); + AjaxResult getConfiguration(Long staffId); AjaxResult setDemandMode(Long id, Boolean demandModeFlag); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffDemandDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffDemandDaoServiceImpl.java index 65aa3a6ca..22140d422 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffDemandDaoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtStaffDemandDaoServiceImpl.java @@ -18,7 +18,7 @@ import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService; public class FtStaffDemandDaoServiceImpl extends ServiceImpl implements IFtStaffDemandDaoService { @Override - public AjaxResult getConfiguration(Integer staffId) { + public AjaxResult getConfiguration(Long staffId) { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq("staff_id", staffId); FtStaffDemandDao dao = this.baseMapper.selectOne(wrapper); 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 42bee926d..6a4f782a4 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 @@ -36,7 +36,7 @@ public class FtStaffInfoDaoServiceImpl extends ServiceImpl Date: Fri, 11 Dec 2020 14:42:05 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=BD=93=E5=A4=A9=E5=91=98=E5=B7=A5=E8=AE=A2=E5=8D=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fantang/controller/ClientController.java | 7 +++---- .../ruoyi/system/fantang/domain/FtOrderDao.java | 2 +- .../system/fantang/mapper/FtOrderDaoMapper.java | 5 +++++ .../system/fantang/service/IFtOrderDaoService.java | 2 ++ .../service/impl/FtOrderDaoServiceImpl.java | 14 ++++++++++++++ 5 files changed, 25 insertions(+), 5 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 c0fc78090..0ba64a499 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 @@ -42,8 +42,8 @@ public class ClientController extends BaseController { } @GetMapping("/getOrderOfToday/{staffId}") - public AjaxResult getOrderOfToday(@PathVariable("staffId") Integer staffId) { - return AjaxResult.success("调用成功"); + public AjaxResult getOrderOfToday(@PathVariable("staffId") Long staffId) { + return AjaxResult.success(orderDaoService.getOrderOfToday(staffId)); } @GetMapping("/getWeekMenu") @@ -95,8 +95,7 @@ public class ClientController extends BaseController { @PostMapping("/logout/{staffId}") public AjaxResult logout(@PathVariable("staffId") Long staffId) { - staffInfoDaoService.logout(staffId); - return AjaxResult.success("登录成功"); + return AjaxResult.success(staffInfoDaoService.logout(staffId)); } @GetMapping("/getWorkday") diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtOrderDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtOrderDao.java index 92e271f00..71a4d0309 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtOrderDao.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtOrderDao.java @@ -46,7 +46,7 @@ public class FtOrderDao implements Serializable { /** * 员工 id */ - private Long workerId; + private Long staffId; /** * 清单 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java index b5e2c28cf..486929230 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.fantang.domain.FtOrderDao; import org.apache.ibatis.annotations.Insert; +import java.util.List; + /** * 订单管理Mapper接口 * @@ -14,4 +16,7 @@ public interface FtOrderDaoMapper extends BaseMapper { @Insert("insert into ft_order (order_type, staff_id, order_src, create_at, order_date, order_list, total_price) select type as order_type, staff_id, 1 as order_src, now() as create_at, date_add(now(), interval 1 day) as order_date, foods, (select sum(price) from ft_food f where FIND_IN_SET(f.food_id,d.foods)) as price from ft_staff_demand d where d.demand_mode = 1") void GenerateStaffTomorrowOrder(); + + + List getOrderOfToday(Long staffId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtOrderDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtOrderDaoService.java index d11f742d4..b3b11bb07 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtOrderDaoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtOrderDaoService.java @@ -1,6 +1,7 @@ package com.ruoyi.system.fantang.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.fantang.domain.FtOrderDao; /** @@ -11,4 +12,5 @@ import com.ruoyi.system.fantang.domain.FtOrderDao; */ public interface IFtOrderDaoService extends IService { + AjaxResult getOrderOfToday(Long 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 1779ddcc9..32b5df66f 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 @@ -1,12 +1,17 @@ package com.ruoyi.system.fantang.service.impl; +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.fantang.domain.FtOrderDao; import com.ruoyi.system.fantang.mapper.FtOrderDaoMapper; import com.ruoyi.system.fantang.service.IFtOrderDaoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Date; + /** * 订单管理Service业务层处理 * @@ -20,4 +25,13 @@ public class FtOrderDaoServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); + wrapper.eq("staff_id", staffId); + wrapper.between("order_date", DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date())); + return AjaxResult.success(this.baseMapper.selectList(wrapper)); + } } From 11a7baeb0368c6bf20ae5395af2d5fafa4d08c6a Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Fri, 11 Dec 2020 18:11:38 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=BD=93=E5=A4=A9=E5=91=98=E5=B7=A5=E8=AE=A2=E5=8D=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fantang/controller/ClientController.java | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 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 0ba64a499..77534c14b 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 @@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.system.fantang.domain.FtStaffInfoDao; import com.ruoyi.system.fantang.service.IFtConfigDaoService; import com.ruoyi.system.fantang.service.IFtOrderDaoService; import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService; @@ -13,9 +12,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Date; -import java.util.List; -import java.util.Map; @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController @@ -58,8 +54,12 @@ public class ClientController extends BaseController { /** * 推送订单信息 - * - * @param params + * 日期:2020年12月11日 + * 作者:陈智兴 + * @param JSONArray + * staffId: 员工id + * type:订餐类型 + * demandDate: 订餐用餐日期 * @return */ @PostMapping("/PostOrder") @@ -87,7 +87,17 @@ public class ClientController extends BaseController { return AjaxResult.success("推送个人配置"); } - + /** + * 设置订餐模式 + * 日期:2020年12月10日 + * 作者: 陈智兴 + * 修改:首次创建 + * @param { + * tel: 手机号码; + * password: 密码 + * } + * @return 返回员工信息 + */ @GetMapping("/login") public AjaxResult login(String tel, String password) { return staffInfoDaoService.login(tel, password); @@ -133,6 +143,17 @@ public class ClientController extends BaseController { return null; } + /** + * 设置订餐模式 + * 日期:2020年12月11日 + * 作者: 陈智兴 + * 修改:首次创建 + * @param { + * config_id: id; + * demandMode: true:自动模式;false:手动模式 + * } + * @return + */ @PostMapping("/setDemandMode") public AjaxResult setDemandMode(@RequestBody JSONObject params) { Long id = params.getLong("id"); From 21a2fcfed6698d869a0af18673e07f1523c38a84 Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Mon, 14 Dec 2020 17:40:34 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=BD=93=E5=A4=A9=E5=91=98=E5=B7=A5=E8=AE=A2=E5=8D=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index cb10a631e..f89e8e5b8 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -1,8 +1,8 @@ { "name": "ruoyi", "version": "3.3.0", - "description": "若依管理系统", - "author": "若依", + "description": "食堂管理系统", + "author": "食堂", "license": "MIT", "scripts": { "dev": "vue-cli-service serve",