会签配置管理
This commit is contained in:
parent
b28a993067
commit
64be877da7
|
|
@ -0,0 +1,101 @@
|
|||
package com.bonus.material.countersign.controller;
|
||||
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
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.service.ISignConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会签管理Controller
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-16
|
||||
*/
|
||||
@Api(tags = "会签管理接口")
|
||||
@RestController
|
||||
@RequestMapping("/sign_config")
|
||||
public class signConfigController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISignConfigService signConfigService;
|
||||
|
||||
/**
|
||||
* 查询会签配置管理列表
|
||||
*/
|
||||
@ApiOperation(value = "查询会签配置管理列表")
|
||||
@RequiresPermissions("signConfig:info:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo getList(SignConfigVo signConfigVo) {
|
||||
startPage();
|
||||
List<SignConfigVo> list = signConfigService.getList(signConfigVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会签配置管理
|
||||
*/
|
||||
@ApiOperation(value = "新增会签配置管理")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("signConfig:info:add")
|
||||
@SysLog(title = "会签配置管理", businessType = OperaType.INSERT, logType = 1,module = "会签配置管理->新增会签配置管理")
|
||||
@PostMapping("/addConfig")
|
||||
public AjaxResult addConfig(@RequestBody SignConfigVo signConfigVo) {
|
||||
try {
|
||||
return signConfigService.insertConfigInfo(signConfigVo);
|
||||
} catch (Exception e) {
|
||||
return error("系统错误, " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会签配置详细信息
|
||||
*/
|
||||
@ApiOperation(value = "获取会签配置管理详细信息")
|
||||
@RequiresPermissions("signConfig:info:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(signConfigService.selectConfigInfoById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改会签配置管理
|
||||
*/
|
||||
@ApiOperation(value = "修改会签配置管理")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("signConfig:info:edit")
|
||||
@SysLog(title = "会签配置管理", businessType = OperaType.UPDATE, logType = 1,module = "会签配置管理->修改会签配置管理")
|
||||
@PostMapping("/editConfig")
|
||||
public AjaxResult editConfig(@RequestBody SignConfigVo signConfigVo) {
|
||||
try {
|
||||
return signConfigService.updateConfigInfo(signConfigVo);
|
||||
} catch (Exception e) {
|
||||
return error("系统错误, " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会签配置
|
||||
*/
|
||||
@ApiOperation(value = "删除会签配置管理")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("signConfig:info:remove")
|
||||
@SysLog(title = "会签配置管理", businessType = OperaType.DELETE, module = "会签配置管理->删除会签配置管理")
|
||||
@PostMapping("/delConfig/{id}")
|
||||
public AjaxResult delConfig(@PathVariable("id") Long id) {
|
||||
return signConfigService.delConfig(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.bonus.material.countersign.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
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 SignConfigVo 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 peopleId;
|
||||
|
||||
/** 会签流程名称 */
|
||||
@ApiModelProperty(value = "会签流程名称")
|
||||
private String processName;
|
||||
|
||||
/** 会签类型名称 */
|
||||
@ApiModelProperty(value = "会签类型名称")
|
||||
private String signTypeName;
|
||||
|
||||
/** 配置人员名称 */
|
||||
@ApiModelProperty(value = "配置人员名称")
|
||||
private String peopleName;
|
||||
|
||||
@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.warehouse.domain.WhHouseInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会签配置管理Mapper接口
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-16
|
||||
*/
|
||||
public interface SignConfigMapper
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询会签配置管理列表
|
||||
*
|
||||
* @param signConfigVo 会签配置管理
|
||||
* @return 会签配置管理集合
|
||||
*/
|
||||
List<SignConfigVo> getList(SignConfigVo signConfigVo);
|
||||
|
||||
/**
|
||||
* 新增时查询是否流程id和会签类型重复
|
||||
*
|
||||
* @param signConfigVo 会签配置管理
|
||||
* @return 会签配置管理
|
||||
*/
|
||||
int selectConfigRepeat(SignConfigVo signConfigVo);
|
||||
|
||||
/**
|
||||
* 新增会签配置管理
|
||||
*
|
||||
* @param signConfigVo 会签配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertConfigInfo(SignConfigVo signConfigVo);
|
||||
|
||||
/**
|
||||
* 查询会签配置管理详情
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 会签配置管理
|
||||
*/
|
||||
SignConfigVo selectConfigInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 修改时查询是否流程id和会签类型重复
|
||||
*
|
||||
* @param signConfigVo 会签配置管理
|
||||
* @return 会签配置管理
|
||||
*/
|
||||
int selectConfigRepeatEdit(SignConfigVo signConfigVo);
|
||||
|
||||
/**
|
||||
* 编辑会签配置管理
|
||||
*
|
||||
* @param signConfigVo 会签配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateConfigInfo(SignConfigVo signConfigVo);
|
||||
|
||||
|
||||
/**
|
||||
* 删除会签配置管理
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
int delConfig(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.bonus.material.countersign.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.countersign.domain.SignConfigVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会签配置管理Service接口
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-16
|
||||
*/
|
||||
public interface ISignConfigService {
|
||||
|
||||
/**
|
||||
* 查询会签配置管理列表
|
||||
*
|
||||
* @param signConfigVo 会签配置管理
|
||||
* @return 会签配置管理集合
|
||||
*/
|
||||
List<SignConfigVo> getList(SignConfigVo signConfigVo);
|
||||
|
||||
/**
|
||||
* 新增会签配置管理
|
||||
*
|
||||
* @param signConfigVo 会签配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult insertConfigInfo(SignConfigVo signConfigVo);
|
||||
|
||||
/**
|
||||
* 查询会签配置管理详情
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 会签配置管理
|
||||
*/
|
||||
SignConfigVo selectConfigInfoById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 修改会签配置管理
|
||||
*
|
||||
* @param signConfigVo 会签配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult updateConfigInfo(SignConfigVo signConfigVo);
|
||||
|
||||
/**
|
||||
* 删除会签配置管理信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult delConfig(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
package com.bonus.material.countersign.service.impl;
|
||||
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.countersign.domain.SignConfigVo;
|
||||
import com.bonus.material.countersign.mapper.SignConfigMapper;
|
||||
import com.bonus.material.countersign.service.ISignConfigService;
|
||||
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 SignConfigServiceImpl implements ISignConfigService
|
||||
{
|
||||
@Autowired
|
||||
private SignConfigMapper signConfigMapper;
|
||||
|
||||
/**
|
||||
* 查询会签配置管理列表
|
||||
*
|
||||
* @param signConfigVo 会签配置管理
|
||||
* @return 会签配置管理
|
||||
*/
|
||||
@Override
|
||||
public List<SignConfigVo> getList(SignConfigVo signConfigVo) {
|
||||
return signConfigMapper.getList(signConfigVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会签配置管理
|
||||
*
|
||||
* @param signConfigVo 会签配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insertConfigInfo(SignConfigVo signConfigVo)
|
||||
{
|
||||
try {
|
||||
int count = signConfigMapper.selectConfigRepeat(signConfigVo);
|
||||
if(count > 0){
|
||||
return AjaxResult.error("同时存在相同流程名称和会签类型,请重新选择新增");
|
||||
}
|
||||
int countTwo = signConfigMapper.insertConfigInfo(signConfigVo);
|
||||
if(countTwo == 1){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error("会签配置新增失败");
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会签配置管理详情
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 会签配置管理
|
||||
*/
|
||||
@Override
|
||||
public SignConfigVo selectConfigInfoById(Long id)
|
||||
{
|
||||
return signConfigMapper.selectConfigInfoById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改会签配置管理
|
||||
*
|
||||
* @param signConfigVo 会签配置管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateConfigInfo(SignConfigVo signConfigVo)
|
||||
{
|
||||
try {
|
||||
int count = signConfigMapper.selectConfigRepeatEdit(signConfigVo);
|
||||
if(count > 0){
|
||||
return AjaxResult.error("同时存在相同流程名称和会签类型,请重新选择修改");
|
||||
}
|
||||
int countTwo = signConfigMapper.updateConfigInfo(signConfigVo);
|
||||
if(countTwo == 1){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error("会签配置修改失败");
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会签配置管理信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult delConfig(Long id)
|
||||
{
|
||||
try {
|
||||
int count = signConfigMapper.delConfig(id);
|
||||
if(count == 1){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error("会签配置删除失败");
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<?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.SignConfigMapper">
|
||||
|
||||
<select id="getList" resultType="com.bonus.material.countersign.domain.SignConfigVo">
|
||||
select
|
||||
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_user su on sc.people_id = su.user_id and su.del_flag = 0
|
||||
<where>
|
||||
sc.del_flag = 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}, '%'))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectConfigRepeat" 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>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertConfigInfo" parameterType="com.bonus.material.countersign.domain.SignConfigVo">
|
||||
insert into sign_config(
|
||||
<if test="processId != null">process_id,</if>
|
||||
<if test="signType != null">sign_type,</if>
|
||||
<if test="peopleId != null">people_id,</if>
|
||||
del_flag
|
||||
)values(
|
||||
<if test="processId != null">#{processId},</if>
|
||||
<if test="signType != null">#{signType},</if>
|
||||
<if test="peopleId != null">#{peopleId},</if>
|
||||
0
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectConfigInfoById" parameterType="Long" resultType="com.bonus.material.countersign.domain.SignConfigVo">
|
||||
select
|
||||
sc.id as id,sc.process_id as processId,sc.sign_type as signType,sc.people_id as peopleId
|
||||
from sign_config sc
|
||||
where sc.id = #{id} and sc.del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectConfigRepeatEdit" 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>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateConfigInfo" parameterType="com.bonus.material.countersign.domain.SignConfigVo">
|
||||
update sign_config
|
||||
<set>
|
||||
<if test="processId != null">process_id = #{processId},</if>
|
||||
<if test="signType != null">sign_type = #{signType},</if>
|
||||
<if test="peopleId != null">people_id = #{peopleId}</if>
|
||||
</set>
|
||||
where id = #{id} and del_flag = 0
|
||||
</update>
|
||||
|
||||
<update id="delConfig" parameterType="Long">
|
||||
update sign_config
|
||||
set del_flag = 1
|
||||
where id = #{id} and del_flag = 0
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue