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