|
|
@@ -16,6 +16,8 @@ import com.zhongzheng.common.utils.AES;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.common.utils.polyv.PolyvUtils;
|
|
|
+import com.zhongzheng.modules.base.domain.UserProfile;
|
|
|
+import com.zhongzheng.modules.base.service.IUserProfileService;
|
|
|
import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
|
import com.zhongzheng.modules.course.vo.CourseChapterVo;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
@@ -33,6 +35,7 @@ import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
import com.zhongzheng.modules.order.vo.OrderGoodsVo;
|
|
|
import com.zhongzheng.modules.system.domain.SysTenant;
|
|
|
import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
|
|
|
+import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
|
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
|
import com.zhongzheng.modules.user.domain.UserPlan;
|
|
|
import com.zhongzheng.modules.user.domain.UserStudyRecordPhoto;
|
|
|
@@ -41,6 +44,7 @@ import com.zhongzheng.modules.user.service.IUserStudyRecordPhotoService;
|
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
|
import com.zhongzheng.modules.user.vo.SubjectStudyRecordVo;
|
|
|
import com.zhongzheng.modules.user.vo.UserStudyRecordPhotoVo;
|
|
|
+import com.zhongzheng.modules.user.vo.UserStudyRecordVo;
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
@@ -105,6 +109,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
@Autowired
|
|
|
private IClassGradeUserService iClassGradeUserService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IUserProfileService iUserProfileService;
|
|
|
+
|
|
|
@Value("${aliyun.oss.endpoint}")
|
|
|
private String ALIYUN_OSS_ENDPOINT;
|
|
|
|
|
|
@@ -506,6 +513,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
return "班级有效期已结束";
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
OrderGoodsQueryBo goodsQueryBo = new OrderGoodsQueryBo();
|
|
|
goodsQueryBo.setUserId(bo.getUserId());
|
|
|
goodsQueryBo.setGradeId(userVo.getGradeId());
|
|
|
@@ -513,12 +521,26 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
if(Validator.isEmpty(orderGoods)){
|
|
|
return "班级商品不存在";
|
|
|
}
|
|
|
+
|
|
|
+ UserProfile userProfile = iUserProfileService.getOne(new LambdaQueryWrapper<UserProfile>()
|
|
|
+ .eq(UserProfile::getUserId,bo.getUserId()).eq(UserProfile::getGoodsId,orderGoods.getGoodsId())
|
|
|
+ .eq(UserProfile::getCurrentStatus,1).eq(UserProfile::getTypeStatus,1)
|
|
|
+ .last("limit 1"));
|
|
|
+ if(Validator.isNotEmpty(userProfile)&&userProfile.getStatus()!=1){
|
|
|
+ return "资料审核没通过";
|
|
|
+ }
|
|
|
+
|
|
|
+ UserStudyRecordQueryBo studyRecordQueryBo = new UserStudyRecordQueryBo();
|
|
|
+ studyRecordQueryBo.setUserId(bo.getUserId());
|
|
|
+ studyRecordQueryBo.setGradeId(userVo.getGradeId());
|
|
|
+ //第一条学习记录
|
|
|
+ UserStudyRecordVo firstVo = iUserStudyRecordService.queryFirst(studyRecordQueryBo);
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
params.put("zh",OFFICIALPUSH_INFOACCOUNT);
|
|
|
params.put("bh",userVo.getOfficialName());
|
|
|
params.put("xm",userVo.getRealName());
|
|
|
params.put("sfz",userVo.getIdCard());
|
|
|
- params.put("ksrq",DateUtils.timestampToDate(orderGoods.getCreateTime()));
|
|
|
+ params.put("ksrq",DateUtils.timestampToDate(firstVo.getFirstStartTime()));
|
|
|
params.put("jsrq",DateUtils.timestampToDate(userVo.getPeriodTime()));
|
|
|
String dataTxt = params.get("zh")+params.get("bh")+params.get("xm")+params.get("sfz")+params.get("ksrq")+params.get("jsrq");
|
|
|
String encrypted = dataSign(dataTxt,OFFICIALPUSH_TOKEN);
|