diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/controller/BusiCustomerCompanyController.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/controller/BusiCustomerCompanyController.java new file mode 100644 index 000000000..e33093e77 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/controller/BusiCustomerCompanyController.java @@ -0,0 +1,164 @@ +package com.ruoyi.busi.controller; + +import java.util.ArrayList; +import java.util.List; + +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.domain.Ztree; +import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.utils.StringUtils; +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.busi.domain.BusiCustomerCompany; +import com.ruoyi.busi.service.IBusiCustomerCompanyService; +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 WangCL + * @date 2021-12-16 + */ +@Controller +@RequestMapping("/busi/company") +public class BusiCustomerCompanyController extends BaseController { + private String prefix = "busi/company"; + + @Autowired + private IBusiCustomerCompanyService busiCustomerCompanyService; + + @RequiresPermissions("busi:company:view") + @GetMapping() + public String company() { + return prefix + "/company"; + } + + /** + * 查询客户公司列表 + */ + @RequiresPermissions("busi:company:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(BusiCustomerCompany busiCustomerCompany) { + startPage(); + List list = busiCustomerCompanyService.selectBusiCustomerCompanyList(busiCustomerCompany); + return getDataTable(list); + } + + /** + * 导出客户公司列表 + */ + @RequiresPermissions("busi:company:export") + @Log(title = "客户公司", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BusiCustomerCompany busiCustomerCompany) { + List list = busiCustomerCompanyService.selectBusiCustomerCompanyList(busiCustomerCompany); + ExcelUtil util = new ExcelUtil(BusiCustomerCompany.class); + return util.exportExcel(list, "客户公司数据"); + } + + /** + * 新增客户公司 + */ + @GetMapping("/add") + public String add() { + return prefix + "/add"; + } + + /** + * 新增保存客户公司 + */ + @RequiresPermissions("busi:company:add") + @Log(title = "客户公司", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(BusiCustomerCompany busiCustomerCompany) { + return toAjax(busiCustomerCompanyService.insertBusiCustomerCompany(busiCustomerCompany)); + } + + /** + * 修改客户公司 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") String id, ModelMap mmap) { + BusiCustomerCompany busiCustomerCompany = busiCustomerCompanyService.selectBusiCustomerCompanyById(id); + mmap.put("busiCustomerCompany", busiCustomerCompany); + return prefix + "/edit"; + } + + /** + * 修改保存客户公司 + */ + @RequiresPermissions("busi:company:edit") + @Log(title = "客户公司", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BusiCustomerCompany busiCustomerCompany) { + return toAjax(busiCustomerCompanyService.updateBusiCustomerCompany(busiCustomerCompany)); + } + + /** + * 删除客户公司 + */ + @RequiresPermissions("busi:company:remove") + @Log(title = "客户公司", businessType = BusinessType.DELETE) + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) { + return toAjax(busiCustomerCompanyService.deleteBusiCustomerCompanyByIds(ids)); + } + + /** + * @param mmap + * @return + */ + @GetMapping(value = {"/selectCompany"}) + public String selectCompany(ModelMap mmap) { + BusiCustomerCompany com = new BusiCustomerCompany(); + com.setId("0"); + com.setCoName("根节点"); + mmap.put("company", com); + return prefix + "/tree"; + } + + /** + * 加载客户公司树列表 + */ + @GetMapping("/treeData") + @ResponseBody + public List treeData() { + List list = busiCustomerCompanyService.selectBusiCustomerCompanyList(new BusiCustomerCompany()); + return initZtree(list); + } + + /** + * 初始化树列表 + * @param list + * @return + */ + public List initZtree(List list) { + List ztrees = new ArrayList(); + for (BusiCustomerCompany comp : list) { + Ztree ztree = new Ztree(); + ztree.setId(Long.valueOf(comp.getId())); + ztree.setpId(0l); + ztree.setName(comp.getCoName()); + ztree.setTitle(comp.getCoName()); + ztrees.add(ztree); + } + return ztrees; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/controller/BusiCustomerPersonController.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/controller/BusiCustomerPersonController.java new file mode 100644 index 000000000..ed7b8b0b2 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/controller/BusiCustomerPersonController.java @@ -0,0 +1,126 @@ +package com.ruoyi.busi.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.busi.domain.BusiCustomerPerson; +import com.ruoyi.busi.service.IBusiCustomerPersonService; +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 WangCL + * @date 2021-12-16 + */ +@Controller +@RequestMapping("/busi/person") +public class BusiCustomerPersonController extends BaseController +{ + private String prefix = "busi/person"; + + @Autowired + private IBusiCustomerPersonService busiCustomerPersonService; + + @RequiresPermissions("busi:person:view") + @GetMapping() + public String person() + { + return prefix + "/person"; + } + + /** + * 查询客户公司人员列表 + */ + @RequiresPermissions("busi:person:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(BusiCustomerPerson busiCustomerPerson) + { + startPage(); + List list = busiCustomerPersonService.selectBusiCustomerPersonList(busiCustomerPerson); + return getDataTable(list); + } + + /** + * 导出客户公司人员列表 + */ + @RequiresPermissions("busi:person:export") + @Log(title = "客户公司人员", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BusiCustomerPerson busiCustomerPerson) + { + List list = busiCustomerPersonService.selectBusiCustomerPersonList(busiCustomerPerson); + ExcelUtil util = new ExcelUtil(BusiCustomerPerson.class); + return util.exportExcel(list, "客户公司人员数据"); + } + + /** + * 新增客户公司人员 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存客户公司人员 + */ + @RequiresPermissions("busi:person:add") + @Log(title = "客户公司人员", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(BusiCustomerPerson busiCustomerPerson) + { + return toAjax(busiCustomerPersonService.insertBusiCustomerPerson(busiCustomerPerson)); + } + + /** + * 修改客户公司人员 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") String id, ModelMap mmap) + { + BusiCustomerPerson busiCustomerPerson = busiCustomerPersonService.selectBusiCustomerPersonById(id); + mmap.put("busiCustomerPerson", busiCustomerPerson); + return prefix + "/edit"; + } + + /** + * 修改保存客户公司人员 + */ + @RequiresPermissions("busi:person:edit") + @Log(title = "客户公司人员", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BusiCustomerPerson busiCustomerPerson) + { + return toAjax(busiCustomerPersonService.updateBusiCustomerPerson(busiCustomerPerson)); + } + + /** + * 删除客户公司人员 + */ + @RequiresPermissions("busi:person:remove") + @Log(title = "客户公司人员", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(busiCustomerPersonService.deleteBusiCustomerPersonByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/domain/BusiCustomerCompany.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/domain/BusiCustomerCompany.java new file mode 100644 index 000000000..f424afb13 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/domain/BusiCustomerCompany.java @@ -0,0 +1,112 @@ +package com.ruoyi.busi.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; + +/** + * 客户公司对象 busi_customer_company + * + * @author WangCL + * @date 2021-12-16 + */ +public class BusiCustomerCompany extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** ID */ + private String id; + + /** 公司名称 */ + @Excel(name = "公司名称") + private String coName; + + /** 公司地址 */ + @Excel(name = "公司地址") + private String addr; + + /** 对公账号 */ + @Excel(name = "对公账号") + private String account; + + /** 纳税号 */ + @Excel(name = "纳税号") + private String taxNumber; + + /** 客户公司人员信息 */ + private List busiCustomerPersonList; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + public void setCoName(String coName) + { + this.coName = coName; + } + + public String getCoName() + { + return coName; + } + public void setAddr(String addr) + { + this.addr = addr; + } + + public String getAddr() + { + return addr; + } + public void setAccount(String account) + { + this.account = account; + } + + public String getAccount() + { + return account; + } + public void setTaxNumber(String taxNumber) + { + this.taxNumber = taxNumber; + } + + public String getTaxNumber() + { + return taxNumber; + } + + public List getBusiCustomerPersonList() + { + return busiCustomerPersonList; + } + + public void setBusiCustomerPersonList(List busiCustomerPersonList) + { + this.busiCustomerPersonList = busiCustomerPersonList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("coName", getCoName()) + .append("addr", getAddr()) + .append("account", getAccount()) + .append("taxNumber", getTaxNumber()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("busiCustomerPersonList", getBusiCustomerPersonList()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/domain/BusiCustomerPerson.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/domain/BusiCustomerPerson.java new file mode 100644 index 000000000..2951ed7c4 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/domain/BusiCustomerPerson.java @@ -0,0 +1,138 @@ +package com.ruoyi.busi.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; + +/** + * 客户公司人员对象 busi_customer_person + * + * @author WangCL + * @date 2021-12-16 + */ +public class BusiCustomerPerson extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** ID主键 */ + private String id; + + /** 所属公司 */ +// @Excel(name = "所属公司") + private String companyId; + + /** 所属公司 */ + @Excel(name = "所属公司") + private String companyName; + + /** 姓名 */ + @Excel(name = "姓名") + private String personName; + + /** 性别 */ + @Excel(name = "性别") + private String sex; + + /** 手机号码 */ + @Excel(name = "手机号码") + private String phonenumber; + + /** 人员邮箱 */ + @Excel(name = "人员邮箱") + private String email; + + /** 角色 */ + @Excel(name = "角色") + private String role; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + public void setCompanyId(String companyId) + { + this.companyId = companyId; + } + + public String getCompanyId() + { + return companyId; + } + public void setPersonName(String personName) + { + this.personName = personName; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getPersonName() + { + return personName; + } + public void setSex(String sex) + { + this.sex = sex; + } + + public String getSex() + { + return sex; + } + public void setPhonenumber(String phonenumber) + { + this.phonenumber = phonenumber; + } + + public String getPhonenumber() + { + return phonenumber; + } + public void setEmail(String email) + { + this.email = email; + } + + public String getEmail() + { + return email; + } + public void setRole(String role) + { + this.role = role; + } + + public String getRole() + { + return role; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("companyId", getCompanyId()) + .append("companyName", getCompanyName()) + .append("personName", getPersonName()) + .append("sex", getSex()) + .append("phonenumber", getPhonenumber()) + .append("email", getEmail()) + .append("role", getRole()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/mapper/BusiCustomerCompanyMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/mapper/BusiCustomerCompanyMapper.java new file mode 100644 index 000000000..52479f3fe --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/mapper/BusiCustomerCompanyMapper.java @@ -0,0 +1,87 @@ +package com.ruoyi.busi.mapper; + +import java.util.List; +import com.ruoyi.busi.domain.BusiCustomerCompany; +import com.ruoyi.busi.domain.BusiCustomerPerson; + +/** + * 客户公司Mapper接口 + * + * @author WangCL + * @date 2021-12-16 + */ +public interface BusiCustomerCompanyMapper +{ + /** + * 查询客户公司 + * + * @param id 客户公司主键 + * @return 客户公司 + */ + public BusiCustomerCompany selectBusiCustomerCompanyById(String id); + + /** + * 查询客户公司列表 + * + * @param busiCustomerCompany 客户公司 + * @return 客户公司集合 + */ + public List selectBusiCustomerCompanyList(BusiCustomerCompany busiCustomerCompany); + + /** + * 新增客户公司 + * + * @param busiCustomerCompany 客户公司 + * @return 结果 + */ + public int insertBusiCustomerCompany(BusiCustomerCompany busiCustomerCompany); + + /** + * 修改客户公司 + * + * @param busiCustomerCompany 客户公司 + * @return 结果 + */ + public int updateBusiCustomerCompany(BusiCustomerCompany busiCustomerCompany); + + /** + * 删除客户公司 + * + * @param id 客户公司主键 + * @return 结果 + */ + public int deleteBusiCustomerCompanyById(String id); + + /** + * 批量删除客户公司 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBusiCustomerCompanyByIds(String[] ids); + + /** + * 批量删除客户公司人员 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBusiCustomerPersonByCompanyIds(String[] ids); + + /** + * 批量新增客户公司人员 + * + * @param busiCustomerPersonList 客户公司人员列表 + * @return 结果 + */ + public int batchBusiCustomerPerson(List busiCustomerPersonList); + + + /** + * 通过客户公司主键删除客户公司人员信息 + * + * @param id 客户公司ID + * @return 结果 + */ + public int deleteBusiCustomerPersonByCompanyId(String id); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/mapper/BusiCustomerPersonMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/mapper/BusiCustomerPersonMapper.java new file mode 100644 index 000000000..388bc703c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/mapper/BusiCustomerPersonMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.busi.mapper; + +import java.util.List; +import com.ruoyi.busi.domain.BusiCustomerPerson; + +/** + * 客户公司人员Mapper接口 + * + * @author WangCL + * @date 2021-12-16 + */ +public interface BusiCustomerPersonMapper +{ + /** + * 查询客户公司人员 + * + * @param id 客户公司人员主键 + * @return 客户公司人员 + */ + public BusiCustomerPerson selectBusiCustomerPersonById(String id); + + /** + * 查询客户公司人员列表 + * + * @param busiCustomerPerson 客户公司人员 + * @return 客户公司人员集合 + */ + public List selectBusiCustomerPersonList(BusiCustomerPerson busiCustomerPerson); + + /** + * 新增客户公司人员 + * + * @param busiCustomerPerson 客户公司人员 + * @return 结果 + */ + public int insertBusiCustomerPerson(BusiCustomerPerson busiCustomerPerson); + + /** + * 修改客户公司人员 + * + * @param busiCustomerPerson 客户公司人员 + * @return 结果 + */ + public int updateBusiCustomerPerson(BusiCustomerPerson busiCustomerPerson); + + /** + * 删除客户公司人员 + * + * @param id 客户公司人员主键 + * @return 结果 + */ + public int deleteBusiCustomerPersonById(String id); + + /** + * 批量删除客户公司人员 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBusiCustomerPersonByIds(String[] ids); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiCustomerCompanyService.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiCustomerCompanyService.java new file mode 100644 index 000000000..19e8b3a0f --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiCustomerCompanyService.java @@ -0,0 +1,61 @@ +package com.ruoyi.busi.service; + +import java.util.List; +import com.ruoyi.busi.domain.BusiCustomerCompany; + +/** + * 客户公司Service接口 + * + * @author WangCL + * @date 2021-12-16 + */ +public interface IBusiCustomerCompanyService +{ + /** + * 查询客户公司 + * + * @param id 客户公司主键 + * @return 客户公司 + */ + public BusiCustomerCompany selectBusiCustomerCompanyById(String id); + + /** + * 查询客户公司列表 + * + * @param busiCustomerCompany 客户公司 + * @return 客户公司集合 + */ + public List selectBusiCustomerCompanyList(BusiCustomerCompany busiCustomerCompany); + + /** + * 新增客户公司 + * + * @param busiCustomerCompany 客户公司 + * @return 结果 + */ + public int insertBusiCustomerCompany(BusiCustomerCompany busiCustomerCompany); + + /** + * 修改客户公司 + * + * @param busiCustomerCompany 客户公司 + * @return 结果 + */ + public int updateBusiCustomerCompany(BusiCustomerCompany busiCustomerCompany); + + /** + * 批量删除客户公司 + * + * @param ids 需要删除的客户公司主键集合 + * @return 结果 + */ + public int deleteBusiCustomerCompanyByIds(String ids); + + /** + * 删除客户公司信息 + * + * @param id 客户公司主键 + * @return 结果 + */ + public int deleteBusiCustomerCompanyById(String id); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiCustomerPersonService.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiCustomerPersonService.java new file mode 100644 index 000000000..7f3737c44 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiCustomerPersonService.java @@ -0,0 +1,61 @@ +package com.ruoyi.busi.service; + +import java.util.List; +import com.ruoyi.busi.domain.BusiCustomerPerson; + +/** + * 客户公司人员Service接口 + * + * @author WangCL + * @date 2021-12-16 + */ +public interface IBusiCustomerPersonService +{ + /** + * 查询客户公司人员 + * + * @param id 客户公司人员主键 + * @return 客户公司人员 + */ + public BusiCustomerPerson selectBusiCustomerPersonById(String id); + + /** + * 查询客户公司人员列表 + * + * @param busiCustomerPerson 客户公司人员 + * @return 客户公司人员集合 + */ + public List selectBusiCustomerPersonList(BusiCustomerPerson busiCustomerPerson); + + /** + * 新增客户公司人员 + * + * @param busiCustomerPerson 客户公司人员 + * @return 结果 + */ + public int insertBusiCustomerPerson(BusiCustomerPerson busiCustomerPerson); + + /** + * 修改客户公司人员 + * + * @param busiCustomerPerson 客户公司人员 + * @return 结果 + */ + public int updateBusiCustomerPerson(BusiCustomerPerson busiCustomerPerson); + + /** + * 批量删除客户公司人员 + * + * @param ids 需要删除的客户公司人员主键集合 + * @return 结果 + */ + public int deleteBusiCustomerPersonByIds(String ids); + + /** + * 删除客户公司人员信息 + * + * @param id 客户公司人员主键 + * @return 结果 + */ + public int deleteBusiCustomerPersonById(String id); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiCustomerCompanyServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiCustomerCompanyServiceImpl.java new file mode 100644 index 000000000..0653e0538 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiCustomerCompanyServiceImpl.java @@ -0,0 +1,134 @@ +package com.ruoyi.busi.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 java.util.ArrayList; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.busi.domain.BusiCustomerPerson; +import com.ruoyi.busi.mapper.BusiCustomerCompanyMapper; +import com.ruoyi.busi.domain.BusiCustomerCompany; +import com.ruoyi.busi.service.IBusiCustomerCompanyService; +import com.ruoyi.common.core.text.Convert; + +/** + * 客户公司Service业务层处理 + * + * @author WangCL + * @date 2021-12-16 + */ +@Service +public class BusiCustomerCompanyServiceImpl implements IBusiCustomerCompanyService +{ + @Autowired + private BusiCustomerCompanyMapper busiCustomerCompanyMapper; + + /** + * 查询客户公司 + * + * @param id 客户公司主键 + * @return 客户公司 + */ + @Override + public BusiCustomerCompany selectBusiCustomerCompanyById(String id) + { + return busiCustomerCompanyMapper.selectBusiCustomerCompanyById(id); + } + + /** + * 查询客户公司列表 + * + * @param busiCustomerCompany 客户公司 + * @return 客户公司 + */ + @Override + public List selectBusiCustomerCompanyList(BusiCustomerCompany busiCustomerCompany) + { + return busiCustomerCompanyMapper.selectBusiCustomerCompanyList(busiCustomerCompany); + } + + /** + * 新增客户公司 + * + * @param busiCustomerCompany 客户公司 + * @return 结果 + */ + @Transactional + @Override + public int insertBusiCustomerCompany(BusiCustomerCompany busiCustomerCompany) + { + busiCustomerCompany.setCreateTime(DateUtils.getNowDate()); + int rows = busiCustomerCompanyMapper.insertBusiCustomerCompany(busiCustomerCompany); + insertBusiCustomerPerson(busiCustomerCompany); + return rows; + } + + /** + * 修改客户公司 + * + * @param busiCustomerCompany 客户公司 + * @return 结果 + */ + @Transactional + @Override + public int updateBusiCustomerCompany(BusiCustomerCompany busiCustomerCompany) + { + busiCustomerCompany.setUpdateTime(DateUtils.getNowDate()); + busiCustomerCompanyMapper.deleteBusiCustomerPersonByCompanyId(busiCustomerCompany.getId()); + insertBusiCustomerPerson(busiCustomerCompany); + return busiCustomerCompanyMapper.updateBusiCustomerCompany(busiCustomerCompany); + } + + /** + * 批量删除客户公司 + * + * @param ids 需要删除的客户公司主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteBusiCustomerCompanyByIds(String ids) + { + busiCustomerCompanyMapper.deleteBusiCustomerPersonByCompanyIds(Convert.toStrArray(ids)); + return busiCustomerCompanyMapper.deleteBusiCustomerCompanyByIds(Convert.toStrArray(ids)); + } + + /** + * 删除客户公司信息 + * + * @param id 客户公司主键 + * @return 结果 + */ + @Override + public int deleteBusiCustomerCompanyById(String id) + { + busiCustomerCompanyMapper.deleteBusiCustomerPersonByCompanyId(id); + return busiCustomerCompanyMapper.deleteBusiCustomerCompanyById(id); + } + + /** + * 新增客户公司人员信息 + * + * @param busiCustomerCompany 客户公司对象 + */ + public void insertBusiCustomerPerson(BusiCustomerCompany busiCustomerCompany) + { + List busiCustomerPersonList = busiCustomerCompany.getBusiCustomerPersonList(); + String id = busiCustomerCompany.getId(); + if (StringUtils.isNotNull(busiCustomerPersonList)) + { + List list = new ArrayList(); + for (BusiCustomerPerson busiCustomerPerson : busiCustomerPersonList) + { + busiCustomerPerson.setCompanyId(id); + list.add(busiCustomerPerson); + } + if (list.size() > 0) + { + busiCustomerCompanyMapper.batchBusiCustomerPerson(list); + } + } + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiCustomerPersonServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiCustomerPersonServiceImpl.java new file mode 100644 index 000000000..0543f7ad9 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiCustomerPersonServiceImpl.java @@ -0,0 +1,97 @@ +package com.ruoyi.busi.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.busi.mapper.BusiCustomerPersonMapper; +import com.ruoyi.busi.domain.BusiCustomerPerson; +import com.ruoyi.busi.service.IBusiCustomerPersonService; +import com.ruoyi.common.core.text.Convert; + +/** + * 客户公司人员Service业务层处理 + * + * @author WangCL + * @date 2021-12-16 + */ +@Service +public class BusiCustomerPersonServiceImpl implements IBusiCustomerPersonService +{ + @Autowired + private BusiCustomerPersonMapper busiCustomerPersonMapper; + + /** + * 查询客户公司人员 + * + * @param id 客户公司人员主键 + * @return 客户公司人员 + */ + @Override + public BusiCustomerPerson selectBusiCustomerPersonById(String id) + { + return busiCustomerPersonMapper.selectBusiCustomerPersonById(id); + } + + /** + * 查询客户公司人员列表 + * + * @param busiCustomerPerson 客户公司人员 + * @return 客户公司人员 + */ + @Override + public List selectBusiCustomerPersonList(BusiCustomerPerson busiCustomerPerson) + { + return busiCustomerPersonMapper.selectBusiCustomerPersonList(busiCustomerPerson); + } + + /** + * 新增客户公司人员 + * + * @param busiCustomerPerson 客户公司人员 + * @return 结果 + */ + @Override + public int insertBusiCustomerPerson(BusiCustomerPerson busiCustomerPerson) + { + busiCustomerPerson.setCreateTime(DateUtils.getNowDate()); + return busiCustomerPersonMapper.insertBusiCustomerPerson(busiCustomerPerson); + } + + /** + * 修改客户公司人员 + * + * @param busiCustomerPerson 客户公司人员 + * @return 结果 + */ + @Override + public int updateBusiCustomerPerson(BusiCustomerPerson busiCustomerPerson) + { + busiCustomerPerson.setUpdateTime(DateUtils.getNowDate()); + return busiCustomerPersonMapper.updateBusiCustomerPerson(busiCustomerPerson); + } + + /** + * 批量删除客户公司人员 + * + * @param ids 需要删除的客户公司人员主键 + * @return 结果 + */ + @Override + public int deleteBusiCustomerPersonByIds(String ids) + { + return busiCustomerPersonMapper.deleteBusiCustomerPersonByIds(Convert.toStrArray(ids)); + } + + /** + * 删除客户公司人员信息 + * + * @param id 客户公司人员主键 + * @return 结果 + */ + @Override + public int deleteBusiCustomerPersonById(String id) + { + return busiCustomerPersonMapper.deleteBusiCustomerPersonById(id); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/busi/BusiCustomerCompanyMapper.xml b/ruoyi-admin/src/main/resources/mapper/busi/BusiCustomerCompanyMapper.xml new file mode 100644 index 000000000..29830bd1c --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/busi/BusiCustomerCompanyMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, co_name, addr, account, tax_number, create_by, create_time, update_by, update_time from busi_customer_company + + + + + + + + insert into busi_customer_company + + co_name, + addr, + account, + tax_number, + create_by, + create_time, + update_by, + update_time, + + + #{coName}, + #{addr}, + #{account}, + #{taxNumber}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update busi_customer_company + + co_name = #{coName}, + addr = #{addr}, + account = #{account}, + tax_number = #{taxNumber}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from busi_customer_company where id = #{id} + + + + delete from busi_customer_company where id in + + #{id} + + + + + delete from busi_customer_person where company_id in + + #{companyId} + + + + + delete from busi_customer_person where company_id = #{companyId} + + + + insert into busi_customer_person( id, company_id, person_name, sex, phonenumber, email, role, create_by, create_time, update_by, update_time) values + + ( #{item.id}, #{item.companyId}, #{item.personName}, #{item.sex}, #{item.phonenumber}, #{item.email}, #{item.role}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/busi/BusiCustomerPersonMapper.xml b/ruoyi-admin/src/main/resources/mapper/busi/BusiCustomerPersonMapper.xml new file mode 100644 index 000000000..129dcccb0 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/busi/BusiCustomerPersonMapper.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + select A.id, A.company_id, B.co_name company_name, A.person_name, A.sex, A.phonenumber, A.email, A.role, A.create_by, A.create_time, A.update_by, A.update_time + from busi_customer_person A LEFT JOIN busi_customer_company B on A.company_id = B.id + + + + + + + + insert into busi_customer_person + + company_id, + person_name, + sex, + phonenumber, + email, + role, + create_by, + create_time, + update_by, + update_time, + + + #{companyId}, + #{personName}, + #{sex}, + #{phonenumber}, + #{email}, + #{role}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update busi_customer_person + + company_id = #{companyId}, + person_name = #{personName}, + sex = #{sex}, + phonenumber = #{phonenumber}, + email = #{email}, + role = #{role}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from busi_customer_person where id = #{id} + + + + delete from busi_customer_person where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/busi/company/add.html b/ruoyi-admin/src/main/resources/templates/busi/company/add.html new file mode 100644 index 000000000..ac63ae785 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/busi/company/add.html @@ -0,0 +1,148 @@ + + + + + + +
+
+

客户公司信息

+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+

客户公司人员信息

+
+
+ + +
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/busi/company/company.html b/ruoyi-admin/src/main/resources/templates/busi/company/company.html new file mode 100644 index 000000000..077da2871 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/busi/company/company.html @@ -0,0 +1,110 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/busi/company/edit.html b/ruoyi-admin/src/main/resources/templates/busi/company/edit.html new file mode 100644 index 000000000..579b5cd44 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/busi/company/edit.html @@ -0,0 +1,150 @@ + + + + + + +
+
+

客户公司信息

+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+

客户公司人员信息

+
+
+ + +
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/busi/company/tree.html b/ruoyi-admin/src/main/resources/templates/busi/company/tree.html new file mode 100644 index 000000000..3de518292 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/busi/company/tree.html @@ -0,0 +1,50 @@ + + + + + + + + + + +
+ + +
+ +
+ 展开 / + 折叠 +
+
+
+ + + + + diff --git a/ruoyi-admin/src/main/resources/templates/busi/person/add.html b/ruoyi-admin/src/main/resources/templates/busi/person/add.html new file mode 100644 index 000000000..959f27da0 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/busi/person/add.html @@ -0,0 +1,83 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/busi/person/edit.html b/ruoyi-admin/src/main/resources/templates/busi/person/edit.html new file mode 100644 index 000000000..ccce59847 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/busi/person/edit.html @@ -0,0 +1,86 @@ + + + + + + +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/busi/person/person.html b/ruoyi-admin/src/main/resources/templates/busi/person/person.html new file mode 100644 index 000000000..f262ba654 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/busi/person/person.html @@ -0,0 +1,142 @@ + + + + + + +
+
+
+
+
+
    +
  • + + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/sql/busi_20211108.sql b/sql/busi_20211108.sql index e27ff6784..902a3ecdd 100644 --- a/sql/busi_20211108.sql +++ b/sql/busi_20211108.sql @@ -1,6 +1,8 @@ insert into sys_dict_type values(11, '尺码', 'busi_size', '0', 'admin', sysdate(), '', null, '尺码列表'); insert into sys_dict_type values(12, '颜色', 'busi_color', '0', 'admin', sysdate(), '', null, '颜色列表'); +insert into sys_dict_type values(13, '客户角色', 'busi_role', '0', 'admin', sysdate(), '', null, '客户角色列表'); +-- 尺码字典 insert into sys_dict_data values (30, 1, 'XXXXXS', '1', 'busi_size', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); insert into sys_dict_data values (31, 2, 'XXXXS', '2', 'busi_size', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); insert into sys_dict_data values (32, 3, 'XXXS', '3', 'busi_size', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); @@ -16,7 +18,7 @@ insert into sys_dict_data values (41, 12, 'XXXXL', '12', 'busi_size', '', '', 'N insert into sys_dict_data values (42, 13, 'XXXXXL', '13', 'busi_size', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); insert into sys_dict_data values (43, 14, 'XXXXXXL', '14', 'busi_size', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); insert into sys_dict_data values (44, 15, '通码', '15', 'busi_size', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); - +-- 颜色字典 insert into sys_dict_data values (45, 1, '白色', '1', 'busi_color', '', '', 'Y', '0', 'admin', sysdate(), '', null, ''); insert into sys_dict_data values (46, 2, '黑色', '2', 'busi_color', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); insert into sys_dict_data values (47, 3, '红色', '3', 'busi_color', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); @@ -32,8 +34,11 @@ insert into sys_dict_data values (56, 12, '默认', '12', 'busi_color', '', '', insert into sys_dict_data values (57, 13, '铁色', '13', 'busi_color', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); insert into sys_dict_data values (58, 14, '粉色', '14', 'busi_color', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); --- 一级菜单 +-- 客户角色字典 +insert into sys_dict_data values (59, 1, '负责人', '1', 'busi_role', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); +insert into sys_dict_data values (60, 2, '跟单人员', '2', 'busi_role', '', '', 'N', '0', 'admin', sysdate(), '', null, ''); +-- 一级菜单 insert into sys_menu values ('117', '生产信息', '0', '1', '#', '', 'M', '0', '1', '', 'fa fa-wrench', 'admin', sysdate(), '', null, '生产信息菜单'); insert into sys_menu values ('118', '物料信息', '0', '2', '#', '', 'M', '0', '1', '', 'fa fa-cubes', 'admin', sysdate(), '', null, '物料信息菜单'); insert into sys_menu values ('119', '订单信息', '0', '3', '#', '', 'M', '0', '1', '', 'fa fa-tasks', 'admin', sysdate(), '', null, '订单信息菜单'); @@ -53,7 +58,4 @@ insert into sys_menu values ('510', '衔接订单', '119', '3', '/monitor/operlo insert into sys_menu values ('511', '出货管理', '120', '1', '/monitor/operlog', '', 'C', '0', '1', 'monitor:operlog:view', 'fa fa-address-book', 'admin', sysdate(), '', null, '出货管理菜单'); insert into sys_menu values ('512', '交货管理', '120', '2', '/monitor/operlog', '', 'C', '0', '1', 'monitor:operlog:view', 'fa fa-address-book', 'admin', sysdate(), '', null, '交货管理菜单'); insert into sys_menu values ('513', '返修管理', '120', '3', '/monitor/operlog', '', 'C', '0', '1', 'monitor:operlog:view', 'fa fa-address-book', 'admin', sysdate(), '', null, '返修管理菜单'); -insert into sys_menu values ('514', '客户负责人信息', '121', '1', '/monitor/operlog', '', 'C', '0', '1', 'monitor:operlog:view', 'fa fa-address-book', 'admin', sysdate(), '', null, '客户负责人信息菜单'); -insert into sys_menu values ('515', '跟单人员信息', '121', '2', '/monitor/operlog', '', 'C', '0', '1', 'monitor:operlog:view', 'fa fa-address-book', 'admin', sysdate(), '', null, '跟单人员信息菜单'); -insert into sys_menu values ('516', '款号信息', '121', '3', '/monitor/operlog', '', 'C', '0', '1', 'monitor:operlog:view', 'fa fa-address-book', 'admin', sysdate(), '', null, '款号信息菜单'); insert into sys_menu values ('517', '客户税号', '122', '1', '/monitor/operlog', '', 'C', '0', '1', 'monitor:operlog:view', 'fa fa-address-book', 'admin', sysdate(), '', null, '客户税号菜单'); diff --git a/sql/tmp.sql b/sql/tmp.sql index 4fcfb08c9..b05f334b5 100644 --- a/sql/tmp.sql +++ b/sql/tmp.sql @@ -1 +1,47 @@ --- https://dbschema.com/download.html \ No newline at end of file +-- 菜单 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('客户公司人员管理', '121', '1', '/busi/person', 'C', '0', 'busi:person:view', '#', 'admin', sysdate(), '', null, '客户公司人员管理菜单'); + +-- 按钮父菜单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', 'busi:person:list', '#', 'admin', sysdate(), '', null, ''); + +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', 'busi:person:add', '#', 'admin', sysdate(), '', null, ''); + +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', 'busi:person:edit', '#', 'admin', sysdate(), '', null, ''); + +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', 'busi:person:remove', '#', 'admin', sysdate(), '', null, ''); + +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', 'busi:person:export', '#', 'admin', sysdate(), '', null, ''); + + + +-- 菜单 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('客户公司管理', '121', '1', '/busi/company', 'C', '0', 'busi:company:view', '#', 'admin', sysdate(), '', null, '客户公司管理菜单'); + +-- 按钮父菜单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', 'busi:company:list', '#', 'admin', sysdate(), '', null, ''); + +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', 'busi:company:add', '#', 'admin', sysdate(), '', null, ''); + +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', 'busi:company:edit', '#', 'admin', sysdate(), '', null, ''); + +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', 'busi:company:remove', '#', 'admin', sysdate(), '', null, ''); + +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', 'busi:company:export', '#', 'admin', sysdate(), '', null, '');