wms出库流程测试修改
This commit is contained in:
@@ -4,14 +4,16 @@ import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@MapperScan("com.**.mapper")
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
@EnableScheduling
|
||||
public class RuoYiApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
|
||||
@@ -3,13 +3,10 @@ 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.job.mydojob.domain.MydoJob;
|
||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作业统计 Controller
|
||||
*/
|
||||
@@ -22,12 +19,12 @@ public class ToWcsApiController {
|
||||
private IToWcsService toWcsService;
|
||||
|
||||
/**
|
||||
* 推送AGV任务
|
||||
* @return
|
||||
* 推送CTU出库任务
|
||||
*/
|
||||
@PostMapping("/pushOutMydoJob")
|
||||
public AjaxResult pushOutMydoJob(@RequestBody MydoJob mydoJob) {
|
||||
return toWcsService.pushOutMydoJob(mydoJob);
|
||||
//@PostMapping("/pushOutMydoJob")
|
||||
@Scheduled(fixedDelay=10000)
|
||||
public void pushOutMydoJob() {
|
||||
toWcsService.pushOutMydoJob();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||
public interface IToWcsService {
|
||||
|
||||
|
||||
AjaxResult pushOutMydoJob(MydoJob mydoJob);
|
||||
void pushOutMydoJob();
|
||||
|
||||
AjaxResult pushAgvMoveJob(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.ruoyi.out.tagTask.service.ITagTaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -33,20 +34,30 @@ import java.util.List;
|
||||
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;
|
||||
|
||||
public static final String PUSH_OUT_MYDO_JOB = "http://localhost:8081/agv/api/receiveOutMydoJob";
|
||||
public static final String PUSH_AGV_MOVE_JOB = "http://localhost:8081/agv/api/receiveAgvMoveJob";
|
||||
|
||||
|
||||
@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();
|
||||
public void pushOutMydoJob() {
|
||||
//查询所有未推送的料箱出库作业
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setStatus("1");
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("21");
|
||||
list.add("23");
|
||||
mydoJobParam.setInOutIds(list);
|
||||
List<MydoJob> outMydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
||||
for (MydoJob outMydoJob : outMydoJobs) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(PUSH_OUT_MYDO_JOB, JSONUtil.toJsonStr(outMydoJob), "推送出库任务");
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
outMydoJob.setStatus("3");
|
||||
mydoJobService.updateMydoJob(outMydoJob);
|
||||
}
|
||||
}
|
||||
return AjaxResult.error(requestLog.getDuration());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -110,9 +110,6 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
mydoJobService.manualCompleted(inMydoJob);
|
||||
break;
|
||||
case "2":
|
||||
if (StrUtil.isEmpty(wmsJobRequest.getTrayCode())){
|
||||
return AjaxResult.error("托盘码不能为空");
|
||||
}
|
||||
if (StrUtil.isEmpty(wmsJobRequest.getPickSsj())){
|
||||
return AjaxResult.error("拣选工位不能为空");
|
||||
}
|
||||
@@ -121,12 +118,12 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
}
|
||||
//出库
|
||||
mydoJobParam.setTaskNo(wmsJobRequest.getTaskNo());
|
||||
mydoJobParam.setTrayCode(wmsJobRequest.getTrayCode());
|
||||
//mydoJobParam.setTrayCode(wmsJobRequest.getTrayCode());
|
||||
List<MydoJob> outMydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
||||
if (outMydoJobs.isEmpty()){
|
||||
return AjaxResult.error("没有该作业 taskNo: {}", wmsJobRequest.getTaskNo());
|
||||
}
|
||||
//mydoJobService.OuthandFinish(outMydoJobs.stream().map(MydoJob::getJobId).toArray(String[]::new));
|
||||
MydoJob outJob = outMydoJobs.get(0);
|
||||
//查询拣选工位绑定的电子标签
|
||||
BasTag tagParam = new BasTag();
|
||||
tagParam.setPickAdd(wmsJobRequest.getPickSsj());
|
||||
@@ -135,7 +132,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
return AjaxResult.error("没有该拣选工位绑定的电子标签");
|
||||
}
|
||||
BasTag basTag = tags.get(0);
|
||||
basTag.setTrayCode(wmsJobRequest.getTrayCode());
|
||||
basTag.setTrayCode(outJob.getTrayCode());
|
||||
iBasTagService.updateBasTag(basTag);
|
||||
//同步电子标签
|
||||
MydoJobDetail param = new MydoJobDetail();
|
||||
|
||||
@@ -5,15 +5,15 @@ import com.ruoyi.bas.tag.domain.BasTag;
|
||||
|
||||
/**
|
||||
* 电子标签Mapper接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
public interface BasTagMapper
|
||||
public interface BasTagMapper
|
||||
{
|
||||
/**
|
||||
* 查询电子标签
|
||||
*
|
||||
*
|
||||
* @param id 电子标签主键
|
||||
* @return 电子标签
|
||||
*/
|
||||
@@ -21,7 +21,7 @@ public interface BasTagMapper
|
||||
|
||||
/**
|
||||
* 查询电子标签列表
|
||||
*
|
||||
*
|
||||
* @param basTag 电子标签
|
||||
* @return 电子标签集合
|
||||
*/
|
||||
@@ -29,7 +29,7 @@ public interface BasTagMapper
|
||||
|
||||
/**
|
||||
* 新增电子标签
|
||||
*
|
||||
*
|
||||
* @param basTag 电子标签
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ public interface BasTagMapper
|
||||
|
||||
/**
|
||||
* 修改电子标签
|
||||
*
|
||||
*
|
||||
* @param basTag 电子标签
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ public interface BasTagMapper
|
||||
|
||||
/**
|
||||
* 删除电子标签
|
||||
*
|
||||
*
|
||||
* @param id 电子标签主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -53,9 +53,11 @@ public interface BasTagMapper
|
||||
|
||||
/**
|
||||
* 批量删除电子标签
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasTagByIds(Long[] ids);
|
||||
|
||||
BasTag selectBasTagByTrayCode(String trayCode);
|
||||
}
|
||||
|
||||
@@ -5,15 +5,15 @@ import com.ruoyi.bas.tag.domain.BasTag;
|
||||
|
||||
/**
|
||||
* 电子标签Service接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
public interface IBasTagService
|
||||
public interface IBasTagService
|
||||
{
|
||||
/**
|
||||
* 查询电子标签
|
||||
*
|
||||
*
|
||||
* @param id 电子标签主键
|
||||
* @return 电子标签
|
||||
*/
|
||||
@@ -21,7 +21,7 @@ public interface IBasTagService
|
||||
|
||||
/**
|
||||
* 查询电子标签列表
|
||||
*
|
||||
*
|
||||
* @param basTag 电子标签
|
||||
* @return 电子标签集合
|
||||
*/
|
||||
@@ -29,7 +29,7 @@ public interface IBasTagService
|
||||
|
||||
/**
|
||||
* 新增电子标签
|
||||
*
|
||||
*
|
||||
* @param basTag 电子标签
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ public interface IBasTagService
|
||||
|
||||
/**
|
||||
* 修改电子标签
|
||||
*
|
||||
*
|
||||
* @param basTag 电子标签
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ public interface IBasTagService
|
||||
|
||||
/**
|
||||
* 批量删除电子标签
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的电子标签主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -53,9 +53,16 @@ public interface IBasTagService
|
||||
|
||||
/**
|
||||
* 删除电子标签信息
|
||||
*
|
||||
*
|
||||
* @param id 电子标签主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasTagById(Long id);
|
||||
|
||||
/**
|
||||
* 根据托盘码查询电子标签
|
||||
* @param trayCode
|
||||
* @return
|
||||
*/
|
||||
BasTag selectBasTagByTrayCode(String trayCode);
|
||||
}
|
||||
|
||||
@@ -9,19 +9,19 @@ import com.ruoyi.bas.tag.service.IBasTagService;
|
||||
|
||||
/**
|
||||
* 电子标签Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@Service
|
||||
public class BasTagServiceImpl implements IBasTagService
|
||||
public class BasTagServiceImpl implements IBasTagService
|
||||
{
|
||||
@Autowired
|
||||
private BasTagMapper basTagMapper;
|
||||
|
||||
/**
|
||||
* 查询电子标签
|
||||
*
|
||||
*
|
||||
* @param id 电子标签主键
|
||||
* @return 电子标签
|
||||
*/
|
||||
@@ -33,7 +33,7 @@ public class BasTagServiceImpl implements IBasTagService
|
||||
|
||||
/**
|
||||
* 查询电子标签列表
|
||||
*
|
||||
*
|
||||
* @param basTag 电子标签
|
||||
* @return 电子标签
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ public class BasTagServiceImpl implements IBasTagService
|
||||
|
||||
/**
|
||||
* 新增电子标签
|
||||
*
|
||||
*
|
||||
* @param basTag 电子标签
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -57,7 +57,7 @@ public class BasTagServiceImpl implements IBasTagService
|
||||
|
||||
/**
|
||||
* 修改电子标签
|
||||
*
|
||||
*
|
||||
* @param basTag 电子标签
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -69,7 +69,7 @@ public class BasTagServiceImpl implements IBasTagService
|
||||
|
||||
/**
|
||||
* 批量删除电子标签
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的电子标签主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -81,7 +81,7 @@ public class BasTagServiceImpl implements IBasTagService
|
||||
|
||||
/**
|
||||
* 删除电子标签信息
|
||||
*
|
||||
*
|
||||
* @param id 电子标签主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -90,4 +90,9 @@ public class BasTagServiceImpl implements IBasTagService
|
||||
{
|
||||
return basTagMapper.deleteBasTagById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasTag selectBasTagByTrayCode(String trayCode) {
|
||||
return basTagMapper.selectBasTagByTrayCode(trayCode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 任务表对象 mydo_job
|
||||
*
|
||||
@@ -127,6 +129,15 @@ public class MydoJob extends BaseEntity
|
||||
|
||||
private String inOut;
|
||||
|
||||
private List<String> inOutIds;
|
||||
|
||||
public List<String> getInOutIds() {
|
||||
return inOutIds;
|
||||
}
|
||||
|
||||
public void setInOutIds(List<String> inOutIds) {
|
||||
this.inOutIds = inOutIds;
|
||||
}
|
||||
|
||||
public String getDepartmentName() {
|
||||
return departmentName;
|
||||
|
||||
@@ -122,7 +122,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
String resStr = HttpUtil.post(url, param);
|
||||
requestLog.setResponseBody(resStr);
|
||||
AjaxResult bean = JSONUtil.toBean(resStr, AjaxResult.class);
|
||||
if (Convert.toInt(bean.get("code")) == 0) {
|
||||
if (Convert.toInt(bean.get("code")) == 200) {
|
||||
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)));
|
||||
|
||||
@@ -107,7 +107,7 @@ public class TagTaskController extends BaseController
|
||||
/**
|
||||
* 传入电子标签信息
|
||||
*/
|
||||
@Scheduled(fixedDelay = 2000)
|
||||
//@Scheduled(fixedDelay = 2000)
|
||||
public void tagManager(){
|
||||
tagTaskService.tagManager();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import com.ruoyi.bas.containerDetails.domain.BasContainerDetails;
|
||||
import com.ruoyi.bas.containerDetails.service.IBasContainerDetailsService;
|
||||
import com.ruoyi.bas.port.domain.BasProductPort;
|
||||
import com.ruoyi.bas.port.mapper.BasProductPortMapper;
|
||||
import com.ruoyi.bas.tag.domain.BasTag;
|
||||
import com.ruoyi.bas.tag.service.IBasTagService;
|
||||
import com.ruoyi.check.commit.domain.CheckCommitRecord;
|
||||
import com.ruoyi.check.commit.service.ICheckCommitRecordService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@@ -85,6 +87,8 @@ public class PdaServiceImp implements PdaService {
|
||||
private IOutPickSubmitService outPickSubmitService;
|
||||
@Autowired
|
||||
private ITagTaskService tagTaskService;
|
||||
@Autowired
|
||||
private IBasTagService basTagService;
|
||||
|
||||
/**
|
||||
* 空托盘入库
|
||||
@@ -373,6 +377,18 @@ public class PdaServiceImp implements PdaService {
|
||||
List<MydoJobDetail> currentMydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(mydoJobDetailParam);
|
||||
boolean flag = currentMydoJobDetails.stream().allMatch(mydoJobDetail -> mydoJobDetail.getPickQuantity().equals(mydoJobDetail.getOutQuantity()));
|
||||
if (flag) {
|
||||
|
||||
BasTag basTag = basTagService.selectBasTagByTrayCode(trayCodeMakeSure.getTrayCode());
|
||||
//删除电子标签
|
||||
TagTask param = new TagTask();
|
||||
param.setTagId(basTag.getId());
|
||||
List<TagTask> tagTasks = tagTaskService.selectTagTaskList(param);
|
||||
if (CollUtil.isNotEmpty(tagTasks)) {
|
||||
tagTaskService.deleteTagTaskByIds(tagTasks.stream()
|
||||
.map(TagTask::getId)
|
||||
.toArray(Long[]::new));
|
||||
}
|
||||
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||
map.put("v_type", "1");
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.bas.tag.mapper.BasTagMapper">
|
||||
|
||||
|
||||
<resultMap type="BasTag" id="BasTagResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="ip" column="ip" />
|
||||
@@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectBasTagList" parameterType="BasTag" resultMap="BasTagResult">
|
||||
<include refid="selectBasTagVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="ip != null and ip != ''"> and ip = #{ip}</if>
|
||||
<if test="pickAdd != null and pickAdd != ''"> and pick_add = #{pickAdd}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
@@ -33,11 +33,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectBasTagById" parameterType="Long" resultMap="BasTagResult">
|
||||
<include refid="selectBasTagVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectBasTagByTrayCode" resultMap="BasTagResult">
|
||||
<include refid="selectBasTagVo"/>
|
||||
where tray_code = #{trayCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertBasTag" parameterType="BasTag" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bas_tag
|
||||
@@ -83,9 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBasTagByIds" parameterType="String">
|
||||
delete from bas_tag where id in
|
||||
delete from bas_tag where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -88,6 +88,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="inOut != null and inOut != '' and inOut =='1'.toString "> and mj.in_or_out < 20</if>
|
||||
<if test="inOut != null and inOut != '' and inOut =='3'.toString "> and mj.in_or_out in (5,6)</if>
|
||||
<if test="inOut != null and inOut != '' and inOut =='4'.toString "> and mj.in_or_out in (25,26)</if>
|
||||
<if test = "inOutIds !=null and inOutIds.size() > 0">
|
||||
and mj.in_or_out in
|
||||
<foreach item="item" index="index" collection="inOutIds" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
|
||||
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
|
||||
${params.warehouseDataScope}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user