|
@@ -314,12 +314,17 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
UserSubscribe update = new UserSubscribe();
|
|
|
update.setSubscribeId(subscribe);
|
|
|
update.setSubscribeStatus(bo.getSubscribeStatus());
|
|
|
+ //考试登记
|
|
|
+ if(Validator.isNotEmpty(bo.getExamStatus())&&bo.getExamStatus()>0){
|
|
|
+ if(!checkCanExamResult(userSubscribeVo.getApplySiteEndTime(),userSubscribeVo.getApplySiteExamTime())){
|
|
|
+ throw new CustomException("考试时间未到,不能进行考试登记");
|
|
|
+ }
|
|
|
+ }
|
|
|
if (bo.getSubscribeStatus() != null && bo.getSubscribeStatus().equals(2)) {
|
|
|
sendExamcancel(bo);
|
|
|
}
|
|
|
update.setExamStatus(bo.getExamStatus());
|
|
|
update.setRemark(bo.getRemark());
|
|
|
- // update.setBeforeId(bo.getBeforeId());
|
|
|
update.setBeforeStatus(bo.getBeforeStatus());
|
|
|
if (bo.getBeforeStatus() != null && bo.getBeforeStatus().equals(1)){
|
|
|
if(Validator.isEmpty(userSubscribeVo.getBeforeStatus())||userSubscribeVo.getBeforeStatus().equals(0)){
|
|
@@ -372,6 +377,8 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean updateByEditMoreBo(List<UserAppSubscribeEditBo> list) {
|
|
@@ -382,6 +389,12 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
UserSubscribe update = new UserSubscribe();
|
|
|
update.setSubscribeId(subscribe);
|
|
|
update.setSubscribeStatus(editBo.getSubscribeStatus());
|
|
|
+ //考试登记
|
|
|
+ if(Validator.isNotEmpty(editBo.getExamStatus())&&editBo.getExamStatus()>0){
|
|
|
+ if(!checkCanExamResult(userSubscribeVo.getApplySiteEndTime(),userSubscribeVo.getApplySiteExamTime())){
|
|
|
+ throw new CustomException("考试时间未到,不能进行考试登记");
|
|
|
+ }
|
|
|
+ }
|
|
|
if(editBo.getExamStatus().equals(1)){
|
|
|
update.setPerformance(editBo.getPerformance());
|
|
|
update.setCertificateCode(editBo.getCertificateCode());
|
|
@@ -460,6 +473,22 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
return b;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 检查可否进行考试登记
|
|
|
+ * @param
|
|
|
+ */
|
|
|
+ private boolean checkCanExamResult(String applySiteEndTime,Long applySiteExamTime){
|
|
|
+ String date = DateUtils.timestampToDateFormat(applySiteExamTime);
|
|
|
+ if (Validator.isNotEmpty(applySiteEndTime)&&applySiteEndTime.length()==5) {
|
|
|
+ date = date + " "+applySiteEndTime;
|
|
|
+ }
|
|
|
+ Long examTime = DateUtils.dateTime("yyyy/MM/dd HH:mm",date).getTime();
|
|
|
+ if(examTime.longValue()>System.currentTimeMillis()){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
//取消预约
|
|
|
private void sendExamcancel(UserSubscribeEditBo bo) {
|
|
|
for (Long subscribe : bo.getSubscribeId()) {
|
|
@@ -515,9 +544,16 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
public Boolean updateByEditSingleBo(UserAppSubscribeEditBo bo) {
|
|
|
UserSubscribe update = BeanUtil.toBean(bo, UserSubscribe.class);
|
|
|
validEntityBeforeSave(update);
|
|
|
+
|
|
|
//时间是否已过
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
UserSubscribeVo userSubscribeVo = this.queryById(update.getSubscribeId());
|
|
|
+ //考试登记
|
|
|
+ if(Validator.isNotEmpty(bo.getExamStatus())&&bo.getExamStatus()>0){
|
|
|
+ if(!checkCanExamResult(userSubscribeVo.getApplySiteEndTime(),userSubscribeVo.getApplySiteExamTime())){
|
|
|
+ throw new CustomException("考试时间未到,不能进行考试登记");
|
|
|
+ }
|
|
|
+ }
|
|
|
ExamApplyVo examApplyVo = examApplyMapper.selectByApply(userSubscribeVo.getApplyId());
|
|
|
if (examApplyVo.getApplyEndTime() < System.currentTimeMillis()/1000){
|
|
|
throw new IllegalArgumentException("不可取消预约");
|
|
@@ -1363,6 +1399,14 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
userSbusciEditBo.setPerformance(userSubscribeImport.getPerformance());
|
|
|
userSbusciEditBo.setCertificateCode(userSubscribeImport.getCertificateCode());
|
|
|
userSbusciEditBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ //考试登记
|
|
|
+ if(Validator.isNotEmpty(userSbusciEditBo.getExamStatus())&&userSbusciEditBo.getExamStatus()>0){
|
|
|
+ if(!checkCanExamResult(userSbusciEditBo.getApplySiteEndTime(),userSbusciEditBo.getApplySiteExamTime())){
|
|
|
+ userSubscribeImport.setCause("考试时间未到,不能进行考试登记");
|
|
|
+ userSubscribeImports.add(userSubscribeImport);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
this.updateById(userSbusciEditBo);
|
|
|
//考试状态由正常改为非正常
|
|
|
if(!userSubscribeImport.getExamStatus().equals("正常")){
|