From a7c0dac0284663184d19806730380e3c5198db14 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期五, 01 三月 2024 10:39:54 +0800 Subject: [PATCH] 文档 --- document/一、二、三期合同考核要求.xlsx | 0 ycl-server/src/main/resources/application-dev.yml | 6 +-- document/故障类型.xlsx | 0 ycl-server/src/main/java/com/ycl/system/controller/SysProfileController.java | 53 +++++++++++++------------- ycl-server/src/main/java/com/ycl/system/service/impl/SysUserServiceImpl.java | 2 document/一机一档.xls | 0 document/副本1020自贡市局运维考核平台.xlsx | 0 document/2023年公安科信工作市(州)绩效评估细则及解释(2023.4.13).docx | 0 document/摄像机.xlsx | 0 document/自贡市局运维考核平台需求文档.docx | 0 document/自贡天网运行维护方案.docx | 0 ycl-server/src/main/resources/mapper/system/SysUserMapper.xml | 4 + ycl-pojo/src/main/java/com/ycl/system/entity/SysUser.java | 11 +++++ 13 files changed, 44 insertions(+), 32 deletions(-) diff --git "a/document/2023\345\271\264\345\205\254\345\256\211\347\247\221\344\277\241\345\267\245\344\275\234\345\270\202\357\274\210\345\267\236\357\274\211\347\273\251\346\225\210\350\257\204\344\274\260\347\273\206\345\210\231\345\217\212\350\247\243\351\207\212\357\274\2102023.4.13\357\274\211.docx" "b/document/2023\345\271\264\345\205\254\345\256\211\347\247\221\344\277\241\345\267\245\344\275\234\345\270\202\357\274\210\345\267\236\357\274\211\347\273\251\346\225\210\350\257\204\344\274\260\347\273\206\345\210\231\345\217\212\350\247\243\351\207\212\357\274\2102023.4.13\357\274\211.docx" new file mode 100644 index 0000000..f22f546 --- /dev/null +++ "b/document/2023\345\271\264\345\205\254\345\256\211\347\247\221\344\277\241\345\267\245\344\275\234\345\270\202\357\274\210\345\267\236\357\274\211\347\273\251\346\225\210\350\257\204\344\274\260\347\273\206\345\210\231\345\217\212\350\247\243\351\207\212\357\274\2102023.4.13\357\274\211.docx" Binary files differ diff --git "a/document/\344\270\200\343\200\201\344\272\214\343\200\201\344\270\211\346\234\237\345\220\210\345\220\214\350\200\203\346\240\270\350\246\201\346\261\202.xlsx" "b/document/\344\270\200\343\200\201\344\272\214\343\200\201\344\270\211\346\234\237\345\220\210\345\220\214\350\200\203\346\240\270\350\246\201\346\261\202.xlsx" new file mode 100644 index 0000000..6707da7 --- /dev/null +++ "b/document/\344\270\200\343\200\201\344\272\214\343\200\201\344\270\211\346\234\237\345\220\210\345\220\214\350\200\203\346\240\270\350\246\201\346\261\202.xlsx" Binary files differ diff --git "a/document/\344\270\200\346\234\272\344\270\200\346\241\243.xls" "b/document/\344\270\200\346\234\272\344\270\200\346\241\243.xls" new file mode 100644 index 0000000..d858975 --- /dev/null +++ "b/document/\344\270\200\346\234\272\344\270\200\346\241\243.xls" Binary files differ diff --git "a/document/\345\211\257\346\234\2541020\350\207\252\350\264\241\345\270\202\345\261\200\350\277\220\347\273\264\350\200\203\346\240\270\345\271\263\345\217\260.xlsx" "b/document/\345\211\257\346\234\2541020\350\207\252\350\264\241\345\270\202\345\261\200\350\277\220\347\273\264\350\200\203\346\240\270\345\271\263\345\217\260.xlsx" index dfe6322..e8edd0a 100644 --- "a/document/\345\211\257\346\234\2541020\350\207\252\350\264\241\345\270\202\345\261\200\350\277\220\347\273\264\350\200\203\346\240\270\345\271\263\345\217\260.xlsx" +++ "b/document/\345\211\257\346\234\2541020\350\207\252\350\264\241\345\270\202\345\261\200\350\277\220\347\273\264\350\200\203\346\240\270\345\271\263\345\217\260.xlsx" Binary files differ diff --git "a/document/\346\221\204\345\203\217\346\234\272.xlsx" "b/document/\346\221\204\345\203\217\346\234\272.xlsx" new file mode 100644 index 0000000..8083d6b --- /dev/null +++ "b/document/\346\221\204\345\203\217\346\234\272.xlsx" Binary files differ diff --git "a/document/\346\225\205\351\232\234\347\261\273\345\236\213.xlsx" "b/document/\346\225\205\351\232\234\347\261\273\345\236\213.xlsx" new file mode 100644 index 0000000..67a7718 --- /dev/null +++ "b/document/\346\225\205\351\232\234\347\261\273\345\236\213.xlsx" Binary files differ diff --git "a/document/\350\207\252\350\264\241\345\244\251\347\275\221\350\277\220\350\241\214\347\273\264\346\212\244\346\226\271\346\241\210.docx" "b/document/\350\207\252\350\264\241\345\244\251\347\275\221\350\277\220\350\241\214\347\273\264\346\212\244\346\226\271\346\241\210.docx" new file mode 100644 index 0000000..cda9f4c --- /dev/null +++ "b/document/\350\207\252\350\264\241\345\244\251\347\275\221\350\277\220\350\241\214\347\273\264\346\212\244\346\226\271\346\241\210.docx" Binary files differ diff --git "a/document/\350\207\252\350\264\241\345\270\202\345\261\200\350\277\220\347\273\264\350\200\203\346\240\270\345\271\263\345\217\260\351\234\200\346\261\202\346\226\207\346\241\243.docx" "b/document/\350\207\252\350\264\241\345\270\202\345\261\200\350\277\220\347\273\264\350\200\203\346\240\270\345\271\263\345\217\260\351\234\200\346\261\202\346\226\207\346\241\243.docx" new file mode 100644 index 0000000..1b4da26 --- /dev/null +++ "b/document/\350\207\252\350\264\241\345\270\202\345\261\200\350\277\220\347\273\264\350\200\203\346\240\270\345\271\263\345\217\260\351\234\200\346\261\202\346\226\207\346\241\243.docx" Binary files differ diff --git a/ycl-pojo/src/main/java/com/ycl/system/entity/SysUser.java b/ycl-pojo/src/main/java/com/ycl/system/entity/SysUser.java index 90a6718..97f0258 100644 --- a/ycl-pojo/src/main/java/com/ycl/system/entity/SysUser.java +++ b/ycl-pojo/src/main/java/com/ycl/system/entity/SysUser.java @@ -58,6 +58,8 @@ /** 鏈�鍚庣櫥褰曟椂闂� */ private Date loginDate; + /** 鏄惁涓虹涓�娆$櫥褰� 0涓虹涓�娆$櫥褰曢渶瑕佷慨鏀瑰瘑鐮� */ + private Short firstLogin; /** 閮ㄩ棬瀵硅薄 */ private SysDept dept; @@ -76,6 +78,14 @@ public SysUser() { + } + + public Short getFirstLogin() { + return firstLogin; + } + + public void setFirstLogin(Short firstLogin) { + this.firstLogin = firstLogin; } public SysUser(Long userId) @@ -303,6 +313,7 @@ .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .append("dept", getDept()) + .append("firstLogin",getFirstLogin()) .toString(); } } diff --git a/ycl-server/src/main/java/com/ycl/system/controller/SysProfileController.java b/ycl-server/src/main/java/com/ycl/system/controller/SysProfileController.java index 9114491..588c7bb 100644 --- a/ycl-server/src/main/java/com/ycl/system/controller/SysProfileController.java +++ b/ycl-server/src/main/java/com/ycl/system/controller/SysProfileController.java @@ -4,6 +4,7 @@ import com.ycl.config.PlatformConfig; import com.ycl.system.AjaxResult; import com.ycl.system.entity.SysUser; +import com.ycl.system.mapper.SysUserMapper; import com.ycl.system.model.LoginUser; import com.ycl.system.service.ISysUserService; import com.ycl.system.service.TokenService; @@ -12,30 +13,33 @@ import com.ycl.utils.file.MimeTypeUtils; import enumeration.BusinessType; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import utils.StringUtils; /** * 涓汉淇℃伅 涓氬姟澶勭悊 - * + * * @author ruoyi */ @RestController @RequestMapping("/system/user/profile") -public class SysProfileController extends BaseController{ +public class SysProfileController extends BaseController { @Autowired private ISysUserService userService; @Autowired private TokenService tokenService; + @Autowired + private SysUserMapper userMapper; + /** * 涓汉淇℃伅 */ @GetMapping - public AjaxResult profile() - { + public AjaxResult profile() { LoginUser loginUser = getLoginUser(); SysUser user = loginUser.getUser(); AjaxResult ajax = AjaxResult.success(user); @@ -49,24 +53,20 @@ */ @Log(title = "涓汉淇℃伅", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult updateProfile(@RequestBody SysUser user) - { + public AjaxResult updateProfile(@RequestBody SysUser user) { LoginUser loginUser = getLoginUser(); SysUser currentUser = loginUser.getUser(); currentUser.setNickName(user.getNickName()); currentUser.setEmail(user.getEmail()); currentUser.setPhonenumber(user.getPhonenumber()); currentUser.setSex(user.getSex()); - if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) - { + if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) { return error("淇敼鐢ㄦ埛'" + loginUser.getUsername() + "'澶辫触锛屾墜鏈哄彿鐮佸凡瀛樺湪"); } - if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) - { + if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) { return error("淇敼鐢ㄦ埛'" + loginUser.getUsername() + "'澶辫触锛岄偖绠辫处鍙峰凡瀛樺湪"); } - if (userService.updateUserProfile(currentUser) > 0) - { + if (userService.updateUserProfile(currentUser) > 0) { // 鏇存柊缂撳瓨鐢ㄦ埛淇℃伅 tokenService.setLoginUser(loginUser); return success(); @@ -79,26 +79,30 @@ */ @Log(title = "涓汉淇℃伅", businessType = BusinessType.UPDATE) @PutMapping("/updatePwd") - public AjaxResult updatePwd(String oldPassword, String newPassword) - { + @Transactional(rollbackFor = Exception.class) + public AjaxResult updatePwd(String oldPassword, String newPassword, Short firstLogin) { LoginUser loginUser = getLoginUser(); String userName = loginUser.getUsername(); String password = loginUser.getPassword(); - if (!SecurityUtils.matchesPassword(oldPassword, password)) - { + if (firstLogin != 0 && !SecurityUtils.matchesPassword(oldPassword, password)) { return error("淇敼瀵嗙爜澶辫触锛屾棫瀵嗙爜閿欒"); } - if (SecurityUtils.matchesPassword(newPassword, password)) - { + if (SecurityUtils.matchesPassword(newPassword, password)) { return error("鏂板瘑鐮佷笉鑳戒笌鏃у瘑鐮佺浉鍚�"); } newPassword = SecurityUtils.encryptPassword(newPassword); - if (userService.resetUserPwd(userName, newPassword) > 0) - { + if (userService.resetUserPwd(userName, newPassword) > 0) { // 鏇存柊缂撳瓨鐢ㄦ埛瀵嗙爜 loginUser.getUser().setPassword(newPassword); tokenService.setLoginUser(loginUser); return success(); + } + //灏嗙姸鎬佹敼涓哄凡淇敼杩囧瘑鐮� + if (firstLogin == 0) { + SysUser user = new SysUser(); + user.setUserId(loginUser.getUserId()); + user.setFirstLogin((short) 1); + userMapper.updateUser(user); } return error("淇敼瀵嗙爜寮傚父锛岃鑱旂郴绠$悊鍛�"); } @@ -108,14 +112,11 @@ */ @Log(title = "鐢ㄦ埛澶村儚", businessType = BusinessType.UPDATE) @PostMapping("/avatar") - public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception - { - if (!file.isEmpty()) - { + public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception { + if (!file.isEmpty()) { LoginUser loginUser = getLoginUser(); String avatar = FileUploadUtils.upload(PlatformConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION); - if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) - { + if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) { AjaxResult ajax = AjaxResult.success(); ajax.put("imgUrl", avatar); // 鏇存柊缂撳瓨鐢ㄦ埛澶村儚 diff --git a/ycl-server/src/main/java/com/ycl/system/service/impl/SysUserServiceImpl.java b/ycl-server/src/main/java/com/ycl/system/service/impl/SysUserServiceImpl.java index 5ed1c8b..c0b41ae 100644 --- a/ycl-server/src/main/java/com/ycl/system/service/impl/SysUserServiceImpl.java +++ b/ycl-server/src/main/java/com/ycl/system/service/impl/SysUserServiceImpl.java @@ -53,7 +53,7 @@ @Autowired private ISysConfigService configService; - //TODO:鏃犳硶娉ㄥ叆 + @Autowired protected Validator validator; diff --git a/ycl-server/src/main/resources/application-dev.yml b/ycl-server/src/main/resources/application-dev.yml index 5e12c6f..e41423c 100644 --- a/ycl-server/src/main/resources/application-dev.yml +++ b/ycl-server/src/main/resources/application-dev.yml @@ -60,14 +60,12 @@ spring.data: redis: # 鍦板潃 - host: 162.14.79.111 + host: localhost # 绔彛锛岄粯璁や负6379 port: 6379 - password: 234#Wersdf! + password: 123456 # 鏁版嵁搴撶储寮� database: 0 - # 瀵嗙爜(濡傛病鏈夊瘑鐮佽娉ㄩ噴鎺�) - # password: # 杩炴帴瓒呮椂鏃堕棿 timeout: 10s # 鏄惁寮�鍚痵sl diff --git a/ycl-server/src/main/resources/mapper/system/SysUserMapper.xml b/ycl-server/src/main/resources/mapper/system/SysUserMapper.xml index e7eb00a..2991de9 100644 --- a/ycl-server/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ycl-server/src/main/resources/mapper/system/SysUserMapper.xml @@ -23,6 +23,7 @@ <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> <result property="remark" column="remark" /> + <result property="firstLogin" column="first_login" /> <association property="dept" javaType="com.ycl.system.entity.SysDept" resultMap="deptResult" /> <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> </resultMap> @@ -47,7 +48,7 @@ </resultMap> <sql id="selectUserVo"> - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, + select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.first_login, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u @@ -190,6 +191,7 @@ <if test="loginDate != null">login_date = #{loginDate},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="remark != null">remark = #{remark},</if> + <if test="firstLogin !=null ">first_login = #{firstLogin}</if> update_time = sysdate() </set> where user_id = #{userId} -- Gitblit v1.8.0