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
9eccdb5b
Commit
9eccdb5b
authored
Oct 11, 2022
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改测试bug
parent
e96a0623
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
11 deletions
+56
-11
fill-manager/src/main/java/com/mortals/xhx/module/home/web/HomeController.java
.../java/com/mortals/xhx/module/home/web/HomeController.java
+10
-8
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterDatumServiceImpl.java
...hx/module/matter/service/impl/MatterDatumServiceImpl.java
+24
-1
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
...als/xhx/module/matter/service/impl/MatterServiceImpl.java
+22
-2
No files found.
fill-manager/src/main/java/com/mortals/xhx/module/home/web/HomeController.java
View file @
9eccdb5b
...
...
@@ -92,11 +92,12 @@ public class HomeController extends BaseJsonBodyController {
}
@PostMapping
({
"dept/list"
})
@UnAuth
public
Rest
<
Object
>
deptList
(
@RequestBody
HomeQueryPdu
queryPdu
)
{
IUser
user
=
this
.
getCurUser
();
if
(
user
==
null
){
throw
new
AppException
(
"用户未登录"
);
}
//
IUser user = this.getCurUser();
//
if(user==null){
//
throw new AppException("用户未登录");
//
}
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
String
busiDesc
=
"查询站点部门列表"
;
...
...
@@ -136,11 +137,12 @@ public class HomeController extends BaseJsonBodyController {
}
@PostMapping
({
"device/list"
})
@UnAuth
public
Rest
<
Object
>
deviceList
(
@RequestBody
DevicePdu
queryPdu
)
{
IUser
user
=
this
.
getCurUser
();
if
(
user
==
null
){
throw
new
AppException
(
"用户未登录"
);
}
//
IUser user = this.getCurUser();
//
if(user==null){
//
throw new AppException("用户未登录");
//
}
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
String
busiDesc
=
"查询站点设备列表"
;
...
...
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterDatumServiceImpl.java
View file @
9eccdb5b
...
...
@@ -29,6 +29,7 @@ import com.mortals.xhx.common.pdu.gen.component.ComponentCons;
import
com.mortals.xhx.common.utils.ExportDocUtil
;
import
com.mortals.xhx.common.utils.WordUtil
;
import
com.mortals.xhx.module.matter.model.MatterEntity
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.http.entity.ContentType
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -58,6 +59,8 @@ import java.util.stream.Collectors;
@Service
(
"matterDatumService"
)
public
class
MatterDatumServiceImpl
extends
AbstractCRUDServiceImpl
<
MatterDatumDao
,
MatterDatumEntity
,
Long
>
implements
MatterDatumService
{
private
static
int
RECOMMEND_COUNT
=
5
;
@Value
(
"${upload.path}"
)
private
String
filePath
;
@Value
(
"${upload.url:http://localhost:17215/fsm/file/commonupload?prePath=/file/uploadfile}"
)
...
...
@@ -100,6 +103,26 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
super
.
saveBefore
(
entity
,
context
);
}
@Override
protected
void
updateBefore
(
MatterDatumEntity
entity
,
Context
context
)
throws
AppException
{
entity
.
setIsRecommend
(
null
);
this
.
validData
(
entity
,
context
);
}
@Override
protected
void
removeBefore
(
Long
[]
ids
,
Context
context
)
throws
AppException
{
List
<
MatterDatumEntity
>
queryList
=
this
.
get
(
ids
,
context
);
if
(
CollectionUtils
.
isNotEmpty
(
queryList
)){
int
recommendCount
=
paramService
.
getParamIntValue
(
ParamKey
.
MATTER_DATUM_RECOMMEND_COUNT
);
for
(
MatterDatumEntity
matterEntity:
queryList
){
if
(
matterEntity
.
getIsRecommend
()==
1
){
recommendCount
--;
}
}
paramService
.
setValueByKey
(
ParamKey
.
MATTER_DATUM_RECOMMEND_COUNT
,
String
.
valueOf
(
recommendCount
));
}
}
private
void
parseDocxToJson
(
MatterDatumEntity
entity
)
{
String
rootPath
=
this
.
filePath
.
endsWith
(
"/"
)
?
this
.
filePath
:
this
.
filePath
+
"/"
;
String
filepath
=
rootPath
+
entity
.
getTemplatePath
();
...
...
@@ -351,7 +374,7 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
Map
<
String
,
Object
>
condition
=
new
HashMap
<>();
condition
.
put
(
"id"
,
id
);
if
(
matterDatumEntity
.
getIsRecommend
()==
0
){
if
(
recommendCount
==
6
){
if
(
recommendCount
>=
RECOMMEND_COUNT
){
throw
new
AppException
(
"超过推荐个数"
);
}
recommendCount
++;
...
...
fill-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
View file @
9eccdb5b
...
...
@@ -28,6 +28,7 @@ import java.util.*;
@Service
(
"matterService"
)
public
class
MatterServiceImpl
extends
AbstractCRUDServiceImpl
<
MatterDao
,
MatterEntity
,
Long
>
implements
MatterService
{
private
static
int
RECOMMEND_COUNT
=
5
;
@Autowired
private
ParamService
paramService
;
@Autowired
...
...
@@ -50,6 +51,26 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
this
.
validData
(
entity
,
context
);
}
@Override
protected
void
updateBefore
(
MatterEntity
entity
,
Context
context
)
throws
AppException
{
entity
.
setIsRecommend
(
null
);
this
.
validData
(
entity
,
context
);
}
@Override
protected
void
removeBefore
(
Long
[]
ids
,
Context
context
)
throws
AppException
{
List
<
MatterEntity
>
queryList
=
this
.
get
(
ids
,
context
);
if
(
CollectionUtils
.
isNotEmpty
(
queryList
)){
int
recommendCount
=
paramService
.
getParamIntValue
(
ParamKey
.
MATTER_RECOMMEND_COUNT
);
for
(
MatterEntity
matterEntity:
queryList
){
if
(
matterEntity
.
getIsRecommend
()==
1
){
recommendCount
--;
}
}
paramService
.
setValueByKey
(
ParamKey
.
MATTER_RECOMMEND_COUNT
,
String
.
valueOf
(
recommendCount
));
}
}
@Override
public
void
createMatterbBySheetMatter
(
Long
[]
sheetMatterIds
)
{
List
<
SheetMatterEntity
>
sheetMatterEntityList
=
sheetMatterDao
.
get
(
sheetMatterIds
);
...
...
@@ -97,9 +118,8 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
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
){
if
(
recommendCount
>=
RECOMMEND_COUNT
){
throw
new
AppException
(
"超过推荐个数"
);
}
recommendCount
++;
...
...
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