流程管理模板可见处理

master
shijie 4 years ago
parent 730a6a2b68
commit ad709c6a29
  1. 58
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessManageController.java
  2. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgProcessManageMapper.java
  3. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgProcessManageVisualMapper.java
  4. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgProcessManageService.java
  5. 34
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgProcessManageServiceImpl.java
  6. 4
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgProcessManageMapper.xml
  7. 7
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgProcessManageVisualMapper.xml
  8. 4
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java
  9. 12
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java
  10. 4
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java
  11. 28
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/feign/GuaranteeFeignService.java
  12. 21
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java
  13. 8
      dq-framework-common/src/main/java/com/daqing/framework/model/response/PromptSuccess.java
  14. 2
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/response/HrmsCode.java

@ -7,8 +7,11 @@ import com.daqing.financial.guarantee.service.IDgProcessManageService;
import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.guarantee.DgProcessManage;
import com.daqing.framework.domain.hrms.ext.EmployeeVO;
import com.daqing.framework.domain.hrms.response.HrmsCode;
import com.daqing.framework.enums.OperationType;
import com.daqing.framework.enums.OperationUnit;
import com.daqing.framework.exception.ExceptionCast;
import com.daqing.framework.model.response.CommonCode;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;
import io.swagger.annotations.Api;
@ -80,13 +83,14 @@ public class DgProcessManageController {
public ResponseResult updateUserVisual(@RequestBody UpdateUserVisualReq updateUserVisualReq){
Integer id = updateUserVisualReq.getId();
List<Integer>ids = updateUserVisualReq.getIds();
Boolean a=false;
if(ids.size()>0){
//查询可见范围内的人可见列表
Boolean a= iDgProcessManageService.updateUserVisual(id,ids);
return new ResponseResult<PageUtils>().SUCCESS(a);
a= iDgProcessManageService.updateUserVisual(id,ids);
}else{
return new ResponseResult<PageUtils>().SUCCESS(true);
ExceptionCast.cast(HrmsCode.AT_LEAST_ONE);
}
return new ResponseResult<PageUtils>().SUCCESS(a);
}
/**
@ -106,4 +110,52 @@ public class DgProcessManageController {
}
/**
* 设置超管人员可以看到审批模板
* @param
* @return
*/
@Log(detail = "设置超管人员可以看到审批模板",level = 3,operationUnit = OperationUnit.PROCESSMANAGE,operationType = OperationType.UPDATE)
@PostMapping("/updateManagerVisual")
@ApiOperation(value = "设置超管人员可以看到审批模板")
@Transactional
public ResponseResult updateManagerVisual(Integer userId){
boolean a = iDgProcessManageService.queryAllModelId(userId);
return new ResponseResult<>().SUCCESS(a);
}
/**
* 根据指定用户删除可见审批模板
* @param
* @return
*/
@Log(detail = "根据指定用户删除可见审批模板",level = 3,operationUnit = OperationUnit.PROCESSMANAGE,operationType = OperationType.DELETE)
@PostMapping("/delUserVisual")
@ApiOperation(value = "根据指定用户删除可见审批模板")
@Transactional
public ResponseResult delUserVisual(Integer userId){
boolean a = iDgProcessManageService.delUserVisual(userId);
return new ResponseResult<>().SUCCESS(a);
}
/**
* 批量删除用户可见审批模板
* @param
* @return
*/
@Log(detail = "批量删除用户可见审批模板",level = 3,operationUnit = OperationUnit.PROCESSMANAGE,operationType = OperationType.DELETE)
@GetMapping("/delBatchUserVisual")
@ApiOperation(value = "批量删除用户可见审批模板")
@Transactional
public ResponseResult delBatchUserVisual(@RequestParam("userId") List<Integer> userId){
boolean a = iDgProcessManageService.delBatchUserVisual(userId);
return new ResponseResult<>().SUCCESS(a);
}
}

