Prechádzať zdrojové kódy

:bug: 修复手机号为空时仍旧用空数据查询用户的问题
:bug: 修复短信模板种手机号为空时仍旧添加逗号分隔符导致失败的问题

Twelve615 1 rok pred
rodič
commit
98e261a80a

+ 8 - 2
crmeb-admin/src/main/java/com/zbkj/admin/controller/merchant/NewMerchantApi.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.pagehelper.Page;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.google.common.base.Strings;
 import com.sun.org.apache.bcel.internal.generic.FMUL;
 import com.zbkj.admin.controller.newapi.request.ProductAttrValueIntegralRequest;
 import com.zbkj.admin.controller.newapi.request.UserEnterpriseSearchRequest;
@@ -520,7 +521,7 @@ public class NewMerchantApi {
         String tempId = byId.getTempId();
         MerchantSmsTiming merchantSmsTiming = merchantSmsTimingService.selectByTempId(tempId);
         Page<User> page = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
-        if (null != merchantSmsTiming) {
+        if (null != merchantSmsTiming && !Strings.isNullOrEmpty(merchantSmsTiming.getPhone())) {
             String phone = merchantSmsTiming.getPhone();
             String[] split = phone.split(",");
             LambdaQueryWrapper<User> queryWrapper2 = new LambdaQueryWrapper<>();
@@ -546,7 +547,12 @@ public class NewMerchantApi {
         if (null != merchantSmsTiming) {
             if ("1".equals(saveType)) {
                 String BeforePhone = merchantSmsTiming.getPhone();
-                String AfterPhone = BeforePhone + "," + phone;
+                String AfterPhone;
+                if (Strings.isNullOrEmpty(BeforePhone.replaceAll(",",""))){
+                    AfterPhone = phone;
+                } else {
+                    AfterPhone = BeforePhone + "," + phone;
+                }
                 merchantSmsTiming.setPhone(AfterPhone);
                 merchantSmsTimingService.updateById(merchantSmsTiming);
             } else {