优化返回有效记录接口,只返回今天以后的记录
This commit is contained in:
parent
357eb123c9
commit
32cbe06ec6
@ -93,7 +93,7 @@ public class ClientController extends BaseController {
|
|||||||
* param JSONObject staffId: 员工id
|
* param JSONObject staffId: 员工id
|
||||||
* return
|
* return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getAvailableStopOrder")
|
@PostMapping("/getAvailableStopOrder")
|
||||||
public AjaxResult getAvailableStopOrder(@RequestBody JSONObject params) {
|
public AjaxResult getAvailableStopOrder(@RequestBody JSONObject params) {
|
||||||
return AjaxResult.success(orderDaoService.getAvailableStopOrder(params.getLong("staffId")));
|
return AjaxResult.success(orderDaoService.getAvailableStopOrder(params.getLong("staffId")));
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ public class FtOrderDaoServiceImpl extends ServiceImpl<FtOrderDaoMapper, FtOrder
|
|||||||
public AjaxResult getAvailableOrder(Integer staffId) {
|
public AjaxResult getAvailableOrder(Integer staffId) {
|
||||||
QueryWrapper<FtOrderDao> wrapper = new QueryWrapper<>();
|
QueryWrapper<FtOrderDao> wrapper = new QueryWrapper<>();
|
||||||
wrapper.eq("staff_id", staffId);
|
wrapper.eq("staff_id", staffId);
|
||||||
|
wrapper.ge("order_date", new Date());
|
||||||
List<FtOrderDao> daos = this.baseMapper.selectList(wrapper);
|
List<FtOrderDao> daos = this.baseMapper.selectList(wrapper);
|
||||||
return AjaxResult.success(daos);
|
return AjaxResult.success(daos);
|
||||||
}
|
}
|
||||||
|
@ -28,17 +28,23 @@ public class FtStaffInfoDaoServiceImpl extends ServiceImpl<FtStaffInfoDaoMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult login(String tel, String password) {
|
public AjaxResult login(String tel, String password) {
|
||||||
QueryWrapper<FtStaffInfoDao> queryWrapper = new QueryWrapper<>();
|
// 查询是否有该员工
|
||||||
queryWrapper.eq("tel", tel);
|
QueryWrapper<FtStaffInfoDao> wrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("password", password);
|
wrapper.eq("tel", tel);
|
||||||
FtStaffInfoDao dao = this.baseMapper.selectOne(queryWrapper);
|
FtStaffInfoDao dao = this.baseMapper.selectOne(wrapper);
|
||||||
|
if (dao == null) {
|
||||||
|
return AjaxResult.error(-2, "无该员工信息");
|
||||||
|
} else {
|
||||||
|
wrapper.eq("password", password);
|
||||||
|
dao = this.baseMapper.selectOne(wrapper);
|
||||||
if (dao == null)
|
if (dao == null)
|
||||||
return AjaxResult.error(-1, "查无记录");
|
return AjaxResult.error(-1, "密码错误");
|
||||||
dao.setLoginFlag(true);
|
dao.setLoginFlag(true);
|
||||||
dao.setToken(IdUtils.fastUUID());
|
dao.setToken(IdUtils.fastUUID());
|
||||||
this.baseMapper.updateById(dao);
|
this.baseMapper.updateById(dao);
|
||||||
return AjaxResult.success(dao);
|
return AjaxResult.success(dao);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult logout(Long staffId) {
|
public AjaxResult logout(Long staffId) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user