From e65889f4bf0df68b705cc6ab43f75c9f37d5db62 Mon Sep 17 00:00:00 2001 From: "kuang.yifei@iwhalecloud.com" Date: Thu, 11 Aug 2022 17:14:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E8=B4=B9=E8=80=85=E5=88=86=E9=94=80?= =?UTF-8?q?=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customer/CustomerPlaceController.java | 136 ++++++++++++++++++ .../templates/customer/place/add.html | 55 +++++++ .../templates/customer/place/edit.html | 56 ++++++++ .../templates/customer/place/place.html | 114 +++++++++++++++ .../ghy/customer/domain/CustomerPlace.java | 98 +++++++++++++ .../customer/mapper/CustomerPlaceMapper.java | 61 ++++++++ .../service/ICustomerPlaceService.java | 61 ++++++++ .../impl/CustomerPlaceServiceImpl.java | 96 +++++++++++++ .../mapper/customer/CustomerPlaceMapper.xml | 92 ++++++++++++ 9 files changed, 769 insertions(+) create mode 100644 ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java create mode 100644 ghy-admin/src/main/resources/templates/customer/place/add.html create mode 100644 ghy-admin/src/main/resources/templates/customer/place/edit.html create mode 100644 ghy-admin/src/main/resources/templates/customer/place/place.html create mode 100644 ghy-custom/src/main/java/com/ghy/customer/domain/CustomerPlace.java create mode 100644 ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerPlaceMapper.java create mode 100644 ghy-custom/src/main/java/com/ghy/customer/service/ICustomerPlaceService.java create mode 100644 ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerPlaceServiceImpl.java create mode 100644 ghy-custom/src/main/resources/mapper/customer/CustomerPlaceMapper.xml diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java new file mode 100644 index 00000000..08971e7a --- /dev/null +++ b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java @@ -0,0 +1,136 @@ +package com.ghy.web.controller.customer; + +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.*; +import com.ghy.common.annotation.Log; +import com.ghy.common.enums.BusinessType; +import com.ghy.customer.domain.CustomerPlace; +import com.ghy.customer.service.ICustomerPlaceService; +import com.ghy.common.core.controller.BaseController; +import com.ghy.common.core.domain.AjaxResult; +import com.ghy.common.utils.poi.ExcelUtil; +import com.ghy.common.core.page.TableDataInfo; + +/** + * 分销申请Controller + * + * @author clunt + * @date 2022-08-11 + */ +@Controller +@RequestMapping("/customer/place") +public class CustomerPlaceController extends BaseController +{ + private String prefix = "customer/place"; + + @Autowired + private ICustomerPlaceService customerPlaceService; + + @RequiresPermissions("customer:place:view") + @GetMapping() + public String place() + { + return prefix + "/place"; + } + + /** + * 查询分销申请列表 + */ + @RequiresPermissions("customer:place:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(CustomerPlace customerPlace) + { + startPage(); + List list = customerPlaceService.selectCustomerPlaceList(customerPlace); + return getDataTable(list); + } + + /** + * App查询分销申请列表 + */ + @PostMapping("/app/list") + @ResponseBody + public TableDataInfo appList(@RequestBody CustomerPlace customerPlace) + { + startPage(); + List list = customerPlaceService.selectCustomerPlaceList(customerPlace); + return getDataTable(list); + } + + + /** + * 导出分销申请列表 + */ + @RequiresPermissions("customer:place:export") + @Log(title = "分销申请", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(CustomerPlace customerPlace) + { + List list = customerPlaceService.selectCustomerPlaceList(customerPlace); + ExcelUtil util = new ExcelUtil(CustomerPlace.class); + return util.exportExcel(list, "分销申请数据"); + } + + /** + * 新增分销申请 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存分销申请 + */ + @RequiresPermissions("customer:place:add") + @Log(title = "分销申请", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(CustomerPlace customerPlace) + { + return toAjax(customerPlaceService.insertCustomerPlace(customerPlace)); + } + + /** + * 修改分销申请 + */ + @RequiresPermissions("customer:place:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") String id, ModelMap mmap) + { + CustomerPlace customerPlace = customerPlaceService.selectCustomerPlaceById(id); + mmap.put("customerPlace", customerPlace); + return prefix + "/edit"; + } + + /** + * 修改保存分销申请 + */ + @RequiresPermissions("customer:place:edit") + @Log(title = "分销申请", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(CustomerPlace customerPlace) + { + return toAjax(customerPlaceService.updateCustomerPlace(customerPlace)); + } + + /** + * 删除分销申请 + */ + @RequiresPermissions("customer:place:remove") + @Log(title = "分销申请", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(customerPlaceService.deleteCustomerPlaceByIds(ids)); + } +} diff --git a/ghy-admin/src/main/resources/templates/customer/place/add.html b/ghy-admin/src/main/resources/templates/customer/place/add.html new file mode 100644 index 00000000..9c0c22af --- /dev/null +++ b/ghy-admin/src/main/resources/templates/customer/place/add.html @@ -0,0 +1,55 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ghy-admin/src/main/resources/templates/customer/place/edit.html b/ghy-admin/src/main/resources/templates/customer/place/edit.html new file mode 100644 index 00000000..e5a2f2c6 --- /dev/null +++ b/ghy-admin/src/main/resources/templates/customer/place/edit.html @@ -0,0 +1,56 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ghy-admin/src/main/resources/templates/customer/place/place.html b/ghy-admin/src/main/resources/templates/customer/place/place.html new file mode 100644 index 00000000..b136b562 --- /dev/null +++ b/ghy-admin/src/main/resources/templates/customer/place/place.html @@ -0,0 +1,114 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ghy-custom/src/main/java/com/ghy/customer/domain/CustomerPlace.java b/ghy-custom/src/main/java/com/ghy/customer/domain/CustomerPlace.java new file mode 100644 index 00000000..ff142aa5 --- /dev/null +++ b/ghy-custom/src/main/java/com/ghy/customer/domain/CustomerPlace.java @@ -0,0 +1,98 @@ +package com.ghy.customer.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ghy.common.annotation.Excel; +import com.ghy.common.core.domain.BaseEntity; + +/** + * 分销申请对象 customer_place + * + * @author clunt + * @date 2022-08-11 + */ +public class CustomerPlace extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键id */ + private String id; + + /** 名字 */ + @Excel(name = "名字") + private String name; + + /** 关联消费者id */ + @Excel(name = "关联消费者id") + private Long customerId; + + /** 注册手机号 */ + @Excel(name = "注册手机号") + private String phone; + + /** 城市id */ + @Excel(name = "城市id") + private Long city; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setCustomerId(Long customerId) + { + this.customerId = customerId; + } + + public Long getCustomerId() + { + return customerId; + } + public void setPhone(String phone) + { + this.phone = phone; + } + + public String getPhone() + { + return phone; + } + public void setCity(Long city) + { + this.city = city; + } + + public Long getCity() + { + return city; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("customerId", getCustomerId()) + .append("phone", getPhone()) + .append("city", getCity()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} \ No newline at end of file diff --git a/ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerPlaceMapper.java b/ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerPlaceMapper.java new file mode 100644 index 00000000..397abb5d --- /dev/null +++ b/ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerPlaceMapper.java @@ -0,0 +1,61 @@ +package com.ghy.customer.mapper; + +import java.util.List; +import com.ghy.customer.domain.CustomerPlace; + +/** + * 分销申请Mapper接口 + * + * @author clunt + * @date 2022-08-11 + */ +public interface CustomerPlaceMapper +{ + /** + * 查询分销申请 + * + * @param id 分销申请主键 + * @return 分销申请 + */ + public CustomerPlace selectCustomerPlaceById(String id); + + /** + * 查询分销申请列表 + * + * @param customerPlace 分销申请 + * @return 分销申请集合 + */ + public List selectCustomerPlaceList(CustomerPlace customerPlace); + + /** + * 新增分销申请 + * + * @param customerPlace 分销申请 + * @return 结果 + */ + public int insertCustomerPlace(CustomerPlace customerPlace); + + /** + * 修改分销申请 + * + * @param customerPlace 分销申请 + * @return 结果 + */ + public int updateCustomerPlace(CustomerPlace customerPlace); + + /** + * 删除分销申请 + * + * @param id 分销申请主键 + * @return 结果 + */ + public int deleteCustomerPlaceById(String id); + + /** + * 批量删除分销申请 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCustomerPlaceByIds(String[] ids); +} \ No newline at end of file diff --git a/ghy-custom/src/main/java/com/ghy/customer/service/ICustomerPlaceService.java b/ghy-custom/src/main/java/com/ghy/customer/service/ICustomerPlaceService.java new file mode 100644 index 00000000..89555c0a --- /dev/null +++ b/ghy-custom/src/main/java/com/ghy/customer/service/ICustomerPlaceService.java @@ -0,0 +1,61 @@ +package com.ghy.customer.service; + +import java.util.List; +import com.ghy.customer.domain.CustomerPlace; + +/** + * 分销申请Service接口 + * + * @author clunt + * @date 2022-08-11 + */ +public interface ICustomerPlaceService +{ + /** + * 查询分销申请 + * + * @param id 分销申请主键 + * @return 分销申请 + */ + public CustomerPlace selectCustomerPlaceById(String id); + + /** + * 查询分销申请列表 + * + * @param customerPlace 分销申请 + * @return 分销申请集合 + */ + public List selectCustomerPlaceList(CustomerPlace customerPlace); + + /** + * 新增分销申请 + * + * @param customerPlace 分销申请 + * @return 结果 + */ + public int insertCustomerPlace(CustomerPlace customerPlace); + + /** + * 修改分销申请 + * + * @param customerPlace 分销申请 + * @return 结果 + */ + public int updateCustomerPlace(CustomerPlace customerPlace); + + /** + * 批量删除分销申请 + * + * @param ids 需要删除的分销申请主键集合 + * @return 结果 + */ + public int deleteCustomerPlaceByIds(String ids); + + /** + * 删除分销申请信息 + * + * @param id 分销申请主键 + * @return 结果 + */ + public int deleteCustomerPlaceById(String id); +} \ No newline at end of file diff --git a/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerPlaceServiceImpl.java b/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerPlaceServiceImpl.java new file mode 100644 index 00000000..0cfee2a7 --- /dev/null +++ b/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerPlaceServiceImpl.java @@ -0,0 +1,96 @@ +package com.ghy.customer.service.impl; +import java.util.List; +import com.ghy.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ghy.customer.mapper.CustomerPlaceMapper; +import com.ghy.customer.domain.CustomerPlace; +import com.ghy.customer.service.ICustomerPlaceService; +import com.ghy.common.core.text.Convert; + +/** + * 分销申请Service业务层处理 + * + * @author clunt + * @date 2022-08-11 + */ +@Service +public class CustomerPlaceServiceImpl implements ICustomerPlaceService +{ + @Autowired + private CustomerPlaceMapper customerPlaceMapper; + + /** + * 查询分销申请 + * + * @param id 分销申请主键 + * @return 分销申请 + */ + @Override + public CustomerPlace selectCustomerPlaceById(String id) + { + return customerPlaceMapper.selectCustomerPlaceById(id); + } + + /** + * 查询分销申请列表 + * + * @param customerPlace 分销申请 + * @return 分销申请 + */ + @Override + public List selectCustomerPlaceList(CustomerPlace customerPlace) + { + return customerPlaceMapper.selectCustomerPlaceList(customerPlace); + } + + /** + * 新增分销申请 + * + * @param customerPlace 分销申请 + * @return 结果 + */ + @Override + public int insertCustomerPlace(CustomerPlace customerPlace) + { + customerPlace.setCreateTime(DateUtils.getNowDate()); + return customerPlaceMapper.insertCustomerPlace(customerPlace); + } + + /** + * 修改分销申请 + * + * @param customerPlace 分销申请 + * @return 结果 + */ + @Override + public int updateCustomerPlace(CustomerPlace customerPlace) + { + customerPlace.setUpdateTime(DateUtils.getNowDate()); + return customerPlaceMapper.updateCustomerPlace(customerPlace); + } + + /** + * 批量删除分销申请 + * + * @param ids 需要删除的分销申请主键 + * @return 结果 + */ + @Override + public int deleteCustomerPlaceByIds(String ids) + { + return customerPlaceMapper.deleteCustomerPlaceByIds(Convert.toStrArray(ids)); + } + + /** + * 删除分销申请信息 + * + * @param id 分销申请主键 + * @return 结果 + */ + @Override + public int deleteCustomerPlaceById(String id) + { + return customerPlaceMapper.deleteCustomerPlaceById(id); + } +} \ No newline at end of file diff --git a/ghy-custom/src/main/resources/mapper/customer/CustomerPlaceMapper.xml b/ghy-custom/src/main/resources/mapper/customer/CustomerPlaceMapper.xml new file mode 100644 index 00000000..7fc723d1 --- /dev/null +++ b/ghy-custom/src/main/resources/mapper/customer/CustomerPlaceMapper.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + select id, name, customer_id, phone, city, create_by, create_time, update_by, update_time, remark from customer_place + + + + + + + + insert into customer_place + + name, + customer_id, + phone, + city, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{name}, + #{customerId}, + #{phone}, + #{city}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update customer_place + + name = #{name}, + customer_id = #{customerId}, + phone = #{phone}, + city = #{city}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from customer_place where id = #{id} + + + + delete from customer_place where id in + + #{id} + + + + \ No newline at end of file