新增子系统用户

beetlsql3-dev
chenyuan 12 months ago
parent 4ebe2458dc
commit c4d773e9f5

@ -21,7 +21,6 @@ import static com.ibeetl.admin.core.service.CorePlatformService.DICT_CACHE_FIND_
public interface CoreDictDao extends BaseMapper<CoreDict> {
/**
*
* @param type

@ -104,6 +104,7 @@ public class CoreDictService extends CoreBaseService<CoreDict> {
param[i] = param[i].contains("=") && !param[i].contains("find_in_set")?(param[i].replace("=","='").replace(",","',")+ (StringUtils.isBlank(param[i])?"":"'")):param[i];
}
}
System.out.println("导致堆栈空间不足-----------------------------------------------------------------------------------");
return dictDao.findALlListByTable(idName,filedName,tableCode,tableName,param);
}else {
return new ArrayList<>();

@ -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");
}
}

@ -255,7 +255,7 @@ getUserInfoByUsername
===
select cu.CODE as username,
cu.PASSWORD as password,
cu.NAME as name,
IF(s.student_name IS NULL, t.teacher_name, s.student_name) as name,
cu.old_id as userId,
if(cur.ROLE_ID = 192, 4, 3) as roleId,
uc.old_school_id as schoolId,
@ -266,7 +266,9 @@ IF(s.student_mobile IS NULL, t.teacher_mobile, s.student_mobile)
IF(uf.old_id is null, uf1.old_id, uf.old_id) as collegeId,
IF(uf.university_faculty_name is null, uf1.university_faculty_name, uf.university_faculty_name) as collegeName,
IF(us.old_id is null, us1.old_id, us.old_id) as majorId,
IF(us.university_system_name is null, us1.university_system_name, us.university_system_name) as majorName
IF(us.university_system_name is null, us1.university_system_name, us.university_system_name) as majorName,
s.old_id as studentId,
t.old_id as teacherId
from core_user cu
join universities_colleges uc on cu.ORG_ID = uc.org_id
left join student s on cu.ID = s.user_id

@ -112,7 +112,8 @@ public class InterceptorConfig implements WebMvcConfigurer, InitializingBean {
"/**/externalApi/**",
"/wx",
"/test/**",
"/account/**"
"/account/**",
"/api/resourcesApplication/logicPicture.json"
// "/upload/**"
)
.excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**").order(1);

@ -1,6 +1,8 @@
package com.ibeetl.jlw.dao;
import com.ibeetl.jlw.entity.ResourcesApplication;
import com.ibeetl.jlw.entity.dto.StuLogicModuleInfoDTO;
import com.ibeetl.jlw.entity.dto.StuLogicPictureDTO;
import com.ibeetl.jlw.web.query.ResourcesApplicationQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.mapper.BaseMapper;
@ -9,6 +11,7 @@ import org.beetl.sql.mapper.annotation.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
@ -33,4 +36,7 @@ public interface ResourcesApplicationDao extends BaseMapper<ResourcesApplication
PageQuery<ResourcesApplication> queryMyApplicationByConditionQuery(PageQuery query);
List<ResourcesApplication> getValuesByQuery(ResourcesApplicationQuery query);
List<StuLogicPictureDTO> logicPicture();
List<StuLogicModuleInfoDTO> logicPictureByName(String name);
}

@ -53,4 +53,6 @@ public interface UniversitiesCollegesJurisdictionExperimentalSystemDao extends B
List<UniversitiesCollegesJurisdictionExperimentalSystem> getNotExpireApply( @Param("orgId") Long orgId , @Param("typeId") String typeIds);
List<UniversitiesCollegesJurisdictionExperimentalSystem>forexSimulationTradingAuthorizationSchoolDataInterface();
List<String> getAllApplicationIdBySchoolId(Long schoolId);
}

@ -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,27 @@
package com.ibeetl.jlw.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author 17803
* @date 2024-02-20 9:08
*/
@Data
@ApiModel(description = "业务逻辑图数据")
public class StuLogicPictureDTO {
@ApiModelProperty(value = "模块名")
private String moduleName;
@ApiModelProperty(value = "序号(`用来排序`")
private Integer order;
@ApiModelProperty(value = "模块内容")
private List<StuLogicModuleInfoDTO> moduleInfoDTOList;
}

@ -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();
}
}

