Browse Source

修改查询件数 --待完成

single_db
pref_mail@163.com 1 year ago
parent
commit
98d0000917
  1. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.java
  2. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml
  3. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscaninvnMapper.java
  4. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscaninvnMapper.xml
  5. 29
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/OrderPackageStatusDataHandler.java
  6. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  7. 370
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.java

@ -127,4 +127,11 @@ public interface DistributionLoadscanMapper extends BaseMapper<DistributionLoads
* @return
*/
String selectPackageSigningTime(@Param("packageId") Long id);
/**
* 统计装车数据
* @param deliveryId
* @return
*/
Integer getLoadCountNum(@Param("deliveryId") Long deliveryId);
}

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml

@ -249,4 +249,21 @@
SELECT signing_time FROM logpm_distribution_loadscan WHERE package_id = #{packageId} AND signfor_state = 2 AND scan_state != 1
</select>
<select id="getLoadCountNum" resultType="int">
SELECT
count( ldl.id )
FROM
logpm_distribution_loadscan ldl
right JOIN logpm_distribution_reservation ldr on ldr.id= ldl.reservation_id and ldr.reservation_status !='40'
WHERE
ldl.is_deleted = 0
AND ldl.delivery_id = #{deliveryId}
AND ldl.scan_status != '1'
AND ldl.is_abnormal_loading = 1
</select>
</mapper>

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscaninvnMapper.java

@ -58,4 +58,6 @@ public interface DistributionLoadscaninvnMapper extends BaseMapper<DistributionL
* @return
*/
Integer statisticsLoadingNum(@Param("deliveryListId") Long deliveryId);
Integer getLoadCountNum(@Param("deliveryId") Long deliveryId);
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscaninvnMapper.xml

@ -71,5 +71,16 @@
<select id="statisticsLoadingNum" resultType="java.lang.Integer">
SELECT COUNT(ldl.loaded_nub) FROM logpm_distribution_loadscaninvn AS ldl WHERE delivery_id = #{deliveryListId}
</select>
<select id="getLoadCountNum" resultType="int">
SELECT
count( ldl.id )
FROM
logpm_distribution_loadscaninvn ldl
right JOIN logpm_distribution_reservation ldr on ldr.id= ldl.reservation_id and ldr.reservation_status !='40'
WHERE
ldl.is_deleted = 0
AND ldl.delivery_id = #{deliveryId}
AND ldl.scan_status != '1'
</select>
</mapper>

29
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/OrderPackageStatusDataHandler.java

@ -50,35 +50,6 @@ public class OrderPackageStatusDataHandler {
// 更新状态
baseMapper.updateOrderPackageCodeById(parcelListEntity.getId(),groundingStatus);
// log.info(">>>> 更新包间状态 >> 包件ID {} 状态 {}",parcelListEntity.getId(),groundingStatus);
// String orderCode = parcelListEntity.getOrderCode();
//
// QueryWrapper<DistributionStockArticleEntity> stockArticleEntityQueryWrapper = new QueryWrapper<>();
// stockArticleEntityQueryWrapper.eq("order_code",orderCode)
// .eq("is_deleted",0);
// DistributionStockArticleEntity one = distributionStockArticleMapper.selectOne(stockArticleEntityQueryWrapper);
// Integer totalNumber = one.getTotalNumber();
//
// QueryWrapper<DistributionParcelListEntity> queryWrapperList = new QueryWrapper<>();
// queryWrapperList.eq("order_code",orderCode)
// .eq("order_package_grounding_status","20")
// .eq("warehouse_id",warehouseId)
// .eq("is_deleted",0);
// List<DistributionParcelListEntity> listEntityList = baseMapper.selectList(queryWrapperList);
// int size = listEntityList.size();
// if(size == 0){
// //更新订单上架状态
// baseMapper.updateOrderGroundingStatus(orderCode,"10",warehouseId);
// }else if(size >= totalNumber){
// //更新订单上架状态
// baseMapper.updateOrderGroundingStatus(orderCode,"30",warehouseId);
// }else{
// //更新订单上架状态
// baseMapper.updateOrderGroundingStatus(orderCode,"20",warehouseId);
// }
}catch (Exception e){
// 更新状态报错

41
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -919,34 +919,24 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// }
@NotNull
private String getLoadingMsg(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()).eq(DistributionLoadscanEntity::getIsAbnormalLoading,1));
List<DistributionLoadscaninvnEntity> distributionLoadscaninvnEntities = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda().eq(DistributionLoadscaninvnEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()).ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
private Integer getCarLaodNum(Long deliveryId){
AtomicInteger loadingNum = new AtomicInteger();
// AtomicInteger abnormalLoadingNum = new AtomicInteger();
if (Func.isNotEmpty(distributionLoadscanEntitiesflag)) {
//统计装车包件
// Long yijingLoadingNum = distributionLoadscanEntitiesflag.stream().count();
int yijingLoadingNum = distributionLoadscanEntitiesflag.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum();
Integer contNum_a = distributionLoadscanMapper.getLoadCountNum(deliveryId);
loadingNum.getAndAdd(contNum_a);
loadingNum.getAndAdd(yijingLoadingNum);
// int yichangLoadingNum = distributionLoadscanEntitiesflag.stream().filter(f -> Func.equals(f.getIsAbnormalLoading(), 2)).mapToInt(DistributionLoadscanEntity::getLoadedNub).sum();
// if (yichangLoadingNum > 0) {
// abnormalLoadingNum.getAndAdd(yichangLoadingNum);
// }
}
Integer contNum_b= distributionLoadscaninvnMapper.getLoadCountNum(deliveryId);
loadingNum.getAndAdd(contNum_b);
return loadingNum.get();
}
@NotNull
private String getLoadingMsg(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
if (Func.isNotEmpty(distributionLoadscaninvnEntities)) {
//统计库存品装车数量
int inventoryLoadingNum = distributionLoadscaninvnEntities.stream().mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum();
loadingNum.getAndAdd(inventoryLoadingNum);
}
StringBuilder str = new StringBuilder();
str.append("装车").append(loadingNum.get() + "件");
// if (abnormalLoadingNum.get() > 0) {
// str.append("异常").append(abnormalLoadingNum.get() + "件");
// }
str.append("装车").append(getCarLaodNum(distrilbutionloadingscanDTO.getDeliveryId()) + "件");
return str.toString();
}
@ -2370,6 +2360,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
//转换字典字段
for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) {
distributionAppDeliveryListVO.setScannedNumber(getCarLaodNum(distributionAppDeliveryListVO.getId()));
// 调用下 查询装车件数的方法
//查询备货区
if (StringUtils.isNotBlank(distributionAppDeliveryListVO.getReservationId())) {
List<String> list = CommonUtil.stringNum(distributionAppDeliveryListVO.getReservationId());

370
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -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;
}

Loading…
Cancel
Save