修改实务认知得分和智能评分规则

master
xiaoCJ 7 months ago
parent ceb1613f62
commit a8ac1aa1ad

@ -132,7 +132,7 @@ public class TokenProvider {
//生成智云平台32字节密钥
public static void main(String[] args) {
getJWTUserByZhiYun("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjb2xsZWdlIjoi5ryU56S65a2m6ZmiIiwiaWNpYnRTY2hvb2xJZCI6NCwibWQ1UHdkIjoiNDYtRjktNEMtOEQtRTEtNEYtQjMtNjYtODAtODUtMDctNjgtRkYtMUItN0YtMkEiLCJyb2xlaWQiOiI0Iiwic2V4Ijoi55S3IiwidXNlcklkIjoiNDkyIiwic3R1ZGVudElkIjoiNDA1MSIsInBhc3N3b3JkIjoiMTIzcXdlIiwiY2xhc3NJZCI6IjIxNiIsImljaWJ0Q2xhc3NJZCI6MjA5LCJtYWpvciI6IuS6p-WTgea8lOekuuS4k-S4miIsInNjaG9vbCI6IuWkqeaLqeWkp-WtpiIsInNjaG9vbElkIjoiMjMyIiwibmFtZSI6InR6czAwNiIsInN0dWRlbnRObyI6InR6czAwNiIsImFwcGxpY2F0aW9uSWQiOiIxMjIiLCJjbGFzcyI6IuWkqeaLqea8lOekujbnj60iLCJ1c2VybmFtZSI6InR6czAwNiJ9.P6EmI0cQoAZwuoPJrwRjtjZNSCANUtxcRebQTtm0HOI");
getJWTUserByZhiYun("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjb2xsZWdlIjoi5ryU56S65a2m6ZmiIiwiaWNpYnRTY2hvb2xJZCI6NCwibWQ1UHdkIjoiNDYtRjktNEMtOEQtRTEtNEYtQjMtNjYtODAtODUtMDctNjgtRkYtMUItN0YtMkEiLCJyb2xlaWQiOiI0Iiwic2V4Ijoi55S3IiwidXNlcklkIjoiNDkyIiwic3R1ZGVudElkIjoiNDA1MSIsInBhc3N3b3JkIjoiMTIzcXdlIiwiY2xhc3NJZCI6IjIxNiIsImljaWJ0Q2xhc3NJZCI6MjA5LCJtYWpvciI6IuS6p-WTgea8lOekuuS4k-S4miIsInNjaG9vbCI6IuWkqeaLqeWkp-WtpiIsInNjaG9vbElkIjoiMjMyIiwibmFtZSI6InR6czAwNiIsInN0dWRlbnRObyI6InR6czAwNiIsImFwcGxpY2F0aW9uSWQiOiIxMjIiLCJjbGFzcyI6IuWkqeaLqea8lOekujbnj60iLCJ1c2VybmFtZSI6InR6czAwNiJ9.252uWMvke17Es1P82g3xHMTx6yfAGKt0jU3Q0TJC_9I");
// String prefix = "zy_wh_mnjy_";
// String generatedKey = generateKey(prefix);
// System.out.println("Generated Key: " + generatedKey);

@ -7,10 +7,7 @@ import com.sztzjy.fund_investment.config.exception.UnAuthorizedException;
import com.sztzjy.fund_investment.config.security.JwtUser;
import com.sztzjy.fund_investment.config.security.LoginResult;
import com.sztzjy.fund_investment.config.security.TokenProvider;
import com.sztzjy.fund_investment.entity.Flow;
import com.sztzjy.fund_investment.entity.PerformanceScore;
import com.sztzjy.fund_investment.entity.PerformanceScoreExample;
import com.sztzjy.fund_investment.entity.User;
import com.sztzjy.fund_investment.entity.*;
import com.sztzjy.fund_investment.entity.dto.EvaluationLevel;
import com.sztzjy.fund_investment.entity.dto.PerformanceTrainingScoreDto;
import com.sztzjy.fund_investment.mapper.FlowMapper;
@ -31,10 +28,7 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.lang.reflect.Field;
@ -226,6 +220,47 @@ public class UserController {
}
@ApiOperation("根据用户Code查询该用户是否存在个人赛用户数据存在则返回不存在则新增后返回用于智云3.0创建用户后调用该接口创建用户个人赛")
@PostMapping("/checkOrCreateForexSimulationUser")
@AnonymousAccess
public String checkOrCreateForexSimulationUser(@RequestBody List<ZYUserInfo> zyUserInfoList) {
List<User> users = new ArrayList<>();
for (int i = 0; i < zyUserInfoList.size(); i++) {
ZYUserInfo zyUserInfo = zyUserInfoList.get(i);
Integer zyUserId = zyUserInfo.getUserId();
String username = zyUserInfo.getUsername(); // studentid
User user = userMapper.selectByPrimaryKey(String.valueOf(zyUserId));
if (user != null) {
continue;
}
User stuUser = new User();
stuUser.setUserid(String.valueOf(zyUserId));
stuUser.setStudentId(zyUserInfo.getUsername());
stuUser.setName(zyUserInfo.getName());
stuUser.setUsername(username);
stuUser.setClassId(zyUserInfo.getClassId().toString());
stuUser.setClassName(zyUserInfo.getClassName());
stuUser.setPassword(zyUserInfo.getPassword());
stuUser.setPhone(zyUserInfo.getPhone());
stuUser.setRoleId( zyUserInfo.getRoleId()); //3教师 4学生
stuUser.setSchoolId(zyUserInfo.getSchoolId().toString());
stuUser.setSchoolName(zyUserInfo.getSchoolName());
stuUser.setCreateTime(new Date());
users.add(stuUser);
}
if (users.isEmpty()) {
return "账号已全部存在";
}
try {
userMapper.batchInsertStudents(users);
return "ok";
} catch (Exception e) {
e.printStackTrace();
return "false";
}
}
/* MAPflow
* @author xcj
* @Date 2024/1/3

@ -0,0 +1,25 @@
package com.sztzjy.fund_investment.entity;
import lombok.Data;
/**
* @Author xcj
* @Date 2024/8/7
*/
@Data
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;
}

@ -41,4 +41,5 @@ public interface UserMapper {
List<UserDto>getStudentScoreDetails(@Param("schoolId") String schoolId, @Param("classId")String classId, @Param("studentIdOrName")String studentIdOrName);
void batchInsertStudents(@Param("list") List<User> users);
}

@ -37,7 +37,8 @@
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
@ -66,7 +67,8 @@
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
@ -78,7 +80,8 @@
</where>
</sql>
<sql id="Base_Column_List">
userid, name, student_id, class_name, class_id, username, password, phone, role_id,
userid
, name, student_id, class_name, class_id, username, password, phone, role_id,
create_time, school_id, school_name, un, dis, access_token, login_type
</sql>
@ -89,7 +92,8 @@
where un = #{un,jdbcType=VARCHAR}
</select>
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.UserExample" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.UserExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
@ -110,7 +114,8 @@
where userid = #{userid,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from wx_user
delete
from wx_user
where userid = #{userid,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.UserExample">
@ -236,7 +241,8 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.UserExample" resultType="java.lang.Long">
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.UserExample"
resultType="java.lang.Long">
select count(*) from wx_user
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
@ -431,4 +437,17 @@
</select>
<insert id="batchInsertStudents" parameterType="java.util.List">
insert into wx_user (userid, name, student_id,
class_name, class_id, username,
password, phone, role_id,
create_time, school_id, school_name)
values
<foreach collection="list" item="student" separator=",">
(#{student.userid,jdbcType=VARCHAR}, #{student.name,jdbcType=VARCHAR}, #{student.studentId,jdbcType=VARCHAR},
#{student.className,jdbcType=VARCHAR}, #{student.classId,jdbcType=VARCHAR}, #{student.username,jdbcType=VARCHAR},
#{student.password,jdbcType=VARCHAR}, #{student.phone,jdbcType=VARCHAR}, #{student.roleId,jdbcType=INTEGER},
#{student.createTime,jdbcType=TIMESTAMP}, #{student.schoolId,jdbcType=VARCHAR}, #{student.schoolName,jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
Loading…
Cancel
Save