Merge remote-tracking branch 'origin/Four-Way-Rack' into Four-Way-Rack
 
	
	
	
	
	
	
	
	
	
	
	
	
	
 |  |  | 
 |  |  | // 接口地址 | 
 |  |  | export const API_BASE_URL: string = 'http://127.0.0.1:9090/wcs'; | 
 |  |  | export const WEBSOCKET_BASE_URL: string = 'ws://127.0.0.1:9090/wcs'; | 
 |  |  | export const IP: string = 'localhost'; | 
 |  |  | export const PORT: number = 9090; | 
 |  |  |  | 
 |  |  | export const API_BASE_URL: string = 'http://' + IP + ':' + PORT + '/wcs'; | 
 |  |  | export const WEBSOCKET_BASE_URL: string = 'ws://' + IP + ':' + PORT + '/wcs'; | 
 |  |  |  | 
 |  |  | export const API_TIMEOUT: number = 60; | 
 |  |  |  | 
 
 |  |  | 
 |  |  |     '': '', | 
 |  |  |     'map.pallet.barcode': 'Pallet Barcode', | 
 |  |  |     'map.is.enable': 'Enable or Not', | 
 |  |  |     'map.enable': 'Enable', | 
 |  |  |     'map.diable': 'Disable', | 
 |  |  |     'map.handle': 'Handle', | 
 |  |  |     'map.command': 'Command', | 
 |  |  |     'map.loc.sts': 'Location Status', | 
 |  |  |     'map.loc.operation': 'Location Operation', | 
 |  |  |     'map.loc.lock': 'Lock', | 
 |  |  |     'map.loc.unlock': 'Unlock', | 
 
 |  |  | 
 |  |  |                             curFloor={curFloor} | 
 |  |  |                             setDrawerTitle={setDrawerTitle} | 
 |  |  |                             setDrawerWidth={setDrawerWidth} | 
 |  |  |                             refCurr={props.refCurr} | 
 |  |  |                         /> | 
 |  |  |                     </> | 
 |  |  |                 )} | 
 
 |  |  | 
 |  |  | import * as Utils from '../../utils' | 
 |  |  | import Http from '@/utils/http'; | 
 |  |  | import ShelfThree from './shelfThree' | 
 |  |  | import BoolValueIcon from '@/components/BoolValueIcon'; | 
 |  |  |  | 
 |  |  | const useStyles = createStyles(({ token, css }) => { | 
 |  |  |     return { | 
 |  |  | 
 |  |  |     } | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const fetchShelfInfo = async (locNo) => { | 
 |  |  |     const res = await Http.doGet('/api/map/shelf/info', { locNo: locNo }); | 
 |  |  | const fetchShelfGroup = async (locNo) => { | 
 |  |  |     const res = await Http.doGet('/api/map/shelf/group', { locNo: locNo }); | 
 |  |  |     if (res?.data && shelfThree) { | 
 |  |  |         shelfThree.generateMesh((loader, addObject) => { | 
 |  |  |             const promises = []; | 
 |  |  | 
 |  |  |  | 
 |  |  |     const { data, curFloor, curLocNo, setCurLocNo } = props; | 
 |  |  |     const [loading, setLoading] = React.useState(false); | 
 |  |  |     const [info, setInfo] = React.useState(null); | 
 |  |  |  | 
 |  |  |     useEffect(() => { | 
 |  |  |         // init curLocNo | 
 |  |  | 
 |  |  |             shelfThree.handleClick = (objName) => { | 
 |  |  |                 setCurLocNo(objName); | 
 |  |  |             }; | 
 |  |  |             fetchShelfInfo(originLocNo); | 
 |  |  |             fetchShelfGroup(originLocNo); | 
 |  |  |             setLoading(false); | 
 |  |  |         }, 300) | 
 |  |  |  | 
 |  |  |         return endThree; | 
 |  |  |     }, [data]); | 
 |  |  |  | 
 |  |  |     useEffect(() => { | 
 |  |  |         if (!curLocNo) { | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |         const fetchShelfInfo = async (locNo) => { | 
 |  |  |             const res = await Http.doGet('/api/map/shelf/info', { locNo: locNo }); | 
 |  |  |             if (res?.data) { | 
 |  |  |                 setInfo(res.data); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         fetchShelfInfo(curLocNo); | 
 |  |  |     }, [curLocNo]) | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <> | 
 |  |  | 
 |  |  |                         items={ | 
 |  |  |                             [ | 
 |  |  |                                 { | 
 |  |  |                                     key: '1', | 
 |  |  |                                     label: intl.formatMessage({ id: 'map.loc.no', defaultMessage: '库位号' }), | 
 |  |  |                                     children: curLocNo, | 
 |  |  |                                 }, | 
 |  |  |                                 { | 
 |  |  |                                     key: '2', | 
 |  |  |                                     label: intl.formatMessage({ id: 'map.loc.sts', defaultMessage: '库位状态' }), | 
 |  |  |                                     children: info?.locSts, | 
 |  |  |                                 }, | 
 |  |  |                                 { | 
 |  |  |                                     label: intl.formatMessage({ id: 'map.pallet.barcode', defaultMessage: '托盘条码' }), | 
 |  |  |                                     children: '80000010', | 
 |  |  |                                     children: info?.zpallet, | 
 |  |  |                                 }, | 
 |  |  |                                 { | 
 |  |  |                                     key: '3', | 
 |  |  |                                     label: intl.formatMessage({ id: 'map.is.enable', defaultMessage: '是否启用' }), | 
 |  |  |                                     children: 'Disabled', | 
 |  |  |                                     children: <BoolValueIcon value={info?.enable} />, | 
 |  |  |                                 }, | 
 |  |  |                                 { | 
 |  |  |                                     key: '4', | 
 |  |  |                                     label: intl.formatMessage({ id: 'map.loc.operation', defaultMessage: '库位操作' }), | 
 |  |  |                                     children: ( | 
 |  |  |                                         <> | 
 
| New file | 
 |  |  | 
 |  |  | import React, { useState, useRef, useEffect } from 'react'; | 
 |  |  | import { Col, Form, Input, Row, Switch, Slider, message, Drawer, Space, Button, InputNumber, Segmented } from 'antd'; | 
 |  |  | import { FormattedMessage, useIntl, useModel } from '@umijs/max'; | 
 |  |  | import { createStyles } from 'antd-style'; | 
 |  |  | import Http from '@/utils/http'; | 
 |  |  |  | 
 |  |  | const useStyles = createStyles(({ token, css }) => { | 
 |  |  |  | 
 |  |  | }) | 
 |  |  |  | 
 |  |  | const ShuttleHandle = (props) => { | 
 |  |  |     const intl = useIntl(); | 
 |  |  |     const { styles } = useStyles(); | 
 |  |  |  | 
 |  |  |     useEffect(() => { | 
 |  |  |  | 
 |  |  |     }, []); | 
 |  |  |  | 
 |  |  |     const handleCancel = () => { | 
 |  |  |         props.onClose(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <> | 
 |  |  |             <Drawer | 
 |  |  |                 title={intl.formatMessage({ id: 'map.command', defaultMessage: '命令' })} | 
 |  |  |                 width={350} | 
 |  |  |                 closable={false} | 
 |  |  |                 open={props.open} | 
 |  |  |                 getContainer={props.refCurr} | 
 |  |  |                 rootStyle={{ position: "absolute" }} | 
 |  |  |                 onClose={handleCancel} | 
 |  |  |                 extra={ | 
 |  |  |                     <Space> | 
 |  |  |                         <Button onClick={handleCancel}> | 
 |  |  |                             <FormattedMessage id='common.cancel' defaultMessage='取消' /> | 
 |  |  |                         </Button> | 
 |  |  |                         {/* <Button onClick={handleOk} type="primary"> | 
 |  |  |                             <FormattedMessage id='common.submit' defaultMessage='确定' /> | 
 |  |  |                         </Button> */} | 
 |  |  |                     </Space> | 
 |  |  |                 } | 
 |  |  |             > | 
 |  |  |                 <h1>asds</h1> | 
 |  |  |  | 
 |  |  |             </Drawer> | 
 |  |  |         </> | 
 |  |  |     ) | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  | 
 |  |  | export default ShuttleHandle; | 
 
 |  |  | 
 |  |  |                 curNo={curNo} | 
 |  |  |                 data={curSprite.data} | 
 |  |  |                 curFloor={curFloor} | 
 |  |  |                 refCurr={props.refCurr} | 
 |  |  |             /> | 
 |  |  |         ), | 
 |  |  |         json: ( | 
 
 |  |  | 
 |  |  | import * as Utils from '../../utils' | 
 |  |  | import Http from '@/utils/http'; | 
 |  |  | import BoolValueIcon from '@/components/BoolValueIcon'; | 
 |  |  | import ShuttleHandle from './handle'; | 
 |  |  |  | 
 |  |  | const useStyles = createStyles(({ token, css }) => { | 
 |  |  |     return { | 
 |  |  | 
 |  |  |     } | 
 |  |  | }) | 
 |  |  |  | 
 |  |  |  | 
 |  |  | const updateEnable = async (deviceNo, enable) => { | 
 |  |  |     const resp = await Http.doPost('api/dict/update', { val }); | 
 |  |  |     if (resp.code === 200) { | 
 |  |  |         message.success(intl.formatMessage({ id: 'page.update.success', defaultMessage: '更新成功' })); | 
 |  |  |         return true; | 
 |  |  |     } else { | 
 |  |  |         message.error(resp.msg); | 
 |  |  |         return false; | 
 |  |  |     } | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const ShuttleView = (props) => { | 
 |  |  |     const intl = useIntl(); | 
 |  |  | 
 |  |  |  | 
 |  |  |     const { data } = props; | 
 |  |  |     const [loading, setLoading] = React.useState(false); | 
 |  |  |     const [childrenDrawer, setChildrenDrawer] = useState(false); | 
 |  |  |     const [info, setInfo] = React.useState(null); | 
 |  |  |  | 
 |  |  |     useEffect(() => { | 
 |  |  | 
 |  |  |                                     }, | 
 |  |  |                                     { | 
 |  |  |                                         label: intl.formatMessage({ id: 'map.loc.no', defaultMessage: '库位号' }), | 
 |  |  |                                         children: <Badge status="processing" text="Running" />, | 
 |  |  |                                         children: info?.currentLocNo, | 
 |  |  |                                     }, | 
 |  |  |                                     { | 
 |  |  |                                         label: intl.formatMessage({ id: 'map.pallet.barcode', defaultMessage: '托盘条码' }), | 
 |  |  |                                         children: '80000010', | 
 |  |  |                                         children: info?.zpallet, | 
 |  |  |                                     }, | 
 |  |  |                                     { | 
 |  |  |                                         label: intl.formatMessage({ id: 'map.origin.loc', defaultMessage: '起始库位' }), | 
 |  |  | 
 |  |  |                                         label: intl.formatMessage({ id: 'map.dest.loc', defaultMessage: '目标库位' }), | 
 |  |  |                                         children: info?.destLocNo, | 
 |  |  |                                     }, | 
 |  |  |                                     | 
 |  |  |  | 
 |  |  |                                     { | 
 |  |  |                                         label: intl.formatMessage({ id: 'map.shuttle.batter.power', defaultMessage: '电池电量' }), | 
 |  |  |                                         children: info?.batteryPower, | 
 |  |  | 
 |  |  |                                     }, | 
 |  |  |                                     { | 
 |  |  |                                         label: intl.formatMessage({ id: 'map.is.enable', defaultMessage: '是否启用' }), | 
 |  |  |                                         children: 'Disabled', | 
 |  |  |                                         children: <BoolValueIcon value={info?.enable} />, | 
 |  |  |                                     }, | 
 |  |  |                                     { | 
 |  |  |                                         label: intl.formatMessage({ id: 'map.loc.operation', defaultMessage: '库位操作' }), | 
 |  |  | 
 |  |  |                                         children: ( | 
 |  |  |                                             <> | 
 |  |  |                                                 <Button className={styles.tableButton} size='default' type="primary" danger> | 
 |  |  |                                                     <FormattedMessage id='map.loc.lock' defaultMessage='锁定' /> | 
 |  |  |                                                     <FormattedMessage id='map.diable' defaultMessage='禁用' /> | 
 |  |  |                                                 </Button> | 
 |  |  |                                                 <Button className={styles.tableButton} size='default' disabled> | 
 |  |  |                                                     <FormattedMessage id='map.loc.unlock' defaultMessage='解锁' /> | 
 |  |  |                                                     <FormattedMessage id='map.enable' defaultMessage='启用' /> | 
 |  |  |                                                 </Button> | 
 |  |  |                                                 <Button className={styles.tableButton} size='default'> | 
 |  |  |                                                     <FormattedMessage id='map.loc.reset' defaultMessage='清除库位' /> | 
 |  |  |                                                 <Button | 
 |  |  |                                                     className={styles.tableButton} | 
 |  |  |                                                     size='default' | 
 |  |  |                                                     onClick={() => { | 
 |  |  |                                                         setChildrenDrawer(true); | 
 |  |  |                                                     }} | 
 |  |  |                                                 > | 
 |  |  |                                                     <FormattedMessage id='map.handle' defaultMessage='手动操作' /> | 
 |  |  |                                                 </Button> | 
 |  |  |                                             </> | 
 |  |  |                                         ) | 
 |  |  | 
 |  |  |                                 ] | 
 |  |  |                             } | 
 |  |  |                         /> | 
 |  |  |                         <ShuttleHandle | 
 |  |  |                             open={childrenDrawer} | 
 |  |  |                             refCurr={props.refCurr} | 
 |  |  |                             shuttleNo={data.no} | 
 |  |  |                             onClose={() => { | 
 |  |  |                                 setChildrenDrawer(false) | 
 |  |  |                             }} | 
 |  |  |                         /> | 
 |  |  |                     </div> | 
 |  |  |                 )} | 
 |  |  |             </div> | 
 
 |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     // 货架 - 库位 -------------------------------------------------------- | 
 |  |  |     @GetMapping("/shelf/group") | 
 |  |  |     public R shelfGroup(@RequestParam String locNo) { | 
 |  |  |         return R.ok().add(mapService.getShelfLocNoGroup(locNo)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @GetMapping("/shelf/info") | 
 |  |  |     public R shelfInfo(@RequestParam String locNo) { | 
 |  |  |         return R.ok().add(mapService.getShelfLocNoList(locNo)); | 
 |  |  |         return R.ok().add(mapService.getShelfLocNoInfo(locNo)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     // 穿梭车 -------------------------------------------------------- | 
 
 |  |  | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public List<LocVo> getShelfLocNoList(String locNo) { | 
 |  |  |     public List<LocVo> getShelfLocNoGroup(String locNo) { | 
 |  |  |         List<LocVo> locVos = new ArrayList<>(); | 
 |  |  |         int row = Utils.getRow(locNo); | 
 |  |  |         int bay = Utils.getBay(locNo); | 
 |  |  | 
 |  |  |         return locVos; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public LocVo getShelfLocNoInfo(String locNo) { | 
 |  |  |         LocVo locVo = new LocVo(); | 
 |  |  |         locVo.setLocNo(locNo); | 
 |  |  |         Loc loc = locService.selectByLocNo(locNo); | 
 |  |  |         if (null == loc) { | 
 |  |  |             return locVo; | 
 |  |  |         } | 
 |  |  |         locVo.setLocSts(loc.getLocStsFlag()); | 
 |  |  |         locVo.setZpallet(loc.getZpallet()); | 
 |  |  |         locVo.setEnable(CommonUtils.getStatusBool(loc.getStatus())); | 
 |  |  |         return locVo; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public ShuttleVo getShuttleInfo(String shuttleNo) { | 
 |  |  |         ShuttleVo vo = new ShuttleVo(); | 
 |  |  |         vo.setShuttleNo(shuttleNo); | 
 
 |  |  | 
 |  |  |  | 
 |  |  | public interface LocService extends IService<Loc> { | 
 |  |  |  | 
 |  |  |     Loc selectByLocNo(String locNo); | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  | package com.zy.asrs.wcs.core.service.impl; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
 |  |  | import com.zy.asrs.framework.common.Cools; | 
 |  |  | import com.zy.asrs.wcs.core.mapper.LocMapper; | 
 |  |  | import com.zy.asrs.wcs.core.entity.Loc; | 
 |  |  | import com.zy.asrs.wcs.core.service.LocService; | 
 |  |  | 
 |  |  | @Service("locService") | 
 |  |  | public class LocServiceImpl extends ServiceImpl<LocMapper, Loc> implements LocService { | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public Loc selectByLocNo(String locNo) { | 
 |  |  |         if (Cools.isEmpty(locNo)) { | 
 |  |  |             return null; | 
 |  |  |         } | 
 |  |  |         return this.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, locNo)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |