From 27731323bcdb87823305c9b9a7fd774e4ea6cfa3 Mon Sep 17 00:00:00 2001 From: "mula.liu" Date: Wed, 30 Apr 2025 11:40:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/manage/delivery/edit.html | 2 +- .../manage/delivery/selectOrder.html | 2 +- .../templates/system/partner/add.html | 105 +++++++++ .../templates/system/partner/edit.html | 92 ++++++++ .../templates/system/partner/partner.html | 133 +++++++++++ .../sip/controller/PartnerInfoController.java | 128 +++++++++++ .../com/ruoyi/sip/domain/PartnerInfo.java | 217 ++++++++++++++++++ .../ruoyi/sip/mapper/PartnerInfoMapper.java | 61 +++++ .../sip/service/IPartnerInfoService.java | 61 +++++ .../service/impl/PartnerInfoServiceImpl.java | 94 ++++++++ .../mapper/system/PartnerInfoMapper.xml | 103 +++++++++ 11 files changed, 996 insertions(+), 2 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/partner/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/partner/edit.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/partner/partner.html create mode 100644 ruoyi-sip/src/main/java/com/ruoyi/sip/controller/PartnerInfoController.java create mode 100644 ruoyi-sip/src/main/java/com/ruoyi/sip/domain/PartnerInfo.java create mode 100644 ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/PartnerInfoMapper.java create mode 100644 ruoyi-sip/src/main/java/com/ruoyi/sip/service/IPartnerInfoService.java create mode 100644 ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/PartnerInfoServiceImpl.java create mode 100644 ruoyi-sip/src/main/resources/mapper/system/PartnerInfoMapper.xml diff --git a/ruoyi-admin/src/main/resources/templates/manage/delivery/edit.html b/ruoyi-admin/src/main/resources/templates/manage/delivery/edit.html index 79ca2e61..f3924483 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/delivery/edit.html +++ b/ruoyi-admin/src/main/resources/templates/manage/delivery/edit.html @@ -165,7 +165,7 @@ }); function openList(){ var options = { - title: "关联合同", + title: "选择合同", url: prefix + '/selectOrder', skin: 'layui-layer-gray', maxmin: false, diff --git a/ruoyi-admin/src/main/resources/templates/manage/delivery/selectOrder.html b/ruoyi-admin/src/main/resources/templates/manage/delivery/selectOrder.html index b177a06e..27774c6f 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/delivery/selectOrder.html +++ b/ruoyi-admin/src/main/resources/templates/manage/delivery/selectOrder.html @@ -29,7 +29,7 @@ - + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/partner/edit.html b/ruoyi-admin/src/main/resources/templates/system/partner/edit.html new file mode 100644 index 00000000..10aae6d6 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/partner/edit.html @@ -0,0 +1,92 @@ + + + + + + +
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/partner/partner.html b/ruoyi-admin/src/main/resources/templates/system/partner/partner.html new file mode 100644 index 00000000..d689fd3b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/partner/partner.html @@ -0,0 +1,133 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/PartnerInfoController.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/PartnerInfoController.java new file mode 100644 index 00000000..88662351 --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/PartnerInfoController.java @@ -0,0 +1,128 @@ +package com.ruoyi.sip.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.sip.domain.PartnerInfo; +import com.ruoyi.sip.service.IPartnerInfoService; +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 mula + * @date 2025-04-30 + */ +@Controller +@RequestMapping("/system/partner") +public class PartnerInfoController extends BaseController +{ + private String prefix = "system/partner"; + + @Autowired + private IPartnerInfoService partnerInfoService; + + @RequiresPermissions("system:partner:view") + @GetMapping() + public String partner() + { + return prefix + "/partner"; + } + + /** + * 查询供应商管理列表 + */ + @RequiresPermissions("system:partner:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(PartnerInfo partnerInfo) + { + startPage(); + List list = partnerInfoService.selectPartnerInfoList(partnerInfo); + return getDataTable(list); + } + + /** + * 导出供应商管理列表 + */ + @RequiresPermissions("system:partner:export") + @Log(title = "供应商管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(PartnerInfo partnerInfo) + { + List list = partnerInfoService.selectPartnerInfoList(partnerInfo); + ExcelUtil util = new ExcelUtil(PartnerInfo.class); + return util.exportExcel(list, "供应商管理数据"); + } + + /** + * 新增供应商管理 + */ + @RequiresPermissions("system:partner:add") + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存供应商管理 + */ + @RequiresPermissions("system:partner:add") + @Log(title = "供应商管理", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(PartnerInfo partnerInfo) + { + return toAjax(partnerInfoService.insertPartnerInfo(partnerInfo)); + } + + /** + * 修改供应商管理 + */ + @RequiresPermissions("system:partner:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + PartnerInfo partnerInfo = partnerInfoService.selectPartnerInfoById(id); + mmap.put("partnerInfo", partnerInfo); + return prefix + "/edit"; + } + + /** + * 修改保存供应商管理 + */ + @RequiresPermissions("system:partner:edit") + @Log(title = "供应商管理", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(PartnerInfo partnerInfo) + { + return toAjax(partnerInfoService.updatePartnerInfo(partnerInfo)); + } + + /** + * 删除供应商管理 + */ + @RequiresPermissions("system:partner:remove") + @Log(title = "供应商管理", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(partnerInfoService.deletePartnerInfoByIds(ids)); + } +} diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/PartnerInfo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/PartnerInfo.java new file mode 100644 index 00000000..13fc2712 --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/PartnerInfo.java @@ -0,0 +1,217 @@ +package com.ruoyi.sip.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 供应商管理对象 partner_info + * + * @author mula + * @date 2025-04-30 + */ +public class PartnerInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 供应商编码 */ + @Excel(name = "供应商编码") + private String partnerCode; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String partnerName; + + /** 省 */ + @Excel(name = "省") + private String province; + + /** 市 */ + @Excel(name = "市") + private String city; + + /** 详细地址 */ + @Excel(name = "详细地址") + private String address; + + /** 联系人 */ + @Excel(name = "联系人") + private String contactPerson; + + /** 联系电话 */ + @Excel(name = "联系电话") + private String contactPhone; + + /** 认证级别 */ + @Excel(name = "认证级别") + private String level; + + /** */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") + private Date createAt; + + /** */ + private Date updateAt; + + /** */ + private Date deleteAt; + + /** */ + private Integer status; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setPartnerCode(String partnerCode) + { + this.partnerCode = partnerCode; + } + + public String getPartnerCode() + { + return partnerCode; + } + + public void setPartnerName(String partnerName) + { + this.partnerName = partnerName; + } + + public String getPartnerName() + { + return partnerName; + } + + public void setProvince(String province) + { + this.province = province; + } + + public String getProvince() + { + return province; + } + + public void setCity(String city) + { + this.city = city; + } + + public String getCity() + { + return city; + } + + public void setAddress(String address) + { + this.address = address; + } + + public String getAddress() + { + return address; + } + + public void setContactPerson(String contactPerson) + { + this.contactPerson = contactPerson; + } + + public String getContactPerson() + { + return contactPerson; + } + + public void setContactPhone(String contactPhone) + { + this.contactPhone = contactPhone; + } + + public String getContactPhone() + { + return contactPhone; + } + + public void setLevel(String level) + { + this.level = level; + } + + public String getLevel() + { + return level; + } + + public void setCreateAt(Date createAt) + { + this.createAt = createAt; + } + + public Date getCreateAt() + { + return createAt; + } + + public void setUpdateAt(Date updateAt) + { + this.updateAt = updateAt; + } + + public Date getUpdateAt() + { + return updateAt; + } + + public void setDeleteAt(Date deleteAt) + { + this.deleteAt = deleteAt; + } + + public Date getDeleteAt() + { + return deleteAt; + } + + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("partnerCode", getPartnerCode()) + .append("partnerName", getPartnerName()) + .append("province", getProvince()) + .append("city", getCity()) + .append("address", getAddress()) + .append("contactPerson", getContactPerson()) + .append("contactPhone", getContactPhone()) + .append("level", getLevel()) + .append("createAt", getCreateAt()) + .append("updateAt", getUpdateAt()) + .append("deleteAt", getDeleteAt()) + .append("status", getStatus()) + .toString(); + } +} diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/PartnerInfoMapper.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/PartnerInfoMapper.java new file mode 100644 index 00000000..aba65fb4 --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/PartnerInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.sip.mapper; + +import java.util.List; +import com.ruoyi.sip.domain.PartnerInfo; + +/** + * 供应商管理Mapper接口 + * + * @author mula + * @date 2025-04-30 + */ +public interface PartnerInfoMapper +{ + /** + * 查询供应商管理 + * + * @param id 供应商管理主键 + * @return 供应商管理 + */ + public PartnerInfo selectPartnerInfoById(Long id); + + /** + * 查询供应商管理列表 + * + * @param partnerInfo 供应商管理 + * @return 供应商管理集合 + */ + public List selectPartnerInfoList(PartnerInfo partnerInfo); + + /** + * 新增供应商管理 + * + * @param partnerInfo 供应商管理 + * @return 结果 + */ + public int insertPartnerInfo(PartnerInfo partnerInfo); + + /** + * 修改供应商管理 + * + * @param partnerInfo 供应商管理 + * @return 结果 + */ + public int updatePartnerInfo(PartnerInfo partnerInfo); + + /** + * 删除供应商管理 + * + * @param id 供应商管理主键 + * @return 结果 + */ + public int deletePartnerInfoById(Long id); + + /** + * 批量删除供应商管理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deletePartnerInfoByIds(String[] ids); +} diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IPartnerInfoService.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IPartnerInfoService.java new file mode 100644 index 00000000..a45825ff --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IPartnerInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.sip.service; + +import java.util.List; +import com.ruoyi.sip.domain.PartnerInfo; + +/** + * 供应商管理Service接口 + * + * @author mula + * @date 2025-04-30 + */ +public interface IPartnerInfoService +{ + /** + * 查询供应商管理 + * + * @param id 供应商管理主键 + * @return 供应商管理 + */ + public PartnerInfo selectPartnerInfoById(Long id); + + /** + * 查询供应商管理列表 + * + * @param partnerInfo 供应商管理 + * @return 供应商管理集合 + */ + public List selectPartnerInfoList(PartnerInfo partnerInfo); + + /** + * 新增供应商管理 + * + * @param partnerInfo 供应商管理 + * @return 结果 + */ + public int insertPartnerInfo(PartnerInfo partnerInfo); + + /** + * 修改供应商管理 + * + * @param partnerInfo 供应商管理 + * @return 结果 + */ + public int updatePartnerInfo(PartnerInfo partnerInfo); + + /** + * 批量删除供应商管理 + * + * @param ids 需要删除的供应商管理主键集合 + * @return 结果 + */ + public int deletePartnerInfoByIds(String ids); + + /** + * 删除供应商管理信息 + * + * @param id 供应商管理主键 + * @return 结果 + */ + public int deletePartnerInfoById(Long id); +} diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/PartnerInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/PartnerInfoServiceImpl.java new file mode 100644 index 00000000..91ca4b2f --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/PartnerInfoServiceImpl.java @@ -0,0 +1,94 @@ +package com.ruoyi.sip.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.sip.mapper.PartnerInfoMapper; +import com.ruoyi.sip.domain.PartnerInfo; +import com.ruoyi.sip.service.IPartnerInfoService; +import com.ruoyi.common.core.text.Convert; + +/** + * 供应商管理Service业务层处理 + * + * @author mula + * @date 2025-04-30 + */ +@Service +public class PartnerInfoServiceImpl implements IPartnerInfoService +{ + @Autowired + private PartnerInfoMapper partnerInfoMapper; + + /** + * 查询供应商管理 + * + * @param id 供应商管理主键 + * @return 供应商管理 + */ + @Override + public PartnerInfo selectPartnerInfoById(Long id) + { + return partnerInfoMapper.selectPartnerInfoById(id); + } + + /** + * 查询供应商管理列表 + * + * @param partnerInfo 供应商管理 + * @return 供应商管理 + */ + @Override + public List selectPartnerInfoList(PartnerInfo partnerInfo) + { + return partnerInfoMapper.selectPartnerInfoList(partnerInfo); + } + + /** + * 新增供应商管理 + * + * @param partnerInfo 供应商管理 + * @return 结果 + */ + @Override + public int insertPartnerInfo(PartnerInfo partnerInfo) + { + return partnerInfoMapper.insertPartnerInfo(partnerInfo); + } + + /** + * 修改供应商管理 + * + * @param partnerInfo 供应商管理 + * @return 结果 + */ + @Override + public int updatePartnerInfo(PartnerInfo partnerInfo) + { + return partnerInfoMapper.updatePartnerInfo(partnerInfo); + } + + /** + * 批量删除供应商管理 + * + * @param ids 需要删除的供应商管理主键 + * @return 结果 + */ + @Override + public int deletePartnerInfoByIds(String ids) + { + return partnerInfoMapper.deletePartnerInfoByIds(Convert.toStrArray(ids)); + } + + /** + * 删除供应商管理信息 + * + * @param id 供应商管理主键 + * @return 结果 + */ + @Override + public int deletePartnerInfoById(Long id) + { + return partnerInfoMapper.deletePartnerInfoById(id); + } +} diff --git a/ruoyi-sip/src/main/resources/mapper/system/PartnerInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/system/PartnerInfoMapper.xml new file mode 100644 index 00000000..1b5c2d3a --- /dev/null +++ b/ruoyi-sip/src/main/resources/mapper/system/PartnerInfoMapper.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + select id, partner_code, partner_name, province, city, address, contact_person, contact_phone, level, create_at, update_at, delete_at, status from partner_info + + + + + + + + insert into partner_info + + partner_code, + partner_name, + province, + city, + address, + contact_person, + contact_phone, + level, + create_at, + update_at, + delete_at, + status, + + + #{partnerCode}, + #{partnerName}, + #{province}, + #{city}, + #{address}, + #{contactPerson}, + #{contactPhone}, + #{level}, + #{createAt}, + #{updateAt}, + #{deleteAt}, + #{status}, + + + + + update partner_info + + partner_code = #{partnerCode}, + partner_name = #{partnerName}, + province = #{province}, + city = #{city}, + address = #{address}, + contact_person = #{contactPerson}, + contact_phone = #{contactPhone}, + level = #{level}, + create_at = #{createAt}, + update_at = #{updateAt}, + delete_at = #{deleteAt}, + status = #{status}, + + where id = #{id} + + + + delete from partner_info where id = #{id} + + + + delete from partner_info where id in + + #{id} + + + + \ No newline at end of file