任务完成处理和pda盘点界面优化
This commit is contained in:
@@ -96,7 +96,8 @@ public class WcsServiceController extends BaseController {
|
||||
@PostMapping("/reMaterial")
|
||||
public AjaxResult reMaterial(@RequestBody WmsJobHandler wmsJobHandler) {
|
||||
AjaxResult ajaxResult = apiWcsService.reMaterial(wmsJobHandler);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobHandler), "取货无货重分物料",ajaxResult);
|
||||
// RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobHandler), "取货无货重分物料",ajaxResult);
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobHandler), "取货无货任务作废-货位需要盘点",ajaxResult);
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ruoyi.api.service;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.domain.wcsJobHandle.WmsJobHandler;
|
||||
import com.ruoyi.api.domain.wcsStockin.WcsStockinReceive;
|
||||
import com.ruoyi.api.domain.wcsStockout.WcsStockoutParam;
|
||||
import com.ruoyi.common.WcsUrl;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.log.domain.RequestLog;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -36,47 +39,84 @@ public interface IApiWcsService {
|
||||
* @param wcsStockinReiceive
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult requestMydoJobManual(WcsStockinReceive wcsStockinReiceive);
|
||||
AjaxResult requestMydoJobManual(WcsStockinReceive wcsStockinReiceive);
|
||||
|
||||
/**
|
||||
* wcs任务回传
|
||||
* @param wmsJobHandler
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult jobFinish(WmsJobHandler wmsJobHandler);
|
||||
AjaxResult jobFinish(WmsJobHandler wmsJobHandler);
|
||||
|
||||
/**
|
||||
* 放货有货 - 入库重分
|
||||
* @param wmsJobHandler
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult reAssign(WmsJobHandler wmsJobHandler);
|
||||
AjaxResult reAssign(WmsJobHandler wmsJobHandler);
|
||||
|
||||
/**
|
||||
* 取货无货 - 重分物料
|
||||
* @param wmsJobHandler
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult reMaterial(WmsJobHandler wmsJobHandler);
|
||||
AjaxResult reMaterial(WmsJobHandler wmsJobHandler);
|
||||
|
||||
/**
|
||||
* 推送拣选回流作业
|
||||
* 推送【拣选回流】作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult sendBackMydoJob(Map<String, Object> param);
|
||||
AjaxResult sendBackMydoJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 推送盘点回流作业
|
||||
* 推送【盘点出库】作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult sendInventoryBackMydoJob(Map<String, Object> param);
|
||||
AjaxResult sendInventoryOutMydoJob(Map<String, Object> param);
|
||||
|
||||
public AjaxResult sendOutMydoJob(Map<String, Object> param);
|
||||
/**
|
||||
* 推送【盘点回流】作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
AjaxResult sendInventoryBackMydoJob(Map<String, Object> param);
|
||||
|
||||
public AjaxResult sendMoveMydoJob(Map<String, Object> param);
|
||||
/**
|
||||
* 推送【常规出库】作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
AjaxResult sendOutMydoJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 推送【移库】作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
AjaxResult sendMoveMydoJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 推送【空托出库】作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
AjaxResult sendEmptyTrayOutMydoJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 手动作废wcs作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
AjaxResult cancelWcsMydoJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 手动完成wcs作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
AjaxResult manualCompleteWcsMydoJob(Map<String, Object> param);
|
||||
|
||||
public AjaxResult sendEmptyTrayOutMydoJob(Map<String, Object> param);
|
||||
|
||||
}
|
||||
|
||||
@@ -668,7 +668,6 @@ public class ApiWcsService implements IApiWcsService {
|
||||
|
||||
String warehouseId = mydoJob.getWarehouseId();
|
||||
BasCargoSpace basCargoSpaceParam = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(wmsJobHandler.getCargoSpaceId());
|
||||
|
||||
//标记异常货位状态
|
||||
if (ObjUtil.isNotNull(basCargoSpaceParam)) {
|
||||
basCargoSpaceParam.setStatus(CargoSpaceCode.CARGOSPACE_STATUS_STOCKIN_EXCEPTION);
|
||||
@@ -679,7 +678,6 @@ public class ApiWcsService implements IApiWcsService {
|
||||
BasCargoSpace cargoSpaceNew = basCargoSpaceService.selectBasCargoSpaceForStockin(
|
||||
new BasCargoSpace().builder().roadwayId(mydoJob.getRoadwayId()).cargoAreaId(basCargoSpaceParam.getCargoAreaId()).theType(mydoJob.getTrayType()).build()
|
||||
);
|
||||
|
||||
if (ObjUtil.isNotNull(cargoSpaceNew)) {
|
||||
log.info("【入库重分】重分失败,该区域没有可用的空货位,货区:{},托盘类型:{}", basCargoSpaceParam.getCargoAreaId(), mydoJob.getTrayType());
|
||||
return AjaxResult.error("该区域没有可用的空货位");
|
||||
@@ -706,7 +704,7 @@ public class ApiWcsService implements IApiWcsService {
|
||||
|
||||
|
||||
/**
|
||||
* 取货无货 - 重分物料
|
||||
* 取货无货 - 重分物料 @@@FT577特殊情况,由于出库版辊唯一,无货情况下不能继续重分,只能手动处理
|
||||
* @param wmsJobHandler
|
||||
* @return
|
||||
*/
|
||||
@@ -751,6 +749,7 @@ public class ApiWcsService implements IApiWcsService {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult sendBackMydoJob(Map<String, Object> param) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WcsUrl.PUSH_IN_MYDO_JOB, JSONUtil.toJsonStr(param), "推送入库回流作业");
|
||||
@@ -767,22 +766,6 @@ public class ApiWcsService implements IApiWcsService {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult sendInventoryBackMydoJob(Map<String, Object> param) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WcsUrl.PUSH_IN_MYDO_JOB, JSONUtil.toJsonStr(param), "推送盘点回流作业");
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(AjaxResult.success()));
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setIsSuccessful("1");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 推送出库作业
|
||||
* @param param
|
||||
@@ -826,13 +809,36 @@ public class ApiWcsService implements IApiWcsService {
|
||||
|
||||
|
||||
/**
|
||||
* 推送盘点作业
|
||||
* 推送盘点出库作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult sendInventroyMydoJob(Map<String, Object> param) {
|
||||
@Override
|
||||
public AjaxResult sendInventoryOutMydoJob(Map<String, Object> param) {
|
||||
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WcsUrl.PUSH_MOVE_MYDO_JOB, JSONUtil.toJsonStr(param), "推送盘点作业");
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WcsUrl.PUSH_INVENTORY_MYDO_JOB, JSONUtil.toJsonStr(param), "推送盘点出库作业");
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(AjaxResult.success()));
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setIsSuccessful("1");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 推送盘点回库作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult sendInventoryBackMydoJob(Map<String, Object> param) {
|
||||
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WcsUrl.PUSH_INVENTORY_MYDO_JOB, JSONUtil.toJsonStr(param), "推送盘点回库作业");
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(AjaxResult.success()));
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setIsSuccessful("1");
|
||||
@@ -851,6 +857,7 @@ public class ApiWcsService implements IApiWcsService {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult sendEmptyTrayOutMydoJob(Map<String, Object> param) {
|
||||
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WcsUrl.PUSH_OUT_MYDO_JOB, JSONUtil.toJsonStr(param), "推送容器出库作业");
|
||||
@@ -866,4 +873,45 @@ public class ApiWcsService implements IApiWcsService {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动作废wcs作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult cancelWcsMydoJob(Map<String, Object> param){
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WcsUrl.PUSH_OUT_MYDO_JOB, JSONUtil.toJsonStr(param), "wcs手动作废作业");
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(AjaxResult.success()));
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setIsSuccessful("1");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 手动完成wcs作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult manualCompleteWcsMydoJob(Map<String, Object> param){
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WcsUrl.MANUAL_COMPLETE_WCS_MYDOJOB, JSONUtil.toJsonStr(param), "wcs手动完成作业");
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(AjaxResult.success()));
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setIsSuccessful("1");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@ public class WcsUrl {
|
||||
/** 推送移库作业 */
|
||||
public static final String PUSH_MOVE_MYDO_JOB = "http://localhost:8081/wcs2wms/api/receiveMoveMydoJob";
|
||||
|
||||
/** 推送盘点作业 */
|
||||
public static final String PUSH_INVENTORY_MYDO_JOB = "http://localhost:8081/wcs2wms/api/receiveInventoryMydoJob";
|
||||
|
||||
/** 推送回流作业 */
|
||||
public static final String PUSH_RETURN_MYDO_JOB = "http://localhost:8081/wcs2wms/api/receiveReturnMydoJob";
|
||||
|
||||
@@ -23,8 +26,11 @@ public class WcsUrl {
|
||||
/** */
|
||||
public static final String OUT_MYDOJOB_MS = "http://localhost:8081/wcs2wms/api/outMydojobMakesure";
|
||||
|
||||
/** */
|
||||
public static final String CANCEL_MYDOJOB = "http://localhost:8081/wcs2wms/api/cancelMydoJob";
|
||||
/** 请求wcs手动作废作业 */
|
||||
public static final String CANCEL_WCS_MYDOJOB = "http://localhost:8081/wcs2wms/api/cancelMydoJob";
|
||||
|
||||
/** 请求wcs手动完成作业 */
|
||||
public static final String MANUAL_COMPLETE_WCS_MYDOJOB = "http://localhost:8081/wcs2wms/api/manualCompleteMydoJob";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ public class PdaController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/inventoryTrayCodeComplete")
|
||||
@PreAuthorize("@ss.hasPermi('out:bound:task:info')")
|
||||
public AjaxResult inventoryTrayCodeComplete(Map<String, Object> params) {
|
||||
public AjaxResult inventoryTrayCodeComplete(@RequestBody Map<String, Object> params) {
|
||||
return pdaService.inventoryTrayCodeComplete(params);
|
||||
}
|
||||
|
||||
|
||||
@@ -236,8 +236,6 @@ public class MydoJobHandler {
|
||||
mydoJobService.insertMydoJobFinish(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
|
||||
// apiWcsService.cancelWcsMydojob()
|
||||
|
||||
log.info("【账务处理-入库】任务作废,移除作业信息,更新货位状态,作业号:{}", mydoJob.getJobId());
|
||||
return;
|
||||
}
|
||||
@@ -895,5 +893,9 @@ public class MydoJobHandler {
|
||||
|
||||
|
||||
|
||||
void cancelWcsJob(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -239,6 +239,112 @@ public class RequestWcsHandler {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 推送wcs移库任务
|
||||
*/
|
||||
@Scheduled(fixedRate = TIMEINTERVAL_2000)
|
||||
public void sendWcsMoveTask(){
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectOutMydoJobList(
|
||||
new MydoJob().builder()
|
||||
.status(TaskStatusEnum.READY.getCode())
|
||||
.inOrOut(TaskType.TASKTYPE_PICK_BACK)
|
||||
.build()
|
||||
);
|
||||
|
||||
if (mydoJobs.isEmpty()) return;
|
||||
|
||||
for (MydoJob mydoJob : mydoJobs){
|
||||
|
||||
//初始化参数
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("reqCode", UUID.randomUUID().toString());//请求码
|
||||
paramMap.put("trayCode", mydoJob.getTrayCode());//容器编号
|
||||
paramMap.put("taskNo", mydoJob.getTaskNo());//容器编号
|
||||
paramMap.put("jobId", mydoJob.getJobId());
|
||||
paramMap.put("inOrOut", mydoJob.getInOrOut());
|
||||
paramMap.put("cargoSpaceId", mydoJob.getCargoSpaceId());
|
||||
|
||||
AjaxResult ajaxResult = apiWcsService.sendBackMydoJob(paramMap);
|
||||
|
||||
if (ajaxResult.isSuccess()){
|
||||
log.info("【推送回流入库】<托盘回流>入库,更新货位和库存预占用状态,wms作业号:{},货位:{},托盘号:{}", mydoJob.getJobId(), mydoJob.getCargoSpaceId(), mydoJob.getTrayCode());
|
||||
mydoJob.setStatus(TaskStatusEnum.RUNNING.getCode());
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
|
||||
//更新库存状态【占用中】
|
||||
List<BasStock> stocks = basStockService.selectBasStockListByTrayCode(mydoJob.getTrayCode());
|
||||
if (!stocks.isEmpty()){
|
||||
for (BasStock stock : stocks) {
|
||||
stock.setStockStatus(BasStockCode.STOCK_STATUS_OCCUPIED);
|
||||
stock.setCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
basStockService.updateBasStock(stock);
|
||||
}
|
||||
}
|
||||
|
||||
//更新货位状态【入库预占用】
|
||||
basCargoSpaceService.updateBasCargoSpaceStatus(mydoJob.getCargoSpaceId(), "", CargoSpaceCode.CARGOSPACE_STATUS_PRE_STOCKIN);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 推送wcs盘点出库任务
|
||||
*/
|
||||
@Scheduled(fixedRate = TIMEINTERVAL_2000)
|
||||
public void sendWcsInventoryOutTask(){
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectOutMydoJobList(
|
||||
new MydoJob().builder()
|
||||
.status(TaskStatusEnum.READY.getCode())
|
||||
.inOrOut(TaskType.TASKTYPE_STOCKOUT_INVENTORY)
|
||||
.build()
|
||||
);
|
||||
|
||||
if (mydoJobs.isEmpty()) return;
|
||||
|
||||
for (MydoJob mydoJob : mydoJobs){
|
||||
|
||||
//初始化参数
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("reqCode", UUID.randomUUID().toString());//请求码
|
||||
paramMap.put("trayCode", mydoJob.getTrayCode());//容器编号
|
||||
paramMap.put("taskNo", mydoJob.getTaskNo());//容器编号
|
||||
paramMap.put("jobId", mydoJob.getJobId());
|
||||
paramMap.put("inOrOut", mydoJob.getInOrOut());
|
||||
paramMap.put("cargoSpaceId", mydoJob.getCargoSpaceId());
|
||||
|
||||
AjaxResult ajaxResult = apiWcsService.sendInventoryOutMydoJob(paramMap);
|
||||
|
||||
if (ajaxResult.isSuccess()){
|
||||
log.info("【推送盘点出库】<盘点>出库,更新货位和库存预占用状态,wms作业号:{},货位:{},托盘号:{}", mydoJob.getJobId(), mydoJob.getCargoSpaceId(), mydoJob.getTrayCode());
|
||||
mydoJob.setStatus(TaskStatusEnum.RUNNING.getCode());
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
|
||||
//更新库存状态【占用中】
|
||||
List<BasStock> stocks = basStockService.selectBasStockListByTrayCode(mydoJob.getTrayCode());
|
||||
if (!stocks.isEmpty()){
|
||||
for (BasStock stock : stocks) {
|
||||
stock.setStockStatus(BasStockCode.STOCK_STATUS_OCCUPIED);
|
||||
stock.setCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
basStockService.updateBasStock(stock);
|
||||
}
|
||||
}
|
||||
|
||||
//更新货位状态【入库预占用】
|
||||
basCargoSpaceService.updateBasCargoSpaceStatus(mydoJob.getCargoSpaceId(), mydoJob.getTrayCode(), CargoSpaceCode.CARGOSPACE_STATUS_PRE_STOCKOUT);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user