Browse Source

2024 6 24 号

zhuwei 8 months ago
parent
commit
3eb2207087

+ 1 - 1
blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java

@@ -76,7 +76,7 @@ public interface LauncherConstant {
      * nacos dev 地址 215==172.31.222.127   192.168.0.109     127.0.0.1  210-=-172.30.224.81
      * nacos dev 地址 172.31.222.127   192.168.0.109     127.0.0.1    172.30.224.81(39.108.216.210)
      */
-    String NACOS_DEV_ADDR = "152.168.2.11:8848";
+    String NACOS_DEV_ADDR = "172.30.224.81:8848";
 
     /**
      * nacos prod 地址

+ 37 - 32
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -338,7 +338,7 @@ public class ExcelTabController extends BladeController {
         detail.setHtmlUrl(thmlUrl);
         excelTabService.saveOrUpdate(detail);
         // 解析html
-        expailHtmlInfo(thmlUrl, detail.getId());
+        expailHtmlInfo(thmlUrl, detail.getId(),detail.getTabType()+"");
         return R.success("上传成功");
     }
 
@@ -377,13 +377,12 @@ public class ExcelTabController extends BladeController {
             String file_path = FileUtils.getSysLocalFileUrl();
 
             String filecode = SnowFlakeUtil.getId() + "";
-        //    String thmlUrl = file_path + filecode + ".html";
             String exceUrl = file_path + filecode + "123.xlsx";
 
             ExcelInfoUtils.excelInfo(ossInputStream, exceUrl, htmlUrl2, "1");
 
             // 解析html
-            expailHtmlInfo(htmlUrl2, Long.parseLong(nodeId));
+           // expailHtmlInfo(htmlUrl2, Long.parseLong(nodeId));
         }
 
     }
@@ -851,32 +850,35 @@ public class ExcelTabController extends BladeController {
         if (tab != null) {
             isWater = true;
         }
+        ExcelTab dataInfo = excelTabService.getById(wbsTreePrivate.getExcelId());
         // 添加标题显示
         Elements trs = table.select("tr");
-        for (int i = 1; i < 6; i++) {
-            Element tr = trs.get(i);
-            Elements tds = tr.select("td");
-            for (int j = 0; j < tds.size(); j++) {
-                Element data = tds.get(j);
-                String style = data.attr("style");
-                if (style.indexOf("font-size") >= 0) {
-                    int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt")));
-                    if (isWater) {
-                        if (StringUtils.isNotEmpty(data.text()) && fontsize >= 12) {
-                            trs.get(i - 1).select("td").get(0).text(projectInfo.getProjectName());
-                        }
-                    } else {
-                        if (StringUtils.isNotEmpty(data.text()) && fontsize >= 14) {
-                            Elements td = trs.get(i - 1).select("td");
-                            if (td!=null && td.size()>=1){
-                                for(Element element:td){
-                                    String style2 = element.attr("style");
-                                    String sizeinfo = style2.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt"));
-                                    if(sizeinfo.length()>=2 && sizeinfo.indexOf(".")<0){
-                                        int fontsize2 = Func.toInt(sizeinfo);
-                                        if(StringUtils.isEmpty(element.text()) && fontsize2>=14){
-                                            element.text(projectInfo.getProjectName());
-                                            break;
+        if(dataInfo.getTabType()!=100L) {
+            for (int i = 1; i < 6; i++) {
+                Element tr = trs.get(i);
+                Elements tds = tr.select("td");
+                for (int j = 0; j < tds.size(); j++) {
+                    Element data = tds.get(j);
+                    String style = data.attr("style");
+                    if (style.indexOf("font-size") >= 0) {
+                        int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt")));
+                        if (isWater) {
+                            if (StringUtils.isNotEmpty(data.text()) && fontsize >= 12) {
+                                trs.get(i - 1).select("td").get(0).text(projectInfo.getProjectName());
+                            }
+                        } else {
+                            if (StringUtils.isNotEmpty(data.text()) && fontsize >= 14) {
+                                Elements td = trs.get(i - 1).select("td");
+                                if (td != null && td.size() >= 1) {
+                                    for (Element element : td) {
+                                        String style2 = element.attr("style");
+                                        String sizeinfo = style2.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt"));
+                                        if (sizeinfo.length() >= 2 && sizeinfo.indexOf(".") < 0) {
+                                            int fontsize2 = Func.toInt(sizeinfo);
+                                            if (StringUtils.isEmpty(element.text()) && fontsize2 >= 14) {
+                                                element.text(projectInfo.getProjectName());
+                                                break;
+                                            }
                                         }
                                     }
                                 }
@@ -969,7 +971,7 @@ public class ExcelTabController extends BladeController {
     }
 
     // 上传解析 html
-    public void expailHtmlInfo(String thmlUrl, Long excelId) throws Exception {
+    public void expailHtmlInfo(String thmlUrl, Long excelId,String tabType) throws Exception {
 
         // 读取
         File file1 = ResourceUtil.getFile(thmlUrl);
@@ -1061,9 +1063,6 @@ public class ExcelTabController extends BladeController {
                     //x 移位 算法
                     String getRowInfo = rowData[y1];
 
-                    if (y1 == 17) {
-                        System.out.println("1");
-                    }
                     if (getRowInfo != null) {
                         String[] dataInfo2 = getRowInfo.split(",");
 
@@ -1333,12 +1332,15 @@ public class ExcelTabController extends BladeController {
                             data.empty().append(checkbox);
 
                         } else {
+
                             if (index_state) { // 区域内
                                 if (rowspan >= 1 || isText) {
                                     data.empty().append("<el-input type='textarea' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft'  @keydown.shift.right='keyupShiftRight'  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
                                 } else {
                                     data.empty().append("<el-input type='text' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft'  @keydown.shift.right='keyupShiftRight'  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
                                 }
+                            } else if (tabType.equals("100")&& i<2) { //计量特殊添加
+                                data.empty().append("<el-input type='text' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft'  @keydown.shift.right='keyupShiftRight'  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
                             } else { // 区域外
                                 if (j == 0) {
                                     if (colspan == maxCol && i >= 1) {
@@ -1480,6 +1482,9 @@ public class ExcelTabController extends BladeController {
             Element data = tds.get(j);
             String keyId = data.attr("class");
             int colspan = data.attr("COLSPAN").equals("") ? 1 : Integer.parseInt(data.attr("COLSPAN"));
+            if(colspan==0){
+                 colspan = data.attr("colspan").equals("") ? 1 : Integer.parseInt(data.attr("colspan"));
+            }
             String classInfo = styleMap.get(keyId);
             String textInfo = data.text().trim().replaceAll(" ", "");
 
@@ -3257,7 +3262,7 @@ public class ExcelTabController extends BladeController {
             Thread.sleep(100);
             sheet.saveToHtml(html_url, options);
             Thread.sleep(100);
-            this.expailHtmlInfo(html_url, p_key_id);
+            this.expailHtmlInfo(html_url, p_key_id,detail.getTabType()+"");
             Thread.sleep(100);
             EexpaileInfo(html_url, p_key_id);
             System.out.println(i);

+ 82 - 252
blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java

@@ -74,6 +74,7 @@ import org.springblade.system.user.vo.UserVO;
 import org.springblade.system.user.wrapper.UserWrapper;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -204,7 +205,7 @@ public class UserController {
             data.setRoleId("1537248158277914626");
             projectAndUserList.add(data);
             user.setProjectAndUserList(projectAndUserList);
-        }else if (ObjectUtil.isNotEmpty(user.getSysId()) && user.getSysId().equals("40")) {
+        } else if (ObjectUtil.isNotEmpty(user.getSysId()) && user.getSysId().equals("40")) {
             user.setUserType("1,2,3,7");
             user.setPassword("123456");
             user.setPlaintextPassword("123456");
@@ -219,7 +220,7 @@ public class UserController {
             data.setRoleId("1538760412710289409");
             projectAndUserList.add(data);
             user.setProjectAndUserList(projectAndUserList);
-        }else if (ObjectUtil.isNotEmpty(user.getSysId()) && user.getSysId().equals("50")) {
+        } else if (ObjectUtil.isNotEmpty(user.getSysId()) && user.getSysId().equals("50")) {
             user.setUserType("1,2,3,7");
             user.setPassword("123456");
             user.setPlaintextPassword("123456");
@@ -234,21 +235,6 @@ public class UserController {
             data.setRoleId("1537249581371707394");
             projectAndUserList.add(data);
             user.setProjectAndUserList(projectAndUserList);
-        }else{
-            user.setUserType("1,2,3,7");
-            user.setPassword("123456");
-            user.setPlaintextPassword("123456");
-            user.setTenantId("000000");
-            user.setDeptId("1750404533561184258");
-            user.setStatus(1);
-            user.setSysType(2);
-            List<SaveUserInfoByProjectDTO> projectAndUserList = new ArrayList<>();
-            SaveUserInfoByProjectDTO data = new SaveUserInfoByProjectDTO();
-            data.setContractId("1714919227250950146");
-            data.setProjectId("1750070685257990145");
-            data.setRoleId("1538760412710289409");
-            projectAndUserList.add(data);
-            user.setProjectAndUserList(projectAndUserList);
         }
 
         return R.status(userService.submit2(user));
@@ -502,11 +488,9 @@ public class UserController {
     @ApiOperation(value = "token验证加密", notes = "token验证登录")
     public R loginByToken(String token, HttpServletRequest request) {
 
-
-
         token = "bearer " + token;
         HttpClient httpClient = HttpClientBuilder.create().build();
-        HttpGet httpPost = new HttpGet("http://39.108.216.210:8090/blade-auth/oauth/user-info");
+        HttpGet httpPost = new HttpGet("http://172.30.224.81:8090/blade-auth/oauth/user-info");
         httpPost.setHeader("Authorization", token); //这个需要 client:
         List<NameValuePair> params = new ArrayList<NameValuePair>();
 
@@ -523,7 +507,7 @@ public class UserController {
             if (jsonObject != null && ObjectUtil.isNotEmpty(jsonObject)) {
                 JSONObject data = jsonObject.getJSONObject("data");
                 String name = data.getString("name");
-                return this.loginByToken2(name,request);
+                return this.loginByToken2(name, request);
             } else {
                 return R.fail("token解析用户失败");
             }
@@ -534,249 +518,95 @@ public class UserController {
 
     }
 
+
     @PostMapping("/loginByToken2")
     @ApiOperationSupport(order = 20)
     @ApiOperation(value = "token验证加密", notes = "token验证登录")
-    public R loginByToken2(String account,HttpServletRequest request) {
-        String Authorization = request.getHeader("Authorization");
-        if(Authorization==null || StringUtil.isEmpty(Authorization)){
-            Authorization="Basic Y2xpZW50OmNsaWVudF9zZWNyZXQ=";
+    public R loginByToken2(String account, HttpServletRequest request) {
+        if(account==null || Func.isNull(account) || Func.isEmpty(account)){
+            return R.fail("account值不能为空");
         }
-        if (StringUtil.isBlank(account)) {
-            return R.fail("请输出token");
+        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account", account);
+        // queryWrapper.eq("password", tokenPw);
+        queryWrapper.eq("sys_type", 2);
+        User userInfo = userService.getOne(queryWrapper);
+        if (userInfo == null) {
+            return R.fail("用户名或密码错误");
         }
 
-        if (account != null) {
-            QueryWrapper<User> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("account", account);
-            // queryWrapper.eq("password", tokenPw);
-            queryWrapper.eq("sys_type", 2);
-            User userInfo = userService.getOne(queryWrapper);
-            if (userInfo == null) {
-                return R.fail("用户名或密码错误");
-            }
-            String tenId = userInfo.getTenantId();
-            String pass = userInfo.getPlaintextPassword();
-            String md5Pass = MD5Utils.md5Hex(pass, "UTF-8");
-            System.out.println("密码" + md5Pass);
-
-            HttpClient httpClient = HttpClientBuilder.create().build();
-            HttpPost httpPost = new HttpPost("http://39.108.216.210:8090/blade-auth/oauth/token");
-            httpPost.setHeader("Authorization", Authorization);
-            httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
-            httpPost.setHeader("Tenant-Id", userInfo.getTenantId());
-            List<NameValuePair> params = new ArrayList<NameValuePair>();
-            params.add(new BasicNameValuePair("grant_type", "password"));
-            params.add(new BasicNameValuePair("username", account));
-            params.add(new BasicNameValuePair("password", md5Pass));
-            params.add(new BasicNameValuePair("scope", "all"));
-            params.add(new BasicNameValuePair("tenantId", "000000"));
-            httpPost.setEntity(new UrlEncodedFormEntity(params, Consts.UTF_8));
-            try {
-                HttpResponse httpResponse = httpClient.execute(httpPost);
-                InputStream inputStream = httpResponse.getEntity().getContent();
-                ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-                byte[] buffer = new byte[1024];
-                int index = 0;
-                while ((index = inputStream.read(buffer)) != -1) {
-                    outputStream.write(buffer, 0, index);
+        String Authorization = request.getHeader("Authorization");
+
+        if (Authorization == null || StringUtil.isEmpty(Authorization)) {
+            String useType = userInfo.getUserType();
+            List<String> strList = Func.toStrList(useType);
+            for(String sys_id:strList){
+                String dataInfo = "";
+                if(sys_id.equals("1")){ //质量/试验平台
+                     dataInfo ="client:client_secret";
+                }else if(sys_id.equals("2")){ //APP端
+                     dataInfo ="uni-app:app_secret";
+                }else if(sys_id.equals("3")){ //档案平台"
+                     dataInfo ="archives:archives_secret";
+                }else if(sys_id.equals("4")){ //后台管理端"
+                    dataInfo ="saber:saber_secret";
+                }else if(sys_id.equals("5")){ //成本管控系统"
+                    dataInfo ="hac:hac_secret";
+                }else if(sys_id.equals("6")){ //征拆系统"
+                    dataInfo ="lar:lar_secret";
+                }else if(sys_id.equals("7")){ //计量系统"
+                    dataInfo ="measure:measure_secret";
+                }else if(sys_id.equals("8")){ //安全系统"
+                    dataInfo ="measure:measure_secret";
+                }
+                Authorization = "Basic "+Func.encodeBase64(dataInfo);
+                //Basic bWVhc3VyZTptZWFzdXJlX3NlY3JldA==
+                //Basic bWVhc3VyZTptZWFzdXJlX3NlY3JldA==
+                R loginInfo = this.getLoginInfo(Authorization, userInfo);
+                if(loginInfo.getCode()==200){
+                    return loginInfo;
                 }
-                System.out.println("\n");
-                return R.data(JSON.parseObject(outputStream.toString()));
-            } catch (IOException e) {
-                e.printStackTrace();
             }
-        } else {
-            return R.fail("请确认account是否有误");
         }
-        return R.fail("");
+        return this.getLoginInfo(Authorization,userInfo);
     }
 
-    /**
-     * 定时同步白马项目用户信息 不在使用
-     */
-   // @Scheduled(cron = "0 0 4 * * ?")
-    public void syncProjectUserInfo() throws ParseException, IOException {
-        JSONObject json = new JSONObject();
-        json.put("fn", "all");
-
-        //测试数据
-        String url = "http://js.cegc.com.cn:13426/login/japi/synUser";
-        String encoding = "utf-8";
-        String da = AesInfoUtil.sendPost(url, json, encoding);
-        if (da != null) {
-            JSONObject userInfo = JSONObject.parseObject(da);
-            //System.out.println(userInfo);
-            int code = userInfo.getInteger("status");
-            if (code == 200) {
-                JSONArray list = userInfo.getJSONArray("list");
-                if (list != null && list.size() >= 1) {
-                    for (int i = 0; i < list.size(); i++) {
-                        JSONObject jsonObject = list.getJSONObject(i);
-                        String id = jsonObject.getString("id"); //人员唯一编码
-                        String account = jsonObject.getString("account"); //账号
-                        //String password = jsonObject.getString("password"); //MD5加密后的密码
-                        String name = jsonObject.getString("name"); //人员姓名
-                        String idCard = jsonObject.getString("idcard"); //身份证号
-                        String phone = jsonObject.getString("phone"); //电话号码
-
-                        /*这里实际接口返回的数据都是companyName对应的公司名称*/
-                        String companyName = jsonObject.getString("companyName"); //公司名称
-                        //String constructionCompany = jsonObject.getString("constructionCompany"); //公司名称
-                        //String projectName = jsonObject.getString("projectName") + ""; //公司名称*/
-                        String status = jsonObject.getString("status"); //状态(1:启用  2:冻结  3:删除)
-                        /*修改需求前*/
-                        /*if (projectName.contains("白马项目")
-                                || constructionCompany.equals("重庆白马航运发展有限公司")
-                                || constructionCompany.equals("中国水利水电第八工程局有限公司") //二期
-                                || constructionCompany.equals("中国水利水电第四工程局中电建路桥集团联合体")//一期
-                                || companyName.equals("重庆白马航运发展有限公司")//二期一期(业主)
-                                || companyName.equals("中国水利水电第八工程局有限公司")
-                                || companyName.equals("中国水利水电第四工程局中电建路桥集团联合体")
-                        ) if (sysUser != null) {
-                                newUser = sysUser;
-                            } else {
-                                newUser.setId(SnowFlakeUtil.getId());
-                                newUser.setDeptId("1588069957940674562"); //白马部门
-                                newUser.setSysType(2);
-                                newUser.setIsDeleted(0);
-                                newUser.setCreateUser(Long.parseLong("1541381503819694081"));
-                                newUser.setUpdateUser(Long.parseLong("1541381503819694081"));
-                                newUser.setTenantId("000000");
-                                newUser.setSysId(id);
-                                newUser.setUpdateTime(new Date());
-                                newUser.setCreateTime(new Date());
-                            }
-                            newUser.setUserType("1,2");
-                            newUser.setAccount(account);
-                            newUser.setRealName(name);
-                            newUser.setName(name);
-                            newUser.setPassword("10470c3b4b1fed12c3baac014be15fac67c6e815");
-                            newUser.setName(name);
-                            newUser.setStatus(Integer.parseInt(status));
-                            newUser.setIdNumber(idCard);
-                            newUser.setCompanyName(companyName);*/
-
-                        /*2023年8月4日16:29:14,修改需求,匹配到对应合同段中去*/
-                        /*2023年10月13日13:43:26,修改需求,增加:中国水利水电第八工程局有限公司-属于二期合同段、重庆市交通工程监理咨询有限责任公司-属于一监办*/
-                        if (companyName.contains("重庆白马航运发展有限公司")
-                                || companyName.contains("四川二滩国际工程咨询有限责任公司")
-                                || companyName.contains("中国水利水电第四工程局中电建路桥集团联合体")
-                                || companyName.contains("中国水利水电第八工程局有限公司")
-                                || companyName.contains("重庆市交通工程监理咨询有限责任公司")
-                                || companyName.contains("中铁长江交通设计集团有限公司")
-                                || companyName.contains("中铁八局集团有限公司")) {
-                            List<User> sysUser = userService.getBaseMapper().selectList(Wrappers.<User>lambdaQuery().eq(User::getSysId, id).eq(User::getSysType, 2));
-
-                            /*修改电话号码*/
-                            if (sysUser.size() > 0 && ObjectUtil.isNotEmpty(phone) && phone.length() == 11) {
-                                for (User user : sysUser) {
-                                    if (ObjectUtil.isEmpty(user.getPhone())) {
-                                        userService.lambdaUpdate()
-                                                .set(User::getPhone, phone)
-                                                .eq(User::getId, user.getId())
-                                                .update();
-                                    }
-                                }
-                            }
-
-                            /*只有本系统不存在时才去新增*/
-                            if (sysUser.size() == 0L) {
-                                User newUser = new User();
-                                newUser.setId(SnowFlakeUtil.getId());
-                                newUser.setDeptId("1588069957940674562"); //白马部门
-                                newUser.setSysType(2);
-                                newUser.setIsDeleted(0);
-                                newUser.setCreateUser(Long.parseLong("1541381503819694081"));
-                                newUser.setUpdateUser(Long.parseLong("1541381503819694081"));
-                                newUser.setTenantId("000000");
-                                newUser.setSysId(id);
-                                newUser.setUpdateTime(new Date());
-                                newUser.setCreateTime(new Date());
-                                newUser.setUserType("1,2");
-                                newUser.setAccount(account);
-                                newUser.setRealName(name);
-                                newUser.setName(name);
-                                newUser.setPassword("10470c3b4b1fed12c3baac014be15fac67c6e815");
-                                newUser.setPlaintextPassword("123456");
-                                newUser.setName(name);
-                                newUser.setStatus(Integer.parseInt(status));
-                                newUser.setIdNumber(idCard);
-                                newUser.setCompanyName(companyName);
-                                newUser.setPhone(ObjectUtil.isNotEmpty(phone) && phone.length() == 11 ? phone : null);
-
-                                //所有合同段(白马)
-                                if (companyName.contains("重庆白马航运发展有限公司")) {
-                                    List<ContractInfo> contractInfos = jdbcTemplate.query("select id from m_contract_info where p_id = 1612329251049537537 and is_deleted = 0 and status = 1", new BeanPropertyRowMapper<>(ContractInfo.class));
-                                    for (ContractInfo contractInfo : contractInfos) {
-                                        Long count = jdbcTemplate.queryForObject("select count(1) from m_project_assignment_user where user_id = " + newUser.getId() + " and project_id = 1612329251049537537 " + " and contract_id = " + contractInfo.getId() + " and post_id is null " + " and status = 1 and is_deleted = 0", Long.class);
-                                        if (count == null || count == 0L) {
-                                            //绑定项目,设置默认角色信息 白马项目id:1612329251049537537;所有合同段id:contractInfo.getId();角色施工-资料员id:1537249581371707394
-                                            saveUserInfoByProjectClient.saveInfoRelation(newUser.getId(), 1612329251049537537L, contractInfo.getId(), 1537249581371707394L);
-                                            newUser.setRoleId("1537249581371707394");
-                                        }
-                                    }
-                                }
-
-                                //二期合同段(八局、二滩、长江设计单位、中国水利水电第八工程局有限公司)
-                                if (companyName.contains("中铁八局集团有限公司") || companyName.contains("四川二滩国际工程咨询有限责任公司")
-                                        || companyName.contains("中铁长江交通设计集团有限公司") || companyName.contains("中国水利水电第八工程局有限公司")) {
-                                    Long count = jdbcTemplate.queryForObject("select count(1) from m_project_assignment_user where user_id = " + newUser.getId() + " and  project_id = 1612329251049537537 and contract_id = 1612335077269143554 and post_id is null and status = 1 and is_deleted = 0", Long.class);
-                                    if (count == null || count == 0L) {
-                                        //绑定项目,设置默认角色信息 白马项目id:1612329251049537537;第二期合同段id:1612335077269143554;角色施工-资料员id:1537249581371707394
-                                        saveUserInfoByProjectClient.saveInfoRelation(newUser.getId(), 1612329251049537537L, 1612335077269143554L, 1537249581371707394L);
-                                        newUser.setRoleId("1537249581371707394");
-                                    }
-                                }
-
-                                //一期合同段(四局、长江设计单位)
-                                if (companyName.contains("中国水利水电第四工程局中电建路桥集团联合体") || companyName.contains("中铁长江交通设计集团有限公司")) {
-                                    Long count = jdbcTemplate.queryForObject("select count(1) from m_project_assignment_user where user_id = " + newUser.getId() + " and  project_id = 1612329251049537537 and contract_id = 1613022750656921601 and post_id is null and status = 1 and is_deleted = 0", Long.class);
-                                    if (count == null || count == 0L) {
-                                        //绑定项目,设置默认角色信息 白马项目id:1612329251049537537;第一期合同段id:1613022750656921601;角色施工-资料员id:1537249581371707394
-                                        saveUserInfoByProjectClient.saveInfoRelation(newUser.getId(), 1612329251049537537L, 1613022750656921601L, 1537249581371707394L);
-                                        newUser.setRoleId("1537249581371707394");
-                                    }
-                                }
-
-                                //二监办合同段(二滩)
-                                if (companyName.contains("四川二滩国际工程咨询有限责任公司")) {
-                                    Long count = jdbcTemplate.queryForObject("select count(1) from m_project_assignment_user where user_id = " + newUser.getId() + " and  project_id = 1612329251049537537 and contract_id = 1687370619295309826 and post_id is null and status = 1 and is_deleted = 0", Long.class);
-                                    if (count == null || count == 0L) {
-                                        //绑定项目,设置默认角色信息 白马项目id:1612329251049537537;二监办合同段id:1687370619295309826;角色施工-资料员id:1537249581371707394
-                                        saveUserInfoByProjectClient.saveInfoRelation(newUser.getId(), 1612329251049537537L, 1687370619295309826L, 1537249581371707394L);
-                                        newUser.setRoleId("1537249581371707394");
-                                    }
-                                }
-
-                                //一监办合同段(重庆市交通工程监理咨询有限责任公司)
-                                if (companyName.contains("重庆市交通工程监理咨询有限责任公司")) {
-                                    Long count = jdbcTemplate.queryForObject("select count(1) from m_project_assignment_user where user_id = " + newUser.getId() + " and  project_id = 1612329251049537537 and contract_id = 1687370014959017986 and post_id is null and status = 1 and is_deleted = 0", Long.class);
-                                    if (count == null || count == 0L) {
-                                        //绑定项目,设置默认角色信息 白马项目id:1612329251049537537;一监办合同段id:1687370014959017986;角色施工-资料员id:1537249581371707394
-                                        saveUserInfoByProjectClient.saveInfoRelation(newUser.getId(), 1612329251049537537L, 1687370014959017986L, 1537249581371707394L);
-                                        newUser.setRoleId("1537249581371707394");
-                                    }
-                                }
-
-                                /*修改需求前*/
-                                /*Long count = jdbcTemplate.queryForObject("select count(1) from m_project_assignment_user where user_id = " + newUser.getId() + " and  project_id = 1612329251049537537 and contract_id = 1612335077269143554 and post_id is null and status = 1 and is_deleted = 0", Long.class);
-                                if (count == null || count == 0L) {
-                                    //绑定项目,设置默认角色信息 白马项目id:1612329251049537537;第二期合同段id:1612335077269143554;角色施工-资料员id:1537249581371707394
-                                    saveUserInfoByProjectClient.saveInfoRelation(newUser.getId(), 1612329251049537537L, 1612335077269143554L, 1537249581371707394L);
-                                    newUser.setRoleId("1537249581371707394"); //角色施工-资料员id:1537249581371707394
-                                }*/
-
-                                //userService.saveOrUpdate(newUser);
-
-                                /*2023年10月13日14:05:51 改为save新增,而不是像以前一样用saveOrUpdate*/
-                                userService.save(newUser);
-                                userService.submitUserDept(newUser);
-                            }
-                        }
-                    }
-                }
+
+    public R getLoginInfo( String Authorization, User userInfo) {
+        String tenId = userInfo.getTenantId();
+        String account = userInfo.getAccount();
+        String pass = userInfo.getPlaintextPassword();
+        String md5Pass = MD5Utils.md5Hex(pass, "UTF-8");
+        System.out.println("密码" + md5Pass);
+
+        HttpClient httpClient = HttpClientBuilder.create().build();
+        HttpPost httpPost = new HttpPost("http://172.30.224.81:8090/blade-auth/oauth/token");
+        httpPost.setHeader("Authorization", Authorization);
+        httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
+        httpPost.setHeader("Tenant-Id", tenId);
+        List<NameValuePair> params = new ArrayList<NameValuePair>();
+        params.add(new BasicNameValuePair("grant_type", "password"));
+        params.add(new BasicNameValuePair("username", account));
+        params.add(new BasicNameValuePair("password", md5Pass));
+        params.add(new BasicNameValuePair("scope", "all"));
+        params.add(new BasicNameValuePair("tenantId", tenId));
+        params.add(new BasicNameValuePair("type", "account"));
+        httpPost.setEntity(new UrlEncodedFormEntity(params, Consts.UTF_8));
+        try {
+            HttpResponse httpResponse = httpClient.execute(httpPost);
+            InputStream inputStream = httpResponse.getEntity().getContent();
+            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+            byte[] buffer = new byte[1024];
+            int index = 0;
+            while ((index = inputStream.read(buffer)) != -1) {
+                outputStream.write(buffer, 0, index);
             }
+            System.out.println("\n");
+            return R.data(JSON.parseObject(outputStream.toString()));
+        } catch (IOException e) {
+            e.printStackTrace();
         }
+        return R.fail("获取token失败");
     }
+
 }