1、修复员工登录更新状态bug

2、返回配置信息bug
This commit is contained in:
czx 2020-12-11 11:10:28 +08:00
parent a01ff2cbc4
commit fe51f511a4
6 changed files with 38 additions and 10 deletions

View File

@ -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;

View File

@ -128,5 +128,5 @@ public class FtStaffInfoDao {
private Boolean loginFlag;
private Long expiredFlag;
private String expired;
}

View File

@ -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<FtStaffInfoDao> {
@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<FtStaffInfoDao> selectStaffInfoWithDepart();
@Update("update ft_staff_info set token=#{token}, login_flag=1 where staff_id=#{staff_id}")
void updateLoginStatus(FtStaffInfoDao dao);
}

View File

@ -12,7 +12,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IFtStaffDemandDaoService extends IService<FtStaffDemandDao> {
AjaxResult getConfiguration(Integer staffId);
AjaxResult getConfiguration(Long staffId);
AjaxResult setDemandMode(Long id, Boolean demandModeFlag);
}

View File

@ -18,7 +18,7 @@ import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService;
public class FtStaffDemandDaoServiceImpl extends ServiceImpl<FtStaffDemandDaoMapper, FtStaffDemandDao> implements IFtStaffDemandDaoService {
@Override
public AjaxResult getConfiguration(Integer staffId) {
public AjaxResult getConfiguration(Long staffId) {
QueryWrapper<FtStaffDemandDao> wrapper = new QueryWrapper<>();
wrapper.eq("staff_id", staffId);
FtStaffDemandDao dao = this.baseMapper.selectOne(wrapper);

View File

@ -36,7 +36,7 @@ public class FtStaffInfoDaoServiceImpl extends ServiceImpl<FtStaffInfoDaoMapper,
return AjaxResult.error(-1, "查无记录");
dao.setLoginFlag(true);
dao.setToken(IdUtils.fastUUID());
this.baseMapper.insert(dao);
this.baseMapper.updateById(dao);
return AjaxResult.success(dao);
}
@ -47,7 +47,7 @@ public class FtStaffInfoDaoServiceImpl extends ServiceImpl<FtStaffInfoDaoMapper,
dao.setLoginFlag(false);
dao.setToken("");
int ret = this.baseMapper.updateById(dao);
if (ret ==0 )
if (ret == 0)
return AjaxResult.error("更新退出状态失败");
return AjaxResult.success(dao);
}