姜永辉 2 лет назад
Родитель
Сommit
f8a65532c3
1 измененных файлов с 6 добавлено и 3 удалено
  1. 6 3
      src/main/java/com/dk/oauth/service/impl/CompanyServiceImpl.java

+ 6 - 3
src/main/java/com/dk/oauth/service/impl/CompanyServiceImpl.java

@@ -92,7 +92,10 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
     @Transactional(rollbackFor = Exception.class)
     public ResponseResultVO updateCurrentCpByWxid(Map<String, Object> map) {
         String userWxid = map.get("openid") + "";
-        Integer cpId = Integer.valueOf(map.get("cpId") + "");
+        Integer cpId = null;
+        if (map.get("cpId") != null) {
+            cpId = Integer.valueOf(map.get("cpId") + "");
+        }
         int i = userMapper.updateCurrentCpByWxid(userWxid, cpId);
         return ResponseResultUtil.success(true);
     }
@@ -125,7 +128,7 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
         HttpServletRequest request;
         if (attributes != null) {
             request = attributes.getRequest();
-            request.setAttribute("svcCode", company.getSvcCode().replace("_","-"));
+            request.setAttribute("svcCode", company.getSvcCode().replace("_", "-"));
         }
 
         // 组织机构 -顶级
@@ -158,7 +161,7 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
         // 如果没有成功返回,状态设置为待审
         if (staffResponseResponseResultVO.getCode() != ResponseCodeEnum.SUCCESS.getCode()) {
             // 无用户
-            throw new BaseBusinessException(staffResponseResponseResultVO.getCode(),staffResponseResponseResultVO.getMessage());
+            throw new BaseBusinessException(staffResponseResponseResultVO.getCode(), staffResponseResponseResultVO.getMessage());
         } else {
             staffResponse = staffResponseResponseResultVO.getData();
         }