Merge remote-tracking branch 'origin/main'

This commit is contained in:
Lenovo 2024-07-20 10:58:03 +08:00
commit 71f8993304
3 changed files with 48 additions and 40 deletions

View File

@ -278,7 +278,7 @@ public class AiServiceImpl implements IAiService {
List<BusAgentInfo> agentInfoL = agentInfoService.selectBusAgentInfoList(agentInfo); List<BusAgentInfo> agentInfoL = agentInfoService.selectBusAgentInfoList(agentInfo);
if (agentInfoL.size() > 0) { if (agentInfoL.size() > 0) {
int cha = agentInfoL.get(0).getAiDurationBalance() - agentInfoL.get(0).getAiRealTimeNum(); int cha = agentInfoL.get(0).getAiDurationBalance() - agentInfoL.get(0).getAiRealTimeNum();
if (cha < list.size()) { if (cha < list.size()&&(cha - 1)>0) {
list.subList(0, cha - 1); list.subList(0, cha - 1);
agentInfoL.get(0).setAiRealTimeNum(agentInfoL.get(0).getAiDurationBalance()); agentInfoL.get(0).setAiRealTimeNum(agentInfoL.get(0).getAiDurationBalance());
} else { } else {
@ -347,6 +347,21 @@ public class AiServiceImpl implements IAiService {
if (listInfo.size() == 0) { if (listInfo.size() == 0) {
System.out.println("话术:" + content + "; order" + busOrderInfo.toString()); System.out.println("话术:" + content + "; order" + busOrderInfo.toString());
sendAiTask(content,busOrderInfo); sendAiTask(content,busOrderInfo);
}else {
BusAgentInfo busAgentInfo = agentInfoL.get(0);
int a = 1;
int reduce = busAgentInfo.getAiDurationBalance() - a;
busAgentInfo.setAiDurationBalance(reduce);
busAgentInfo.setAiRealTimeNum(0);
agentInfoService.updateBusAgentInfo(busAgentInfo);
BusIntegralRecord record = new BusIntegralRecord();
record.setAccount(busAgentInfo.getAgentAccount());
record.setIntegralUpdateTime(new Date());
record.setUpdateType("消耗账分");
record.setIntegralUpdateNum(a);
record.setIntegralBalance(reduce);
integralRecordService.insertBusIntegralRecord(record);
} }
BusReturnVisitInfo returnVisitInfo = new BusReturnVisitInfo(); BusReturnVisitInfo returnVisitInfo = new BusReturnVisitInfo();
returnVisitInfo.setPhoneNumber(busOrderInfo.getPrivcyPhone()); returnVisitInfo.setPhoneNumber(busOrderInfo.getPrivcyPhone());

View File

@ -98,7 +98,7 @@
<!-- <el-table-column label="删除状态" align="center" prop="delStatus" /> --> <!-- <el-table-column label="删除状态" align="center" prop="delStatus" /> -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button v-if="scope.row.superiorAgentAccount == 'admin'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"

View File

@ -716,48 +716,41 @@ export default {
const query = {id:row.id} const query = {id:row.id}
generateWord(query).then(response => { generateWord(query).then(response => {
const copyText = response.msg const copyText = response.msg
this.imageUrl = "http://localhost/dev-api/profile/upload/2024/07/18/img0_20240718113153A001.jpg"; this.imageUrl = "https://youshi.bj.cn/prod-api/profile/upload/2024/07/19/img0_20240719111559A001.jpg";
try {
// ClipboardItem
// const blob = this.fetchImageAsBlob(this.imageUrl);
// const item = new ClipboardItem({ [blob.type]: blob });
// // ClipboardItem // this.copyQrCode(this.imageUrl)
// navigator.clipboard.write([item]).then(function() { if (navigator.clipboard && window.isSecureContext) {
// console.log(''); const blob = this.fetchImageAsBlob(this.imageUrl);
// }) const item = new ClipboardItem({ [blob.type]: blob });
// this.copyQrCode() navigator.clipboard.writeText(copyText)
navigator.clipboard.writeText(copyText); this.$modal.msgSuccess("复制成功")
this.$modal.msgSuccess("复制成功");
} catch (err) { } else {
console.error('复制失败', err); // text area
let textArea = document.createElement("textarea");
textArea.value = copyText;
// 使text areaviewport
textArea.style.position = "absolute";
textArea.style.opacity = 0;
textArea.style.left = "-999999px";
textArea.style.top = "-999999px";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
return new Promise((res, rej) => {
//
document.execCommand('copy') ? res() : rej();
textArea.remove();
});
} }
}); });
// this.$modal.confirm('"' + row.storeCode + '"').then(function() {
// return changeSelfDeliveryStatus(row.id, 3);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// }).catch(function() {
// });
}, },
copyQrCode() { async copyQrCode(imageUrl) {
const clipboard = new Clipboard('.copy-btn', { const blob = this.fetchImageAsBlob(imageUrl);
text: () => this.imageUrl const item = new ClipboardItem({ [blob.type]: blob });
}); await navigator.clipboard.write([item]).then(function() {
console.log('图片已复制到剪贴板');
clipboard.on('success', () => { })
console.log('二维码图片链接已复制到剪贴板');
//
clipboard.destroy(); // Clipboard
});
clipboard.on('error', () => {
console.log('复制失败');
//
clipboard.destroy(); // Clipboard
});
}, },
fetchImageAsBlob(imageUrl) { fetchImageAsBlob(imageUrl) {
return fetch(imageUrl) return fetch(imageUrl)