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.ApiLog; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | 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 ApiLogController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | @RequestMapping(value = "/apiLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(apiLogService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiLog/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<ApiLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(apiLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(ApiLog apiLog) { |
| | | apiLogService.insert(apiLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiLog/update/auth") |
| | | @ManagerAuth |
| | | public R update(ApiLog apiLog){ |
| | | if (Cools.isEmpty(apiLog) || null==apiLog.getId()){ |
| | | return R.error(); |
| | | } |
| | | apiLogService.updateById(apiLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiLog/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | apiLogService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<ApiLog> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("apiLog")); |
| | | convert(map, wrapper); |
| | | List<ApiLog> list = apiLogService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<ApiLog> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("uuid", condition); |
| | | Page<ApiLog> page = apiLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (ApiLog apiLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", apiLog.getId()); |
| | | map.put("value", apiLog.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<ApiLog> wrapper = new EntityWrapper<ApiLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != apiLogService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(ApiLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | private TaskWrkController taskWrkController; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | |
| | | }}; |
| | | //agv任务完成 |
| | | @PostMapping("/toAgvTaskOver") |
| | | @AppAuth(memo = "agv任务完成接口") |
| | | public R getAgvTaskOver(@RequestHeader String appkey, |
| | | @RequestBody TaskOverParam param, |
| | | HttpServletRequest request){ |
| | |
| | | |
| | | //AGV请求入库码头接口 |
| | | @PostMapping("/targetWharfApply") |
| | | @AppAuth(memo = "AGV请求入库码头接口") |
| | | public R targetWharfApply(@RequestHeader String appkey, |
| | | @RequestBody WMSAndAGVInterfaceParam param, |
| | | HttpServletRequest request) throws IOException { |
| | |
| | | return R.error("空闲的入库码头(AGV)为空!"); |
| | | } |
| | | R r = openService.AgvToWCSToWms(param); |
| | | apiLogService.save("AGV请求入库码头接口" |
| | | ,request.getRemoteAddr()+request.getRequestURI() |
| | | ,appkey |
| | | ,request.getRemoteAddr() |
| | | ,JSON.toJSONString(param) |
| | | ,r.toString() |
| | | ,true |
| | | ); |
| | | return r; |
| | | } |
| | | |
| | | //AGV请求动作接口 |
| | | @PostMapping("/agvTaskRequest") |
| | | @AppAuth(memo = "AGV请求动作接口") |
| | | public R agvTaskRequest(@RequestHeader String appkey, |
| | | @RequestBody WMSAndAGVInterfaceParam param, |
| | | HttpServletRequest request) { |
| | |
| | | map.put("J-1109",118);map.put("J-1110",117); |
| | | map.put("J-1111",122);map.put("J-1112",121); |
| | | |
| | | try{ |
| | | BasDevp basDevp = basDevpService.selectById(map.get(param.getWharfCode())); |
| | | if (basDevp.getAutoing().equals("Y") && basDevp.getLoading().equals("N")){ |
| | | return R.ok(); |
| | | }else { |
| | | return R.error("站点状态不可入"); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("AGV请求动作接口报错:"+e); |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>().eq("stn_desc", param.getWharfCode())); |
| | | |
| | | if (Cools.isEmpty(staDesc)){ |
| | | return R.error("程序报错,未查询到站点"); |
| | | } |
| | | BasDevp basDevp = basDevpService.selectById(map.get(param.getWharfCode())); |
| | | if (basDevp.getAutoing().equals("Y")){ |
| | | apiLogService.save("AGV请求入库码头接口" |
| | | ,request.getRemoteAddr()+request.getRequestURI() |
| | | ,appkey |
| | | ,request.getRemoteAddr() |
| | | ,JSON.toJSONString(param) |
| | | ,R.ok().toString() |
| | | ,true |
| | | ); |
| | | return R.ok(); |
| | | }else { |
| | | apiLogService.save("AGV请求入库码头接口" |
| | | ,request.getRemoteAddr()+request.getRequestURI() |
| | | ,appkey |
| | | ,request.getRemoteAddr() |
| | | ,JSON.toJSONString(param) |
| | | ,R.error("站点状态不可入").toString() |
| | | ,true |
| | | ); |
| | | return R.error("站点状态不可入"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | Map<Integer, StaProtocol> station = devpThread.getStation(); |
| | | |
| | | for(Map.Entry<Integer, StaProtocol> entry : station.entrySet()) { |
| | | list = staPlcErr(entry); |
| | | if (!Cools.isEmpty(staPlcErr(entry))){ |
| | | list.add(staPlcErr(entry).get(0)) ; |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.ok().add(list); |
| | |
| | | excludeTrash(param); |
| | | EntityWrapper<StaDesc> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)){ |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | wrapper.orderAsc(Collections.singleton("crn_no")); |
| | | return R.ok(staDescService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("man_api_log") |
| | | public class ApiLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 日志编号 |
| | | */ |
| | | @ApiModelProperty(value= "日志编号") |
| | | private String uuid; |
| | | |
| | | /** |
| | | * 名称空间 |
| | | */ |
| | | @ApiModelProperty(value= "名称空间") |
| | | private String namespace; |
| | | |
| | | /** |
| | | * 接口地址 |
| | | */ |
| | | @ApiModelProperty(value= "接口地址") |
| | | private String url; |
| | | |
| | | /** |
| | | * 平台密钥 |
| | | */ |
| | | @ApiModelProperty(value= "平台密钥") |
| | | private String appkey; |
| | | |
| | | /** |
| | | * 时间戳 |
| | | */ |
| | | @ApiModelProperty(value= "时间戳") |
| | | private String timestamp; |
| | | |
| | | /** |
| | | * 客户端IP |
| | | */ |
| | | @ApiModelProperty(value= "客户端IP") |
| | | @TableField("client_ip") |
| | | private String clientIp; |
| | | |
| | | /** |
| | | * 请求内容 |
| | | */ |
| | | @ApiModelProperty(value= "请求内容") |
| | | private String request; |
| | | |
| | | /** |
| | | * 响应内容 |
| | | */ |
| | | @ApiModelProperty(value= "响应内容") |
| | | private String response; |
| | | |
| | | /** |
| | | * 异常内容 |
| | | */ |
| | | @ApiModelProperty(value= "异常内容") |
| | | private String err; |
| | | |
| | | /** |
| | | * 结果 1: 成功 0: 失败 |
| | | */ |
| | | @ApiModelProperty(value= "结果 1: 成功 0: 失败 ") |
| | | private Integer result; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public ApiLog() {} |
| | | |
| | | public ApiLog(String uuid,String namespace,String url,String appkey,String timestamp,String clientIp,String request,String response,String err,Integer result,Integer status,Date createTime,Date updateTime,String memo) { |
| | | this.uuid = uuid; |
| | | this.namespace = namespace; |
| | | this.url = url; |
| | | this.appkey = appkey; |
| | | this.timestamp = timestamp; |
| | | this.clientIp = clientIp; |
| | | this.request = request; |
| | | this.response = response; |
| | | this.err = err; |
| | | this.result = result; |
| | | this.status = status; |
| | | this.createTime = createTime; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // ApiLog apiLog = new ApiLog( |
| | | // null, // 日志编号 |
| | | // null, // 名称空间 |
| | | // null, // 接口地址 |
| | | // null, // 平台密钥 |
| | | // null, // 时间戳 |
| | | // null, // 客户端IP |
| | | // null, // 请求内容 |
| | | // null, // 响应内容 |
| | | // null, // 异常内容 |
| | | // null, // 结果 |
| | | // null, // 状态 |
| | | // null, // 添加时间 |
| | | // null, // 修改时间 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getResult$(){ |
| | | if (null == this.result){ return null; } |
| | | switch (this.result){ |
| | | case 1: |
| | | return "成功"; |
| | | case 0: |
| | | return "失败"; |
| | | default: |
| | | return String.valueOf(this.result); |
| | | } |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "禁用"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface ApiLogMapper extends BaseMapper<ApiLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface ApiLogService extends IService<ApiLog> { |
| | | |
| | | void save(String namespace, String url, String appkey, String ip, String request, String response, boolean success); |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.entity.param.WMSAndAGVInterfaceParam; |
| | | import com.zy.asrs.entity.param.taskCreateParam; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | |
| | | public interface OpenService { |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.mapper.ApiLogMapper; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | @Slf4j |
| | | @Service("apiLogService") |
| | | public class ApiLogServiceImpl extends ServiceImpl<ApiLogMapper, ApiLog> implements ApiLogService { |
| | | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | @Async |
| | | @Override |
| | | public void save(String namespace, String url, String appkey, String ip, String request, String response, boolean success) { |
| | | Date now = new Date(); |
| | | ApiLog apiLog = new ApiLog( |
| | | String.valueOf(snowflakeIdWorker.nextId()), // 日志编号 |
| | | namespace, // 名称空间 |
| | | url, // 接口地址 |
| | | appkey, // 平台密钥 |
| | | String.valueOf(now.getTime()), // 时间戳 |
| | | ip, // 客户端IP |
| | | request, // 请求内容 |
| | | response, |
| | | null, // 异常内容 |
| | | success?1:0 , // 结果 |
| | | 1, // 状态 |
| | | now, // 添加时间 |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | if (!this.insert(apiLog)) { |
| | | log.error("接口调用日志保存失败!"); |
| | | } |
| | | } |
| | | } |
| | |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | |
| | | TaskWrk taskWrk = taskWrkMapper.selectByWrkNo(Integer.valueOf(workNo)); |
| | | if (taskWrk != null) { |
| | |
| | | if (Cools.isEmpty(taskWrk)){ |
| | | continue; |
| | | } |
| | | if (taskWrk.getTargetPoint() != null && taskWrk.getStartPoint() != null && taskWrk.getWrkNo() != null){ |
| | | if (taskWrk.getTargetPoint() != null && taskWrk.getStartPoint() != null && taskWrk.getWrkNo() != null && taskWrk.getWrkNo().shortValue() != workNo){ |
| | | staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(inSta.getStaNo().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | }else { |
| | | //TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo()); |
| | | toWmsDTO.setWarehouseId("1688469798893297665"); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.entity.StaDesc; |
| | | import com.zy.asrs.entity.TaskWrk; |
| | | import com.zy.asrs.entity.ToWmsDTO; |
| | | 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.service.ApiLogService; |
| | | import com.zy.asrs.service.OpenService; |
| | | import com.zy.asrs.service.StaDescService; |
| | | import com.zy.asrs.service.TaskWrkService; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | |
| | | private TaskWrkService taskWrkService; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | |
| | | |
| | | |
| | | @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"); |
| | | }}; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void taskCreate(taskCreateParam param) { |
| | |
| | | } |
| | | |
| | | if (!Cools.isEmpty(param.getStartPoint())) { |
| | | taskWrk.setStartPoint(param.getStartPoint());//起点 |
| | | taskWrk.setStartPoint(Utils.getWcsLocNo(param.getStartPoint()));//起点 |
| | | taskWrk.setOriginStartPoint(param.getStartPoint()); |
| | | } |
| | | if (!Cools.isEmpty(param.getTargetPoint())) { |
| | | taskWrk.setTargetPoint(param.getTargetPoint());//终点 |
| | | taskWrk.setTargetPoint(Utils.getWcsLocNo(param.getTargetPoint()));//终点 |
| | | taskWrk.setOriginTargetPoint(param.getTargetPoint()); |
| | | } |
| | | if (!Cools.isEmpty(param.getMemo())) { |
| | | taskWrk.setMemo(param.getMemo());//备注 |
| | |
| | | ToWmsDTO toWmsDTO = new ToWmsDTO(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("x-api-key","7a15b5db-29b6-552c-8cff-0cfec3756da2"); |
| | | List<Integer> list = getInEnableRoadway(); |
| | | List<Integer> list = new ArrayList<>(); |
| | | if (param.getWharfSource().contains("J")){ |
| | | list = getInEnableRoadway(); |
| | | }else { |
| | | list = getInEnableRoadway2(); |
| | | } |
| | | |
| | | |
| | | //TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo()); |
| | | toWmsDTO.setWarehouseId("1688469798893297665"); |
| | |
| | | } |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | apiLogService.save("wms请求入库码头接口" |
| | | ,wmsUrl+"wcsManager/wcsInterface/inboundTaskApply" |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(param) |
| | | ,response |
| | | ,true |
| | | ); |
| | | |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | //解析 |
| | | List<WMSAndAGVInterfaceParam> params = new ArrayList<>(); |
| | | params.add(param); |
| | | WMSAndAGVInterfaceParam data = JSONObject.parseObject(jsonObject.get("data").toString(), WMSAndAGVInterfaceParam.class); |
| | | |
| | | taskCreate(new taskCreateParam(data)); |
| | | return R.ok(jsonObject.get("data")); |
| | | }else { |
| | | return R.error((String) jsonObject.get("msg")); |
| | | String msg = null; |
| | | try { |
| | | taskCreate(new taskCreateParam(data)); |
| | | }catch (Exception e){ |
| | | msg = e.getMessage(); |
| | | } |
| | | if (msg != null){ |
| | | return R.error(msg); |
| | | } |
| | | Map<String,String> map1 = new HashMap<>(); |
| | | StaDesc staDesc = new StaDesc(); |
| | | if (param.getWharfSource().contains("J")){ |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no",data.getTaskTunnel()) |
| | | .eq("type_no",1) |
| | | .lt("crn_stn",200)); |
| | | }else { |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no",data.getTaskTunnel()) |
| | | .eq("type_no",1) |
| | | .ge("crn_stn",200)); |
| | | } |
| | | //map1.put("taskTunnel", staDesc.getStnDesc()); |
| | | map1.put("taskTunnel", "J-1104"); |
| | | return R.ok(map1); |
| | | } |
| | | |
| | | return R.error((String) jsonObject.get("msg")); |
| | | } |
| | | |
| | | @Override |
| | | public void getAgvTaskOver(TaskOverParam param) { |
| | | Map<String,Integer> map = new HashMap<>(); |
| | | map.put("J-1101",102);map.put("J-1102",101); |
| | | map.put("J-1103",106);map.put("J-1104",105); |
| | | map.put("J-1105",110);map.put("J-1106",109); |
| | | map.put("J-1107",114);map.put("J-1108",113); |
| | | map.put("J-1109",118);map.put("J-1110",117); |
| | | map.put("J-1111",122);map.put("J-1112",121); |
| | | map.put("H-1101",305);map.put("H-1102",300); |
| | | // Map<String,Integer> map = new HashMap<>(); |
| | | // put("J-1101",102);put("J-1102",101); |
| | | // put("J-1103",106);put("J-1104",105); |
| | | // put("J-1105",110);put("J-1106",109); |
| | | // put("J-1107",114);put("J-1108",113); |
| | | // put("J-1109",118);put("J-1110",117); |
| | | // put("J-1111",122);put("J-1112",121); |
| | | // put("H-1101",305);put("H-1102",300); |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("stn_desc", param.getWharfCode())); |
| | | if (Cools.isEmpty(staDesc)){ |
| | | throw new RuntimeException("未查询到站点信息"); |
| | | } |
| | | // 获取入库站信息 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(map.get(param.getWharfCode())); |
| | | StaProtocol staProtocol = devpThread.getStation().get(staDesc.getStnNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | |
| | | } |
| | | Short workNo = staProtocol.getWorkNo(); |
| | | for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | if (inSta.getBackSta().equals(map.get(param.getWharfCode()))){ |
| | | if (inSta.getBackSta().equals(staDesc.getStnNo())){ |
| | | if (wharfCode1.contains(param.getWharfCode())){ |
| | | if (!staProtocol.isLoading() && !staProtocol.isCar()){ |
| | | //AGV出库完成以后 |
| | |
| | | //AGV入库完成以后 |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo(inSta.getStaNo().shortValue()); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | if (result) { |
| | | |
| | | } else { |
| | |
| | | map.put(115,4); |
| | | map.put(119,5); |
| | | map.put(123,6); |
| | | //map.put(301,7); |
| | | //put(301,7); |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历入库口 |
| | |
| | | } |
| | | Short workNo = staProtocol.getWorkNo(); |
| | | if (workNo == 0 && !staProtocol.isLoading()){ |
| | | if (Cools.isEmpty(map.get(inSta.getStaNo()))){ |
| | | if (Cools.isEmpty( map.get(inSta.getStaNo()))){ |
| | | continue; |
| | | } |
| | | list.add(map.get(inSta.getStaNo())); |
| | | list.add( map.get(inSta.getStaNo())); |
| | | } |
| | | } |
| | | } |
| | | //roadway = list.stream().mapToInt(Integer::intValue).toArray(); |
| | | return list; |
| | | } |
| | | |
| | | 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); |
| | | //put(301,7); |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历入库口 |
| | | for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | // 获取入库站信息 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getBackSta()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | Short workNo = staProtocol.getWorkNo(); |
| | | if (workNo == 0 && !staProtocol.isLoading()){ |
| | | if (Cools.isEmpty( map.get(inSta.getStaNo()))){ |
| | | continue; |
| | | } |
| | | list.add( map.get(inSta.getStaNo())); |
| | | } |
| | | } |
| | | } |
| | | //roadway = list.stream().mapToInt(Integer::intValue).toArray(); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | // generator.table="sys_host"; |
| | | // sqlserver |
| | | generator.sqlOsType = SqlOsType.SQL_SERVER; |
| | | generator.url="127.0.0.1:1433;databasename=wcs_dev"; |
| | | generator.url="127.0.0.1:1433;databasename=ghtzasrs"; |
| | | generator.username="sa"; |
| | | generator.password="sa"; |
| | | generator.table="wcs_data_resource"; |
| | | generator.password="sa@123"; |
| | | generator.table="man_api_log"; |
| | | generator.packagePath="com.zy.asrs"; |
| | | generator.js = false; |
| | | generator.html = false; |
| | |
| | | case 2: |
| | | write((StaProtocol)task.getData()); |
| | | break; |
| | | case 3: |
| | | write2((StaProtocol)task.getData()); |
| | | default: |
| | | break; |
| | | } |
| | |
| | | |
| | | // 外形检测 - 102 |
| | | Thread.sleep(100); |
| | | OperateResultExOne<byte[]> result4 = siemensS7Net.Read("DB101.150", (short)1); |
| | | OperateResultExOne<byte[]> result4 = siemensS7Net.Read("DB101.160", (short)1); |
| | | if (result4.IsSuccess) { |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result4.Content, 0, 1); |
| | | StaProtocol staProtocol = station.get(103); |
| | |
| | | } |
| | | // 外形检测 - 107 |
| | | Thread.sleep(50); |
| | | OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB101.154", (short)1); |
| | | OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB101.164", (short)1); |
| | | if (result5.IsSuccess) { |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result5.Content, 0, 1); |
| | | StaProtocol staProtocol = station.get(107); |
| | |
| | | } |
| | | // 外形检测 - 111 |
| | | Thread.sleep(50); |
| | | OperateResultExOne<byte[]> result6 = siemensS7Net.Read("DB101.158", (short)1); |
| | | OperateResultExOne<byte[]> result6 = siemensS7Net.Read("DB101.168", (short)1); |
| | | if (result6.IsSuccess) { |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result6.Content, 0, 1); |
| | | StaProtocol staProtocol = station.get(111); |
| | |
| | | } |
| | | // 外形检测 - 115 |
| | | Thread.sleep(50); |
| | | OperateResultExOne<byte[]> result7 = siemensS7Net.Read("DB101.162", (short)1); |
| | | OperateResultExOne<byte[]> result7 = siemensS7Net.Read("DB101.172", (short)1); |
| | | if (result7.IsSuccess) { |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result7.Content, 0, 1); |
| | | StaProtocol staProtocol = station.get(115); |
| | |
| | | } |
| | | // 外形检测 - 119 |
| | | Thread.sleep(50); |
| | | OperateResultExOne<byte[]> result8 = siemensS7Net.Read("DB101.166", (short)1); |
| | | OperateResultExOne<byte[]> result8 = siemensS7Net.Read("DB101.176", (short)1); |
| | | if (result8.IsSuccess) { |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result8.Content, 0, 1); |
| | | StaProtocol staProtocol = station.get(119); |
| | |
| | | } |
| | | // 外形检测 - 123 |
| | | Thread.sleep(50); |
| | | OperateResultExOne<byte[]> result9 = siemensS7Net.Read("DB101.170", (short)1); |
| | | OperateResultExOne<byte[]> result9 = siemensS7Net.Read("DB101.180", (short)1); |
| | | if (result9.IsSuccess) { |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result9.Content, 0, 1); |
| | | StaProtocol staProtocol = station.get(123); |
| | |
| | | } |
| | | |
| | | } |
| | | private void write2(StaProtocol staProtocol) throws InterruptedException { |
| | | if (null == staProtocol) { |
| | | return; |
| | | } |
| | | ArrayList<Integer> staNos = getStaNo(); |
| | | |
| | | int index = staNos.indexOf(staProtocol.getSiteId()); |
| | | short[] array = new short[2]; |
| | | array[0] = staProtocol.getWorkNo(); |
| | | array[1] = staProtocol.getStaNo(); |
| | | // OperateResult write = siemensS7Net.Write("DB100." + index*4, array); |
| | | |
| | | //更新命令日志 |
| | | // CommandInfoLogService commandInfoLogService = SpringUtils.getBean(CommandInfoLogService.class); |
| | | // CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class); |
| | | // CommandInfo commandInfo = commandInfoService.selectById(staProtocol.getCommandId()); |
| | | // 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(staProtocol)); |
| | | // 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("手动命令"); |
| | | // } |
| | | |
| | | OperateResult writeResult; |
| | | //任务下发次数 |
| | | int writeCount = 0; |
| | | //任务下发成功标识 |
| | | boolean writeFlag = false; |
| | | while(writeCount < 5){ |
| | | writeResult = siemensS7Net.Write("DB100." + index*4, array); // 工作号、目标站 |
| | | |
| | | if(writeResult.IsSuccess){ |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> readResult = siemensS7Net.Read("DB100." + index*4, (short)4); |
| | | if(readResult.IsSuccess){ |
| | | short workNo = siemensS7Net.getByteTransform().TransInt16(readResult.Content, 0); |
| | | short staNo = siemensS7Net.getByteTransform().TransInt16(readResult.Content, 2); |
| | | if(staProtocol.getWorkNo().equals(workNo) && staProtocol.getStaNo().equals(staNo)){ |
| | | //任务命令写入成功 |
| | | writeFlag = true; |
| | | log.info("写入输送线命令后返回成功,并且回读成功。输送线plc编号={},{},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | |
| | | Date now = new Date(); |
| | | |
| | | // //更新指令状态 |
| | | // commandInfo.setCommandStatus(CommandStatusType.COMPLETE.id);//输送线直接完成状态 |
| | | // commandInfo.setExecuteTime(now); |
| | | // commandInfo.setCompleteTime(now); |
| | | // commandInfoService.updateById(commandInfo); |
| | | // |
| | | // //更新指令日志 |
| | | // commandInfoLog.setDeviceLog("指令下发成功"); |
| | | // commandInfoLog.setCommandStatus(CommandStatusType.COMPLETE.id);//输送线直接完成状态 |
| | | // commandInfoLog.setExecuteTime(now); |
| | | // commandInfoLog.setCompleteTime(now); |
| | | // commandInfoLogService.insert(commandInfoLog); |
| | | |
| | | //更新任务步序 |
| | | TaskWrkService taskWrkService = SpringUtils.getBean(TaskWrkService.class); |
| | | TaskWrk taskWrk = taskWrkService.selectByWrkNo(staProtocol.getWorkNo().intValue()); |
| | | if (taskWrk != null) { |
| | | taskWrk.setCommandStep(taskWrk.getCommandStep() + 1);//更新指令步序 |
| | | taskWrkService.updateById(taskWrk); |
| | | } |
| | | |
| | | break; |
| | | } else {//返回结果是成功了,但是真实值不相同 |
| | | writeCount++; |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令后返回成功,但是读取任务值不一致。输送线plc编号={1},站点数据={2},写入次数={3}", |
| | | slave.getId(), JSON.toJSON(staProtocol),writeCount)); |
| | | log.error("写入输送线命令后返回成功,但是读取任务值不一致。输送线plc编号={},{},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | // //更新指令日志 |
| | | // commandInfoLog.setDeviceLog("指令下发失败"); |
| | | // commandInfoLogService.insert(commandInfoLog); |
| | | } |
| | | } else { |
| | | writeCount++; |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令后读取失败。输送线plc编号={1},站点数据={2},写入次数={3}", |
| | | slave.getId(), JSON.toJSON(staProtocol), writeCount)); |
| | | log.error("写入输送线命令后读取失败。输送线plc编号={},站点数据={},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | |
| | | // //更新指令日志 |
| | | // commandInfoLog.setDeviceLog("指令下发失败"); |
| | | // commandInfoLogService.insert(commandInfoLog); |
| | | } |
| | | } else { |
| | | writeCount++; |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令失败。输送线plc编号={1},站点数据={2},写入次数={3}", |
| | | slave.getId(), JSON.toJSON(staProtocol),writeCount)); |
| | | log.error("写入输送线命令失败。输送线plc编号={},站点数据={},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | |
| | | // //更新指令日志 |
| | | // commandInfoLog.setDeviceLog("指令下发失败"); |
| | | // commandInfoLogService.insert(commandInfoLog); |
| | | } |
| | | Thread.sleep(200); |
| | | } |
| | | |
| | | //写命令尝试了5次还是失败了 |
| | | if(!writeFlag){ |
| | | staProtocol = station.get(staProtocol.getSiteId()); |
| | | if (staProtocol.getWorkNo() == 0 && staProtocol.getStaNo() ==0) { |
| | | staProtocol.setPakMk(true); |
| | | } |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令尝试5次失败。输送线plc编号={1},站点数据={2}", slave.getId(), JSON.toJSON(staProtocol))); |
| | | log.error("写入输送线命令尝试5次失败。输送线plc编号={},站点数据={}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | |
| | | //重新添加数据到任务队列 |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, slave.getId(), new Task(2, staProtocol)); |
| | | read();//读取1次设备状态 |
| | | return; |
| | | } else { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】 输送线命令下发成功 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol))); |
| | | log.info("输送线命令下发 [id:{}] >>>>> 命令下发成功: {}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | |
| | | Integer siteId = staProtocol.getSiteId(); |
| | | staProtocol = station.get(siteId); |
| | | if ((siteId == 101 || siteId == 201)&&(staProtocol.getWorkNo() == 0 && staProtocol.getStaNo() ==0)) { |
| | | staProtocol.setPakMk(true); |
| | | } |
| | | |
| | | //更新任务步序 |
| | | TaskWrkService taskWrkService = SpringUtils.getBean(TaskWrkService.class); |
| | | TaskWrk taskWrk = taskWrkService.selectByWrkNo(staProtocol.getWorkNo().intValue()); |
| | | if (taskWrk != null) { |
| | | taskWrk.setCommandStep(taskWrk.getCommandStep() + 1);//更新指令步序 |
| | | taskWrkService.updateById(taskWrk); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // /** |
| | | // * 写入 ID+目标站 =====> 单站点写入 |
| | |
| | | emptyInSta[5]: #空板入库口5 |
| | | staNo: 121 |
| | | inSta[0]: #入库口1 |
| | | scale: ${wcs-slave.scale[0].id} |
| | | #scale: ${wcs-slave.scale[0].id} |
| | | staNo: 103 |
| | | backSta: 102 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | inSta[1]: #入库口2 |
| | | scale: ${wcs-slave.scale[1].id} |
| | | #scale: ${wcs-slave.scale[1].id} |
| | | staNo: 107 |
| | | backSta: 106 |
| | | barcode: ${wcs-slave.barcode[1].id} |
| | | #slot: 0 |
| | | inSta[2]: #入库口1 |
| | | scale: ${wcs-slave.scale[0].id} |
| | | #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} |
| | | #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} |
| | | #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} |
| | | #scale: ${wcs-slave.scale[0].id} |
| | | staNo: 123 |
| | | backSta: 122 |
| | | barcode: ${wcs-slave.barcode[5].id} |
| | |
| | | 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]: #输送线 |
| | | id: 3 |
| | | ip: 172.17.8.201 |
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.ApiLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.ApiLog"> |
| | | <id column="id" property="id" /> |
| | | <result column="uuid" property="uuid" /> |
| | | <result column="namespace" property="namespace" /> |
| | | <result column="url" property="url" /> |
| | | <result column="appkey" property="appkey" /> |
| | | <result column="timestamp" property="timestamp" /> |
| | | <result column="client_ip" property="clientIp" /> |
| | | <result column="request" property="request" /> |
| | | <result column="response" property="response" /> |
| | | <result column="err" property="err" /> |
| | | <result column="result" property="result" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="memo" property="memo" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | base: baseUrl + "/static/wms/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
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/wms/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/wms/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/wms/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="namespace" 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="apiLog" lay-filter="apiLog"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <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/html" id="resTpl"> |
| | | <span name="settle" |
| | | {{# if( d.result === 1){ }} |
| | | class="layui-badge layui-badge-green" >{{d.result$}}</span> |
| | | {{# }else { }} |
| | | class="layui-badge layui-badge-red" >{{d.result$}}</span> |
| | | {{# } }} |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/wms/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/wms/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/wms/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/wms/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/wms/js/apiLog/apiLog.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="uuid" placeholder="请输入日志编号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">名称空间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="namespace" placeholder="请输入名称空间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">接口地址: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="url" placeholder="请输入接口地址"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">平台密钥: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="appkey" placeholder="请输入平台密钥"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">时间戳: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="timestamp" placeholder="请输入时间戳"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">客户端IP: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="clientIp" placeholder="请输入客户端IP"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">请求内容: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="request" placeholder="请输入请求内容"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">响应内容: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="response" placeholder="请输入响应内容"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">异常内容: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="err" placeholder="请输入异常内容"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">结果: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="result"> |
| | | <option value="">请选择结果</option> |
| | | <option value="1">成功</option> |
| | | <option value="0">失败</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">状态: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="status"> |
| | | <option value="">请选择状态</option> |
| | | <option value="1">正常</option> |
| | | <option value="0">禁用</option> |
| | | </select> |
| | | </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="updateTime" id="updateTime$" placeholder="请输入修改时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">备注: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="memo" 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> |
| | | |