| | |
| | | VITE_BASE_IP=192.168.4.12 |
| | | VITE_BASE_IP=127.0.0.1 |
| | | # VITE_BASE_IP=47.76.147.249 |
| | | VITE_BASE_PORT=8080 |
| | |
| | | col: "Col", |
| | | lev: "Lev", |
| | | channel: "Channel", |
| | | startChannel: "startChannel", |
| | | maxParts: "MaxParts", |
| | | maxPack: "MaxPack", |
| | | flagLabelMange: "FlagLabelMange", |
| | |
| | | flagLogic: "虚拟库位", |
| | | fucAtrrs: "功能属性", |
| | | barcode: "容器码", |
| | | startChannel: "起始巷道", |
| | | unit: "单位", |
| | | size: "长/宽/高", |
| | | length: "长", |
| | |
| | | validate={[required()]} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={4}> |
| | | <TextInput |
| | | label={"table.field.loc.startChannel"} |
| | | name="startChannel" |
| | | value={formData.startChannel} |
| | | onChange={(e) => handleChange(+e.target.value, 'startChannel')} |
| | | size="small" |
| | | type="number" |
| | | validate={[required()]} |
| | | /> |
| | | </Grid> |
| | | </Grid> |
| | | </Box> |
| | | </DialogContent> |
| | |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | <OutStockPublic record={select} open={drawerVal} setOpen={setDrawerVal} /> |
| | | <OutStockPublic record={select} open={drawerVal} setOpen={setDrawerVal} setManualDialog={setManualDialog}/> |
| | | </PageEditDrawer> |
| | | </Box > |
| | | ) |
| | |
| | | const translate = useTranslate(); |
| | | const [params, setParams] = useState({}); |
| | | const [select, setSelect] = useState([]); |
| | | |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const refresh = useRefresh(); |
| | | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | |
| | | </DialogContent> |
| | | </Grid> |
| | | <Grid> |
| | | <OutOrderPreview open={preview} setOpen={setPreview} selectedIds={select} /> |
| | | <OutOrderPreview open={preview} setOpen={setPreview} selectedIds={select} setCloseParent={setOpen} /> |
| | | </Grid> |
| | | </Dialog > |
| | | ) |
| | |
| | | |
| | | |
| | | const OutOrderPreview = (props) => { |
| | | const { open, setOpen, record, selectedIds } = props; |
| | | const { open, setOpen, record, selectedIds, setCloseParent } = props; |
| | | const translate = useTranslate(); |
| | | const gridRef = useGridApiRef(); |
| | | const [rows, setRows] = useState([]); |
| | |
| | | if (reason !== "backdropClick") { |
| | | // const res = await request.get(`/outStock/items/cancel/` + selectedIds); |
| | | setOpen(false); |
| | | setCloseParent(false) |
| | | } |
| | | }; |
| | | |
| | |
| | | </Grid> |
| | | </Grid> |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <ConfirmButton label="toolbar.confirm" variant="contained" size="large" gridRef={gridRef} setOpen={setOpen} /> |
| | | <ConfirmButton label="toolbar.confirm" variant="contained" size="large" gridRef={gridRef} setOpen={setOpen} setCloseParent={setCloseParent}/> |
| | | </Toolbar> |
| | | </DialogContent> |
| | | </Dialog> |
| | |
| | | |
| | | export default OutOrderPreview; |
| | | |
| | | const ConfirmButton = ({ gridRef, setOpen }) => { |
| | | const ConfirmButton = ({ gridRef, setOpen, setCloseParent }) => { |
| | | const refresh = useRefresh(); |
| | | const notify = useNotify(); |
| | | const confirm = async () => { |
| | |
| | | notify(msg); |
| | | refresh() |
| | | setOpen(false) |
| | | setCloseParent(false) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | |
| | | })); |
| | | |
| | | const OutStockPublic = (props) => { |
| | | const { record, open, setOpen } = props; |
| | | const { record, open, setOpen, setManualDialog } = props; |
| | | const notify = useNotify(); |
| | | const gridRef = useGridApiRef(); |
| | | const [rows, setRows] = useState([]); |
| | |
| | | return ( |
| | | <Button label="toolbar.confirm" size="medium" onClick={handleRowClick} /> |
| | | ) |
| | | |
| | | }; |
| | | |
| | | const handleClickOpen = () => { |
| | |
| | | }; |
| | | |
| | | useEffect(() => { |
| | | if (open) { |
| | | getWaveRule() |
| | | } |
| | | }, [open, formData]) |
| | | getWaveRule() |
| | | }, [open]) |
| | | |
| | | const getWaveRule = async () => { |
| | | if (formData.waveId == null && formData.waveId == undefined) { |
| | |
| | | } |
| | | const { data: { code, data, msg } } = await request.post('/outStock/order/getOutTaskItems', { ...formData }); |
| | | if (code === 200) { |
| | | setRows(data) |
| | | // setRows(data) |
| | | setFetchRows(data) |
| | | } else { |
| | | notify(msg); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.constant.Constants; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.controller.params.LocToTaskParams; |
| | |
| | | } |
| | | param.setType(Constants.TASK_TYPE_OUT_STOCK); |
| | | |
| | | // try { |
| | | // locItemService.generateTask(TaskResouceType.TASK_RESOUCE_STOCK_TYPE.val, param, getLoginUserId()); |
| | | // } catch (Exception e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | try { |
| | | locItemService.generateTask(TaskResouceType.TASK_RESOUCE_STOCK_TYPE.val, param, getLoginUserId()); |
| | | } catch (Exception e) { |
| | | throw new CoolException(e); |
| | | } |
| | | |
| | | return R.ok(param); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:list')") |
| | | @GetMapping("/saveOutTaskSts/{barcode}") |
| | | @ApiOperation("快速拣货查询") |
| | | @ApiOperation("快速拣货") |
| | | public R saveOutTaskSts(@PathVariable String barcode) { |
| | | |
| | | return pdaOutStockService.saveOutTaskSts(barcode); |
| | |
| | | @NotBlank(message = "巷道") |
| | | private Integer channel; |
| | | |
| | | @ApiModelProperty("起始巷道") |
| | | @NotBlank(message = "起始巷道") |
| | | private Integer startChannel; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.LocMastInitParam; |
| | |
| | | import com.vincent.rsf.server.manager.mapper.LocTypeRelaMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.manager.utils.Shelves; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | List<Loc> list = new ArrayList<>(); |
| | | Integer chanl = 0; //默认第一巷道 |
| | | for (int r = param.getStartRow(); r <= param.getEndRow(); r++) { |
| | | if (r % param.getChannel() == 1) { |
| | | chanl ++; |
| | | try{ |
| | | Shelves shelves = new Shelves(param.getEndRow() - param.getStartRow() + 1, param.getChannel(),param.getStartRow()); |
| | | for (List<Integer> node : shelves.nodes){ |
| | | if (node.contains(r)) { |
| | | if (!Cools.isEmpty(param.getStartChannel()) && param.getStartChannel() > 0){ |
| | | chanl = shelves.nodes.indexOf(node) + param.getStartChannel(); |
| | | }else { |
| | | chanl = shelves.nodes.indexOf(node) + 1; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | throw new CoolException("解析巷道号失败"); |
| | | } |
| | | for (int b = param.getStartBay(); b <= param.getEndBay(); b++) { |
| | | for (int l = param.getStartLev(); l <= param.getEndLev(); l++) { |
| | |
| | | .setId(null) |
| | | .setUpdateBy(loginUserId) |
| | | .setCreateBy(loginUserId) |
| | | .setCreateTime(new Date()) |
| | | .setUpdateTime(new Date()) |
| | | .setPoCode(delivery.getCode()); |
| | | if (!this.save(order)) { |
| | | throw new CoolException("主单保存失败!!"); |
| New file |
| | |
| | | package com.vincent.rsf.server.manager.utils; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.vincent.rsf.framework.common.Arith; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <strong>立库货架实体类</strong> |
| | | * Created by vincent on 2020/6/11 |
| | | */ |
| | | public class Shelves { |
| | | |
| | | // 货架排数量 |
| | | public final int size; |
| | | |
| | | // 货架组数量 |
| | | public final int group; |
| | | |
| | | // 偏移量[default:0] |
| | | public final int offset; |
| | | |
| | | // 货架实例节点集合 |
| | | public List<List<Integer>> nodes; |
| | | |
| | | public Shelves(int size, int group) { |
| | | this(size, group, 0); |
| | | } |
| | | |
| | | /** |
| | | * @param size 货架单排总数 |
| | | * @param group 货架组数量 |
| | | * @param offset 序列号偏移量 |
| | | */ |
| | | public Shelves(int size, int group, int offset) { |
| | | this.size = size; |
| | | this.group = group; |
| | | this.offset = offset-1; |
| | | init(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 初始化方法【私有】 |
| | | */ |
| | | private void init(){ |
| | | if (group == 0 || size%group != 0) { |
| | | throw new RuntimeException("shelves init fail!"); |
| | | } |
| | | nodes = new ArrayList<>(); |
| | | for (int g = 1; g <= this.group; g++){ |
| | | int unit = size/group; |
| | | List<Integer> node = new ArrayList<>(); |
| | | for (int i = (g-1)*unit+1+offset ; i <= g*unit+offset; i++){ |
| | | node.add(i); |
| | | } |
| | | nodes.add(node); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 开始计算 =======>>> |
| | | * |
| | | * 货架命中规则如下: |
| | | * 安装位置: [1] [2] | [3] [4] -------- [5] [6] | [7] [8] |
| | | * 命中顺序: 1 -> 5 -> 4 -> 8 -> 2 -> 6 -> 3 -> 7 -> 1 ... |
| | | * |
| | | * 1.该规则适不限制货架数量,总数与组别在构造器中设置 |
| | | * 2.如有序列号起始问题,用偏移量规避即可 |
| | | * |
| | | * @param curSeq 当前货架号 |
| | | * @return 规则命中货架号 |
| | | */ |
| | | public int start(int curSeq){ |
| | | Iterator<List<Integer>> iterator = nodes.iterator(); |
| | | while (iterator.hasNext()){ |
| | | List<Integer> node = iterator.next(); |
| | | if (node.contains(curSeq)) { |
| | | int idx = node.indexOf(curSeq); |
| | | // 是否为末尾货架 |
| | | if (iterator.hasNext()) { |
| | | return iterator.next().get(idx); |
| | | } else { |
| | | List<Integer> first = nodes.get(0); |
| | | int val = first.get(idx); |
| | | int res = size / group + 1 + offset - val; |
| | | // 反向命中货架时不再是对立下标(相对于巷道) |
| | | if (res < val) { |
| | | // 轮询所有货架后重新开始定位 |
| | | if (val - res - offset == 1) { |
| | | return first.get(0); |
| | | } |
| | | res = res + 1; |
| | | } |
| | | return res + offset; |
| | | } |
| | | } |
| | | } |
| | | return -1; |
| | | } |
| | | |
| | | public Integer get(Integer curRow) { |
| | | for (List<Integer> node : nodes){ |
| | | if (node.contains(curRow)) { |
| | | return nodes.indexOf(node) + 1; |
| | | } |
| | | } |
| | | throw new CoolException("货排检索系统报错, node:" + JSON.toJSONString(nodes) + ", curRow:" + curRow); |
| | | } |
| | | |
| | | public static void main(String[] args) throws InterruptedException { |
| | | |
| | | double remainder = Arith.divides(1,16 - 1, 16); |
| | | System.out.println(remainder); |
| | | System.out.println((int) remainder); |
| | | // Shelves shelves = new Shelves(8,2); |
| | | // System.out.println(shelves.nodes.toString()); |
| | | // int start = 1; |
| | | // while (true) { |
| | | // System.out.println(start); |
| | | // start = shelves.start(start); |
| | | // Thread.sleep(500L); |
| | | // } |
| | | } |
| | | |
| | | } |
| | | |