|
@@ -1239,15 +1239,22 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
if(Validator.isEmpty(newOrderGoods.getSevenYear())){
|
|
|
return 0;
|
|
|
}
|
|
|
- OrderGoods copyOrderGoods = iOrderGoodsService.getSevenLastOne(goods.getProjectId(),newOrderGoods.getSevenYear(),userId);
|
|
|
- if(Validator.isEmpty(copyOrderGoods)){
|
|
|
+ OrderGoods oldOrderGoods = iOrderGoodsService.getSevenLastOne(goods.getProjectId(),newOrderGoods.getSevenYear(),userId);
|
|
|
+ if(Validator.isEmpty(oldOrderGoods)){
|
|
|
newOrderGoods.setSevenClassVersion(newOrderGoods.getSevenClassVersion()+1);
|
|
|
newOrderGoods.setSevenClassStatus(1);
|
|
|
newOrderGoods.setUpdateTime(DateUtils.getNowTime());
|
|
|
iOrderGoodsService.updateById(newOrderGoods);
|
|
|
return 1;
|
|
|
}
|
|
|
- UserStudyRecord userStudyRecord = baseMapper.getSevenStudyRecord(copyOrderGoods.getOrderGoodsId(),copyOrderGoods.getGradeId());
|
|
|
+ if(newOrderGoods.getSevenClassStatus()==4){
|
|
|
+ newOrderGoods.setSevenClassVersion(oldOrderGoods.getSevenClassVersion()+1);
|
|
|
+ newOrderGoods.setSevenClassStatus(1);
|
|
|
+ newOrderGoods.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ iOrderGoodsService.updateById(newOrderGoods);
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ UserStudyRecord userStudyRecord = baseMapper.getSevenStudyRecord(oldOrderGoods.getOrderGoodsId(),oldOrderGoods.getGradeId());
|
|
|
if(Validator.isEmpty(userStudyRecord)){
|
|
|
throw new CustomException("公共章学习数据错误");
|
|
|
}
|
|
@@ -1326,7 +1333,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
userStudyRecordPhotoService.save(copyPhoto);
|
|
|
}
|
|
|
}
|
|
|
- newOrderGoods.setSevenClassVersion(copyOrderGoods.getSevenClassVersion());
|
|
|
+ newOrderGoods.setSevenClassVersion(oldOrderGoods.getSevenClassVersion());
|
|
|
newOrderGoods.setSevenClassStatus(2);
|
|
|
newOrderGoods.setUpdateTime(DateUtils.getNowTime());
|
|
|
iOrderGoodsService.updateById(newOrderGoods);
|