|
@@ -140,7 +140,6 @@ public class WcsToWmsApiService {
|
|
|
locationCoordinateVo.setCol(Integer.valueOf(baseLocationLotattVO.getRowNo()));
|
|
|
locationCoordinateVo.setRow(Integer.valueOf(baseLocationLotattVO.getRowIndex()));
|
|
|
return AjaxResult.success("仓位获取成功!", locationCoordinateVo);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// 判重
|
|
@@ -364,6 +363,7 @@ public class WcsToWmsApiService {
|
|
|
|
|
|
/**
|
|
|
* 拆包机开启接口
|
|
|
+ *
|
|
|
* @param lineOpenNotificationForm
|
|
|
* @return
|
|
|
*/
|
|
@@ -439,10 +439,17 @@ public class WcsToWmsApiService {
|
|
|
* @return
|
|
|
*/
|
|
|
public AjaxResult turnOffTheUnpacker() {
|
|
|
- //写仓库注入碳酸钠完成
|
|
|
- stirringTankClient.writeTank05();
|
|
|
- //写关闭拆包机信号
|
|
|
- unpackingMachineSubClient.writeV141_2();
|
|
|
+ new Thread(() -> {
|
|
|
+ try {
|
|
|
+ Thread.sleep(300000);
|
|
|
+ //写关闭拆包机信号
|
|
|
+ unpackingMachineSubClient.writeV141_2();
|
|
|
+ //写仓库注入碳酸钠完成
|
|
|
+ stirringTankClient.writeTank05();
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
@@ -452,10 +459,17 @@ public class WcsToWmsApiService {
|
|
|
* @return
|
|
|
*/
|
|
|
public AjaxResult turnOffTheUnpacker1() {
|
|
|
- //写仓库注入丁黄药完成
|
|
|
- stirringTankClient.writeTank05_1();
|
|
|
- //写关闭拆包机信号
|
|
|
- unpackingMachineSubClient.writeV141_3();
|
|
|
+ new Thread(() -> {
|
|
|
+ try {
|
|
|
+ Thread.sleep(300000);
|
|
|
+ //写关闭拆包机信号
|
|
|
+ unpackingMachineSubClient.writeV141_3();
|
|
|
+ //写仓库注入丁黄药完成
|
|
|
+ stirringTankClient.writeTank05_1();
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
@@ -465,10 +479,17 @@ public class WcsToWmsApiService {
|
|
|
* @return
|
|
|
*/
|
|
|
public AjaxResult turnOffTheUnpacker2() {
|
|
|
- //写仓库注入六偏磷酸钠完成
|
|
|
- stirringTankClient.writeTank05_3();
|
|
|
- //写关闭拆包机信号
|
|
|
- unpackingMachineSubClient.writeV141_4();
|
|
|
+ new Thread(() -> {
|
|
|
+ try {
|
|
|
+ Thread.sleep(300000);
|
|
|
+ //写关闭拆包机信号
|
|
|
+ unpackingMachineSubClient.writeV141_4();
|
|
|
+ //写仓库注入六偏磷酸钠完成
|
|
|
+ stirringTankClient.writeTank05_3();
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
@@ -478,10 +499,17 @@ public class WcsToWmsApiService {
|
|
|
* @return
|
|
|
*/
|
|
|
public AjaxResult turnOffTheUnpacker3() {
|
|
|
- //写仓库注入硫酸铵完成
|
|
|
- stirringTankClient.writeTank05_4();
|
|
|
- //写关闭拆包机信号
|
|
|
- unpackingMachineSubClient.writeV141_5();
|
|
|
+ new Thread(() -> {
|
|
|
+ try {
|
|
|
+ Thread.sleep(300000);
|
|
|
+ //写关闭拆包机信号
|
|
|
+ unpackingMachineSubClient.writeV141_5();
|
|
|
+ //写仓库注入硫酸铵完成
|
|
|
+ stirringTankClient.writeTank05_4();
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
@@ -491,12 +519,20 @@ public class WcsToWmsApiService {
|
|
|
* @return
|
|
|
*/
|
|
|
public AjaxResult turnOffTheUnpacker4() {
|
|
|
- //写仓库注入乙黄药完成
|
|
|
- stirringTankClient.writeTank05_5();
|
|
|
- //写关闭拆包机信号
|
|
|
- unpackingMachineSubClient.writeV141_6();
|
|
|
+ new Thread(() -> {
|
|
|
+ try {
|
|
|
+ Thread.sleep(300000);
|
|
|
+ //写关闭拆包机信号
|
|
|
+ unpackingMachineSubClient.writeV141_6();
|
|
|
+ //写仓库注入乙黄药完成
|
|
|
+ stirringTankClient.writeTank05_5();
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 异常关闭1号拆包机
|
|
|
*
|
|
@@ -562,4 +598,102 @@ public class WcsToWmsApiService {
|
|
|
unpackingMachineSubClient.writeV141_6();
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新数据接口
|
|
|
+ *
|
|
|
+ * @param updateForm
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AjaxResult updateAsnData(UpdateForm updateForm) {
|
|
|
+ String asnNo = updateForm.getDocNo();
|
|
|
+ String asnLineNo = updateForm.getLineNo();
|
|
|
+ Integer num = updateForm.getNum();
|
|
|
+ WmsDocAsnDetails wmsDocAsnDetails = wmsDocAsnDetailsMapper.selectWmsDocAsnDetailsByAsnLineNo(asnNo, asnLineNo);
|
|
|
+ wmsDocAsnDetails.setExpectedQty(new BigDecimal(num));
|
|
|
+ wmsDocAsnDetails.setExpectedQtyEach(new BigDecimal(num));
|
|
|
+ wmsDocAsnDetailsMapper.updateWmsDocAsnDetails(wmsDocAsnDetails);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 桶装入库
|
|
|
+ *
|
|
|
+ * @param stackingCompletion
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional
|
|
|
+ public synchronized AjaxResult theBucketIsLoadedIntoTheLibrary(String sku, String asnNo, String palletNo, BigDecimal num) {
|
|
|
+
|
|
|
+
|
|
|
+ // 数量
|
|
|
+ Double qty = num.doubleValue();
|
|
|
+
|
|
|
+ // 任务号
|
|
|
+ String wcsNo = "";
|
|
|
+
|
|
|
+ // 判重
|
|
|
+ WcsTask wcsTaskQuery = new WcsTask();
|
|
|
+ wcsTaskQuery.setExt1(asnNo);
|
|
|
+ wcsTaskQuery.setExt2(palletNo);
|
|
|
+ wcsTaskQuery.setExt3(wcsNo);
|
|
|
+ WcsTask wcsTask = iWcsTaskService.selectWcsTaskByModel(wcsTaskQuery);
|
|
|
+ if (wcsTask != null) {
|
|
|
+ String locationTo = wcsTask.getLocationTo();
|
|
|
+ BaseLocationInfo baseLocationInfo = iBaseLocationInfoService.selectBaseLocationInfoByIdOrNo(locationTo, Constant.WAREHOUSE_ID);
|
|
|
+ LocationCoordinateVo locationCoordinateVo = new LocationCoordinateVo();
|
|
|
+ locationCoordinateVo.setTaskNo(wcsTask.getTaskNo());
|
|
|
+ locationCoordinateVo.setLocationId(baseLocationInfo.getLocationNo());
|
|
|
+ locationCoordinateVo.setFloor(Integer.valueOf(baseLocationInfo.getShiftNo()));
|
|
|
+ locationCoordinateVo.setCol(Integer.valueOf(baseLocationInfo.getRowNo()));
|
|
|
+ locationCoordinateVo.setRow(Integer.valueOf(baseLocationInfo.getRowIndex()));
|
|
|
+ return AjaxResult.success("仓位获取成功!", locationCoordinateVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 推荐目标库位
|
|
|
+ BaseLocationLotattVO baseLocationLotattVO = baseLocationInfoSubService.recommendAReceiptLocation(sku);
|
|
|
+ if (baseLocationLotattVO == null) {
|
|
|
+ AjaxResult.error("没有可以推荐的目标库位!");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 生成任务
|
|
|
+ String taskNo = "";
|
|
|
+ AjaxResult ajaxResult = wcsTaskSubService.addWcsTask(Constant.LOC_STAGE_CACHE.toString()
|
|
|
+ , baseLocationLotattVO.getId().toString()
|
|
|
+ , asnNo
|
|
|
+ , palletNo
|
|
|
+ , wcsNo);
|
|
|
+ if (!ajaxResult.isSuccess()) {
|
|
|
+ return ajaxResult;
|
|
|
+ }
|
|
|
+ taskNo = ajaxResult.get("data").toString();
|
|
|
+ // 入库缓存位生成库存
|
|
|
+ InvLotLocIdSubService.initInv(Constant.LOC_STAGE_CACHE.toString(), sku, palletNo, asnNo, taskNo, qty);
|
|
|
+ // 反馈
|
|
|
+ LocationCoordinateVo locationCoordinateVo = new LocationCoordinateVo();
|
|
|
+ locationCoordinateVo.setTaskNo(taskNo);
|
|
|
+ locationCoordinateVo.setLocationId(baseLocationLotattVO.getLocationNo());
|
|
|
+ locationCoordinateVo.setFloor(Integer.valueOf(baseLocationLotattVO.getShiftNo()));
|
|
|
+ locationCoordinateVo.setCol(Integer.valueOf(baseLocationLotattVO.getRowNo()));
|
|
|
+ locationCoordinateVo.setRow(Integer.valueOf(baseLocationLotattVO.getRowIndex()));
|
|
|
+ return AjaxResult.success("仓位获取成功!", locationCoordinateVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 安全交握
|
|
|
+ * @param callbackTaskFrom
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AjaxResult secureHandover(CallbackTaskFrom callbackTaskFrom) {
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 出库任务下发
|
|
|
+ * @param callbackTaskFrom
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AjaxResult outboundRequest(OutboundForm outboundForm) {
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
}
|