@ -20,6 +20,8 @@ import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.jlw.dao.*;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.entity.dto.StuLogicModuleInfoDTO;
import com.ibeetl.jlw.entity.dto.StuLogicPictureDTO;
import com.ibeetl.jlw.web.query.ResourcesApplicationQuery;
import org.beetl.sql.core.SqlId;
import org.beetl.sql.core.engine.PageQuery;
@ -30,10 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
import static cn.hutool.core.util.ObjectUtil.defaultIfBlank;
@ -454,5 +453,15 @@ public class ResourcesApplicationService extends CoreBaseService<ResourcesApplic
}
}
public List<StuLogicPictureDTO> logicPicture(){
List<StuLogicPictureDTO> pics = resourcesApplicationDao.logicPicture();
if(pics!=null&&pics.size()>0){
for(StuLogicPictureDTO dto:pics){
dto.setModuleInfoDTOList(resourcesApplicationDao.logicPictureByName(dto.getModuleName())); ;
}
}
return pics;
}
}

@ -7,11 +7,15 @@ import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.pinyin.PinyinUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSONObject;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.jlw.dao.SchoolClassDao;
import com.ibeetl.jlw.entity.SchoolClass;
import com.ibeetl.jlw.entity.UniversitiesColleges;
import com.ibeetl.jlw.util.BXApiUtil;
import com.ibeetl.jlw.util.BxJDBCUtil;
import com.ibeetl.jlw.util.HttpJsonRequest;
import com.ibeetl.jlw.web.query.SchoolClassQuery;
import org.beetl.sql.core.SqlId;
import org.beetl.sql.core.engine.PageQuery;
@ -206,11 +210,21 @@ public class SchoolClassService extends CoreBaseService<SchoolClass> {
insertSchoolClass.setAddTime(new Date());
insertSchoolClass.setOrgId(orgId);
insertSchoolClass.setUserId(userId);
Integer icibtClassId = BXApiUtil.createBxClass(schoolClass.getClassName(), universitiesColleges.getIcibtSchoolId());
insertSchoolClass.setIcibtClassId(icibtClassId);
insert(insertSchoolClass);
SchoolClass s = new SchoolClass();
s.setClassId(insertSchoolClass.getClassId());
s.setOldClassId(insertSchoolClass.getClassId()+1500);
schoolClassDao.updateTemplateById(s);
insertSchoolClass.setOldClassId(s.getOldClassId());
return insertSchoolClass;
}
/**
*
*

@ -21,6 +21,7 @@ import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.*;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.enums.AccountTypeEnum;
import com.ibeetl.jlw.util.HttpUtil;
import com.ibeetl.jlw.web.query.ResourcesApplicationCourseQuery;
import com.ibeetl.jlw.web.query.ResourcesApplicationQuery;
import com.ibeetl.jlw.web.query.StudentAccountAssetAllocationQuery;
@ -698,7 +699,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
"&majorName=" + majorName +
"&studentNumber=" + studentNumber +
"&initialCapital=" + initialCapital;
String result = sendPostRequest("http://120.79.54.255:8801/account/checkOrCreateForexSimulationUser", postData);
String result = HttpUtil.sendPostRequest("http://120.79.54.255:8801/account/checkOrCreateForexSimulationUser", postData);
// 使用 Gson 将 JSON 字符串解析为一个 Map 对象
Type type = new TypeToken<Map<String, Object>>() {
}.getType();
@ -782,7 +783,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
"VALUES (" + applicationId + ", " + initialCapital + ", " + initialCapital + ", "
+ initialCapital + ", 0, 0, 0, 0, 0, " + initialCapital + ", 0, 0, 0, 0, 0, 0, " + oldUserId + ", " +
"'0', NULL, NULL, NULL, NULL, '" + formattedDate + "', " + oldUserId + ")";
sendPostRequest("http://120.79.161.177:8029/Account/InsertPevcFunding", "UserId=" + oldUserId);
HttpUtil.sendPostRequest("http://120.79.161.177:8029/Account/InsertPevcFunding", "UserId=" + oldUserId);
}
runJdbc(sql);
}
@ -892,7 +893,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
} else {
postData = "UserId=" + coreUser.getId() + "&&Money=" + money + "&&CZId=" + 2;
}
String result = sendPostRequest(url, postData);
String result = HttpUtil.sendPostRequest(url, postData);
StudentAccountAssetAllocationQuery updateQuery = new StudentAccountAssetAllocationQuery();
updateQuery.setApplicationId(Long.valueOf(18));
updateQuery.setStudentId(studentId);
@ -993,43 +994,7 @@ public class StudentAccountAssetAllocationService extends CoreBaseService<Studen
return studentAccountAssetAllocationDao.getInfoByStudentIdAnIsInstitution(studentId);
}
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();
if (responseCode == HttpURLConnection.HTTP_OK) {
try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
return response.toString();
}
} else {
System.out.println("接口请求错误:" + responseCode);
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
*

@ -5,15 +5,20 @@ import cn.hutool.core.collection.CollUtil;
import cn.jlw.util.ToolUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.service.CorePlatformService;
import com.ibeetl.admin.core.service.CoreUserService;
import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.util.TimeTool;
import com.ibeetl.admin.core.util.user.ZYUserInfo;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.dao.UniversitiesCollegesJurisdictionExperimentalSystemDao;
import com.ibeetl.jlw.entity.Student;
import com.ibeetl.jlw.entity.UniversitiesColleges;
import com.ibeetl.jlw.entity.UniversitiesCollegesJurisdictionCurriculumResources;
import com.ibeetl.jlw.entity.UniversitiesCollegesJurisdictionExperimentalSystem;
import com.ibeetl.jlw.util.SubsystemUserUtil;
import com.ibeetl.jlw.web.query.UniversitiesCollegesJurisdictionCurriculumResourcesQuery;
import com.ibeetl.jlw.web.query.UniversitiesCollegesJurisdictionExperimentalSystemQuery;
import org.beetl.sql.core.SqlId;
@ -23,10 +28,7 @@ import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
import static cn.hutool.core.date.DateTime.now;
@ -51,6 +53,10 @@ public class UniversitiesCollegesJurisdictionExperimentalSystemService extends C
@Autowired
private StudentAccountAssetAllocationService studentAccountAssetAllocationService;
@Autowired
private StudentService studentService;
@Autowired
private CoreUserService coreUserService;
public PageQuery<UniversitiesCollegesJurisdictionExperimentalSystem>queryByCondition(PageQuery query){
PageQuery ret = universitiesCollegesJurisdictionExperimentalSystemDao.queryByCondition(query);
@ -115,6 +121,22 @@ public class UniversitiesCollegesJurisdictionExperimentalSystemService extends C
}
if(universitiesCollegesJurisdictionExperimentalSystemList.size()>0){
this.insertBatch(universitiesCollegesJurisdictionExperimentalSystemList);
//子系统添加用户数据
List<Map<String,Object>> students = studentService.findAllBySchoolId(universitiesCollegesId);
if(null != students && students.size()>0){
List<ZYUserInfo> userInfos = new ArrayList<>();
for(Map<String,Object> student : students){
Map<String, Object> map = coreUserService.getUserInfoByUsername(String.valueOf(student.get("studentNo")));
ZYUserInfo info = new ZYUserInfo(map);
userInfos.add(info);
}
List<String> applications = getAllApplicationIdBySchoolId(universitiesCollegesId);
try {
SubsystemUserUtil.subsystemUserCreate(userInfos,applications);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
//应用授权后开通资金账户权限
studentAccountAssetAllocationService.updateApplicationAuthority(uc.getOrgId());
}
@ -192,4 +214,8 @@ public class UniversitiesCollegesJurisdictionExperimentalSystemService extends C
public List<UniversitiesCollegesJurisdictionExperimentalSystem> forexSimulationTradingAuthorizationSchoolDataInterface(){
return universitiesCollegesJurisdictionExperimentalSystemDao.forexSimulationTradingAuthorizationSchoolDataInterface();
}
public List<String> getAllApplicationIdBySchoolId(Long schoolId){
return universitiesCollegesJurisdictionExperimentalSystemDao.getAllApplicationIdBySchoolId(schoolId);
}
}

@ -231,6 +231,11 @@ public class UniversityFacultyService extends CoreBaseService<UniversityFaculty>
faculty.setOrgId(orgId);
insert(faculty);
UniversityFaculty f = new UniversityFaculty();
f.setUniversityFacultyId(faculty.getUniversityFacultyId());
f.setOldId(f.getUniversityFacultyId()+500);
universityFacultyDao.updateTemplateById(f);
faculty.setOldId(f.getOldId());
return faculty;
}

@ -203,6 +203,11 @@ public class UniversitySystemService extends CoreBaseService<UniversitySystem>{
system.setOrgId(orgId);
insert(system);
UniversitySystem s = new UniversitySystem();
s.setUniversitySystemId(system.getUniversitySystemId());
s.setOldId(system.getUniversitySystemId()+500);
universitySystemDao.updateTemplateById(s);
system.setOldId(s.getOldId());
return system;
}

@ -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;
}
}
}

@ -37,4 +37,7 @@ public class BxJDBCUtil {
}
}
}
}

@ -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");
}
}
}
}

@ -5,11 +5,14 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.service.CoreUserService;
import com.ibeetl.admin.core.util.user.ZYUserInfo;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.query.CustomFilterByLcUser;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.enums.AccountTypeEnum;
import com.ibeetl.jlw.service.*;
import com.ibeetl.jlw.util.HttpJsonRequest;
import com.ibeetl.jlw.util.HttpUtil;
import com.ibeetl.jlw.web.query.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -18,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.security.MessageDigest;
import java.sql.*;
import java.util.ArrayList;
import java.util.HashMap;
@ -210,7 +214,7 @@ public class AccountController {
if (applicationId == -1) {
allocationQuery.setApplicationId(Long.valueOf(-1));
allocationQuery.setName(AccountTypeEnum.BANK_ACCOUNT);
} else if (applicationId == 4) {
} else if (applicationId == 4) {
allocationQuery.setApplicationId(Long.valueOf(4));
allocationQuery.setName(AccountTypeEnum.P2P_ACCOUNT);
StudentAccountCrowdfundingSystem info = studentAccountCrowdfundingSystemService.getInfo(student.getStudentId());
@ -1345,8 +1349,69 @@ public class AccountController {
@ApiOperation("根据学校id查询用户数据")
@GetMapping("getUsersBySchoolId.json")
public JsonResult<List<Map<String, Object>>> getUsersBySchoolId(Long schoolId){
public JsonResult<List<Map<String, Object>>> getUsersBySchoolId(Long schoolId) {
return JsonResult.success(userService.getUsersBySchoolId(schoolId));
}
@ApiOperation("创建保险用户")
@PostMapping("createInsuranceUser")
public void createInsuranceUser(Long classId, Integer icibtClassId) {
StudentQuery query = new StudentQuery();
query.setClassId(classId);
List<Student> students = studentService.getValuesByQuery(query);
for (Student s : students) {
createBxStudent(69, icibtClassId, s.getStudentSn(), s.getStudentName(), 1);
}
}
public void createBxStudent(Integer icibtSchoolId, Integer icibtClassId, String studentNo, String name, Integer sex) {
String PostData = "{'LoginName':'" + studentNo + "','Password':'" +
encryptToMD5("123qwe") + "','Name':'" + name + "','Sex':'" +
sex + "','SchoolNumber':'" + studentNo + "','RoleId':'" + 4 + "','SchoolId':'" +
icibtSchoolId + "','SchoolClassId':[" + icibtClassId + "]}";
String request = HttpJsonRequest.sendPostRequest("http://120.79.161.177:8183/SignIn/AddUser", null, PostData, "application/json");
}
public static String encryptToMD5(String input) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] messageDigest = md.digest(input.getBytes());
StringBuilder hexString = new StringBuilder();
for (byte b : messageDigest) {
String hex = Integer.toHexString(0xff & b);
if (hex.length() == 1) {
hexString.append('0');
}
hexString.append(hex).append('-');
}
hexString.deleteCharAt(hexString.length() - 1); // 移除末尾多余的连字符
return hexString.toString().toUpperCase(); // 转换为大写形式
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@ApiOperation("测试子系统用户传输")
@PostMapping("test1")
public void test() throws JsonProcessingException {
Map<String, Object> map = coreUserService.getUserInfoByUsername("tzs001");
Map<String, Object> map1 = coreUserService.getUserInfoByUsername("tzs006");
ZYUserInfo info = new ZYUserInfo(map);
ZYUserInfo info1 = new ZYUserInfo(map1);
List<ZYUserInfo> userInfoList = new ArrayList<>();
userInfoList.add(info);
userInfoList.add(info1);
ObjectMapper objectMapper = new ObjectMapper();
String json = objectMapper.writeValueAsString(userInfoList);
// HttpUtil.sendPostRequest("http://localhost:61814/account/saveNewUsersFromZhiyunPlatform", json,"application/json");
HttpUtil.sendPostRequest("http://localhost:61759/account/saveNewUsersFromZhiyunPlatform", json,"application/json");
// String request = HttpUtil.sendPostRequest("http://118.31.7.2:8800/account/checkOrCreateForexSimulationUser", json, "application/json");
int a = 0;
}
}

@ -11,16 +11,20 @@ import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.entity.ResourcesApplication;
import com.ibeetl.jlw.entity.Student;
import com.ibeetl.jlw.entity.Teacher;
import com.ibeetl.jlw.entity.dto.StuLogicModuleInfoDTO;
import com.ibeetl.jlw.entity.dto.StuLogicPictureDTO;
import com.ibeetl.jlw.service.LoginTodoService;
import com.ibeetl.jlw.service.ResourcesApplicationService;
import com.ibeetl.jlw.service.SysLogService;
import com.ibeetl.jlw.web.query.ResourcesApplicationQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -221,4 +225,28 @@ public class ResourcesApplicationController{
public JsonResult getLoginTodo() {
return JsonResult.success(loginTodoService.buildByCurrentLoginUser());
}
@ApiOperation("业务逻辑图详情")
@ResponseBody
@GetMapping(API + "/logicPicture.json")
public JsonResult<List<StuLogicPictureDTO>> logicPicture(@SCoreUser CoreUser coreUser){
List<StuLogicPictureDTO> logicPictureDTOList = resourcesApplicationService.logicPicture();
String token = resourcesApplicationService.getKeyByCurrentUser(118L, "zy_szjj_c1fqkcgekg1icu7ddp8qiho0u");
if (logicPictureDTOList!=null&&logicPictureDTOList.size()>0)
{
for(StuLogicPictureDTO d:logicPictureDTOList){
for(StuLogicModuleInfoDTO dto:d.getModuleInfoDTOList()){
StringBuffer sb = new StringBuffer();
sb.append(dto.getRedirectUrl());
sb.append("?token=");
sb.append(token);
dto.setRedirectUrl(sb.toString());
}
}
return JsonResult.success(logicPictureDTOList);
}
return JsonResult.failMessage("获取失败");
}
}

@ -23,6 +23,7 @@ import com.ibeetl.jlw.entity.dto.SchoolClassBatchImportDTO;
import com.ibeetl.jlw.service.SchoolClassService;
import com.ibeetl.jlw.service.UniversitiesCollegesService;
import com.ibeetl.jlw.service.UniversitySystemService;
import com.ibeetl.jlw.util.BXApiUtil;
import com.ibeetl.jlw.util.HttpJsonRequest;
import com.ibeetl.jlw.web.query.SchoolClassQuery;
import io.swagger.annotations.Api;
@ -215,7 +216,7 @@ public class SchoolClassController extends BaseController {
if (StrUtil.isNotBlank(schoolClass.getClassSn())) {
schoolClassService.validateClassSnListIsExistsThrow(Collections.singletonList(schoolClass), universitiesColleges.getOrgId().toString());
}
icibtClassId = createBxClass(schoolClass.getClassName(), universitiesColleges.getIcibtSchoolId());
icibtClassId = BXApiUtil.createBxClass(schoolClass.getClassName(), universitiesColleges.getIcibtSchoolId());
} else {
UniversitiesColleges universitiesColleges = new UniversitiesColleges();
universitiesColleges.setOrgId(coreUser.getOrgId());
@ -226,13 +227,11 @@ public class SchoolClassController extends BaseController {
schoolClass.setClassSn(uniqueClassSn);
schoolClass.setUniversitiesCollegesId(universitiesColleges.getUniversitiesCollegesId());
schoolClass.setOrgId(universitiesColleges.getOrgId());
icibtClassId = createBxClass(schoolClass.getClassName(), universitiesColleges.getIcibtSchoolId());
icibtClassId = BXApiUtil.createBxClass(schoolClass.getClassName(), universitiesColleges.getIcibtSchoolId());
}
}
schoolClassService.save(schoolClass);
SchoolClass newClass = new SchoolClass();
newClass.setIcibtClassId(icibtClassId);
newClass.setClassId(schoolClass.getClassId());
@ -244,16 +243,7 @@ public class SchoolClassController extends BaseController {
}
private 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;
}
}
@PostMapping(MODEL + "/edit.json")
@Function("schoolClass.edit")
@ResponseBody

File diff suppressed because it is too large Load Diff

@ -16,6 +16,7 @@ import com.ibeetl.jlw.entity.dto.CreateUserDTO;
import com.ibeetl.jlw.enums.AccountTypeEnum;
import com.ibeetl.jlw.enums.GenderEnum;
import com.ibeetl.jlw.service.*;
import com.ibeetl.jlw.util.HttpUtil;
import com.ibeetl.jlw.util.ZhiYunJDBCUtil;
import com.ibeetl.jlw.web.query.*;
import io.swagger.annotations.Api;
@ -38,7 +39,6 @@ import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static com.ibeetl.jlw.service.StudentAccountAssetAllocationService.sendPostRequest;
@Api(tags = "数据迁移")
@RestController
@ -517,7 +517,7 @@ public class TestController {
" JOIN EduMajors maj ON stu.MajorId = maj.Id " +
" JOIN EduSchools sch ON stu.SchoolId = sch.Id " +
" JOIN EduClasses cla ON stu.ClassId = cla.Id" +
" join EduUsers us on stu.StudentNo = us.UserName where stu.isdeleted=0";
" join EduUsers us on stu.StudentNo = us.UserName where stu.isdeleted=0 ";
ps = conn.prepareStatement(sql);
ResultSet resultSet = ps.executeQuery();
int i = 0;
@ -1629,7 +1629,7 @@ public class TestController {
"&majorName=" + majorName +
"&studentNumber=" + studentNumber +
"&initialCapital=" + initialCapital;
String result = sendPostRequest("http://localhost:8801/account/checkOrCreateForexSimulationUser", postData);
String result = HttpUtil.sendPostRequest("http://localhost:8801/account/checkOrCreateForexSimulationUser", postData);
// 使用 Gson 将 JSON 字符串解析为一个 Map 对象
Type type = new TypeToken<Map<String, Object>>() {
}.getType();
@ -1655,4 +1655,23 @@ public class TestController {
}
}
}
@ApiOperation("去除用户名空格")
@PostMapping("removeNameSpace")
public void removeNameSpace(Long classId) {
StudentQuery q = new StudentQuery();
q.setClassId(classId);
List<Student> students = studentService.getValuesByQuery(q) ;
if (students != null && students.size() > 0) {
for (Student student : students) {
CoreUser coreUser = coreUserService.getUserById(student.getUserId());
if (coreUser != null) {
coreUser.setCode(coreUser.getCode().replaceAll("\\D+", ""));
coreUserService.updateTemplateById(coreUser);
}
student.setStudentSn(student.getStudentSn().replaceAll("\\D+", ""));
studentService.updateTemplate(student);
}
}
}
}

@ -138,3 +138,6 @@ logistics.customer = 90F883EF5EB30F659B5B44173E01C8A6
# vue \u9884\u89C8url
vue_next_home=http://localhost:10000/jlw/next-home
vue_next_goods_filter_prefix=http://localhost:10000/jlw/next-goodsList?exhibitionType=1&exhibitionId=
PEVC_USER_INSERT_API_URL="http://localhost:61814/account/saveNewUsersFromZhiyunPlatform"
MNJY_USER_INSERT_API_URL="http://localhost:61759/account/saveNewUsersFromZhiyunPlatform"

@ -302,3 +302,11 @@ getValuesByQuery
@if(!isEmpty(linkSecretKey)){
and t.link_secret_key =#linkSecretKey#
@}
logicPicture
===
select module_name,module_order as 'order' from stu_logic_picture_info group by module_name,module_order
logicPictureByName
===
select name_info, redirect_url, authority_info, sequencys as 'order', module_name, module_order from stu_logic_picture_info where module_name=#name# ORDER BY module_order ASC ,sequencys ASC

@ -268,3 +268,10 @@ AND a.use_end_time >= NOW()
forexSimulationTradingAuthorizationSchoolDataInterface
===
select * from universities_colleges_jurisdiction_experimental_system where type_id=113
getAllApplicationIdBySchoolId
===
select ra.application_second_level_relation
from universities_colleges_jurisdiction_experimental_system ues join resources_application ra on ues.type_id = ra.resources_application_id
where universities_colleges_id =#schoolId#;
Loading…
Cancel
Save