@t2652009480 9 months ago
commit 260bca4af4

@ -130,7 +130,7 @@ public class TopicController {
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId);
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
if (performanceScores.isEmpty()) {
if (performanceScores == null || performanceScores.isEmpty()) {
return null;
} else {
return new ResultEntity<>(performanceScores.get(0));

@ -10,7 +10,6 @@ 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.dto.EvaluationLevel;
import com.sztzjy.fund_investment.entity.dto.PerformanceScoreDto;
import com.sztzjy.fund_investment.entity.dto.PerformanceTrainingScoreDto;
import com.sztzjy.fund_investment.mapper.FlowMapper;
import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper;
@ -23,15 +22,12 @@ import com.sztzjy.fund_investment.util.ResultEntity;
import com.sztzjy.fund_investment.util.RsaUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.geolatte.geom.M;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
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.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -40,7 +36,6 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.sql.Array;
import java.util.*;
@Api(tags = "用户管理")
@ -192,7 +187,7 @@ public class UserController {
PerformanceScoreExample example = new PerformanceScoreExample();
example.createCriteria().andFlowIdEqualTo(flow.getFlowId());
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(example);
if (performanceScores.isEmpty()) {
if (performanceScores == null || performanceScores.isEmpty()) {
return null;
}
performanceScoreMapper.deleteByExample(example);

@ -74,11 +74,13 @@ public class ProfitManagementServiceImpl implements ProfitManagementService {
profitManagementMapper.updateByPrimaryKey(profitManagement);
if (!(userMarketValue.compareTo(marketValue) == 0)) {
performanceScoreService.calculateScoreByModule("profitManagementMarketValueScore", 0, profitManagement.getFlowId());
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "市值计算错误!", marketValue);
} else {
performanceScoreService.calculateScoreByModule("profitManagementMarketValueScore", 2, profitManagement.getFlowId());
}
if (!(userFundEarnings.compareTo(fundEarnings) == 0)) {
performanceScoreService.calculateScoreByModule("profitManagementMarketValueScore", 0, profitManagement.getFlowId());
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "收益计算错误!", fundEarnings);
} else {
performanceScoreService.calculateScoreByModule("profitManagementFundScore", 2, profitManagement.getFlowId());

Loading…
Cancel
Save