@ -23,4 +23,6 @@ public interface DgProcessManageMapper extends BaseMapper<DgProcessManage> {
List<DgProcessManage> processManageList(@Param("usrId") int usrId);
Boolean updateTimeByModelId(@Param("modelId") Integer modelId, @Param("date") Date date);
List<Integer> queryAllModelId();
}

@ -21,4 +21,6 @@ public interface DgProcessManageVisualMapper extends BaseMapper<DgProcessManageV
List<Integer> processVisualList(@Param("id") Integer id);
int insertUserVisual(@Param("list")List<DgProcessManageVisual> list);
int delBatchUserVisual(@Param("list")List<Integer> userId);
}

@ -28,4 +28,10 @@ public interface IDgProcessManageService extends IService<DgProcessManage> {
Boolean updateUserVisual(@Param("id") Integer id, @Param("ids") List<Integer> ids);
int updateProcessManage(@Param("processManageReq")ProcessManageRequest processManageReq);
Boolean queryAllModelId(Integer userId);
Boolean delUserVisual(Integer userId);
Boolean delBatchUserVisual(List<Integer> userId);
}

@ -5,15 +5,12 @@ import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.mapper.DgProcessManageMapper;
import com.daqing.financial.guarantee.mapper.DgProcessManageVisualMapper;
import com.daqing.financial.guarantee.model.request.ProcessManageRequest;
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 com.daqing.framework.domain.hrms.ext.EmployeeVO;
import com.daqing.framework.domain.hrms.ext.UserDeptVO;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.RedisUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -87,4 +84,35 @@ public class DgProcessManageServiceImpl extends ServiceImpl<DgProcessManageMappe
BeanUtils.copyProperties(processManageReq,dgProcessManage);
return this.baseMapper.updateById(dgProcessManage);
}
@Override
public Boolean queryAllModelId(Integer userId) {
//获取所有的审批模板id
List<Integer> list = this.baseMapper.queryAllModelId();
List<DgProcessManageVisual>visualList = new ArrayList();
for (Integer modelId:list) {
DgProcessManageVisual dgManageVisualPO = new DgProcessManageVisual();
dgManageVisualPO.setProcessManageId(modelId);
dgManageVisualPO.setUserId(userId);
visualList.add(dgManageVisualPO);
}
//添加用户可见审批模板
int a = dgProcessManageVisualMapper.insertUserVisual(visualList);
return a>0?true:false;
}
@Override
public Boolean delUserVisual(Integer userId) {
int count = dgProcessManageVisualMapper.delete(new QueryWrapper<DgProcessManageVisual>().eq("user_id", userId));
return count>0?true:false;
}
@Override
public Boolean delBatchUserVisual(List<Integer> userId) {
int count = dgProcessManageVisualMapper.delBatchUserVisual(userId);
return count>0?true:false;
}
}

@ -26,4 +26,8 @@
<update id="updateTimeByModelId">
UPDATE dg_process_manage SET update_time = #{date} WHERE model_id = #{modelId}
</update>
<select id="queryAllModelId" resultType="int">
SELECT id from dg_process_manage
</select>
</mapper>

@ -27,4 +27,11 @@
</foreach>
</insert>
<delete id="delBatchUserVisual">
delete from dg_process_manage_visual where user_id IN
<foreach collection="list" open="(" separator="," close=")" item="item">
#{item}
</foreach>
</delete>
</mapper>

