|
|
|
|
@ -14,6 +14,7 @@ import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.desk.dashboard.pojo.entity.BsWorkCenterEntity; |
|
|
|
|
import org.springblade.desk.dashboard.service.IBsWorkCenterService; |
|
|
|
|
import org.springblade.desk.logistics.enums.DistinguishRegionsEnum; |
|
|
|
|
import org.springblade.desk.logistics.pojo.dto.BoxBindingDto; |
|
|
|
|
import org.springblade.desk.logistics.pojo.dto.ReturnToWarehouseDto; |
|
|
|
|
import org.springblade.desk.logistics.pojo.entity.*; |
|
|
|
|
@ -26,6 +27,7 @@ import org.springblade.desk.produce.pojo.entity.WorkOrder; |
|
|
|
|
import org.springblade.desk.produce.pojo.entity.WorkPlan; |
|
|
|
|
import org.springblade.desk.produce.service.IWorkOrderService; |
|
|
|
|
import org.springblade.desk.produce.service.IWorkPlanService; |
|
|
|
|
import org.springblade.system.cache.DictCache; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
@ -1025,7 +1027,14 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
if (workCenter != null) { |
|
|
|
|
detailsVO.setWcName(workCenter.getWcName()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//判断是否是镀后库作业中心
|
|
|
|
|
if (DistinguishRegionsEnum.includeByWcName(workCenter.getWcName())) { |
|
|
|
|
List<YieldOrder> yieldOrderList = yieldOrderService.list(new LambdaQueryWrapper<YieldOrder>().eq(YieldOrder::getCardNo, orderList.get(0).getCardNo())); |
|
|
|
|
String code = DistinguishRegionsEnum.wcNameByCode(workCenter.getWcName()); |
|
|
|
|
String logisticsAnagementRegion = DictCache.getValue(code, yieldOrderList.get(0).getUseDept()); |
|
|
|
|
detailsVO.setStationRegion(logisticsAnagementRegion); |
|
|
|
|
return R.data(detailsVO); |
|
|
|
|
} |
|
|
|
|
// 设置工位区域
|
|
|
|
|
List<StationCenter> stationCenterList = stationCenterService.list( |
|
|
|
|
new LambdaQueryWrapper<StationCenter>().eq(StationCenter::getWcId, wcId) |
|
|
|
|
@ -1064,55 +1073,21 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
return R.data(stationNameBoxBarcodeVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R getStationRegion() { |
|
|
|
|
List<StationVO> freeStationList = stationService.getStatusStationList(STATUS_FREE, null,CONVEYOR_LINE_RECEIVE_ONLY,false); |
|
|
|
|
List<String> stationRegionList = freeStationList.stream().map(StationVO::getStationRegion).distinct().collect(Collectors.toUnmodifiableList()); |
|
|
|
|
ArrayList<StationRegionVo> list = new ArrayList<>(); |
|
|
|
|
for (String stationRegion : stationRegionList) { |
|
|
|
|
StationRegionVo stationRegionVo = new StationRegionVo(); |
|
|
|
|
stationRegionVo.setStationRegion(stationRegion); |
|
|
|
|
List<String> stationList = freeStationList.stream().filter(s -> stationRegion.equals(s.getStationRegion())).map(StationVO::getStationCode).distinct().collect(Collectors.toUnmodifiableList()); |
|
|
|
|
stationRegionVo.setStationCodeList(stationList); |
|
|
|
|
list.add(stationRegionVo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public R<?> boxBinding1(BoxBindingDto boxBinding) {
|
|
|
|
|
// log.info("【箱条码绑定】开始处理 - 绑定参数:{}", boxBinding);
|
|
|
|
|
//
|
|
|
|
|
// // 1. 基础参数校验
|
|
|
|
|
// R<?> paramCheckResult = validateBoxBindingParams(boxBinding);
|
|
|
|
|
// if (!paramCheckResult.isSuccess()) {
|
|
|
|
|
// return paramCheckResult;
|
|
|
|
|
// }
|
|
|
|
|
// String boxBarcode = boxBinding.getBoxBarcode();
|
|
|
|
|
// List<String> orderCardNoList = boxBinding.getOrderIdList();
|
|
|
|
|
//
|
|
|
|
|
// // 2. 订单有效性校验
|
|
|
|
|
// R<?> orderValidResult = validateOrderExist(orderCardNoList);
|
|
|
|
|
// if (!orderValidResult.isSuccess()) {
|
|
|
|
|
// return orderValidResult;
|
|
|
|
|
// }
|
|
|
|
|
// List<YieldOrder> yieldOrderList = (List<YieldOrder>) orderValidResult.getData();
|
|
|
|
|
// List<Long> orderIdList = yieldOrderList.stream()
|
|
|
|
|
// .map(YieldOrder::getId)
|
|
|
|
|
// .collect(Collectors.toList());
|
|
|
|
|
//
|
|
|
|
|
// // 3. 校验箱条码是否存在运行中任务
|
|
|
|
|
// R<?> boxTaskCheckResult = checkBoxBarcodeRunningTask(boxBarcode);
|
|
|
|
|
// if (!boxTaskCheckResult.isSuccess()) {
|
|
|
|
|
// return boxTaskCheckResult;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // 4. 校验订单是否已绑定
|
|
|
|
|
//// R<?> orderBindCheckResult = checkOrderIdBoundStatus(orderIdList);
|
|
|
|
|
//// if (!orderBindCheckResult.isSuccess()) {
|
|
|
|
|
//// return orderBindCheckResult;
|
|
|
|
|
//// }
|
|
|
|
|
//
|
|
|
|
|
// // 5. 订单重量校验(超限则拒绝绑定)
|
|
|
|
|
// BigDecimal totalWeight = calculateOrderTotalWeight(orderIdList);
|
|
|
|
|
// if (totalWeight.compareTo(MAX_BOX_WEIGHT_THRESHOLD) > 0) {
|
|
|
|
|
// String errorMsg = String.format("箱条码%s绑定的订单总重量%.2fkg,超过最大阈值%.2fkg",
|
|
|
|
|
// boxBarcode, totalWeight, MAX_BOX_WEIGHT_THRESHOLD);
|
|
|
|
|
// log.warn("【箱条码绑定】{}", errorMsg);
|
|
|
|
|
// return R.fail(errorMsg + ",请重新进行绑定");
|
|
|
|
|
// }
|
|
|
|
|
// // 6.
|
|
|
|
|
//
|
|
|
|
|
// // 6. 保存绑定关系
|
|
|
|
|
// return saveOrderBoxBinding(boxBarcode, new ArrayList<>(orderIdList));
|
|
|
|
|
// }
|
|
|
|
|
return R.data(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1158,6 +1133,23 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
// 从结果中获取最终确定的 wcId(第一次会赋值)
|
|
|
|
|
wcId = (Long) checkResult.getData(); |
|
|
|
|
} |
|
|
|
|
//判断是不是镀后库作业中心
|
|
|
|
|
if(DistinguishRegionsEnum.includeByWcName( bsWorkCenterService.getById(wcId).getWcName())){ |
|
|
|
|
List<String> deptList = yieldOrderService.list(new LambdaQueryWrapper<YieldOrder>().in(YieldOrder::getCardNo, orderBindList)).stream().map(s -> s.getUseDept()).toList(); |
|
|
|
|
String code = DistinguishRegionsEnum.wcNameByCode(bsWorkCenterService.getById(wcId).getWcName()); |
|
|
|
|
String stationRegion=""; |
|
|
|
|
for (String s : deptList) { |
|
|
|
|
String logisticsAnagementRegion = DictCache.getValue(code, s); |
|
|
|
|
if (logisticsAnagementRegion==null) { |
|
|
|
|
return R.fail("站点区域异常"); |
|
|
|
|
}else if (stationRegion==null) { |
|
|
|
|
stationRegion= logisticsAnagementRegion; |
|
|
|
|
} |
|
|
|
|
if (!stationRegion.equals(logisticsAnagementRegion)) { |
|
|
|
|
return R.fail("站点区域异常,站点区域配送不统一"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 4. 校验箱条码是否存在运行中任务
|
|
|
|
|
R<?> boxTaskCheckResult = checkBoxBarcodeRunningTask(boxBarcode); |
|
|
|
|
if (!boxTaskCheckResult.isSuccess()) { |
|
|
|
|
|