新增退出时机表,完成投资报告页面接口

master
xiaoCJ 1 year ago
parent 7146b60e08
commit a66950f786

@ -31,7 +31,7 @@ import java.util.List;
* @date 2023/12/5 8:46
*/
@RestController
@RequestMapping("/inquiryIssuance")
@RequestMapping("/stu/inquiryIssuance")
@Api(tags = "学生端--询价发行")
public class InquiryIssuanceController {
@Resource

@ -51,17 +51,18 @@ public class ProfitManagementController {
@ApiOperation("显示股票相关信息弹窗")
@AnonymousAccess
@GetMapping("/getStockInfo")
public ResultEntity<String> getStockInfo(@RequestParam String flowId) {
return null;
public ResultEntity<ProfitManagement> getStockInfo(@ApiParam("getLineChart返回的Id") @RequestParam String id) {
return new ResultEntity<>(profitManagementService.getStockInfo(id));
}
@ApiOperation("判断市值和基金收益对错")
@AnonymousAccess
@GetMapping("/getRightMarketValueAndFundEarnings")
public ResultEntity<String> getStockInfo(@RequestParam String flowId,
@ApiParam("市值") @RequestParam String marketValue,
@ApiParam("基金收益") @RequestParam String fundEarnings) {
public ResultEntity getStockInfo(@RequestParam @ApiParam("getLineChart返回的Id") String id,
@ApiParam("用户输入的市值") @RequestParam String userMarketValue,
@ApiParam("用户输入的基金收益") @RequestParam String userFundEarnings) {
profitManagementService.getRightMarketValueAndFundEarnings(id, userMarketValue, userFundEarnings);
return null;
}
}

@ -41,7 +41,7 @@ import java.util.List;
@RestController
@RequestMapping("/stu/projectDueDiligenceController")
@Api(tags = "学生端--项目尽调")
public class ProjectDueDiligence {
public class ProjectDueDiligenceController {
@Autowired
ISysProjectDueDiligenceService projectDueDiligenceService;
@Autowired

@ -20,9 +20,9 @@ import java.util.List;
//yz
@RestController
@RequestMapping("/projectValuationController")
@RequestMapping("/stu/projectValuationController")
@Api(tags = "学生端--项目估值")
public class ProjectValuation {
public class ProjectValuationController {
@Autowired
ISysProjectValuationService projectValuationService;
@Autowired

@ -7,7 +7,7 @@ import com.sztzjy.fund_investment.entity.*;
import com.sztzjy.fund_investment.mapper.FlowMapper;
import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper;
import com.sztzjy.fund_investment.mapper.TopicsMapper;
import com.sztzjy.fund_investment.mapper.UserTableMapper;
import com.sztzjy.fund_investment.mapper.UserMapper;
import com.sztzjy.fund_investment.service.TopicService;
import com.sztzjy.fund_investment.util.ResultEntity;
import io.swagger.annotations.Api;
@ -37,7 +37,7 @@ public class TopicController {
@Autowired
private PerformanceScoreMapper performanceScoreMapper;
@Autowired
private UserTableMapper userTableMapper;
private UserMapper userMapper;
@Autowired
private FlowMapper flowMapper;
@ -152,7 +152,7 @@ public class TopicController {
flowExample.createCriteria().andFlowIdEqualTo(flowId);
List<Flow> flows = flowMapper.selectByExample(flowExample);
Flow flow = flows.get(0);
UserTable userTable = userTableMapper.selectByPrimaryKey(flow.getUserid());
User userTable = userMapper.selectByPrimaryKey(flow.getUserid());
performanceScore.setClassId(userTable.getClassId());
performanceScore.setPracticalCognitionTime(new Date());

@ -7,11 +7,11 @@ import com.sztzjy.fund_investment.annotation.AnonymousAccess;
import com.sztzjy.fund_investment.config.security.TokenProvider;
import com.sztzjy.fund_investment.entity.TeaClassScore;
import com.sztzjy.fund_investment.entity.TrainingReport;
import com.sztzjy.fund_investment.entity.UserTable;
import com.sztzjy.fund_investment.entity.UserTableExample;
import com.sztzjy.fund_investment.entity.User;
import com.sztzjy.fund_investment.entity.UserExample;
import com.sztzjy.fund_investment.entity.dto.*;
import com.sztzjy.fund_investment.mapper.TrainingReportMapper;
import com.sztzjy.fund_investment.mapper.UserTableMapper;
import com.sztzjy.fund_investment.mapper.UserMapper;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.service.tea.ClassScoreService;
import com.sztzjy.fund_investment.util.ResultEntity;
@ -46,7 +46,7 @@ public class ClassScoreController {
@Autowired
private PerformanceScoreService performanceScoreService;
@Autowired
private UserTableMapper userTableMapper;
private UserMapper userMapper;
@AnonymousAccess
@ -168,11 +168,11 @@ public class ClassScoreController {
@GetMapping("/getClassNameBySchoolId")
@ApiOperation("成绩管理&互动答疑/班级下拉框")
public ResultEntity<List<String>> getClassNameBySchoolId(@RequestParam String schoolId) {
UserTableExample userTableExample = new UserTableExample();
UserExample userTableExample = new UserExample();
userTableExample.createCriteria().andSchoolIdEqualTo(schoolId);
List<UserTable> userTables = userTableMapper.selectByExample(userTableExample);
List<User> userTables = userMapper.selectByExample(userTableExample);
List<String> list = new ArrayList<>();
for (UserTable userTable : userTables) {
for (User userTable : userTables) {
list.add(userTable.getClassName());
}
return new ResultEntity<List<String>>(list);

@ -1,85 +0,0 @@
package com.sztzjy.fund_investment.entity;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @author xcj
* user_table
*/
public class UserTable {
private String userid;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("学号")
private String studentId;
@ApiModelProperty("班级名称")
private String className;
@ApiModelProperty("班级ID")
private String classId;
@ApiModelProperty("学校ID")
private String schoolId;
@ApiModelProperty("学校名称")
private String schoolName;
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid == null ? null : userid.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getStudentId() {
return studentId;
}
public void setStudentId(String studentId) {
this.studentId = studentId == null ? null : studentId.trim();
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className == null ? null : className.trim();
}
public String getClassId() {
return classId;
}
public void setClassId(String classId) {
this.classId = classId == null ? null : classId.trim();
}
public String getSchoolId() {
return schoolId;
}
public void setSchoolId(String schoolId) {
this.schoolId = schoolId == null ? null : schoolId.trim();
}
public String getSchoolName() {
return schoolName;
}
public void setSchoolName(String schoolName) {
this.schoolName = schoolName == null ? null : schoolName.trim();
}
}

@ -1,689 +0,0 @@
package com.sztzjy.fund_investment.entity;
import java.util.ArrayList;
import java.util.List;
public class UserTableExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public UserTableExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andUseridIsNull() {
addCriterion("userid is null");
return (Criteria) this;
}
public Criteria andUseridIsNotNull() {
addCriterion("userid is not null");
return (Criteria) this;
}
public Criteria andUseridEqualTo(String value) {
addCriterion("userid =", value, "userid");
return (Criteria) this;
}
public Criteria andUseridNotEqualTo(String value) {
addCriterion("userid <>", value, "userid");
return (Criteria) this;
}
public Criteria andUseridGreaterThan(String value) {
addCriterion("userid >", value, "userid");
return (Criteria) this;
}
public Criteria andUseridGreaterThanOrEqualTo(String value) {
addCriterion("userid >=", value, "userid");
return (Criteria) this;
}
public Criteria andUseridLessThan(String value) {
addCriterion("userid <", value, "userid");
return (Criteria) this;
}
public Criteria andUseridLessThanOrEqualTo(String value) {
addCriterion("userid <=", value, "userid");
return (Criteria) this;
}
public Criteria andUseridLike(String value) {
addCriterion("userid like", value, "userid");
return (Criteria) this;
}
public Criteria andUseridNotLike(String value) {
addCriterion("userid not like", value, "userid");
return (Criteria) this;
}
public Criteria andUseridIn(List<String> values) {
addCriterion("userid in", values, "userid");
return (Criteria) this;
}
public Criteria andUseridNotIn(List<String> values) {
addCriterion("userid not in", values, "userid");
return (Criteria) this;
}
public Criteria andUseridBetween(String value1, String value2) {
addCriterion("userid between", value1, value2, "userid");
return (Criteria) this;
}
public Criteria andUseridNotBetween(String value1, String value2) {
addCriterion("userid not between", value1, value2, "userid");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andStudentIdIsNull() {
addCriterion("student_id is null");
return (Criteria) this;
}
public Criteria andStudentIdIsNotNull() {
addCriterion("student_id is not null");
return (Criteria) this;
}
public Criteria andStudentIdEqualTo(String value) {
addCriterion("student_id =", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdNotEqualTo(String value) {
addCriterion("student_id <>", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdGreaterThan(String value) {
addCriterion("student_id >", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdGreaterThanOrEqualTo(String value) {
addCriterion("student_id >=", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdLessThan(String value) {
addCriterion("student_id <", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdLessThanOrEqualTo(String value) {
addCriterion("student_id <=", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdLike(String value) {
addCriterion("student_id like", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdNotLike(String value) {
addCriterion("student_id not like", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdIn(List<String> values) {
addCriterion("student_id in", values, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdNotIn(List<String> values) {
addCriterion("student_id not in", values, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdBetween(String value1, String value2) {
addCriterion("student_id between", value1, value2, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdNotBetween(String value1, String value2) {
addCriterion("student_id not between", value1, value2, "studentId");
return (Criteria) this;
}
public Criteria andClassNameIsNull() {
addCriterion("class_name is null");
return (Criteria) this;
}
public Criteria andClassNameIsNotNull() {
addCriterion("class_name is not null");
return (Criteria) this;
}
public Criteria andClassNameEqualTo(String value) {
addCriterion("class_name =", value, "className");
return (Criteria) this;
}
public Criteria andClassNameNotEqualTo(String value) {
addCriterion("class_name <>", value, "className");
return (Criteria) this;
}
public Criteria andClassNameGreaterThan(String value) {
addCriterion("class_name >", value, "className");
return (Criteria) this;
}
public Criteria andClassNameGreaterThanOrEqualTo(String value) {
addCriterion("class_name >=", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLessThan(String value) {
addCriterion("class_name <", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLessThanOrEqualTo(String value) {
addCriterion("class_name <=", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLike(String value) {
addCriterion("class_name like", value, "className");
return (Criteria) this;
}
public Criteria andClassNameNotLike(String value) {
addCriterion("class_name not like", value, "className");
return (Criteria) this;
}
public Criteria andClassNameIn(List<String> values) {
addCriterion("class_name in", values, "className");
return (Criteria) this;
}
public Criteria andClassNameNotIn(List<String> values) {
addCriterion("class_name not in", values, "className");
return (Criteria) this;
}
public Criteria andClassNameBetween(String value1, String value2) {
addCriterion("class_name between", value1, value2, "className");
return (Criteria) this;
}
public Criteria andClassNameNotBetween(String value1, String value2) {
addCriterion("class_name not between", value1, value2, "className");
return (Criteria) this;
}
public Criteria andClassIdIsNull() {
addCriterion("class_id is null");
return (Criteria) this;
}
public Criteria andClassIdIsNotNull() {
addCriterion("class_id is not null");
return (Criteria) this;
}
public Criteria andClassIdEqualTo(String value) {
addCriterion("class_id =", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdNotEqualTo(String value) {
addCriterion("class_id <>", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdGreaterThan(String value) {
addCriterion("class_id >", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdGreaterThanOrEqualTo(String value) {
addCriterion("class_id >=", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdLessThan(String value) {
addCriterion("class_id <", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdLessThanOrEqualTo(String value) {
addCriterion("class_id <=", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdLike(String value) {
addCriterion("class_id like", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdNotLike(String value) {
addCriterion("class_id not like", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdIn(List<String> values) {
addCriterion("class_id in", values, "classId");
return (Criteria) this;
}
public Criteria andClassIdNotIn(List<String> values) {
addCriterion("class_id not in", values, "classId");
return (Criteria) this;
}
public Criteria andClassIdBetween(String value1, String value2) {
addCriterion("class_id between", value1, value2, "classId");
return (Criteria) this;
}
public Criteria andClassIdNotBetween(String value1, String value2) {
addCriterion("class_id not between", value1, value2, "classId");
return (Criteria) this;
}
public Criteria andSchoolIdIsNull() {
addCriterion("school_id is null");
return (Criteria) this;
}
public Criteria andSchoolIdIsNotNull() {
addCriterion("school_id is not null");
return (Criteria) this;
}
public Criteria andSchoolIdEqualTo(String value) {
addCriterion("school_id =", value, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdNotEqualTo(String value) {
addCriterion("school_id <>", value, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdGreaterThan(String value) {
addCriterion("school_id >", value, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdGreaterThanOrEqualTo(String value) {
addCriterion("school_id >=", value, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdLessThan(String value) {
addCriterion("school_id <", value, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdLessThanOrEqualTo(String value) {
addCriterion("school_id <=", value, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdLike(String value) {
addCriterion("school_id like", value, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdNotLike(String value) {
addCriterion("school_id not like", value, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdIn(List<String> values) {
addCriterion("school_id in", values, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdNotIn(List<String> values) {
addCriterion("school_id not in", values, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdBetween(String value1, String value2) {
addCriterion("school_id between", value1, value2, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdNotBetween(String value1, String value2) {
addCriterion("school_id not between", value1, value2, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolNameIsNull() {
addCriterion("school_name is null");
return (Criteria) this;
}
public Criteria andSchoolNameIsNotNull() {
addCriterion("school_name is not null");
return (Criteria) this;
}
public Criteria andSchoolNameEqualTo(String value) {
addCriterion("school_name =", value, "schoolName");
return (Criteria) this;
}
public Criteria andSchoolNameNotEqualTo(String value) {
addCriterion("school_name <>", value, "schoolName");
return (Criteria) this;
}
public Criteria andSchoolNameGreaterThan(String value) {
addCriterion("school_name >", value, "schoolName");
return (Criteria) this;
}
public Criteria andSchoolNameGreaterThanOrEqualTo(String value) {
addCriterion("school_name >=", value, "schoolName");
return (Criteria) this;
}
public Criteria andSchoolNameLessThan(String value) {
addCriterion("school_name <", value, "schoolName");
return (Criteria) this;
}
public Criteria andSchoolNameLessThanOrEqualTo(String value) {
addCriterion("school_name <=", value, "schoolName");
return (Criteria) this;
}
public Criteria andSchoolNameLike(String value) {
addCriterion("school_name like", value, "schoolName");
return (Criteria) this;
}
public Criteria andSchoolNameNotLike(String value) {
addCriterion("school_name not like", value, "schoolName");
return (Criteria) this;
}
public Criteria andSchoolNameIn(List<String> values) {
addCriterion("school_name in", values, "schoolName");
return (Criteria) this;
}
public Criteria andSchoolNameNotIn(List<String> values) {
addCriterion("school_name not in", values, "schoolName");
return (Criteria) this;
}
public Criteria andSchoolNameBetween(String value1, String value2) {
addCriterion("school_name between", value1, value2, "schoolName");
return (Criteria) this;
}
public Criteria andSchoolNameNotBetween(String value1, String value2) {
addCriterion("school_name not between", value1, value2, "schoolName");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -1,32 +0,0 @@
package com.sztzjy.fund_investment.mapper;
import com.sztzjy.fund_investment.entity.UserTable;
import com.sztzjy.fund_investment.entity.UserTableExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface UserTableMapper {
long countByExample(UserTableExample example);
int deleteByExample(UserTableExample example);
int deleteByPrimaryKey(String userid);
int insert(UserTable record);
int insertSelective(UserTable record);
List<UserTable> selectByExample(UserTableExample example);
UserTable selectByPrimaryKey(String userid);
int updateByExampleSelective(@Param("record") UserTable record, @Param("example") UserTableExample example);
int updateByExample(@Param("record") UserTable record, @Param("example") UserTableExample example);
int updateByPrimaryKeySelective(UserTable record);
int updateByPrimaryKey(UserTable record);
}

@ -10,4 +10,8 @@ import java.util.List;
*/
public interface ProfitManagementService {
List<ProfitManagement> getLineChart(String flowId);
ProfitManagement getStockInfo(String id);
void getRightMarketValueAndFundEarnings(String id, String userMarketValue, String userFundEarnings);
}

@ -29,29 +29,60 @@ public class ProfitManagementServiceImpl implements ProfitManagementService {
* @author xcj
* @Date 2023/11/23
*/
// @Override
// public List<ProfitManagement> getLineChart(String flowId) {
// ProfitManagementExample profitManagementExample = new ProfitManagementExample();
// profitManagementExample.createCriteria().andFlowIdEqualTo(flowId);
// profitManagementExample.setOrderByClause("market_time ASC");
// List<ProfitManagement> profitManagementList = profitManagementMapper.selectByExample(profitManagementExample);
// if (!profitManagementList.isEmpty()) {
// return profitManagementList;
// }
// int date[] = {Constant.ONEDAY, Constant.FIVEDAY, Constant.TWENTYDAY, Constant.ONEMONTH, Constant.THREEMONTHS, Constant.SIXMONTHS};
// List<ProfitManagement> list = new ArrayList<>();
// for (int i = 0; i < date.length; i++) {
// ProfitManagement profitManagement = new ProfitManagement();
// profitManagement.setId(IdUtil.simpleUUID());
// profitManagement.setFlowId(flowId);
// profitManagement.setMarketTime(date[i]);
// Random random = new Random();
// double randomValue = 0.01 + random.nextDouble() * 19.99; // 生成0到20之间的随机数不包括0
// BigDecimal stockPrice = BigDecimal.valueOf(randomValue).setScale(2, RoundingMode.HALF_UP); // 保留两位小数
// profitManagement.setStockPrice(stockPrice);
// profitManagementMapper.insert(profitManagement);
// list.add(profitManagement);
// }
// return list;
// }
@Override
public List<ProfitManagement> getLineChart(String flowId) {
ProfitManagementExample profitManagementExample = new ProfitManagementExample();
profitManagementExample.createCriteria().andFlowIdEqualTo(flowId);
profitManagementExample.setOrderByClause("market_time ASC");
List<ProfitManagement> profitManagementList = profitManagementMapper.selectByExample(profitManagementExample);
if (!profitManagementList.isEmpty()) {
return profitManagementList;
}
int date[] = {Constant.ONEDAY, Constant.FIVEDAY, Constant.TWENTYDAY, Constant.ONEMONTH, Constant.THREEMONTHS, Constant.SIXMONTHS};
List<ProfitManagement> list = new ArrayList<>();
for (int i = 0; i < date.length; i++) {
ProfitManagement profitManagement = new ProfitManagement();
profitManagement.setId(IdUtil.simpleUUID());
profitManagement.setFlowId(flowId);
profitManagement.setMarketTime(date[i]);
Random random = new Random();
double randomValue = 0.01 + random.nextDouble() * 19.99; // 生成0到20之间的随机数不包括0
BigDecimal stockPrice = BigDecimal.valueOf(randomValue).setScale(2, RoundingMode.HALF_UP); // 保留两位小数
profitManagement.setStockPrice(stockPrice);
profitManagementMapper.insert(profitManagement);
list.add(profitManagement);
}
return list;
return profitManagementMapper.selectByExample(profitManagementExample);
}
//getByID
@Override
public ProfitManagement getStockInfo(String id) {
return profitManagementMapper.selectByPrimaryKey(id);
}
@Override
public void getRightMarketValueAndFundEarnings(String id, String userMarketValue, String userFundEarnings) {
ProfitManagement profitManagement = profitManagementMapper.selectByPrimaryKey(id);
//公司市值=股票价格*总股本
BigDecimal marketValue = profitManagement.getStockPrice().multiply(profitManagement.getTotalEquity()).setScale(6, RoundingMode.HALF_UP);
profitManagement.setMarketValue(marketValue);
//基金收益=持股数量*股票价格-投资金额
BigDecimal fundEarnings = profitManagement.getShareCount().multiply(profitManagement.getStockPrice()).subtract(profitManagement.getInvestmentAmount()).setScale(6, RoundingMode.HALF_UP);
profitManagement.setFundEarnings(fundEarnings);
// if (new BigDecimal(userMarketValue).compareTo(fundEarnings)=0){
// BigDecimal.
// }
}
}

@ -33,7 +33,7 @@ public class ClassScoreServiceImpl implements ClassScoreService {
@Autowired
private TeaClassScoreMapper teaClassScoreMapper;
@Autowired
private UserTableMapper userMapper;
private UserMapper userMapper;
@Autowired
private TrainingReportMapper reportMapper;
@Autowired
@ -123,9 +123,9 @@ public class ClassScoreServiceImpl implements ClassScoreService {
*/
@Override
public PageInfo<UserDto> getStudentScoreDetails(Integer index, Integer size, String schoolId, String classId, String studentIdOrName) {
UserTableExample userTableExample = new UserTableExample();
UserTableExample.Criteria criteria = userTableExample.createCriteria();
UserTableExample.Criteria orCriteria = userTableExample.createCriteria();
UserExample userTableExample = new UserExample();
UserExample.Criteria criteria = userTableExample.createCriteria();
UserExample.Criteria orCriteria = userTableExample.createCriteria();
if (StringUtils.isNotBlank(classId)) {
criteria.andClassIdEqualTo(classId);
}else {
@ -136,9 +136,9 @@ public class ClassScoreServiceImpl implements ClassScoreService {
orCriteria.andStudentIdEqualTo(studentIdOrName);
}
userTableExample.or(orCriteria);
List<UserTable> userTables = userMapper.selectByExample(userTableExample);
List<User> userTables = userMapper.selectByExample(userTableExample);
List<UserDto> userDtoList = new ArrayList<>();
for (UserTable userTable : userTables) {
for (User userTable : userTables) {
UserDto userDto = new UserDto();
BeanUtils.copyProperties(userTable, userDto);
Flow flow = flowMapper.selectByPrimaryKey(userTable.getUserid());
@ -177,11 +177,11 @@ public class ClassScoreServiceImpl implements ClassScoreService {
*/
@Override
public void importExcel(HttpServletResponse response, String schoolId) {
UserTableExample userTableExample = new UserTableExample();
UserExample userTableExample = new UserExample();
userTableExample.createCriteria().andSchoolIdEqualTo(schoolId);
List<UserTable> userTables = userMapper.selectByExample(userTableExample);
List<User> userTables = userMapper.selectByExample(userTableExample);
List<UserDto> userDtoList = new ArrayList<>();
for (UserTable userTable : userTables) {
for (User userTable : userTables) {
UserDto userDto = new UserDto();
BeanUtils.copyProperties(userTable, userDto);
Flow flow = flowMapper.selectByPrimaryKey(userTable.getUserid());

@ -6,7 +6,7 @@ import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto;
import com.sztzjy.fund_investment.mapper.FlowMapper;
import com.sztzjy.fund_investment.mapper.QuestionAnswerMapper;
import com.sztzjy.fund_investment.mapper.TopicsMapper;
import com.sztzjy.fund_investment.mapper.UserTableMapper;
import com.sztzjy.fund_investment.mapper.UserMapper;
import com.sztzjy.fund_investment.service.tea.TeaTopicManageService;
import com.sztzjy.fund_investment.util.PageUtil;
import com.sztzjy.fund_investment.util.ResultEntity;
@ -31,7 +31,7 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService {
@Autowired
private QuestionAnswerMapper questionAnswerMapper;
@Autowired
private UserTableMapper userTableMapper;
private UserMapper userMapper;
@Autowired
private FlowMapper flowMapper;
@ -100,9 +100,9 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService {
QuestionAnswerExample questionAnswerExample = new QuestionAnswerExample();
questionAnswerExample.createCriteria().andSchoolidEqualTo(schoolId);
List<QuestionAnswer> questionAnswers = questionAnswerMapper.selectByExample(questionAnswerExample);
UserTableExample userTableExample = new UserTableExample();
UserTableExample.Criteria criteria = userTableExample.createCriteria();
UserTableExample.Criteria or = userTableExample.createCriteria();
UserExample userTableExample = new UserExample();
UserExample.Criteria criteria = userTableExample.createCriteria();
UserExample.Criteria or = userTableExample.createCriteria();
criteria.andSchoolIdEqualTo(schoolId);
if (StringUtils.isNotBlank(className)) {
criteria.andClassNameEqualTo(className);
@ -112,10 +112,10 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService {
or.andNameEqualTo(keyWord);
}
userTableExample.or(or);
List<UserTable> userTables = userTableMapper.selectByExample(userTableExample);
List<User> userTables = userMapper.selectByExample(userTableExample);
List<QuestionAnswerDto> list = new ArrayList<>();
for (UserTable userTable : userTables) {
for (User userTable : userTables) {
Flow flow = flowMapper.selectByPrimaryKey(userTable.getUserid());
String flowId = flow.getFlowId();
for (QuestionAnswer questionAnswer : questionAnswers) {

@ -4,7 +4,7 @@ import cn.hutool.core.util.IdUtil;
import com.sztzjy.fund_investment.entity.*;
import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper;
import com.sztzjy.fund_investment.mapper.TeaClassScoreMapper;
import com.sztzjy.fund_investment.mapper.UserTableMapper;
import com.sztzjy.fund_investment.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@ -26,7 +26,7 @@ public class Task {
@Autowired
private TeaClassScoreMapper teaClassScoreMapper;
@Autowired
private UserTableMapper userMapper;
private UserMapper userMapper;
/* 00.00
* @author xcj
@ -105,10 +105,10 @@ public class Task {
teaClassScore.setGeneralCount(gradeCounts.get("general"));
teaClassScore.setFailCount(gradeCounts.get("fail"));
teaClassScore.setClassId(classId);
UserTableExample userTableExample =new UserTableExample();
UserExample userTableExample =new UserExample();
userTableExample.createCriteria().andSchoolIdEqualTo(schoolId).andClassIdEqualTo(classId);
List<UserTable> userTables = userMapper.selectByExample(userTableExample);
UserTable userTable = userTables.get(0);
List<User> userTables = userMapper.selectByExample(userTableExample);
User userTable = userTables.get(0);
teaClassScore.setClassName(userTable.getClassName());
BigDecimal divideScore = avgScore.divide(count, 2, RoundingMode.HALF_UP);
teaClassScore.setClassAverageScore(divideScore);

@ -1,243 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.fund_investment.mapper.UserTableMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.UserTable">
<id column="userid" jdbcType="VARCHAR" property="userid" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="student_id" jdbcType="VARCHAR" property="studentId" />
<result column="class_name" jdbcType="VARCHAR" property="className" />
<result column="class_id" jdbcType="VARCHAR" property="classId" />
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
<result column="school_name" jdbcType="VARCHAR" property="schoolName" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
userid, name, student_id, class_name, class_id, school_id, school_name
</sql>
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.UserTableExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from user_table
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from user_table
where userid = #{userid,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from user_table
where userid = #{userid,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.UserTableExample">
delete from user_table
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.fund_investment.entity.UserTable">
insert into user_table (userid, name, student_id,
class_name, class_id, school_id,
school_name)
values (#{userid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR},
#{className,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR},
#{schoolName,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.UserTable">
insert into user_table
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userid != null">
userid,
</if>
<if test="name != null">
name,
</if>
<if test="studentId != null">
student_id,
</if>
<if test="className != null">
class_name,
</if>
<if test="classId != null">
class_id,
</if>
<if test="schoolId != null">
school_id,
</if>
<if test="schoolName != null">
school_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userid != null">
#{userid,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="studentId != null">
#{studentId,jdbcType=VARCHAR},
</if>
<if test="className != null">
#{className,jdbcType=VARCHAR},
</if>
<if test="classId != null">
#{classId,jdbcType=VARCHAR},
</if>
<if test="schoolId != null">
#{schoolId,jdbcType=VARCHAR},
</if>
<if test="schoolName != null">
#{schoolName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.UserTableExample" resultType="java.lang.Long">
select count(*) from user_table
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update user_table
<set>
<if test="record.userid != null">
userid = #{record.userid,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.studentId != null">
student_id = #{record.studentId,jdbcType=VARCHAR},
</if>
<if test="record.className != null">
class_name = #{record.className,jdbcType=VARCHAR},
</if>
<if test="record.classId != null">
class_id = #{record.classId,jdbcType=VARCHAR},
</if>
<if test="record.schoolId != null">
school_id = #{record.schoolId,jdbcType=VARCHAR},
</if>
<if test="record.schoolName != null">
school_name = #{record.schoolName,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update user_table
set userid = #{record.userid,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
student_id = #{record.studentId,jdbcType=VARCHAR},
class_name = #{record.className,jdbcType=VARCHAR},
class_id = #{record.classId,jdbcType=VARCHAR},
school_id = #{record.schoolId,jdbcType=VARCHAR},
school_name = #{record.schoolName,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.UserTable">
update user_table
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="studentId != null">
student_id = #{studentId,jdbcType=VARCHAR},
</if>
<if test="className != null">
class_name = #{className,jdbcType=VARCHAR},
</if>
<if test="classId != null">
class_id = #{classId,jdbcType=VARCHAR},
</if>
<if test="schoolId != null">
school_id = #{schoolId,jdbcType=VARCHAR},
</if>
<if test="schoolName != null">
school_name = #{schoolName,jdbcType=VARCHAR},
</if>
</set>
where userid = #{userid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.UserTable">
update user_table
set name = #{name,jdbcType=VARCHAR},
student_id = #{studentId,jdbcType=VARCHAR},
class_name = #{className,jdbcType=VARCHAR},
class_id = #{classId,jdbcType=VARCHAR},
school_id = #{schoolId,jdbcType=VARCHAR},
school_name = #{schoolName,jdbcType=VARCHAR}
where userid = #{userid,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save