Browse Source

1.干线图片上传限制

2.动态托盘码打托
fix-sign
zhenghaoyu 4 months ago
parent
commit
c25b9e363f
  1. 7
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java
  2. 18
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java
  3. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLinePhotoService.java
  4. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLinePhotoEntityServiceImpl.java
  5. 313
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  6. 31
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java
  7. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java
  8. 26
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

7
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java

@ -1,9 +1,6 @@
package com.logpm.trunkline.vo; package com.logpm.trunkline.vo;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity; import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineCarsUnloadLogEntity;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -58,4 +55,6 @@ public class TrunklineCarsLoadVO extends TrunklineCarsLoadEntity {
private Integer isStartPhoto; private Integer isStartPhoto;
private Integer isUnloadPhoto; private Integer isUnloadPhoto;
private List<TrunklineCarsLoadLinePhotoEntity> carsLoadLinePhotoEntities = new ArrayList<>();
} }

18
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java

@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity; import org.springblade.core.tenant.mp.TenantEntity;
@Data @Data
@ -71,6 +70,23 @@ public class WarehouseConfigEntity extends TenantEntity {
@ApiModelProperty(value = "预留5") @ApiModelProperty(value = "预留5")
private String reserve5; private String reserve5;
/**
* 是否干线上传装车图片
*/
@ApiModelProperty(value = "是否干线上传装车图片")
private Integer isTrunklineLoadingPhoto;
/**
* 是否干线上传发车图片
*/
@ApiModelProperty(value = "是否干线上传发车图片")
private Integer isTrunklineStartPhoto;
/**
* 是否干线上传卸车图片
*/
@ApiModelProperty(value = "是否干线上传卸车图片")
private Integer isTrunklineUnloadPhoto;
} }

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLinePhotoService.java

@ -9,4 +9,7 @@ public interface ITrunklineCarsLoadLinePhotoService extends BaseService<Trunklin
Integer findNumByLoadIdAndNodeIdAndTypeAndPosition(Long loadId, Long carsLoadLineId, Integer type, Integer position); Integer findNumByLoadIdAndNodeIdAndTypeAndPosition(Long loadId, Long carsLoadLineId, Integer type, Integer position);
List<TrunklineCarsLoadLinePhotoEntity> findListByLoadIdAndWarehouseId(Long loadId, Long warehouseId, Integer type, Integer position); List<TrunklineCarsLoadLinePhotoEntity> findListByLoadIdAndWarehouseId(Long loadId, Long warehouseId, Integer type, Integer position);
List<TrunklineCarsLoadLinePhotoEntity> findListByLoadIdListAndWarehouseId(List<Long> idList, Long warehouseId);
} }

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLinePhotoEntityServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.service.impl; package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.trunkline.entity.TrunklineCarsLoadLinePhotoEntity; import com.logpm.trunkline.entity.TrunklineCarsLoadLinePhotoEntity;
import com.logpm.trunkline.mapper.TrunklineCarsLoadLinePhotoMapper; import com.logpm.trunkline.mapper.TrunklineCarsLoadLinePhotoMapper;
import com.logpm.trunkline.service.ITrunklineCarsLoadLinePhotoService; import com.logpm.trunkline.service.ITrunklineCarsLoadLinePhotoService;
@ -25,4 +26,13 @@ public class TrunklineCarsLoadLinePhotoEntityServiceImpl extends BaseServiceImpl
public List<TrunklineCarsLoadLinePhotoEntity> findListByLoadIdAndWarehouseId(Long loadId, Long warehouseId, Integer type, Integer position) { public List<TrunklineCarsLoadLinePhotoEntity> findListByLoadIdAndWarehouseId(Long loadId, Long warehouseId, Integer type, Integer position) {
return baseMapper.findListByLoadIdAndWarehouseId(loadId,warehouseId, type, position); return baseMapper.findListByLoadIdAndWarehouseId(loadId,warehouseId, type, position);
} }
@Override
public List<TrunklineCarsLoadLinePhotoEntity> findListByLoadIdListAndWarehouseId(List<Long> idList, Long warehouseId) {
QueryWrapper<TrunklineCarsLoadLinePhotoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("load_id",idList)
.eq("warehouse_id",warehouseId);
List<TrunklineCarsLoadLinePhotoEntity> trunklineCarsLoadLinePhotoEntities = baseMapper.selectList(queryWrapper);
return trunklineCarsLoadLinePhotoEntities;
}
} }

