客户公司管理和客户人员管理功能完善
This commit is contained in:
parent
a357230460
commit
e6eec0c6a2
|
|
@ -86,6 +86,8 @@ public class BusiCustomerCompanyController extends BaseController {
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(BusiCustomerCompany busiCustomerCompany) {
|
public AjaxResult addSave(BusiCustomerCompany busiCustomerCompany) {
|
||||||
|
busiCustomerCompany.setCreateBy(getLoginName());
|
||||||
|
busiCustomerCompany.getBusiCustomerPersonList().stream().forEach(person -> person.setCreateBy(getLoginName()));
|
||||||
return toAjax(busiCustomerCompanyService.insertBusiCustomerCompany(busiCustomerCompany));
|
return toAjax(busiCustomerCompanyService.insertBusiCustomerCompany(busiCustomerCompany));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,6 +109,8 @@ public class BusiCustomerCompanyController extends BaseController {
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult editSave(BusiCustomerCompany busiCustomerCompany) {
|
public AjaxResult editSave(BusiCustomerCompany busiCustomerCompany) {
|
||||||
|
busiCustomerCompany.setUpdateBy(getLoginName());
|
||||||
|
busiCustomerCompany.getBusiCustomerPersonList().stream().forEach(person -> person.setCreateBy(getLoginName()));
|
||||||
return toAjax(busiCustomerCompanyService.updateBusiCustomerCompany(busiCustomerCompany));
|
return toAjax(busiCustomerCompanyService.updateBusiCustomerCompany(busiCustomerCompany));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package com.ruoyi.busi.controller;
|
package com.ruoyi.busi.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.busi.domain.BusiCustomerCompany;
|
||||||
|
import com.ruoyi.busi.service.IBusiCustomerCompanyService;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
@ -27,17 +30,20 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/busi/person")
|
@RequestMapping("/busi/person")
|
||||||
public class BusiCustomerPersonController extends BaseController
|
public class BusiCustomerPersonController extends BaseController {
|
||||||
{
|
|
||||||
private String prefix = "busi/person";
|
private String prefix = "busi/person";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBusiCustomerPersonService busiCustomerPersonService;
|
private IBusiCustomerPersonService busiCustomerPersonService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBusiCustomerCompanyService busiCustomerCompanyService;
|
||||||
|
|
||||||
@RequiresPermissions("busi:person:view")
|
@RequiresPermissions("busi:person:view")
|
||||||
@GetMapping()
|
@GetMapping("/{companyId}")
|
||||||
public String person()
|
public String person(@PathVariable("companyId") String companyId, ModelMap mmap) {
|
||||||
{
|
BusiCustomerCompany busiCustomerCompany = busiCustomerCompanyService.selectBusiCustomerCompanyById(companyId);
|
||||||
|
mmap.put("company", busiCustomerCompany == null ? new BusiCustomerCompany() : busiCustomerCompany);
|
||||||
return prefix + "/person";
|
return prefix + "/person";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,8 +53,7 @@ public class BusiCustomerPersonController extends BaseController
|
||||||
@RequiresPermissions("busi:person:list")
|
@RequiresPermissions("busi:person:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(BusiCustomerPerson busiCustomerPerson)
|
public TableDataInfo list(BusiCustomerPerson busiCustomerPerson) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
List<BusiCustomerPerson> list = busiCustomerPersonService.selectBusiCustomerPersonList(busiCustomerPerson);
|
List<BusiCustomerPerson> list = busiCustomerPersonService.selectBusiCustomerPersonList(busiCustomerPerson);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
|
|
@ -61,8 +66,7 @@ public class BusiCustomerPersonController extends BaseController
|
||||||
@Log(title = "客户公司人员", businessType = BusinessType.EXPORT)
|
@Log(title = "客户公司人员", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult export(BusiCustomerPerson busiCustomerPerson)
|
public AjaxResult export(BusiCustomerPerson busiCustomerPerson) {
|
||||||
{
|
|
||||||
List<BusiCustomerPerson> list = busiCustomerPersonService.selectBusiCustomerPersonList(busiCustomerPerson);
|
List<BusiCustomerPerson> list = busiCustomerPersonService.selectBusiCustomerPersonList(busiCustomerPerson);
|
||||||
ExcelUtil<BusiCustomerPerson> util = new ExcelUtil<BusiCustomerPerson>(BusiCustomerPerson.class);
|
ExcelUtil<BusiCustomerPerson> util = new ExcelUtil<BusiCustomerPerson>(BusiCustomerPerson.class);
|
||||||
return util.exportExcel(list, "客户公司人员数据");
|
return util.exportExcel(list, "客户公司人员数据");
|
||||||
|
|
@ -72,8 +76,7 @@ public class BusiCustomerPersonController extends BaseController
|
||||||
* 新增客户公司人员
|
* 新增客户公司人员
|
||||||
*/
|
*/
|
||||||
@GetMapping("/add")
|
@GetMapping("/add")
|
||||||
public String add()
|
public String add() {
|
||||||
{
|
|
||||||
return prefix + "/add";
|
return prefix + "/add";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -84,8 +87,8 @@ public class BusiCustomerPersonController extends BaseController
|
||||||
@Log(title = "客户公司人员", businessType = BusinessType.INSERT)
|
@Log(title = "客户公司人员", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(BusiCustomerPerson busiCustomerPerson)
|
public AjaxResult addSave(BusiCustomerPerson busiCustomerPerson) {
|
||||||
{
|
busiCustomerPerson.setCreateBy(getLoginName());
|
||||||
return toAjax(busiCustomerPersonService.insertBusiCustomerPerson(busiCustomerPerson));
|
return toAjax(busiCustomerPersonService.insertBusiCustomerPerson(busiCustomerPerson));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,8 +96,7 @@ public class BusiCustomerPersonController extends BaseController
|
||||||
* 修改客户公司人员
|
* 修改客户公司人员
|
||||||
*/
|
*/
|
||||||
@GetMapping("/edit/{id}")
|
@GetMapping("/edit/{id}")
|
||||||
public String edit(@PathVariable("id") String id, ModelMap mmap)
|
public String edit(@PathVariable("id") String id, ModelMap mmap) {
|
||||||
{
|
|
||||||
BusiCustomerPerson busiCustomerPerson = busiCustomerPersonService.selectBusiCustomerPersonById(id);
|
BusiCustomerPerson busiCustomerPerson = busiCustomerPersonService.selectBusiCustomerPersonById(id);
|
||||||
mmap.put("busiCustomerPerson", busiCustomerPerson);
|
mmap.put("busiCustomerPerson", busiCustomerPerson);
|
||||||
return prefix + "/edit";
|
return prefix + "/edit";
|
||||||
|
|
@ -107,8 +109,8 @@ public class BusiCustomerPersonController extends BaseController
|
||||||
@Log(title = "客户公司人员", businessType = BusinessType.UPDATE)
|
@Log(title = "客户公司人员", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult editSave(BusiCustomerPerson busiCustomerPerson)
|
public AjaxResult editSave(BusiCustomerPerson busiCustomerPerson) {
|
||||||
{
|
busiCustomerPerson.setUpdateBy(getLoginName());
|
||||||
return toAjax(busiCustomerPersonService.updateBusiCustomerPerson(busiCustomerPerson));
|
return toAjax(busiCustomerPersonService.updateBusiCustomerPerson(busiCustomerPerson));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,10 +119,9 @@ public class BusiCustomerPersonController extends BaseController
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("busi:person:remove")
|
@RequiresPermissions("busi:person:remove")
|
||||||
@Log(title = "客户公司人员", businessType = BusinessType.DELETE)
|
@Log(title = "客户公司人员", businessType = BusinessType.DELETE)
|
||||||
@PostMapping( "/remove")
|
@PostMapping("/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult remove(String ids)
|
public AjaxResult remove(String ids) {
|
||||||
{
|
|
||||||
return toAjax(busiCustomerPersonService.deleteBusiCustomerPersonByIds(ids));
|
return toAjax(busiCustomerPersonService.deleteBusiCustomerPersonByIds(ids));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ public class BusiCustomerCompanyServiceImpl implements IBusiCustomerCompanyServi
|
||||||
List<BusiCustomerPerson> list = new ArrayList<BusiCustomerPerson>();
|
List<BusiCustomerPerson> list = new ArrayList<BusiCustomerPerson>();
|
||||||
for (BusiCustomerPerson busiCustomerPerson : busiCustomerPersonList)
|
for (BusiCustomerPerson busiCustomerPerson : busiCustomerPersonList)
|
||||||
{
|
{
|
||||||
|
busiCustomerPerson.setCreateTime(DateUtils.getNowDate());
|
||||||
busiCustomerPerson.setCompanyId(id);
|
busiCustomerPerson.setCompanyId(id);
|
||||||
list.add(busiCustomerPerson);
|
list.add(busiCustomerPerson);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,11 @@
|
||||||
field: 'taxNumber',
|
field: 'taxNumber',
|
||||||
title: '纳税号'
|
title: '纳税号'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间',
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
|
@ -99,12 +104,18 @@
|
||||||
var actions = [];
|
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-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>');
|
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>');
|
||||||
|
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="detail(\'' + row.id + '\',\'' + row.coName + '\')"> <i class="fa fa-list-ul"></i>人员列表</a> ');
|
||||||
return actions.join('');
|
return actions.join('');
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
$.table.init(options);
|
$.table.init(options);
|
||||||
});
|
});
|
||||||
|
/*进入人员列表-详细*/
|
||||||
|
function detail(companyid, companyName) {
|
||||||
|
var url = ctx + "busi/person/" + companyid;
|
||||||
|
$.modal.openTab(companyName + "人员信息", url, true);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label>所属公司:</label>
|
<label>所属公司:</label>
|
||||||
<input id="treeId" name="companyId" type="text" style="display: none;">
|
<input id="treeId" name="companyId" th:value="${company.id}" type="text" style="display: none;">
|
||||||
<input id="treeName" name="companyName" type="text" readonly="true" onclick="selectCompany()" >
|
<input id="treeName" name="companyName" th:value="${company.coName}" type="text" readonly="true" onclick="selectCompany()" >
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label>姓名:</label>
|
<label>姓名:</label>
|
||||||
|
|
@ -105,6 +105,11 @@
|
||||||
return $.table.selectDictLabel(roleDatas, value);
|
return $.table.selectDictLabel(roleDatas, value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间',
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue