员工订餐前端获取配置信息接口
This commit is contained in:
parent
9e1f48d9d8
commit
a01ff2cbc4
@ -1,14 +1,17 @@
|
|||||||
package com.ruoyi.system.fantang.controller;
|
package com.ruoyi.system.fantang.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.system.fantang.domain.FtStaffInfoDao;
|
import com.ruoyi.system.fantang.domain.FtStaffInfoDao;
|
||||||
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
|
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
|
||||||
|
import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService;
|
||||||
import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService;
|
import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@ -24,6 +27,9 @@ public class ClientController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IFtStaffInfoDaoService staffInfoDaoService;
|
private IFtStaffInfoDaoService staffInfoDaoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IFtStaffDemandDaoService staffDemandDaoService;
|
||||||
|
|
||||||
@GetMapping("/getDinnerTimeSetting")
|
@GetMapping("/getDinnerTimeSetting")
|
||||||
public AjaxResult getDinnerTimeSetting() {
|
public AjaxResult getDinnerTimeSetting() {
|
||||||
return AjaxResult.success(iFtConfigDaoService.getDinnerTimeSetting());
|
return AjaxResult.success(iFtConfigDaoService.getDinnerTimeSetting());
|
||||||
@ -49,13 +55,17 @@ public class ClientController extends BaseController {
|
|||||||
return AjaxResult.success("调用提交订单成功");
|
return AjaxResult.success("调用提交订单成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取配置信息
|
||||||
@GetMapping("/getConfiguration/{staffId}")
|
@GetMapping("/getConfiguration/{staffId}")
|
||||||
public AjaxResult getConfiguration(@PathVariable("staffId") Integer staffId) {
|
public AjaxResult getConfiguration(@PathVariable("staffId") Integer staffId) {
|
||||||
|
staffDemandDaoService.getConfiguration(staffId);
|
||||||
return AjaxResult.success("调用个人配置");
|
return AjaxResult.success("调用个人配置");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/postConfiguration")
|
// 获取配置信息
|
||||||
public AjaxResult postConfiguration() {
|
@PostMapping("/postConfiguration/{staffId}")
|
||||||
|
public AjaxResult postConfiguration(@PathVariable("staffId") Long staffId) {
|
||||||
|
|
||||||
return AjaxResult.success("推送个人配置");
|
return AjaxResult.success("推送个人配置");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,6 +75,7 @@ public class ClientController extends BaseController {
|
|||||||
}
|
}
|
||||||
@PostMapping("/logout/{staffId}")
|
@PostMapping("/logout/{staffId}")
|
||||||
public AjaxResult logout(@PathVariable("staffId") Long staffId) {
|
public AjaxResult logout(@PathVariable("staffId") Long staffId) {
|
||||||
|
staffInfoDaoService.logout(staffId);
|
||||||
return AjaxResult.success("登录成功");
|
return AjaxResult.success("登录成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,20 +93,27 @@ public class ClientController extends BaseController {
|
|||||||
public AjaxResult getOtherProduct() {
|
public AjaxResult getOtherProduct() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@GetMapping("/postProductOrder")
|
@PostMapping("/postProductOrder")
|
||||||
public AjaxResult postProductOrder() {
|
public AjaxResult postProductOrder() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@GetMapping("/postCurrentOrder")
|
@PostMapping("/postCurrentOrder")
|
||||||
public AjaxResult postCurrentOrder() {
|
public AjaxResult postCurrentOrder() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@GetMapping("/postStopOrder")
|
@PostMapping("/postStopOrder")
|
||||||
public AjaxResult postStopOrder() {
|
public AjaxResult postStopOrder() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@GetMapping("/postRestoreOrder")
|
@PostMapping("/postRestoreOrder")
|
||||||
public AjaxResult postRestoreOrder() {
|
public AjaxResult postRestoreOrder() {
|
||||||
return null;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ private static final long serialVersionUID=1L;
|
|||||||
|
|
||||||
/** 员工 id */
|
/** 员工 id */
|
||||||
@Excel(name = "员工 id")
|
@Excel(name = "员工 id")
|
||||||
private Long staffId;
|
private Integer staffId;
|
||||||
|
|
||||||
/** 正餐清单 */
|
/** 正餐清单 */
|
||||||
@Excel(name = "正餐清单")
|
@Excel(name = "正餐清单")
|
||||||
@ -74,7 +74,7 @@ private static final long serialVersionUID=1L;
|
|||||||
|
|
||||||
/** 报餐模式 */
|
/** 报餐模式 */
|
||||||
@Excel(name = "报餐模式")
|
@Excel(name = "报餐模式")
|
||||||
private Integer demandMode;
|
private Boolean demandMode;
|
||||||
|
|
||||||
/** 停用标志 */
|
/** 停用标志 */
|
||||||
@Excel(name = "停用标志")
|
@Excel(name = "停用标志")
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
package com.ruoyi.system.fantang.service;
|
package com.ruoyi.system.fantang.service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.system.fantang.domain.FtStaffDemandDao;
|
import com.ruoyi.system.fantang.domain.FtStaffDemandDao;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工报餐Service接口
|
* 员工报餐Service接口
|
||||||
*
|
*
|
||||||
* @author ft
|
* @author 陈智兴
|
||||||
* @date 2020-12-07
|
* @date 2020-12-07
|
||||||
*/
|
*/
|
||||||
public interface IFtStaffDemandDaoService extends IService<FtStaffDemandDao> {
|
public interface IFtStaffDemandDaoService extends IService<FtStaffDemandDao> {
|
||||||
|
|
||||||
|
AjaxResult getConfiguration(Integer staffId);
|
||||||
|
|
||||||
|
AjaxResult setDemandMode(Long id, Boolean demandModeFlag);
|
||||||
}
|
}
|
||||||
|
@ -17,4 +17,6 @@ public interface IFtStaffInfoDaoService extends IService<FtStaffInfoDao> {
|
|||||||
List<FtStaffInfoDao> selectStaffInfoWithDepart();
|
List<FtStaffInfoDao> selectStaffInfoWithDepart();
|
||||||
|
|
||||||
AjaxResult login(String tel, String password);
|
AjaxResult login(String tel, String password);
|
||||||
|
|
||||||
|
AjaxResult logout(Long staffId);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.ruoyi.system.fantang.service.impl;
|
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 org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ruoyi.system.fantang.mapper.FtStaffDemandDaoMapper;
|
import com.ruoyi.system.fantang.mapper.FtStaffDemandDaoMapper;
|
||||||
@ -15,4 +17,25 @@ import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService;
|
|||||||
@Service
|
@Service
|
||||||
public class FtStaffDemandDaoServiceImpl extends ServiceImpl<FtStaffDemandDaoMapper, FtStaffDemandDao> implements IFtStaffDemandDaoService {
|
public class FtStaffDemandDaoServiceImpl extends ServiceImpl<FtStaffDemandDaoMapper, FtStaffDemandDao> implements IFtStaffDemandDaoService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult getConfiguration(Integer staffId) {
|
||||||
|
QueryWrapper<FtStaffDemandDao> 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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -39,4 +39,16 @@ public class FtStaffInfoDaoServiceImpl extends ServiceImpl<FtStaffInfoDaoMapper,
|
|||||||
this.baseMapper.insert(dao);
|
this.baseMapper.insert(dao);
|
||||||
return AjaxResult.success(dao);
|
return AjaxResult.success(dao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult logout(Long staffId) {
|
||||||
|
FtStaffInfoDao dao = new FtStaffInfoDao();
|
||||||
|
dao.setStaffId(staffId);
|
||||||
|
dao.setLoginFlag(false);
|
||||||
|
dao.setToken("");
|
||||||
|
int ret = this.baseMapper.updateById(dao);
|
||||||
|
if (ret ==0 )
|
||||||
|
return AjaxResult.error("更新退出状态失败");
|
||||||
|
return AjaxResult.success(dao);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user