313
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -45,14 +45,8 @@ import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper; import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper;
import com.logpm.trunkline.service.*; import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.*; import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity; import com.logpm.warehouse.entity.*;
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity; import com.logpm.warehouse.feign.*;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import com.logpm.warehouse.vo.WarehouseWaybillVO; import com.logpm.warehouse.vo.WarehouseWaybillVO;
import com.logpm.warehouse.vo.WaybillOrderTotalWeightAndVolumeVO; import com.logpm.warehouse.vo.WaybillOrderTotalWeightAndVolumeVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -139,6 +133,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
private final IBasicdataTripartiteMallClient tripartiteMallClient; private final IBasicdataTripartiteMallClient tripartiteMallClient;
private final IBasicMaterialClient basicMaterialClient; private final IBasicMaterialClient basicMaterialClient;
private final IBasicdataBrandClient basicdataBrandClient; private final IBasicdataBrandClient basicdataBrandClient;
private final IWarehouseConfigClient warehouseConfigClient;
@Override @Override
@ -267,6 +262,20 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// throw new CustomerException(400, "节点还未上传发车前图片"); // throw new CustomerException(400, "节点还未上传发车前图片");
// } // }
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineStartPhoto = warehouseConfig.getIsTrunklineStartPhoto();
if(NumberUtil.equals(isTrunklineStartPhoto,1)){
//限制装车之前上传图片
Integer isStartPhoto = currentCarsLoadLineEntity.getIsStartPhoto();
if(NumberUtil.equals(isStartPhoto,0)){
log.warn("##############startCarByLoadId: 节点还未上传发车前图片 isStartPhoto={}", isStartPhoto);
throw new CustomerException(405, "节点还未上传发车前图片");
}
}
}
if (StringUtil.isNotBlank(fullLoadRate)) { if (StringUtil.isNotBlank(fullLoadRate)) {
carsLoadEntity.setFullLoadRate(new BigDecimal(fullLoadRate)); carsLoadEntity.setFullLoadRate(new BigDecimal(fullLoadRate));
} }
@ -2307,174 +2316,44 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
public R findLinePhoto(LoadCarsDTO loadCarsDTO) { public R findLinePhoto(LoadCarsDTO loadCarsDTO) {
Long loadId = loadCarsDTO.getLoadId(); Long loadId = loadCarsDTO.getLoadId();
List<Map<String, Object>> resultList = new ArrayList<>();
List<TrunklineCarsLoadLinePhotoEntity> linePhotoEntityList = carsLoadLinePhotoService.findListByLoadIdAndWarehouseId(loadId, null, null, null); List<TrunklineCarsLoadLinePhotoEntity> linePhotoEntityList = carsLoadLinePhotoService.findListByLoadIdAndWarehouseId(loadId, null, null, null);
//把linePhotoEntityList中所有元素的loadLineId放入一个Set集合
Set<Long> loadLineIdSet = linePhotoEntityList.stream().map(TrunklineCarsLoadLinePhotoEntity::getLoadLineId).collect(Collectors.toSet());
if(CollUtil.isNotEmpty(loadLineIdSet)){
QueryWrapper<TrunklineCarsLoadLineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id",loadLineIdSet);
List<TrunklineCarsLoadLineEntity> carsLoadLineList = trunklineCarsLoadLineService.list(queryWrapper);
//把carsLoadLineList转化为以id为key的map
Map<Long, TrunklineCarsLoadLineEntity> carsLoadLineMap = carsLoadLineList.stream().collect(Collectors.toMap(TrunklineCarsLoadLineEntity::getId, Function.identity()));
//把linePhotoEntityList中所有元素以loadLineId进行分组 Map<Long, List<TrunklineCarsLoadLinePhotoEntity>> linePhotoMap = linePhotoEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadLineId));
Map<Long, List<TrunklineCarsLoadLinePhotoEntity>> linePhotoMap = linePhotoEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadLineId));
List<TrunklineCarsLoadLineEntity> loadLineEntityList = trunklineCarsLoadLineService.findListByLoadId(loadId);
List<Map<String, Object>> resultList = new ArrayList<>();
linePhotoMap.keySet().forEach(loadLineId -> { if(CollUtil.isNotEmpty(loadLineEntityList)){
Map<String,Object> map = new HashMap<>();
List<TrunklineCarsLoadLinePhotoEntity> trunklineCarsLoadLinePhotoEntities = linePhotoMap.get(loadLineId);
TrunklineCarsLoadLineEntity trunklineCarsLoadLineEntity = carsLoadLineMap.get(loadLineId);
map.put("carsLoadLineEntity",trunklineCarsLoadLineEntity);
Map<String,Object> loadingMap = new HashMap<>();
//把trunklineCarsLoadLinePhotoEntities通过type=10进行过滤
List<TrunklineCarsLoadLinePhotoEntity> ls = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(10)).collect(Collectors.toList());
//把qualityList通过position进行分组
// List<TrunklineCarsLoadLinePhotoEntity> listQian = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> listHou = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> listZuo = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> listYou = new ArrayList<>();
// Map<Integer, List<TrunklineCarsLoadLinePhotoEntity>> listMap = ls.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition));
// listMap.keySet().forEach(key -> {
// List<TrunklineCarsLoadLinePhotoEntity> list = listMap.get(key);
// if(NumberUtil.equals(1,key)){//后
// listQian.addAll(list);
// }else if(NumberUtil.equals(2,key)){//后
// listHou.addAll(list);
// }else if(NumberUtil.equals(3,key)){
// listZuo.addAll(list);
// }else if(NumberUtil.equals(4,key)){
// listYou.addAll(list);
// }
// });
//
// loadingMap.put("listQian",listQian);
// loadingMap.put("listHou",listHou);
// loadingMap.put("listZuo",listZuo);
// loadingMap.put("listYou",listYou);
// Map<String,Object> loadingObject = new HashMap<>();
// loadingObject.put("loadingList",ls);
map.put("loadingObject",ls);
//发车
// Map<String,Object> qualityMap = new HashMap<>();
List<TrunklineCarsLoadLinePhotoEntity> qualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(20)).collect(Collectors.toList());
//把qualityList通过position进行分组
// List<TrunklineCarsLoadLinePhotoEntity> qualityListQian = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> qualityListHou = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> qualityListZuo = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> qualityListYou = new ArrayList<>();
// Map<Integer, List<TrunklineCarsLoadLinePhotoEntity>> qualityListMap = qualityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition));
// qualityListMap.keySet().forEach(key -> {
// List<TrunklineCarsLoadLinePhotoEntity> list = qualityListMap.get(key);
// if(NumberUtil.equals(1,key)){//后
// qualityListQian.addAll(list);
// }else if(NumberUtil.equals(2,key)){//后
// qualityListHou.addAll(list);
// }else if(NumberUtil.equals(3,key)){
// qualityListZuo.addAll(list);
// }else if(NumberUtil.equals(4,key)){
// qualityListYou.addAll(list);
// }
// });
//
// qualityMap.put("qualityListQian",qualityListQian);
// qualityMap.put("qualityListHou",qualityListHou);
// qualityMap.put("qualityListZuo",qualityListZuo);
// qualityMap.put("qualityListYou",qualityListYou);
// Map<String,Object> yubuMap = new HashMap<>();
// List<TrunklineCarsLoadLinePhotoEntity> yubuListQian = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> yubuListHou = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> yubuListZuo = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> yubuListYou = new ArrayList<>();
List<TrunklineCarsLoadLinePhotoEntity> yubuList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(21)).collect(Collectors.toList());
//把qualityList通过position进行分组
// Map<Integer, List<TrunklineCarsLoadLinePhotoEntity>> yubuListMap = yubuList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition));
// yubuListMap.keySet().forEach(key -> {
// List<TrunklineCarsLoadLinePhotoEntity> list = yubuListMap.get(key);
// if(NumberUtil.equals(1,key)){//后
// yubuListQian.addAll(list);
// }else if(NumberUtil.equals(2,key)){//后
// yubuListHou.addAll(list);
// }else if(NumberUtil.equals(3,key)){
// yubuListZuo.addAll(list);
// }else if(NumberUtil.equals(4,key)){
// yubuListYou.addAll(list);
// }
// });
//
// yubuMap.put("yubuListQian",yubuListQian);
// yubuMap.put("yubuListHou",yubuListHou);
// yubuMap.put("yubuListZuo",yubuListZuo);
// yubuMap.put("yubuListYou",yubuListYou);
// Map<String,Object> startObject = new HashMap<>();
// startObject.put("qualityList",qualityList);
// startObject.put("yubuList",yubuList);
map.put("startObject",qualityList.addAll(yubuList));
//卸车
Map<String,Object> unloadQualityMap = new HashMap<>();
List<TrunklineCarsLoadLinePhotoEntity> unloadQualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(30)).collect(Collectors.toList());
//把qualityList通过position进行分组
// List<TrunklineCarsLoadLinePhotoEntity> unloadQualityListQian = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> unloadQualityListHou = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> unloadQualityListZuo = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> unloadQualityListYou = new ArrayList<>();
// Map<Integer, List<TrunklineCarsLoadLinePhotoEntity>> unloadQualityListMap = unloadQualityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition));
// qualityListMap.keySet().forEach(key -> {
// List<TrunklineCarsLoadLinePhotoEntity> list = unloadQualityListMap.get(key);
// if(NumberUtil.equals(1,key)){//后
// unloadQualityListQian.addAll(list);
// }else if(NumberUtil.equals(2,key)){//后
// unloadQualityListHou.addAll(list);
// }else if(NumberUtil.equals(3,key)){
// unloadQualityListZuo.addAll(list);
// }else if(NumberUtil.equals(4,key)){
// unloadQualityListYou.addAll(list);
// }
// });
//
// unloadQualityMap.put("unloadQualityListQian",unloadQualityListQian);
// unloadQualityMap.put("unloadQualityListHou",unloadQualityListHou);
// unloadQualityMap.put("unloadQualityListZuo",unloadQualityListZuo);
// unloadQualityMap.put("unloadQualityListYou",unloadQualityListYou);
// Map<String,Object> protectionMap = new HashMap<>();
List<TrunklineCarsLoadLinePhotoEntity> protectionList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(31)).collect(Collectors.toList());
// protectionMap.put("protectionList",protectionList); loadLineEntityList.forEach(loadLineEntity -> {
Long loadLineId = loadLineEntity.getId();
// Map<String,Object> unloadObject = new HashMap<>(); Map<String,Object> map = new HashMap<>();
// unloadObject.put("unloadQualityList",unloadQualityList);
// unloadObject.put("protectionList",protectionList);
map.put("carsLoadLineEntity",loadLineEntity);
map.put("unloadObject",unloadQualityList.addAll(protectionList)); List<TrunklineCarsLoadLinePhotoEntity> trunklineCarsLoadLinePhotoEntities = linePhotoMap.get(loadLineId);
if(CollUtil.isNotEmpty(trunklineCarsLoadLinePhotoEntities)){
List<TrunklineCarsLoadLinePhotoEntity> ls = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(10)).collect(Collectors.toList());
map.put("loadingObject",ls);
List<TrunklineCarsLoadLinePhotoEntity> qualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(20)).collect(Collectors.toList());
List<TrunklineCarsLoadLinePhotoEntity> yubuList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(21)).collect(Collectors.toList());
qualityList.addAll(yubuList);
map.put("startObject",qualityList);
List<TrunklineCarsLoadLinePhotoEntity> unloadQualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(30)).collect(Collectors.toList());
List<TrunklineCarsLoadLinePhotoEntity> protectionList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(31)).collect(Collectors.toList());
unloadQualityList.addAll(protectionList);
map.put("unloadObject",unloadQualityList);
}
resultList.add(map); resultList.add(map);
}); });
}
}
return R.data(resultList); return R.data(resultList);
} }
@ -3560,6 +3439,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// return R.fail(405, "当前节点还未上传装车前照片"); // return R.fail(405, "当前节点还未上传装车前照片");
// } // }
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineLoadingPhoto = warehouseConfig.getIsTrunklineLoadingPhoto();
if(NumberUtil.equals(isTrunklineLoadingPhoto,1)){
//限制装车之前上传图片
Integer isLoadingPhoto = carsLoadLineEntity.getIsLoadingPhoto();
if(NumberUtil.equals(isLoadingPhoto,0)){
log.warn("##############loadingScan: 当前节点还未上传装车前照片 isLoadingPhoto={}", isLoadingPhoto);
return R.fail(405, "当前节点还未上传装车前照片");
}
}
}
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId); BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if (Objects.isNull(basicdataWarehouseEntity)) { if (Objects.isNull(basicdataWarehouseEntity)) {
log.warn("##################loadingScan: 仓库信息不存在 warehouseId={}", warehouseId); log.warn("##################loadingScan: 仓库信息不存在 warehouseId={}", warehouseId);
@ -3942,6 +3834,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// return R.fail(405, "当前节点还未上传装车前照片"); // return R.fail(405, "当前节点还未上传装车前照片");
// } // }
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineLoadingPhoto = warehouseConfig.getIsTrunklineLoadingPhoto();
if(NumberUtil.equals(isTrunklineLoadingPhoto,1)){
//限制装车之前上传图片
Integer isLoadingPhoto = carsLoadLineEntity.getIsLoadingPhoto();
if(NumberUtil.equals(isLoadingPhoto,0)){
log.warn("##############loadingZero: 当前节点还未上传装车前照片 isLoadingPhoto={}", isLoadingPhoto);
return R.fail(405, "当前节点还未上传装车前照片");
}
}
}
Long trayId = null; Long trayId = null;
String trayName = null; String trayName = null;
if (!StringUtil.isBlank(trayCode)) { if (!StringUtil.isBlank(trayCode)) {
@ -4304,6 +4209,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
page.setCurrent(loadCarsDTO.getPageNum()); page.setCurrent(loadCarsDTO.getPageNum());
page.setSize(loadCarsDTO.getPageSize()); page.setSize(loadCarsDTO.getPageSize());
Integer type = loadCarsDTO.getType(); Integer type = loadCarsDTO.getType();
Long warehouseId = loadCarsDTO.getWarehouseId();
Date start = CommonUtil.getStartByDateStr(loadCarsDTO.getStartDate()); Date start = CommonUtil.getStartByDateStr(loadCarsDTO.getStartDate());
Date end = CommonUtil.getEndByDateStr(loadCarsDTO.getEndDate()); Date end = CommonUtil.getEndByDateStr(loadCarsDTO.getEndDate());
@ -4312,6 +4218,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
IPage<TrunklineCarsLoadVO> pageList = baseMapper.carsLoadPageList(page, loadCarsDTO); IPage<TrunklineCarsLoadVO> pageList = baseMapper.carsLoadPageList(page, loadCarsDTO);
List<TrunklineCarsLoadVO> records = pageList.getRecords(); List<TrunklineCarsLoadVO> records = pageList.getRecords();
//把records中所有元素的id放入一个List
List<Long> idList = records.stream().map(TrunklineCarsLoadVO::getId).collect(Collectors.toList());
List<TrunklineCarsLoadLinePhotoEntity> carsLoadLinePhotoEntities = carsLoadLinePhotoService.findListByLoadIdListAndWarehouseId(idList,warehouseId);
Map<Long, List<TrunklineCarsLoadLinePhotoEntity>> map = new HashMap<>();
if(CollUtil.isNotEmpty(carsLoadLinePhotoEntities)){
//把carsLoadLinePhotoEntities中所有元素通过loadId进行分组
map = carsLoadLinePhotoEntities.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadId));
}
//循环records,获取字典值 //循环records,获取字典值
for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) { for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) {
String loadStatus = trunklineCarsLoadVO.getLoadStatus(); String loadStatus = trunklineCarsLoadVO.getLoadStatus();
@ -4321,6 +4236,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer stockCarsNum = trunklineCarsLoadVO.getStockNumber(); Integer stockCarsNum = trunklineCarsLoadVO.getStockNumber();
trunklineCarsLoadVO.setRealLoadingNumber(stockCarsNum); trunklineCarsLoadVO.setRealLoadingNumber(stockCarsNum);
trunklineCarsLoadVO.setLoadStatus(value); trunklineCarsLoadVO.setLoadStatus(value);
List<TrunklineCarsLoadLinePhotoEntity> trunklineCarsLoadLinePhotoEntities = map.get(trunklineCarsLoadVO.getId());
trunklineCarsLoadVO.setCarsLoadLinePhotoEntities(trunklineCarsLoadLinePhotoEntities);
} }
pageList.setRecords(records); pageList.setRecords(records);
return R.data(pageList); return R.data(pageList);
@ -7405,6 +7323,21 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "当前网点已经卸车确认"); return R.fail(405, "当前网点已经卸车确认");
} }
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineUnloadPhoto = warehouseConfig.getIsTrunklineUnloadPhoto();
if(NumberUtil.equals(isTrunklineUnloadPhoto,1)){
//限制装车之前上传图片
Integer isUnloadPhoto = loadLineEntity.getIsUnloadPhoto();
if(NumberUtil.equals(isUnloadPhoto,0)){
log.warn("##############batchUnload: 节点还未上传卸车前图片 isUnloadPhoto={}", isUnloadPhoto);
return R.fail(405, "节点还未上传卸车前图片");
}
}
}
// Long nowWarehouseId = carsLoadEntity.getNowWarehouseId(); // Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();
// if (!warehouseId.equals(nowWarehouseId)) { // if (!warehouseId.equals(nowWarehouseId)) {
// log.warn("############batchUnload: 当前节点还未到车 loadId={} warehouseId={}", loadId, warehouseId); // log.warn("############batchUnload: 当前节点还未到车 loadId={} warehouseId={}", loadId, warehouseId);
@ -9069,12 +9002,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "配载计划节点信息不存在"); return R.fail(405, "配载计划节点信息不存在");
} }
//限制装车之前上传图片 WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
// Integer isLoadingPhoto = loadLineEntity.getIsLoadingPhoto(); if(!Objects.isNull(warehouseConfig)){
// if(NumberUtil.equals(isLoadingPhoto,0)){ Integer isTrunklineLoadingPhoto = warehouseConfig.getIsTrunklineLoadingPhoto();
// log.warn("##############manualLoading: 当前节点还未上传装车前照片 isLoadingPhoto={}", isLoadingPhoto); if(NumberUtil.equals(isTrunklineLoadingPhoto,1)){
// return R.fail(405, "当前节点还未上传装车前照片"); //限制装车之前上传图片
// } Integer isLoadingPhoto = loadLineEntity.getIsLoadingPhoto();
if(NumberUtil.equals(isLoadingPhoto,0)){
log.warn("##############manualLoading: 当前节点还未上传装车前照片 isLoadingPhoto={}", isLoadingPhoto);
return R.fail(405, "当前节点还未上传装车前照片");
}
}
}
String tenantId = AuthUtil.getTenantId(); String tenantId = AuthUtil.getTenantId();
Long userId = AuthUtil.getUserId(); Long userId = AuthUtil.getUserId();
@ -10609,6 +10548,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// return R.fail(405, "当前节点还未上传装车前照片"); // return R.fail(405, "当前节点还未上传装车前照片");
// } // }
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineLoadingPhoto = warehouseConfig.getIsTrunklineLoadingPhoto();
if(NumberUtil.equals(isTrunklineLoadingPhoto,1)){
//限制装车之前上传图片
Integer isLoadingPhoto = carsLoadLineEntity.getIsLoadingPhoto();
if(NumberUtil.equals(isLoadingPhoto,0)){
log.warn("##############loadingTray: 当前节点还未上传装车前照片 isLoadingPhoto={}", isLoadingPhoto);
return R.fail(405, "当前节点还未上传装车前照片");
}
}
}
Integer pacakagNum = 0; Integer pacakagNum = 0;
Integer zeroNum = 0; Integer zeroNum = 0;
@ -11308,6 +11260,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
IPage<TrunklineCarsLoadVO> pageList = baseMapper.arriveUnloadPageList(page, loadCarsDTO); IPage<TrunklineCarsLoadVO> pageList = baseMapper.arriveUnloadPageList(page, loadCarsDTO);
List<TrunklineCarsLoadVO> records = pageList.getRecords(); List<TrunklineCarsLoadVO> records = pageList.getRecords();
//把records中所有元素的id放入一个List
List<Long> idList = records.stream().map(TrunklineCarsLoadVO::getId).collect(Collectors.toList());
List<TrunklineCarsLoadLinePhotoEntity> carsLoadLinePhotoEntities = carsLoadLinePhotoService.findListByLoadIdListAndWarehouseId(idList,warehouseId);
Map<Long, List<TrunklineCarsLoadLinePhotoEntity>> map = new HashMap<>();
if(CollUtil.isNotEmpty(carsLoadLinePhotoEntities)){
//把carsLoadLinePhotoEntities中所有元素通过loadId进行分组
map = carsLoadLinePhotoEntities.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadId));
}
for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) { for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) {
Long loadId = trunklineCarsLoadVO.getId(); Long loadId = trunklineCarsLoadVO.getId();
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId); TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
@ -11338,6 +11299,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer stockCarNumber = trunklineCarsLoadVO.getStockNumber(); Integer stockCarNumber = trunklineCarsLoadVO.getStockNumber();
trunklineCarsLoadVO.setRealLoadingNumber(stockCarNumber); trunklineCarsLoadVO.setRealLoadingNumber(stockCarNumber);
trunklineCarsLoadVO.setTotalLoadingNum(realLoadingNumber); trunklineCarsLoadVO.setTotalLoadingNum(realLoadingNumber);
List<TrunklineCarsLoadLinePhotoEntity> trunklineCarsLoadLinePhotoEntities = map.get(loadId);
trunklineCarsLoadVO.setCarsLoadLinePhotoEntities(trunklineCarsLoadLinePhotoEntities);
} }
pageList.setRecords(records); pageList.setRecords(records);
return R.data(pageList); return R.data(pageList);
@ -11510,6 +11474,21 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.warn("############unloadPackage: 配载计划节点信息不存在 loadId={} warehouseId={}", loadId, warehouseId); log.warn("############unloadPackage: 配载计划节点信息不存在 loadId={} warehouseId={}", loadId, warehouseId);
return R.fail(405, "配载计划节点信息不存在"); return R.fail(405, "配载计划节点信息不存在");
} }
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineUnloadPhoto = warehouseConfig.getIsTrunklineUnloadPhoto();
if(NumberUtil.equals(isTrunklineUnloadPhoto,1)){
//限制装车之前上传图片
Integer isUnloadPhoto = carsLoadLineEntity.getIsUnloadPhoto();
if(NumberUtil.equals(isUnloadPhoto,0)){
log.warn("##############unloadPackage: 节点还未上传卸车前图片 isUnloadPhoto={}", isUnloadPhoto);
return R.fail(405, "节点还未上传卸车前图片");
}
}
}
String unloadStatus = carsLoadLineEntity.getUnloadStatus(); String unloadStatus = carsLoadLineEntity.getUnloadStatus();
Integer unloadNumber = carsLoadLineEntity.getUnloadNumber(); Integer unloadNumber = carsLoadLineEntity.getUnloadNumber();
if (!"0".equals(unloadStatus)) { if (!"0".equals(unloadStatus)) {

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

@ -83,6 +83,37 @@ public class WarehouseTrayTypeApiController {
} }
} }
@ResponseBody
@PostMapping("/createTray")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "创建托盘", notes = "传入trayTypeDTO")
public R createTray(@RequestBody TrayTypeDTO trayTypeDTO) {
String method = "###########orderScanTrayCode: ";
log.info(method+"订单扫码托盘 trayTypeDTO={}",trayTypeDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
BasicdataTrayEntity trayEntity = warehouseTrayTypeService.createTray(myCurrentWarehouse.getId(),myCurrentWarehouse.getWarehouseCode());
return R.data(trayEntity);
}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,"系统异常,联系管理员");
}
}
/** /**
* 公用的扫托盘方法 * 公用的扫托盘方法
* @param trayTypeDTO * @param trayTypeDTO

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java

@ -2,6 +2,7 @@ package com.logpm.warehouse.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.warehouse.dto.DownPackageCodeDTO; import com.logpm.warehouse.dto.DownPackageCodeDTO;
import com.logpm.warehouse.dto.NoDataStockListDTO; import com.logpm.warehouse.dto.NoDataStockListDTO;
@ -125,4 +126,6 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
R findPackageTrayInfo(String orderPackageCode, Long warehouseId); R findPackageTrayInfo(String orderPackageCode, Long warehouseId);
R downPackageCodes(List<DownPackageCodeDTO> downPackageCodeDTOS, Long warehouseId); R downPackageCodes(List<DownPackageCodeDTO> downPackageCodeDTOS, Long warehouseId);
BasicdataTrayEntity createTray(Long warehouseId, String warehouseCode);
} }

26
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -39,10 +39,7 @@ import com.logpm.warehouse.service.*;
import com.logpm.warehouse.vo.*; import com.logpm.warehouse.vo.*;
import com.logpm.warehouse.wrapper.WarehouseTrayTypeWrapper; import com.logpm.warehouse.wrapper.WarehouseTrayTypeWrapper;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.*;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.apiwarehouse.PalletProductTypeConstant; import org.springblade.common.constant.apiwarehouse.PalletProductTypeConstant;
import org.springblade.common.constant.broadcast.FanoutConstants; import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.order.OrderFreezeStatusConstant; import org.springblade.common.constant.order.OrderFreezeStatusConstant;
@ -141,6 +138,8 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
private IWarehousePackageTrackLogService warehousePackageTrackLogService; private IWarehousePackageTrackLogService warehousePackageTrackLogService;
@Autowired @Autowired
private IBasicdataBrandClient basicdataBrandClient; private IBasicdataBrandClient basicdataBrandClient;
@Autowired
private IBasicdataCodeClient iBasicdataCodeClient;
@Override @Override
@ -1040,6 +1039,25 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
return R.success("解绑成功"); return R.success("解绑成功");
} }
@Override
public BasicdataTrayEntity createTray(Long warehouseId, String warehouseCode) {
BasicdataTrayEntity basicdataTrayEntity = new BasicdataTrayEntity();
String trayInfo = iBasicdataCodeClient.getCodeByType(CodeNumConstant.TRAYS,warehouseCode,"465897");
String[] split = trayInfo.split("&&");
basicdataTrayEntity.setReserve1("1");
basicdataTrayEntity.setPalletCode(split[0]);
basicdataTrayEntity.setPalletName(split[1]);
basicdataTrayEntity.setWarehouseId(warehouseId);
basicdataTrayEntity.setTrayStatus("1");
basicdataTrayEntity.setType(1);
Long newTrayId = basicdataTrayClient.addTray(basicdataTrayEntity);
basicdataTrayEntity.setId(newTrayId);
return basicdataTrayEntity;
}
@Override @Override
public R orderScanOrderPackageCodeSyncJd(Long trayId,String trayType, String trayCode,String trayName, String orderPackageCode, Long warehouseId) { public R orderScanOrderPackageCodeSyncJd(Long trayId,String trayType, String trayCode,String trayName, String orderPackageCode, Long warehouseId) {

Loading…
Cancel
Save