From 8b14c4479b1ee2c42d374014e3dedb5e1bc1a404 Mon Sep 17 00:00:00 2001 From: Yifei Kuang Date: Sun, 19 Jan 2025 11:39:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E7=B4=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/system/ClewController.java | 44 ++- .../web/controller/tool/NoticeController.java | 10 +- .../resources/templates/system/clew/clew.html | 2 - .../templates/system/clew/publicClew.html | 334 ++++++++++++++++++ ruoyi-quartz/pom.xml | 4 + .../quartz/service/PublicClewService.java | 10 + .../service/impl/PublicClewServiceImpl.java | 22 ++ .../com/ruoyi/quartz/task/PublicClewTask.java | 21 ++ .../com/ruoyi/system/mapper/ClewMapper.java | 10 + .../ruoyi/system/service/IClewService.java | 9 + .../system/service/impl/ClewServiceImpl.java | 17 + .../resources/mapper/system/ClewMapper.xml | 86 ++++- 12 files changed, 559 insertions(+), 10 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/clew/publicClew.html create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/PublicClewService.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/PublicClewServiceImpl.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/PublicClewTask.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ClewController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ClewController.java index 5be5fed6..b97840cd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ClewController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ClewController.java @@ -2,10 +2,7 @@ package com.ruoyi.web.controller.system; import java.security.GeneralSecurityException; import java.security.Key; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import cn.hutool.core.util.ObjectUtil; @@ -81,6 +78,13 @@ public class ClewController extends BaseController return prefix + "/clew"; } + @RequiresPermissions("system:clew:view") + @GetMapping("publicClew") + public String publicClew(ModelMap modelMap) + { + return prefix + "/publicClew"; + } + /** * 查询线索列表 */ @@ -122,6 +126,37 @@ public class ClewController extends BaseController return getDataTable(list); } + @RequiresPermissions("system:clew:list") + @PostMapping("/listPublic") + @ResponseBody + public TableDataInfo listPublic(Clew clew) + { + startPage(); + clew.setSaleId(2L); + List list = clewService.selectClewPublicList(clew); + list.forEach(model->{ + if(model.getSaleId() != null){ + SysUser user = sysUserService.selectUserById(model.getSaleId()); + if(user != null){ + model.setSaleName(user.getUserName()); + } + SysUser sourceUser = sysUserService.selectUserById(model.getSourceSaleId()); + if(sourceUser != null){ + model.setSourceSaleName(sourceUser.getUserName()); + } + } + if(model.getSourceApp() != null){ + CompanyApp param = new CompanyApp(); + param.setCompanyId(model.getSourceApp()); + List result = companyAppService.selectCompanyAppList(param); + model.setSourceAppName(result.get(0).getAppName()); + }else { + model.setSourceAppName("黑猫APP"); + } + }); + return getDataTable(list); + } + /** * 导出线索列表 */ @@ -350,6 +385,7 @@ public class ClewController extends BaseController return AjaxResult.error("该线索已被人取走!"); } sourceClew.setSaleId(getSysUser().getUserId()); + sourceClew.setUpdateTime(new Date()); return toAjax(clewService.updateClew(sourceClew)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/NoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/NoticeController.java index 6d51bfb5..084e1835 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/NoticeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/NoticeController.java @@ -74,8 +74,14 @@ public class NoticeController { @GetMapping("/download") @ResponseBody - public AjaxResult download(){ - + public AjaxResult download(@RequestParam("aid")String aid, + @RequestParam("appId")String appId, + @RequestParam("oaid")String oaid, + @RequestParam("idType")String idType, + @RequestParam("uniqueId")String uniqueId, + @RequestParam("actionType")String actionType, + @RequestParam("callBack")String callBack){ + log.info("归因转化回调内容,{},{},{},{},{},{},{}", aid, appId, oaid, idType, uniqueId, actionType, callBack); return AjaxResult.success("下载成功!"); } diff --git a/ruoyi-admin/src/main/resources/templates/system/clew/clew.html b/ruoyi-admin/src/main/resources/templates/system/clew/clew.html index c35b57d0..edce1368 100644 --- a/ruoyi-admin/src/main/resources/templates/system/clew/clew.html +++ b/ruoyi-admin/src/main/resources/templates/system/clew/clew.html @@ -296,8 +296,6 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('取回线索'); - actions.push('放入公海池'); actions.push('分配客服'); actions.push('编辑 '); actions.push('删除'); diff --git a/ruoyi-admin/src/main/resources/templates/system/clew/publicClew.html b/ruoyi-admin/src/main/resources/templates/system/clew/publicClew.html new file mode 100644 index 00000000..ec47b7ec --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/clew/publicClew.html @@ -0,0 +1,334 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + App来源: +
  • +
  • + 加微: +
  • +
  • + 有效: +
  • +
  • + 意向: +
  • +
  • + 成交: +
  • +
  • + 来源应用: +
  • +
  • + + + - + +
  • +
  • + + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-quartz/pom.xml b/ruoyi-quartz/pom.xml index 479c21dc..d3dfe43e 100644 --- a/ruoyi-quartz/pom.xml +++ b/ruoyi-quartz/pom.xml @@ -40,6 +40,10 @@ ruoyi-system + + cn.hutool + hutool-all + \ No newline at end of file diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/PublicClewService.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/PublicClewService.java new file mode 100644 index 00000000..905edb20 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/PublicClewService.java @@ -0,0 +1,10 @@ +package com.ruoyi.quartz.service; + +public interface PublicClewService { + + /** + * 更新 3天未添加微信/ 12天未成交 + */ + void updateOvertimeClew(); + +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/PublicClewServiceImpl.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/PublicClewServiceImpl.java new file mode 100644 index 00000000..30196a8b --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/PublicClewServiceImpl.java @@ -0,0 +1,22 @@ +package com.ruoyi.quartz.service.impl; + +import cn.hutool.core.date.DateUtil; +import com.ruoyi.quartz.service.PublicClewService; +import com.ruoyi.system.service.IClewService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; + +@Service +public class PublicClewServiceImpl implements PublicClewService { + + @Autowired + private IClewService clewService; + + @Override + public void updateOvertimeClew() { + clewService.updateSuitAbleNotAddWx(DateUtil.offsetDay(new Date(), -3)); + clewService.updateSuitAbleNotDeal(DateUtil.offsetDay(new Date(), -12)); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/PublicClewTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/PublicClewTask.java new file mode 100644 index 00000000..b96c673a --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/PublicClewTask.java @@ -0,0 +1,21 @@ +package com.ruoyi.quartz.task; + +import com.ruoyi.quartz.service.PublicClewService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author clunt + *

公海池定时任务

+ */ +@Component("publicClewTask") +public class PublicClewTask { + + @Autowired + private PublicClewService publicClewService; + + public void ryParams() { + publicClewService.updateOvertimeClew(); + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ClewMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ClewMapper.java index 8674d4bf..f4426837 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ClewMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ClewMapper.java @@ -1,7 +1,9 @@ package com.ruoyi.system.mapper; +import java.util.Date; import java.util.List; import com.ruoyi.system.domain.Clew; +import org.apache.ibatis.annotations.Param; /** * 线索Mapper接口 @@ -27,6 +29,8 @@ public interface ClewMapper */ public List selectClewList(Clew clew); + public List selectClewPublicList(Clew clew); + /** * 新增线索 * @@ -60,4 +64,10 @@ public interface ClewMapper * @return 结果 */ public int deleteClewByIds(String[] ids); + + void updateSuitAbleNotAddWx(@Param("beginTime")Date beginTime); + + + void updateSuitAbleNotDeal(@Param("beginTime")Date beginTime); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IClewService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IClewService.java index d9c68d84..e17a4701 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IClewService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IClewService.java @@ -1,5 +1,6 @@ package com.ruoyi.system.service; +import java.util.Date; import java.util.List; import com.ruoyi.system.domain.Clew; @@ -27,6 +28,9 @@ public interface IClewService */ public List selectClewList(Clew clew); + + public List selectClewPublicList(Clew clew); + /** * 新增线索 * @@ -60,4 +64,9 @@ public interface IClewService * @return 结果 */ public int deleteClewById(Long id); + + void updateSuitAbleNotAddWx(Date beginTime); + + void updateSuitAbleNotDeal(Date beginTime); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ClewServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ClewServiceImpl.java index b8f6f0a2..bda925cd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ClewServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ClewServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.system.service.impl; +import java.util.Date; import java.util.List; import cn.hutool.core.util.ObjectUtil; @@ -52,6 +53,12 @@ public class ClewServiceImpl implements IClewService return clewMapper.selectClewList(clew); } + @Override + public List selectClewPublicList(Clew clew) + { + return clewMapper.selectClewPublicList(clew); + } + /** * 新增线索 * @@ -125,4 +132,14 @@ public class ClewServiceImpl implements IClewService { return clewMapper.deleteClewById(id); } + + @Override + public void updateSuitAbleNotAddWx(Date beginTime) { + clewMapper.updateSuitAbleNotAddWx(beginTime); + } + + @Override + public void updateSuitAbleNotDeal(Date beginTime) { + clewMapper.updateSuitAbleNotDeal(beginTime); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/ClewMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ClewMapper.xml index a67c8803..46eb86fc 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ClewMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ClewMapper.xml @@ -55,7 +55,8 @@ and company = #{company} - and (sale_id = #{saleId} or sale_id = 2) + and sale_id = #{saleId} + and sale_id != 2 and info_flow = #{infoFlow} and next_time = #{nextTime} and wx_name like concat('%', #{wxName}, '%') @@ -110,7 +111,7 @@ - order by update_time desc + order by create_time desc order by create_time desc @@ -118,6 +119,68 @@ + + +