|
@@ -1,6 +1,7 @@
|
|
|
package com.zhongzheng.modules.user.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
@@ -72,6 +73,10 @@ public class UserMockSubscribeServiceImpl extends ServiceImpl<UserMockSubscribeM
|
|
|
lqw.eq(StrUtil.isNotBlank(bo.getApplySiteStartTime()), UserMockSubscribe::getApplySiteStartTime, bo.getApplySiteStartTime());
|
|
|
lqw.eq(StrUtil.isNotBlank(bo.getApplySiteEndTime()), UserMockSubscribe::getApplySiteEndTime, bo.getApplySiteEndTime());
|
|
|
lqw.eq(bo.getApplySiteExamTime() != null, UserMockSubscribe::getApplySiteExamTime, bo.getApplySiteExamTime());
|
|
|
+ lqw.eq(bo.getDoNum() != null, UserMockSubscribe::getDoNum, bo.getDoNum());
|
|
|
+ lqw.eq(bo.getFirstScore() != null, UserMockSubscribe::getFirstScore, bo.getFirstScore());
|
|
|
+ lqw.eq(bo.getFirstSubjectiveScore() != null, UserMockSubscribe::getFirstSubjectiveScore, bo.getFirstSubjectiveScore());
|
|
|
+ lqw.eq(bo.getFirstHandTime() != null, UserMockSubscribe::getFirstHandTime, bo.getFirstHandTime());
|
|
|
return entity2Vo(this.list(lqw));
|
|
|
}
|
|
|
|
|
@@ -169,6 +174,21 @@ public class UserMockSubscribeServiceImpl extends ServiceImpl<UserMockSubscribeM
|
|
|
public Boolean updateByEditBo(UserMockSubscribeEditBo bo) {
|
|
|
UserMockSubscribe update = BeanUtil.toBean(bo, UserMockSubscribe.class);
|
|
|
validEntityBeforeSave(update);
|
|
|
+ UserMockSubscribeVo userMockSubscribeVo = this.queryById(update.getSubscribeId());
|
|
|
+ if (BeanUtil.isNotEmpty(userMockSubscribeVo)) {
|
|
|
+ if (Validator.isNotEmpty(userMockSubscribeVo.getFirstScore())) {
|
|
|
+ update.setFirstScore(null);
|
|
|
+ }
|
|
|
+ if (Validator.isNotEmpty(userMockSubscribeVo.getFirstSubjectiveScore()) && userMockSubscribeVo.getFirstSubjectiveScore() == 1) {
|
|
|
+ update.setFirstSubjectiveScore(null);
|
|
|
+ }
|
|
|
+ if (Validator.isNotEmpty(userMockSubscribeVo.getFirstHandTime())) {
|
|
|
+ update.setFirstHandTime(null);
|
|
|
+ }
|
|
|
+ if (Validator.isNotEmpty(bo.getHandStatus()) && bo.getHandStatus() != 0) {
|
|
|
+ update.setDoNum(userMockSubscribeVo.getDoNum() + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
return this.updateById(update);
|
|
|
}
|