From 399e1cdc27d0a8cf029e47fff5c96cf30564ce88 Mon Sep 17 00:00:00 2001 From: "kuang.yife" Date: Tue, 29 Aug 2023 17:48:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E5=A4=A7=E5=A0=86=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/system/ClewController.java | 53 +++++++ .../web/controller/tool/NoticeController.java | 3 +- .../src/main/resources/application.yml | 2 +- .../src/main/resources/templates/login.html | 4 +- .../templates/system/clew/changeUser.html | 30 ++++ .../resources/templates/system/clew/clew.html | 146 +++++++----------- .../resources/templates/system/clew/edit.html | 67 +++----- .../templates/system/phone/phone.html | 8 + .../java/com/ruoyi/system/domain/Clew.java | 2 + .../com/ruoyi/system/domain/ClewPhone.java | 32 +--- .../resources/mapper/system/ClewMapper.xml | 1 + .../mapper/system/ClewPhoneMapper.xml | 4 +- 12 files changed, 183 insertions(+), 169 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/clew/changeUser.html 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 5e5a1171..448fa52a 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 @@ -1,6 +1,12 @@ package com.ruoyi.web.controller.system; import java.util.List; + +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.system.domain.ClewPhone; +import com.ruoyi.system.service.IClewPhoneService; +import com.ruoyi.system.service.ISysUserService; +import org.apache.commons.collections.CollectionUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -30,6 +36,12 @@ public class ClewController extends BaseController @Autowired private IClewService clewService; + @Autowired + private ISysUserService sysUserService; + + @Autowired + private IClewPhoneService clewPhoneService; + @RequiresPermissions("system:clew:view") @GetMapping() public String clew() @@ -46,7 +58,18 @@ public class ClewController extends BaseController public TableDataInfo list(Clew clew) { startPage(); + if(!"admin".equals(getSysUser().getLoginName())){ + clew.setSaleId(getSysUser().getUserId()); + } List list = clewService.selectClewList(clew); + list.forEach(model->{ + if(model.getSaleId() != null){ + SysUser user = sysUserService.selectUserById(model.getSaleId()); + if(user != null){ + model.setSaleName(user.getUserName()); + } + } + }); return getDataTable(list); } @@ -90,6 +113,20 @@ public class ClewController extends BaseController @ResponseBody public AjaxResult appAddSave(@RequestBody Clew clew) { + Clew param = new Clew(); + param.setPhone(clew.getPhone()); + List result = clewService.selectClewList(param); + if (CollectionUtils.isNotEmpty(result)){ + return AjaxResult.success(); + } + // 将初始线索设置成已跟踪 + ClewPhone model = new ClewPhone(); + model.setPhone(clew.getPhone()); + List clewPhoneList = clewPhoneService.selectClewPhoneList(model); + clewPhoneList.forEach(x->{ + x.setStatus("1"); + clewPhoneService.updateClewPhone(x); + }); return toAjax(clewService.insertClew(clew)); } @@ -128,4 +165,20 @@ public class ClewController extends BaseController { return toAjax(clewService.deleteClewByIds(ids)); } + + @PostMapping("/changeUser") + @ResponseBody + public AjaxResult changeUser(Clew clew) + { + return toAjax(clewService.updateClew(clew)); + } + + @GetMapping("/changeUser/{clewId}") + public String changeUser(@PathVariable("clewId") String id, ModelMap mmap) + { + mmap.put("clewId", id); + mmap.put("users", sysUserService.selectUserList(new SysUser())); + return "system/clew/changeUser"; + } + } 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 b814e983..28764a39 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 @@ -136,7 +136,8 @@ public class NoticeController { clewPhoneService.insertClewPhone(model); } }catch (Exception e){ - log.error("手机号入库失败!"); + e.printStackTrace(); + log.error("手机号入库失败!,原因:{}", e.getMessage()); } }catch (Exception e){ diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 77e9adae..cda3c288 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -114,7 +114,7 @@ shiro: cipherKey: session: # Session超时时间,-1代表永不过期(默认30分钟) - expireTime: 30 + expireTime: 360 # 同步session到数据库的周期(默认1分钟) dbSyncPeriod: 1 # 相隔多久检查一次session的有效性,默认就是10分钟 diff --git a/ruoyi-admin/src/main/resources/templates/login.html b/ruoyi-admin/src/main/resources/templates/login.html index 162d6463..4bb791c7 100644 --- a/ruoyi-admin/src/main/resources/templates/login.html +++ b/ruoyi-admin/src/main/resources/templates/login.html @@ -44,8 +44,8 @@

登录:

你若不离不弃,我必生死相依

- - + +
diff --git a/ruoyi-admin/src/main/resources/templates/system/clew/changeUser.html b/ruoyi-admin/src/main/resources/templates/system/clew/changeUser.html new file mode 100644 index 00000000..4f657c89 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/clew/changeUser.html @@ -0,0 +1,30 @@ + + + + + + +
+ + +
+ +
+ +
+
+ +
+ + + + + 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 9c136138..56b7283d 100644 --- a/ruoyi-admin/src/main/resources/templates/system/clew/clew.html +++ b/ruoyi-admin/src/main/resources/templates/system/clew/clew.html @@ -10,74 +10,14 @@
    -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • @@ -86,18 +26,6 @@
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  •  搜索  重置 @@ -130,6 +58,13 @@ \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/clew/edit.html b/ruoyi-admin/src/main/resources/templates/system/clew/edit.html index 04c32866..dc41c021 100644 --- a/ruoyi-admin/src/main/resources/templates/system/clew/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/clew/edit.html @@ -8,24 +8,6 @@
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    @@ -53,12 +35,6 @@
    -
    - -
    - -
    -
    @@ -70,47 +46,46 @@
    -
    -
    - -
    - -
    -
    -
    +
    - +
    - +
    + + +
    - +
    - +
    + + +
    - +
    - +
    + + +
    - +
    - -
    -
    -
    - -
    - +
    + + +
    diff --git a/ruoyi-admin/src/main/resources/templates/system/phone/phone.html b/ruoyi-admin/src/main/resources/templates/system/phone/phone.html index 76a73aeb..3fc10db9 100644 --- a/ruoyi-admin/src/main/resources/templates/system/phone/phone.html +++ b/ruoyi-admin/src/main/resources/templates/system/phone/phone.html @@ -46,6 +46,8 @@