1;页面序号排序

2;异常订单不处理
3;短信公用方法
This commit is contained in:
wangshuai 2024-07-23 14:32:13 +08:00
parent c6008344fa
commit 18bb013925
12 changed files with 128 additions and 77 deletions

View File

@ -59,7 +59,7 @@ public class BusStoreDayHistoryInfoController extends BaseController
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(BusStoreExcelInfo excelInfo) public TableDataInfo list(BusStoreExcelInfo excelInfo)
{ {
startPage(); // startPage();
List<BusStoreExcelInfo> list = busStoreDayHistoryInfoService.selectBusStoreDayHistoryInfoList(excelInfo); List<BusStoreExcelInfo> list = busStoreDayHistoryInfoService.selectBusStoreDayHistoryInfoList(excelInfo);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -3,8 +3,12 @@ package com.ruoyi.common.config;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.lianlu.common.Credential; import com.lianlu.common.Credential;
import com.lianlu.models.SmsSend; import com.lianlu.models.SmsSend;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.sms.v20210111.SmsClient;
import lombok.Data; import lombok.Data;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@Data @Data
@ -17,23 +21,35 @@ public class BusTencentProperties {
private String appId; private String appId;
@Value("${tencent.bus.appKey}") @Value("${tencent.bus.appKey}")
private String appKey; private String appKey;
//
// private static String MchId = "1049039";
// private static String AppId = "10011721121033115";
// private static String AppKey = "c167746e38d64143a874cec3d5de014e";
private static String MchId = "1049039"; public JSONObject smsCredential(String phone, String content){
private static String AppId = "10011721121033115"; //使用http需给Credential添加true参数new Credential(MchId, AppId, AppKey, true);
private static String AppKey = "c167746e38d64143a874cec3d5de014e"; Credential credential = new Credential(enterpriseId, appId, appKey, true);
SmsSend s = new SmsSend();
s.setPhoneNumberSet(new String[] {phone});
s.setSignName("【优势管家】");
s.setSessionContext(content);
try {
return s.NormalSend(credential,s);
} catch (Exception e) {
System.out.println(e.getMessage());
return null;
}
}
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
// //使用http需给Credential添加true参数new Credential(MchId, AppId, AppKey, true); //// //使用http需给Credential添加true参数new Credential(MchId, AppId, AppKey, true);
Credential credential = new Credential(MchId, AppId, AppKey, true); // BusTencentProperties busTencentProperties = new BusTencentProperties();
// JSONObject ss = busTencentProperties.smsCredential("17612400322","短信内容");
// NormalSend // SmsSend s = new SmsSend();
SmsSend s = new SmsSend(); //// NormalSend
s.setPhoneNumberSet(new String[] {"17612400322"}); // JSONObject re = s.NormalSend()
s.setSignName("【签名内容】"); // System.out.println(re);
s.setSessionContext("短信内容");
JSONObject re = s.NormalSend(credential, s);
System.out.println(re);
// PersonalSend // PersonalSend
// SmsSend s = new SmsSend(); // SmsSend s = new SmsSend();

View File

@ -6,6 +6,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.business.domain.*; import com.ruoyi.business.domain.*;
import com.ruoyi.business.mapper.BusReturnVisitInfoMapper; import com.ruoyi.business.mapper.BusReturnVisitInfoMapper;
import com.ruoyi.business.service.*; import com.ruoyi.business.service.*;
import com.ruoyi.common.config.BusTencentProperties;
import com.ruoyi.common.utils.HttpClientUtilT; import com.ruoyi.common.utils.HttpClientUtilT;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
@ -48,6 +49,8 @@ public class AiServiceImpl implements IAiService {
private IBusStoreConfigInfoService iBusStoreConfigInfoService; private IBusStoreConfigInfoService iBusStoreConfigInfoService;
@Autowired @Autowired
private IBusBanOperateInfoService iBusBanOperateInfoService; private IBusBanOperateInfoService iBusBanOperateInfoService;
@Autowired
private BusTencentProperties busTencentProperties;
private String userSn = "SYSUSER|8398f13f3feccef770ee4d465fe22fbf"; private String userSn = "SYSUSER|8398f13f3feccef770ee4d465fe22fbf";
private String aiUserSn = "SYSUSER|2665bcca63a2b5c724095fa01dce0470"; private String aiUserSn = "SYSUSER|2665bcca63a2b5c724095fa01dce0470";
@ -363,7 +366,7 @@ public class AiServiceImpl implements IAiService {
if("AI".equals(busStoreInfo.getMarketingChannels())){ if("AI".equals(busStoreInfo.getMarketingChannels())){
sendAiTask(content,busOrderInfo); sendAiTask(content,busOrderInfo);
}else if("sms".equals(busStoreInfo.getMarketingChannels())){ }else if("sms".equals(busStoreInfo.getMarketingChannels())){
sendSmsTask(); sendSmsTask(busOrderInfo);
}else{ }else{
sendAiTask(content,busOrderInfo); sendAiTask(content,busOrderInfo);
} }
@ -394,7 +397,8 @@ public class AiServiceImpl implements IAiService {
} }
} }
private void sendSmsTask() { private void sendSmsTask(BusOrderInfo busOrderInfo) {
} }
private void addAiTaskTest(String apiKey, String content, BusOrderInfo busOrderInfo) { private void addAiTaskTest(String apiKey, String content, BusOrderInfo busOrderInfo) {

View File

@ -10,6 +10,7 @@ import com.ruoyi.business.mapper.BusStoreInfoMapper;
import com.ruoyi.business.service.IBusStoreDayHistoryInfoService; import com.ruoyi.business.service.IBusStoreDayHistoryInfoService;
import com.ruoyi.business.service.IBusStoreDayInfoService; import com.ruoyi.business.service.IBusStoreDayInfoService;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -62,6 +63,7 @@ public class BusStoreDayHistoryInfoServiceImpl implements IBusStoreDayHistoryInf
} }
busStoreExcelInfo.setStoreList(sl); busStoreExcelInfo.setStoreList(sl);
} }
PageUtils.startPage();
return busStoreDayHistoryInfoMapper.selectBusStoreDayHistoryInfoList(busStoreExcelInfo); return busStoreDayHistoryInfoMapper.selectBusStoreDayHistoryInfoList(busStoreExcelInfo);
} }

