diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/dao/SysCompanyMapper.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/dao/SysCompanyMapper.java index 1908419..99ce9bb 100644 --- a/tamguo-oms/src/main/java/com/tamguo/modules/sys/dao/SysCompanyMapper.java +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/dao/SysCompanyMapper.java @@ -10,6 +10,6 @@ public interface SysCompanyMapper extends SuperMapper{ List listData(SysCompanyCondition condition); - SysCompanyEntity select(String id); + SysCompanyEntity selectByCode(String code); } diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/model/SysCompanyEntity.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/model/SysCompanyEntity.java index e65f18b..9526a73 100644 --- a/tamguo-oms/src/main/java/com/tamguo/modules/sys/model/SysCompanyEntity.java +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/model/SysCompanyEntity.java @@ -7,7 +7,6 @@ import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.serializer.SerializerFeature; import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableName; -import com.tamguo.config.dao.SuperEntity; import com.tamguo.modules.sys.model.enums.SysCompanyStatusEnum; /** @@ -15,20 +14,15 @@ import com.tamguo.modules.sys.model.enums.SysCompanyStatusEnum; * */ @TableName(value="sys_company") -public class SysCompanyEntity extends SuperEntity implements Serializable { +public class SysCompanyEntity implements Serializable { private static final long serialVersionUID = 1L; private String code; 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 remarks; - private String parentId; + private String parentCode; private Boolean isLeaf; private Integer treeLevel; private Date updateDate; @@ -57,45 +51,9 @@ public class SysCompanyEntity extends SuperEntity implements S 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 static long getSerialversionuid() { return serialVersionUID; } - public String getParentId() { - return parentId; - } - public void setParentId(String parentId) { - this.parentId = parentId; - } public String getRemarks() { return remarks; } @@ -138,5 +96,11 @@ public class SysCompanyEntity extends SuperEntity implements S public void setParentName(String parentName) { this.parentName = parentName; } + public String getParentCode() { + return parentCode; + } + public void setParentCode(String parentCode) { + this.parentCode = parentCode; + } } \ No newline at end of file diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/ISysCompanyService.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/ISysCompanyService.java index edff286..54f6d69 100644 --- a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/ISysCompanyService.java +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/ISysCompanyService.java @@ -15,5 +15,5 @@ public interface ISysCompanyService extends IService{ List listData(SysCompanyCondition condition); /** 根据ID查询公司*/ - SysCompanyEntity select(String id); + SysCompanyEntity selectByCode(String code); } diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysCompanyServiceImpl.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysCompanyServiceImpl.java index 9653bee..a2641c1 100644 --- a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysCompanyServiceImpl.java +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysCompanyServiceImpl.java @@ -22,7 +22,7 @@ public class SysCompanyServiceImpl extends ServiceImpl treeData(String excludeId) { - List companyList = sysCompanyMapper.selectList(Condition.create().ne("id", excludeId)); + List companyList = sysCompanyMapper.selectList(Condition.create().ne("code", excludeId)); return companyList; } @@ -32,8 +32,8 @@ public class SysCompanyServiceImpl extends ServiceImpl SELECT - c.id, c.code, - c.parent_id, + c.parent_code, c.is_leaf, c.tree_level, c.name, c.full_name, c.type, - c.duty_man, - c.tel, - c.address, - c.zip_code, - c.email, c.remarks, c.update_date, c.status @@ -26,7 +20,7 @@ 1 = 1 - and c.parent_id = #{parentCode} + and c.parent_code = #{parentCode} and c.tree_level = 0 @@ -35,29 +29,23 @@ - SELECT - c.id, c.code, - c.parent_id, + c.parent_code, c.is_leaf, c.tree_level, c.name, c.full_name, c.type, - c.duty_man, - c.tel, - c.address, - c.zip_code, - c.email, c.update_date, c.create_date, c.`status`, cp.name as parent_name FROM sys_company c - LEFT JOIN sys_company cp on cp.id = c.parent_id + LEFT JOIN sys_company cp on cp.code = c.parent_code WHERE - c.id = #{id} + c.code = #{code} \ No newline at end of file diff --git a/tamguo-oms/src/main/resources/static/jqGrid/4.7/js/jquery.jqGrid.extend.js b/tamguo-oms/src/main/resources/static/jqGrid/4.7/js/jquery.jqGrid.extend.js index 3c630e2..8d131e7 100644 --- a/tamguo-oms/src/main/resources/static/jqGrid/4.7/js/jquery.jqGrid.extend.js +++ b/tamguo-oms/src/main/resources/static/jqGrid/4.7/js/jquery.jqGrid.extend.js @@ -22,7 +22,7 @@ }, treeReader: { level_field: "treeLevel", - parent_id_field: "parentId", + parent_id_field: "parentCode", userdata: "otherData", leaf_field: "isLeaf", expanded_field: "isOpen", diff --git a/tamguo-oms/src/main/resources/templates/modules/sys/company/detail.html b/tamguo-oms/src/main/resources/templates/modules/sys/company/detail.html index 3c0a6a3..c33cf32 100644 --- a/tamguo-oms/src/main/resources/templates/modules/sys/company/detail.html +++ b/tamguo-oms/src/main/resources/templates/modules/sys/company/detail.html @@ -49,7 +49,7 @@
- + @@ -575,8 +575,8 @@ var vm = new Vue({ } }); }, - getCompany:function(id){ - axios.get(ctx + "sys/company/info/"+id).then(function(response){ + getCompany:function(code){ + axios.get(ctx + "sys/company/info/"+code).then(function(response){ vm.company = response.data.result; }) }, @@ -629,10 +629,10 @@ var vm = new Vue({ return false; } } - vm.company.parentId = codes.join(','); + vm.company.parentCode = codes.join(','); vm.company.parentName = names.join(','); try { - $('#parentId,#parentName').valid(); + $('#parentCode,#parentName').valid(); } catch (e) { } if (typeof treeselectCallback == 'function') { @@ -642,7 +642,7 @@ var vm = new Vue({ }; options.btn.push(' 清除'); options['btn'+ options.btn.length] = function(index,layero) { - $("#parentId").val('').change(); + $("#parentCode").val('').change(); $("#parentName").val('').change(); if (typeof treeselectCallback == 'function') { treeselectCallback('parent','clear',index,layero); @@ -660,7 +660,7 @@ var vm = new Vue({ watch:{ } }); -var id = [[${id}]]; +var id = '[[${id}]]'; if(!/^(undefined|null|\s*)?$/.test(id)){ vm.getCompany(id); } diff --git a/tamguo-oms/src/main/resources/templates/modules/sys/company/index.html b/tamguo-oms/src/main/resources/templates/modules/sys/company/index.html index e5c212a..24b448b 100644 --- a/tamguo-oms/src/main/resources/templates/modules/sys/company/index.html +++ b/tamguo-oms/src/main/resources/templates/modules/sys/company/index.html @@ -87,8 +87,9 @@ $('#dataGrid').dataGrid({ searchForm: $("#searchForm"), columnModel: [ {header:'公司名称', name:'name', index:'a.company_name', width:250, align:"left", frozen:true, formatter: function(val, obj, row, act){ - return '( '+row.code+' ) '+''+(val||row.code)+''; + return '( '+row.code+' ) '+''+(val||row.code)+''; }}, + {header:'公司编码', name:'code', index:'a.code',hidden : true, align:"left"}, {header:'公司全称', name:'fullName', index:'a.full_name', width:200, align:"left"}, {header:'排序号', name:'treeSort', index:'a.tree_sort', width:80, align:"center"}, {header:'归属区域', name:'area.treeNames', index:'a.areaCode', width:200, align:"center"}, @@ -99,7 +100,7 @@ $('#dataGrid').dataGrid({ }}, {header:'操作', name:'actions', width:130, sortable:false, title:false, formatter: function(val, obj, row, act){ var actions = []; - actions.push(' '); + actions.push(' '); if (row.status == Global.STATUS_NORMAL){ actions.push(' '); }