Bladeren bron

员工编辑

姜永辉 1 jaar geleden
bovenliggende
commit
53830fcfd0
1 gewijzigde bestanden met toevoegingen van 11 en 2 verwijderingen
  1. 11 2
      src/main/java/com/dk/oauth/service/impl/CompanyServiceImpl.java

+ 11 - 2
src/main/java/com/dk/oauth/service/impl/CompanyServiceImpl.java

@@ -88,8 +88,17 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
     public ResponseResultVO getCompanyMaxStaffNum(Integer id) {
     public ResponseResultVO getCompanyMaxStaffNum(Integer id) {
         Company company = companyMapper.selectById(id);
         Company company = companyMapper.selectById(id);
         Map<String,Object> mp = new HashMap<>();
         Map<String,Object> mp = new HashMap<>();
-        mp.put("maxStaffNum",company.getMaxStaffNum());
-        mp.put("curStaffNum",company.getCurStaffNum());
+        // 解析license信息
+        String licenseStr = AESUtil.desEncrypt(company.getLicense());
+        if(licenseStr != null ){
+            Map<String,Object> licenseMap = JSON.parseObject(licenseStr,Map.class);
+            mp.put("web_max_num",Integer.parseInt(licenseMap.get("web_max_num").toString()));
+            mp.put("wx_max_num",Integer.parseInt(licenseMap.get("wx_max_num").toString()));
+        }else{
+            mp.put("web_max_num",1);
+            mp.put("wx_max_num",1);
+        }
+
         return ResponseResultUtil.success(mp);
         return ResponseResultUtil.success(mp);
     }
     }