Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
ssfj-yincen
Overview
Overview
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
公共应用
ssfj-yincen
Commits
2d1e8c99
Commit
2d1e8c99
authored
May 18, 2024
by
liuzz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手术分级数据全量推送,修改手术分级的时候更新推送相关绑定数据
parent
27e1a554
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
377 additions
and
152 deletions
+377
-152
XhWebServiceClient.java
...om/wechat/common/webserviceClient/XhWebServiceClient.java
+8
-17
SecurityConfig.java
...main/java/com/wechat/framework/config/SecurityConfig.java
+96
-96
OperationController.java
.../wechat/project/basis/controller/OperationController.java
+8
-9
OperationMapper.java
...java/com/wechat/project/basis/mapper/OperationMapper.java
+23
-0
OperationServiceImpl.java
...chat/project/basis/service/impl/OperationServiceImpl.java
+50
-11
EmpLinkOperationController.java
...ject/operation/controller/EmpLinkOperationController.java
+13
-9
OpenController.java
...m/wechat/project/operation/controller/OpenController.java
+135
-0
SysMenuServiceImpl.java
...echat/project/system/service/impl/SysMenuServiceImpl.java
+5
-9
OperationMapper.xml
src/main/resources/mybatis/basis/OperationMapper.xml
+39
-1
No files found.
src/main/java/com/wechat/common/webserviceClient/XhWebServiceClient.java
View file @
2d1e8c99
package
com
.
wechat
.
common
.
webserviceClient
;
package
com
.
wechat
.
common
.
webserviceClient
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
javax.xml.namespace.QName
;
import
lombok.extern.slf4j.Slf4j
;
import
javax.xml.rpc.ParameterMode
;
import
javax.xml.rpc.ServiceException
;
import
org.apache.axis.client.Call
;
import
org.apache.axis.client.Call
;
import
org.apache.axis.client.Service
;
import
org.apache.axis.client.Service
;
import
org.apache.axis.encoding.XMLType
;
import
org.apache.axis.encoding.XMLType
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.xml.namespace.QName
;
import
javax.xml.rpc.ParameterMode
;
import
javax.xml.rpc.ServiceException
;
@Component
@Component
@Slf4j
public
class
XhWebServiceClient
{
public
class
XhWebServiceClient
{
protected
final
Logger
logger
=
LoggerFactory
.
getLogger
(
XhWebServiceClient
.
class
);
public
static
String
SubWebService
(
String
map
)
throws
Exception
{
public
static
String
SubWebService
(
String
map
)
throws
Exception
{
String
requestXml
=
JSONObject
.
toJSON
(
map
).
toString
();
String
requestXml
=
JSONObject
.
toJSON
(
map
).
toString
();
System
.
out
.
println
(
"调用esb发布数据集服务:"
+
requestXml
);
log
.
info
(
"调用esb发布数据集服务:{}"
,
requestXml
);
String
responseXml
=
""
;
String
responseXml
=
""
;
try
{
try
{
...
@@ -33,7 +33,7 @@ public class XhWebServiceClient {
...
@@ -33,7 +33,7 @@ public class XhWebServiceClient {
return
(
String
)
call
.
invoke
(
new
Object
[]{
requestXml
});
return
(
String
)
call
.
invoke
(
new
Object
[]{
requestXml
});
}
catch
(
ServiceException
var8
)
{
}
catch
(
ServiceException
var8
)
{
var8
.
printStackTrace
();
var8
.
printStackTrace
();
System
.
out
.
println
(
"调用发布数据接口异常:"
+
var8
.
getMessage
());
log
.
error
(
"调用发布数据接口异常:{}"
,
var8
.
getMessage
());
throw
new
ServiceException
(
"请求webservice服务异常"
,
var8
);
throw
new
ServiceException
(
"请求webservice服务异常"
,
var8
);
}
}
}
}
...
@@ -63,14 +63,5 @@ public class XhWebServiceClient {
...
@@ -63,14 +63,5 @@ public class XhWebServiceClient {
}
}
}
}
public
static
void
main
(
String
[]
args
)
{
String
xml
=
"{\"parameters\":{\"pagerecord\":\"9999\",\"sharedatacode\":\"S00014\",\"pageno\":\"1\",\"ORGCODE\":\"66\",\"Reservationid\":\"P00202007030311380926074\"}}"
;
try
{
new
XhWebServiceClient
();
SubWebService
(
xml
);
}
catch
(
Exception
var3
)
{
var3
.
printStackTrace
();
}
}
}
}
src/main/java/com/wechat/framework/config/SecurityConfig.java
View file @
2d1e8c99
...
@@ -22,106 +22,106 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic
...
@@ -22,106 +22,106 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic
@Configuration
@Configuration
@EnableWebSecurity
@EnableWebSecurity
@EnableGlobalMethodSecurity
(
@EnableGlobalMethodSecurity
(
prePostEnabled
=
true
,
prePostEnabled
=
true
,
securedEnabled
=
true
securedEnabled
=
true
)
)
public
class
SecurityConfig
extends
WebSecurityConfigurerAdapter
{
public
class
SecurityConfig
extends
WebSecurityConfigurerAdapter
{
@Autowired
@Autowired
private
UserDetailsService
userDetailsService
;
private
UserDetailsService
userDetailsService
;
@Autowired
@Autowired
private
AuthenticationEntryPointImpl
unauthorizedHandler
;
private
AuthenticationEntryPointImpl
unauthorizedHandler
;
@Autowired
@Autowired
private
LogoutSuccessHandlerImpl
logoutSuccessHandler
;
private
LogoutSuccessHandlerImpl
logoutSuccessHandler
;
@Autowired
@Autowired
private
JwtAuthenticationTokenFilter
authenticationTokenFilter
;
private
JwtAuthenticationTokenFilter
authenticationTokenFilter
;
@Autowired
@Autowired
private
SmsCodeAuthenticationSecurityConfig
smsCodeAuthenticationSecurityConfig
;
private
SmsCodeAuthenticationSecurityConfig
smsCodeAuthenticationSecurityConfig
;
@Bean
@Bean
public
AuthenticationManager
authenticationManagerBean
()
throws
Exception
{
public
AuthenticationManager
authenticationManagerBean
()
throws
Exception
{
return
super
.
authenticationManagerBean
();
return
super
.
authenticationManagerBean
();
}
}
protected
void
configure
(
HttpSecurity
httpSecurity
)
throws
Exception
{
protected
void
configure
(
HttpSecurity
httpSecurity
)
throws
Exception
{
((
HttpSecurity
)((
HttpSecurity
)((
FormLoginConfigurer
)((
FormLoginConfigurer
)((
HttpSecurity
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
HttpSecurity
)((
HttpSecurity
)
httpSecurity
.
csrf
()
((
HttpSecurity
)
((
HttpSecurity
)
((
FormLoginConfigurer
)
((
FormLoginConfigurer
)
((
HttpSecurity
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
HttpSecurity
)
((
HttpSecurity
)
httpSecurity
.
csrf
()
.
disable
())
.
disable
())
.
exceptionHandling
()
.
exceptionHandling
()
.
authenticationEntryPoint
(
this
.
unauthorizedHandler
)
.
authenticationEntryPoint
(
this
.
unauthorizedHandler
)
.
and
())
.
and
())
.
authorizeRequests
()
.
authorizeRequests
()
.
antMatchers
(
new
String
[]{
"/login"
,
"/captchaImage"
}))
.
antMatchers
(
new
String
[]{
"/login"
,
"/captchaImage"
}))
.
anonymous
()
.
anonymous
()
.
antMatchers
(
.
antMatchers
(
HttpMethod
.
GET
,
new
String
[]{
"/*.html"
,
"/**/*.html"
,
"/**/*.css"
,
"/**/*.js"
}
HttpMethod
.
GET
,
new
String
[]{
"/*.html"
,
"/**/*.html"
,
"/**/*.css"
,
"/**/*.js"
}
))
))
.
permitAll
()
.
permitAll
()
.
antMatchers
(
new
String
[]{
"/websocket/**"
}))
.
antMatchers
(
new
String
[]{
"/websocket/**"
}))
.
permitAll
()
.
permitAll
()
.
antMatchers
(
new
String
[]{
"/mapi/**"
}))
.
antMatchers
(
new
String
[]{
"/mapi/**"
}))
.
permitAll
()
.
permitAll
()
.
antMatchers
(
new
String
[]{
"/system/dict/data/dictType/**"
}))
.
antMatchers
(
new
String
[]{
"/system/dict/data/dictType/**"
}))
.
permitAll
()
.
permitAll
()
.
antMatchers
(
new
String
[]{
"/standard/paramInfo/title/**"
}))
.
antMatchers
(
new
String
[]{
"/standard/paramInfo/title/**"
}))
.
permitAll
()
.
permitAll
()
.
antMatchers
(
new
String
[]{
"/webservice
/**"
}))
.
antMatchers
(
new
String
[]{
"/webservice/**"
,
"/open
/**"
}))
.
permitAll
()
.
permitAll
()
.
antMatchers
(
new
String
[]{
"/xinhua/**"
}))
.
antMatchers
(
new
String
[]{
"/xinhua/**"
}))
.
permitAll
()
.
permitAll
()
.
antMatchers
(
new
String
[]{
"/profile/**"
}))
.
antMatchers
(
new
String
[]{
"/profile/**"
}))
.
permitAll
()
.
permitAll
()
.
antMatchers
(
new
String
[]{
"/common/download**"
}))
.
antMatchers
(
new
String
[]{
"/common/download**"
}))
.
anonymous
()
.
anonymous
()
.
antMatchers
(
new
String
[]{
"/swagger-ui.html"
}))
.
antMatchers
(
new
String
[]{
"/swagger-ui.html"
}))
.
permitAll
()
.
permitAll
()
.
antMatchers
(
new
String
[]{
"/swagger-resources/**"
}))
.
antMatchers
(
new
String
[]{
"/swagger-resources/**"
}))
.
permitAll
()
.
permitAll
()
.
antMatchers
(
new
String
[]{
"/webjars/**"
}))
.
antMatchers
(
new
String
[]{
"/webjars/**"
}))
.
anonymous
()
.
anonymous
()
.
antMatchers
(
new
String
[]{
"/*/api-docs"
}))
.
antMatchers
(
new
String
[]{
"/*/api-docs"
}))
.
permitAll
()
.
permitAll
()
.
antMatchers
(
new
String
[]{
"/druid/**"
}))
.
antMatchers
(
new
String
[]{
"/druid/**"
}))
.
anonymous
()
.
anonymous
()
.
anyRequest
())
.
anyRequest
())
.
authenticated
()
.
authenticated
()
.
and
())
.
and
())
.
formLogin
()
.
formLogin
()
.
loginProcessingUrl
(
"/api/user/login"
))
.
loginProcessingUrl
(
"/api/user/login"
))
.
permitAll
())
.
permitAll
())
.
and
())
.
and
())
.
authorizeRequests
()
.
authorizeRequests
()
.
mvcMatchers
(
new
String
[]{
"/mapi/user/**"
})
.
mvcMatchers
(
new
String
[]{
"/mapi/user/**"
})
.
anonymous
()
.
anonymous
()
.
and
())
.
and
())
.
headers
()
.
headers
()
.
frameOptions
()
.
frameOptions
()
.
disable
();
.
disable
();
((
HttpSecurity
)((
FormLoginConfigurer
)((
FormLoginConfigurer
)((
HttpSecurity
)((
AuthorizedUrl
)((
AuthorizedUrl
)((
HttpSecurity
)((
SmsCodeAuthenticationSecurityConfig
)
httpSecurity
.
apply
(
((
HttpSecurity
)
((
FormLoginConfigurer
)
((
FormLoginConfigurer
)
((
HttpSecurity
)
((
AuthorizedUrl
)
((
AuthorizedUrl
)
((
HttpSecurity
)
((
SmsCodeAuthenticationSecurityConfig
)
httpSecurity
.
apply
(
this
.
smsCodeAuthenticationSecurityConfig
this
.
smsCodeAuthenticationSecurityConfig
))
))
.
and
())
.
and
())
.
authorizeRequests
()
.
authorizeRequests
()
.
antMatchers
(
new
String
[]{
"/mapi/user/**"
}))
.
antMatchers
(
new
String
[]{
"/mapi/user/**"
}))
.
permitAll
()
.
permitAll
()
.
anyRequest
())
.
anyRequest
())
.
authenticated
()
.
authenticated
()
.
and
())
.
and
())
.
formLogin
()
.
formLogin
()
.
loginPage
(
"/login"
)
.
loginPage
(
"/login"
)
.
defaultSuccessUrl
(
"/"
))
.
defaultSuccessUrl
(
"/"
))
.
permitAll
())
.
permitAll
())
.
and
())
.
and
())
.
logout
()
.
logout
()
.
permitAll
();
.
permitAll
();
httpSecurity
.
logout
().
logoutUrl
(
"/logout"
).
logoutSuccessHandler
(
this
.
logoutSuccessHandler
);
httpSecurity
.
logout
().
logoutUrl
(
"/logout"
).
logoutSuccessHandler
(
this
.
logoutSuccessHandler
);
httpSecurity
.
addFilterBefore
(
this
.
authenticationTokenFilter
,
UsernamePasswordAuthenticationFilter
.
class
);
httpSecurity
.
addFilterBefore
(
this
.
authenticationTokenFilter
,
UsernamePasswordAuthenticationFilter
.
class
);
}
}
@Bean
@Bean
public
BCryptPasswordEncoder
bCryptPasswordEncoder
()
{
public
BCryptPasswordEncoder
bCryptPasswordEncoder
()
{
return
new
BCryptPasswordEncoder
();
return
new
BCryptPasswordEncoder
();
}
}
protected
void
configure
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
protected
void
configure
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
auth
.
userDetailsService
(
this
.
userDetailsService
).
passwordEncoder
(
this
.
bCryptPasswordEncoder
());
auth
.
userDetailsService
(
this
.
userDetailsService
).
passwordEncoder
(
this
.
bCryptPasswordEncoder
());
}
}
}
}
src/main/java/com/wechat/project/basis/controller/OperationController.java
View file @
2d1e8c99
...
@@ -8,17 +8,11 @@ import com.wechat.framework.web.domain.AjaxResult;
...
@@ -8,17 +8,11 @@ import com.wechat.framework.web.domain.AjaxResult;
import
com.wechat.framework.web.page.TableDataInfo
;
import
com.wechat.framework.web.page.TableDataInfo
;
import
com.wechat.project.basis.domain.Operation
;
import
com.wechat.project.basis.domain.Operation
;
import
com.wechat.project.basis.service.IOperationService
;
import
com.wechat.project.basis.service.IOperationService
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
java.util.List
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RestController
@RequestMapping
({
"/basis/operationDict"
})
@RequestMapping
({
"/basis/operationDict"
})
...
@@ -62,6 +56,11 @@ public class OperationController extends BaseController {
...
@@ -62,6 +56,11 @@ public class OperationController extends BaseController {
return
this
.
toAjax
(
this
.
operationService
.
insertOperation
(
operation
));
return
this
.
toAjax
(
this
.
operationService
.
insertOperation
(
operation
));
}
}
/**
* 更新手术等级
* @param operation
* @return
*/
@PreAuthorize
(
"@ss.hasPermi('basis:operationDict:edit')"
)
@PreAuthorize
(
"@ss.hasPermi('basis:operationDict:edit')"
)
@Log
(
@Log
(
title
=
"手术字典"
,
title
=
"手术字典"
,
...
...
src/main/java/com/wechat/project/basis/mapper/OperationMapper.java
View file @
2d1e8c99
package
com
.
wechat
.
project
.
basis
.
mapper
;
package
com
.
wechat
.
project
.
basis
.
mapper
;
import
com.wechat.project.basis.domain.Operation
;
import
com.wechat.project.basis.domain.Operation
;
import
com.wechat.project.operation.domain.EmpLinkOperation
;
import
java.util.List
;
import
java.util.List
;
public
interface
OperationMapper
{
public
interface
OperationMapper
{
...
@@ -19,4 +21,25 @@ public interface OperationMapper {
...
@@ -19,4 +21,25 @@ public interface OperationMapper {
int
deleteOperationByCode
(
String
opsCode
);
int
deleteOperationByCode
(
String
opsCode
);
int
selectCountOperation
(
String
opsCode
);
int
selectCountOperation
(
String
opsCode
);
/**
* 查询所有绑定过的此手术的信息
* @param opsCode
* @return
*/
List
<
EmpLinkOperation
>
selectBindOperationEmp
(
String
opsCode
);
/**
* 查询所有
* @param opsCode
* @return
*/
List
<
EmpLinkOperation
>
selectAllOperationEmp
();
/**
* 手术分级修改之后对绑定数据进行更新
* @param operation
* @return
*/
int
updateEmpLinkById
(
EmpLinkOperation
operation
);
}
}
src/main/java/com/wechat/project/basis/service/impl/OperationServiceImpl.java
View file @
2d1e8c99
package
com
.
wechat
.
project
.
basis
.
service
.
impl
;
package
com
.
wechat
.
project
.
basis
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.wechat.common.utils.DateUtils
;
import
com.wechat.common.utils.DateUtils
;
import
com.wechat.project.basis.domain.DataSourceByPT
;
import
com.wechat.common.webserviceClient.XhWebServiceClient
;
import
com.wechat.project.basis.domain.Dept
;
import
com.wechat.project.basis.domain.*
;
import
com.wechat.project.basis.domain.DeptMainInfo
;
import
com.wechat.project.basis.domain.Emp
;
import
com.wechat.project.basis.domain.MainParameters
;
import
com.wechat.project.basis.domain.Operation
;
import
com.wechat.project.basis.domain.OperationMainInfo
;
import
com.wechat.project.basis.domain.PTResponse
;
import
com.wechat.project.basis.domain.UserMainInfo
;
import
com.wechat.project.basis.mapper.DeptMapper
;
import
com.wechat.project.basis.mapper.DeptMapper
;
import
com.wechat.project.basis.mapper.EmpMapper
;
import
com.wechat.project.basis.mapper.EmpMapper
;
import
com.wechat.project.basis.mapper.OperationMapper
;
import
com.wechat.project.basis.mapper.OperationMapper
;
import
com.wechat.project.basis.service.IOperationService
;
import
com.wechat.project.basis.service.IOperationService
;
import
java.util.List
;
import
com.wechat.project.operation.domain.EmpLinkOperation
;
import
com.wechat.project.operation.domain.OperationAuthMain
;
import
com.wechat.project.operation.domain.OperationAuthToPlatform
;
import
com.wechat.project.operation.domain.PlatformParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
@Service
@Slf4j
public
class
OperationServiceImpl
implements
IOperationService
{
public
class
OperationServiceImpl
implements
IOperationService
{
@Autowired
@Autowired
private
OperationMapper
operationMapper
;
private
OperationMapper
operationMapper
;
...
@@ -199,7 +201,44 @@ public class OperationServiceImpl implements IOperationService {
...
@@ -199,7 +201,44 @@ public class OperationServiceImpl implements IOperationService {
@Override
@Override
public
int
updateOperation
(
Operation
operation
)
{
public
int
updateOperation
(
Operation
operation
)
{
return
this
.
operationMapper
.
updateOperation
(
operation
);
Operation
oldOperation
=
selectOperationById
(
operation
.
getId
());
this
.
operationMapper
.
updateOperation
(
operation
);
// 更新手术等级是需要重新发送给平台消息的
// 查询已经绑定过此手术的所有授权
// 判断是否更新了手术分级
if
(!
StrUtil
.
equals
(
operation
.
getOpsName
(),
oldOperation
.
getOpsName
())
||
!
StrUtil
.
equals
(
operation
.
getOperationLevel
(),
oldOperation
.
getOperationLevel
()))
{
List
<
EmpLinkOperation
>
empLinkOperations
=
operationMapper
.
selectBindOperationEmp
(
operation
.
getOpsCode
());
OperationAuthMain
operationAuthMain
=
new
OperationAuthMain
();
PlatformParam
platformParam
=
new
PlatformParam
();
platformParam
.
setDatasetcode
(
"D02950"
);
platformParam
.
setSourceid
(
"SSFJ"
);
platformParam
.
setSourcetype
(
"U"
);
empLinkOperations
.
forEach
(
empLinkOperation
->
{
// 更新手术信息
empLinkOperation
.
setOperationName
(
operation
.
getOpsName
());
empLinkOperation
.
setOperationLevel
(
operation
.
getOperationLevel
());
empLinkOperation
.
setSpell
(
operation
.
getSpell
());
operationMapper
.
updateEmpLinkById
(
empLinkOperation
);
// 平台消息推送
try
{
OperationAuthToPlatform
operationAuthToPlatform
=
new
OperationAuthToPlatform
();
operationAuthToPlatform
.
setCreateTime
(
DateUtils
.
getTime
());
operationAuthToPlatform
.
setEmpCode
(
empLinkOperation
.
getEmpCode
());
operationAuthToPlatform
.
setMainKey
(
empLinkOperation
.
getEmpCode
()
+
"_"
+
empLinkOperation
.
getOperationCode
());
operationAuthToPlatform
.
setOpsCode
(
empLinkOperation
.
getOperationCode
());
operationAuthToPlatform
.
setOpsLevel
(
empLinkOperation
.
getOperationLevel
());
operationAuthToPlatform
.
setOpsName
(
empLinkOperation
.
getOperationName
());
operationAuthToPlatform
.
setSpell
(
empLinkOperation
.
getSpell
());
operationAuthMain
.
setParam
(
platformParam
);
operationAuthMain
.
setOperationAuthToPlatforms
(
CollectionUtil
.
toList
(
operationAuthToPlatform
));
String
result
=
XhWebServiceClient
.
SubWebService
(
JSON
.
toJSONString
(
operationAuthMain
));
log
.
info
(
"手术分级联动授权更新平台发布结果:{}"
,
result
);
}
catch
(
Exception
e
){
log
.
error
(
"平台消息推送失败"
,
e
);
}
});
}
return
1
;
}
}
@Override
@Override
...
...
src/main/java/com/wechat/project/operation/controller/EmpLinkOperationController.java
View file @
2d1e8c99
...
@@ -10,17 +10,11 @@ import com.wechat.project.basis.domain.Operation;
...
@@ -10,17 +10,11 @@ import com.wechat.project.basis.domain.Operation;
import
com.wechat.project.operation.domain.AddOperationAuth
;
import
com.wechat.project.operation.domain.AddOperationAuth
;
import
com.wechat.project.operation.domain.EmpLinkOperation
;
import
com.wechat.project.operation.domain.EmpLinkOperation
;
import
com.wechat.project.operation.service.IEmpLinkOperationService
;
import
com.wechat.project.operation.service.IEmpLinkOperationService
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
java.util.List
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RestController
@RequestMapping
({
"/operation/operationLevel"
})
@RequestMapping
({
"/operation/operationLevel"
})
...
@@ -96,6 +90,11 @@ public class EmpLinkOperationController extends BaseController {
...
@@ -96,6 +90,11 @@ public class EmpLinkOperationController extends BaseController {
return
this
.
getDataTable
(
list
);
return
this
.
getDataTable
(
list
);
}
}
/**
* 获取未关联手术
* @param empLinkOperation
* @return
*/
@GetMapping
({
"/getUnLinkOperation"
})
@GetMapping
({
"/getUnLinkOperation"
})
public
TableDataInfo
selectUnLinkOperation
(
EmpLinkOperation
empLinkOperation
)
{
public
TableDataInfo
selectUnLinkOperation
(
EmpLinkOperation
empLinkOperation
)
{
this
.
startPage
();
this
.
startPage
();
...
@@ -112,6 +111,11 @@ public class EmpLinkOperationController extends BaseController {
...
@@ -112,6 +111,11 @@ public class EmpLinkOperationController extends BaseController {
return
this
.
getDataTable
(
list
);
return
this
.
getDataTable
(
list
);
}
}
/**
* 删除手术授权
* @param addOperationAuth
* @return
*/
@PostMapping
({
"/deleteEmpLinkOperationByModel"
})
@PostMapping
({
"/deleteEmpLinkOperationByModel"
})
public
AjaxResult
deleteEmpLinkOperationByModel
(
@RequestBody
AddOperationAuth
addOperationAuth
)
{
public
AjaxResult
deleteEmpLinkOperationByModel
(
@RequestBody
AddOperationAuth
addOperationAuth
)
{
return
this
.
toAjax
(
this
.
empLinkOperationService
.
deleteEmpLinkOperationByModel
(
addOperationAuth
));
return
this
.
toAjax
(
this
.
empLinkOperationService
.
deleteEmpLinkOperationByModel
(
addOperationAuth
));
...
...
src/main/java/com/wechat/project/operation/controller/OpenController.java
0 → 100644
View file @
2d1e8c99
package
com
.
wechat
.
project
.
operation
.
controller
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.wechat.common.utils.DateUtils
;
import
com.wechat.common.webserviceClient.XhWebServiceClient
;
import
com.wechat.framework.web.controller.BaseController
;
import
com.wechat.framework.web.domain.AjaxResult
;
import
com.wechat.project.basis.mapper.OperationMapper
;
import
com.wechat.project.operation.domain.*
;
import
com.wechat.project.operation.service.IEmpLinkOperationService
;
import
com.wechat.project.system.domain.SysMenu
;
import
com.wechat.project.system.domain.vo.RouterVo
;
import
com.wechat.project.system.mapper.SysMenuMapper
;
import
com.wechat.project.system.service.ISysMenuService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
@RestController
@RequestMapping
({
"/open"
})
@Slf4j
public
class
OpenController
extends
BaseController
{
@Autowired
private
IEmpLinkOperationService
empLinkOperationService
;
@Autowired
private
OperationMapper
operationMapper
;
@Autowired
private
SysMenuMapper
menuMapper
;
@Autowired
private
ISysMenuService
menuService
;
public
static
volatile
int
flag
=
0
;
@GetMapping
({
"/init"
})
public
AjaxResult
initAllEmpLink
()
{
if
(
flag
==
1
){
return
AjaxResult
.
success
(
"初始化任务正在执行,请不要重复调用"
);
}
flag
=
1
;
new
Thread
(()->{
OperationAuthMain
operationAuthMain
=
new
OperationAuthMain
();
PlatformParam
platformParam
=
new
PlatformParam
();
platformParam
.
setDatasetcode
(
"D02950"
);
platformParam
.
setSourceid
(
"SSFJ"
);
platformParam
.
setSourcetype
(
"U"
);
try
{
List
<
EmpLinkOperation
>
linkOperations
=
operationMapper
.
selectAllOperationEmp
();
linkOperations
.
forEach
(
operation
->
{
OperationAuthToPlatform
operationAuthToPlatform
=
new
OperationAuthToPlatform
();
operationAuthToPlatform
.
setCreateTime
(
DateUtils
.
getTime
());
operationAuthToPlatform
.
setEmpCode
(
operation
.
getEmpCode
());
operationAuthToPlatform
.
setMainKey
(
operation
.
getEmpCode
()
+
"_"
+
operation
.
getOperationCode
());
operationAuthToPlatform
.
setOpsCode
(
operation
.
getOperationCode
());
operationAuthToPlatform
.
setOpsLevel
(
operation
.
getOperationLevel
());
operationAuthToPlatform
.
setOpsName
(
operation
.
getOperationName
());
operationAuthToPlatform
.
setSpell
(
operation
.
getSpell
());
operationAuthMain
.
setParam
(
platformParam
);
operationAuthMain
.
setOperationAuthToPlatforms
(
CollectionUtil
.
toList
(
operationAuthToPlatform
));
String
result
=
null
;
try
{
result
=
XhWebServiceClient
.
SubWebService
(
JSON
.
toJSONString
(
operationAuthMain
));
}
catch
(
Exception
e
)
{
log
.
error
(
"平台消息推送失败"
,
e
);
}
log
.
info
(
"手术分级联动授权更新平台发布结果:{}"
,
result
);
});
}
catch
(
Exception
e
){
log
.
error
(
"初始化授权失败"
,
e
);
}
finally
{
flag
=
0
;
}
}).
start
();
return
AjaxResult
.
success
(
"正在推送数据,请不要重复刷新或调用"
);
}
@GetMapping
({
"/test"
})
public
AjaxResult
test
(){
List
<
SysMenu
>
menus
=
this
.
menuMapper
.
selectMenuTreeAll
();
List
<
SysMenu
>
childPerms
=
this
.
getChildPerms
(
menus
,
0
);
List
<
RouterVo
>
routerVos
=
this
.
menuService
.
buildMenus
(
childPerms
);
log
.
info
(
routerVos
.
toString
());
return
AjaxResult
.
success
();
}
public
List
<
SysMenu
>
getChildPerms
(
List
<
SysMenu
>
list
,
int
parentId
)
{
List
<
SysMenu
>
returnList
=
new
ArrayList
<>();
for
(
SysMenu
t
:
list
)
{
if
(
t
.
getParentId
()
==
(
long
)
parentId
)
{
this
.
recursionFn
(
list
,
t
);
returnList
.
add
(
t
);
}
}
return
returnList
;
}
private
void
recursionFn
(
List
<
SysMenu
>
list
,
SysMenu
t
)
{
List
<
SysMenu
>
childList
=
this
.
getChildList
(
list
,
t
);
t
.
setChildren
(
childList
);
for
(
SysMenu
tChild
:
childList
)
{
if
(
this
.
hasChild
(
list
,
tChild
))
{
for
(
SysMenu
n
:
childList
)
{
this
.
recursionFn
(
list
,
n
);
}
}
}
}
private
boolean
hasChild
(
List
<
SysMenu
>
list
,
SysMenu
t
)
{
return
this
.
getChildList
(
list
,
t
).
size
()
>
0
;
}
private
List
<
SysMenu
>
getChildList
(
List
<
SysMenu
>
list
,
SysMenu
t
)
{
List
<
SysMenu
>
tlist
=
new
ArrayList
<>();
for
(
SysMenu
n
:
list
)
{
if
(
n
.
getParentId
()
==
t
.
getMenuId
())
{
tlist
.
add
(
n
);
}
}
return
tlist
;
}
}
src/main/java/com/wechat/project/system/service/impl/SysMenuServiceImpl.java
View file @
2d1e8c99
...
@@ -9,16 +9,12 @@ import com.wechat.project.system.domain.vo.RouterVo;
...
@@ -9,16 +9,12 @@ import com.wechat.project.system.domain.vo.RouterVo;
import
com.wechat.project.system.mapper.SysMenuMapper
;
import
com.wechat.project.system.mapper.SysMenuMapper
;
import
com.wechat.project.system.mapper.SysRoleMenuMapper
;
import
com.wechat.project.system.mapper.SysRoleMenuMapper
;
import
com.wechat.project.system.service.ISysMenuService
;
import
com.wechat.project.system.service.ISysMenuService
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashSet
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
SysMenuServiceImpl
implements
ISysMenuService
{
public
class
SysMenuServiceImpl
implements
ISysMenuService
{
public
static
final
String
PREMISSION_STRING
=
"perms[\"{0}\"]"
;
public
static
final
String
PREMISSION_STRING
=
"perms[\"{0}\"]"
;
...
@@ -189,7 +185,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
...
@@ -189,7 +185,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
List
<
SysMenu
>
tlist
=
new
ArrayList
<>();
List
<
SysMenu
>
tlist
=
new
ArrayList
<>();
for
(
SysMenu
n
:
list
)
{
for
(
SysMenu
n
:
list
)
{
if
(
n
.
getParentId
()
==
t
.
getMenuId
(
))
{
if
(
Objects
.
equals
(
n
.
getParentId
(),
t
.
getMenuId
()
))
{
tlist
.
add
(
n
);
tlist
.
add
(
n
);
}
}
}
}
...
@@ -198,6 +194,6 @@ public class SysMenuServiceImpl implements ISysMenuService {
...
@@ -198,6 +194,6 @@ public class SysMenuServiceImpl implements ISysMenuService {
}
}
private
boolean
hasChild
(
List
<
SysMenu
>
list
,
SysMenu
t
)
{
private
boolean
hasChild
(
List
<
SysMenu
>
list
,
SysMenu
t
)
{
return
this
.
getChildList
(
list
,
t
).
size
()
>
0
;
return
!
this
.
getChildList
(
list
,
t
).
isEmpty
()
;
}
}
}
}
src/main/resources/mybatis/basis/OperationMapper.xml
View file @
2d1e8c99
...
@@ -86,5 +86,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -86,5 +86,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectCountOperation"
parameterType=
"String"
resultType=
"int"
>
<select
id=
"selectCountOperation"
parameterType=
"String"
resultType=
"int"
>
select count(id) from operation where ops_code = #{opsCode}
select count(id) from operation where ops_code = #{opsCode}
</select>
</select>
<select
id=
"selectBindOperationEmp"
resultType=
"com.wechat.project.operation.domain.EmpLinkOperation"
>
SELECT
id,
operation_code AS operationCode,
operation_name AS operationName,
emp_code AS empCode,
emp_name AS empName,
operation_level AS operationLevel,
spell
FROM
emp_link_operation
WHERE
operation_code = #{opsCode}
</select>
<update
id=
"updateEmpLinkById"
>
update emp_link_operation
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"operationName != null and operationName != ''"
>
operation_name = #{operationName},
</if>
<if
test=
"operationLevel != null and operationLevel != ''"
>
operation_level = #{operationLevel},
</if>
<if
test=
"spell != null and spell != ''"
>
spell = #{spell},
</if>
</trim>
where id = #{id}
</update>
<select
id=
"selectAllOperationEmp"
resultType=
"com.wechat.project.operation.domain.EmpLinkOperation"
>
SELECT
id,
operation_code AS operationCode,
operation_name AS operationName,
emp_code AS empCode,
emp_name AS empName,
operation_level AS operationLevel,
spell
FROM
emp_link_operation
</select>
</mapper>
</mapper>
\ 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