From 5c66d75392ca26700347c006d5237bc6f078defe Mon Sep 17 00:00:00 2001 From: baozhipeng <961815525@qq.com> Date: Thu, 7 Apr 2022 12:24:14 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jero/modules/system/controller/LoginController.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java b/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java index aacee361..38c708f8 100644 --- a/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java +++ b/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java @@ -643,4 +643,12 @@ public class LoginController { //String string = redisUtil.get("_verification:_phone:" + phone).toString(); return Result.OK(); } + + @ApiOperation(value = "单点登录") + @PostMapping(value = "/singleSignON") + public Result singleSignON(@RequestParam(name="code") String code) { + Result result = new Result<>(); + return result; + } + } From 88782644ff6bb758ad872089c09ba5d93f6224fc Mon Sep 17 00:00:00 2001 From: baozhipeng <961815525@qq.com> Date: Thu, 7 Apr 2022 13:49:52 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/jero/config/shiro/ShiroConfig.java | 1 + .../system/controller/LoginController.java | 6 ++++-- .../modules/system/service/ISysUserService.java | 4 +++- .../system/service/impl/SysUserServiceImpl.java | 15 +++++++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java b/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java index 7529b32d..c38a7249 100644 --- a/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java +++ b/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java @@ -79,6 +79,7 @@ public class ShiroConfig { filterChainDefinitionMap.put("/sys/mLogin", "anon"); //登录接口排除 filterChainDefinitionMap.put("/sys/logout", "anon"); //登出接口排除 filterChainDefinitionMap.put("/sys/thirdLogin/**", "anon"); //第三方登录 + filterChainDefinitionMap.put("/sys/singleSignOn", "anon"); //单点登录 filterChainDefinitionMap.put("/sys/getEncryptedString", "anon"); //获取加密串 filterChainDefinitionMap.put("/sys/sms", "anon");//短信验证码 filterChainDefinitionMap.put("/sys/phoneLogin", "anon");//手机登录 diff --git a/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java b/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java index 38c708f8..38157e58 100644 --- a/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java +++ b/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java @@ -645,9 +645,11 @@ public class LoginController { } @ApiOperation(value = "单点登录") - @PostMapping(value = "/singleSignON") - public Result singleSignON(@RequestParam(name="code") String code) { + @PostMapping(value = "/singleSignOn") + public Result singleSignOn(@RequestParam(name="code") String code) { Result result = new Result<>(); + + sysUserService.singleSignOn(code); return result; } diff --git a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java index c27a6d1e..56be8466 100644 --- a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java +++ b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java @@ -20,6 +20,7 @@ import com.jero.modules.system.model.SysLoginVO; import com.jero.modules.system.model.SysUserSysDepartModel; import com.jero.modules.system.vo.SysUserVo; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestParam; /** *

@@ -263,6 +264,7 @@ public interface ISysUserService extends IService { */ PayContactsManagement getPayContactsManagementByPhone(String phone); - + //单点登录 + void singleSignOn(String code); } diff --git a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java index d9d7a3da..ca584c11 100644 --- a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java +++ b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java @@ -1,5 +1,6 @@ package com.jero.modules.system.service.impl; +import cn.hutool.http.HttpUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -73,6 +74,10 @@ public class SysUserServiceImpl extends ServiceImpl impl private RedisUtil redisUtil; @Value("${defaultPassword}") private String defaultPassword; + @Value("${singleSignON.client_id}") + private String client_id; + @Value("${singleSignON.client_id}") + private String client_secret; @Override @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true) @@ -620,6 +625,16 @@ public class SysUserServiceImpl extends ServiceImpl impl if(ObjectUtils.isEmpty(user.getVerifyPassword())){ throw new JeroBootException("确认密码为必填"); } + } + //单点登录 + public void singleSignOn(String code){ + HashMap paramMap = new HashMap<>(); + paramMap.put("client_id", client_id); + paramMap.put("client_secret", client_secret); + paramMap.put("code", 1); + paramMap.put("grant_type", "authorization_code"); + + String token= HttpUtil.post("https://idmtest.catarc.ac.cn/bam-protocol-service/oauth2/getToken", paramMap); } } From 4e42794bbe0588cfe1f8b8c55eea5dda3b7da43a Mon Sep 17 00:00:00 2001 From: baozhipeng <961815525@qq.com> Date: Thu, 7 Apr 2022 13:51:07 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jero-boot-single-startup/src/main/resources/application-dev.yml b/jero-boot-single-startup/src/main/resources/application-dev.yml index ba26fd20..bd1148a8 100644 --- a/jero-boot-single-startup/src/main/resources/application-dev.yml +++ b/jero-boot-single-startup/src/main/resources/application-dev.yml @@ -332,3 +332,8 @@ message: wxName: '小程序名称' # 消息模板替换,报名url openPage: http://localhost:3000/signUpEntrance?id + +#单点登录 +singleSignON: + client_id: cwp + client_secret: f9dfaeb910f247608f771e2418478 From eb8a176d3e67c9569d4168a27a05d153c3ba48b5 Mon Sep 17 00:00:00 2001 From: baozhipeng <961815525@qq.com> Date: Thu, 7 Apr 2022 16:19:51 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/LoginController.java | 54 +------ .../system/service/ISysUserService.java | 11 +- .../service/impl/SysUserServiceImpl.java | 136 ++++++++++++++++-- 3 files changed, 141 insertions(+), 60 deletions(-) diff --git a/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java b/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java index 38157e58..a9fefb8d 100644 --- a/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java +++ b/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/LoginController.java @@ -56,8 +56,6 @@ public class LoginController { private RedisUtil redisUtil; @Autowired private ISysDepartService sysDepartService; - @Autowired - private ISysDictService sysDictService; @Resource private BaseCommonService baseCommonService; @Resource @@ -160,7 +158,7 @@ public class LoginController { return result; } //用户登录信息 - userInfo(sysUser, result); + sysUserService.userInfo(sysUser, result); //update-begin--Author:wangshuai Date:20200714 for:登录日志没有记录人员 LoginUser loginUser = new LoginUser(); BeanUtils.copyProperties(sysUser, loginUser); @@ -413,7 +411,7 @@ public class LoginController { return result; } //用户信息 - userInfo(sysUser, result); + sysUserService.userInfo(sysUser, result); //添加日志 baseCommonService.addLog("账号: " + sysUser.getUsername() + ",登录成功!", CommonConstant.LOG_TYPE_1, null); @@ -421,50 +419,7 @@ public class LoginController { } - /** - * 用户信息 - * - * @param sysUser - * @param result - * @return - */ - private Result userInfo(SysUser sysUser, Result result) { - String syspassword = sysUser.getPassword(); - String username = sysUser.getUsername(); - // 生成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); - // 获取用户部门信息 - JSONObject obj = new JSONObject(); - List departs = sysDepartService.queryUserDeparts(sysUser.getId()); - obj.put("departs", departs); - if (departs == null || departs.size() == 0) { - obj.put("multi_depart", 0); - } else if (departs.size() == 1) { - sysUserService.updateUserDepart(username, departs.get(0).getOrgCode()); - obj.put("multi_depart", 1); - } else { - //查询当前是否有登录部门 - // update-begin--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去 - SysUser sysUserById = sysUserService.getById(sysUser.getId()); - if (oConvertUtils.isEmpty(sysUserById.getOrgCode())) { - sysUserService.updateUserDepart(username, departs.get(0).getOrgCode()); - } - // update-end--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去 - obj.put("multi_depart", 2); - } - sysUser.setPhone(PasswordUtil.decrypt(sysUser.getPhone())); - sysUser.setEmail(PasswordUtil.decrypt(sysUser.getEmail())); - obj.put("token", token); - obj.put("userInfo", sysUser); - obj.put("sysAllDictItems", sysDictService.queryAllDictItems()); - result.setResult(obj); - result.success("登录成功"); - return result; - } /** * 获取加密字符串 @@ -647,10 +602,7 @@ public class LoginController { @ApiOperation(value = "单点登录") @PostMapping(value = "/singleSignOn") public Result singleSignOn(@RequestParam(name="code") String code) { - Result result = new Result<>(); - - sysUserService.singleSignOn(code); - return result; + return sysUserService.singleSignOn(code); } } diff --git a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java index 56be8466..1b214713 100644 --- a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java +++ b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -265,6 +266,14 @@ public interface ISysUserService extends IService { PayContactsManagement getPayContactsManagementByPhone(String phone); //单点登录 - void singleSignOn(String code); + Result singleSignOn(String code); + /** + * 用户信息 + * + * @param sysUser + * @param result + * @return + */ + Result userInfo(SysUser sysUser, Result result); } diff --git a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java index ca584c11..7ad83b18 100644 --- a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java +++ b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java @@ -1,15 +1,19 @@ package com.jero.modules.system.service.impl; import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.jero.common.exception.JeroBootException; +import com.jero.common.system.util.JwtUtil; import com.jero.common.util.*; import com.jero.modules.pay.company.entity.PayContactsManagement; +import com.jero.modules.system.model.SysLoginModel; import com.jero.modules.system.model.SysLoginVO; +import com.jero.modules.system.service.*; import com.jero.modules.system.vo.SysUserVo; import lombok.extern.slf4j.Slf4j; import com.jero.common.api.vo.Result; @@ -22,7 +26,6 @@ import com.jero.common.system.vo.SysUserCacheInfo; import com.jero.modules.system.entity.*; import com.jero.modules.system.mapper.*; import com.jero.modules.system.model.SysUserSysDepartModel; -import com.jero.modules.system.service.ISysUserService; import com.jero.modules.system.vo.SysUserDepVo; import org.apache.commons.lang.StringUtils; import org.springframework.beans.BeanUtils; @@ -33,11 +36,14 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; +import org.springframework.web.bind.annotation.RequestBody; import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; +import static com.jero.modules.system.controller.LoginController.RETRY_LOGIN_PREFIX; + /** *

* 用户表 服务实现类 @@ -72,6 +78,14 @@ public class SysUserServiceImpl extends ServiceImpl impl private BaseCommonService baseCommonService; @Autowired private RedisUtil redisUtil; + @Autowired + private ISysDictService sysDictService; + @Autowired + private ISysDepartService sysDepartService; + @Resource + private ISysRoleService sysRoleService; + @Resource + private ISysUserRoleService sysUserRoleService; @Value("${defaultPassword}") private String defaultPassword; @Value("${singleSignON.client_id}") @@ -628,13 +642,119 @@ public class SysUserServiceImpl extends ServiceImpl impl } //单点登录 - public void singleSignOn(String code){ - HashMap paramMap = new HashMap<>(); - paramMap.put("client_id", client_id); - paramMap.put("client_secret", client_secret); - paramMap.put("code", 1); - paramMap.put("grant_type", "authorization_code"); + public Result singleSignOn(String code){ + //根据授权码获取access_token + HashMap tokenParam = new HashMap<>(); + tokenParam.put("client_id", client_id); + tokenParam.put("client_secret", client_secret); + tokenParam.put("code", 1); + tokenParam.put("grant_type", "authorization_code"); - String token= HttpUtil.post("https://idmtest.catarc.ac.cn/bam-protocol-service/oauth2/getToken", paramMap); + String tokenRes= HttpUtil.post("https://idmtest.catarc.ac.cn/bam-protocol-service/oauth2/getToken", tokenParam); + JSONObject tokenJson = JSONObject.parseObject(tokenRes); + String access_token = tokenJson.getString("access_token"); + + //根据access_token获取用户信息 + HashMap userInfoParam = new HashMap<>(); + userInfoParam.put("access_token", access_token); + userInfoParam.put("client_id", client_id); + + String userInfoRes= HttpUtil.get("https://idmtest.catarc.ac.cn/bam-protocol-service/oauth2/getUserInfo", userInfoParam); + + //根据工号登录 + return loginByUserNo("01433"); + } + + /** + * 根据工号登录 + * @return + */ + public Result loginByUserNo(String workNo) { + Result result = new Result<>(); + + //1. 校验用户是否有效 + //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(SysUser::getWorkNo, workNo); + SysUser sysUser = getOne(queryWrapper); + //update-end-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false + result= (Result) checkUserIsEffective(sysUser); + if (!result.isSuccess()) { + return result; + } + + //用户登录信息 + userInfo(sysUser, result); + //update-begin--Author:wangshuai Date:20200714 for:登录日志没有记录人员 + LoginUser loginUser = new LoginUser(); + BeanUtils.copyProperties(sysUser, loginUser); + // 新增用户角色code + LambdaQueryWrapper querySysUserRole = new LambdaQueryWrapper(); + querySysUserRole.eq(SysUserRole::getUserId,sysUser.getId()); + List listSysUserRole = sysUserRoleService.list(querySysUserRole); + if(!org.apache.commons.collections.CollectionUtils.isEmpty(listSysUserRole)){ + List listStr = listSysUserRole.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()); + LambdaQueryWrapper querySysRole = new LambdaQueryWrapper(); + querySysRole.in(SysRole::getId,listStr); + List listSysRole = sysRoleService.list(querySysRole); + if(!org.apache.commons.collections.CollectionUtils.isEmpty(listSysRole)){ + StringBuilder sb = new StringBuilder(); + listSysRole.forEach(p->{ + sb.append(p.getRoleCode()); + if(listSysRole.indexOf(p) != (listSysRole.size() - 1)){ + sb.append(","); + } + }); + loginUser.setRoleCode(sb.toString()); + } + } + baseCommonService.addLog("账号: " + sysUser.getUsername() + ",第三方登录成功!", CommonConstant.LOG_TYPE_1, null, loginUser); + //update-end--Author:wangshuai Date:20200714 for:登录日志没有记录人员 + return result; + } + + /** + * 用户信息 + * + * @param sysUser + * @param result + * @return + */ + public Result userInfo(SysUser sysUser, Result result) { + String syspassword = sysUser.getPassword(); + String username = sysUser.getUsername(); + // 生成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); + + // 获取用户部门信息 + JSONObject obj = new JSONObject(); + List departs = sysDepartService.queryUserDeparts(sysUser.getId()); + obj.put("departs", departs); + if (departs == null || departs.size() == 0) { + obj.put("multi_depart", 0); + } else if (departs.size() == 1) { + updateUserDepart(username, departs.get(0).getOrgCode()); + obj.put("multi_depart", 1); + } else { + //查询当前是否有登录部门 + // update-begin--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去 + SysUser sysUserById = getById(sysUser.getId()); + if (oConvertUtils.isEmpty(sysUserById.getOrgCode())) { + updateUserDepart(username, departs.get(0).getOrgCode()); + } + // update-end--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去 + obj.put("multi_depart", 2); + } + sysUser.setPhone(PasswordUtil.decrypt(sysUser.getPhone())); + sysUser.setEmail(PasswordUtil.decrypt(sysUser.getEmail())); + obj.put("token", token); + obj.put("userInfo", sysUser); + obj.put("sysAllDictItems", sysDictService.queryAllDictItems()); + result.setResult(obj); + result.success("登录成功"); + return result; } } From 5d2578ebfa4a9caa261605b423c8d5f92c1784df Mon Sep 17 00:00:00 2001 From: baozhipeng <961815525@qq.com> Date: Fri, 8 Apr 2022 17:46:04 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=B7=A5=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/2022-1-4变更.sql | 126 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 125 insertions(+), 1 deletion(-) diff --git a/db/2022-1-4变更.sql b/db/2022-1-4变更.sql index d8feea1f..f31cef51 100644 --- a/db/2022-1-4变更.sql +++ b/db/2022-1-4变更.sql @@ -46,4 +46,128 @@ ALTER TABLE tb_certificate_payment update tb_certificate_payment set charge_use = 20 where 1 = 1; update pay_meeting set meeting_type = 5 ,case_committee_id = '1486586847797346305' ,case_committee_name = '全国汽车标准化技术委员会电动车辆分技术委员会' WHERE id = '1478574801809993729'; -update pay_working_group_subitem set make_invoice = 1 where id = '1484760196725768194'; \ No newline at end of file +update pay_working_group_subitem set make_invoice = 1 where id = '1484760196725768194'; + +-- 2022-4-8 导入工号 +/* + Navicat Premium Data Transfer + + Source Server : 10.10.10.44 + Source Server Type : MySQL + Source Server Version : 50711 + Source Host : 10.10.10.44:3306 + Source Schema : income_payments + + Target Server Type : MySQL + Target Server Version : 50711 + File Encoding : 65001 + + Date: 08/04/2022 14:33:40 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for sheet0 +-- ---------------------------- +DROP TABLE IF EXISTS `sheet0`; +CREATE TABLE `sheet0` ( + `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `fullname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sheet0 +-- ---------------------------- +INSERT INTO `sheet0` VALUES ('06779', '闫雪'); +INSERT INTO `sheet0` VALUES ('01633', '陈强'); +INSERT INTO `sheet0` VALUES ('05085', '纪梦雪'); +INSERT INTO `sheet0` VALUES ('02939', '解瀚光'); +INSERT INTO `sheet0` VALUES ('05090', '孙悦'); +INSERT INTO `sheet0` VALUES ('05095', '张清莹'); +INSERT INTO `sheet0` VALUES ('05524', '王彪'); +INSERT INTO `sheet0` VALUES ('04172', '赵静炜'); +INSERT INTO `sheet0` VALUES ('00067', '王兆'); +INSERT INTO `sheet0` VALUES ('00084', '戎辉'); +INSERT INTO `sheet0` VALUES ('00066', '刘桂彬'); +INSERT INTO `sheet0` VALUES ('01433', '傅剑华'); +INSERT INTO `sheet0` VALUES ('01107', '李维菁'); +INSERT INTO `sheet0` VALUES ('01505', '张英男'); +INSERT INTO `sheet0` VALUES ('05536', '张昊'); +INSERT INTO `sheet0` VALUES ('05532', '闫志强'); +INSERT INTO `sheet0` VALUES ('05511', '郭琳'); +INSERT INTO `sheet0` VALUES ('01627', '李琛'); +INSERT INTO `sheet0` VALUES ('03054', '王一鸣'); +INSERT INTO `sheet0` VALUES ('01133', '孙枝鹏'); +INSERT INTO `sheet0` VALUES ('05817', '李玉刚'); +INSERT INTO `sheet0` VALUES ('05755', '常晏宁'); +INSERT INTO `sheet0` VALUES ('05530', '许天楚'); +INSERT INTO `sheet0` VALUES ('05518', '刘静榕'); +INSERT INTO `sheet0` VALUES ('05089', '彭伟强'); +INSERT INTO `sheet0` VALUES ('04770', '曹丽娟'); +INSERT INTO `sheet0` VALUES ('04235', '田富刚'); +INSERT INTO `sheet0` VALUES ('01877', '张铜柱'); +INSERT INTO `sheet0` VALUES ('01557', '张广秀'); +INSERT INTO `sheet0` VALUES ('01140', '轩轶'); +INSERT INTO `sheet0` VALUES ('01134', '孙振东'); +INSERT INTO `sheet0` VALUES ('01003', '刘彦戎'); +INSERT INTO `sheet0` VALUES ('01150', '朱彤'); +INSERT INTO `sheet0` VALUES ('05515', '李铮'); +INSERT INTO `sheet0` VALUES ('05509', '付越'); +INSERT INTO `sheet0` VALUES ('04238', '季国田'); +INSERT INTO `sheet0` VALUES ('03840', '胡月'); +INSERT INTO `sheet0` VALUES ('01821', '李波'); +INSERT INTO `sheet0` VALUES ('01470', '范嘉睿'); +INSERT INTO `sheet0` VALUES ('01181', '刘地'); +INSERT INTO `sheet0` VALUES ('04670', '文清浩'); +INSERT INTO `sheet0` VALUES ('02343', '潘俊家'); +INSERT INTO `sheet0` VALUES ('01162', '郭淼'); +INSERT INTO `sheet0` VALUES ('02256', '殷凤轩'); +INSERT INTO `sheet0` VALUES ('05586', '何丽'); +INSERT INTO `sheet0` VALUES ('05525', '王惠云'); +INSERT INTO `sheet0` VALUES ('05517', '刘佳仪'); +INSERT INTO `sheet0` VALUES ('05508', '董坤'); +INSERT INTO `sheet0` VALUES ('02141', '李金玉'); +INSERT INTO `sheet0` VALUES ('01513', '张翠'); +INSERT INTO `sheet0` VALUES ('01183', '杨振馨'); +INSERT INTO `sheet0` VALUES ('01166', '孙怡'); +INSERT INTO `sheet0` VALUES ('01047', '骆志红'); +INSERT INTO `sheet0` VALUES ('01064', '朱毅'); +INSERT INTO `sheet0` VALUES ('01525', '李稳'); +INSERT INTO `sheet0` VALUES ('01546', '郑天雷'); +INSERT INTO `sheet0` VALUES ('01726', '于洋'); +INSERT INTO `sheet0` VALUES ('05387', '郝维健'); +INSERT INTO `sheet0` VALUES ('05522', '刘志超'); +INSERT INTO `sheet0` VALUES ('05505', '曹冬冬'); +INSERT INTO `sheet0` VALUES ('03871', '胡建'); +INSERT INTO `sheet0` VALUES ('02997', '兰昊'); +INSERT INTO `sheet0` VALUES ('01671', '徐枭'); +INSERT INTO `sheet0` VALUES ('01665', '保翔'); +INSERT INTO `sheet0` VALUES ('01061', '何云堂'); +INSERT INTO `sheet0` VALUES ('04202', '柳邵辉'); +INSERT INTO `sheet0` VALUES ('02704', '孙航'); +INSERT INTO `sheet0` VALUES ('06716', '吴嘉杰'); +INSERT INTO `sheet0` VALUES ('05709', '张路'); +INSERT INTO `sheet0` VALUES ('03206', '张淼'); +INSERT INTO `sheet0` VALUES ('02662', '吴含冰'); +INSERT INTO `sheet0` VALUES ('05514', '李宝田'); +INSERT INTO `sheet0` VALUES ('05507', '陈振宇'); +INSERT INTO `sheet0` VALUES ('04346', '张行'); +INSERT INTO `sheet0` VALUES ('04922', '李春'); +INSERT INTO `sheet0` VALUES ('02944', '张琳琳'); +INSERT INTO `sheet0` VALUES ('04674', '陆春'); +INSERT INTO `sheet0` VALUES ('05535', '张春荣'); +INSERT INTO `sheet0` VALUES ('05533', '燕翙江'); +INSERT INTO `sheet0` VALUES ('05087', '李云伟'); +INSERT INTO `sheet0` VALUES ('01083', '王颖'); +INSERT INTO `sheet0` VALUES ('04393', '魏墨晗'); +INSERT INTO `sheet0` VALUES ('03741', '吕双'); +INSERT INTO `sheet0` VALUES ('02377', '冯博'); +INSERT INTO `sheet0` VALUES ('01432', '谢东明'); + +SET FOREIGN_KEY_CHECKS = 1; + +update sys_user set sys_user.work_no = (select sheet0.username from sheet0 where sys_user.realname = sheet0.fullname) + +DROP TABLE IF EXISTS `sheet0`; From eb330fcf17af2d9fed5f2466e4561534a26984ef Mon Sep 17 00:00:00 2001 From: baozhipeng <961815525@qq.com> Date: Fri, 8 Apr 2022 17:51:14 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=B7=A5=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/2022-1-4变更.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/db/2022-1-4变更.sql b/db/2022-1-4变更.sql index f31cef51..a5939517 100644 --- a/db/2022-1-4变更.sql +++ b/db/2022-1-4变更.sql @@ -48,6 +48,7 @@ update tb_certificate_payment set charge_use = 20 where 1 = 1; update pay_meeting set meeting_type = 5 ,case_committee_id = '1486586847797346305' ,case_committee_name = '全国汽车标准化技术委员会电动车辆分技术委员会' WHERE id = '1478574801809993729'; update pay_working_group_subitem set make_invoice = 1 where id = '1484760196725768194'; + -- 2022-4-8 导入工号 /* Navicat Premium Data Transfer @@ -168,6 +169,9 @@ INSERT INTO `sheet0` VALUES ('01432', '谢东明'); SET FOREIGN_KEY_CHECKS = 1; +ALTER TABLE `income_payments_prod`.`sys_user` +DROP INDEX `uniq_sys_user_work_no`; + update sys_user set sys_user.work_no = (select sheet0.username from sheet0 where sys_user.realname = sheet0.fullname) DROP TABLE IF EXISTS `sheet0`; From 5fb04e6b0b4fdffab08091cc307a69399dcc1a09 Mon Sep 17 00:00:00 2001 From: baozhipeng <961815525@qq.com> Date: Fri, 8 Apr 2022 17:59:40 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=B7=A5=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/2022-1-4变更.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db/2022-1-4变更.sql b/db/2022-1-4变更.sql index a5939517..35f130d7 100644 --- a/db/2022-1-4变更.sql +++ b/db/2022-1-4变更.sql @@ -50,6 +50,7 @@ update pay_working_group_subitem set make_invoice = 1 where id = '14847601967257 -- 2022-4-8 导入工号 + /* Navicat Premium Data Transfer @@ -169,9 +170,9 @@ INSERT INTO `sheet0` VALUES ('01432', '谢东明'); SET FOREIGN_KEY_CHECKS = 1; -ALTER TABLE `income_payments_prod`.`sys_user` +ALTER TABLE `sys_user` DROP INDEX `uniq_sys_user_work_no`; -update sys_user set sys_user.work_no = (select sheet0.username from sheet0 where sys_user.realname = sheet0.fullname) +update sys_user set sys_user.work_no = (select sheet0.username from sheet0 where sys_user.realname = sheet0.fullname); DROP TABLE IF EXISTS `sheet0`; From da385bd44534447b81747cd6b5a139d24ef5aa18 Mon Sep 17 00:00:00 2001 From: baozhipeng <961815525@qq.com> Date: Mon, 11 Apr 2022 15:36:43 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=B7=A5=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/system/service/impl/SysUserServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java index 7ad83b18..60efdc29 100644 --- a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java +++ b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java @@ -90,7 +90,7 @@ public class SysUserServiceImpl extends ServiceImpl impl private String defaultPassword; @Value("${singleSignON.client_id}") private String client_id; - @Value("${singleSignON.client_id}") + @Value("${singleSignON.client_secret}") private String client_secret; @Override @@ -647,7 +647,7 @@ public class SysUserServiceImpl extends ServiceImpl impl HashMap tokenParam = new HashMap<>(); tokenParam.put("client_id", client_id); tokenParam.put("client_secret", client_secret); - tokenParam.put("code", 1); + tokenParam.put("code", code); tokenParam.put("grant_type", "authorization_code"); String tokenRes= HttpUtil.post("https://idmtest.catarc.ac.cn/bam-protocol-service/oauth2/getToken", tokenParam); @@ -660,9 +660,11 @@ public class SysUserServiceImpl extends ServiceImpl impl userInfoParam.put("client_id", client_id); String userInfoRes= HttpUtil.get("https://idmtest.catarc.ac.cn/bam-protocol-service/oauth2/getUserInfo", userInfoParam); + JSONObject userInfoJson = JSONObject.parseObject(userInfoRes); + String loginName = userInfoJson.getString("loginName"); //根据工号登录 - return loginByUserNo("01433"); + return loginByUserNo(loginName); } /**