|
|
|
@ -48,8 +48,6 @@ public class CptfController {
|
|
|
|
private FbqdStuAnswerMapper fbqdStuAnswerMapper;
|
|
|
|
private FbqdStuAnswerMapper fbqdStuAnswerMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
StuGradeMapper stuGradeMapper;
|
|
|
|
StuGradeMapper stuGradeMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
@ -70,31 +68,31 @@ public class CptfController {
|
|
|
|
StuGradeExample stuGradeExample = new StuGradeExample();
|
|
|
|
StuGradeExample stuGradeExample = new StuGradeExample();
|
|
|
|
stuGradeExample.createCriteria().andUserIdEqualTo(fbqdStuAnswerDTO.getUserId()).andProjectEqualTo(Constant.PRO_CPTFCS).andModuleEqualTo(Constant.MODULE_CPDJ);
|
|
|
|
stuGradeExample.createCriteria().andUserIdEqualTo(fbqdStuAnswerDTO.getUserId()).andProjectEqualTo(Constant.PRO_CPTFCS).andModuleEqualTo(Constant.MODULE_CPDJ);
|
|
|
|
List<StuGrade> stuGradeList = stuGradeMapper.selectByExampleWithBLOBs(stuGradeExample);
|
|
|
|
List<StuGrade> stuGradeList = stuGradeMapper.selectByExampleWithBLOBs(stuGradeExample);
|
|
|
|
if(CollectionUtils.isEmpty(stuGradeList)){
|
|
|
|
if (CollectionUtils.isEmpty(stuGradeList)) {
|
|
|
|
// FbqdAnswer answer = fbqdAnswerMapper.selectByExampleWithBLOBs(new FbqdAnswerExample()).get(0);
|
|
|
|
// FbqdAnswer answer = fbqdAnswerMapper.selectByExampleWithBLOBs(new FbqdAnswerExample()).get(0);
|
|
|
|
int count = 0;
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
|
|
|
|
//1.
|
|
|
|
//1.
|
|
|
|
List<FbqdDTO> dataInfoList = fbqdStuAnswerDTO.getDataInfoList();
|
|
|
|
List<FbqdDTO> dataInfoList = fbqdStuAnswerDTO.getDataInfoList();
|
|
|
|
String oneAnswer = "1,1,1,1,0,0,0.1965,0.3565,0.3767,0.9430,0,0";
|
|
|
|
String oneAnswer = "1,1,1,1,0,0,0.1965,0.3565,0.3767,0.9430,0,0";
|
|
|
|
int count1 = calculte(dataInfoList,1,oneAnswer);
|
|
|
|
int count1 = calculte(dataInfoList, 1, oneAnswer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//2.
|
|
|
|
//2.
|
|
|
|
List<FbqdDTO> radioInfoList = fbqdStuAnswerDTO.getRadioInfoList();
|
|
|
|
List<FbqdDTO> radioInfoList = fbqdStuAnswerDTO.getRadioInfoList();
|
|
|
|
String twoAnswer = "0.7264,0.5147,0.8358,0.7372,0,0,0.1642,0.2628,0.2736,0.4853,0,0";
|
|
|
|
String twoAnswer = "0.7264,0.5147,0.8358,0.7372,0,0,0.1642,0.2628,0.2736,0.4853,0,0";
|
|
|
|
int count2 = calculte(radioInfoList,2,twoAnswer);
|
|
|
|
int count2 = calculte(radioInfoList, 2, twoAnswer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//3.
|
|
|
|
//3.
|
|
|
|
List<FbqdDTO> messageInfoList = fbqdStuAnswerDTO.getMessageInfoList();
|
|
|
|
List<FbqdDTO> messageInfoList = fbqdStuAnswerDTO.getMessageInfoList();
|
|
|
|
String threeAnswer = "0.6305,0.5342,0.4066,0.5243";
|
|
|
|
String threeAnswer = "0.6305,0.5342,0.4066,0.5243";
|
|
|
|
int count3 =calculte(messageInfoList,3,threeAnswer);
|
|
|
|
int count3 = calculte(messageInfoList, 3, threeAnswer);
|
|
|
|
|
|
|
|
|
|
|
|
//4.
|
|
|
|
//4.
|
|
|
|
List<FbqdDTO> eventInfoList = fbqdStuAnswerDTO.getEventInfoList();
|
|
|
|
List<FbqdDTO> eventInfoList = fbqdStuAnswerDTO.getEventInfoList();
|
|
|
|
String fourAnswer = "0.1940,0.2446,0.3116,0.2498";
|
|
|
|
String fourAnswer = "0.1940,0.2446,0.3116,0.2498";
|
|
|
|
int count4 = calculte(eventInfoList,4,fourAnswer);
|
|
|
|
int count4 = calculte(eventInfoList, 4, fourAnswer);
|
|
|
|
|
|
|
|
|
|
|
|
//5.综合评分
|
|
|
|
//5.综合评分
|
|
|
|
String fiveAnswer = "1,0.1503,0.2751";
|
|
|
|
String fiveAnswer = "1,0.1503,0.2751";
|
|
|
|
@ -106,28 +104,27 @@ public class CptfController {
|
|
|
|
int i = compareListsUtil.calculateLengthPenaltyEnhanced(fbqdStuAnswerDTO.getScenePromotion());
|
|
|
|
int i = compareListsUtil.calculateLengthPenaltyEnhanced(fbqdStuAnswerDTO.getScenePromotion());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
count= count1 + count2+count3+count4+i + fiveCount;
|
|
|
|
count = count1 + count2 + count3 + count4 + i + fiveCount;
|
|
|
|
|
|
|
|
|
|
|
|
FbqdStuAnswer fbqdStuAnswer = new FbqdStuAnswer();
|
|
|
|
FbqdStuAnswer fbqdStuAnswer = new FbqdStuAnswer();
|
|
|
|
fbqdStuAnswer.setId(IdUtil.simpleUUID());
|
|
|
|
fbqdStuAnswer.setId(IdUtil.simpleUUID());
|
|
|
|
fbqdStuAnswer.setUserId(fbqdStuAnswerDTO.getUserId());
|
|
|
|
fbqdStuAnswer.setUserId(fbqdStuAnswerDTO.getUserId());
|
|
|
|
|
|
|
|
|
|
|
|
fbqdStuAnswer.setCrowdPromotion( JSON.toJSONString(fbqdStuAnswerDTO));
|
|
|
|
fbqdStuAnswer.setCrowdPromotion(JSON.toJSONString(fbqdStuAnswerDTO));
|
|
|
|
fbqdStuAnswerMapper.insertSelective(fbqdStuAnswer);
|
|
|
|
fbqdStuAnswerMapper.insertSelective(fbqdStuAnswer);
|
|
|
|
|
|
|
|
|
|
|
|
Boolean aBoolean = scoreService.insertScore(fbqdStuAnswerDTO.getUserId(), Constant.PRO_CPTFCS, Constant.MODULE_FBQDPG, BigDecimal.valueOf(100 - count), fbqdStuAnswerDTO.getScenePromotion());
|
|
|
|
Boolean aBoolean = scoreService.insertScore(fbqdStuAnswerDTO.getUserId(), Constant.PRO_CPTFCS, Constant.MODULE_FBQDPG, BigDecimal.valueOf(100 - count), fbqdStuAnswerDTO.getScenePromotion());
|
|
|
|
if(aBoolean){
|
|
|
|
if (aBoolean) {
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "提交成功");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "提交成功");
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "已提交过");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "已提交过");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("发布渠道-回显接口")
|
|
|
|
@ApiOperation("发布渠道-回显接口")
|
|
|
|
@GetMapping("/selectByCpdjUserId")
|
|
|
|
@GetMapping("/selectByCpdjUserId")
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ -149,58 +146,55 @@ public class CptfController {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/restartTraining")
|
|
|
|
@GetMapping("/restartTraining")
|
|
|
|
@ApiOperation("产品投放-重新实训")
|
|
|
|
@ApiOperation("产品投放-重新实训")
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
public ResultEntity restartTraining(@RequestParam String userId,@ApiParam("重新实训的模块名") String module) {
|
|
|
|
public ResultEntity restartTraining(@RequestParam String userId, @ApiParam("重新实训的模块名") String module) {
|
|
|
|
|
|
|
|
|
|
|
|
if (Constant.MODULE_FBQDPG.equals(module)) {
|
|
|
|
if (Constant.MODULE_FBQDPG.equals(module)) {
|
|
|
|
Boolean b=scoreService.deleteScore(userId,Constant.PRO_CPTFCS,module);
|
|
|
|
Boolean b = scoreService.deleteScore(userId, Constant.PRO_CPTFCS, module);
|
|
|
|
if(b){
|
|
|
|
if (b) {
|
|
|
|
FbqdStuAnswerExample cpdjStuAnswerExample = new FbqdStuAnswerExample();
|
|
|
|
FbqdStuAnswerExample cpdjStuAnswerExample = new FbqdStuAnswerExample();
|
|
|
|
cpdjStuAnswerExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
cpdjStuAnswerExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
fbqdStuAnswerMapper.deleteByExample(cpdjStuAnswerExample);
|
|
|
|
fbqdStuAnswerMapper.deleteByExample(cpdjStuAnswerExample);
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "重新实训成功");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "重新实训成功");
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "重新实训失败");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "重新实训失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Constant.MODULE_CPTGCS.equals(module)) {
|
|
|
|
if (Constant.MODULE_CPTGCS.equals(module)) {
|
|
|
|
Boolean b=scoreService.deleteScore(userId,Constant.PRO_CPTFCS,module);
|
|
|
|
Boolean b = scoreService.deleteScore(userId, Constant.PRO_CPTFCS, module);
|
|
|
|
if(b){
|
|
|
|
if (b) {
|
|
|
|
CptgcsStuAnswerExample cptgcsStuAnswerExample = new CptgcsStuAnswerExample();
|
|
|
|
CptgcsStuAnswerExample cptgcsStuAnswerExample = new CptgcsStuAnswerExample();
|
|
|
|
cptgcsStuAnswerExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
cptgcsStuAnswerExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
cptgcsStuAnswerMapper.deleteByExample(cptgcsStuAnswerExample);
|
|
|
|
cptgcsStuAnswerMapper.deleteByExample(cptgcsStuAnswerExample);
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "重新实训成功");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "重新实训成功");
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "重新实训失败");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "重新实训失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Constant.MODULE_CPTGCS.equals(module)) {
|
|
|
|
if (Constant.MODULE_CPTGCS.equals(module)) {
|
|
|
|
Boolean b=scoreService.deleteScore(userId,Constant.PRO_CPGH,module);
|
|
|
|
Boolean b = scoreService.deleteScore(userId, Constant.PRO_CPGH, module);
|
|
|
|
if(b){
|
|
|
|
if (b) {
|
|
|
|
CptgcsStuAnswerExample cptgcsStuAnswerExample = new CptgcsStuAnswerExample();
|
|
|
|
CptgcsStuAnswerExample cptgcsStuAnswerExample = new CptgcsStuAnswerExample();
|
|
|
|
cptgcsStuAnswerExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
cptgcsStuAnswerExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
cptgcsStuAnswerMapper.deleteByExample(cptgcsStuAnswerExample);
|
|
|
|
cptgcsStuAnswerMapper.deleteByExample(cptgcsStuAnswerExample);
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "重新实训成功");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "重新实训成功");
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "重新实训失败");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "重新实训失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Constant.MODULE_CPYXDW.equals(module)) {
|
|
|
|
if (Constant.MODULE_CPYXDW.equals(module)) {
|
|
|
|
Boolean b=scoreService.deleteScore(userId,Constant.PRO_CPGH,module);
|
|
|
|
Boolean b = scoreService.deleteScore(userId, Constant.PRO_CPGH, module);
|
|
|
|
if(b){
|
|
|
|
if (b) {
|
|
|
|
CpyxdwStuAnswerExample cpyxdwStuAnswerExample = new CpyxdwStuAnswerExample();
|
|
|
|
CpyxdwStuAnswerExample cpyxdwStuAnswerExample = new CpyxdwStuAnswerExample();
|
|
|
|
cpyxdwStuAnswerExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
cpyxdwStuAnswerExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
cpyxdwStuAnswerMapper.deleteByExample(cpyxdwStuAnswerExample);
|
|
|
|
cpyxdwStuAnswerMapper.deleteByExample(cpyxdwStuAnswerExample);
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "重新实训成功");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "重新实训成功");
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "重新实训失败");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "重新实训失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -210,16 +204,12 @@ public class CptfController {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private CptgcsAnswerMapper cptgcsAnswerMapper;
|
|
|
|
private CptgcsAnswerMapper cptgcsAnswerMapper;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private CptgcsStuAnswerMapper cptgcsStuAnswerMapper;
|
|
|
|
private CptgcsStuAnswerMapper cptgcsStuAnswerMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/commitCptgcsAnswer")
|
|
|
|
@PostMapping("/commitCptgcsAnswer")
|
|
|
|
@ApiOperation("产品推广测试-提交")
|
|
|
|
@ApiOperation("产品推广测试-提交")
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ -228,7 +218,7 @@ public class CptfController {
|
|
|
|
StuGradeExample stuGradeExample = new StuGradeExample();
|
|
|
|
StuGradeExample stuGradeExample = new StuGradeExample();
|
|
|
|
stuGradeExample.createCriteria().andUserIdEqualTo(stuAnswer.getUserId()).andProjectEqualTo(Constant.PRO_CPTFCS).andModuleEqualTo(Constant.MODULE_CPTGCS);
|
|
|
|
stuGradeExample.createCriteria().andUserIdEqualTo(stuAnswer.getUserId()).andProjectEqualTo(Constant.PRO_CPTFCS).andModuleEqualTo(Constant.MODULE_CPTGCS);
|
|
|
|
List<StuGrade> stuGradeList = stuGradeMapper.selectByExampleWithBLOBs(stuGradeExample);
|
|
|
|
List<StuGrade> stuGradeList = stuGradeMapper.selectByExampleWithBLOBs(stuGradeExample);
|
|
|
|
if(CollectionUtils.isEmpty(stuGradeList)){
|
|
|
|
if (CollectionUtils.isEmpty(stuGradeList)) {
|
|
|
|
CptgcsAnswer answer = cptgcsAnswerMapper.selectByExampleWithBLOBs(new CptgcsAnswerExample()).get(0);
|
|
|
|
CptgcsAnswer answer = cptgcsAnswerMapper.selectByExampleWithBLOBs(new CptgcsAnswerExample()).get(0);
|
|
|
|
int count = 0;
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
|
|
|
|
@ -239,7 +229,7 @@ public class CptfController {
|
|
|
|
//产品点击率 校验
|
|
|
|
//产品点击率 校验
|
|
|
|
|
|
|
|
|
|
|
|
//错误次数
|
|
|
|
//错误次数
|
|
|
|
int monthlyDataErrorCount =compareListsUtil.compareErrorCount(stuAnswerClickRate, clickRate).getErrorCount();
|
|
|
|
int monthlyDataErrorCount = compareListsUtil.compareErrorCount(stuAnswerClickRate, clickRate).getErrorCount();
|
|
|
|
count = count + monthlyDataErrorCount;
|
|
|
|
count = count + monthlyDataErrorCount;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -248,17 +238,16 @@ public class CptfController {
|
|
|
|
|
|
|
|
|
|
|
|
String conversionRate = answer.getConversionRate();
|
|
|
|
String conversionRate = answer.getConversionRate();
|
|
|
|
//错误次数
|
|
|
|
//错误次数
|
|
|
|
int cheapSumCount =compareListsUtil.compareErrorCount(stuAnswerConversionRate, conversionRate).getErrorCount();
|
|
|
|
int cheapSumCount = compareListsUtil.compareErrorCount(stuAnswerConversionRate, conversionRate).getErrorCount();
|
|
|
|
count = count + cheapSumCount;
|
|
|
|
count = count + cheapSumCount;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//3.投资回报率数据
|
|
|
|
//3.投资回报率数据
|
|
|
|
String stuRoiData = stuAnswer.getRoiData();
|
|
|
|
String stuRoiData = stuAnswer.getRoiData();
|
|
|
|
|
|
|
|
|
|
|
|
String roiData = answer.getRoiData();
|
|
|
|
String roiData = answer.getRoiData();
|
|
|
|
//错误次数
|
|
|
|
//错误次数
|
|
|
|
int cheapPercentageCount =compareListsUtil.compareErrorCount(stuRoiData, roiData).getErrorCount();
|
|
|
|
int cheapPercentageCount = compareListsUtil.compareErrorCount(stuRoiData, roiData).getErrorCount();
|
|
|
|
count = count + cheapPercentageCount;
|
|
|
|
count = count + cheapPercentageCount;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -267,21 +256,19 @@ public class CptfController {
|
|
|
|
|
|
|
|
|
|
|
|
String orderAmount = answer.getOrderAmount();
|
|
|
|
String orderAmount = answer.getOrderAmount();
|
|
|
|
//错误次数
|
|
|
|
//错误次数
|
|
|
|
int costEffectiveSumCount =compareListsUtil.compareErrorCount(stuAnswerOrderAmount, orderAmount).getErrorCount();
|
|
|
|
int costEffectiveSumCount = compareListsUtil.compareErrorCount(stuAnswerOrderAmount, orderAmount).getErrorCount();
|
|
|
|
count = count + costEffectiveSumCount;
|
|
|
|
count = count + costEffectiveSumCount;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//5.p值
|
|
|
|
//5.p值
|
|
|
|
String stuPValue = stuAnswer.getpValue();
|
|
|
|
String stuPValue = stuAnswer.getpValue();
|
|
|
|
|
|
|
|
|
|
|
|
String pValue = answer.getpValue();
|
|
|
|
String pValue = answer.getpValue();
|
|
|
|
//错误次数
|
|
|
|
//错误次数
|
|
|
|
int costEffectivePercentageCount =compareListsUtil.compareErrorCount(stuPValue, pValue).getErrorCount();
|
|
|
|
int costEffectivePercentageCount = compareListsUtil.compareErrorCount(stuPValue, pValue).getErrorCount();
|
|
|
|
count = count + costEffectivePercentageCount;
|
|
|
|
count = count + costEffectivePercentageCount;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//主观题
|
|
|
|
//主观题
|
|
|
|
int i = compareListsUtil.calculateLengthPenaltyEnhanced(stuAnswer.getContext());
|
|
|
|
int i = compareListsUtil.calculateLengthPenaltyEnhanced(stuAnswer.getContext());
|
|
|
|
count = count + i;
|
|
|
|
count = count + i;
|
|
|
|
@ -290,20 +277,17 @@ public class CptfController {
|
|
|
|
cptgcsStuAnswerMapper.insertSelective(stuAnswer);
|
|
|
|
cptgcsStuAnswerMapper.insertSelective(stuAnswer);
|
|
|
|
|
|
|
|
|
|
|
|
Boolean aBoolean = scoreService.insertScore(stuAnswer.getUserId(), Constant.PRO_CPTFCS, Constant.MODULE_CPTGCS, BigDecimal.valueOf(100 - count), stuAnswer.getContext());
|
|
|
|
Boolean aBoolean = scoreService.insertScore(stuAnswer.getUserId(), Constant.PRO_CPTFCS, Constant.MODULE_CPTGCS, BigDecimal.valueOf(100 - count), stuAnswer.getContext());
|
|
|
|
if(aBoolean){
|
|
|
|
if (aBoolean) {
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "提交成功");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "提交成功");
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "已提交过");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "已提交过");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("产品推广测试-回显接口")
|
|
|
|
@ApiOperation("产品推广测试-回显接口")
|
|
|
|
@GetMapping("/selectCptgcsByUserId")
|
|
|
|
@GetMapping("/selectCptgcsByUserId")
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ -326,9 +310,6 @@ public class CptfController {
|
|
|
|
private CpyxdwStuAnswerMapper cpyxdwStuAnswerMapper;
|
|
|
|
private CpyxdwStuAnswerMapper cpyxdwStuAnswerMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/commitCpyxdwAnswer")
|
|
|
|
@PostMapping("/commitCpyxdwAnswer")
|
|
|
|
@ApiOperation("产品营销定位-提交")
|
|
|
|
@ApiOperation("产品营销定位-提交")
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ -337,14 +318,13 @@ public class CptfController {
|
|
|
|
StuGradeExample stuGradeExample = new StuGradeExample();
|
|
|
|
StuGradeExample stuGradeExample = new StuGradeExample();
|
|
|
|
stuGradeExample.createCriteria().andUserIdEqualTo(stuAnswer.getUserId()).andProjectEqualTo(Constant.PRO_CPTFCS).andModuleEqualTo(Constant.MODULE_CPYXDW);
|
|
|
|
stuGradeExample.createCriteria().andUserIdEqualTo(stuAnswer.getUserId()).andProjectEqualTo(Constant.PRO_CPTFCS).andModuleEqualTo(Constant.MODULE_CPYXDW);
|
|
|
|
List<StuGrade> stuGradeList = stuGradeMapper.selectByExampleWithBLOBs(stuGradeExample);
|
|
|
|
List<StuGrade> stuGradeList = stuGradeMapper.selectByExampleWithBLOBs(stuGradeExample);
|
|
|
|
if(CollectionUtils.isEmpty(stuGradeList)){
|
|
|
|
if (CollectionUtils.isEmpty(stuGradeList)) {
|
|
|
|
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
|
|
|
|
//1.产品点击率
|
|
|
|
//1.产品点击率
|
|
|
|
String axis = stuAnswer.getxAxis();
|
|
|
|
String axis = stuAnswer.getxAxis();
|
|
|
|
if (axis!=null)
|
|
|
|
if (axis != null) {
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!"点击率".equals(axis)) {
|
|
|
|
if (!"点击率".equals(axis)) {
|
|
|
|
count++;
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -352,16 +332,13 @@ public class CptfController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String yAxis = stuAnswer.getyAxis();
|
|
|
|
String yAxis = stuAnswer.getyAxis();
|
|
|
|
if (yAxis!=null)
|
|
|
|
if (yAxis != null) {
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!"转换率".equals(yAxis)) {
|
|
|
|
if (!"转换率".equals(yAxis)) {
|
|
|
|
count++;
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//主观题
|
|
|
|
//主观题
|
|
|
|
int i = compareListsUtil.calculateLengthPenaltyEnhanced(stuAnswer.getAnalysis());
|
|
|
|
int i = compareListsUtil.calculateLengthPenaltyEnhanced(stuAnswer.getAnalysis());
|
|
|
|
count = count + i;
|
|
|
|
count = count + i;
|
|
|
|
@ -370,20 +347,17 @@ public class CptfController {
|
|
|
|
cpyxdwStuAnswerMapper.insertSelective(stuAnswer);
|
|
|
|
cpyxdwStuAnswerMapper.insertSelective(stuAnswer);
|
|
|
|
|
|
|
|
|
|
|
|
Boolean aBoolean = scoreService.insertScore(stuAnswer.getUserId(), Constant.PRO_CPTFCS, Constant.MODULE_CPYXDW, BigDecimal.valueOf(100 - count), stuAnswer.getAnalysis());
|
|
|
|
Boolean aBoolean = scoreService.insertScore(stuAnswer.getUserId(), Constant.PRO_CPTFCS, Constant.MODULE_CPYXDW, BigDecimal.valueOf(100 - count), stuAnswer.getAnalysis());
|
|
|
|
if(aBoolean){
|
|
|
|
if (aBoolean) {
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "提交成功");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "提交成功");
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "已提交过");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "已提交过");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("产品营销定位-回显接口")
|
|
|
|
@ApiOperation("产品营销定位-回显接口")
|
|
|
|
@GetMapping("/selectCpyxdwByUserId")
|
|
|
|
@GetMapping("/selectCpyxdwByUserId")
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ -403,24 +377,19 @@ public class CptfController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Integer calculte(List<FbqdDTO> dataInfoList, Integer ser, String answer) {
|
|
|
|
public Integer calculte( List<FbqdDTO> dataInfoList,Integer ser,String answer ) {
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
int count = 0;
|
|
|
|
if (CollectionUtils.isEmpty(dataInfoList)) {
|
|
|
|
if (CollectionUtils.isEmpty(dataInfoList)) {
|
|
|
|
if (ser==1)
|
|
|
|
if (ser == 1) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return 12;
|
|
|
|
return 12;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ser==2)
|
|
|
|
if (ser == 2) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return 12;
|
|
|
|
return 12;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ser==3)
|
|
|
|
if (ser == 3) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return 4;
|
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ser==4)
|
|
|
|
if (ser == 4) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return 4;
|
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
@ -441,4 +410,54 @@ public Integer calculte( List<FbqdDTO> dataInfoList,Integer ser,String answer )
|
|
|
|
return count;
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @PostMapping("/commitCpyxdwAnswer")
|
|
|
|
|
|
|
|
// @ApiOperation("用户数据分析/产品定位-提交")
|
|
|
|
|
|
|
|
// @AnonymousAccess
|
|
|
|
|
|
|
|
// public ResultEntity commitCpyxdwAnswer(@RequestBody CpyxdwStuAnswer stuAnswer) {
|
|
|
|
|
|
|
|
// //先查询是否提交过
|
|
|
|
|
|
|
|
// StuGradeExample stuGradeExample = new StuGradeExample();
|
|
|
|
|
|
|
|
// stuGradeExample.createCriteria().andUserIdEqualTo(stuAnswer.getUserId()).andProjectEqualTo(Constant.PRO_CPTFCS).andModuleEqualTo(Constant.MODULE_CPYXDW);
|
|
|
|
|
|
|
|
// List<StuGrade> stuGradeList = stuGradeMapper.selectByExampleWithBLOBs(stuGradeExample);
|
|
|
|
|
|
|
|
// if (CollectionUtils.isEmpty(stuGradeList)) {
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// int count = 0;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// //1.产品点击率
|
|
|
|
|
|
|
|
// String axis = stuAnswer.getxAxis();
|
|
|
|
|
|
|
|
// if (axis != null) {
|
|
|
|
|
|
|
|
// if (!"点击率".equals(axis)) {
|
|
|
|
|
|
|
|
// count++;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// String yAxis = stuAnswer.getyAxis();
|
|
|
|
|
|
|
|
// if (yAxis != null) {
|
|
|
|
|
|
|
|
// if (!"转换率".equals(yAxis)) {
|
|
|
|
|
|
|
|
// count++;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// //主观题
|
|
|
|
|
|
|
|
// int i = compareListsUtil.calculateLengthPenaltyEnhanced(stuAnswer.getAnalysis());
|
|
|
|
|
|
|
|
// count = count + i;
|
|
|
|
|
|
|
|
// stuAnswer.setId(IdUtil.simpleUUID());
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// cpyxdwStuAnswerMapper.insertSelective(stuAnswer);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Boolean aBoolean = scoreService.insertScore(stuAnswer.getUserId(), Constant.PRO_CPTFCS, Constant.MODULE_CPYXDW, BigDecimal.valueOf(100 - count), stuAnswer.getAnalysis());
|
|
|
|
|
|
|
|
// if (aBoolean) {
|
|
|
|
|
|
|
|
// return new ResultEntity<>(HttpStatus.OK, "提交成功");
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// return new ResultEntity<>(HttpStatus.BAD_REQUEST, "已提交过");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|