View File

@ -380,70 +380,70 @@ public class MeituanServiceImpl implements IMeituanService {
for (int i = 0; i < array.size(); i++) { for (int i = 0; i < array.size(); i++) {
BusOrderInfo orderInfo = new BusOrderInfo(); BusOrderInfo orderInfo = new BusOrderInfo();
Object o = array.get(i); Object o = array.get(i);
JSONObject oj = JSONObject.parseObject(JSON.toJSONString(o)); try {
String isPhf = oj.getString("businessType"); JSONObject oj = JSONObject.parseObject(JSON.toJSONString(o));
JSONObject order0 = oj.getJSONObject("orderInfo"); String isPhf = oj.getString("businessType");
JSONObject commonInfo = oj.getJSONObject("commonInfo"); JSONObject order0 = oj.getJSONObject("orderInfo");
JSONObject order1 = order0.getJSONObject("orderInfo"); JSONObject commonInfo = oj.getJSONObject("commonInfo");
JSONObject foodInfo = order0.getJSONObject("foodInfo"); JSONObject order1 = order0.getJSONObject("orderInfo");
if(foodInfo != null){ JSONObject foodInfo = order0.getJSONObject("foodInfo");
JSONObject userLabelVo = foodInfo.getJSONObject("userLabelVo"); JSONObject userLabelVo = foodInfo.getJSONObject("userLabelVo");
JSONArray array1 = userLabelVo.getJSONArray("contents"); JSONArray array1 = userLabelVo.getJSONArray("contents");
String info = array1.getJSONObject(0).getString("info"); String info = array1.getJSONObject(0).getString("info");
JSONObject expectTimeVo = order1.getJSONObject("expectTimeVo");
String daySeq = order1.getString("dayseq");
String wmOrderViewId = order1.getString("wmOrderViewId");
String orderTimeFmt = order1.getString("orderTimeFmt");
String expectTime = expectTimeVo.getString("expectTimeFmt");
String statusDesc = order1.getString("statusDesc");
String userId = commonInfo.getString("wmUserId");
String redisDaySeq = Optional.ofNullable(redisTemplate.opsForValue().get(key)).orElse(null);
if (redisDaySeq == null) {
redisTemplate.opsForValue().set(key, daySeq);
} else {
if (Integer.valueOf(daySeq) > Integer.valueOf(redisDaySeq)) {
redisTemplate.opsForValue().set(key, daySeq);
}
if (daySeq.equals(lastDayseq)) {
flag = true;
break;
}
}
String s = String.valueOf(new Random().nextLong());
String nextId = s.substring(1,s.length());
orderInfo.setId(Long.valueOf(nextId));
orderInfo.setStoreCode(wmPoiId);
orderInfo.setDayseq(daySeq);
orderInfo.setOrderNo(wmOrderViewId);
if(expectTime.contains("今日")){
expectTime = expectTime.substring(3,expectTime.length());
}
BusStoreInfo storeInfo = new BusStoreInfo();
storeInfo.setStoreCode(wmPoiId);
BusStoreInfo storeInfo1 = busStoreInfoMapper.selectBusStoreInfoList(storeInfo).get(0);
orderInfo.setStoreName(storeInfo1.getStoreName());
orderInfo.setCompleteTime("2024-"+expectTime);
orderInfo.setOrderStatus(statusDesc);
orderInfo.setCustomId(userId);
if ("门店新客".equals(info)){ if ("门店新客".equals(info)){
orderInfo.setOrderCount("1"); orderInfo.setOrderCount("1");
} else if (info.contains("下单")){ } else if (info.contains("下单")){
orderInfo.setOrderCount(info.substring(info.indexOf("下单")+2,info.length()-1)); orderInfo.setOrderCount(info.substring(info.indexOf("下单")+2,info.length()-1));
}else{
continue;
} }
} SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
JSONObject expectTimeVo = order1.getJSONObject("expectTimeVo"); try {
String daySeq = order1.getString("dayseq"); orderInfo.setOrderTime(format.parse("2024-"+orderTimeFmt));
String wmOrderViewId = order1.getString("wmOrderViewId"); } catch (ParseException e) {
String orderTimeFmt = order1.getString("orderTimeFmt"); throw new RuntimeException(e);
String expectTime = expectTimeVo.getString("expectTimeFmt");
String statusDesc = order1.getString("statusDesc");
String userId = commonInfo.getString("wmUserId");
String redisDaySeq = Optional.ofNullable(redisTemplate.opsForValue().get(key)).orElse(null);
if (redisDaySeq == null) {
redisTemplate.opsForValue().set(key, daySeq);
} else {
if (Integer.valueOf(daySeq) > Integer.valueOf(redisDaySeq)) {
redisTemplate.opsForValue().set(key, daySeq);
}
if (daySeq.equals(lastDayseq)) {
flag = true;
break;
} }
orderInfo.setIsPhf(isPhf);
}catch (Exception e){
System.out.println(e.getMessage());
continue;
} }
String s = String.valueOf(new Random().nextLong());
String nextId = s.substring(1,s.length());
orderInfo.setId(Long.valueOf(nextId));
orderInfo.setStoreCode(wmPoiId);
orderInfo.setDayseq(daySeq);
orderInfo.setOrderNo(wmOrderViewId);
if(expectTime.contains("今日")){
expectTime = expectTime.substring(3,expectTime.length());
}
BusStoreInfo storeInfo = new BusStoreInfo();
storeInfo.setStoreCode(wmPoiId);
BusStoreInfo storeInfo1 = busStoreInfoMapper.selectBusStoreInfoList(storeInfo).get(0);
orderInfo.setStoreName(storeInfo1.getStoreName());
orderInfo.setCompleteTime("2024-"+expectTime);
orderInfo.setOrderStatus(statusDesc);
orderInfo.setCustomId(userId);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
try {
orderInfo.setOrderTime(format.parse("2024-"+orderTimeFmt));
} catch (ParseException e) {
throw new RuntimeException(e);
}
orderInfo.setIsPhf(isPhf);
list.add(orderInfo); list.add(orderInfo);
} }
if (list.size() > 0) { if (list.size() > 0) {

View File

@ -159,7 +159,11 @@
<el-table v-loading="loading" :data="storeList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="storeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" /> <el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" type="index" width="50" /> <el-table-column label="序号" type="index" width="50" >
<template slot-scope="scope">
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="平台" prop="platformType" width="55"> <el-table-column label="平台" prop="platformType" width="55">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_platform_type" :value="scope.row.platformType"/> <dict-tag :options="dict.type.sys_platform_type" :value="scope.row.platformType"/>

View File

@ -179,7 +179,11 @@
<el-table v-loading="loading" :data="storeList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="storeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" /> <el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" type="index" width="50" /> <el-table-column label="序号" type="index" width="50" >
<template slot-scope="scope">
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="平台" prop="platformType" width="55"> <el-table-column label="平台" prop="platformType" width="55">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_platform_type" :value="scope.row.platformType"/> <dict-tag :options="dict.type.sys_platform_type" :value="scope.row.platformType"/>

View File

@ -49,7 +49,11 @@
<el-table v-loading="loading" :data="templateList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="templateList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" prop="id"/> <el-table-column type="selection" width="55" align="center" prop="id"/>
<el-table-column label="序号" type="index" ></el-table-column> <el-table-column label="序号" type="index" width="50" >
<template slot-scope="scope">
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="模版名称" align="center" prop="templateName" /> <el-table-column label="模版名称" align="center" prop="templateName" />
<el-table-column label="模版类型" align="center" prop="templateType" /> <el-table-column label="模版类型" align="center" prop="templateType" />
<!-- <el-table-column label="内容" align="center" prop="templateContent" /> --> <!-- <el-table-column label="内容" align="center" prop="templateContent" /> -->

View File

@ -63,7 +63,12 @@
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="storeId" /> <el-table-column label="序号" type="index" width="50" >
<template slot-scope="scope">
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<!-- <el-table-column label="店铺编号" align="center" prop="storeId" /> -->
<el-table-column label="店铺名称" align="center" prop="storeName" /> <el-table-column label="店铺名称" align="center" prop="storeName" />
<el-table-column label="订单日期" align="center" prop="orderDate" /> <el-table-column label="订单日期" align="center" prop="orderDate" />
<el-table-column label="好评日期" align="center" prop="commentsDate" /> <el-table-column label="好评日期" align="center" prop="commentsDate" />

View File

@ -28,7 +28,11 @@
</el-row> --> </el-row> -->
<el-table v-loading="loading" :data="infoList" > <el-table v-loading="loading" :data="infoList" >
<el-table-column label="序号" align="center" type="index"/> <el-table-column label="序号" type="index" width="50" >
<template slot-scope="scope">
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="店铺名称" align="center" prop="storeName" /> <el-table-column label="店铺名称" align="center" prop="storeName" />
<el-table-column label="店铺标识" align="center" prop="storeCode" /> <el-table-column label="店铺标识" align="center" prop="storeCode" />
<el-table-column label="操作账户" align="center" prop="updateUser" /> <el-table-column label="操作账户" align="center" prop="updateUser" />

View File

@ -160,7 +160,11 @@
<el-table v-loading="loading" :data="storeList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="storeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" ></el-table-column> <el-table-column label="序号" type="index" width="50" >
<template slot-scope="scope">
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="平台" prop="platformType" width="55"> <el-table-column label="平台" prop="platformType" width="55">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_platform_type" :value="scope.row.platformType"/> <dict-tag :options="dict.type.sys_platform_type" :value="scope.row.platformType"/>

View File

@ -62,7 +62,11 @@
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" prop="id"/> <el-table-column type="selection" width="55" align="center" prop="id"/>
<el-table-column label="序号" type="index" width="120" /> <el-table-column label="序号" type="index" width="150" >
<template slot-scope="scope">
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="名称" prop="storeName" :show-overflow-tooltip="true" /> <el-table-column label="名称" prop="storeName" :show-overflow-tooltip="true" />
<el-table-column label="标识" prop="storeCode" /> <el-table-column label="标识" prop="storeCode" />
<el-table-column label="发送号码" prop="phoneNumber" align="center" width=""/> <el-table-column label="发送号码" prop="phoneNumber" align="center" width=""/>