| New file |
| | |
| | | -- save basAgvLocNo record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basAgvLocNo/basAgvLocNo.html', 'basAgvLocNo管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basAgvLocNo#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basAgvLocNo#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basAgvLocNo#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basAgvLocNo#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basAgvLocNo#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basAgvLocNo/basAgvLocNo.html', N'basAgvLocNo管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basAgvLocNo#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basAgvLocNo#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basAgvLocNo#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basAgvLocNo#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basAgvLocNo#btn-export', N'导出', '', '3', '4', '1'); |
| New file |
| | |
| | | -- save basDevpErrorLog record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basDevpErrorLog/basDevpErrorLog.html', 'basDevpErrorLog管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basDevpErrorLog#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basDevpErrorLog#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basDevpErrorLog#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basDevpErrorLog#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'basDevpErrorLog#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basDevpErrorLog/basDevpErrorLog.html', N'basDevpErrorLog管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basDevpErrorLog#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basDevpErrorLog#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basDevpErrorLog#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basDevpErrorLog#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'basDevpErrorLog#btn-export', N'导出', '', '3', '4', '1'); |
| New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | public class BasAgvLocNoController extends BaseController { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasDevpErrorLog; |
| | | import com.zy.asrs.service.BasDevpErrorLogService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class BasDevpErrorLogController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BasDevpErrorLogService basDevpErrorLogService; |
| | | |
| | | @RequestMapping(value = "/basDevpErrorLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basDevpErrorLogService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/basDevpErrorLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasDevpErrorLog basDevpErrorLog) { |
| | | basDevpErrorLogService.insert(basDevpErrorLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/basDevpErrorLog/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | basDevpErrorLogService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/basDevpErrorLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasDevpErrorLog> wrapper = new EntityWrapper<BasDevpErrorLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basDevpErrorLogService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasDevpErrorLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("asr_bas_agv_loc_no") |
| | | public class BasAgvLocNo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * agv库位编号 |
| | | */ |
| | | @ApiModelProperty(value= "agv库位编号") |
| | | @TableField("agv_loc_no") |
| | | private String agvLocNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("sta_no") |
| | | private Integer staNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("io_type") |
| | | private String ioType; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("appe_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date appeTime; |
| | | |
| | | public BasAgvLocNo() {} |
| | | |
| | | public BasAgvLocNo(String agvLocNo,Integer staNo,String locNo,Integer status,String ioType,Date appeTime) { |
| | | this.agvLocNo = agvLocNo; |
| | | this.staNo = staNo; |
| | | this.locNo = locNo; |
| | | this.status = status; |
| | | this.ioType = ioType; |
| | | this.appeTime = appeTime; |
| | | } |
| | | |
| | | // BasAgvLocNo basAgvLocNo = new BasAgvLocNo( |
| | | // null, // agv库位编号 |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null // |
| | | // ); |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.appeTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("asr_bas_devp_error_log") |
| | | public class BasDevpErrorLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @ApiModelProperty(value= "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 输送编号 |
| | | */ |
| | | @ApiModelProperty(value= "输送编号") |
| | | @TableField("dev_no") |
| | | private Integer devNo; |
| | | |
| | | /** |
| | | * 物体进/出超时 |
| | | */ |
| | | @ApiModelProperty(value= "物体进/出超时") |
| | | @TableField("pass_time_out") |
| | | private String passTimeOut; |
| | | |
| | | /** |
| | | * 有物体无数据 |
| | | */ |
| | | @ApiModelProperty(value= "有物体无数据") |
| | | @TableField("object_no_id_error") |
| | | private String objectNoIdError; |
| | | |
| | | /** |
| | | * 有数据无物体 |
| | | */ |
| | | @ApiModelProperty(value= "有数据无物体") |
| | | @TableField("id_no_object_error") |
| | | private String idNoObjectError; |
| | | |
| | | /** |
| | | * 线体电机热继报警 |
| | | */ |
| | | @ApiModelProperty(value= "线体电机热继报警") |
| | | @TableField("lmfr_error") |
| | | private String lmfrError; |
| | | |
| | | /** |
| | | * 顶升报警 |
| | | */ |
| | | @ApiModelProperty(value= "顶升报警") |
| | | @TableField("lift_error") |
| | | private String liftError; |
| | | |
| | | /** |
| | | * 顶升电机热继报警 |
| | | */ |
| | | @ApiModelProperty(value= "顶升电机热继报警") |
| | | @TableField("dlfr_error") |
| | | private String dlfrError; |
| | | |
| | | /** |
| | | * 顶升横移电机热继报警 |
| | | */ |
| | | @ApiModelProperty(value= "顶升横移电机热继报警") |
| | | @TableField("dmfr_error") |
| | | private String dmfrError; |
| | | |
| | | /** |
| | | * 变频故障 |
| | | */ |
| | | @ApiModelProperty(value= "变频故障") |
| | | @TableField("vfd_error") |
| | | private String vfdError; |
| | | |
| | | /** |
| | | * 伺服故障 |
| | | */ |
| | | @ApiModelProperty(value= "伺服故障") |
| | | @TableField("srv_error") |
| | | private String srvError; |
| | | |
| | | /** |
| | | * 预留1 |
| | | */ |
| | | @ApiModelProperty(value= "预留1") |
| | | private String res1; |
| | | |
| | | /** |
| | | * 预留2 |
| | | */ |
| | | @ApiModelProperty(value= "预留2") |
| | | private String res2; |
| | | |
| | | /** |
| | | * 预留3 |
| | | */ |
| | | @ApiModelProperty(value= "预留3") |
| | | private String res3; |
| | | |
| | | /** |
| | | * 与上位机通讯超时 |
| | | */ |
| | | @ApiModelProperty(value= "与上位机通讯超时") |
| | | @TableField("communication_time_out") |
| | | private String communicationTimeOut; |
| | | |
| | | /** |
| | | * 信息参数不全 |
| | | */ |
| | | @ApiModelProperty(value= "信息参数不全") |
| | | @TableField("parameter_incomplete_error") |
| | | private String parameterIncompleteError; |
| | | |
| | | /** |
| | | * 信息数据未清除 |
| | | */ |
| | | @ApiModelProperty(value= "信息数据未清除") |
| | | @TableField("data_not_clear") |
| | | private String dataNotClear; |
| | | |
| | | /** |
| | | * 参数设置报警 |
| | | */ |
| | | @ApiModelProperty(value= "参数设置报警") |
| | | @TableField("set_parameter_error") |
| | | private String setParameterError; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value= "创建时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("in_enable") |
| | | private String inEnable; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("out_enable") |
| | | private String outEnable; |
| | | |
| | | @ApiModelProperty(value= "数据错误") |
| | | @TableField("data_error") |
| | | private String dataError; |
| | | |
| | | public BasDevpErrorLog() {} |
| | | |
| | | public BasDevpErrorLog(Integer devNo,String passTimeOut,String objectNoIdError,String idNoObjectError,String lmfrError,String liftError,String dlfrError,String dmfrError,String vfdError,String srvError,String res1,String res2,String res3,String communicationTimeOut,String parameterIncompleteError,String dataNotClear,String setParameterError,Date createTime,String inEnable,String outEnable,String dataError) { |
| | | this.devNo = devNo; |
| | | this.passTimeOut = passTimeOut; |
| | | this.objectNoIdError = objectNoIdError; |
| | | this.idNoObjectError = idNoObjectError; |
| | | this.lmfrError = lmfrError; |
| | | this.liftError = liftError; |
| | | this.dlfrError = dlfrError; |
| | | this.dmfrError = dmfrError; |
| | | this.vfdError = vfdError; |
| | | this.srvError = srvError; |
| | | this.res1 = res1; |
| | | this.res2 = res2; |
| | | this.res3 = res3; |
| | | this.communicationTimeOut = communicationTimeOut; |
| | | this.parameterIncompleteError = parameterIncompleteError; |
| | | this.dataNotClear = dataNotClear; |
| | | this.setParameterError = setParameterError; |
| | | this.createTime = createTime; |
| | | this.inEnable = inEnable; |
| | | this.outEnable = outEnable; |
| | | this.dataError = dataError; |
| | | } |
| | | |
| | | // BasDevpErrorLog basDevpErrorLog = new BasDevpErrorLog( |
| | | // null, // 输送编号 |
| | | // null, // 物体进/出超时 |
| | | // null, // 有物体无数据 |
| | | // null, // 有数据无物体 |
| | | // null, // 线体电机热继报警 |
| | | // null, // 顶升报警 |
| | | // null, // 顶升电机热继报警 |
| | | // null, // 顶升横移电机热继报警 |
| | | // null, // 变频故障 |
| | | // null, // 伺服故障 |
| | | // null, // 预留1 |
| | | // null, // 预留2 |
| | | // null, // 预留3 |
| | | // null, // 与上位机通讯超时 |
| | | // null, // 信息参数不全 |
| | | // null, // 信息数据未清除 |
| | | // null, // 参数设置报警 |
| | | // null, // 创建时间 |
| | | // null, // |
| | | // null, // |
| | | // null // |
| | | // ); |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasAgvLocNo; |
| | | import com.zy.asrs.entity.BasAgvMast; |
| | | import com.zy.asrs.entity.BasArmMast; |
| | | import com.zy.asrs.entity.result.OrderDetlValueResultUtil; |
| | | import com.zy.asrs.service.BasAgvLocNoService; |
| | | import com.zy.asrs.service.BasDevpErrorLogService; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | /* |
| | | * Created by Monkey D. Luffy on 2025.09.09 |
| | |
| | | @Data |
| | | public class AgvTaskAssignmentParam { |
| | | |
| | | private String id; |
| | | private String reqCode; |
| | | private String taskCode; |
| | | private String taskTyp = "cs"; |
| | | private String ctnrTyp = "1"; |
| | | private ArrayList<PositionCodePathClass> positionCodePath = new ArrayList<PositionCodePathClass>(); |
| | | |
| | | public AgvTaskAssignmentParam() {} |
| | | |
| | | public AgvTaskAssignmentParam(String id) { |
| | | this.id = id; |
| | | @Data |
| | | public static class PositionCodePathClass { |
| | | private String positionCode; |
| | | private String type = "05";//放置位 |
| | | } |
| | | |
| | | public AgvTaskAssignmentParam(int id) { |
| | | this.id = String.valueOf(id); |
| | | public AgvTaskAssignmentParam() { |
| | | |
| | | } |
| | | public AgvTaskAssignmentParam(BasAgvMast basAgvMast) { |
| | | switch (basAgvMast.getIoType()){ |
| | | case 0: |
| | | getAgvTaskAssignmentParam0(basAgvMast); |
| | | return; |
| | | case 1: |
| | | getAgvTaskAssignmentParam1(basAgvMast); |
| | | return; |
| | | case 2: |
| | | getAgvTaskAssignmentParam2(basAgvMast); |
| | | return; |
| | | case 3: |
| | | getAgvTaskAssignmentParam3(basAgvMast); |
| | | return; |
| | | default: |
| | | return; |
| | | } |
| | | |
| | | } |
| | | |
| | | public void getAgvTaskAssignmentParam0(BasAgvMast basAgvMast) { |
| | | BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class); |
| | | |
| | | this.reqCode = basAgvMast.getTaskNo()+"-"+basAgvMast.getTimestamp(); |
| | | |
| | | SnowflakeIdWorker snowflakeIdWorker = SpringUtils.getBean(SnowflakeIdWorker.class); |
| | | long nextId = snowflakeIdWorker.nextId(); |
| | | this.taskCode = String.valueOf(nextId); |
| | | PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoSou = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getSourceLocNo())); |
| | | positionCodePathClassEnd.setPositionCode(basAgvLocNoSou.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassEnd); |
| | | |
| | | PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getStaNo())); |
| | | positionCodePathClassSou.setPositionCode(basAgvLocNoEnd.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassSou); |
| | | |
| | | |
| | | } |
| | | public void getAgvTaskAssignmentParam1(BasAgvMast basAgvMast) { |
| | | BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class); |
| | | |
| | | this.reqCode = basAgvMast.getTaskNo().toString(); |
| | | this.taskCode = basAgvMast.getTimestamp().toString(); |
| | | PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoSou = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getSourceLocNo())); |
| | | positionCodePathClassSou.setPositionCode(basAgvLocNoSou.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassSou); |
| | | PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getLocNo())); |
| | | positionCodePathClassEnd.setPositionCode(basAgvLocNoEnd.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassEnd); |
| | | |
| | | } |
| | | public void getAgvTaskAssignmentParam2(BasAgvMast basAgvMast) { |
| | | BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class); |
| | | |
| | | this.reqCode = basAgvMast.getTaskNo().toString(); |
| | | this.taskCode = basAgvMast.getTimestamp().toString(); |
| | | PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoSou= basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getSourceStaNo())); |
| | | positionCodePathClassSou.setPositionCode(basAgvLocNoSou.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassSou); |
| | | PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getLocNo())); |
| | | positionCodePathClassEnd.setPositionCode(basAgvLocNoEnd.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassEnd); |
| | | |
| | | } |
| | | public void getAgvTaskAssignmentParam3(BasAgvMast basAgvMast) { |
| | | BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class); |
| | | |
| | | this.reqCode = basAgvMast.getTaskNo().toString(); |
| | | this.taskCode = basAgvMast.getTimestamp().toString(); |
| | | PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoSou = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getSourceStaNo())); |
| | | positionCodePathClassSou.setPositionCode(basAgvLocNoSou.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassSou); |
| | | PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getStaNo())); |
| | | positionCodePathClassEnd.setPositionCode(basAgvLocNoEnd.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassEnd); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasAgvLocNo; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasAgvLocNoMapper extends BaseMapper<BasAgvLocNo> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasDevpErrorLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasDevpErrorLogMapper extends BaseMapper<BasDevpErrorLog> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasAgvLocNo; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface BasAgvLocNoService extends IService<BasAgvLocNo> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasDevpErrorLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface BasDevpErrorLogService extends IService<BasDevpErrorLog> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.BasAgvLocNoMapper; |
| | | import com.zy.asrs.entity.BasAgvLocNo; |
| | | import com.zy.asrs.service.BasAgvLocNoService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basAgvLocNoService") |
| | | public class BasAgvLocNoServiceImpl extends ServiceImpl<BasAgvLocNoMapper, BasAgvLocNo> implements BasAgvLocNoService { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.BasDevpErrorLogMapper; |
| | | import com.zy.asrs.entity.BasDevpErrorLog; |
| | | import com.zy.asrs.service.BasDevpErrorLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basDevpErrorLogService") |
| | | public class BasDevpErrorLogServiceImpl extends ServiceImpl<BasDevpErrorLogMapper, BasDevpErrorLog> implements BasDevpErrorLogService { |
| | | |
| | | } |
| | |
| | | WrkMastSta wrkMastSta1 = wrkMastStaMapper.selectByWorkSta(1, (int) rgvProtocol.getRgvNo()); |
| | | if(wrkMastSta1 != null && wrkMastSta2 != null){ |
| | | rgvThread.setPakMk(false); //小车双工位锁定 |
| | | |
| | | } |
| | | // if(basRgv.getPakToCrn().equals("0")){ |
| | | // rgvRunWrkToCrn(rgv, rgvProtocol,mark); //若小车取到一个接驳任务,第二个工位只能取接驳任务 |
| | |
| | | .eq("status", 2) |
| | | .eq("binding_tags", basArmMast.getBindingTags()) |
| | | ); |
| | | |
| | | if (binding_tags<2){ |
| | | armTaskAssignmentCallApiLogSave(staProtocol, "条码数据已存在!!!", staProtocol.getSiteId()+"码垛位置,条码数据正在自动组托===>>" + barcode, false); |
| | | continue; |
| | | BasArmMast basArmMastOne = basArmMastService.selectOne( |
| | | new EntityWrapper<BasArmMast>() |
| | | .eq("status", 2) |
| | | .eq("binding_tags", basArmMast.getBindingTags()) |
| | | ); |
| | | Double anfmeSignOne = basArmMastService.selectBasArmMastSignValue(basArmMastOne.getOrderNo(), basArmMastOne.getSku(),basArmMastOne.getBindingTags()); |
| | | |
| | | if (anfmeSignOne>1D){ |
| | | armTaskAssignmentCallApiLogSave(staProtocol, "条码数据已存在!!!", staProtocol.getSiteId()+"码垛位置,条码数据正在自动组托===>>" + barcode, false); |
| | | continue; |
| | | } |
| | | |
| | | } |
| | | } |
| | | OrderDetlValueResultUtil orderDetlValueResultUtil = basArmMastService.selectOrderDetlValue(basArmMast.getOrderNo(), basArmMast.getSku()); |
| | |
| | | try{ |
| | | List<BasAgvMast> basAgvMastList = basAgvMastService.selectList(new EntityWrapper<BasAgvMast>().eq("status", 0)); |
| | | for (BasAgvMast basAgvMast : basAgvMastList) { |
| | | if (basAgvMast.getStatus()!=0 && basAgvMast.getIoType()!=0){//0==》AGV库位==》输送线站点 |
| | | if (basAgvMast.getStatus()!=0 || basAgvMast.getIoType()!=0){//0==》AGV库位==》输送线站点 |
| | | continue; |
| | | } |
| | | try{ |
| | |
| | | AgvTaskAssignmentParam agvTaskAssignmentParam = new AgvTaskAssignmentParam(basAgvMast); |
| | | |
| | | //任务下发 |
| | | ReturnT<String> result = new PostMesDataUtils().postMesData("AGV任务下发", AgvConstant.AGV_URL, AgvConstant.AGV_ADAPTOR, agvTaskAssignmentParam); |
| | | ReturnT<String> result = new PostMesDataUtils().postMesDataAgv("AGV任务下发", AgvConstant.AGV_URL, AgvConstant.AGV_ADAPTOR, agvTaskAssignmentParam); |
| | | if (result.getCode()==200){ |
| | | basAgvMast.setStatus(1); |
| | | basAgvMastService.updateById(basAgvMast); |
| | |
| | | try{ |
| | | List<BasAgvMast> basAgvMastList = basAgvMastService.selectList(new EntityWrapper<BasAgvMast>().eq("status", 0)); |
| | | for (BasAgvMast basAgvMast : basAgvMastList) { |
| | | if (basAgvMast.getStatus()!=0 && basAgvMast.getIoType()!=1){//1==》AGV库位==》AGV库位 |
| | | if (basAgvMast.getStatus()!=0 || basAgvMast.getIoType()!=1){//1==》AGV库位==》AGV库位 |
| | | continue; |
| | | } |
| | | try{ |
| | | AgvTaskAssignmentParam agvTaskAssignmentParam = new AgvTaskAssignmentParam(); |
| | | AgvTaskAssignmentParam agvTaskAssignmentParam = new AgvTaskAssignmentParam(basAgvMast); |
| | | |
| | | //任务下发 |
| | | ReturnT<String> result = new PostMesDataUtils().postMesData("AGV任务下发", AgvConstant.AGV_URL, AgvConstant.AGV_ADAPTOR, agvTaskAssignmentParam); |
| | | ReturnT<String> result = new PostMesDataUtils().postMesDataAgv("AGV任务下发", AgvConstant.AGV_URL, AgvConstant.AGV_ADAPTOR, agvTaskAssignmentParam); |
| | | if (result.getCode()==200){ |
| | | basAgvMast.setStatus(1); |
| | | basAgvMastService.updateById(basAgvMast); |
| | |
| | | try{ |
| | | List<BasAgvMast> basAgvMastList = basAgvMastService.selectList(new EntityWrapper<BasAgvMast>().eq("status", 0)); |
| | | for (BasAgvMast basAgvMast : basAgvMastList) { |
| | | if (basAgvMast.getStatus()!=0 && basAgvMast.getIoType()!=2){//2==》输送线站点==》AGV库位 |
| | | if (basAgvMast.getStatus()!=0 || basAgvMast.getIoType()!=2){//2==》输送线站点==》AGV库位 |
| | | continue; |
| | | } |
| | | try{ |
| | |
| | | |
| | | if (!Cools.isEmpty(staProtocol.getWorkNo()) && staProtocol.getWorkNo().equals(basAgvMast.getTaskNo())){ |
| | | |
| | | AgvTaskAssignmentParam agvTaskAssignmentParam = new AgvTaskAssignmentParam(); |
| | | AgvTaskAssignmentParam agvTaskAssignmentParam = new AgvTaskAssignmentParam(basAgvMast); |
| | | |
| | | //任务下发 |
| | | ReturnT<String> result = new PostMesDataUtils().postMesData("AGV任务下发", AgvConstant.AGV_URL, AgvConstant.AGV_ADAPTOR, agvTaskAssignmentParam); |
| | | ReturnT<String> result = new PostMesDataUtils().postMesDataAgv("AGV任务下发", AgvConstant.AGV_URL, AgvConstant.AGV_ADAPTOR, agvTaskAssignmentParam); |
| | | if (result.getCode()==200){ |
| | | basAgvMast.setStatus(1); |
| | | basAgvMastService.updateById(basAgvMast); |
| | |
| | | try{ |
| | | List<BasAgvMast> basAgvMastList = basAgvMastService.selectList(new EntityWrapper<BasAgvMast>().eq("status", 0)); |
| | | for (BasAgvMast basAgvMast : basAgvMastList) { |
| | | if (basAgvMast.getStatus()!=0 && basAgvMast.getIoType()!=3){//3==》输送线站点==》输送线站点 |
| | | if (basAgvMast.getStatus()!=0 || basAgvMast.getIoType()!=3){//3==》输送线站点==》输送线站点 |
| | | continue; |
| | | } |
| | | try{ |
| | |
| | | |
| | | if (!Cools.isEmpty(staProtocol.getWorkNo()) && staProtocol.getWorkNo().equals(basAgvMast.getTaskNo())){ |
| | | |
| | | AgvTaskAssignmentParam agvTaskAssignmentParam = new AgvTaskAssignmentParam(); |
| | | AgvTaskAssignmentParam agvTaskAssignmentParam = new AgvTaskAssignmentParam(basAgvMast); |
| | | |
| | | //任务下发 |
| | | ReturnT<String> result = new PostMesDataUtils().postMesData("AGV任务下发", AgvConstant.AGV_URL, AgvConstant.AGV_ADAPTOR, agvTaskAssignmentParam); |
| | | ReturnT<String> result = new PostMesDataUtils().postMesDataAgv("AGV任务下发", AgvConstant.AGV_URL, AgvConstant.AGV_ADAPTOR, agvTaskAssignmentParam); |
| | | if (result.getCode()==200){ |
| | | basAgvMast.setStatus(1); |
| | | basAgvMastService.updateById(basAgvMast); |
| | |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | public ReturnT<String> postMesDataAgv(String name, String URL, String mesPath, Object combParam){ |
| | | // if (true){ |
| | | // System.out.println("name:"+name+",URL:"+URL+",mesPath:"+mesPath+",combParam:"+combParam); |
| | | // return SUCCESS; |
| | | // } |
| | | if(combParam != null){ |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | // Map<String, Object> map = new HashMap<>() |
| | | // map.put("appkey","ea1f0459efc02a79f046f982767939ae"); |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(map) |
| | | .setUri(URL) |
| | | .setPath(mesPath) |
| | | .setJson(JSON.toJSONString(combParam)) |
| | | .build() |
| | | .doPost(); |
| | | System.out.println("response:"+response); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | if (jsonObject.getInteger("code").equals(0)) { |
| | | success = true; |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", URL+"/"+mesPath, JSON.toJSONString(combParam), response); |
| | | throw new CoolException(name); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", URL+"/"+mesPath, JSON.toJSONString(combParam), response); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } finally { |
| | | try { |
| | | if (success){ |
| | | // 保存接口日志 |
| | | ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class); |
| | | apiLogService.save( |
| | | name, |
| | | URL +"/"+ mesPath, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(combParam), |
| | | response, |
| | | success |
| | | ); |
| | | } else { |
| | | postMesDataCallApiLogSave(response,success,name, URL, mesPath, combParam); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("", e); } |
| | | } |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | public ReturnT<String> postMesData(String name, String URL, String mesPath, Object combParam,Map<String, Object> map){ |
| | | // if (true){ |
| | |
| | | generator.url="localhost:1433;databasename=jshdasrs"; |
| | | generator.username="sa"; |
| | | generator.password="sa@123"; |
| | | generator.table="asr_bas_agv_mast"; |
| | | generator.table="asr_bas_agv_loc_no"; |
| | | generator.packagePath="com.zy.asrs"; |
| | | generator.build(); |
| | | } |
| | |
| | | * */ |
| | | public class AgvConstant { |
| | | |
| | | public static final String AGV_IP = "10.10.10.171"; |
| | | public static final String AGV_URL = "http://10.10.10.171:7002"; |
| | | public static final String AGV_IP = "10.10.10.200"; |
| | | public static final String AGV_URL = "http://10.10.10.200:8181"; |
| | | |
| | | public static final String AGV_ADAPTOR = "adaptor/api/wcs/order";//创建订单 |
| | | public static final String AGV_ADAPTOR = "rcms/services/rest/hikRpcService/genAgvSchedulingTask";//创建订单 |
| | | |
| | | public static final String AGV_WORKSPACE = "adaptor/api/wcs/workspace/ready";//通知工作空间已就绪 |
| | | |
| | | } |
| | |
| | | package com.zy.core.model.protocol; |
| | | |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.BasDevpErrorLog; |
| | | import lombok.Data; |
| | | |
| | | import java.util.HashMap; |
| | |
| | | |
| | | // 故障读取锁定标记 |
| | | private boolean errorMk = false; |
| | | |
| | | //写入标记 |
| | | private boolean writeMk = true; |
| | | private Boolean passTimeOut = false; //物体进出超时 |
| | | private Boolean objectNoIdError = false; //有物体无数据 |
| | | private Boolean idNoObjectError = false; //有数据无物体 |
| | | private Boolean lmfrError = false; //线体电机热继报警 |
| | | private Boolean liftError = false; //顶升报警 |
| | | private Boolean dlfrError = false; //顶升电机热继报警 |
| | | private Boolean dmfrError = false; //顶升横移电机热继报警 |
| | | private Boolean vfdError = false; //变频故障 |
| | | private Boolean srvError = false; //伺服故障 |
| | | private Boolean res1 = false; //预留1 |
| | | private Boolean res2 = false; //预留2 |
| | | private Boolean res3 = false; //预留3 |
| | | private Boolean communicationTimeOut = false; //与上位机通讯超时 |
| | | private Boolean parameterIncompleteError = false; //信息参数不全 |
| | | private Boolean dataNotClear = false; //信息数据未清除 |
| | | private Boolean setParameterError = false; //参数设置报警 |
| | | private Boolean res4 = false; //预留4 |
| | | private Boolean res5 = false; //预留5 |
| | | private Boolean dataError = false; //数据错误 |
| | | |
| | | // private |
| | | public BasDevpErrorLog toSqlModelError(){ |
| | | BasDevpErrorLog basDevpErrorLog = new BasDevpErrorLog(); |
| | | basDevpErrorLog.setDevNo(siteId); |
| | | basDevpErrorLog.setPassTimeOut(passTimeOut?"Y":"N"); |
| | | basDevpErrorLog.setObjectNoIdError(objectNoIdError?"Y":"N"); |
| | | basDevpErrorLog.setIdNoObjectError(idNoObjectError?"Y":"N"); |
| | | basDevpErrorLog.setLmfrError(lmfrError?"Y":"N"); |
| | | basDevpErrorLog.setLiftError(liftError?"Y":"N"); |
| | | basDevpErrorLog.setDlfrError(dlfrError?"Y":"N"); |
| | | basDevpErrorLog.setDmfrError(dmfrError?"Y":"N"); |
| | | basDevpErrorLog.setVfdError(vfdError?"Y":"N"); |
| | | basDevpErrorLog.setSrvError(srvError?"Y":"N"); |
| | | basDevpErrorLog.setRes1(res1?"Y":"N"); |
| | | basDevpErrorLog.setRes2(res2?"Y":"N"); |
| | | basDevpErrorLog.setRes3(res3?"Y":"N"); |
| | | basDevpErrorLog.setCommunicationTimeOut(communicationTimeOut?"Y":"N"); |
| | | basDevpErrorLog.setParameterIncompleteError(parameterIncompleteError?"Y":"N"); |
| | | basDevpErrorLog.setDataNotClear(dataNotClear?"Y":"N"); |
| | | basDevpErrorLog.setSetParameterError(setParameterError?"Y":"N"); |
| | | basDevpErrorLog.setInEnable(res4?"Y":"N"); |
| | | basDevpErrorLog.setOutEnable(res5?"Y":"N"); |
| | | basDevpErrorLog.setDataError(dataError?"Y":"N"); |
| | | return basDevpErrorLog; |
| | | } |
| | | |
| | | |
| | | public Boolean isErr(){ |
| | | if (frontErr || backErr || highErr || leftErr || rightErr || weightErr || barcodeErr){ |
| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.BasDevpOpt; |
| | | import com.zy.asrs.entity.BasRgvMap; |
| | | import com.zy.asrs.entity.BasRgvOpt; |
| | | import com.zy.asrs.service.BasDevpOptService; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.BasRgvMapService; |
| | | import com.zy.asrs.service.BasRgvOptService; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.utils.News; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | |
| | | add(1022);add(1024); |
| | | add(1025);add(1026);add(1028); |
| | | add(1029);add(1031); |
| | | add(1032);add(1033);add(1035); |
| | | add(1032);add(1033);add(1034);add(1035); |
| | | add(1036);add(1037);add(1038); |
| | | add(1039);add(1040);add(1041); |
| | | add(1042);add(1043);add(1044);add(1045);add(1046);add(1047);add(1048);add(1050);add(1051);add(1052);add(1053);add(1054);add(1055);add(1056);add(1057); |
| | |
| | | OperateResultExOne<byte[]> result4 = null;//1054-1079 |
| | | OperateResultExOne<byte[]> result5 = null;//1080-1110 |
| | | OperateResultExOne<byte[]> resultErr = null; |
| | | if(staNoSize == 99){ |
| | | if(staNoSize == 100){ |
| | | result1 = siemensS7Net.Read("DB100.0", (short) (2768));//1001-1028 |
| | | result2 = siemensS7Net.Read("DB101.0", (short) (1268));//1029-1037 |
| | | result3 = siemensS7Net.Read("DB104.0", (short) (1268));//1042-1053 |
| | |
| | | station.put(siteId, staProtocol); |
| | | } |
| | | staProtocol.setSiteId(siteId); |
| | | if (staNoSize == 99) { |
| | | if (staNoSize == 100) { |
| | | if (siteId < 1029) { |
| | | result = result1; |
| | | } else if (siteId < 1042) { |
| | |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result.Content, offset + offset3, 1); |
| | | staProtocol.setAutoing(!status[0]); // 自动 |
| | | boolean[] status1 = siemensS7Net.getByteTransform().TransBool(result.Content, offset + offset3 - 4, 3); |
| | | boolean[] statusErr = siemensS7Net.getByteTransform().TransBool(result.Content, offset + 54, 1); |
| | | boolean[] statusErr = siemensS7Net.getByteTransform().TransBool(result.Content, offset + offset3 - 8, 3); |
| | | boolean loading = false; |
| | | if(!status1[0]) |
| | | // && statusErr[2]) |
| | | { |
| | | loading = true; |
| | | } |
| | |
| | | staProtocol.setInEnable(status1[2]); // 可入 |
| | | staProtocol.setOutEnable(status1[2]);// 可出 |
| | | staProtocol.setErr(status1[6]); |
| | | // staProtocol.setInEnable(status1[1]); // 可入 |
| | | // staProtocol.setOutEnable(status1[3]);// 可出 |
| | | // staProtocol.setEmptyMk(status[4]); // 空板信号 |
| | | // staProtocol.setFullPlt(status[5]); // 满托盘 |
| | | // staProtocol.setHigh(status[6]); // 高库位 |
| | | // staProtocol.setLow(status[7]); // 低库位 |
| | | |
| | | staProtocol.setPassTimeOut(statusErr[0]); |
| | | staProtocol.setObjectNoIdError(statusErr[1]); |
| | | staProtocol.setIdNoObjectError(statusErr[2]); |
| | | staProtocol.setLmfrError(statusErr[3]); |
| | | staProtocol.setLiftError(statusErr[4]); |
| | | staProtocol.setDlfrError(statusErr[5]); |
| | | staProtocol.setDmfrError(statusErr[6]); |
| | | staProtocol.setVfdError(statusErr[7]); |
| | | staProtocol.setSrvError(statusErr[8]); |
| | | staProtocol.setRes1(statusErr[9]); |
| | | staProtocol.setRes2(statusErr[10]); |
| | | staProtocol.setRes3(statusErr[11]); |
| | | staProtocol.setCommunicationTimeOut(statusErr[12]); |
| | | staProtocol.setParameterIncompleteError(statusErr[13]); |
| | | staProtocol.setDataNotClear(statusErr[14]); |
| | | staProtocol.setSetParameterError(statusErr[15]); |
| | | staProtocol.setRes4(statusErr[16]); |
| | | staProtocol.setRes5(statusErr[17]); |
| | | staProtocol.setDataError(statusErr[18]); |
| | | |
| | | if( (staProtocol.getPassTimeOut() || |
| | | staProtocol.getObjectNoIdError() || |
| | | staProtocol.getIdNoObjectError() || |
| | | staProtocol.getLmfrError() || |
| | | staProtocol.getLiftError() || |
| | | staProtocol.getDlfrError() || |
| | | staProtocol.getDmfrError() || |
| | | staProtocol.getVfdError() || |
| | | staProtocol.getSrvError() || |
| | | staProtocol.getRes1() || |
| | | staProtocol.getRes2() || |
| | | staProtocol.getRes3() || |
| | | staProtocol.getCommunicationTimeOut() || |
| | | staProtocol.getParameterIncompleteError() || |
| | | staProtocol.getDataNotClear() || |
| | | staProtocol.getSetParameterError() || |
| | | staProtocol.getDataError()) && staProtocol.isWriteMk() |
| | | ){ |
| | | staProtocol.setErrorMk(true);//若存在异常触发写入 |
| | | } |
| | | |
| | | if( !staProtocol.getPassTimeOut() && |
| | | !staProtocol.getObjectNoIdError() && |
| | | !staProtocol.getIdNoObjectError() && |
| | | !staProtocol.getLmfrError() && |
| | | !staProtocol.getLiftError() && |
| | | !staProtocol.getDlfrError() && |
| | | !staProtocol.getDmfrError() && |
| | | !staProtocol.getVfdError() && |
| | | !staProtocol.getSrvError() && |
| | | !staProtocol.getRes1() && |
| | | !staProtocol.getRes2() && |
| | | !staProtocol.getRes3() && |
| | | !staProtocol.getCommunicationTimeOut() && |
| | | !staProtocol.getParameterIncompleteError() && |
| | | !staProtocol.getDataNotClear() && |
| | | !staProtocol.getSetParameterError() && |
| | | !staProtocol.getDataError() |
| | | ){ |
| | | staProtocol.setWriteMk(true);//无异常后才能继续写入 |
| | | staProtocol.setErrorMk(false);//若存在异常触发写入 |
| | | |
| | | } |
| | | |
| | | |
| | | if (!staProtocol.isPakMk() && (!staProtocol.isLoading() || staProtocol.getWorkNo()==0)) { |
| | | staProtocol.setPakMk(true); |
| | |
| | | for (Integer siteId : staNos) { |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | basDevps.add(staProtocol.toSqlModel()); |
| | | } |
| | | if(staProtocol.isWriteMk() && staProtocol.isErrorMk()){ |
| | | try { |
| | | // 日志记录异常情况 |
| | | BasDevpErrorLog basDevpErrorLogs = new BasDevpErrorLog(); |
| | | basDevpErrorLogs = staProtocol.toSqlModelError(); |
| | | BasDevpErrorLogService basDevpErrorLogService = SpringUtils.getBean(BasDevpErrorLogService.class); |
| | | basDevpErrorLogService.insert(basDevpErrorLogs); |
| | | staProtocol.setWriteMk(false); |
| | | } catch (Exception ignore) { |
| | | log.error(ignore.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class); |
| | | |
| | | if (null != basDevpService && !basDevpService.updateBatchById(basDevps)) { |
| | | throw new Exception("更新数据库数据失败"); |
| | | } |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | initSite(); |
| | | e.printStackTrace(); |
| | |
| | | bay: 52 |
| | | lev: 1 |
| | | crnInStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 2004 |
| | | row: 3 |
| | | bay: 52 |
| | |
| | | bay: 52 |
| | | lev: 1 |
| | | crnOutStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 2001 |
| | | row: 2 |
| | | bay: 52 |
| | |
| | | bay: 52 |
| | | lev: 1 |
| | | crnInStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 2010 |
| | | row: 7 |
| | | bay: 52 |
| | |
| | | bay: 52 |
| | | lev: 1 |
| | | crnOutStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 2007 |
| | | row: 6 |
| | | bay: 52 |
| | |
| | | bay: 52 |
| | | lev: 1 |
| | | crnInStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 2016 |
| | | row: 10 |
| | | row: 11 |
| | | bay: 52 |
| | | lev: 2 |
| | | crnInStn[2]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 4001 |
| | | row: 10 |
| | | row: 9 |
| | | bay: 52 |
| | | lev: 4 |
| | | lev: 3 |
| | | |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | |
| | | bay: 52 |
| | | lev: 1 |
| | | crnOutStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 2013 |
| | | row: 11 |
| | | row: 9 |
| | | bay: 52 |
| | | lev: 2 |
| | | crnOutStn[2]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 4004 |
| | | row: 11 |
| | | bay: 52 |
| | | lev: 4 |
| | | lev: 3 |
| | | # 堆垛机4 |
| | | crn[3]: |
| | | id: 4 |
| | |
| | | bay: 52 |
| | | lev: 1 |
| | | crnInStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 2022 |
| | | row: 15 |
| | | bay: 52 |
| | |
| | | bay: 52 |
| | | lev: 1 |
| | | crnOutStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 1022 |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 2019 |
| | | row: 14 |
| | | bay: 52 |
| | | lev: 2 |
| | |
| | | bay: 52 |
| | | lev: 1 |
| | | crnInStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 2028 |
| | | row: 19 |
| | | bay: 52 |
| | |
| | | bay: 52 |
| | | lev: 1 |
| | | crnOutStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 2025 |
| | | row: 18 |
| | | bay: 52 |
| | |
| | | inSta[1]: |
| | | staNo: 1036 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | backSta: 1035 |
| | | backSta: 1037 |
| | | led: ${wcs-slave.led[1].id} |
| | | # 空板入库口1 |
| | | emptyInSta[0]: |
| | |
| | | slot: 0 |
| | | # 入库口1 |
| | | inSta[0]: |
| | | staNo: 2035 |
| | | staNo: 2037 |
| | | barcode: ${wcs-slave.barcode[3].id} |
| | | backSta: 2034 |
| | | led: ${wcs-slave.led[5].id} |
| | |
| | | # barcode: ${wcs-slave.barcode[0].id} |
| | | # backSta: 105 |
| | | # led: ${wcs-slave.led[1].id} |
| | | # # 拣料入库口1 |
| | | # pickSta[0]: |
| | | # staNo: 159 |
| | | # barcode: ${wcs-slave.barcode[2].id} |
| | | # led: ${wcs-slave.led[5].id} |
| | | # backSta: 160 |
| | | # 拣料入库口1 |
| | | pickSta[0]: |
| | | staNo: 4001 |
| | | barcode: ${wcs-slave.barcode[4].id} |
| | | led: ${wcs-slave.led[4].id} |
| | | backSta: 4003 |
| | | # 入库口1 |
| | | inSta[1]: |
| | | staNo: 4001 |
| | | barcode: ${wcs-slave.barcode[4].id} |
| | | backSta: 4003 |
| | | led: ${wcs-slave.led[6].id} |
| | | led: ${wcs-slave.led[4].id} |
| | | # # 空板入库口1 |
| | | # emptyInSta[1]: |
| | | # staNo: 107 |
| | |
| | | # backSta: 108 |
| | | # 出库口1 |
| | | outSta[0]: |
| | | staNo: 2033 |
| | | staNo: 2031 |
| | | # led: ${wcs-slave.led[0].id} |
| | | outSta[1]: |
| | | staNo: 4006 |
| | | led: ${wcs-slave.led[7].id} |
| | | led: ${wcs-slave.led[5].id} |
| | | # outSta[2]: |
| | | # staNo: 156 |
| | | # led: ${wcs-slave.led[4].id} |
| | |
| | | id: 4 |
| | | ip: 10.10.10.215 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 152 |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staArr: 2037 |
| | | # LED5 |
| | | led[4]: |
| | | id: 5 |
| | | ip: 10.10.10.216 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 156 |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staArr: 4001 |
| | | # LED6 |
| | | led[5]: |
| | | id: 6 |
| | | ip: 10.10.10.217 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 160,159 |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staArr: 4006 |
| | | # LED6 |
| | | led[6]: |
| | | id: 7 |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.BasAgvLocNoMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasAgvLocNo"> |
| | | <result column="id" property="id" /> |
| | | <result column="agv_loc_no" property="agvLocNo" /> |
| | | <result column="sta_no" property="staNo" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="status" property="status" /> |
| | | <result column="io_type" property="ioType" /> |
| | | <result column="appe_time" property="appeTime" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.BasDevpErrorLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasDevpErrorLog"> |
| | | <result column="dev_no" property="devNo" /> |
| | | <result column="pass_time_out" property="passTimeOut" /> |
| | | <result column="object_no_id_error" property="objectNoIdError" /> |
| | | <result column="id_no_object_error" property="idNoObjectError" /> |
| | | <result column="lmfr_error" property="lmfrError" /> |
| | | <result column="lift_error" property="liftError" /> |
| | | <result column="dlfr_error" property="dlfrError" /> |
| | | <result column="dmfr_error" property="dmfrError" /> |
| | | <result column="vfd_error" property="vfdError" /> |
| | | <result column="srv_error" property="srvError" /> |
| | | <result column="res1" property="res1" /> |
| | | <result column="res2" property="res2" /> |
| | | <result column="res3" property="res3" /> |
| | | <result column="communication_time_out" property="communicationTimeOut" /> |
| | | <result column="parameter_incomplete_error" property="parameterIncompleteError" /> |
| | | <result column="data_not_clear" property="dataNotClear" /> |
| | | <result column="set_parameter_error" property="setParameterError" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="in_enable" property="inEnable" /> |
| | | <result column="out_enable" property="outEnable" /> |
| | | <result column="data_error" property="dataError" /> |
| | | <result column="id" property="id" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#basAgvLocNo', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/basAgvLocNo/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'id', align: 'center',title: 'ID'} |
| | | ,{field: 'agvLocNo', align: 'center',title: 'agv库位编号'} |
| | | ,{field: 'staNo', align: 'center',title: ''} |
| | | ,{field: 'locNo', align: 'center',title: ''} |
| | | ,{field: 'status', align: 'center',title: ''} |
| | | ,{field: 'ioType', align: 'center',title: ''} |
| | | ,{field: 'appeTime$', align: 'center',title: ''} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(basAgvLocNo)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(basAgvLocNo)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'basAgvLocNo': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/basAgvLocNo/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(basAgvLocNo)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basAgvLocNo/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basAgvLocNo/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#appeTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['appeTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
| New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#basDevpErrorLog', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/basDevpErrorLog/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'devNo', align: 'center',title: '输送编号'} |
| | | ,{field: 'passTimeOut', align: 'center',title: '物体进/出超时'} |
| | | ,{field: 'objectNoIdError', align: 'center',title: '有物体无数据'} |
| | | ,{field: 'idNoObjectError', align: 'center',title: '有数据无物体'} |
| | | ,{field: 'lmfrError', align: 'center',title: '线体电机热继报警'} |
| | | ,{field: 'liftError', align: 'center',title: '顶升报警'} |
| | | ,{field: 'dlfrError', align: 'center',title: '顶升电机热继报警'} |
| | | ,{field: 'dmfrError', align: 'center',title: '顶升横移电机热继报警'} |
| | | ,{field: 'vfdError', align: 'center',title: '变频故障'} |
| | | ,{field: 'srvError', align: 'center',title: '伺服故障'} |
| | | ,{field: 'res1', align: 'center',title: '预留1'} |
| | | ,{field: 'res2', align: 'center',title: '预留2'} |
| | | ,{field: 'res3', align: 'center',title: '预留3'} |
| | | ,{field: 'communicationTimeOut', align: 'center',title: '与上位机通讯超时'} |
| | | ,{field: 'parameterIncompleteError', align: 'center',title: '信息参数不全'} |
| | | ,{field: 'dataNotClear', align: 'center',title: '信息数据未清除'} |
| | | ,{field: 'setParameterError', align: 'center',title: '参数设置报警'} |
| | | ,{field: 'createTime$', align: 'center',title: '创建时间'} |
| | | ,{field: 'inEnable', align: 'center',title: ''} |
| | | ,{field: 'outEnable', align: 'center',title: ''} |
| | | ,{field: 'dataError', align: 'center',title: ''} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(basDevpErrorLog)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(basDevpErrorLog)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'basDevpErrorLog': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/basDevpErrorLog/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(basDevpErrorLog)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basDevpErrorLog/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basDevpErrorLog/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#createTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['createTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="basAgvLocNo" lay-filter="basAgvLocNo"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basAgvLocNo/basAgvLocNo.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">agv库位编号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="agvLocNo" placeholder="请输入agv库位编号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="staNo" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="locNo" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="status" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="ioType" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="appeTime" id="appeTime$" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | </html> |
| | | |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="basDevpErrorLog" lay-filter="basDevpErrorLog"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basDevpErrorLog/basDevpErrorLog.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">输送编号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="devNo" placeholder="请输入输送编号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">物体进/出超时: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="passTimeOut" placeholder="请输入物体进/出超时"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">有物体无数据: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="objectNoIdError" placeholder="请输入有物体无数据"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">有数据无物体: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="idNoObjectError" placeholder="请输入有数据无物体"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">线体电机热继报警: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="lmfrError" placeholder="请输入线体电机热继报警"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">顶升报警: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="liftError" placeholder="请输入顶升报警"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">顶升电机热继报警: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="dlfrError" placeholder="请输入顶升电机热继报警"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">顶升横移电机热继报警: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="dmfrError" placeholder="请输入顶升横移电机热继报警"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">变频故障: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="vfdError" placeholder="请输入变频故障"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">伺服故障: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="srvError" placeholder="请输入伺服故障"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">预留1: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="res1" placeholder="请输入预留1"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">预留2: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="res2" placeholder="请输入预留2"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">预留3: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="res3" placeholder="请输入预留3"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">与上位机通讯超时: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="communicationTimeOut" placeholder="请输入与上位机通讯超时"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">信息参数不全: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="parameterIncompleteError" placeholder="请输入信息参数不全"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">信息数据未清除: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="dataNotClear" placeholder="请输入信息数据未清除"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">参数设置报警: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="setParameterError" placeholder="请输入参数设置报警"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">创建时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="createTime" id="createTime$" placeholder="请输入创建时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="inEnable" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="outEnable" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="dataError" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | </html> |
| | | |