Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sample-form-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
赵啸非
sample-form-platform
Commits
e20087bd
Commit
e20087bd
authored
May 07, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加样表皮肤管理
parent
99542ef3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
124 additions
and
20 deletions
+124
-20
sample-form-manager/src/main/java/com/mortals/xhx/base/system/user/service/UserService.java
...com/mortals/xhx/base/system/user/service/UserService.java
+5
-0
sample-form-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
...a/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
+4
-1
sample-form-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
+75
-0
sample-form-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+0
-4
sample-form-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterDatumController.java
.../mortals/xhx/module/matter/web/MatterDatumController.java
+12
-2
sample-form-manager/src/main/java/com/mortals/xhx/module/sample/web/SampleBillController.java
...m/mortals/xhx/module/sample/web/SampleBillController.java
+28
-9
sample-form-manager/src/main/java/com/mortals/xhx/module/skin/service/impl/SkinServiceImpl.java
...mortals/xhx/module/skin/service/impl/SkinServiceImpl.java
+0
-4
No files found.
sample-form-manager/src/main/java/com/mortals/xhx/base/system/user/service/UserService.java
View file @
e20087bd
...
...
@@ -13,6 +13,7 @@ import com.mortals.framework.model.Result;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.framework.service.IUser
;
import
com.mortals.xhx.base.system.menu.model.MenuEntity
;
import
com.mortals.xhx.base.system.user.dao.UserDao
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
java.util.List
;
...
...
@@ -112,4 +113,8 @@ public interface UserService extends ICRUDService<UserEntity,Long> {
* @throws AppException
*/
public
boolean
updateUserPwd
(
String
loginName
,
String
oldPwd
,
String
newPwd
)
throws
AppException
;
UserDao
getUserDao
();
}
\ No newline at end of file
sample-form-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
View file @
e20087bd
...
...
@@ -95,6 +95,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
Map
<
String
,
DeviceEntity
>
oldDeviceMap
=
oldDeviceList
.
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getDeviceCode
(),
y
->
y
,
(
o
,
n
)
->
n
));
Map
<
String
,
DeviceEntity
>
newDeviceMap
=
newDeviceList
.
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getDeviceCode
(),
y
->
y
,
(
o
,
n
)
->
n
));
log
.
info
(
"oldDeviceMap:{}"
,
JSON
.
toJSONString
(
oldDeviceMap
));
List
<
DeviceEntity
>
updateDeviceLsit
=
newDeviceList
.
stream
().
map
(
item
->
{
if
(
oldDeviceMap
.
containsKey
(
item
.
getDeviceCode
()))
{
item
.
setId
(
oldDeviceMap
.
get
(
item
.
getDeviceCode
()).
getId
());
...
...
@@ -108,6 +110,7 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
}).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
toList
());
List
<
DeviceEntity
>
saveDeviceList
=
newDeviceList
.
stream
().
map
(
item
->
{
log
.
info
(
"deviceCode:{},oldDeviceMap:{}"
,
item
.
getDeviceCode
(),
oldDeviceMap
.
containsKey
(
item
.
getDeviceCode
()));
if
(!
oldDeviceMap
.
containsKey
(
item
.
getDeviceCode
()))
{
item
.
setDeviceId
(
item
.
getId
());
item
.
setCreateUserId
(
1L
);
...
...
@@ -128,7 +131,7 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
if
(!
ObjectUtils
.
isEmpty
(
updateDeviceLsit
))
{
log
.
info
(
"设备更新,size:{}"
,
updateDeviceLsit
.
size
());
deviceService
.
update
(
updateDeviceLsit
);
//
deviceService.update(updateDeviceLsit);
}
if
(!
ObjectUtils
.
isEmpty
(
saveDeviceList
))
{
...
...
sample-form-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
0 → 100644
View file @
e20087bd
package
com.mortals.xhx.daemon.task
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.user.UserPdu
;
import
com.mortals.xhx.feign.user.IUserFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
/**
* 同步用户,唯一标识为用户名。
*/
@Slf4j
@Service
(
"SyncUserTask"
)
@ConditionalOnExpression
(
"'${platform.type:null}'=='cloud'"
)
public
class
SyncUserTaskImpl
implements
ITaskExcuteService
{
@Autowired
private
IUserFeign
userFeign
;
@Autowired
private
UserService
userService
;
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
log
.
info
(
"同步用户任务"
);
UserPdu
userPdu
=
new
UserPdu
();
userPdu
.
setPage
(
1
);
userPdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
UserPdu
>>>
resp
=
userFeign
.
list
(
userPdu
);
if
(
resp
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
//同步更新用户,以loginname为唯一标识,密码默认与用户相同
resp
.
getData
().
getData
().
forEach
(
user
->
{
log
.
info
(
"loginName:{}"
,
user
.
getLoginName
());
UserEntity
tempEntity
=
userService
.
selectOne
(
new
UserQuery
().
loginName
(
user
.
getLoginName
()));
if
(
ObjectUtils
.
isEmpty
(
tempEntity
))
{
UserEntity
userEntity
=
new
UserEntity
();
BeanUtils
.
copyProperties
(
user
,
userEntity
,
new
String
[]{
"id"
,
"lastLoginTime"
,
"lastLoginAddress"
});
log
.
info
(
"新增:{}"
,
JSON
.
toJSONString
(
userEntity
));
userService
.
getUserDao
().
insert
(
userEntity
);
}
else
{
//更新基本信息
UserEntity
userEntity
=
new
UserEntity
();
BeanUtils
.
copyProperties
(
user
,
userEntity
,
new
String
[]{
"loginPwd"
,
"userType"
,
"status"
,
"lastLoginTime"
,
"lastLoginAddress"
});
log
.
info
(
"更新:{}"
,
JSON
.
toJSONString
(
userEntity
));
userService
.
getUserDao
().
update
(
userEntity
);
}
});
}
// log.info("syncUserResp:{}", JSON.toJSONString(resp));
}
@Override
public
void
stopTask
(
ITask
task
)
throws
AppException
{
}
}
sample-form-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
e20087bd
...
...
@@ -24,8 +24,4 @@ public class DeviceServiceImpl extends AbstractCRUDServiceImpl<DeviceDao, Device
@Autowired
private
MatterDatumService
matterDatumService
;
@Override
protected
void
saveBefore
(
DeviceEntity
entity
,
Context
context
)
throws
AppException
{
super
.
saveBefore
(
entity
,
context
);
}
}
\ No newline at end of file
sample-form-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterDatumController.java
View file @
e20087bd
...
...
@@ -6,8 +6,11 @@ import com.mortals.framework.model.OrderCol;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.key.ParamKey
;
import
com.mortals.xhx.module.matter.model.MatterEntity
;
import
com.mortals.xhx.module.matter.service.MatterService
;
import
com.mortals.xhx.module.sample.model.SampleBillEntity
;
import
com.mortals.xhx.module.sample.service.SampleBillService
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -46,6 +49,8 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
private
ParamService
paramService
;
@Autowired
private
SampleBillService
sampleBillService
;
@Autowired
private
MatterService
matterService
;
public
MatterDatumController
()
{
super
.
setModuleDesc
(
"事项申请材料"
);
...
...
@@ -125,8 +130,13 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
sampleBillEntity
.
initAttrValue
();
sampleBillEntity
.
setSiteId
(
entity
.
getSiteId
());
sampleBillEntity
.
setMaterialName
(
entity
.
getMaterialName
());
sampleBillEntity
.
setMaterialFullName
(
entity
.
getMateriaFullName
());
sampleBillEntity
.
setMatterName
(
entity
.
getMatterName
());
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getMatterId
())){
MatterEntity
matterEntity
=
matterService
.
get
(
entity
.
getMatterId
());
sampleBillEntity
.
setMatterName
(
matterEntity
.
getMatterName
());
sampleBillEntity
.
setMatterFullName
(
matterEntity
.
getMatterFullName
());
}
sampleBillEntity
.
setMatterFullName
(
entity
.
getMatterName
());
sampleBillEntity
.
setOperTime
(
new
Date
());
sampleBillService
.
save
(
sampleBillEntity
,
context
);
...
...
sample-form-manager/src/main/java/com/mortals/xhx/module/sample/web/SampleBillController.java
View file @
e20087bd
package
com.mortals.xhx.module.sample.web
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceQuery
;
import
com.mortals.xhx.module.device.service.DeviceService
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
com.mortals.framework.model.Context
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.module.sample.model.SampleBillEntity
;
import
com.mortals.xhx.module.sample.service.SampleBillService
;
...
...
@@ -19,26 +26,31 @@ import com.mortals.framework.util.StringUtils;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
/**
*
* 样报服务
*
* @author zxfei
* @date 2023-02-23
*/
* 样报服务
*
* @author zxfei
* @date 2023-02-23
*/
@RestController
@RequestMapping
(
"sample/bill"
)
public
class
SampleBillController
extends
BaseCRUDJsonBodyMappingController
<
SampleBillService
,
SampleBillEntity
,
Long
>
{
public
class
SampleBillController
extends
BaseCRUDJsonBodyMappingController
<
SampleBillService
,
SampleBillEntity
,
Long
>
{
@Autowired
private
ParamService
paramService
;
public
SampleBillController
(){
super
.
setModuleDesc
(
"样报服务"
);
@Autowired
public
DeviceService
deviceService
;
public
SampleBillController
()
{
super
.
setModuleDesc
(
"样报服务"
);
}
@Override
...
...
@@ -58,6 +70,13 @@ public class SampleBillController extends BaseCRUDJsonBodyMappingController<Samp
@Override
@UnAuth
public
String
save
(
@RequestBody
SampleBillEntity
entity
)
{
if
(
ObjectUtils
.
isEmpty
(
entity
.
getDeviceName
())
&&
!
ObjectUtils
.
isEmpty
(
entity
.
getDeviceCode
()))
{
DeviceEntity
deviceEntity
=
deviceService
.
selectOne
(
new
DeviceQuery
().
deviceCode
(
entity
.
getDeviceCode
()));
entity
.
setDeviceName
(
deviceEntity
.
getDeviceName
());
}
entity
.
setMatterFullName
(
entity
.
getMaterialName
());
entity
.
setMaterialFullName
(
entity
.
getMaterialFullName
());
return
super
.
save
(
entity
);
}
}
\ No newline at end of file
sample-form-manager/src/main/java/com/mortals/xhx/module/skin/service/impl/SkinServiceImpl.java
View file @
e20087bd
...
...
@@ -48,10 +48,6 @@ public class SkinServiceImpl extends AbstractCRUDServiceImpl<SkinDao, SkinEntity
@Override
protected
void
updateAfter
(
SkinEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateAfter
(
entity
,
context
);
//推送皮肤更新消息
DeviceMsgReqPdu
deviceMsgReqPdu
=
new
DeviceMsgReqPdu
();
deviceMsgReqPdu
.
setSiteid
(
entity
.
getSiteId
());
...
...
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