Commit 6511ebe3 authored by lanbaoming's avatar lanbaoming

2024-06-26提交

parent 185caeff
......@@ -18,6 +18,10 @@ import java.util.List;
@ToString(callSuper = true)
public class CustomerAnalysisReq extends PageParam {
private String orderfield; //排序字段
private String ordertype; //排序方式
private int start;
private int size;
......@@ -50,7 +54,7 @@ public class CustomerAnalysisReq extends PageParam {
/*
销售经理
*/
private List<String> salesmanid;
private List<String> salesmanid;
private String salesmanidstr;
private String salesmanidstrs;
......
......@@ -160,6 +160,24 @@ public class CustomerAnalysisImpl implements CustomerAnalysisService {
对查询逻辑做处理 lanbm 2024-04-16 add
*/
public CustomerAnalysisReq getReq(CustomerAnalysisReq Req) {
//处理排序问题
if (Req.getOrderfield() == null || Req.getOrderfield().length() == 0) {
Req.setOrderfield("allsumvolume");
Req.setOrdertype("desc");
} else {
if (Req.getOrderfield().equals("sumvolumeV1")==true) {
Req.setOrderfield("sumvolume1");
}
}
if (Req.getOrdertype() != null &&
Req.getOrdertype().equals("descending")==true) {
Req.setOrdertype("desc");
} else {
Req.setOrdertype("asc");
}
//计算月份差
long lc = monthDiff(Req.getSdate(), Req.getEdate());
if (lc == 0) {
......@@ -231,8 +249,7 @@ public class CustomerAnalysisImpl implements CustomerAnalysisService {
/*
设置部门多选
*/
private void setDept(CustomerAnalysisReq Req)
{
private void setDept(CustomerAnalysisReq Req) {
if (Req.getDeptid() != null && Req.getDeptid().size() > 0) {
if (Req.getDeptid().size() == 1) {
Req.setDeptidstr(Req.getDeptid().get(0).toString());
......
......@@ -58,7 +58,13 @@
)
select * from dataTJ
<include refid="WherePage2"/>
order by allsumvolume desc,number desc
<if test="orderfield!=null and orderfield!=''
and ordertype!=null and ordertype!=''">
order by ${orderfield} ${ordertype}
</if>
limit #{start},#{size}
</select>
......@@ -198,8 +204,8 @@
and c.customer_service in ${salesmanidstrs}
</if>
<if test="deptid!=null and deptid!=''">
and u_d.dept_id= #{deptid}
<if test="deptidstr!=null and deptidstr!=''">
and u_d.dept_id= #{deptidstr}
</if>
<if test="deptidstrs!=null and deptidstrs!=''">
and u_d.dept_id in ${deptidstrs}
......
......@@ -532,7 +532,8 @@ public class WarehouseServiceImpl implements WarehouseService {
if (regionId.equals("")) {
return new ArrayList();
}
List<WarehouseTreeRegionVO> list = warehouseMapper.getRegionList(type, regionId, destCountryId, objectiveId, destWarehouseId);
List<WarehouseTreeRegionVO> list =
warehouseMapper.getRegionList(type, regionId, destCountryId, objectiveId, destWarehouseId);
return list;
}
}
......@@ -101,9 +101,17 @@ public class WarehouseController {
}
@GetMapping("/getRegionList")
public CommonResult<List<WarehouseTreeRegionVO>> getRegionList(@RequestParam(value = "type", required = false) Integer type,
String regionId,String destCountryId, String objectiveId ,String destWarehouseId){
List<WarehouseTreeRegionVO> list = warehouseService.getRegionList(type,regionId,destCountryId,objectiveId,destWarehouseId);
public CommonResult<List<WarehouseTreeRegionVO>> getRegionList(
@RequestParam(value = "type", required = false) Integer type,
String regionId,String destCountryId,
String objectiveId ,String destWarehouseId){
List<WarehouseTreeRegionVO> list =
warehouseService.getRegionList(
type,
regionId,
destCountryId,
objectiveId,
destWarehouseId);
return success(list);
}
......
......@@ -110,7 +110,8 @@ public class ProductPriceExcelExportListener {
//先定义一个空集合每次循环使他变成null减少内存的占用
int start = (i - 1) * pageSize;
int end = i * pageSize;
List<ProductPriceExcelData> list = productPriceService.getExcelList(pageSize, maxId, exportReqVO);
List<ProductPriceExcelData> list =
productPriceService.getExcelList(pageSize, maxId, exportReqVO);
log.error("路线价格数据{}-{}处理成功", start, end);
if(CollectionUtil.isEmpty(list)) continue;
maxId = list.get(list.size() - 1).getId();
......
......@@ -1757,21 +1757,27 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
@Override
public void matchLineAndProduct(List<ProductPriceRespVO> list) {
if (CollectionUtil.isNotEmpty(list)) {
//线路ID
List<Long> lineIdList = list.stream()
.map(ProductPriceBaseVO::getWarehouseLineId)
.collect(Collectors.toList());
List<WarehouseLineDO> lineDOList = warehouseService.selectBylineIdList(lineIdList);
List<WarehouseLineDO> lineDOList =
warehouseService.selectBylineIdList(lineIdList);
//产品ID
List<Long> productIdList = list.stream()
.map(ProductPriceBaseVO::getProductId)
.collect(Collectors.toList());
List<ProductDO> productDOList =
productService.getProductList(productIdList);
Map<Long, ProductDO> productMap = productDOList.stream()
.collect(Collectors.toMap(ProductDO::getId, (v -> v), (v1, v2) -> v2));
.collect(Collectors.toMap(ProductDO::getId,
(v -> v), (v1, v2) -> v2));
Map<Long, WarehouseLineDO> lineMap = lineDOList.stream()
.collect(Collectors.toMap(WarehouseLineDO::getId, (v -> v), (v1, v2) -> v2));
.collect(Collectors.toMap(WarehouseLineDO::getId,
(v -> v), (v1, v2) -> v2));
list.forEach(t -> {
t.setWarehouseLineDO(lineMap.get(t.getWarehouseLineId()));
t.setProductDO(productMap.get(t.getProductId()));
......@@ -1787,17 +1793,20 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
@Override
public List<ProductPriceExcelData> getExcelList(int pageSize, Long maxId, ProductPricePageReqVO params) {
List<ProductPriceExcelData> list = baseMapper.getExcelList(pageSize, maxId, params);
List<ProductPriceExcelData> list =
baseMapper.getExcelList(pageSize, maxId, params);
if (CollectionUtil.isNotEmpty(list)) {
List<Long> idList = list.stream()
.map(ProductPriceExcelData::getId)
.collect(Collectors.toList());
List<ProductPriceSpecialDO> specialList = productPriceSpecialService.getProductPriceSpecialList(idList);
List<ProductPriceSpecialDO> specialList =
productPriceSpecialService.getProductPriceSpecialList(idList);
Map<Long, List<ProductPriceSpecialDO>> specialMap = specialList.stream()
.collect(Collectors.groupingBy(ProductPriceSpecialDO::getProductPriceId));
List<ProductPriceStepDO> stepList = productPriceStepService.getProductPriceStepList(idList);
List<ProductPriceStepDO> stepList =
productPriceStepService.getProductPriceStepList(idList);
List<Long> stepIdList = stepList.stream()
.map(ProductPriceStepDO::getId)
.collect(toList());
......
......@@ -100,6 +100,12 @@ public class ProductPricePageReqVO extends PageParam {
@ApiModelProperty(value = "运输方式")
private String transportType;
@ApiModelProperty(value = "国家")
private Long destCountryId;
@ApiModelProperty(value = "目的仓")
private Long destWarehouseId;
@ApiModelProperty(value = "商品编码")
private String productCode;
@ApiModelProperty(value = "海关编码")
......
......@@ -23,6 +23,7 @@
AND ep.deleted = 0
AND FIND_IN_SET(ewl.transport_type, ew_start.freight)>0
AND FIND_IN_SET(ewl.transport_type, ew_dest.freight)>0
<if test="params.productCode != null and params.productCode !=''">
and ep.product_code like CONCAT('%',#{params.productCode},'%')
</if>
......@@ -112,6 +113,15 @@
and ew_dest.shi = #{params.destCityId}
</if>
<!--目的国-->
<if test="params.destCountryId != null">
and ew_dest.guojia=#{params.destCountryId}
</if>
<!--目的仓-->
<if test="params.destWarehouseId != null">
and ew_dest.id=#{params.destWarehouseId}
</if>
<if test="params.blacklist != null">
and epp.blacklist = #{params.blacklist}
</if>
......@@ -268,6 +278,16 @@
<if test="params.destCityId != null">
and ew_dest.shi = #{params.destCityId}
</if>
<!--目的国-->
<if test="params.destCountryId != null">
and ew_dest.guojia=#{params.destCountryId}
</if>
<!--目的仓-->
<if test="params.destWarehouseId != null">
and ew_dest.id=#{params.destWarehouseId}
</if>
<if test="params.blacklist != null">
and epp.blacklist = #{params.blacklist}
</if>
......@@ -387,6 +407,16 @@
<if test="params.destCityId != null">
and ew_dest.shi = #{params.destCityId}
</if>
<!--目的国-->
<if test="params.destCountryId != null">
and ew_dest.guojia=#{params.destCountryId}
</if>
<!--目的仓-->
<if test="params.destWarehouseId != null">
and ew_dest.id=#{params.destWarehouseId}
</if>
<if test="params.blacklist != null">
and epp.blacklist = #{params.blacklist}
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment