放货有货 重新分配货位
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
package com.ruoyi.api.controller;
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.api.domain.GenAgvSchedulingTaskRequest;
|
||||||
|
import com.ruoyi.api.service.IToWcsService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -17,16 +17,25 @@ import java.util.List;
|
|||||||
@RequestMapping("/api2wcs")
|
@RequestMapping("/api2wcs")
|
||||||
public class ToWcsApiController {
|
public class ToWcsApiController {
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMydoJobService mydoJobService;
|
private IToWcsService toWcsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取任务
|
* 推送AGV任务
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getJob")
|
@PostMapping("/pushOutMydoJob")
|
||||||
public AjaxResult getJob(MydoJob mydoJob)
|
public AjaxResult pushOutMydoJob(@RequestBody MydoJob mydoJob) {
|
||||||
{
|
return toWcsService.pushOutMydoJob(mydoJob);
|
||||||
return AjaxResult.success(mydoJobService.selectMydoJobList(mydoJob));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送agv搬运作业
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/pushAgvMoveJob")
|
||||||
|
public AjaxResult pushAgvMoveJob(@RequestBody GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest) {
|
||||||
|
return toWcsService.pushAgvMoveJob(genAgvSchedulingTaskRequest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
package com.ruoyi.api.controller;
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.ruoyi.api.domain.WmsJobRequest;
|
import com.ruoyi.api.domain.WmsJobRequest;
|
||||||
import com.ruoyi.api.service.IToWmsService;
|
import com.ruoyi.api.service.IToWmsService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||||
|
import com.ruoyi.log.domain.RequestLog;
|
||||||
|
import com.ruoyi.log.service.IRequestLogService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -17,13 +21,19 @@ public class ToWmsApiController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IToWmsService toWmsService;
|
private IToWmsService toWmsService;
|
||||||
|
@Autowired
|
||||||
|
private IRequestLogService requestLogService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入库任务请求
|
* 入库任务请求
|
||||||
*/
|
*/
|
||||||
@PostMapping("/inJob")
|
@PostMapping("/inJob")
|
||||||
public AjaxResult inJob(@RequestBody MydoJob mydoJob) {
|
public AjaxResult inJob(@RequestBody MydoJob mydoJob) {
|
||||||
return toWmsService.inJob(mydoJob);
|
AjaxResult ajaxResult = toWmsService.inJob(mydoJob);
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(mydoJob), "InJob");
|
||||||
|
requestLog.setResponseBody(Convert.toStr(ajaxResult.get("msg")));
|
||||||
|
requestLogService.insertRequestLog(requestLog);
|
||||||
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,23 +49,35 @@ public class ToWmsApiController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/jobFinish")
|
@PostMapping("/jobFinish")
|
||||||
public AjaxResult jobFinish(@RequestBody WmsJobRequest wmsJobRequest) {
|
public AjaxResult jobFinish(@RequestBody WmsJobRequest wmsJobRequest) {
|
||||||
return toWmsService.jobFinish(wmsJobRequest);
|
AjaxResult ajaxResult = toWmsService.jobFinish(wmsJobRequest);
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobRequest), "jobFinish");
|
||||||
|
requestLog.setResponseBody(Convert.toStr(ajaxResult.get("msg")));
|
||||||
|
requestLogService.insertRequestLog(requestLog);
|
||||||
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 放货有货,重新分配货位
|
* 放货有货,重新分配货位
|
||||||
*/
|
*/
|
||||||
@GetMapping("/reAssign")
|
@PostMapping("/reAssign")
|
||||||
public AjaxResult reAssign(MydoJob mydoJob) {
|
public AjaxResult reAssign(@RequestBody MydoJob mydoJob) {
|
||||||
return AjaxResult.success();
|
AjaxResult ajaxResult = toWmsService.reAssign(mydoJob);
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(mydoJob), "reAssign");
|
||||||
|
requestLog.setResponseBody(Convert.toStr(ajaxResult.get("msg")));
|
||||||
|
requestLogService.insertRequestLog(requestLog);
|
||||||
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取货无货,重新分配物料
|
* 取货无货,重新分配物料
|
||||||
*/
|
*/
|
||||||
@GetMapping("/reMaterial")
|
@PostMapping("/reMaterial")
|
||||||
public AjaxResult reMaterial(MydoJob mydoJob) {
|
public AjaxResult reMaterial(@RequestBody MydoJob mydoJob) {
|
||||||
return AjaxResult.success();
|
AjaxResult ajaxResult = toWmsService.reMaterial(mydoJob);
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(mydoJob), "reMaterial");
|
||||||
|
requestLog.setResponseBody(Convert.toStr(ajaxResult.get("msg")));
|
||||||
|
requestLogService.insertRequestLog(requestLog);
|
||||||
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,156 @@
|
|||||||
|
package com.ruoyi.api.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【生成AGV任务】请求接口
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class GenAgvSchedulingTaskRequest {
|
||||||
|
/**
|
||||||
|
* 请求编号
|
||||||
|
* 同一个请求重复提交, 使用同一编号
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
private String reqCode = UUID.randomUUID().toString();
|
||||||
|
/**
|
||||||
|
* 请求时间
|
||||||
|
* 格式: “yyyy-MM-dd HH:mm:ss”
|
||||||
|
*/
|
||||||
|
private String reqTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")).toString();
|
||||||
|
/**
|
||||||
|
* 客户端编号
|
||||||
|
* 客户端编号,如PDA,HCWMS等
|
||||||
|
*/
|
||||||
|
private String clientCode;
|
||||||
|
/**
|
||||||
|
* 令牌号
|
||||||
|
* 由调度系统颁发
|
||||||
|
*/
|
||||||
|
private String tokenCode;
|
||||||
|
/**
|
||||||
|
* 任务类型
|
||||||
|
* 内置任务类型:
|
||||||
|
* 厂内货架搬运: F01
|
||||||
|
* 厂内货架空满交换: F02
|
||||||
|
* 辊筒搬运接驳:F03
|
||||||
|
* 厂内货架出库AGV待命:F04
|
||||||
|
* 旋转货架: F05
|
||||||
|
* 厂内电梯任务: F06
|
||||||
|
* 以下为叉车专用任务类型
|
||||||
|
* 高位货架到工作台: F11
|
||||||
|
* 工作台到高位货架: F12
|
||||||
|
* 巷道到工作台: F13
|
||||||
|
* 工作台到巷道: F14
|
||||||
|
* 高位货架到工作台(接驳) : F15
|
||||||
|
* 工作台到高位货架 (接驳) : F16
|
||||||
|
* 巷道到工作台(接驳) : F17
|
||||||
|
* 工作台到巷道(接驳) : F18
|
||||||
|
* 叉车电梯主任务: F20
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
private String taskTyp;
|
||||||
|
/**
|
||||||
|
* 容器类型(叉车/CTU专用) 叉车项目必传
|
||||||
|
*/
|
||||||
|
private String ctnrTyp;
|
||||||
|
/**
|
||||||
|
* 容器编号 (叉车/CTU专用)
|
||||||
|
*/
|
||||||
|
private String ctnrCode; //
|
||||||
|
/**
|
||||||
|
* 容器数量(叉车堆叠专用),默认值1,仅记录堆叠的数量不记录堆叠的每个容器号
|
||||||
|
*/
|
||||||
|
private String ctnrNum;
|
||||||
|
/**
|
||||||
|
* 任务模式
|
||||||
|
* 0-普通move 1-出库move 2-入库move 3-移库move
|
||||||
|
*/
|
||||||
|
private String taskMode;
|
||||||
|
/**
|
||||||
|
* 工作位
|
||||||
|
* 与RCS-2000端配置的位置名称一致, 工作位名称为字母\数字\或组合
|
||||||
|
*/
|
||||||
|
private String wbCode;
|
||||||
|
/**
|
||||||
|
* 位置路径
|
||||||
|
* AGV关键路径位置集合,与任务类型中模板配置的位置路径一一对应。待现场地图部署、配置完成后可获取
|
||||||
|
*/
|
||||||
|
private List<PositionCodeData> positionCodePath;
|
||||||
|
/**
|
||||||
|
* 货架编号
|
||||||
|
* 不指定货架可以为空
|
||||||
|
*/
|
||||||
|
private String podCode;
|
||||||
|
/**
|
||||||
|
* 货架方向
|
||||||
|
* “180”,”0”,”90”,”-90” 分别对应地图的”左”,”右”,”上”,”下”
|
||||||
|
* 不指定方向可以为空
|
||||||
|
* 如果终点不是工作台或工作台未配置操作方向则货架拣货方向podDir作为终点方向
|
||||||
|
* 如果工作台配有操作方向,则系统会根据货架拣货方向podDir和工作台操作方向计算货架终点方向
|
||||||
|
*/
|
||||||
|
private String podDir;
|
||||||
|
/**
|
||||||
|
* 货架类型, 传空时表示随机找个货架
|
||||||
|
* 找空货架传参方式如下:
|
||||||
|
* -1: 代表不关心货架类型, 找到空货架即可.
|
||||||
|
* -2: 代表从工作位获取关联货架类型, 如果未配置, 只找空货架.
|
||||||
|
* 货架类型编号: 只找该货架类型的空货架
|
||||||
|
*/
|
||||||
|
private String podTyp;
|
||||||
|
/**
|
||||||
|
* 物料批次
|
||||||
|
* 物料批次或货架上的物料唯一编码,生成任务单时,货架与物料直接绑定时使用. (通过同时传podCode和materialLot来绑定或通过 wbCode 找到位置上的货架和materialLot来绑定)
|
||||||
|
* 如果是区域/策略内查找货架,可以匹配对应物料批次的货架,支持以下值:
|
||||||
|
* 0:区域/策略内查找空货架
|
||||||
|
* 1:区域/策略内查找满货架
|
||||||
|
* 其他值:查找指定物料批次对应的货架
|
||||||
|
* 巷道任务通过该字段传入特征值
|
||||||
|
*/
|
||||||
|
private String materialLot;
|
||||||
|
/**
|
||||||
|
* 优先级
|
||||||
|
* 从(1~127)级,最大优先级最高。为空时,采用任务模板的优先级
|
||||||
|
*/
|
||||||
|
private String priority;
|
||||||
|
/**
|
||||||
|
* AGV编号
|
||||||
|
* 填写表示指定某一编号的AGV执行该任务
|
||||||
|
*/
|
||||||
|
private String agvCode;
|
||||||
|
/**
|
||||||
|
* 任务单号
|
||||||
|
* 选填, 不填系统自动生成
|
||||||
|
*/
|
||||||
|
private String taskCode;
|
||||||
|
/**
|
||||||
|
* 组编号
|
||||||
|
* CTU场景下用于按组出库,同组任务优先拼车。 如业务需要任务组间或组内按顺序出库,则需调用料箱顺序出库(CTU)接口。
|
||||||
|
* 潜伏式场景下,通过组号来管理顺序出库的顺序,组号小的优先出库。
|
||||||
|
*/
|
||||||
|
private String groupId;
|
||||||
|
/**
|
||||||
|
* 设备类型
|
||||||
|
*/
|
||||||
|
private String agvTyp;
|
||||||
|
/**
|
||||||
|
* 选择策略
|
||||||
|
* 区域/策略中挑选货架以及根据物料批次挑选货架时的先进先出规则,支持以下4个值:
|
||||||
|
* 1:按照货架到达储位的时间顺序,先进先出
|
||||||
|
* 2:按照货架到达储位的时间顺序,先进后出
|
||||||
|
* 9:按照货架绑定物料批次的时间顺序,先进先出
|
||||||
|
* 10:按照货架绑定物料批次的时间顺序,先进后出
|
||||||
|
*/
|
||||||
|
private String positionSelStrategy;
|
||||||
|
/**
|
||||||
|
* 自定义数据
|
||||||
|
*/
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.ruoyi.api.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PositionCodeData {
|
||||||
|
/**
|
||||||
|
* 位置编号 - 单个编号不超过64位
|
||||||
|
*/
|
||||||
|
private String positionCode;
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*
|
||||||
|
* 位置类型说明:
|
||||||
|
* 00表示:位置编号
|
||||||
|
* 01表示:物料批次号
|
||||||
|
* 02表示:策略编号(含多个区域) 如:第一个区域放不下, 可以放第二个区域
|
||||||
|
* 03表示:货架编号,通过货架编号找到货架所在位置
|
||||||
|
* 04表示:区域编号,在区域中查找可用位置
|
||||||
|
* 05表示:仓位编号(叉车/CTU专用)
|
||||||
|
* 06表示:巷道编号
|
||||||
|
* 07表示:容器编号
|
||||||
|
* 08表示:巷道策略
|
||||||
|
* 09表示:巷道区域
|
||||||
|
* 10表示:巷道仓位
|
||||||
|
* 11表示:输送线(机台)编号
|
||||||
|
* 12表示:CTU工作台(梳齿工作站)编号
|
||||||
|
* 13表示:搬运巷道指定货架出库
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.ruoyi.api.service;
|
||||||
|
|
||||||
|
import com.ruoyi.api.domain.GenAgvSchedulingTaskRequest;
|
||||||
|
import com.ruoyi.api.domain.WmsJobRequest;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作业统计 Service 接口
|
||||||
|
*/
|
||||||
|
public interface IToWcsService {
|
||||||
|
|
||||||
|
|
||||||
|
AjaxResult pushOutMydoJob(MydoJob mydoJob);
|
||||||
|
|
||||||
|
AjaxResult pushAgvMoveJob(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest);
|
||||||
|
}
|
||||||
@@ -14,4 +14,8 @@ public interface IToWmsService {
|
|||||||
AjaxResult inJob(MydoJob mydoJob);
|
AjaxResult inJob(MydoJob mydoJob);
|
||||||
|
|
||||||
AjaxResult jobFinish(WmsJobRequest wmsJobRequest);
|
AjaxResult jobFinish(WmsJobRequest wmsJobRequest);
|
||||||
|
|
||||||
|
AjaxResult reAssign(MydoJob mydoJob);
|
||||||
|
|
||||||
|
AjaxResult reMaterial(MydoJob mydoJob);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.ruoyi.api.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.ruoyi.api.domain.GenAgvSchedulingTaskRequest;
|
||||||
|
import com.ruoyi.api.domain.WmsJobRequest;
|
||||||
|
import com.ruoyi.api.service.IToWcsService;
|
||||||
|
import com.ruoyi.api.service.IToWmsService;
|
||||||
|
import com.ruoyi.bas.container.domain.BasContainer;
|
||||||
|
import com.ruoyi.bas.container.service.IBasContainerService;
|
||||||
|
import com.ruoyi.bas.tag.domain.BasTag;
|
||||||
|
import com.ruoyi.bas.tag.service.IBasTagService;
|
||||||
|
import com.ruoyi.bas.taskNo.service.IBasTaskNoService;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||||
|
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||||
|
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||||
|
import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
|
||||||
|
import com.ruoyi.log.domain.RequestLog;
|
||||||
|
import com.ruoyi.log.service.IRequestLogService;
|
||||||
|
import com.ruoyi.out.tagTask.domain.TagTask;
|
||||||
|
import com.ruoyi.out.tagTask.service.ITagTaskService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作业统计 Service 实现
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ToWcsServiceImpl implements IToWcsService {
|
||||||
|
@Autowired
|
||||||
|
private IRequestLogService requestLogService;
|
||||||
|
|
||||||
|
public static final String PUSH_OUT_MYDO_JOB = "pushOutMydoJob";
|
||||||
|
public static final String PUSH_AGV_MOVE_JOB = "pushOutMydoJob";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMydoJobService mydoJobService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult pushOutMydoJob(MydoJob mydoJob) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(PUSH_OUT_MYDO_JOB, JSONUtil.toJsonStr(mydoJob), "推送出库任务");
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())){
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
return AjaxResult.error(requestLog.getDuration());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult pushAgvMoveJob(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(PUSH_AGV_MOVE_JOB, JSONUtil.toJsonStr(genAgvSchedulingTaskRequest), "推送出库任务");
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())){
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
return AjaxResult.error(requestLog.getDuration());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,16 +3,21 @@ package com.ruoyi.api.service.impl;
|
|||||||
import cn.hutool.core.collection.ListUtil;
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.ruoyi.api.domain.WmsJobRequest;
|
import com.ruoyi.api.domain.WmsJobRequest;
|
||||||
import com.ruoyi.api.mapper.JobStatisticsMapper;
|
import com.ruoyi.api.mapper.JobStatisticsMapper;
|
||||||
import com.ruoyi.api.service.IJobStatisticsService;
|
import com.ruoyi.api.service.IJobStatisticsService;
|
||||||
import com.ruoyi.api.service.IToWmsService;
|
import com.ruoyi.api.service.IToWmsService;
|
||||||
|
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
|
||||||
import com.ruoyi.bas.cargoSpace.mapper.BasCargoSpaceMapper;
|
import com.ruoyi.bas.cargoSpace.mapper.BasCargoSpaceMapper;
|
||||||
|
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
|
||||||
import com.ruoyi.bas.container.domain.BasContainer;
|
import com.ruoyi.bas.container.domain.BasContainer;
|
||||||
import com.ruoyi.bas.container.service.IBasContainerService;
|
import com.ruoyi.bas.container.service.IBasContainerService;
|
||||||
import com.ruoyi.bas.tag.domain.BasTag;
|
import com.ruoyi.bas.tag.domain.BasTag;
|
||||||
import com.ruoyi.bas.tag.service.IBasTagService;
|
import com.ruoyi.bas.tag.service.IBasTagService;
|
||||||
import com.ruoyi.bas.taskNo.service.IBasTaskNoService;
|
import com.ruoyi.bas.taskNo.service.IBasTaskNoService;
|
||||||
|
import com.ruoyi.bas.warehouse.domain.BasWarehouse;
|
||||||
|
import com.ruoyi.bas.warehouse.service.IBasWarehouseService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||||
@@ -20,6 +25,8 @@ import com.ruoyi.job.mydojob.mapper.MydoJobMapper;
|
|||||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||||
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||||
import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
|
import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
|
||||||
|
import com.ruoyi.log.domain.RequestLog;
|
||||||
|
import com.ruoyi.log.service.IRequestLogService;
|
||||||
import com.ruoyi.out.tagTask.domain.TagTask;
|
import com.ruoyi.out.tagTask.domain.TagTask;
|
||||||
import com.ruoyi.out.tagTask.service.ITagTaskService;
|
import com.ruoyi.out.tagTask.service.ITagTaskService;
|
||||||
import org.aspectj.weaver.loadtime.Aj;
|
import org.aspectj.weaver.loadtime.Aj;
|
||||||
@@ -50,6 +57,9 @@ public class ToWmsServiceImpl implements IToWmsService {
|
|||||||
private IBasTaskNoService basTaskNoService;
|
private IBasTaskNoService basTaskNoService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBasTagService iBasTagService;
|
private IBasTagService iBasTagService;
|
||||||
|
@Autowired
|
||||||
|
private IBasCargoSpaceService basCargoSpaceService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -155,4 +165,35 @@ public class ToWmsServiceImpl implements IToWmsService {
|
|||||||
}
|
}
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult reAssign(MydoJob param) {
|
||||||
|
//重新分配货位
|
||||||
|
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(param.getJobId());
|
||||||
|
String warehouseId = mydoJob.getWarehouseId();
|
||||||
|
BasCargoSpace basCargoSpace = basCargoSpaceService.selectEmptyCargoSpaceByWarehouseId(warehouseId);
|
||||||
|
if (basCargoSpace == null){
|
||||||
|
return AjaxResult.error("没有空货位");
|
||||||
|
}else {
|
||||||
|
mydoJob.setCargoSpaceId(basCargoSpace.getCargoSpaceId());
|
||||||
|
mydoJob.setFaultFlag("1");
|
||||||
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
|
return AjaxResult.success("重新分配货位成功", mydoJob);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult reMaterial(MydoJob mydoJob) {
|
||||||
|
//重新分配物料
|
||||||
|
//标记原货位为出库待盘点
|
||||||
|
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||||
|
basCargoSpace.setStatus("6");
|
||||||
|
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||||
|
//减少单据分配数量
|
||||||
|
|
||||||
|
// 作废作业
|
||||||
|
|
||||||
|
//调用自动分配
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,4 +68,11 @@ public interface BasCargoSpaceMapper extends BaseMapper<BasCargoSpace>
|
|||||||
* @return 状态统计结果列表
|
* @return 状态统计结果列表
|
||||||
*/
|
*/
|
||||||
public List<Map<String, Object>> selectStatusCount();
|
public List<Map<String, Object>> selectStatusCount();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 找空货位
|
||||||
|
* @param warehouseId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BasCargoSpace selectEmptyCargoSpaceByWarehouseId(String warehouseId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,5 +61,10 @@ public interface IBasCargoSpaceService extends IService<BasCargoSpace>
|
|||||||
*/
|
*/
|
||||||
public int deleteBasCargoSpaceByCargoSpaceId(String cargoSpaceId);
|
public int deleteBasCargoSpaceByCargoSpaceId(String cargoSpaceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 找空货位
|
||||||
|
* @param warehouseId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BasCargoSpace selectEmptyCargoSpaceByWarehouseId(String warehouseId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,5 +97,10 @@ public class BasCargoSpaceServiceImpl extends ServiceImpl<BasCargoSpaceMapper,Ba
|
|||||||
return basCargoSpaceMapper.deleteBasCargoSpaceByCargoSpaceId(cargoSpaceId);
|
return basCargoSpaceMapper.deleteBasCargoSpaceByCargoSpaceId(cargoSpaceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BasCargoSpace selectEmptyCargoSpaceByWarehouseId(String warehouseId) {
|
||||||
|
return basCargoSpaceMapper.selectEmptyCargoSpaceByWarehouseId(warehouseId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,4 +58,21 @@ public interface IRequestLogService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteRequestLogByRequestId(Long requestId);
|
public int deleteRequestLogByRequestId(Long requestId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求接口记录
|
||||||
|
* @param url
|
||||||
|
* @param param
|
||||||
|
* @param remark
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RequestLog getRequestLog(String url, String param, String remark);
|
||||||
|
/**
|
||||||
|
* 接收接口记录
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @param remark
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RequestLog getRequestLog(String param, String remark);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
package com.ruoyi.log.service.impl;
|
package com.ruoyi.log.service.impl;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.date.DateUnit;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.log.mapper.RequestLogMapper;
|
import com.ruoyi.log.mapper.RequestLogMapper;
|
||||||
@@ -90,4 +99,67 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
{
|
{
|
||||||
return requestLogMapper.deleteRequestLogByRequestId(requestId);
|
return requestLogMapper.deleteRequestLogByRequestId(requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入请求日志
|
||||||
|
*
|
||||||
|
* @param url 请求url
|
||||||
|
* @param param 参数
|
||||||
|
* @return requestLog
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public RequestLog getRequestLog(String url, String param, String remark) {
|
||||||
|
RequestLog requestLog = new RequestLog();
|
||||||
|
requestLog.setRequestTime(DateUtil.formatDateTime(new Date()));
|
||||||
|
requestLog.setSourceSystem("wcs");
|
||||||
|
requestLog.setTargetSystem("wms");
|
||||||
|
requestLog.setEndpoint(remark);
|
||||||
|
requestLog.setRequestMethod("post");
|
||||||
|
requestLog.setRequestHeaders(null);
|
||||||
|
requestLog.setRequestBody(param);
|
||||||
|
requestLog.setRequestUrl(url);
|
||||||
|
try {
|
||||||
|
String resStr = HttpUtil.post(url, param);
|
||||||
|
requestLog.setResponseBody(resStr);
|
||||||
|
AjaxResult bean = JSONUtil.toBean(resStr, AjaxResult.class);
|
||||||
|
if (Convert.toInt(bean.get("code")) == 0) {
|
||||||
|
requestLog.setResponseTime(DateUtil.formatDateTime(new Date()));
|
||||||
|
requestLog.setResponseStatus("1");
|
||||||
|
requestLog.setDuration(Convert.toStr(DateUtil.between(Convert.toDate(requestLog.getRequestTime()), Convert.toDate(requestLog.getResponseTime()), DateUnit.MS)));
|
||||||
|
requestLog.setIsSuccessful("1");
|
||||||
|
}else {
|
||||||
|
requestLog.setResponseStatus("0");
|
||||||
|
requestLog.setErrorDetails(Convert.toStr(bean.get("msg")));
|
||||||
|
requestLog.setIsSuccessful("0");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
requestLog.setErrorDetails(e.getMessage());
|
||||||
|
requestLog.setIsSuccessful("0");
|
||||||
|
requestLog.setResponseStatus("0");
|
||||||
|
} finally {
|
||||||
|
requestLogMapper.insertRequestLog(requestLog);
|
||||||
|
}
|
||||||
|
return requestLog;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入请求日志
|
||||||
|
*
|
||||||
|
* @return requestLog
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public RequestLog getRequestLog(String param, String remark) {
|
||||||
|
RequestLog requestLog = new RequestLog();
|
||||||
|
requestLog.setRequestTime(DateUtil.formatDateTime(new Date()));
|
||||||
|
requestLog.setRequestBody(param);
|
||||||
|
requestLog.setSourceSystem("wms");
|
||||||
|
requestLog.setTargetSystem("wcs");
|
||||||
|
requestLog.setEndpoint(remark);
|
||||||
|
requestLog.setRequestMethod("post");
|
||||||
|
requestLog.setResponseTime(DateUtil.formatDateTime(new Date()));
|
||||||
|
requestLog.setDuration(Convert.toStr(DateUtil.between(Convert.toDate(requestLog.getRequestTime()), Convert.toDate(requestLog.getResponseTime()), DateUnit.MS)));
|
||||||
|
requestLog.setIsSuccessful("1");
|
||||||
|
return requestLog;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,5 +173,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
FROM bas_cargo_space
|
FROM bas_cargo_space
|
||||||
GROUP BY status
|
GROUP BY status
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectEmptyCargoSpaceByWarehouseId" resultType="com.ruoyi.bas.cargoSpace.domain.BasCargoSpace">
|
||||||
|
SELECT TOP 1 cargo_space_id as cargoSpaceId
|
||||||
|
FROM bas_cargo_space
|
||||||
|
WHERE warehouse_id = #{warehouseId}
|
||||||
|
AND status = '1'
|
||||||
|
ORDER BY the_platoon, the_column, the_floor
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user