|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
|
|
|
import lombok.SneakyThrows;
|
|
|
import org.dromara.common.core.domain.AjaxResult;
|
|
|
import org.dromara.common.core.domain.R;
|
|
|
+import org.dromara.common.core.domain.dto.RoleDTO;
|
|
|
import org.dromara.common.core.domain.model.LoginUser;
|
|
|
import org.dromara.common.core.utils.DateUtils;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
@@ -59,6 +60,17 @@ public class XiaoyuanReservatServiceImpl implements IXiaoyuanReservatService {
|
|
|
*/
|
|
|
@Override
|
|
|
public TableDataInfo<XiaoyuanReservatVo> queryPageList(XiaoyuanReservatBo bo, PageQuery pageQuery) {
|
|
|
+ LoginUser user = LoginHelper.getLoginUser();
|
|
|
+ List<RoleDTO> roles = user.getRoles();
|
|
|
+ Boolean bl = false;
|
|
|
+ for (RoleDTO role : roles) {
|
|
|
+ if("teacher".equals(role.getRoleKey())){
|
|
|
+ bl = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(bl){
|
|
|
+ bo.setTeacherPhone(user.getUsername());
|
|
|
+ }
|
|
|
LambdaQueryWrapper<XiaoyuanReservat> lqw = buildQueryWrapper(bo);
|
|
|
Page<XiaoyuanReservatVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
return TableDataInfo.build(result);
|
|
@@ -75,6 +87,7 @@ public class XiaoyuanReservatServiceImpl implements IXiaoyuanReservatService {
|
|
|
|
|
|
private LambdaQueryWrapper<XiaoyuanReservat> buildQueryWrapper(XiaoyuanReservatBo bo) {
|
|
|
LambdaQueryWrapper<XiaoyuanReservat> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq(bo.getReservatId() != null && bo.getReservatId() != 0L, XiaoyuanReservat::getReservatId, bo.getReservatId());
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getTeacherName()), XiaoyuanReservat::getTeacherName, bo.getTeacherName());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getTeacherPhone()), XiaoyuanReservat::getTeacherPhone, bo.getTeacherPhone());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getTenantId()), XiaoyuanReservat::getTenantId, bo.getTenantId());
|
|
@@ -250,6 +263,9 @@ public class XiaoyuanReservatServiceImpl implements IXiaoyuanReservatService {
|
|
|
}
|
|
|
int i = 0;
|
|
|
for (XiaoyuanReservatVo xiaoyuanReservatVo : reservatVoList) {
|
|
|
+ if("2".equals(xiaoyuanReservatVo.getVisitStatus())){
|
|
|
+ return R.ok("核销失败");
|
|
|
+ }
|
|
|
XiaoyuanReservat update = new XiaoyuanReservat();
|
|
|
update.setReservatId(xiaoyuanReservatVo.getReservatId());
|
|
|
update.setVisitStatus("2");
|