客户公司管理和客户人员管理功能完善

This commit is contained in:
wangcl 2021-12-17 10:22:42 +08:00
parent a357230460
commit e6eec0c6a2
5 changed files with 45 additions and 23 deletions

View File

@ -86,6 +86,8 @@ public class BusiCustomerCompanyController extends BaseController {
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BusiCustomerCompany busiCustomerCompany) {
busiCustomerCompany.setCreateBy(getLoginName());
busiCustomerCompany.getBusiCustomerPersonList().stream().forEach(person -> person.setCreateBy(getLoginName()));
return toAjax(busiCustomerCompanyService.insertBusiCustomerCompany(busiCustomerCompany));
}
@ -107,6 +109,8 @@ public class BusiCustomerCompanyController extends BaseController {
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(BusiCustomerCompany busiCustomerCompany) {
busiCustomerCompany.setUpdateBy(getLoginName());
busiCustomerCompany.getBusiCustomerPersonList().stream().forEach(person -> person.setCreateBy(getLoginName()));
return toAjax(busiCustomerCompanyService.updateBusiCustomerCompany(busiCustomerCompany));
}

View File

@ -1,6 +1,9 @@
package com.ruoyi.busi.controller;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -27,17 +30,20 @@ import com.ruoyi.common.core.page.TableDataInfo;
*/
@Controller
@RequestMapping("/busi/person")
public class BusiCustomerPersonController extends BaseController
{
public class BusiCustomerPersonController extends BaseController {
private String prefix = "busi/person";
@Autowired
private IBusiCustomerPersonService busiCustomerPersonService;
@Autowired
private IBusiCustomerCompanyService busiCustomerCompanyService;
@RequiresPermissions("busi:person:view")
@GetMapping()
public String person()
{
@GetMapping("/{companyId}")
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";
}
@ -47,8 +53,7 @@ public class BusiCustomerPersonController extends BaseController
@RequiresPermissions("busi:person:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(BusiCustomerPerson busiCustomerPerson)
{
public TableDataInfo list(BusiCustomerPerson busiCustomerPerson) {
startPage();
List<BusiCustomerPerson> list = busiCustomerPersonService.selectBusiCustomerPersonList(busiCustomerPerson);
return getDataTable(list);
@ -61,8 +66,7 @@ public class BusiCustomerPersonController extends BaseController
@Log(title = "客户公司人员", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BusiCustomerPerson busiCustomerPerson)
{
public AjaxResult export(BusiCustomerPerson busiCustomerPerson) {
List<BusiCustomerPerson> list = busiCustomerPersonService.selectBusiCustomerPersonList(busiCustomerPerson);
ExcelUtil<BusiCustomerPerson> util = new ExcelUtil<BusiCustomerPerson>(BusiCustomerPerson.class);
return util.exportExcel(list, "客户公司人员数据");
@ -72,8 +76,7 @@ public class BusiCustomerPersonController extends BaseController
* 新增客户公司人员
*/
@GetMapping("/add")
public String add()
{
public String add() {
return prefix + "/add";
}
@ -84,8 +87,8 @@ public class BusiCustomerPersonController extends BaseController
@Log(title = "客户公司人员", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BusiCustomerPerson busiCustomerPerson)
{
public AjaxResult addSave(BusiCustomerPerson busiCustomerPerson) {
busiCustomerPerson.setCreateBy(getLoginName());
return toAjax(busiCustomerPersonService.insertBusiCustomerPerson(busiCustomerPerson));
}
@ -93,8 +96,7 @@ public class BusiCustomerPersonController extends BaseController
* 修改客户公司人员
*/
@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);
mmap.put("busiCustomerPerson", busiCustomerPerson);
return prefix + "/edit";
@ -107,8 +109,8 @@ public class BusiCustomerPersonController extends BaseController
@Log(title = "客户公司人员", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(BusiCustomerPerson busiCustomerPerson)
{
public AjaxResult editSave(BusiCustomerPerson busiCustomerPerson) {
busiCustomerPerson.setUpdateBy(getLoginName());
return toAjax(busiCustomerPersonService.updateBusiCustomerPerson(busiCustomerPerson));
}
@ -119,8 +121,7 @@ public class BusiCustomerPersonController extends BaseController
@Log(title = "客户公司人员", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
public AjaxResult remove(String ids) {
return toAjax(busiCustomerPersonService.deleteBusiCustomerPersonByIds(ids));
}
}

View File

@ -122,6 +122,7 @@ public class BusiCustomerCompanyServiceImpl implements IBusiCustomerCompanyServi
List<BusiCustomerPerson> list = new ArrayList<BusiCustomerPerson>();
for (BusiCustomerPerson busiCustomerPerson : busiCustomerPersonList)
{
busiCustomerPerson.setCreateTime(DateUtils.getNowDate());
busiCustomerPerson.setCompanyId(id);
list.add(busiCustomerPerson);
}

View File

@ -92,6 +92,11 @@
field: 'taxNumber',
title: '纳税号'
},
{
field: 'createTime',
title: '创建时间',
sortable: true
},
{
title: '操作',
align: 'center',
@ -99,12 +104,18 @@
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>');
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('');
}
}]
};
$.table.init(options);
});
/*进入人员列表-详细*/
function detail(companyid, companyName) {
var url = ctx + "busi/person/" + companyid;
$.modal.openTab(companyName + "人员信息", url, true);
}
</script>
</body>
</html>

View File

@ -12,8 +12,8 @@
<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()" >
<input id="treeId" name="companyId" th:value="${company.id}" type="text" style="display: none;">
<input id="treeName" name="companyName" th:value="${company.coName}" type="text" readonly="true" onclick="selectCompany()" >
</li>
<li>
<label>姓名:</label>
@ -105,6 +105,11 @@
return $.table.selectDictLabel(roleDatas, value);
}
},
{
field: 'createTime',
title: '创建时间',
sortable: true
},
{
title: '操作',
align: 'center',