|
|
|
@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataTrayEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataCodeClient; |
|
|
|
@ -1144,6 +1143,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
// loadCarsDTO.setOrderCodes(orderCodes);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
String openTimeStartStr = loadCarsDTO.getOpenTimeStartStr(); |
|
|
|
|
String openTimeEndStr = loadCarsDTO.getOpenTimeEndStr(); |
|
|
|
|
loadCarsDTO.setOpenTimeStart(CommonUtil.getStartByDateStr(openTimeStartStr)); |
|
|
|
|
loadCarsDTO.setOpenTimeEnd(CommonUtil.getEndByDateStr(openTimeEndStr)); |
|
|
|
|
|
|
|
|
|
String enterTimeStartStr = loadCarsDTO.getEnterTimeStartStr(); |
|
|
|
|
String enterTimeEndStr = loadCarsDTO.getEnterTimeEndStr(); |
|
|
|
|
loadCarsDTO.setEnterTimeStart(CommonUtil.getStartByDateStr(enterTimeStartStr)); |
|
|
|
|
loadCarsDTO.setEnterTimeEnd(CommonUtil.getStartByDateStr(enterTimeEndStr)); |
|
|
|
|
|
|
|
|
|
IPage<CarsLoadAllOrderVO> pageList = baseMapper.findAllOrderList(page,loadCarsDTO); |
|
|
|
|
return R.data(pageList); |
|
|
|
|
} |
|
|
|
@ -1622,7 +1631,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R loadingScan(Long loadId,Long warehouseId,String orderPackageCode,String trayCode) { |
|
|
|
|
public R loadingScan(Long loadId,Long warehouseId,String orderPackageCode,String trayCode,String remark) { |
|
|
|
|
log.info("#################loadingScan: 装车扫描"); |
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); |
|
|
|
@ -1667,7 +1676,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
String trayName = null; |
|
|
|
|
Long fromWarehouseId = null; |
|
|
|
|
Long loadScanId = null; |
|
|
|
|
String remark = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断包条码是不是在库
|
|
|
|
@ -2375,6 +2383,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Integer enterNum = loadCarsDTO.getEnterNum(); |
|
|
|
|
Long warehouseId = loadCarsDTO.getWarehouseId(); |
|
|
|
|
|
|
|
|
|
String orders = null; |
|
|
|
|
if(0 == isZero){ |
|
|
|
|
unloadPackage(loadId,orderPackageCode,warehouseId,1,"卸分一体 卸车"); |
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
@ -2387,6 +2396,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
log.warn("##########findNextNodeList: 打托失败 trayCode={} orderPackageCode={}",trayCode,orderPackageCode); |
|
|
|
|
return R.fail(405,"打托失败"); |
|
|
|
|
} |
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId); |
|
|
|
|
orders = parcelListEntity.getOrderCode(); |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
unloadZero(loadId,waybillNo,enterNum,warehouseId,1,null,orderCode,"卸分一体 卸车"); |
|
|
|
@ -2402,9 +2414,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
log.warn("##########findNextNodeList: 打托失败 trayCode={} orderCode={}",trayCode,orderCode); |
|
|
|
|
return R.fail(405,"打托失败"); |
|
|
|
|
} |
|
|
|
|
orders = orderCode; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return R.success("打托成功"); |
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("orders",orders); |
|
|
|
|
return R.data(map); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -3218,6 +3234,63 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
return R.success("更新成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R manualLoading(LoadCarsDTO loadCarsDTO, String remark) { |
|
|
|
|
Long loadId = loadCarsDTO.getLoadId(); |
|
|
|
|
Long warehouseId = loadCarsDTO.getWarehouseId(); |
|
|
|
|
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); |
|
|
|
|
if(Objects.isNull(carsLoadEntity)){ |
|
|
|
|
log.warn("##############manualLoading: 配载计划不存在 loadId={}",loadId); |
|
|
|
|
return R.fail(405,"配载计划不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId); |
|
|
|
|
if(Objects.isNull(warehouseEntity)){ |
|
|
|
|
log.warn("##############manualLoading: 仓库信息不存在 warehouseId={}",warehouseId); |
|
|
|
|
return R.fail(405,"仓库信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Long nowWarehouseId = carsLoadEntity.getNowWarehouseId(); |
|
|
|
|
if(!nowWarehouseId.equals(warehouseId)){ |
|
|
|
|
log.warn("##############manualLoading: 车辆不在当前仓 warehouseId={}",warehouseId); |
|
|
|
|
return R.fail(405,"车辆不在当前仓"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询有哪些在当前仓做计划的订单
|
|
|
|
|
List<TrunklineCarsOrderEntity> carsOrderEntityList = trunklineCarsOrderService.findListByLoadIdAndNodeId(loadId, warehouseId); |
|
|
|
|
for (TrunklineCarsOrderEntity carsOrderEntity : carsOrderEntityList) { |
|
|
|
|
Integer type = carsOrderEntity.getType(); |
|
|
|
|
if(type.equals(1)){ |
|
|
|
|
//订制品订单
|
|
|
|
|
String orderCode = carsOrderEntity.getOrderCode(); |
|
|
|
|
Integer planNum = carsOrderEntity.getPlanNum(); |
|
|
|
|
List<DistributionParcelListEntity> entityListByOrderCode = distributionParcelListClient.findEntityListByOrderCodeAndStatus(orderCode, warehouseId,"20"); |
|
|
|
|
int size = entityListByOrderCode.size(); |
|
|
|
|
if(planNum.equals(size)){ |
|
|
|
|
for (DistributionParcelListEntity parcelListEntity : entityListByOrderCode) { |
|
|
|
|
String orderPackageCode = parcelListEntity.getOrderPackageCode(); |
|
|
|
|
//查询包件是否已经装车
|
|
|
|
|
TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.findEntityByLoadIdAndOrderPackageCode(loadId, orderPackageCode); |
|
|
|
|
if(Objects.isNull(carsLoadScanEntity)){ |
|
|
|
|
loadingScan(loadId,warehouseId,orderPackageCode,null,"手动一键装车"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else if(type.equals(2)){ |
|
|
|
|
//零担订单
|
|
|
|
|
String orderCode = carsOrderEntity.getOrderCode(); |
|
|
|
|
String waybillNo = carsOrderEntity.getWaybillNo(); |
|
|
|
|
Integer planNum = carsOrderEntity.getPlanNum(); |
|
|
|
|
Integer realNum = carsOrderEntity.getRealNum(); |
|
|
|
|
if(realNum.equals(0)){ |
|
|
|
|
loadingZero(loadId,warehouseId,waybillNo,orderCode,null,planNum,"手动一键装车"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return R.success("装车完成"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R loadingTrayInfo(LoadCarsDTO loadCarsDTO) { |
|
|
|
|
log.info("##############loadingTrayInfo: 查询托盘的货物信息"); |
|
|
|
@ -3295,7 +3368,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Integer zeroNum = 0; |
|
|
|
|
for (LoadingPackageDTO loadingPackageDTO : packageList) { |
|
|
|
|
String orderPackageCode = loadingPackageDTO.getOrderPackageCode(); |
|
|
|
|
loadingScan(loadId,warehouseId,orderPackageCode,trayCode); |
|
|
|
|
loadingScan(loadId,warehouseId,orderPackageCode,trayCode,"托盘正常装车"); |
|
|
|
|
pacakagNum = pacakagNum + 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|