Browse Source

叠盘机测高已可用,改为自动同步

master
psh 7 months ago
parent
commit
8a40def0bb
  1. 5
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/fold_disc_site/FoldDiscSiteDeviceDriver.java
  2. 64
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/ssx_site/SsxSiteDeviceDriver.java
  3. 13
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/RkDto.java
  4. 11
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/SckbDto.java
  5. 31
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/impl/BoardServiceImpl.java
  6. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java
  7. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java

5
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/fold_disc_site/FoldDiscSiteDeviceDriver.java

@ -112,6 +112,11 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
if (number != last_number) {
int max_emptypalletnum = Integer.parseInt(this.getDevice().getExtraValue().get("max_emptypalletnum").toString());
JSONObject json = new JSONObject();
json.put("number", number);
json.put("device_code",device_code);
json.put("type",1);
acsToWmsService.notify(json);
if (number == max_emptypalletnum) {
this.requireSucess = false;
}

64
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/ssx_site/SsxSiteDeviceDriver.java

@ -95,7 +95,7 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
private Date instruction_require_time = new Date();
private Date instruction_finished_time = new Date();
private int instruction_require_time_out;
private int instruction_require_time_out = 3000;
boolean requireSucess = false;
boolean resultSucess = false;
@ -173,51 +173,85 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
if (error != last_error) {
}
if (move != last_move) {
if (move != last_move && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("point_qty", move);
json.put("point_qty", move==0?"无货":"有货");
json.put("type",2);
acsToWmsService.notify(json);
}
if (!Objects.equals(mother_tray, last_mother_tray)) {
if (!Objects.equals(mother_tray, last_mother_tray)&& "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("mother_tray", mother_tray);
json.put("type",2);
acsToWmsService.notify(json);
}
if (!Objects.equals(sub_tray, last_sub_tray)) {
if (!Objects.equals(sub_tray, last_sub_tray)&& "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("sub_tray", sub_tray);
json.put("type",2);
acsToWmsService.notify(json);
}
if (device_type != last_device_type) {
if (device_type != last_device_type && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("device_type", device_type);
json.put("device_type", device_type==0?"正常":"异常");
json.put("type",2);
acsToWmsService.notify(json);
}
if (frame_type != last_frame_type) {
if (frame_type != last_frame_type && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("frame_type", frame_type);
json.put("frame_type", frame_type==0?"正常":"异常");
json.put("type",2);
acsToWmsService.notify(json);
}
if (mother_type != last_mother_type) {
if (mother_type != last_mother_type && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("sub_type", sub_type);
json.put("sub_type", sub_type==0?"正常":"异常");
json.put("type",2);
acsToWmsService.notify(json);
}
if (sub_type != last_sub_type) {
if (sub_type != last_sub_type && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("sub_type", sub_type);
json.put("sub_type", sub_type==0?"正常":"异常");
json.put("type",2);
acsToWmsService.notify(json);
}
if (error_code != last_error_code) {
if (error_code != last_error_code && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("error", error_code);
String errorCode="";
switch (error_code){
case 0:
errorCode="无报警";
break;
case 1:
errorCode="超高";
break;
case 10:
errorCode="左超宽";
break;
case 100:
errorCode="右超宽";
break;
case 1000:
errorCode="前超长";
break;
case 10000:
errorCode="后超长";
break;
case 100000:
errorCode="超重";
break;
default:
break;
}
json.put("error", errorCode);
json.put("type",2);
acsToWmsService.notify(json);
}

13
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/RkDto.java

@ -0,0 +1,13 @@
package org.nl.wms.board.service.dao.dto;
import lombok.Data;
import java.util.List;
@Data
public class RkDto {
private KcDto kc;
private HwDto hw;
private List<WlDto> kn;
private List<WlDto> wrk;
}

11
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/SckbDto.java

@ -0,0 +1,11 @@
package org.nl.wms.board.service.dao.dto;
import lombok.Data;
import java.util.List;
@Data
public class SckbDto {
private List<ScDto> pt;
private List<ScDto> ks;
}

31
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/impl/BoardServiceImpl.java

@ -2,6 +2,7 @@ package org.nl.wms.board.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.utils.RedisUtils;
import org.nl.wms.board.service.BoardService;
@ -26,14 +27,6 @@ public class BoardServiceImpl implements BoardService {
if (czDto == null) {
czDto = new CzDto();
}
redisUtils.set("mother_tray",0);
redisUtils.set("sub_tray",0);
redisUtils.set("device_type",0);
redisUtils.set("frame_type",0);
redisUtils.set("mother_type",0);
redisUtils.set("sub_type",0);
redisUtils.set("point_qty",0);
czDto.setMother_tray(String.valueOf(redisUtils.get("mother_tray")));
czDto.setPoint_qty(String.valueOf(redisUtils.get("point_qty")));
czDto.setDevice_type((Integer) redisUtils.get("device_type"));
@ -41,7 +34,7 @@ public class BoardServiceImpl implements BoardService {
czDto.setMother_type((Integer) redisUtils.get("mother_type"));
czDto.setSub_type((Integer) redisUtils.get("sub_type"));
czDto.setError((Integer) redisUtils.get("error"));
return JSONObject.parseObject(JSON.toJSONString(czDto));
return JSONObject.parseObject(JSON.toJSONString(czDto, SerializerFeature.WriteNullStringAsEmpty));
}
public JSONObject rk() {
@ -50,18 +43,18 @@ public class BoardServiceImpl implements BoardService {
HwDto hwDto = boardMapper.hw();
List<WlDto> knList = boardMapper.kn();
List<WlDto> wrkList = boardMapper.wrk();
JSONObject jsonObject = new JSONObject();
jsonObject.put("kc", kcDto);
jsonObject.put("hw", hwDto);
jsonObject.put("kn", knList);
jsonObject.put("wrk", wrkList);
return jsonObject;
RkDto rkDto = new RkDto();
rkDto.setKc(kcDto);
rkDto.setHw(hwDto);
rkDto.setKn(knList);
rkDto.setWrk(wrkList);
return JSONObject.parseObject(JSON.toJSONString(rkDto, SerializerFeature.WriteNullStringAsEmpty));
}
public JSONObject sc() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("pt", boardMapper.sc("HW"));
jsonObject.put("ks", boardMapper.sc("HWK"));
return jsonObject;
SckbDto sckbDto = new SckbDto();
sckbDto.setPt(boardMapper.sc("HW"));
sckbDto.setKs(boardMapper.sc("HWK"));
return JSONObject.parseObject(JSON.toJSONString(sckbDto, SerializerFeature.WriteNullStringAsEmpty));
}
}

15
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java

@ -23,6 +23,7 @@ import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.point.service.impl.SchBasePointServiceImpl;
import org.nl.wms.sch.task.service.ISchBaseTaskService;
import org.nl.wms.sch.task.service.dao.SchBaseTask;
import org.nl.wms.sch.task_manage.AbstractTask;
@ -170,9 +171,17 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
public BaseResponse notify(JSONObject param) {
String requestNo = param.getString("requestNo");
log.info("notifyAcs - 请求参数 {}", param);
// 遍历所有键
for(String key:param.keySet()){
redisUtils.set(key,param.getString(key));
if(param.getInteger("type")==1){
//叠盘机高度同步
SchBasePoint schBasePoint= pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, param.getString("device_code")));
schBasePoint.setVehicle_qty(param.getInteger("number"));
pointService.update(schBasePoint);
}else if(param.getInteger("type")==2) {
// 输送线看板展示字段同步
for (String key : param.keySet()) {
redisUtils.set(key, param.getString(key));
}
}
return BaseResponse.responseOk(requestNo, "反馈成功!");
}

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java

@ -80,7 +80,6 @@ public class POINTTask extends AbstractTask {
.eq(SchBasePoint::getPoint_code, task.getPoint_code2()));
//如果是叠盘位,根据当前数量+1为目标地址
int qty=nextSchBasePoint.getVehicle_qty()+1;
log.info("当前叠盘位完成任务次数为");
task.setPoint_code2(task.getPoint_code2().substring(0,task.getPoint_code2().length()-1)+qty);
}
task.setVehicle_code(schBasePoint.getVehicle_code());
@ -175,7 +174,8 @@ public class POINTTask extends AbstractTask {
endPointObj.setVehicle_code(taskObj.getVehicle_code());
endPointObj.setVehicle_code2(taskObj.getVehicle_code2());
if(endPointObj.getPoint_code().startsWith("DKT")){
endPointObj.setVehicle_qty(endPointObj.getVehicle_qty()+1);
//叠盘机数量由acs同步,无需维护
// endPointObj.setVehicle_qty(endPointObj.getVehicle_qty()+1);
}else {
endPointObj.setVehicle_qty(1);
}

Loading…
Cancel
Save