修改bug

This commit is contained in:
yangjun 2026-03-04 16:55:49 +08:00
parent 8663d3ca31
commit 370239bc0f
6 changed files with 63 additions and 20 deletions

View File

@ -316,10 +316,16 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
employeesApply.setApplyType("0"); employeesApply.setApplyType("0");
employeesApplyService.save(employeesApply); employeesApplyService.save(employeesApply);
//告诉管理平台 像员工-机构关系表nu_biz_employees_org 增加数据 //告诉管理平台 像员工-机构关系表nu_biz_employees_org 增加数据
EmployeesApplyMQDto mqdto = new EmployeesApplyMQDto(); EmployeesApplyMQDto mqdto = new EmployeesApplyMQDto();
BeanUtils.copyProperties(employeesApply, mqdto); BeanUtils.copyProperties(employeesApply, mqdto);
mqdto.setId(null);
mqdto.setOrgCode(orgCode); mqdto.setOrgCode(orgCode);
mqdto.setStatus("1");
mqdto.setDelFlag("0");
mqdto.setApplyType("0");
rabbitMQUtil.sendToExchange("hldy.employees", "hldy.employees.invide", mqdto); rabbitMQUtil.sendToExchange("hldy.employees", "hldy.employees.invide", mqdto);
return Result.OK("邀请成功!"); return Result.OK("邀请成功!");

View File

@ -53,7 +53,7 @@
</collection> </collection>
</resultMap> </resultMap>
<select id="pageList" resultMap="ConfigServiceDirectiveResultMap" parameterType="map"> <select id="pageList" resultType="com.nu.modules.config.servicedirective.entity.ConfigServiceDirective" parameterType="map">
SELECT SELECT
c.id, c.id,
c.category_id, c.category_id,
@ -100,13 +100,20 @@
and c.iz_enabled = #{directive.izEnabled} and c.iz_enabled = #{directive.izEnabled}
</if> </if>
<if test="directive !=null and directive.notId != null and directive.notId != ''"> <if test="directive !=null and directive.notId != null and directive.notId != ''">
c.id not IN <choose>
<foreach collection="directive.notId" item="item" open="(" separator="," close=")"> <when test='directive.notId.contains(",")'>
#{item.id} AND c.id NOT IN
</foreach> <foreach collection='directive.notId.split(",")' item="notId" open="(" separator="," close=")">
#{notId}
</foreach>
</when>
<otherwise>
AND c.id != #{directive.notId}
</otherwise>
</choose>
</if> </if>
</where> </where>
ORDER BY c.category_id ASC, c.type_id ASC, c.instruction_tag_id ASC,c.create_time desc ORDER BY c.category_id ASC, c.create_time desc
</select> </select>
<select id="queryDirectiveIdByBodyTagIds" <select id="queryDirectiveIdByBodyTagIds"

View File

@ -86,16 +86,16 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
} }
// configServiceDirective.setIzEnabled("Y"); // configServiceDirective.setIzEnabled("Y");
List<ConfigServiceDirective> list = baseMapper.pageList(configServiceDirective, list_.getRecords()); List<ConfigServiceDirective> list = baseMapper.pageList(configServiceDirective, list_.getRecords());
//处理服务标签字段 // //处理服务标签字段
if (list != null && !list.isEmpty()) { // if (list != null && !list.isEmpty()) {
list.stream().forEach(record -> { // list.stream().forEach(record -> {
List<DirectiveBodyTag> bodyTagList = record.getBodyTagList(); // List<DirectiveBodyTag> bodyTagList = record.getBodyTagList();
record.setBodyTags(bodyTagList.stream().map(DirectiveBodyTag::getId).collect(Collectors.joining(","))); // record.setBodyTags(bodyTagList.stream().map(DirectiveBodyTag::getId).collect(Collectors.joining(",")));
//
List<DirectiveEmotionTag> emotionTagList = record.getEmotionTagList(); // List<DirectiveEmotionTag> emotionTagList = record.getEmotionTagList();
record.setEmotionTags(emotionTagList.stream().map(DirectiveEmotionTag::getId).collect(Collectors.joining(","))); // record.setEmotionTags(emotionTagList.stream().map(DirectiveEmotionTag::getId).collect(Collectors.joining(",")));
}); // });
} // }
//处理单元格合并所需数据 //处理单元格合并所需数据
// merge(list); // merge(list);

