Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doc_wei
Skyeye
提交
6e22c5d3
S
Skyeye
项目概览
doc_wei
/
Skyeye
通知
1195
Star
154
Fork
127
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
6e22c5d3
编写于
11月 27, 2018
作者:
doc_wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
公司信息添加,列表展示,删除完成
上级
2bccbe23
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
156 addition
and
28 deletion
+156
-28
skyeye-dao/src/main/java/com/skyeye/company/dao/CompanyMationDao.java
...rc/main/java/com/skyeye/company/dao/CompanyMationDao.java
+4
-0
skyeye-service/src/main/java/com/skyeye/company/service/CompanyMationService.java
...java/com/skyeye/company/service/CompanyMationService.java
+2
-0
skyeye-service/src/main/java/com/skyeye/company/service/impl/CompanyMationServiceImpl.java
...skyeye/company/service/impl/CompanyMationServiceImpl.java
+26
-1
skyeye-web/src/main/java/com/skyeye/company/controller/CompanyMationController.java
...om/skyeye/company/controller/CompanyMationController.java
+16
-0
skyeye-web/src/main/resources/dbmapper/CompanyMationMapper.xml
...e-web/src/main/resources/dbmapper/CompanyMationMapper.xml
+22
-13
skyeye-web/src/main/resources/mapping/reqmapping.xml
skyeye-web/src/main/resources/mapping/reqmapping.xml
+11
-2
skyeye-web/src/main/webapp/assets/lib/layui/lay/modules/treetable/treeGrid.js
...webapp/assets/lib/layui/lay/modules/treetable/treeGrid.js
+3
-1
skyeye-web/src/main/webapp/js/companymation/companymationadd.js
...-web/src/main/webapp/js/companymation/companymationadd.js
+48
-6
skyeye-web/src/main/webapp/js/companymation/companymationlist.js
...web/src/main/webapp/js/companymation/companymationlist.js
+17
-4
skyeye-web/src/main/webapp/tpl/companymation/companymationadd.html
...b/src/main/webapp/tpl/companymation/companymationadd.html
+3
-0
skyeye-web/src/main/webapp/tpl/companymation/companymationlist.html
.../src/main/webapp/tpl/companymation/companymationlist.html
+4
-1
未找到文件。
skyeye-dao/src/main/java/com/skyeye/company/dao/CompanyMationDao.java
浏览文件 @
6e22c5d3
...
...
@@ -19,4 +19,8 @@ public interface CompanyMationDao {
public
int
editCompanyMationById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
List
<
Map
<
String
,
Object
>>
queryOverAllCompanyMationList
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
Map
<
String
,
Object
>
queryCompanyMationById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
}
skyeye-service/src/main/java/com/skyeye/company/service/CompanyMationService.java
浏览文件 @
6e22c5d3
...
...
@@ -15,4 +15,6 @@ public interface CompanyMationService {
public
void
editCompanyMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
public
void
queryOverAllCompanyMationList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
}
skyeye-service/src/main/java/com/skyeye/company/service/impl/CompanyMationServiceImpl.java
浏览文件 @
6e22c5d3
...
...
@@ -74,7 +74,12 @@ public class CompanyMationServiceImpl implements CompanyMationService{
@Override
public
void
deleteCompanyMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
companyMationDao
.
deleteCompanyMationById
(
map
);
Map
<
String
,
Object
>
bean
=
companyMationDao
.
queryCompanyMationById
(
map
);
if
(
Integer
.
parseInt
(
bean
.
get
(
"childsNum"
).
toString
())
==
0
){
companyMationDao
.
deleteCompanyMationById
(
map
);
}
else
{
outputObject
.
setreturnMessage
(
"该公司下存在子公司,无法直接删除。"
);
}
}
/**
...
...
@@ -115,5 +120,25 @@ public class CompanyMationServiceImpl implements CompanyMationService{
outputObject
.
setreturnMessage
(
"该公司信息已注册,请确认。"
);
}
}
/**
*
* @Title: queryOverAllCompanyMationList
* @Description: 获取总公司信息列表
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
queryOverAllCompanyMationList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
List
<
Map
<
String
,
Object
>>
beans
=
companyMationDao
.
queryOverAllCompanyMationList
(
map
);
if
(!
beans
.
isEmpty
()){
outputObject
.
setBeans
(
beans
);
outputObject
.
settotal
(
beans
.
size
());
}
}
}
skyeye-web/src/main/java/com/skyeye/company/controller/CompanyMationController.java
浏览文件 @
6e22c5d3
...
...
@@ -94,4 +94,20 @@ public class CompanyMationController {
companyMationService
.
editCompanyMationById
(
inputObject
,
outputObject
);
}
/**
*
* @Title: queryOverAllCompanyMationList
* @Description: 获取总公司信息列表
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/CompanyMationController/queryOverAllCompanyMationList"
)
@ResponseBody
public
void
queryOverAllCompanyMationList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
companyMationService
.
queryOverAllCompanyMationList
(
inputObject
,
outputObject
);
}
}
skyeye-web/src/main/resources/dbmapper/CompanyMationMapper.xml
浏览文件 @
6e22c5d3
...
...
@@ -25,18 +25,6 @@
<if
test=
"companyName != '' and companyName != null"
>
AND a.company_name LIKE '%${companyName}%'
</if>
<if
test=
"provinceId != '' and provinceId != null"
>
AND a.address_province = #{provinceId}
</if>
<if
test=
"cityId != '' and cityId != null"
>
AND a.address_city = #{cityId}
</if>
<if
test=
"areaId != '' and areaId != null"
>
AND a.address_area = #{areaId}
</if>
<if
test=
"townshipId != '' and townshipId != null"
>
AND a.address_township = #{townshipId}
</if>
ORDER BY a.create_time DESC
</select>
...
...
@@ -57,7 +45,18 @@
(#{id}, #{companyName}, #{companyDesc}, #{pId}, #{provinceId}, #{cityId}, #{areaId}, #{townshipId}, #{addressDetailed}, #{createId}, #{createTime})
</insert>
<delete
id=
"deleteCompanyMationMationById"
parameterType=
"java.util.Map"
>
<select
id=
"queryCompanyMationById"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
a.id,
a.company_name companyName,
a.p_id pId,
(SELECT COUNT(*) FROM company_mation b WHERE b.p_id = a.id) childsNum
FROM
company_mation a
WHERE a.id = #{id}
</select>
<delete
id=
"deleteCompanyMationById"
parameterType=
"java.util.Map"
>
DELETE
FROM
company_mation
...
...
@@ -110,4 +109,14 @@
WHERE id = #{id}
</update>
<select
id=
"queryOverAllCompanyMationList"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
a.id,
a.company_name name
FROM
company_mation a
WHERE a.p_id = '0'
ORDER BY a.create_time DESC
</select>
</mapper>
\ No newline at end of file
skyeye-web/src/main/resources/mapping/reqmapping.xml
浏览文件 @
6e22c5d3
...
...
@@ -734,10 +734,17 @@
<!-- 公司管理开始 -->
<url
id=
"companymation001"
path=
"/post/CompanyMationController/queryCompanyMationList"
val=
"获取公司信息列表"
allUse=
"1"
>
<property
id=
"limit"
name=
"limit"
ref=
"required,num"
var=
"分页参数,每页多少条数据"
/>
<property
id=
"page"
name=
"page"
ref=
"required,num"
var=
"分页参数,第几页"
/>
<property
id=
"companyName"
name=
"companyName"
ref=
""
var=
"公司名称"
/>
</url>
<url
id=
"companymation002"
path=
"/post/CompanyMationController/insertCompanyMation"
val=
"添加公司信息信息"
allUse=
"1"
>
<property
id=
"companyName"
name=
"companyName"
ref=
"required"
var=
"公司名称"
/>
<property
id=
"companyDesc"
name=
"companyDesc"
ref=
""
var=
"公司简介"
/>
<property
id=
"pId"
name=
"pId"
ref=
"required"
var=
"公司总公司"
/>
<property
id=
"provinceId"
name=
"provinceId"
ref=
"required"
var=
"行政区划省"
/>
<property
id=
"cityId"
name=
"cityId"
ref=
""
var=
"行政区划市"
/>
<property
id=
"areaId"
name=
"areaId"
ref=
""
var=
"行政区划县"
/>
<property
id=
"townshipId"
name=
"townshipId"
ref=
""
var=
"行政区划镇"
/>
<property
id=
"addressDetailed"
name=
"addressDetailed"
ref=
"required"
var=
"行政区划具体地址"
/>
</url>
<url
id=
"companymation003"
path=
"/post/CompanyMationController/deleteCompanyMationById"
val=
"删除公司信息信息"
allUse=
"1"
>
<property
id=
"rowId"
name=
"id"
ref=
"required"
var=
"公司信息id"
/>
...
...
@@ -748,6 +755,8 @@
<url
id=
"companymation005"
path=
"/post/CompanyMationController/editCompanyMationById"
val=
"编辑公司信息信息"
allUse=
"1"
>
<property
id=
"rowId"
name=
"id"
ref=
"required"
var=
"公司信息id"
/>
</url>
<url
id=
"companymation006"
path=
"/post/CompanyMationController/queryOverAllCompanyMationList"
val=
"获取总公司信息列表"
allUse=
"1"
>
</url>
<!-- 公司管理结束 -->
</controller>
\ No newline at end of file
skyeye-web/src/main/webapp/assets/lib/layui/lay/modules/treetable/treeGrid.js
浏览文件 @
6e22c5d3
...
...
@@ -2312,7 +2312,9 @@ layui.config({
var
index
=
$
(
this
).
attr
(
"
data-index
"
);
var
list
=
table
.
getDataList
(
that
.
config
.
id
);
var
o
=
list
[
index
];
that
.
config
.
onDblClickRow
(
index
,
o
);
if
(
!
isNull
(
that
.
config
.
onDblClickRow
)){
that
.
config
.
onDblClickRow
(
index
,
o
);
}
});
//拖拽调整宽度
th
.
unbind
(
'
mousemove
'
).
on
(
'
mousemove
'
,
function
(
e
){
...
...
skyeye-web/src/main/webapp/js/companymation/companymationadd.js
浏览文件 @
6e22c5d3
...
...
@@ -26,6 +26,19 @@ layui.config({
});
form
.
render
();
showGrid
({
id
:
"
OverAllCompany
"
,
url
:
reqBasePath
+
"
companymation006
"
,
params
:
{},
pagination
:
false
,
template
:
getFileContent
(
'
tpl/template/select-option.tpl
'
),
ajaxSendLoadBefore
:
function
(
hdb
){
},
ajaxSendAfter
:
function
(
json
){
form
.
render
(
'
select
'
);
}
});
//默认隐藏子公司
$
(
"
#parentIdBox
"
).
addClass
(
"
layui-hide
"
);
...
...
@@ -47,11 +60,40 @@ layui.config({
form
.
on
(
'
submit(formAddBean)
'
,
function
(
data
)
{
//表单验证
if
(
winui
.
verifyForm
(
data
.
elem
))
{
var
pId
=
'
0
'
;
if
(
$
(
"
input[name='companyType']:checked
"
).
val
()
==
'
2
'
){
if
(
isNull
(
$
(
"
#OverAllCompany
"
).
val
())){
top
.
winui
.
window
.
msg
(
'
请选择总公司
'
,
{
icon
:
2
,
time
:
2000
});
return
false
;
}
else
{
pId
=
$
(
"
#OverAllCompany
"
).
val
();
}
}
var
provinceId
=
""
,
cityId
=
""
,
areaId
=
""
,
townshipId
=
""
;
if
(
!
isNull
(
$
(
"
#provinceId
"
).
val
())){
provinceId
=
$
(
"
#provinceId
"
).
val
();
}
if
(
!
isNull
(
$
(
"
#cityId
"
).
val
())){
cityId
=
$
(
"
#cityId
"
).
val
();
}
if
(
!
isNull
(
$
(
"
#areaId
"
).
val
())){
areaId
=
$
(
"
#areaId
"
).
val
();
}
if
(
!
isNull
(
$
(
"
#townshipId
"
).
val
())){
townshipId
=
$
(
"
#townshipId
"
).
val
();
}
var
params
=
{
companyName
:
$
(
"
#companyName
"
).
val
(),
companyDesc
:
encodeURI
(
layedit
.
getContent
(
layContent
)),
pId
:
pId
,
provinceId
:
provinceId
,
cityId
:
cityId
,
areaId
:
areaId
,
townshipId
:
townshipId
,
addressDetailed
:
$
(
"
#addressDetailed
"
).
val
(),
};
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
ic
on002
"
,
params
:
params
,
type
:
'
json
'
,
callback
:
function
(
json
){
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
companymati
on002
"
,
params
:
params
,
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
0
'
;
...
...
@@ -89,7 +131,7 @@ layui.config({
function
loadChildProvinceArea
(){
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
commontarea001
"
,
params
:{},
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
var
str
=
'
<dd class="layui-col-xs3"><select
class="areaProvince" id="provinceI
d" lay-filter="areaProvince" lay-search=""><option value="">请选择</option>
'
;
var
str
=
'
<dd class="layui-col-xs3"><select
id="provinceId" win-verify="require
d" lay-filter="areaProvince" lay-search=""><option value="">请选择</option>
'
;
for
(
var
i
=
0
;
i
<
json
.
rows
.
length
;
i
++
){
str
+=
'
<option value="
'
+
json
.
rows
[
i
].
id
+
'
">
'
+
json
.
rows
[
i
].
name
+
'
</option>
'
;
}
...
...
@@ -106,7 +148,7 @@ layui.config({
function
loadChildCityArea
(){
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
commontarea002
"
,
params
:{
rowId
:
$
(
"
#provinceId
"
).
val
()},
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
var
str
=
'
<dd class="layui-col-xs3"><select
class="areaCity"
id="cityId" lay-filter="areaCity" lay-search=""><option value="">请选择</option>
'
;
var
str
=
'
<dd class="layui-col-xs3"><select id="cityId" lay-filter="areaCity" lay-search=""><option value="">请选择</option>
'
;
for
(
var
i
=
0
;
i
<
json
.
rows
.
length
;
i
++
){
str
+=
'
<option value="
'
+
json
.
rows
[
i
].
id
+
'
">
'
+
json
.
rows
[
i
].
name
+
'
</option>
'
;
}
...
...
@@ -123,7 +165,7 @@ layui.config({
function
loadChildArea
(){
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
commontarea003
"
,
params
:{
rowId
:
$
(
"
#cityId
"
).
val
()},
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
var
str
=
'
<dd class="layui-col-xs3"><select
class="area"
id="areaId" lay-filter="area" lay-search=""><option value="">请选择</option>
'
;
var
str
=
'
<dd class="layui-col-xs3"><select id="areaId" lay-filter="area" lay-search=""><option value="">请选择</option>
'
;
for
(
var
i
=
0
;
i
<
json
.
rows
.
length
;
i
++
){
str
+=
'
<option value="
'
+
json
.
rows
[
i
].
id
+
'
">
'
+
json
.
rows
[
i
].
name
+
'
</option>
'
;
}
...
...
@@ -140,7 +182,7 @@ layui.config({
function
loadChildAreaTownShip
(){
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
commontarea004
"
,
params
:{
rowId
:
$
(
"
#areaId
"
).
val
()},
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
var
str
=
'
<dd class="layui-col-xs3"><select
class="areaTownShip"
id="townshipId" lay-filter="areaTownShip" lay-search=""><option value="">请选择</option>
'
;
var
str
=
'
<dd class="layui-col-xs3"><select id="townshipId" lay-filter="areaTownShip" lay-search=""><option value="">请选择</option>
'
;
for
(
var
i
=
0
;
i
<
json
.
rows
.
length
;
i
++
){
str
+=
'
<option value="
'
+
json
.
rows
[
i
].
id
+
'
">
'
+
json
.
rows
[
i
].
name
+
'
</option>
'
;
}
...
...
skyeye-web/src/main/webapp/js/companymation/companymationlist.js
浏览文件 @
6e22c5d3
...
...
@@ -19,13 +19,16 @@ layui.config({
idField
:
'
id
'
,
url
:
reqBasePath
+
'
companymation001
'
,
cellMinWidth
:
100
,
where
:{
companyName
:
$
(
"
#companyName
"
).
val
()},
treeId
:
'
id
'
,
//树形id字段名称
treeUpId
:
'
pId
'
,
//树形父id字段名称
treeShowName
:
'
companyName
'
,
//以树形式显示的字段
cols
:
[[
{
field
:
'
companyName
'
,
width
:
150
,
title
:
'
公司名称
'
},
{
field
:
'
companyDesc
'
,
width
:
200
,
title
:
'
公司简介
'
},
{
field
:
'
id
'
,
width
:
200
,
title
:
'
公司地址
'
,
templet
:
function
(
d
){
{
field
:
'
companyName
'
,
width
:
300
,
title
:
'
公司名称
'
},
{
field
:
'
companyDesc
'
,
width
:
100
,
title
:
'
公司简介
'
,
templet
:
function
(
d
){
return
'
<i class="fa fa-fw fa-html5 cursor" lay-event="companyDesc"></i>
'
;
}},
{
field
:
'
id
'
,
width
:
400
,
title
:
'
公司地址
'
,
templet
:
function
(
d
){
var
str
=
d
.
provinceName
+
"
"
;
if
(
!
isNull
(
d
.
cityName
)){
str
+=
d
.
cityName
+
"
"
;
...
...
@@ -41,6 +44,7 @@ layui.config({
}
return
str
;
}},
{
field
:
'
createTime
'
,
width
:
150
,
title
:
'
录入时间
'
},
{
title
:
'
操作
'
,
fixed
:
'
right
'
,
align
:
'
center
'
,
width
:
240
,
toolbar
:
'
#tableBar
'
}
]],
isPage
:
false
...
...
@@ -53,6 +57,15 @@ layui.config({
del
(
data
,
obj
);
}
else
if
(
layEvent
===
'
edit
'
)
{
//编辑
edit
(
data
);
}
else
if
(
layEvent
===
'
companyDesc
'
)
{
//公司简介
layer
.
open
({
id
:
'
公司简介
'
,
type
:
1
,
title
:
'
公司简介
'
,
shade
:
0.3
,
area
:
[
'
1200px
'
,
'
600px
'
],
content
:
data
.
companyDesc
,
});
}
});
...
...
@@ -122,7 +135,7 @@ layui.config({
});
function
loadTable
(){
treeGrid
.
query
(
"
messageTable
"
,
{
where
:{}});
treeGrid
.
query
(
"
messageTable
"
,
{
where
:{
companyName
:
$
(
"
#companyName
"
).
val
()
}});
}
exports
(
'
companymationlist
'
,
{});
...
...
skyeye-web/src/main/webapp/tpl/companymation/companymationadd.html
浏览文件 @
6e22c5d3
...
...
@@ -26,6 +26,9 @@
<div
class=
"layui-form-item"
id=
"parentIdBox"
>
<label
class=
"layui-form-label"
>
总公司
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<select
id=
"OverAllCompany"
lay-filter=
"OverAllCompany"
lay-search=
""
>
<option
value=
""
>
请选择
</option>
</select>
</div>
</div>
<div
class=
"layui-form-item"
>
...
...
skyeye-web/src/main/webapp/tpl/companymation/companymationlist.html
浏览文件 @
6e22c5d3
...
...
@@ -12,7 +12,10 @@
<form
class=
"layui-form layui-form-pane"
action=
""
autocomplete=
"off"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
公司名称
</label>
<div
class=
"layui-input-inline"
>
<input
id=
"companyName"
name=
"companyName"
class=
"layui-input"
/>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录