工具发布流程和使用申请流程细节优化
This commit is contained in:
parent
fbc96e81e3
commit
0e18f96534
@ -84,7 +84,7 @@ public class ToolController extends BaseController
|
||||
@ApiOperation("判断文件名称是否存在 true 存在 false 不存在")
|
||||
@GetMapping("/checkToolExist")
|
||||
public AjaxResult checkToolExist(Tool tTool) {
|
||||
return AjaxResult.success(toolService.checkToolExist(tTool.getToolCode(), tTool.getToolRespDept()));
|
||||
return AjaxResult.success(toolService.checkToolExist(tTool));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -117,6 +117,11 @@ public class ToolController extends BaseController
|
||||
toolService.insertTool(tTool);
|
||||
}else if (BooleanUtil.isTrue(tTool.getEditStatus())){
|
||||
toolService.updateTool(tTool);
|
||||
}else {
|
||||
Tool tool = new Tool();
|
||||
tool.setToolId(tTool.getToolId());
|
||||
tool.setRecordStatus(tTool.getRecordStatus());
|
||||
toolService.updateTool(tool);
|
||||
}
|
||||
return AjaxResult.success("操作成功",processInstanceModel);
|
||||
}else {
|
||||
|
@ -9,6 +9,7 @@ import com.blueland.bpmclient.model.ProcessInstanceModel;
|
||||
import com.rzdata.common.enums.RecordStatusEnum;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import com.rzdata.web.service.IUseApplyItemService;
|
||||
import com.rzdata.web.service.WorkflowService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -126,6 +127,11 @@ public class UseApplyController extends BaseController
|
||||
}else if (BooleanUtil.isTrue(useApply.getEditStatus())){
|
||||
useApplyService.updateUseApply(useApply);
|
||||
useApplyItemService.updateItemList(useApply.getItemList(),useApply.getId());
|
||||
}else {
|
||||
UseApply updateStatus = new UseApply();
|
||||
useApply.setId(useApply.getId());
|
||||
useApply.setRecordStatus(useApply.getRecordStatus());
|
||||
useApplyService.updateUseApply(updateStatus);
|
||||
}
|
||||
return AjaxResult.success("操作成功",processInstanceModel);
|
||||
}else {
|
||||
|
@ -75,6 +75,12 @@ public class Tool extends BaseEntity
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 发布时间 */
|
||||
private String releaseTime;
|
||||
|
||||
/** 部门对象 */
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT),
|
||||
|
@ -21,14 +21,20 @@ public class UseApply extends BaseEntity
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 申请人 */
|
||||
@Excel(name = "申请人")
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "申请人id")
|
||||
private String userId;
|
||||
|
||||
@Excel(name = "申请人名称")
|
||||
private String nickName;
|
||||
|
||||
/** 申请部门 */
|
||||
@Excel(name = "申请部门")
|
||||
@Excel(name = "申请部门id")
|
||||
private String deptId;
|
||||
|
||||
@Excel(name = "申请部门名称")
|
||||
private String deptName;
|
||||
|
||||
/** 申请理由 */
|
||||
@Excel(name = "申请理由")
|
||||
private String reason;
|
||||
|
@ -22,6 +22,8 @@ public interface ToolMapper
|
||||
|
||||
Tool getInfoByBpmcId(String bpmcId);
|
||||
|
||||
int checkToolExist(Tool tool);
|
||||
|
||||
/**
|
||||
* 查询工具信息列表
|
||||
*
|
||||
|
@ -38,7 +38,7 @@ public interface IToolService
|
||||
*/
|
||||
public int insertTool(Tool tool);
|
||||
|
||||
public boolean checkToolExist(String toolCode, String toolRespDept);
|
||||
public boolean checkToolExist(Tool tTool);
|
||||
|
||||
/**
|
||||
* 修改工具信息
|
||||
|
@ -2,6 +2,7 @@ package com.rzdata.web.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import com.rzdata.web.mapper.ToolMapper;
|
||||
import com.rzdata.web.service.IToolService;
|
||||
@ -60,18 +61,15 @@ public class ToolServiceImpl implements IToolService
|
||||
@Override
|
||||
public int insertTool(Tool tool)
|
||||
{
|
||||
tool.setCreateBy(SecurityUtils.getUserId().toString());
|
||||
tool.setCreateTime(DateUtils.getNowDate());
|
||||
return toolMapper.insertTool(tool);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkToolExist(String toolCode, String toolRespDept)
|
||||
public boolean checkToolExist(Tool tTool)
|
||||
{
|
||||
Tool tool = new Tool();
|
||||
tool.setToolCode(toolCode);
|
||||
tool.setToolRespDept(toolRespDept);
|
||||
List<Tool> toolList = toolMapper.selectToolList(tool);
|
||||
return toolList.size() > 0;
|
||||
return toolMapper.checkToolExist(tTool)> 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,6 +81,7 @@ public class ToolServiceImpl implements IToolService
|
||||
@Override
|
||||
public int updateTool(Tool tool)
|
||||
{
|
||||
tool.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||
tool.setUpdateTime(DateUtils.getNowDate());
|
||||
return toolMapper.updateTool(tool);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.rzdata.web.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -58,6 +59,7 @@ public class UseApplyServiceImpl implements IUseApplyService
|
||||
@Override
|
||||
public int insertUseApply(UseApply useApply)
|
||||
{
|
||||
useApply.setCreateBy(SecurityUtils.getUserId().toString());
|
||||
useApply.setCreateTime(DateUtils.getNowDate());
|
||||
return useApplyMapper.insertUseApply(useApply);
|
||||
}
|
||||
@ -71,6 +73,7 @@ public class UseApplyServiceImpl implements IUseApplyService
|
||||
@Override
|
||||
public int updateUseApply(UseApply useApply)
|
||||
{
|
||||
useApply.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||
useApply.setUpdateTime(DateUtils.getNowDate());
|
||||
return useApplyMapper.updateUseApply(useApply);
|
||||
}
|
||||
|
@ -130,5 +130,5 @@ xss:
|
||||
|
||||
bpmc:
|
||||
tenantId: TLTC_SYS
|
||||
serviceUrl: http://192.168.2.17:8081/ebpm-process-rest/
|
||||
serviceUrl: http://192.168.2.20:8081/ebpm-process-rest/
|
||||
uniteWorkUrl: http://localhost/tool-tech/workflowRouter
|
||||
|
@ -129,11 +129,23 @@
|
||||
where tool_id = #{toolId}
|
||||
</update>
|
||||
|
||||
<select id="checkToolExist" parameterType="Tool" resultType="int">
|
||||
select count(*) from t_tool t
|
||||
<where>
|
||||
t.tool_code = #{toolCode} and t.tool_resp_dept = #{toolRespDept}
|
||||
and (t.record_status = 'doing' or t.record_status = 'done')
|
||||
<if test="toolId!=null and toolId!=''">
|
||||
and t.tool_id != #{toolId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectToolList" parameterType="Tool" resultMap="ToolResult">
|
||||
select u.tool_id, u.tool_code, u.tool_name, u.tool_type, u.tool_source, u.tool_use, u.test_situation, u.function_desc, u.apply_condition, u.operate_explain,
|
||||
select u.tool_id, u.tool_code, u.tool_name, u.tool_type, u.tool_source, u.tool_use, u.test_situation, u.function_desc, u.apply_condition, u.operate_explain,u.record_status,u.proc_inst_id,
|
||||
u.tool_principals, u.tool_principals_name, u.tool_resp_dept, u.status, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from t_tool u
|
||||
left join sys_dept d on u.tool_resp_dept = d.dept_id
|
||||
where 1=1
|
||||
and u.record_status != 'cancel'
|
||||
<if test="toolId != null and toolId != ''">
|
||||
AND u.tool_id = #{toolId}
|
||||
</if>
|
||||
@ -155,6 +167,10 @@
|
||||
<if test="toolRespDept != null and toolRespDept != ''">
|
||||
AND u.tool_resp_dept = #{toolRespDept}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND (u.create_by = #{createBy} or u.record_status = 'done')
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<delete id="deleteToolByToolId" parameterType="String">
|
||||
|
@ -6,8 +6,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<resultMap type="UseApply" id="UseApplyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="reason" column="reason" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@ -18,13 +20,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUseApplyVo">
|
||||
select id, user_name, dept_id, reason, create_by, create_time, update_by, update_time from t_use_apply
|
||||
select id, user_id, nick_name, dept_id, dept_name, reason, create_by, create_time, update_by, update_time from t_use_apply
|
||||
</sql>
|
||||
|
||||
<select id="selectUseApplyList" parameterType="UseApply" resultMap="UseApplyResult">
|
||||
<include refid="selectUseApplyVo"/>
|
||||
<where>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="userId != null and userId != ''"> and user_id like concat('%', #{userId}, '%')</if>
|
||||
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
|
||||
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
|
||||
</where>
|
||||
@ -44,8 +46,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
insert into t_use_apply
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
<if test="reason != null">reason,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
@ -56,8 +60,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
<if test="reason != null">#{reason},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
@ -71,8 +77,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<update id="updateUseApply" parameterType="UseApply">
|
||||
update t_use_apply
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
<if test="reason != null">reason = #{reason},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
|
Loading…
x
Reference in New Issue
Block a user