diff --git a/ruoyi-admin/src/main/resources/templates/manage/service/service.html b/ruoyi-admin/src/main/resources/templates/manage/service/service.html index c5f6b103..db42353f 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/service/service.html +++ b/ruoyi-admin/src/main/resources/templates/manage/service/service.html @@ -163,15 +163,10 @@ + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/agent/agent.html b/ruoyi-admin/src/main/resources/templates/system/agent/agent.html new file mode 100644 index 00000000..3287167f --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/agent/agent.html @@ -0,0 +1,106 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/agent/edit.html b/ruoyi-admin/src/main/resources/templates/system/agent/edit.html new file mode 100644 index 00000000..bbf13d81 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/agent/edit.html @@ -0,0 +1,98 @@ + + + + + + +
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/AgentInfoController.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/AgentInfoController.java new file mode 100644 index 00000000..972ef35e --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/AgentInfoController.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.AgentInfo; +import com.ruoyi.sip.service.IAgentInfoService; +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-05-13 + */ +@Controller +@RequestMapping("/system/agent") +public class AgentInfoController extends BaseController +{ + private String prefix = "system/agent"; + + @Autowired + private IAgentInfoService agentInfoService; + + @RequiresPermissions("system:agent:view") + @GetMapping() + public String agent() + { + return prefix + "/agent"; + } + + /** + * 查询办事处信息列表 + */ + @RequiresPermissions("system:agent:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(AgentInfo agentInfo) + { + startPage(); + List list = agentInfoService.selectAgentInfoList(agentInfo); + return getDataTable(list); + } + + /** + * 导出办事处信息列表 + */ + @RequiresPermissions("system:agent:export") + @Log(title = "办事处信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(AgentInfo agentInfo) + { + List list = agentInfoService.selectAgentInfoList(agentInfo); + ExcelUtil util = new ExcelUtil(AgentInfo.class); + return util.exportExcel(list, "办事处信息数据"); + } + + /** + * 新增办事处信息 + */ + @RequiresPermissions("system:agent:add") + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存办事处信息 + */ + @RequiresPermissions("system:agent:add") + @Log(title = "办事处信息", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(AgentInfo agentInfo) + { + return toAjax(agentInfoService.insertAgentInfo(agentInfo)); + } + + /** + * 修改办事处信息 + */ + @RequiresPermissions("system:agent:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + AgentInfo agentInfo = agentInfoService.selectAgentInfoById(id); + mmap.put("agentInfo", agentInfo); + return prefix + "/edit"; + } + + /** + * 修改保存办事处信息 + */ + @RequiresPermissions("system:agent:edit") + @Log(title = "办事处信息", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(AgentInfo agentInfo) + { + return toAjax(agentInfoService.updateAgentInfo(agentInfo)); + } + + /** + * 删除办事处信息 + */ + @RequiresPermissions("system:agent:remove") + @Log(title = "办事处信息", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(agentInfoService.deleteAgentInfoByIds(ids)); + } +} diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/AgentInfo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/AgentInfo.java new file mode 100644 index 00000000..8e167953 --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/AgentInfo.java @@ -0,0 +1,214 @@ +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; + +/** + * 办事处信息对象 agent_info + * + * @author mula + * @date 2025-05-13 + */ +public class AgentInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键,自增 */ + private Long id; + + /** 办事处编码 */ + @Excel(name = "办事处编码") + private String agentCode; + + /** 办公处名称 */ + @Excel(name = "办公处名称") + private String agentName; + + /** 所在省 */ + @Excel(name = "所在省") + private String province; + + /** 所在市 */ + @Excel(name = "所在市") + private String city; + + /** 详细地址 */ + private String address; + + /** 联系人 */ + private String contactPerson; + + /** 联系电话 */ + private String contactPhone; + + /** 联系邮件 */ + private String contactEmail; + + /** 创建时间 */ + @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 setAgentCode(String agentCode) + { + this.agentCode = agentCode; + } + + public String getAgentCode() + { + return agentCode; + } + + public void setAgentName(String agentName) + { + this.agentName = agentName; + } + + public String getAgentName() + { + return agentName; + } + + 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 setContactEmail(String contactEmail) + { + this.contactEmail = contactEmail; + } + + public String getContactEmail() + { + return contactEmail; + } + + 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("agentCode", getAgentCode()) + .append("agentName", getAgentName()) + .append("province", getProvince()) + .append("city", getCity()) + .append("address", getAddress()) + .append("contactPerson", getContactPerson()) + .append("contactPhone", getContactPhone()) + .append("contactEmail", getContactEmail()) + .append("remark", getRemark()) + .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/AgentInfoMapper.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/AgentInfoMapper.java new file mode 100644 index 00000000..ba143dfa --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/AgentInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.sip.mapper; + +import java.util.List; +import com.ruoyi.sip.domain.AgentInfo; + +/** + * 办事处信息Mapper接口 + * + * @author mula + * @date 2025-05-13 + */ +public interface AgentInfoMapper +{ + /** + * 查询办事处信息 + * + * @param id 办事处信息主键 + * @return 办事处信息 + */ + public AgentInfo selectAgentInfoById(Long id); + + /** + * 查询办事处信息列表 + * + * @param agentInfo 办事处信息 + * @return 办事处信息集合 + */ + public List selectAgentInfoList(AgentInfo agentInfo); + + /** + * 新增办事处信息 + * + * @param agentInfo 办事处信息 + * @return 结果 + */ + public int insertAgentInfo(AgentInfo agentInfo); + + /** + * 修改办事处信息 + * + * @param agentInfo 办事处信息 + * @return 结果 + */ + public int updateAgentInfo(AgentInfo agentInfo); + + /** + * 删除办事处信息 + * + * @param id 办事处信息主键 + * @return 结果 + */ + public int deleteAgentInfoById(Long id); + + /** + * 批量删除办事处信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteAgentInfoByIds(String[] ids); +} diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IAgentInfoService.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IAgentInfoService.java new file mode 100644 index 00000000..871c1be0 --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IAgentInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.sip.service; + +import java.util.List; +import com.ruoyi.sip.domain.AgentInfo; + +/** + * 办事处信息Service接口 + * + * @author mula + * @date 2025-05-13 + */ +public interface IAgentInfoService +{ + /** + * 查询办事处信息 + * + * @param id 办事处信息主键 + * @return 办事处信息 + */ + public AgentInfo selectAgentInfoById(Long id); + + /** + * 查询办事处信息列表 + * + * @param agentInfo 办事处信息 + * @return 办事处信息集合 + */ + public List selectAgentInfoList(AgentInfo agentInfo); + + /** + * 新增办事处信息 + * + * @param agentInfo 办事处信息 + * @return 结果 + */ + public int insertAgentInfo(AgentInfo agentInfo); + + /** + * 修改办事处信息 + * + * @param agentInfo 办事处信息 + * @return 结果 + */ + public int updateAgentInfo(AgentInfo agentInfo); + + /** + * 批量删除办事处信息 + * + * @param ids 需要删除的办事处信息主键集合 + * @return 结果 + */ + public int deleteAgentInfoByIds(String ids); + + /** + * 删除办事处信息信息 + * + * @param id 办事处信息主键 + * @return 结果 + */ + public int deleteAgentInfoById(Long id); +} diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/AgentInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/AgentInfoServiceImpl.java new file mode 100644 index 00000000..d35a70e0 --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/AgentInfoServiceImpl.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.AgentInfoMapper; +import com.ruoyi.sip.domain.AgentInfo; +import com.ruoyi.sip.service.IAgentInfoService; +import com.ruoyi.common.core.text.Convert; + +/** + * 办事处信息Service业务层处理 + * + * @author mula + * @date 2025-05-13 + */ +@Service +public class AgentInfoServiceImpl implements IAgentInfoService +{ + @Autowired + private AgentInfoMapper agentInfoMapper; + + /** + * 查询办事处信息 + * + * @param id 办事处信息主键 + * @return 办事处信息 + */ + @Override + public AgentInfo selectAgentInfoById(Long id) + { + return agentInfoMapper.selectAgentInfoById(id); + } + + /** + * 查询办事处信息列表 + * + * @param agentInfo 办事处信息 + * @return 办事处信息 + */ + @Override + public List selectAgentInfoList(AgentInfo agentInfo) + { + return agentInfoMapper.selectAgentInfoList(agentInfo); + } + + /** + * 新增办事处信息 + * + * @param agentInfo 办事处信息 + * @return 结果 + */ + @Override + public int insertAgentInfo(AgentInfo agentInfo) + { + return agentInfoMapper.insertAgentInfo(agentInfo); + } + + /** + * 修改办事处信息 + * + * @param agentInfo 办事处信息 + * @return 结果 + */ + @Override + public int updateAgentInfo(AgentInfo agentInfo) + { + return agentInfoMapper.updateAgentInfo(agentInfo); + } + + /** + * 批量删除办事处信息 + * + * @param ids 需要删除的办事处信息主键 + * @return 结果 + */ + @Override + public int deleteAgentInfoByIds(String ids) + { + return agentInfoMapper.deleteAgentInfoByIds(Convert.toStrArray(ids)); + } + + /** + * 删除办事处信息信息 + * + * @param id 办事处信息主键 + * @return 结果 + */ + @Override + public int deleteAgentInfoById(Long id) + { + return agentInfoMapper.deleteAgentInfoById(id); + } +} diff --git a/ruoyi-sip/src/main/resources/mapper/system/AgentInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/system/AgentInfoMapper.xml new file mode 100644 index 00000000..e8368b46 --- /dev/null +++ b/ruoyi-sip/src/main/resources/mapper/system/AgentInfoMapper.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, agent_code, agent_name, province, city, address, contact_person, contact_phone, contact_email, remark, create_at, update_at, delete_at, status from agent_info + + + + + + + + insert into agent_info + + agent_code, + agent_name, + province, + city, + address, + contact_person, + contact_phone, + contact_email, + remark, + create_at, + update_at, + delete_at, + status, + + + #{agentCode}, + #{agentName}, + #{province}, + #{city}, + #{address}, + #{contactPerson}, + #{contactPhone}, + #{contactEmail}, + #{remark}, + #{createAt}, + #{updateAt}, + #{deleteAt}, + #{status}, + + + + + update agent_info + + agent_code = #{agentCode}, + agent_name = #{agentName}, + province = #{province}, + city = #{city}, + address = #{address}, + contact_person = #{contactPerson}, + contact_phone = #{contactPhone}, + contact_email = #{contactEmail}, + remark = #{remark}, + create_at = #{createAt}, + update_at = #{updateAt}, + delete_at = #{deleteAt}, + status = #{status}, + + where id = #{id} + + + + delete from agent_info where id = #{id} + + + + delete from agent_info where id in + + #{id} + + + + \ No newline at end of file