优化0116
This commit is contained in:
@@ -71,6 +71,7 @@ public interface MydoJobMapper
|
||||
void InvalidMydoJob(HashMap<String, Object> map);
|
||||
|
||||
MydoJob selectMydoJobByExitList(@Param("exitList") List<String> exitList );
|
||||
MydoJob selectMydoJobByExitList1(@Param("exitList") List<String> exitList ,@Param("roadwayId") String roadwayId);
|
||||
|
||||
void insertHistory(String jobId);
|
||||
|
||||
@@ -85,4 +86,6 @@ public interface MydoJobMapper
|
||||
List<MydoJob> getInJobByEntrance(@Param("exitList") List<String> exitList);
|
||||
|
||||
MydoJob selectJobByTaskNo(String taskNo);
|
||||
|
||||
MydoJob selectMydoJobByEntranceList1(@Param("entranceId") String entranceId);
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ public interface IMydoJobService
|
||||
boolean InvalidMydoJob(Long rwh, Integer id);
|
||||
|
||||
MydoJob selectMydoJobByExitList(List<String> exitList);
|
||||
MydoJob selectMydoJobByExitList1(List<String> exitList,String roadwayId);
|
||||
|
||||
void insertHistory(String jobId);
|
||||
|
||||
@@ -80,4 +81,6 @@ public interface IMydoJobService
|
||||
List<MydoJob> getInJobByEntrance(List<String> exitList);
|
||||
|
||||
MydoJob selectJobByTaskNo(String taskNo);
|
||||
|
||||
MydoJob selectMydoJobByEntranceList1(String entranceId);
|
||||
}
|
||||
|
||||
@@ -134,6 +134,11 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
return mydoJobMapper.selectMydoJobByExitList(exitList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByExitList1(List<String> exitList ,String roadwayId) {
|
||||
return mydoJobMapper.selectMydoJobByExitList1(exitList,roadwayId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertHistory(String jobId) {
|
||||
mydoJobMapper.insertHistory(jobId);
|
||||
@@ -149,6 +154,11 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
return mydoJobMapper.selectMydoJobByEntranceList(entranceList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByEntranceList1(String entranceId) {
|
||||
return mydoJobMapper.selectMydoJobByEntranceList1(entranceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob) {
|
||||
return mydoJobMapper.selectMydoJobFinishList(mydoJob);
|
||||
|
||||
@@ -99,7 +99,8 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
||||
if (ssj.getDw() == 1 && ssj.getTaskNo() > 1000) {
|
||||
int taskNo = ssj.getTaskNo();
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(taskNo));
|
||||
if (ObjUtil.isNotNull(mydoJob) && TASK_STATUS_CREATE.equals(mydoJob.getStatus()) && TASK_EP_SSJ.equals(mydoJob.getExecutionPhase()) && Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
if (ObjUtil.isNotNull(mydoJob) && TASK_STATUS_CREATE.equals(mydoJob.getStatus())
|
||||
&& TASK_EP_SSJ.equals(mydoJob.getExecutionPhase()) && Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
//修改作业执行状态
|
||||
mydoJob.setStatus(TASK_STATUS_RUNNING);
|
||||
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
@@ -109,7 +110,7 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
||||
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)) {
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ) && Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_3, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
List<Integer> pclList = roadwayMap.get(ssj.getDeviceCode());
|
||||
|
||||
@@ -41,9 +41,6 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
private final Map<String, List<Integer>> roadwayMap = new HashMap<>();
|
||||
private IJobCallBackService jobCallBackService;
|
||||
|
||||
private final Map<String,DeviceSsj> roadwayOutMap = new HashMap<>();
|
||||
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
@@ -51,14 +48,11 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<DeviceSsj> roadway1 = new ArrayList<>();
|
||||
roadway1.add(PlcSsjRead.deviceSsjMap.get("L2003"));
|
||||
roadway1.add(PlcSsjRead.deviceSsjMap.get("L2004"));
|
||||
roadwayOutMap.put("L2003", PlcSsjRead.deviceSsjMap.get("L2004"));
|
||||
ssjCodeList.put("roadway1", roadway1);
|
||||
ArrayList<DeviceSsj> roadway2 = new ArrayList<>();
|
||||
roadway2.add(PlcSsjRead.deviceSsjMap.get("L2005"));
|
||||
roadway2.add(PlcSsjRead.deviceSsjMap.get("L2006"));
|
||||
roadwayOutMap.put("L2005", PlcSsjRead.deviceSsjMap.get("L2006"));
|
||||
ssjCodeList.put("roadway2", roadway2);
|
||||
|
||||
ArrayList<DeviceSsj> ou1 = new ArrayList<>();
|
||||
ou1.add(PlcSsjRead.deviceSsjMap.get("L2004"));
|
||||
ssjCodeList.put("ou1", ou1);
|
||||
@@ -66,7 +60,13 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
out2.add(PlcSsjRead.deviceSsjMap.get("L2006"));
|
||||
ssjCodeList.put("out2", out2);
|
||||
|
||||
ArrayList<DeviceSsj> roadway1Both = new ArrayList<>();
|
||||
roadway1Both.add(PlcSsjRead.deviceSsjMap.get("L2001"));
|
||||
ssjCodeList.put("roadway1Both", roadway1Both);
|
||||
|
||||
ArrayList<DeviceSsj> roadway2Both = new ArrayList<>();
|
||||
roadway2Both.add(PlcSsjRead.deviceSsjMap.get("L2007"));
|
||||
ssjCodeList.put("roadway2Both", roadway2Both);
|
||||
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
@@ -111,6 +111,7 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
|
||||
if (ssj.getTaskNo() > 0) {
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(ssj.getTaskNo()));
|
||||
if(Convert.toInt(mydoJob.getInOrOut()) > 20){
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
@@ -132,7 +133,7 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -142,13 +143,28 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
* 出库堆垛机队列生成
|
||||
*/
|
||||
public void dispatch(List<DeviceSsj> ssjList) {
|
||||
DeviceSsj deviceSsj = roadwayOutMap.get(ssjList.get(0).getDeviceCode());
|
||||
DeviceSsj deviceSsj = ssjList.get(0);
|
||||
DeviceSsj ssj = new DeviceSsj();
|
||||
String roadwayId = "";
|
||||
String entrance_id = "";
|
||||
if ("L2003".equals(deviceSsj.getDeviceCode())) {
|
||||
roadwayId = "1";
|
||||
ssj = ssjCodeList.get("roadway1Both").get(0);
|
||||
entrance_id = "L2004";
|
||||
|
||||
}
|
||||
if("L2005".equals(deviceSsj.getDeviceCode())) {
|
||||
roadwayId = "2";
|
||||
ssj = ssjCodeList.get("roadway2Both").get(0);
|
||||
entrance_id = "L2006";
|
||||
}
|
||||
|
||||
List<String> exitList = new ArrayList<>();
|
||||
exitList.add("1");
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList(exitList);
|
||||
MydoJob inJob = mydoJobService.selectMydoJobByEntranceList(Collections.singletonList(deviceSsj.getDeviceCode()));
|
||||
boolean allKx = ssjList.stream().allMatch(ssj -> ssj.getKx() == 1);
|
||||
if (ObjUtil.isNotNull(mydoJob) && allKx && ObjUtil.isNull(inJob) && deviceSsj.getInOrOut() == 1) {
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1(exitList, roadwayId);
|
||||
MydoJob inJob = mydoJobService.selectMydoJobByEntranceList1(entrance_id);
|
||||
if (ObjUtil.isNotNull(mydoJob) && deviceSsj.getKx() == 1 && ssj.getKx() == 0
|
||||
&& ObjUtil.isNull(inJob) && ssj.getInOrOut() == 1) {
|
||||
//所有线体为空闲 并且存在出库作业 并且不存在入库作业
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
if (ObjUtil.isNull(basCargoSpace)) {
|
||||
|
||||
@@ -152,7 +152,14 @@ public class Floor1SingleSsjThread implements Runnable {
|
||||
if (ssj.getKx() == 1) {
|
||||
List<String> exitList = new ArrayList<>();
|
||||
exitList.add("1");
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList(exitList);
|
||||
String roadwayId = "";
|
||||
if("L2001".equals(ssj.getDeviceCode())){
|
||||
roadwayId = "1";
|
||||
}
|
||||
if("L2007".equals(ssj.getDeviceCode())){
|
||||
roadwayId = "2";
|
||||
}
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1(exitList,roadwayId);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
if (ObjUtil.isNull(basCargoSpace)) {
|
||||
|
||||
@@ -99,7 +99,8 @@ public class Floor2RoadWaySsjThread implements Runnable {
|
||||
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)) {
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)
|
||||
&& Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_1, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||
|
||||
@@ -114,6 +114,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by priority desc,create_time
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByExitList1" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size from mydo_job_wcs
|
||||
where exit_id in
|
||||
<foreach item="item" index="index" collection="exitList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and roadway_id = #{roadwayId}
|
||||
and in_or_out > 20
|
||||
and status = 1 and execution_phase= 0
|
||||
order by priority desc,create_time
|
||||
</select>
|
||||
|
||||
<insert id="insertMydoJob" parameterType="MydoJob">
|
||||
insert into mydo_job_wcs
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -239,6 +251,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and in_or_out <= 20 and status = 3
|
||||
order by priority desc,create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByEntranceList1" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag, tray_code from mydo_job_wcs
|
||||
where entrance_id = #{entranceId}
|
||||
and in_or_out <= 20 and status = 3
|
||||
order by priority desc,create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobFinishList" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobFinishVo"/>
|
||||
<where>
|
||||
|
||||
Reference in New Issue
Block a user