Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
315d7acb
Commit
315d7acb
authored
Jun 07, 2024
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企微托管账号
parent
6927181a
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1070 additions
and
24 deletions
+1070
-24
OpenStaffDTO.java
...main/java/com/gic/haoban/manage/api/dto/OpenStaffDTO.java
+249
-0
OpenStaffInitQDTO.java
...ava/com/gic/haoban/manage/api/qdto/OpenStaffInitQDTO.java
+34
-0
OpenStaffApiService.java
...om/gic/haoban/manage/api/service/OpenStaffApiService.java
+57
-0
QywxCallbackController.java
.../haoban/manage/web/controller/QywxCallbackController.java
+11
-23
OpenStaffMapper.java
...gic/haoban/manage/service/dao/mapper/OpenStaffMapper.java
+29
-0
WxEnterpriseMapper.java
.../haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
+3
-0
TabOpenStaff.java
...va/com/gic/haoban/manage/service/entity/TabOpenStaff.java
+269
-0
QwOpenResultInitBO.java
...om/gic/haoban/manage/service/pojo/QwOpenResultInitBO.java
+36
-0
OpenStaffService.java
...m/gic/haoban/manage/service/service/OpenStaffService.java
+9
-0
WxEnterpriseService.java
...ic/haoban/manage/service/service/WxEnterpriseService.java
+7
-0
OpenStaffServiceImpl.java
...ban/manage/service/service/impl/OpenStaffServiceImpl.java
+32
-0
WxEnterpriseServiceImpl.java
.../manage/service/service/impl/WxEnterpriseServiceImpl.java
+5
-0
OpenStaffApiServiceImpl.java
...age/service/service/out/impl/OpenStaffApiServiceImpl.java
+131
-0
OpenUtils.java
...in/java/com/gic/haoban/manage/service/util/OpenUtils.java
+80
-0
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+4
-1
OpenStaffMapper.xml
...ge3-service/src/main/resources/mapper/OpenStaffMapper.xml
+83
-0
WxEnterpriseMapper.xml
...-service/src/main/resources/mapper/WxEnterpriseMapper.xml
+6
-0
OpenStaffMapper.xml
...ervice/src/main/resources/mapper/role/OpenStaffMapper.xml
+0
-0
QwOpenTest.java
haoban-manage3-service/src/test/java/QwOpenTest.java
+25
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/OpenStaffDTO.java
0 → 100644
View file @
315d7acb
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* tab_haoban_open_staff
*/
public
class
OpenStaffDTO
implements
Serializable
{
/**
* 主键
*/
private
Long
openStaffId
;
/**
* 企微id
*/
private
String
wxEnterpriseId
;
/**
* 成员id
*/
private
String
staffId
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 客户端id
*/
private
String
uuid
;
/**
* 是否删除1是0否
*/
private
Integer
deleteFlag
;
/**
* 0待验证 1授权中 2已过期
*/
private
Integer
statusFlag
;
/**
* 登录步骤
*/
private
Integer
step
;
/**
* 企微的userid
*/
private
Long
qwUserId
;
/**
* 企微的企业id
*/
private
Long
wxCorpId
;
/**
* 一次扫码内容
*/
private
String
qrCode1
;
/**
* 一次扫码内容
*/
private
String
key1
;
/**
* 二次扫码内容
*/
private
String
qrCode2
;
/**
* 二次扫码内容
*/
private
String
key2
;
/**
* 是否需要验证码
*/
private
Integer
validFlag
;
/**
* 最新授权时间
*/
private
Date
authTime
;
/**
* 首次授权时间
*/
private
Date
firstAuthTime
;
/**
* tab_haoban_open_staff
*/
private
static
final
long
serialVersionUID
=
1L
;
public
Long
getOpenStaffId
()
{
return
openStaffId
;
}
public
void
setOpenStaffId
(
Long
openStaffId
)
{
this
.
openStaffId
=
openStaffId
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
==
null
?
null
:
wxEnterpriseId
.
trim
();
}
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
==
null
?
null
:
staffId
.
trim
();
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getUuid
()
{
return
uuid
;
}
public
void
setUuid
(
String
uuid
)
{
this
.
uuid
=
uuid
==
null
?
null
:
uuid
.
trim
();
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
public
Integer
getStatusFlag
()
{
return
statusFlag
;
}
public
void
setStatusFlag
(
Integer
statusFlag
)
{
this
.
statusFlag
=
statusFlag
;
}
public
Integer
getStep
()
{
return
step
;
}
public
void
setStep
(
Integer
step
)
{
this
.
step
=
step
;
}
public
Long
getQwUserId
()
{
return
qwUserId
;
}
public
void
setQwUserId
(
Long
qwUserId
)
{
this
.
qwUserId
=
qwUserId
;
}
public
Long
getWxCorpId
()
{
return
wxCorpId
;
}
public
void
setWxCorpId
(
Long
wxCorpId
)
{
this
.
wxCorpId
=
wxCorpId
;
}
public
String
getQrCode1
()
{
return
qrCode1
;
}
public
void
setQrCode1
(
String
qrCode1
)
{
this
.
qrCode1
=
qrCode1
==
null
?
null
:
qrCode1
.
trim
();
}
public
String
getKey1
()
{
return
key1
;
}
public
void
setKey1
(
String
key1
)
{
this
.
key1
=
key1
==
null
?
null
:
key1
.
trim
();
}
public
String
getQrCode2
()
{
return
qrCode2
;
}
public
void
setQrCode2
(
String
qrCode2
)
{
this
.
qrCode2
=
qrCode2
==
null
?
null
:
qrCode2
.
trim
();
}
public
String
getKey2
()
{
return
key2
;
}
public
void
setKey2
(
String
key2
)
{
this
.
key2
=
key2
==
null
?
null
:
key2
.
trim
();
}
public
Integer
getValidFlag
()
{
return
validFlag
;
}
public
void
setValidFlag
(
Integer
validFlag
)
{
this
.
validFlag
=
validFlag
;
}
public
Date
getAuthTime
()
{
return
authTime
;
}
public
void
setAuthTime
(
Date
authTime
)
{
this
.
authTime
=
authTime
;
}
public
Date
getFirstAuthTime
()
{
return
firstAuthTime
;
}
public
void
setFirstAuthTime
(
Date
firstAuthTime
)
{
this
.
firstAuthTime
=
firstAuthTime
;
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/qdto/OpenStaffInitQDTO.java
0 → 100644
View file @
315d7acb
package
com
.
gic
.
haoban
.
manage
.
api
.
qdto
;
import
java.io.Serializable
;
public
class
OpenStaffInitQDTO
implements
Serializable
{
private
String
wxEnterpriseId
;
private
String
enterpriseId
;
private
String
staffId
;
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/OpenStaffApiService.java
0 → 100644
View file @
315d7acb
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.OpenStaffDTO
;
import
com.gic.haoban.manage.api.qdto.OpenStaffInitQDTO
;
public
interface
OpenStaffApiService
{
/**
* 授权绑定
* @param qdto
* @return
*/
public
ServiceResponse
<
Long
>
init
(
OpenStaffInitQDTO
qdto
)
;
/**
* id查询
* @param openStaffId
* @return
*/
public
ServiceResponse
<
OpenStaffDTO
>
getById
(
Long
openStaffId
)
;
/**
* 删除
* @param id
* @return
*/
public
ServiceResponse
<
Void
>
delete
(
Long
id
)
;
/**
* 设置需要输入验证码
* @param uuid
* @return
*/
public
ServiceResponse
<
Void
>
updateValiFlag
(
String
uuid
)
;
/**
* 登录成功
*/
public
ServiceResponse
<
Void
>
login
(
String
uuid
,
Long
qwCorpid
,
String
corpNam
,
Long
qwUserId
)
;
/**
* 退出登录
*/
public
ServiceResponse
<
Void
>
logout
(
String
uuid
)
;
/**
*
* @param uuid
* @param loginStatus
* @return
*/
public
ServiceResponse
<
Void
>
updateLoginStatus
(
String
uuid
,
int
loginStatus
)
;
}
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/QywxCallbackController.java
View file @
315d7acb
...
@@ -5,9 +5,11 @@ import com.gic.authcenter.commons.util.IgnoreLogin;
...
@@ -5,9 +5,11 @@ import com.gic.authcenter.commons.util.IgnoreLogin;
import
com.gic.commons.util.GlobalVar
;
import
com.gic.commons.util.GlobalVar
;
import
com.gic.commons.util.HttpClient
;
import
com.gic.commons.util.HttpClient
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.service.OpenStaffApiService
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -24,7 +26,8 @@ public class QywxCallbackController extends WebBaseController {
...
@@ -24,7 +26,8 @@ public class QywxCallbackController extends WebBaseController {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QywxCallbackController
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QywxCallbackController
.
class
);
private
static
final
String
url
=
"http://47.94.7.218:8089/wxwork/%s"
;
@Autowired
private
OpenStaffApiService
openStaffApiService
;
@RequestMapping
(
"qywx-msg-notice"
)
@RequestMapping
(
"qywx-msg-notice"
)
@IgnoreLogin
@IgnoreLogin
...
@@ -85,43 +88,28 @@ public class QywxCallbackController extends WebBaseController {
...
@@ -85,43 +88,28 @@ public class QywxCallbackController extends WebBaseController {
}
}
private
void
v100001
(
String
uuid
,
JSONObject
json
)
{
private
void
v100001
(
String
uuid
,
JSONObject
json
)
{
logger
.
info
(
"用户扫码={}"
,
uuid
);
logger
.
info
(
"用户扫码={}"
,
uuid
);
}
}
private
void
v100004
(
String
uuid
,
JSONObject
json
)
{
private
void
v100004
(
String
uuid
,
JSONObject
json
)
{
logger
.
info
(
"需要输入验证码校验={}"
,
uuid
);
logger
.
info
(
"需要输入验证码校验={}"
,
uuid
);
this
.
openStaffApiService
.
updateValiFlag
(
uuid
)
;
}
}
private
void
v100002
(
String
uuid
,
JSONObject
json
)
{
private
void
v100002
(
String
uuid
,
JSONObject
json
)
{
logger
.
info
(
"验证码校验成功返回={}"
,
uuid
);
logger
.
info
(
"验证码校验成功返回={}"
,
uuid
);
}
}
private
void
loginSuccess
(
String
uuid
,
JSONObject
json
)
{
private
void
loginSuccess
(
String
uuid
,
JSONObject
json
)
{
logger
.
info
(
"登录成功={}"
,
uuid
);
logger
.
info
(
"登录成功={}"
,
uuid
);
Long
qwCorpId
=
json
.
getLong
(
"corp_id"
)
;
Long
qwUserid
=
json
.
getLong
(
"user_id"
)
;
String
corpName
=
json
.
getString
(
"corp_name"
)
;
this
.
openStaffApiService
.
login
(
uuid
,
qwCorpId
,
corpName
,
qwUserid
)
;
}
}
private
void
close
(
String
uuid
,
JSONObject
json
)
{
private
void
close
(
String
uuid
,
JSONObject
json
)
{
logger
.
info
(
"退出={}"
,
uuid
);
logger
.
info
(
"退出={}"
,
uuid
);
this
.
openStaffApiService
.
logout
(
uuid
)
;
}
}
private
void
v100003
(
String
uuid
,
JSONObject
json
)
{
private
void
v100003
(
String
uuid
,
JSONObject
json
)
{
logger
.
info
(
"取消登录={}"
,
uuid
);
logger
.
info
(
"取消登录={}"
,
uuid
);
}
}
@RequestMapping
(
"qywx-init"
)
@IgnoreLogin
public
HaobanResponse
init
()
{
String
callbackUrl
=
GlobalVar
.
ctxPropertiesMap
.
get
(
"haoban_service_host"
)+
"/haoban-manage3-operation-web/qywx-msg-notice"
;
String
map1
=
HttpClient
.
sendPostJSON
(
String
.
format
(
url
,
"init"
)
,
"{}"
,
"utf-8"
)
;
logger
.
info
(
map1
);
JSONObject
json
=
JSONObject
.
parseObject
(
map1
)
;
String
uuid
=
json
.
getJSONObject
(
"data"
).
getString
(
"uuid"
)
;
JSONObject
setCallbackUrl
=
new
JSONObject
()
;
setCallbackUrl
.
put
(
"uuid"
,
uuid
)
;
setCallbackUrl
.
put
(
"url"
,
callbackUrl
)
;
String
map2
=
HttpClient
.
sendPostJSON
(
String
.
format
(
url
,
"SetCallbackUrl"
),
setCallbackUrl
.
toJSONString
(),
"utf-8"
)
;
String
map3
=
HttpClient
.
sendPostJSON
(
String
.
format
(
url
,
"getQrCode"
),
setCallbackUrl
.
toJSONString
(),
"utf-8"
)
;
List
<
String
>
list
=
new
ArrayList
<>()
;
list
.
add
(
map1
);
list
.
add
(
map2
);
list
.
add
(
map3
);
HaobanResponse
resp
=
new
HaobanResponse
()
;
resp
.
setResult
(
list
);
return
resp
;
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/OpenStaffMapper.java
0 → 100644
View file @
315d7acb
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
com.gic.haoban.manage.service.entity.TabOpenStaff
;
import
org.apache.ibatis.annotations.Param
;
public
interface
OpenStaffMapper
{
/**
* 根据主键删除
*/
int
deleteByPrimaryKey
(
@Param
(
"id"
)
Long
id
);
/**
* 插入一条记录
*/
int
insert
(
TabOpenStaff
record
);
int
update
(
TabOpenStaff
tab
)
;
TabOpenStaff
getByStaffId
(
@Param
(
"staffId"
)
String
staffId
)
;
TabOpenStaff
getByUUID
(
@Param
(
"uuid"
)
String
uuid
)
;
void
updateValiFlag
(
@Param
(
"uuid"
)
String
uuid
);
TabOpenStaff
getById
(
Long
openStaffId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
View file @
315d7acb
...
@@ -94,4 +94,6 @@ public interface WxEnterpriseMapper {
...
@@ -94,4 +94,6 @@ public interface WxEnterpriseMapper {
* @return
* @return
*/
*/
List
<
String
>
listWxEnterpriseByCallbackFlag
(
@Param
(
"callbackFlag"
)
Integer
callbackFlag
);
List
<
String
>
listWxEnterpriseByCallbackFlag
(
@Param
(
"callbackFlag"
)
Integer
callbackFlag
);
String
getWxEnterpriseIdByName
(
@Param
(
"corpName"
)
String
corpName
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabOpenStaff.java
0 → 100644
View file @
315d7acb
package
com
.
gic
.
haoban
.
manage
.
service
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* tab_haoban_open_staff
*/
public
class
TabOpenStaff
implements
Serializable
{
/**
* 主键
*/
private
Long
openStaffId
;
/**
* 企微id
*/
private
String
wxEnterpriseId
;
private
String
enterpriseId
;
/**
* 成员id
*/
private
String
staffId
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 客户端id
*/
private
String
uuid
;
/**
* 是否删除1是0否
*/
private
Integer
deleteFlag
;
/**
* 0待验证 1授权中 2已过期
*/
private
Integer
statusFlag
;
/**
* 登录步骤
*/
private
Integer
step
;
/**
* 企微的userid
*/
private
Long
qwUserId
;
/**
* 企微的企业id
*/
private
Long
wxCorpId
;
/**
* 一次扫码内容
*/
private
String
qrCode1
;
/**
* 一次扫码内容
*/
private
String
key1
;
/**
* 二次扫码内容
*/
private
String
qrCode2
;
/**
* 二次扫码内容
*/
private
String
key2
;
/**
* 是否需要验证码
*/
private
Integer
validFlag
;
/**
* 最新授权时间
*/
private
Date
authTime
;
/**
* 首次授权时间
*/
private
Date
firstAuthTime
;
private
Integer
validQrcodeFlag
;
/**
* tab_haoban_open_staff
*/
private
static
final
long
serialVersionUID
=
1L
;
public
Integer
getValidQrcodeFlag
()
{
return
validQrcodeFlag
;
}
public
void
setValidQrcodeFlag
(
Integer
validQrcodeFlag
)
{
this
.
validQrcodeFlag
=
validQrcodeFlag
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Long
getOpenStaffId
()
{
return
openStaffId
;
}
public
void
setOpenStaffId
(
Long
openStaffId
)
{
this
.
openStaffId
=
openStaffId
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
==
null
?
null
:
wxEnterpriseId
.
trim
();
}
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
==
null
?
null
:
staffId
.
trim
();
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getUuid
()
{
return
uuid
;
}
public
void
setUuid
(
String
uuid
)
{
this
.
uuid
=
uuid
==
null
?
null
:
uuid
.
trim
();
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
public
Integer
getStatusFlag
()
{
return
statusFlag
;
}
public
void
setStatusFlag
(
Integer
statusFlag
)
{
this
.
statusFlag
=
statusFlag
;
}
public
Integer
getStep
()
{
return
step
;
}
public
void
setStep
(
Integer
step
)
{
this
.
step
=
step
;
}
public
Long
getQwUserId
()
{
return
qwUserId
;
}
public
void
setQwUserId
(
Long
qwUserId
)
{
this
.
qwUserId
=
qwUserId
;
}
public
Long
getWxCorpId
()
{
return
wxCorpId
;
}
public
void
setWxCorpId
(
Long
wxCorpId
)
{
this
.
wxCorpId
=
wxCorpId
;
}
public
String
getQrCode1
()
{
return
qrCode1
;
}
public
void
setQrCode1
(
String
qrCode1
)
{
this
.
qrCode1
=
qrCode1
==
null
?
null
:
qrCode1
.
trim
();
}
public
String
getKey1
()
{
return
key1
;
}
public
void
setKey1
(
String
key1
)
{
this
.
key1
=
key1
==
null
?
null
:
key1
.
trim
();
}
public
String
getQrCode2
()
{
return
qrCode2
;
}
public
void
setQrCode2
(
String
qrCode2
)
{
this
.
qrCode2
=
qrCode2
==
null
?
null
:
qrCode2
.
trim
();
}
public
String
getKey2
()
{
return
key2
;
}
public
void
setKey2
(
String
key2
)
{
this
.
key2
=
key2
==
null
?
null
:
key2
.
trim
();
}
public
Integer
getValidFlag
()
{
return
validFlag
;
}
public
void
setValidFlag
(
Integer
validFlag
)
{
this
.
validFlag
=
validFlag
;
}
public
Date
getAuthTime
()
{
return
authTime
;
}
public
void
setAuthTime
(
Date
authTime
)
{
this
.
authTime
=
authTime
;
}
public
Date
getFirstAuthTime
()
{
return
firstAuthTime
;
}
public
void
setFirstAuthTime
(
Date
firstAuthTime
)
{
this
.
firstAuthTime
=
firstAuthTime
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/QwOpenResultInitBO.java
0 → 100644
View file @
315d7acb
package
com
.
gic
.
haoban
.
manage
.
service
.
pojo
;
import
java.io.Serializable
;
public
class
QwOpenResultInitBO
implements
Serializable
{
private
String
uuid
;
private
String
qrcode
;
private
String
Key
;
public
String
getUuid
()
{
return
uuid
;
}
public
void
setUuid
(
String
uuid
)
{
this
.
uuid
=
uuid
;
}
public
String
getQrcode
()
{
return
qrcode
;
}
public
void
setQrcode
(
String
qrcode
)
{
this
.
qrcode
=
qrcode
;
}
public
String
getKey
()
{
return
Key
;
}
public
void
setKey
(
String
key
)
{
Key
=
key
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/OpenStaffService.java
0 → 100644
View file @
315d7acb
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
import
com.gic.haoban.manage.service.entity.TabOpenStaff
;
public
interface
OpenStaffService
{
public
TabOpenStaff
save
(
TabOpenStaff
tab
)
;
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseService.java
View file @
315d7acb
...
@@ -99,4 +99,11 @@ public interface WxEnterpriseService {
...
@@ -99,4 +99,11 @@ public interface WxEnterpriseService {
*/
*/
List
<
String
>
listWxEnterpriseByCallbackFlag
(
Integer
callbackFlag
);
List
<
String
>
listWxEnterpriseByCallbackFlag
(
Integer
callbackFlag
);
/**
* 查询id
* @param corpName
* @return
*/
String
getWxEnterpriseIdByName
(
String
corpName
)
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/OpenStaffServiceImpl.java
0 → 100644
View file @
315d7acb
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.manage.service.dao.mapper.OpenStaffMapper
;
import
com.gic.haoban.manage.service.entity.TabOpenStaff
;
import
com.gic.haoban.manage.service.service.OpenStaffService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
@Service
(
"openStaffService"
)
public
class
OpenStaffServiceImpl
implements
OpenStaffService
{
@Autowired
private
OpenStaffMapper
openStaffMapper
;
@Override
public
TabOpenStaff
save
(
TabOpenStaff
tab
)
{
tab
.
setUpdateTime
(
new
Date
());
if
(
null
==
tab
.
getOpenStaffId
())
{
tab
.
setOpenStaffId
(
UniqueIdUtils
.
uniqueLong
());
tab
.
setDeleteFlag
(
0
);
tab
.
setStatusFlag
(
2
);
tab
.
setCreateTime
(
new
Date
());
this
.
openStaffMapper
.
insert
(
tab
)
;
}
else
{
this
.
openStaffMapper
.
update
(
tab
)
;
}
return
tab
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseServiceImpl.java
View file @
315d7acb
...
@@ -316,4 +316,9 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
...
@@ -316,4 +316,9 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
public
List
<
String
>
listWxEnterpriseByCallbackFlag
(
Integer
callbackFlag
)
{
public
List
<
String
>
listWxEnterpriseByCallbackFlag
(
Integer
callbackFlag
)
{
return
this
.
mapper
.
listWxEnterpriseByCallbackFlag
(
callbackFlag
);
return
this
.
mapper
.
listWxEnterpriseByCallbackFlag
(
callbackFlag
);
}
}
@Override
public
String
getWxEnterpriseIdByName
(
String
corpName
)
{
return
this
.
mapper
.
getWxEnterpriseIdByName
(
corpName
)
;
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/OpenStaffApiServiceImpl.java
0 → 100644
View file @
315d7acb
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.manage.api.dto.OpenStaffDTO
;
import
com.gic.haoban.manage.api.qdto.OpenStaffInitQDTO
;
import
com.gic.haoban.manage.api.service.OpenStaffApiService
;
import
com.gic.haoban.manage.service.dao.mapper.OpenStaffMapper
;
import
com.gic.haoban.manage.service.entity.TabOpenStaff
;
import
com.gic.haoban.manage.service.pojo.QwOpenResultInitBO
;
import
com.gic.haoban.manage.service.service.OpenStaffService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.util.OpenUtils
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
/**
* 企微托管账号
*/
@Service
(
"openStaffApiService"
)
public
class
OpenStaffApiServiceImpl
implements
OpenStaffApiService
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
OpenStaffApiService
.
class
);
@Autowired
private
OpenStaffMapper
openStaffMapper
;
@Autowired
private
OpenStaffService
openStaffService
;
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Override
public
ServiceResponse
<
Void
>
delete
(
Long
id
)
{
this
.
openStaffMapper
.
deleteByPrimaryKey
(
id
)
;
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Void
>
updateValiFlag
(
String
uuid
)
{
this
.
openStaffMapper
.
updateValiFlag
(
uuid
)
;
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Void
>
updateLoginStatus
(
String
uuid
,
int
loginStatus
)
{
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Void
>
login
(
String
uuid
,
Long
qwCorpId
,
String
corpName
,
Long
qwUserId
)
{
TabOpenStaff
openStaff
=
this
.
openStaffMapper
.
getByUUID
(
uuid
)
;
if
(
null
==
openStaff
)
{
log
.
info
(
"通过uuid查不到={}"
,
uuid
);
OpenUtils
.
logout
(
uuid
);
return
ServiceResponse
.
failure
(
"9999"
,
"登录错误"
)
;
}
String
wxEnterpriseId
=
openStaff
.
getWxEnterpriseId
()
;
String
backWxEnterpriseId
=
this
.
wxEnterpriseService
.
getWxEnterpriseIdByName
(
corpName
)
;
if
(
StringUtils
.
isBlank
(
backWxEnterpriseId
)
||
!
backWxEnterpriseId
.
equals
(
wxEnterpriseId
))
{
OpenUtils
.
logout
(
uuid
);
log
.
info
(
"登录的企业不对={},{}"
,
uuid
,
corpName
);
return
ServiceResponse
.
failure
(
"9999"
,
"登录错误"
)
;
}
openStaff
.
setWxCorpId
(
qwCorpId
);
openStaff
.
setQwUserId
(
qwUserId
);
if
(
null
==
openStaff
.
getFirstAuthTime
())
{
openStaff
.
setFirstAuthTime
(
new
Date
());
}
openStaff
.
setAuthTime
(
new
Date
());
openStaff
.
setStatusFlag
(
1
);
this
.
openStaffMapper
.
update
(
openStaff
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Void
>
logout
(
String
uuid
)
{
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
OpenStaffDTO
>
getById
(
Long
openStaffId
)
{
TabOpenStaff
openStaff
=
this
.
openStaffMapper
.
getById
(
openStaffId
)
;
if
(
null
==
openStaff
)
{
return
ServiceResponse
.
failure
(
"9999"
,
"已删除"
)
;
}
OpenStaffDTO
dto
=
EntityUtil
.
changeEntityByJSON
(
OpenStaffDTO
.
class
,
openStaff
)
;
return
ServiceResponse
.
success
(
dto
);
}
@Override
public
ServiceResponse
<
Long
>
init
(
OpenStaffInitQDTO
qdto
)
{
String
staffId
=
qdto
.
getStaffId
();
if
(
StringUtils
.
isBlank
(
staffId
))
{
log
.
info
(
"staffId is null"
);
return
ServiceResponse
.
failure
(
"9999"
,
"staffId为空"
)
;
}
String
lockKey
=
"lock:qywx:open:"
+
staffId
;
try
{
RedisUtil
.
lock
(
lockKey
,
3L
);
TabOpenStaff
openStaff
=
this
.
openStaffMapper
.
getByStaffId
(
staffId
)
;
if
(
null
==
openStaff
)
{
openStaff
=
new
TabOpenStaff
()
;
openStaff
.
setStaffId
(
staffId
);
openStaff
.
setWxEnterpriseId
(
qdto
.
getWxEnterpriseId
());
openStaff
.
setEnterpriseId
(
qdto
.
getEnterpriseId
());
}
Long
qwUserId
=
null
;
if
(
null
!=
openStaff
)
{
qwUserId
=
openStaff
.
getQwUserId
()
;
}
ServiceResponse
<
QwOpenResultInitBO
>
resp
=
OpenUtils
.
init
(
qwUserId
)
;
log
.
info
(
"resp={}"
,
JSONObject
.
toJSONString
(
resp
));
QwOpenResultInitBO
init
=
resp
.
getResult
()
;
openStaff
.
setUuid
(
init
.
getUuid
());
openStaff
.
setQrCode1
(
init
.
getQrcode
());
openStaff
.
setKey1
(
init
.
getKey
());
openStaff
=
this
.
openStaffService
.
save
(
openStaff
);
return
ServiceResponse
.
success
(
openStaff
.
getOpenStaffId
())
;
}
catch
(
Exception
e
)
{
log
.
info
(
"异常"
,
e
);
}
return
ServiceResponse
.
failure
(
"9999"
,
"登录失败"
)
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/OpenUtils.java
0 → 100644
View file @
315d7acb
package
com
.
gic
.
haoban
.
manage
.
service
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.GlobalVar
;
import
com.gic.commons.util.HttpClient
;
import
com.gic.haoban.manage.service.pojo.QwOpenResultBO
;
import
com.gic.haoban.manage.service.pojo.QwOpenResultInitBO
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
/**
* https://www.showdoc.com.cn/1889765213630885/8704551724545128 密码:147258
*/
public
class
OpenUtils
{
private
static
Logger
logger
=
LogManager
.
getLogger
(
OpenUtils
.
class
);
private
static
final
String
gicCallbackHost
=
GlobalVar
.
ctxPropertiesMap
.
get
(
"haoban_service_host"
)+
"/haoban-manage3-operation-web/qywx-msg-notice"
;
private
static
final
String
openHost
=
"http://47.94.7.218:8089/wxwork/%s"
;
public
static
ServiceResponse
<
QwOpenResultInitBO
>
init
(
Long
qwUserId
)
{
JSONObject
initJson
=
new
JSONObject
()
;
if
(
null
!=
qwUserId
)
{
initJson
.
put
(
"vid"
,
qwUserId
)
;
}
String
initStr
=
HttpClient
.
sendPostJSON
(
String
.
format
(
openHost
,
"init"
)
,
initJson
.
toJSONString
(),
"utf-8"
)
;
logger
.
info
(
"init={}"
,
initStr
);
QwOpenResultBO
initResult
=
result
(
initStr
)
;
if
(!
initResult
.
isOk
())
{
return
ServiceResponse
.
failure
(
"9999"
,
initResult
.
getErrmsg
())
;
}
QwOpenResultInitBO
initBO
=
JSONObject
.
parseObject
(
initResult
.
getData
().
toString
(),
QwOpenResultInitBO
.
class
)
;
String
uuid
=
initBO
.
getUuid
()
;
// 设置回调
setCallback
(
uuid
);
// 获取二维码
ServiceResponse
<
QwOpenResultInitBO
>
response
=
getQrcode
(
uuid
,
initBO
)
;
if
(!
response
.
isSuccess
())
{
return
response
;
}
return
ServiceResponse
.
success
(
initBO
)
;
}
public
static
void
logout
(
String
uuid
)
{
JSONObject
json
=
new
JSONObject
()
;
json
.
put
(
"uuid"
,
uuid
)
;
String
callbackJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
openHost
,
"LoginOut"
),
json
.
toJSONString
(),
"utf-8"
)
;
logger
.
info
(
"退出={},uuid={}"
,
callbackJson
,
uuid
);
}
private
static
void
setCallback
(
String
uuid
)
{
JSONObject
json
=
new
JSONObject
()
;
json
.
put
(
"uuid"
,
uuid
)
;
json
.
put
(
"url"
,
gicCallbackHost
)
;
String
callbackJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
openHost
,
"SetCallbackUrl"
),
json
.
toJSONString
(),
"utf-8"
)
;
logger
.
info
(
"设置回调={},uuid={}"
,
callbackJson
,
uuid
);
}
private
static
ServiceResponse
<
QwOpenResultInitBO
>
getQrcode
(
String
uuid
,
QwOpenResultInitBO
initBO
)
{
JSONObject
json
=
new
JSONObject
()
;
json
.
put
(
"uuid"
,
uuid
)
;
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
openHost
,
"getQrCode"
),
json
.
toJSONString
(),
"utf-8"
)
;
logger
.
info
(
"获取qrcode={},uuid={}"
,
backJson
,
uuid
);
QwOpenResultBO
initResult
=
result
(
backJson
)
;
if
(!
initResult
.
isOk
())
{
return
ServiceResponse
.
failure
(
"9999"
,
initResult
.
getErrmsg
())
;
}
QwOpenResultInitBO
backBO
=
JSONObject
.
parseObject
(
initResult
.
getData
().
toString
(),
QwOpenResultInitBO
.
class
)
;
initBO
.
setQrcode
(
backBO
.
getQrcode
());
initBO
.
setKey
(
backBO
.
getKey
());
return
ServiceResponse
.
success
()
;
}
private
static
QwOpenResultBO
result
(
String
json
)
{
QwOpenResultBO
bo
=
JSONObject
.
parseObject
(
json
,
QwOpenResultBO
.
class
);
return
bo
;
}
}
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
315d7acb
...
@@ -218,7 +218,8 @@
...
@@ -218,7 +218,8 @@
ref=
"interactRecordApiService"
timeout=
"10000"
/>
ref=
"interactRecordApiService"
timeout=
"10000"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.content.MallOrderStatusChangeApiService"
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.content.MallOrderStatusChangeApiService"
ref=
"mallOrderStatusChangeApiService"
timeout=
"10000"
/>
ref=
"mallOrderStatusChangeApiService"
timeout=
"10000"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.OpenStaffApiService"
ref=
"openStaffApiService"
timeout=
"10000"
/>
<dubbo:reference
interface=
"com.gic.store.goods.service.GoodsInfoOutApiService"
id=
"goodsInfoOutApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.store.goods.service.GoodsInfoOutApiService"
id=
"goodsInfoOutApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.store.goods.service.GoodsCenterApiService"
id=
"goodsCenterApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.store.goods.service.GoodsCenterApiService"
id=
"goodsCenterApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.business.order.service.ordermanage.OrderInfoOutApiService"
id=
"orderInfoOutApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.business.order.service.ordermanage.OrderInfoOutApiService"
id=
"orderInfoOutApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
...
@@ -237,4 +238,5 @@
...
@@ -237,4 +238,5 @@
<dubbo:reference
interface=
"com.gic.content.api.service.ContentSettingApiService"
id=
"contentSettingApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.content.api.service.ContentSettingApiService"
id=
"contentSettingApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.clerk.api.service.MenuApiService"
id=
"menuApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.clerk.api.service.MenuApiService"
id=
"menuApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
</beans>
</beans>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/OpenStaffMapper.xml
0 → 100644
View file @
315d7acb
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.gic.haoban.manage.service.dao.mapper.OpenStaffMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.TabOpenStaff"
>
<id
column=
"open_staff_id"
javaType=
"long"
jdbcType=
"BIGINT"
property=
"openStaffId"
/>
<result
column=
"wx_enterprise_id"
javaType=
"String"
jdbcType=
"CHAR"
property=
"wxEnterpriseId"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
/>
<result
column=
"staff_id"
javaType=
"String"
jdbcType=
"CHAR"
property=
"staffId"
/>
<result
column=
"create_time"
javaType=
"java.util.Date"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
javaType=
"java.util.Date"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"uuid"
javaType=
"String"
jdbcType=
"VARCHAR"
property=
"uuid"
/>
<result
column=
"delete_flag"
javaType=
"int"
jdbcType=
"INTEGER"
property=
"deleteFlag"
/>
<result
column=
"status_flag"
javaType=
"int"
jdbcType=
"INTEGER"
property=
"statusFlag"
/>
<result
column=
"step"
javaType=
"int"
jdbcType=
"INTEGER"
property=
"step"
/>
<result
column=
"qw_user_id"
javaType=
"long"
jdbcType=
"BIGINT"
property=
"qwUserId"
/>
<result
column=
"wx_corp_id"
javaType=
"long"
jdbcType=
"BIGINT"
property=
"wxCorpId"
/>
<result
column=
"qr_code_1"
javaType=
"String"
jdbcType=
"VARCHAR"
property=
"qrCode1"
/>
<result
column=
"key_1"
javaType=
"String"
jdbcType=
"VARCHAR"
property=
"key1"
/>
<result
column=
"qr_code_2"
javaType=
"String"
jdbcType=
"VARCHAR"
property=
"qrCode2"
/>
<result
column=
"key_2"
javaType=
"String"
jdbcType=
"VARCHAR"
property=
"key2"
/>
<result
column=
"valid_flag"
javaType=
"int"
jdbcType=
"INTEGER"
property=
"validFlag"
/>
<result
column=
"auth_time"
javaType=
"java.util.Date"
jdbcType=
"TIMESTAMP"
property=
"authTime"
/>
<result
column=
"first_auth_time"
javaType=
"java.util.Date"
jdbcType=
"TIMESTAMP"
property=
"firstAuthTime"
/>
<result
column=
"valid_qrcode_flag"
property=
"validQrcodeFlag"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
open_staff_id, wx_enterprise_id,enterprise_id, staff_id, create_time, update_time, uuid, delete_flag,status_flag, step, qw_user_id, wx_corp_id, qr_code_1, key_1,
qr_code_2, key_2, valid_flag, auth_time,first_auth_time , valid_qrcode_flag
</sql>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.dao.mapper.OpenStaffMapper"
>
<![CDATA[
INSERT INTO tab_haoban_open_staff(
open_staff_id, wx_enterprise_id, staff_id, create_time, update_time, uuid, delete_flag, status_flag, step, qw_user_id, wx_corp_id, qr_code_1, key_1,
qr_code_2, key_2,valid_flag, auth_time, first_auth_time , enterprise_id , valid_qrcode_flag
)VALUES(
#{openStaffId,jdbcType=BIGINT}, #{wxEnterpriseId,jdbcType=CHAR}, #{staffId,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{uuid,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER}, #{statusFlag,jdbcType=INTEGER},
#{step,jdbcType=INTEGER}, #{qwUserId,jdbcType=BIGINT}, #{wxCorpId,jdbcType=BIGINT}, #{qrCode1,jdbcType=VARCHAR},
#{key1,jdbcType=VARCHAR}, #{qrCode2,jdbcType=VARCHAR}, #{key2,jdbcType=VARCHAR}, #{validFlag,jdbcType=INTEGER},
#{authTime,jdbcType=TIMESTAMP}, #{firstAuthTime,jdbcType=TIMESTAMP} , #{enterpriseId} , #{validQrcodeFlag}
)
]]>
</insert>
<update
id=
"update"
parameterType=
"com.gic.haoban.manage.service.entity.TabOpenStaff"
>
update tab_haoban_open_staff set uuid = #{uuid} , update_time=now(),
status_flag=#{statusFlag,jdbcType=INTEGER},
step=#{step,jdbcType=INTEGER},
qw_user_id=#{qwUserId,jdbcType=BIGINT},
wx_corp_id=#{wxCorpId,jdbcType=BIGINT},
qr_code_1=#{qrCode1,jdbcType=VARCHAR},
key_1=#{key1,jdbcType=VARCHAR},
qr_code_2=#{qrCode2,jdbcType=VARCHAR},
key_2=#{key2,jdbcType=VARCHAR},
valid_flag=#{validFlag,jdbcType=INTEGER},
auth_time=#{authTime,jdbcType=TIMESTAMP},
<if
test=
"null != firstAuthTime"
>
first_auth_time=#{firstAuthTime} ,
</if>
where open_staff_id = #{openStaffId}
</update>
<update
id=
"updateValiFlag"
>
update tab_haoban_open_staff set valid_flag = 1 where uuid = #{uuid}
</update>
<delete
id=
"deleteByPrimaryKey"
>
update tab_haoban_open_staff set delete_flag = 1 , update_time =now() where open_staff_id = #{id}
</delete>
<select
id=
"getByStaffId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_open_staff where staff_id = #{staffId} and delete_flag = 0
</select>
<select
id=
"getById"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_open_staff where open_staff_id = #{id} and delete_flag = 0
</select>
<select
id=
"getByUUID"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_open_staff where uuid = #{uuid} and delete_flag = 0
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/WxEnterpriseMapper.xml
View file @
315d7acb
...
@@ -603,4 +603,9 @@
...
@@ -603,4 +603,9 @@
and callback_flag = #{callbackFlag}
and callback_flag = #{callbackFlag}
</select>
</select>
<select
id=
"getWxEnterpriseIdByName"
resultType=
"java.lang.String"
>
select wx_enterprise_id from tab_haoban_wx_enterprise where corp_name = #{corpName} and status_flag = 1 and wx_security_type > 0
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/role/
TabHaobanMenu
Mapper.xml
→
haoban-manage3-service/src/main/resources/mapper/role/
OpenStaff
Mapper.xml
View file @
315d7acb
File moved
haoban-manage3-service/src/test/java/QwOpenTest.java
0 → 100644
View file @
315d7acb
import
com.gic.haoban.manage.api.qdto.OpenStaffInitQDTO
;
import
com.gic.haoban.manage.api.service.OpenStaffApiService
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@ContextConfiguration
(
locations
=
{
"classpath:applicationContext-conf.xml"
})
public
class
QwOpenTest
{
@Autowired
private
OpenStaffApiService
openStaffApiService
;
@Test
public
void
tt
()
{
OpenStaffInitQDTO
s
=
new
OpenStaffInitQDTO
()
;
s
.
setStaffId
(
"52995ea8c81c4cc286a9b82bc36a7081"
);
s
.
setWxEnterpriseId
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
);
s
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
this
.
openStaffApiService
.
init
(
s
)
;
}
}
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