新增子系统用户
parent
4ebe2458dc
commit
c4d773e9f5
@ -0,0 +1,177 @@
|
||||
package com.ibeetl.admin.core.util.user;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class ZYUserInfo {
|
||||
|
||||
private String username;
|
||||
private String password;
|
||||
private String name;
|
||||
private Integer userId;
|
||||
private Integer roleId;
|
||||
private Integer schoolId;
|
||||
private String schoolName;
|
||||
private Integer classId;
|
||||
private String className;
|
||||
private String phone ;
|
||||
private Long collegeId;
|
||||
private String collegeName;
|
||||
private Long majorId;
|
||||
private String majorName;
|
||||
|
||||
private Long studentId;
|
||||
private Long teacherId;
|
||||
|
||||
|
||||
public Long getStudentId() {
|
||||
return studentId;
|
||||
}
|
||||
|
||||
public void setStudentId(Long studentId) {
|
||||
this.studentId = studentId;
|
||||
}
|
||||
|
||||
public Long getTeacherId() {
|
||||
return teacherId;
|
||||
}
|
||||
|
||||
public void setTeacherId(Long teacherId) {
|
||||
this.teacherId = teacherId;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Integer userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Integer getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Integer roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public Integer getSchoolId() {
|
||||
return schoolId;
|
||||
}
|
||||
|
||||
public void setSchoolId(Integer schoolId) {
|
||||
this.schoolId = schoolId;
|
||||
}
|
||||
|
||||
public String getSchoolName() {
|
||||
return schoolName;
|
||||
}
|
||||
|
||||
public void setSchoolName(String schoolName) {
|
||||
this.schoolName = schoolName;
|
||||
}
|
||||
|
||||
public Integer getClassId() {
|
||||
return classId;
|
||||
}
|
||||
|
||||
public void setClassId(Integer classId) {
|
||||
this.classId = classId;
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public Long getCollegeId() {
|
||||
return collegeId;
|
||||
}
|
||||
|
||||
public void setCollegeId(Long collegeId) {
|
||||
this.collegeId = collegeId;
|
||||
}
|
||||
|
||||
public String getCollegeName() {
|
||||
return collegeName;
|
||||
}
|
||||
|
||||
public void setCollegeName(String collegeName) {
|
||||
this.collegeName = collegeName;
|
||||
}
|
||||
|
||||
public Long getMajorId() {
|
||||
return majorId;
|
||||
}
|
||||
|
||||
public void setMajorId(Long majorId) {
|
||||
this.majorId = majorId;
|
||||
}
|
||||
|
||||
public String getMajorName() {
|
||||
return majorName;
|
||||
}
|
||||
|
||||
public void setMajorName(String majorName) {
|
||||
this.majorName = majorName;
|
||||
}
|
||||
|
||||
|
||||
public ZYUserInfo() {
|
||||
}
|
||||
|
||||
public ZYUserInfo(Map<String, Object> map) {
|
||||
this.username = (String) map.get("username");
|
||||
this.password = (String) map.get("password");
|
||||
this.name = (String) map.get("name");
|
||||
this.userId = (Integer) map.get("userid");
|
||||
this.roleId = Integer.valueOf(map.get("roleid").toString()) ;
|
||||
this.schoolId = Integer.valueOf(map.get("schoolid").toString());
|
||||
this.schoolName = (String) map.get("schoolname");
|
||||
this.classId = Integer.valueOf( map.get("classid").toString());
|
||||
this.className = (String) map.get("classname");
|
||||
this.phone = (String) map.get("phone");
|
||||
this.collegeId = (Long) map.get("collegeid");
|
||||
this.collegeName = (String) map.get("collegename");
|
||||
this.majorId = (Long) map.get("majorid");
|
||||
this.majorName = (String) map.get("majorname");
|
||||
this.studentId = map.get("studentid")==null?0L:(Long) map.get("studentid");
|
||||
this.teacherId = map.get("teacherid")==null?0L:(Long) map.get("teacherid");
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.ibeetl.jlw.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 17803
|
||||
* @date 2024-02-20 9:17
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "业务逻辑图模块内容")
|
||||
public class StuLogicModuleInfoDTO {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "业务名")
|
||||
private String nameInfo;
|
||||
|
||||
@ApiModelProperty(value = "跳转路径")
|
||||
private String redirectUrl;
|
||||
|
||||
@ApiModelProperty(value = "是否可用")
|
||||
private Integer authorityInfo;
|
||||
|
||||
@ApiModelProperty(value = "序号")
|
||||
private Integer order;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.ibeetl.jlw.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.beetl.sql.annotation.entity.EnumMapping;
|
||||
import org.beetl.sql.annotation.entity.EnumValue;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@EnumMapping("text")
|
||||
public enum SubsystemName {
|
||||
|
||||
P2P_NETWORK_LENDING("P2P网络借贷公司"),
|
||||
ARTIFICIAL_INTELLIGENCE_TRAINING("人工智能实训"),
|
||||
CROWDFUNDING_COMPANY("众筹公司"),
|
||||
SUPPLY_CHAIN_FINANCE_COMPANY("供应链金融服务公司"),
|
||||
INSURANCE_COMPANY("保险公司"),
|
||||
BLOCKCHAIN_TECHNOLOGY("区块链技术"),
|
||||
COMMERCIAL_BANK("商业银行"),
|
||||
POLICY_BANK("政策性银行"),
|
||||
CREDIT_COOPERATIVE("信用合作社机构"),
|
||||
FOREIGN_EXCHANGE("外汇"),
|
||||
BIG_DATA_ANALYSIS_MINING("大数据分析挖掘"),
|
||||
BIG_DATA_COLLECTION("大数据采集"),
|
||||
INVESTMENT_BANK("投资银行"),
|
||||
PAYMENT_CLEARING("支付清算"),
|
||||
DIGITAL_CURRENCY("数字人民币"),
|
||||
DIGITAL_ASSETS("数字资产"),
|
||||
DATA_INFORMATION("数据资讯"),
|
||||
SMART_TRADING("智能交易"),
|
||||
SMART_DATA("智能数据"),
|
||||
SMART_FINANCE("智能理财"),
|
||||
SECURITIES("证券/期货/基金/信托/资管公司"),
|
||||
SECURITIES_TRADING("证券交易"),
|
||||
CSRC("证监会、银保监会、行业协会"),
|
||||
RISK_MANAGEMENT("风险管理");
|
||||
|
||||
|
||||
|
||||
@EnumValue
|
||||
private String text;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getText();
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ibeetl.jlw.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public class BXApiUtil {
|
||||
|
||||
|
||||
public static int createBxClass(String className, Integer icibtSchoolId) {
|
||||
String request = HttpJsonRequest.sendPostRequest("http://120.79.161.177:8183/SignIn/AddClass", null, "{'ClassName':'" + className + "','SchoolId': " + icibtSchoolId + "}", "application/json");
|
||||
JSONObject jsonObject = JSONObject.parseObject(request);
|
||||
String schoolId = jsonObject.getString("schoolClassId");
|
||||
if (schoolId != null) {
|
||||
return Integer.parseInt(schoolId);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.ibeetl.jlw.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
public class HttpUtil {
|
||||
|
||||
public static String sendPostRequest(String url, String postData) {
|
||||
try {
|
||||
URL apiUrl = new URL(url);
|
||||
|
||||
HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
connection.setRequestProperty("Content-Length", String.valueOf(postData.length()));
|
||||
connection.setDoOutput(true);
|
||||
|
||||
try (OutputStream os = connection.getOutputStream()) {
|
||||
byte[] input = postData.getBytes("UTF-8");
|
||||
os.write(input, 0, input.length);
|
||||
}
|
||||
|
||||
int responseCode = connection.getResponseCode();
|
||||
StringBuilder response = new StringBuilder();
|
||||
if (responseCode == HttpURLConnection.HTTP_OK) {
|
||||
try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
|
||||
String inputLine;
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getErrorStream()))) {
|
||||
String inputLine;
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
}
|
||||
System.out.println("接口请求错误:" + responseCode);
|
||||
}
|
||||
|
||||
return response.toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static String sendPostRequest(String url, String postData,String contentType) {
|
||||
try {
|
||||
URL apiUrl = new URL(url);
|
||||
|
||||
HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", contentType);
|
||||
connection.setRequestProperty("Content-Length", String.valueOf(postData.length()));
|
||||
connection.setDoOutput(true);
|
||||
|
||||
try (OutputStream os = connection.getOutputStream()) {
|
||||
byte[] input = postData.getBytes("UTF-8");
|
||||
os.write(input, 0, input.length);
|
||||
}
|
||||
|
||||
int responseCode = connection.getResponseCode();
|
||||
StringBuilder response = new StringBuilder();
|
||||
if (responseCode == HttpURLConnection.HTTP_OK) {
|
||||
try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
|
||||
String inputLine;
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getErrorStream()))) {
|
||||
String inputLine;
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
}
|
||||
System.out.println("接口请求错误:" + responseCode);
|
||||
}
|
||||
|
||||
return response.toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.ibeetl.jlw.util;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ibeetl.admin.core.util.user.ZYUserInfo;
|
||||
import com.ibeetl.jlw.enums.SubsystemName;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SubsystemUserUtil {
|
||||
@Value("${PEVC_USER_INSERT_API_URL}")
|
||||
private static String pevcUserInsertApiUrl;
|
||||
@Value("${MNJY_USER_INSERT_API_URL}")
|
||||
private static String mnjyUserInsertApiUrl;
|
||||
|
||||
public static void subsystemUserCreate(List<ZYUserInfo> zyUserInfos, List<String> applications) throws JsonProcessingException {
|
||||
if (zyUserInfos != null && zyUserInfos.size() > 0) {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String json = objectMapper.writeValueAsString(zyUserInfos);
|
||||
if (applications.contains(SubsystemName.INVESTMENT_BANK.getText())) {
|
||||
//PEVC系统新增用户信息
|
||||
HttpUtil.sendPostRequest(pevcUserInsertApiUrl, json, "application/json");
|
||||
}
|
||||
if (applications.contains(SubsystemName.SECURITIES_TRADING.getText())) {
|
||||
//MNJY系统新增用户信息
|
||||
HttpUtil.sendPostRequest(mnjyUserInsertApiUrl, json, "application/json");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue