员工订餐-获取用餐时间
This commit is contained in:
parent
a9f0e4aad2
commit
dea15c69de
@ -0,0 +1,137 @@
|
||||
package com.ruoyi.system.fantang.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.fantang.domain.FtStaffDemandDao;
|
||||
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
|
||||
import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工报餐Controller
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-07
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/fantang/staffDemand")
|
||||
public class FtStaffDemandDaoController extends BaseController {
|
||||
|
||||
private final IFtStaffDemandDaoService iFtStaffDemandDaoService;
|
||||
|
||||
private final IFtConfigDaoService iFtConfigDaoService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取用餐时间
|
||||
*/
|
||||
@GetMapping("/getDinnerTimeSetting")
|
||||
public AjaxResult getDinnerTimeSetting() {
|
||||
return AjaxResult.success(iFtConfigDaoService.getDinnerTimeSetting());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询员工报餐列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FtStaffDemandDao ftStaffDemandDao) {
|
||||
startPage();
|
||||
LambdaQueryWrapper<FtStaffDemandDao> lqw = Wrappers.lambdaQuery(ftStaffDemandDao);
|
||||
if (ftStaffDemandDao.getStaffId() != null) {
|
||||
lqw.eq(FtStaffDemandDao::getStaffId, ftStaffDemandDao.getStaffId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(ftStaffDemandDao.getFoods())) {
|
||||
lqw.eq(FtStaffDemandDao::getFoods, ftStaffDemandDao.getFoods());
|
||||
}
|
||||
if (ftStaffDemandDao.getType() != null) {
|
||||
lqw.eq(FtStaffDemandDao::getType, ftStaffDemandDao.getType());
|
||||
}
|
||||
if (ftStaffDemandDao.getCreateAt() != null) {
|
||||
lqw.eq(FtStaffDemandDao::getCreateAt, ftStaffDemandDao.getCreateAt());
|
||||
}
|
||||
if (ftStaffDemandDao.getUpdateAt() != null) {
|
||||
lqw.eq(FtStaffDemandDao::getUpdateAt, ftStaffDemandDao.getUpdateAt());
|
||||
}
|
||||
if (ftStaffDemandDao.getUpdateFrom() != null) {
|
||||
lqw.eq(FtStaffDemandDao::getUpdateFrom, ftStaffDemandDao.getUpdateFrom());
|
||||
}
|
||||
if (StringUtils.isNotBlank(ftStaffDemandDao.getOrderInfo())) {
|
||||
lqw.eq(FtStaffDemandDao::getOrderInfo, ftStaffDemandDao.getOrderInfo());
|
||||
}
|
||||
if (ftStaffDemandDao.getDemandMode() != null) {
|
||||
lqw.eq(FtStaffDemandDao::getDemandMode, ftStaffDemandDao.getDemandMode());
|
||||
}
|
||||
if (ftStaffDemandDao.getStopFlag() != null) {
|
||||
lqw.eq(FtStaffDemandDao::getStopFlag, ftStaffDemandDao.getStopFlag());
|
||||
}
|
||||
List<FtStaffDemandDao> list = iFtStaffDemandDaoService.list(lqw);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出员工报餐列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:export')")
|
||||
@Log(title = "员工报餐", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(FtStaffDemandDao ftStaffDemandDao) {
|
||||
LambdaQueryWrapper<FtStaffDemandDao> lqw = new LambdaQueryWrapper<FtStaffDemandDao>(ftStaffDemandDao);
|
||||
List<FtStaffDemandDao> list = iFtStaffDemandDaoService.list(lqw);
|
||||
ExcelUtil<FtStaffDemandDao> util = new ExcelUtil<FtStaffDemandDao>(FtStaffDemandDao.class);
|
||||
return util.exportExcel(list, "staffDemand");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工报餐详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(iFtStaffDemandDaoService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增员工报餐
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:add')")
|
||||
@Log(title = "员工报餐", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FtStaffDemandDao ftStaffDemandDao) {
|
||||
return toAjax(iFtStaffDemandDaoService.save(ftStaffDemandDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工报餐
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:edit')")
|
||||
@Log(title = "员工报餐", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FtStaffDemandDao ftStaffDemandDao) {
|
||||
return toAjax(iFtStaffDemandDaoService.updateById(ftStaffDemandDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工报餐
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:remove')")
|
||||
@Log(title = "员工报餐", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(iFtStaffDemandDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.ruoyi.system.fantang.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 员工报餐对象 ft_staff_demand
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-07
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("ft_staff_demand")
|
||||
public class FtStaffDemandDao 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 String foods;
|
||||
|
||||
/** 用餐类型 */
|
||||
@Excel(name = "用餐类型")
|
||||
private Long type;
|
||||
|
||||
/** 创建时间 */
|
||||
@Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createAt;
|
||||
|
||||
/** 创建人 */
|
||||
private Long createBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@Excel(name = "更新时间" , width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateAt;
|
||||
|
||||
/** 更新人 */
|
||||
private Long updateBy;
|
||||
|
||||
/** 更新来源 */
|
||||
@Excel(name = "更新来源")
|
||||
private Integer updateFrom;
|
||||
|
||||
/** 订单详情 */
|
||||
@Excel(name = "订单详情")
|
||||
private String orderInfo;
|
||||
|
||||
/** 报餐模式 */
|
||||
@Excel(name = "报餐模式")
|
||||
private Integer demandMode;
|
||||
|
||||
/** 停用标志 */
|
||||
@Excel(name = "停用标志")
|
||||
private Integer stopFlag;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.system.fantang.mapper;
|
||||
|
||||
import com.ruoyi.system.fantang.domain.FtConfigDao;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 饭堂参数Mapper接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-07
|
||||
*/
|
||||
public interface FtConfigDaoMapper extends BaseMapper<FtConfigDao> {
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.system.fantang.mapper;
|
||||
|
||||
import com.ruoyi.system.fantang.domain.FtStaffDemandDao;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 员工报餐Mapper接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-07
|
||||
*/
|
||||
public interface FtStaffDemandDaoMapper extends BaseMapper<FtStaffDemandDao> {
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.system.fantang.service;
|
||||
|
||||
import com.ruoyi.system.fantang.domain.FtConfigDao;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 饭堂参数Service接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-07
|
||||
*/
|
||||
public interface IFtConfigDaoService extends IService<FtConfigDao> {
|
||||
|
||||
Map<String, String> getDinnerTimeSetting();
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.system.fantang.service;
|
||||
|
||||
import com.ruoyi.system.fantang.domain.FtStaffDemandDao;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 员工报餐Service接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-07
|
||||
*/
|
||||
public interface IFtStaffDemandDaoService extends IService<FtStaffDemandDao> {
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
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.system.fantang.domain.FtConfigDao;
|
||||
import com.ruoyi.system.fantang.mapper.FtConfigDaoMapper;
|
||||
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 饭堂参数Service业务层处理
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-07
|
||||
*/
|
||||
@Service
|
||||
public class FtConfigDaoServiceImpl extends ServiceImpl<FtConfigDaoMapper, FtConfigDao> implements IFtConfigDaoService {
|
||||
|
||||
@Override
|
||||
public Map<String, String> getDinnerTimeSetting() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
|
||||
QueryWrapper<FtConfigDao> breakfastStartWrapper = new QueryWrapper<>();
|
||||
breakfastStartWrapper.eq("config_key", "breakfast_start");
|
||||
String breakfastStart = this.baseMapper.selectOne(breakfastStartWrapper).getConfigValue();
|
||||
map.put("breakfastStart", breakfastStart);
|
||||
|
||||
QueryWrapper<FtConfigDao> breakfastEndWrapper = new QueryWrapper<>();
|
||||
breakfastEndWrapper.eq("config_key", "breakfast_end");
|
||||
String breakfastEnd = this.baseMapper.selectOne(breakfastStartWrapper).getConfigValue();
|
||||
map.put("breakfastEnd", breakfastEnd);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.system.fantang.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.system.fantang.mapper.FtStaffDemandDaoMapper;
|
||||
import com.ruoyi.system.fantang.domain.FtStaffDemandDao;
|
||||
import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService;
|
||||
|
||||
/**
|
||||
* 员工报餐Service业务层处理
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-12-07
|
||||
*/
|
||||
@Service
|
||||
public class FtStaffDemandDaoServiceImpl extends ServiceImpl<FtStaffDemandDaoMapper, FtStaffDemandDao> implements IFtStaffDemandDaoService {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.fantang.mapper.FtConfigDaoMapper">
|
||||
|
||||
<resultMap type="FtConfigDao" id="FtConfigDaoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="corpId" column="corp_id" />
|
||||
<result property="configKey" column="config_key" />
|
||||
<result property="configValue" column="config_value" />
|
||||
<result property="flag" column="flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.fantang.mapper.FtStaffDemandDaoMapper">
|
||||
|
||||
<resultMap type="FtStaffDemandDao" id="FtStaffDemandDaoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="staffId" column="staff_id" />
|
||||
<result property="foods" column="foods" />
|
||||
<result property="type" column="type" />
|
||||
<result property="createAt" column="create_at" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateAt" column="update_at" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateFrom" column="update_from" />
|
||||
<result property="orderInfo" column="order_info" />
|
||||
<result property="demandMode" column="demand_mode" />
|
||||
<result property="stopFlag" column="stop_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user