#
luxiaotao1123
2024-09-18 14466bd111a43a723e0bdbe945c31e3993e7ab60
#
7个文件已修改
224 ■■■■■ 已修改文件
zy-acs-flow/src/i18n/en.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/zh.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/loc/LocInit.jsx 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-framework/src/main/java/com/zy/acs/framework/common/BaseRes.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/LocController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/param/LocInitParam.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/system/controller/AuthController.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/en.js
@@ -498,7 +498,19 @@
    },
    page: {
        loc: {
            init: 'INITIALIZE'
            init: 'INITIALIZE',
            start: {
                row: 'start row',
                bay: 'start bay',
                lev: 'start lev',
            },
            end: {
                row: 'end row',
                bay: 'end bay',
                lev: 'end lev',
            },
            levOffset: 'lev offset',
            bottomOffset: 'bottom offset',
        }
    }
};
zy-acs-flow/src/i18n/zh.js
@@ -497,7 +497,19 @@
    },
    page: {
        loc: {
            init: '初始化'
            init: '初始化',
            start: {
                row: '开始排',
                bay: '开始列',
                lev: '开始层',
            },
            end: {
                row: '结束排',
                bay: '结束列',
                lev: '结束层',
            },
            levOffset: '每层高度',
            bottomOffset: '底部偏移量',
        }
    }
};
zy-acs-flow/src/page/loc/LocInit.jsx
@@ -1,12 +1,10 @@
import React, { useState, useRef, useEffect, useMemo } from "react";
import {
    CreateBase,
    useTranslate,
    TextInput,
    NumberInput,
    BooleanInput,
    DateInput,
    SaveButton,
    SelectInput,
    ReferenceInput,
    ReferenceArrayInput,
@@ -16,7 +14,6 @@
    useDataProvider,
    useNotify,
    Form,
    useCreateController,
} from 'react-admin';
import {
    Dialog,
@@ -26,8 +23,11 @@
    Stack,
    Grid,
    Box,
    Button,
} from '@mui/material';
import DialogCloseButton from "../components/DialogCloseButton";
import CheckIcon from '@mui/icons-material/Check';
import request from '@/utils/request'
const LocInit = (props) => {
    const { open, setOpen } = props;
@@ -41,6 +41,20 @@
        }
    };
    const onSubmit = (data) => {
        request.post('/loc/init', { ...data }).then(res => {
            const { code, msg, data } = res.data;
            if (code === 200) {
                setOpen(false);
                notify('common.response.success', { type: 'success' });
            } else {
                notify(msg, { type: 'error', messageArgs: { _: msg } });
            }
        }).catch(error => {
            notify(error, { type: 'error', messageArgs: { _: error } });
        })
    };
    return (
        <>
            <Dialog
@@ -51,7 +65,7 @@
                disableRestoreFocus
                maxWidth="md"   // 'xs' | 'sm' | 'md' | 'lg' | 'xl'
            >
                <Form>
                <Form onSubmit={onSubmit}>
                    <DialogTitle id="form-dialog-title" sx={{
                        position: 'sticky',
                        top: 0,
@@ -80,56 +94,6 @@
                                </ReferenceInput>
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <TextInput
                                    label="table.field.loc.locNo"
                                    source="locNo"
                                    parse={v => v}
                                    validate={required()}
                                />
                            </Grid>
                            <Grid item xs={12} display="flex" gap={1}>
                                <Grid item xs={4} display="flex" gap={1}>
                                    <NumberInput
                                        label="table.field.loc.row"
                                        source="row"
                                    />
                                </Grid>
                                <Grid item xs={4} display="flex" gap={1}>
                                    <NumberInput
                                        label="table.field.loc.bay"
                                        source="bay"
                                    />
                                </Grid>
                                <Grid item xs={4} display="flex" gap={1}>
                                    <NumberInput
                                        label="table.field.loc.lev"
                                        source="lev"
                                    />
                                </Grid>
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <ReferenceInput
                                    source="code"
                                    reference="code"
                                >
                                    <AutocompleteInput
                                        label="table.field.loc.code"
                                        optionText="data"
                                        filterToQuery={(val) => ({ data: val })}
                                    />
                                </ReferenceInput>
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <SelectInput
                                    label="table.field.loc.compDirect"
                                    source="compDirect"
                                    choices={[
                                        { id: 1, name: '大于' },
                                        { id: 0, name: '小于' },
                                    ]}
                                />
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <ReferenceInput
                                    source="locSts"
                                    reference="locSts"
@@ -144,15 +108,68 @@
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <NumberInput
                                    label="table.field.loc.offset"
                                    source="offset"
                                    label="page.loc.start.row"
                                    source="startRow"
                                    validate={required()}
                                />
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <TextInput
                                    label="table.field.loc.barcode"
                                    source="barcode"
                                    parse={v => v}
                                <NumberInput
                                    label="page.loc.end.row"
                                    source="endRow"
                                    validate={required()}
                                />
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <NumberInput
                                    label="page.loc.start.bay"
                                    source="startBay"
                                    validate={required()}
                                />
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <NumberInput
                                    label="page.loc.end.bay"
                                    source="endBay"
                                    validate={required()}
                                />
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <NumberInput
                                    label="page.loc.start.lev"
                                    source="startLev"
                                    validate={required()}
                                />
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <NumberInput
                                    label="page.loc.end.lev"
                                    source="endLev"
                                    validate={required()}
                                />
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <NumberInput
                                    label="page.loc.levOffset"
                                    source="levOffset"
                                    validate={required()}
                                />
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <NumberInput
                                    label="page.loc.bottomOffset"
                                    source="bottom"
                                    validate={required()}
                                />
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
                                <SelectInput
                                    label="table.field.loc.compDirect"
                                    source="compDirect"
                                    choices={[
                                        { id: 1, name: '大于' },
                                        { id: 0, name: '小于' },
                                    ]}
                                />
                            </Grid>
                            <Grid item xs={6} display="flex" gap={1}>
@@ -171,7 +188,7 @@
                    </DialogContent>
                    <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}>
                        <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }}  >
                            <SaveButton />
                            <Button variant="contained" type="submit" startIcon={<CheckIcon />}>{translate('ra.action.confirm')}</Button>
                        </Toolbar>
                    </DialogActions>
                </Form>
