From 4df60be99f51b0a83dfbb82b2f5445f6dd92c4aa Mon Sep 17 00:00:00 2001 From: GeDashi <2531216855@qq.com> Date: Fri, 20 Dec 2024 01:47:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A43?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/SysLoginService.java | 2 +- .../system/controller/CustomerController.java | 104 ++++++++++++++ .../controller/TwodimensionController.java | 104 ++++++++++++++ .../com/ruoyi/system/domain/Customer.java | 80 +++++++++++ .../com/ruoyi/system/domain/Twodimension.java | 93 +++++++++++++ .../ruoyi/system/mapper/CustomerMapper.java | 87 ++++++++++++ .../system/mapper/TwodimensionMapper.java | 61 ++++++++ .../system/service/ICustomerService.java | 61 ++++++++ .../system/service/ITwodimensionService.java | 61 ++++++++ .../service/impl/CustomerServiceImpl.java | 131 ++++++++++++++++++ .../service/impl/TwodimensionServiceImpl.java | 93 +++++++++++++ .../mapper/system/CustomerMapper.xml | 98 +++++++++++++ .../mapper/system/TwodimensionMapper.xml | 71 ++++++++++ 13 files changed, 1045 insertions(+), 1 deletion(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/controller/TwodimensionController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/Customer.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/Twodimension.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/TwodimensionMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/ITwodimensionService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TwodimensionServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/system/TwodimensionMapper.xml diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index ce86ad4..99deb53 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -176,6 +176,6 @@ public class SysLoginService sysUser.setUserId(userId); sysUser.setLoginIp(IpUtils.getIpAddr()); sysUser.setLoginDate(DateUtils.getNowDate()); - userService.updateUserProfile(sysUser); + //userService.updateUserProfile(sysUser); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java new file mode 100644 index 0000000..84ad40c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +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.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.Customer; +import com.ruoyi.system.service.ICustomerService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 客户表Controller + * + * @author LG + * @date 2024-12-20 + */ +@RestController +@RequestMapping("/system/customer") +public class CustomerController extends BaseController +{ + @Autowired + private ICustomerService customerService; + + /** + * 查询客户表列表 + */ + @PreAuthorize("@ss.hasPermi('system:customer:list')") + @GetMapping("/list") + public TableDataInfo list(Customer customer) + { + startPage(); + List list = customerService.selectCustomerList(customer); + return getDataTable(list); + } + + /** + * 导出客户表列表 + */ + @PreAuthorize("@ss.hasPermi('system:customer:export')") + @Log(title = "客户表", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Customer customer) + { + List list = customerService.selectCustomerList(customer); + ExcelUtil util = new ExcelUtil(Customer.class); + util.exportExcel(response, list, "客户表数据"); + } + + /** + * 获取客户表详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:customer:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(customerService.selectCustomerById(id)); + } + + /** + * 新增客户表 + */ + @PreAuthorize("@ss.hasPermi('system:customer:add')") + @Log(title = "客户表", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Customer customer) + { + return toAjax(customerService.insertCustomer(customer)); + } + + /** + * 修改客户表 + */ + @PreAuthorize("@ss.hasPermi('system:customer:edit')") + @Log(title = "客户表", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Customer customer) + { + return toAjax(customerService.updateCustomer(customer)); + } + + /** + * 删除客户表 + */ + @PreAuthorize("@ss.hasPermi('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-system/src/main/java/com/ruoyi/system/controller/TwodimensionController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/TwodimensionController.java new file mode 100644 index 0000000..4c5213f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/TwodimensionController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +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.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.Twodimension; +import com.ruoyi.system.service.ITwodimensionService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 提货二维码Controller + * + * @author LG + * @date 2024-12-20 + */ +@RestController +@RequestMapping("/system/twodimension") +public class TwodimensionController extends BaseController +{ + @Autowired + private ITwodimensionService twodimensionService; + + /** + * 查询提货二维码列表 + */ + @PreAuthorize("@ss.hasPermi('system:twodimension:list')") + @GetMapping("/list") + public TableDataInfo list(Twodimension twodimension) + { + startPage(); + List list = twodimensionService.selectTwodimensionList(twodimension); + return getDataTable(list); + } + + /** + * 导出提货二维码列表 + */ + @PreAuthorize("@ss.hasPermi('system:twodimension:export')") + @Log(title = "提货二维码", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Twodimension twodimension) + { + List list = twodimensionService.selectTwodimensionList(twodimension); + ExcelUtil util = new ExcelUtil(Twodimension.class); + util.exportExcel(response, list, "提货二维码数据"); + } + + /** + * 获取提货二维码详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:twodimension:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(twodimensionService.selectTwodimensionById(id)); + } + + /** + * 新增提货二维码 + */ + @PreAuthorize("@ss.hasPermi('system:twodimension:add')") + @Log(title = "提货二维码", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Twodimension twodimension) + { + return toAjax(twodimensionService.insertTwodimension(twodimension)); + } + + /** + * 修改提货二维码 + */ + @PreAuthorize("@ss.hasPermi('system:twodimension:edit')") + @Log(title = "提货二维码", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Twodimension twodimension) + { + return toAjax(twodimensionService.updateTwodimension(twodimension)); + } + + /** + * 删除提货二维码 + */ + @PreAuthorize("@ss.hasPermi('system:twodimension:remove')") + @Log(title = "提货二维码", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(twodimensionService.deleteTwodimensionByIds(ids)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Customer.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Customer.java new file mode 100644 index 0000000..bdf57b3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Customer.java @@ -0,0 +1,80 @@ +package com.ruoyi.system.domain; + +import java.util.List; +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; + +/** + * 客户表对象 customer + * + * @author LG + * @date 2024-12-20 + */ +public class Customer extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 客户id */ + private Long id; + + /** 客户名 */ + @Excel(name = "客户名") + private String customername; + + /** 二维码id */ + @Excel(name = "二维码id") + private Long twodimensionid; + + /** 提货二维码信息 */ + private List twodimensionList; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCustomername(String customername) + { + this.customername = customername; + } + + public String getCustomername() + { + return customername; + } + public void setTwodimensionid(Long twodimensionid) + { + this.twodimensionid = twodimensionid; + } + + public Long getTwodimensionid() + { + return twodimensionid; + } + + public List getTwodimensionList() + { + return twodimensionList; + } + + public void setTwodimensionList(List twodimensionList) + { + this.twodimensionList = twodimensionList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("customername", getCustomername()) + .append("twodimensionid", getTwodimensionid()) + .append("twodimensionList", getTwodimensionList()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Twodimension.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Twodimension.java new file mode 100644 index 0000000..c44cbdd --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Twodimension.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.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; + +/** + * 提货二维码对象 twodimension + * + * @author LG + * @date 2024-12-20 + */ +public class Twodimension extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 二维码id */ + private Long id; + + /** 二维码1 */ + @Excel(name = "二维码1") + private String twodimension1; + + /** 二维码2 */ + @Excel(name = " 二维码2") + private String twodimension2; + + /** 二维码3 */ + @Excel(name = " 二维码3") + private String twodimension3; + + /** 客户id */ + @Excel(name = "客户id") + private Long customerid; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTwodimension1(String twodimension1) + { + this.twodimension1 = twodimension1; + } + + public String getTwodimension1() + { + return twodimension1; + } + public void setTwodimension2(String twodimension2) + { + this.twodimension2 = twodimension2; + } + + public String getTwodimension2() + { + return twodimension2; + } + public void setTwodimension3(String twodimension3) + { + this.twodimension3 = twodimension3; + } + + public String getTwodimension3() + { + return twodimension3; + } + public void setCustomerid(Long customerid) + { + this.customerid = customerid; + } + + public Long getCustomerid() + { + return customerid; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("twodimension1", getTwodimension1()) + .append("twodimension2", getTwodimension2()) + .append("twodimension3", getTwodimension3()) + .append("customerid", getCustomerid()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java new file mode 100644 index 0000000..325aadb --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java @@ -0,0 +1,87 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.Customer; +import com.ruoyi.system.domain.Twodimension; + +/** + * 客户表Mapper接口 + * + * @author LG + * @date 2024-12-20 + */ +public interface CustomerMapper +{ + /** + * 查询客户表 + * + * @param id 客户表主键 + * @return 客户表 + */ + public Customer selectCustomerById(Long id); + + /** + * 查询客户表列表 + * + * @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 id 客户表主键 + * @return 结果 + */ + public int deleteCustomerById(Long id); + + /** + * 批量删除客户表 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCustomerByIds(Long[] ids); + + /** + * 批量删除提货二维码 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTwodimensionByCustomerids(Long[] ids); + + /** + * 批量新增提货二维码 + * + * @param twodimensionList 提货二维码列表 + * @return 结果 + */ + public int batchTwodimension(List twodimensionList); + + + /** + * 通过客户表主键删除提货二维码信息 + * + * @param id 客户表ID + * @return 结果 + */ + public int deleteTwodimensionByCustomerid(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TwodimensionMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TwodimensionMapper.java new file mode 100644 index 0000000..f0944b2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TwodimensionMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.Twodimension; + +/** + * 提货二维码Mapper接口 + * + * @author LG + * @date 2024-12-20 + */ +public interface TwodimensionMapper +{ + /** + * 查询提货二维码 + * + * @param id 提货二维码主键 + * @return 提货二维码 + */ + public Twodimension selectTwodimensionById(Long id); + + /** + * 查询提货二维码列表 + * + * @param twodimension 提货二维码 + * @return 提货二维码集合 + */ + public List selectTwodimensionList(Twodimension twodimension); + + /** + * 新增提货二维码 + * + * @param twodimension 提货二维码 + * @return 结果 + */ + public int insertTwodimension(Twodimension twodimension); + + /** + * 修改提货二维码 + * + * @param twodimension 提货二维码 + * @return 结果 + */ + public int updateTwodimension(Twodimension twodimension); + + /** + * 删除提货二维码 + * + * @param id 提货二维码主键 + * @return 结果 + */ + public int deleteTwodimensionById(Long id); + + /** + * 批量删除提货二维码 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTwodimensionByIds(Long[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java new file mode 100644 index 0000000..e979583 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.Customer; + +/** + * 客户表Service接口 + * + * @author LG + * @date 2024-12-20 + */ +public interface ICustomerService +{ + /** + * 查询客户表 + * + * @param id 客户表主键 + * @return 客户表 + */ + public Customer selectCustomerById(Long id); + + /** + * 查询客户表列表 + * + * @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 需要删除的客户表主键集合 + * @return 结果 + */ + public int deleteCustomerByIds(Long[] ids); + + /** + * 删除客户表信息 + * + * @param id 客户表主键 + * @return 结果 + */ + public int deleteCustomerById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITwodimensionService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITwodimensionService.java new file mode 100644 index 0000000..bdc7118 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITwodimensionService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.Twodimension; + +/** + * 提货二维码Service接口 + * + * @author LG + * @date 2024-12-20 + */ +public interface ITwodimensionService +{ + /** + * 查询提货二维码 + * + * @param id 提货二维码主键 + * @return 提货二维码 + */ + public Twodimension selectTwodimensionById(Long id); + + /** + * 查询提货二维码列表 + * + * @param twodimension 提货二维码 + * @return 提货二维码集合 + */ + public List selectTwodimensionList(Twodimension twodimension); + + /** + * 新增提货二维码 + * + * @param twodimension 提货二维码 + * @return 结果 + */ + public int insertTwodimension(Twodimension twodimension); + + /** + * 修改提货二维码 + * + * @param twodimension 提货二维码 + * @return 结果 + */ + public int updateTwodimension(Twodimension twodimension); + + /** + * 批量删除提货二维码 + * + * @param ids 需要删除的提货二维码主键集合 + * @return 结果 + */ + public int deleteTwodimensionByIds(Long[] ids); + + /** + * 删除提货二维码信息 + * + * @param id 提货二维码主键 + * @return 结果 + */ + public int deleteTwodimensionById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java new file mode 100644 index 0000000..be33273 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java @@ -0,0 +1,131 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.system.domain.Twodimension; +import com.ruoyi.system.mapper.CustomerMapper; +import com.ruoyi.system.domain.Customer; +import com.ruoyi.system.service.ICustomerService; + +/** + * 客户表Service业务层处理 + * + * @author LG + * @date 2024-12-20 + */ +@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(Customer customer) + { + return customerMapper.selectCustomerList(customer); + } + + /** + * 新增客户表 + * + * @param customer 客户表 + * @return 结果 + */ + @Transactional + @Override + public int insertCustomer(Customer customer) + { + int rows = customerMapper.insertCustomer(customer); + insertTwodimension(customer); + return rows; + } + + /** + * 修改客户表 + * + * @param customer 客户表 + * @return 结果 + */ + @Transactional + @Override + public int updateCustomer(Customer customer) + { + customerMapper.deleteTwodimensionByCustomerid(customer.getId()); + insertTwodimension(customer); + return customerMapper.updateCustomer(customer); + } + + /** + * 批量删除客户表 + * + * @param ids 需要删除的客户表主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteCustomerByIds(Long[] ids) + { + customerMapper.deleteTwodimensionByCustomerids(ids); + return customerMapper.deleteCustomerByIds(ids); + } + + /** + * 删除客户表信息 + * + * @param id 客户表主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteCustomerById(Long id) + { + customerMapper.deleteTwodimensionByCustomerid(id); + return customerMapper.deleteCustomerById(id); + } + + /** + * 新增提货二维码信息 + * + * @param customer 客户表对象 + */ + public void insertTwodimension(Customer customer) + { + List twodimensionList = customer.getTwodimensionList(); + Long id = customer.getId(); + if (StringUtils.isNotNull(twodimensionList)) + { + List list = new ArrayList(); + for (Twodimension twodimension : twodimensionList) + { + twodimension.setCustomerid(id); + list.add(twodimension); + } + if (list.size() > 0) + { + customerMapper.batchTwodimension(list); + } + } + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TwodimensionServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TwodimensionServiceImpl.java new file mode 100644 index 0000000..1ef467c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TwodimensionServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.TwodimensionMapper; +import com.ruoyi.system.domain.Twodimension; +import com.ruoyi.system.service.ITwodimensionService; + +/** + * 提货二维码Service业务层处理 + * + * @author LG + * @date 2024-12-20 + */ +@Service +public class TwodimensionServiceImpl implements ITwodimensionService +{ + @Autowired + private TwodimensionMapper twodimensionMapper; + + /** + * 查询提货二维码 + * + * @param id 提货二维码主键 + * @return 提货二维码 + */ + @Override + public Twodimension selectTwodimensionById(Long id) + { + return twodimensionMapper.selectTwodimensionById(id); + } + + /** + * 查询提货二维码列表 + * + * @param twodimension 提货二维码 + * @return 提货二维码 + */ + @Override + public List selectTwodimensionList(Twodimension twodimension) + { + return twodimensionMapper.selectTwodimensionList(twodimension); + } + + /** + * 新增提货二维码 + * + * @param twodimension 提货二维码 + * @return 结果 + */ + @Override + public int insertTwodimension(Twodimension twodimension) + { + return twodimensionMapper.insertTwodimension(twodimension); + } + + /** + * 修改提货二维码 + * + * @param twodimension 提货二维码 + * @return 结果 + */ + @Override + public int updateTwodimension(Twodimension twodimension) + { + return twodimensionMapper.updateTwodimension(twodimension); + } + + /** + * 批量删除提货二维码 + * + * @param ids 需要删除的提货二维码主键 + * @return 结果 + */ + @Override + public int deleteTwodimensionByIds(Long[] ids) + { + return twodimensionMapper.deleteTwodimensionByIds(ids); + } + + /** + * 删除提货二维码信息 + * + * @param id 提货二维码主键 + * @return 结果 + */ + @Override + public int deleteTwodimensionById(Long id) + { + return twodimensionMapper.deleteTwodimensionById(id); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml b/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml new file mode 100644 index 0000000..cf1aff5 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, customername, twodimensionid from customer + + + + + + + + + + insert into customer + + customername, + twodimensionid, + + + #{customername}, + #{twodimensionid}, + + + + + update customer + + customername = #{customername}, + twodimensionid = #{twodimensionid}, + + where id = #{id} + + + + delete from customer where id = #{id} + + + + delete from customer where id in + + #{id} + + + + + delete from twodimension where customerid in + + #{customerid} + + + + + delete from twodimension where customerid = #{customerid} + + + + insert into twodimension( id, twodimension1, twodimension2, twodimension3, customerid) values + + ( #{item.id}, #{item.twodimension1}, #{item.twodimension2}, #{item.twodimension3}, #{item.customerid}) + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/TwodimensionMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TwodimensionMapper.xml new file mode 100644 index 0000000..8d978b9 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/TwodimensionMapper.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + select id, twodimension1, twodimension2, twodimension3, customerid from twodimension + + + + + + + + insert into twodimension + + twodimension1, + twodimension2, + twodimension3, + customerid, + + + #{twodimension1}, + #{twodimension2}, + #{twodimension3}, + #{customerid}, + + + + + update twodimension + + twodimension1 = #{twodimension1}, + twodimension2 = #{twodimension2}, + twodimension3 = #{twodimension3}, + customerid = #{customerid}, + + where id = #{id} + + + + delete from twodimension where id = #{id} + + + + delete from twodimension where id in + + #{id} + + + \ No newline at end of file