客户公司管理和客户人员管理模块初始化
This commit is contained in:
parent
f0da17ce46
commit
a357230460
|
|
@ -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<BusiCustomerCompany> 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<BusiCustomerCompany> list = busiCustomerCompanyService.selectBusiCustomerCompanyList(busiCustomerCompany);
|
||||
ExcelUtil<BusiCustomerCompany> util = new ExcelUtil<BusiCustomerCompany>(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<Ztree> treeData() {
|
||||
List<BusiCustomerCompany> list = busiCustomerCompanyService.selectBusiCustomerCompanyList(new BusiCustomerCompany());
|
||||
return initZtree(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化树列表
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
public List<Ztree> initZtree(List<BusiCustomerCompany> list) {
|
||||
List<Ztree> ztrees = new ArrayList<Ztree>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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<BusiCustomerPerson> 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<BusiCustomerPerson> list = busiCustomerPersonService.selectBusiCustomerPersonList(busiCustomerPerson);
|
||||
ExcelUtil<BusiCustomerPerson> util = new ExcelUtil<BusiCustomerPerson>(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));
|
||||
}
|
||||
}
|
||||
|
|
@ -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<BusiCustomerPerson> 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<BusiCustomerPerson> getBusiCustomerPersonList()
|
||||
{
|
||||
return busiCustomerPersonList;
|
||||
}
|
||||
|
||||
public void setBusiCustomerPersonList(List<BusiCustomerPerson> 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();
|
||||
}
|
||||
}
|
||||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
@ -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<BusiCustomerCompany> 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<BusiCustomerPerson> busiCustomerPersonList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过客户公司主键删除客户公司人员信息
|
||||
*
|
||||
* @param id 客户公司ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiCustomerPersonByCompanyId(String id);
|
||||
}
|
||||
|
|
@ -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<BusiCustomerPerson> 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);
|
||||
}
|
||||
|
|
@ -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<BusiCustomerCompany> 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);
|
||||
}
|
||||
|
|
@ -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<BusiCustomerPerson> 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);
|
||||
}
|
||||
|
|
@ -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<BusiCustomerCompany> 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<BusiCustomerPerson> busiCustomerPersonList = busiCustomerCompany.getBusiCustomerPersonList();
|
||||
String id = busiCustomerCompany.getId();
|
||||
if (StringUtils.isNotNull(busiCustomerPersonList))
|
||||
{
|
||||
List<BusiCustomerPerson> list = new ArrayList<BusiCustomerPerson>();
|
||||
for (BusiCustomerPerson busiCustomerPerson : busiCustomerPersonList)
|
||||
{
|
||||
busiCustomerPerson.setCompanyId(id);
|
||||
list.add(busiCustomerPerson);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
busiCustomerCompanyMapper.batchBusiCustomerPerson(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<BusiCustomerPerson> 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.busi.mapper.BusiCustomerCompanyMapper">
|
||||
|
||||
<resultMap type="BusiCustomerCompany" id="BusiCustomerCompanyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="coName" column="co_name" />
|
||||
<result property="addr" column="addr" />
|
||||
<result property="account" column="account" />
|
||||
<result property="taxNumber" column="tax_number" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="BusiCustomerCompanyBusiCustomerPersonResult" type="BusiCustomerCompany" extends="BusiCustomerCompanyResult">
|
||||
<collection property="busiCustomerPersonList" notNullColumn="sub_id" javaType="java.util.List" resultMap="BusiCustomerPersonResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="BusiCustomerPerson" id="BusiCustomerPersonResult">
|
||||
<result property="id" column="sub_id" />
|
||||
<result property="companyId" column="sub_company_id" />
|
||||
<result property="personName" column="sub_person_name" />
|
||||
<result property="sex" column="sub_sex" />
|
||||
<result property="phonenumber" column="sub_phonenumber" />
|
||||
<result property="email" column="sub_email" />
|
||||
<result property="role" column="sub_role" />
|
||||
<result property="createBy" column="sub_create_by" />
|
||||
<result property="createTime" column="sub_create_time" />
|
||||
<result property="updateBy" column="sub_update_by" />
|
||||
<result property="updateTime" column="sub_update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBusiCustomerCompanyVo">
|
||||
select id, co_name, addr, account, tax_number, create_by, create_time, update_by, update_time from busi_customer_company
|
||||
</sql>
|
||||
|
||||
<select id="selectBusiCustomerCompanyList" parameterType="BusiCustomerCompany" resultMap="BusiCustomerCompanyResult">
|
||||
<include refid="selectBusiCustomerCompanyVo"/>
|
||||
<where>
|
||||
<if test="coName != null and coName != ''"> and co_name like concat('%', #{coName}, '%')</if>
|
||||
<if test="addr != null and addr != ''"> and addr like concat('%', #{addr}, '%')</if>
|
||||
<if test="account != null and account != ''"> and account like concat('%', #{account}, '%')</if>
|
||||
<if test="taxNumber != null and taxNumber != ''"> and tax_number like concat('%', #{taxNumber}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBusiCustomerCompanyById" parameterType="String" resultMap="BusiCustomerCompanyBusiCustomerPersonResult">
|
||||
select a.id, a.co_name, a.addr, a.account, a.tax_number, a.create_by, a.create_time, a.update_by, a.update_time,
|
||||
b.id as sub_id, b.company_id as sub_company_id, b.person_name as sub_person_name, b.sex as sub_sex, b.phonenumber as sub_phonenumber, b.email as sub_email, b.role as sub_role, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time
|
||||
from busi_customer_company a
|
||||
left join busi_customer_person b on b.company_id = a.id
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBusiCustomerCompany" parameterType="BusiCustomerCompany" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into busi_customer_company
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="coName != null and coName != ''">co_name,</if>
|
||||
<if test="addr != null">addr,</if>
|
||||
<if test="account != null">account,</if>
|
||||
<if test="taxNumber != null">tax_number,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="coName != null and coName != ''">#{coName},</if>
|
||||
<if test="addr != null">#{addr},</if>
|
||||
<if test="account != null">#{account},</if>
|
||||
<if test="taxNumber != null">#{taxNumber},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBusiCustomerCompany" parameterType="BusiCustomerCompany">
|
||||
update busi_customer_company
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="coName != null and coName != ''">co_name = #{coName},</if>
|
||||
<if test="addr != null">addr = #{addr},</if>
|
||||
<if test="account != null">account = #{account},</if>
|
||||
<if test="taxNumber != null">tax_number = #{taxNumber},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBusiCustomerCompanyById" parameterType="String">
|
||||
delete from busi_customer_company where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiCustomerCompanyByIds" parameterType="String">
|
||||
delete from busi_customer_company where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiCustomerPersonByCompanyIds" parameterType="String">
|
||||
delete from busi_customer_person where company_id in
|
||||
<foreach item="companyId" collection="array" open="(" separator="," close=")">
|
||||
#{companyId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiCustomerPersonByCompanyId" parameterType="String">
|
||||
delete from busi_customer_person where company_id = #{companyId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchBusiCustomerPerson">
|
||||
insert into busi_customer_person( id, company_id, person_name, sex, phonenumber, email, role, create_by, create_time, update_by, update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.companyId}, #{item.personName}, #{item.sex}, #{item.phonenumber}, #{item.email}, #{item.role}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.busi.mapper.BusiCustomerPersonMapper">
|
||||
|
||||
<resultMap type="BusiCustomerPerson" id="BusiCustomerPersonResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="companyName" column="company_name" />
|
||||
<result property="personName" column="person_name" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="phonenumber" column="phonenumber" />
|
||||
<result property="email" column="email" />
|
||||
<result property="role" column="role" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBusiCustomerPersonVo">
|
||||
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
|
||||
</sql>
|
||||
|
||||
<select id="selectBusiCustomerPersonList" parameterType="BusiCustomerPerson" resultMap="BusiCustomerPersonResult">
|
||||
<include refid="selectBusiCustomerPersonVo"/>
|
||||
<where>
|
||||
<if test="companyId != null and companyId != ''"> and A.company_id = #{companyId}</if>
|
||||
<if test="personName != null and personName != ''"> and A.person_name like concat('%', #{personName}, '%')</if>
|
||||
<if test="phonenumber != null and phonenumber != ''"> and A.phonenumber like concat('%', #{phonenumber}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBusiCustomerPersonById" parameterType="String" resultMap="BusiCustomerPersonResult">
|
||||
<include refid="selectBusiCustomerPersonVo"/>
|
||||
where A.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBusiCustomerPerson" parameterType="BusiCustomerPerson" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into busi_customer_person
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="companyId != null and companyId != ''">company_id,</if>
|
||||
<if test="personName != null and personName != ''">person_name,</if>
|
||||
<if test="sex != null and sex != ''">sex,</if>
|
||||
<if test="phonenumber != null">phonenumber,</if>
|
||||
<if test="email != null">email,</if>
|
||||
<if test="role != null">role,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
||||
<if test="personName != null and personName != ''">#{personName},</if>
|
||||
<if test="sex != null and sex != ''">#{sex},</if>
|
||||
<if test="phonenumber != null">#{phonenumber},</if>
|
||||
<if test="email != null">#{email},</if>
|
||||
<if test="role != null">#{role},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBusiCustomerPerson" parameterType="BusiCustomerPerson">
|
||||
update busi_customer_person
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||
<if test="personName != null and personName != ''">person_name = #{personName},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
<if test="phonenumber != null">phonenumber = #{phonenumber},</if>
|
||||
<if test="email != null">email = #{email},</if>
|
||||
<if test="role != null">role = #{role},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBusiCustomerPersonById" parameterType="String">
|
||||
delete from busi_customer_person where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiCustomerPersonByIds" parameterType="String">
|
||||
delete from busi_customer_person where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增客户公司')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-company-add">
|
||||
<h4 class="form-header h4">客户公司信息</h4>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">公司名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="coName" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">公司地址:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="addr" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">对公账号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="account" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">纳税号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="taxNumber" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-header h4">客户公司人员信息</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus"> 增加</i></button>
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus"> 删除</i></button>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/company"
|
||||
var sexDatas = [[${@dict.getType('sys_user_sex')}]];
|
||||
var roleDatas = [[${@dict.getType('busi_role')}]];
|
||||
$("#form-company-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-company-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
pagination: false,
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
sidePagination: "client",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'index',
|
||||
align: 'center',
|
||||
title: "序号",
|
||||
formatter: function (value, row, index) {
|
||||
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
|
||||
return columnIndex + $.table.serialNumber(index);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'personName',
|
||||
align: 'center',
|
||||
title: '姓名',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiCustomerPersonList[%s].personName' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'sex',
|
||||
align: 'center',
|
||||
title: '性别',
|
||||
formatter: function(value, row, index) {
|
||||
var name = $.common.sprintf("busiCustomerPersonList[%s].sex", index);
|
||||
return $.common.dictToSelect(sexDatas, value, name);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'phonenumber',
|
||||
align: 'center',
|
||||
title: '手机号码',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiCustomerPersonList[%s].phonenumber' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'email',
|
||||
align: 'center',
|
||||
title: '人员邮箱',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiCustomerPersonList[%s].email' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'role',
|
||||
align: 'center',
|
||||
title: '角色',
|
||||
formatter: function(value, row, index) {
|
||||
var name = $.common.sprintf("busiCustomerPersonList[%s].role", index);
|
||||
return $.common.dictToSelect(roleDatas, value, name);
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
function addColumn() {
|
||||
var count = $("#" + table.options.id).bootstrapTable('getData').length;
|
||||
sub.editColumn();
|
||||
|
||||
$("#" + table.options.id).bootstrapTable('insertRow', {
|
||||
index: count,
|
||||
row: {
|
||||
index: $.table.serialNumber(count),
|
||||
personName: "",
|
||||
sex: "",
|
||||
phonenumber: "",
|
||||
email: "",
|
||||
role: ""
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('客户公司列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>公司名称:</label>
|
||||
<input type="text" name="coName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>公司地址:</label>
|
||||
<input type="text" name="addr"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>对公账号:</label>
|
||||
<input type="text" name="account"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>纳税号:</label>
|
||||
<input type="text" name="taxNumber"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="busi:company:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="busi:company:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="busi:company:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="busi:company:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('busi:company:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('busi:company:remove')}]];
|
||||
var prefix = ctx + "busi/company";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "客户公司",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'coName',
|
||||
title: '公司名称'
|
||||
},
|
||||
{
|
||||
field: 'addr',
|
||||
title: '公司地址'
|
||||
},
|
||||
{
|
||||
field: 'account',
|
||||
title: '对公账号'
|
||||
},
|
||||
{
|
||||
field: 'taxNumber',
|
||||
title: '纳税号'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改客户公司')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-company-edit" th:object="${busiCustomerCompany}">
|
||||
<h4 class="form-header h4">客户公司信息</h4>
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">公司名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="coName" th:field="*{coName}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">公司地址:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="addr" th:field="*{addr}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">对公账号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="account" th:field="*{account}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">纳税号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="taxNumber" th:field="*{taxNumber}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-header h4">客户公司人员信息</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus"> 增加</i></button>
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus"> 删除</i></button>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/company";
|
||||
var sexDatas = [[${@dict.getType('sys_user_sex')}]];
|
||||
var roleDatas = [[${@dict.getType('busi_role')}]];
|
||||
$("#form-company-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-company-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
data: [[${busiCustomerCompany.busiCustomerPersonList}]],
|
||||
pagination: false,
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
sidePagination: "client",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'index',
|
||||
align: 'center',
|
||||
title: "序号",
|
||||
formatter: function (value, row, index) {
|
||||
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
|
||||
return columnIndex + $.table.serialNumber(index);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'personName',
|
||||
align: 'center',
|
||||
title: '姓名',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiCustomerPersonList[%s].personName' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'sex',
|
||||
align: 'center',
|
||||
title: '性别',
|
||||
formatter: function(value, row, index) {
|
||||
var name = $.common.sprintf("busiCustomerPersonList[%s].sex", index);
|
||||
return $.common.dictToSelect(sexDatas, value, name);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'phonenumber',
|
||||
align: 'center',
|
||||
title: '手机号码',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiCustomerPersonList[%s].phonenumber' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'email',
|
||||
align: 'center',
|
||||
title: '人员邮箱',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiCustomerPersonList[%s].email' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'role',
|
||||
align: 'center',
|
||||
title: '角色',
|
||||
formatter: function(value, row, index) {
|
||||
var name = $.common.sprintf("busiCustomerPersonList[%s].role", index);
|
||||
return $.common.dictToSelect(roleDatas, value, name);
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
function addColumn() {
|
||||
var count = $("#" + table.options.id).bootstrapTable('getData').length;
|
||||
sub.editColumn();
|
||||
|
||||
$("#" + table.options.id).bootstrapTable('insertRow', {
|
||||
index: count,
|
||||
row: {
|
||||
index: $.table.serialNumber(count),
|
||||
personName: "",
|
||||
sex: "",
|
||||
phonenumber: "",
|
||||
email: "",
|
||||
role: ""
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('客户公司选择')" />
|
||||
<th:block th:include="include :: ztree-css" />
|
||||
</head>
|
||||
<style>
|
||||
body{height:auto;font-family: "Microsoft YaHei";}
|
||||
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
|
||||
</style>
|
||||
<body class="hold-transition box box-main">
|
||||
<input id="treeId" name="treeId" type="hidden" th:value="${company.id}"/>
|
||||
<input id="treeName" name="treeName" type="hidden" th:value="${company.coName}"/>
|
||||
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
|
||||
<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
|
||||
<label id="btnHide" title="隐藏搜索">︽</label>
|
||||
</div>
|
||||
<div class="treeSearchInput" id="search">
|
||||
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
|
||||
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
|
||||
</div>
|
||||
<div class="treeExpandCollapse">
|
||||
<a href="#" onclick="$.tree.expand()">展开</a> /
|
||||
<a href="#" onclick="$.tree.collapse()">折叠</a>
|
||||
</div>
|
||||
<div id="tree" class="ztree treeselect"></div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: ztree-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/company"
|
||||
$(function() {
|
||||
var url = prefix + "/treeData";
|
||||
var options = {
|
||||
url: url,
|
||||
expandLevel: 2,
|
||||
onClick : zOnClick
|
||||
};
|
||||
$.tree.init(options);
|
||||
});
|
||||
|
||||
function zOnClick(event, treeId, treeNode) {
|
||||
var treeId = treeNode.id;
|
||||
var treeName = treeNode.name;
|
||||
$("#treeId").val(treeId);
|
||||
$("#treeName").val(treeName);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增客户公司人员')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-person-add">
|
||||
<input id="treeId" name="companyId" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">所属公司:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="treeName" name="companyName" readonly="true" onclick="selectCompany()" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">姓名:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="personName" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">性别:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}" required>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手机号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="phonenumber" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">人员邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="email" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">角色:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="role" class="form-control m-b" th:with="type=${@dict.getType('busi_role')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/person"
|
||||
$("#form-person-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-person-add').serialize());
|
||||
}
|
||||
}
|
||||
/*客户公司选择*/
|
||||
function selectCompany() {
|
||||
var options = {
|
||||
title: '选择客户公司',
|
||||
width: "380",
|
||||
height: "400",
|
||||
url: ctx + "busi/company/selectCompany/",
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
function doSubmit(index, layero){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改客户公司人员')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-person-edit" th:object="${busiCustomerPerson}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<input id="treeId" name="companyId" th:field="*{companyId}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">所属公司:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="treeName" name="companyName" readonly="true" onclick="selectCompany()" th:field="*{companyName}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">姓名:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="personName" th:field="*{personName}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">性别:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}" required>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sex}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手机号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="phonenumber" th:field="*{phonenumber}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">人员邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="email" th:field="*{email}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">角色:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="role" class="form-control m-b" th:with="type=${@dict.getType('busi_role')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{role}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/person";
|
||||
$("#form-person-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-person-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
/*选择客户公司*/
|
||||
function selectCompany() {
|
||||
var options = {
|
||||
title: '选择客户公司',
|
||||
width: "380",
|
||||
height: "400",
|
||||
url: ctx + "busi/company/selectCompany/",
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('客户公司人员列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>所属公司:</label>
|
||||
<input id="treeId" name="companyId" type="text" style="display: none;">
|
||||
<input id="treeName" name="companyName" type="text" readonly="true" onclick="selectCompany()" >
|
||||
</li>
|
||||
<li>
|
||||
<label>姓名:</label>
|
||||
<input type="text" name="personName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>手机号码:</label>
|
||||
<input type="text" name="phonenumber"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="busi:person:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="busi:person:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="busi:person:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="busi:person:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('busi:person:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('busi:person:remove')}]];
|
||||
var sexDatas = [[${@dict.getType('sys_user_sex')}]];
|
||||
var roleDatas = [[${@dict.getType('busi_role')}]];
|
||||
var prefix = ctx + "busi/person";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "客户公司人员",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID主键',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'companyName',
|
||||
title: '所属公司'
|
||||
},
|
||||
{
|
||||
field: 'personName',
|
||||
title: '姓名'
|
||||
},
|
||||
{
|
||||
field: 'sex',
|
||||
title: '性别',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(sexDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'phonenumber',
|
||||
title: '手机号码'
|
||||
},
|
||||
{
|
||||
field: 'email',
|
||||
title: '人员邮箱'
|
||||
},
|
||||
{
|
||||
field: 'role',
|
||||
title: '角色',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(roleDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
/*选择客户公司*/
|
||||
function selectCompany() {
|
||||
var options = {
|
||||
title: '选择客户公司',
|
||||
width: "380",
|
||||
height: "400",
|
||||
url: ctx + "busi/company/selectCompany/",
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
$.table.search();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -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, '客户税号菜单');
|
||||
|
|
|
|||
48
sql/tmp.sql
48
sql/tmp.sql
|
|
@ -1 +1,47 @@
|
|||
-- https://dbschema.com/download.html
|
||||
-- 菜单 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, '');
|
||||
|
|
|
|||
Loading…
Reference in New Issue