Merge remote-tracking branch 'origin/master'

master
rong.liu 2 weeks ago
commit b7e9343f2a
  1. 9
      api/src/main/java/com/huoran/config/FeignSimpleEncoderConfig.java
  2. 6
      bank/src/main/java/com/huoran/bank/service/impl/BankServiceImpl.java
  3. 3
      financial_product/src/main/java/com/huoran/financial_product/service/impl/BankProductsServiceImpl.java
  4. 8
      judgment_point/src/main/java/com/huoran/judgment_point/service/impl/LcJudgmentPointServiceImpl.java
  5. 7
      occupationlab/src/main/java/com/huoran/occupationlab/controller/UserScoreController.java

@ -5,7 +5,9 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import com.alibaba.fastjson.support.springfox.SwaggerJsonSerializer;
import feign.Feign;
import feign.Logger;
import feign.Request;
import feign.codec.Decoder;
import feign.codec.Encoder;
import org.springframework.beans.factory.ObjectFactory;
@ -32,6 +34,13 @@ public class FeignSimpleEncoderConfig {
return Logger.Level.FULL;
}
@Bean
public Feign.Builder feignBuilder() {
return Feign.builder()
.options(new Request.Options(30000, 30000)); // 设置连接和读取超时时间为10秒
}
@Bean
public Encoder feignEncoder() {
return new SpringEncoder(feignHttpMessageConverter());

@ -209,9 +209,9 @@ public class BankServiceImpl extends ServiceImpl<BankMapper, BankSubmitVo> imple
}
Integer scoreId = occupationlabClient.addUserScore(userScore);
if (ObjectUtils.isEmpty(scoreId)) {
throw new CustomException(ExceptionEnum.ADD_USER_SCORE_FAIL);
}
// if (ObjectUtils.isEmpty(scoreId)) {
// throw new CustomException(ExceptionEnum.ADD_USER_SCORE_FAIL);
// }
}
//删除缓存

@ -562,11 +562,13 @@ public class BankProductsServiceImpl extends ServiceImpl<BankProductsMapper, Ban
try {
ScoreDetails scoreDetails = judgmentPointClient.scoreAndReturnScoreDetails(calculateScoreParameters);
if (ObjectUtils.isEmpty(scoreDetails) || scoreDetails.getScoreInfos().isEmpty()) {
System.out.println("scoreDetails is null 判分失败,检查判分点状态");
throw new CustomException(ExceptionEnum.ADD_USER_SCORE_FAIL);
}
scoreInfos = scoreDetails.getScoreInfos();
} catch (RuntimeException e) {
System.out.println("scoreDetails is null 判分失败,检查判分点状态");
throw new CustomException(ExceptionEnum.ADD_USER_SCORE_FAIL);
}
double scores = scoreInfos.stream()
@ -640,6 +642,7 @@ public class BankProductsServiceImpl extends ServiceImpl<BankProductsMapper, Ban
boolean batchAddUserScore = occupationlabClient.batchAddUserScore(userScores);
System.out.println("batchAddUserScore: " + batchAddUserScore);
if (!batchAddUserScore) {
System.out.println("保存用户分数记录失败,检查职站状态");
// 保存失败 操作回滚
throw new CustomException(ExceptionEnum.ADD_USER_SCORE_FAIL);
}

@ -424,7 +424,7 @@ public class LcJudgmentPointServiceImpl extends ServiceImpl<LcJudgmentPointMappe
//无操作记录,记录每题分数返回
if (operationRules.isEmpty()){
System.out.println("无操作记录,记录每题分数返回=====for11111111111开始");
for (LcJudgmentRule judgmentRule : lcJudgmentRules) {
LcRuleRecord lcRuleRecord = new LcRuleRecord();
lcRuleRecord.setRuleId(judgmentRule.getId());
@ -450,6 +450,7 @@ public class LcJudgmentPointServiceImpl extends ServiceImpl<LcJudgmentPointMappe
}
lcRuleRecordList.add(lcRuleRecord);
}
System.out.println("无操作记录,记录每题分数返回=====for11111111111结束");
//没做直接错
scoreInfos.add(new ScoreInfo(lcId, 0.0, false, judgmentScore, flag));
}else {
@ -465,7 +466,7 @@ public class LcJudgmentPointServiceImpl extends ServiceImpl<LcJudgmentPointMappe
//存储不同规则之间的与或
ArrayList<Boolean> booleanList = new ArrayList<>();
ArrayList<Integer> logicList = new ArrayList<>();
System.out.println("有操作记录=====for2222222222222开始");
for (LcJudgmentRule judgmentRule : lcJudgmentRules) {
boolean aBoolean = false;
@ -590,6 +591,7 @@ public class LcJudgmentPointServiceImpl extends ServiceImpl<LcJudgmentPointMappe
//添加操作记录
lcRuleRecordList.add(lcRuleRecord);
}
System.out.println("有操作记录=====for2222222222222结束");
// 逻辑运算 判断逻辑是否正确,正确则计分
boolean logicRight = ArithmeticUtil.logic(booleanList, logicList);
// 判断逻辑是否正确,正确则计分
@ -601,9 +603,11 @@ public class LcJudgmentPointServiceImpl extends ServiceImpl<LcJudgmentPointMappe
}
}
System.out.println("准备保存操作记录-------"+lcRuleRecordList);
//批量插入
batchInsertRuleRecord(lcRuleRecordList);
scoreDetails.setScoreInfos(scoreInfos);
System.out.println("scoreDetails收集完成-------"+scoreDetails);
return scoreDetails;
}

@ -32,10 +32,11 @@ public class UserScoreController {
@PostMapping("/addUserScore")
@ApiOperation(value = "新增用户分数表 远程feign")
public Integer addUserScore(@RequestBody UserScore userScore){
if (userScoreService.save(userScore)){
return userScore.getId();
boolean save = userScoreService.save(userScore);
if (!save){
System.out.println("新增用户分数表失败!!!");
}
return null;
return 1;
}
@PostMapping("/batchAddUserScore")

Loading…
Cancel
Save