Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
57ad68e9
Commit
57ad68e9
authored
Jun 18, 2021
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态表单
parent
165d4afb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
125 additions
and
56 deletions
+125
-56
AlertFrom.java
...om/yeejoin/amos/boot/module/jcs/api/entity/AlertFrom.java
+3
-0
AlertFromValue.java
...ejoin/amos/boot/module/jcs/api/entity/AlertFromValue.java
+16
-1
AlertFromVo.java
.../com/yeejoin/amos/boot/module/jcs/api/vo/AlertFromVo.java
+11
-7
AlertListvalue.java
...m/yeejoin/amos/boot/module/jcs/api/vo/AlertListvalue.java
+17
-9
FromList.java
...ava/com/yeejoin/amos/boot/module/jcs/api/vo/FromList.java
+34
-25
Items.java
...n/java/com/yeejoin/amos/boot/module/jcs/api/vo/Items.java
+33
-0
AlertFromController.java
...s/boot/module/jcs/biz/controller/AlertFromController.java
+11
-14
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/entity/AlertFrom.java
View file @
57ad68e9
...
...
@@ -42,5 +42,8 @@ public class AlertFrom extends BaseEntity {
@ApiModelProperty
(
value
=
"操作人名称"
)
private
String
recUserName
;
@ApiModelProperty
(
value
=
"字段值字典code"
)
private
String
fieldValueCode
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/entity/AlertFromValue.java
View file @
57ad68e9
...
...
@@ -29,7 +29,7 @@ public class AlertFromValue extends BaseEntity {
@ApiModelProperty
(
value
=
"表单id"
)
private
Integer
alertFromId
;
private
Long
alertFromId
;
@ApiModelProperty
(
value
=
"警情id"
)
private
Long
alertCalledId
;
...
...
@@ -52,4 +52,19 @@ public class AlertFromValue extends BaseEntity {
@ApiModelProperty
(
value
=
"操作人名称"
)
private
String
recUserName
;
public
AlertFromValue
()
{
super
();
}
public
AlertFromValue
(
Long
alertFromId
,
String
fieldName
,
String
fieldCode
)
{
super
();
this
.
alertFromId
=
alertFromId
;
this
.
fieldName
=
fieldName
;
this
.
fieldCode
=
fieldCode
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/vo/AlertFromVo.java
View file @
57ad68e9
...
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.jcs.api.vo;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -33,19 +35,21 @@ public class AlertFromVo{
@ApiModelProperty
(
value
=
"表单类型"
)
private
String
type
;
@ApiModelProperty
(
value
=
"表单
初始化
值"
)
private
String
data
;
@ApiModelProperty
(
value
=
"表单值"
)
private
Items
data
;
public
AlertFromVo
(
String
key
,
String
label
,
String
type
,
String
data
)
{
@ApiModelProperty
(
value
=
"提交表单附加字段"
)
private
AlertFromValue
formItemDescr
;
public
AlertFromVo
()
{
super
();
}
public
AlertFromVo
(
String
key
,
String
label
,
String
type
,
Items
data
,
AlertFromValue
formItemDescr
)
{
super
();
this
.
key
=
key
;
this
.
label
=
label
;
this
.
type
=
type
;
this
.
data
=
data
;
}
public
AlertFromVo
()
{
super
();
this
.
formItemDescr
=
formItemDescr
;
}
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/vo/AlertListvalue.java
View file @
57ad68e9
...
...
@@ -5,7 +5,8 @@ package com.yeejoin.amos.boot.module.jcs.api.vo;
* */
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
AlertListvalue
{
@ApiModelProperty
(
value
=
"key"
)
...
...
@@ -17,14 +18,21 @@ public class AlertListvalue {
@ApiModelProperty
(
value
=
"值"
)
private
String
value
;
@ApiModelProperty
(
value
=
"表单id"
)
private
Long
alertFromId
;
@ApiModelProperty
(
value
=
"英文名称"
)
private
String
fieldCode
;
@ApiModelProperty
(
value
=
"字段值字典code"
)
private
String
fieldValueCode
;
public
AlertListvalue
(
String
key
,
String
text
,
String
value
)
{
super
();
this
.
key
=
key
;
this
.
text
=
text
;
this
.
value
=
value
;
}
@Override
public
String
toString
()
{
return
"AlertListvalue []"
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/vo/FromList.java
View file @
57ad68e9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
vo
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.velocity.runtime.directive.Foreach
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFrom
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.DataDictionary
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IDataDictionaryService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IFireTeamService
;
@Component
public
class
FromList
{
/**
* 数据字典
*
*
*/
/**
* 数据字典
*
*/
@Autowired
I
FireTeamService
iFireTeam
Service
;
I
DataDictionaryService
iDataDictionary
Service
;
public
static
List
<
AlertFromVo
>
getFromlist
(
List
<
AlertFrom
>
list
)
{
public
List
<
AlertFromVo
>
getFromlist
(
List
<
AlertFrom
>
list
)
{
List
<
AlertFromVo
>
listfrom
=
new
ArrayList
<
AlertFromVo
>();
// 组装数据
for
(
AlertFrom
alertFrom
:
list
)
{
switch
(
alertFrom
.
getFieldType
())
{
case
"select"
:
if
(
alertFrom
.
getFieldType
().
equals
(
"string"
)||
alertFrom
.
getFieldType
().
equals
(
"date"
)||
alertFrom
.
getFieldType
().
equals
(
"textarea"
))
{
AlertFromVo
vo
=
new
AlertFromVo
(
alertFrom
.
getFieldCode
(),
alertFrom
.
getFieldName
(),
alertFrom
.
getFieldType
(),
null
,
new
AlertFromValue
(
alertFrom
.
getSequenceNbr
(),
alertFrom
.
getFieldName
(),
alertFrom
.
getFieldCode
()));
listfrom
.
add
(
vo
);
}
else
{
// 查询数据项
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
columnMap
.
put
(
"type"
,
alertFrom
.
getFieldValueCode
());
Collection
<
DataDictionary
>
listDataDictionary
=
iDataDictionaryService
.
listByMap
(
columnMap
);
AlertFromVo
vo
=
new
AlertFromVo
(
alertFrom
.
getFieldCode
(),
alertFrom
.
getFieldName
(),
alertFrom
.
getFieldType
(),
new
Items
(
getdata
(
listDataDictionary
)),
new
AlertFromValue
(
alertFrom
.
getSequenceNbr
(),
alertFrom
.
getFieldName
(),
alertFrom
.
getFieldCode
()));
listfrom
.
add
(
vo
);
}
}
AlertFromVo
vo
=
new
AlertFromVo
(
null
,
null
,
null
,
null
);
break
;
case
"date"
:
break
;
case
"radio"
:
break
;
return
listfrom
;
}
default
:
break
;
}
public
List
<
AlertListvalue
>
getdata
(
Collection
<
DataDictionary
>
list
)
{
List
<
AlertListvalue
>
listAlertListvalue
=
new
ArrayList
<
AlertListvalue
>()
;
for
(
DataDictionary
dataDictionary
:
list
)
{
listAlertListvalue
.
add
(
new
AlertListvalue
(
dataDictionary
.
getSequenceNbr
().
toString
(),
dataDictionary
.
getCode
(),
dataDictionary
.
getName
()));
}
return
null
;
return
listAlertListvalue
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/vo/Items.java
0 → 100644
View file @
57ad68e9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
vo
;
import
java.util.List
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 动态表单值
*
**/
@Data
public
class
Items
{
@ApiModelProperty
(
value
=
"初始化值"
)
private
List
<
AlertListvalue
>
items
;
public
Items
()
{
super
();
}
public
Items
(
List
<
AlertListvalue
>
items
)
{
super
();
this
.
items
=
items
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertFromController.java
View file @
57ad68e9
...
...
@@ -7,7 +7,8 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertFromService
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertFromVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FromList
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -16,8 +17,10 @@ import org.springframework.web.bind.annotation.*;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFrom
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue
;
import
com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
java.util.Arrays
;
import
java.util.List
;
...
...
@@ -36,7 +39,8 @@ public class AlertFromController extends BaseController {
@Autowired
IAlertFromService
iAlertFromService
;
@Autowired
FromList
fromList
;
/**
* 新增警情表单
* @return
...
...
@@ -97,25 +101,18 @@ public class AlertFromController extends BaseController {
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{code}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/
from/
{code}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
AlertFrom
selectFromdItem
(
HttpServletRequest
request
,
@PathVariable
String
code
){
public
ResponseModel
selectFromdItem
(
HttpServletRequest
request
,
@PathVariable
String
code
){
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"alert_type_code"
,
code
);
//警情动态表单数据
List
<
AlertFrom
>
alertFromValue
=
iAlertFromService
.
list
(
queryWrapper
);
List
<
AlertFromVo
>
list
=
fromList
.
getFromlist
(
alertFromValue
);
return
null
;
return
CommonResponseUtil
.
success
(
list
);
}
...
...
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