Merge branch '0.8.X' of https://gitee.com/hdka/klp-oa into 0.8.X
This commit is contained in:
@@ -81,5 +81,9 @@ public class WmsStockLogVo {
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 仓库/库区名称
|
||||
*/
|
||||
@ExcelProperty(value = "仓库/库区名称")
|
||||
private String warehouseName;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.domain.WmsStock;
|
||||
import com.klp.domain.WmsStockLog;
|
||||
import com.klp.domain.vo.WmsStockLogVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 库存流水Mapper接口
|
||||
@@ -12,4 +17,5 @@ import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
*/
|
||||
public interface WmsStockLogMapper extends BaseMapperPlus<WmsStockLogMapper, WmsStockLog, WmsStockLogVo> {
|
||||
|
||||
Page<WmsStockLogVo> selectVoPagePlus(Page<?> page, @Param("ew") Wrapper<WmsStockLog> wrapper);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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;
|
||||
@@ -44,8 +45,8 @@ public class WmsStockLogServiceImpl implements IWmsStockLogService {
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsStockLogVo> queryPageList(WmsStockLogBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsStockLog> lqw = buildQueryWrapper(bo);
|
||||
Page<WmsStockLogVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
QueryWrapper<WmsStockLog> lqw = buildQueryWrapperPlus(bo);
|
||||
Page<WmsStockLogVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@@ -58,6 +59,21 @@ public class WmsStockLogServiceImpl implements IWmsStockLogService {
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private QueryWrapper<WmsStockLog> buildQueryWrapperPlus(WmsStockLogBo bo) {
|
||||
QueryWrapper<WmsStockLog> lqw = Wrappers.query();
|
||||
lqw.eq("sl.del_flag", 0);
|
||||
lqw.eq(bo.getWarehouseId() != null, "sl.warehouse_id", bo.getWarehouseId());
|
||||
lqw.eq(bo.getItemId() != null, "sl.item_id", bo.getItemId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getItemType()), "sl.item_type", bo.getItemType());
|
||||
lqw.eq(bo.getChangeQty() != null, "sl.change_qty", bo.getChangeQty());
|
||||
lqw.eq(bo.getAfterQty() != null, "sl.after_qty", bo.getAfterQty());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getChangeType()), "sl.change_type", bo.getChangeType());
|
||||
// 根据时间区间查询
|
||||
lqw.ge(bo.getStartTime() != null, "sl.change_time", bo.getStartTime());
|
||||
lqw.le(bo.getEndTime() != null, "sl.change_time", bo.getEndTime());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WmsStockLog> buildQueryWrapper(WmsStockLogBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsStockLog> lqw = Wrappers.lambdaQuery();
|
||||
|
||||
@@ -21,5 +21,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsStockLogVo">
|
||||
select sl.*, w.warehouse_name
|
||||
from wms_stock_log sl
|
||||
left join wms_warehouse w on sl.warehouse_id = w.warehouse_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user