Commit 6b677164 by huluobin

战术更新

parent 67e44c52
......@@ -25,7 +25,8 @@ public interface IBeautyExpoQuestionnaireService extends IService<BeautyExpoQues
* 是否已经填写调查问卷
*
* @param customerId
* @param type
* @return
*/
Boolean hasSubmitted(Integer customerId);
Boolean hasSubmitted(Integer customerId, Integer type);
}
......@@ -22,15 +22,17 @@ public class BeautyExpoQuestionnaireServiceImpl extends ServiceImpl<BeautyExpoQu
@Override
public void submitQuestionnaire(BeautyExpoQuestionnaire beautyExpoQuestionnaire) {
if (hasSubmitted(beautyExpoQuestionnaire.getCustomerId())) {
if (hasSubmitted(beautyExpoQuestionnaire.getCustomerId(), beautyExpoQuestionnaire.getType())) {
throw new RRException(ErrorCode.CS_2003);
}
this.save(beautyExpoQuestionnaire);
}
@Override
public Boolean hasSubmitted(Integer customerId) {
BeautyExpoQuestionnaire questionnaire = this.getOne(new LambdaQueryWrapper<BeautyExpoQuestionnaire>().eq(BeautyExpoQuestionnaire::getCustomerId, customerId));
public Boolean hasSubmitted(Integer customerId, Integer type) {
BeautyExpoQuestionnaire questionnaire = this.getOne(new LambdaQueryWrapper<BeautyExpoQuestionnaire>()
.eq(BeautyExpoQuestionnaire::getCustomerId, customerId)
.eq(BeautyExpoQuestionnaire::getType, type));
return questionnaire != null;
}
}
......@@ -32,7 +32,7 @@ public class BeautyExpoQuestionnaireController {
@ApiOperation("/是否已经填写美博会调查问卷")
@GetMapping("/customer/beautyExpoQuestionnaire/hasSubmitted")
public JsonResult<Boolean> hasSubmitted(@RequestParam Integer type) {
return JsonResult.success(beautyExpoQuestionnaireService.hasSubmitted(SessionUtils.getCustomerId()));
return JsonResult.success(beautyExpoQuestionnaireService.hasSubmitted(SessionUtils.getCustomerId(), type));
}
@ApiOperation("/提交美博会调查问卷")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment