Merge remote-tracking branch 'origin/master' into master
This commit is contained in:
commit
e54f23dd05
@ -82,6 +82,21 @@ public class ClientController extends BaseController {
|
|||||||
return AjaxResult.success(orderDaoService.getAvailableOrder(staffId));
|
return AjaxResult.success(orderDaoService.getAvailableOrder(staffId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取员工停餐信息
|
||||||
|
* 日期:2020年12月21日
|
||||||
|
* 作者:陈智兴
|
||||||
|
*
|
||||||
|
* param JSONObject staffId: 员工id
|
||||||
|
* return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getAvailableStopOrder")
|
||||||
|
public AjaxResult getAvailableStopOrder(@RequestBody JSONObject params) {
|
||||||
|
return AjaxResult.success(orderDaoService.getAvailableStopOrder(params.getLong("staffId")));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送订单信息
|
* 推送订单信息
|
||||||
* 日期:2020年12月11日
|
* 日期:2020年12月11日
|
||||||
@ -94,9 +109,52 @@ public class ClientController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/PostOrder")
|
@PostMapping("/PostOrder")
|
||||||
public AjaxResult postOrder(@RequestBody JSONObject params) {
|
public AjaxResult postOrder(@RequestBody JSONObject params) {
|
||||||
orderDaoService.insertOrder(params.getLong("staffId"), params.getInteger("orderType"), params.getDate("demandDate"));
|
return AjaxResult.success(orderDaoService.insertOrder(params.getLong("staffId"), params.getInteger("orderType"), params.getDate("demandDate")));
|
||||||
|
}
|
||||||
|
|
||||||
return AjaxResult.success("调用提交订单成功");
|
/**
|
||||||
|
* 推送停餐信息
|
||||||
|
* 日期:2020年12月21日
|
||||||
|
* 作者:陈智兴
|
||||||
|
*
|
||||||
|
* param staffId: 员工id
|
||||||
|
* type:订餐类型
|
||||||
|
* demandDate: 订餐用餐日期
|
||||||
|
* return -1: 已报停餐信息, 1: 停餐成功
|
||||||
|
*/
|
||||||
|
@PostMapping("/postStopOrder")
|
||||||
|
public AjaxResult postStopOrder(@RequestBody JSONObject params) {
|
||||||
|
return AjaxResult.success(orderDaoService.stopOrder(params.getLong("staffId"), params.getInteger("orderType"), params.getDate("demandDate")));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工取消订餐信息
|
||||||
|
* 日期:2020年12月21日
|
||||||
|
* 作者:陈智兴
|
||||||
|
*
|
||||||
|
* param staffId: 员工id
|
||||||
|
* type:订餐类型
|
||||||
|
* demandDate: 订餐用餐日期
|
||||||
|
* return -1: 已报停餐信息, 1: 停餐成功
|
||||||
|
*/
|
||||||
|
@PostMapping("/postCancelOrder")
|
||||||
|
public AjaxResult postCancelOrder(@RequestBody JSONObject params) {
|
||||||
|
return orderDaoService.cancelOrder(params.getLong("orderId"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送取消停餐信息
|
||||||
|
* 日期:2020年12月21日
|
||||||
|
* 作者:陈智兴
|
||||||
|
*
|
||||||
|
* param staffId: 员工id
|
||||||
|
* type:订餐类型
|
||||||
|
* demandDate: 订餐用餐日期
|
||||||
|
* return -1: 已报停餐信息, 1: 停餐成功
|
||||||
|
*/
|
||||||
|
@PostMapping("/postCancelStopOrder")
|
||||||
|
public AjaxResult postCancelStopOrder(@RequestBody JSONObject params) {
|
||||||
|
return AjaxResult.success(orderDaoService.cancelStopOrder(params.getLong("orderId")));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取配置信息
|
// 获取配置信息
|
||||||
@ -151,21 +209,6 @@ public class ClientController extends BaseController {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 推送停餐信息
|
|
||||||
* 日期:2020年12月11日
|
|
||||||
* 作者:陈智兴
|
|
||||||
*
|
|
||||||
* param staffId: 员工id
|
|
||||||
* type:订餐类型
|
|
||||||
* demandDate: 订餐用餐日期
|
|
||||||
* return
|
|
||||||
*/
|
|
||||||
@PostMapping("/postStopOrder")
|
|
||||||
public AjaxResult postStopOrder(@RequestBody JSONObject params) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/postRestoreOrder")
|
@PostMapping("/postRestoreOrder")
|
||||||
public AjaxResult postRestoreOrder() {
|
public AjaxResult postRestoreOrder() {
|
||||||
return null;
|
return null;
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
package com.ruoyi.system.fantang.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工报餐对象 ft_staff_demand
|
||||||
|
*
|
||||||
|
* @author ft
|
||||||
|
* @date 2020-12-07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@EqualsAndHashCode
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("ft_staff_stop_meals")
|
||||||
|
public class FtStaffStopMealsDao implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 员工 id */
|
||||||
|
@Excel(name = "员工 id")
|
||||||
|
private Long staffId;
|
||||||
|
|
||||||
|
/** 用餐类型 */
|
||||||
|
@Excel(name = "用餐类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
@Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createAt;
|
||||||
|
|
||||||
|
/** 停餐时间 */
|
||||||
|
@Excel(name = "停餐时间" , width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date demandDate;
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.system.fantang.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.system.fantang.domain.FtStaffStopMealsDao;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工报餐Mapper接口
|
||||||
|
*
|
||||||
|
* @author ft
|
||||||
|
* @date 2020-12-07
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface FtStaffStopMealsDaoMapper extends BaseMapper<FtStaffStopMealsDao> {
|
||||||
|
|
||||||
|
}
|
@ -21,4 +21,12 @@ public interface IFtOrderDaoService extends IService<FtOrderDao> {
|
|||||||
AjaxResult getAvailableOrder(Integer staffId);
|
AjaxResult getAvailableOrder(Integer staffId);
|
||||||
|
|
||||||
AjaxResult getOrderOfDay(Long staffId, Date orderDate);
|
AjaxResult getOrderOfDay(Long staffId, Date orderDate);
|
||||||
|
|
||||||
|
AjaxResult stopOrder(Long staffId, Integer orderType, Date demandDate);
|
||||||
|
|
||||||
|
AjaxResult cancelOrder(Long orderId);
|
||||||
|
|
||||||
|
AjaxResult getAvailableStopOrder(Long staffId);
|
||||||
|
|
||||||
|
AjaxResult cancelStopOrder(Long orderId);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ import com.ruoyi.system.fantang.mapper.FtConfigDaoMapper;
|
|||||||
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
|
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -24,34 +26,15 @@ public class FtConfigDaoServiceImpl extends ServiceImpl<FtConfigDaoMapper, FtCon
|
|||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
|
|
||||||
QueryWrapper<FtConfigDao> breakfastStartWrapper = new QueryWrapper<>();
|
QueryWrapper<FtConfigDao> breakfastStartWrapper = new QueryWrapper<>();
|
||||||
breakfastStartWrapper.eq("config_key", "breakfast_start");
|
breakfastStartWrapper.eq("config_key", "dinner_string");
|
||||||
String breakfastStart = this.baseMapper.selectOne(breakfastStartWrapper).getConfigValue();
|
String dinnerString = this.baseMapper.selectOne(breakfastStartWrapper).getConfigValue();
|
||||||
map.put("breakfastStart", breakfastStart);
|
String[] split = dinnerString.split(",");
|
||||||
|
map.put("breakfastStart", split[0]);
|
||||||
QueryWrapper<FtConfigDao> breakfastEndWrapper = new QueryWrapper<>();
|
map.put("breakfastEnd", split[1]);
|
||||||
breakfastEndWrapper.eq("config_key", "breakfast_end");
|
map.put("lunchStart", split[2]);
|
||||||
String breakfastEnd = this.baseMapper.selectOne(breakfastStartWrapper).getConfigValue();
|
map.put("lunchEnd", split[3]);
|
||||||
map.put("breakfastEnd", breakfastEnd);
|
map.put("dinnerStart", split[4]);
|
||||||
|
map.put("dinnerEnd", split[5]);
|
||||||
QueryWrapper<FtConfigDao> lunchStartWrapper = new QueryWrapper<>();
|
|
||||||
lunchStartWrapper.eq("config_key", "lunch_start");
|
|
||||||
String lunchStart = this.baseMapper.selectOne(lunchStartWrapper).getConfigValue();
|
|
||||||
map.put("lunchStart", lunchStart);
|
|
||||||
|
|
||||||
QueryWrapper<FtConfigDao> lunchEndWrapper = new QueryWrapper<>();
|
|
||||||
lunchEndWrapper.eq("config_key", "lunch_end");
|
|
||||||
String lunchEnd = this.baseMapper.selectOne(lunchEndWrapper).getConfigValue();
|
|
||||||
map.put("lunchEnd", lunchEnd);
|
|
||||||
|
|
||||||
QueryWrapper<FtConfigDao> dinnerStartWrapper = new QueryWrapper<>();
|
|
||||||
dinnerStartWrapper.eq("config_key", "dinner_start");
|
|
||||||
String dinnerStart = this.baseMapper.selectOne(dinnerStartWrapper).getConfigValue();
|
|
||||||
map.put("dinnerStart", dinnerStart);
|
|
||||||
|
|
||||||
QueryWrapper<FtConfigDao> dinnerEndWrapper = new QueryWrapper<>();
|
|
||||||
dinnerEndWrapper.eq("config_key", "dinner_end");
|
|
||||||
String dinnerEnd = this.baseMapper.selectOne(dinnerEndWrapper).getConfigValue();
|
|
||||||
map.put("dinnerEnd", dinnerEnd);
|
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package com.ruoyi.system.fantang.service.impl;
|
package com.ruoyi.system.fantang.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.system.fantang.domain.FtOrderDao;
|
import com.ruoyi.system.fantang.domain.FtOrderDao;
|
||||||
|
import com.ruoyi.system.fantang.domain.FtStaffStopMealsDao;
|
||||||
import com.ruoyi.system.fantang.mapper.FtOrderDaoMapper;
|
import com.ruoyi.system.fantang.mapper.FtOrderDaoMapper;
|
||||||
|
import com.ruoyi.system.fantang.mapper.FtStaffStopMealsDaoMapper;
|
||||||
import com.ruoyi.system.fantang.service.IFtOrderDaoService;
|
import com.ruoyi.system.fantang.service.IFtOrderDaoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -23,6 +24,9 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
public class FtOrderDaoServiceImpl extends ServiceImpl<FtOrderDaoMapper, FtOrderDao> implements IFtOrderDaoService {
|
public class FtOrderDaoServiceImpl extends ServiceImpl<FtOrderDaoMapper, FtOrderDao> implements IFtOrderDaoService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
FtStaffStopMealsDaoMapper staffStopMealsDaoMapper;
|
||||||
|
|
||||||
public void GenerateStaffTomorrowOrder() {
|
public void GenerateStaffTomorrowOrder() {
|
||||||
this.baseMapper.GenerateStaffTomorrowOrder();
|
this.baseMapper.GenerateStaffTomorrowOrder();
|
||||||
|
|
||||||
@ -44,6 +48,14 @@ public class FtOrderDaoServiceImpl extends ServiceImpl<FtOrderDaoMapper, FtOrder
|
|||||||
dao.setStaffId(staffId);
|
dao.setStaffId(staffId);
|
||||||
dao.setOrderType(orderType);
|
dao.setOrderType(orderType);
|
||||||
dao.setOrderDate(demandDate);
|
dao.setOrderDate(demandDate);
|
||||||
|
QueryWrapper<FtOrderDao> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("staff_id", staffId);
|
||||||
|
wrapper.eq("order_type", orderType);
|
||||||
|
wrapper.between("order_date", DateUtil.beginOfDay(demandDate), DateUtil.endOfDay(demandDate));
|
||||||
|
Integer count = this.baseMapper.selectCount(wrapper);
|
||||||
|
if (count > 0)
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
return this.baseMapper.insert(dao);
|
return this.baseMapper.insert(dao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,4 +75,33 @@ public class FtOrderDaoServiceImpl extends ServiceImpl<FtOrderDaoMapper, FtOrder
|
|||||||
List<FtOrderDao> daos = this.baseMapper.selectList(wrapper);
|
List<FtOrderDao> daos = this.baseMapper.selectList(wrapper);
|
||||||
return AjaxResult.success(daos);
|
return AjaxResult.success(daos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult stopOrder(Long staffId, Integer orderType, Date demandDate) {
|
||||||
|
FtStaffStopMealsDao dao = new FtStaffStopMealsDao();
|
||||||
|
dao.setStaffId(staffId);
|
||||||
|
dao.setType(orderType);
|
||||||
|
dao.setDemandDate(demandDate);
|
||||||
|
dao.setCreateAt(new Date());
|
||||||
|
return AjaxResult.success(staffStopMealsDaoMapper.insert(dao));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult cancelOrder(Long orderId) {
|
||||||
|
FtOrderDao dao = new FtOrderDao();
|
||||||
|
dao.setOrderId(orderId);
|
||||||
|
return AjaxResult.success(this.baseMapper.deleteById(dao));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult getAvailableStopOrder(Long staffId) {
|
||||||
|
QueryWrapper<FtStaffStopMealsDao> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("staff_id", staffId);
|
||||||
|
return AjaxResult.success(staffStopMealsDaoMapper.selectList(wrapper));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult cancelStopOrder(Long orderId) {
|
||||||
|
return AjaxResult.success(staffStopMealsDaoMapper.deleteById(orderId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user