修改时长报错问题

main
whb 1 year ago
parent e5e9e2135e
commit f5e4340348

@ -368,7 +368,6 @@ public class CptfController {
}
public Integer calculte(List<FbqdDTO> dataInfoList, Integer ser, String answer) {
int count = 0;
if (CollectionUtils.isEmpty(dataInfoList)) {
@ -433,12 +432,26 @@ public class CptfController {
} else {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败");
}
} else {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "已提交过");
return new ResultEntity<>(HttpStatus.OK, "提交成功");
}
}
@GetMapping("/restartTrainingByAlgorithm")
@ApiOperation("用户数据分析/产品定位-重新实训")
@AnonymousAccess
public ResultEntity restartTrainingByAlgorithm(@RequestParam String userId, @ApiParam("重新实训的模块名") String module,@ApiParam("大模块名")String project) {
scoreService.deleteScore(userId, project, module);
AlgorithmStuAnswerExample cpdjStuAnswerExample = new AlgorithmStuAnswerExample();
cpdjStuAnswerExample.createCriteria().andUserIdEqualTo(userId).andProjectEqualTo(project).andModuleEqualTo(module);
algorithmStuAnswerMapper.deleteByExample(cpdjStuAnswerExample);
return new ResultEntity<>(HttpStatus.OK, "重新实训成功");
}
}

@ -1,5 +1,6 @@
package com.sztzjy.linkCommerce.controller.stu;
import cn.hutool.core.convert.Convert;
import com.sztzjy.linkCommerce.annotation.AnonymousAccess;
import com.sztzjy.linkCommerce.config.Constant;
import com.sztzjy.linkCommerce.entity.*;
@ -35,7 +36,7 @@ public class StudyTimeAndCountController {
@PostMapping("/updateStudyTime")
@ApiOperation("更新学习时间")
@AnonymousAccess
public ResultEntity<StuModuleDTO> updateStudyTime(@RequestParam String userId, @RequestParam @ApiParam("项目名称 市场需求挖掘、产品规划") String projectName, @RequestParam int time) {
public ResultEntity<StuModuleDTO> updateStudyTime(@RequestParam String userId, @RequestParam @ApiParam("项目名称 市场需求挖掘、产品规划") String projectName, @RequestParam String time) {
//先查询有无这个对象 没有则新增对象
StuStudyTimeExample stuStudyTimeExample = new StuStudyTimeExample();
stuStudyTimeExample.createCriteria().andUserIdEqualTo(userId);
@ -56,29 +57,29 @@ public class StudyTimeAndCountController {
stuStudyTime.setProductPlanningTime(0);
stuStudyTime.setSupplyChannelTime(0);
if (Constant.PRO_SCXQWJ.equals(projectName)) {
stuStudyTime.setMarketResearchTime(time);
stuStudyTime.setMarketResearchTime(Convert.toInt(time));
} else if (Constant.PRO_CPGH.equals(projectName)) {
stuStudyTime.setProductPlanningTime(time);
stuStudyTime.setProductPlanningTime(Convert.toInt(time));
} else if (Constant.PRO_CPTFCS.equals(projectName)) {
stuStudyTime.setProductLaunchTestTime(time);
stuStudyTime.setProductLaunchTestTime(Convert.toInt(time));
} else if (Constant.PRO_GYQDGL.equals(projectName)) {
stuStudyTime.setSupplyChannelTime(time);
stuStudyTime.setSupplyChannelTime(Convert.toInt(time));
} else if (Constant.PRO_CPPGYKH.equals(projectName)) {
stuStudyTime.setProductEvaluationTime(time);
stuStudyTime.setProductEvaluationTime(Convert.toInt(time));
}
insert = stuStudyTimeMapper.insert(stuStudyTime);
} else {
StuStudyTime stuStudyTime = stuStudyTimes.get(0);
if (Constant.PRO_SCXQWJ.equals(projectName)) {
stuStudyTime.setMarketResearchTime(stuStudyTime.getMarketResearchTime() + time);
stuStudyTime.setMarketResearchTime(stuStudyTime.getMarketResearchTime() + Convert.toInt(time));
} else if (Constant.PRO_CPGH.equals(projectName)) {
stuStudyTime.setProductPlanningTime(stuStudyTime.getProductPlanningTime() + time);
stuStudyTime.setProductPlanningTime(stuStudyTime.getProductPlanningTime() + Convert.toInt(time));
} else if (Constant.PRO_CPTFCS.equals(projectName)) {
stuStudyTime.setProductLaunchTestTime(stuStudyTime.getProductLaunchTestTime() + time);
stuStudyTime.setProductLaunchTestTime(stuStudyTime.getProductLaunchTestTime() + Convert.toInt(time));
} else if (Constant.PRO_GYQDGL.equals(projectName)) {
stuStudyTime.setSupplyChannelTime(stuStudyTime.getSupplyChannelTime() + time);
stuStudyTime.setSupplyChannelTime(stuStudyTime.getSupplyChannelTime() + Convert.toInt(time));
} else if (Constant.PRO_CPPGYKH.equals(projectName)) {
stuStudyTime.setProductEvaluationTime(stuStudyTime.getProductEvaluationTime() + time);
stuStudyTime.setProductEvaluationTime(stuStudyTime.getProductEvaluationTime() + Convert.toInt(time));
}
insert = stuStudyTimeMapper.updateByPrimaryKey(stuStudyTime);
}

@ -71,11 +71,11 @@ public class UserBehaviorProfilingAnaServiceImpl implements UserBehaviorProfilin
stuMachineLearning.setId(id);
machineLearningMapper.updateByPrimaryKeyWithBLOBs(stuMachineLearning);
if (learning.getSubState() == 1) {
BigDecimal aDouble = BigDecimal.valueOf(100).subtract(Convert.toBigDecimal(learning.getErrorField()));
//算分
scoreService.insertScore(learning.getUserId(), learning.getProject(), learning.getModule(), aDouble, null);
}
return new ResultEntity<>(HttpStatus.OK, "提交成功!");
}
}

Loading…
Cancel
Save