main
tamguo 7 years ago
parent 6cfc5bfab7
commit 23e5ef15a2

@ -0,0 +1,8 @@
package com.tamguo.modules.sys.dao;
import com.tamguo.config.dao.SuperMapper;
import com.tamguo.modules.sys.model.SysCompanyEntity;
public interface SysCompanyMapper extends SuperMapper<SysCompanyEntity>{
}

@ -0,0 +1,97 @@
package com.tamguo.modules.sys.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotations.TableName;
import com.tamguo.config.dao.SuperEntity;
/**
* The persistent class for the sys_company database table.
*
*/
@TableName(value="sys_company")
public class SysCompanyEntity extends SuperEntity<SysCompanyEntity> implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private String fullName;
private String type;
private String dutyMan;
private String tel;
private String address;
private String zipCode;
private String email;
private String comments;
private String parentId;
private String treeId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getDutyMan() {
return dutyMan;
}
public void setDutyMan(String dutyMan) {
this.dutyMan = dutyMan;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getZipCode() {
return zipCode;
}
public void setZipCode(String zipCode) {
this.zipCode = zipCode;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getTreeId() {
return treeId;
}
public void setTreeId(String treeId) {
this.treeId = treeId;
}
}

@ -0,0 +1,12 @@
package com.tamguo.modules.sys.service;
import java.util.List;
import com.tamguo.modules.sys.model.SysCompanyEntity;
public interface ISysCompanyService {
/** 公司属性结构*/
List<SysCompanyEntity> treeData();
}

@ -0,0 +1,28 @@
package com.tamguo.modules.sys.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.Condition;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.tamguo.modules.sys.dao.SysCompanyMapper;
import com.tamguo.modules.sys.model.SysCompanyEntity;
import com.tamguo.modules.sys.service.ISysCompanyService;
@Service
public class SysCompanyServiceImpl extends ServiceImpl<SysCompanyMapper, SysCompanyEntity> implements ISysCompanyService {
@Autowired
private SysCompanyMapper sysCompanyMapper;
@SuppressWarnings("unchecked")
@Override
public List<SysCompanyEntity> treeData() {
List<SysCompanyEntity> companyList = sysCompanyMapper.selectList(Condition.EMPTY);
return companyList;
}
}

@ -0,0 +1,25 @@
package com.tamguo.modules.sys.web;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.tamguo.modules.sys.model.SysCompanyEntity;
import com.tamguo.modules.sys.service.ISysCompanyService;
@Controller
@RequestMapping(path="sys/company")
public class CompanyController {
@Autowired
ISysCompanyService iSysCompanyService;
@RequestMapping(path="treeData")
@ResponseBody
public List<SysCompanyEntity> treeData() {
return iSysCompanyService.treeData();
}
}

@ -0,0 +1,5 @@
<?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.tamguo.modules.sys.dao.SysCompanyMapper">
</mapper>

@ -27,7 +27,7 @@ content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
<i class="fa icon-grid"></i> 组织机构
</div>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool addTabPage" data-href="/js/a/sys/office/list" title="机构管理"><i class="fa fa-edit"></i></button>
<button type="button" class="btn btn-box-tool addTabPage" data-href="/js/a/sys/office/list" title="机构管理"><i class="fa fa-edit"></i></button>
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新"><i class="fa fa-refresh"></i></button>
@ -65,7 +65,7 @@ $('body').layout({
// 主页框架
var win = $("#mainFrame")[0].contentWindow;
// 树结构初始化加载
var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData:{enable:true}},
var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData: {enable: true,idKey: "uid",pIdKey: "parentId",rootPId: "",enable:true},key: {url:"nourl"}},
callback:{onClick:function(event, treeId, treeNode){
tree.expandNode(treeNode);
win.$('input[type=reset]').click();
@ -74,7 +74,7 @@ var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData:{
win.page();
}}
}, tree, loadTree = function(){
js.ajaxSubmit("/js/a/sys/office/treeData?___t=" + new Date().getTime(), {ctrlPermi:'2'/*1拥有的权限 2管理的权限*/}, function(data){
js.ajaxSubmit("http://localhost/sys/company/treeData?___t=" + new Date().getTime(), {ctrlPermi:'2'/*1拥有的权限 2管理的权限*/}, function(data){
tree = $.fn.zTree.init($("#tree"), setting, data);//.expandAll(true);
// 展开第一级节点
var nodes = tree.getNodesByParam("level", 0);

Loading…
Cancel
Save