From 0362a147303ab214e89eeef36a016cece03166b1 Mon Sep 17 00:00:00 2001 From: Lenovo Date: Fri, 12 Jul 2024 15:01:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=89=E7=BA=BF=E4=B8=8E?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=9B=9E=E8=AE=BF=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BusReturnVisitInfoServiceImpl.java | 29 ++++++++---- .../service/impl/MeituanServiceImpl.java | 46 +++++++++---------- .../business/BusReturnVisitInfoMapper.xml | 1 + 3 files changed, 43 insertions(+), 33 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/BusReturnVisitInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/BusReturnVisitInfoServiceImpl.java index 4c9e114..3e725ee 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/BusReturnVisitInfoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/BusReturnVisitInfoServiceImpl.java @@ -1,6 +1,10 @@ package com.ruoyi.business.service.impl; import java.util.List; + +import com.ruoyi.business.domain.BusStoreInfo; +import com.ruoyi.business.mapper.BusStoreInfoMapper; +import com.ruoyi.common.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.business.mapper.BusReturnVisitInfoMapper; @@ -9,19 +13,21 @@ import com.ruoyi.business.service.IBusReturnVisitInfoService; /** * 回访数据Service业务层处理 - * + * * @author ruoyi * @date 2024-07-05 */ @Service -public class BusReturnVisitInfoServiceImpl implements IBusReturnVisitInfoService +public class BusReturnVisitInfoServiceImpl implements IBusReturnVisitInfoService { @Autowired private BusReturnVisitInfoMapper busReturnVisitInfoMapper; + @Autowired + private BusStoreInfoMapper storeInfoMapper; /** * 查询回访数据 - * + * * @param id 回访数据主键 * @return 回访数据 */ @@ -33,19 +39,26 @@ public class BusReturnVisitInfoServiceImpl implements IBusReturnVisitInfoService /** * 查询回访数据列表 - * + * * @param busReturnVisitInfo 回访数据 * @return 回访数据 */ @Override public List selectBusReturnVisitInfoList(BusReturnVisitInfo busReturnVisitInfo) { + BusStoreInfo info = new BusStoreInfo(); + info.setBindId(SecurityUtils.getLoginUser().getUserId()); + List list = storeInfoMapper.selectBusStoreInfoList(info); + if (list.size() != 0){ + String storeCode = list.get(0).getStoreCode(); + busReturnVisitInfo.setStoreCode(storeCode); + } return busReturnVisitInfoMapper.selectBusReturnVisitInfoList(busReturnVisitInfo); } /** * 新增回访数据 - * + * * @param busReturnVisitInfo 回访数据 * @return 结果 */ @@ -57,7 +70,7 @@ public class BusReturnVisitInfoServiceImpl implements IBusReturnVisitInfoService /** * 修改回访数据 - * + * * @param busReturnVisitInfo 回访数据 * @return 结果 */ @@ -69,7 +82,7 @@ public class BusReturnVisitInfoServiceImpl implements IBusReturnVisitInfoService /** * 批量删除回访数据 - * + * * @param ids 需要删除的回访数据主键 * @return 结果 */ @@ -81,7 +94,7 @@ public class BusReturnVisitInfoServiceImpl implements IBusReturnVisitInfoService /** * 删除回访数据信息 - * + * * @param id 回访数据主键 * @return 结果 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java index 03132a4..8941d69 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java @@ -159,11 +159,7 @@ public class MeituanServiceImpl implements IMeituanService { for (BusStoreInfo store : busStoreInfoList) { Boolean flag = getCommentsOne(store); if (!flag) { - //掉线 - BusStoreInfo busStoreInfo1 = new BusStoreInfo(); - busStoreInfo1.setId(store.getId()); - busStoreInfo1.setGrantStatus("2"); - busStoreInfoMapper.updateBusStoreInfo(busStoreInfo1); + System.out.println("获取好评信息返回错误..."); } } return "ok"; @@ -177,11 +173,7 @@ public class MeituanServiceImpl implements IMeituanService { for (BusStoreInfo store : busStoreInfoList) { Boolean flag = yesterdayCountOne(store); if (!flag) { - //掉线 - BusStoreInfo busStoreInfo1 = new BusStoreInfo(); - busStoreInfo1.setId(store.getId()); - busStoreInfo1.setGrantStatus("2"); - busStoreInfoMapper.updateBusStoreInfo(busStoreInfo1); + System.out.println("获取昨日统计信息返回错误..."); } } return "ok"; @@ -200,11 +192,7 @@ public class MeituanServiceImpl implements IMeituanService { for (BusStoreInfo store : busStoreInfoList) { Boolean flag = getScoreOne(store); if (!flag) { - //掉线 - BusStoreInfo busStoreInfo1 = new BusStoreInfo(); - busStoreInfo1.setId(store.getId()); - busStoreInfo1.setGrantStatus("2"); - busStoreInfoMapper.updateBusStoreInfo(busStoreInfo1); + System.out.println("获取评分信息返回错误..."); } } return "ok"; @@ -225,11 +213,7 @@ public class MeituanServiceImpl implements IMeituanService { for (BusStoreInfo store : busStoreInfoList) { R flag = orderInfo(store.getStoreCode(),now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")),store.getStoreCookie()); if (flag.getCode() != 200) { - //掉线 - BusStoreInfo busStoreInfo1 = new BusStoreInfo(); - busStoreInfo1.setId(store.getId()); - busStoreInfo1.setGrantStatus("2"); - busStoreInfoMapper.updateBusStoreInfo(busStoreInfo1); + System.out.println("获取订单信息返回错误..."); } } return "ok"; @@ -276,6 +260,9 @@ public class MeituanServiceImpl implements IMeituanService { busStoreDayInfoService.insertBusStoreDayInfo(dayInfo); } } + } else if ("1001".equals(code)) { + storeInfo.setGrantStatus("2"); + busStoreInfoService.updateBusStoreInfo(storeInfo); } // System.out.println(jsonObject); return true; @@ -389,12 +376,24 @@ public class MeituanServiceImpl implements IMeituanService { JSONObject jo = merchantOrders(pageNum, date, cookie); if ("0".equals(jo.getString("code"))) { array = jo.getJSONObject("data").getJSONArray("wmOrderList"); - } else { + } else if ("1001".equals(jo.getString("code"))) { + BusStoreInfo storeInfo = new BusStoreInfo(); + storeInfo.setStoreCode(wmPoiId); + BusStoreInfo storeInfo1 = busStoreInfoMapper.selectBusStoreInfoList(storeInfo).get(0); + storeInfo1.setGrantStatus("2"); + busStoreInfoService.updateBusStoreInfo(storeInfo1); + System.out.println(jo.getString("msg")); return R.fail(jo.getString("msg")); } } return R.ok(); + } else if ("1001".equals(code)) { + BusStoreInfo storeInfo = new BusStoreInfo(); + storeInfo.setStoreCode(wmPoiId); + BusStoreInfo storeInfo1 = busStoreInfoMapper.selectBusStoreInfoList(storeInfo).get(0); + storeInfo1.setGrantStatus("2"); + busStoreInfoService.updateBusStoreInfo(storeInfo1); } return R.fail(jsonObject.getString("msg")); } @@ -423,9 +422,6 @@ public class MeituanServiceImpl implements IMeituanService { httpPost.setHeader("Cookie", cookie); CloseableHttpClient client = proxyHttpClient(); -// if(client1 == null){ -// client1 = proxyHttpClient(); -// } // CloseableHttpClient client = HttpClientBuilder.create().build(); HttpEntity responseEntity; String resp = null; @@ -436,7 +432,7 @@ public class MeituanServiceImpl implements IMeituanService { jsonObject = JSONObject.parseObject(resp); } catch (Exception e) { System.out.println(e.getMessage()); - jsonObject.put("code","403"); +// jsonObject.put("code","403"); } return jsonObject; } diff --git a/ruoyi-system/src/main/resources/mapper/business/BusReturnVisitInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/business/BusReturnVisitInfoMapper.xml index c3f1c50..d3f16cc 100644 --- a/ruoyi-system/src/main/resources/mapper/business/BusReturnVisitInfoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/business/BusReturnVisitInfoMapper.xml @@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and phone_end_number = #{phoneEndNumber} and return_visit_time = #{returnVisitTime} and finish_time = #{finishTime} + and phone_number is not null