|
|
|
@ -60,6 +60,7 @@ import com.gaotao.modules.trans.entity.TransNoControl; |
|
|
|
import com.gaotao.modules.trans.service.TransNoControlService; |
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport; |
|
|
|
@ -68,6 +69,7 @@ import org.springframework.util.StringUtils; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashSet; |
|
|
|
@ -105,6 +107,12 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
@Autowired |
|
|
|
private HaiAnWcsApiService haiAnWcsApiService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 海安立库开关,仅用于分拣清单测试特例判断;接口真实外呼仍由HaiAnWcsApiServiceImpl统一控制 - rqrq |
|
|
|
*/ |
|
|
|
@Value("${interface.haianWarehouse:false}") |
|
|
|
private boolean haianWarehouseEnabled; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private TransNoControlService transNoControlService; |
|
|
|
|
|
|
|
@ -375,6 +383,17 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
try { |
|
|
|
// 调用接口层查分拣清单:入参site+locationCode,HTTP 是否外呼由接口层开关决定;失败回退空列表不阻断 PDA - rqrq |
|
|
|
String response = haiAnWcsApiService.queryAutoSortingInfo(queryRequest); |
|
|
|
if (!haianWarehouseEnabled) { |
|
|
|
// 立库未启用时临时返回固定标签供PDA分拣联调;接口层仍已记录请求和短路响应,测试结束后删除本分支 - rqrq |
|
|
|
result.setRfidList(new ArrayList<String>(Arrays.asList( |
|
|
|
"A552025100200000009", |
|
|
|
"A552025100200000012", |
|
|
|
"A552025100200000015" |
|
|
|
))); |
|
|
|
result.setMockMode(Boolean.TRUE); |
|
|
|
result.setMessage("haianWarehouse=false,返回临时固定分拣清单"); |
|
|
|
return result; |
|
|
|
} |
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
JsonNode rootNode = mapper.readTree(response); |
|
|
|
List<String> rfidList = new ArrayList<String>(); |
|
|
|
@ -1214,8 +1233,8 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
if ("Y".equals(palletInfo.getCallingFlag()) && !sortedSourcePallet) { |
|
|
|
throw new RuntimeException("栈板正在被调用,无法扫入"); |
|
|
|
} |
|
|
|
// 组盘入库/手工组盘以及分拣工作盘都要查 area.pack_able;只有分拣页被分拣源盘跳过,因为到站后 area 可能仍是立库禁盘区域 - rqrq |
|
|
|
if (!sortedSourcePallet) { |
|
|
|
// 人工分拣页的工作盘和被分拣源盘都跳过区域pack_able校验;标签归属、入库状态等其他校验继续执行 - rqrq |
|
|
|
if (!HaiAnPdaSortFlagStaticData.isSortingScene(sortFlag) && !sortedSourcePallet) { |
|
|
|
validatePackAbleForPalletOperation(site, palletInfo); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1385,14 +1404,17 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
String partNo = request.getPartNo(); |
|
|
|
String createBy = request.getCreateBy(); |
|
|
|
Integer wcsFlag = request.getWcsFlag() == null ? 1 : request.getWcsFlag(); |
|
|
|
Integer sortFlag = request.getSortFlag(); |
|
|
|
|
|
|
|
if (!StringUtils.hasText(serialNo) || !StringUtils.hasText(originalPalletId) |
|
|
|
|| !StringUtils.hasText(originalPosition) || originalLayer == null || !StringUtils.hasText(partNo)) { |
|
|
|
throw new RuntimeException("扫回参数不完整"); |
|
|
|
} |
|
|
|
HaiAnPalletInfoResult originalPalletInfo = loadRequiredPallet(site, originalPalletId); |
|
|
|
// 扫回本质是扫入原栈板,需执行同样的pack_able权限校验 - rqrq |
|
|
|
// 人工分拣扫回跳过区域pack_able校验;普通业务调用仍保留原有区域权限校验 - rqrq |
|
|
|
if (!HaiAnPdaSortFlagStaticData.isSortingScene(sortFlag)) { |
|
|
|
validatePackAbleForPalletOperation(site, originalPalletInfo); |
|
|
|
} |
|
|
|
|
|
|
|
HaiAnHandlingUnitLabelRow labelInfo = haiAnPdaAutoWarehouseMapper.getHandlingUnitBySerialNo(serialNo); |
|
|
|
if (labelInfo == null) { |
|
|
|
|