Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
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
赵啸非
smart_gov_platform
Commits
13931842
Commit
13931842
authored
Feb 01, 2023
by
YIyiyi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.scsmile.cn/zxf/smart_gov_platform
parents
73fde25c
88ce81d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
15 deletions
+74
-15
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
...mortals/xhx/module/site/service/impl/SiteServiceImpl.java
+13
-6
base-manager/src/main/java/com/mortals/xhx/module/workman/service/impl/WorkmanServiceImpl.java
...s/xhx/module/workman/service/impl/WorkmanServiceImpl.java
+55
-1
base-manager/src/main/java/com/mortals/xhx/module/workman/web/WorkmanController.java
...com/mortals/xhx/module/workman/web/WorkmanController.java
+6
-8
No files found.
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
View file @
13931842
...
@@ -103,11 +103,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -103,11 +103,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Override
@Override
protected
void
updateBefore
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
updateBefore
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
//校验下前后名称是否一直 如果不一致 同步修改所以关联
//校验下前后名称是否一直 如果不一致 同步修改所以关联
SiteEntity
siteEntity
=
this
.
get
(
entity
.
getId
(),
context
);
SiteEntity
oldSite
=
this
.
get
(
entity
.
getId
(),
context
);
if
(!
siteEntity
.
getSiteName
().
equals
(
entity
.
getSiteName
())){
if
(!
oldSite
.
getSiteName
().
equals
(
entity
.
getSiteName
())){
//todo
//todo
//更新关联站点名称
//更新关联站点名称
updateAssociateSiteName
(
entity
,
context
);
updateAssociateSiteName
(
oldSite
,
entity
,
context
);
//通知设备更新站点信息
//通知设备更新站点信息
DevicePdu
devicePdu
=
new
DevicePdu
();
DevicePdu
devicePdu
=
new
DevicePdu
();
devicePdu
.
setSiteId
(
entity
.
getId
());
devicePdu
.
setSiteId
(
entity
.
getId
());
...
@@ -116,8 +116,15 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -116,8 +116,15 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
super
.
updateBefore
(
entity
,
context
);
super
.
updateBefore
(
entity
,
context
);
}
}
private
void
updateAssociateSiteName
(
SiteEntity
entity
,
Context
context
)
{
private
void
updateAssociateSiteName
(
SiteEntity
oldSite
,
SiteEntity
newSite
,
Context
context
)
{
List
<
WindowEntity
>
windowEntityList
=
windowService
.
find
(
new
WindowQuery
().
siteId
(
entity
.
getId
()));
//更新窗口站点名称
WindowEntity
windowEntity
=
new
WindowEntity
();
windowEntity
.
setSiteName
(
newSite
.
getSiteName
());
WindowEntity
condition
=
new
WindowEntity
();
condition
.
setSiteName
(
oldSite
.
getSiteName
());
windowService
.
updateBatch
(
windowEntity
,
condition
,
context
);
/* List<WindowEntity> windowEntityList = windowService.find(new WindowQuery().siteId(entity.getId()));
windowEntityList.forEach(item->item.setSiteName(entity.getSiteName()));
windowEntityList.forEach(item->item.setSiteName(entity.getSiteName()));
windowService.update(windowEntityList, context);
windowService.update(windowEntityList, context);
...
@@ -139,7 +146,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -139,7 +146,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
//更新工作人员站点
//更新工作人员站点
List<WorkmanEntity> workmanEntities = workmanService.find(new WorkmanQuery().siteId(entity.getId()));
List<WorkmanEntity> workmanEntities = workmanService.find(new WorkmanQuery().siteId(entity.getId()));
workmanEntities.forEach(item->item.setSiteName(entity.getSiteName()));
workmanEntities.forEach(item->item.setSiteName(entity.getSiteName()));
workmanService
.
update
(
workmanEntities
,
context
);
workmanService.update(workmanEntities, context);
*/
}
}
@Override
@Override
...
...
base-manager/src/main/java/com/mortals/xhx/module/workman/service/impl/WorkmanServiceImpl.java
View file @
13931842
...
@@ -17,6 +17,7 @@ import com.mortals.xhx.module.workman.model.WorkmanQuery;
...
@@ -17,6 +17,7 @@ import com.mortals.xhx.module.workman.model.WorkmanQuery;
import
com.mortals.xhx.module.workman.service.WorkmanService
;
import
com.mortals.xhx.module.workman.service.WorkmanService
;
import
lombok.Getter
;
import
lombok.Getter
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -145,7 +146,7 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
...
@@ -145,7 +146,7 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
*/
*/
@Override
@Override
public
Rest
<
Void
>
doImportPic
(
String
picfilePath
)
throws
AppException
{
public
Rest
<
Void
>
doImportPic
(
String
picfilePath
)
throws
AppException
{
String
disPath
=
filePath
+
"/pics/"
+
FileUtil
.
getPrefix
(
picfilePath
).
trim
();
String
disPath
=
filePath
+
"/pics/"
+
FileUtil
.
getPrefix
(
picfilePath
).
trim
();
String
targetFilePath
=
uploadService
.
getFilePath
(
picfilePath
);
String
targetFilePath
=
uploadService
.
getFilePath
(
picfilePath
);
if
(
FileUtil
.
isEmpty
(
new
File
(
targetFilePath
)))
{
if
(
FileUtil
.
isEmpty
(
new
File
(
targetFilePath
)))
{
throw
new
AppException
(
"文件不存在!"
);
throw
new
AppException
(
"文件不存在!"
);
...
@@ -188,4 +189,57 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
...
@@ -188,4 +189,57 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
}
}
}
}
/**
* @param list
* @param updateSupport
* @param context
* @return
*/
@Override
public
String
importList
(
List
<
WorkmanEntity
>
list
,
Boolean
updateSupport
,
Context
context
)
{
if
(
ObjectUtils
.
isEmpty
(
list
))
{
throw
new
AppException
(
"导入数据不能为空!"
);
}
int
successNum
=
0
;
int
failureNum
=
0
;
StringBuilder
successMsg
=
new
StringBuilder
();
StringBuilder
failureMsg
=
new
StringBuilder
();
StringBuilder
failureDetailMsg
=
new
StringBuilder
();
for
(
WorkmanEntity
entity
:
list
)
{
try
{
entity
.
setCreateUserId
(
context
==
null
?
1L
:
context
.
getUser
()
==
null
?
1L
:
context
.
getUser
().
getId
());
entity
.
setCreateTime
(
new
Date
());
WorkmanEntity
save
=
this
.
save
(
entity
,
context
);
if
(
save
!=
null
)
{
successNum
++;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"导入异常"
,
e
);
failureNum
++;
failureDetailMsg
.
append
(
"\n"
);
failureDetailMsg
.
append
(
String
.
format
(
"导入工作人员数据失败!用户名:%s"
,
entity
.
getName
()));
failureDetailMsg
.
append
(
"\n"
);
}
}
successMsg
.
insert
(
0
,
"数据导入成功!共 "
+
successNum
+
" 条"
);
if
(
failureNum
>
0
)
{
failureMsg
.
insert
(
0
,
"导入失败!共 "
+
failureNum
+
" 条数据格式不正确"
);
successMsg
.
append
(
"\n"
);
successMsg
.
append
(
failureMsg
);
successMsg
.
append
(
failureDetailMsg
);
}
else
{
}
return
successMsg
.
toString
();
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
out
.
println
(
SecurityUtil
.
md5DoubleEncoding
(
""
));
}
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/workman/web/WorkmanController.java
View file @
13931842
...
@@ -69,7 +69,6 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
...
@@ -69,7 +69,6 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
private
UploadService
uploadService
;
private
UploadService
uploadService
;
public
WorkmanController
()
{
public
WorkmanController
()
{
super
.
setModuleDesc
(
"工作人员"
);
super
.
setModuleDesc
(
"工作人员"
);
}
}
...
@@ -116,7 +115,7 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
...
@@ -116,7 +115,7 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
public
String
doImportPic
(
@RequestBody
WorkmanEntity
query
)
{
public
String
doImportPic
(
@RequestBody
WorkmanEntity
query
)
{
JSONObject
ret
=
new
JSONObject
();
JSONObject
ret
=
new
JSONObject
();
try
{
try
{
log
.
info
(
"filePath:"
+
query
.
getFilePath
());
log
.
info
(
"filePath:"
+
query
.
getFilePath
());
Rest
<
Void
>
rest
=
this
.
service
.
doImportPic
(
query
.
getFilePath
());
Rest
<
Void
>
rest
=
this
.
service
.
doImportPic
(
query
.
getFilePath
());
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
recordSysLog
(
request
,
getCurUser
(),
"解析工作人员图片成功!"
);
recordSysLog
(
request
,
getCurUser
(),
"解析工作人员图片成功!"
);
...
@@ -183,12 +182,12 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
...
@@ -183,12 +182,12 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
workmanEntity
.
setSiteName
(
siteEntity
.
getSiteName
());
workmanEntity
.
setSiteName
(
siteEntity
.
getSiteName
());
}
}
if
(
ObjectUtils
.
isEmpty
(
workmanEntity
.
getLoginName
()))
{
if
(
ObjectUtils
.
isEmpty
(
workmanEntity
.
getLoginName
()))
{
String
loginName
=
PinyinUtil
.
getPinyin
(
workmanEntity
.
getName
(),
""
);
String
loginName
=
PinyinUtil
.
getPinyin
(
StrUtil
.
cleanBlank
(
workmanEntity
.
getName
()),
""
);
workmanEntity
.
setLoginName
(
loginName
);
workmanEntity
.
setLoginName
(
loginName
);
}
}
if
(
ObjectUtils
.
isEmpty
(
workmanEntity
.
getLoginPwd
()))
{
if
(
ObjectUtils
.
isEmpty
(
workmanEntity
.
getLoginPwd
()))
{
workmanEntity
.
setLoginPwd
(
"123"
);
workmanEntity
.
setLoginPwd
(
"123"
);
}
}
...
@@ -212,18 +211,17 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
...
@@ -212,18 +211,17 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
workmanEntity
.
setPicObj
(
null
);
workmanEntity
.
setPicObj
(
null
);
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"写入证照异常"
,
e
);
log
.
error
(
"写入证照异常"
,
e
);
}
}
}
}
}
}
super
.
doImportDataBefore
(
list
,
updateSupport
,
context
);
super
.
doImportDataBefore
(
list
,
updateSupport
,
context
);
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
StrUtil
.
removeAllLineBreaks
(
PinyinUtil
.
getPinyin
(
"张三"
,
""
)));
System
.
out
.
println
(
StrUtil
.
cleanBlank
(
PinyinUtil
.
getPinyin
(
"张 三"
,
""
)));
}
}
...
...
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