Browse Source

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java
fix-sign
pref_mail@163.com 4 months ago
parent
commit
45974088a3
  1. 4
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/config/XxlJobConfig.java
  2. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java
  3. 18
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesOvertimeFineMapper.xml
  4. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  5. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  6. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java
  7. 293
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

4
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/config/XxlJobConfig.java

@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration;
*
* @author xuxueli 2017-04-28
*/
//@Configuration(proxyBeanMethods = false)
@Configuration(proxyBeanMethods = false)
public class XxlJobConfig {
private final Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
@ -38,7 +38,7 @@ public class XxlJobConfig {
private int logRetentionDays;
// @Bean
@Bean
public XxlJobSpringExecutor xxlJobExecutor() {
logger.info(">>>>>>>>>>> xxl-job config init.");
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java

@ -17,6 +17,7 @@ import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.secure.BladeUser;
@ -37,6 +38,7 @@ import java.util.*;
*/
@AllArgsConstructor
@Component
@Slf4j
public class AftersalesXxlJob {
private static final Logger logger = LoggerFactory.getLogger(AftersalesXxlJob.class);

18
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesOvertimeFineMapper.xml

@ -25,10 +25,20 @@
<result column="remarks" property="remarks"/>
</resultMap>
<select id="pageListOwn" resultType="com.logpm.aftersales.vo.AftersalesOvertimeFineVO" >
select laof.id,lawo.work_order_number workOrderNumber,lawo.work_order_type workOrderType,lawo.discovery_node discoveryNode,COUNT(laof.id) ,laof.create_time createTime,
laof.timeout,laof.money,laof.business_name businessName,lawo.id workOrderId
from logpm_aftersales_overtime_fine laof
LEFT JOIN logpm_aftersales_work_order lawo on lawo.id = laof.work_order_id
SELECT
laof.id,
lawo.work_order_number workOrderNumber,
lawo.work_order_type workOrderType,
lawo.discovery_node discoveryNode,
COUNT( laof.id ),
laof.create_time createTime,
laof.timeout,
laof.money,
laof.business_name businessName,
lawo.id workOrderId
FROM
logpm_aftersales_overtime_fine laof
LEFT JOIN logpm_aftersales_work_order lawo ON lawo.id = laof.work_order_id
<where>
<if test=" param.id != null and param.id != ''">and laof.id = #{param.id }</if>
<if test="param.workOrderNumber != null and param.workOrderNumber != ''">and lawo.work_order_number LIKE '%${param.workOrderNumber}%'</if>

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -888,7 +888,10 @@
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldrs.parce_list_id = ldpl.id
LEFT JOIN logpm_distribution_stock_article As ldsa ON ldpl.stock_article_id = ldsa.id
WHERE
ldrs.packet_bar_status IN ('1','3') and reservation_id = #{reservationId} AND ldpl.conditions = 1 AND ldpl.is_transfer = 0
ldrs.packet_bar_status IN ('1','3')
AND reservation_id = #{reservationId}
AND ldpl.conditions = 1
AND ldpl.is_transfer = 0
</select>
<select id="getReservationNumStockSelf" resultType="Integer">
select IFNULL(SUM(lddd.quantity),0)

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml

@ -1461,9 +1461,8 @@
LEFT JOIN logpm_distribution_loadscan AS ldl ON ldl.package_id = ldpl.id AND ldl.is_abnormal_loading = 1 AND
ldl.scan_status != 1 AND ldl.reservation_id = ldr.id
WHERE
ldrp.packet_bar_status != 2
ldr.is_deleted = 0
AND ldr.id = #{reservationId}
AND ldr.is_deleted = 0
AND ldr.reservation_status != 40
UNION
SELECT

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java

@ -99,14 +99,6 @@ public class AdvanceDetailController {
return R.fail(405,"请选择删除的包件");
}
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// if(Objects.isNull(myCurrentWarehouse)){
// log.warn(method+"请选择仓库");
// return R.fail(405,"请选择仓库");
// }
// advanceDetailDTO.setWarehouseId(myCurrentWarehouse.getId());
// advanceDetailDTO.setWarehouseName(myCurrentWarehouse.getName());
return advanceDetailService.deleteAdvanceDetail(advanceDetailDTO);
}catch (CustomerException e){
log.error(e.message,e);

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

@ -10356,38 +10356,170 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String trayCode = trunklineCarsLoadScan.getTrayCode();
String waybillNo = trunklineCarsLoadScan.getWaybillNo();
String orderCode = trunklineCarsLoadScan.getOrderCode();
if(type==1){
//包件
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(scanCode, warehouseId);
if(Objects.isNull(parcelListEntity)){
log.info("#########adnormalHasStock: 包件信息不存在");
Integer unbingTray = 0;
if(StringUtil.isNotBlank(trayCode)){
unbingTray = 1;
}
unloadPackageNoXz(loadId,scanCode,warehouseId,unbingTray,IncomingTypeEnum.ABNORMAL_INCOMING.getValue(),IncomingTypeEnum.ABNORMAL_INCOMING.getCode(),null,null);
}else{
String orderPackageStatus = parcelListEntity.getOrderPackageStatus();
if("20".equals(orderPackageStatus)){
log.warn("#########adnormalHasStock: 包件已入库 scanCode={} warehouseId={}",scanCode,warehouseId);
return R.success("包件已入库");
String loadCode = trunklineCarsLoadScan.getLoadCode();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("###############adnormalHasStock: 仓库信息不存在");
return R.fail(405, "仓库信息不存在");
}
String warehouseName = warehouseEntity.getName();
List<TrunklineCarsLoadScanEntity> carsLoadScanEntities = new ArrayList<>();
carsLoadScanEntities.add(trunklineCarsLoadScan);
//把carsLoadScanEntities中所有元素的scanCode放入一个Set集合
Set<String> scanCodeSet = carsLoadScanEntities.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toSet());
log.info("###############adnormalHasStock: 当前同步的数据 {}",scanCodeSet);
List<String> scanCodeList = new ArrayList<>(scanCodeSet);
List<TrunklineAdvanceDetailEntity> allAdvanceDetailList = new ArrayList<>();
int packageBatchSize = 500;
List<List<String>> orderPackageCodeGroups = new ArrayList<>();
for (int i = 0; i < scanCodeList.size(); i += packageBatchSize) {
int endIndex = Math.min(i + packageBatchSize, scanCodeList.size());
orderPackageCodeGroups.add(scanCodeList.subList(i, endIndex));
}
orderPackageCodeGroups.forEach(orderPackageCodeGroup -> {
List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = trunklineAdvanceDetailService.findListByOrderPackageCodeList(orderPackageCodeGroup);
allAdvanceDetailList.addAll(advanceDetailEntityList);
});
//把allAdvanceDetailList转化成orderPackageCode为key的Map
Map<String, TrunklineAdvanceDetailEntity> advanceDetailMap = allAdvanceDetailList.stream().collect(Collectors.toMap(TrunklineAdvanceDetailEntity::getOrderPackageCode, Function.identity()));
List<TrunklineCarsLoadScanEntity> updateScanList = new ArrayList<>();
List<TrunklineAdvanceDetailEntity> incomingAdvanceDetailList = new ArrayList<>();
List<TrunklineAdvanceDetailEntity> udateAdvanceDetailList = new ArrayList<>();
Set<String> orderPackageCodeSet = new HashSet<>();
carsLoadScanEntities.forEach(carsLoadScanEntity -> {
String orderPackageCode = carsLoadScanEntity.getScanCode();
TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = advanceDetailMap.get(orderPackageCode);
if(!Objects.isNull(trunklineAdvanceDetailEntity)){
orderPackageCodeSet.add(orderPackageCode);
TrunklineCarsLoadScanEntity updateScanEntity = new TrunklineCarsLoadScanEntity();
updateScanEntity.setId(carsLoadScanEntity.getId());
String packageStatus = trunklineAdvanceDetailEntity.getPackageStatus();
if(packageStatus.equals("0")){
updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getWarehouseId());
incomingAdvanceDetailList.add(trunklineAdvanceDetailEntity);
}else{
Integer unbingTray = 0;
if(StringUtil.isNotBlank(trayCode)){
unbingTray = 1;
}
unloadPackageNoXz(loadId,scanCode,warehouseId,unbingTray,IncomingTypeEnum.ABNORMAL_INCOMING.getValue(),IncomingTypeEnum.ABNORMAL_INCOMING.getCode(),null,null);
updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getNowWarehouseId());
udateAdvanceDetailList.add(trunklineAdvanceDetailEntity);
}
updateScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode());
updateScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId());
updateScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo());
updateScanEntity.setIsData(1);
updateScanList.add(updateScanEntity);
}
}else{
Integer unbingTray = 0;
if(StringUtil.isNotBlank(trayCode)){
unbingTray = 1;
});
if(CollUtil.isNotEmpty(incomingAdvanceDetailList)){
for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : incomingAdvanceDetailList) {
InComingDTO inComingDTO = new InComingDTO();
inComingDTO.setOrderPackageCode(trunklineAdvanceDetailEntity.getOrderPackageCode());
inComingDTO.setIncomingType(IncomingTypeEnum.SYNC_INCOMING.getCode());
inComingDTO.setWarehouseId(warehouseId);
R r = inComingService.incomingPackage(inComingDTO);
if(r.getCode() != 200){
throw new CustomerException(405,"入库失败");
}
}
//零担
unloadZeroNoXz(loadId,waybillNo,num,warehouseId,unbingTray,trayCode,orderCode,"异常列表入库");
}
if(CollUtil.isNotEmpty(udateAdvanceDetailList)){
List<DistributionParcelListEntity> updateParceList = new ArrayList<>();
udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> {
String orderPackageCode = trunklineAdvanceDetailEntity.getOrderPackageCode();
List<DistributionParcelListEntity> list = distributionParcelListClient.findListByOrderPackageCodeAndStatus(orderPackageCode,"20");
//把list通过warehouseId进行分组
if(CollUtil.isNotEmpty(list)){
list.forEach(distributionParcelListEntity -> {
DistributionParcelListEntity updateEntity = new DistributionParcelListEntity();
updateEntity.setId(distributionParcelListEntity.getId());
updateEntity.setOrderPackageStatus("60");
updateEntity.setOrderCode(distributionParcelListEntity.getOrderCode());
updateEntity.setWarehouseId(distributionParcelListEntity.getWarehouseId());
updateParceList.add(updateEntity);
});
}
});
distributionParcelListClient.updateList(updateParceList);
advanceService.saveOrderAndPackages(udateAdvanceDetailList, warehouseId);
List<TrunklineAdvanceDetailEntity> updateNowWarehouseList = new ArrayList<>();
udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> {
TrunklineAdvanceDetailEntity updateEntity = new TrunklineAdvanceDetailEntity();
updateEntity.setId(trunklineAdvanceDetailEntity.getId());
updateEntity.setNowWarehouseId(warehouseId);
updateEntity.setNowWarehouseName(warehouseName);
updateNowWarehouseList.add(updateEntity);
});
trunklineAdvanceDetailService.updateBatchById(updateNowWarehouseList);
}
trunklineCarsLoadScanService.updateBatchById(updateScanList);
int i= 0;
//完结所有包件异常列表
if(CollUtil.isNotEmpty(orderPackageCodeSet)){
i = orderPackageCodeSet.size();
DealWithAbnormalVO dealWithAbnormalVO = new DealWithAbnormalVO();
dealWithAbnormalVO.setOrderPackageCodes(new ArrayList<>(orderPackageCodeSet));
dealWithAbnormalVO.setCarsNo(loadCode);
dealWithAbnormalVO.setWarehouseName(warehouseName);
dealWithAbnormalVO.setNickName(AuthUtil.getNickName());
dealWithAbnormalVO.setRemark("数据同步系统自动处理("+warehouseName+" "+loadCode+" "+AuthUtil.getNickName()+")");
abnormalRecordClient.dealwithOrderPackageCodes(dealWithAbnormalVO);
}
// if(type==1){
// //包件
// DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(scanCode, warehouseId);
// if(Objects.isNull(parcelListEntity)){
// log.info("#########adnormalHasStock: 包件信息不存在");
// Integer unbingTray = 0;
// if(StringUtil.isNotBlank(trayCode)){
// unbingTray = 1;
// }
// unloadPackageNoXz(loadId,scanCode,warehouseId,unbingTray,IncomingTypeEnum.ABNORMAL_INCOMING.getValue(),IncomingTypeEnum.ABNORMAL_INCOMING.getCode(),null,null);
// }else{
// String orderPackageStatus = parcelListEntity.getOrderPackageStatus();
// if("20".equals(orderPackageStatus)){
// log.warn("#########adnormalHasStock: 包件已入库 scanCode={} warehouseId={}",scanCode,warehouseId);
// return R.success("包件已入库");
// }else{
// Integer unbingTray = 0;
// if(StringUtil.isNotBlank(trayCode)){
// unbingTray = 1;
// }
// unloadPackageNoXz(loadId,scanCode,warehouseId,unbingTray,IncomingTypeEnum.ABNORMAL_INCOMING.getValue(),IncomingTypeEnum.ABNORMAL_INCOMING.getCode(),null,null);
// }
// }
// }else{
// Integer unbingTray = 0;
// if(StringUtil.isNotBlank(trayCode)){
// unbingTray = 1;
// }
// //零担
// unloadZeroNoXz(loadId,waybillNo,num,warehouseId,unbingTray,trayCode,orderCode,"异常列表入库");
//
// }
return R.success("入库成功");
}
@ -10624,6 +10756,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
int totalNum = realNum + 1;
if(totalNum > planNum){
carsOrderEntity.setRealNum(totalNum);
}else{
carsOrderEntity.setRealNum(totalNum);
flag = 1;
@ -10632,7 +10765,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
if(flag == 0){
noPlanPackageList.add(orderPackageCode);
log.warn("##################loadingTrayPackageList: 存在不在计划的包件 orderCode={}", orderCode);
throw new CustomerException(405, orderCode+"不在计划中");
// noPlanPackageList.add(orderPackageCode);
}
}
if(CollUtil.isNotEmpty(noPlanPackageList)){
@ -12147,7 +12282,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// }
if (isData == 0) {
return Resp.fail(4005,"系统无编码");
return Resp.scanFail(4005,"系统无编码","系统无编码");
}
return Resp.scanSuccess("卸车成功", audio.toString());
}
@ -12631,6 +12766,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
} else {
String scanStatus = carsLoadScanEntity.getScanStatus();
if(!"1".equals(scanStatus)){
carsLoadScanEntity.setUnloadTrayCode(unloadTrayCode);
carsLoadScanEntity.setUnloadTrayName(unloadTrayName);
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
log.warn("##############unloadPackage: 包件已卸车 orderPackageCode={}", orderPackageCode);
return R.fail(405, "包件已卸车");
}
@ -12656,8 +12794,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setScanStatus("2");
carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
carsLoadScanEntity.setUnloadTime(new Date());
carsLoadScanEntity.setUnloadAbnormal(1);
carsLoadScanEntity.setIsSupple(1);
carsLoadScanEntity.setUnloadTrayCode(unloadTrayCode);
carsLoadScanEntity.setUnloadTrayName(unloadTrayName);
trayCode = carsLoadScanEntity.getTrayCode();
if (!StringUtil.isBlank(trayCode)) {
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
@ -12665,13 +12803,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trayName = trayEntity.getPalletName();
}
if (unbindTray == 1) {
if(StringUtils.isNotBlank(orderPackageCode)){
updownTypeClient.downPackageOrDelTray(orderPackageCode, fromWarehouseId, "干线卸车下架解托");
}
carsLoadAsyncService.downPackageOrDelTray(orderPackageCode, fromWarehouseId, "干线卸车下架解托");
}
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, orderPackageCode, 1,
carsLoadAsyncService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, orderPackageCode, 1,
1, 1, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark);
if (1 == isData) {
@ -12691,6 +12827,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}else{
Long currentOrderId = null;
//查询当前仓库订单信息有没有
Integer totalNum = trunklineAdvanceDetailService.findTotalNumByOrderCode(orderCode);
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if (Objects.isNull(stockArticleEntity)) {
//查询包件前面仓的订单信息
@ -12700,11 +12837,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
stockArticleEntity.setId(null);
stockArticleEntity.setWarehouseId(warehouseId);
stockArticleEntity.setWarehouse(warehouseName);
stockArticleEntity.setTotalNumber(totalNum);
stockArticleEntity.setHandQuantity(0);
stockArticleEntity.setCompleteSet(1);
stockArticleEntity.setStockupStatus("10");
stockArticleEntity.setReservationStatus("10");
stockArticleEntity.setOrderStatus("10");
stockArticleEntity.setOrderStatus("20");
stockArticleEntity.setGroundingStatus("10");
stockArticleEntity.setOrderReceiveStatus("10");
stockArticleEntity.setFreezeStatus("10");
@ -12713,10 +12851,23 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
stockArticleEntity.setTransferQuantity(0);
stockArticleEntity.setSigninQuantity(0);
stockArticleEntity.setIncomingNum(0);
stockArticleEntity.setAllocation(null);
stockArticleEntity.setTrays(null);
currentOrderId = distributionStockArticleClient.addData(stockArticleEntity);
stockArticleEntity.setId(currentOrderId);
} else {
currentOrderId = stockArticleEntity.getId();
String reservationStatus = stockArticleEntity.getReservationStatus();
if("30".equals(reservationStatus)){
stockArticleEntity.setReservationStatus("20");
}
String orderStatus = stockArticleEntity.getOrderStatus();
if("80".equals(orderStatus)){
stockArticleEntity.setOrderStatus("70");
}
stockArticleEntity.setGenre(1);
stockArticleEntity.setTotalNumber(totalNum);
distributionStockArticleClient.updateEntity(stockArticleEntity);
}
//判断包件当前仓是否是目的仓
@ -12731,8 +12882,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if (destinationWarehouseId.equals(warehouseId)) {
distributionParcelListEntity.setIsTransfer(0);
isTransfer = 0;
} else {
distributionParcelListEntity.setIsTransfer(1);
isTransfer = 1;
}
}
distributionParcelListEntity.setWarehouseId(warehouseId);
@ -12754,8 +12907,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if (destinationWarehouseId.equals(warehouseId)) {
distributionParcelListEntity.setIsTransfer(0);
isTransfer = 0;
} else {
distributionParcelListEntity.setIsTransfer(1);
isTransfer = 1;
}
}
distributionParcelListClient.update(distributionParcelListEntity);
@ -12773,6 +12928,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//未入库
InComingDTO inComingDTO = new InComingDTO();
inComingDTO.setOrderPackageCode(orderPackageCode);
inComingDTO.setIncomingType(incomingType);
inComingDTO.setWarehouseId(warehouseId);
inComingService.incomingPackage(inComingDTO);
@ -12790,6 +12946,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newStockArticle.setId(null);
newStockArticle.setWarehouseId(warehouseId);
newStockArticle.setWarehouse(basicdataWarehouseEntity.getName());
newStockArticle.setAllocation(null);
newStockArticle.setTrays(null);
orderId = distributionStockArticleClient.addData(newStockArticle);
} else {
orderId = newStockArticle.getId();
@ -12809,9 +12967,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
carsLoadScanEntity.setUnloadTime(new Date());
carsLoadScanEntity.setIsData(1);
carsLoadScanEntity.setIsSupple(1);
carsLoadScanEntity.setUnloadTrayCode(unloadTrayCode);
carsLoadScanEntity.setUnloadTrayName(unloadTrayName);
isData = 1;
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
}else{
carsLoadScanEntity.setReserve1("1");
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
}
}
}
@ -13778,20 +13943,54 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//查询该节点有没有该托盘的信息
List<TrunklineCarsLoadScanEntity> list = trunklineCarsLoadScanService.findUnloadTrayGoodsList(loadId, warehouseId, trayCode);
Set<String> set = new TreeSet<>();
for (TrunklineCarsLoadScanEntity carsLoadScanEntity : list) {
Integer type = carsLoadScanEntity.getType();
String scanCode = carsLoadScanEntity.getScanCode();
//把list通过type进行分组
Map<Integer, List<TrunklineCarsLoadScanEntity>> map = list.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getType));
map.keySet().forEach(type -> {
List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities = map.get(type);
if (type == 1) {
//包件
unloadPackage(loadId, scanCode, warehouseId, 0, "托盘正常卸车", incomingType,palletName,trayCode);
} else if (type == 2) {
String waybillNo = carsLoadScanEntity.getWaybillNo();
Integer num = carsLoadScanEntity.getNum();
String orderCode = carsLoadScanEntity.getOrderCode();
unloadZeroWithTray(loadId, waybillNo, num, warehouseId, 0, trayCode, orderCode, "托盘零担正常卸车",palletName,trayCode);
//把trunklineCarsLoadScanEntities中所有元素的id放入一个List
List<Long> scanIds = trunklineCarsLoadScanEntities.stream()
.map(TrunklineCarsLoadScanEntity::getId)
.collect(Collectors.toList());
BatchUnloadDTO batchUnloadDTO = new BatchUnloadDTO();
batchUnloadDTO.setWarehouseId(warehouseId);
batchUnloadDTO.setLoadId(loadId);
batchUnloadDTO.setIncomingType(incomingType);
List<UnloadPackageDTO> unloadPackageList = new ArrayList<>();
trunklineCarsLoadScanEntities.forEach(carsLoadScanEntity -> {
UnloadPackageDTO unloadPackageDTO = new UnloadPackageDTO();
unloadPackageDTO.setCarsLoadScanId(carsLoadScanEntity.getId());
unloadPackageList.add(unloadPackageDTO);
});
batchUnloadDTO.setUnloadPackageList(unloadPackageList);
List<UnloadZeroDTO> unloadZeroList = new ArrayList<>();
batchUnloadDTO.setUnloadZeroList(unloadZeroList);
batchUnload(batchUnloadDTO);
}else{
trunklineCarsLoadScanEntities.forEach(carsLoadScanEntity -> {
String waybillNo = carsLoadScanEntity.getWaybillNo();
Integer num = carsLoadScanEntity.getNum();
String orderCode = carsLoadScanEntity.getOrderCode();
unloadZeroWithTray(loadId, waybillNo, num, warehouseId, 0, trayCode, orderCode, "托盘零担正常卸车",palletName,trayCode);
});
}
}
});
// for (TrunklineCarsLoadScanEntity carsLoadScanEntity : list) {
// Integer type = carsLoadScanEntity.getType();
// String scanCode = carsLoadScanEntity.getScanCode();
// if (type == 1) {
// //包件
// unloadPackage(loadId, scanCode, warehouseId, 0, "托盘正常卸车", incomingType,palletName,trayCode);
// } else if (type == 2) {
// String waybillNo = carsLoadScanEntity.getWaybillNo();
// Integer num = carsLoadScanEntity.getNum();
// String orderCode = carsLoadScanEntity.getOrderCode();
// unloadZeroWithTray(loadId, waybillNo, num, warehouseId, 0, trayCode, orderCode, "托盘零担正常卸车",palletName,trayCode);
// }
// }
//处理托盘的入库和货物的入库
trayTypeClient.changeTrayWarehouseInfo(trayCode, warehouseId);

Loading…
Cancel
Save