Commit bbacb6f6 authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/MVP1.7.7' into MVP1.7.7

parents ce3fa591 93d7e957
...@@ -435,4 +435,12 @@ public class TEmployeeProject extends BaseEntity { ...@@ -435,4 +435,12 @@ public class TEmployeeProject extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String empDeptid; private String empDeptid;
@Schema(description = "操作的用户id")
@TableField(exist = false)
private String operationUserId;
@Schema(description = "操作的用户Name")
@TableField(exist = false)
private String operationUserName;
} }
...@@ -49,4 +49,10 @@ public class TEmployeeProjectBelongDeptSearchCspVo { ...@@ -49,4 +49,10 @@ public class TEmployeeProjectBelongDeptSearchCspVo {
@Schema(description = "项目档案创建与离职人") @Schema(description = "项目档案创建与离职人")
private String empCreateAndLeaveUser; private String empCreateAndLeaveUser;
@Schema(description = "登录人Id")
private String userId;
// 项目档案入离职日期,与日志确认接收时间比较
@Schema(description = "登录人姓名")
private String userName;
} }
...@@ -2580,6 +2580,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -2580,6 +2580,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(p)) { if (Common.isNotNull(p)) {
p.setStatus(CommonConstants.ONE_INT); p.setStatus(CommonConstants.ONE_INT);
p.setOperationUserId(vo.getCreateBy());
p.setOperationUserName(vo.getCreateName());
// hgw加所属部门逻辑: // hgw加所属部门逻辑:
tEmployeeProjectService.doSaveBelongDept(p, CommonConstants.ONE_STRING); tEmployeeProjectService.doSaveBelongDept(p, CommonConstants.ONE_STRING);
} }
......
...@@ -2084,6 +2084,17 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -2084,6 +2084,17 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
searchCspVo.setDeptId(p.getDeptId()); searchCspVo.setDeptId(p.getDeptId());
searchCspVo.setEmpIdCard(p.getEmpIdcard()); searchCspVo.setEmpIdCard(p.getEmpIdcard());
searchCspVo.setFeedbackType(feedbackType); searchCspVo.setFeedbackType(feedbackType);
YifuUser user = SecurityUtils.getUser();
if (user != null && Common.isNotNull(user.getNickname())) {
searchCspVo.setUserId(p.getOperationUserId());
searchCspVo.setUserName(p.getOperationUserName());
} else if (Common.isNotNull(p.getOperationUserId())) {
searchCspVo.setUserId(p.getOperationUserId());
searchCspVo.setUserName(p.getOperationUserName());
} else {
searchCspVo.setUserId(p.getCreateBy());
searchCspVo.setUserName(p.getCreateName());
}
if (CommonConstants.ONE_STRING.equals(feedbackType)) { if (CommonConstants.ONE_STRING.equals(feedbackType)) {
searchCspVo.setEmpCreateAndLeaveTime(p.getCreateTime()); searchCspVo.setEmpCreateAndLeaveTime(p.getCreateTime());
searchCspVo.setEmpCreateAndLeaveUser(p.getCreateName()); searchCspVo.setEmpCreateAndLeaveUser(p.getCreateName());
......
...@@ -22,12 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -22,12 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.csp.entity.TOperationLog; import com.yifu.cloud.plus.v1.csp.entity.TOperationLog;
import com.yifu.cloud.plus.v1.csp.service.TOperationLogService; import com.yifu.cloud.plus.v1.csp.service.TOperationLogService;
import com.yifu.cloud.plus.v1.csp.vo.TOperationLogSearchVo; import com.yifu.cloud.plus.v1.csp.vo.TOperationLogSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchCspVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
......
...@@ -521,10 +521,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -521,10 +521,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
* @return: boolean * @return: boolean
**/ **/
private boolean doSaveLogBatch(TEmployeeProjectBelongDeptSearchCspVo searchCspVo, List<TEmployeeProjectBelongDept> belongDeptList) { private boolean doSaveLogBatch(TEmployeeProjectBelongDeptSearchCspVo searchCspVo, List<TEmployeeProjectBelongDept> belongDeptList) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return true;
}
TOperationLog log; TOperationLog log;
List<TOperationLog> logList = new ArrayList<>(); List<TOperationLog> logList = new ArrayList<>();
String title = "已处理"; String title = "已处理";
...@@ -543,8 +539,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -543,8 +539,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
log.setRemark("离职登记前已减员"); log.setRemark("离职登记前已减员");
} }
} }
log.setCreateBy(user.getId()); log.setCreateBy(searchCspVo.getUserId());
log.setCreateName(user.getNickname()); log.setCreateName(searchCspVo.getUserName());
log.setCreateTime(LocalDateTime.now()); log.setCreateTime(LocalDateTime.now());
logList.add(log); logList.add(log);
} }
......
...@@ -67,7 +67,7 @@ public class TOperationLogServiceImpl extends ServiceImpl<TOperationLogMapper, T ...@@ -67,7 +67,7 @@ public class TOperationLogServiceImpl extends ServiceImpl<TOperationLogMapper, T
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) { if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd()); wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
} }
wrapper.orderByDesc(TOperationLog::getCreateTime); wrapper.orderByAsc(TOperationLog::getCreateTime);
return baseMapper.selectList(wrapper); return baseMapper.selectList(wrapper);
} }
......
...@@ -38,3 +38,9 @@ security: ...@@ -38,3 +38,9 @@ security:
- /v3/api-docs - /v3/api-docs
- /actuator/** - /actuator/**
- /swagger-ui/** - /swagger-ui/**
wx:
corpid: wwbcb090af0dfe50e5
corpsecret: 16kqEL_eU-ARwYyqLgEBWHgxm8gXVnkzv_eJMLy9NpU
agentid: 1000010
authUrl: https://test-wx.worfu.com/yifu-auth/method/oauth/wxLogin
domainName: https://test-wx.worfu.com
\ No newline at end of file
...@@ -265,13 +265,16 @@ ...@@ -265,13 +265,16 @@
</select> </select>
<!-- 将数据处理为已处理 --> <!-- 将数据处理为已处理 -->
<select id="updateTwoRegistrationByIdCard" resultType="java.lang.Integer"> <update id="updateTwoRegistrationByIdCard">
update employee_registration a update employee_registration a
set a.process_status= '2' set a.process_status= '2'
where a.emp_idcard = #{searchCspVo.empIdCard} and a.process_status= '0' where a.emp_idcard = #{searchCspVo.empIdCard} and a.process_status= '0'
<if test="searchCspVo.deptId != null and searchCspVo.deptId.trim() != ''">
AND a.dept_id = #{searchCspVo.deptId}
</if>
<if test="searchCspVo.feedbackType != null and searchCspVo.feedbackType.trim() != ''"> <if test="searchCspVo.feedbackType != null and searchCspVo.feedbackType.trim() != ''">
AND a.feedback_type = #{searchCspVo.feedbackType} AND a.feedback_type = #{searchCspVo.feedbackType}
</if> </if>
</select> </update>
</mapper> </mapper>
...@@ -311,4 +311,18 @@ public class DeptController { ...@@ -311,4 +311,18 @@ public class DeptController {
return sysDeptService.cspUpdateDept(dept); return sysDeptService.cspUpdateDept(dept);
} }
/**
* 客户服务平台——获取项目下已删除的部门
* @return R<String> 删除部门的ID集合
* @author chenyuxi
* @since 1.9.7
*/
@GetMapping(value = "/csp/getDelDeptIds")
public R<String> cspDelDeptIds(SysDeptVo dept) {
if(Common.isEmpty(dept.getProjectNo())){
return R.failed("项目编码不能为空");
}
return R.ok(sysDeptService.cspDelDeptIds(dept.getProjectNo()));
}
} }
...@@ -97,4 +97,8 @@ public interface SysDeptMapper extends BaseMapper<SysDept> { ...@@ -97,4 +97,8 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
void batchUpdateSort(@Param("moveVos")List<DeptSortVo> moveVos); void batchUpdateSort(@Param("moveVos")List<DeptSortVo> moveVos);
List<SysDept> cspDelDeptIds(@Param("projectNo") String projectNo);
} }
...@@ -105,4 +105,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> { ...@@ -105,4 +105,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
@Param("projectNo")String projectNo); @Param("projectNo")String projectNo);
List<String> getCspUserByDeptId(@Param("deptId")String deptId); List<String> getCspUserByDeptId(@Param("deptId")String deptId);
List<String> getCspUserByProjectNo(@Param("projectNo")String projectNo);
} }
...@@ -144,4 +144,12 @@ public interface SysDeptService extends IService<SysDept> { ...@@ -144,4 +144,12 @@ public interface SysDeptService extends IService<SysDept> {
R<Boolean> cspUpdateDept(SysDeptMoveVo dept); R<Boolean> cspUpdateDept(SysDeptMoveVo dept);
/**
* 客户服务平台——获取项目下已删除的部门
* @return R<String> 删除部门的ID集合
* @author chenyuxi
* @since 1.9.7
*/
String cspDelDeptIds(String projectNo);
} }
...@@ -511,6 +511,14 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl ...@@ -511,6 +511,14 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
} }
dept.setClient(ClientNameConstants.CLIENT_CSP); dept.setClient(ClientNameConstants.CLIENT_CSP);
this.save(dept); this.save(dept);
// 清理用户权限,重新获取项目下的用户的部门权限
List<String> userNames = sysUserMapper.getCspUserByProjectNo(dept.getProjectNo());
if (Common.isNotNull(userNames)){
for (String us:userNames){
redisUtil.remove(CacheConstants.USER_DETAILS +"::"+ us);
}
}
return R.ok("创建成功"); return R.ok("创建成功");
} }
...@@ -557,6 +565,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl ...@@ -557,6 +565,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
return R.failed("部门下仍然有员工,请调出所有员工后,删除部门"); return R.failed("部门下仍然有员工,请调出所有员工后,删除部门");
} }
this.removeById(deptId); this.removeById(deptId);
// 清理用户权限,重新获取用户的部门权限
List<String> userNames = sysUserMapper.getCspUserByDeptId(deptId.toString());
if (Common.isNotNull(userNames)){
for (String us:userNames){
redisUtil.remove(CacheConstants.USER_DETAILS +"::"+ us);
}
}
return R.ok("删除成功"); return R.ok("删除成功");
} }
...@@ -616,4 +631,27 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl ...@@ -616,4 +631,27 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
} }
return R.ok(); return R.ok();
} }
/**
* 客户服务平台——获取项目下已删除的部门
*
* @param projectNo
* @return R<String> 删除部门的ID集合
* @author chenyuxi
* @since 1.9.7
*/
@Override
public String cspDelDeptIds(String projectNo) {
String delDeptIds = "";
List<SysDept> deptList = baseMapper.cspDelDeptIds(projectNo);
if(Common.isNotNull(deptList)){
for(SysDept dept : deptList){
delDeptIds = delDeptIds.concat(",").concat(dept.getDeptId().toString());
}
}
if(delDeptIds.length()>0){
delDeptIds = delDeptIds.substring(1);
}
return delDeptIds;
}
} }
...@@ -155,4 +155,8 @@ ...@@ -155,4 +155,8 @@
</foreach> </foreach>
</update> </update>
<select id="cspDelDeptIds" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept">
select dept_id from sys_dept where del_flag = '1' AND project_no = #{projectNo}
</select>
</mapper> </mapper>
...@@ -446,6 +446,14 @@ ...@@ -446,6 +446,14 @@
where a.user_id in ( where a.user_id in (
select c.user_id from sys_user_dept_permission c select c.user_id from sys_user_dept_permission c
where c.project_no in (SELECT project_no from sys_user_dept_permission where dept_id=#{deptId}) where c.project_no in (SELECT project_no from sys_user_dept_permission where dept_id=#{deptId})
) ) and a.del_flag='0'
</select>
<select id="getCspUserByProjectNo" resultType="java.lang.String">
SELECT a.username from sys_user a
where a.user_id in (
select c.user_id from sys_user_dept_permission c
where c.project_no in (#{projectNo})
) and a.del_flag='0'
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment