|
@@ -17,10 +17,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.zhongzheng.common.annotation.DataScope;
|
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
|
+import com.zhongzheng.common.exception.BaseException;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
-import com.zhongzheng.common.utils.DateUtils;
|
|
|
-import com.zhongzheng.common.utils.ServletUtils;
|
|
|
-import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
+import com.zhongzheng.common.type.EncryptHandler;
|
|
|
+import com.zhongzheng.common.utils.*;
|
|
|
import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.modules.activity.domain.ActivityGoodsPrice;
|
|
|
import com.zhongzheng.modules.activity.service.IActivityGoodsPriceService;
|
|
@@ -91,6 +91,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.io.InputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
@@ -5061,15 +5062,15 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
switch (goodsVo.getCourseType()){
|
|
|
case 1://视频
|
|
|
h5Url = String.format("%s%s/pages/learn/index?skipPort=%s", URL_PREFIX, sysTenant.getHostH5(),key);
|
|
|
- pcUrl = String.format("%s%s/person-center/my-course?skipPort=%s", URL_PREFIX, sysTenant.getHostH5(),key);
|
|
|
+ pcUrl = String.format("%s%s/person-center/my-course?skipPort=%s", URL_PREFIX, sysTenant.getHostPc(),key);
|
|
|
break;
|
|
|
case 2://题库
|
|
|
h5Url = String.format("%s%s/pages/questionBank/index?skipPort=%s", URL_PREFIX, sysTenant.getHostH5(),key);
|
|
|
- pcUrl = String.format("%s%s/person-center/my-bank/index?skipPort=%s", URL_PREFIX, sysTenant.getHostH5(),key);
|
|
|
+ pcUrl = String.format("%s%s/person-center/my-bank/index?skipPort=%s", URL_PREFIX, sysTenant.getHostPc(),key);
|
|
|
break;
|
|
|
case 6://直播
|
|
|
h5Url = String.format("%s%s/pages/learn/index?skipPort=%s", URL_PREFIX, sysTenant.getHostH5(),key);
|
|
|
- pcUrl = String.format("%s%s/person-center/my-live?skipPort=%s", URL_PREFIX, sysTenant.getHostH5(),key);
|
|
|
+ pcUrl = String.format("%s%s/person-center/my-live?skipPort=%s", URL_PREFIX, sysTenant.getHostPc(),key);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -5087,6 +5088,45 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
return voList;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String,String> checkUserAccount(UserGoodsListBo bo) {
|
|
|
+ List<User> users = null;
|
|
|
+ if (StringUtils.isNotBlank(bo.getIdNum())){
|
|
|
+ users = iUserService.getUserByIdNumNotTenant(bo.getIdNum());
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isEmpty(users)){
|
|
|
+ users = iUserService.getUserByTelNotTenant(bo.getTelphone());
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isEmpty(users)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ User user = users.stream().filter(x -> {
|
|
|
+ return SecurityUtils.matchesPassword(bo.getPassword(),x.getPassword());
|
|
|
+ } ).findFirst().orElse(null);
|
|
|
+ if (ObjectUtils.isNull(user)){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ //新系统有账号
|
|
|
+ Long tenantId = user.getTenantId();
|
|
|
+ //缓存用户信息key
|
|
|
+ String key = String.format("KQTZ%s",user.getUserId());
|
|
|
+ SysTenant sysTenant = iSysTenantService.getById(tenantId);
|
|
|
+ //课程
|
|
|
+ String h5Url = String.format("%s%s/pages/learn/index?skipPort=%s", URL_PREFIX, sysTenant.getHostH5(),key);
|
|
|
+ String pcUrl = String.format("%s%s/person-center/my-course?skipPort=%s", URL_PREFIX, sysTenant.getHostPc(),key);
|
|
|
+ HashMap<String, String> map = new HashMap<>();
|
|
|
+ map.put("h5Url",h5Url);
|
|
|
+ map.put("pcUrl",pcUrl);
|
|
|
+ UserPhoneBo phoneBo = new UserPhoneBo();
|
|
|
+ phoneBo.setTelphone(bo.getTelphone());
|
|
|
+ phoneBo.setTenantId(tenantId);
|
|
|
+ phoneBo.setIdNum(bo.getIdNum());
|
|
|
+
|
|
|
+ //缓存用户信息
|
|
|
+ redisCache.setCacheObjectTenant(tenantId+":"+key, JSONObject.toJSONString(phoneBo), 12, TimeUnit.HOURS);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
private void updateHandoutsId(Long goodsId, Long tenantId, Long handoutsId) {
|
|
|
baseMapper.updateHandoutsId(goodsId,tenantId,handoutsId);
|
|
|
}
|