Browse Source

1.库内作业逻辑修改

training
zhenghaoyu 2 years ago
parent
commit
d61087419b
  1. 1
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/UpShelfDataVO.java
  2. 1
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseUpdownGoodsVO.java
  3. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  4. 28
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java
  5. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml
  6. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java
  7. 26
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml
  8. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownGoodsService.java
  9. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java
  10. 15
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java
  11. 201
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

1
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/UpShelfDataVO.java

@ -17,6 +17,7 @@ public class UpShelfDataVO implements Serializable {
private String marketName;//商场名称
private String materialCode;//物料编码
private String materialName;//物料名称
private String incomingBatch;//批次号
private Integer goodsType;//货物类型
}

1
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseUpdownGoodsVO.java

@ -9,5 +9,6 @@ import lombok.EqualsAndHashCode;
public class WarehouseUpdownGoodsVO extends WarehouseUpdownGoodsEntity {
private String orderCode;
private String waybillNumber;
}

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -20,7 +20,6 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -30,15 +29,16 @@ import com.logpm.basic.entity.BasicPrintTemplateEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basic.feign.IBasicPrintTemplateClient;
import com.logpm.distribution.dto.DistributionStockArticleDTO;
import com.logpm.distribution.dto.DistributionStockListInfoDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionStockArticleExcel;
import com.logpm.distribution.excel.DistributionStockListInfoExcel;
import com.logpm.distribution.mapper.DistributionAddvalueMapper;
import com.logpm.distribution.mapper.DistributionDeliveryListMapper;
import com.logpm.distribution.mapper.DistributionStockArticleMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionStockArticleQRCodeVO;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import lombok.AllArgsConstructor;
@ -57,19 +57,15 @@ import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsProperties;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.ScheduledThreadPoolExecutor;
@ -565,6 +561,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
public List<DistributionStockArticleEntity> findListByWaybillNumber(String waybillNumber) {
QueryWrapper<DistributionStockArticleEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("waybill_number",waybillNumber)
.eq("is_zero","1")
.eq("is_deleted",0);
return baseMapper.selectList(queryWrapper);

28
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java

@ -759,6 +759,34 @@ public class WarehouseTrayTypeApiController {
//-------------------------------托盘空置---------------
@ResponseBody
@PostMapping("/trayToNullScanTrayCode")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "托盘空置扫描托盘", notes = "传入trayTypeDTO")
public R trayToNullScanTrayCode(@RequestBody TrayTypeDTO trayTypeDTO) {
String method = "###########trayToNullScanTrayCode: ";
log.info(method+"托盘空置扫描托盘 trayTypeDTO={}",trayTypeDTO);
String trayCode = trayTypeDTO.getTrayCode();//托盘码
//通过托盘码查询,当前托盘是否有货物,如果有就按照原来的托盘打包方式展示,如果没有就展示订单的打托方式
try{
if(!StringUtil.hasLength(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
//查询托盘是否被打托
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeService.getEntityByTrayCode(trayCode);
return R.data(trayTypeDataVO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/trayToNull")
@ApiOperationSupport(order = 1)

12
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml

@ -21,9 +21,11 @@
select ldpl.order_code orderCode,
lwtg.tray_code trayCode,
1 goodsType,
sum(lwtg.num) shelfNum
sum(lwtg.num) shelfNum,
max(ldsa.total_number) totalNum
from logpm_warehouse_tray_goods lwtg
left join logpm_distribution_parcel_list ldpl on ldpl.id = lwtg.association_id and ldpl.is_deleted = 0
left join logpm_distribution_stock_article ldsa on ldpl.order_code = ldsa.order_code and ldsa.is_deleted = 0
where 1=1
and lwtg.is_deleted = 0
and lwtg.tray_type_id = #{trayTypeId}
@ -58,7 +60,8 @@
select ldsa.order_code orderCode,
lwtg.tray_code trayCode,
2 goodsType,
lwtg.num num
lwtg.num shelfNum,
ldsa.total_number totalNum
from logpm_warehouse_tray_goods lwtg
left join logpm_distribution_stock_article ldsa on ldsa.id = lwtg.association_id and ldsa.is_zero = 1 and ldsa.is_deleted = 0
where lwtg.is_deleted = 0
@ -109,7 +112,10 @@
lwtg.num shelfNum,
3 goodsType,
ldsl.market_id marketId,
ldsl.market_name marketName
ldsl.market_name marketName,
lwtg.association_value materialCode,
ldsl.description_goods materialName,
lwtg.incoming_batch incomingBatch
from logpm_warehouse_tray_goods lwtg
left join logpm_distribution_stock_list ldsl on ldsl.material_id = lwtg.association_id and lwtg.market_id = ldsl.market_id and lwtg.incoming_batch = ldsl.incoming_batch and ldsl.is_deleted = 0
where lwtg.is_deleted = 0

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java

@ -80,6 +80,12 @@ public interface WarehouseUpdownGoodsMapper extends BaseMapper<WarehouseUpdownGo
List<PositionVO> getUpdownGoodsByStock(@Param("marketId") Long marketId, @Param("materialCode") String materialCode, @Param("incomingBatch") String incomingBatch);
List<WarehouseUpdownGoodsEntity> findUpdownStockByMaterialName(@Param("materialName") String materialName, @Param("marketId") Long marketId);
List<WarehouseUpdownGoodsVO> getZeroOrderList(@Param("orderCode") String orderCode);
List<WarehouseUpdownGoodsVO> getZeroOrderListByWaybillNumber(@Param("waybillNumber") String waybillNumber);
// /**
// * 根据货位查询货物

26
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml

@ -187,7 +187,7 @@
<update id="updeteNumByUpdownGoodsId">
update logpm_warehouse_updown_goods
set num = #{num}
where updown_type_id = #{updownTypeId}
where id = #{updownGoodsId}
</update>
<delete id="deleteByIdsList">
@ -226,4 +226,28 @@
and lwug.incoming_batch = #{incomingBatch}
</select>
<select id="findUpdownStockByMaterialName" resultType="com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity">
select lwug.*
from logpm_warehouse_updown_goods lwug
left join logpm_distribution_stock_list ldsl on ldsl.market_id = lwug.market_id and ldsl.incoming_batch = lwug.incoming_batch and ldsl.material_id = lwug.association_id and lwug.is_deleted = 0
where ldsl.description_goods = #{materialName}
and ldsl.market_id = #{marketId}
</select>
<select id="getZeroOrderList" resultType="com.logpm.warehouse.vo.WarehouseUpdownGoodsVO">
select lwug.*,
ldsa.waybill_number waybillNumber
from logpm_warehouse_updown_goods lwug
left join logpm_distribution_stock_article ldsa on ldsa.order_code = lwug.association_value and ldsa.is_deleted = 0
where lwug.association_value = #{orderCode}
</select>
<select id="getZeroOrderListByWaybillNumber" resultType="com.logpm.warehouse.vo.WarehouseUpdownGoodsVO">
select lwug.*,
ldsa.waybill_number waybillNumber
from logpm_warehouse_updown_goods lwug
left join logpm_distribution_stock_article ldsa on ldsa.order_code = lwug.association_value and ldsa.is_deleted = 0
where ldsa.waybill_number = #{waybillNumber}
</select>
</mapper>

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownGoodsService.java

@ -115,4 +115,10 @@ public interface IWarehouseUpdownGoodsService extends BaseService<WarehouseUpdow
List<PositionVO> getUpdownGoodsByZeroOrderId(Long orderId);
List<PositionVO> getUpdownGoodsByStock(Long marketId, String materialCode, String incomingBatch);
List<WarehouseUpdownGoodsEntity> findUpdownStockByMaterialName(String materialName, Long marketId);
List<WarehouseUpdownGoodsVO> getZeroOrderList(String orderCode);
List<WarehouseUpdownGoodsVO> getZeroOrderListByWaybillNumber(String waybillNumber);
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java

@ -172,7 +172,7 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
trayGoodsEntity.setTrayTypeId(trayTypeEntity.getId());
trayGoodsEntity.setGoodsType(2);
trayGoodsEntity.setAssociationId(materialId);
trayGoodsEntity.setAssociationValue(null);
trayGoodsEntity.setAssociationValue(materialCode);
trayGoodsEntity.setAssociationType("4");
trayGoodsEntity.setNum(num);
trayGoodsEntity.setIsFleeing(isException);

15
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java

@ -188,4 +188,19 @@ public class WarehouseUpdownGoodsServiceImpl extends BaseServiceImpl<WarehouseUp
return baseMapper.getUpdownGoodsByStock(marketId,materialCode,incomingBatch);
}
@Override
public List<WarehouseUpdownGoodsEntity> findUpdownStockByMaterialName(String materialName, Long marketId) {
return baseMapper.findUpdownStockByMaterialName(materialName,marketId);
}
@Override
public List<WarehouseUpdownGoodsVO> getZeroOrderList(String orderCode) {
return baseMapper.getZeroOrderList(orderCode);
}
@Override
public List<WarehouseUpdownGoodsVO> getZeroOrderListByWaybillNumber(String waybillNumber) {
return baseMapper.getZeroOrderListByWaybillNumber(waybillNumber);
}
}

201
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -148,6 +148,10 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
return list;
}else if(upshelfScanType == 2){
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCode(code);
if(Objects.isNull(parcelListEntity)){
log.warn("#################findUpShelfScanGoods: 包件信息不存在 orderPackageCode={}",code);
throw new CustomerException(403,"包件信息不存在");
}
String orderCode = parcelListEntity.getOrderCode();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCode(orderCode);
if(Objects.isNull(stockArticleEntity)){
@ -303,18 +307,23 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
Long trayTypeId = trayTypeEntity.getId();//打托方式id
String type = trayTypeEntity.getType();//打托分类
upShelfAllocationVO.setTotalNum(trayTypeEntity.getTotalNum());
upShelfAllocationVO.setOrderTotalnum(trayTypeEntity.getOrderTotalNum());
upShelfAllocationVO.setStockNum(trayTypeEntity.getStockNum());
upShelfAllocationVO.setStockTotalNum(trayTypeEntity.getStockTotalNum());
if("1".equals(type) || "2".equals(type)){
upShelfAllocationVO.setTrayNum(trayTypeEntity.getTotalNum());
}else if("3".equals(type) || "4".equals(type)){
upShelfAllocationVO.setTrayNum(trayTypeEntity.getStockNum());
}
List<UpShelfDataVO> listByTrayTypeId = null;
if(PalletProductTypeConstant.CUSTOMIZED.equals(type)){
upShelfAllocationVO.setTotalNum(trayTypeEntity.getTotalNum());
listByTrayTypeId = warehouseTrayGoodsService.getUpListByTrayTypeId(trayTypeId);
}else if(PalletProductTypeConstant.ARTIFICIAL.equals(type)){
upShelfAllocationVO.setTotalNum(trayTypeEntity.getTotalNum());
listByTrayTypeId = warehouseTrayGoodsService.getZeroUpListByTrayTypeId(trayTypeId);
}else if(PalletProductTypeConstant.STOCKDATA.equals(type)){
upShelfAllocationVO.setStockTotalNum(trayTypeEntity.getTotalNum());
listByTrayTypeId = warehouseTrayGoodsService.getStockUpListByTrayTypeId(trayTypeId);
}else if(PalletProductTypeConstant.STOCKNODATA.equals(type)){
upShelfAllocationVO.setStockTotalNum(trayTypeEntity.getTotalNum());
listByTrayTypeId = warehouseTrayGoodsService.getStockUpListByTrayTypeId(trayTypeId);
}
upShelfAllocationVO.setList(listByTrayTypeId);
@ -413,9 +422,12 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
if(!Objects.isNull(trayEntity)){
trayCode = trayEntity.getPalletCode();
//如果有托盘
TrayTypeDataVO entityByTrayCode = warehouseTrayTypeService.getEntityByTrayCode(trayCode);
trayType = entityByTrayCode.getTrayType();
String type = entityByTrayCode.getType();//数据类型 1订制品 2零担 3 4 库存品
QueryWrapper<WarehouseTrayTypeEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("tray_code",trayCode)
.eq("is_deleted",0);
WarehouseTrayTypeEntity trayTypeEntity = warehouseTrayTypeService.getOne(queryWrapper);
trayType = trayTypeEntity.getTrayType();
String type = trayTypeEntity.getType();//数据类型 1订制品 2零担 3 4 库存品
if(!"1".equals(type)){
log.warn("##############upShelfOrder: 库位上的托盘是定制品类型 allocationId={}",allocationId);
return R.fail(403,"库位上的托盘是定制品类型");
@ -454,14 +466,31 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
String orderPackageCode = upShelfPackageDTO.getOrderPackageCode();
log.info("##############upShelfPackage: 当前处理的包件码 orderPackageCode={}",orderPackageCode);
try{
//判断包件是否已经上架
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_value",orderPackageCode);
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(queryWrapper);
if(!Objects.isNull(updownGoodsEntity)){
log.warn("##############upShelfPackage: 包件已上架 orderPackageCode={}",orderPackageCode);
continue;
}
//判断包件是否有绑托盘,
QueryWrapper<WarehouseTrayGoodsEntity> trayGoodsQueryWrapper = new QueryWrapper<>();
trayGoodsQueryWrapper.eq("association_value",orderPackageCode);
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getOne(trayGoodsQueryWrapper);
if(!Objects.isNull(trayGoodsEntity)){
//已打托的数据需要取消托盘绑定
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode,"扫描上架:包件下托");
}
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCode(orderPackageCode);
//包件级别的上架
upShelfPackageNoTray(parcelListEntity,goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity);
if(StringUtil.hasLength(trayCode)){
//存入托盘信息
warehouseTrayTypeService.orderScanOrderPackageCode(trayType,trayCode,orderPackageCode);
}
//包件级别的上架
upShelfPackageNoTray(parcelListEntity,goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity);
num++;
}catch (CustomerException e){
log.warn(e.message);
@ -760,21 +789,12 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
if(1==zeroType){
//零担订单号
String orderCode = code;
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_value",orderCode);
List<WarehouseUpdownGoodsEntity> list = warehouseUpdownGoodsService.list(queryWrapper);
List<WarehouseUpdownGoodsVO> list = warehouseUpdownGoodsService.getZeroOrderList(orderCode);
return R.data(list);
}else if (2==zeroType){
//零担运单号
String waybillNumber = code;
List<WarehouseUpdownGoodsEntity> list = new ArrayList<>();
List<DistributionStockArticleEntity> listByWaybillNumber = distributionStockArticleClient.findListByWaybillNumber(waybillNumber);
for (DistributionStockArticleEntity stockArticleEntity:listByWaybillNumber){
String orderCode = stockArticleEntity.getOrderCode();
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_value",orderCode);
list.addAll(warehouseUpdownGoodsService.list(queryWrapper));
}
List<WarehouseUpdownGoodsVO> list = warehouseUpdownGoodsService.getZeroOrderListByWaybillNumber(waybillNumber);
return R.data(list);
}else{
log.warn("#################getZeroOrderByCode: 未知的订单查询类型");
@ -892,23 +912,14 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
List<WarehouseUpdownGoodsEntity> list = warehouseUpdownGoodsService.list(queryWrapper);
return R.data(list);
}else if (2==stockType){
// //2物料名称
// String materialName = code;
// List<WarehouseUpdownGoodsEntity> list = new ArrayList<>();
// List<DistributionStockArticleEntity> listByWaybillNumber = distributionStockArticleClient.findListByWaybillNumber(waybillNumber);
// for (DistributionStockArticleEntity stockArticleEntity:listByWaybillNumber){
// String orderCode = stockArticleEntity.getOrderCode();
// QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("association_value",orderCode);
// list.addAll(warehouseUpdownGoodsService.list(queryWrapper));
// }
// return R.data(list);
//2物料名称
String materialName = code;
List<WarehouseUpdownGoodsEntity> list = warehouseUpdownGoodsService.findUpdownStockByMaterialName(materialName,marketId);
return R.data(list);
}else{
log.warn("#################getZeroOrderByCode: 未知的订单查询类型");
return R.fail(403,"未知的订单查询类型");
}
return null;
}
@Override
@ -919,10 +930,12 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
String materialCode = upShelfStockDTO.getMaterialCode();//物料编码
Long allocationId = upShelfStockDTO.getAllocationId();//库位id
Integer enterNum = upShelfStockDTO.getEnterNum();//下架数量
String incomingBatch = upShelfStockDTO.getIncomingBatch();
BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_value",materialCode)
.eq("incoming_batch",incomingBatch)
.eq("allocation_id",allocationId);
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(queryWrapper);
Integer num = updownGoodsEntity.getNum();
@ -1245,34 +1258,56 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
private void bindingAllocationAndStockAndLog(List<UpShelfStockDTO> upShelfStockList, WarehouseUpdownTypeEntity updownTypeEntity) {
List<WarehouseUpdownGoodsEntity> updownGoodsList = new ArrayList<>();
List<WarehouseUpdownGoodsEntity> updownGoodsLogList = new ArrayList<>();
for (UpShelfStockDTO upShelfStockDTO:upShelfStockList){
Long marketId = upShelfStockDTO.getMarketId();
Long allocationId = updownTypeEntity.getAllocationId();
String materialCode = upShelfStockDTO.getMaterialCode();
Integer enterNum = upShelfStockDTO.getEnterNum();
String incomingBatch = upShelfStockDTO.getIncomingBatch();
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, materialCode,incomingBatch);
WarehouseUpdownGoodsEntity updownGoodsEntity = new WarehouseUpdownGoodsEntity();
updownGoodsEntity.setUpdownTypeId(updownTypeEntity.getId());
updownGoodsEntity.setAreaId(updownTypeEntity.getAreaId());
updownGoodsEntity.setAreaTitle(updownTypeEntity.getAreaTitle());
updownGoodsEntity.setShelfId(updownTypeEntity.getShelfId());
updownGoodsEntity.setShelfTitle(updownTypeEntity.getShelfTitle());
updownGoodsEntity.setAllocationId(updownTypeEntity.getAllocationId());
updownGoodsEntity.setAllocationTitle(updownTypeEntity.getAllocationTitle());
updownGoodsEntity.setPositionCode(updownTypeEntity.getPositionCode());
updownGoodsEntity.setAssociationId(stockListEntity.getMaterialId());
updownGoodsEntity.setAssociationValue(stockListEntity.getCargoNumber());
updownGoodsEntity.setAssociationType("4");
updownGoodsEntity.setGoodsName(stockListEntity.getDescriptionGoods());
updownGoodsEntity.setNum(enterNum);
updownGoodsEntity.setMarketId(stockListEntity.getMarketId());
updownGoodsEntity.setMarketName(stockListEntity.getMarketName());
updownGoodsEntity.setIncomingBatch(stockListEntity.getIncomingBatch());
updownGoodsList.add(updownGoodsEntity);
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("allocation_id",allocationId)
.eq("market_id",marketId)
.eq("association_value",materialCode)
.eq("incoming_batch",incomingBatch);
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(queryWrapper);
if(!Objects.isNull(updownGoodsEntity)){
Integer num = updownGoodsEntity.getNum();
updownGoodsEntity.setNum(num+enterNum);
updownGoodsList.add(updownGoodsEntity);
//存入日志对象
WarehouseUpdownGoodsEntity oldUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
BeanUtil.copy(updownGoodsEntity,oldUpdownGoodsEntity);
oldUpdownGoodsEntity.setNum(enterNum);
oldUpdownGoodsEntity.setId(null);
updownGoodsLogList.add(oldUpdownGoodsEntity);
}else{
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, materialCode,incomingBatch);
updownGoodsEntity = new WarehouseUpdownGoodsEntity();
updownGoodsEntity.setUpdownTypeId(updownTypeEntity.getId());
updownGoodsEntity.setAreaId(updownTypeEntity.getAreaId());
updownGoodsEntity.setAreaTitle(updownTypeEntity.getAreaTitle());
updownGoodsEntity.setShelfId(updownTypeEntity.getShelfId());
updownGoodsEntity.setShelfTitle(updownTypeEntity.getShelfTitle());
updownGoodsEntity.setAllocationId(updownTypeEntity.getAllocationId());
updownGoodsEntity.setAllocationTitle(updownTypeEntity.getAllocationTitle());
updownGoodsEntity.setPositionCode(updownTypeEntity.getPositionCode());
updownGoodsEntity.setAssociationId(stockListEntity.getMaterialId());
updownGoodsEntity.setAssociationValue(stockListEntity.getCargoNumber());
updownGoodsEntity.setAssociationType("4");
updownGoodsEntity.setGoodsName(stockListEntity.getDescriptionGoods());
updownGoodsEntity.setNum(enterNum);
updownGoodsEntity.setMarketId(stockListEntity.getMarketId());
updownGoodsEntity.setMarketName(stockListEntity.getMarketName());
updownGoodsEntity.setIncomingBatch(stockListEntity.getIncomingBatch());
updownGoodsList.add(updownGoodsEntity);
updownGoodsLogList.add(updownGoodsEntity);
}
}
warehouseUpdownGoodsService.saveBatch(updownGoodsList);
saveUpdownGoodsLog(updownGoodsList,"1",0,"扫描上架:库存品上架");
saveUpdownGoodsLog(updownGoodsLogList,"1",0,"扫描上架:库存品上架");
}
private UpdownStockVO stockToUpdownStockVO(DistributionStockListEntity stockListEntity) {
@ -1324,30 +1359,47 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
private void bindingAllocationAndZeroOrderAndLog(List<UpShelfZeroOrderDTO> upShelfZeroOrderList, WarehouseUpdownTypeEntity updownTypeEntity) {
List<WarehouseUpdownGoodsEntity> updownGoodsList = new ArrayList<>();
List<WarehouseUpdownGoodsEntity> updownGoodsLogList = new ArrayList<>();
for (UpShelfZeroOrderDTO upShelfZeroOrderDTO:upShelfZeroOrderList){
String orderCode = upShelfZeroOrderDTO.getOrderCode();
Integer enterNum = upShelfZeroOrderDTO.getEnterNum();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCode(orderCode);
WarehouseUpdownGoodsEntity updownGoodsEntity = new WarehouseUpdownGoodsEntity();
updownGoodsEntity.setUpdownTypeId(updownTypeEntity.getId());
updownGoodsEntity.setAreaId(updownTypeEntity.getAreaId());
updownGoodsEntity.setAreaTitle(updownTypeEntity.getAreaTitle());
updownGoodsEntity.setShelfId(updownTypeEntity.getShelfId());
updownGoodsEntity.setShelfTitle(updownTypeEntity.getShelfTitle());
updownGoodsEntity.setAllocationId(updownTypeEntity.getAllocationId());
updownGoodsEntity.setAllocationTitle(updownTypeEntity.getAllocationTitle());
updownGoodsEntity.setPositionCode(updownTypeEntity.getPositionCode());
updownGoodsEntity.setAssociationId(stockArticleEntity.getId());
updownGoodsEntity.setAssociationValue(stockArticleEntity.getOrderCode());
updownGoodsEntity.setAssociationType("1");
updownGoodsEntity.setGoodsName(stockArticleEntity.getDescriptionGoods());
updownGoodsEntity.setNum(enterNum);
updownGoodsList.add(updownGoodsEntity);
Long allocationId = updownTypeEntity.getAllocationId();
//判断是否有这个订单在库位上
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_value",orderCode)
.eq("allocation_id",allocationId);
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(queryWrapper);
if(!Objects.isNull(updownGoodsEntity)){
Integer num = updownGoodsEntity.getNum();
updownGoodsEntity.setNum(num+enterNum);
updownGoodsList.add(updownGoodsEntity);//存入绑定更新
WarehouseUpdownGoodsEntity oldUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
BeanUtil.copy(updownGoodsEntity,oldUpdownGoodsEntity);
oldUpdownGoodsEntity.setNum(enterNum);
oldUpdownGoodsEntity.setId(null);
updownGoodsLogList.add(oldUpdownGoodsEntity);
}else{
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCode(orderCode);
updownGoodsEntity = new WarehouseUpdownGoodsEntity();
updownGoodsEntity.setUpdownTypeId(updownTypeEntity.getId());
updownGoodsEntity.setAreaId(updownTypeEntity.getAreaId());
updownGoodsEntity.setAreaTitle(updownTypeEntity.getAreaTitle());
updownGoodsEntity.setShelfId(updownTypeEntity.getShelfId());
updownGoodsEntity.setShelfTitle(updownTypeEntity.getShelfTitle());
updownGoodsEntity.setAllocationId(allocationId);
updownGoodsEntity.setAllocationTitle(updownTypeEntity.getAllocationTitle());
updownGoodsEntity.setPositionCode(updownTypeEntity.getPositionCode());
updownGoodsEntity.setAssociationId(stockArticleEntity.getId());
updownGoodsEntity.setAssociationValue(stockArticleEntity.getOrderCode());
updownGoodsEntity.setAssociationType("1");
updownGoodsEntity.setGoodsName(stockArticleEntity.getDescriptionGoods());
updownGoodsEntity.setNum(enterNum);
updownGoodsList.add(updownGoodsEntity);
updownGoodsLogList.add(updownGoodsEntity);
}
}
warehouseUpdownGoodsService.saveBatch(updownGoodsList);
saveUpdownGoodsLog(updownGoodsList,"1",0,"扫描上架:零担上架");
warehouseUpdownGoodsService.saveOrUpdateBatch(updownGoodsList);
saveUpdownGoodsLog(updownGoodsLogList,"1",0,"扫描上架:零担上架");
}
private R saveTrayGoodsToAllocation(WarehouseTrayTypeEntity trayTypeEntity, BasicdataGoodsAllocationEntity goodsAllocationEntity, BasicdataGoodsShelfEntity goodsShelfEntity, BasicdataGoodsAreaEntity goodsAreaEntity) {
@ -1417,6 +1469,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
for (WarehouseUpdownGoodsEntity updownGoodsEntity:updownGoodsList){
WarehouseUpdownGoodsLogEntity updownGoodsLogEntity = new WarehouseUpdownGoodsLogEntity();
BeanUtil.copy(updownGoodsEntity,updownGoodsLogEntity);
updownGoodsLogEntity.setId(null);
updownGoodsLogEntity.setBindingType(bindingType);
updownGoodsLogEntity.setIsAlltrays(isAlltrays);
updownGoodsLogEntity.setRemark(remark);
@ -1485,7 +1538,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
String orderCode = parcelListEntity.getOrderCode();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCode(orderCode);
Integer totalNumber = stockArticleEntity.getTotalNumber();
if(!set.contains(associationValue)){
if(!set.contains(orderCode)){
set.add(orderCode);
orderTotalNum = orderTotalNum + totalNumber;
}

Loading…
Cancel
Save