@ -140,8 +140,8 @@ public class UserLoginController implements UserLoginControllerApi {
headerImg = URLDecoder.decode(imgUrl,encoder);
//account = new String(username.getBytes("GBK"),"iso-8859-1");
log.info("account==========="+account+"headerImg============="+headerImg);
// response.sendRedirect("https://test.feifanhitech.com/dq/index.html#/login?token="+token+"&account="+account+"&headerImg="+headerImg);
response.sendRedirect("https://www.feifanhitech.com/index/#/login?token="+token+"&account="+account+"&headerImg="+headerImg);
response.sendRedirect("https://test.feifanhitech.com/dq/index.html#/login?token="+token+"&account="+account+"&headerImg="+headerImg);
// response.sendRedirect("https://www.feifanhitech.com/index/#/login?token="+token+"&account="+account+"&headerImg="+headerImg);
}
}else {
userService.weChatBinding(code,response,state);

@ -94,8 +94,8 @@ public class UserServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> imple
if(dbUser == null){//openId不存在,返回绑定手机号页面,须另写绑定手机号接口
log.info("dbUser为空,openId不存在,请先绑定手机号哦~~~");
try {
response.sendRedirect("https://www.feifanhitech.com/index/#/bind-phone?matched="+md5UnionId);
// response.sendRedirect("https://test.feifanhitech.com/dq/index.html#/bind-phone?matched="+md5UnionId);//跳转绑定手机号页面
// response.sendRedirect("https://www.feifanhitech.com/index/#/bind-phone?matched="+md5UnionId);
response.sendRedirect("https://test.feifanhitech.com/dq/index.html#/bind-phone?matched="+md5UnionId);//跳转绑定手机号页面
} catch (IOException e) {
e.printStackTrace();
}
@ -160,8 +160,8 @@ public class UserServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> imple
if (countWeChatId > 0){
try {
log.info("微信重复了,我走到了这里.............................");
// response.sendRedirect("https://test.feifanhitech.com/dq/index.html#/workbench-manpower?token="+token+"&message=1");
response.sendRedirect("https://www.feifanhitech.com/index/#/workbench-manpower?token="+token+"&message=1");
response.sendRedirect("https://test.feifanhitech.com/dq/index.html#/workbench-manpower?token="+token+"&message=1");
// response.sendRedirect("https://www.feifanhitech.com/index/#/workbench-manpower?token="+token+"&message=1");
} catch (IOException e) {
e.printStackTrace();
}
@ -171,8 +171,8 @@ public class UserServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> imple
if (result){
try {
log.info("转发成功---------------------------------------");
// response.sendRedirect("https://test.feifanhitech.com/dq/index.html#/workbench-manpower?token="+token);
response.sendRedirect("https://www.feifanhitech.com/index/#/workbench-manpower?token="+token);
response.sendRedirect("https://test.feifanhitech.com/dq/index.html#/workbench-manpower?token="+token);
// response.sendRedirect("https://www.feifanhitech.com/index/#/workbench-manpower?token="+token);
}catch (IOException e){
e.printStackTrace();
}

@ -329,7 +329,7 @@ public class EmployeeController implements EmployeeControllerApi {
* @return
*/
@GetMapping("/getUserIdByRoleId")
public List<EmployeeVO> getUserIdByRoleId() {
return employeeService.getUserIdByRoleId();
public ResponseResult getUserIdByRoleId() {
return ResponseResult.SUCCESS(employeeService.getUserIdByRoleId());
}
}

@ -0,0 +1,28 @@
package com.daqing.financial.hrms.feign;
import com.daqing.framework.model.response.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
/**
* 这是一个声明式的远程调用
*/
@FeignClient("dq-financial-guarantee")
public interface GuaranteeFeignService {
@PostMapping("/dg-process-manage/updateManagerVisual")
ResponseResult updateManagerVisual(@RequestBody Integer userId);
@PostMapping("/dg-process-manage/delUserVisual")
ResponseResult delUserVisual(@RequestBody Integer userId);
@PostMapping("/dg-process-manage/delBatchUserVisual")
ResponseResult delBatchUserVisual(@RequestBody List<Integer> userId);
}

@ -1,10 +1,12 @@
package com.daqing.financial.hrms.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.financial.hrms.dao.*;
import com.daqing.financial.hrms.feign.GuaranteeFeignService;
import com.daqing.financial.hrms.service.EmployeeService;
import com.daqing.framework.domain.crms.request.EmployeeDisableRequest;
import com.daqing.framework.domain.crms.response.CrmsCode;
@ -24,7 +26,6 @@ import com.daqing.framework.util.Md5Util;
import com.daqing.framework.utils.PageUtils;
import com.daqing.framework.utils.excel.ExcelUtil;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -55,6 +56,9 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity
@Autowired
private RoleDao roleDao;
@Autowired
private GuaranteeFeignService guaranteeFeignService;
/**
* 列表
*/
@ -88,6 +92,10 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity
ExceptionCast.cast(HrmsCode.EMPLOYEE_IS_NULL);
}
this.getBaseMapper().deleteRoleByUserId(user_ids);
List<Integer> userIds = JSONArray.parseArray(user_ids.toString(),Integer.class);
//删除员工信息的同时要删除审批流程可见信息
guaranteeFeignService.delBatchUserVisual(userIds);
return this.getBaseMapper().deleteByIds(user_ids);
}
@ -326,6 +334,13 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity
Boolean result4 = this.getBaseMapper().insertPosition(employeeInfoVO.getId(), employeeInfoVO.getPositionIds());
Boolean result5 = this.getBaseMapper().insertRole(userId, employeeInfoVO.getRoleIds());
//修改,则先要将该用户对应得审批模板都删除
guaranteeFeignService.delUserVisual(employeeInfoVO.getId().intValue());
//如果新增的角色包含超管,则要设置该用户可以看到审批模板
if(employeeInfoVO.getRoleIds().contains(1)){
ResponseResult result = guaranteeFeignService.updateManagerVisual(employeeInfoVO.getId().intValue());
}
return result1 && result2 && result3 && result4 && result5;
}
@ -393,6 +408,10 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity
return result3 && result4 && result5;
}
}
//如果新增的角色包含超管,则要设置该用户可以看到审批模板
if(employeeInfoVO.getRoleIds().contains(1)){
ResponseResult result = guaranteeFeignService.updateManagerVisual(employeeInfoVO.getId().intValue());
}
return false;
}