View File

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nu.modules.IEmployeesInfoApi; import com.nu.modules.IEmployeesInfoApi;
import org.jeecg.common.constant.CacheConstant;
import org.jeecg.modules.system.entity.*; import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.model.DepartIdModel; import org.jeecg.modules.system.model.DepartIdModel;
import org.jeecg.modules.system.model.SysUserSysDepartModel; import org.jeecg.modules.system.model.SysUserSysDepartModel;
@ -41,8 +42,10 @@ import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
@ -635,9 +638,9 @@ public class SysUserController {
/** /**
* 首页用户重置密码 * 首页用户重置密码
*/ */
@RequiresPermissions("system:user:updatepwd")
@RequestMapping(value = "/updatePassword", method = RequestMethod.PUT) @RequestMapping(value = "/updatePassword", method = RequestMethod.PUT)
public Result<?> updatePassword(@RequestBody JSONObject json) { @CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)
public Result<?> updatePassword(@RequestBody JSONObject json,HttpServletRequest request) {
String username = json.getString("username"); String username = json.getString("username");
String oldpassword = json.getString("oldpassword"); String oldpassword = json.getString("oldpassword");
String password = json.getString("password"); String password = json.getString("password");
@ -653,10 +656,35 @@ public class SysUserController {
//update-begin---author:wangshuai ---date:20220316 for[VUEN-234]修改密码添加敏感日志------------ //update-begin---author:wangshuai ---date:20220316 for[VUEN-234]修改密码添加敏感日志------------
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
baseCommonService.addLog("修改密码username " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2); baseCommonService.addLog("修改密码username " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
Result<?> result = sysUserService.resetPassword(username,oldpassword,password,confirmpassword);
SysUser sysUser2 = sysUserService.getById(user.getId());
setUserInfo(request, sysUser2, result);
//update-end---author:wangshuai ---date:20220316 for[VUEN-234]修改密码添加敏感日志------------ //update-end---author:wangshuai ---date:20220316 for[VUEN-234]修改密码添加敏感日志------------
return sysUserService.resetPassword(username,oldpassword,password,confirmpassword); return result;
} }
@Nullable
private void setUserInfo(HttpServletRequest request, SysUser sysUser, Result<?> result) {
String username = sysUser.getUsername();
String syspassword = sysUser.getPassword();
// 获取用户部门信息
JSONObject obj = new JSONObject(new LinkedHashMap<>());
//1.生成token
String token = JwtUtil.sign(username, syspassword);
// 设置token缓存有效时间
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);
obj.put("token", token);
//3.设置登录用户信息
obj.put("userInfo", sysUser);
}
@RequestMapping(value = "/userRoleList", method = RequestMethod.GET) @RequestMapping(value = "/userRoleList", method = RequestMethod.GET)
public Result<IPage<SysUser>> userRoleList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, public Result<IPage<SysUser>> userRoleList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) {

View File

@ -171,6 +171,7 @@ public class SysUser implements Serializable {
* 员工id * 员工id
*/ */
private String employeesId; private String employeesId;
private String passwordType;
@Dict(dicCode = "login_type") @Dict(dicCode = "login_type")
private String loginType; private String loginType;

View File

@ -253,11 +253,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return Result.error("两次输入密码不一致!"); return Result.error("两次输入密码不一致!");
} }
String password = PasswordUtil.encrypt(username, newpassword, user.getSalt()); String password = PasswordUtil.encrypt(username, newpassword, user.getSalt());
this.userMapper.update(new SysUser().setPassword(password), new LambdaQueryWrapper<SysUser>().eq(SysUser::getId, user.getId())); this.userMapper.update(new SysUser().setPassword(password).setPasswordType("1"), new LambdaQueryWrapper<SysUser>().eq(SysUser::getId, user.getId()));
SysUserMQDto sysUserMQDto = new SysUserMQDto(); SysUserMQDto sysUserMQDto = new SysUserMQDto();
sysUserMQDto.setId(user.getId()); sysUserMQDto.setId(user.getId());
sysUserMQDto.setPassword(password); sysUserMQDto.setPassword(password);
rabbitMQUtil.sendToExchange("hldy.employees.rpw.fanout", "", sysUserMQDto); rabbitMQUtil.sendToExchange("hldy.employees.rpw.fanout", "", sysUserMQDto);
return Result.ok("密码重置成功!"); return Result.ok("密码重置成功!");
} }