zy-acs-framework/src/main/java/com/zy/acs/framework/common/BaseRes.java
@@ -2,13 +2,22 @@
public interface BaseRes {
    String OK = "200-操作成功";
    String EMPTY = "201-暂无数据";
    String LIMIT = "202-无权限";
    String PARAM = "401-参数为空";
    String DENIED = "403-请重新登录";
    String REPEAT = "407-已存在";
    String NO_ACTIVATION = "409-请先激活系统";
    String ERROR = "500-服务器错误";
    String OK = "200-Success";
    String EMPTY = "201-Empty Data";
    String LIMIT = "202-No Authority";
    String PARAM = "401-Parameters Cannot Be Empty";
    String DENIED = "403-Please Re-Login";
    String REPEAT = "407-Already Exist";
    String NO_ACTIVATION = "409-Please Activate The System First";
    String ERROR = "500-Internal Server Error";
//    String OK = "200-操作成功";
//    String EMPTY = "201-暂无数据";
//    String LIMIT = "202-无权限";
//    String PARAM = "401-参数为空";
//    String DENIED = "403-请重新登录";
//    String REPEAT = "407-已存在";
//    String NO_ACTIVATION = "409-请先激活系统";
//    String ERROR = "500-服务器错误";
}
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/LocController.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zy.acs.common.utils.GsonUtils;
import com.zy.acs.common.utils.Utils;
import com.zy.acs.framework.common.Cools;
import com.zy.acs.framework.common.R;
@@ -141,13 +142,13 @@
                            locNo,    // 库位编号
                            null,    // 名称
                            null,    // 条码
                            LocStsType.IDLE.val(),    // 库位状态
                            param.getLocSts(),    // 库位状态
                            offset,    // 偏移量
                            r,    // 排
                            b,    // 列
                            l,    // 层
                            null,    // 托盘码
                            null,    // 库位类型
                            param.getLocType(),    // 库位类型
                            null,    // 状态[非空]
                            null,    // 是否删除[非空]
                            null,    // 租户
@@ -157,6 +158,7 @@
                            null,    // 修改时间
                            null    // 备注
                    );
                    loc.setCompDirect(param.getCompDirect());
                    if (locService.count(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, locNo)) > 0) {
                        throw new CoolException(locNo + " location has exist !");
                    }
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/param/LocInitParam.java
@@ -26,4 +26,10 @@
    private Double bottom;
    private Integer compDirect;
    private Long locSts;
    private Long locType;
}
zy-acs-manager/src/main/java/com/zy/acs/manager/system/controller/AuthController.java
@@ -51,18 +51,18 @@
        Long tenantId = param.getTenantId();
        User user = userService.getByUsername(username, tenantId);
        if (user == null) {
            return R.error("账号不存在");
            return R.error("Username Does Not Exist");
        }
        if (!user.getStatus().equals(1)) {
            return R.error("账号被冻结");
            return R.error("Account Frozen");
        }
        if (!userService.comparePassword(user.getPassword(), param.getPassword())) {
            return R.error("密码错误");
            return R.error("Wrong Password");
        }
        String accessToken = JwtUtil.buildToken(new JwtSubject(username, user.getTenantId()),
                configProperties.getTokenExpireTime(), configProperties.getTokenKey());
        userLoginService.saveAsync(user.getId(), accessToken, UserLogin.TYPE_LOGIN, tenantId, null, request);
        return R.ok("登录成功").add(new LoginResult(accessToken, user));
        return R.ok("Login Success").add(new LoginResult(accessToken, user));
    }
    @GetMapping("/auth/user")
@@ -95,7 +95,7 @@
        if (userService.updateById(user)) {
            return R.ok().add(userService.getByIdRel(user.getId()));
        }
        return R.error("保存失败");
        return R.error("Save Fail");
    }
    @PreAuthorize("hasAuthority('sys:auth:password')")
@@ -103,22 +103,22 @@
    @PutMapping("/auth/password")
    public R updatePassword(@RequestBody UpdatePasswordParam param) {
        if (Cools.isEmpty(param.getOldPassword(), param.getPassword())) {
            return R.error("参数不能为空");
            return R.error("Parameters Cannot Be Empty");
        }
        Long userId = getLoginUserId();
        if (userId == null) {
            return R.error("未登录");
            return R.error("Please Login First");
        }
        if (!userService.comparePassword(userService.getById(userId).getPassword(), param.getOldPassword())) {
            return R.error("原密码输入不正确");
            return R.error("The Origin Password Was Incorrect");
        }
        User user = new User();
        user.setId(userId);
        user.setPassword(userService.encodePassword(param.getPassword()));
        if (userService.updateById(user)) {
            return R.ok("修改成功");
            return R.ok("Update Success");
        }
        return R.error("修改失败");
        return R.error("Update Fail");
    }
}