|
|
@@ -36,6 +36,7 @@ import com.zhongzheng.modules.course.vo.CourseBusinessVo;
|
|
|
import com.zhongzheng.modules.course.vo.CourseChapterVo;
|
|
|
import com.zhongzheng.modules.course.vo.CourseProjectTypeVo;
|
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
+import com.zhongzheng.modules.goods.domain.GoodsCourse;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.grade.bo.*;
|
|
|
@@ -856,6 +857,103 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
studentVo.setGoodsId(orderGoods.getGoodsId());
|
|
|
studentVo.setGoodsName(goods.getGoodsName());
|
|
|
studentVo.setFullName(fullName);
|
|
|
+ studentVo.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
|
|
+ String userName = "erjian";
|
|
|
+ if(fullName.equals("继续教育二级建造师")){
|
|
|
+ studentVo.setGradeType(1);
|
|
|
+ }
|
|
|
+ if(fullName.equals("继续教育二级造价师")){
|
|
|
+ studentVo.setGradeType(2);
|
|
|
+ userName = "erzao";
|
|
|
+ }
|
|
|
+ SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
|
|
|
+ .eq(SysUser::getUserName, userName).last("limit 1"));
|
|
|
+ LoginUser loginUser = new LoginUser();
|
|
|
+ loginUser.setUser(sysUser);
|
|
|
+
|
|
|
+ studentVo.setToken(iUserService.createToken(loginUser));
|
|
|
+ return studentVo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ClassPeriodStudentVo DecryptSevenOfficialInfo(ClassGradeDecryptQueryBo bo) {
|
|
|
+ SEVEN_OFFICIALPUSH_INFOACCOUNT=null;
|
|
|
+ SEVEN_OFFICIALPUSH_TOKEN=null;
|
|
|
+ String pars;
|
|
|
+ try {
|
|
|
+ if(Validator.isNotEmpty(bo.getTenantId())){
|
|
|
+ ServletUtils.getRequestAttributes().getResponse().setHeader("TenantId", bo.getTenantId());
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(configService.selectConfigByKeyNoCache("seven.office.account"))){
|
|
|
+ SEVEN_OFFICIALPUSH_INFOACCOUNT = configService.selectConfigByKeyNoCache("seven.office.account");
|
|
|
+ SEVEN_OFFICIALPUSH_TOKEN = configService.selectConfigByKeyNoCache("seven.office.token");
|
|
|
+ }
|
|
|
+ byte[] Keys = new byte[]{0x22, 0x34, 0x76, 0x58, (byte) 0x90, (byte) 0xAB, (byte) 0xAD, (byte) 0xBF};
|
|
|
+ byte[] rgbKey = SEVEN_OFFICIALPUSH_TOKEN.substring(0, 8).getBytes("UTF-8");
|
|
|
+ pars = ToolsUtils.decryptDesNew(bo.getData(), SEVEN_OFFICIALPUSH_TOKEN.substring(0, 8));
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new CustomException("解析错误");
|
|
|
+ }
|
|
|
+ Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(pars);
|
|
|
+ String idCard = split.get("idnum");
|
|
|
+ String datetime = split.get("datetime");
|
|
|
+ String year = split.get("year");
|
|
|
+ if (Validator.isEmpty(datetime)) {
|
|
|
+ throw new CustomException("数据错误");
|
|
|
+ }
|
|
|
+ String datetimeStr = datetime.substring(0, 8);
|
|
|
+ if (!DateUtils.dateTimeNow(DateUtils.YYYYMMDD).equals(datetimeStr)) {
|
|
|
+ throw new CustomException("数据错误");
|
|
|
+ }
|
|
|
+ User user = iUserService.getOne(new LambdaQueryWrapper<User>().eq(User::getIdCard, EncryptHandler.encrypt(idCard)).last("limit 1"));
|
|
|
+ if (Validator.isEmpty(user)) {
|
|
|
+ throw new CustomException("身份证查无用户");
|
|
|
+ }
|
|
|
+ String bh = split.get("bh");
|
|
|
+ List<ClassGrade> classGradeList = iClassGradeService.list(new LambdaQueryWrapper<ClassGrade>().eq(ClassGrade::getOfficialName, bh));
|
|
|
+ if (Validator.isEmpty(classGradeList) || classGradeList.size() == 0) {
|
|
|
+ throw new CustomException("班级不存在");
|
|
|
+ }
|
|
|
+ ClassGradeUser classGradeUser = null;
|
|
|
+ ClassGrade grade = null;
|
|
|
+ OrderGoods orderGoods = null;
|
|
|
+ for (ClassGrade classGrade : classGradeList) {
|
|
|
+ LambdaQueryWrapper<ClassGradeUser> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq(ClassGradeUser::getGradeId, classGrade.getGradeId());
|
|
|
+ lqw.eq(ClassGradeUser::getUserId, user.getUserId());
|
|
|
+ List<ClassGradeUser> gradeUserList = iClassGradeUserService.list(lqw);
|
|
|
+ for (ClassGradeUser gu : gradeUserList) {
|
|
|
+ OrderGoods og = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId, gu.getOrderGoodsId())
|
|
|
+ .eq(OrderGoods::getSevenYear, year));
|
|
|
+ if (Validator.isNotEmpty(og)) {
|
|
|
+ grade = classGrade;
|
|
|
+ orderGoods = og;
|
|
|
+ classGradeUser = gu;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (Validator.isEmpty(classGradeUser)) {
|
|
|
+ throw new CustomException("班级用户不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Validator.isEmpty(orderGoods)) {
|
|
|
+ throw new CustomException("订单商品不存在");
|
|
|
+ }
|
|
|
+ Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, orderGoods.getGoodsId()));
|
|
|
+ CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
|
|
|
+ queryBo.setId(goods.getBusinessId());
|
|
|
+ String fullName = iCourseBusinessService.queryFullName(queryBo);
|
|
|
+ ClassPeriodStudentVo studentVo = new ClassPeriodStudentVo();
|
|
|
+ studentVo.setGradeId(grade.getGradeId());
|
|
|
+ studentVo.setClassName(grade.getClassName());
|
|
|
+ studentVo.setRealName(user.getRealname());
|
|
|
+ studentVo.setUserId(user.getUserId());
|
|
|
+ studentVo.setIdCard(idCard);
|
|
|
+ studentVo.setGoodsId(orderGoods.getGoodsId());
|
|
|
+ studentVo.setGoodsName(goods.getGoodsName());
|
|
|
+ studentVo.setFullName(fullName);
|
|
|
+ studentVo.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
|
|
String userName = "erjian";
|
|
|
if(fullName.equals("继续教育二级建造师")){
|
|
|
studentVo.setGradeType(1);
|