Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fill-system
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖旭伟
fill-system
Commits
f55867d3
Commit
f55867d3
authored
Oct 09, 2022
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础事项转事项接口,事项推荐或者取消接口,事项申请材料推荐或取消接口
parent
fa6b84b2
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
464 additions
and
142 deletions
+464
-142
fill-manager/doc/api.md
fill-manager/doc/api.md
+109
-0
fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/ParamService.java
...m/mortals/xhx/base/system/param/service/ParamService.java
+8
-0
fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/impl/ParamServiceImpl.java
.../xhx/base/system/param/service/impl/ParamServiceImpl.java
+25
-0
fill-manager/src/main/java/com/mortals/xhx/common/key/ParamKey.java
...er/src/main/java/com/mortals/xhx/common/key/ParamKey.java
+4
-1
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterDatumService.java
...mortals/xhx/module/matter/service/MatterDatumService.java
+5
-1
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterService.java
.../com/mortals/xhx/module/matter/service/MatterService.java
+11
-0
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterDatumServiceImpl.java
...hx/module/matter/service/impl/MatterDatumServiceImpl.java
+168
-139
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
...als/xhx/module/matter/service/impl/MatterServiceImpl.java
+67
-1
fill-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterController.java
...a/com/mortals/xhx/module/matter/web/MatterController.java
+46
-0
fill-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterDatumController.java
.../mortals/xhx/module/matter/web/MatterDatumController.java
+21
-0
No files found.
fill-manager/doc/api.md
View file @
f55867d3
...
...
@@ -1174,6 +1174,78 @@ msg|String|消息|-
"msg":"成功"
}
```
### 基础事项转为事项
**请求URL:**
matter/createMatter
**请求方式:**
GET
**内容类型:**
application/json;charset=utf-8
**简要描述:**
基础事项转为事项
**请求参数:**
参数名称|类型|必填|描述
:---|:---|:---|:------
ids|String|是|数组
**请求样例:**
```
http://localhost:8080/matter/createMatter?ids=1&id=2'
```
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|-
**响应消息样例:**
```
{
"code":1,
"msg":"成功"
}
```
### 推荐或取消推荐事项
**请求URL:**
matter/recommend
**请求方式:**
GET
**内容类型:**
application/json;charset=utf-8
**简要描述:**
推荐或取消推荐事项
**请求参数:**
参数名称|类型|必填|描述
:---|:---|:---|:------
id|String|是|数组
**请求样例:**
```
http://localhost:8080/matter/recommend?id=1&id=2'
```
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|-
**响应消息样例:**
```
{
"code":1,
"msg":"成功"
}
```
## 事项申请材料
...
...
@@ -1431,6 +1503,43 @@ msg|String|消息|-
}
```
### 推荐或取消推荐事项申请材料
**请求URL:**
matter/datum/recommend
**请求方式:**
GET
**内容类型:**
application/json;charset=utf-8
**简要描述:**
推荐或取消推荐事项申请材料
**请求参数:**
参数名称|类型|必填|描述
:---|:---|:---|:------
id|String|是|数组
**请求样例:**
```
http://localhost:8080/matter/datum/recommend?id=1&id=2'
```
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|-
**响应消息样例:**
```
{
"code":1,
"msg":"成功"
}
```
## 首页接口
### 查询用户站点列表
...
...
fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/ParamService.java
View file @
f55867d3
...
...
@@ -68,4 +68,12 @@ public interface ParamService extends ICRUDCacheService<ParamEntity, Long>, IPar
*/
void
setPrintDisplayQuantity
(
int
value
);
/**
* 通过Key设置参数值 value
* @param key
* @param value
* @return
*/
void
setValueByKey
(
String
key
,
String
value
);
}
\ No newline at end of file
fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/impl/ParamServiceImpl.java
View file @
f55867d3
...
...
@@ -126,6 +126,31 @@ public class ParamServiceImpl extends AbstractCRUDCacheServiceImpl<ParamDao, Par
}
}
@Override
public
void
setValueByKey
(
String
key
,
String
value
)
{
List
<
ParamEntity
>
list
=
this
.
getCacheList
();
ParamEntity
entity
=
null
;
for
(
ParamEntity
paramEntity:
list
){
if
(
key
.
equals
(
paramEntity
.
getParamKey
())){
entity
=
paramEntity
;
break
;
}
}
if
(
entity
!=
null
){
entity
.
setParamValue
(
String
.
valueOf
(
value
));
this
.
update
(
entity
);
}
else
{
entity
=
new
ParamEntity
();
entity
.
setParamValue
(
String
.
valueOf
(
value
));
entity
.
setParamKey
(
key
);
entity
.
setName
(
"key"
);
entity
.
setCreateTime
(
new
Date
());
entity
.
setCreateUserId
(
1
l
);
entity
.
setCreateUserName
(
"系统管理员"
);
this
.
save
(
entity
);
}
}
@Override
public
boolean
needRefresh
()
{
...
...
fill-manager/src/main/java/com/mortals/xhx/common/key/ParamKey.java
View file @
f55867d3
...
...
@@ -11,5 +11,8 @@ public class ParamKey {
public
static
final
String
FILE_URL
=
"iot:base:param:fileUrl"
;
/** 物料编码长度,默认6 */
public
static
final
String
MATERIA_CODE_LENGTH
=
"iot:base:param:materia:length"
;
/** 事项推荐个数 */
public
static
final
String
MATTER_RECOMMEND_COUNT
=
"matter:recommend"
;
/** 事项材料推荐个数 */
public
static
final
String
MATTER_DATUM_RECOMMEND_COUNT
=
"matter:datum:recommend"
;
}
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterDatumService.java
View file @
f55867d3
...
...
@@ -19,5 +19,9 @@ public interface MatterDatumService extends ICRUDService<MatterDatumEntity,Long>
*/
String
mergeFormToDoc
(
MatterDatumEntity
docFormVo
,
Context
context
);
/**
* 推荐or取消推荐
* @param id
*/
void
recommend
(
Long
id
);
}
\ No newline at end of file
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterService.java
View file @
f55867d3
...
...
@@ -11,4 +11,15 @@ import com.mortals.xhx.module.matter.model.MatterEntity;
*/
public
interface
MatterService
extends
ICRUDService
<
MatterEntity
,
Long
>{
/**
* 站点事项转系统事项
* @param sheetMatterIds
*/
void
createMatterbBySheetMatter
(
Long
[]
sheetMatterIds
);
/**
* 推荐or取消推荐
* @param id
*/
void
recommend
(
Long
id
);
}
\ No newline at end of file
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterDatumServiceImpl.java
View file @
f55867d3
This diff is collapsed.
Click to expand it.
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
View file @
f55867d3
package
com.mortals.xhx.module.matter.service.impl
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.key.ParamKey
;
import
com.mortals.xhx.module.sheet.dao.SheetMatterDao
;
import
com.mortals.xhx.module.sheet.model.SheetMatterEntity
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
...
...
@@ -6,6 +12,9 @@ import com.mortals.framework.model.Context;
import
com.mortals.xhx.module.matter.dao.MatterDao
;
import
com.mortals.xhx.module.matter.model.MatterEntity
;
import
com.mortals.xhx.module.matter.service.MatterService
;
import
java.util.*
;
/**
* MatterService
* 事项申请材料 service实现
...
...
@@ -16,4 +25,61 @@ import com.mortals.xhx.module.matter.service.MatterService;
@Service
(
"matterService"
)
public
class
MatterServiceImpl
extends
AbstractCRUDServiceImpl
<
MatterDao
,
MatterEntity
,
Long
>
implements
MatterService
{
@Autowired
private
ParamService
paramService
;
@Autowired
private
SheetMatterDao
sheetMatterDao
;
@Override
public
void
createMatterbBySheetMatter
(
Long
[]
sheetMatterIds
)
{
List
<
SheetMatterEntity
>
sheetMatterEntityList
=
sheetMatterDao
.
get
(
sheetMatterIds
);
if
(
CollectionUtils
.
isNotEmpty
(
sheetMatterEntityList
)){
Date
now
=
new
Date
();
List
<
MatterEntity
>
list
=
new
ArrayList
<>();
for
(
SheetMatterEntity
sheetMatterEntity:
sheetMatterEntityList
){
MatterEntity
matterEntity
=
new
MatterEntity
();
matterEntity
.
setSiteId
(
sheetMatterEntity
.
getSiteId
());
matterEntity
.
setTid
(
sheetMatterEntity
.
getTid
());
matterEntity
.
setTcode
(
sheetMatterEntity
.
getTcode
());
matterEntity
.
setTname
(
sheetMatterEntity
.
getTname
());
matterEntity
.
setMatterName
(
sheetMatterEntity
.
getMatterName
());
matterEntity
.
setEnglishName
(
sheetMatterEntity
.
getEnglishName
());
matterEntity
.
setMatterNo
(
sheetMatterEntity
.
getMatterNo
());
matterEntity
.
setMatterFullName
(
sheetMatterEntity
.
getMatterName
());
matterEntity
.
setTotal
(
0
);
matterEntity
.
setSort
(
0
);
matterEntity
.
setIsRecommend
(
0
);
matterEntity
.
setCreateUserId
(
1
l
);
matterEntity
.
setCreateTime
(
now
);
list
.
add
(
matterEntity
);
}
this
.
dao
.
insertBatch
(
list
);
}
}
@Override
public
void
recommend
(
Long
id
)
{
MatterEntity
matterEntity
=
this
.
dao
.
get
(
id
);
if
(
matterEntity
==
null
){
throw
new
AppException
(
"数据已更改,请重试"
);
}
int
recommendCount
=
paramService
.
getParamIntValue
(
ParamKey
.
MATTER_RECOMMEND_COUNT
);
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
Map
<
String
,
Object
>
condition
=
new
HashMap
<>();
condition
.
put
(
"id"
,
id
);
boolean
IsAdd
=
false
;
if
(
matterEntity
.
getIsRecommend
()==
0
){
if
(
recommendCount
==
6
){
throw
new
AppException
(
"超过推荐个数"
);
}
recommendCount
++;
data
.
put
(
"isRecommend"
,
1
);
}
else
{
recommendCount
--;
data
.
put
(
"isRecommend"
,
0
);
}
this
.
dao
.
update
(
data
,
condition
);
paramService
.
setValueByKey
(
ParamKey
.
MATTER_RECOMMEND_COUNT
,
String
.
valueOf
(
recommendCount
));
}
}
\ No newline at end of file
fill-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterController.java
View file @
f55867d3
package
com.mortals.xhx.module.matter.web
;
import
com.mortals.framework.common.code.YesNo
;
import
com.mortals.framework.service.IUser
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -46,5 +49,48 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
super
.
init
(
model
,
context
);
}
@RequestMapping
(
value
=
{
"createMatter"
},
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
})
public
String
createMatter
(
Long
[]
ids
)
{
Context
context
=
this
.
getContext
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
int
code
=
1
;
String
busiDesc
=
"站点事项转事项"
;
try
{
this
.
service
.
createMatterbBySheetMatter
(
ids
);
model
.
put
(
"message_info"
,
"站点事项转事项成功!"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】 [id:"
+
ids
+
"]"
);
}
catch
(
Exception
var7
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var7
);
}
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
Integer
.
valueOf
(
code
));
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"data"
,
model
);
return
ret
.
toJSONString
();
}
@RequestMapping
(
value
=
{
"recommend"
},
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
})
public
String
recommend
(
Long
id
)
{
Context
context
=
this
.
getContext
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
int
code
=
1
;
String
busiDesc
=
"推荐or取消推荐"
+
this
.
getModuleDesc
();
try
{
this
.
service
.
recommend
(
id
);
model
.
put
(
"message_info"
,
this
.
getModuleDesc
()
+
"推荐or取消推荐成功!"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】 [id:"
+
id
+
"]"
);
}
catch
(
Exception
var7
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var7
);
}
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
Integer
.
valueOf
(
code
));
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"data"
,
model
);
return
ret
.
toJSONString
();
}
}
\ No newline at end of file
fill-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterDatumController.java
View file @
f55867d3
...
...
@@ -47,4 +47,25 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
super
.
init
(
model
,
context
);
}
@RequestMapping
(
value
=
{
"recommend"
},
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
})
public
String
recommend
(
Long
id
)
{
Context
context
=
this
.
getContext
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
int
code
=
1
;
String
busiDesc
=
"推荐or取消推荐"
+
this
.
getModuleDesc
();
try
{
this
.
service
.
recommend
(
id
);
model
.
put
(
"message_info"
,
this
.
getModuleDesc
()
+
"推荐or取消推荐成功!"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】 [id:"
+
id
+
"]"
);
}
catch
(
Exception
var7
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var7
);
}
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
Integer
.
valueOf
(
code
));
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"data"
,
model
);
return
ret
.
toJSONString
();
}
}
\ No newline at end of file
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