Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b14bed4d9a
|
|
@ -0,0 +1,101 @@
|
|||
package com.bonus.material.countersign.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.countersign.domain.SignConfigVo;
|
||||
import com.bonus.material.countersign.domain.SignProcessVo;
|
||||
import com.bonus.material.countersign.service.ISignConfigService;
|
||||
import com.bonus.material.countersign.service.ISignProcessService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会签流程管理Controller
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-16
|
||||
*/
|
||||
@Api(tags = "会签流程管理接口")
|
||||
@RestController
|
||||
@RequestMapping("/sign_process")
|
||||
public class signProcessController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISignProcessService signProcessService;
|
||||
|
||||
/**
|
||||
* 查询会签流程配置管理列表
|
||||
*/
|
||||
@ApiOperation(value = "查询会签配置管理列表")
|
||||
@RequiresPermissions("signProcess:info:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo getList(SignProcessVo signProcessVo) {
|
||||
startPage();
|
||||
List<SignProcessVo> list = signProcessService.getList(signProcessVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会签流程配置管理
|
||||
*/
|
||||
@ApiOperation(value = "新增会签流程配置管理")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("signProcess:info:add")
|
||||
@SysLog(title = "会签流程配置管理", businessType = OperaType.INSERT, logType = 1,module = "会签流程配置管理->新增会签流程配置管理")
|
||||
@PostMapping("/addProcess")
|
||||
public AjaxResult addProcess(@RequestBody SignProcessVo signProcessVo) {
|
||||
try {
|
||||
return signProcessService.insertProcessInfo(signProcessVo);
|
||||
} catch (Exception e) {
|
||||
return error("系统错误, " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会签流程配置详细信息
|
||||
*/
|
||||
@ApiOperation(value = "获取会签流程配置管理详细信息")
|
||||
@RequiresPermissions("signProcess:info:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(signProcessService.selectProcessInfoById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改会签流程配置管理
|
||||
*/
|
||||
@ApiOperation(value = "修改会签流程配置管理")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("signProcess:info:edit")
|
||||
@SysLog(title = "会签流程配置管理", businessType = OperaType.UPDATE, logType = 1,module = "会签流程配置管理->修改会签流程配置管理")
|
||||
@PostMapping("/editProcess")
|
||||
public AjaxResult editProcess(@RequestBody SignProcessVo signProcessVo) {
|
||||
try {
|
||||
return signProcessService.updateProcessInfo(signProcessVo);
|
||||
} catch (Exception e) {
|
||||
return error("系统错误, " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会签流程配置
|
||||
*/
|
||||
@ApiOperation(value = "删除会签流程配置管理")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("signProcess:info:remove")
|
||||
@SysLog(title = "会签流程配置管理", businessType = OperaType.DELETE, module = "会签流程配置管理->删除会签流程配置管理")
|
||||
@PostMapping("/delProcess/{id}")
|
||||
public AjaxResult delProcess(@PathVariable("id") Long id) {
|
||||
return signProcessService.delProcess(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.bonus.material.countersign.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 会签配置管理对象
|
||||
* @author hongchao
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@ToString
|
||||
public class SignProcessVo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = -6993602646196064834L;
|
||||
|
||||
/** id */
|
||||
@ApiModelProperty(value = "id")
|
||||
private Long id;
|
||||
|
||||
/** 会签流程id */
|
||||
@ApiModelProperty(value = "会签流程id")
|
||||
private String processId;
|
||||
|
||||
/** 会签类型 */
|
||||
@ApiModelProperty(value = "会签类型")
|
||||
private String signType;
|
||||
|
||||
/** 组织id */
|
||||
@ApiModelProperty(value = "组织id")
|
||||
private Long orgId;
|
||||
|
||||
/** 会签流程名称 */
|
||||
@ApiModelProperty(value = "会签流程名称")
|
||||
private String processName;
|
||||
|
||||
/** 会签类型名称 */
|
||||
@ApiModelProperty(value = "会签类型名称")
|
||||
private String signTypeName;
|
||||
|
||||
/** 组织名称 */
|
||||
@ApiModelProperty(value = "组织名称")
|
||||
private String orgName;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.bonus.material.countersign.mapper;
|
||||
|
||||
import com.bonus.material.countersign.domain.SignConfigVo;
|
||||
import com.bonus.material.countersign.domain.SignProcessVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会签流程配置管理Mapper接口
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-16
|
||||
*/
|
||||
public interface SignProcessMapper
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询会签流程配置管理列表
|
||||
*
|
||||
* @param signProcessVo 会签流程配置管理
|
||||
* @return 会签流程配置管理集合
|
||||
*/
|
||||
List<SignProcessVo> getList(SignProcessVo signProcessVo);
|
||||
|
||||
/**
|
||||
* 新增时查询流程id和会签类型下会签组织是否重复
|
||||
*
|
||||
* @param signProcessVo 会签流程配置管理
|
||||
* @return 会签流程配置管理
|
||||
*/
|
||||
int selectProcessRepeat(SignProcessVo signProcessVo);
|
||||
|
||||
/**
|
||||
* 新增会签流程配置管理
|
||||
*
|
||||
* @param signProcessVo 会签流程配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertProcessInfo(SignProcessVo signProcessVo);
|
||||
|
||||
/**
|
||||
* 查询会签流程配置管理详情
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 会签流程配置管理
|
||||
*/
|
||||
SignProcessVo selectProcessInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 修改时查询查询流程id和会签类型下会签组织是否重复
|
||||
*
|
||||
* @param signProcessVo 会签流程配置管理
|
||||
* @return 会签流程配置管理
|
||||
*/
|
||||
int selectProcessRepeatEdit(SignProcessVo signProcessVo);
|
||||
|
||||
/**
|
||||
* 编辑会签流程配置管理
|
||||
*
|
||||
* @param signProcessVo 会签流程配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateProcessInfo(SignProcessVo signProcessVo);
|
||||
|
||||
|
||||
/**
|
||||
* 删除会签流程配置管理
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
int delProcess(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.bonus.material.countersign.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.countersign.domain.SignConfigVo;
|
||||
import com.bonus.material.countersign.domain.SignProcessVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会签流程配置管理Service接口
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-16
|
||||
*/
|
||||
public interface ISignProcessService {
|
||||
|
||||
/**
|
||||
* 查询会签流程配置管理列表
|
||||
*
|
||||
* @param signProcessVo 会签流程配置管理
|
||||
* @return 会签流程配置管理集合
|
||||
*/
|
||||
List<SignProcessVo> getList(SignProcessVo signProcessVo);
|
||||
|
||||
/**
|
||||
* 新增会签流程配置管理
|
||||
*
|
||||
* @param signProcessVo 会签流程配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult insertProcessInfo(SignProcessVo signProcessVo);
|
||||
|
||||
/**
|
||||
* 查询会签流程配置管理详情
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 会签流程配置管理
|
||||
*/
|
||||
SignProcessVo selectProcessInfoById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 修改会签流程配置管理
|
||||
*
|
||||
* @param signProcessVo 会签流程配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult updateProcessInfo(SignProcessVo signProcessVo);
|
||||
|
||||
/**
|
||||
* 删除会签流程配置管理信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult delProcess(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
package com.bonus.material.countersign.service.impl;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.countersign.domain.SignConfigVo;
|
||||
import com.bonus.material.countersign.domain.SignProcessVo;
|
||||
import com.bonus.material.countersign.mapper.SignConfigMapper;
|
||||
import com.bonus.material.countersign.mapper.SignProcessMapper;
|
||||
import com.bonus.material.countersign.service.ISignConfigService;
|
||||
import com.bonus.material.countersign.service.ISignProcessService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会签流程配置管理Service业务层处理
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-16
|
||||
*/
|
||||
@Service
|
||||
public class SignProcessServiceImpl implements ISignProcessService
|
||||
{
|
||||
@Autowired
|
||||
private SignProcessMapper signProcessMapper;
|
||||
|
||||
/**
|
||||
* 查询会签流程配置管理列表
|
||||
*
|
||||
* @param signProcessVo 会签流程配置管理
|
||||
* @return 会签流程配置管理
|
||||
*/
|
||||
@Override
|
||||
public List<SignProcessVo> getList(SignProcessVo signProcessVo) {
|
||||
return signProcessMapper.getList(signProcessVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会签流程配置管理
|
||||
*
|
||||
* @param signProcessVo 会签流程配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insertProcessInfo(SignProcessVo signProcessVo)
|
||||
{
|
||||
try {
|
||||
int count = signProcessMapper.selectProcessRepeat(signProcessVo);
|
||||
if(count > 0){
|
||||
return AjaxResult.error("该会签流程和类型下已有该会签组织,请重新选择新增");
|
||||
}
|
||||
int countTwo = signProcessMapper.insertProcessInfo(signProcessVo);
|
||||
if(countTwo == 1){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error("会签流程配置新增失败");
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会签流程配置管理详情
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 会签流程配置管理
|
||||
*/
|
||||
@Override
|
||||
public SignProcessVo selectProcessInfoById(Long id)
|
||||
{
|
||||
return signProcessMapper.selectProcessInfoById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改会签流程配置管理
|
||||
*
|
||||
* @param signProcessVo 会签流程配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateProcessInfo(SignProcessVo signProcessVo)
|
||||
{
|
||||
try {
|
||||
int count = signProcessMapper.selectProcessRepeatEdit(signProcessVo);
|
||||
if(count > 0){
|
||||
return AjaxResult.error("该会签流程和类型下已有该会签组织,请重新选择修改");
|
||||
}
|
||||
int countTwo = signProcessMapper.updateProcessInfo(signProcessVo);
|
||||
if(countTwo == 1){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error("会签流程配置修改失败");
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会签流程配置管理信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult delProcess(Long id)
|
||||
{
|
||||
try {
|
||||
int count = signProcessMapper.delProcess(id);
|
||||
if(count == 1){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error("会签流程配置删除失败");
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,11 +9,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sc.id as id,sc.process_id as processId,sc.sign_type as signType,sc.people_id as peopleId,
|
||||
su.nick_name as peopleName,sdd.dict_label as processName,sdd2.dict_label as signTypeName
|
||||
from sign_config sc
|
||||
left join sys_dict_data sdd on sc.process_id = sdd.dict_value and sdd.dict_type = 'countersign_process_name' and sdd.status = 0
|
||||
left join sys_dict_data sdd2 on sc.sign_type = sdd2.dict_value and sdd2.dict_type = 'countersign_type_name' and sdd2.status = 0
|
||||
left join sys_dict_data sdd on sc.process_id = sdd.dict_value
|
||||
left join sys_dict_data sdd2 on sc.sign_type = sdd2.dict_value
|
||||
left join sys_user su on sc.people_id = su.user_id and su.del_flag = 0
|
||||
<where>
|
||||
sc.del_flag = 0
|
||||
and sdd.dict_type = 'countersign_process_name' and sdd.status = 0
|
||||
and sdd2.dict_type = 'countersign_type_name' and sdd2.status = 0
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (sdd.dict_label like concat('%', #{keyWord}, '%') or sdd2.dict_label like concat('%', #{keyWord}, '%')
|
||||
or su.user_name like concat('%', #{keyWord}, '%'))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.material.countersign.mapper.SignProcessMapper">
|
||||
|
||||
<select id="getList" resultType="com.bonus.material.countersign.domain.SignProcessVo">
|
||||
select
|
||||
sc.id as id,sc.process_id as processId,sc.sign_type as signType,sc.org_id as orgId,
|
||||
sd.dept_name as orgName,sdd.dict_label as processName,sdd2.dict_label as signTypeName
|
||||
from sign_config sc
|
||||
left join sys_dict_data sdd on sc.process_id = sdd.dict_value
|
||||
left join sys_dict_data sdd2 on sc.sign_type = sdd2.dict_value
|
||||
left join sys_dept sd on sc.org_id = sd.dept_id and sd.del_flag = 0
|
||||
<where>
|
||||
sc.del_flag = 0
|
||||
and sdd.dict_type = 'countersign_process_config_name' and sdd.status = 0
|
||||
and sdd2.dict_type = 'countersign_process_type_name' and sdd2.status = 0
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (sdd.dict_label like concat('%', #{keyWord}, '%') or sdd2.dict_label like concat('%', #{keyWord}, '%')
|
||||
or sd.dept_name like concat('%', #{keyWord}, '%'))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProcessRepeat" resultType="int">
|
||||
select
|
||||
count(id)
|
||||
from sign_config sc
|
||||
<where>
|
||||
sc.del_flag = 0
|
||||
<if test="processId != null">
|
||||
and sc.process_id = #{processId}
|
||||
</if>
|
||||
<if test="signType != null">
|
||||
and sc.sign_type = #{signType}
|
||||
</if>
|
||||
<if test="orgId != null">
|
||||
and sc.org_id = #{orgId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertProcessInfo" parameterType="com.bonus.material.countersign.domain.SignProcessVo">
|
||||
insert into sign_config(
|
||||
<if test="processId != null">process_id,</if>
|
||||
<if test="signType != null">sign_type,</if>
|
||||
<if test="orgId != null">org_id,</if>
|
||||
del_flag
|
||||
)values(
|
||||
<if test="processId != null">#{processId},</if>
|
||||
<if test="signType != null">#{signType},</if>
|
||||
<if test="orgId != null">#{orgId},</if>
|
||||
0
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectProcessInfoById" parameterType="Long" resultType="com.bonus.material.countersign.domain.SignProcessVo">
|
||||
select
|
||||
sc.id as id,sc.process_id as processId,sc.sign_type as signType,sc.org_id as orgId
|
||||
from sign_config sc
|
||||
where sc.id = #{id} and sc.del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectProcessRepeatEdit" resultType="int">
|
||||
select
|
||||
count(id)
|
||||
from sign_config sc
|
||||
<where>
|
||||
sc.del_flag = 0
|
||||
<if test="id != null">
|
||||
and sc.id != #{id}
|
||||
</if>
|
||||
<if test="processId != null">
|
||||
and sc.process_id = #{processId}
|
||||
</if>
|
||||
<if test="signType != null">
|
||||
and sc.sign_type = #{signType}
|
||||
</if>
|
||||
<if test="orgId != null">
|
||||
and sc.org_id = #{orgId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateProcessInfo" parameterType="com.bonus.material.countersign.domain.SignProcessVo">
|
||||
update sign_config
|
||||
<set>
|
||||
<if test="processId != null">process_id = #{processId},</if>
|
||||
<if test="signType != null">sign_type = #{signType},</if>
|
||||
<if test="orgId != null">org_id = #{orgId}</if>
|
||||
</set>
|
||||
where id = #{id} and del_flag = 0
|
||||
</update>
|
||||
|
||||
<update id="delProcess" parameterType="Long">
|
||||
update sign_config
|
||||
set del_flag = 1
|
||||
where id = #{id} and del_flag = 0
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue