|
|
@@ -1,9 +1,11 @@
|
|
|
package org.dromara.hotel.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import cn.hutool.core.util.HexUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import org.dromara.common.core.constant.HotelBusinessConstants;
|
|
|
+import org.dromara.common.core.service.DictService;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
@@ -20,10 +22,7 @@ import org.dromara.hotel.domain.KfProvideCardHis;
|
|
|
import org.dromara.hotel.mapper.KfProvideCardHisMapper;
|
|
|
import org.dromara.hotel.service.IKfProvideCardHisService;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Collection;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 发卡记录Service业务层处理
|
|
|
@@ -36,6 +35,7 @@ import java.util.Collection;
|
|
|
public class KfProvideCardHisServiceImpl implements IKfProvideCardHisService {
|
|
|
|
|
|
private final KfProvideCardHisMapper baseMapper;
|
|
|
+ private final DictService dictService;
|
|
|
|
|
|
/**
|
|
|
* 查询发卡记录
|
|
|
@@ -78,7 +78,11 @@ public class KfProvideCardHisServiceImpl implements IKfProvideCardHisService {
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
LambdaQueryWrapper<KfProvideCardHis> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(bo.getCardId() != null, KfProvideCardHis::getCardId, bo.getCardId());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getFactoryId()), KfProvideCardHis::getFactoryId, bo.getFactoryId());
|
|
|
+ String roomFixId = HexUtil.toHex(Long.parseLong(bo.getFactoryId()));
|
|
|
+ if (roomFixId.length() < 16) {
|
|
|
+ roomFixId = StringUtils.rightPad(roomFixId, 16, "F");
|
|
|
+ }
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getFactoryId()), KfProvideCardHis::getFactoryId, roomFixId);
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getCardType()), KfProvideCardHis::getCardType, bo.getCardType());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getRoomCode()), KfProvideCardHis::getRoomCode, bo.getRoomCode());
|
|
|
lqw.eq(bo.getMasterId() != null, KfProvideCardHis::getMasterId, bo.getMasterId());
|
|
|
@@ -177,10 +181,20 @@ public class KfProvideCardHisServiceImpl implements IKfProvideCardHisService {
|
|
|
@Override
|
|
|
public KfProvideCardHisVo queryByBo(KfProvideCardHisBo bo) {
|
|
|
List<KfProvideCardHisVo> list = this.queryList(bo);
|
|
|
- if (CollectionUtil.isNotEmpty(list)) {
|
|
|
- return this.queryList(bo).get(0);
|
|
|
+ if(list.isEmpty()){
|
|
|
+ return null;
|
|
|
+ }else {
|
|
|
+ KfProvideCardHisVo res = list.get(0);
|
|
|
+ if(StringUtils.isNotBlank(res.getCardType())){
|
|
|
+ String cardTypeName = dictService.getDictLabel("room_card_type", res.getCardType());
|
|
|
+ res.setCardType(cardTypeName);
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(res.getCardStatus())){
|
|
|
+ String cardStatusName = dictService.getDictLabel("room_card_status", res.getCardStatus());
|
|
|
+ res.setCardStatus(cardStatusName);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
}
|
|
|
- return null;
|
|
|
}
|
|
|
|
|
|
@Override
|