|
|
|
@ -16,9 +16,13 @@
|
|
|
|
|
*/ |
|
|
|
|
package com.logpm.basicdata.feign; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataFreightDetailEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataFreightEntity; |
|
|
|
|
import com.logpm.basicdata.service.IBasicdataFreightDetailService; |
|
|
|
|
import com.logpm.basicdata.service.IBasicdataFreightService; |
|
|
|
|
import com.logpm.basicdata.vo.BasicdataFreightApiVO; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springblade.core.mp.support.BladePage; |
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
@ -27,6 +31,9 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
import springfox.documentation.annotations.ApiIgnore; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 基础客户品牌类型表 Feign实现类 |
|
|
|
|
* |
|
|
|
@ -38,16 +45,46 @@ import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
@AllArgsConstructor |
|
|
|
|
public class BasicdataFreightClient implements IBasicdataFreightClient { |
|
|
|
|
|
|
|
|
|
private final IBasicdataFreightService basicdataFreightService; |
|
|
|
|
private final IBasicdataFreightService basicdataFreightService; |
|
|
|
|
private final IBasicdataFreightDetailService basicdataFreightDetailService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@GetMapping(TOP) |
|
|
|
|
public BladePage<BasicdataFreightEntity> top(Integer current, Integer size) { |
|
|
|
|
Query query = new Query(); |
|
|
|
|
query.setCurrent(current); |
|
|
|
|
query.setSize(size); |
|
|
|
|
IPage<BasicdataFreightEntity> page = basicdataFreightService.page(Condition.getPage(query)); |
|
|
|
|
return BladePage.of(page); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@GetMapping(TOP) |
|
|
|
|
public BladePage<BasicdataFreightEntity> top(Integer current, Integer size) { |
|
|
|
|
Query query = new Query(); |
|
|
|
|
query.setCurrent(current); |
|
|
|
|
query.setSize(size); |
|
|
|
|
IPage<BasicdataFreightEntity> page = basicdataFreightService.page(Condition.getPage(query)); |
|
|
|
|
return BladePage.of(page); |
|
|
|
|
} |
|
|
|
|
@Override |
|
|
|
|
@GetMapping(PRICE) |
|
|
|
|
public List<BasicdataFreightDetailEntity> pirce(BasicdataFreightApiVO param) { |
|
|
|
|
QueryWrapper<BasicdataFreightEntity> queryWrapper1 = new QueryWrapper(); |
|
|
|
|
queryWrapper1.eq("item_name", param.getItemName()).eq("category", param.getCategory()); |
|
|
|
|
BasicdataFreightEntity freightEntity = basicdataFreightService.getOne(queryWrapper1); |
|
|
|
|
List<BasicdataFreightDetailEntity> objects = new ArrayList<>(); |
|
|
|
|
if (null != freightEntity) { |
|
|
|
|
// 一口价和每趟 identification
|
|
|
|
|
Integer identification = freightEntity.getIdentification(); |
|
|
|
|
if (1 != identification) { |
|
|
|
|
BasicdataFreightDetailEntity detailEntity = new BasicdataFreightDetailEntity(); |
|
|
|
|
detailEntity.setCost(freightEntity.getCost()); |
|
|
|
|
if (2 == identification) { |
|
|
|
|
detailEntity.setItemName("一口价"); |
|
|
|
|
} else if (3 == identification) { |
|
|
|
|
detailEntity.setItemName("每趟计费"); |
|
|
|
|
} |
|
|
|
|
objects.add(detailEntity); |
|
|
|
|
} else { |
|
|
|
|
QueryWrapper<BasicdataFreightDetailEntity> queryWrapper = new QueryWrapper(); |
|
|
|
|
queryWrapper.eq("freight_id", freightEntity.getId()).ne("is_deleted", 1); |
|
|
|
|
List<BasicdataFreightDetailEntity> list = basicdataFreightDetailService.list(queryWrapper); |
|
|
|
|
objects.addAll(list); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return objects; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|