联查产线名字

This commit is contained in:
2025-07-30 15:27:07 +08:00
parent 5fe25e7d3a
commit a8b69a3fee
4 changed files with 30 additions and 11 deletions

View File

@@ -89,5 +89,8 @@ public class WmsSchedulePlanDetailVo {
* 天数
*/
private Integer days;
//产线名字
@ExcelProperty(value = "产线名字")
private String lineName;
}

View File

@@ -1,5 +1,8 @@
package com.klp.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.klp.domain.WmsSchedulePlanDetail;
import com.klp.domain.vo.PlanTimeAgg;
import com.klp.domain.vo.WmsSchedulePlanDetailVo;
@@ -17,4 +20,6 @@ import java.util.List;
public interface WmsSchedulePlanDetailMapper extends BaseMapperPlus<WmsSchedulePlanDetailMapper, WmsSchedulePlanDetail, WmsSchedulePlanDetailVo> {
List<PlanTimeAgg> selectPlanTimeAgg(@Param("planIds") List<Long> planIds);
Page<WmsSchedulePlanDetailVo> selectVoPagePlus(Page<Object> build,@Param("ew") QueryWrapper<WmsSchedulePlanDetail> lqw);
}

View File

@@ -1,11 +1,13 @@
package com.klp.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.klp.common.core.page.TableDataInfo;
import com.klp.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.klp.common.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.klp.domain.bo.WmsSchedulePlanDetailBo;
@@ -43,8 +45,8 @@ public class WmsSchedulePlanDetailServiceImpl implements IWmsSchedulePlanDetailS
*/
@Override
public TableDataInfo<WmsSchedulePlanDetailVo> queryPageList(WmsSchedulePlanDetailBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<WmsSchedulePlanDetail> lqw = buildQueryWrapper(bo);
Page<WmsSchedulePlanDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
QueryWrapper<WmsSchedulePlanDetail> lqw = buildQueryWrapper(bo);
Page<WmsSchedulePlanDetailVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
@@ -53,19 +55,21 @@ public class WmsSchedulePlanDetailServiceImpl implements IWmsSchedulePlanDetailS
*/
@Override
public List<WmsSchedulePlanDetailVo> queryList(WmsSchedulePlanDetailBo bo) {
LambdaQueryWrapper<WmsSchedulePlanDetail> lqw = buildQueryWrapper(bo);
QueryWrapper<WmsSchedulePlanDetail> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<WmsSchedulePlanDetail> buildQueryWrapper(WmsSchedulePlanDetailBo bo) {
private QueryWrapper<WmsSchedulePlanDetail> buildQueryWrapper(WmsSchedulePlanDetailBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WmsSchedulePlanDetail> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getPlanId() != null, WmsSchedulePlanDetail::getPlanId, bo.getPlanId());
lqw.eq(bo.getLineId() != null, WmsSchedulePlanDetail::getLineId, bo.getLineId());
lqw.eq(bo.getProductId() != null, WmsSchedulePlanDetail::getProductId, bo.getProductId());
lqw.eq(bo.getQuantity() != null, WmsSchedulePlanDetail::getQuantity, bo.getQuantity());
lqw.eq(bo.getStartDate() != null, WmsSchedulePlanDetail::getStartDate, bo.getStartDate());
lqw.eq(bo.getEndDate() != null, WmsSchedulePlanDetail::getEndDate, bo.getEndDate());
QueryWrapper<WmsSchedulePlanDetail> lqw = Wrappers.query();
//联查需要取别名
lqw.eq("wspd.del_flag", 0);
lqw.eq( "wspd.plan_id", bo.getPlanId());
lqw.eq("wspd.line_id", bo.getLineId());
lqw.eq("wspd.product_id", bo.getProductId());
lqw.eq("wspd.quantity", bo.getQuantity());
lqw.eq("wspd.start_date", bo.getStartDate());
lqw.eq("wspd.end_date", bo.getEndDate());
return lqw;
}