zhou zhou
2 天以前 6331e9aa3f0ced66084bb41de3245162ff8ae806
#跳转到当前
6个文件已修改
64 ■■■■■ 已修改文件
rsf-admin/src/i18n/en.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/i18n/zh.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/task/FlowStepInstanceModal.jsx 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/system/controller/FlowStepInstanceController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/system/service/FlowStepInstanceService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/system/service/impl/FlowStepInstanceServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/i18n/en.js
@@ -1529,6 +1529,7 @@
        modiftySite: 'Modify SiteNo',
        selectWave: 'Select Wave Rule',
        flowStep: "Flow Step",
        jumpCurrent: "Jump To Current",
    },
    placeholder: {
rsf-admin/src/i18n/zh.js
@@ -1597,6 +1597,7 @@
        selectWave: '波次规则',
        transformation: "转换",
        flowStep: "流程步骤",
        jumpCurrent: "跳转到当前",
    },
    placeholder: {
        warehouseAreasCode: "用于库位编码前缀占位符",
rsf-admin/src/page/task/FlowStepInstanceModal.jsx
@@ -25,6 +25,7 @@
import AddIcon from '@mui/icons-material/Add';
import DeleteIcon from '@mui/icons-material/Delete';
import EditIcon from '@mui/icons-material/Edit';
import MyLocationIcon from '@mui/icons-material/MyLocation';
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
@@ -34,7 +35,7 @@
        cursor: 'auto'
    },
    '& .opt': {
        width: 150
        width: 220
    },
}));
@@ -109,6 +110,20 @@
        }
    };
    const handleJumpCurrent = async (item) => {
        try {
            const res = await request.post(`/flowStepInstance/jumpCurrent/${item.id}`);
            if (res.data.code === 200) {
                notify(res.data.msg || translate('common.response.success'), { type: 'success' });
                fetchData();
            } else {
                notify(res.data.msg, { type: 'error' });
            }
        } catch (error) {
            notify('Jump current failed', { type: 'error' });
        }
    };
    const handleFormClose = () => {
        setFormOpen(false);
        setFormData({});
@@ -177,7 +192,7 @@
                        <TextField source="taskNo" label={translate("table.field.flowStepInstance.taskNo")} />
                        <DateField source="createTime" label={translate("table.field.flowStepInstance.createTime")} showTime />
                        <WrapperField cellClassName="opt" label="common.field.opt" onClick={(e) => e.stopPropagation()} >
                            <RowActions onEdit={handleEdit} onDelete={handleDelete} />
                            <RowActions onEdit={handleEdit} onDelete={handleDelete} onJumpCurrent={handleJumpCurrent} />
                        </WrapperField>
                    </StyledDatagrid>
                </DialogContent>
@@ -215,8 +230,9 @@
    );
};
const RowActions = ({ onEdit, onDelete }) => {
const RowActions = ({ onEdit, onDelete, onJumpCurrent }) => {
    const record = useRecordContext();
    const translate = useTranslate();
    return (
        <Box display="flex">
            <Tooltip title="Edit">
@@ -224,6 +240,11 @@
                    <EditIcon fontSize="small" />
                </IconButton>
            </Tooltip>
            <Tooltip title={translate("toolbar.jumpCurrent")}>
                <IconButton onClick={() => onJumpCurrent(record)} size="small" color="secondary">
                    <MyLocationIcon fontSize="small" />
                </IconButton>
            </Tooltip>
            {/* If there's an issue with event propagation you might need to handle it in onClick */}
            <Tooltip title="Delete">
                <IconButton onClick={() => onDelete(record)} size="small" color="error">
rsf-server/src/main/java/com/vincent/rsf/server/system/controller/FlowStepInstanceController.java
@@ -74,6 +74,16 @@
        return R.ok("Update Success").add(flowStepInstance);
    }
    @PreAuthorize("hasAuthority('manager:task:update')")
    @OperationLog("Jump Current 子流程步骤实例")
    @PostMapping("/flowStepInstance/jumpCurrent/{id}")
    public R jumpCurrent(@PathVariable("id") Long id) {
        if (!flowStepInstanceService.jumpCurrent(id)) {
            return R.error("跳转异常");
        }
        return R.ok("跳转成功").add(id);
    }
    @PreAuthorize("hasAuthority('manager:task:remove')")
    @OperationLog("Delete 子流程步骤实例")
    @PostMapping("/flowStepInstance/remove/{ids}")
rsf-server/src/main/java/com/vincent/rsf/server/system/service/FlowStepInstanceService.java
@@ -5,4 +5,6 @@
public interface FlowStepInstanceService extends IService<FlowStepInstance> {
    boolean jumpCurrent(Long id);
}
rsf-server/src/main/java/com/vincent/rsf/server/system/service/impl/FlowStepInstanceServiceImpl.java
@@ -1,12 +1,35 @@
package com.vincent.rsf.server.system.service.impl;
import com.vincent.rsf.server.system.entity.FlowInstance;
import com.vincent.rsf.server.system.mapper.FlowStepInstanceMapper;
import com.vincent.rsf.server.system.entity.FlowStepInstance;
import com.vincent.rsf.server.system.service.FlowInstanceService;
import com.vincent.rsf.server.system.service.FlowStepInstanceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service("flowStepInstanceService")
public class FlowStepInstanceServiceImpl extends ServiceImpl<FlowStepInstanceMapper, FlowStepInstance> implements FlowStepInstanceService {
    @Autowired
    private FlowInstanceService flowInstanceService;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean jumpCurrent(Long id) {
        FlowStepInstance flowStepInstance = getById(id);
        if (flowStepInstance == null || flowStepInstance.getFlowInstanceId() == null) {
            return false;
        }
        FlowInstance flowInstance = new FlowInstance();
        flowInstance.setId(flowStepInstance.getFlowInstanceId());
        flowInstance.setCurrentStepCode(flowStepInstance.getStepCode());
        flowInstance.setCurrentStepOrder(flowStepInstance.getStepOrder());
        flowInstance.setUpdateTime(new java.util.Date());
        return flowInstanceService.updateById(flowInstance);
    }
}