@ -32,15 +32,15 @@ public class PromptSuccess {
public static final String UPLOAD_FILE_PATH = "//usr//local//nginx//html//admin//headImg//"; // linux图片存放路径
// public static final String IMAGE_URL_PATH = "https://test.feifanhitech.com/headImg/"; // 数据库/预加载图片路径
public static final String IMAGE_URL_PATH = "https://www.feifanhitech.com/headImg/"; // 数据库/预加载图片路径
public static final String IMAGE_URL_PATH = "https://test.feifanhitech.com/headImg/"; // 数据库/预加载图片路径
// public static final String IMAGE_URL_PATH = "https://www.feifanhitech.com/headImg/"; // 数据库/预加载图片路径
public static final String[] LETTERS = {"A","B","C","D","E"}; // 员工姓名重复时自动加的字母,可再添加
public static final String STATUS_REFUSE = "拒绝";
// public static final String ENCLOSUREFILE_URL_PATH = "https://test.feifanhitech.com/enclosureFile/"; // 附件文件存放路径
public static final String ENCLOSUREFILE_URL_PATH = "https://www.feifanhitech.com/enclosureFile/"; // 附件文件存放路径
public static final String ENCLOSUREFILE_URL_PATH = "https://test.feifanhitech.com/enclosureFile/"; // 附件文件存放路径
// public static final String ENCLOSUREFILE_URL_PATH = "https://www.feifanhitech.com/enclosureFile/"; // 附件文件存放路径
public static final String FILE_URL_PATH = "//usr//local//nginx//html//admin//enclosureFile//"; // 附件文件存放路径

@ -82,6 +82,8 @@ public enum HrmsCode implements ResultCode {
TOKEN_EXCEPTION(false,401,"TOKEN已过期,请重新登录!"),
AT_LEAST_ONE(false,61001,"模板可见人员至少选择一项!"),
EMP_SAME(false, 51001, "A,B角不能选同一个人!"),
EMP_TO_BE_CHOOSE(false, 51002, "该用户已经被指派!");

Loading…
Cancel
Save