parent
0ca789b059
commit
14ec6646f1
23 changed files with 662 additions and 175 deletions
@ -0,0 +1,81 @@ |
||||
package com.daqing.financial.guarantee.controller; |
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse; |
||||
import com.daqing.financial.guarantee.model.response.DgProessManageRes; |
||||
import com.daqing.financial.guarantee.service.IDgProcessManageService; |
||||
import com.daqing.framework.domain.guarantee.DgProcessManage; |
||||
import com.daqing.framework.model.response.ResponseResult; |
||||
import com.daqing.framework.util.RedisUtil; |
||||
import com.daqing.framework.utils.PageUtils; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import org.springframework.stereotype.Controller; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Arrays; |
||||
import java.util.LinkedHashMap; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 流程管理表 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-01-15 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/dg-process-manage") |
||||
public class DgProcessManageController { |
||||
|
||||
@Autowired |
||||
private DgApplyAmountInfoController dgApplyAmountInfoController; |
||||
@Autowired |
||||
private IDgProcessManageService iDgProcessManageService; |
||||
|
||||
/** |
||||
* 流程管理列表(可见范围内的人可以查看列表) |
||||
* @param |
||||
* @return |
||||
*/ |
||||
@GetMapping("/processManageList") |
||||
@ApiOperation(value = "流程管理列表") |
||||
public ResponseResult processManageList(){ |
||||
//获取当前登录用户id
|
||||
String userId = dgApplyAmountInfoController.getUserId(); |
||||
//查询可见范围内的人可见列表
|
||||
List<DgProcessManage> list = iDgProcessManageService.processManageList(userId); |
||||
return new ResponseResult<PageUtils>().SUCCESS(list); |
||||
} |
||||
|
||||
/** |
||||
* 查询审批模板对应的可见人员 |
||||
* @param |
||||
* @return |
||||
*/ |
||||
@GetMapping("/processVisualList") |
||||
@ApiOperation(value = "查询审批模板对应的可见人员") |
||||
public ResponseResult processVisualList(@RequestParam(value = "id") Integer id){ |
||||
//查询可见范围内的人可见列表
|
||||
List<Integer> list = iDgProcessManageService.processVisualList(id); |
||||
return new ResponseResult<PageUtils>().SUCCESS(list); |
||||
} |
||||
|
||||
/** |
||||
* 修改人员可以看到审批模板 |
||||
* @param id 流程管理id ids 可见人id |
||||
* @return |
||||
*/ |
||||
@GetMapping("/updateUserVisual") |
||||
@ApiOperation(value = "修改人员可以看到审批模板") |
||||
public ResponseResult updateUserVisual(@RequestParam(value="id") Integer id,@RequestParam(value = "ids") List<Integer>ids){ |
||||
//查询可见范围内的人可见列表
|
||||
Boolean a= iDgProcessManageService.updateUserVisual(id,ids); |
||||
return new ResponseResult<PageUtils>().SUCCESS(a); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,21 @@ |
||||
package com.daqing.financial.guarantee.controller; |
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* <p> |
||||
* 流程管理可见表 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-01-15 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/dg-process-manage-visual") |
||||
public class DgProcessManageVisualController { |
||||
|
||||
} |
@ -0,0 +1,23 @@ |
||||
package com.daqing.financial.guarantee.mapper; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.daqing.framework.domain.guarantee.DgProcessManage; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 流程管理表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-01-15 |
||||
*/ |
||||
@Mapper |
||||
public interface DgProcessManageMapper extends BaseMapper<DgProcessManage> { |
||||
|
||||
List<DgProcessManage> processManageList(@Param("usrId") int usrId); |
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.daqing.financial.guarantee.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.daqing.framework.domain.guarantee.DgProcessManageVisual; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 流程管理可见表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-01-15 |
||||
*/ |
||||
@Mapper |
||||
public interface DgProcessManageVisualMapper extends BaseMapper<DgProcessManageVisual> { |
||||
|
||||
List<Integer> processVisualList(@Param("id") Integer id); |
||||
|
||||
int insertUserVisual(@Param("list")List<DgProcessManageVisual> list); |
||||
} |
@ -0,0 +1,19 @@ |
||||
package com.daqing.financial.guarantee.model.response; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @Author QYQ |
||||
* @DATE 2021/1/15 17:10 |
||||
* @Version 1.0 |
||||
*/ |
||||
@Data |
||||
public class DgProessManageRes { |
||||
|
||||
@ApiModelProperty("用户id") |
||||
private Integer userId; |
||||
|
||||
@ApiModelProperty("员工姓名") |
||||
private String name; |
||||
} |
@ -0,0 +1,26 @@ |
||||
package com.daqing.financial.guarantee.service; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.daqing.financial.guarantee.model.response.DgProessManageRes; |
||||
import com.daqing.framework.domain.guarantee.DgProcessManage; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 流程管理表 服务类 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-01-15 |
||||
*/ |
||||
public interface IDgProcessManageService extends IService<DgProcessManage> { |
||||
|
||||
List<DgProcessManage> processManageList(String userId); |
||||
|
||||
List<Integer> processVisualList(Integer id); |
||||
|
||||
Boolean updateUserVisual(@Param("id") Integer id, @Param("ids") List<Integer> ids); |
||||
} |
@ -0,0 +1,17 @@ |
||||
package com.daqing.financial.guarantee.service; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.daqing.framework.domain.guarantee.DgProcessManageVisual; |
||||
|
||||
/** |
||||
* <p> |
||||
* 流程管理可见表 服务类 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-01-15 |
||||
*/ |
||||
public interface IDgProcessManageVisualService extends IService<DgProcessManageVisual> { |
||||
|
||||
} |
@ -0,0 +1,66 @@ |
||||
package com.daqing.financial.guarantee.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.daqing.financial.guarantee.mapper.DgProcessManageMapper; |
||||
import com.daqing.financial.guarantee.mapper.DgProcessManageVisualMapper; |
||||
import com.daqing.financial.guarantee.model.response.DgProessManageRes; |
||||
import com.daqing.financial.guarantee.service.IDgProcessManageService; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.daqing.framework.domain.guarantee.DgProcessManage; |
||||
import com.daqing.framework.domain.guarantee.DgProcessManageVisual; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 流程管理表 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-01-15 |
||||
*/ |
||||
@Service |
||||
public class DgProcessManageServiceImpl extends ServiceImpl<DgProcessManageMapper, DgProcessManage> implements IDgProcessManageService { |
||||
|
||||
@Autowired |
||||
private DgProcessManageVisualMapper dgProcessManageVisualMapper; |
||||
|
||||
@Override |
||||
public List<DgProcessManage> processManageList(String userId) { |
||||
|
||||
int usrId = Integer.parseInt(userId); |
||||
return this.baseMapper.processManageList(usrId); |
||||
} |
||||
|
||||
@Override |
||||
public List<Integer> processVisualList(Integer id) { |
||||
//根据流程管理id查询可见人id
|
||||
List<Integer> visualUserId = dgProcessManageVisualMapper.processVisualList(id); |
||||
return visualUserId; |
||||
} |
||||
|
||||
@Override |
||||
public Boolean updateUserVisual(Integer id, List<Integer> ids) { |
||||
//先根据主键id删除所有对应可见模板员工
|
||||
dgProcessManageVisualMapper.delete(new QueryWrapper<DgProcessManageVisual>() |
||||
.eq("process_manage_id",id)); |
||||
|
||||
//批量新增数据到流程管理可见表
|
||||
List<DgProcessManageVisual> list = new ArrayList<>(); |
||||
for (Integer i:ids) { |
||||
DgProcessManageVisual dgProcessManageVisual = new DgProcessManageVisual(); |
||||
dgProcessManageVisual.setProcessManageId(id); |
||||
dgProcessManageVisual.setUserId(i); |
||||
list.add(dgProcessManageVisual); |
||||
} |
||||
int i = dgProcessManageVisualMapper.insertUserVisual(list); |
||||
if(i>0){ |
||||
return true; |
||||
}else{ |
||||
return false; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,20 @@ |
||||
package com.daqing.financial.guarantee.service.impl; |
||||
|
||||
import com.daqing.financial.guarantee.mapper.DgProcessManageVisualMapper; |
||||
import com.daqing.financial.guarantee.service.IDgProcessManageVisualService; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.daqing.framework.domain.guarantee.DgProcessManageVisual; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* <p> |
||||
* 流程管理可见表 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-01-15 |
||||
*/ |
||||
@Service |
||||
public class DgProcessManageVisualServiceImpl extends ServiceImpl<DgProcessManageVisualMapper, DgProcessManageVisual> implements IDgProcessManageVisualService { |
||||
|
||||
} |
@ -0,0 +1,25 @@ |
||||
<?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.daqing.financial.guarantee.mapper.DgProcessManageMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgProcessManage"> |
||||
<id column="id" property="id" /> |
||||
<result column="icon_img" property="iconImg" /> |
||||
<result column="model_id" property="modelId" /> |
||||
<result column="approval_name" property="approvalName" /> |
||||
<result column="update_time" property="updateTime" /> |
||||
<result column="create_time" property="createTime" /> |
||||
</resultMap> |
||||
|
||||
<select id="processManageList" parameterType="int" resultMap="BaseResultMap"> |
||||
SELECT pm.* FROM dg_process_manage pm |
||||
LEFT JOIN dg_process_manage_visual mv ON mv.process_manage_id=pm.id |
||||
<where> |
||||
<if test="usrId != null and usrId != ''"> |
||||
mv.user_id = #{usrId} |
||||
</if> |
||||
</where> |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,30 @@ |
||||
<?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.daqing.financial.guarantee.mapper.DgProcessManageVisualMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgProcessManageVisual"> |
||||
<id column="id" property="id" /> |
||||
<result column="process_manage_id" property="processManageId" /> |
||||
<result column="user_id" property="userId" /> |
||||
</resultMap> |
||||
|
||||
<select id="processVisualList" parameterType="int" resultType="int"> |
||||
select user_id from dg_process_manage_visual |
||||
<where> |
||||
<if test="id != null"> |
||||
process_manage_id = #{id} |
||||
</if> |
||||
</where> |
||||
</select> |
||||
|
||||
<insert id="insertUserVisual"> |
||||
INSERT INTO dg_process_manage_visual |
||||
(process_manage_id,user_id) |
||||
VALUES |
||||
<foreach collection="list" item="item" separator=","> |
||||
(#{item.processManageId},#{item.userId}) |
||||
</foreach> |
||||
</insert> |
||||
|
||||
</mapper> |
@ -0,0 +1,57 @@ |
||||
package com.daqing.framework.domain.guarantee; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* <p> |
||||
* 流程管理表 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-01-15 |
||||
*/ |
||||
@Data |
||||
@TableName("dg_process_manage") |
||||
public class DgProcessManage implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键id |
||||
*/ |
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private Integer id; |
||||
|
||||
/** |
||||
* 图标 |
||||
*/ |
||||
private String iconImg; |
||||
|
||||
/** |
||||
* 业务管理模块id |
||||
*/ |
||||
private Integer modelId; |
||||
|
||||
/** |
||||
* 审批名称 |
||||
*/ |
||||
private String approvalName; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
} |
@ -0,0 +1,39 @@ |
||||
package com.daqing.framework.domain.guarantee; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* <p> |
||||
* 流程管理可见表 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-01-15 |
||||
*/ |
||||
@Data |
||||
@TableName("dg_process_manage_visual") |
||||
public class DgProcessManageVisual implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键id |
||||
*/ |
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private Integer id; |
||||
|
||||
/** |
||||
* 流程管理id |
||||
*/ |
||||
private Integer processManageId; |
||||
|
||||
/** |
||||
* 可见人id |
||||
*/ |
||||
private Integer userId; |
||||
} |
Loading…
Reference in new issue