From 557bc54d23b149151740c461a9dcb4d8000316b9 Mon Sep 17 00:00:00 2001 From: tamguo Date: Mon, 30 Jul 2018 14:21:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/sys/model/SysCompanyEntity.java | 8 +- .../modules/sys/service/ISysAreaService.java | 3 + .../sys/service/ISysCompanyService.java | 3 + .../sys/service/impl/SysAreaServiceImpl.java | 34 +- .../service/impl/SysCompanyServiceImpl.java | 40 ++ .../modules/sys/web/CompanyController.java | 20 +- .../modules/sys/web/SysAreaController.java | 8 + .../templates/modules/sys/company/add.html | 423 +++++++++++ .../templates/modules/sys/company/detail.html | 666 ------------------ .../templates/modules/sys/company/index.html | 4 +- 10 files changed, 533 insertions(+), 676 deletions(-) create mode 100644 tamguo-oms/src/main/resources/templates/modules/sys/company/add.html delete mode 100644 tamguo-oms/src/main/resources/templates/modules/sys/company/detail.html 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 1cc3f8a..8e3a975 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 @@ -5,6 +5,7 @@ import java.math.BigDecimal; import java.util.Date; import com.baomidou.mybatisplus.annotations.KeySequence; +import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; /** @@ -16,6 +17,7 @@ import com.baomidou.mybatisplus.annotations.TableName; public class SysCompanyEntity implements Serializable { private static final long serialVersionUID = 1L; + @TableId private String companyCode; private String areaCode; private String companyName; @@ -31,7 +33,7 @@ public class SysCompanyEntity implements Serializable { private Boolean treeLeaf; private BigDecimal treeLevel; private String treeNames; - private BigDecimal treeSort; + private String treeSort; private String treeSorts; private String updateBy; private Date updateDate; @@ -144,11 +146,11 @@ public class SysCompanyEntity implements Serializable { this.treeNames = treeNames; } - public BigDecimal getTreeSort() { + public String getTreeSort() { return this.treeSort; } - public void setTreeSort(BigDecimal treeSort) { + public void setTreeSort(String treeSort) { this.treeSort = treeSort; } diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/ISysAreaService.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/ISysAreaService.java index d23fd50..0664de0 100644 --- a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/ISysAreaService.java +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/ISysAreaService.java @@ -2,6 +2,7 @@ package com.tamguo.modules.sys.service; import java.util.List; +import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.service.IService; import com.tamguo.modules.sys.model.SysAreaEntity; import com.tamguo.modules.sys.model.condition.SysAreaCondition; @@ -10,4 +11,6 @@ public interface ISysAreaService extends IService{ List listData(SysAreaCondition condition); + JSONArray treeData(String excludeId); + } 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 bb40693..247e35c 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 @@ -17,4 +17,7 @@ public interface ISysCompanyService extends IService{ /** 根据ID查询公司*/ SysCompanyEntity selectByCode(String code); + + /** 新建公司*/ + void save(SysCompanyEntity company); } diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysAreaServiceImpl.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysAreaServiceImpl.java index 992dcee..075068d 100644 --- a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysAreaServiceImpl.java +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysAreaServiceImpl.java @@ -1,10 +1,13 @@ package com.tamguo.modules.sys.service.impl; import java.util.List; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.mapper.Condition; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.tamguo.modules.sys.dao.SysAreaMapper; import com.tamguo.modules.sys.model.SysAreaEntity; @@ -22,4 +25,33 @@ public class SysAreaServiceImpl extends ServiceImpl areaList = null; + if(StringUtils.isEmpty(excludeId)) { + areaList = sysAreaMapper.selectList(Condition.EMPTY); + }else { + areaList = sysAreaMapper.selectList(Condition.create().notLike("parent_codes", excludeId).ne("area_code", excludeId)); + } + return turnZTreeData(areaList); + } + + private JSONArray turnZTreeData(List areaList) { + if(areaList != null) { + JSONArray nodes = new JSONArray(); + for(int i=0 ; i implements ISysCompanyService { @@ -60,5 +64,41 @@ public class SysCompanyServiceImpl extends ServiceImpl +公司管理 - JeeSite Demo + + + + + + + + + + + + +
+
+
+
+ 新增公司 +
+
+ +
+
+
+
+
基本信息
+
+
+
+ +
+
+ + + + +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ + + +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+
+ + + +
+
+
+
+
+
+ +
+
+ + + +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + \ No newline at end of file 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 deleted file mode 100644 index a4a67fc..0000000 --- a/tamguo-oms/src/main/resources/templates/modules/sys/company/detail.html +++ /dev/null @@ -1,666 +0,0 @@ - - - - - - - - - - - - -公司管理 - JeeSite Demo - - - - - - - - - - - - - -
-
-
-
-
- 编辑公司 -
-
- -
-
-
-
-
基本信息
-
-
-
- -
-
- - - - - - - -
-
-
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
-
-
- -
-
- -
- -
-
-
-
-
- -
-
- -
- - -
-
-
-
-
-
-
- -
- -
-
-
-
- - -
-
-
- - - - - - - - - - - - - - - - - - \ No newline at end of file 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 4ee697c..24edd00 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 @@ -28,7 +28,7 @@ content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/> 刷新 展开 折叠 - 新增 + 新增
@@ -107,7 +107,7 @@ $('#dataGrid').dataGrid({ actions.push(' '); } actions.push(' '); - actions.push(' '); + actions.push(' '); return actions.join(''); }} ],