|
@@ -11,14 +11,18 @@ import com.iamberry.rst.faces.order.EfastOrderService;
|
|
|
import com.iamberry.rst.faces.product.ProductService;
|
|
|
import com.iamberry.rst.faces.sms.SmsService;
|
|
|
import com.iamberry.rst.faces.sys.SysService;
|
|
|
+import com.iamberry.rst.util.SmsConfig;
|
|
|
import com.iamberry.rst.utils.AdminUtils;
|
|
|
import com.iamberry.rst.utils.OrderNoUtil;
|
|
|
import com.iamberry.rst.utils.StitchAttrUtil;
|
|
|
+import com.iamberry.wechat.tools.NameUtils;
|
|
|
import com.iamberry.wechat.tools.ResponseJson;
|
|
|
import net.sf.json.JSONArray;
|
|
|
import net.sf.json.JSONObject;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -39,6 +43,8 @@ import static com.iamberry.rst.util.SmsConfig.CONFIRM_TEXT;
|
|
|
@RequestMapping("/admin/customer")
|
|
|
public class AdminCustomerController {
|
|
|
|
|
|
+ private Logger logger = LoggerFactory.getLogger(AdminCustomerController.class);
|
|
|
+
|
|
|
@Autowired
|
|
|
private CompanyInfoService companyInfoService;
|
|
|
@Autowired
|
|
@@ -621,33 +627,66 @@ public class AdminCustomerController {
|
|
|
@ResponseBody
|
|
|
@RequiresPermissions("customer:add:customer")
|
|
|
@RequestMapping("/send_phone_sms")
|
|
|
- public ResponseJson sendPhoneSms(HttpServletRequest request,String type,String phone,ComplaintQuestionInfo complaintQuestionInfo) throws Exception {
|
|
|
- String url = "https://rst.iamberry.com/QA";
|
|
|
+ public ResponseJson sendPhoneSms(HttpServletRequest request,String type,String phone,Integer typeCompany,ComplaintQuestionInfo complaintQuestionInfo) throws Exception {
|
|
|
+ String url = NameUtils.getConfig("website");
|
|
|
Integer flag = 1;
|
|
|
+
|
|
|
+ if(typeCompany == null || typeCompany == 0){
|
|
|
+ return new ResponseJson(500, "未获取到产品类型!", 500);
|
|
|
+ }
|
|
|
+
|
|
|
+ String con = "";
|
|
|
if(type != null && !"".equals(type)){
|
|
|
if( "p".equals(type)){
|
|
|
url += "/problem?questionId="+complaintQuestionInfo.getQuestionId();
|
|
|
+
|
|
|
+ switch (typeCompany){
|
|
|
+ case 1:
|
|
|
+ con = SmsConfig.SEND_PRODUCT_SMS_WATERO;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ con = SmsConfig.SEND_PRODUCT_SMS_SHANGDUO;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ con = SmsConfig.SEND_PRODUCT_SMS_YULIA;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
}else if( "m".equals(type)){
|
|
|
- url += "/adress";
|
|
|
+ complaintQuestionInfo.setQuestionName(null);
|
|
|
+ url += "/address";
|
|
|
+
|
|
|
+ switch (typeCompany){
|
|
|
+ case 1:
|
|
|
+ con = SmsConfig.SEND_PRODUCT_SEND_WATERO;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ con = SmsConfig.SEND_PRODUCT_SEND_SHANGDUO;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ con = SmsConfig.SEND_PRODUCT_SEND_YULIA;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ logger.info("发送短信url地址:" + url);
|
|
|
+
|
|
|
flag = complaintQuestionInfoService.updateQuestionById(complaintQuestionInfo);
|
|
|
if (flag < 1) {
|
|
|
return new ResponseJson(500, "问题修改失败!", 500);
|
|
|
}
|
|
|
-
|
|
|
- String text = MessageFormat.format(CONFIRM_TEXT, complaintQuestionInfo.getQuestionProfile());
|
|
|
+ String text = MessageFormat.format(con, url);
|
|
|
String result = smsService.sendOtherCMS(phone, text);
|
|
|
|
|
|
- ResponseJson json = new ResponseJson();
|
|
|
- ResponseJson rj = json.addResponseKeyValue(result);
|
|
|
-
|
|
|
- if (rj.getResultCode() != 200) {
|
|
|
- return new ResponseJson(500, "发送短信失败!", 500);
|
|
|
- } else {
|
|
|
- return new ResponseJson(200, "发送短信成功!", 200);
|
|
|
+ if("SUCCESS".equals(result)){
|
|
|
+ return new ResponseJson(200, "发送短信成功", 200);
|
|
|
+ }else{
|
|
|
+ return new ResponseJson(200, "发送短信失败", 200);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|