parent
af978f560f
commit
421a7225c0
|
@ -3,6 +3,8 @@ package com.ruoyi.business.controller;
|
|||
import com.ruoyi.business.service.IAiService;
|
||||
import com.ruoyi.business.service.IBusFifteenInfoService;
|
||||
import com.ruoyi.business.service.IBusOrderInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
/**
|
||||
* 采集美团接口
|
||||
*/
|
||||
@Api(tags = "短信测试")
|
||||
@RestController
|
||||
@RequestMapping("/ai")
|
||||
public class AiController {
|
||||
|
@ -23,6 +26,7 @@ public class AiController {
|
|||
@Autowired
|
||||
private IBusFifteenInfoService fifteenInfoService;
|
||||
|
||||
@ApiOperation("测试配合数据库信息")
|
||||
@GetMapping("/sendAi")
|
||||
public void sendAi(){
|
||||
|
||||
|
|
|
@ -21,17 +21,13 @@ public class BusTencentProperties {
|
|||
private String appId;
|
||||
@Value("${tencent.bus.appKey}")
|
||||
private String appKey;
|
||||
//
|
||||
// private static String MchId = "1049039";
|
||||
// private static String AppId = "10011721121033115";
|
||||
// private static String AppKey = "c167746e38d64143a874cec3d5de014e";
|
||||
|
||||
public JSONObject smsCredential(String phone, String content){
|
||||
//使用http需给Credential添加true参数new Credential(MchId, AppId, AppKey, true);
|
||||
Credential credential = new Credential(enterpriseId, appId, appKey, true);
|
||||
SmsSend s = new SmsSend();
|
||||
s.setPhoneNumberSet(new String[] {phone});
|
||||
s.setSignName("【优势管家】");
|
||||
// s.setSignName("【优势管家】");
|
||||
s.setSessionContext(content);
|
||||
try {
|
||||
return s.NormalSend(credential,s);
|
||||
|
@ -41,6 +37,8 @@ public class BusTencentProperties {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
//// //使用http需给Credential添加true参数new Credential(MchId, AppId, AppKey, true);
|
||||
|
|
|
@ -376,7 +376,7 @@ public class AiServiceImpl implements IAiService {
|
|||
}else if("sms".equals(busStoreInfo.getMarketingChannels())){
|
||||
sendSmsTask(content,busOrderInfo);
|
||||
}else{
|
||||
sendAiTask(content,busOrderInfo);
|
||||
System.out.println("未配置营销渠道=====================");
|
||||
}
|
||||
}else {
|
||||
BusAgentInfo busAgentInfo = agentInfoL.get(0);
|
||||
|
@ -408,7 +408,7 @@ public class AiServiceImpl implements IAiService {
|
|||
@Override
|
||||
@Transactional
|
||||
public void sms() {
|
||||
String content = "#分机号#测试";
|
||||
String content = sysDictDataMapper.selectDictLabel("bus_default_sms_script","default_script");
|
||||
BusOrderInfo busOrderInfo = orderInfoService.selectBusOrderInfoById(1L);
|
||||
sendSmsTask(content,busOrderInfo);
|
||||
}
|
||||
|
@ -416,10 +416,10 @@ public class AiServiceImpl implements IAiService {
|
|||
private synchronized void sendSmsTask(String content, BusOrderInfo busOrderInfo) {
|
||||
try {
|
||||
String phoneNo = busOrderInfo.getPrivcyPhone().split(",")[0];//#分机号#
|
||||
content = content.replaceAll("#分机号#",busOrderInfo.getPrivcyPhone().split(",")[1]);
|
||||
content = content.replaceAll("分机号",busOrderInfo.getPrivcyPhone().split(",")[1]);
|
||||
// String ss = "{\"taskId\":\"202203170025799000001\",\"message\":\"success\",\"timestamp\":1647481716818,\"status\":\"00\",\"tag\":\"\"}";
|
||||
// com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSON.parseObject(ss);
|
||||
com.alibaba.fastjson.JSONObject jsonObject = busTencentProperties.smsCredential(phoneNo,content);
|
||||
com.alibaba.fastjson.JSONObject jsonObject = busTencentProperties.smsCredential(phoneNo, content);
|
||||
System.out.println(jsonObject);
|
||||
if("00".equals(jsonObject.getString("status"))){
|
||||
//定时任务15天之前的删除记录 todo
|
||||
|
@ -428,6 +428,7 @@ public class AiServiceImpl implements IAiService {
|
|||
fifteenInfo.setLastVisitTime(LocalDateTime.now().toString());
|
||||
fifteenInfoService.insertBusFifteenInfo(fifteenInfo);
|
||||
}
|
||||
System.out.println("建立sendSmsTask成功: ");
|
||||
} catch (Exception e) {
|
||||
System.out.println("建立sendSmsTask错误: " + busOrderInfo.toString());
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -210,6 +210,12 @@
|
|||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>配置</el-button>
|
||||
<el-button v-if="userAccount !='admin' && scope.row.selfDeliveryStatus == '2' "
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-bicycle"
|
||||
@click="handleSelfDelivery(scope.row)"
|
||||
>退出自配送</el-button>
|
||||
<el-button v-if="userAccount !='admin' && scope.row.returnVisitStatus !== '1'"
|
||||
size="mini"
|
||||
type="text"
|
||||
|
@ -676,11 +682,11 @@ export default {
|
|||
},
|
||||
/** 自配送按钮操作 */
|
||||
handleSelfDelivery(row) {
|
||||
this.$modal.confirm('是否确认将营销源 "' + row.storeCode + '" 转为自配送?确认后该营销源会变为自配送营销。').then(function() {
|
||||
return changeSelfDeliveryStatus(row.id, 2);
|
||||
this.$modal.confirm('是否确认将营销源 "' + row.storeCode + '" 退出自配送?确认后该营销源会变为定时营销。').then(function() {
|
||||
return changeSelfDeliveryStatus(row.id, 1);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.$modal.msgSuccess("更改成功");
|
||||
}).catch(function() {
|
||||
|
||||
});
|
||||
|
|
|
@ -791,7 +791,7 @@ export default {
|
|||
return changeSelfDeliveryStatus(row.id, 2);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.$modal.msgSuccess("更改成功");
|
||||
}).catch(function() {
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue