|
@@ -24,6 +24,8 @@ import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.type.EncryptHandler;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
+import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
+import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.modules.base.domain.UserProfile;
|
|
|
import com.zhongzheng.modules.base.service.IUserProfileService;
|
|
|
import com.zhongzheng.modules.course.bo.CourseAddBo;
|
|
@@ -49,10 +51,7 @@ import com.zhongzheng.modules.goods.service.IGoodsCourseService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsQuestionRelService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.service.IQuestionMerchantService;
|
|
|
-import com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo;
|
|
|
-import com.zhongzheng.modules.goods.vo.GoodsPeriodVo;
|
|
|
-import com.zhongzheng.modules.goods.vo.GoodsSectionNumVo;
|
|
|
-import com.zhongzheng.modules.goods.vo.GoodsUserVo;
|
|
|
+import com.zhongzheng.modules.goods.vo.*;
|
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
|
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodStatusAddBo;
|
|
@@ -69,6 +68,7 @@ import com.zhongzheng.modules.order.vo.SpecialQuestionVo;
|
|
|
import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
|
import com.zhongzheng.modules.system.domain.SysTenant;
|
|
|
import com.zhongzheng.modules.system.service.ISysTenantService;
|
|
|
+import com.zhongzheng.modules.top.order.vo.TopConversionRateTrendVo;
|
|
|
import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
|
|
|
import com.zhongzheng.modules.user.bo.UserPhoneBo;
|
|
|
import com.zhongzheng.modules.user.bo.UserPlanQueryBo;
|
|
@@ -162,6 +162,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
private RedisCache redisCache;
|
|
|
@Value("${liveGotoURL}")
|
|
|
private String URL_PREFIX;
|
|
|
+ @Value("${oldSys.goods}")
|
|
|
+ private String OLD_GOODS;
|
|
|
@Autowired
|
|
|
private ClassGradeUserMapper classGradeUserMapper;
|
|
|
|
|
@@ -1111,6 +1113,43 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public UserNewGoodsVo getOldGoodsList(Long userId) {
|
|
|
+ UserNewGoodsVo vo = new UserNewGoodsVo();
|
|
|
+ User user = iUserService.getById(userId);
|
|
|
+ if (ObjectUtils.isNull(user)){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ String idCard = EncryptHandler.decrypt(user.getIdCard());
|
|
|
+ String telPhone = EncryptHandler.decrypt(user.getTelphone());
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(idCard+telPhone+nowTime + "pubilc2022");
|
|
|
+ params.put("stamp", nowTime.toString());
|
|
|
+ params.put("sign", sign);
|
|
|
+ params.put("idNum", idCard);
|
|
|
+ params.put("passwordSign", "2");
|
|
|
+ params.put("telphone",telPhone);
|
|
|
+ String respone = "";
|
|
|
+ try {
|
|
|
+ respone = HttpUtils.postFormBody(OLD_GOODS, params);
|
|
|
+ if (!respone.contains("\"code\":200")) {
|
|
|
+ throw new CustomException("旧系统用户商品接口错误");
|
|
|
+ }
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(respone);
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
+ if (ObjectUtils.isNotNull(data)){
|
|
|
+ vo = JSONObject.parseObject(JSONObject.toJSONString(data), UserNewGoodsVo.class);
|
|
|
+ }else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new CustomException("旧系统用户商品接口错误");
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
private Long liveTime(Long nowTime, Integer day) {
|
|
|
for (Integer i = 0; i < day; i++) {
|
|
|
Long dayAfter = DateUtils.getDayAfter(nowTime, 1);
|