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 d0dc7150..5be5fed6 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 @@ -340,6 +340,30 @@ public class ClewController extends BaseController return toAjax(clewService.updateClew(clew)); } + + @PostMapping("/getBackClew") + @ResponseBody + public AjaxResult getBackClew(Clew clew) + { + Clew sourceClew = clewService.selectClewById(clew.getId()); + if(sourceClew.getSaleId() != 2L){ + return AjaxResult.error("该线索已被人取走!"); + } + sourceClew.setSaleId(getSysUser().getUserId()); + return toAjax(clewService.updateClew(sourceClew)); + } + + @PostMapping("/addPublicClew") + @ResponseBody + public AjaxResult addPublicClew(Clew clew) + { + Clew sourceClew = clewService.selectClewById(clew.getId()); + sourceClew.setSaleId(2L); + clew.setUpdateTime(DateUtils.getNowDate()); + return toAjax(clewService.updateClew(sourceClew)); + } + + @GetMapping("/changeUser/{clewId}") public String changeUser(@PathVariable("clewId") String id, ModelMap mmap) { 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 c936a05b..c35b57d0 100644 --- a/ruoyi-admin/src/main/resources/templates/system/clew/clew.html +++ b/ruoyi-admin/src/main/resources/templates/system/clew/clew.html @@ -296,6 +296,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; + actions.push('取回线索'); + actions.push('放入公海池'); actions.push('分配客服'); actions.push('编辑 '); actions.push('删除'); @@ -306,6 +308,21 @@ $.table.init(options); }); + + /* 用户管理-停用 */ + function getBackClew(id) { + $.modal.confirm("确定要取回该线索吗?", function() { + $.operate.post(prefix + "/getBackClew", { "id": id}); + }) + } + + /* 用户管理启用 */ + function addPublicClew(id) { + $.modal.confirm("确定要加入公海池吗?", function() { + $.operate.post(prefix + "/addPublicClew", { "id": id}); + }) + } + /* 选择供应商 */ function changeUser(clewId) { var url = prefix + '/changeUser/' + clewId; diff --git a/ruoyi-system/src/main/resources/mapper/system/ClewMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ClewMapper.xml index c1267e54..a67c8803 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ClewMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ClewMapper.xml @@ -55,7 +55,7 @@ and company = #{company} - and sale_id = #{saleId} + and (sale_id = #{saleId} or sale_id = 2) and info_flow = #{infoFlow} and next_time = #{nextTime} and wx_name like concat('%', #{wxName}, '%')