|
|
|
@ -44,6 +44,7 @@ import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
|
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
|
import org.springblade.common.constant.order.OrderStockupStatusConstant; |
|
|
|
|
import org.springblade.common.utils.CommonUtil; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
@ -93,8 +94,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
private final IDistrilbutionBillPackageService distrilbutionBillPackageService; |
|
|
|
|
private final IBasicdataWarehouseClient warehouseClient; |
|
|
|
|
|
|
|
|
|
private final RabbitTemplate rabbitTemplate; |
|
|
|
|
|
|
|
|
|
private final RabbitTemplate rabbitTemplate; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -110,7 +110,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean submitNumByOrderIdAndName(Long articleId, String productName, Integer num) { |
|
|
|
|
int i = baseMapper.submitNumByOrderIdAndName(articleId,productName,num); |
|
|
|
|
int i = baseMapper.submitNumByOrderIdAndName(articleId, productName, num); |
|
|
|
|
// if(i == 1){
|
|
|
|
|
// return true;
|
|
|
|
|
// }else{
|
|
|
|
@ -136,6 +136,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询备货包件信息 |
|
|
|
|
* |
|
|
|
|
* @param page |
|
|
|
|
* @param distributionParcelList |
|
|
|
|
* @return |
|
|
|
@ -144,9 +145,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
public IPage<DistributionParcelListVO> getParcelListOwn(IPage<Object> page, Map<String, Object> distributionParcelList) { |
|
|
|
|
Object o = distributionParcelList.get("id"); |
|
|
|
|
IPage<DistributionParcelListVO> parcelListOwn = baseMapper.getParcelListOwn(page, Long.parseLong((String) o)); |
|
|
|
|
parcelListOwn.getRecords().forEach(i ->{ |
|
|
|
|
if(ObjectUtils.isNotNull(i) && ObjectUtils.isNotNull(i.getStockupStatus())){ |
|
|
|
|
i.setStockupStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_STOCKUP_STATUS,i.getStockupStatus())); |
|
|
|
|
parcelListOwn.getRecords().forEach(i -> { |
|
|
|
|
if (ObjectUtils.isNotNull(i) && ObjectUtils.isNotNull(i.getStockupStatus())) { |
|
|
|
|
i.setStockupStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_STOCKUP_STATUS, i.getStockupStatus())); |
|
|
|
|
} |
|
|
|
|
//出现货位信息
|
|
|
|
|
String s = warehouseUpdownGoodsClient.selectMsgBywrap(i.getId()); |
|
|
|
@ -159,10 +160,10 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
public IPage<DistributionParcelListVO> getParcelListOwnSelf(IPage<Object> page, Map<String, Object> distributionParcelList) { |
|
|
|
|
Object o = distributionParcelList.get("id"); |
|
|
|
|
IPage<DistributionParcelListVO> parcelListOwn = baseMapper.getParcelListOwnSelf(page, Long.parseLong((String) o)); |
|
|
|
|
parcelListOwn.getRecords().forEach(i ->{ |
|
|
|
|
if(ObjectUtils.isNotNull( i.getStockupStatus())){ |
|
|
|
|
parcelListOwn.getRecords().forEach(i -> { |
|
|
|
|
if (ObjectUtils.isNotNull(i.getStockupStatus())) { |
|
|
|
|
i.setStockupStatusName(OrderStockupStatusConstant.yibeihu.getName()); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
i.setStockupStatusName(OrderStockupStatusConstant.daibeihuo.getName()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -178,30 +179,29 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
// 上架状态
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void updateGroundingStatus(String orderPackageCode, String groundingStatus,Long warehouseId) { |
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
|
updateGroundingStatus(orderPackageCode,groundingStatus,warehouseId); |
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.error("###############updateGroundingStatus: 更新上架状态失败 orderPackageCode={} warehouseId={} groundingStatus={}",orderPackageCode,warehouseId,groundingStatus); |
|
|
|
|
public void updateGroundingStatus(String orderPackageCode, String groundingStatus, Long warehouseId) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
// baseMapper.updateGroundingStatus(orderPackageCode,groundingStatus,warehouseId);
|
|
|
|
|
|
|
|
|
|
log.info(">>>>> 发送消息给MQ start 包件{}", orderPackageCode); |
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap(); |
|
|
|
|
map.put("messageId", CommonUtil.getUUID()); |
|
|
|
|
map.put("orderPackageCode", orderPackageCode); |
|
|
|
|
map.put("groundingStatus", groundingStatus); |
|
|
|
|
map.put("warehouseId", warehouseId); |
|
|
|
|
rabbitTemplate.convertAndSend(RabbitConstant.ORDER_PACKAGE_STATUS_INFO_EXCHANGE, RabbitConstant.ORDER_PACKAGE_STATUS_INFO_ROUTING, map); |
|
|
|
|
log.info(">>>>> 发送消息给MQ end 包件{}", orderPackageCode); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error(">>>>>>> errr",e); |
|
|
|
|
log.error("###############updateGroundingStatus: 更新上架状态失败 orderPackageCode={} warehouseId={} groundingStatus={}", orderPackageCode, warehouseId, groundingStatus); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// log.info(">>>>> 发送消息给MQ start 包件{}",orderPackageCode);
|
|
|
|
|
//
|
|
|
|
|
// Map<String,Object> map = new HashMap();
|
|
|
|
|
// map.put("messageId", CommonUtil.getUUID());
|
|
|
|
|
// map.put("orderPackageCode", orderPackageCode);
|
|
|
|
|
// map.put("groundingStatus", groundingStatus);
|
|
|
|
|
// map.put("warehouseId", warehouseId);
|
|
|
|
|
//将消息携带绑定键值
|
|
|
|
|
// rabbitTemplate.convertAndSend(RabbitConstant.ORDER_PACKAGE_STATUS_INFO_EXCHANGE, RabbitConstant.ORDER_PACKAGE_STATUS_INFO_ROUTING, map);
|
|
|
|
|
// log.info(">>>>> 发送消息给MQ end 包件{}",orderPackageCode);
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -220,23 +220,23 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCode(String orderCode,Long warehouseId) { |
|
|
|
|
return baseMapper.findALLNoUpShelfPackageByOrderCode(orderCode,warehouseId); |
|
|
|
|
public List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCode(String orderCode, Long warehouseId) { |
|
|
|
|
return baseMapper.findALLNoUpShelfPackageByOrderCode(orderCode, warehouseId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<DistributionParcelListEntity> pageOweList(IPage<Object> page, Map<String, Object> distributionParcelList) { |
|
|
|
|
Object o = distributionParcelList.get("parcelType"); |
|
|
|
|
if(ObjectUtils.isNotNull(o)){ |
|
|
|
|
if (ObjectUtils.isNotNull(o)) { |
|
|
|
|
distributionParcelList.remove("parcelType"); |
|
|
|
|
} |
|
|
|
|
DistributionParcelListDTO distributionParcelListDTO = JSONObject.parseObject(JSONObject.toJSONString(distributionParcelList), DistributionParcelListDTO.class); |
|
|
|
|
if(Func.isNotEmpty(distributionParcelListDTO.getStockArticleIds())){ |
|
|
|
|
if (Func.isNotEmpty(distributionParcelListDTO.getStockArticleIds())) { |
|
|
|
|
String trim = distributionParcelListDTO.getStockArticleIds().trim(); |
|
|
|
|
List<String> list = CommonUtil.stringNum(trim); |
|
|
|
|
if(!list.isEmpty()){ |
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
distributionParcelListDTO.setStockArticleIdsList(list); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
distributionParcelListDTO.setStockArticleIdsLike(trim); |
|
|
|
|
} |
|
|
|
|
//转库存品限制
|
|
|
|
@ -258,11 +258,12 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return baseMapper.pageOweList(page,distributionParcelListDTO); |
|
|
|
|
return baseMapper.pageOweList(page, distributionParcelListDTO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询已备货的数据 |
|
|
|
|
* 查询已备货的数据 |
|
|
|
|
* |
|
|
|
|
* @param stockupDTO |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -282,38 +283,38 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
Object o = distributionParcelList.get("stockArticleId"); |
|
|
|
|
Object reservationId = distributionParcelList.get("reservationId"); |
|
|
|
|
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
if(ObjectUtils.isNotNull(o)){ |
|
|
|
|
String a= (String) o; |
|
|
|
|
if(a.contains(",")){ |
|
|
|
|
queryWrapper.in("stock_article_id",a.split(",")); |
|
|
|
|
}else{ |
|
|
|
|
queryWrapper.eq("stock_article_id",a); |
|
|
|
|
if (ObjectUtils.isNotNull(o)) { |
|
|
|
|
String a = (String) o; |
|
|
|
|
if (a.contains(",")) { |
|
|
|
|
queryWrapper.in("stock_article_id", a.split(",")); |
|
|
|
|
} else { |
|
|
|
|
queryWrapper.eq("stock_article_id", a); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = baseMapper.selectList(queryWrapper); |
|
|
|
|
if(distributionParcelListEntities.isEmpty()){ |
|
|
|
|
if (distributionParcelListEntities.isEmpty()) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
List<DistributionParcelListZeroVO> list = new ArrayList<>(); |
|
|
|
|
distributionParcelListEntities.forEach( i ->{ |
|
|
|
|
distributionParcelListEntities.forEach(i -> { |
|
|
|
|
//查询在库数量
|
|
|
|
|
DistributionParcelNumberEntity parcelNumber = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda() |
|
|
|
|
.eq(DistributionParcelNumberEntity::getParcelListId, i.getId()) |
|
|
|
|
.eq(DistributionParcelNumberEntity::getStockArticleId, i.getStockArticleId())); |
|
|
|
|
.eq(DistributionParcelNumberEntity::getParcelListId, i.getId()) |
|
|
|
|
.eq(DistributionParcelNumberEntity::getStockArticleId, i.getStockArticleId())); |
|
|
|
|
DistributionReservationZeroPackageEntity one = reservationZeroPackageService.getOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda() |
|
|
|
|
.eq(DistributionReservationZeroPackageEntity::getParcelListId, i.getId()) |
|
|
|
|
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, i.getStockArticleId()) |
|
|
|
|
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId) |
|
|
|
|
); |
|
|
|
|
DistributionParcelListZeroVO parcelListVO = new DistributionParcelListZeroVO(); |
|
|
|
|
BeanUtils.copyProperties(i,parcelListVO); |
|
|
|
|
BeanUtils.copyProperties(i, parcelListVO); |
|
|
|
|
parcelListVO.setLibraryQuantity(parcelNumber.getHandQuantity()); |
|
|
|
|
parcelListVO.setDeliveryQuantity(parcelNumber.getDeliveryQuantity()); |
|
|
|
|
if(ObjectUtils.isNotNull(one)){ |
|
|
|
|
if (ObjectUtils.isNotNull(one)) { |
|
|
|
|
parcelListVO.setReservationQuantity(one.getQuantity()); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
parcelListVO.setReservationQuantity(0); |
|
|
|
|
} |
|
|
|
|
list.add(parcelListVO); |
|
|
|
@ -323,6 +324,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 修改零担在库数量 |
|
|
|
|
* |
|
|
|
|
* @param distributionParcelList |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -330,47 +332,46 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
public int getZeroUpdateMaterial(Map<String, Object> distributionParcelList) { |
|
|
|
|
Object o = distributionParcelList.get("stockArticleId"); //订单ID
|
|
|
|
|
Object parcelListZeroVO = distributionParcelList.get("distributionParcelListZeroVO"); |
|
|
|
|
if(ObjectUtils.isNull(parcelListZeroVO)){ |
|
|
|
|
if (ObjectUtils.isNull(parcelListZeroVO)) { |
|
|
|
|
throw new ServiceException("修改参数为空!!!"); |
|
|
|
|
} |
|
|
|
|
List<DistributionParcelListZeroVO> list = (List<DistributionParcelListZeroVO>) parcelListZeroVO; |
|
|
|
|
String jsonString = JSON.toJSONString(list); |
|
|
|
|
list =JSON.parseArray(jsonString,DistributionParcelListZeroVO.class); |
|
|
|
|
list = JSON.parseArray(jsonString, DistributionParcelListZeroVO.class); |
|
|
|
|
list.stream().forEach(i -> { |
|
|
|
|
DistributionParcelListZeroVO parcelZeroVO = JSONObject.parseObject(JSONObject.toJSONString(i), DistributionParcelListZeroVO.class); |
|
|
|
|
if(!parcelZeroVO.getTiQuantity().equals(0) || parcelZeroVO.getTiQuantity() <= parcelZeroVO.getDeliveryQuantity()){ |
|
|
|
|
//修改
|
|
|
|
|
boolean update = distributionParcelNumberService.update(Wrappers.<DistributionParcelNumberEntity>update() |
|
|
|
|
.eq("parcel_list_id", parcelZeroVO.getId()) |
|
|
|
|
.set("hand_quantity", parcelZeroVO.getTiQuantity()) |
|
|
|
|
); |
|
|
|
|
DistributionParcelListZeroVO parcelZeroVO = JSONObject.parseObject(JSONObject.toJSONString(i), DistributionParcelListZeroVO.class); |
|
|
|
|
if (!parcelZeroVO.getTiQuantity().equals(0) || parcelZeroVO.getTiQuantity() <= parcelZeroVO.getDeliveryQuantity()) { |
|
|
|
|
//修改
|
|
|
|
|
boolean update = distributionParcelNumberService.update(Wrappers.<DistributionParcelNumberEntity>update() |
|
|
|
|
.eq("parcel_list_id", parcelZeroVO.getId()) |
|
|
|
|
.set("hand_quantity", parcelZeroVO.getTiQuantity()) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Integer selectSumByOrderId(Long orderId, Long warehouseId) { |
|
|
|
|
baseMapper.selectCount(new QueryWrapper<DistributionParcelListEntity>().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getIsDeleted,0) |
|
|
|
|
.eq(DistributionParcelListEntity::getStockArticleId,orderId) |
|
|
|
|
.eq(DistributionParcelListEntity::getIsDeleted, 0) |
|
|
|
|
.eq(DistributionParcelListEntity::getStockArticleId, orderId) |
|
|
|
|
//在库数量
|
|
|
|
|
.eq(null!=warehouseId,DistributionParcelListEntity::getWarehouseId,warehouseId) |
|
|
|
|
.eq(null!=warehouseId,DistributionParcelListEntity::getOrderPackageLoadingStatus,"10") |
|
|
|
|
.in(null!=warehouseId,DistributionParcelListEntity::getOrderPackageStatus,"20,30,40") |
|
|
|
|
.eq(null != warehouseId, DistributionParcelListEntity::getWarehouseId, warehouseId) |
|
|
|
|
.eq(null != warehouseId, DistributionParcelListEntity::getOrderPackageLoadingStatus, "10") |
|
|
|
|
.in(null != warehouseId, DistributionParcelListEntity::getOrderPackageStatus, "20,30,40") |
|
|
|
|
); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<DistributionParcelListEntity> getParcelListByStockArticleId(Long id) { |
|
|
|
|
return this.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId,id)); |
|
|
|
|
return this.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, id)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
* @param distributionParcelList |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -378,9 +379,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
public List<DistributionParcelListBaseVO> getStockDataBase(Map<String, Object> distributionParcelList) { |
|
|
|
|
DistributionParcelListEntity parcelListEntity = JSONObject.parseObject(JSONObject.toJSONString(distributionParcelList), DistributionParcelListEntity.class); |
|
|
|
|
List<DistributionParcelListBaseVO> stockDataBase = baseMapper.getStockDataBase(parcelListEntity); |
|
|
|
|
stockDataBase.forEach( i ->{ |
|
|
|
|
if(StringUtils.isNotBlank(i.getTypeService())){ |
|
|
|
|
i.setTypeServiceName(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE,i.getTypeService())); |
|
|
|
|
stockDataBase.forEach(i -> { |
|
|
|
|
if (StringUtils.isNotBlank(i.getTypeService())) { |
|
|
|
|
i.setTypeServiceName(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, i.getTypeService())); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return stockDataBase; |
|
|
|
@ -394,6 +395,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 包件转库存品 |
|
|
|
|
* |
|
|
|
|
* @param distributionParcelList |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -401,34 +403,34 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public R packageTransferStock(Map<String, Object> distributionParcelList) { |
|
|
|
|
Object o = distributionParcelList.get("ids"); |
|
|
|
|
if(ObjectUtils.isNull(o)){ |
|
|
|
|
if (ObjectUtils.isNull(o)) { |
|
|
|
|
return R.fail("参数不完整!"); |
|
|
|
|
} |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if(ObjectUtils.isNull(myCurrentWarehouse)){ |
|
|
|
|
if (ObjectUtils.isNull(myCurrentWarehouse)) { |
|
|
|
|
throw new ServiceException("请选择仓库!"); |
|
|
|
|
} |
|
|
|
|
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
String s = String.valueOf(o); |
|
|
|
|
if(s.contains(",")){ |
|
|
|
|
if (s.contains(",")) { |
|
|
|
|
String[] split = s.split(","); |
|
|
|
|
queryWrapper.in("id",split); |
|
|
|
|
}else{ |
|
|
|
|
queryWrapper.eq("id",o); |
|
|
|
|
queryWrapper.in("id", split); |
|
|
|
|
} else { |
|
|
|
|
queryWrapper.eq("id", o); |
|
|
|
|
} |
|
|
|
|
queryWrapper.eq("conditions",1); |
|
|
|
|
queryWrapper.eq("conditions", 1); |
|
|
|
|
List<DistributionParcelListEntity> list1 = baseMapper.selectList(queryWrapper); |
|
|
|
|
boolean b = list1.stream().anyMatch(i -> ObjectUtils.isNull(i.getMaterialId())); |
|
|
|
|
if(b){ |
|
|
|
|
if (b) { |
|
|
|
|
throw new ServiceException("有包件未维护物料信息,请维护后在进行操作!!"); |
|
|
|
|
} |
|
|
|
|
if (!list1.isEmpty()) { |
|
|
|
|
Set<Long> listString = new HashSet<>(); |
|
|
|
|
list1.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getMaterialId)) |
|
|
|
|
.forEach((k ,v) ->{ |
|
|
|
|
.forEach((k, v) -> { |
|
|
|
|
int sum = v.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); |
|
|
|
|
List<Long> packageIds = new ArrayList<>(); |
|
|
|
|
v.stream().forEach( i -> { |
|
|
|
|
v.stream().forEach(i -> { |
|
|
|
|
//查询有没有打托数据
|
|
|
|
|
|
|
|
|
|
//查询包件有没有物料
|
|
|
|
@ -438,9 +440,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
//有
|
|
|
|
|
list.stream().collect(Collectors.groupingBy(DistributionParcelDetailsEntity::getEncoded)) |
|
|
|
|
.forEach((kk,vv) ->{ |
|
|
|
|
.forEach((kk, vv) -> { |
|
|
|
|
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); |
|
|
|
|
BeanUtil.copyProperties(vv.get(0),parcelListEntity); |
|
|
|
|
BeanUtil.copyProperties(vv.get(0), parcelListEntity); |
|
|
|
|
parcelListEntity.setQuantity(sum); |
|
|
|
|
parcelListEntity.setMaterialName(vv.get(0).getName()); |
|
|
|
|
parcelListEntity.setMaterialCode(vv.get(0).getEncoded()); |
|
|
|
@ -448,10 +450,10 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
// 添加库存品信息
|
|
|
|
|
//查询在库订单信息
|
|
|
|
|
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId()); |
|
|
|
|
if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId()) ) { |
|
|
|
|
if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId())) { |
|
|
|
|
throw new ServiceException("订单的客户数据异常,无法转换!!"); |
|
|
|
|
} |
|
|
|
|
addStockList(distributionStockArticleEntity,parcelListEntity, 1); |
|
|
|
|
addStockList(distributionStockArticleEntity, parcelListEntity, 1); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
//修改状态
|
|
|
|
@ -464,21 +466,21 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
packageIds.add(parcelList.getId()); |
|
|
|
|
}); |
|
|
|
|
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); |
|
|
|
|
BeanUtil.copyProperties(v.get(0),parcelListEntity); |
|
|
|
|
BeanUtil.copyProperties(v.get(0), parcelListEntity); |
|
|
|
|
parcelListEntity.setQuantity(sum); |
|
|
|
|
// 添加库存品信息
|
|
|
|
|
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId()); |
|
|
|
|
if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId()) ) { |
|
|
|
|
if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId())) { |
|
|
|
|
throw new ServiceException("订单的客户数据异常,无法转换!!"); |
|
|
|
|
} |
|
|
|
|
addStockListByPackage(distributionStockArticleEntity,packageIds, 1); |
|
|
|
|
addStockListByPackage(distributionStockArticleEntity, packageIds, 1); |
|
|
|
|
}); |
|
|
|
|
listString.forEach( oo -> { |
|
|
|
|
listString.forEach(oo -> { |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity1 = distributionStockArticleMapper.selectById(oo); |
|
|
|
|
if(ObjectUtils.isNull(stockArticleEntity1)){ |
|
|
|
|
if (ObjectUtils.isNull(stockArticleEntity1)) { |
|
|
|
|
throw new ServiceException("订单不存在!"); |
|
|
|
|
} |
|
|
|
|
if(stockArticleEntity1.getTotalNumber().equals(list1.size())){ |
|
|
|
|
if (stockArticleEntity1.getTotalNumber().equals(list1.size())) { |
|
|
|
|
//修改订单状态
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(oo); |
|
|
|
|
|
|
|
|
@ -494,14 +496,14 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId()) |
|
|
|
|
.eq(DistributionParcelListEntity::getConditions, 2) |
|
|
|
|
); |
|
|
|
|
if(!distributionParcelListEntities.isEmpty() && stockArticleEntity1.getTotalNumber().equals(distributionParcelListEntities.size())){ |
|
|
|
|
if (!distributionParcelListEntities.isEmpty() && stockArticleEntity1.getTotalNumber().equals(distributionParcelListEntities.size())) { |
|
|
|
|
//修改订单状态
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(oo); //修改
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(oo); //修改
|
|
|
|
|
stockArticleEntity.setId(oo); |
|
|
|
|
stockArticleEntity.setGenre(2); |
|
|
|
|
stockArticleEntity.setTotalNumber(stockArticleEntity.getTotalNumber() - list1.size()); |
|
|
|
|
distributionStockArticleMapper.updateById(stockArticleEntity); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(oo); |
|
|
|
|
distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity() - list1.size()); |
|
|
|
|
distributionStockArticleEntity.setTotalNumber(distributionStockArticleEntity.getTotalNumber() - list1.size()); |
|
|
|
@ -530,7 +532,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
parcelListEntity.setConditions(1); |
|
|
|
|
IPage<DistributionParcelListEntity> distributionParcelListEntityIPage = baseMapper.pageOweList(page, parcelListEntity); |
|
|
|
|
List<DistributionParcelListEntity> list = new ArrayList<>(); |
|
|
|
|
distributionParcelListEntityIPage.getRecords().forEach( i ->{ |
|
|
|
|
distributionParcelListEntityIPage.getRecords().forEach(i -> { |
|
|
|
|
DistrilbutionBillPackageEntity one = distrilbutionBillPackageService.getOne(Wrappers.<DistrilbutionBillPackageEntity>query().lambda() |
|
|
|
|
.eq(DistrilbutionBillPackageEntity::getStockArticleId, i.getStockArticleId()) |
|
|
|
|
.eq(DistrilbutionBillPackageEntity::getBillLadingId, reservationId) |
|
|
|
@ -538,8 +540,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
.apply("packet_bar_status in (1,3)") |
|
|
|
|
); |
|
|
|
|
DistributionParcelListEntity parcelListVO = new DistributionParcelListEntity(); |
|
|
|
|
BeanUtils.copyProperties(i,parcelListVO); |
|
|
|
|
parcelListVO.setChoice(ObjectUtils.isNotNull(one) ? true : false); |
|
|
|
|
BeanUtils.copyProperties(i, parcelListVO); |
|
|
|
|
parcelListVO.setChoice(ObjectUtils.isNotNull(one) ? true : false); |
|
|
|
|
list.add(parcelListVO); |
|
|
|
|
}); |
|
|
|
|
distributionParcelListEntityIPage.setRecords(list); |
|
|
|
@ -548,6 +550,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询包件数据 |
|
|
|
|
* |
|
|
|
|
* @param parcelListVO |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -574,13 +577,13 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
|
|
|
|
|
// 获取当前登录的仓库信息
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if(ObjectUtils.isNull(myCurrentWarehouse)){ |
|
|
|
|
if (ObjectUtils.isNull(myCurrentWarehouse)) { |
|
|
|
|
throw new ServiceException("没有仓库信息!"); |
|
|
|
|
} |
|
|
|
|
// 用户勾选数据的ids
|
|
|
|
|
Object ids = paramMap.get("ids"); |
|
|
|
|
List<String> idArr = null; |
|
|
|
|
if (null != ids && !ids.toString().equals("")){ |
|
|
|
|
if (null != ids && !ids.toString().equals("")) { |
|
|
|
|
idArr = Arrays.asList(paramMap.get("ids").toString().split(",")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -596,8 +599,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void freezeByOrderCode(String orderCode,String freezeStatus) { |
|
|
|
|
baseMapper.freezeByOrderCode(orderCode,freezeStatus); |
|
|
|
|
public void freezeByOrderCode(String orderCode, String freezeStatus) { |
|
|
|
|
baseMapper.freezeByOrderCode(orderCode, freezeStatus); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -607,12 +610,12 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void updateOrderPackageCodeById(Long packageId, String orderPackageStatus) { |
|
|
|
|
baseMapper.updateOrderPackageCodeById(packageId,orderPackageStatus); |
|
|
|
|
baseMapper.updateOrderPackageCodeById(packageId, orderPackageStatus); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public DistributionParcelListEntity selectByOrderPackageCode(String orderPackageCode, Long warehouseId) { |
|
|
|
|
return baseMapper.selectByOrderPackageCode(orderPackageCode,warehouseId); |
|
|
|
|
return baseMapper.selectByOrderPackageCode(orderPackageCode, warehouseId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -620,7 +623,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public DistributionStockArticleEntity addStockList(DistributionStockArticleEntity distributionStockArticleEntity,DistributionParcelListEntity distributionParcelList, Integer qu) { |
|
|
|
|
public DistributionStockArticleEntity addStockList(DistributionStockArticleEntity distributionStockArticleEntity, DistributionParcelListEntity distributionParcelList, Integer qu) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity(); |
|
|
|
@ -658,16 +661,16 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
distributionStockListEntity.setParcelListId(distributionParcelList.getId());//包件id
|
|
|
|
|
distributionStockListEntity.setQuantityOccupied(0);//冻结数量
|
|
|
|
|
distributionStockListEntity.setServiceType(distributionStockArticleEntity.getTypeService());//冻结数量
|
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getStockListEntity(distributionStockArticleEntity.getMallId(), distributionParcelList.getMaterialId(), distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getStoreId(),distributionStockArticleEntity.getWarehouseId()); |
|
|
|
|
if(ObjectUtils.isNotNull(stockListEntity)){ |
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getStockListEntity(distributionStockArticleEntity.getMallId(), distributionParcelList.getMaterialId(), distributionStockArticleEntity.getOrderCode(), distributionStockArticleEntity.getStoreId(), distributionStockArticleEntity.getWarehouseId()); |
|
|
|
|
if (ObjectUtils.isNotNull(stockListEntity)) { |
|
|
|
|
//有记录
|
|
|
|
|
DistributionStockListEntity listEntity = new DistributionStockListEntity(); |
|
|
|
|
listEntity.setId(stockListEntity.getId());//id
|
|
|
|
|
Integer quantity = ObjectUtils.isNull(distributionParcelList.getQuantity()) ? 0: distributionParcelList.getQuantity(); |
|
|
|
|
Integer quantityStock = ObjectUtils.isNull(stockListEntity.getQuantityStock()) ? 0 : stockListEntity.getQuantityStock(); |
|
|
|
|
Integer quantity = ObjectUtils.isNull(distributionParcelList.getQuantity()) ? 0 : distributionParcelList.getQuantity(); |
|
|
|
|
Integer quantityStock = ObjectUtils.isNull(stockListEntity.getQuantityStock()) ? 0 : stockListEntity.getQuantityStock(); |
|
|
|
|
listEntity.setQuantityStock(quantity + quantityStock); |
|
|
|
|
distributionStockListService.updateById(listEntity); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
distributionStockListService.save(distributionStockListEntity); |
|
|
|
|
} |
|
|
|
|
distributionStockListEntity.setTrayName(Optional.ofNullable(distributionParcelList.getPallet()).orElse(null)); //托盘
|
|
|
|
@ -679,7 +682,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
|
|
|
|
|
//添加库存品记录
|
|
|
|
|
DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity(); |
|
|
|
|
BeanUtil.copyProperties(distributionStockListEntity,distributionStockListInfo); |
|
|
|
|
BeanUtil.copyProperties(distributionStockListEntity, distributionStockListInfo); |
|
|
|
|
distributionStockListInfo.setWarehousingTime(distributionStockArticleEntity.getWarehouseEntryTime()); |
|
|
|
|
distributionStockListInfo.setStockArticleId(distributionStockArticleEntity.getId()); |
|
|
|
|
// distributionStockListInfo.setLicensePlate(distributionStockArticleEntity.get); //车牌
|
|
|
|
@ -687,31 +690,32 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
distributionStockListInfoService.save(distributionStockListInfo); |
|
|
|
|
return distributionStockArticleEntity; |
|
|
|
|
} |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public DistributionStockArticleEntity addStockListByPackage(DistributionStockArticleEntity distributionStockArticleEntity,List<Long> packageIds, Integer qu) { |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)){ |
|
|
|
|
//当前无选择仓库
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = this.listByIds(packageIds); |
|
|
|
|
List<Long> materialId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialId).distinct().collect(Collectors.toList()); |
|
|
|
|
List<String> materialCode = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialCode).distinct().collect(Collectors.toList()); |
|
|
|
|
List<String> materialUnit = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialUnit).distinct().collect(Collectors.toList()); |
|
|
|
|
List<Long> mallId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMallId).distinct().collect(Collectors.toList()); |
|
|
|
|
List<String> materialName= distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialName).distinct().collect(Collectors.toList()); |
|
|
|
|
List<Long> brandId= distributionParcelListEntities.stream().map(DistributionParcelListEntity::getBrandId).distinct().collect(Collectors.toList()); |
|
|
|
|
if (materialId.size()!=1 ||materialCode.size()!=1 ||materialUnit.size()!=1 ||mallId.size()!=1 || materialName.size()!=1 || brandId.size()!=1 ){ |
|
|
|
|
//该批次包件出现多种物料包件
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int num = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); |
|
|
|
|
if (num <= 0){ |
|
|
|
|
//无有效的在库数量
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity(); |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public DistributionStockArticleEntity addStockListByPackage(DistributionStockArticleEntity distributionStockArticleEntity, List<Long> packageIds, Integer qu) { |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)) { |
|
|
|
|
//当前无选择仓库
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = this.listByIds(packageIds); |
|
|
|
|
List<Long> materialId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialId).distinct().collect(Collectors.toList()); |
|
|
|
|
List<String> materialCode = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialCode).distinct().collect(Collectors.toList()); |
|
|
|
|
List<String> materialUnit = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialUnit).distinct().collect(Collectors.toList()); |
|
|
|
|
List<Long> mallId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMallId).distinct().collect(Collectors.toList()); |
|
|
|
|
List<String> materialName = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialName).distinct().collect(Collectors.toList()); |
|
|
|
|
List<Long> brandId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getBrandId).distinct().collect(Collectors.toList()); |
|
|
|
|
if (materialId.size() != 1 || materialCode.size() != 1 || materialUnit.size() != 1 || mallId.size() != 1 || materialName.size() != 1 || brandId.size() != 1) { |
|
|
|
|
//该批次包件出现多种物料包件
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int num = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); |
|
|
|
|
if (num <= 0) { |
|
|
|
|
//无有效的在库数量
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity(); |
|
|
|
|
//直接添加
|
|
|
|
|
// distributionStockListEntity.setIncomingBatch(distributionStockArticleEntity.get); //入库批次号
|
|
|
|
|
distributionStockListEntity.setServiceNumber(Optional.ofNullable(distributionStockArticleEntity.getServiceNumber()).orElse(null)); //服务号
|
|
|
|
@ -746,16 +750,16 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
// distributionStockListEntity.setParcelListId(distributionParcelListEntities.getId());//包件id
|
|
|
|
|
distributionStockListEntity.setQuantityOccupied(0);//冻结数量
|
|
|
|
|
distributionStockListEntity.setServiceType(distributionStockArticleEntity.getTypeService());//冻结数量
|
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getStockListEntity(distributionStockArticleEntity.getMallId(), distributionParcelListEntities.get(0).getMaterialId(), distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getStoreId(),distributionStockArticleEntity.getWarehouseId()); |
|
|
|
|
if(ObjectUtils.isNotNull(stockListEntity)){ |
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getStockListEntity(distributionStockArticleEntity.getMallId(), distributionParcelListEntities.get(0).getMaterialId(), distributionStockArticleEntity.getOrderCode(), distributionStockArticleEntity.getStoreId(), distributionStockArticleEntity.getWarehouseId()); |
|
|
|
|
if (ObjectUtils.isNotNull(stockListEntity)) { |
|
|
|
|
//有记录
|
|
|
|
|
DistributionStockListEntity listEntity = new DistributionStockListEntity(); |
|
|
|
|
listEntity.setId(stockListEntity.getId());//id
|
|
|
|
|
Integer quantity = ObjectUtils.isNull(distributionParcelListEntities.get(0).getQuantity()) ? 0: distributionParcelListEntities.get(0).getQuantity(); |
|
|
|
|
Integer quantityStock = ObjectUtils.isNull(stockListEntity.getQuantityStock()) ? 0 : stockListEntity.getQuantityStock(); |
|
|
|
|
Integer quantity = ObjectUtils.isNull(distributionParcelListEntities.get(0).getQuantity()) ? 0 : distributionParcelListEntities.get(0).getQuantity(); |
|
|
|
|
Integer quantityStock = ObjectUtils.isNull(stockListEntity.getQuantityStock()) ? 0 : stockListEntity.getQuantityStock(); |
|
|
|
|
listEntity.setQuantityStock(quantity + quantityStock); |
|
|
|
|
distributionStockListService.updateById(listEntity); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
distributionStockListService.save(distributionStockListEntity); |
|
|
|
|
} |
|
|
|
|
// distributionStockListEntity.setTrayName(Optional.ofNullable(distributionParcelList.getPallet()).orElse(null)); //托盘
|
|
|
|
@ -766,62 +770,62 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
// distributionStockListEntity.setOrderCode(Optional.ofNullable(distributionParcelListEntities.get(0).getOrderCode()).orElse(null)); //订单自编号
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
|
|
//添加库存品记录
|
|
|
|
|
DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity(); |
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
|
|
//添加库存品记录
|
|
|
|
|
DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity(); |
|
|
|
|
// BeanUtil.copyProperties(distributionStockListEntity,distributionStockListInfo);
|
|
|
|
|
|
|
|
|
|
distributionStockListInfo.setServiceNumber(distributionStockListEntity.getServiceNumber()); //服务号
|
|
|
|
|
distributionStockListInfo.setDescriptionGoods(distributionStockListEntity.getMallName()); //物料名称
|
|
|
|
|
distributionStockListInfo.setCargoNumber(distributionStockListEntity.getCargoNumber()); //物料编号
|
|
|
|
|
distributionStockListInfo.setWarehouseName(distributionStockListEntity.getWarehouseName()); //仓库
|
|
|
|
|
distributionStockListInfo.setWarehouseId(distributionStockListEntity.getWarehouseId()); //仓库ID
|
|
|
|
|
distributionStockListInfo.setMarketId(distributionStockListEntity.getMarketId()); //商场
|
|
|
|
|
distributionStockListInfo.setCargoUnit(distributionStockListEntity.getCargoUnit()); //货物单位
|
|
|
|
|
distributionStockListInfo.setServiceNumber(distributionStockListEntity.getServiceNumber()); //服务号
|
|
|
|
|
distributionStockListInfo.setDescriptionGoods(distributionStockListEntity.getMallName()); //物料名称
|
|
|
|
|
distributionStockListInfo.setCargoNumber(distributionStockListEntity.getCargoNumber()); //物料编号
|
|
|
|
|
distributionStockListInfo.setWarehouseName(distributionStockListEntity.getWarehouseName()); //仓库
|
|
|
|
|
distributionStockListInfo.setWarehouseId(distributionStockListEntity.getWarehouseId()); //仓库ID
|
|
|
|
|
distributionStockListInfo.setMarketId(distributionStockListEntity.getMarketId()); //商场
|
|
|
|
|
distributionStockListInfo.setCargoUnit(distributionStockListEntity.getCargoUnit()); //货物单位
|
|
|
|
|
|
|
|
|
|
distributionStockListInfo.setMallName(distributionStockListEntity.getMallName()); //商场名称
|
|
|
|
|
distributionStockListInfo.setQuantityStock(distributionParcelListEntity.getQuantity()); //库存数量(包件数量)
|
|
|
|
|
distributionStockListInfo.setIncomingBatch(distributionStockListEntity.getIncomingBatch()); //入库批次
|
|
|
|
|
distributionStockListInfo.setOutboundQuantity(0); //出库数量
|
|
|
|
|
distributionStockListInfo.setOutboundQuantity(0); //入库时间
|
|
|
|
|
distributionStockListInfo.setMallName(distributionStockListEntity.getMallName()); //商场名称
|
|
|
|
|
distributionStockListInfo.setQuantityStock(distributionParcelListEntity.getQuantity()); //库存数量(包件数量)
|
|
|
|
|
distributionStockListInfo.setIncomingBatch(distributionStockListEntity.getIncomingBatch()); //入库批次
|
|
|
|
|
distributionStockListInfo.setOutboundQuantity(0); //出库数量
|
|
|
|
|
distributionStockListInfo.setOutboundQuantity(0); //入库时间
|
|
|
|
|
|
|
|
|
|
// distributionStockListEntity.setCargoUnit(Optional.ofNullable(distributionParcelList.getMaterialUnit()).orElse(null));//单位
|
|
|
|
|
distributionStockListInfo.setStoreId(distributionStockListEntity.getStoreId());//门店ID
|
|
|
|
|
distributionStockListInfo.setMarketCode(distributionStockListEntity.getMarketCode());//商场编码
|
|
|
|
|
distributionStockListInfo.setMarketName(distributionStockListEntity.getMarketName());//商场名称
|
|
|
|
|
distributionStockListInfo.setStoreCode(distributionStockListEntity.getStoreCode());//门店编码
|
|
|
|
|
distributionStockListInfo.setStoreName(distributionStockListEntity.getStoreName());//门店名称
|
|
|
|
|
distributionStockListInfo.setStoreId(distributionStockListEntity.getStoreId());//门店ID
|
|
|
|
|
distributionStockListInfo.setMarketCode(distributionStockListEntity.getMarketCode());//商场编码
|
|
|
|
|
distributionStockListInfo.setMarketName(distributionStockListEntity.getMarketName());//商场名称
|
|
|
|
|
distributionStockListInfo.setStoreCode(distributionStockListEntity.getStoreCode());//门店编码
|
|
|
|
|
distributionStockListInfo.setStoreName(distributionStockListEntity.getStoreName());//门店名称
|
|
|
|
|
|
|
|
|
|
// distributionStockListEntity.setCategory(Optional.ofNullable(distributionParcelList.getBrandId()+"").orElse(null));//品分类
|
|
|
|
|
// 品牌
|
|
|
|
|
distributionStockListInfo.setBrandId(distributionStockListEntity.getBrandId()); |
|
|
|
|
distributionStockListInfo.setUnpackingQuantity(0); |
|
|
|
|
distributionStockListInfo.setSourceType("1"); //类型
|
|
|
|
|
// 品牌
|
|
|
|
|
distributionStockListInfo.setBrandId(distributionStockListEntity.getBrandId()); |
|
|
|
|
distributionStockListInfo.setUnpackingQuantity(0); |
|
|
|
|
distributionStockListInfo.setSourceType("1"); //类型
|
|
|
|
|
|
|
|
|
|
distributionStockListInfo.setSku(distributionStockListEntity.getSku()); |
|
|
|
|
distributionStockListInfo.setMaterialId(distributionStockListEntity.getMaterialId());//货物ID
|
|
|
|
|
distributionStockListInfo.setSku(distributionStockListEntity.getSku()); |
|
|
|
|
distributionStockListInfo.setMaterialId(distributionStockListEntity.getMaterialId());//货物ID
|
|
|
|
|
// distributionStockListEntity.setParcelListId(distributionParcelListEntities.getId());//包件id
|
|
|
|
|
distributionStockListInfo.setQuantityOccupied(0);//冻结数量
|
|
|
|
|
distributionStockListInfo.setServiceType(distributionStockListEntity.getServiceType());//冻结数
|
|
|
|
|
|
|
|
|
|
//需要包件维度的详情
|
|
|
|
|
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
|
warehouseUpdownGoodsEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationType("3"); |
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationValue(distributionParcelListEntity.getOrderPackageCode()); |
|
|
|
|
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationInformation(warehouseUpdownGoodsEntity); |
|
|
|
|
if (Func.isNotEmpty(locationInformation)){ |
|
|
|
|
distributionStockListInfo.setQuantityOccupied(0);//冻结数量
|
|
|
|
|
distributionStockListInfo.setServiceType(distributionStockListEntity.getServiceType());//冻结数
|
|
|
|
|
|
|
|
|
|
//需要包件维度的详情
|
|
|
|
|
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
|
warehouseUpdownGoodsEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationType("3"); |
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationValue(distributionParcelListEntity.getOrderPackageCode()); |
|
|
|
|
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationInformation(warehouseUpdownGoodsEntity); |
|
|
|
|
if (Func.isNotEmpty(locationInformation)) { |
|
|
|
|
// distributionStockListInfo.setTrayName(locationInformation.get);
|
|
|
|
|
distributionStockListInfo.setStorageLocation(locationInformation.getAllocationTitle()); |
|
|
|
|
distributionStockListInfo.setStorageLocation(locationInformation.getAllocationTitle()); |
|
|
|
|
} |
|
|
|
|
distributionStockListInfo.setFactory(distributionStockArticleEntity.getFactoryTrain()); |
|
|
|
|
distributionStockListInfo.setDespatch(distributionStockArticleEntity.getTrainNumber()); |
|
|
|
|
distributionStockListInfo.setStockArticleId(distributionStockArticleEntity.getId()); |
|
|
|
|
distributionStockListInfo.setOrderCode(distributionStockArticleEntity.getOrderCode()); |
|
|
|
|
distributionStockListInfo.setParcelListId(distributionParcelListEntity.getId()); |
|
|
|
|
distributionStockListInfo.setPackageCode(distributionParcelListEntity.getOrderPackageCode()); |
|
|
|
|
distributionStockListInfoService.save(distributionStockListInfo); |
|
|
|
|
} |
|
|
|
|
distributionStockListInfo.setFactory(distributionStockArticleEntity.getFactoryTrain()); |
|
|
|
|
distributionStockListInfo.setDespatch(distributionStockArticleEntity.getTrainNumber()); |
|
|
|
|
distributionStockListInfo.setStockArticleId(distributionStockArticleEntity.getId()); |
|
|
|
|
distributionStockListInfo.setOrderCode(distributionStockArticleEntity.getOrderCode()); |
|
|
|
|
distributionStockListInfo.setParcelListId(distributionParcelListEntity.getId()); |
|
|
|
|
distributionStockListInfo.setPackageCode(distributionParcelListEntity.getOrderPackageCode()); |
|
|
|
|
distributionStockListInfoService.save(distributionStockListInfo); |
|
|
|
|
} |
|
|
|
|
return distributionStockArticleEntity; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|