New file |
| | |
| | | package com.zy.asrs.domain.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ConfigUpdateBatchParam { |
| | | |
| | | private String code; |
| | | |
| | | private String value; |
| | | |
| | | } |
| | |
| | | private Integer chargeLine; |
| | | |
| | | /** |
| | | * 建议电量线 |
| | | */ |
| | | @ApiModelProperty(value= "建议电量线") |
| | | @TableField("suggest_charge_line") |
| | | private Integer suggestChargeLine; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | |
| | | } |
| | | |
| | | //判断当前小车是否满足需要充电要求 |
| | | if (!shuttleThread.isRequireCharge()) { |
| | | if (shuttleThread.isRequireCharge().equals(ShuttleRequireChargeType.NONE)) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | List<ShuttleCommand> commands = shuttleOperaUtils.getShuttleChargeCommand(assignCommand, shuttleThread, true); |
| | | assignCommand.setCommands(commands);//运行命令 |
| | | |
| | | wrkMast.setWrkSts(WrkStsType.CHARGE_SHUTTLE_WORKING.sts); |
| | | wrkMast.setWrkSts(WrkStsType.CHARGE_SHUTTLE_CHARGING.sts); |
| | | wrkMast.setModiTime(new Date()); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | return false; |
| | |
| | | |
| | | //小车停止充电 |
| | | private synchronized boolean executeShuttleChargeStepStopCharge(WrkMast wrkMast) { |
| | | if (wrkMast.getWrkSts() == WrkStsType.CHARGE_SHUTTLE_WORKING.sts) { |
| | | if (wrkMast.getWrkSts() == WrkStsType.CHARGE_SHUTTLE_CHARGING.sts) { |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, wrkMast.getShuttleNo()); |
| | | if (shuttleThread == null) { |
| | | return false; |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (!shuttleThread.isChargingCompleted()) { |
| | | boolean stopCharge = false; |
| | | if (wrkMast.getMemo().equals("suggestChargeTaskStop")) { |
| | | stopCharge = true; |
| | | }else { |
| | | if (shuttleThread.isChargingCompleted()) { |
| | | stopCharge = true; |
| | | } |
| | | } |
| | | |
| | | if (!stopCharge) { |
| | | return false; |
| | | } |
| | | |
| | |
| | | |
| | | //下发任务 |
| | | shuttleAction.assignWork(shuttleProtocol.getShuttleNo(), assignCommand); |
| | | |
| | | wrkMast.setWrkSts(WrkStsType.CHARGE_SHUTTLE_CHARGING_COMPLETE.sts); |
| | | wrkMast.setModiTime(new Date()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | return true; |
| | |
| | | |
| | | //小车离开充电桩 |
| | | private synchronized boolean executeShuttleChargeStepLeaveCharge(WrkMast wrkMast) { |
| | | if (wrkMast.getWrkSts() == WrkStsType.CHARGE_SHUTTLE_COMPLETE.sts) { |
| | | if (wrkMast.getWrkSts() == WrkStsType.CHARGE_SHUTTLE_CHARGING_COMPLETE.sts) { |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, wrkMast.getShuttleNo()); |
| | | if (shuttleThread == null) { |
| | | return false; |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | |
| | | private DeviceConfigService deviceConfigService; |
| | | @Autowired |
| | | private LiftDispatchUtils liftDispatchUtils; |
| | | @Autowired |
| | | private BasShuttleService basShuttleService; |
| | | |
| | | /** |
| | | * 初始化实时地图 |
| | |
| | | } |
| | | |
| | | //判断当前小车是否满足需要充电要求 |
| | | if (!shuttleThread.isRequireCharge()) { |
| | | continue; |
| | | if (shuttleThread.isRequireCharge().equals(ShuttleRequireChargeType.NONE)) { |
| | | continue;//无需充电 |
| | | } |
| | | |
| | | boolean forceCharge = true; |
| | | if (shuttleThread.isRequireCharge().equals(ShuttleRequireChargeType.SUGGEST_CHARGE)) { |
| | | BasShuttle basShuttle = basShuttleService.selectOne(new EntityWrapper<BasShuttle>().eq("shuttle_no", device.getDeviceNo())); |
| | | if (basShuttle != null) { |
| | | Integer suggestChargeLine = basShuttle.getSuggestChargeLine(); |
| | | boolean chargeSuggestResult = Integer.parseInt(shuttleProtocol.getBatteryPower()) < suggestChargeLine; |
| | | if (chargeSuggestResult) { |
| | | //检测系统是否有任务 |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().in("io_type", 1, 101, 201)); |
| | | if (wrkMasts.isEmpty()) { |
| | | forceCharge = false; |
| | | }else { |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | WrkMast wrkMast1 = wrkMastService.selectShuttleWorking(shuttleProtocol.getShuttleNo()); |
| | |
| | | wrkMast.setIoPri((double) 999); |
| | | wrkMast.setLocNo(chargeLocNo); |
| | | wrkMast.setShuttleNo(device.getDeviceNo()); |
| | | wrkMast.setMemo("charge"); |
| | | wrkMast.setMemo(forceCharge ? "forceCharge" : "suggestCharge"); |
| | | wrkMast.setAppeTime(new Date()); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | News.error("保存{}号四向穿梭车充电任务失败!!!", device.getDeviceNo()); |
| | |
| | | List<ShuttleCommand> commands = shuttleOperaUtils.getShuttleChargeCommand(assignCommand, shuttleThread, true); |
| | | assignCommand.setCommands(commands);//运行命令 |
| | | |
| | | wrkMast.setWrkSts(WrkStsType.CHARGE_SHUTTLE_WORKING.sts); |
| | | wrkMast.setWrkSts(WrkStsType.CHARGE_SHUTTLE_START_CHARGING.sts); |
| | | wrkMast.setModiTime(new Date()); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | return false; |
| | |
| | | |
| | | //小车停止充电 |
| | | private synchronized boolean executeShuttleChargeStepStopCharge(WrkMast wrkMast) { |
| | | if (wrkMast.getWrkSts() == WrkStsType.CHARGE_SHUTTLE_WORKING.sts) { |
| | | if (wrkMast.getWrkSts() == WrkStsType.CHARGE_SHUTTLE_CHARGING.sts) { |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, wrkMast.getShuttleNo()); |
| | | if (shuttleThread == null) { |
| | | return false; |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (!shuttleThread.isChargingCompleted()) { |
| | | boolean stopCharge = false; |
| | | if (wrkMast.getMemo().equals("suggestChargeTaskStop")) { |
| | | stopCharge = true; |
| | | }else { |
| | | if (shuttleThread.isChargingCompleted()) { |
| | | stopCharge = true; |
| | | } |
| | | } |
| | | |
| | | if (!stopCharge) { |
| | | return false; |
| | | } |
| | | |
| | |
| | | |
| | | //小车离开充电桩 |
| | | private synchronized boolean executeShuttleChargeStepLeaveCharge(WrkMast wrkMast) { |
| | | if (wrkMast.getWrkSts() == WrkStsType.CHARGE_SHUTTLE_COMPLETE.sts) { |
| | | if (wrkMast.getWrkSts() == WrkStsType.CHARGE_SHUTTLE_CHARGING_COMPLETE.sts) { |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, wrkMast.getShuttleNo()); |
| | | if (shuttleThread == null) { |
| | | return false; |
| | |
| | | return false; |
| | | } |
| | | |
| | | String targetLocNo = navigateUtils.calcFirstLocation(shuttleProtocol.getCurrentLocNo(), wrkMast.getLocNo(), NavigationMapType.getMapTypes(NavigationMapType.NORMAL), null, null, 2); |
| | | //小车出提升机近点距离 |
| | | int shuttleOutLiftLocationDistance = 2; |
| | | Config shuttleOutLiftLocationDistanceConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "shuttleOutLiftLocationDistance")); |
| | | if (shuttleOutLiftLocationDistanceConfig != null) { |
| | | shuttleOutLiftLocationDistance = Integer.parseInt(shuttleOutLiftLocationDistanceConfig.getValue()); |
| | | } |
| | | |
| | | String targetLocNo = navigateUtils.calcFirstLocation(shuttleProtocol.getCurrentLocNo(), wrkMast.getLocNo(), NavigationMapType.getMapTypes(NavigationMapType.NORMAL), null, null, shuttleOutLiftLocationDistance); |
| | | if (targetLocNo == null) {//出提升机近点计算失败 |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,出提升机近点计算失败", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo()); |
| | | return false; |
| | |
| | | |
| | | , WrkStsType.NEW_CHARGE.sts |
| | | , WrkStsType.CHARGE_SHUTTLE_RUN.sts |
| | | , WrkStsType.CHARGE_SHUTTLE_WORKING.sts |
| | | , WrkStsType.CHARGE_SHUTTLE_COMPLETE.sts |
| | | , WrkStsType.CHARGE_SHUTTLE_RUN_COMPLETE.sts |
| | | , WrkStsType.CHARGE_SHUTTLE_CHARGING.sts |
| | | , WrkStsType.CHARGE_SHUTTLE_CHARGING_COMPLETE.sts |
| | | ).eq("shuttle_no", shuttleNo)); |
| | | if (Cools.isEmpty(wrkMasts)) { |
| | | return false; |
| | |
| | | wrkMast.setWrkSts(WrkStsType.COMPLETE_MOVE.sts); |
| | | shuttleThread.setSyncTaskNo(0); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Shuttle), shuttleProtocol.getShuttleNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.SHUTTLE_MOVE_COMPLETE);//触发通知 |
| | | } else if (wrkMast.getWrkSts() == WrkStsType.CHARGE_SHUTTLE_WORKING.sts) { |
| | | //204.小车充电中 ==> 205.小车充电完成 |
| | | wrkMast.setWrkSts(WrkStsType.CHARGE_SHUTTLE_COMPLETE.sts); |
| | | } else if (wrkMast.getWrkSts() == WrkStsType.CHARGE_SHUTTLE_START_CHARGING.sts) { |
| | | //204.小车开启充电中 ==> 205.小车充电中 |
| | | wrkMast.setWrkSts(WrkStsType.CHARGE_SHUTTLE_CHARGING.sts); |
| | | shuttleThread.setSyncTaskNo(0); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Shuttle), shuttleProtocol.getShuttleNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.SHUTTLE_POWER_COMPLETE);//触发通知 |
| | | } else if (wrkMast.getWrkSts() == WrkStsType.CHARGE_SHUTTLE_CHARGING.sts) { |
| | | //205.小车充电中 ==> 206.小车充电完成 |
| | | wrkMast.setWrkSts(WrkStsType.CHARGE_SHUTTLE_CHARGING_COMPLETE.sts); |
| | | shuttleThread.setSyncTaskNo(0); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Shuttle), shuttleProtocol.getShuttleNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.SHUTTLE_POWER_COMPLETE);//触发通知 |
| | | } else if (wrkMast.getWrkSts() == WrkStsType.LOC_MOVE_SHUTTLE_RUN.sts) { |
| | |
| | | int[] pointArr = NavigatePositionConvert.positionToXY(locNo); |
| | | NavigateNode currentNode = new NavigateNode(pointArr[0], pointArr[1]); |
| | | currentNode.setZ(lev); |
| | | innerNodes.add(currentNode); |
| | | |
| | | boolean addCurrentNode = true; |
| | | for (int[] shuttlePoint : whiteShuttlePointList) { |
| | | if(currentNode.getX() == shuttlePoint[0] && currentNode.getY() == shuttlePoint[1]) { |
| | | addCurrentNode = false; |
| | | break; |
| | | } |
| | | } |
| | | if (addCurrentNode) { |
| | | innerNodes.add(currentNode); |
| | | } |
| | | |
| | | List<List<MapNode>> lists = navigateMapData.getJsonData(lev, NavigationMapType.getMapTypes(NavigationMapType.NONE), null, null);//获取完整地图 |
| | | int[][] map = navigateMapData.parseJsonDataArr(lists); |
| | |
| | | return; |
| | | } |
| | | |
| | | if (shuttleThread.isRequireCharge()) { |
| | | if (!shuttleThread.isRequireCharge().equals(ShuttleRequireChargeType.NONE)) { |
| | | return; |
| | | } |
| | | |
| | |
| | | //判断是否有充电任务正在使用穿梭车 |
| | | WrkMast wrkMast = wrkMastService.selectChargeWorking(shuttleNo); |
| | | if (wrkMast != null) { |
| | | if (wrkMast.getMemo().equals("suggestCharge")) { |
| | | wrkMast.setMemo("suggestChargeTaskStop");//断开充电 |
| | | wrkMast.setModiTime(new Date()); |
| | | wrkMastService.updateById(wrkMast); |
| | | } |
| | | return true;//有充电任务 |
| | | } |
| | | return false;//无充电任务 |
New file |
| | |
| | | package com.zy.core.enums; |
| | | |
| | | public enum ShuttleRequireChargeType { |
| | | |
| | | NONE(0, "无需充电"), |
| | | FORCE_CHARGE(1, "强制充电"), |
| | | SUGGEST_CHARGE(2, "建议充电") |
| | | ; |
| | | |
| | | public Integer id; |
| | | public String desc; |
| | | |
| | | ShuttleRequireChargeType(Integer id, String desc) { |
| | | this.id = id; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static ShuttleRequireChargeType get(Short id) { |
| | | if (null == id) { |
| | | return null; |
| | | } |
| | | for (ShuttleRequireChargeType type : ShuttleRequireChargeType.values()) { |
| | | if (type.id.equals(id.intValue())) { |
| | | return type; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static ShuttleRequireChargeType get(ShuttleRequireChargeType type) { |
| | | if (null == type) { |
| | | return null; |
| | | } |
| | | for (ShuttleRequireChargeType type1 : ShuttleRequireChargeType.values()) { |
| | | if (type1 == type) { |
| | | return type1; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | NEW_CHARGE(201, "生成充电任务"), |
| | | CHARGE_SHUTTLE_RUN(202, "小车前往充电桩"), |
| | | CHARGE_SHUTTLE_RUN_COMPLETE(203, "小车到达充电桩"), |
| | | CHARGE_SHUTTLE_WORKING(204, "小车充电中"), |
| | | CHARGE_SHUTTLE_COMPLETE(205, "小车充电完成"), |
| | | CHARGE_SHUTTLE_START_CHARGING(204, "小车开启充电中"), |
| | | CHARGE_SHUTTLE_CHARGING(205, "小车充电中"), |
| | | CHARGE_SHUTTLE_CHARGING_COMPLETE(206, "小车充电完成"), |
| | | COMPLETE_CHARGE(210, "充电任务完成"), |
| | | |
| | | NEW_MOVE(301, "生成迁移任务"), |
| | |
| | | import com.zy.common.model.NavigateNode; |
| | | import com.zy.core.ThreadHandler; |
| | | import com.zy.core.enums.ShuttleProtocolStatusType; |
| | | import com.zy.core.enums.ShuttleRequireChargeType; |
| | | import com.zy.core.enums.ShuttleTaskNoType; |
| | | import com.zy.core.model.CommandResponse; |
| | | import com.zy.core.model.command.ShuttleCommand; |
| | |
| | | |
| | | boolean isDeviceIdle(ExecuteSupport support);//设备是否空闲 |
| | | |
| | | boolean isRequireCharge();//是否满足充电状态 |
| | | ShuttleRequireChargeType isRequireCharge();//是否满足充电状态 |
| | | |
| | | boolean isCharging();//是否充电中 |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean isRequireCharge() { |
| | | public ShuttleRequireChargeType isRequireCharge() { |
| | | if (this.shuttleProtocol.getDeviceStatus() == null |
| | | || this.shuttleProtocol.getPakMk() == null |
| | | || this.shuttleProtocol.getErrorCode() == null |
| | |
| | | || this.shuttleProtocol.getMode() == null |
| | | || this.shuttleProtocol.getExtend() == null |
| | | ) { |
| | | return false; |
| | | return ShuttleRequireChargeType.NONE; |
| | | } |
| | | |
| | | InnerSuhttleExtend extend = (InnerSuhttleExtend) this.shuttleProtocol.getExtend(); |
| | |
| | | && extend.getSuspendState() == 0 |
| | | ; |
| | | if (!res) { |
| | | return res; |
| | | return ShuttleRequireChargeType.NONE; |
| | | } else { |
| | | // 电量小于阈值需要进行充电 |
| | | try { |
| | | BasShuttleService shuttleService = SpringUtils.getBean(BasShuttleService.class); |
| | | if (shuttleService == null) { |
| | | return false; |
| | | return ShuttleRequireChargeType.NONE; |
| | | } |
| | | |
| | | BasShuttle basShuttle = shuttleService.selectOne(new EntityWrapper<BasShuttle>().eq("shuttle_no", deviceConfig.getDeviceNo())); |
| | | if (basShuttle == null) { |
| | | return false; |
| | | return ShuttleRequireChargeType.NONE; |
| | | } |
| | | |
| | | Integer chargeLine = basShuttle.getChargeLine(); |
| | | if (chargeLine == null) { |
| | | return false; |
| | | return ShuttleRequireChargeType.NONE; |
| | | } |
| | | return Integer.valueOf(this.shuttleProtocol.getBatteryPower()) < chargeLine; |
| | | |
| | | boolean chargeResult = Integer.valueOf(this.shuttleProtocol.getBatteryPower()) < chargeLine; |
| | | if (chargeResult) { |
| | | return ShuttleRequireChargeType.FORCE_CHARGE;//需要强制充电 |
| | | } |
| | | |
| | | Integer suggestChargeLine = basShuttle.getSuggestChargeLine(); |
| | | if (suggestChargeLine == null) { |
| | | return ShuttleRequireChargeType.NONE; |
| | | } |
| | | |
| | | boolean suggestChargeResult = Integer.valueOf(this.shuttleProtocol.getBatteryPower()) < suggestChargeLine; |
| | | if (suggestChargeResult) { |
| | | return ShuttleRequireChargeType.SUGGEST_CHARGE;//建议充电 |
| | | } |
| | | |
| | | return ShuttleRequireChargeType.NONE; |
| | | } catch (Exception e) { |
| | | return false; |
| | | return ShuttleRequireChargeType.NONE; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.zy.asrs.domain.param.ConfigUpdateBatchParam; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | |
| | | return R.ok(configService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/config/listAll/auth") |
| | | @ManagerAuth |
| | | public R listAll(){ |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(configService.selectList(wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/config/updateBatch") |
| | | @ManagerAuth |
| | | public R updateBatch(@RequestBody List<ConfigUpdateBatchParam> params){ |
| | | for (ConfigUpdateBatchParam param : params) { |
| | | String code = param.getCode(); |
| | | String value = param.getValue(); |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", code)); |
| | | if (config == null) { |
| | | continue; |
| | | } |
| | | |
| | | config.setValue(value); |
| | | configService.updateById(config); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/config/edit/auth") |
| | | @ManagerAuth |
| | | public R edit(Config config) { |
| | |
| | | <result column="idle_loc" property="idleLoc" /> |
| | | <result column="auto_charge" property="autoCharge" /> |
| | | <result column="charge_line" property="chargeLine" /> |
| | | <result column="suggest_charge_line" property="suggestChargeLine" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | |
| | | {type: 'checkbox'} |
| | | ,{field: 'shuttleNo', align: 'center',title: '四向穿梭车号', width: 120} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | // ,{field: 'shuttleStatus', align: 'center',title: '作业态'} |
| | | ,{field: 'wrkNo', align: 'center',title: '任务号'} |
| | | // ,{field: 'idleLoc', align: 'center',title: '暂存库位'} |
| | | // ,{field: 'wrkNo', align: 'center',title: '任务号'} |
| | | ,{field: 'chargeLine', align: 'center',title: '电量线'} |
| | | ,{field: 'currentCode', align: 'center',title: '二维码'} |
| | | ,{field: 'suggestChargeLine', align: 'center',title: '建议电量线'} |
| | | // ,{field: 'createBy$', align: 'center',title: '添加人员'} |
| | | // ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | // ,{field: 'updateBy$', align: 'center',title: '修改人员'} |
| | | // ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{field: 'pakMk$', align: 'center',title: '标记'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">任务号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="wrkNo" placeholder="请输入任务号"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">任务号: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="wrkNo" placeholder="请输入任务号">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">自动充电: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">建议电量线: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="suggestChargeLine" 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 class="layui-form-item"> |
| | | <label class="layui-form-label">标记: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="pakMk"> |
| | | <option value="1">Y</option> |
| | | <option value="0">N</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">标记: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <select name="pakMk">--> |
| | | <!-- <option value="1">Y</option>--> |
| | | <!-- <option value="0">N</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | </div> |
| | | </div> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>调试参数</title> |
| | | <link rel="stylesheet" href="../../../static/vue/element/element.css"> |
| | | <script type="text/javascript" src="../../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../../static/vue/element/element.js"></script> |
| | | <style> |
| | | .show-box { |
| | | width: 20%; |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: center; |
| | | margin-bottom: 30px; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <div id="app"> |
| | | <div> |
| | | <el-card class="box-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span>调度参数</span> |
| | | </div> |
| | | |
| | | <div style="display: flex;flex-wrap: wrap;"> |
| | | <div class="show-box"> |
| | | <div>调度小车同层最大数量</div> |
| | | <el-input v-model="codeMap.dispatchShuttleMaxNum" style="width: 60%;"></el-input> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>入库预留小车</div> |
| | | <el-input v-model="codeMap.shuttleWrkInObligateCount" style="width: 60%;"></el-input> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>避障内圈半径</div> |
| | | <el-input v-model="codeMap.avoidInnerCircle" style="width: 60%;"></el-input> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>避障外圈半径</div> |
| | | <el-input v-model="codeMap.avoidOuterCircle" style="width: 60%;"></el-input> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>地图母轨方向(x,y)</div> |
| | | <el-input v-model="codeMap.direction_map" style="width: 60%;"></el-input> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>小车出提升机近点距离</div> |
| | | <el-input v-model="codeMap.shuttleOutLiftLocationDistance" style="width: 60%;"></el-input> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>小车移动连续下发指令</div> |
| | | <el-radio border v-model="codeMap.shuttleMoveCommandsContinuously" label="Y">开</el-radio> |
| | | <el-radio border v-model="codeMap.shuttleMoveCommandsContinuously" label="N">关</el-radio> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>允许交管重新规划路径</div> |
| | | <el-radio border v-model="codeMap.trafficControlRestartCalcPath" label="Y">开</el-radio> |
| | | <el-radio border v-model="codeMap.trafficControlRestartCalcPath" label="N">关</el-radio> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>输出RCS调试日志</div> |
| | | <el-radio border v-model="codeMap.rcsDebugShowLog" label="true">开</el-radio> |
| | | <el-radio border v-model="codeMap.rcsDebugShowLog" label="false">关</el-radio> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-top: 20px;"> |
| | | <el-button type="primary" @click="saveParam('shuttle')">保存</el-button> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | |
| | | <div style="margin-top: 20px;"> |
| | | <el-card class="box-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span>充电参数</span> |
| | | </div> |
| | | |
| | | <div style="display: flex;flex-wrap: wrap;"> |
| | | <div class="show-box"> |
| | | <div>小车充电最大阈值</div> |
| | | <el-input v-model="codeMap.chargeMaxValue" style="width: 60%;"></el-input> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>小车电量预警阈值</div> |
| | | <el-input v-model="codeMap.shuttlePowerEarlyValue" style="width: 60%;"></el-input> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>小车满电校准</div> |
| | | <el-radio border v-model="codeMap.shuttleMaxPowerVerify" label="true">开</el-radio> |
| | | <el-radio border v-model="codeMap.shuttleMaxPowerVerify" label="false">关</el-radio> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>定时充电开关</div> |
| | | <el-radio border v-model="codeMap.timedCharge" label="Y">开</el-radio> |
| | | <el-radio border v-model="codeMap.timedCharge" label="N">关</el-radio> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>定时充电时间段</div> |
| | | <el-input v-model="codeMap.timedChargeRange" style="width: 60%;"></el-input> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>小车默认充电线</div> |
| | | <el-input v-model="codeMap.shuttleDefaultChargePowerLine" style="width: 60%;"></el-input> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>小车定时充电线</div> |
| | | <el-input v-model="codeMap.timedChargePowerLine" style="width: 60%;"></el-input> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-top: 20px;"> |
| | | <el-button type="primary" @click="saveParam('charge')">保存</el-button> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | |
| | | <div style="margin-top: 20px;"> |
| | | <el-card class="box-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span>演示模式参数</span> |
| | | </div> |
| | | <div style="display: flex;flex-wrap: wrap;"> |
| | | <div class="show-box"> |
| | | <div>移动演示模式-楼层</div> |
| | | <el-input v-model="codeMap.demoRunLev" style="width: 60%;"></el-input> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>移动演示模式-是否换层</div> |
| | | <el-radio border v-model="codeMap.demoSwitchLev" label="Y">开</el-radio> |
| | | <el-radio border v-model="codeMap.demoSwitchLev" label="N">关</el-radio> |
| | | </div> |
| | | |
| | | <div class="show-box"> |
| | | <div>演示模式-货物搬运</div> |
| | | <el-radio border v-model="codeMap.demoCargoMove" label="Y">开</el-radio> |
| | | <el-radio border v-model="codeMap.demoCargoMove" label="N">关</el-radio> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div style="margin-top: 20px;"> |
| | | <el-button type="primary" @click="saveParam('demo')">保存</el-button> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </div> |
| | | <script> |
| | | var app = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | codeMap: {}, |
| | | }, |
| | | created() { |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | init() { |
| | | this.getConfigData() |
| | | }, |
| | | getConfigData() { |
| | | let that = this; |
| | | $.ajax({ |
| | | url: baseUrl + "/config/listAll/auth", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | data: {}, |
| | | dataType: 'json', |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'GET', |
| | | success: function(res) { |
| | | if (res.code == 200) { |
| | | let codeMap = {} |
| | | res.data.forEach((item) => { |
| | | codeMap[item.code] = item.value |
| | | }) |
| | | that.codeMap = codeMap; |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | that.$message({ |
| | | message: res.msg, |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | saveParam(type) { |
| | | let that = this; |
| | | let codeList = this.getParamData(type) |
| | | let updateCodeList = []; |
| | | |
| | | codeList.forEach((key) => { |
| | | let value = this.codeMap[key] |
| | | updateCodeList.push({ |
| | | code: key, |
| | | value: value |
| | | }) |
| | | }) |
| | | |
| | | console.log(updateCodeList) |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/config/updateBatch", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | data: JSON.stringify(updateCodeList), |
| | | dataType: 'json', |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function(res) { |
| | | if (res.code == 200) { |
| | | that.$message({ |
| | | message: '保存成功', |
| | | type: 'success' |
| | | }); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | that.$message({ |
| | | message: res.msg, |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | getParamData(type) { |
| | | let data = [] |
| | | if(type == "shuttle") { |
| | | data.push('dispatchShuttleMaxNum'); |
| | | data.push('shuttleWrkInObligateCount'); |
| | | data.push('avoidInnerCircle'); |
| | | data.push('avoidOuterCircle'); |
| | | data.push('direction_map'); |
| | | data.push('shuttleOutLiftLocationDistance'); |
| | | data.push('shuttleMoveCommandsContinuously'); |
| | | data.push('trafficControlRestartCalcPath'); |
| | | data.push('rcsDebugShowLog'); |
| | | }else if (type == "charge") { |
| | | data.push('chargeMaxValue'); |
| | | data.push('shuttlePowerEarlyValue'); |
| | | data.push('shuttleMaxPowerVerify'); |
| | | data.push('timedCharge'); |
| | | data.push('timedChargeRange'); |
| | | data.push('shuttleDefaultChargePowerLine'); |
| | | data.push('timedChargePowerLine'); |
| | | }else if (type == "demo") { |
| | | data.push('demoRunLev'); |
| | | data.push('demoSwitchLev'); |
| | | data.push('demoCargoMove'); |
| | | } |
| | | |
| | | return data; |
| | | }, |
| | | }, |
| | | }) |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |