优化空托去向流程

main
Comair 1 year ago
parent faa65fdbec
commit 9af2432460
  1. 10
      shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java
  2. 2
      shkj-wms/src/main/java/com/shkj/wms/plc/PlcInit.java
  3. 15
      shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java
  4. 9
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java
  5. 4
      shkj-wms/src/main/java/com/shkj/wms/service/impl/IBusinEnptyContainerServiceImpl.java
  6. 5
      shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java
  7. 1
      shkj-wms/src/main/java/com/shkj/wms/third/rcs/RCSUtil.java
  8. 2
      shkj-wms/src/main/resources/mapper/wms/BusinDataTaskMapper.xml

@ -136,7 +136,7 @@ public class PlcEventTask {
private ScheduledExecutorService executorService = Executors.newScheduledThreadPool(8); private ScheduledExecutorService executorService = Executors.newScheduledThreadPool(8);
// @Scheduled(fixedRate = 200) @Scheduled(fixedRate = 200)
public void init() { public void init() {
//查询需要连接的PLC,初始化连接对象 //查询需要连接的PLC,初始化连接对象
List<WcsPlcConnectVo> plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1")); List<WcsPlcConnectVo> plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1"));
@ -219,7 +219,7 @@ public class PlcEventTask {
} }
} }
// @Scheduled(fixedRate = 200) @Scheduled(fixedRate = 200)
public void init1() { public void init1() {
//查询需要连接的PLC,初始化连接对象 //查询需要连接的PLC,初始化连接对象
List<WcsPlcConnectVo> plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1")); List<WcsPlcConnectVo> plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1"));
@ -237,7 +237,7 @@ public class PlcEventTask {
} }
} }
// @Scheduled(fixedRate = 200) @Scheduled(fixedRate = 200)
public void init2() { public void init2() {
//查询需要连接的PLC,初始化连接对象 //查询需要连接的PLC,初始化连接对象
List<WcsPlcConnectVo> plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1")); List<WcsPlcConnectVo> plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1"));
@ -255,7 +255,7 @@ public class PlcEventTask {
} }
} }
// @Scheduled(fixedDelay = 6000) @Scheduled(fixedDelay = 6000)
public void writePlcheartbeat() { public void writePlcheartbeat() {
//根据连接的plcId获取属性 //根据连接的plcId获取属性
PlcOperate plcOperate = plcInit.getPlcOperate_41(); PlcOperate plcOperate = plcInit.getPlcOperate_41();
@ -678,7 +678,7 @@ public class PlcEventTask {
LocalTime end = LocalTime.now(); LocalTime end = LocalTime.now();
Duration between = Duration.between(start, end); Duration between = Duration.between(start, end);
long seconds = between.getSeconds() % 60; long seconds = between.getSeconds() % 60;
log.info("执行plctask用时:" + seconds); // log.info("执行plctask用时:" + seconds);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

@ -42,7 +42,7 @@ public class PlcInit {
RedisTemplate redisTemplate; RedisTemplate redisTemplate;
private ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1); private ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1);
// @PostConstruct @PostConstruct
public void init(){ public void init(){
log.info("初始化连接对象"); log.info("初始化连接对象");
executorService.scheduleWithFixedDelay( executorService.scheduleWithFixedDelay(

@ -179,9 +179,9 @@ public class ScheduledTasks {
// @PostConstruct // @PostConstruct
// @Scheduled(cron = "0/3 * * * * ? ") // @Scheduled(cron = "0/3 * * * * ? ")
// @Scheduled(fixedRate = 200) @Scheduled(fixedRate = 200)
public void task() { public void task() {
log.info("开始获取需要执行的任务"); // log.info("开始获取需要执行的任务");
//获取待下发任务数据 //获取待下发任务数据
BusinTaskQueryBo taskQueryBo = new BusinTaskQueryBo(); BusinTaskQueryBo taskQueryBo = new BusinTaskQueryBo();
List<BusinDataTaskVo> businDataTaskVos = new ArrayList<>(); List<BusinDataTaskVo> businDataTaskVos = new ArrayList<>();
@ -234,7 +234,7 @@ public class ScheduledTasks {
taskQueryBo.setTaskType("22"); taskQueryBo.setTaskType("22");
List<BusinDataTaskVo> businDataTaskVo22 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); List<BusinDataTaskVo> businDataTaskVo22 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo);
businDataTaskVos.addAll(businDataTaskVo22); businDataTaskVos.addAll(businDataTaskVo22);
log.info("要执行的任务信息:"+JsonUtil.toJSONString(businDataTaskVos));
for (BusinDataTaskVo businDataTaskVo : businDataTaskVos) { for (BusinDataTaskVo businDataTaskVo : businDataTaskVos) {
doTask(businDataTaskVo); doTask(businDataTaskVo);
} }
@ -387,7 +387,7 @@ public class ScheduledTasks {
businDataTaskVo.setToLayer(locationVo.getLayer()); businDataTaskVo.setToLayer(locationVo.getLayer());
businDataTaskVo.setToRow(locationVo.getLocationRow()); businDataTaskVo.setToRow(locationVo.getLocationRow());
businDataTaskVo.setTunnel(tunnel); businDataTaskVo.setTunnel(tunnel);
businDataTaskVo.setLocationId(locationVo.getId()); businDataTaskVo.setLocationId(locationId);
//获取货位对应的巷道及巷道对应的设备信息 //获取货位对应的巷道及巷道对应的设备信息
pointQueryBo.setTunnel(tunnel); pointQueryBo.setTunnel(tunnel);
pointQueryBo.setDirection("0"); pointQueryBo.setDirection("0");
@ -1895,7 +1895,7 @@ public class ScheduledTasks {
/** /**
* 空治具出库流程 * 空治具出库流程
*/ */
// @Scheduled(cron = "0/5 * * * * ? ") @Scheduled(cron = "0/5 * * * * ? ")
public void exeEmptyContainerFromWare() { public void exeEmptyContainerFromWare() {
if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get(RedisConstant.out_empty_type))) { if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get(RedisConstant.out_empty_type))) {
log.info("暂未设置空治具出库"); log.info("暂未设置空治具出库");
@ -2071,6 +2071,8 @@ public class ScheduledTasks {
} else if (businDataTaskVo.getWarehouseType().equals("2")) { } else if (businDataTaskVo.getWarehouseType().equals("2")) {
randome = "P02"; randome = "P02";
} }
Long locationId =0L;
if ("P01".equals(randome)) { if ("P01".equals(randome)) {
//根据车型分配库位 先判断该任务是否已经分配了货位 //根据车型分配库位 先判断该任务是否已经分配了货位
Result<BaseLocationVo> locationVoResult = null; Result<BaseLocationVo> locationVoResult = null;
@ -2093,7 +2095,7 @@ public class ScheduledTasks {
redisTemplate.opsForValue().set("randome", "P02"); redisTemplate.opsForValue().set("randome", "P02");
BaseLocationVo locationVo = locationVoResult.getData(); BaseLocationVo locationVo = locationVoResult.getData();
String tunnel = locationVo.getTunnel(); String tunnel = locationVo.getTunnel();
Long locationId = locationVo.getId(); locationId = locationVo.getId();
for (BusinDataTaskGoodsVo businDataTaskGoodsVo : businDataTaskGoodsVos) { for (BusinDataTaskGoodsVo businDataTaskGoodsVo : businDataTaskGoodsVos) {
businDataTaskGoodsVo.setLocationId(locationId); businDataTaskGoodsVo.setLocationId(locationId);
} }
@ -2221,6 +2223,7 @@ public class ScheduledTasks {
BusinDataTask businDataTask = new BusinDataTask(); BusinDataTask businDataTask = new BusinDataTask();
businDataTask.setId(businDataTaskVo.getId()); businDataTask.setId(businDataTaskVo.getId());
businDataTask.setTaskStatus(TaskStatusEnum.wait_callback.getValue()); businDataTask.setTaskStatus(TaskStatusEnum.wait_callback.getValue());
businDataTask.setLocationId(locationId);
iBusinDataTaskService.updateById(businDataTask); iBusinDataTaskService.updateById(businDataTask);
return; return;
} }

@ -792,6 +792,7 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
} }
@Override
public synchronized Result<BaseLocationVo> assignEmptyLocationAll(AssingEmptyLocBo assingEmptyLocBo) { public synchronized Result<BaseLocationVo> assignEmptyLocationAll(AssingEmptyLocBo assingEmptyLocBo) {
BaseLocationVo locationVo = null; BaseLocationVo locationVo = null;
//bo等于空时,是空治具分配货位,否则是保险杠分配货位 //bo等于空时,是空治具分配货位,否则是保险杠分配货位
@ -1000,6 +1001,14 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
} }
/**
* 保险杠分配货位检查是否是双深位
* @param locationList
* @param batch
* @param vehicheModel
* @param businDataTaskGoodsVos
* @return
*/
//从选取的巷道中选择库位 //从选取的巷道中选择库位
private BaseLocationVo assginLocation(List<BaseLocationVo> locationList, String batch, String vehicheModel, List<BusinDataTaskGoodsVo> businDataTaskGoodsVos) { private BaseLocationVo assginLocation(List<BaseLocationVo> locationList, String batch, String vehicheModel, List<BusinDataTaskGoodsVo> businDataTaskGoodsVos) {
BaseLocationVo resultLocationVo = null; BaseLocationVo resultLocationVo = null;

@ -157,7 +157,7 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl<BaseContainerMa
} }
else if (stuats){ else if (stuats){
// Map map = checkWareForEmptycon(); // Map map = checkWareForEmptycon();
AssingEmptyLocBo emptyLocBo = new AssingEmptyLocBo(); AssingEmptyLocBo emptyLocBo = null;
Result<BaseLocationVo> locationVoResult=iBaseLocationService.assignEmptyLocationAll(emptyLocBo); Result<BaseLocationVo> locationVoResult=iBaseLocationService.assignEmptyLocationAll(emptyLocBo);
if (!Result.isOk(locationVoResult)){ if (!Result.isOk(locationVoResult)){
@ -175,7 +175,7 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl<BaseContainerMa
List<BasePointDeviceVo> basePointDeviceVos = baseLocationPlcMapper.selectBasePointByGroupno(pointQueryBo); List<BasePointDeviceVo> basePointDeviceVos = baseLocationPlcMapper.selectBasePointByGroupno(pointQueryBo);
if (basePointDeviceVos.size() > 0) { if (basePointDeviceVos.size() > 0) {
basePointDeviceVo = basePointDeviceVos.get(0); pointDeviceVo = basePointDeviceVos.get(0);
} }
agvType= String.valueOf(RCSTaskTypeEnum.TO_B_AND_PUT.getValue()); agvType= String.valueOf(RCSTaskTypeEnum.TO_B_AND_PUT.getValue());

@ -1053,6 +1053,7 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe
BusinDataTask businDataTask = iBusinDataTaskService.getById(taskId); BusinDataTask businDataTask = iBusinDataTaskService.getById(taskId);
BaseLocation baseLocation=null; BaseLocation baseLocation=null;
if (StringUtils.isNotEmpty(businDataTask.getLocationId().toString())){ if (StringUtils.isNotEmpty(businDataTask.getLocationId().toString())){
baseLocation= iBaseLocationService.getById(businDataTask.getLocationId()); baseLocation= iBaseLocationService.getById(businDataTask.getLocationId());
} }
@ -1143,9 +1144,9 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe
//将任务状态改为已完成 //将任务状态改为已完成
businDataTask.setTaskStatus(TaskStatusEnum.finished.getValue()); businDataTask.setTaskStatus(TaskStatusEnum.finished.getValue());
iBusinDataTaskService.updateById(businDataTask); return iBusinDataTaskService.updateById(businDataTask)? Result.ok():Result.err();
//回填入库状态,已完成入库 //回填入库状态,已完成入库
return businBillheadMapper.updateInfoBytaskCode(taskId) > 0 ? Result.ok():Result.err(); // return businBillheadMapper.updateInfoBytaskCode(taskId) > 0 ? Result.ok():Result.err();
} }
@Override @Override

@ -339,7 +339,6 @@ public class RCSUtil {
for (String point : points) { for (String point : points) {
RcsIdList rcsIdList = new RcsIdList(); RcsIdList rcsIdList = new RcsIdList();
rcsIdList.setId(point); rcsIdList.setId(point);
log.error(point);
idList.add(rcsIdList); idList.add(rcsIdList);
} }
dto.setTargets(idList); dto.setTargets(idList);

@ -249,7 +249,7 @@
<where> <where>
<if test="createTimeS !=null and createTimeS !=''"> <if test="createTimeS !=null and createTimeS !=''">
and DATE_FORMAT(task.create_time,'%Y-%m-%d')>=#{createTimeS} and DATE_FORMAT(task.create_time,'%Y-%m-%d')>=#{createTimeS}
</if> </if>
<if test="createTimeE !=null and createTimeE !=''"> <if test="createTimeE !=null and createTimeE !=''">

Loading…
Cancel
Save