|
|
|
@ -1,8 +1,5 @@
|
|
|
|
package org.dromara.wms.service.impl;
|
|
|
|
package org.dromara.wms.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.github.yulichang.toolkit.JoinWrappers;
|
|
|
|
import com.github.yulichang.toolkit.JoinWrappers;
|
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
@ -11,7 +8,6 @@ import org.dromara.common.core.utils.MapstructUtils;
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
import org.dromara.common.satoken.utils.LoginHelper;
|
|
|
|
|
|
|
|
import org.dromara.wms.domain.BaseMaterialInfo;
|
|
|
|
import org.dromara.wms.domain.BaseMaterialInfo;
|
|
|
|
import org.dromara.wms.domain.WmsAllocateOrderDetail;
|
|
|
|
import org.dromara.wms.domain.WmsAllocateOrderDetail;
|
|
|
|
import org.dromara.wms.domain.bo.WmsAllocateOrderDetailBo;
|
|
|
|
import org.dromara.wms.domain.bo.WmsAllocateOrderDetailBo;
|
|
|
|
@ -58,7 +54,7 @@ public class WmsAllocateOrderDetailServiceImpl implements IWmsAllocateOrderDetai
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public TableDataInfo<WmsAllocateOrderDetailVo> queryPageList(WmsAllocateOrderDetailBo bo, PageQuery pageQuery) {
|
|
|
|
public TableDataInfo<WmsAllocateOrderDetailVo> queryPageList(WmsAllocateOrderDetailBo bo, PageQuery pageQuery) {
|
|
|
|
// LambdaQueryWrapper<WmsAllocateOrderDetail> lqw = buildQueryWrapper(bo);
|
|
|
|
// LambdaQueryWrapper<WmsAllocateOrderDetail> lqw = buildQueryWrapper(bo);
|
|
|
|
MPJLambdaWrapper<WmsAllocateOrderDetail> lqw = buildJoinQueryWrapper(bo);
|
|
|
|
MPJLambdaWrapper<WmsAllocateOrderDetail> lqw = buildQueryWrapper(bo);
|
|
|
|
Page<WmsAllocateOrderDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
|
Page<WmsAllocateOrderDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
|
return TableDataInfo.build(result);
|
|
|
|
return TableDataInfo.build(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -71,34 +67,27 @@ public class WmsAllocateOrderDetailServiceImpl implements IWmsAllocateOrderDetai
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<WmsAllocateOrderDetailVo> queryList(WmsAllocateOrderDetailBo bo) {
|
|
|
|
public List<WmsAllocateOrderDetailVo> queryList(WmsAllocateOrderDetailBo bo) {
|
|
|
|
MPJLambdaWrapper<WmsAllocateOrderDetail> lqw = buildJoinQueryWrapper(bo);
|
|
|
|
MPJLambdaWrapper<WmsAllocateOrderDetail> lqw = buildQueryWrapper(bo);
|
|
|
|
return baseMapper.selectVoList(lqw);
|
|
|
|
return baseMapper.selectVoList(lqw);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private MPJLambdaWrapper<WmsAllocateOrderDetail> buildQueryWrapper(WmsAllocateOrderDetailBo bo) {
|
|
|
|
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
|
|
|
|
MPJLambdaWrapper<WmsAllocateOrderDetail> lqw = JoinWrappers.lambda(WmsAllocateOrderDetail.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lqw.eq(bo.getAoDId() != null, WmsAllocateOrderDetail::getAoDId, bo.getAoDId());
|
|
|
|
private MPJLambdaWrapper<WmsAllocateOrderDetail> buildQueryWrapper(WmsAllocateOrderDetailBo bo) {
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getAllocateCode()), WmsAllocateOrderDetail::getAllocateCode, bo.getAllocateCode());
|
|
|
|
|
|
|
|
lqw.eq(bo.getMaterialId() != null, WmsAllocateOrderDetail::getMaterialId, bo.getMaterialId());
|
|
|
|
|
|
|
|
lqw.eq(bo.getAllocateOrderQty() != null, WmsAllocateOrderDetail::getAllocateOrderQty, bo.getAllocateOrderQty());
|
|
|
|
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getErpSynchronousStatus()), WmsAllocateOrderDetail::getErpSynchronousStatus, bo.getErpSynchronousStatus());
|
|
|
|
|
|
|
|
lqw.eq(bo.getErpSynchronousQty() != null, WmsAllocateOrderDetail::getErpSynchronousQty, bo.getErpSynchronousQty());
|
|
|
|
|
|
|
|
return lqw;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private MPJLambdaWrapper<WmsAllocateOrderDetail> buildJoinQueryWrapper(WmsAllocateOrderDetailBo bo) {
|
|
|
|
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
MPJLambdaWrapper<WmsAllocateOrderDetail> lqw = JoinWrappers.lambda(WmsAllocateOrderDetail.class)
|
|
|
|
MPJLambdaWrapper<WmsAllocateOrderDetail> lqw = JoinWrappers.lambda(WmsAllocateOrderDetail.class)
|
|
|
|
.selectAll(WmsAllocateOrderDetail.class)
|
|
|
|
.selectAll(WmsAllocateOrderDetail.class)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 关联查询
|
|
|
|
.select(BaseMaterialInfo::getMaterialCode, BaseMaterialInfo::getMaterialName)
|
|
|
|
.select(BaseMaterialInfo::getMaterialCode, BaseMaterialInfo::getMaterialName)
|
|
|
|
.leftJoin(BaseMaterialInfo.class,BaseMaterialInfo::getMaterialId,WmsAllocateOrderDetail::getMaterialId);
|
|
|
|
.leftJoin(BaseMaterialInfo.class, BaseMaterialInfo::getMaterialId, WmsAllocateOrderDetail::getMaterialId)
|
|
|
|
lqw.eq(bo.getAoDId() != null, WmsAllocateOrderDetail::getAoDId, bo.getAoDId());
|
|
|
|
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getAllocateCode()), WmsAllocateOrderDetail::getAllocateCode, bo.getAllocateCode());
|
|
|
|
.eq(bo.getAoDId() != null, WmsAllocateOrderDetail::getAoDId, bo.getAoDId())
|
|
|
|
lqw.eq(bo.getMaterialId() != null, WmsAllocateOrderDetail::getMaterialId, bo.getMaterialId());
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAllocateCode()), WmsAllocateOrderDetail::getAllocateCode, bo.getAllocateCode())
|
|
|
|
lqw.eq(bo.getAllocateOrderQty() != null, WmsAllocateOrderDetail::getAllocateOrderQty, bo.getAllocateOrderQty());
|
|
|
|
.eq(bo.getMaterialId() != null, WmsAllocateOrderDetail::getMaterialId, bo.getMaterialId())
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getErpSynchronousStatus()), WmsAllocateOrderDetail::getErpSynchronousStatus, bo.getErpSynchronousStatus());
|
|
|
|
.eq(bo.getAllocateOrderQty() != null, WmsAllocateOrderDetail::getAllocateOrderQty, bo.getAllocateOrderQty())
|
|
|
|
lqw.eq(bo.getErpSynchronousQty() != null, WmsAllocateOrderDetail::getErpSynchronousQty, bo.getErpSynchronousQty()).orderByDesc(WmsAllocateOrderDetail::getCreateTime);
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getErpSynchronousStatus()), WmsAllocateOrderDetail::getErpSynchronousStatus, bo.getErpSynchronousStatus())
|
|
|
|
|
|
|
|
.eq(bo.getErpSynchronousQty() != null, WmsAllocateOrderDetail::getErpSynchronousQty, bo.getErpSynchronousQty())
|
|
|
|
|
|
|
|
.orderByDesc(WmsAllocateOrderDetail::getCreateTime);
|
|
|
|
return lqw;
|
|
|
|
return lqw;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -132,7 +121,6 @@ public class WmsAllocateOrderDetailServiceImpl implements IWmsAllocateOrderDetai
|
|
|
|
public Boolean updateByBo(WmsAllocateOrderDetailBo bo) {
|
|
|
|
public Boolean updateByBo(WmsAllocateOrderDetailBo bo) {
|
|
|
|
WmsAllocateOrderDetail update = MapstructUtils.convert(bo, WmsAllocateOrderDetail.class);
|
|
|
|
WmsAllocateOrderDetail update = MapstructUtils.convert(bo, WmsAllocateOrderDetail.class);
|
|
|
|
validEntityBeforeSave(update);
|
|
|
|
validEntityBeforeSave(update);
|
|
|
|
update.setUpdateBy(LoginHelper.getUsername());
|
|
|
|
|
|
|
|
return baseMapper.updateById(update) > 0;
|
|
|
|
return baseMapper.updateById(update) > 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|