diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/WkCrmLeadsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/WkCrmLeadsController.java new file mode 100644 index 000000000..4de0b1259 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/WkCrmLeadsController.java @@ -0,0 +1,126 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.WkCrmLeads; +import com.ruoyi.system.service.IWkCrmLeadsService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 线索Controller + * + * @author ruoyi + * @date 2021-04-06 + */ +@Controller +@RequestMapping("/system/leads") +public class WkCrmLeadsController extends BaseController +{ + private String prefix = "system/leads"; + + @Autowired + private IWkCrmLeadsService wkCrmLeadsService; + + @RequiresPermissions("system:leads:view") + @GetMapping() + public String leads() + { + return prefix + "/leads"; + } + + /** + * 查询线索列表 + */ + @RequiresPermissions("system:leads:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(WkCrmLeads wkCrmLeads) + { + startPage(); + List list = wkCrmLeadsService.selectWkCrmLeadsList(wkCrmLeads); + return getDataTable(list); + } + + /** + * 导出线索列表 + */ + @RequiresPermissions("system:leads:export") + @Log(title = "线索", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(WkCrmLeads wkCrmLeads) + { + List list = wkCrmLeadsService.selectWkCrmLeadsList(wkCrmLeads); + ExcelUtil util = new ExcelUtil(WkCrmLeads.class); + return util.exportExcel(list, "leads"); + } + + /** + * 新增线索 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存线索 + */ + @RequiresPermissions("system:leads:add") + @Log(title = "线索", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(WkCrmLeads wkCrmLeads) + { + return toAjax(wkCrmLeadsService.insertWkCrmLeads(wkCrmLeads)); + } + + /** + * 修改线索 + */ + @GetMapping("/edit/{leadsId}") + public String edit(@PathVariable("leadsId") Long leadsId, ModelMap mmap) + { + WkCrmLeads wkCrmLeads = wkCrmLeadsService.selectWkCrmLeadsById(leadsId); + mmap.put("wkCrmLeads", wkCrmLeads); + return prefix + "/edit"; + } + + /** + * 修改保存线索 + */ + @RequiresPermissions("system:leads:edit") + @Log(title = "线索", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(WkCrmLeads wkCrmLeads) + { + return toAjax(wkCrmLeadsService.updateWkCrmLeads(wkCrmLeads)); + } + + /** + * 删除线索 + */ + @RequiresPermissions("system:leads:remove") + @Log(title = "线索", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(wkCrmLeadsService.deleteWkCrmLeadsByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/resources/templates/system/leads/add.html b/ruoyi-admin/src/main/resources/templates/system/leads/add.html new file mode 100644 index 000000000..8a60759c7 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/leads/add.html @@ -0,0 +1,155 @@ + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/leads/edit.html b/ruoyi-admin/src/main/resources/templates/system/leads/edit.html new file mode 100644 index 000000000..80f819aee --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/leads/edit.html @@ -0,0 +1,160 @@ + + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/leads/leads.html b/ruoyi-admin/src/main/resources/templates/system/leads/leads.html new file mode 100644 index 000000000..60ba816f2 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/leads/leads.html @@ -0,0 +1,166 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/WkCrmLeads.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/WkCrmLeads.java new file mode 100644 index 000000000..b93d22ef8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/WkCrmLeads.java @@ -0,0 +1,198 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 线索对象 wk_crm_leads + * + * @author ruoyi + * @date 2021-04-06 + */ +public class WkCrmLeads extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private Long leadsId; + + /** 跟进状态 0未跟进1已跟进 */ + @Excel(name = "跟进状态 0未跟进1已跟进") + private Long followup; + + /** 线索名称 */ + @Excel(name = "线索名称") + private String leadsName; + + /** 下次联系时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "下次联系时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date nextTime; + + /** 电话 */ + @Excel(name = "电话") + private String telephone; + + /** 手机号 */ + @Excel(name = "手机号") + private String mobile; + + /** 邮箱 */ + @Excel(name = "邮箱") + private String email; + + /** 地址 */ + @Excel(name = "地址") + private String address; + + /** 创建人ID */ + @Excel(name = "创建人ID") + private Long createUserId; + + /** 负责人ID */ + @Excel(name = "负责人ID") + private Long ownerUserId; + + /** 最后跟进时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "最后跟进时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date lastTime; + + /** 最后一条跟进记录 */ + @Excel(name = "最后一条跟进记录") + private String lastContent; + + public void setLeadsId(Long leadsId) + { + this.leadsId = leadsId; + } + + public Long getLeadsId() + { + return leadsId; + } + public void setFollowup(Long followup) + { + this.followup = followup; + } + + public Long getFollowup() + { + return followup; + } + public void setLeadsName(String leadsName) + { + this.leadsName = leadsName; + } + + public String getLeadsName() + { + return leadsName; + } + public void setNextTime(Date nextTime) + { + this.nextTime = nextTime; + } + + public Date getNextTime() + { + return nextTime; + } + public void setTelephone(String telephone) + { + this.telephone = telephone; + } + + public String getTelephone() + { + return telephone; + } + public void setMobile(String mobile) + { + this.mobile = mobile; + } + + public String getMobile() + { + return mobile; + } + public void setEmail(String email) + { + this.email = email; + } + + public String getEmail() + { + return email; + } + public void setAddress(String address) + { + this.address = address; + } + + public String getAddress() + { + return address; + } + public void setCreateUserId(Long createUserId) + { + this.createUserId = createUserId; + } + + public Long getCreateUserId() + { + return createUserId; + } + public void setOwnerUserId(Long ownerUserId) + { + this.ownerUserId = ownerUserId; + } + + public Long getOwnerUserId() + { + return ownerUserId; + } + public void setLastTime(Date lastTime) + { + this.lastTime = lastTime; + } + + public Date getLastTime() + { + return lastTime; + } + public void setLastContent(String lastContent) + { + this.lastContent = lastContent; + } + + public String getLastContent() + { + return lastContent; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("leadsId", getLeadsId()) + .append("followup", getFollowup()) + .append("leadsName", getLeadsName()) + .append("nextTime", getNextTime()) + .append("telephone", getTelephone()) + .append("mobile", getMobile()) + .append("email", getEmail()) + .append("address", getAddress()) + .append("remark", getRemark()) + .append("createUserId", getCreateUserId()) + .append("ownerUserId", getOwnerUserId()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .append("lastTime", getLastTime()) + .append("lastContent", getLastContent()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/WkCrmLeadsMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/WkCrmLeadsMapper.java new file mode 100644 index 000000000..daa0d7efa --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/WkCrmLeadsMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.WkCrmLeads; + +/** + * 线索Mapper接口 + * + * @author ruoyi + * @date 2021-04-06 + */ +public interface WkCrmLeadsMapper +{ + /** + * 查询线索 + * + * @param leadsId 线索ID + * @return 线索 + */ + public WkCrmLeads selectWkCrmLeadsById(Long leadsId); + + /** + * 查询线索列表 + * + * @param wkCrmLeads 线索 + * @return 线索集合 + */ + public List selectWkCrmLeadsList(WkCrmLeads wkCrmLeads); + + /** + * 新增线索 + * + * @param wkCrmLeads 线索 + * @return 结果 + */ + public int insertWkCrmLeads(WkCrmLeads wkCrmLeads); + + /** + * 修改线索 + * + * @param wkCrmLeads 线索 + * @return 结果 + */ + public int updateWkCrmLeads(WkCrmLeads wkCrmLeads); + + /** + * 删除线索 + * + * @param leadsId 线索ID + * @return 结果 + */ + public int deleteWkCrmLeadsById(Long leadsId); + + /** + * 批量删除线索 + * + * @param leadsIds 需要删除的数据ID + * @return 结果 + */ + public int deleteWkCrmLeadsByIds(String[] leadsIds); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IWkCrmLeadsService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IWkCrmLeadsService.java new file mode 100644 index 000000000..da814cb94 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IWkCrmLeadsService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.WkCrmLeads; + +/** + * 线索Service接口 + * + * @author ruoyi + * @date 2021-04-06 + */ +public interface IWkCrmLeadsService +{ + /** + * 查询线索 + * + * @param leadsId 线索ID + * @return 线索 + */ + public WkCrmLeads selectWkCrmLeadsById(Long leadsId); + + /** + * 查询线索列表 + * + * @param wkCrmLeads 线索 + * @return 线索集合 + */ + public List selectWkCrmLeadsList(WkCrmLeads wkCrmLeads); + + /** + * 新增线索 + * + * @param wkCrmLeads 线索 + * @return 结果 + */ + public int insertWkCrmLeads(WkCrmLeads wkCrmLeads); + + /** + * 修改线索 + * + * @param wkCrmLeads 线索 + * @return 结果 + */ + public int updateWkCrmLeads(WkCrmLeads wkCrmLeads); + + /** + * 批量删除线索 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteWkCrmLeadsByIds(String ids); + + /** + * 删除线索信息 + * + * @param leadsId 线索ID + * @return 结果 + */ + public int deleteWkCrmLeadsById(Long leadsId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WkCrmLeadsServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WkCrmLeadsServiceImpl.java new file mode 100644 index 000000000..7ecd3306c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WkCrmLeadsServiceImpl.java @@ -0,0 +1,97 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.WkCrmLeadsMapper; +import com.ruoyi.system.domain.WkCrmLeads; +import com.ruoyi.system.service.IWkCrmLeadsService; +import com.ruoyi.common.core.text.Convert; + +/** + * 线索Service业务层处理 + * + * @author ruoyi + * @date 2021-04-06 + */ +@Service +public class WkCrmLeadsServiceImpl implements IWkCrmLeadsService +{ + @Autowired + private WkCrmLeadsMapper wkCrmLeadsMapper; + + /** + * 查询线索 + * + * @param leadsId 线索ID + * @return 线索 + */ + @Override + public WkCrmLeads selectWkCrmLeadsById(Long leadsId) + { + return wkCrmLeadsMapper.selectWkCrmLeadsById(leadsId); + } + + /** + * 查询线索列表 + * + * @param wkCrmLeads 线索 + * @return 线索 + */ + @Override + public List selectWkCrmLeadsList(WkCrmLeads wkCrmLeads) + { + return wkCrmLeadsMapper.selectWkCrmLeadsList(wkCrmLeads); + } + + /** + * 新增线索 + * + * @param wkCrmLeads 线索 + * @return 结果 + */ + @Override + public int insertWkCrmLeads(WkCrmLeads wkCrmLeads) + { + wkCrmLeads.setCreateTime(DateUtils.getNowDate()); + return wkCrmLeadsMapper.insertWkCrmLeads(wkCrmLeads); + } + + /** + * 修改线索 + * + * @param wkCrmLeads 线索 + * @return 结果 + */ + @Override + public int updateWkCrmLeads(WkCrmLeads wkCrmLeads) + { + wkCrmLeads.setUpdateTime(DateUtils.getNowDate()); + return wkCrmLeadsMapper.updateWkCrmLeads(wkCrmLeads); + } + + /** + * 删除线索对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteWkCrmLeadsByIds(String ids) + { + return wkCrmLeadsMapper.deleteWkCrmLeadsByIds(Convert.toStrArray(ids)); + } + + /** + * 删除线索信息 + * + * @param leadsId 线索ID + * @return 结果 + */ + @Override + public int deleteWkCrmLeadsById(Long leadsId) + { + return wkCrmLeadsMapper.deleteWkCrmLeadsById(leadsId); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/WkCrmLeadsMapper.xml b/ruoyi-system/src/main/resources/mapper/system/WkCrmLeadsMapper.xml new file mode 100644 index 000000000..125e974c6 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/WkCrmLeadsMapper.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + select leads_id, followup, leads_name, next_time, telephone, mobile, email, address, remark, create_user_id, owner_user_id, create_time, update_time, last_time, last_content from wk_crm_leads + + + + + + + + insert into wk_crm_leads + + followup, + leads_name, + next_time, + telephone, + mobile, + email, + address, + remark, + create_user_id, + owner_user_id, + create_time, + update_time, + last_time, + last_content, + + + #{followup}, + #{leadsName}, + #{nextTime}, + #{telephone}, + #{mobile}, + #{email}, + #{address}, + #{remark}, + #{createUserId}, + #{ownerUserId}, + #{createTime}, + #{updateTime}, + #{lastTime}, + #{lastContent}, + + + + + update wk_crm_leads + + followup = #{followup}, + leads_name = #{leadsName}, + next_time = #{nextTime}, + telephone = #{telephone}, + mobile = #{mobile}, + email = #{email}, + address = #{address}, + remark = #{remark}, + create_user_id = #{createUserId}, + owner_user_id = #{ownerUserId}, + create_time = #{createTime}, + update_time = #{updateTime}, + last_time = #{lastTime}, + last_content = #{lastContent}, + + where leads_id = #{leadsId} + + + + delete from wk_crm_leads where leads_id = #{leadsId} + + + + delete from wk_crm_leads where leads_id in + + #{leadsId} + + + + \ No newline at end of file