diff --git a/pom.xml b/pom.xml
index 241d9000f..61a5ed6d3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -213,6 +213,7 @@
ruoyi-quartz
ruoyi-generator
ruoyi-common
+ zesome-cms
pom
diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml
index 9d76b8e4e..665f9ce91 100644
--- a/ruoyi-admin/pom.xml
+++ b/ruoyi-admin/pom.xml
@@ -72,7 +72,13 @@
com.ruoyi
ruoyi-generator
-
+
+ com.ruoyi
+ zesome-cms
+ 3.3
+ compile
+
+
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/cms/customer/CustomerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/cms/customer/CustomerController.java
new file mode 100644
index 000000000..e98374546
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/cms/customer/CustomerController.java
@@ -0,0 +1,124 @@
+package com.ruoyi.web.controller.cms.customer;
+
+import com.ruoyi.cms.domain.Customer;
+import com.ruoyi.cms.service.ICustomerService;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+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.*;
+
+import java.util.List;
+
+/**
+ * 客户 信息操作处理
+ *
+ * @author pengc
+ * @date 2019-05-26
+ */
+@Controller
+@RequestMapping("/cms/customer")
+public class CustomerController extends BaseController
+{
+ private String prefix = "cms/customer";
+
+ @Autowired
+ private ICustomerService customerService;
+
+ @RequiresPermissions("cms:customer:view")
+ @GetMapping()
+ public String customer()
+ {
+ return prefix + "/customer";
+ }
+
+ /**
+ * 查询客户列表
+ */
+ @RequiresPermissions("cms:customer:list")
+ @PostMapping("/list")
+ @ResponseBody
+ public TableDataInfo list(Customer customer)
+ {
+ startPage();
+ List list = customerService.selectCustomerList(customer);
+ return getDataTable(list);
+ }
+
+
+ /**
+ * 导出客户列表
+ */
+ @RequiresPermissions("cms:customer:export")
+ @PostMapping("/export")
+ @ResponseBody
+ public AjaxResult export(Customer customer)
+ {
+ List list = customerService.selectCustomerList(customer);
+ ExcelUtil util = new ExcelUtil(Customer.class);
+ return util.exportExcel(list, "customer");
+ }
+
+ /**
+ * 新增客户
+ */
+ @GetMapping("/add")
+ public String add()
+ {
+ return prefix + "/add";
+ }
+
+ /**
+ * 新增保存客户
+ */
+ @RequiresPermissions("cms:customer:add")
+ @Log(title = "客户", businessType = BusinessType.INSERT)
+ @PostMapping("/add")
+ @ResponseBody
+ public AjaxResult addSave(Customer customer)
+ {
+ return toAjax(customerService.insertCustomer(customer));
+ }
+
+ /**
+ * 修改客户
+ */
+ @GetMapping("/edit/{customerid}")
+ public String edit(@PathVariable("customerid") Integer customerid, ModelMap mmap)
+ {
+ Customer customer = customerService.selectCustomerById(customerid);
+ mmap.put("customer", customer);
+ return prefix + "/edit";
+ }
+
+ /**
+ * 修改保存客户
+ */
+ @RequiresPermissions("cms:customer:edit")
+ @Log(title = "客户", businessType = BusinessType.UPDATE)
+ @PostMapping("/edit")
+ @ResponseBody
+ public AjaxResult editSave(Customer customer)
+ {
+ return toAjax(customerService.updateCustomer(customer));
+ }
+
+ /**
+ * 删除客户
+ */
+ @RequiresPermissions("cms:customer:remove")
+ @Log(title = "客户", businessType = BusinessType.DELETE)
+ @PostMapping( "/remove")
+ @ResponseBody
+ public AjaxResult remove(String ids)
+ {
+ return toAjax(customerService.deleteCustomerByIds(ids));
+ }
+
+}
diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
index 18c0b11cc..44414dcfa 100644
--- a/ruoyi-admin/src/main/resources/application-druid.yml
+++ b/ruoyi-admin/src/main/resources/application-druid.yml
@@ -6,9 +6,9 @@ spring:
druid:
# 主库数据源
master:
- url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+ url: jdbc:mysql://localhost:3306/zesome?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
- password: password
+ password: 123
# 从库数据源
slave:
# 从数据源开关/默认关闭
diff --git a/ruoyi-generator/src/main/resources/generator.yml b/ruoyi-generator/src/main/resources/generator.yml
index 9e76f23f4..0009de8be 100644
--- a/ruoyi-generator/src/main/resources/generator.yml
+++ b/ruoyi-generator/src/main/resources/generator.yml
@@ -1,11 +1,10 @@
-
# 代码生成
-gen:
+gen:
# 作者
- author: ruoyi
+ author: pengc
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
- packageName: com.ruoyi.system
+ packageName: com.ruoyi.cms
# 自动去除表前缀,默认是true
autoRemovePre: true
# 表前缀(类名不会包含表前缀)
- tablePrefix: sys_
\ No newline at end of file
+ tablePrefix: cms_
\ No newline at end of file
diff --git a/zesome-cms/pom.xml b/zesome-cms/pom.xml
new file mode 100644
index 000000000..d27dbfb20
--- /dev/null
+++ b/zesome-cms/pom.xml
@@ -0,0 +1,21 @@
+
+
+
+ ruoyi
+ com.ruoyi
+ 3.3
+
+ 4.0.0
+
+ zesome-cms
+
+
+ com.ruoyi
+ ruoyi-common
+
+
+
+
+
\ No newline at end of file
diff --git a/zesome-cms/src/main/java/com/ruoyi/cms/domain/Customer.java b/zesome-cms/src/main/java/com/ruoyi/cms/domain/Customer.java
new file mode 100644
index 000000000..f9946aae5
--- /dev/null
+++ b/zesome-cms/src/main/java/com/ruoyi/cms/domain/Customer.java
@@ -0,0 +1,108 @@
+package com.ruoyi.cms.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 客户表 cms_customer
+ *
+ * @author pengc
+ * @date 2019-05-26
+ */
+public class Customer extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 客户id */
+ private Integer customerid;
+ /** 名称 */
+ private String name;
+ /** 性别 */
+ private Integer sex;
+ /** 联系方式 */
+ private String phone;
+ /** 邮箱 */
+ private String email;
+ /** 咨询类型 */
+ private Integer type;
+ /** 内容 */
+ private String context;
+
+ public void setCustomerid(Integer customerid)
+ {
+ this.customerid = customerid;
+ }
+
+ public Integer getCustomerid()
+ {
+ return customerid;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+ public void setSex(Integer sex)
+ {
+ this.sex = sex;
+ }
+
+ public Integer getSex()
+ {
+ return sex;
+ }
+ public void setPhone(String phone)
+ {
+ this.phone = phone;
+ }
+
+ public String getPhone()
+ {
+ return phone;
+ }
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+ public String getEmail()
+ {
+ return email;
+ }
+ public void setType(Integer type)
+ {
+ this.type = type;
+ }
+
+ public Integer getType()
+ {
+ return type;
+ }
+ public void setContext(String context)
+ {
+ this.context = context;
+ }
+
+ public String getContext()
+ {
+ return context;
+ }
+
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("customerid", getCustomerid())
+ .append("name", getName())
+ .append("sex", getSex())
+ .append("phone", getPhone())
+ .append("email", getEmail())
+ .append("type", getType())
+ .append("context", getContext())
+ .append("createTime", getCreateTime())
+ .toString();
+ }
+}
diff --git a/zesome-cms/src/main/java/com/ruoyi/cms/mapper/CustomerMapper.java b/zesome-cms/src/main/java/com/ruoyi/cms/mapper/CustomerMapper.java
new file mode 100644
index 000000000..62533d257
--- /dev/null
+++ b/zesome-cms/src/main/java/com/ruoyi/cms/mapper/CustomerMapper.java
@@ -0,0 +1,62 @@
+package com.ruoyi.cms.mapper;
+
+import com.ruoyi.cms.domain.Customer;
+import java.util.List;
+
+/**
+ * 客户 数据层
+ *
+ * @author pengc
+ * @date 2019-05-26
+ */
+public interface CustomerMapper
+{
+ /**
+ * 查询客户信息
+ *
+ * @param customerid 客户ID
+ * @return 客户信息
+ */
+ public Customer selectCustomerById(Integer customerid);
+
+ /**
+ * 查询客户列表
+ *
+ * @param customer 客户信息
+ * @return 客户集合
+ */
+ public List selectCustomerList(Customer customer);
+
+ /**
+ * 新增客户
+ *
+ * @param customer 客户信息
+ * @return 结果
+ */
+ public int insertCustomer(Customer customer);
+
+ /**
+ * 修改客户
+ *
+ * @param customer 客户信息
+ * @return 结果
+ */
+ public int updateCustomer(Customer customer);
+
+ /**
+ * 删除客户
+ *
+ * @param customerid 客户ID
+ * @return 结果
+ */
+ public int deleteCustomerById(Integer customerid);
+
+ /**
+ * 批量删除客户
+ *
+ * @param customerids 需要删除的数据ID
+ * @return 结果
+ */
+ public int deleteCustomerByIds(String[] customerids);
+
+}
\ No newline at end of file
diff --git a/zesome-cms/src/main/java/com/ruoyi/cms/service/ICustomerService.java b/zesome-cms/src/main/java/com/ruoyi/cms/service/ICustomerService.java
new file mode 100644
index 000000000..0cd7112ef
--- /dev/null
+++ b/zesome-cms/src/main/java/com/ruoyi/cms/service/ICustomerService.java
@@ -0,0 +1,54 @@
+package com.ruoyi.cms.service;
+
+import com.ruoyi.cms.domain.Customer;
+import java.util.List;
+
+/**
+ * 客户 服务层
+ *
+ * @author pengc
+ * @date 2019-05-26
+ */
+public interface ICustomerService
+{
+ /**
+ * 查询客户信息
+ *
+ * @param customerid 客户ID
+ * @return 客户信息
+ */
+ public Customer selectCustomerById(Integer customerid);
+
+ /**
+ * 查询客户列表
+ *
+ * @param customer 客户信息
+ * @return 客户集合
+ */
+ public List selectCustomerList(Customer customer);
+
+ /**
+ * 新增客户
+ *
+ * @param customer 客户信息
+ * @return 结果
+ */
+ public int insertCustomer(Customer customer);
+
+ /**
+ * 修改客户
+ *
+ * @param customer 客户信息
+ * @return 结果
+ */
+ public int updateCustomer(Customer customer);
+
+ /**
+ * 删除客户信息
+ *
+ * @param ids 需要删除的数据ID
+ * @return 结果
+ */
+ public int deleteCustomerByIds(String ids);
+
+}
diff --git a/zesome-cms/src/main/java/com/ruoyi/cms/service/impl/CustomerServiceImpl.java b/zesome-cms/src/main/java/com/ruoyi/cms/service/impl/CustomerServiceImpl.java
new file mode 100644
index 000000000..c8a78e9a4
--- /dev/null
+++ b/zesome-cms/src/main/java/com/ruoyi/cms/service/impl/CustomerServiceImpl.java
@@ -0,0 +1,83 @@
+package com.ruoyi.cms.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.cms.mapper.CustomerMapper;
+import com.ruoyi.cms.domain.Customer;
+import com.ruoyi.cms.service.ICustomerService;
+import com.ruoyi.common.core.text.Convert;
+
+/**
+ * 客户 服务层实现
+ *
+ * @author pengc
+ * @date 2019-05-26
+ */
+@Service
+public class CustomerServiceImpl implements ICustomerService
+{
+ @Autowired
+ private CustomerMapper customerMapper;
+
+ /**
+ * 查询客户信息
+ *
+ * @param customerid 客户ID
+ * @return 客户信息
+ */
+ @Override
+ public Customer selectCustomerById(Integer customerid)
+ {
+ return customerMapper.selectCustomerById(customerid);
+ }
+
+ /**
+ * 查询客户列表
+ *
+ * @param customer 客户信息
+ * @return 客户集合
+ */
+ @Override
+ public List selectCustomerList(Customer customer)
+ {
+ return customerMapper.selectCustomerList(customer);
+ }
+
+ /**
+ * 新增客户
+ *
+ * @param customer 客户信息
+ * @return 结果
+ */
+ @Override
+ public int insertCustomer(Customer customer)
+ {
+ return customerMapper.insertCustomer(customer);
+ }
+
+ /**
+ * 修改客户
+ *
+ * @param customer 客户信息
+ * @return 结果
+ */
+ @Override
+ public int updateCustomer(Customer customer)
+ {
+ return customerMapper.updateCustomer(customer);
+ }
+
+ /**
+ * 删除客户对象
+ *
+ * @param ids 需要删除的数据ID
+ * @return 结果
+ */
+ @Override
+ public int deleteCustomerByIds(String ids)
+ {
+ return customerMapper.deleteCustomerByIds(Convert.toStrArray(ids));
+ }
+
+}
diff --git a/zesome-cms/src/main/resources/mapper/cms/CustomerMapper.xml b/zesome-cms/src/main/resources/mapper/cms/CustomerMapper.xml
new file mode 100644
index 000000000..64447dbbe
--- /dev/null
+++ b/zesome-cms/src/main/resources/mapper/cms/CustomerMapper.xml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select customerid, name, sex, phone, email, type, context, create_time from cms_customer
+
+
+
+
+
+
+
+ insert into cms_customer
+
+ customerid,
+ name,
+ sex,
+ phone,
+ email,
+ type,
+ context,
+ create_time,
+
+
+ #{customerid},
+ #{name},
+ #{sex},
+ #{phone},
+ #{email},
+ #{type},
+ #{context},
+ #{createTime},
+
+
+
+
+ update cms_customer
+
+ name = #{name},
+ sex = #{sex},
+ phone = #{phone},
+ email = #{email},
+ type = #{type},
+ context = #{context},
+ create_time = #{createTime},
+
+ where customerid = #{customerid}
+
+
+
+ delete from cms_customer where customerid = #{customerid}
+
+
+
+ delete from cms_customer where customerid in
+
+ #{customerid}
+
+
+
+
\ No newline at end of file
diff --git a/zesome-cms/src/main/resources/templates/cms/customer/add.html b/zesome-cms/src/main/resources/templates/cms/customer/add.html
new file mode 100644
index 000000000..f2d788c22
--- /dev/null
+++ b/zesome-cms/src/main/resources/templates/cms/customer/add.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/zesome-cms/src/main/resources/templates/cms/customer/customer.html b/zesome-cms/src/main/resources/templates/cms/customer/customer.html
new file mode 100644
index 000000000..699e79200
--- /dev/null
+++ b/zesome-cms/src/main/resources/templates/cms/customer/customer.html
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/zesome-cms/src/main/resources/templates/cms/customer/edit.html b/zesome-cms/src/main/resources/templates/cms/customer/edit.html
new file mode 100644
index 000000000..623117dff
--- /dev/null
+++ b/zesome-cms/src/main/resources/templates/cms/customer/edit.html
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+