|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package org.dromara.wms.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.github.yulichang.toolkit.JoinWrappers;
|
|
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
@ -8,7 +10,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.dromara.wms.domain.BaseMaterialInfo;
|
|
|
|
|
import org.dromara.wms.domain.WmsBaseWarehouse;
|
|
|
|
|
import org.dromara.wms.domain.WmsOutstockDetail;
|
|
|
|
|
import org.dromara.wms.domain.WmsOutstockOrder;
|
|
|
|
|
import org.dromara.wms.domain.bo.WmsOutstockDetailBo;
|
|
|
|
|
import org.dromara.wms.domain.bo.WmsOutstockOrderBo;
|
|
|
|
|
import org.dromara.wms.domain.vo.WmsOutstockOrderVo;
|
|
|
|
|
import org.dromara.wms.mapper.WmsInstockOrderMapper;
|
|
|
|
@ -59,12 +65,30 @@ public class WmsOutstockOrderServiceImpl implements IWmsOutstockOrderService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public TableDataInfo<WmsOutstockOrderVo> queryPageList(WmsOutstockOrderBo bo, PageQuery pageQuery) {
|
|
|
|
|
LambdaQueryWrapper<WmsOutstockOrder> lqw = buildQueryWrapper(bo);
|
|
|
|
|
lqw.orderByDesc(WmsOutstockOrder::getCreateTime);
|
|
|
|
|
MPJLambdaWrapper<WmsOutstockOrder> lqw = buildJoinQueryWrapper(bo);
|
|
|
|
|
Page<WmsOutstockOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
|
|
return TableDataInfo.build(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MPJLambdaWrapper<WmsOutstockOrder> buildJoinQueryWrapper(WmsOutstockOrderBo bo) {
|
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
|
MPJLambdaWrapper<WmsOutstockOrder> lqw = JoinWrappers.lambda(WmsOutstockOrder.class)
|
|
|
|
|
.selectAll(WmsOutstockOrder.class)
|
|
|
|
|
.select(WmsBaseWarehouse::getWarehouseCode)
|
|
|
|
|
.leftJoin(WmsBaseWarehouse.class, WmsBaseWarehouse::getWarehouseId, WmsOutstockOrder::getWarehouseId);
|
|
|
|
|
lqw.eq(bo.getOutstockId() != null, WmsOutstockOrder::getOutstockId, bo.getOutstockId());
|
|
|
|
|
lqw.eq(bo.getWarehouseId() != null, WmsOutstockOrder::getWarehouseId, bo.getWarehouseId());
|
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getOutstockCode()), WmsOutstockOrder::getOutstockCode, bo.getOutstockCode());
|
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getOutstockType()), WmsOutstockOrder::getOutstockType, bo.getOutstockType());
|
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsOutstockOrder::getMaterialCategories, bo.getMaterialCategories());
|
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getOrderType()), WmsOutstockOrder::getOrderType, bo.getOrderType());
|
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getOrderNo()), WmsOutstockOrder::getOrderNo, bo.getOrderNo());
|
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getAuditBy()), WmsOutstockOrder::getAuditBy, bo.getAuditBy());
|
|
|
|
|
lqw.eq(bo.getAuditTime() != null, WmsOutstockOrder::getAuditTime, bo.getAuditTime());
|
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), WmsOutstockOrder::getAuditStatus, bo.getAuditStatus());
|
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getAuditComments()), WmsOutstockOrder::getAuditComments, bo.getAuditComments())
|
|
|
|
|
.orderByAsc(WmsOutstockOrder::getCreateTime);
|
|
|
|
|
return lqw;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 查询符合条件的出库单列表
|
|
|
|
|
*
|
|
|
|
@ -101,7 +125,7 @@ public class WmsOutstockOrderServiceImpl implements IWmsOutstockOrderService {
|
|
|
|
|
* @return 是否新增成功
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean insertByBo(WmsOutstockOrderBo bo) {
|
|
|
|
|
public WmsOutstockOrderVo insertByBo(WmsOutstockOrderBo bo) {
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHssmm");
|
|
|
|
|
String orderDate = format.format(date);
|
|
|
|
@ -122,7 +146,11 @@ public class WmsOutstockOrderServiceImpl implements IWmsOutstockOrderService {
|
|
|
|
|
if (flag) {
|
|
|
|
|
bo.setOutstockId(add.getOutstockId());
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
LambdaQueryWrapper<WmsOutstockOrder> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
wrapper.eq(WmsOutstockOrder::getOutstockCode,outStockOrder);
|
|
|
|
|
List<WmsOutstockOrderVo> vos = baseMapper.selectVoList(wrapper);
|
|
|
|
|
|
|
|
|
|
return vos.get(0);
|
|
|
|
|
}
|
|
|
|
|
public String generateOrder(Integer value){
|
|
|
|
|
if (value.toString().length()<3){
|
|
|
|
|