|
@@ -1,22 +1,26 @@
|
|
|
package com.chelvc.cloud.vehicle.server.service.impl;
|
|
|
-
|
|
|
import java.util.List;
|
|
|
-
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.chelvc.cloud.vehicle.api.dto.MerchantDTO;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.MerchantPagingParam;
|
|
|
import com.chelvc.cloud.vehicle.api.param.NearbyQueryParam;
|
|
|
import com.chelvc.cloud.vehicle.api.param.PointQueryParam;
|
|
|
+import com.chelvc.cloud.vehicle.server.copier.MerchantCopier;
|
|
|
import com.chelvc.cloud.vehicle.server.dao.MerchantMapper;
|
|
|
import com.chelvc.cloud.vehicle.server.entity.Merchant;
|
|
|
import com.chelvc.cloud.vehicle.server.service.MerchantService;
|
|
|
+import com.chelvc.framework.base.model.Pagination;
|
|
|
+import com.chelvc.framework.base.util.StringUtils;
|
|
|
+import com.chelvc.framework.database.util.PagingUtils;
|
|
|
import lombok.NonNull;
|
|
|
import org.apache.dubbo.config.annotation.DubboService;
|
|
|
|
|
|
/**
|
|
|
* 商家业务操作实现
|
|
|
*
|
|
|
- * @author Woody
|
|
|
- * @date 2023/5/2
|
|
|
+ * @author liude
|
|
|
+ * @date 2023/7/22
|
|
|
*/
|
|
|
@DubboService(interfaceClass = com.chelvc.cloud.vehicle.api.service.MerchantService.class)
|
|
|
public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> implements MerchantService,
|
|
@@ -30,4 +34,16 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
|
|
|
public List<MerchantDTO> listNearbyMerchants(@NonNull NearbyQueryParam param, int size) {
|
|
|
return this.baseMapper.listNearbyMerchants(param, size);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Pagination<MerchantDTO> getMerchantPaging(@NonNull MerchantPagingParam param) {
|
|
|
+ Page<Merchant> page = this.lambdaQuery()
|
|
|
+ .like(StringUtils.nonEmpty(param.getName()), Merchant::getName, param.getName())
|
|
|
+ .orderByAsc(Merchant::getRecommend).page(PagingUtils.convert(param.getPaging()));
|
|
|
+ return PagingUtils.convert(page, MerchantCopier.INSTANCE::copying);
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public MerchantDTO getMerchant(@NonNull Long id){
|
|
|
+ return MerchantCopier.INSTANCE.copying(this.getById(id));
|
|
|
+ }
|
|
|
}
|