From a5ea99916c9f78b009d32f45de1a360716058eab Mon Sep 17 00:00:00 2001 From: Administrator <513693417@qq.com> Date: Fri, 11 Sep 2020 10:14:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=BC=9A=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-business/orderMenu.sql | 22 +++ .../controller/BizMemberController.java | 126 +++++++++++++ .../controller/BizOrderController.java | 126 +++++++++++++ .../com/ruoyi/business/domain/BizMember.java | 176 ++++++++++++++++++ .../com/ruoyi/business/domain/BizOrder.java | 139 ++++++++++++++ .../com/ruoyi/business/domain/BizProduct.java | 4 +- .../business/mapper/BizMemberMapper.java | 61 ++++++ .../ruoyi/business/mapper/BizOrderMapper.java | 61 ++++++ .../business/service/IBizMemberService.java | 61 ++++++ .../business/service/IBizOrderService.java | 61 ++++++ .../service/impl/BizMemberServiceImpl.java | 97 ++++++++++ .../service/impl/BizOrderServiceImpl.java | 97 ++++++++++ .../mapper/business/BizMemberMapper.xml | 112 +++++++++++ .../mapper/business/BizOrderMapper.xml | 97 ++++++++++ .../mapper/business/BizProductMapper.xml | 20 +- .../mapper/business/BizProductTypeMapper.xml | 14 +- .../templates/business/member/add.html | 58 ++++++ .../templates/business/member/edit.html | 59 ++++++ .../templates/business/member/member.html | 117 ++++++++++++ .../templates/business/order/add.html | 25 +++ .../templates/business/order/edit.html | 26 +++ .../templates/business/order/order.html | 110 +++++++++++ .../templates/business/product/edit.html | 2 +- 23 files changed, 1651 insertions(+), 20 deletions(-) create mode 100644 ruoyi-business/orderMenu.sql create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/controller/BizMemberController.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/controller/BizOrderController.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/domain/BizMember.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/domain/BizOrder.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizMemberMapper.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizOrderMapper.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/service/IBizMemberService.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/service/IBizOrderService.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizMemberServiceImpl.java create mode 100644 ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizOrderServiceImpl.java create mode 100644 ruoyi-business/src/main/resources/mapper/business/BizMemberMapper.xml create mode 100644 ruoyi-business/src/main/resources/mapper/business/BizOrderMapper.xml create mode 100644 ruoyi-business/src/main/resources/templates/business/member/add.html create mode 100644 ruoyi-business/src/main/resources/templates/business/member/edit.html create mode 100644 ruoyi-business/src/main/resources/templates/business/member/member.html create mode 100644 ruoyi-business/src/main/resources/templates/business/order/add.html create mode 100644 ruoyi-business/src/main/resources/templates/business/order/edit.html create mode 100644 ruoyi-business/src/main/resources/templates/business/order/order.html diff --git a/ruoyi-business/orderMenu.sql b/ruoyi-business/orderMenu.sql new file mode 100644 index 000000000..bd548a619 --- /dev/null +++ b/ruoyi-business/orderMenu.sql @@ -0,0 +1,22 @@ +-- 菜单 SQL +insert into sys_menu (menu_name, target, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单管理', 'menuItem', '0', '6', '/business/order', 'C', '0', 'business:order:view', 'fa fa-shopping-cart', 'admin', '2018-03-01', 'ry', '2018-03-01', '订单菜单'); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单查询', '@parentId', '1', '#', 'F', '0', 'business:order:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单新增', '@parentId', '2', '#', 'F', '0', 'business:order:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单修改', '@parentId', '3', '#', 'F', '0', 'business:order:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单删除', '@parentId', '4', '#', 'F', '0', 'business:order:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单导出', '@parentId', '5', '#', 'F', '0', 'business:order:export', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BizMemberController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BizMemberController.java new file mode 100644 index 000000000..b069f1862 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BizMemberController.java @@ -0,0 +1,126 @@ +package com.ruoyi.business.controller; + +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.business.domain.BizMember; +import com.ruoyi.business.service.IBizMemberService; +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 2020-09-11 + */ +@Controller +@RequestMapping("/business/member") +public class BizMemberController extends BaseController +{ + private String prefix = "business/member"; + + @Autowired + private IBizMemberService bizMemberService; + + @RequiresPermissions("business:member:view") + @GetMapping() + public String member() + { + return prefix + "/member"; + } + + /** + * 查询会员列表 + */ + @RequiresPermissions("business:member:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(BizMember bizMember) + { + startPage(); + List list = bizMemberService.selectBizMemberList(bizMember); + return getDataTable(list); + } + + /** + * 导出会员列表 + */ + @RequiresPermissions("business:member:export") + @Log(title = "会员", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BizMember bizMember) + { + List list = bizMemberService.selectBizMemberList(bizMember); + ExcelUtil util = new ExcelUtil(BizMember.class); + return util.exportExcel(list, "member"); + } + + /** + * 新增会员 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存会员 + */ + @RequiresPermissions("business:member:add") + @Log(title = "会员", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(BizMember bizMember) + { + return toAjax(bizMemberService.insertBizMember(bizMember)); + } + + /** + * 修改会员 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + BizMember bizMember = bizMemberService.selectBizMemberById(id); + mmap.put("bizMember", bizMember); + return prefix + "/edit"; + } + + /** + * 修改保存会员 + */ + @RequiresPermissions("business:member:edit") + @Log(title = "会员", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BizMember bizMember) + { + return toAjax(bizMemberService.updateBizMember(bizMember)); + } + + /** + * 删除会员 + */ + @RequiresPermissions("business:member:remove") + @Log(title = "会员", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(bizMemberService.deleteBizMemberByIds(ids)); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BizOrderController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BizOrderController.java new file mode 100644 index 000000000..f707bd1df --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BizOrderController.java @@ -0,0 +1,126 @@ +package com.ruoyi.business.controller; + +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.business.domain.BizOrder; +import com.ruoyi.business.service.IBizOrderService; +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 2020-09-09 + */ +@Controller +@RequestMapping("/business/order") +public class BizOrderController extends BaseController +{ + private String prefix = "business/order"; + + @Autowired + private IBizOrderService bizOrderService; + + @RequiresPermissions("business:order:view") + @GetMapping() + public String order() + { + return prefix + "/order"; + } + + /** + * 查询订单列表 + */ + @RequiresPermissions("business:order:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(BizOrder bizOrder) + { + startPage(); + List list = bizOrderService.selectBizOrderList(bizOrder); + return getDataTable(list); + } + + /** + * 导出订单列表 + */ + @RequiresPermissions("business:order:export") + @Log(title = "订单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BizOrder bizOrder) + { + List list = bizOrderService.selectBizOrderList(bizOrder); + ExcelUtil util = new ExcelUtil(BizOrder.class); + return util.exportExcel(list, "order"); + } + + /** + * 新增订单 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存订单 + */ + @RequiresPermissions("business:order:add") + @Log(title = "订单", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(BizOrder bizOrder) + { + return toAjax(bizOrderService.insertBizOrder(bizOrder)); + } + + /** + * 修改订单 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + BizOrder bizOrder = bizOrderService.selectBizOrderById(id); + mmap.put("bizOrder", bizOrder); + return prefix + "/edit"; + } + + /** + * 修改保存订单 + */ + @RequiresPermissions("business:order:edit") + @Log(title = "订单", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BizOrder bizOrder) + { + return toAjax(bizOrderService.updateBizOrder(bizOrder)); + } + + /** + * 删除订单 + */ + @RequiresPermissions("business:order:remove") + @Log(title = "订单", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(bizOrderService.deleteBizOrderByIds(ids)); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizMember.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizMember.java new file mode 100644 index 000000000..e5bd6a8d3 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizMember.java @@ -0,0 +1,176 @@ +package com.ruoyi.business.domain; + +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; + +/** + * 会员对象 biz_member + * + * @author ruoyi + * @date 2020-09-11 + */ +public class BizMember extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 会员ID */ + private Long id; + + /** 手机号码 */ + @Excel(name = "手机号码") + private String mobile; + + /** 用户姓名 */ + @Excel(name = "用户姓名") + private String memberName; + + /** 用户密码 */ + private String password; + + /** 推荐人ID */ + @Excel(name = "推荐人ID") + private Long recommendId; + + /** 所有上级推荐人ID */ + private String recommendAllId; + + /** 推荐人手机 */ + private String recommendMobile; + + /** 推荐人姓名 */ + private String recommendName; + + /** 会员类型 */ + @Excel(name = "会员类型") + private Integer memberType; + + /** 是否删除:0-否,1-是 */ + private Integer isDelete; + + /** 是否禁用:0-否,1-是 */ + @Excel(name = "是否禁用:0-否,1-是") + private Integer isEnable; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setMobile(String mobile) + { + this.mobile = mobile; + } + + public String getMobile() + { + return mobile; + } + public void setMemberName(String memberName) + { + this.memberName = memberName; + } + + public String getMemberName() + { + return memberName; + } + public void setPassword(String password) + { + this.password = password; + } + + public String getPassword() + { + return password; + } + public void setRecommendId(Long recommendId) + { + this.recommendId = recommendId; + } + + public Long getRecommendId() + { + return recommendId; + } + public void setRecommendAllId(String recommendAllId) + { + this.recommendAllId = recommendAllId; + } + + public String getRecommendAllId() + { + return recommendAllId; + } + public void setRecommendMobile(String recommendMobile) + { + this.recommendMobile = recommendMobile; + } + + public String getRecommendMobile() + { + return recommendMobile; + } + public void setRecommendName(String recommendName) + { + this.recommendName = recommendName; + } + + public String getRecommendName() + { + return recommendName; + } + public void setMemberType(Integer memberType) + { + this.memberType = memberType; + } + + public Integer getMemberType() + { + return memberType; + } + public void setIsDelete(Integer isDelete) + { + this.isDelete = isDelete; + } + + public Integer getIsDelete() + { + return isDelete; + } + public void setIsEnable(Integer isEnable) + { + this.isEnable = isEnable; + } + + public Integer getIsEnable() + { + return isEnable; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("mobile", getMobile()) + .append("memberName", getMemberName()) + .append("password", getPassword()) + .append("recommendId", getRecommendId()) + .append("recommendAllId", getRecommendAllId()) + .append("recommendMobile", getRecommendMobile()) + .append("recommendName", getRecommendName()) + .append("memberType", getMemberType()) + .append("isDelete", getIsDelete()) + .append("isEnable", getIsEnable()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizOrder.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizOrder.java new file mode 100644 index 000000000..599bef1ee --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizOrder.java @@ -0,0 +1,139 @@ +package com.ruoyi.business.domain; + +import java.math.BigDecimal; +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; + +/** + * 订单对象 biz_order + * + * @author ruoyi + * @date 2020-09-09 + */ +public class BizOrder extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 订单ID */ + private Long id; + + /** 订单编码 */ + @Excel(name = "订单编码") + private String orderSn; + + /** 会员ID */ + private Long memberId; + + /** 手机号码 */ + @Excel(name = "手机号码") + private String mobile; + + /** 用户姓名 */ + @Excel(name = "用户姓名") + private String memberName; + + /** 订单金额 */ + @Excel(name = "订单金额") + private BigDecimal orderAmount; + + /** 订单状态:0-待支付,1-已支付,2-已取消 */ + @Excel(name = "订单状态:0-待支付,1-已支付,2-已取消") + private Integer orderStatus; + + /** 收货人地址ID */ + @Excel(name = "收货人地址ID") + private Long addressId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setOrderSn(String orderSn) + { + this.orderSn = orderSn; + } + + public String getOrderSn() + { + return orderSn; + } + public void setMemberId(Long memberId) + { + this.memberId = memberId; + } + + public Long getMemberId() + { + return memberId; + } + public void setMobile(String mobile) + { + this.mobile = mobile; + } + + public String getMobile() + { + return mobile; + } + public void setMemberName(String memberName) + { + this.memberName = memberName; + } + + public String getMemberName() + { + return memberName; + } + public void setOrderAmount(BigDecimal orderAmount) + { + this.orderAmount = orderAmount; + } + + public BigDecimal getOrderAmount() + { + return orderAmount; + } + public void setOrderStatus(Integer orderStatus) + { + this.orderStatus = orderStatus; + } + + public Integer getOrderStatus() + { + return orderStatus; + } + public void setAddressId(Long addressId) + { + this.addressId = addressId; + } + + public Long getAddressId() + { + return addressId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("orderSn", getOrderSn()) + .append("memberId", getMemberId()) + .append("mobile", getMobile()) + .append("memberName", getMemberName()) + .append("orderAmount", getOrderAmount()) + .append("orderStatus", getOrderStatus()) + .append("addressId", getAddressId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizProduct.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizProduct.java index 66b3a4f07..d86aed263 100644 --- a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizProduct.java +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizProduct.java @@ -40,8 +40,8 @@ public class BizProduct extends BaseEntity @Excel(name = "产品单价") private Long amount; - /** 产品返现 */ - @Excel(name = "产品单价") + /** 产品返现金额 */ + @Excel(name = "产品返现金额") private Long cashbackAmount; /** 排序 */ diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizMemberMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizMemberMapper.java new file mode 100644 index 000000000..9c2f9282e --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizMemberMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.ruoyi.business.domain.BizMember; + +/** + * 会员Mapper接口 + * + * @author ruoyi + * @date 2020-09-11 + */ +public interface BizMemberMapper +{ + /** + * 查询会员 + * + * @param id 会员ID + * @return 会员 + */ + public BizMember selectBizMemberById(Long id); + + /** + * 查询会员列表 + * + * @param bizMember 会员 + * @return 会员集合 + */ + public List selectBizMemberList(BizMember bizMember); + + /** + * 新增会员 + * + * @param bizMember 会员 + * @return 结果 + */ + public int insertBizMember(BizMember bizMember); + + /** + * 修改会员 + * + * @param bizMember 会员 + * @return 结果 + */ + public int updateBizMember(BizMember bizMember); + + /** + * 删除会员 + * + * @param id 会员ID + * @return 结果 + */ + public int deleteBizMemberById(Long id); + + /** + * 批量删除会员 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteBizMemberByIds(String[] ids); +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizOrderMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizOrderMapper.java new file mode 100644 index 000000000..25d2ea41c --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizOrderMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.ruoyi.business.domain.BizOrder; + +/** + * 订单Mapper接口 + * + * @author ruoyi + * @date 2020-09-09 + */ +public interface BizOrderMapper +{ + /** + * 查询订单 + * + * @param id 订单ID + * @return 订单 + */ + public BizOrder selectBizOrderById(Long id); + + /** + * 查询订单列表 + * + * @param bizOrder 订单 + * @return 订单集合 + */ + public List selectBizOrderList(BizOrder bizOrder); + + /** + * 新增订单 + * + * @param bizOrder 订单 + * @return 结果 + */ + public int insertBizOrder(BizOrder bizOrder); + + /** + * 修改订单 + * + * @param bizOrder 订单 + * @return 结果 + */ + public int updateBizOrder(BizOrder bizOrder); + + /** + * 删除订单 + * + * @param id 订单ID + * @return 结果 + */ + public int deleteBizOrderById(Long id); + + /** + * 批量删除订单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteBizOrderByIds(String[] ids); +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizMemberService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizMemberService.java new file mode 100644 index 000000000..e03dd43d9 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizMemberService.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.BizMember; + +/** + * 会员Service接口 + * + * @author ruoyi + * @date 2020-09-11 + */ +public interface IBizMemberService +{ + /** + * 查询会员 + * + * @param id 会员ID + * @return 会员 + */ + public BizMember selectBizMemberById(Long id); + + /** + * 查询会员列表 + * + * @param bizMember 会员 + * @return 会员集合 + */ + public List selectBizMemberList(BizMember bizMember); + + /** + * 新增会员 + * + * @param bizMember 会员 + * @return 结果 + */ + public int insertBizMember(BizMember bizMember); + + /** + * 修改会员 + * + * @param bizMember 会员 + * @return 结果 + */ + public int updateBizMember(BizMember bizMember); + + /** + * 批量删除会员 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteBizMemberByIds(String ids); + + /** + * 删除会员信息 + * + * @param id 会员ID + * @return 结果 + */ + public int deleteBizMemberById(Long id); +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizOrderService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizOrderService.java new file mode 100644 index 000000000..d0f822c85 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizOrderService.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.BizOrder; + +/** + * 订单Service接口 + * + * @author ruoyi + * @date 2020-09-09 + */ +public interface IBizOrderService +{ + /** + * 查询订单 + * + * @param id 订单ID + * @return 订单 + */ + public BizOrder selectBizOrderById(Long id); + + /** + * 查询订单列表 + * + * @param bizOrder 订单 + * @return 订单集合 + */ + public List selectBizOrderList(BizOrder bizOrder); + + /** + * 新增订单 + * + * @param bizOrder 订单 + * @return 结果 + */ + public int insertBizOrder(BizOrder bizOrder); + + /** + * 修改订单 + * + * @param bizOrder 订单 + * @return 结果 + */ + public int updateBizOrder(BizOrder bizOrder); + + /** + * 批量删除订单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteBizOrderByIds(String ids); + + /** + * 删除订单信息 + * + * @param id 订单ID + * @return 结果 + */ + public int deleteBizOrderById(Long id); +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizMemberServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizMemberServiceImpl.java new file mode 100644 index 000000000..1e0171fca --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizMemberServiceImpl.java @@ -0,0 +1,97 @@ +package com.ruoyi.business.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.business.mapper.BizMemberMapper; +import com.ruoyi.business.domain.BizMember; +import com.ruoyi.business.service.IBizMemberService; +import com.ruoyi.common.core.text.Convert; + +/** + * 会员Service业务层处理 + * + * @author ruoyi + * @date 2020-09-11 + */ +@Service +public class BizMemberServiceImpl implements IBizMemberService +{ + @Autowired + private BizMemberMapper bizMemberMapper; + + /** + * 查询会员 + * + * @param id 会员ID + * @return 会员 + */ + @Override + public BizMember selectBizMemberById(Long id) + { + return bizMemberMapper.selectBizMemberById(id); + } + + /** + * 查询会员列表 + * + * @param bizMember 会员 + * @return 会员 + */ + @Override + public List selectBizMemberList(BizMember bizMember) + { + return bizMemberMapper.selectBizMemberList(bizMember); + } + + /** + * 新增会员 + * + * @param bizMember 会员 + * @return 结果 + */ + @Override + public int insertBizMember(BizMember bizMember) + { + bizMember.setCreateTime(DateUtils.getNowDate()); + return bizMemberMapper.insertBizMember(bizMember); + } + + /** + * 修改会员 + * + * @param bizMember 会员 + * @return 结果 + */ + @Override + public int updateBizMember(BizMember bizMember) + { + bizMember.setUpdateTime(DateUtils.getNowDate()); + return bizMemberMapper.updateBizMember(bizMember); + } + + /** + * 删除会员对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteBizMemberByIds(String ids) + { + return bizMemberMapper.deleteBizMemberByIds(Convert.toStrArray(ids)); + } + + /** + * 删除会员信息 + * + * @param id 会员ID + * @return 结果 + */ + @Override + public int deleteBizMemberById(Long id) + { + return bizMemberMapper.deleteBizMemberById(id); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizOrderServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizOrderServiceImpl.java new file mode 100644 index 000000000..75046040f --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizOrderServiceImpl.java @@ -0,0 +1,97 @@ +package com.ruoyi.business.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.business.mapper.BizOrderMapper; +import com.ruoyi.business.domain.BizOrder; +import com.ruoyi.business.service.IBizOrderService; +import com.ruoyi.common.core.text.Convert; + +/** + * 订单Service业务层处理 + * + * @author ruoyi + * @date 2020-09-09 + */ +@Service +public class BizOrderServiceImpl implements IBizOrderService +{ + @Autowired + private BizOrderMapper bizOrderMapper; + + /** + * 查询订单 + * + * @param id 订单ID + * @return 订单 + */ + @Override + public BizOrder selectBizOrderById(Long id) + { + return bizOrderMapper.selectBizOrderById(id); + } + + /** + * 查询订单列表 + * + * @param bizOrder 订单 + * @return 订单 + */ + @Override + public List selectBizOrderList(BizOrder bizOrder) + { + return bizOrderMapper.selectBizOrderList(bizOrder); + } + + /** + * 新增订单 + * + * @param bizOrder 订单 + * @return 结果 + */ + @Override + public int insertBizOrder(BizOrder bizOrder) + { + bizOrder.setCreateTime(DateUtils.getNowDate()); + return bizOrderMapper.insertBizOrder(bizOrder); + } + + /** + * 修改订单 + * + * @param bizOrder 订单 + * @return 结果 + */ + @Override + public int updateBizOrder(BizOrder bizOrder) + { + bizOrder.setUpdateTime(DateUtils.getNowDate()); + return bizOrderMapper.updateBizOrder(bizOrder); + } + + /** + * 删除订单对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteBizOrderByIds(String ids) + { + return bizOrderMapper.deleteBizOrderByIds(Convert.toStrArray(ids)); + } + + /** + * 删除订单信息 + * + * @param id 订单ID + * @return 结果 + */ + @Override + public int deleteBizOrderById(Long id) + { + return bizOrderMapper.deleteBizOrderById(id); + } +} diff --git a/ruoyi-business/src/main/resources/mapper/business/BizMemberMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BizMemberMapper.xml new file mode 100644 index 000000000..06717836a --- /dev/null +++ b/ruoyi-business/src/main/resources/mapper/business/BizMemberMapper.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, mobile, member_name, password, recommend_id, recommend_all_id, recommend_mobile, recommend_name, member_type, is_delete, is_enable, create_by, create_time, update_by, update_time from biz_member + + + + + + + + insert into biz_member + + mobile, + member_name, + password, + recommend_id, + recommend_all_id, + recommend_mobile, + recommend_name, + member_type, + is_delete, + is_enable, + create_by, + create_time, + update_by, + update_time, + + + #{mobile}, + #{memberName}, + #{password}, + #{recommendId}, + #{recommendAllId}, + #{recommendMobile}, + #{recommendName}, + #{memberType}, + #{isDelete}, + #{isEnable}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update biz_member + + mobile = #{mobile}, + member_name = #{memberName}, + password = #{password}, + recommend_id = #{recommendId}, + recommend_all_id = #{recommendAllId}, + recommend_mobile = #{recommendMobile}, + recommend_name = #{recommendName}, + member_type = #{memberType}, + is_delete = #{isDelete}, + is_enable = #{isEnable}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from biz_member where id = #{id} + + + + delete from biz_member where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/mapper/business/BizOrderMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BizOrderMapper.xml new file mode 100644 index 000000000..aa13a85b5 --- /dev/null +++ b/ruoyi-business/src/main/resources/mapper/business/BizOrderMapper.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + select id, order_sn, member_id, mobile, member_name, order_amount, order_status, address_id, create_by, create_time, update_by, update_time from biz_order + + + + + + + + insert into biz_order + + order_sn, + member_id, + mobile, + member_name, + order_amount, + order_status, + address_id, + create_by, + create_time, + update_by, + update_time, + + + #{orderSn}, + #{memberId}, + #{mobile}, + #{memberName}, + #{orderAmount}, + #{orderStatus}, + #{addressId}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update biz_order + + order_sn = #{orderSn}, + member_id = #{memberId}, + mobile = #{mobile}, + member_name = #{memberName}, + order_amount = #{orderAmount}, + order_status = #{orderStatus}, + address_id = #{addressId}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from biz_order where id = #{id} + + + + delete from biz_order where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/mapper/business/BizProductMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BizProductMapper.xml index bf3abab9a..a20d6e694 100644 --- a/ruoyi-business/src/main/resources/mapper/business/BizProductMapper.xml +++ b/ruoyi-business/src/main/resources/mapper/business/BizProductMapper.xml @@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -24,14 +24,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - select product_id, product_code, product_name, product_type_id, product_class, amount, cashback_amount, sort, online_status, online_time, offline_time, remark, create_by, create_time, update_by, update_time from biz_product + select id, product_code, product_name, product_type_id, product_class, amount, cashback_amount, sort, online_status, online_time, offline_time, remark, create_by, create_time, update_by, update_time from biz_product @@ -113,15 +113,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = #{updateTime}, - where product_id = #{productId} + where id = #{productId} - delete from biz_product where product_id = #{productId} + delete from biz_product where id = #{productId} - delete from biz_product where product_id in + delete from biz_product where id in #{productId} diff --git a/ruoyi-business/src/main/resources/mapper/business/BizProductTypeMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BizProductTypeMapper.xml index 628c3c1e5..40422a02e 100644 --- a/ruoyi-business/src/main/resources/mapper/business/BizProductTypeMapper.xml +++ b/ruoyi-business/src/main/resources/mapper/business/BizProductTypeMapper.xml @@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select product_type_id, product_type_code, product_type_name, image_url, sort, is_enable, create_by, create_time, update_by, update_time from biz_product_type + select id, product_type_code, product_type_name, image_url, sort, is_enable, create_by, create_time, update_by, update_time from biz_product_type @@ -74,15 +74,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = #{updateTime}, - where product_type_id = #{productTypeId} + where id = #{productTypeId} - delete from biz_product_type where product_type_id = #{productTypeId} + delete from biz_product_type where id = #{productTypeId} - delete from biz_product_type where product_type_id in + delete from biz_product_type where id in #{productTypeId} diff --git a/ruoyi-business/src/main/resources/templates/business/member/add.html b/ruoyi-business/src/main/resources/templates/business/member/add.html new file mode 100644 index 000000000..978cae71f --- /dev/null +++ b/ruoyi-business/src/main/resources/templates/business/member/add.html @@ -0,0 +1,58 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + 代码生成请选择字典属性 +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/templates/business/member/edit.html b/ruoyi-business/src/main/resources/templates/business/member/edit.html new file mode 100644 index 000000000..abc176941 --- /dev/null +++ b/ruoyi-business/src/main/resources/templates/business/member/edit.html @@ -0,0 +1,59 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + 代码生成请选择字典属性 +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/templates/business/member/member.html b/ruoyi-business/src/main/resources/templates/business/member/member.html new file mode 100644 index 000000000..c7be568c7 --- /dev/null +++ b/ruoyi-business/src/main/resources/templates/business/member/member.html @@ -0,0 +1,117 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/templates/business/order/add.html b/ruoyi-business/src/main/resources/templates/business/order/add.html new file mode 100644 index 000000000..1d9872143 --- /dev/null +++ b/ruoyi-business/src/main/resources/templates/business/order/add.html @@ -0,0 +1,25 @@ + + + + + + +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/templates/business/order/edit.html b/ruoyi-business/src/main/resources/templates/business/order/edit.html new file mode 100644 index 000000000..a16dbc6e0 --- /dev/null +++ b/ruoyi-business/src/main/resources/templates/business/order/edit.html @@ -0,0 +1,26 @@ + + + + + + +
+
+ +
+
+ + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/templates/business/order/order.html b/ruoyi-business/src/main/resources/templates/business/order/order.html new file mode 100644 index 000000000..12f067015 --- /dev/null +++ b/ruoyi-business/src/main/resources/templates/business/order/order.html @@ -0,0 +1,110 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/templates/business/product/edit.html b/ruoyi-business/src/main/resources/templates/business/product/edit.html index f54273dd5..2eb3b38f2 100644 --- a/ruoyi-business/src/main/resources/templates/business/product/edit.html +++ b/ruoyi-business/src/main/resources/templates/business/product/edit.html @@ -4,7 +4,7 @@ - +111