ai 回访 对应账户账分验证(<=0不能进行回访)

This commit is contained in:
wangshuai 2024-07-09 18:02:44 +08:00
parent 3a411dd1f3
commit 88ae473bbc
6 changed files with 33 additions and 17 deletions

View File

@ -106,10 +106,10 @@ public class BusAgentIntegralController extends BaseController
record.setCreateTime(new Date()); record.setCreateTime(new Date());
BusAgentInfo temp = busAgentInfoService.selectBusAgentInfoById(busAgentInfo.getId()); BusAgentInfo temp = busAgentInfoService.selectBusAgentInfoById(busAgentInfo.getId());
int oldValue = Integer.valueOf(temp.getIntegral()); int oldValue = temp.getIntegral();
int newValue = Integer.valueOf(busAgentInfo.getIntegral1()); int newValue = Integer.valueOf(busAgentInfo.getIntegral1());
busAgentInfo.setIntegral(String.valueOf(oldValue+newValue)); busAgentInfo.setIntegral(oldValue+newValue);
record.setIntegralBalance(Integer.valueOf(oldValue+newValue)); record.setIntegralBalance(oldValue+newValue);
recordService.insertBusIntegralRecord(record); recordService.insertBusIntegralRecord(record);
return toAjax(busAgentInfoService.updateBusAgentInfo(busAgentInfo)); return toAjax(busAgentInfoService.updateBusAgentInfo(busAgentInfo));

View File

