Althars123 преди 3 години
родител
ревизия
26d327d51a

+ 2 - 1
twzd-admin/src/test/java/com/miaxis/test/NormalTest.java

@@ -3,6 +3,7 @@ package com.miaxis.test;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.miaxis.TwzdApplication;
 import com.miaxis.common.core.domain.entity.UserInfo;
+import com.miaxis.common.utils.StringUtils;
 import com.miaxis.feign.service.IWxSendService;
 import com.miaxis.question.mapper.QuestionInfoMapper;
 import com.miaxis.question.vo.QuestionInfoExcelTypeVo;
@@ -63,7 +64,7 @@ public class NormalTest {
         //查询该用户的上级
         UserInfo upUserInfo = userInfoService.getUpUserInfo(fromUserName);
         //当用户销售类型为 普通用户(含驾校分成) 并且他的父级不是代理商(含驾校分成)时,则需要填写驾校信息,且未填写驾校信息时
-        if (userInfo.getSaleType() ==1 && upUserInfo.getSaleType()!=3 && userInfo.getSchoolName() == null ){
+        if (userInfo.getSaleType() ==1 && upUserInfo.getSaleType()!=3 && !StringUtils.isEmpty(userInfo.getSchoolName()) ){
             System.out.println("进来了");
         }
     }

+ 4 - 4
twzd-service/src/main/java/com/miaxis/wx/service/impl/WxGzhServiceImpl.java

@@ -215,7 +215,7 @@ public class WxGzhServiceImpl implements IWxGzhService {
                         //查询该用户的上级
                         UserInfo upUserInfo = userInfoService.getUpUserInfo(fromUserName);
                         //当用户销售类型为 普通用户(含驾校分成) 并且他的父级不是代理商(含驾校分成)时,且未填写驾校信息时则需要填写驾校信息
-                       if (userInfo.getSaleType() ==1 && upUserInfo.getSaleType()!=3 && userInfo.getSchoolName() == null ){
+                       if (userInfo.getSaleType() ==1 && upUserInfo.getSaleType()!=3 && StringUtils.isEmpty(userInfo.getSchoolName()) ){
                            return choseSchoolName(userInfo,fromUserName,toUserName);
                        }
                         String mediaId = wxMessageEvenService.gainTicketEvent(fromUserName, this.getGzhToken(), false, wxForeverCode);
@@ -280,7 +280,7 @@ public class WxGzhServiceImpl implements IWxGzhService {
 
     private String choseSchoolName(UserInfo userInfo,String fromUserName,String toUserName) throws Exception {
         //城市未填写
-        if (userInfo.getCityName() == null){
+        if (StringUtils.isEmpty(userInfo.getCityName())){
             QueryParams queryParams = new QueryParams();
             queryParams.setChoseColumName("city_name");
             List<String> cities = schoolInfoMapper.queryNames(queryParams);
@@ -292,7 +292,7 @@ public class WxGzhServiceImpl implements IWxGzhService {
                 return MessageUtil.initText(fromUserName, toUserName, buffer.toString());
             }
             return MessageUtil.initText(fromUserName, toUserName, buffer.toString());
-        }else if (userInfo.getAreaName() == null) {
+        }else if (StringUtils.isEmpty(userInfo.getAreaName())) {
             QueryParams queryParamsArea = new QueryParams();
             queryParamsArea.setChoseColumName("area_name");
             queryParamsArea.setConditionColumName1("city_name");
@@ -307,7 +307,7 @@ public class WxGzhServiceImpl implements IWxGzhService {
             }
         }
 
-        else if (userInfo.getSchoolName() == null) {
+        else if (StringUtils.isEmpty(userInfo.getSchoolName())) {
             QueryParams queryParamsArea = new QueryParams();
             queryParamsArea.setChoseColumName("school_name");
             queryParamsArea.setConditionColumName1("city_name");