From ad709c6a29df83ab92b02c00a5a6c5693fe210b7 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Tue, 11 May 2021 11:16:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E7=AE=A1=E7=90=86=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=8F=AF=E8=A7=81=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DgProcessManageController.java | 58 ++++++++++++++++++- .../mapper/DgProcessManageMapper.java | 2 + .../mapper/DgProcessManageVisualMapper.java | 2 + .../service/IDgProcessManageService.java | 6 ++ .../impl/DgProcessManageServiceImpl.java | 34 ++++++++++- .../guarantee/DgProcessManageMapper.xml | 4 ++ .../guarantee/DgProcessManageVisualMapper.xml | 7 +++ .../controller/UserLoginController.java | 4 +- .../hrauth/service/impl/UserServiceImpl.java | 12 ++-- .../hrms/controller/EmployeeController.java | 4 +- .../hrms/feign/GuaranteeFeignService.java | 28 +++++++++ .../service/impl/EmployeeServiceImpl.java | 21 ++++++- .../model/response/PromptSuccess.java | 8 +-- .../domain/hrms/response/HrmsCode.java | 2 + 14 files changed, 171 insertions(+), 21 deletions(-) create mode 100644 dq-financial-hrms/src/main/java/com/daqing/financial/hrms/feign/GuaranteeFeignService.java diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessManageController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessManageController.java index 7cb83158..352ed84e 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessManageController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessManageController.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(); Listids = updateUserVisualReq.getIds(); + Boolean a=false; if(ids.size()>0){ //查询可见范围内的人可见列表 - Boolean a= iDgProcessManageService.updateUserVisual(id,ids); - return new ResponseResult().SUCCESS(a); + a= iDgProcessManageService.updateUserVisual(id,ids); }else{ - return new ResponseResult().SUCCESS(true); + ExceptionCast.cast(HrmsCode.AT_LEAST_ONE); } + return new ResponseResult().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 userId){ + + boolean a = iDgProcessManageService.delBatchUserVisual(userId); + + return new ResponseResult<>().SUCCESS(a); + } + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgProcessManageMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgProcessManageMapper.java index 1d5ca2d5..66398882 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgProcessManageMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgProcessManageMapper.java @@ -23,4 +23,6 @@ public interface DgProcessManageMapper extends BaseMapper { List processManageList(@Param("usrId") int usrId); Boolean updateTimeByModelId(@Param("modelId") Integer modelId, @Param("date") Date date); + + List queryAllModelId(); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgProcessManageVisualMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgProcessManageVisualMapper.java index 4155fdbe..ea1406ae 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgProcessManageVisualMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgProcessManageVisualMapper.java @@ -21,4 +21,6 @@ public interface DgProcessManageVisualMapper extends BaseMapper processVisualList(@Param("id") Integer id); int insertUserVisual(@Param("list")List list); + + int delBatchUserVisual(@Param("list")List userId); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgProcessManageService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgProcessManageService.java index b425a14e..02ff50a4 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgProcessManageService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgProcessManageService.java @@ -28,4 +28,10 @@ public interface IDgProcessManageService extends IService { Boolean updateUserVisual(@Param("id") Integer id, @Param("ids") List ids); int updateProcessManage(@Param("processManageReq")ProcessManageRequest processManageReq); + + Boolean queryAllModelId(Integer userId); + + Boolean delUserVisual(Integer userId); + + Boolean delBatchUserVisual(List userId); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgProcessManageServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgProcessManageServiceImpl.java index 30b6a549..c3f7f2b0 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgProcessManageServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgProcessManageServiceImpl.java @@ -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 list = this.baseMapper.queryAllModelId(); + + ListvisualList = 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().eq("user_id", userId)); + return count>0?true:false; + } + + @Override + public Boolean delBatchUserVisual(List userId) { + int count = dgProcessManageVisualMapper.delBatchUserVisual(userId); + return count>0?true:false; + } } diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgProcessManageMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgProcessManageMapper.xml index 34d9c75c..58401f8d 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgProcessManageMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgProcessManageMapper.xml @@ -26,4 +26,8 @@ UPDATE dg_process_manage SET update_time = #{date} WHERE model_id = #{modelId} + + diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgProcessManageVisualMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgProcessManageVisualMapper.xml index d6b2b3c1..e91fca89 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgProcessManageVisualMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgProcessManageVisualMapper.xml @@ -27,4 +27,11 @@ + + delete from dg_process_manage_visual where user_id IN + + #{item} + + + diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java index c7d2d7db..d4f5a179 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java @@ -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); diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java index 4ce2ac40..56b1475c 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java @@ -94,8 +94,8 @@ public class UserServiceImpl extends ServiceImpl 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 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 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(); } diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java index d0dfb71a..e7a4967d 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java @@ -329,7 +329,7 @@ public class EmployeeController implements EmployeeControllerApi { * @return */ @GetMapping("/getUserIdByRoleId") - public List getUserIdByRoleId() { - return employeeService.getUserIdByRoleId(); + public ResponseResult getUserIdByRoleId() { + return ResponseResult.SUCCESS(employeeService.getUserIdByRoleId()); } } diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/feign/GuaranteeFeignService.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/feign/GuaranteeFeignService.java new file mode 100644 index 00000000..64ed0a85 --- /dev/null +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/feign/GuaranteeFeignService.java @@ -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 userId); + +} diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java index 0be13d11..4b28a2f8 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java @@ -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 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