| | |
| | | <relativePath/> <!-- lookup parent from repository --> |
| | | </parent> |
| | | <groupId>com.zy</groupId> |
| | | <artifactId>wxwcs</artifactId> |
| | | <artifactId>jdzwcs</artifactId> |
| | | <version>1.0.0</version> |
| | | <packaging>war</packaging> |
| | | |
| | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <finalName>wxwcs</finalName> |
| | | <finalName>jdzwcs</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.AppAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CarryParam; |
| | | import com.zy.asrs.entity.param.TaskOverParam; |
| | | import com.zy.asrs.entity.param.WMSAndAGVInterfaceParam; |
| | | import com.zy.asrs.entity.param.TaskCreateParam; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.web.BaseController; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | |
| | | import static org.apache.ibatis.ognl.OgnlRuntime.setFieldValue; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | |
| | | private StaDescService staDescService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private BasCrnErrorService basCrnErrorService; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | |
| | | //任务下发接口 |
| | | @PostMapping("/outboundTaskSend") |
| | | @Transactional |
| | | public R outboundTaskSend(@RequestHeader String appkey, |
| | | @RequestBody List<CarryParam> params, |
| | | HttpServletRequest request) { |
| | | //auth(appkey, params, request); |
| | | public HashMap<String, Object> outboundTaskSend(@RequestBody HashMap<String,Object> hashMap) { |
| | | String jsonString = JSON.toJSONString(hashMap.get("TaskList")); |
| | | List<CarryParam> params= JSONObject.parseArray(jsonString,CarryParam.class); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<WMSAndAGVInterfaceParam> params1 =new ArrayList<>(); |
| | | for (CarryParam param:params){ |
| | | |
| | | if (Cools.isEmpty(param)){ |
| | | return R.error("参数为空!"); |
| | | map.put("Code","0"); |
| | | map.put("Msg","参数为空!"); |
| | | return map; |
| | | } else if (Cools.isEmpty(param.getTaskNo())){ |
| | | return R.error("任务号为空!"); |
| | | } else if (Cools.isEmpty(param.getIoType())){ |
| | | return R.error("任务类型为空!"); |
| | | map.put("Code","0"); |
| | | map.put("Msg","任务号为空!"); |
| | | return map; |
| | | } else if (Cools.isEmpty(param.getStereoscopicTaskType())){ |
| | | map.put("Code","0"); |
| | | map.put("Msg","任务类型为空!"); |
| | | return map; |
| | | } |
| | | if (Cools.isEmpty(param.getStartPoint()) || Cools.isEmpty(param.getTargetPoint())){ |
| | | return R.error("初始目标或者目标位为空"); |
| | | } |
| | | // if (Cools.isEmpty(param.getContainerCode())){ |
| | | // return R.error("容器编码(托盘码)为空!"); |
| | | // } |
| | | // if (Cools.isEmpty(param.getEmptyContainer())){ |
| | | // return R.error("是否空托盘信号为空!"); |
| | | // } |
| | | // if (!param.getTaskType().equals("YK")){ |
| | | // if (Cools.isEmpty(param.getTargetWharf())){ |
| | | // return R.error("目标码头区域为空!");//G开头=7车间,H开头=8层,J开头=9车间 |
| | | // } |
| | | // } |
| | | |
| | | String fusion = Utils.Fusion(param.getOriginalRowNo(), param.getOriginalFloorNo(), param.getOriginalColumnNo()); |
| | | param.setStartPoint(fusion); |
| | | LocMast locMast = locMastService.selectByLocNo(param.getStartPoint()); |
| | | if(Cools.isEmpty(locMast)){ |
| | | return R.error("初始库位无法找到"); |
| | | map.put("Code","0"); |
| | | map.put("Msg","初始库位无法找到!"); |
| | | return map; |
| | | } |
| | | |
| | | R r = null; |
| | | HashMap<String,Object> r = new HashMap<>(); |
| | | |
| | | if(param.getIoType() == 2){ |
| | | if(param.getStereoscopicTaskType() == 2){ |
| | | //出库任务创建 |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("type_no",2) |
| | | .eq("crn_no",locMast.getCrnNo()) |
| | | .eq("stn_no",param.getTargetPoint())); |
| | | .eq("stn_no",param.getTerminalNo())); |
| | | if(Cools.isEmpty(staDesc)){ |
| | | return R.error("出库路劲不存在"); |
| | | map.put("Code","0"); |
| | | map.put("Msg","出库路劲不存在!"); |
| | | return map; |
| | | } |
| | | r = openService.taskCreate(new TaskCreateParam(param,staDesc.getCrnNo())); |
| | | }else if (param.getIoType() == 3){ |
| | | if(r.get("Code").equals("0")){ |
| | | return r; |
| | | } |
| | | }else if (param.getStereoscopicTaskType() == 3){ |
| | | String fusion1 = Utils.Fusion(param.getGoalRowNo(), param.getGoalFloorNo(), param.getGoalColumnNo()); |
| | | param.setTerminalNo(fusion1); |
| | | //移库任务创建 |
| | | r = openService.taskCreate(new TaskCreateParam(param,locMast.getCrnNo())); |
| | | if(r.get("Code").equals("0")){ |
| | | return r; |
| | | } |
| | | } |
| | | |
| | | apiLogService.save("Wms任务下发接口" |
| | | ,request.getRemoteAddr()+request.getRequestURI() |
| | | ,appkey |
| | | ,"" |
| | | ,request.getRemoteAddr() |
| | | ,JSON.toJSONString(param) |
| | | ,r.toString() |
| | | ,true |
| | | ); |
| | | |
| | | } |
| | | |
| | | return R.ok(); |
| | | map.put("Code","1"); |
| | | map.put("Msg","ok"); |
| | | return map; |
| | | } |
| | | |
| | | //任务取消接口 |
| | |
| | | } |
| | | |
| | | //设备状态查询接口 |
| | | @PostMapping("/deviceStatus") |
| | | @GetMapping("/deviceStatus") |
| | | @Transactional |
| | | public R deviceStatus(@RequestHeader String appkey, |
| | | HttpServletRequest request) { |
| | | auth(appkey, "设备状态查询接口", request); |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<Object> list = new ArrayList<>(); |
| | | for (BasDevp basDevp:basDevps){ |
| | | list.add(basDevp); |
| | | } |
| | | public R deviceStatus() { |
| | | List<CrnStatusParam> crnStatusParams=new ArrayList<>(); |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | | for (BasCrnp basCrnp:basCrnps){ |
| | | list.add(basCrnp); |
| | | CrnStatusParam crnStatusParam=new CrnStatusParam(); |
| | | crnStatusParam.setCrnNo(basCrnp.getCrnNo()); |
| | | crnStatusParam.setCrnSts(basCrnp.getCrnSts()); |
| | | crnStatusParam.setErrorCode(basCrnp.getCrnErr()); |
| | | BasCrnError error=basCrnErrorService.selectOne(new EntityWrapper<BasCrnError>().eq("error_code",basCrnp.getCrnErr())); |
| | | if(Cools.isEmpty(error)){ |
| | | crnStatusParam.setErrorMsg(""); |
| | | }else { |
| | | crnStatusParam.setErrorMsg(error.getErrName()); |
| | | } |
| | | crnStatusParams.add(crnStatusParam); |
| | | } |
| | | return R.ok(list); |
| | | return R.ok(crnStatusParams); |
| | | } |
| | | |
| | | public static <T> List<T> convertListMapToListObject(List<HashMap<String, Object>> listMap, Class<T> clazz) throws Exception { |
| | | List<T> list = new ArrayList<>(); |
| | | |
| | | for (Map<String, Object> map : listMap) { |
| | | T obj = clazz.getDeclaredConstructor().newInstance(); |
| | | |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | String key = entry.getKey(); |
| | | Object value = entry.getValue(); |
| | | |
| | | try { |
| | | Field field = clazz.getDeclaredField(key); |
| | | field.setAccessible(true); |
| | | setFieldValue(obj, field, value); |
| | | } catch (NoSuchFieldException e) { |
| | | System.out.println("No such field: " + key + " in class " + clazz.getName()); |
| | | } |
| | | } |
| | | |
| | | list.add(obj); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | private static void setFieldValue(Object obj, Field field, Object value) throws IllegalAccessException { |
| | | Class<?> fieldType = field.getType(); |
| | | |
| | | if (fieldType.isAssignableFrom(value.getClass())) { |
| | | field.set(obj, value); |
| | | } else if (fieldType == int.class || fieldType == Integer.class) { |
| | | field.set(obj, ((Number) value).intValue()); |
| | | } else if (fieldType == long.class || fieldType == Long.class) { |
| | | field.set(obj, ((Number) value).longValue()); |
| | | } else if (fieldType == double.class || fieldType == Double.class) { |
| | | field.set(obj, ((Number) value).doubleValue()); |
| | | } else if (fieldType == float.class || fieldType == Float.class) { |
| | | field.set(obj, ((Number) value).floatValue()); |
| | | } else if (fieldType == boolean.class || fieldType == Boolean.class) { |
| | | field.set(obj, (Boolean) value); |
| | | } else if (fieldType == String.class) { |
| | | field.set(obj, String.valueOf(value)); |
| | | } else { |
| | | System.out.println("Unsupported field type: " + fieldType.getName()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @Value("${wms.taskStatusFeedbackPath}") |
| | | private String taskStatusFeedbackPath; |
| | | @Value("${wms.TaskExecCallback}") |
| | | private String TaskExecCallback; |
| | | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | |
| | | String response=""; |
| | | try{ |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("taskNo",taskWrk.getTaskNo()); |
| | | headParam.put("status",taskWrk.getStatus()); |
| | | headParam.put("ioType",taskWrk.getIoType()); |
| | | headParam.put("barcode",taskWrk.getBarcode()); |
| | | headParam.put("TaskNo",taskWrk.getTaskNo()); |
| | | headParam.put("Result",1); |
| | | // headParam.put("reportTime",new Date()); |
| | | log.info("wcs手动完成任务上报wms={}", taskWrk); |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setPath(TaskExecCallback) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | apiLogService.save("wcs手动完成任务上报wms" |
| | | ,wmsUrl+taskStatusFeedbackPath |
| | | ,wmsUrl+TaskExecCallback |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam) |
| | |
| | | String response=""; |
| | | try{ |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("taskNo",taskWrk.getTaskNo()); |
| | | headParam.put("status",taskWrk.getStatus()); |
| | | headParam.put("ioType",taskWrk.getIoType()); |
| | | headParam.put("barcode",taskWrk.getBarcode()); |
| | | headParam.put("TaskNo",taskWrk.getTaskNo()); |
| | | headParam.put("Result",0); |
| | | // headParam.put("reportTime",new Date()); |
| | | |
| | | log.info("wcs手动取消任务上报wm={}", taskWrk); |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setPath(TaskExecCallback) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | apiLogService.save("wcs手动取消任务上报wms" |
| | | ,wmsUrl+taskStatusFeedbackPath |
| | | ,wmsUrl+TaskExecCallback |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam) |
| | |
| | | private Integer taskTunnel; //任务巷道 |
| | | private String createTime; //创建时间 YYYY-MM-DD HH24:MI:SS |
| | | private String targetLocationCode; //目标货位 |
| | | private long ShelfUnitId; //分配的货位ID |
| | | private String Alley; //分配的货位所属巷道 |
| | | private long TaskId; //分配的货位所属任务ID |
| | | private String TaskNo; //分配的货位所属任务编号 |
| | | private Integer Row; //分配的货位所属排 |
| | | private Integer Floor; //分配的货位所属层 |
| | | private Integer Column; //分配的货位所属列 |
| | | |
| | | |
| | | //任务号 |
| | | private String wrkNo; |
| | |
| | | @TableField("origin_target_point") |
| | | private String originTargetPoint; |
| | | |
| | | @ApiModelProperty(value = "开始任务标记") |
| | | @TableField("mark_start") |
| | | private Integer markStart; |
| | | |
| | | public TaskWrk() {} |
| | | |
| | | public TaskWrk(String taskNo,Integer status,Integer wrkNo,Date createTime,Integer ioType,Integer ioPri,String startPoint,String targetPoint,Long modiUser,Date modiTime,String memo,String barcode,Date assignTime,Date executeTime,Date completeTime,Date cancelTime,Integer wrkSts) { |
| | |
| | | private List<Integer> canInboundTunnels; |
| | | |
| | | // 容器编码 |
| | | private String barcode; |
| | | private String BoxNo; |
| | | //容器类型 |
| | | private String ioType; |
| | | //入库站编号 |
| | |
| | | private Integer locType; |
| | | |
| | | public ToWmsDTO(String barcode, Integer stationCode, Integer locType){ |
| | | this.barcode = barcode; |
| | | this.BoxNo = barcode; |
| | | this.stationCode = stationCode; |
| | | this.locType = locType; |
| | | } |
| | |
| | | @Data |
| | | public class CarryParam { |
| | | //工作号 |
| | | private String taskNo; |
| | | private String TaskNo; |
| | | |
| | | //入出库类型 |
| | | private Integer ioType; |
| | | private Integer StereoscopicTaskType; |
| | | |
| | | //优先级 |
| | | private Integer Priority; |
| | | |
| | | //容器编码 |
| | | private String barcode; |
| | | private String BoxNo; |
| | | |
| | | //源货位排编号 |
| | | private Integer OriginalRowNo; |
| | | |
| | | //源货位层编号 |
| | | private Integer OriginalFloorNo; |
| | | |
| | | //源货位列编号 |
| | | private Integer OriginalColumnNo; |
| | | |
| | | //目标库位排编号 |
| | | private Integer GoalRowNo; |
| | | |
| | | //目标库位层编号 |
| | | private Integer GoalFloorNo; |
| | | |
| | | //目标库位列编号 |
| | | private Integer GoalColumnNo; |
| | | |
| | | //起点 |
| | | private String startPoint; |
| | | |
| | | //目标点 |
| | | private String targetPoint; |
| | | //终端编号(输送线上某一点位) |
| | | private String TerminalNo; |
| | | |
| | | //备注 |
| | | private String meno; |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CarrysParam { |
| | | private List<CarryParam> TaskList; |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CrnStatusParam { |
| | | private Integer crnNo; |
| | | private Integer crnSts; |
| | | private Long errorCode; |
| | | private String errorMsg; |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class Result { |
| | | private Long ShelfUnitId; //分配的货位ID |
| | | private String Alley; //分配的货位所属巷道 |
| | | private Long TaskId; //分配的货位所属任务ID |
| | | private String TaskNo; //分配的货位所属任务编号 |
| | | private int Row; //分配的货位所属排 |
| | | private int Floor; //分配的货位所属层 |
| | | private int Column; //分配的货位所属列 |
| | | //站位编号 用户是从哪个口入的 |
| | | private Integer TerminalNo; |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StorageEscalationParam { |
| | | //托盘码 |
| | | private String BoxNo; |
| | | //执行状态 0:成功 1:失败 |
| | | private Integer WCSStatus=0; |
| | | //错误信息 具体的错误信息(超高,超重等) |
| | | private String WCSErrorMessage=""; |
| | | } |
| | |
| | | |
| | | public TaskCreateParam(CarryParam param, Integer crn){ |
| | | this.taskNo = param.getTaskNo(); |
| | | this.ioType = param.getIoType(); |
| | | this.barcode = param.getBarcode(); |
| | | this.taskPriority = 300; |
| | | this.ioType = param.getStereoscopicTaskType(); |
| | | this.barcode = param.getBoxNo(); |
| | | this.taskPriority = 12; |
| | | this.startPoint = param.getStartPoint(); |
| | | this.targetPoint = param.getTargetPoint(); |
| | | this.targetPoint = param.getTerminalNo(); |
| | | this.emptyContainer = "N"; |
| | | this.crn = crn; |
| | | }; |
| | |
| | | import com.zy.asrs.entity.param.TaskCreateParam; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | |
| | | public interface OpenService { |
| | | |
| | | //创建任务 |
| | | R taskCreate(TaskCreateParam param); |
| | | HashMap<String,Object> taskCreate(TaskCreateParam param); |
| | | |
| | | R AgvToWCSToWms(WMSAndAGVInterfaceParam param) throws IOException; |
| | | |
| | |
| | | import com.zy.asrs.domain.enums.WorkNoType; |
| | | import com.zy.asrs.domain.param.CrnOperatorParam; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.Result; |
| | | import com.zy.asrs.entity.param.StorageEscalationParam; |
| | | import com.zy.asrs.entity.param.TaskOverToWms; |
| | | import com.zy.asrs.mapper.*; |
| | | import com.zy.asrs.service.*; |
| | |
| | | private String wmsUrl; |
| | | @Value("${wms.inboundTaskApplyPath}") |
| | | private String inboundTaskApplyPath; |
| | | @Value("${wms.movePath}") |
| | | private String movePath; |
| | | @Value("${wms.TaskExecCallback}") |
| | | private String TaskExecCallback; |
| | | @Value("${wms.taskStatusFeedbackPath}") |
| | | private String taskStatusFeedbackPath; |
| | | @Autowired |
| | |
| | | private SiteController siteController; |
| | | |
| | | |
| | | public void generateStoreWrkFile1() throws IOException, InterruptedException { |
| | | try { |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历入库口 |
| | | for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | StorageEscalationParam storageEscalationParam = new StorageEscalationParam(); |
| | | // 获取入库站信息 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | Short workNo = staProtocol.getWorkNo(); |
| | | Short stano = staProtocol.getStaNo(); |
| | | |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = ""; |
| | | if (staProtocol.isFrontErr()) { |
| | | errMsg = "前超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isBackErr()) { |
| | | errMsg = "后超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isHighErr()) { |
| | | errMsg = "高超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isLeftErr()) { |
| | | errMsg = "左超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isRightErr()) { |
| | | errMsg = "右超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isWeightErr()) { |
| | | errMsg = "超重"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isBarcodeErr()) { |
| | | errMsg = "扫码失败"; |
| | | back = true; |
| | | } |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() && workNo >= 9790 |
| | | && staProtocol.isPakMk()) { |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | String BoxNo = barcodeThread.getBarcode(); |
| | | TaskWrk taskWrk1 = taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("barcode", BoxNo)); |
| | | if (!Cools.isEmpty(taskWrk1)) { |
| | | log.info("托盘码:" + BoxNo + "任务档存在"); |
| | | if (taskWrk1.getIoType() == 1 && taskWrk1.getStartPoint().equals(staProtocol.getSiteId().toString())) { |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no", taskWrk1.getCrnNo()).eq("type_no", 1).eq("stn_no", staProtocol.getSiteId())); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | return; |
| | | } else { |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | if (back) { |
| | | storageEscalationParam.setWCSStatus(1); |
| | | storageEscalationParam.setWCSErrorMessage(storageEscalationParam.getWCSErrorMessage() + errMsg); |
| | | } |
| | | log.info("组托入库={}", storageEscalationParam); |
| | | storageEscalationParam.setBoxNo(BoxNo); |
| | | String response = ""; |
| | | Boolean success = false; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath(inboundTaskApplyPath) |
| | | .setJson(JSON.toJSONString(storageEscalationParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (!Cools.isEmpty(response)&&!Cools.isEmpty(jsonObject.get("ReturnStatus"))&&jsonObject.get("ReturnStatus").equals(0) && !Cools.isEmpty(jsonObject.get("Result").toString())) { |
| | | Result result = JSON.parseObject(jsonObject.get("Result").toString(), Result.class); |
| | | // 创新一个入库工作档 |
| | | TaskWrk taskWrk = taskWrkService.selectByTaskNo(result.getTaskNo()); |
| | | if (Cools.isEmpty(taskWrk)) { |
| | | taskWrk = createTask1(result, BoxNo); |
| | | if (Cools.isEmpty(taskWrk)) { |
| | | log.error("库位异常,库位号:={}", taskWrk.getOriginTargetPoint()); |
| | | } else { |
| | | taskWrkService.insert(taskWrk); |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no", taskWrk.getCrnNo()).eq("type_no", 1).eq("stn_no", staProtocol.getSiteId())); |
| | | staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(staDesc.getCrnStn().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("TaskNo",taskWrk.getTaskNo()); |
| | | try { |
| | | //开始上报,任务开始时,WCS回调WMS |
| | | response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setJson(JSON.toJSONString(hashMap)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject1 = JSON.parseObject(response); |
| | | Boolean bool = false; |
| | | if(jsonObject1.get("ReturnStatus").equals(0)){ |
| | | bool = true; |
| | | } |
| | | apiLogService.save("wcs开始入库任务上报wms" |
| | | , wmsUrl + TaskExecCallback |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(hashMap) |
| | | , response |
| | | , bool |
| | | ); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | } else { |
| | | // staProtocol.setWorkNo((short) 9991); |
| | | if(staProtocol.getWorkNo()>=9801&&staProtocol.getWorkNo()<=9825){ |
| | | staProtocol.setStaNo((short)105); |
| | | } else if (staProtocol.getWorkNo()>=9826&&staProtocol.getWorkNo()<=9850) { |
| | | staProtocol.setStaNo((short)107); |
| | | }else if (staProtocol.getWorkNo()>=9851&&staProtocol.getWorkNo()<=9875) { |
| | | staProtocol.setStaNo((short)109); |
| | | }else{ |
| | | staProtocol.setStaNo((short)110); |
| | | } |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | } |
| | | |
| | | } else { |
| | | // staProtocol.setWorkNo((short) 9991); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("请求入库调用接口失败"); |
| | | log.error("异常信息打印:" + e); |
| | | try { |
| | | BasDevp basDevp = basDevpService.selectById(inSta.getStaNo()); |
| | | if (Cools.isEmpty(basDevp)) { |
| | | log.error("站点号异常" + inSta.getStaNo()); |
| | | } else if (basDevp.getStaErr() != 0) { |
| | | basDevp.setStaErr(2); |
| | | basDevpService.updateById(basDevp); |
| | | } |
| | | } catch (Exception e1) { |
| | | // 退回 |
| | | log.error("扫码检测程序异常" + inSta.getStaNo() + "异常信息" + e1); |
| | | } |
| | | } finally { |
| | | apiLogService.save("wms请求入库货位接口" |
| | | , wmsUrl + inboundTaskApplyPath |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(storageEscalationParam) |
| | | , response |
| | | , success |
| | | ); |
| | | } |
| | | log.info("入库请求参数=" + JSON.toJSONString(BoxNo)); |
| | | log.info("入库请求返回参数=" + JSON.toJSONString(response)); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("generateStoreWrkFile e", e); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | |
| | | public void generateStoreWrkFile() throws IOException, InterruptedException { |
| | | try { |
| | | |
| | | |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历入库口 |
| | |
| | | } |
| | | // 退回 |
| | | if (back) { |
| | | if (stano == inSta.getBackSta().shortValue()){ |
| | | if (stano == inSta.getBackSta().shortValue()) { |
| | | continue; |
| | | } |
| | | if (workNo == 0 && stano == 0){ |
| | | if (workNo == 0 && stano == 0) { |
| | | continue; |
| | | } |
| | | if (!staProtocol.isPakMk()){ |
| | | if (!staProtocol.isPakMk()) { |
| | | continue; |
| | | } |
| | | // News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg); |
| | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() && (workNo == 9991 ) |
| | | && !staProtocol.isEmptyMk() && (workNo >= 9899) |
| | | && staProtocol.isPakMk()) { |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | |
| | | continue; |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | if(!Cools.isEmpty(barcode) && !barcode.equals("99999999")) { |
| | | if (!Cools.isEmpty(barcode) && !barcode.equals("99999999")) { |
| | | // 请求wms接口,获取工作号和目标库位 |
| | | ToWmsDTO toWmsDTO = new ToWmsDTO(barcode,staProtocol.getSiteId(),staProtocol.isHigh() ? 2 : 1); |
| | | TaskWrk taskWrk1=taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("barcode",barcode)); |
| | | if(!Cools.isEmpty(taskWrk1)){ |
| | | log.info("托盘码:"+barcode+"任务档存在"); |
| | | if (taskWrk1.getIoType()==1 && taskWrk1.getStartPoint().equals(staProtocol.getSiteId().toString())){ |
| | | ToWmsDTO toWmsDTO = new ToWmsDTO(barcode, staProtocol.getSiteId(), staProtocol.isHigh() ? 2 : 1); |
| | | TaskWrk taskWrk1 = taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("barcode", barcode)); |
| | | if (!Cools.isEmpty(taskWrk1)) { |
| | | log.info("托盘码:" + barcode + "任务档存在"); |
| | | if (taskWrk1.getIoType() == 1 && taskWrk1.getStartPoint().equals(staProtocol.getSiteId().toString())) { |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no", taskWrk1.getCrnNo()).eq("type_no",1).eq("stn_no",staProtocol.getSiteId())); |
| | | if (Cools.isEmpty(staDesc)){ |
| | | log.info("托盘码:"+barcode+"任务档存在"); |
| | | .eq("crn_no", taskWrk1.getCrnNo()).eq("type_no", 1).eq("stn_no", staProtocol.getSiteId())); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | log.info("托盘码:" + barcode + "任务档存在"); |
| | | return; |
| | | }else { |
| | | } else { |
| | | staProtocol.setWorkNo(taskWrk1.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(staDesc.getCrnStn().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | |
| | | return; |
| | | } |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("Content-Type","application/json"); |
| | | headParam.put("Content-Type", "application/json"); |
| | | System.out.println(JSON.toJSONString(toWmsDTO)); |
| | | String response; |
| | | try{ |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | |
| | | .setJson(JSON.toJSONString(toWmsDTO)) |
| | | .build() |
| | | .doPost(); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | log.error("请求入库调用接口失败"); |
| | | log.error("异常信息打印:"+e); |
| | | try{ |
| | | log.error("异常信息打印:" + e); |
| | | try { |
| | | BasDevp basDevp = basDevpService.selectById(inSta.getStaNo()); |
| | | if (Cools.isEmpty(basDevp)){ |
| | | log.error("站点号异常"+inSta.getStaNo()); |
| | | } else if (basDevp.getStaErr()!=0){ |
| | | if (Cools.isEmpty(basDevp)) { |
| | | log.error("站点号异常" + inSta.getStaNo()); |
| | | } else if (basDevp.getStaErr() != 0) { |
| | | basDevp.setStaErr(2); |
| | | basDevpService.updateById(basDevp); |
| | | } |
| | | }catch (Exception e1){ |
| | | } catch (Exception e1) { |
| | | // 退回 |
| | | log.error("扫码检测程序异常"+inSta.getStaNo()+"异常信息"+e1); |
| | | log.error("扫码检测程序异常" + inSta.getStaNo() + "异常信息" + e1); |
| | | } |
| | | staProtocol.setWorkNo((short)9999); |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo(inSta.getStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | |
| | | } |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | apiLogService.save("wms请求入库货位接口" |
| | | ,wmsUrl+inboundTaskApplyPath |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(toWmsDTO) |
| | | ,response |
| | | ,true |
| | | ); |
| | | log.info("入库请求参数{}" + JSON.toJSONString(toWmsDTO)); |
| | | log.info("入库请求返回参数{}" + JSON.toJSONString(response)); |
| | | if (jsonObject.getInteger("code").equals(200) && !Cools.isEmpty(jsonObject.get("data").toString())) { |
| | | GetWmsDto getWmsDto = JSON.parseObject(jsonObject.get("data").toString(), GetWmsDto.class); |
| | | try{ |
| | | try { |
| | | BasDevp basDevp = basDevpService.selectById(inSta.getStaNo()); |
| | | if (Cools.isEmpty(basDevp)){ |
| | | log.error("站点号异常1"+inSta.getStaNo()); |
| | | throw new CoolException("站点号异常1,未查询到站点信息"+inSta.getStaNo()); |
| | | if (Cools.isEmpty(basDevp)) { |
| | | log.error("站点号异常1" + inSta.getStaNo()); |
| | | throw new CoolException("站点号异常1,未查询到站点信息" + inSta.getStaNo()); |
| | | } |
| | | Integer staNoCrnNo = Utils.StaNoCrnNo(inSta.getStaNo()); |
| | | if (staNoCrnNo==0){ |
| | | if (staNoCrnNo == 0) { |
| | | basDevp.setStaErr(1); |
| | | basDevpService.updateById(basDevp); |
| | | log.error("站点号异常2"+inSta.getStaNo()); |
| | | throw new CoolException("站点号异常2,站点号不存在"+inSta.getStaNo()); |
| | | }else { |
| | | log.error("站点号异常2" + inSta.getStaNo()); |
| | | throw new CoolException("站点号异常2,站点号不存在" + inSta.getStaNo()); |
| | | } else { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("crn_no", staNoCrnNo.longValue()) |
| | | .eq("loc_no", getWmsDto.getLocNo())); |
| | | if (Cools.isEmpty(locMast)){ |
| | | if (Cools.isEmpty(locMast)) { |
| | | basDevp.setStaErr(1); |
| | | basDevpService.updateById(basDevp); |
| | | log.error("站点号异常3"+inSta.getStaNo()); |
| | | throw new CoolException("站点号异常3:此巷道不存在目标库位"+inSta.getStaNo()); |
| | | log.error("站点号异常3" + inSta.getStaNo()); |
| | | throw new CoolException("站点号异常3:此巷道不存在目标库位" + inSta.getStaNo()); |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | } catch (Exception e) { |
| | | // log.error("扫码检测程序异常"+inSta.getStaNo()+"异常信息"+e); |
| | | // 退回 |
| | | log.error("扫码检测程序异常"+inSta.getStaNo()+errMsg); |
| | | log.error("扫码检测程序异常,异常信息"+e); |
| | | log.error("扫码检测程序异常" + inSta.getStaNo() + errMsg); |
| | | log.error("扫码检测程序异常,异常信息" + e); |
| | | |
| | | staProtocol.setWorkNo((short)9999); |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo(inSta.getStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | |
| | | continue; |
| | | } |
| | | //查看该库位是否为空库位 |
| | | LocMast locMast=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts","O") |
| | | .eq("loc_no",getWmsDto.getLocNo())); |
| | | if(Cools.isEmpty(locMast)){ |
| | | try{ |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "O") |
| | | .eq("loc_no", getWmsDto.getLocNo())); |
| | | if (Cools.isEmpty(locMast)) { |
| | | try { |
| | | HashMap<String, Object> headParam1 = new HashMap<>(); |
| | | headParam1.put("taskNo",getWmsDto.getTaskNo()); |
| | | headParam1.put("status",6); |
| | | headParam1.put("ioType",1); |
| | | headParam1.put("barcode",barcode); |
| | | headParam1.put("taskNo", getWmsDto.getTaskNo()); |
| | | headParam1.put("status", 6); |
| | | headParam1.put("ioType", 1); |
| | | headParam1.put("barcode", barcode); |
| | | String response2; |
| | | response2 = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | |
| | | .doPost(); |
| | | JSONObject jsonObject1 = JSON.parseObject(response2); |
| | | apiLogService.save("wcs派发库位==》不为空《==上报wms" |
| | | ,wmsUrl+taskStatusFeedbackPath |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam1) |
| | | ,response |
| | | ,true |
| | | , wmsUrl + taskStatusFeedbackPath |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(headParam1) |
| | | , response |
| | | , true |
| | | ); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | log.error("wcs派发库位==》不为空《==上报wms", getWmsDto.getWrkNo()); |
| | | throw new CoolException("wcs派发入库任务上报wms失败,派发库位==》不为空《==,异常信息:"+e); |
| | | throw new CoolException("wcs派发入库任务上报wms失败,派发库位==》不为空《==,异常信息:" + e); |
| | | } |
| | | } |
| | | |
| | | // 创新一个入库工作档 |
| | | TaskWrk taskWrk = taskWrkService.selectByTaskNo(getWmsDto.getWrkNo()); |
| | | if(Cools.isEmpty(taskWrk)) { |
| | | taskWrk = createTask(getWmsDto,barcode); |
| | | if (Cools.isEmpty(taskWrk)){ |
| | | if (Cools.isEmpty(taskWrk)) { |
| | | taskWrk = createTask(getWmsDto, barcode); |
| | | if (Cools.isEmpty(taskWrk)) { |
| | | log.error("库位异常,库位号:{}", getWmsDto.getTargetLocationCode()); |
| | | }else { |
| | | } else { |
| | | taskWrkService.insert(taskWrk); |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no", taskWrk.getCrnNo()).eq("type_no",1).eq("stn_no",staProtocol.getSiteId())); |
| | | .eq("crn_no", taskWrk.getCrnNo()).eq("type_no", 1).eq("stn_no", staProtocol.getSiteId())); |
| | | staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(staDesc.getCrnStn().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | } else { |
| | | continue; |
| | | } |
| | | apiLogService.save("wms请求入库货位接口" |
| | | , wmsUrl + inboundTaskApplyPath |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(toWmsDTO) |
| | | , response |
| | | , true |
| | | ); |
| | | |
| | | } else { |
| | | // 退回 |
| | | log.error("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg); |
| | | |
| | | staProtocol.setWorkNo((short)9999); |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo(inSta.getStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | |
| | | // 遍历堆垛机出库站 |
| | | for (CrnSlave.CrnStn crnStn : crnSlave.getCrnOutStn()) { |
| | | List<StaDesc> staDescs = staDescMapper.selectList(new EntityWrapper<StaDesc>().eq("crn_no", crnSlave.getId()).eq("crn_stn", crnStn.getStaNo())); |
| | | for (StaDesc staDesc : staDescs){ |
| | | try{ |
| | | for (StaDesc staDesc : staDescs) { |
| | | try { |
| | | // 获取堆垛机出库站信息 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, crnStn.getDevpPlcId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(crnStn.getStaNo()); |
| | |
| | | if (taskWrk == null) { |
| | | continue; |
| | | } |
| | | log.info("下发输送线任务:taskWrk:"+JSON.toJSONString(taskWrk)); |
| | | log.info("下发输送线任务:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | // R r = siteController.siteDetlUpdate(Integer.valueOf(taskWrk.getTargetPoint()), taskWrk.getWrkNo().shortValue(), (short) 0, "Y", false, false); |
| | | staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(staDesc.getCrnStn().shortValue()); |
| | | staProtocol.setStaNo(staDesc.getStnNo().shortValue()); |
| | | boolean offer = false; |
| | | try{ |
| | | try { |
| | | offer = MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol)); |
| | | }catch (Exception e){ |
| | | log.error("下发输送线任务失败:异常:"+e); |
| | | log.error("下发输送线任务失败:异常:offer:"+offer); |
| | | } catch (Exception e) { |
| | | log.error("下发输送线任务失败:异常:" + e); |
| | | log.error("下发输送线任务失败:异常:offer:" + offer); |
| | | } |
| | | // JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(r)); |
| | | if (offer){ |
| | | log.info("下发输送线任务成功:taskWrk:"+JSON.toJSONString(taskWrk)); |
| | | if (offer) { |
| | | log.info("下发输送线任务成功:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | taskWrk.setStatus(5); |
| | | taskWrk.setWrkSts(14); |
| | | taskWrkService.updateById(taskWrk); |
| | | }else { |
| | | log.error("下发输送线任务失败:taskWrk:"+JSON.toJSONString(taskWrk)); |
| | | |
| | | } else { |
| | | log.error("下发输送线任务失败:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | // log.error("下发输送线任务失败:异常信息:"+JSON.toJSONString(r)); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("出库到出库站异常:异常信息:"+e); |
| | | } catch (Exception e) { |
| | | log.error("出库到出库站异常:异常信息:" + e); |
| | | } |
| | | } |
| | | |
| | |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { continue; } |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | BasCrnp basCrnp = basCrnpService.selectById(crn.getId()); |
| | | if (basCrnp == null) { |
| | | log.error("{}号堆垛机尚未在数据库进行维护!", crn.getId()); |
| | | continue; |
| | | } |
| | | |
| | | // 库位移转 |
| | | this.locToLoc(crn, crnProtocol); |
| | | |
| | | // 只有当堆垛机空闲 并且 无任务时才继续执行 |
| | | if (crnProtocol.getStatusType() == CrnStatusType.IDLE && crnProtocol.getTaskNo() == 0 && crnProtocol.getModeType() == CrnModeType.AUTO |
| | |
| | | crnProtocol.setLastIo("O"); |
| | | } |
| | | } |
| | | |
| | | // 库位移转 |
| | | this.locToLoc(crn, crnProtocol); |
| | | } |
| | | |
| | | } |
| | |
| | | continue; |
| | | } |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0 && staProtocol.isInEnable() |
| | | && staDetl.getCanining()!=null && staDetl.getCanining().equals("Y")) { |
| | | && staDetl.getCanining() != null && staDetl.getCanining().equals("Y")) { |
| | | flag = true; |
| | | } |
| | | if (!flag) { |
| | |
| | | |
| | | // 获取工作状态为2(设备上走)的入库工作档 |
| | | TaskWrk taskWrk = taskWrkMapper.selectPakIn(slave.getId(), staProtocol.getWorkNo().intValue(), staDesc.getStnNo().toString()); |
| | | if(null == taskWrk) { |
| | | if (null == taskWrk) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | taskWrk.setModiTime(new Date()); |
| | | taskWrk.setModiUser(9988L); |
| | | |
| | | // //取出命令 |
| | | // List<CommandInfo> commandInfos = commandInfoService.selectByTaskNo(taskWrk.getTaskNo()); |
| | | // Integer commandStep = taskWrk.getCommandStep(); |
| | | // if (commandInfos.isEmpty()) { |
| | | // continue;//命令空 |
| | | // } |
| | | // CommandInfo commandInfo = commandInfos.get(commandStep); |
| | | // CommandPackage commandPackage = JSON.parseObject(commandInfo.getCommand(), CommandPackage.class);//取出命令报文 |
| | | // CrnCommand crnCommand = JSON.parseObject(commandPackage.getCommand().toString(), CrnCommand.class); |
| | | // |
| | | // if (!MessageQueue.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand))) { |
| | | // log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | // } else { |
| | | // // 修改工作档状态 2.设备上走 => 3.吊车入库中 |
| | | // Date now = new Date(); |
| | | // taskWrk.setWrkSts(3); |
| | | // taskWrk.setModiTime(now); |
| | | // if (taskWrkMapper.updateById(taskWrk) == 0) { |
| | | // log.error("修改工作档状态 2.设备上走 => 3.吊车入库中 失败!!,工作号={}", taskWrk.getWrkNo()); |
| | | // } |
| | | // //开始运行 |
| | | // String response = CrnStartRunning(taskWrk); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // if (jsonObject.getInteger("code").equals(200)) { |
| | | // |
| | | // }else { |
| | | // log.error("入库开始运行通讯失败,"+jsonObject.get("msg")); |
| | | // |
| | | // } |
| | | // } |
| | | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(staDesc.getCrnNo()); // 堆垛机编号 |
| | |
| | | crnCommand.setDestinationPosX(Utils.getRowShort(taskWrk.getTargetPoint())); // 目标库位列 |
| | | crnCommand.setDestinationPosY(Utils.getBayShort(taskWrk.getTargetPoint())); // 目标库位层 |
| | | crnCommand.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint())); // 目标库位排 |
| | | crnCommand.setCommand((short)1); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand),false)) { |
| | | crnCommand.setCommand((short) 1); |
| | | log.info("堆垛机入库任务下发={}",crnCommand); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand), false)) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | throw new CoolException("堆垛机命令生成失败"); |
| | | }else{ |
| | | try{ |
| | | } else { |
| | | try { |
| | | taskWrkService.updateById(taskWrk); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | log.error("修改工作档状态 2.设备上走 => 3.吊车入库中 失败!!,工作号={}", taskWrk.getWrkNo()); |
| | | log.error("修改工作档状态 2.设备上走 => 3.吊车入库中 失败!!,异常:"+e); |
| | | log.error("修改工作档状态 2.设备上走 => 3.吊车入库中 失败!!,异常:" + e); |
| | | } |
| | | try{ |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("taskNo",taskWrk.getTaskNo()); |
| | | headParam.put("status",taskWrk.getStatus()); |
| | | headParam.put("ioType",taskWrk.getIoType()); |
| | | headParam.put("barcode",taskWrk.getBarcode()); |
| | | String response; |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | apiLogService.save("wcs派发入库任务上报wms" |
| | | ,wmsUrl+taskStatusFeedbackPath |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam) |
| | | ,response |
| | | ,true |
| | | ); |
| | | } catch (Exception e){ |
| | | log.error("wcs派发入库任务上报wms失败", JSON.toJSONString(taskWrk)); |
| | | // throw new CoolException("wcs派发入库任务上报wms失败"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | // return; |
| | | } |
| | | } |
| | | |
| | |
| | | * 出库 ===>> 库位到堆垛机站 |
| | | * 2022-06-09 TQS修改,查询工作档LIST,遍历下发,防止第一个任务堵塞出库 |
| | | */ |
| | | public void locToCrnStn(CrnSlave slave, CrnProtocol crnProtocol){ |
| | | public void locToCrnStn(CrnSlave slave, CrnProtocol crnProtocol) { |
| | | List<TaskWrk> taskWrksInitial = taskWrkMapper.selectPakOut(slave.getId(), null); |
| | | if (taskWrksInitial.size()==0){ |
| | | if (taskWrksInitial.size() == 0) { |
| | | return; |
| | | } |
| | | for (CrnSlave.CrnStn crnStn : slave.getCrnOutStn()) { |
| | | List<StaDesc> staDescs = staDescMapper.selectList(new EntityWrapper<StaDesc>().eq("crn_no", slave.getId()).eq("crn_stn", crnStn.getStaNo())); |
| | | for (StaDesc staDesc : staDescs){ |
| | | for (StaDesc staDesc : staDescs) { |
| | | // 获取工作状态为11(生成出库ID)的出库工作档 |
| | | List<TaskWrk> taskWrks = taskWrkMapper.selectPakOut(slave.getId(),staDesc.getStnNo().toString()); |
| | | for (TaskWrk taskWrk : taskWrks){ |
| | | List<TaskWrk> taskWrks = taskWrkMapper.selectPakOut(slave.getId(), staDesc.getStnNo().toString()); |
| | | for (TaskWrk taskWrk : taskWrks) { |
| | | if (taskWrk == null) { |
| | | continue; |
| | | } |
| | |
| | | log.error("查询工作档数据不符合条件--入出类型/站点, 工作号={},源库位={},入出类型={}", taskWrk.getWrkNo(), taskWrk.getStartPoint(), taskWrk.getIoType()); |
| | | continue; |
| | | } |
| | | |
| | | LocMast locMast=locMastService.selectByLocNo(taskWrk.getStartPoint()); |
| | | //判断其库位是否为深库位,如果为深库位找其浅库位是都有货 |
| | | if(locMast.getRow1()==1||locMast.getRow1()==5){ |
| | | LocMast locMast1=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("row1", (locMast.getRow1()+1)) |
| | | .eq("bay1",locMast.getBay1()) |
| | | .eq("lev1",locMast.getLev1()).eq("loc_sts","F")); |
| | | if (!Cools.isEmpty(locMast1)){ |
| | | log.info(locMast.getLocNo()+"出深库位,浅库位有货"); |
| | | continue; |
| | | } |
| | | }else if(locMast.getRow1()==4||locMast.getRow1()==8){ |
| | | LocMast locMast1=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("row1", (locMast.getRow1()-1)) |
| | | .eq("bay1",locMast.getBay1()) |
| | | .eq("lev1",locMast.getLev1()).eq("loc_sts","F")); |
| | | if (!Cools.isEmpty(locMast1)){ |
| | | log.info(locMast.getLocNo()+"出深库位,浅库位有货"); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | // 获取堆垛机出库站信息 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, crnStn.getDevpPlcId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(crnStn.getStaNo()); |
| | |
| | | } |
| | | |
| | | // 判断堆垛机出库站状态 |
| | | if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() !=null && staDetl.getCanouting().equals("Y") |
| | | if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") |
| | | && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | |
| | |
| | | if (taskWrkMapper.selectCrnWorking(slave.getId()) != null) { |
| | | break; |
| | | } |
| | | |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(taskWrk.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo(taskWrk.getWrkNo().shortValue()); // 工作号 |
| | |
| | | command.setDestinationPosX(crnStn.getRow().shortValue()); // 目标库位排 |
| | | command.setDestinationPosY(crnStn.getBay().shortValue()); // 目标库位列 |
| | | command.setDestinationPosZ(crnStn.getLev().shortValue()); // 目标库位层 |
| | | command.setCommand((short)1); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, command),false)) { |
| | | command.setCommand((short) 1); |
| | | |
| | | if(Cools.isEmpty(taskWrk.getMarkStart())||taskWrk.getMarkStart()==0){ |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("TaskNo",taskWrk.getTaskNo()); |
| | | String response = ""; |
| | | try { |
| | | //开始上报,出库任务开始时,WCS回调WMS |
| | | response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setJson(JSON.toJSONString(hashMap)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | Boolean bool = false; |
| | | if(jsonObject.get("ReturnStatus").equals(0)){ |
| | | bool = true; |
| | | taskWrk.setMarkStart(1); |
| | | } |
| | | apiLogService.save("wcs开始任务上报wms" |
| | | , wmsUrl + TaskExecCallback |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(hashMap) |
| | | , response |
| | | , bool |
| | | ); |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, command), false)) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(command)); |
| | | throw new CoolException("堆垛机命令生成失败"); |
| | | }else{ |
| | | try{ |
| | | } else { |
| | | try { |
| | | // 修改工作档状态 11.生成出库ID => 12.吊车出库中 |
| | | Date now = new Date(); |
| | | taskWrk.setWrkSts(12); |
| | |
| | | if (taskWrkMapper.updateById(taskWrk) == 0) { |
| | | log.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", taskWrk.getWrkNo()); |
| | | } |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | log.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", taskWrk.getWrkNo()); |
| | | log.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,异常:"+e); |
| | | log.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,异常:" + e); |
| | | } |
| | | try{ |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("taskNo",taskWrk.getTaskNo()); |
| | | headParam.put("status",taskWrk.getStatus()); |
| | | headParam.put("ioType",taskWrk.getIoType()); |
| | | headParam.put("barcode",taskWrk.getBarcode()); |
| | | String response; |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | apiLogService.save("wcs派发出库任务上报wms" |
| | | ,wmsUrl+taskStatusFeedbackPath |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam) |
| | | ,response |
| | | ,true |
| | | ); |
| | | }catch (Exception e){ |
| | | log.error("wcs派发出库任务上报wms失败", JSON.toJSONString(taskWrk)); |
| | | // throw new CoolException("wcs派发入库任务上报wms失败"); |
| | | } |
| | | // try { |
| | | // HashMap<String, Object> headParam = new HashMap<>(); |
| | | // headParam.put("taskNo", taskWrk.getTaskNo()); |
| | | // headParam.put("status", taskWrk.getStatus()); |
| | | // headParam.put("ioType", taskWrk.getIoType()); |
| | | // headParam.put("barcode", taskWrk.getBarcode()); |
| | | // String response; |
| | | // response = new HttpHandler.Builder() |
| | | // // .setHeaders(headParam) |
| | | // .setUri(wmsUrl) |
| | | // .setPath(taskStatusFeedbackPath) |
| | | // .setJson(JSON.toJSONString(headParam)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // apiLogService.save("wcs派发出库任务上报wms" |
| | | // , wmsUrl + taskStatusFeedbackPath |
| | | // , null |
| | | // , "127.0.0.1" |
| | | // , JSON.toJSONString(headParam) |
| | | // , response |
| | | // , true |
| | | // ); |
| | | // } catch (Exception e) { |
| | | // log.error("wcs派发出库任务上报wms失败", JSON.toJSONString(taskWrk)); |
| | | //// throw new CoolException("wcs派发入库任务上报wms失败"); |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 库位移转 |
| | | */ |
| | | public void locToLoc(CrnSlave slave, CrnProtocol crnProtocol){ |
| | | public void locToLoc(CrnSlave slave, CrnProtocol crnProtocol) { |
| | | for (CrnSlave.CrnStn crnStn : slave.getCrnOutStn()) { |
| | | // 获取工作状态为11(生成出库ID)的移库工作档 |
| | | List<TaskWrk> taskWrks = taskWrkMapper.selectList(new EntityWrapper<TaskWrk>() |
| | | .eq("crn_no",slave.getId()) |
| | | .eq("wrk_sts",11) |
| | | .eq("io_type",3) |
| | | .orderBy("io_pri",false)); |
| | | for (TaskWrk taskWrk : taskWrks){ |
| | | .eq("crn_no", slave.getId()) |
| | | .eq("wrk_sts", 11) |
| | | .eq("io_type", 3) |
| | | .orderBy("io_pri", false)); |
| | | for (TaskWrk taskWrk : taskWrks) { |
| | | |
| | | // 双深库位且浅库位有货,则需先对浅库位进行库位移转 |
| | | // if (Utils.isDeepLoc(slaveProperties, taskWrk.getStartPoint())) { |
| | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | |
| | | |
| | | |
| | | |
| | | // 1.堆垛机开始移动 |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(slave.getId()); // 堆垛机编号 |
| | |
| | | crnCommand.setDestinationPosY(Utils.getBayShort(taskWrk.getTargetPoint())); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint())); // 目标库位层 |
| | | crnCommand.setCommand((short) 1); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand),false)) { |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand), false)) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |
| | | // 修改工作档状态 11.生成出库ID => 12.吊车出库中 |
| | |
| | | if (taskWrkMapper.updateById(taskWrk) == 0) { |
| | | log.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", taskWrk.getWrkNo()); |
| | | } |
| | | try{ |
| | | try { |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("taskNo",taskWrk.getTaskNo()); |
| | | headParam.put("status",taskWrk.getStatus()); |
| | | headParam.put("ioType",taskWrk.getIoType()); |
| | | headParam.put("barcode",taskWrk.getBarcode()); |
| | | headParam.put("TaskNo", taskWrk.getTaskNo()); |
| | | String response; |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | apiLogService.save("wcs派发移库任务上报wms" |
| | | ,wmsUrl+taskStatusFeedbackPath |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam) |
| | | ,response |
| | | ,true |
| | | , wmsUrl + taskStatusFeedbackPath |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(headParam) |
| | | , response |
| | | , true |
| | | ); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | log.error("wcs派发移库库任务上报wms失败", taskWrk); |
| | | // throw new CoolException("wcs派发移库库任务上报wms失败"); |
| | | } |
| | |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { continue; } |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | // 状态:等待确认 并且 任务完成位 = 1 |
| | | if (crnProtocol.getTaskFinish() == 0 && crnProtocol.statusType == CrnStatusType.HANDLING_COMPLETED && crnProtocol.getTaskNo() != 0) { |
| | | //获取入库待确认工作档 |
| | | TaskWrk taskWrk = taskWrkMapper.selectCrnNoInWorking(crn.getId(),crnProtocol.getTaskNo().intValue()); |
| | | if (Cools.isEmpty(taskWrk)&&crnProtocol.getTaskNo() !=999) { |
| | | TaskWrk taskWrk = taskWrkMapper.selectCrnNoInWorking(crn.getId(), crnProtocol.getTaskNo().intValue()); |
| | | if (Cools.isEmpty(taskWrk) && crnProtocol.getTaskNo() != 999) { |
| | | log.error("堆垛机处于等待确认且任务完成状态,但未找到工作档。堆垛机号={},工作号={}", crn.getId(), crnProtocol.getTaskNo()); |
| | | continue; |
| | | } |
| | | Thread.sleep(300); |
| | | //确认完成信号 |
| | | CrnOperatorParam crnOperatorParam=new CrnOperatorParam(); |
| | | CrnOperatorParam crnOperatorParam = new CrnOperatorParam(); |
| | | crnOperatorParam.setCrnNo(crn.getId()); |
| | | |
| | | crnController.crnTaskComplete(crnOperatorParam); |
| | | if(!Cools.isEmpty(taskWrk)){ |
| | | if(taskWrk.getIoType()==1 && taskWrk.getWrkSts()==3){ |
| | | R r = crnController.crnTaskComplete(crnOperatorParam); |
| | | Thread.sleep(1000); |
| | | if(!r.get("code").equals(200)){ |
| | | return; |
| | | } |
| | | if (!Cools.isEmpty(taskWrk)) { |
| | | if (taskWrk.getIoType() == 1 && taskWrk.getWrkSts() == 3) { |
| | | taskWrk.setWrkSts(4);//入库完成 |
| | | taskWrk.setStatus(5);//完结 |
| | | //更新库位状态 |
| | |
| | | locMast.setModiTime(new Date()); |
| | | locMast.setModiUser(9999L); |
| | | locMastService.updateById(locMast); |
| | | }else if(taskWrk.getIoType()==2&&taskWrk.getWrkSts()==12){ |
| | | } else if (taskWrk.getIoType() == 2 && taskWrk.getWrkSts() == 12) { |
| | | taskWrk.setWrkSts(13);//出库完成 |
| | | taskWrk.setStatus(5);//完结 |
| | | //更新库位状态 |
| | |
| | | locMast.setModiTime(new Date()); |
| | | locMast.setModiUser(9999L); |
| | | locMastService.updateById(locMast); |
| | | }else if(taskWrk.getIoType()==3&&taskWrk.getWrkSts()==12){ |
| | | } else if (taskWrk.getIoType() == 3 && taskWrk.getWrkSts() == 12) { |
| | | taskWrk.setWrkSts(4);//入库完成 |
| | | taskWrk.setStatus(5);//完结 |
| | | //更新库位状态 |
| | |
| | | locMastService.updateById(locMast1); |
| | | } |
| | | taskWrkService.updateById(taskWrk); |
| | | |
| | | |
| | | try{ |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("taskNo",taskWrk.getTaskNo()); |
| | | headParam.put("status",taskWrk.getStatus()); |
| | | headParam.put("ioType",taskWrk.getIoType()); |
| | | headParam.put("barcode",taskWrk.getBarcode()); |
| | | String response; |
| | | log.error("wcs完结任务上报wms==》", headParam); |
| | | |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | log.error("wcs完结任务上报wms==》", response); |
| | | |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // log.error("wcs完结任务上报wms==》", jsonObject); |
| | | |
| | | apiLogService.save("wcs派发入库任务上报wms" |
| | | ,wmsUrl+taskStatusFeedbackPath |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam) |
| | | ,response |
| | | ,true |
| | | ); |
| | | }catch (Exception e){ |
| | | log.error("wcs完结任务上报wms失败", taskWrk); |
| | | log.error("wcs完结任务上报wms失败,报错信息:", e); |
| | | // throw new CoolException("wcs派发入库任务上报wms失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 堆垛机异常信息记录 |
| | | */ |
| | | public void recCrnErr(){ |
| | | public void recCrnErr() { |
| | | Date now = new Date(); |
| | | for (CrnSlave crn : slaveProperties.getCrn()) { |
| | | // 获取堆垛机信息 |
| | |
| | | continue; |
| | | } |
| | | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm()); |
| | | String errName = crnError==null? String.valueOf(crnProtocol.getAlarm()):crnError.getErrName(); |
| | | String errName = crnError == null ? String.valueOf(crnProtocol.getAlarm()) : crnError.getErrName(); |
| | | BasErrLog basErrLog = new BasErrLog( |
| | | null, // 编号 |
| | | wrkMast.getWrkNo(), // 工作号 |
| | |
| | | // 记录新异常 |
| | | if (latest == null || (latest.getErrCode() != crnProtocol.getAlarm().intValue())) { |
| | | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm()); |
| | | String errName = crnError==null? String.valueOf(crnProtocol.getAlarm()):crnError.getErrName(); |
| | | String errName = crnError == null ? String.valueOf(crnProtocol.getAlarm()) : crnError.getErrName(); |
| | | BasErrLog basErrLog = new BasErrLog( |
| | | null, // 编号 |
| | | null, // 工作号 |
| | |
| | | null, // 源站 |
| | | null, // 源库位 |
| | | null, // 条码 |
| | | (int)crnProtocol.getAlarm1(), // 异常码 |
| | | (int) crnProtocol.getAlarm1(), // 异常码 |
| | | errName, // 异常 |
| | | 1, // 异常情况 |
| | | now, // 添加时间 |
| | |
| | | //agv取放货任务完成 |
| | | public synchronized void autoCompleteAGV() { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | try{ |
| | | try { |
| | | Thread.sleep(500); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | |
| | | for (BasDevp basDevp:basDevps){ |
| | | for (BasDevp basDevp : basDevps) { |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(basDevp.getDevNo()); |
| | | if (staProtocol == null) { |
| | |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (basDevp.getWrkNo()!=0){ |
| | | if (basDevp.getAgvTargetPick()!=0){//取货 |
| | | staProtocol.setAgvTypeSign((short)0); |
| | | if (basDevp.getWrkNo() != 0) { |
| | | if (basDevp.getAgvTargetPick() != 0) {//取货 |
| | | staProtocol.setAgvTypeSign((short) 0); |
| | | staProtocol.setStaNo(basDevp.getDevNo().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol)); |
| | | } |
| | | boolean sign = true; |
| | | if (basDevp.getAgvTargetPlace()!=0){ |
| | | if (basDevp.getAgvTargetPlace() != 0) { |
| | | sign = false; |
| | | basDevp.setAgvTargetPlace(0); |
| | | basDevpService.updateById(basDevp); |
| | | staProtocol.setAgvTypeSign((short)3);//1 |
| | | staProtocol.setAgvTypeSign((short) 3);//1 |
| | | staProtocol.setStaNo(basDevp.getDevNo().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol)); |
| | | } |
| | | }else { |
| | | if (basDevp.getAgvTargetPlace()!=0){ |
| | | if (basDevp.getLoading().equals("Y")){ |
| | | staProtocol.setAgvTypeSign((short)1); |
| | | } else { |
| | | if (basDevp.getAgvTargetPlace() != 0) { |
| | | if (basDevp.getLoading().equals("Y")) { |
| | | staProtocol.setAgvTypeSign((short) 1); |
| | | staProtocol.setStaNo(basDevp.getDevNo().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol)); |
| | | }else { |
| | | } else { |
| | | log.error("AGV放货完成但输送线无物,复位信号 ===>> [staNo:{}] [basDevp:{}]", basDevp.getDevNo(), basDevp); |
| | | basDevp.setAgvTargetPlace(0); |
| | | basDevpService.updateById(basDevp); |
| | | staProtocol.setAgvTypeSign((short)3);//1 |
| | | staProtocol.setAgvTypeSign((short) 3);//1 |
| | | staProtocol.setStaNo(basDevp.getDevNo().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol)); |
| | | } |
| | | |
| | | } |
| | | if (basDevp.getAgvTargetPick()!=0){ |
| | | if (basDevp.getAgvTargetPick() != 0) { |
| | | basDevp.setAgvTargetPick(0); |
| | | basDevpService.updateById(basDevp); |
| | | staProtocol.setAgvTypeSign((short)2);//0 |
| | | staProtocol.setAgvTypeSign((short) 2);//0 |
| | | staProtocol.setStaNo(basDevp.getDevNo().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public synchronized void autoCompleteTask() { |
| | | List<TaskWrk> taskWrks = taskWrkMapper.selectWorkingTask(); |
| | | for (TaskWrk taskWrk : taskWrks) { |
| | |
| | | } |
| | | |
| | | |
| | | public synchronized String CrnStartRunning(TaskWrk taskWrk){ |
| | | public synchronized String CrnStartRunning(TaskWrk taskWrk) { |
| | | String tasktype = null; |
| | | switch (taskWrk.getIoType()){ |
| | | switch (taskWrk.getIoType()) { |
| | | case 1: |
| | | tasktype= "RK"; |
| | | tasktype = "RK"; |
| | | break; |
| | | case 2: |
| | | tasktype= "CK"; |
| | | tasktype = "CK"; |
| | | break; |
| | | case 3: |
| | | tasktype= "YK"; |
| | | tasktype = "YK"; |
| | | break; |
| | | default: |
| | | tasktype= "未知"; |
| | | tasktype = "未知"; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("x-api-key","7a15b5db-29b6-552c-8cff-0cfec3756da2"); |
| | | map.put("x-api-key", "7a15b5db-29b6-552c-8cff-0cfec3756da2"); |
| | | TaskOverToWms taskOverToWms = new TaskOverToWms(); |
| | | taskOverToWms.setFeedbackFrom("WCS"); //来源 |
| | | taskOverToWms.setWarehouseId("1688469798893297665"); //仓库标识 |
| | | taskOverToWms.setTaskNo(taskWrk.getTaskNo()); //任务号 |
| | | taskOverToWms.setTaskType(tasktype); // 任务类型 |
| | | taskOverToWms.setContainerCode(taskWrk.getBarcode()); // 容器编码 |
| | | if (taskWrk.getIoType() ==1 || taskWrk.getIoType() == 3){ |
| | | if (taskWrk.getIoType() == 1 || taskWrk.getIoType() == 3) { |
| | | taskOverToWms.setEquipmentCode(String.valueOf(taskWrk.getCrnNo())); //设备编码 |
| | | taskOverToWms.setTargetLocationCode(taskWrk.getOriginTargetPoint()); //目标库位 |
| | | }else if (taskWrk.getIoType() ==2){ |
| | | Map<Integer,String> map1 = new HashMap<>(); |
| | | map1.put(102,"J-1101"); |
| | | map1.put(106,"J-1103"); |
| | | map1.put(110,"J-1105"); |
| | | map1.put(114,"J-1107"); |
| | | map1.put(118,"J-1109"); |
| | | map1.put(122,"J-1111"); |
| | | map1.put(305,"H-1101"); |
| | | map1.put(405,"G-1101"); |
| | | } else if (taskWrk.getIoType() == 2) { |
| | | Map<Integer, String> map1 = new HashMap<>(); |
| | | map1.put(102, "J-1101"); |
| | | map1.put(106, "J-1103"); |
| | | map1.put(110, "J-1105"); |
| | | map1.put(114, "J-1107"); |
| | | map1.put(118, "J-1109"); |
| | | map1.put(122, "J-1111"); |
| | | map1.put(305, "H-1101"); |
| | | map1.put(405, "G-1101"); |
| | | taskOverToWms.setEquipmentCode(map1.get(taskWrk.getTargetPoint())); //设备编码 |
| | | taskOverToWms.setSourceLocationCode(taskWrk.getOriginStartPoint()); //源库位 |
| | | } |
| | |
| | | .setJson(JSON.toJSONString(taskOverToWms)) |
| | | .build() |
| | | .doPost(); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | log.error("堆垛机任务完成,请求wms任务完成接口失败"); |
| | | } |
| | | apiLogService.save("堆垛机开始运行" |
| | | ,wmsUrl+"wcsManager/wcsInterface/taskStatusFeedback" |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(taskOverToWms) |
| | | ,response |
| | | ,true |
| | | , wmsUrl + "wcsManager/wcsInterface/taskStatusFeedback" |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(taskOverToWms) |
| | | , response |
| | | , true |
| | | ); |
| | | return response; |
| | | } |
| | | |
| | | private TaskWrk createTask(GetWmsDto dto, String barcode){ |
| | | private TaskWrk createTask1(Result result, String barcode) { |
| | | String locNo = Utils.Fusion(result.getRow(), result.getFloor(), result.getColumn()); |
| | | |
| | | |
| | | Date now = new Date(); |
| | | TaskWrk taskWrk = new TaskWrk(); |
| | | int workNo1 = commonService.getWorkNo(WorkNoType.PAKIN.type);//获取入库工作号 |
| | | taskWrk.setTaskNo(result.getTaskNo());//任务号 |
| | | taskWrk.setWrkNo(workNo1); |
| | | taskWrk.setStatus(TaskStatusType.DISTRIBUTE.id);//任务状态:派发 |
| | | taskWrk.setCreateTime(now); |
| | | taskWrk.setIoType(1);//任务类型 |
| | | taskWrk.setIoPri(13);//优先级 |
| | | taskWrk.setBarcode(barcode);//条码 |
| | | LocMast locMast = locMastService.selectByLocNo(locNo); |
| | | taskWrk.setCrnNo(locMast.getCrnNo()); |
| | | taskWrk.setTargetPoint(locNo); |
| | | taskWrk.setStartPoint("116"); |
| | | if (result.getAlley().equals("1")) { |
| | | taskWrk.setCrnNo(1); |
| | | } else { |
| | | taskWrk.setCrnNo(2); |
| | | } |
| | | if (taskWrk.getIoType() == 1) { |
| | | taskWrk.setWrkSts(2); |
| | | if (!Cools.isEmpty(taskWrk.getTargetPoint())) { |
| | | taskWrk.setOriginTargetPoint(taskWrk.getTargetPoint()); |
| | | } |
| | | } |
| | | return taskWrk; |
| | | } |
| | | |
| | | private TaskWrk createTask(GetWmsDto dto, String barcode) { |
| | | String wcsLocNo = dto.getLocNo(); |
| | | if(Cools.isEmpty(wcsLocNo)){ |
| | | if (Cools.isEmpty(wcsLocNo)) { |
| | | return null; |
| | | } |
| | | Date now = new Date(); |
| | |
| | | taskWrk.setCrnNo(locMast.getCrnNo()); |
| | | taskWrk.setTargetPoint(wcsLocNo); |
| | | taskWrk.setStartPoint(dto.getStaNo().toString()); |
| | | if(taskWrk.getIoType() == 1){ |
| | | if (taskWrk.getIoType() == 1) { |
| | | taskWrk.setWrkSts(2); |
| | | if (!Cools.isEmpty(taskWrk.getTargetPoint())) { |
| | | taskWrk.setOriginTargetPoint(taskWrk.getTargetPoint()); |
| | |
| | | } |
| | | return taskWrk; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | private BasDevpService basDevpService; |
| | | |
| | | |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | public ArrayList<String> wharfCode1 = new ArrayList<String>(){{ |
| | | add("J-1101"); add("J-1103"); add("J-1105"); add("J-1107"); add("J-1109"); add("J-1111");add("H-1101"); |
| | | public ArrayList<String> wharfCode1 = new ArrayList<String>() {{ |
| | | add("J-1101"); |
| | | add("J-1103"); |
| | | add("J-1105"); |
| | | add("J-1107"); |
| | | add("J-1109"); |
| | | add("J-1111"); |
| | | add("H-1101"); |
| | | add("G-1101"); |
| | | }}; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public R taskCreate(TaskCreateParam param) { |
| | | public HashMap<String, Object> taskCreate(TaskCreateParam param) { |
| | | HashMap<String,Object> map=new HashMap<>(); |
| | | TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo()); |
| | | if (taskWrk != null) { |
| | | throw new CoolException(param.getTaskNo() + "任务已存在,请勿重复提交"); |
| | | } |
| | | if (param.getIoType().equals(0)){ |
| | | throw new CoolException("生成任务失败,任务类型不存在!"); |
| | | map.put("Code","0"); |
| | | map.put("Msg",param.getTaskNo()+"任务已经生成!"); |
| | | return map; |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | taskWrk = new TaskWrk(); |
| | | LocMast locMast=locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",param.getStartPoint())); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", param.getStartPoint())); |
| | | int workNo1 = commonService.getWorkNo(WorkNoType.PAKOUT.type);//获取入库工作号 |
| | | taskWrk.setTaskNo(param.getTaskNo());//任务号 |
| | | taskWrk.setWrkNo(workNo1); |
| | | taskWrk.setStatus(TaskStatusType.RECEIVE.id);//任务状态:接收 |
| | | taskWrk.setCreateTime(now); |
| | | try{ |
| | | if (param.getIoType()>1){ |
| | | if (Utils.locNoRowBoolean(locMast.getRow1())){ |
| | | try { |
| | | if (param.getIoType() > 1) { |
| | | if (Utils.locNoRowBoolean(locMast.getRow1())) { |
| | | param.setTaskPriority(11); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | } |
| | | taskWrk.setIoType(param.getIoType());//任务类型 |
| | | taskWrk.setIoPri(param.getTaskPriority());//优先级 |
| | | taskWrk.setBarcode(param.getBarcode());//条码 |
| | | taskWrk.setCrnNo(locMast.getCrnNo()); |
| | | if(param.getIoType() == 1){ |
| | | if (param.getIoType() == 1) { |
| | | taskWrk.setWrkSts(1); |
| | | if (!Cools.isEmpty(param.getTargetPoint())) { |
| | | taskWrk.setTargetPoint(Utils.getWcsLocNo(param.getTargetPoint()));//终点 |
| | |
| | | taskWrk.setTargetPoint(param.getTargetPoint()); |
| | | } |
| | | taskWrk.setTargetPoint(param.getTargetPoint()); |
| | | }else if (param.getIoType() == 3){ |
| | | } else if (param.getIoType() == 3) { |
| | | taskWrk.setWrkSts(11); |
| | | if (!Cools.isEmpty(param.getStartPoint())) { |
| | | taskWrk.setStartPoint(param.getStartPoint());//起点 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | if (!Cools.isEmpty(param.getMemo())) { |
| | | taskWrk.setMemo(param.getMemo());//备注 |
| | | } |
| | | |
| | | if (!taskWrkService.insert(taskWrk)) { |
| | | return R.error("创建任务失败"); |
| | | map.put("Code","0"); |
| | | map.put("Msg",param.getTaskNo()+"创建任务失败!"); |
| | | return map; |
| | | } |
| | | return R.ok(); |
| | | map.put("Code","1"); |
| | | map.put("Msg","ok"); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public R AgvToWCSToWms(WMSAndAGVInterfaceParam param) throws IOException { |
| | | ToWmsDTO toWmsDTO = new ToWmsDTO(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("x-api-key","7a15b5db-29b6-552c-8cff-0cfec3756da2"); |
| | | map.put("x-api-key", "7a15b5db-29b6-552c-8cff-0cfec3756da2"); |
| | | List<Integer> list = new ArrayList<>(); |
| | | if (param.getWharfSource().contains("J")){ |
| | | if (param.getWharfSource().contains("J")) { |
| | | list = getInEnableRoadway(); |
| | | }else { |
| | | } else { |
| | | list = getInEnableRoadway2(); |
| | | } |
| | | |
| | |
| | | .setJson(JSON.toJSONString(toWmsDTO)) |
| | | .build() |
| | | .doPost(); |
| | | }catch (Exception e){ |
| | | return R.error("wms连接失败"+e.getMessage()); |
| | | } catch (Exception e) { |
| | | return R.error("wms连接失败" + e.getMessage()); |
| | | } |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | apiLogService.save("wms请求入库码头接口" |
| | | ,wmsUrl+"wcsManager/wcsInterface/inboundTaskApply" |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(toWmsDTO) |
| | | ,response |
| | | ,true |
| | | , wmsUrl + "wcsManager/wcsInterface/inboundTaskApply" |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(toWmsDTO) |
| | | , response |
| | | , true |
| | | ); |
| | | |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | |
| | | String msg = null; |
| | | try { |
| | | taskCreate(new TaskCreateParam(data)); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | msg = e.getMessage(); |
| | | } |
| | | if (msg != null){ |
| | | if (msg != null) { |
| | | return R.error(msg); |
| | | } |
| | | Map<String,String> map1 = new HashMap<>(); |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | StaDesc staDesc = new StaDesc(); |
| | | if (param.getWharfSource().contains("J")){ |
| | | if (param.getWharfSource().contains("J")) { |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no",data.getTaskTunnel()) |
| | | .eq("type_no",1) |
| | | .lt("stn_no",200)); |
| | | }else if (param.getWharfSource().contains("H")){ |
| | | .eq("crn_no", data.getTaskTunnel()) |
| | | .eq("type_no", 1) |
| | | .lt("stn_no", 200)); |
| | | } else if (param.getWharfSource().contains("H")) { |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no",data.getTaskTunnel()) |
| | | .eq("type_no",1) |
| | | .lt("stn_no",400) |
| | | .gt("stn_no",200)); |
| | | }else { |
| | | .eq("crn_no", data.getTaskTunnel()) |
| | | .eq("type_no", 1) |
| | | .lt("stn_no", 400) |
| | | .gt("stn_no", 200)); |
| | | } else { |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no",data.getTaskTunnel()) |
| | | .eq("type_no",1) |
| | | .lt("stn_no",500) |
| | | .ge("stn_no",400)); |
| | | .eq("crn_no", data.getTaskTunnel()) |
| | | .eq("type_no", 1) |
| | | .lt("stn_no", 500) |
| | | .ge("stn_no", 400)); |
| | | } |
| | | map1.put("taskTunnel", staDesc.getStnDesc()); |
| | | //map1.put("taskTunnel", "J-1104"); |
| | |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("stn_desc", param.getWharfCode())); |
| | | if (Cools.isEmpty(staDesc)){ |
| | | if (Cools.isEmpty(staDesc)) { |
| | | throw new RuntimeException("未查询到站点信息"); |
| | | } |
| | | // 获取入库站信息 |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | Short workNo = staProtocol.getWorkNo(); |
| | | if (wharfCode1.contains(param.getWharfCode())){ |
| | | if (!staProtocol.isLoading() && !staProtocol.isCar() && staProtocol.getWorkNo() >0){ |
| | | if (wharfCode1.contains(param.getWharfCode())) { |
| | | if (!staProtocol.isLoading() && !staProtocol.isCar() && staProtocol.getWorkNo() > 0) { |
| | | //AGV出库完成以后 |
| | | staProtocol.setWorkNo((short) 0); |
| | | staProtocol.setStaNo((short)0); |
| | | staProtocol.setStaNo((short) 0); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | if (result) { |
| | | |
| | |
| | | throw new RuntimeException("agv返回完成后,命令下发失败"); |
| | | } |
| | | } |
| | | }else { |
| | | } else { |
| | | for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | if (inSta.getBackSta().equals(staDesc.getStnNo())){ |
| | | if (inSta.getBackSta().equals(staDesc.getStnNo())) { |
| | | |
| | | if (staProtocol.isLoading() && !staProtocol.isCar() && workNo == 0){ |
| | | if (staProtocol.isLoading() && !staProtocol.isCar() && workNo == 0) { |
| | | //AGV入库完成以后 |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo(inSta.getStaNo().shortValue()); |
| | |
| | | @Override |
| | | public R getAgvPickAndPlaceV1(TaskOverParam param) { |
| | | BasDevp basDevp = basDevpService.selectById(param.getStaNo()); |
| | | if (Cools.isEmpty(basDevp)){ |
| | | return R.error("站点号有误"+param.getStaNo()); |
| | | if (Cools.isEmpty(basDevp)) { |
| | | return R.error("站点号有误" + param.getStaNo()); |
| | | } |
| | | if (param.getType()==0 && basDevp.getAgvStartPick()==1){ |
| | | if (param.getType() == 0 && basDevp.getAgvStartPick() == 1) { |
| | | return R.ok(); |
| | | }else if (param.getType()==1 && basDevp.getAgvStartPlace()==1){ |
| | | } else if (param.getType() == 1 && basDevp.getAgvStartPlace() == 1) { |
| | | return R.ok(); |
| | | }else { |
| | | } else { |
| | | return R.error("不允许"); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public R getAgvPickAndPlaceV2(TaskOverParam param) { |
| | | BasDevp basDevp = basDevpService.selectById(param.getStaNo()); |
| | | if (Cools.isEmpty(basDevp)){ |
| | | return R.error("站点号有误"+param.getStaNo()); |
| | | if (Cools.isEmpty(basDevp)) { |
| | | return R.error("站点号有误" + param.getStaNo()); |
| | | } |
| | | if (param.getType()==0){ |
| | | if (param.getType() == 0) { |
| | | basDevp.setAgvTargetPick(1); |
| | | basDevpService.updateById(basDevp); |
| | | return R.ok(); |
| | | }else if (param.getType()==1){ |
| | | } else if (param.getType() == 1) { |
| | | basDevp.setAgvTargetPlace(1); |
| | | basDevpService.updateById(basDevp); |
| | | return R.ok(); |
| | | }else { |
| | | return R.error("请求类型异常"+param.getType()); |
| | | } else { |
| | | return R.error("请求类型异常" + param.getType()); |
| | | } |
| | | } |
| | | |
| | | public List<Integer> getInEnableRoadway(){ |
| | | public List<Integer> getInEnableRoadway() { |
| | | int[] roadway = null; |
| | | List<Integer> list = new ArrayList<>(); |
| | | Map<Integer,Integer> map = new HashMap<>(); |
| | | map.put(103,1); |
| | | map.put(107,2); |
| | | map.put(111,3); |
| | | map.put(115,4); |
| | | map.put(119,5); |
| | | map.put(123,6); |
| | | Map<Integer, Integer> map = new HashMap<>(); |
| | | map.put(103, 1); |
| | | map.put(107, 2); |
| | | map.put(111, 3); |
| | | map.put(115, 4); |
| | | map.put(119, 5); |
| | | map.put(123, 6); |
| | | //put(301,7); |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | Short workNo = staProtocol.getWorkNo(); |
| | | if (workNo == 0 && !staProtocol.isLoading()){ |
| | | if (Cools.isEmpty( map.get(inSta.getStaNo()))){ |
| | | if (workNo == 0 && !staProtocol.isLoading()) { |
| | | if (Cools.isEmpty(map.get(inSta.getStaNo()))) { |
| | | continue; |
| | | } |
| | | list.add( map.get(inSta.getStaNo())); |
| | | list.add(map.get(inSta.getStaNo())); |
| | | } |
| | | } |
| | | } |
| | |
| | | return list; |
| | | } |
| | | |
| | | public List<Integer> getInEnableRoadway2(){ |
| | | public List<Integer> getInEnableRoadway2() { |
| | | int[] roadway = null; |
| | | List<Integer> list = new ArrayList<>(); |
| | | Map<Integer,Integer> map = new HashMap<>(); |
| | | map.put(205,1); |
| | | map.put(211,2); |
| | | map.put(217,3); |
| | | map.put(223,4); |
| | | map.put(229,5); |
| | | map.put(235,6); |
| | | Map<Integer, Integer> map = new HashMap<>(); |
| | | map.put(205, 1); |
| | | map.put(211, 2); |
| | | map.put(217, 3); |
| | | map.put(223, 4); |
| | | map.put(229, 5); |
| | | map.put(235, 6); |
| | | //put(301,7); |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | Short workNo = staProtocol.getWorkNo(); |
| | | if (workNo == 0 && !staProtocol.isLoading()){ |
| | | if (Cools.isEmpty( map.get(inSta.getStaNo()))){ |
| | | if (workNo == 0 && !staProtocol.isLoading()) { |
| | | if (Cools.isEmpty(map.get(inSta.getStaNo()))) { |
| | | continue; |
| | | } |
| | | list.add( map.get(inSta.getStaNo())); |
| | | list.add(map.get(inSta.getStaNo())); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.concurrent.TimeUnit; |
| | | @Slf4j |
| | | @Service |
| | | public class WorkServiceImpl implements WorkService { |
| | | |
| | |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | @Value("${wms.inboundTaskApplyPath}") |
| | | private String inboundTaskApplyPath; |
| | | @Value("${wms.movePath}") |
| | | private String movePath; |
| | | @Value("${wms.taskStatusFeedbackPath}") |
| | | private String taskStatusFeedbackPath; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void completeWrkMast(String workNo, Long userId) { |
| | | // WrkMast wrkMast = wrkMastService.selectById(workNo); |
| | | // WmsWrk wmsWrk = wmsWrkService.selectByTaskNo(wrkMast.getWmsWrkNo()); |
| | | // if (Cools.isEmpty(wrkMast, wmsWrk)) { |
| | | // throw new CoolException(workNo + "任务不存在"); |
| | | // } |
| | | // if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 14) { |
| | | // throw new CoolException("当前任务已完成"); |
| | | // } |
| | | // // 入库 + 库位转移 |
| | | // if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType()==11)) { |
| | | // wrkMast.setWrkSts(4L); |
| | | // // 出库 |
| | | // } else if (wrkMast.getWrkSts() > 10) { |
| | | // wrkMast.setWrkSts(14L); |
| | | // } |
| | | // Date now = new Date(); |
| | | // wrkMast.setCrnStrTime(DateUtils.calculate(now, 1L, TimeUnit.SECONDS, true)); |
| | | // wrkMast.setCrnEndTime(now); |
| | | // wrkMast.setModiTime(now); |
| | | // wrkMast.setModiUser(userId); |
| | | // // 完成操作人员记录 |
| | | // wrkMast.setManuType("手动完成"); |
| | | // |
| | | // wmsWrk.setStatus(WmsStatusType.COMPLETE.id); |
| | | // wmsWrk.setModiUser(userId); |
| | | // wmsWrk.setModiTime(now); |
| | | // wmsWrk.setCompleteTime(now); |
| | | // if (!wrkMastService.updateById(wrkMast) || !wmsWrkService.updateById(wmsWrk)) { |
| | | // throw new CoolException("修改任务失败"); |
| | | // } |
| | | WrkMast wrkMast = wrkMastService.selectById(workNo); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 14) { |
| | | throw new CoolException("当前工作档已完成"); |
| | | } |
| | | // 入库 + 库位转移 |
| | | if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType() == 11)) { |
| | | wrkMast.setWrkSts(4L); |
| | | // 出库 |
| | | } else if (wrkMast.getWrkSts() > 10) { |
| | | wrkMast.setWrkSts(14L); |
| | | } |
| | | Date now = new Date(); |
| | | wrkMast.setCrnStrTime(DateUtils.calculate(now, 1L, TimeUnit.SECONDS, true)); |
| | | wrkMast.setCrnEndTime(now); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | // 完成操作人员记录 |
| | | wrkMast.setManuType("手动完成"); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("修改工作档失败"); |
| | | } |
| | | |
| | | HashMap<String,Object> headParam = new HashMap<>(); |
| | | headParam.put("TaskNo",wrkMast.getTaskNo()); |
| | | headParam.put("Result",0);//完成 |
| | | |
| | | try { |
| | | String response; |
| | | log.error("wcs手动完结任务上报wms={}", wrkMast); |
| | | |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | apiLogService.save("wcs手动完成任务上报wms" |
| | | , wmsUrl + taskStatusFeedbackPath |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(headParam) |
| | | , response |
| | | , true |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("wcs手动完结任务上报wms失败={}", wrkMast); |
| | | log.error("wcs手动完结任务上报wms失败,报错信息:", e); |
| | | // throw new CoolException("wcs派发入库任务上报wms失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void cancelWrkMast(String workNo, Long userId) { |
| | | // Date now = new Date(); |
| | | // WrkMast wrkMast = wrkMastService.selectById(workNo); |
| | | // WmsWrk wmsWrk = wmsWrkService.selectByWmsWrkNo(wrkMast.getWmsWrkNo()); |
| | | // if (Cools.isEmpty(wrkMast, wmsWrk)) { |
| | | // throw new CoolException(workNo + "任务不存在"); |
| | | // } |
| | | // |
| | | // String locNo = ""; // 待修改目标库位 |
| | | // String locSts = ""; // 待修改目标库位状态 |
| | | // // 入库取消(修改目标库位) |
| | | // if (wrkMast.getWrkSts() < 4) { |
| | | // locNo = wrkMast.getLocNo(); |
| | | // locSts = "O"; |
| | | // |
| | | // // 库位转移 |
| | | // if (wrkMast.getIoType() == 11) { |
| | | // // 库位转移:源库位 |
| | | // LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | // if (Cools.isEmpty(locMast)) { |
| | | // throw new CoolException("取消库位转移失败,源库位不存在:"+ wrkMast.getSourceLocNo()); |
| | | // } |
| | | // locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N")?"D":"F"); |
| | | // locMast.setModiTime(now); |
| | | // locMast.setModiUser(userId); |
| | | // locMastService.updateById(locMast); |
| | | // } |
| | | // // 出库取消(修改源库位) |
| | | // } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) { |
| | | // locNo = wrkMast.getSourceLocNo(); |
| | | // // 出库 ===>> F.在库 |
| | | // if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) { |
| | | // locSts = "F"; |
| | | // // 空板出库 ===>> D.空桶/空栈板 |
| | | // } else if (wrkMast.getIoType() == 110) { |
| | | // locSts = "D"; |
| | | // // 库位转移 ===>> D.空桶/空栈板 |
| | | // } else if (wrkMast.getIoType() == 11) { |
| | | // locSts = wrkMast.getFullPlt().equalsIgnoreCase("N")?"D":"F"; |
| | | // // 库位转移:目标库位 |
| | | // LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | // if (Cools.isEmpty(locMast)) { |
| | | // throw new CoolException("取消库位转移失败,目标库位不存在:"+ wrkMast.getSourceLocNo()); |
| | | // } |
| | | // locMast.setLocSts("O"); |
| | | // locMast.setModiTime(now); |
| | | // locMast.setModiUser(userId); |
| | | // locMastService.updateById(locMast); |
| | | // } |
| | | // } else { |
| | | // throw new CoolException("当前工作状态无法取消"); |
| | | // } |
| | | // |
| | | // //取消入库工作档时,查询组托表,如果有将状态改为待处理 |
| | | // if(wrkMast.getIoType() == 1) { |
| | | // List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); |
| | | // for (WaitPakin waitPakin:waitPakins){ |
| | | // if (!Cools.isEmpty(waitPakin)) { |
| | | // waitPakin.setIoStatus("N"); |
| | | // waitPakin.setLocNo(""); |
| | | // waitPakinService.update(waitPakin, new EntityWrapper<WaitPakin>() |
| | | // .eq("order_no", waitPakin.getOrderNo()) |
| | | // .eq("matnr", waitPakin.getMatnr()) |
| | | // .eq("batch", waitPakin.getBatch())); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // // 取消操作人员记录 |
| | | // wrkMast.setManuType("手动取消"); |
| | | // wrkMast.setModiUser(userId); |
| | | // wrkMast.setModiTime(now); |
| | | // if (!wrkMastService.updateById(wrkMast)) { |
| | | // throw new CoolException("取消任务失败"); |
| | | // } |
| | | // |
| | | // wmsWrk.setStatus(WmsStatusType.CANCEL.id); |
| | | // wmsWrk.setModiUser(userId); |
| | | // wmsWrk.setModiTime(now); |
| | | // wmsWrk.setCancelTime(now); |
| | | // if (!wmsWrkService.updateById(wmsWrk)) { |
| | | // throw new CoolException("取消任务失败"); |
| | | // } |
| | | // |
| | | // // 保存工作主档历史档 |
| | | // if (!wrkMastLogService.save(wrkMast.getWrkNo())) { |
| | | // throw new CoolException("保存任务历史档失败, workNo = " + wrkMast.getWrkNo()); |
| | | // } |
| | | // // 删除工作主档 |
| | | // boolean wrkMastRes = wrkMastService.deleteById(wrkMast); |
| | | // |
| | | // // 修改库位状态 |
| | | // LocMast locMast = locMastService.selectById(locNo); |
| | | // if (Cools.isEmpty(locMast)) { |
| | | // throw new CoolException("取消任务失败,库位不存在:"+ locNo); |
| | | // } |
| | | // locMast.setLocSts(locSts); |
| | | // locMast.setModiTime(now); |
| | | // locMast.setModiUser(userId); |
| | | // boolean locMastRes = locMastService.updateById(locMast); |
| | | // if (!wrkMastRes || !locMastRes) { |
| | | // throw new CoolException("保存数据失败"); |
| | | // } |
| | | Date now = new Date(); |
| | | WrkMast wrkMast = wrkMastService.selectById(workNo); |
| | | |
| | | String locNo = ""; // 待修改目标库位 |
| | | String locSts = ""; // 待修改目标库位状态 |
| | | // 入库取消(修改目标库位) |
| | | if (wrkMast.getWrkSts() < 4) { |
| | | locNo = wrkMast.getLocNo(); |
| | | locSts = "O"; |
| | | |
| | | // 库位转移 |
| | | if (wrkMast.getIoType() == 11) { |
| | | // 库位转移:源库位 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消库位转移失败,源库位不存在:" + wrkMast.getSourceLocNo()); |
| | | } |
| | | locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | // 出库取消(修改源库位) |
| | | } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) { |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | // 出库 ===>> F.在库 |
| | | if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) { |
| | | locSts = "F"; |
| | | // 空板出库 ===>> D.空桶/空栈板 |
| | | } else if (wrkMast.getIoType() == 110) { |
| | | locSts = "D"; |
| | | // 库位转移 ===>> D.空桶/空栈板 |
| | | } else if (wrkMast.getIoType() == 11) { |
| | | locSts = wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F"; |
| | | // 库位转移:目标库位 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消库位转移失败,目标库位不存在:" + wrkMast.getSourceLocNo()); |
| | | } |
| | | locMast.setLocSts("O"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | } else { |
| | | throw new CoolException("当前工作状态无法取消"); |
| | | } |
| | | // 取消操作人员记录 |
| | | wrkMast.setManuType("手动取消"); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("取消任务失败"); |
| | | } |
| | | // 保存工作主档历史档 |
| | | if (!wrkMastLogService.save(wrkMast.getWrkNo())) { |
| | | throw new CoolException("保存任务历史档失败, workNo = " + wrkMast.getWrkNo()); |
| | | } |
| | | |
| | | // 删除工作主档 |
| | | boolean wrkMastRes = wrkMastService.deleteById(wrkMast); |
| | | |
| | | // 修改库位状态 |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消任务失败,库位不存在:" + locNo); |
| | | } |
| | | locMast.setLocSts(locSts); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | boolean locMastRes = locMastService.updateById(locMast); |
| | | if (!wrkMastRes || !locMastRes) { |
| | | throw new CoolException("保存数据失败"); |
| | | } |
| | | HashMap<String,Object> headParam = new HashMap<>(); |
| | | headParam.put("TaskNo",wrkMast.getTaskNo()); |
| | | headParam.put("Result",1);//取消 |
| | | |
| | | try { |
| | | String response; |
| | | log.error("wcs手动取消任务上报wms={}", wrkMast); |
| | | |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | apiLogService.save("wcs手动取消任务上报wms" |
| | | , wmsUrl + taskStatusFeedbackPath |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(headParam) |
| | | , response |
| | | , true |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("wcs手动取消任务上报wms失败={}", wrkMast); |
| | | log.error("wcs手动取消任务上报wms失败,报错信息:", e); |
| | | // throw new CoolException("wcs派发入库任务上报wms失败"); |
| | | } |
| | | } |
| | | } |
| | |
| | | private String wmsUrl; |
| | | @Value("${wms.movePath}") |
| | | private String movePath; |
| | | @Value("${wms.inboundTaskApplyPath}") |
| | | private String inboundTaskApplyPath; |
| | | @Value("${wms.TaskExecCallback}") |
| | | private String TaskExecCallback; |
| | | @Value("${wms.taskStatusFeedbackPath}") |
| | | private String taskStatusFeedbackPath; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void execute() throws IOException { |
| | | |
| | | for (TaskWrk taskWrk : taskWrkService.selectToBeHistoryData()) { |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | if (taskWrk.getStatus().equals(TaskStatusType.OVER.id)||taskWrk.getStatus()==7) {//完成 |
| | | //区分入出库 |
| | | TaskWrkLog taskWrkLog = new TaskWrkLog(taskWrk); |
| | |
| | | if (!taskWrkService.deleteById(taskWrk)) { |
| | | throw new CoolException("任务档删除失败" + taskWrkLog); |
| | | } |
| | | headParam.put("Result", 1); |
| | | } else if (taskWrk.getStatus().equals(TaskStatusType.CANCEL.id)) { |
| | | TaskWrkLog taskWrkLog=new TaskWrkLog(taskWrk); |
| | | if(!wrkLogService.insert(taskWrkLog)){ |
| | |
| | | if(!taskWrkService.deleteById(taskWrk)){ |
| | | throw new CoolException("任务档删除失败"+taskWrkLog); |
| | | } |
| | | headParam.put("Result", 2); |
| | | } |
| | | String response = ""; |
| | | try { |
| | | headParam.put("TaskNo", taskWrk.getTaskNo()); |
| | | log.info("wcs手动完成任务上报wms={}", taskWrk); |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(TaskExecCallback) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | Boolean bool = false; |
| | | if(jsonObject.get("ReturnStatus").equals(0)){ |
| | | bool = true; |
| | | } |
| | | apiLogService.save("wcs完成或者取消任务上报wms" |
| | | , wmsUrl + TaskExecCallback |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(headParam) |
| | | , response |
| | | , bool |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("wcs手动完成任务上报wms失败{},返回值={}", taskWrk, response); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public static String Fusion(int x, int y, int z){ |
| | | String locNo="0"+x; |
| | | if(z>=10){ |
| | | locNo=locNo+"0"+z; |
| | | }else{ |
| | | locNo=locNo+"00"+z; |
| | | } |
| | | if(y>=10){ |
| | | locNo=locNo+y; |
| | | }else { |
| | | locNo=locNo+"0"+y; |
| | | } |
| | | |
| | | return locNo; |
| | | } |
| | | |
| | | } |
| | |
| | | // 演示 |
| | | // mainService.crnDemoOfLocMove1(); |
| | | // 入库 ===>> 入库站到堆垛机站,根据条码扫描生成入库工作档 |
| | | mainService.generateStoreWrkFile(); // 组托 |
| | | mainService.generateStoreWrkFile1(); // 组托 |
| | | // 出库 ===>> 堆垛机出库站到出库站 |
| | | mainService.crnStnToOutStn(); |
| | | // 入出库 ===>> 堆垛机入出库作业下发 |
| | |
| | | //自动完成任务 |
| | | // mainService.autoCompleteTask(); |
| | | //agv取放货完成 |
| | | mainService.autoCompleteAGV(); |
| | | // mainService.autoCompleteAGV(); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | basDevp.setLocType3((short) 0); // 轻重类型{0:未知,1:轻库位,2:重库位} |
| | | basDevp.setLocType1(high != low && low ? (short) 1 : (short) 2); |
| | | basDevp.setInQty(inQty !=null ?(int)inQty : 0); |
| | | basDevp.setAgvStartPick(agvStartPick.intValue()); |
| | | basDevp.setAgvStartPlace(agvStartPlace.intValue()); |
| | | // basDevp.setAgvStartPick(agvStartPick.intValue()); |
| | | // basDevp.setAgvStartPlace(agvStartPlace.intValue()); |
| | | return basDevp; |
| | | } |
| | | |
| | |
| | | break; |
| | | // 写入数据 |
| | | case 2: |
| | | write2((CrnCommand) task.getData()); |
| | | write5((CrnCommand) task.getData()); |
| | | break; |
| | | // 复位 |
| | | case 3: |
| | |
| | | |
| | | command.setCrnNo(slave.getId()); |
| | | short[] array = new short[10]; |
| | | if (Cools.isEmpty(command.getAckFinish())) { |
| | | array[0] = 5; |
| | | } else { |
| | | array[0] = command.getAckFinish(); |
| | | } |
| | | array[0] = command.getAckFinish(); |
| | | array[1] = command.getTaskNo(); |
| | | array[2] = command.getTaskMode(); |
| | | array[3] = command.getSourcePosX(); |
| | |
| | | // 作业信息 |
| | | OperateResult result = siemensNet.Write("DB100.0", array); |
| | | |
| | | if (command.getAckFinish() != 1) { |
| | | BasCrnOptService bean = SpringUtils.getBean(BasCrnOptService.class); |
| | | BasCrnOpt basCrnOpt = new BasCrnOpt( |
| | | command.getTaskNo().intValue(), // 任务号 |
| | | command.getCrnNo(), // 堆垛机[非空] |
| | | new Date(), // 下发时间 |
| | | command.getTaskModeType() == null ? null : command.getTaskModeType().toString(), // 模式 |
| | | command.getSourcePosZ().intValue(), // 源排 |
| | | command.getSourcePosX().intValue(), // 源列 |
| | | command.getSourcePosY().intValue(), // 源层 |
| | | null, // 源站 |
| | | command.getDestinationPosZ().intValue(), // 目标排 |
| | | command.getDestinationPosX().intValue(), // 目标列 |
| | | command.getDestinationPosY().intValue(), // 目标层 |
| | | null, // 目标站 |
| | | null, // 响应结果 |
| | | null, // 修改时间 |
| | | null // 修改人员 |
| | | ); |
| | | bean.insert(basCrnOpt); |
| | | } |
| | | |
| | | if (result.IsSuccess) { |
| | | // log.warn("堆垛机命令下发[id:{},时间:{}] >>>>> {}", slave.getId(), DateUtils.convert(new Date(), DateUtils.yyyyMMddHHmmsssss_F), JSON.toJSON(command)); |
| | | // OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | // return true; |
| | | log.warn("堆垛机命令下发[id:{},时间:{}] >>>>> {}", slave.getId(), DateUtils.convert(new Date(), DateUtils.yyyyMMddHHmmsssss_F), JSON.toJSON(command)); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | return true; |
| | | } else { |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】写入堆垛机plc数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot())); |
| | | log.error("写入堆垛机plc数据失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 写入数据 |
| | | */ |
| | | private boolean write5(CrnCommand command) throws InterruptedException { |
| | | String methodName = Thread.currentThread().getStackTrace()[1].getMethodName(); |
| | | |
| | | try{ |
| | | if (null == command) { |
| | | log.error("堆垛机写入命令为空"); |
| | | return false; |
| | | } |
| | | // convertRow(command); |
| | | command.setCrnNo(slave.getId()); |
| | | short[] array = new short[10]; |
| | | array[0] = command.getAckFinish(); |
| | | array[1] = command.getTaskNo(); |
| | | array[2] = command.getTaskMode(); |
| | | array[3] = command.getSourcePosX(); |
| | | array[4] = command.getSourcePosY(); |
| | | array[5] = command.getSourcePosZ(); |
| | | array[6] = command.getDestinationPosX(); |
| | | array[7] = command.getDestinationPosY(); |
| | | array[8] = command.getDestinationPosZ(); |
| | | // array[9] = command.getSourceStaNo(); |
| | | // array[10] = command.getDestinationStaNo(); |
| | | array[9] = command.getCommand(); |
| | | |
| | | OperateResult result = siemensNet.Write("DB100.0", array); |
| | | |
| | | int i=0; |
| | | do{ |
| | | //堆垛机任务写入后,回读一次,看是否成功 |
| | | Thread.sleep(500); |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 24); |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 20); |
| | | if (resultRead.IsSuccess) { |
| | | CrnCommand one = new CrnCommand(); |
| | | one.setAckFinish(siemensNet.getByteTransform().TransInt16(resultRead.Content, 0)); |
| | | one.setTaskNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 2)); |
| | | //one.setTaskMode(siemensNet.getByteTransform().TransInt16(resultRead.Content, 4)); |
| | | one.setTaskMode(siemensNet.getByteTransform().TransInt16(resultRead.Content, 4)); |
| | | one.setSourcePosX(siemensNet.getByteTransform().TransInt16(resultRead.Content, 6)); |
| | | one.setSourcePosY(siemensNet.getByteTransform().TransInt16(resultRead.Content, 8)); |
| | | one.setSourcePosZ(siemensNet.getByteTransform().TransInt16(resultRead.Content, 10)); |
| | | one.setDestinationPosX(siemensNet.getByteTransform().TransInt16(resultRead.Content, 12)); |
| | | one.setDestinationPosY(siemensNet.getByteTransform().TransInt16(resultRead.Content, 14)); |
| | | one.setDestinationPosZ(siemensNet.getByteTransform().TransInt16(resultRead.Content, 16)); |
| | | // one.setSourceStaNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 18)); |
| | | // one.setDestinationStaNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 20)); |
| | | if (!one.getTaskNo().equals(array[1]) || !one.getAckFinish().equals(array[0]) |
| | | || !one.getSourcePosZ().equals(array[5]) || !one.getSourcePosX().equals(array[3]) |
| | | || !one.getSourcePosY().equals(array[4]) |
| | | || !one.getDestinationPosZ().equals(array[8]) || !one.getDestinationPosX().equals(array[6]) |
| | | || !one.getDestinationPosY().equals(array[7]) |
| | | if (!command.getTaskNo().equals(one.getTaskNo()) || !command.getTaskMode().equals(one.getTaskMode()) |
| | | || !command.getSourcePosX().equals(one.getSourcePosX()) || !command.getSourcePosY().equals(one.getSourcePosY()) |
| | | || !command.getSourcePosZ().equals(one.getSourcePosZ()) || !command.getDestinationPosX().equals(one.getDestinationPosX()) |
| | | || !command.getDestinationPosY().equals(one.getDestinationPosY()) || !command.getDestinationPosZ().equals(one.getDestinationPosZ()) |
| | | ){ |
| | | log.error("传参==堆垛机命令地址写入后回读失败[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one)); |
| | | log.error("实发==堆垛机命令地址写入后回读失败[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one)); |
| | | log.error("堆垛机命令回读失败后,重新添加任务到队列 ===>> [id:{}],{}", slave.getId(), JSON.toJSON(crnCommand)); |
| | | MessageQueue.offer(SlaveType.Crn, slave.getId(), new Task(5, crnCommand)); |
| | | Thread.sleep(100); |
| | | readStatus(); |
| | | return false; |
| | | } else { |
| | | log.info("堆垛机命令地址写入后回读成功[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one)); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | i++; |
| | | log.error("堆垛机命令地址写入后回读失败[id:{}]>>>>重写[{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), i,JSON.toJSON(command),JSON.toJSON(one)); |
| | | result = siemensNet.Write("DB100.0", array); |
| | | }else{ |
| | | i=5; |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("堆垛机命令地址写入后回读出错"); |
| | | log.error("堆垛机命令地址写入后回读出错:异常信息:"+e); |
| | | }while(i<5); |
| | | |
| | | |
| | | try { |
| | | // 日志记录 |
| | | BasCrnOptService bean = SpringUtils.getBean(BasCrnOptService.class); |
| | | BasCrnOpt basCrnOpt = new BasCrnOpt( |
| | | command.getTaskNo().intValue(), // 任务号 |
| | | command.getCrnNo(), // 堆垛机[非空] |
| | | new Date(), // 下发时间 |
| | | command.getTaskModeType().toString(), // 模式 |
| | | command.getSourcePosX().intValue(), // 源排 |
| | | command.getSourcePosY().intValue(), // 源列 |
| | | command.getSourcePosZ().intValue(), // 源层 |
| | | null, // 源站 |
| | | command.getDestinationPosX().intValue(), // 目标排 |
| | | command.getDestinationPosY().intValue(), // 目标列 |
| | | command.getDestinationPosZ().intValue(), // 目标层 |
| | | null, // 目标站 |
| | | null, // 响应结果 |
| | | null, // 修改时间 |
| | | null // 修改人员 |
| | | ); |
| | | bean.insert(basCrnOpt); |
| | | } catch (Exception ignore) {} |
| | | |
| | | if (result != null && result.IsSuccess) { |
| | | Thread.sleep(200); |
| | | this.readStatus(); |
| | | log.info(methodName + ":堆垛机命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command)); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | return true; |
| | | } else { |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】写入堆垛机plc数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort())); |
| | | log.error(methodName + ":写入堆垛机plc数据失败 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | CommandInfoLog commandInfoLog = JSON.parseObject(JSON.toJSONString(commandInfo), CommandInfoLog.class); |
| | | commandInfoLog.setId(null); |
| | | // CommandInfoLog commandInfoLog = new CommandInfoLog(); |
| | | // if (commandInfo != null) { |
| | | // commandInfoLog = JSON.parseObject(JSON.toJSONString(commandInfo), CommandInfoLog.class); |
| | | // commandInfoLog.setId(null); |
| | | // }else { |
| | | // Date now = new Date(); |
| | | // commandInfoLog.setCommand(JSON.toJSONString(command)); |
| | | // commandInfoLog.setCommandStatus(3); |
| | | // commandInfoLog.setStartTime(now); |
| | | // commandInfoLog.setExecuteTime(now); |
| | | // commandInfoLog.setCompleteTime(now); |
| | | // commandInfoLog.setDevice(SlaveType.Devp.toString()); |
| | | // commandInfoLog.setWrkNo(9999); |
| | | // commandInfoLog.setTaskNo("9999"); |
| | | // commandInfoLog.setCommandDesc("手动命令"); |
| | | // } |
| | | |
| | | |
| | | if (result.IsSuccess) { |
| | | // log.warn("堆垛机命令下发[id:{},时间:{}] >>>>> {}", slave.getId(), DateUtils.convert(new Date(), DateUtils.yyyyMMddHHmmsssss_F), JSON.toJSON(command)); |
| | | |
| | | Date now = new Date(); |
| | | //更新指令日志 |
| | | commandInfoLog.setDeviceLog("指令下发成功"); |
| | |
| | | } else { |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】写入堆垛机plc数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot())); |
| | | log.error("写入堆垛机plc数据失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | | |
| | | //更新指令日志 |
| | | commandInfoLog.setDeviceLog("指令下发失败"); |
| | | commandInfoLogService.insert(commandInfoLog); |
| | | return false; |
| | | } |
| | | try{ |
| | | //堆垛机任务写入后,回读一次,看是否成功 |
| | | Thread.sleep(500); |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 24); |
| | | /* |
| | | * |
| | | * if (command.getTaskNo() == 0 && command.getAckFinish() == 0 && command.getAuto() != 1) { |
| | | command.setTaskNo((short) 999); |
| | | } |
| | | |
| | | command.setCrnNo(slave.getId()); |
| | | short[] array = new short[10]; |
| | | if (Cools.isEmpty(command.getAckFinish())) { |
| | | array[0] = 5; |
| | | } else { |
| | | array[0] = command.getAckFinish(); |
| | | } |
| | | array[1] = command.getTaskNo(); |
| | | array[2] = command.getTaskMode(); |
| | | array[3] = command.getSourcePosX(); |
| | | array[4] = command.getSourcePosY(); |
| | | array[5] = command.getSourcePosZ(); |
| | | array[6] = command.getDestinationPosX(); |
| | | array[7] = command.getDestinationPosY(); |
| | | array[8] = command.getDestinationPosZ(); |
| | | array[9] = command.getCommand(); |
| | | // 作业信息 |
| | | OperateResult result = siemensNet.Write("DB100.0", array); |
| | | * */ |
| | | if (resultRead.IsSuccess) { |
| | | CrnCommand one = new CrnCommand(); |
| | | one.setAckFinish(siemensNet.getByteTransform().TransInt16(resultRead.Content, 0)); |
| | | one.setTaskNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 2)); |
| | | //one.setTaskMode(siemensNet.getByteTransform().TransInt16(resultRead.Content, 4)); |
| | | one.setSourcePosX(siemensNet.getByteTransform().TransInt16(resultRead.Content, 6)); |
| | | one.setSourcePosY(siemensNet.getByteTransform().TransInt16(resultRead.Content, 8)); |
| | | one.setSourcePosZ(siemensNet.getByteTransform().TransInt16(resultRead.Content, 10)); |
| | | one.setDestinationPosX(siemensNet.getByteTransform().TransInt16(resultRead.Content, 12)); |
| | | one.setDestinationPosY(siemensNet.getByteTransform().TransInt16(resultRead.Content, 14)); |
| | | one.setDestinationPosZ(siemensNet.getByteTransform().TransInt16(resultRead.Content, 16)); |
| | | // one.setSourceStaNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 18)); |
| | | // one.setDestinationStaNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 20)); |
| | | if (!one.getTaskNo().equals(array[1]) || !one.getAckFinish().equals(array[0]) |
| | | || !one.getSourcePosZ().equals(array[5]) || !one.getSourcePosX().equals(array[3]) |
| | | || !one.getSourcePosY().equals(array[4]) |
| | | || !one.getDestinationPosZ().equals(array[8]) || !one.getDestinationPosX().equals(array[6]) |
| | | || !one.getDestinationPosY().equals(array[7]) |
| | | ){ |
| | | log.error("堆垛机命令地址写入后回读失败[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one)); |
| | | log.error("堆垛机命令回读失败后,重新添加任务到队列 ===>> [id:{}],{}", slave.getId(), JSON.toJSON(crnCommand)); |
| | | MessageQueue.offer(SlaveType.Crn, slave.getId(), new Task(5, crnCommand)); |
| | | Thread.sleep(100); |
| | | readStatus(); |
| | | return false; |
| | | } else { |
| | | log.info("堆垛机命令地址写入后回读成功[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one)); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("堆垛机命令地址写入后回读出错"); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>(); |
| | | private short heartBeatVal = 1; |
| | | public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{ |
| | | add(100);add(101);add(102);add(103);add(104);add(105);add(106);add(107); |
| | | add(100);add(101);add(102);add(103);add(104); |
| | | add(105);add(106);add(107);add(108);add(109); |
| | | add(110);add(111);add(112);add(113);add(114); |
| | | add(115);add(116);add(117);add(118);add(119); |
| | | add(120);add(121);add(122);add(123);add(124); |
| | | add(125);add(1001);add(1002);add(1003);add(1004); |
| | | }}; |
| | | /*public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{ |
| | | add(200);add(201);add(202);add(203); |
| | |
| | | /** |
| | | * 条码数量 |
| | | */ |
| | | private int barcodeSize = 7; |
| | | private int barcodeSize = 1; |
| | | |
| | | /** |
| | | * 入出库模式 |
| | |
| | | } |
| | | } |
| | | |
| | | OperateResultExOne<byte[]> resultAgvAndPlc = siemensS7Net.Read("DB102.0", (short) 30); |
| | | if (resultAgvAndPlc.IsSuccess) { |
| | | for (int i = 0; i < staNoSize; i++) { |
| | | int sign =(i+2)/2-1; |
| | | if ((i+2)%2!=0){ |
| | | Integer siteId = staNos.get(i); // 站点编号 |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (null == staProtocol) { |
| | | staProtocol = new StaProtocol(); |
| | | staProtocol.setSiteId(siteId); |
| | | station.put(siteId, staProtocol); |
| | | } |
| | | staProtocol.setAgvStartPick(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlc.Content, sign*6+4)); // 允许取货 |
| | | staProtocol.setAgvStartPlace((short)0); // 允许放货 |
| | | continue; |
| | | } |
| | | Integer siteId = staNos.get(i); // 站点编号 |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (null == staProtocol) { |
| | | staProtocol = new StaProtocol(); |
| | | staProtocol.setSiteId(siteId); |
| | | station.put(siteId, staProtocol); |
| | | } |
| | | staProtocol.setAgvStartPick(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlc.Content, sign*6)); // 允许取货 |
| | | staProtocol.setAgvStartPlace(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlc.Content, sign*6 + 2)); // 允许放货 |
| | | } |
| | | } |
| | | // OperateResultExOne<byte[]> resultAgvAndPlc = siemensS7Net.Read("DB102.0", (short) 30); |
| | | // if (resultAgvAndPlc.IsSuccess) { |
| | | // for (int i = 0; i < staNoSize; i++) { |
| | | // int sign =(i+2)/2-1; |
| | | // if ((i+2)%2!=0){ |
| | | // Integer siteId = staNos.get(i); // 站点编号 |
| | | // StaProtocol staProtocol = station.get(siteId); |
| | | // if (null == staProtocol) { |
| | | // staProtocol = new StaProtocol(); |
| | | // staProtocol.setSiteId(siteId); |
| | | // station.put(siteId, staProtocol); |
| | | // } |
| | | // staProtocol.setAgvStartPick(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlc.Content, sign*6+4)); // 允许取货 |
| | | // staProtocol.setAgvStartPlace((short)0); // 允许放货 |
| | | // continue; |
| | | // } |
| | | // Integer siteId = staNos.get(i); // 站点编号 |
| | | // StaProtocol staProtocol = station.get(siteId); |
| | | // if (null == staProtocol) { |
| | | // staProtocol = new StaProtocol(); |
| | | // staProtocol.setSiteId(siteId); |
| | | // station.put(siteId, staProtocol); |
| | | // } |
| | | // staProtocol.setAgvStartPick(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlc.Content, sign*6)); // 允许取货 |
| | | // staProtocol.setAgvStartPlace(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlc.Content, sign*6 + 2)); // 允许放货 |
| | | // } |
| | | // } |
| | | |
| | | OperateResultExOne<byte[]> resultAgvAndPlcOk = siemensS7Net.Read("DB132.0", (short) 30); |
| | | if (resultAgvAndPlcOk.IsSuccess) { |
| | | for (int i = 0; i < staNoSize; i++) { |
| | | int sign =(i+2)/2-1; |
| | | if ((i+2)%2!=0){ |
| | | Integer siteId = staNos.get(i); // 站点编号 |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (null == staProtocol) { |
| | | staProtocol = new StaProtocol(); |
| | | staProtocol.setSiteId(siteId); |
| | | station.put(siteId, staProtocol); |
| | | } |
| | | staProtocol.setAgvTargetPick(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlcOk.Content, sign*6+4)); // 允许取货 |
| | | staProtocol.setAgvTargetPlace((short)0); // 允许放货 |
| | | continue; |
| | | } |
| | | Integer siteId = staNos.get(i); // 站点编号 |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (null == staProtocol) { |
| | | staProtocol = new StaProtocol(); |
| | | staProtocol.setSiteId(siteId); |
| | | station.put(siteId, staProtocol); |
| | | } |
| | | try{ |
| | | staProtocol.setAgvTargetPick(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlcOk.Content, sign*6)); // 取货完成 |
| | | if (staProtocol.getAgvTargetPick()!=0){ |
| | | System.out.println(staProtocol.getAgvTargetPick()); |
| | | } |
| | | staProtocol.setAgvTargetPlace(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlcOk.Content, sign*6 + 2)); // 放货完成 |
| | | if (staProtocol.getAgvTargetPlace()!=0){ |
| | | System.out.println(staProtocol.getAgvTargetPlace()); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error(""+e); |
| | | } |
| | | } |
| | | } |
| | | // OperateResultExOne<byte[]> resultAgvAndPlcOk = siemensS7Net.Read("DB132.0", (short) 30); |
| | | // if (resultAgvAndPlcOk.IsSuccess) { |
| | | // for (int i = 0; i < staNoSize; i++) { |
| | | // int sign =(i+2)/2-1; |
| | | // if ((i+2)%2!=0){ |
| | | // Integer siteId = staNos.get(i); // 站点编号 |
| | | // StaProtocol staProtocol = station.get(siteId); |
| | | // if (null == staProtocol) { |
| | | // staProtocol = new StaProtocol(); |
| | | // staProtocol.setSiteId(siteId); |
| | | // station.put(siteId, staProtocol); |
| | | // } |
| | | // staProtocol.setAgvTargetPick(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlcOk.Content, sign*6+4)); // 允许取货 |
| | | // staProtocol.setAgvTargetPlace((short)0); // 允许放货 |
| | | // continue; |
| | | // } |
| | | // Integer siteId = staNos.get(i); // 站点编号 |
| | | // StaProtocol staProtocol = station.get(siteId); |
| | | // if (null == staProtocol) { |
| | | // staProtocol = new StaProtocol(); |
| | | // staProtocol.setSiteId(siteId); |
| | | // station.put(siteId, staProtocol); |
| | | // } |
| | | // try{ |
| | | // staProtocol.setAgvTargetPick(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlcOk.Content, sign*6)); // 取货完成 |
| | | // if (staProtocol.getAgvTargetPick()!=0){ |
| | | // System.out.println(staProtocol.getAgvTargetPick()); |
| | | // } |
| | | // staProtocol.setAgvTargetPlace(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlcOk.Content, sign*6 + 2)); // 放货完成 |
| | | // if (staProtocol.getAgvTargetPlace()!=0){ |
| | | // System.out.println(staProtocol.getAgvTargetPlace()); |
| | | // } |
| | | // }catch (Exception e){ |
| | | // log.error(""+e); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | if (slave.getId() == 1) { |
| | | //条码 |
| | | //Thread.sleep(200); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.840.0", (short) 32); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.848.0", (short) 8); |
| | | if (result2.IsSuccess) { |
| | | for (int i = 0; i < 4; i++) { |
| | | for (int i = 0; i < 1; i++) { |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content, i * 8, 8, "UTF-8"); |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1); |
| | | if (!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) { |
| | |
| | | } |
| | | } |
| | | |
| | | //外形检测 |
| | | OperateResultExOne<byte[]> resultErr1 = siemensS7Net.Read("DB101.810.0", (short) (barcodeSize*1)); |
| | | StaProtocol staProtocol1 = station.get(116); |
| | | boolean[] status1 = siemensS7Net.getByteTransform().TransBool(resultErr1.Content, 0, 1); |
| | | staProtocol1.setFrontErr(status1[0]); |
| | | staProtocol1.setBackErr(status1[1]); |
| | | staProtocol1.setHighErr(status1[2]); |
| | | staProtocol1.setLeftErr(status1[3]); |
| | | staProtocol1.setRightErr(status1[4]); |
| | | staProtocol1.setWeightErr(status1[5]); |
| | | staProtocol1.setBarcodeErr(status1[6]); |
| | | |
| | | OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB13.2", (short) (staNoSize * 4)); |
| | | OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.922.0", (short) (staNoSize * 4)); |
| | | if (resultErr.IsSuccess) { |
| | | for (int i = 0; i < staNoSize; i++) { |
| | | Integer siteId = staNos.get(i); // 站点编号 |
| | |
| | | wcs-slave: |
| | | doubleDeep: true #双深 |
| | | doubleLocs: 3,6,7,10,13 #双深库位排号 3,6,7,10,13 |
| | | doubleLocs: 1,4,5,8 #双深库位排号 1,4,5,8 |
| | | groupCount: 4 #一个堆垛机负责的货架排数 |
| | | crn[0]: #堆垛机1 |
| | | id: 1 |
| | | ip: 10.10.10.110 |
| | | slot: 0 |
| | | demo: false |
| | | rack: 0 |
| | | offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | port: 102 |
| | | crnOutStn[0]: #堆垛机出库站点 |
| | | staNo: 101 |
| | | crnOutStn[0]: #堆垛机出库站点 |
| | | staNo: 125 |
| | | row: 3 |
| | | bay: 1 |
| | | lev: 2 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | crnInStn[0]: #堆垛机入库站点1 |
| | | staNo: 100 |
| | | row: 2 |
| | | bay: 1 |
| | | lev: 1 |
| | | lev: 2 |
| | | backSta: 102 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | ip: 192.168.1.100 |
| | | crnInStn[0]: #堆垛机入库站点1 |
| | | staNo: 100 |
| | | row: 1 |
| | | bay: 1 |
| | | lev: 1 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | id: 1 |
| | | slot: 0 |
| | | demo: false |
| | | crn[1]: #堆垛机2 |
| | | rack: 0 |
| | | offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | port: 102 |
| | | crnOutStn[0]: #堆垛机出库站点 |
| | | staNo: 103 |
| | | row: 5 |
| | | bay: 1 |
| | | lev: 1 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | ip: 192.168.1.110 |
| | | crnInStn[0]: #堆垛机入库站点1 |
| | | staNo: 102 |
| | | row: 4 |
| | | bay: 1 |
| | | lev: 1 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | id: 2 |
| | | ip: 10.10.10.120 |
| | | slot: 0 |
| | | demo: false |
| | | barcode[3]: #条码扫描仪4 |
| | | port: 51236 |
| | | ip: 10.10.10.52 |
| | | id: 4 |
| | | barcode[2]: #条码扫描仪3 |
| | | port: 51236 |
| | | ip: 10.10.10.52 |
| | | id: 3 |
| | | |
| | | barcode[1]: #条码扫描仪2 |
| | | port: 51236 |
| | | ip: 10.10.10.52 |
| | | id: 2 |
| | | |
| | | rack: 0 |
| | | offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | port: 102 |
| | | crnOutStn[0]: #堆垛机出库站点 |
| | | staNo: 115 |
| | | row: 7 |
| | | bay: 1 |
| | | lev: 2 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | crnInStn[0]: #堆垛机入库站点1 |
| | | staNo: 120 |
| | | row: 6 |
| | | bay: 1 |
| | | lev: 2 |
| | | backSta: 106 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devp[0]: #输送线 |
| | | emptyInSta[2]: #空板入库口3 |
| | | staNo: 104 |
| | | emptyInSta[1]: #空板入库口2 |
| | | staNo: 102 |
| | | id: 1 |
| | | ip: 10.10.10.130 |
| | | rack: 0 |
| | | emptyInSta[0]: #空板入库口1 |
| | | staNo: 100 |
| | | ip: 192.168.1.140 |
| | | outSta[4]: #出库口5 |
| | | staNo: 104 |
| | | outSta[3]: #出库口4 |
| | | staNo: 103 |
| | | outSta[6]: #出库口7 |
| | | staNo: 106 |
| | | slot: 0 |
| | | outSta[5]: #出库口6 |
| | | staNo: 105 |
| | | outSta[0]: #出库口1 |
| | | staNo: 100 |
| | | outSta[2]: #出库口3 |
| | | staNo: 102 |
| | | emptyInSta[3]: #空板入库口4 |
| | | staNo: 106 |
| | | outSta[1]: #出库口2 |
| | | staNo: 101 |
| | | inSta[2]: |
| | | staNo: 104 |
| | | barcode: ${wcs-slave.barcode[2].id} |
| | | inSta[3]: |
| | | staNo: 106 |
| | | barcode: ${wcs-slave.barcode[3].id} |
| | | port: 102 |
| | | outSta[7]: #出库口8 |
| | | staNo: 107 |
| | | slot: 0 |
| | | emptyInSta[0]: #空板入库口0 |
| | | staNo: 116 |
| | | inSta[0]: #入库口1 |
| | | staNo: 100 |
| | | staNo: 116 |
| | | backSta: 110 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | inSta[1]: #入库口2 |
| | | staNo: 102 |
| | | barcode: ${wcs-slave.barcode[1].id} |
| | | id: 1 |
| | | barcode[0]: #条码扫描仪1 |
| | | port: 51236 |
| | | ip: 10.10.10.52 |
| | | id: 1 |
| | | |
| | | crn[2]: #堆垛机3 |
| | | rack: 0 |
| | | offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | port: 102 |
| | | crnOutStn[0]: #堆垛机出库站点 |
| | | outSta[0]: #出库口1 |
| | | staNo: 105 |
| | | row: 9 |
| | | bay: 1 |
| | | lev: 1 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | ip: 192.168.1.120 |
| | | crnInStn[0]: #堆垛机入库站点1 |
| | | staNo: 104 |
| | | row: 8 |
| | | bay: 1 |
| | | lev: 1 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | id: 3 |
| | | slot: 0 |
| | | demo: false |
| | | crn[3]: #堆垛机4 |
| | | rack: 0 |
| | | offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | port: 102 |
| | | crnOutStn[0]: #堆垛机出库站点 |
| | | outSta[1]: #出库口2 |
| | | staNo: 107 |
| | | row: 12 |
| | | bay: 1 |
| | | lev: 1 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | ip: 192.168.1.130 |
| | | crnInStn[0]: #堆垛机入库站点1 |
| | | staNo: 106 |
| | | row: 11 |
| | | bay: 1 |
| | | lev: 1 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | id: 4 |
| | | slot: 0 |
| | | demo: false |
| | | |
| | | |
| | | outSta[2]: #出库口2 |
| | | staNo: 109 |
| | | outSta[3]: #出库口1 |
| | | staNo: 110 |
| | | barcode[0]: #条码扫描仪 |
| | | port: 51236 |
| | | ip: 172.17.91.39 |
| | | id: 1 |
| | | # crn[0]: #堆垛机1 |
| | | # id: 1 |
| | | # ip: 172.17.91.2 |
| | | # slot: 0 |
| | | # demo: false |
| | | # rack: 0 |
| | | # offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | # offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | # port: 102 |
| | | # crnOutStn[0]: #堆垛机出库站点 |
| | | # crnOutStn[0]: #堆垛机出库站点 |
| | | # staNo: 101 |
| | | # row: 2 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # ip: 192.168.1.100 |
| | | # crnInStn[0]: #堆垛机入库站点1 |
| | | # staNo: 100 |
| | | # row: 2 |
| | | # row: 1 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnInStn[0]: #堆垛机入库站点1 |
| | | # staNo: 103 |
| | | # row: 3 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # backSta: 102 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnOutStn[1]: #堆垛机出库站点 |
| | | # staNo: 200 |
| | | # row: 2 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # crnInStn[1]: #堆垛机入库站点2 |
| | | # staNo: 205 |
| | | # row: 3 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # crn[1]: #堆垛机2 |
| | | # id: 2 |
| | | # ip: 172.17.91.7 |
| | | # slot: 0 |
| | | # demo: false |
| | | # rack: 0 |
| | | # offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | # port: 102 |
| | | # crnOutStn[0]: #堆垛机出库站点 |
| | | # staNo: 104 |
| | | # row: 5 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnInStn[0]: #堆垛机入库站点1 |
| | | # staNo: 107 |
| | | # row: 6 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # backSta: 106 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnOutStn[1]: #堆垛机出库站点 |
| | | # staNo: 206 |
| | | # row: 5 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # crnInStn[1]: #堆垛机入库站点2 |
| | | # staNo: 211 |
| | | # row: 6 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # crn[2]: #堆垛机3 |
| | | # id: 3 |
| | | # ip: 172.17.91.12 |
| | | # slot: 0 |
| | | # demo: false |
| | | # rack: 0 |
| | | # offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | # port: 102 |
| | | # crnOutStn[0]: #堆垛机出库站点 |
| | | # staNo: 108 |
| | | # row: 8 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnInStn[0]: #堆垛机入库站点1 |
| | | # staNo: 111 |
| | | # row: 9 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # backSta: 110 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnOutStn[1]: #堆垛机出库站点 |
| | | # staNo: 212 |
| | | # row: 8 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # crnInStn[1]: #堆垛机入库站点2 |
| | | # staNo: 217 |
| | | # row: 9 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # crn[3]: #堆垛机4 |
| | | # id: 4 |
| | | # ip: 172.17.91.17 |
| | | # slot: 0 |
| | | # demo: false |
| | | # rack: 0 |
| | | # offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | # port: 102 |
| | | # crnOutStn[0]: #堆垛机出库站点 |
| | | # staNo: 112 |
| | | # row: 12 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnInStn[0]: #堆垛机入库站点1 |
| | | # staNo: 115 |
| | | # row: 13 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # backSta: 114 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnOutStn[1]: #堆垛机出库站点 |
| | | # staNo: 218 |
| | | # row: 12 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # crnInStn[1]: #堆垛机入库站点2 |
| | | # staNo: 223 |
| | | # row: 13 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # crn[4]: #堆垛机5 |
| | | # id: 5 |
| | | # ip: 172.17.91.22 |
| | | # slot: 0 |
| | | # demo: false |
| | | # rack: 0 |
| | | # offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | # port: 102 |
| | | # crnOutStn[0]: #堆垛机出库站点 |
| | | # staNo: 116 |
| | | # row: 16 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnInStn[0]: #堆垛机入库站点1 |
| | | # staNo: 119 |
| | | # row: 17 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # backSta: 118 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnOutStn[1]: #堆垛机出库站点 |
| | | # staNo: 224 |
| | | # row: 16 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # crnInStn[1]: #堆垛机入库站点2 |
| | | # staNo: 229 |
| | | # row: 17 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # crn[5]: #堆垛机6 |
| | | # id: 6 |
| | | # ip: 172.17.91.27 |
| | | # slot: 0 |
| | | # demo: false |
| | | # rack: 0 |
| | | # offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | # port: 102 |
| | | # crnOutStn[0]: #堆垛机出库站点 |
| | | # staNo: 120 |
| | | # row: 20 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnInStn[0]: #堆垛机入库站点1 |
| | | # staNo: 123 |
| | | # row: 21 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # backSta: 122 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # crnOutStn[1]: #堆垛机出库站点 |
| | | # staNo: 230 |
| | | # row: 20 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # crnInStn[1]: #堆垛机入库站点2 |
| | | # staNo: 235 |
| | | # row: 21 |
| | | # bay: 22 |
| | | # lev: 2 |
| | | # devpPlcId: ${wcs-slave.devp[1].id} |
| | | # devp[0]: #输送线 |
| | | # id: 1 |
| | | # ip: 172.17.91.36 |
| | | # rack: 0 |
| | | # port: 102 |
| | | # slot: 0 |
| | | # emptyInSta[0]: #空板入库口0 |
| | | # demo: false |
| | | # crn[1]: #堆垛机2 |
| | | # rack: 0 |
| | | # offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | # port: 102 |
| | | # crnOutStn[0]: #堆垛机出库站点 |
| | | # staNo: 103 |
| | | # emptyInSta[1]: #空板入库口1 |
| | | # row: 5 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # ip: 192.168.1.110 |
| | | # crnInStn[0]: #堆垛机入库站点1 |
| | | # staNo: 102 |
| | | # row: 4 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # id: 2 |
| | | # slot: 0 |
| | | # demo: false |
| | | # barcode[3]: #条码扫描仪4 |
| | | # port: 51236 |
| | | # ip: 10.10.10.52 |
| | | # id: 4 |
| | | # barcode[2]: #条码扫描仪3 |
| | | # port: 51236 |
| | | # ip: 10.10.10.52 |
| | | # id: 3 |
| | | # |
| | | # barcode[1]: #条码扫描仪2 |
| | | # port: 51236 |
| | | # ip: 10.10.10.52 |
| | | # id: 2 |
| | | # |
| | | # devp[0]: #输送线 |
| | | # emptyInSta[2]: #空板入库口3 |
| | | # staNo: 104 |
| | | # emptyInSta[1]: #空板入库口2 |
| | | # staNo: 102 |
| | | # rack: 0 |
| | | # emptyInSta[0]: #空板入库口1 |
| | | # staNo: 100 |
| | | # ip: 192.168.1.140 |
| | | # outSta[4]: #出库口5 |
| | | # staNo: 104 |
| | | # outSta[3]: #出库口4 |
| | | # staNo: 103 |
| | | # outSta[6]: #出库口7 |
| | | # staNo: 106 |
| | | # slot: 0 |
| | | # outSta[5]: #出库口6 |
| | | # staNo: 105 |
| | | # emptyInSta[2]: #空板入库口2 |
| | | # staNo: 109 |
| | | # emptyInSta[3]: #空板入库口3 |
| | | # staNo: 113 |
| | | # emptyInSta[4]: #空板入库口4 |
| | | # staNo: 117 |
| | | # emptyInSta[5]: #空板入库口5 |
| | | # staNo: 121 |
| | | # outSta[0]: #出库口1 |
| | | # staNo: 100 |
| | | # outSta[2]: #出库口3 |
| | | # staNo: 102 |
| | | # emptyInSta[3]: #空板入库口4 |
| | | # staNo: 106 |
| | | # outSta[1]: #出库口2 |
| | | # staNo: 101 |
| | | # inSta[2]: |
| | | # staNo: 104 |
| | | # barcode: ${wcs-slave.barcode[2].id} |
| | | # inSta[3]: |
| | | # staNo: 106 |
| | | # barcode: ${wcs-slave.barcode[3].id} |
| | | # port: 102 |
| | | # outSta[7]: #出库口8 |
| | | # staNo: 107 |
| | | # inSta[0]: #入库口1 |
| | | # #scale: ${wcs-slave.scale[0].id} |
| | | # staNo: 103 |
| | | # backSta: 102 |
| | | # staNo: 100 |
| | | # barcode: ${wcs-slave.barcode[0].id} |
| | | # inSta[1]: #入库口2 |
| | | # #scale: ${wcs-slave.scale[1].id} |
| | | # staNo: 107 |
| | | # backSta: 106 |
| | | # staNo: 102 |
| | | # barcode: ${wcs-slave.barcode[1].id} |
| | | # #slot: 0 |
| | | # inSta[2]: #入库口1 |
| | | # #scale: ${wcs-slave.scale[0].id} |
| | | # staNo: 111 |
| | | # backSta: 110 |
| | | # barcode: ${wcs-slave.barcode[2].id} |
| | | # inSta[3]: #入库口1 |
| | | # #scale: ${wcs-slave.scale[0].id} |
| | | # staNo: 115 |
| | | # backSta: 114 |
| | | # barcode: ${wcs-slave.barcode[3].id} |
| | | # inSta[4]: #入库口2 |
| | | # #scale: ${wcs-slave.scale[1].id} |
| | | # staNo: 119 |
| | | # backSta: 118 |
| | | # barcode: ${wcs-slave.barcode[4].id} |
| | | # #slot: 0 |
| | | # inSta[5]: #入库口1 |
| | | # #scale: ${wcs-slave.scale[0].id} |
| | | # staNo: 123 |
| | | # backSta: 122 |
| | | # barcode: ${wcs-slave.barcode[5].id} |
| | | # outSta[0]: #出库口1 |
| | | # staNo: 100 |
| | | # outSta[1]: #出库口2 |
| | | # id: 1 |
| | | # |
| | | # |
| | | # crn[2]: #堆垛机3 |
| | | # rack: 0 |
| | | # offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | # port: 102 |
| | | # crnOutStn[0]: #堆垛机出库站点 |
| | | # staNo: 105 |
| | | # row: 9 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # ip: 192.168.1.120 |
| | | # crnInStn[0]: #堆垛机入库站点1 |
| | | # staNo: 104 |
| | | # outSta[2]: #出库口2 |
| | | # staNo: 108 |
| | | # outSta[3]: #出库口1 |
| | | # staNo: 112 |
| | | # outSta[4]: #出库口2 |
| | | # staNo: 116 |
| | | # outSta[5]: #出库口2 |
| | | # staNo: 120 |
| | | # devp[1]: #输送线 |
| | | # id: 2 |
| | | # ip: 172.17.91.45 |
| | | # rack: 0 |
| | | # port: 102 |
| | | # slot: 0 |
| | | # inSta[0]: #入库口2 |
| | | # #scale: ${wcs-slave.scale[1].id} |
| | | # staNo: 205 |
| | | # backSta: 203 |
| | | # #barcode: ${wcs-slave.barcode[4].id} |
| | | # inSta[1]: #入库口2 |
| | | # #scale: ${wcs-slave.scale[1].id} |
| | | # staNo: 211 |
| | | # backSta: 209 |
| | | # #barcode: ${wcs-slave.barcode[4].id} |
| | | # inSta[2]: #入库口2 |
| | | # #scale: ${wcs-slave.scale[1].id} |
| | | # staNo: 217 |
| | | # backSta: 215 |
| | | # #barcode: ${wcs-slave.barcode[4].id} |
| | | # inSta[3]: #入库口2 |
| | | # #scale: ${wcs-slave.scale[1].id} |
| | | # staNo: 223 |
| | | # backSta: 221 |
| | | # #barcode: ${wcs-slave.barcode[4].id} |
| | | # inSta[4]: #入库口2 |
| | | # #scale: ${wcs-slave.scale[1].id} |
| | | # staNo: 229 |
| | | # backSta: 227 |
| | | # #barcode: ${wcs-slave.barcode[4].id} |
| | | # inSta[5]: #入库口2 |
| | | # #scale: ${wcs-slave.scale[1].id} |
| | | # staNo: 235 |
| | | # backSta: 232 |
| | | # #barcode: ${wcs-slave.barcode[4].id} |
| | | # outSta[0]: #出库口1 |
| | | # staNo: 200 |
| | | # outSta[1]: #出库口1 |
| | | # staNo: 206 |
| | | # outSta[2]: #出库口1 |
| | | # staNo: 212 |
| | | # outSta[3]: #出库口1 |
| | | # staNo: 218 |
| | | # outSta[4]: #出库口1 |
| | | # staNo: 224 |
| | | # outSta[5]: #出库口1 |
| | | # staNo: 230 |
| | | # devp[2]: #输送线 |
| | | # row: 8 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # id: 3 |
| | | # ip: 172.17.8.201 |
| | | # rack: 0 |
| | | # slot: 0 |
| | | # demo: false |
| | | # crn[3]: #堆垛机4 |
| | | # rack: 0 |
| | | # offset: 2 #偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | # port: 102 |
| | | # emptyInSta[0]: #空板入库口1 |
| | | # staNo: 306 |
| | | # inSta[0]: #入库口1 |
| | | # scale: ${wcs-slave.scale[1].id} |
| | | # staNo: 301 |
| | | # barcode: ${wcs-slave.barcode[6].id} |
| | | # backSta: 300 |
| | | # #slot: 0 |
| | | # outSta[0]: #出库口1 |
| | | # staNo: 307 |
| | | ## devp[3]: #输送线 |
| | | ## id: 4 |
| | | ## ip: 10.10.10.30 |
| | | ## rack: 0 |
| | | ## slot: 0 |
| | | ## port: 102 |
| | | ## emptyInSta[0]: #空板入库口1 |
| | | ## staNo: 406 |
| | | ## inSta[0]: #入库口1 |
| | | ## scale: ${wcs-slave.scale[1].id} |
| | | ## staNo: 406 |
| | | ## barcode: ${wcs-slave.barcode[1].id} |
| | | ## #slot: 0 |
| | | ## outSta[0]: #出库口1 |
| | | ## staNo: 407 |
| | | # scale[0]: #磅秤 |
| | | # port: 5005 |
| | | # ip: 10.10.10.201 |
| | | # id: 1 |
| | | # scale[1]: #磅秤 |
| | | # port: 5005 |
| | | # ip: 10.10.10.202 |
| | | # id: 2 |
| | | # barcode[0]: #条码扫描仪 |
| | | # port: 51236 |
| | | # ip: 172.17.91.39 |
| | | # id: 1 |
| | | # barcode[1]: |
| | | # port: 51236 |
| | | # ip: 172.17.91.40 |
| | | # id: 2 |
| | | # barcode[2]: |
| | | # port: 51236 |
| | | # ip: 172.17.91.41 |
| | | # id: 3 |
| | | # barcode[3]: |
| | | # port: 51236 |
| | | # ip: 172.17.91.42 |
| | | # crnOutStn[0]: #堆垛机出库站点 |
| | | # staNo: 107 |
| | | # row: 12 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # ip: 192.168.1.130 |
| | | # crnInStn[0]: #堆垛机入库站点1 |
| | | # staNo: 106 |
| | | # row: 11 |
| | | # bay: 1 |
| | | # lev: 1 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # id: 4 |
| | | # barcode[4]: |
| | | # port: 51236 |
| | | # ip: 172.17.91.43 |
| | | # id: 5 |
| | | # barcode[5]: |
| | | # port: 51236 |
| | | # ip: 172.17.91.44 |
| | | # id: 6 |
| | | # barcode[6]: |
| | | # port: 51236 |
| | | # ip: 172.17.8.203 |
| | | # id: 7 |
| | | # slot: 0 |
| | | # demo: false |
| | | |
| | | |
| | |
| | | name: @pom.build.finalName@ |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=rywxasrs |
| | | url: jdbc:sqlserver://10.10.10.220:1433;databasename=rywxasrs |
| | | username: sa |
| | | password: sa@123 |
| | | mvc: |
| | |
| | | |
| | | #License相关配置 |
| | | license: |
| | | subject: ryzhwcs |
| | | subject: jdzwcs |
| | | publicAlias: publicCert |
| | | storePass: public_zhongyang_123456789 |
| | | licensePath: license.lic |
| | |
| | | #url: 10.32.53.195:8080 |
| | | # WMS系统ip |
| | | # url: 10.210.157.109:8090 |
| | | url: 10.210.157.26:8090 |
| | | url: 10.10.10.222:2410 |
| | | # 入库任务申请接口 |
| | | #inboundTaskApplyPath: api/InterFace/inboundTaskApply |
| | | inboundTaskApplyPath: sugood/inboundTaskApply |
| | | inboundTaskApplyPath: api/StereoscopicCallBack/AcceptTaskStatus |
| | | # inboundTaskApplyPath: open/asrs/inboundTaskApply |
| | | # 任务状态反馈接口 |
| | | taskStatusFeedbackPath: sugood/taskStatusReport |
| | | # 货位状态更新接口 |
| | | locationUpdatePath: api/InterFace/get_InterFace_TestStorage |
| | | # 任务开始时,WCS回调WMS |
| | | taskStatusFeedbackPath: api/StereoscopicCallBack/TaskExecCallback |
| | | # 任务完成结束时,WCS回调WMS |
| | | TaskExecCallback: api/StereoscopicCallBack/TaskExecFinishedCallback |
| | | # 移库申请接口 |
| | | movePath: api/InterFace/get_InterFace_TestStorage |
| | |
| | | <result column="crn_no" property="crnNo" /> |
| | | <result column="command_step" property="commandStep" /> |
| | | <result column="transfer_mark" property="transferMark" /> |
| | | <result column="mark_start" property="markStart"/> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | |
| | | <select id="selectPakIn" resultMap="BaseResultMap"> |
| | | select top 1 * from dbo.wcs_task_wrk |
| | | where status=1 |
| | | where status=2 |
| | | and crn_no=#{crnNo} |
| | | and wrk_no=#{workNo} |
| | | and start_point=#{startPoint} |
| | |
| | | var baseUrl = "/wxwcs"; |
| | | var baseUrl = "/jdzwcs"; |
| | | |
| | | // 赋值 |
| | | function setVal(el, val) { |
| | |
| | | mapInfo = { |
| | | "mapName": "wxwcs", |
| | | "mapName": "jdzwcs", |
| | | "rackCount": 13, |
| | | "crnCount": 4, |
| | | "stbCount": 4, |
| | |
| | | "floors": 1, |
| | | "racks": [{ |
| | | "type": "rack", |
| | | "id": "rack4", |
| | | "top": 209, |
| | | "left": 475, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [22] |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack13", |
| | | "top": 598, |
| | | "left": 475, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [1,2] |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack12", |
| | | "top": 574, |
| | | "left": 475, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [1] |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack11", |
| | | "top": 502, |
| | | "left": 475, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [1] |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack10", |
| | | "top": 466, |
| | | "left": 475, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22 |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack9", |
| | | "top": 443, |
| | | "left": 475, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22 |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack8", |
| | | "top": 368, |
| | | "left": 475, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22 |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack7", |
| | | "top": 345, |
| | | "left": 475, |
| | | "top": 326, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [3,10,11,17,18] |
| | | "hiddenArr": [1,22] |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack6", |
| | | "top": 303, |
| | | "left": 475, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [1,3,10,11,17,18,22] |
| | | "hiddenArr": [1,22] |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack5", |
| | | "top": 280, |
| | | "left": 475, |
| | | "top": 209, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [3,10,11,17,18,22] |
| | | "hiddenArr": [1,22] |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack4", |
| | | "top": 232, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [1,22] |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack3", |
| | | "top": 182, |
| | | "left": 475, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | |
| | | "type": "rack", |
| | | "id": "rack2", |
| | | "top": 159, |
| | | "left": 475, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | |
| | | "type": "rack", |
| | | "id": "rack1", |
| | | "top": 98, |
| | | "left": 475, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 22, |
| | | "hiddenArr": [1,22] |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack0", |
| | | "top": 75, |
| | | "left": 800, |
| | | "width": 795, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | |
| | | }], |
| | | "crns": [{ |
| | | "type": "crane", |
| | | "id": "crn-4", |
| | | "text": "4", |
| | | "top": 539, |
| | | "left": 530, |
| | | "width": 93, |
| | | "height": 22 |
| | | }, { |
| | | "type": "track", |
| | | "id": "lb_track4", |
| | | "text": "", |
| | | "top": 550, |
| | | "left": 444, |
| | | "width": 850, |
| | | "height": 2 |
| | | }, { |
| | | "type": "crane", |
| | | "id": "crn-3", |
| | | "text": "3", |
| | | "top": 408, |
| | | "left": 530, |
| | | "width": 93, |
| | | "height": 22 |
| | | }, { |
| | | "type": "track", |
| | | "id": "lb_track3", |
| | | "text": "", |
| | | "top": 418, |
| | | "left": 444, |
| | | "width": 850, |
| | | "height": 2 |
| | | }, { |
| | | "type": "crane", |
| | | "id": "crn-2", |
| | | "text": "2", |
| | | "top": 245, |
| | | "left": 530, |
| | | "top": 268, |
| | | "left": 855, |
| | | "width": 93, |
| | | "height": 22 |
| | | }, { |
| | |
| | | "id": "crn-1", |
| | | "text": "1", |
| | | "top": 132, |
| | | "left": 530, |
| | | "left": 855, |
| | | "width": 93, |
| | | "height": 22 |
| | | }, { |
| | | "type": "track", |
| | | "id": "lb_track2", |
| | | "text": "", |
| | | "top": 255, |
| | | "left": 444, |
| | | "top": 278, |
| | | "left": 769, |
| | | "width": 850, |
| | | "height": 2 |
| | | }, { |
| | |
| | | "id": "lb_track1", |
| | | "text": "", |
| | | "top": 143, |
| | | "left": 447, |
| | | "left": 769, |
| | | "width": 850, |
| | | "height": 2 |
| | | }], |
| | |
| | | "id": "tabControl_floor1", |
| | | "text": "楼层", |
| | | "top": 66, |
| | | "left": 80, |
| | | "left": 580, |
| | | "width": 334, |
| | | "height": 714, |
| | | "floors": [{ |
| | |
| | | "id": "page_floor1", |
| | | "text": "1F", |
| | | "top": 4, |
| | | "left": 22, |
| | | "left": 422, |
| | | "width": 308, |
| | | "height": 706, |
| | | "stns": [{ |
| | | "type": "stn", |
| | | "id": "site-107", |
| | | "text": "107", |
| | | "top": 576, |
| | | "left": 386, |
| | | "width": 92, |
| | | "height": 23 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-106", |
| | | "text": "106", |
| | | "top": 504, |
| | | "left": 386, |
| | | "width": 92, |
| | | "height": 23 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-105", |
| | | "text": "105", |
| | | "top": 444, |
| | | "left": 386, |
| | | "width": 92, |
| | | "height": 23 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-104", |
| | | "text": "104", |
| | | "top": 369, |
| | | "left": 386, |
| | | "width": 92, |
| | | "height": 23 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-103", |
| | | "text": "103", |
| | | "top": 281, |
| | | "left": 386, |
| | | "width": 92, |
| | | "height": 23 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-102", |
| | | "text": "102", |
| | | "top": 210, |
| | | "left": 386, |
| | | "width": 92, |
| | | "height": 23 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-101", |
| | | "text": "101", |
| | | "top": 160, |
| | | "left": 386, |
| | | "width": 92, |
| | | "height": 23 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-100", |
| | | "text": "100", |
| | | "top": 99, |
| | | "left": 386, |
| | | "width": 92, |
| | | "left": 771, |
| | | "width": 62, |
| | | "height": 23 |
| | | }] |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-101", |
| | | "text": "101", |
| | | "top": 99, |
| | | "left": 707, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-102", |
| | | "text": "102", |
| | | "top": 99, |
| | | "left": 643, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-103", |
| | | "text": "103", |
| | | "top": 99, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-104", |
| | | "text": "104", |
| | | "top": 124, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 34 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-125", |
| | | "text": "125", |
| | | "top": 160, |
| | | "left": 771, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-124", |
| | | "text": "124", |
| | | "top": 160, |
| | | "left": 707, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-123", |
| | | "text": "123", |
| | | "top": 160, |
| | | "left": 643, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-122", |
| | | "text": "122", |
| | | "top": 160, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-121", |
| | | "text": "121", |
| | | "top": 186, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 42 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-120", |
| | | "text": "120", |
| | | "top": 231, |
| | | "left": 771, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-119", |
| | | "text": "119", |
| | | "top": 231, |
| | | "left": 707, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-118", |
| | | "text": "118", |
| | | "top": 231, |
| | | "left": 643, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-117", |
| | | "text": "117", |
| | | "top": 231, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-116", |
| | | "text": "116", |
| | | "top": 256, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 46 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-115", |
| | | "text": "115", |
| | | "top": 304, |
| | | "left": 771, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-114", |
| | | "text": "114", |
| | | "top": 304, |
| | | "left": 707, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-113", |
| | | "text": "113", |
| | | "top": 304, |
| | | "left": 643, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-112", |
| | | "text": "112", |
| | | "top": 304, |
| | | "left": 579, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-105", |
| | | "text": "105", |
| | | "top": 99, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-106", |
| | | "text": "106", |
| | | "top": 124, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 34 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-107", |
| | | "text": "107", |
| | | "top": 160, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-108", |
| | | "text": "108", |
| | | "top": 186, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 42 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-109", |
| | | "text": "109", |
| | | "top": 231, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 70 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-110", |
| | | "text": "110", |
| | | "top": 304, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-111", |
| | | "text": "111", |
| | | "top": 329, |
| | | "left": 515, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-1001", |
| | | "text": "1001", |
| | | "top": 99, |
| | | "left": 451, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-1002", |
| | | "text": "1002", |
| | | "top": 160, |
| | | "left": 451, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-1003", |
| | | "text": "1003", |
| | | "top": 231, |
| | | "left": 451, |
| | | "width": 62, |
| | | "height": 23 |
| | | },{ |
| | | "type": "stn", |
| | | "id": "site-1004", |
| | | "text": "1004", |
| | | "top": 304, |
| | | "left": 451, |
| | | "width": 62, |
| | | "height": 23 |
| | | } ] |
| | | }] |
| | | }] |
| | | } |
| | |
| | | var baseUrl = "/wxwcs"; |
| | | var baseUrl = "/jdzwcs"; |
| | | |
| | | // 详情窗口-高度 |
| | | var detailHeight = '80%'; |
| | |
| | | tableSearchParam: { |
| | | task_no: null, |
| | | status: null, |
| | | wrk_no: null |
| | | wrk_no: null, |
| | | barcode: null, |
| | | start_point: null, |
| | | target_point : null |
| | | }, |
| | | commandStep: -1 |
| | | }, |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="barcode" placeholder="托盘码" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select class="layui-input" id="loc_type1" name="loc_type1" autocomplete="off"> |
| | | <option value>选择桶类型</option> |
| | | <option value="1">油桶</option> |
| | |
| | | // crnEl.animate({left: (crns[i].bay * unit) + 'px'}, 1000); |
| | | // crns[i].bay = 1; |
| | | |
| | | var offSet = 390; |
| | | var offSet = 800; |
| | | // crns[i].bay = 41; |
| | | if(crns[i].bay === 1){ |
| | | crnEl.animate({left: offSet + 'px'}, 1000); |
| | |
| | | <el-form-item label=""> |
| | | <el-input v-model="tableSearchParam.wrk_no" placeholder="工作号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label=""> |
| | | <el-input v-model="tableSearchParam.barcode" placeholder="箱号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label=""> |
| | | <el-input v-model="tableSearchParam.start_point" placeholder="起始位"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label=""> |
| | | <el-input v-model="tableSearchParam.target_point" placeholder="目标位"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="getTableData">查询</el-button> |
| | | <el-button type="primary" @click="resetParam">重置</el-button> |