@ -60,8 +60,8 @@ public class BusIntegralConsumeController extends BaseController
List<BusAgentInfo> list = agentInfoService.selectBusAgentInfoList(agentInfo); List<BusAgentInfo> list = agentInfoService.selectBusAgentInfoList(agentInfo);
if (list.size() > 0){ if (list.size() > 0){
BusAgentInfo info = list.get(0); BusAgentInfo info = list.get(0);
String integral = String.valueOf(Integer.valueOf(info.getIntegral()) - busIntegralRecord.getIntegralUpdateNum()); int integral = info.getIntegral() - busIntegralRecord.getIntegralUpdateNum();
Integer integral1 = Integer.valueOf(Integer.valueOf(info.getIntegral()) - busIntegralRecord.getIntegralUpdateNum()); Integer integral1 = info.getIntegral() - busIntegralRecord.getIntegralUpdateNum();
busIntegralRecord.setIntegralBalance(integral1); busIntegralRecord.setIntegralBalance(integral1);
info.setIntegral(integral); info.setIntegral(integral);
agentInfoService.updateBusAgentInfo(info); agentInfoService.updateBusAgentInfo(info);

View File

@ -1,11 +1,10 @@
package com.ruoyi.quartz.task; package com.ruoyi.quartz.task;
import com.ruoyi.business.domain.BusAgentInfo;
import com.ruoyi.business.domain.BusFifteenInfo; import com.ruoyi.business.domain.BusFifteenInfo;
import com.ruoyi.business.domain.BusOrderInfo; import com.ruoyi.business.domain.BusOrderInfo;
import com.ruoyi.business.service.IAiService; import com.ruoyi.business.domain.BusStoreInfo;
import com.ruoyi.business.service.IBusFifteenInfoService; import com.ruoyi.business.service.*;
import com.ruoyi.business.service.IBusOrderInfoService;
import com.ruoyi.business.service.IMeituanService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -23,6 +22,10 @@ public class RyTask {
@Autowired @Autowired
private IBusOrderInfoService orderInfoService; private IBusOrderInfoService orderInfoService;
@Autowired @Autowired
private IBusStoreInfoService storeInfoService;
@Autowired
private IBusAgentInfoService agentInfoService;
@Autowired
private IAiService aiService; private IAiService aiService;
@Autowired @Autowired
private IMeituanService iMeituanService; private IMeituanService iMeituanService;
@ -62,6 +65,19 @@ public class RyTask {
BusOrderInfo orderInfo = new BusOrderInfo(); BusOrderInfo orderInfo = new BusOrderInfo();
List<BusOrderInfo> list = orderInfoService.selectBusOrderInfoList(orderInfo); List<BusOrderInfo> list = orderInfoService.selectBusOrderInfoList(orderInfo);
for (BusOrderInfo busOrderInfo : list) { for (BusOrderInfo busOrderInfo : list) {
BusStoreInfo storeInfo = new BusStoreInfo();
storeInfo.setStoreCode(busOrderInfo.getStoreCode());
List<BusStoreInfo> tempStore = storeInfoService.selectBusStoreInfoList(storeInfo);
if (tempStore.size() > 0){
BusAgentInfo agentInfo = new BusAgentInfo();
agentInfo.setAgentAccount(tempStore.get(0).getBindUser());
List<BusAgentInfo> agentInfoL = agentInfoService.selectBusAgentInfoList(agentInfo);
if (agentInfoL.size() > 0) {
if(agentInfoL.get(0).getIntegral()<=0){continue;}
}else continue;
}else continue;
BusOrderInfo temp = new BusOrderInfo(); BusOrderInfo temp = new BusOrderInfo();
temp.setPrivcyPhone(busOrderInfo.getPrivcyPhone()); temp.setPrivcyPhone(busOrderInfo.getPrivcyPhone());
BusOrderInfo tempInfo = orderInfoService.selectBusOrderInfoList(temp).get(0); BusOrderInfo tempInfo = orderInfoService.selectBusOrderInfoList(temp).get(0);

View File

@ -77,7 +77,7 @@ public class BusAgentInfo extends BaseEntity
/** 登录次数 */ /** 登录次数 */
@Excel(name = "登录次数") @Excel(name = "登录次数")
private int loginNum; private int loginNum;
private String integral; private int integral;
private String integral1; private String integral1;
public String getIntegral1() { public String getIntegral1() {
@ -90,11 +90,11 @@ public class BusAgentInfo extends BaseEntity
private Date createTime; private Date createTime;
public String getIntegral() { public int getIntegral() {
return integral; return integral;
} }
public void setIntegral(String integral) { public void setIntegral(int integral) {
this.integral = integral; this.integral = integral;
} }

View File

@ -133,7 +133,7 @@ public class AiServiceImpl implements IAiService
System.out.println("追加任务返回: ============taskMainId,taskMainSn===========" + taskMainId + "," + taskMainSn); System.out.println("追加任务返回: ============taskMainId,taskMainSn===========" + taskMainId + "," + taskMainSn);
//定时任务15天删除记录 todo //定时任务15天之前的删除记录 todo
BusFifteenInfo fifteenInfo = new BusFifteenInfo(); BusFifteenInfo fifteenInfo = new BusFifteenInfo();
fifteenInfo.setCustomId(busOrderInfo.getCustomId()); fifteenInfo.setCustomId(busOrderInfo.getCustomId());
fifteenInfo.setLastVisitTime(LocalDateTime.now().toString()); fifteenInfo.setLastVisitTime(LocalDateTime.now().toString());
@ -244,7 +244,7 @@ public class AiServiceImpl implements IAiService
redisTemplate.opsForValue().set("dialTaskMainSn", taskMainSn); redisTemplate.opsForValue().set("dialTaskMainSn", taskMainSn);
//定时任务15天删除记录 todo //定时任务15天之前的删除记录 todo
BusFifteenInfo fifteenInfo = new BusFifteenInfo(); BusFifteenInfo fifteenInfo = new BusFifteenInfo();
fifteenInfo.setCustomId(busOrderInfo.getCustomId()); fifteenInfo.setCustomId(busOrderInfo.getCustomId());
fifteenInfo.setLastVisitTime(LocalDateTime.now().toString()); fifteenInfo.setLastVisitTime(LocalDateTime.now().toString());
@ -282,8 +282,8 @@ public class AiServiceImpl implements IAiService
if (agentInfoL.size() > 0) { if (agentInfoL.size() > 0) {
BusAgentInfo busAgentInfo = agentInfoL.get(0); BusAgentInfo busAgentInfo = agentInfoL.get(0);
int a = (Integer.valueOf(aiInfo.getTalktimes()) / 60) + 1; int a = (Integer.valueOf(aiInfo.getTalktimes()) / 60) + 1;
int reduce = Integer.valueOf(busAgentInfo.getIntegral()) - a; int reduce = busAgentInfo.getIntegral() - a;
busAgentInfo.setIntegral(String.valueOf(reduce)); busAgentInfo.setIntegral(reduce);
agentInfoService.updateBusAgentInfo(busAgentInfo); agentInfoService.updateBusAgentInfo(busAgentInfo);
} }
} }

View File

@ -284,7 +284,7 @@ public class SysUserServiceImpl implements ISysUserService
busAgentInfo.setSuperiorAgentCode(loginUser.getUserId()); busAgentInfo.setSuperiorAgentCode(loginUser.getUserId());
busAgentInfo.setSuperiorAgentAccount(loginUser.getUsername()); busAgentInfo.setSuperiorAgentAccount(loginUser.getUsername());
busAgentInfo.setDelStatus("1"); busAgentInfo.setDelStatus("1");
busAgentInfo.setIntegral("0"); busAgentInfo.setIntegral(0);
busAgentInfo.setCreateTime(new Date()); busAgentInfo.setCreateTime(new Date());
busAgentInfoMapper.insertBusAgentInfo(busAgentInfo); busAgentInfoMapper.insertBusAgentInfo(busAgentInfo);
} }