3
0

8 Incheckningar 1c4c12f106 ... 664b5a5ccc

Upphovsman SHA1 Meddelande Datum
  guozhaoshun 664b5a5ccc recover file 6 år sedan
  guozhaoshun 03a368021a angelBell HN provinceCode = 90 6 år sedan
  guozhaoshun ea9b83742d angelBell HN provinceCode = 90 6 år sedan
  guozhaoshun 9efc79ba32 angelBell HN provinceCode = 90 6 år sedan
  guozhaoshun 714dc6003e ProvinceUtil get 43 -> 90 6 år sedan
  guozhaoshun 6a73cabad1 fix video update 6 år sedan
  guozhaoshun 3256f1321c ProvinceUtil get HN 43|90 6 år sedan
  guozhaoshun 250b07a14b update ProvinceUtil change provinceCode HN = "90" 6 år sedan

+ 2 - 0
rankin-common-utils/src/main/java/cn/rankin/common/utils/dto/resource/ResourceDTO.java

@@ -13,6 +13,8 @@ public class ResourceDTO implements Serializable {
 
     private String id;
 
+    private String rid;
+
     private String code;
 
     private String name;

+ 6 - 1
rankin-common-utils/src/main/java/cn/rankin/common/utils/util/ProvinceUtil.java

@@ -39,7 +39,8 @@ public class ProvinceUtil {
 
     public static final String HB = "42";   // 湖北
 
-    public static final String HN = "43";   // 湖南
+    public static final String HN_ORIGINAL = "43";   // 湖南 原始CODE
+    public static final String HN = "90";   // 湖南
 
     public static final String GD = "44";   // 广东
 
@@ -148,6 +149,10 @@ public class ProvinceUtil {
     };
 
     public static String get(String str) {
+        //如果使用湖南原始CODE,转为当前CODE
+        if(HN_ORIGINAL.equals(str)){
+            str = HN;
+        }
         return map.get(str);
     }
 

+ 2 - 0
rankin-common-utils/src/main/java/cn/rankin/common/utils/vo/resource/ResourceVo.java

@@ -13,6 +13,8 @@ public class ResourceVo implements Serializable {
 
     private String id;
 
+    private String rid;
+
     private String code;
 
     private String name;

+ 3 - 0
rankin-data-api/src/main/java/cn/rankin/data/api/resource/entity/Resource.java

@@ -57,6 +57,9 @@ public class Resource implements Serializable {
     private Date gmtModified;
 
     @Transient
+    private String rid;
+
+    @Transient
     private String url;
 
     @Transient

+ 1 - 0
rankin-resource-service/src/main/java/cn/rankin/resourceservice/dto/ResourceRemote.java

@@ -62,6 +62,7 @@ public class ResourceRemote implements Serializable {
         videos.forEach(v -> {
             Resource resource = new Resource();
             resource.setId(v.getId());
+            resource.setRid(v.getRid());
             resource.setCode(no);
             resource.setName(title);
             resource.setType(type);

+ 1 - 2
rankin-resource-service/src/main/java/cn/rankin/resourceservice/service/ResourceService.java

@@ -206,7 +206,7 @@ public class ResourceService {
 
     /**
      *
-      * @param resource
+     * @param resource
      * @throws DuplicateValueException
      * @throws NotFoundException
      */
@@ -412,4 +412,3 @@ public class ResourceService {
     }
 
 }
-

+ 21 - 2
rankin-user-service/src/main/java/cn/rankin/userservice/controller/CampusController.java

@@ -2,6 +2,7 @@ package cn.rankin.userservice.controller;
 
 import cn.rankin.common.utils.api.model.APIResult;
 import cn.rankin.common.utils.api.page.Page;
+import cn.rankin.common.utils.util.ProvinceUtil;
 import cn.rankin.data.api.user.dto.CampusDTO;
 import cn.rankin.data.api.user.dto.CampusSearchDTO;
 import cn.rankin.common.utils.enums.BaseOrderEnum;
@@ -12,6 +13,7 @@ import cn.rankin.userservice.service.CampusService;
 import cn.rankin.userservice.service.MerchantService;
 import cn.rankin.userservice.utils.StudentNo;
 import cn.rankin.userservice.utils.StudentNumberUtil;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -20,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
 import java.util.*;
-
+@Slf4j
 @RestController
 @RequestMapping(value = "/campus")
 public class CampusController {
@@ -114,13 +116,15 @@ public class CampusController {
             return APIResult.error(UserServiceAPICode.PARAMETER_ERROR);
         }
 
-        Integer serialNo = campusService.getSerialNo(merchantId, provinceCode);
+        provinceCode = converProvinceCode(merchant, provinceCode);
 
+        Integer serialNo = campusService.getSerialNo(merchantId, provinceCode);
         StudentNo studentNo = StudentNumberUtil.getStudentNo(merchant.getCode(), provinceCode, serialNo);
         if (studentNo == null) {
             return APIResult.error(UserServiceAPICode.CAMPUS_NO_ERROR);
         }
 
+        campusDTO.setProvinceCode(provinceCode);
         campusDTO.setSerialNo(serialNo);
         campusDTO.setCode(studentNo.getCampusNo());
 
@@ -133,6 +137,21 @@ public class CampusController {
         return result;
     }
 
+    /**
+     * 判断是否贝尔安亲,湖南校区。
+     * 因湖南校区已达到最大限额,使用湖南新编号
+     * @param merchant
+     * @param provinceCode
+     * @return
+     */
+    private String converProvinceCode(Merchant merchant, String provinceCode) {
+        if("6666".equals(merchant.getCode()) && provinceCode.equals(ProvinceUtil.HN_ORIGINAL)){
+            provinceCode = ProvinceUtil.HN;
+        }
+
+        return provinceCode;
+    }
+
     @RequestMapping(value = "/ids", method = RequestMethod.GET)
     public APIResult<Map<String, Campus>> findByIds(@RequestParam("id") List<String> campusIds) {
         Map<String, Campus> campusMap = campusService.getCampusMap(campusIds);