|
@@ -17,6 +17,7 @@ import com.iamberry.rst.utils.StitchAttrUtil;
|
|
|
import com.iamberry.wechat.tools.NameUtils;
|
|
|
import com.iamberry.wechat.tools.ResponseJson;
|
|
|
import net.sf.json.JSONArray;
|
|
|
+import org.apache.commons.codec.binary.Base64;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.slf4j.Logger;
|
|
@@ -423,7 +424,9 @@ public class AdminCustomerController {
|
|
|
if (!StringUtils.isNotEmpty(visitAdminId)) {
|
|
|
return new ResponseJson(500, "请选择回访人!", 500);
|
|
|
}
|
|
|
- visit.setAdminId(Integer.parseInt(visitAdminId));
|
|
|
+ Integer loginAdminId = AdminUtils.getLoginAdminId();
|
|
|
+ visit.setAdminId(loginAdminId);
|
|
|
+ visit.setDesignatedAdminId(Integer.parseInt(visitAdminId));
|
|
|
visit.setVisitStatus(1);
|
|
|
visit.setVisitCreateTime(new Date());
|
|
|
int num = visitService.addVisitInfo(visit, visit.getCustomerId());
|
|
@@ -759,6 +762,8 @@ public class AdminCustomerController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ String userPhone = encodePhoneNumber(phone);
|
|
|
+
|
|
|
String text = MessageFormat.format(con, url);
|
|
|
logger.info("给 " + phone + " 手机用户发送短信:" + text);
|
|
|
String result = smsService.sendOtherCMS(phone, text);
|
|
@@ -770,6 +775,25 @@ public class AdminCustomerController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ String encodePhoneNumber(String number)
|
|
|
+ {
|
|
|
+ int encnum = Integer.parseInt(number.substring(2));
|
|
|
+
|
|
|
+ int prefix = (number.charAt(1) - '2') /2; // '3'=>0, '5'=>1, '[67]'=>2, '8'=>3
|
|
|
+
|
|
|
+ encnum |= (prefix <<= 30);
|
|
|
+
|
|
|
+ final byte[] raw = new byte[4];
|
|
|
+
|
|
|
+ raw[0] = (byte)(encnum >>> 24);
|
|
|
+ raw[1] = (byte)(encnum >>> 16);
|
|
|
+ raw[2] = (byte)(encnum >>> 8);
|
|
|
+ raw[3] = (byte) encnum;
|
|
|
+
|
|
|
+ return Base64.encodeBase64URLSafeString(raw);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 进入回访完成页面
|
|
|
*
|