工具发布流程和使用申请流程细节优化
This commit is contained in:
@@ -4,24 +4,26 @@ import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.blueland.bpmclient.model.ProcessInstanceModel;
|
||||
import com.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.constant.Constants;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
import com.rzdata.common.enums.BizExceptionCodeEnum;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.common.enums.RecordStatusEnum;
|
||||
import com.rzdata.common.exception.RestException;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.system.service.ISysDeptService;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import com.rzdata.web.service.IToolService;
|
||||
import com.rzdata.web.service.IUseApplyService;
|
||||
import com.rzdata.web.service.WorkflowService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -40,6 +42,12 @@ public class ToolController extends BaseController
|
||||
@Autowired
|
||||
private WorkflowService workflowService;
|
||||
|
||||
@Autowired
|
||||
private IUseApplyService iUseApplyService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService iSysDeptService;
|
||||
|
||||
/**
|
||||
* 查询工具信息列表
|
||||
*/
|
||||
@@ -48,6 +56,17 @@ public class ToolController extends BaseController
|
||||
{
|
||||
startPage();
|
||||
List<Tool> list = toolService.selectToolList(tool);
|
||||
//前端传传参开启下载权限验证
|
||||
if (BooleanUtil.isTrue(tool.getDownloadCheck())) {
|
||||
String userId = SecurityUtils.getUserId().toString();
|
||||
for (Tool vo:list) {
|
||||
//已发布的工具 是创建人 或者 配置了下载权限 或者 通过了使用申请的
|
||||
vo.setDownloadStatus(RecordStatusEnum.DONE.getCode().equals(vo.getRecordStatus())&&
|
||||
(userId.equals(vo.getCreateBy())||
|
||||
SecurityUtils.hasPermi(Constants.DOWNLOAD_TOOL_PERMISSION)||
|
||||
iUseApplyService.checkUseApply(vo.getToolId(),userId)));
|
||||
}
|
||||
}
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@@ -60,7 +79,7 @@ public class ToolController extends BaseController
|
||||
{
|
||||
List<Tool> list = toolService.selectToolList(tTool);
|
||||
ExcelUtil<Tool> util = new ExcelUtil<Tool>(Tool.class);
|
||||
util.exportExcel(response, list, "工具信息数据");
|
||||
util.exportExcel(response, list, "工具信息数据",tTool.getExcludeFields());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +97,9 @@ public class ToolController extends BaseController
|
||||
@GetMapping(value = "/bpmc/{bpmcId}")
|
||||
public AjaxResult getInfoByBpmcId(@PathVariable("bpmcId") String bpmcId)
|
||||
{
|
||||
return success(toolService.getInfoByBpmcId(bpmcId));
|
||||
Tool tool= toolService.getInfoByBpmcId(bpmcId);
|
||||
tool.setToolRespDeptName(iSysDeptService.getDeptName(tool.getToolRespDept()));
|
||||
return success(tool);
|
||||
}
|
||||
|
||||
@ApiOperation("判断文件名称是否存在 true 存在 false 不存在")
|
||||
|
||||
@@ -129,8 +129,8 @@ public class UseApplyController extends BaseController
|
||||
useApplyItemService.updateItemList(useApply.getItemList(),useApply.getId());
|
||||
}else {
|
||||
UseApply updateStatus = new UseApply();
|
||||
useApply.setId(useApply.getId());
|
||||
useApply.setRecordStatus(useApply.getRecordStatus());
|
||||
updateStatus.setId(useApply.getId());
|
||||
updateStatus.setRecordStatus(useApply.getRecordStatus());
|
||||
useApplyService.updateUseApply(updateStatus);
|
||||
}
|
||||
return AjaxResult.success("操作成功",processInstanceModel);
|
||||
|
||||
@@ -9,6 +9,8 @@ import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工具信息对象 t_tool
|
||||
*
|
||||
@@ -24,70 +26,64 @@ public class Tool extends BaseEntity
|
||||
private String toolId;
|
||||
|
||||
/** 工具编号 */
|
||||
@Excel(name = "工具编号")
|
||||
private String toolCode;
|
||||
|
||||
/** 工具名称 */
|
||||
@Excel(name = "工具名称")
|
||||
@Excel(name = "工具名称",sort=1)
|
||||
private String toolName;
|
||||
|
||||
/** 工具类别 */
|
||||
@Excel(name = "工具类别")
|
||||
@Excel(name = "工具类别",dictType="tool_type",sort=2)
|
||||
private String toolType;
|
||||
|
||||
/** 来源 */
|
||||
@Excel(name = "来源")
|
||||
@Excel(name = "工具来源",sort=3)
|
||||
private String toolSource;
|
||||
|
||||
/** 用途 */
|
||||
@Excel(name = "用途")
|
||||
@Excel(name = "工具用途",sort=7)
|
||||
private String toolUse;
|
||||
|
||||
/** 测试情况 */
|
||||
@Excel(name = "测试情况")
|
||||
@Excel(name = "测评情况",sort=8)
|
||||
private String testSituation;
|
||||
|
||||
/** 功能描述 */
|
||||
@Excel(name = "功能描述")
|
||||
@Excel(name = "功能描述",sort=9)
|
||||
private String functionDesc;
|
||||
|
||||
/** 适用条件 */
|
||||
@Excel(name = "适用条件")
|
||||
@Excel(name = "适用条件",sort=10)
|
||||
private String applyCondition;
|
||||
|
||||
/** 操作说明 */
|
||||
@Excel(name = "操作说明")
|
||||
@Excel(name = "操作说明",sort=11)
|
||||
private String operateExplain;
|
||||
|
||||
/** 负责人 */
|
||||
@Excel(name = "负责人")
|
||||
private String toolPrincipals;
|
||||
|
||||
/** 负责人名称 */
|
||||
@Excel(name = "负责人")
|
||||
@Excel(name = "负责人",sort=4)
|
||||
private String toolPrincipalsName;
|
||||
|
||||
/** 归属单位 */
|
||||
@Excel(name = "归属单位")
|
||||
private String toolRespDept;
|
||||
|
||||
@Excel(name = "归属单位",sort=5)
|
||||
private String toolRespDeptName;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
@Excel(name = "状态",dictType="sys_normal_disable",sort=6)
|
||||
private String status;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注",sort=12)
|
||||
private String remark;
|
||||
|
||||
/** 发布时间 */
|
||||
private String releaseTime;
|
||||
|
||||
/** 部门对象 */
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT),
|
||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT)
|
||||
})
|
||||
private SysDept dept;
|
||||
|
||||
private BpmClientInputModelBo bpmClientInputModel;
|
||||
|
||||
private String recordStatus;
|
||||
@@ -95,4 +91,14 @@ public class Tool extends BaseEntity
|
||||
private Boolean editStatus;
|
||||
|
||||
private String procInstId;
|
||||
|
||||
private Boolean permissionCheck;
|
||||
|
||||
private Boolean permission;
|
||||
|
||||
private Boolean downloadCheck;
|
||||
|
||||
private Boolean downloadStatus;
|
||||
|
||||
private List<String> excludeFields;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.rzdata.web.mapper;
|
||||
import java.util.List;
|
||||
import com.rzdata.web.domain.UseApply;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 使用申请Mapper接口
|
||||
@@ -61,4 +62,6 @@ public interface UseApplyMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyByIds(String[] ids);
|
||||
|
||||
int checkUseApply(@Param("toolId") String toolId, @Param("userId") String userId);
|
||||
}
|
||||
|
||||
@@ -61,4 +61,6 @@ public interface IUseApplyService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyById(String id);
|
||||
|
||||
boolean checkUseApply(String toolId, String userId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.rzdata.common.constant.Constants;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
@@ -49,6 +51,9 @@ public class ToolServiceImpl implements IToolService
|
||||
@Override
|
||||
public List<Tool> selectToolList(Tool tool)
|
||||
{
|
||||
if (BooleanUtil.isTrue(tool.getPermissionCheck())) {
|
||||
tool.setPermission(SecurityUtils.hasPermi(Constants.VIEW_TOOL_PERMISSION));
|
||||
}
|
||||
return toolMapper.selectToolList(tool);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.rzdata.web.mapper.UseApplyMapper;
|
||||
@@ -101,4 +102,8 @@ public class UseApplyServiceImpl implements IUseApplyService
|
||||
{
|
||||
return useApplyMapper.deleteUseApplyById(id);
|
||||
}
|
||||
|
||||
public boolean checkUseApply(String toolId, String userId){
|
||||
return useApplyMapper.checkUseApply(toolId, userId)>0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user