Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sunac_report
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
java-sunac-report
sunac_report
Commits
8825972e
Commit
8825972e
authored
Aug 30, 2019
by
sunxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业务类型数据回显修复
parent
4b366b17
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
14 deletions
+106
-14
DictDao.java
src/main/java/com/ejweb/modules/sys/dao/DictDao.java
+5
-0
DictService.java
src/main/java/com/ejweb/modules/sys/service/DictService.java
+9
-0
DictController.java
src/main/java/com/ejweb/modules/sys/web/DictController.java
+9
-0
DictDao.xml
src/main/resources/mappings/modules/sys/DictDao.xml
+9
-1
ctBbtcBusTypeForm.jsp
src/main/webapp/WEB-INF/views/modules/report/ctBbtcBusTypeForm.jsp
+74
-13
No files found.
src/main/java/com/ejweb/modules/sys/dao/DictDao.java
View file @
8825972e
...
@@ -18,5 +18,10 @@ import com.ejweb.modules.sys.entity.Dict;
...
@@ -18,5 +18,10 @@ import com.ejweb.modules.sys.entity.Dict;
public
interface
DictDao
extends
CrudDao
<
Dict
>
{
public
interface
DictDao
extends
CrudDao
<
Dict
>
{
public
List
<
String
>
findTypeList
(
Dict
dict
);
public
List
<
String
>
findTypeList
(
Dict
dict
);
/*跟据type查询集团信息*/
public
List
<
Dict
>
getByType
(
Dict
dict
);
}
}
src/main/java/com/ejweb/modules/sys/service/DictService.java
View file @
8825972e
...
@@ -5,6 +5,7 @@ package com.ejweb.modules.sys.service;
...
@@ -5,6 +5,7 @@ package com.ejweb.modules.sys.service;
import
java.util.List
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -22,6 +23,9 @@ import com.ejweb.modules.sys.utils.DictUtils;
...
@@ -22,6 +23,9 @@ import com.ejweb.modules.sys.utils.DictUtils;
@Service
@Service
@Transactional
(
readOnly
=
true
)
@Transactional
(
readOnly
=
true
)
public
class
DictService
extends
CrudService
<
DictDao
,
Dict
>
{
public
class
DictService
extends
CrudService
<
DictDao
,
Dict
>
{
@Autowired
private
DictDao
dao
;
/**
/**
* 查询字段类型列表
* 查询字段类型列表
...
@@ -42,5 +46,10 @@ public class DictService extends CrudService<DictDao, Dict> {
...
@@ -42,5 +46,10 @@ public class DictService extends CrudService<DictDao, Dict> {
super
.
delete
(
dict
);
super
.
delete
(
dict
);
CacheUtils
.
remove
(
DictUtils
.
CACHE_DICT_MAP
);
CacheUtils
.
remove
(
DictUtils
.
CACHE_DICT_MAP
);
}
}
/*跟据type查询集团信息*/
@Transactional
(
readOnly
=
false
)
public
List
<
Dict
>
getByType
(
Dict
dict
)
{
return
dao
.
getByType
(
dict
);
}
}
}
src/main/java/com/ejweb/modules/sys/web/DictController.java
View file @
8825972e
...
@@ -120,4 +120,13 @@ public class DictController extends BaseController {
...
@@ -120,4 +120,13 @@ public class DictController extends BaseController {
return
dictService
.
findList
(
dict
);
return
dictService
.
findList
(
dict
);
}
}
/*跟据type查询集团信息*/
@ResponseBody
@RequestMapping
(
value
=
"getByType"
)
public
List
<
Dict
>
getByType
(
String
type
)
{
Dict
dict
=
new
Dict
();
dict
.
setType
(
type
);
return
dictService
.
getByType
(
dict
);
}
}
}
src/main/resources/mappings/modules/sys/DictDao.xml
View file @
8825972e
...
@@ -8,7 +8,15 @@
...
@@ -8,7 +8,15 @@
FROM ct_bbtc_sys_dict
FROM ct_bbtc_sys_dict
WHERE id = #{id}
WHERE id = #{id}
</select>
</select>
<!--跟据type查询集团信息-->
<select
id=
"getByType"
resultType=
"Dict"
>
SELECT
*
FROM ct_bbtc_sys_dict
WHERE type = #{type}
</select>
<select
id=
"findList"
resultType=
"Dict"
>
<select
id=
"findList"
resultType=
"Dict"
>
SELECT
SELECT
*
*
...
...
src/main/webapp/WEB-INF/views/modules/report/ctBbtcBusTypeForm.jsp
View file @
8825972e
...
@@ -28,11 +28,7 @@
...
@@ -28,11 +28,7 @@
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
idx
:
idx
,
delBtn
:
true
,
row
:
row
idx
:
idx
,
delBtn
:
true
,
row
:
row
}));
}));
getGroup
(
list
,
idx
);
$
(
list
+
idx
).
find
(
"select"
).
each
(
function
()
{
$
(
this
).
val
(
$
(
this
).
attr
(
"data-value"
));
});
genSeqNo
();
genSeqNo
();
}
}
...
@@ -54,15 +50,62 @@
...
@@ -54,15 +50,62 @@
});
});
}
}
/* 获取集团列表并选中 */
function
getGroup
(
scopeList
,
idx
){
$
.
ajax
({
type
:
"POST"
,
url
:
"${ctx}/sys/dict/getByType?type=supplement_group"
,
dataType
:
"json"
,
success
:
function
(
returnedData
)
{
var
data1
=
returnedData
;
var
data00
=
$
{
fns
:
toJson
(
cloudAreaList
)};
if
(
data1
!=
''
)
{
var
slsb
=
$
(
scopeList
+
idx
+
"_group"
);
for
(
var
i
=
0
;
i
<
data1
.
length
;
i
++
){
/* slsb.append(new Option(data1[i].name,data1[i].id) );*/
var
value
=
data1
[
i
].
id
;
var
label
=
data1
[
i
].
label
;
if
(
data00
[
idx
]
!=
null
){
if
(
data00
[
idx
].
group
==
label
){
slsb
.
append
(
"<option value="
+
value
+
" selected='true' >"
+
label
+
"</option>"
);
}
else
{
slsb
.
append
(
"<option value="
+
value
+
" >"
+
label
+
"</option>"
);
}
getRegion
(
scopeList
,
idx
);
}
else
{
slsb
.
append
(
"<option value="
+
value
+
" >"
+
label
+
"</option>"
);
}
}
}
},
error
:
function
(
data
){
alert
(
"系统错误"
);
}
});
}
/*跟据集团 获取对应的业务类型 和业务类别 */
/*跟据集团 获取对应的业务类型 和业务类别 */
function
getRegion
(
scopeList
){
function
getRegion
(
scopeList
,
idx
){
var
selectNode
=
$
(
scopeList
+
"_area"
);
if
(
idx
!=
null
){
var
selectNode
=
$
(
scopeList
+
idx
+
"_area"
);
}
else
{
var
selectNode
=
$
(
scopeList
+
"_area"
);
}
selectNode
.
empty
();
//每次需要将上一次的数据进行清空
selectNode
.
empty
();
//每次需要将上一次的数据进行清空
selectNode
.
append
(
"<option value=''>请选择</option>"
);
selectNode
.
append
(
"<option value=''>请选择</option>"
);
if
(
idx
!=
null
){
var
ts_describe
=
$
(
scopeList
+
idx
+
"_group"
).
val
();
}
else
{
var
ts_describe
=
$
(
scopeList
+
"_group"
).
val
();
}
var
ts_describe
=
$
(
scopeList
+
"_group"
).
val
();
if
(
ts_describe
!=
null
&&
ts_describe
!=
''
){
if
(
ts_describe
!=
null
&&
ts_describe
!=
''
){
$
.
ajax
({
$
.
ajax
({
type
:
"POST"
,
type
:
"POST"
,
...
@@ -70,11 +113,30 @@
...
@@ -70,11 +113,30 @@
dataType
:
"json"
,
dataType
:
"json"
,
success
:
function
(
returnedData
)
{
success
:
function
(
returnedData
)
{
var
data1
=
returnedData
.
ctBbtcRegionList
;
var
data1
=
returnedData
.
ctBbtcRegionList
;
var
data00
=
$
{
fns
:
toJson
(
cloudAreaList
)};
if
(
data1
!=
''
)
{
if
(
data1
!=
''
)
{
var
slsb
=
$
(
scopeList
+
"_area"
);
if
(
idx
!=
null
){
var
slsb
=
$
(
scopeList
+
idx
+
"_area"
);
}
else
{
var
slsb
=
$
(
scopeList
+
"_area"
);
}
for
(
var
i
=
0
;
i
<
data1
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
data1
.
length
;
i
++
){
slsb
.
append
(
new
Option
(
data1
[
i
].
name
,
data1
[
i
].
id
));
/* slsb.append(new Option(data1[i].name,data1[i].id) );*/
var
value
=
data1
[
i
].
id
;
var
label
=
data1
[
i
].
name
;
if
(
data00
[
idx
]
!=
null
){
if
(
data00
[
idx
].
area
==
label
){
slsb
.
append
(
"<option value="
+
value
+
" selected='true' >"
+
label
+
"</option>"
);
}
else
{
slsb
.
append
(
"<option value="
+
value
+
" >"
+
label
+
"</option>"
);
}
}
else
{
slsb
.
append
(
"<option value="
+
value
+
" >"
+
label
+
"</option>"
);
}
}
}
}
}
},
error
:
function
(
data
){
},
error
:
function
(
data
){
alert
(
"系统错误"
);
alert
(
"系统错误"
);
...
@@ -165,8 +227,7 @@
...
@@ -165,8 +227,7 @@
<
td
>
<
td
>
<
form
:
select
id
=
"scopeList{{idx}}_group"
path
=
"group"
class
=
"input-small required"
onchange
=
"getRegion('#scopeList{{idx}}')"
cssStyle
=
"width: 280px"
>
<
form
:
select
id
=
"scopeList{{idx}}_group"
path
=
"group"
class
=
"input-small required"
onchange
=
"getRegion('#scopeList{{idx}}')"
cssStyle
=
"width: 280px"
>
<
form
:
option
value
=
""
>
请选择
<
/form:option
>
<
form
:
option
value
=
""
>
请选择
<
/form:option
>
<
form
:
options
items
=
"${fns:getDictList('supplement_group')}"
itemLabel
=
"label"
itemValue
=
"id"
htmlEscape
=
"false"
/>
<
/form:select
>
<
/form:select
>
<
/td
>
<
/td
>
<
td
>
<
td
>
...
@@ -189,7 +250,7 @@
...
@@ -189,7 +250,7 @@
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
addRow
(
'#scopeList'
,
scopeRowIdx
,
scopeTpl
,
data
[
i
]);
addRow
(
'#scopeList'
,
scopeRowIdx
,
scopeTpl
,
data
[
i
]);
scopeRowIdx
=
scopeRowIdx
+
1
;
scopeRowIdx
=
scopeRowIdx
+
1
;
}
}
});
});
</script>
</script>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment