From dd94242a61fd7c26b0c8f6b60805f4b5fc50309a Mon Sep 17 00:00:00 2001 From: wuyibo <771227828@qq.com> Date: Tue, 9 May 2023 20:10:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=B7=9F=E8=BF=9B=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/CustomerController.java | 107 +++ .../system/controller/FollowUpController.java | 105 +++ .../com/ruoyi/system/domain/Customer.java | 453 ++++++++++ .../com/ruoyi/system/domain/FollowUp.java | 116 +++ .../ruoyi/system/domain/vo/CustomerVo.java | 30 + .../ruoyi/system/mapper/CustomerMapper.java | 88 ++ .../ruoyi/system/mapper/FollowUpMapper.java | 61 ++ .../system/service/ICustomerService.java | 62 ++ .../system/service/IFollowUpService.java | 61 ++ .../service/impl/CustomerServiceImpl.java | 135 +++ .../service/impl/FollowUpServiceImpl.java | 96 ++ .../mapper/system/CustomerMapper.xml | 287 ++++++ .../mapper/system/FollowUpMapper.xml | 96 ++ ruoyi-ui/src/api/system/customer.js | 66 ++ ruoyi-ui/src/views/system/customer/index.vue | 831 ++++++++++++++++++ 15 files changed, 2594 insertions(+) create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/FollowUpController.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/Customer.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/FollowUp.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerVo.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FollowUpMapper.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IFollowUpService.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FollowUpServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml create mode 100644 ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/FollowUpMapper.xml create mode 100644 ruoyi-ui/src/api/system/customer.js create mode 100644 ruoyi-ui/src/views/system/customer/index.vue diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java new file mode 100644 index 00000000..de6435f4 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java @@ -0,0 +1,107 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.system.domain.vo.CustomerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.system.domain.Customer; +import com.ruoyi.system.service.ICustomerService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 客户信息Controller + * + * @author ruoyi + * @date 2023-05-06 + */ +@RestController +@RequestMapping("/customer") +public class CustomerController extends BaseController +{ + @Autowired + private ICustomerService customerService; + + /** + * 查询客户信息列表 + */ + @RequiresPermissions("system:customer:list") + @GetMapping("/list") + public TableDataInfo list(CustomerVo customer) + { + startPage(); + List list = customerService.selectCustomerList(customer); + return getDataTable(list); + } + + /** + * 导出客户信息列表 + */ + @RequiresPermissions("system:customer:export") + @Log(title = "客户信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, CustomerVo customer) + { + List list = customerService.selectCustomerList(customer); + ExcelUtil util = new ExcelUtil(CustomerVo.class); + util.exportExcel(response, list, "客户信息数据"); + } + + /** + * 获取客户信息详细信息 + */ + @RequiresPermissions("system:customer:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(customerService.selectCustomerById(id)); + } + + /** + * 新增客户信息 + */ + @RequiresPermissions("system:customer:add") + @Log(title = "客户信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Customer customer) + { + return toAjax(customerService.insertCustomer(customer)); + } + + /** + * 修改客户信息 + */ + @RequiresPermissions("system:customer:edit") + @Log(title = "客户信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Customer customer) + { + return toAjax(customerService.updateCustomer(customer)); + } + + /** + * 删除客户信息 + */ + @RequiresPermissions("system:customer:remove") + @Log(title = "客户信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(customerService.deleteCustomerByIds(ids)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/FollowUpController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/FollowUpController.java new file mode 100644 index 00000000..54bccfa5 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/FollowUpController.java @@ -0,0 +1,105 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.system.domain.FollowUp; +import com.ruoyi.system.service.IFollowUpService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 跟进模块-客户跟进记录Controller + * + * @author ruoyi + * @date 2023-05-07 + */ +@RestController +@RequestMapping("/up") +public class FollowUpController extends BaseController +{ + @Autowired + private IFollowUpService followUpService; + + /** + * 查询跟进模块-客户跟进记录列表 + */ + @RequiresPermissions("system:up:list") + @GetMapping("/list") + public TableDataInfo list(FollowUp followUp) + { + startPage(); + List list = followUpService.selectFollowUpList(followUp); + return getDataTable(list); + } + + /** + * 导出跟进模块-客户跟进记录列表 + */ + @RequiresPermissions("system:up:export") + @Log(title = "跟进模块-客户跟进记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, FollowUp followUp) + { + List list = followUpService.selectFollowUpList(followUp); + ExcelUtil util = new ExcelUtil(FollowUp.class); + util.exportExcel(response, list, "跟进模块-客户跟进记录数据"); + } + + /** + * 获取跟进模块-客户跟进记录详细信息 + */ + @RequiresPermissions("system:up:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) + { + return AjaxResult.success(followUpService.selectFollowUpById(id)); + } + + /** + * 新增跟进模块-客户跟进记录 + */ + @RequiresPermissions("system:up:add") + @Log(title = "跟进模块-客户跟进记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody FollowUp followUp) + { + return toAjax(followUpService.insertFollowUp(followUp)); + } + + /** + * 修改跟进模块-客户跟进记录 + */ + @RequiresPermissions("system:up:edit") + @Log(title = "跟进模块-客户跟进记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody FollowUp followUp) + { + return toAjax(followUpService.updateFollowUp(followUp)); + } + + /** + * 删除跟进模块-客户跟进记录 + */ + @RequiresPermissions("system:up:remove") + @Log(title = "跟进模块-客户跟进记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Integer[] ids) + { + return toAjax(followUpService.deleteFollowUpByIds(ids)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/Customer.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/Customer.java new file mode 100644 index 00000000..b90599d1 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/Customer.java @@ -0,0 +1,453 @@ +package com.ruoyi.system.domain; + +import java.util.List; +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.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 客户信息对象 f_customer + * + * @author ruoyi + * @date 2023-05-06 + */ +public class Customer extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 客户ID */ + private Long id; + + /** 客户名 */ + @Excel(name = "客户名") + private String userName; + + /** 客户昵称 */ + @Excel(name = "客户昵称") + private String nickName; + + /** 客户级别 */ + @Excel(name = "客户级别") + private String userType; + + /** 用户邮箱 */ + @Excel(name = "用户邮箱") + private String email; + + /** 手机号码 */ + @Excel(name = "手机号码") + private String phoneNumber; + + /** 客户性别 */ + @Excel(name = "客户性别") + private String sex; + + /** 头像地址 */ + @Excel(name = "头像地址") + private String avatar; + + /** 线索渠道 */ + @Excel(name = "线索渠道") + private String clueChannel; + + /** 客户信息来源 */ + @Excel(name = "客户信息来源") + private String dataSource; + + /** 客户居住 区县/区域 */ + @Excel(name = "客户居住 区县/区域") + private String liveAddress; + + /** 客户状态 */ + @Excel(name = "客户状态") + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 最后登录IP */ + private String loginIp; + + /** 最后登录时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date loginDate; + + /** 微信号 */ + @Excel(name = "微信号") + private String wechat; + + /** 购车类型 */ + @Excel(name = "购车类型") + private String buyCarType; + + /** 置换/保有车型 */ + @Excel(name = "置换/保有车型") + private String existModels; + + /** 是否评估 */ + @Excel(name = "是否评估") + private Integer isAssessment; + + /** 意向车型 */ + @Excel(name = "意向车型") + private String intentionCarModels; + + /** 对比车型 */ + @Excel(name = "对比车型") + private String contrastCarModels; + + /** 是否试驾 */ + @Excel(name = "是否试驾") + private Integer isTestDrive; + + /** 是否报价 */ + @Excel(name = "是否报价") + private Integer isOffer; + + /** 是否金融 */ + @Excel(name = "是否金融") + private Integer isFinance; + + /** 未订车原因 */ + @Excel(name = "未订车原因") + private String unBookingCarReason; + + /** 预计到店时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "预计到店时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date preToStoreDate; + + /** 最后一次到店日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "最后一次到店日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date lastToStoreDate; + + /** 4S店 */ + @Excel(name = "4S店") + private String storeName; + + /** 下单日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date orderDate; + + /** 跟进模块-客户跟进记录信息 */ + private List followUpList; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setNickName(String nickName) + { + this.nickName = nickName; + } + + public String getNickName() + { + return nickName; + } + public void setUserType(String userType) + { + this.userType = userType; + } + + public String getUserType() + { + return userType; + } + public void setEmail(String email) + { + this.email = email; + } + + public String getEmail() + { + return email; + } + public void setPhoneNumber(String phoneNumber) + { + this.phoneNumber = phoneNumber; + } + + public String getPhoneNumber() + { + return phoneNumber; + } + public void setSex(String sex) + { + this.sex = sex; + } + + public String getSex() + { + return sex; + } + public void setAvatar(String avatar) + { + this.avatar = avatar; + } + + public String getAvatar() + { + return avatar; + } + public void setClueChannel(String clueChannel) + { + this.clueChannel = clueChannel; + } + + public String getClueChannel() + { + return clueChannel; + } + public void setDataSource(String dataSource) + { + this.dataSource = dataSource; + } + + public String getDataSource() + { + return dataSource; + } + public void setLiveAddress(String liveAddress) + { + this.liveAddress = liveAddress; + } + + public String getLiveAddress() + { + return liveAddress; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + public void setLoginIp(String loginIp) + { + this.loginIp = loginIp; + } + + public String getLoginIp() + { + return loginIp; + } + public void setLoginDate(Date loginDate) + { + this.loginDate = loginDate; + } + + public Date getLoginDate() + { + return loginDate; + } + public void setWechat(String wechat) + { + this.wechat = wechat; + } + + public String getWechat() + { + return wechat; + } + public void setBuyCarType(String buyCarType) + { + this.buyCarType = buyCarType; + } + + public String getBuyCarType() + { + return buyCarType; + } + public void setExistModels(String existModels) + { + this.existModels = existModels; + } + + public String getExistModels() + { + return existModels; + } + public void setIsAssessment(Integer isAssessment) + { + this.isAssessment = isAssessment; + } + + public Integer getIsAssessment() + { + return isAssessment; + } + public void setIntentionCarModels(String intentionCarModels) + { + this.intentionCarModels = intentionCarModels; + } + + public String getIntentionCarModels() + { + return intentionCarModels; + } + public void setContrastCarModels(String contrastCarModels) + { + this.contrastCarModels = contrastCarModels; + } + + public String getContrastCarModels() + { + return contrastCarModels; + } + public void setIsTestDrive(Integer isTestDrive) + { + this.isTestDrive = isTestDrive; + } + + public Integer getIsTestDrive() + { + return isTestDrive; + } + public void setIsOffer(Integer isOffer) + { + this.isOffer = isOffer; + } + + public Integer getIsOffer() + { + return isOffer; + } + public void setIsFinance(Integer isFinance) + { + this.isFinance = isFinance; + } + + public Integer getIsFinance() + { + return isFinance; + } + public void setUnBookingCarReason(String unBookingCarReason) + { + this.unBookingCarReason = unBookingCarReason; + } + + public String getUnBookingCarReason() + { + return unBookingCarReason; + } + public void setPreToStoreDate(Date preToStoreDate) + { + this.preToStoreDate = preToStoreDate; + } + + public Date getPreToStoreDate() + { + return preToStoreDate; + } + public void setLastToStoreDate(Date lastToStoreDate) + { + this.lastToStoreDate = lastToStoreDate; + } + + public Date getLastToStoreDate() + { + return lastToStoreDate; + } + public void setStoreName(String storeName) + { + this.storeName = storeName; + } + + public String getStoreName() + { + return storeName; + } + public void setOrderDate(Date orderDate) + { + this.orderDate = orderDate; + } + + public Date getOrderDate() + { + return orderDate; + } + + public List getFollowUpList() + { + return followUpList; + } + + public void setFollowUpList(List followUpList) + { + this.followUpList = followUpList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("userName", getUserName()) + .append("nickName", getNickName()) + .append("userType", getUserType()) + .append("email", getEmail()) + .append("phoneNumber", getPhoneNumber()) + .append("sex", getSex()) + .append("avatar", getAvatar()) + .append("clueChannel", getClueChannel()) + .append("dataSource", getDataSource()) + .append("liveAddress", getLiveAddress()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("loginIp", getLoginIp()) + .append("loginDate", getLoginDate()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("wechat", getWechat()) + .append("buyCarType", getBuyCarType()) + .append("existModels", getExistModels()) + .append("isAssessment", getIsAssessment()) + .append("intentionCarModels", getIntentionCarModels()) + .append("contrastCarModels", getContrastCarModels()) + .append("isTestDrive", getIsTestDrive()) + .append("isOffer", getIsOffer()) + .append("isFinance", getIsFinance()) + .append("unBookingCarReason", getUnBookingCarReason()) + .append("preToStoreDate", getPreToStoreDate()) + .append("lastToStoreDate", getLastToStoreDate()) + .append("storeName", getStoreName()) + .append("orderDate", getOrderDate()) + .append("followUpList", getFollowUpList()) + .toString(); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/FollowUp.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/FollowUp.java new file mode 100644 index 00000000..29a555d8 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/FollowUp.java @@ -0,0 +1,116 @@ +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.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 跟进模块-客户跟进记录对象 f_follow_up + * + * @author ruoyi + * @date 2023-05-07 + */ +public class FollowUp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Integer id; + + /** 客户id */ + @Excel(name = "客户id") + private Long customerId; + + /** 跟进日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "跟进日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date followUpDate; + + /** 跟进记录 */ + @Excel(name = "跟进记录") + private String followUpRecord; + + /** 再次预约到店日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "再次预约到店日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date preToStoreDate; + + /** 级别 */ + @Excel(name = "级别") + private String followLevel; + + public void setId(Integer id) + { + this.id = id; + } + + public Integer getId() + { + return id; + } + public void setCustomerId(Long customerId) + { + this.customerId = customerId; + } + + public Long getCustomerId() + { + return customerId; + } + public void setFollowUpDate(Date followUpDate) + { + this.followUpDate = followUpDate; + } + + public Date getFollowUpDate() + { + return followUpDate; + } + public void setFollowUpRecord(String followUpRecord) + { + this.followUpRecord = followUpRecord; + } + + public String getFollowUpRecord() + { + return followUpRecord; + } + public void setPreToStoreDate(Date preToStoreDate) + { + this.preToStoreDate = preToStoreDate; + } + + public Date getPreToStoreDate() + { + return preToStoreDate; + } + public void setFollowLevel(String followLevel) + { + this.followLevel = followLevel; + } + + public String getFollowLevel() + { + return followLevel; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("customerId", getCustomerId()) + .append("followUpDate", getFollowUpDate()) + .append("followUpRecord", getFollowUpRecord()) + .append("preToStoreDate", getPreToStoreDate()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("followLevel", getFollowLevel()) + .toString(); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerVo.java new file mode 100644 index 00000000..f0b2f383 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerVo.java @@ -0,0 +1,30 @@ +package com.ruoyi.system.domain.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.system.domain.Customer; +import lombok.Getter; +import lombok.Setter; + +import java.util.Date; + +/** + * @author 吴一博 + * @date 2023年05月09日 15:48 + * @Description + */ +@Setter +@Getter +public class CustomerVo extends Customer { + @Excel(name = "跟进次数") + private String followUpTimes; + @Excel(name = "最新跟进日期") + private String followUpLastDate; + @Excel(name = "最新跟进级别") + private String followUpLastLevel; + @Excel(name = "建议下次跟进日期") + private String proposalNextFollowDate; + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "跟进超期", width = 30, dateFormat = "yyyy-MM-dd") + private String followUpOverdueDate; +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java new file mode 100644 index 00000000..242417f2 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java @@ -0,0 +1,88 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.Customer; +import com.ruoyi.system.domain.FollowUp; +import com.ruoyi.system.domain.vo.CustomerVo; + +/** + * 客户信息Mapper接口 + * + * @author ruoyi + * @date 2023-05-06 + */ +public interface CustomerMapper +{ + /** + * 查询客户信息 + * + * @param id 客户信息主键 + * @return 客户信息 + */ + public Customer selectCustomerById(Long id); + + /** + * 查询客户信息列表 + * + * @param customer 客户信息 + * @return 客户信息集合 + */ + public List selectCustomerList(CustomerVo customer); + + /** + * 新增客户信息 + * + * @param customer 客户信息 + * @return 结果 + */ + public int insertCustomer(Customer customer); + + /** + * 修改客户信息 + * + * @param customer 客户信息 + * @return 结果 + */ + public int updateCustomer(Customer customer); + + /** + * 删除客户信息 + * + * @param id 客户信息主键 + * @return 结果 + */ + public int deleteCustomerById(Long id); + + /** + * 批量删除客户信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCustomerByIds(Long[] ids); + + /** + * 批量删除跟进模块-客户跟进记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteFollowUpByCustomerIds(Long[] ids); + + /** + * 批量新增跟进模块-客户跟进记录 + * + * @param followUpList 跟进模块-客户跟进记录列表 + * @return 结果 + */ + public int batchFollowUp(List followUpList); + + + /** + * 通过客户信息主键删除跟进模块-客户跟进记录信息 + * + * @param id 客户信息ID + * @return 结果 + */ + public int deleteFollowUpByCustomerId(Long id); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FollowUpMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FollowUpMapper.java new file mode 100644 index 00000000..f242bdcf --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FollowUpMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.FollowUp; + +/** + * 跟进模块-客户跟进记录Mapper接口 + * + * @author ruoyi + * @date 2023-05-07 + */ +public interface FollowUpMapper +{ + /** + * 查询跟进模块-客户跟进记录 + * + * @param id 跟进模块-客户跟进记录主键 + * @return 跟进模块-客户跟进记录 + */ + public FollowUp selectFollowUpById(Integer id); + + /** + * 查询跟进模块-客户跟进记录列表 + * + * @param followUp 跟进模块-客户跟进记录 + * @return 跟进模块-客户跟进记录集合 + */ + public List selectFollowUpList(FollowUp followUp); + + /** + * 新增跟进模块-客户跟进记录 + * + * @param followUp 跟进模块-客户跟进记录 + * @return 结果 + */ + public int insertFollowUp(FollowUp followUp); + + /** + * 修改跟进模块-客户跟进记录 + * + * @param followUp 跟进模块-客户跟进记录 + * @return 结果 + */ + public int updateFollowUp(FollowUp followUp); + + /** + * 删除跟进模块-客户跟进记录 + * + * @param id 跟进模块-客户跟进记录主键 + * @return 结果 + */ + public int deleteFollowUpById(Integer id); + + /** + * 批量删除跟进模块-客户跟进记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteFollowUpByIds(Integer[] ids); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java new file mode 100644 index 00000000..cd4eb899 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java @@ -0,0 +1,62 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.Customer; +import com.ruoyi.system.domain.vo.CustomerVo; + +/** + * 客户信息Service接口 + * + * @author ruoyi + * @date 2023-05-06 + */ +public interface ICustomerService +{ + /** + * 查询客户信息 + * + * @param id 客户信息主键 + * @return 客户信息 + */ + public Customer selectCustomerById(Long id); + + /** + * 查询客户信息列表 + * + * @param customer 客户信息 + * @return 客户信息集合 + */ + public List selectCustomerList(CustomerVo customer); + + /** + * 新增客户信息 + * + * @param customer 客户信息 + * @return 结果 + */ + public int insertCustomer(Customer customer); + + /** + * 修改客户信息 + * + * @param customer 客户信息 + * @return 结果 + */ + public int updateCustomer(Customer customer); + + /** + * 批量删除客户信息 + * + * @param ids 需要删除的客户信息主键集合 + * @return 结果 + */ + public int deleteCustomerByIds(Long[] ids); + + /** + * 删除客户信息信息 + * + * @param id 客户信息主键 + * @return 结果 + */ + public int deleteCustomerById(Long id); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IFollowUpService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IFollowUpService.java new file mode 100644 index 00000000..0cf4a5ad --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IFollowUpService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.FollowUp; + +/** + * 跟进模块-客户跟进记录Service接口 + * + * @author ruoyi + * @date 2023-05-07 + */ +public interface IFollowUpService +{ + /** + * 查询跟进模块-客户跟进记录 + * + * @param id 跟进模块-客户跟进记录主键 + * @return 跟进模块-客户跟进记录 + */ + public FollowUp selectFollowUpById(Integer id); + + /** + * 查询跟进模块-客户跟进记录列表 + * + * @param followUp 跟进模块-客户跟进记录 + * @return 跟进模块-客户跟进记录集合 + */ + public List selectFollowUpList(FollowUp followUp); + + /** + * 新增跟进模块-客户跟进记录 + * + * @param followUp 跟进模块-客户跟进记录 + * @return 结果 + */ + public int insertFollowUp(FollowUp followUp); + + /** + * 修改跟进模块-客户跟进记录 + * + * @param followUp 跟进模块-客户跟进记录 + * @return 结果 + */ + public int updateFollowUp(FollowUp followUp); + + /** + * 批量删除跟进模块-客户跟进记录 + * + * @param ids 需要删除的跟进模块-客户跟进记录主键集合 + * @return 结果 + */ + public int deleteFollowUpByIds(Integer[] ids); + + /** + * 删除跟进模块-客户跟进记录信息 + * + * @param id 跟进模块-客户跟进记录主键 + * @return 结果 + */ + public int deleteFollowUpById(Integer id); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java new file mode 100644 index 00000000..c2fa8975 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java @@ -0,0 +1,135 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import com.ruoyi.system.domain.vo.CustomerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import com.ruoyi.common.core.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.system.domain.FollowUp; +import com.ruoyi.system.mapper.CustomerMapper; +import com.ruoyi.system.domain.Customer; +import com.ruoyi.system.service.ICustomerService; + +/** + * 客户信息Service业务层处理 + * + * @author ruoyi + * @date 2023-05-06 + */ +@Service +public class CustomerServiceImpl implements ICustomerService +{ + @Autowired + private CustomerMapper customerMapper; + + /** + * 查询客户信息 + * + * @param id 客户信息主键 + * @return 客户信息 + */ + @Override + public Customer selectCustomerById(Long id) + { + return customerMapper.selectCustomerById(id); + } + + /** + * 查询客户信息列表 + * + * @param customer 客户信息 + * @return 客户信息 + */ + @Override + public List selectCustomerList(CustomerVo customer) + { + return customerMapper.selectCustomerList(customer); + } + + /** + * 新增客户信息 + * + * @param customer 客户信息 + * @return 结果 + */ + @Transactional + @Override + public int insertCustomer(Customer customer) + { + customer.setCreateTime(DateUtils.getNowDate()); + int rows = customerMapper.insertCustomer(customer); + insertFollowUp(customer); + return rows; + } + + /** + * 修改客户信息 + * + * @param customer 客户信息 + * @return 结果 + */ + @Transactional + @Override + public int updateCustomer(Customer customer) + { + customer.setUpdateTime(DateUtils.getNowDate()); + customerMapper.deleteFollowUpByCustomerId(customer.getId()); + insertFollowUp(customer); + return customerMapper.updateCustomer(customer); + } + + /** + * 批量删除客户信息 + * + * @param ids 需要删除的客户信息主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteCustomerByIds(Long[] ids) + { + customerMapper.deleteFollowUpByCustomerIds(ids); + return customerMapper.deleteCustomerByIds(ids); + } + + /** + * 删除客户信息信息 + * + * @param id 客户信息主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteCustomerById(Long id) + { + customerMapper.deleteFollowUpByCustomerId(id); + return customerMapper.deleteCustomerById(id); + } + + /** + * 新增跟进模块-客户跟进记录信息 + * + * @param customer 客户信息对象 + */ + public void insertFollowUp(Customer customer) + { + List followUpList = customer.getFollowUpList(); + Long id = customer.getId(); + if (StringUtils.isNotNull(followUpList)) + { + List list = new ArrayList(); + for (FollowUp followUp : followUpList) + { + followUp.setCustomerId(id); + list.add(followUp); + } + if (list.size() > 0) + { + customerMapper.batchFollowUp(list); + } + } + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FollowUpServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FollowUpServiceImpl.java new file mode 100644 index 00000000..9c5d149c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FollowUpServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.FollowUpMapper; +import com.ruoyi.system.domain.FollowUp; +import com.ruoyi.system.service.IFollowUpService; + +/** + * 跟进模块-客户跟进记录Service业务层处理 + * + * @author ruoyi + * @date 2023-05-07 + */ +@Service +public class FollowUpServiceImpl implements IFollowUpService +{ + @Autowired + private FollowUpMapper followUpMapper; + + /** + * 查询跟进模块-客户跟进记录 + * + * @param id 跟进模块-客户跟进记录主键 + * @return 跟进模块-客户跟进记录 + */ + @Override + public FollowUp selectFollowUpById(Integer id) + { + return followUpMapper.selectFollowUpById(id); + } + + /** + * 查询跟进模块-客户跟进记录列表 + * + * @param followUp 跟进模块-客户跟进记录 + * @return 跟进模块-客户跟进记录 + */ + @Override + public List selectFollowUpList(FollowUp followUp) + { + return followUpMapper.selectFollowUpList(followUp); + } + + /** + * 新增跟进模块-客户跟进记录 + * + * @param followUp 跟进模块-客户跟进记录 + * @return 结果 + */ + @Override + public int insertFollowUp(FollowUp followUp) + { + followUp.setCreateTime(DateUtils.getNowDate()); + return followUpMapper.insertFollowUp(followUp); + } + + /** + * 修改跟进模块-客户跟进记录 + * + * @param followUp 跟进模块-客户跟进记录 + * @return 结果 + */ + @Override + public int updateFollowUp(FollowUp followUp) + { + followUp.setUpdateTime(DateUtils.getNowDate()); + return followUpMapper.updateFollowUp(followUp); + } + + /** + * 批量删除跟进模块-客户跟进记录 + * + * @param ids 需要删除的跟进模块-客户跟进记录主键 + * @return 结果 + */ + @Override + public int deleteFollowUpByIds(Integer[] ids) + { + return followUpMapper.deleteFollowUpByIds(ids); + } + + /** + * 删除跟进模块-客户跟进记录信息 + * + * @param id 跟进模块-客户跟进记录主键 + * @return 结果 + */ + @Override + public int deleteFollowUpById(Integer id) + { + return followUpMapper.deleteFollowUpById(id); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml new file mode 100644 index 00000000..5640a7e3 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, clue_channel, data_source, live_address, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark, wechat, buy_car_type, exist_models, is_assessment, intention_car_models, contrast_car_models, is_test_drive, is_offer, is_finance, un_booking_car_reason, pre_to_store_date, last_to_store_date, store_name, order_date from f_customer + + + + + + + + insert into f_customer + + user_name, + nick_name, + user_type, + email, + phonenumber, + sex, + avatar, + clue_channel, + data_source, + live_address, + status, + del_flag, + login_ip, + login_date, + create_by, + create_time, + update_by, + update_time, + remark, + wechat, + buy_car_type, + exist_models, + is_assessment, + intention_car_models, + contrast_car_models, + is_test_drive, + is_offer, + is_finance, + un_booking_car_reason, + pre_to_store_date, + last_to_store_date, + store_name, + order_date, + + + #{userName}, + #{nickName}, + #{userType}, + #{email}, + #{phoneNumber}, + #{sex}, + #{avatar}, + #{clueChannel}, + #{dataSource}, + #{liveAddress}, + #{status}, + #{delFlag}, + #{loginIp}, + #{loginDate}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{wechat}, + #{buyCarType}, + #{existModels}, + #{isAssessment}, + #{intentionCarModels}, + #{contrastCarModels}, + #{isTestDrive}, + #{isOffer}, + #{isFinance}, + #{unBookingCarReason}, + #{preToStoreDate}, + #{lastToStoreDate}, + #{storeName}, + #{orderDate}, + + + + + update f_customer + + user_name = #{userName}, + nick_name = #{nickName}, + user_type = #{userType}, + email = #{email}, + phonenumber = #{phoneNumber}, + sex = #{sex}, + avatar = #{avatar}, + clue_channel = #{clueChannel}, + data_source = #{dataSource}, + live_address = #{liveAddress}, + status = #{status}, + del_flag = #{delFlag}, + login_ip = #{loginIp}, + login_date = #{loginDate}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + wechat = #{wechat}, + buy_car_type = #{buyCarType}, + exist_models = #{existModels}, + is_assessment = #{isAssessment}, + intention_car_models = #{intentionCarModels}, + contrast_car_models = #{contrastCarModels}, + is_test_drive = #{isTestDrive}, + is_offer = #{isOffer}, + is_finance = #{isFinance}, + un_booking_car_reason = #{unBookingCarReason}, + pre_to_store_date = #{preToStoreDate}, + last_to_store_date = #{lastToStoreDate}, + store_name = #{storeName}, + order_date = #{orderDate}, + + where id = #{id} + + + + delete from f_customer where id = #{id} + + + + delete from f_customer where id in + + #{id} + + + + + delete from f_follow_up where customer_id in + + #{customerId} + + + + + delete from f_follow_up where customer_id = #{customerId} + + + + insert into f_follow_up( id, customer_id, follow_up_date, follow_up_record, pre_to_store_date, create_by, create_time, update_by, update_time, remark, follow_level) values + + ( #{item.id}, #{item.customerId}, #{item.followUpDate}, #{item.followUpRecord}, #{item.preToStoreDate}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark}, #{item.followLevel}) + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/FollowUpMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/FollowUpMapper.xml new file mode 100644 index 00000000..ad2b6570 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/FollowUpMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + select id, customer_id, follow_up_date, follow_up_record, pre_to_store_date, create_by, create_time, update_by, update_time, remark, follow_level from f_follow_up + + + + + + + + insert into f_follow_up + + customer_id, + follow_up_date, + follow_up_record, + pre_to_store_date, + create_by, + create_time, + update_by, + update_time, + remark, + follow_level, + + + #{customerId}, + #{followUpDate}, + #{followUpRecord}, + #{preToStoreDate}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{followLevel}, + + + + + update f_follow_up + + customer_id = #{customerId}, + follow_up_date = #{followUpDate}, + follow_up_record = #{followUpRecord}, + pre_to_store_date = #{preToStoreDate}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + follow_level = #{followLevel}, + + where id = #{id} + + + + delete from f_follow_up where id = #{id} + + + + delete from f_follow_up where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/customer.js b/ruoyi-ui/src/api/system/customer.js new file mode 100644 index 00000000..1a7dfd47 --- /dev/null +++ b/ruoyi-ui/src/api/system/customer.js @@ -0,0 +1,66 @@ +import request from '@/utils/request' + +// 查询客户信息列表 +export function listCustomer(query) { + return request({ + url: '/system/customer/list', + method: 'get', + params: query + }) +} +// 查询客户信息列表 +export function listCustomerFollow(query) { + return request({ + url: '/system/up/list', + method: 'get', + params: query + }) +} +// 查询客户信息详细 +export function getCustomer(id) { + return request({ + url: '/system/customer/' + id, + method: 'get' + }) +} + +// 新增客户信息 +export function addCustomer(data) { + return request({ + url: '/system/customer', + method: 'post', + data: data + }) +} + +// 修改客户信息 +export function updateCustomer(data) { + return request({ + url: '/system/customer', + method: 'put', + data: data + }) +} +// 新增客户跟进信息 +export function addCustomerFollowRecerd(data) { + return request({ + url: '/system/up', + method: 'post', + data: data + }) +} + +export function updateCustomerFollowRecerd(data) { + return request({ + url: '/system/up', + method: 'put', + data: data + }) +} +// 删除客户信息 +export function delCustomer(id) { + return request({ + url: '/system/customer/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/system/customer/index.vue b/ruoyi-ui/src/views/system/customer/index.vue new file mode 100644 index 00000000..7132a3da --- /dev/null +++ b/ruoyi-ui/src/views/system/customer/index.vue @@ -0,0 +1,831 @@ + + + +