yangdamao před 1 rokem
rodič
revize
6488198677

+ 1 - 0
zhongzheng-admin-saas/src/main/resources/application-dev.yml

@@ -170,6 +170,7 @@ oldOrder:
 
 oldSys:
     host: http://gdxypx.xy.com
+    goods: http://gdxypx.xy.com/WitSystem/BussinessApi/NewYxtLogin
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log

+ 1 - 0
zhongzheng-admin/src/main/resources/application-dev.yml

@@ -171,6 +171,7 @@ oldOrder:
 
 oldSys:
     host: http://gdxypx.xy.com
+    goods: http://gdxypx.xy.com/WitSystem/BussinessApi/NewYxtLogin
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log

+ 11 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -9,6 +9,7 @@ import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.*;
 import com.zhongzheng.modules.goods.vo.GoodsUserVo;
+import com.zhongzheng.modules.goods.vo.UserNewGoodsVo;
 import com.zhongzheng.modules.order.bo.SpecialQuestionBo;
 import com.zhongzheng.modules.order.vo.SpecialQuestionVo;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
@@ -206,4 +207,14 @@ public class CourseController extends BaseController {
         return AjaxResult.success(vo);
     }
 
+    /**
+     * 旧系统学员商品信息
+     */
+    @ApiOperation("旧系统学员商品信息")
+    @GetMapping("/old/goods/list")
+    public AjaxResult<UserNewGoodsVo> getOldGoodsList() {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        return AjaxResult.success(iCourseService.getOldGoodsList(loginUser.getUser().getUserId()));
+    }
+
 }

+ 1 - 0
zhongzheng-api/src/main/resources/application-dev.yml

@@ -173,6 +173,7 @@ oldOrder:
 
 oldSys:
     host: http://gdxypx.xy.com
+    goods: http://gdxypx.xy.com/System/BussinessApi/NewYxtLogin
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log

+ 3 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java

@@ -8,10 +8,7 @@ import com.zhongzheng.modules.course.domain.Course;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
-import com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo;
-import com.zhongzheng.modules.goods.vo.GoodsPeriodVo;
-import com.zhongzheng.modules.goods.vo.GoodsUserVo;
-import com.zhongzheng.modules.goods.vo.GoodsVo;
+import com.zhongzheng.modules.goods.vo.*;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.vo.ClassGradeVo;
 import com.zhongzheng.modules.order.bo.SpecialQuestionBo;
@@ -110,4 +107,6 @@ public interface ICourseService extends IService<Course> {
     Long getSpecialQuestionCount(SpecialQuestionBo bo);
 
 	Map<String,String> getSpecialQuestionSkipCode(Long userId);
+
+	UserNewGoodsVo getOldGoodsList(Long userId);
 }

+ 43 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -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);