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
d9a14efc
Commit
d9a14efc
authored
Aug 27, 2024
by
徐高华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/xgh/240820' into 'master'
Feature/xgh/240820 See merge request
!2126
parents
9f41526c
3108b3a5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
658 additions
and
22 deletions
+658
-22
OpenStaffImportDTO.java
...ava/com/gic/haoban/manage/api/dto/OpenStaffImportDTO.java
+72
-0
OpenStaffInitQDTO.java
...ava/com/gic/haoban/manage/api/qdto/OpenStaffInitQDTO.java
+11
-0
OpenStaffImportTaskApiService.java
...ban/manage/api/service/OpenStaffImportTaskApiService.java
+15
-0
OpenStaffService.java
...m/gic/haoban/manage/service/service/OpenStaffService.java
+3
-1
OpenStaffServiceImpl.java
...ban/manage/service/service/impl/OpenStaffServiceImpl.java
+13
-3
OpenStaffApiServiceImpl.java
...age/service/service/out/impl/OpenStaffApiServiceImpl.java
+50
-7
OpenStaffImportTaskApiServiceImpl.java
...e/service/out/impl/OpenStaffImportTaskApiServiceImpl.java
+145
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+2
-2
CustomSwitcher.java
...va/com/gic/haoban/manage/service/util/CustomSwitcher.java
+5
-0
OpenUtils.java
...in/java/com/gic/haoban/manage/service/util/OpenUtils.java
+4
-1
applicationContext-conf.xml
...e3-service/src/main/resources/applicationContext-conf.xml
+2
-0
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+2
-1
QywxOpenController.java
...haoban/manage/web/controller/open/QywxOpenController.java
+148
-6
ImportExcelUtil.java
...java/com/gic/haoban/manage/web/utils/ImportExcelUtil.java
+146
-0
OpenClerkVO.java
...n/java/com/gic/haoban/manage/web/vo/open/OpenClerkVO.java
+38
-0
dubbo-haoban-manage-web.xml
...3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
+1
-0
WxStaffController.java
...m/gic/haoban/manage/web/controller/WxStaffController.java
+1
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/OpenStaffImportDTO.java
0 → 100644
View file @
d9a14efc
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
OpenStaffImportDTO
implements
Serializable
{
private
String
wxEnterpriseId
;
private
String
enterpriseId
;
private
List
<
String
>
clerkCodeList
;
private
String
loginClerkId
;
private
String
loginName
;
private
String
realName
;
private
String
clerkCode
;
public
String
getLoginName
()
{
return
loginName
;
}
public
void
setLoginName
(
String
loginName
)
{
this
.
loginName
=
loginName
;
}
public
String
getRealName
()
{
return
realName
;
}
public
void
setRealName
(
String
realName
)
{
this
.
realName
=
realName
;
}
public
String
getClerkCode
()
{
return
clerkCode
;
}
public
void
setClerkCode
(
String
clerkCode
)
{
this
.
clerkCode
=
clerkCode
;
}
public
String
getLoginClerkId
()
{
return
loginClerkId
;
}
public
void
setLoginClerkId
(
String
loginClerkId
)
{
this
.
loginClerkId
=
loginClerkId
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
List
<
String
>
getClerkCodeList
()
{
return
clerkCodeList
;
}
public
void
setClerkCodeList
(
List
<
String
>
clerkCodeList
)
{
this
.
clerkCodeList
=
clerkCodeList
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/qdto/OpenStaffInitQDTO.java
View file @
d9a14efc
...
...
@@ -9,6 +9,17 @@ public class OpenStaffInitQDTO implements Serializable {
private
String
staffId
;
private
int
loginAgainFlag
;
// 导入操作 1是0否
private
int
importFlag
;
public
int
getImportFlag
()
{
return
importFlag
;
}
public
void
setImportFlag
(
int
importFlag
)
{
this
.
importFlag
=
importFlag
;
}
public
int
getLoginAgainFlag
()
{
return
loginAgainFlag
;
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/OpenStaffImportTaskApiService.java
0 → 100644
View file @
d9a14efc
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.OpenStaffImportDTO
;
public
interface
OpenStaffImportTaskApiService
{
ServiceResponse
<
Void
>
callBack
(
String
params
);
ServiceResponse
<
String
>
createTask
(
OpenStaffImportDTO
dto
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/OpenStaffService.java
View file @
d9a14efc
...
...
@@ -27,9 +27,11 @@ public interface OpenStaffService {
* @param qwUserId
* @return
*/
String
autoLogin
(
Long
openStaffId
,
Long
qwUserId
)
;
String
autoLogin
(
Long
openStaffId
,
Long
qwUserId
,
String
wxEnterpriseId
)
;
void
openStaffTimer
();
void
openStaffServiceTimer
();
String
getDeverType
(
String
wxEnterpriseId
)
;
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/OpenStaffServiceImpl.java
View file @
d9a14efc
...
...
@@ -30,6 +30,7 @@ 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.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.util.CustomSwitcher
;
import
com.gic.haoban.manage.service.util.OpenUtils
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -223,8 +224,8 @@ public class OpenStaffServiceImpl implements OpenStaffService {
}
@Override
public
String
autoLogin
(
Long
openStaffId
,
Long
qwUserId
)
{
ServiceResponse
<
QwOpenResultInitBO
>
initResp
=
OpenUtils
.
init
(
qwUserId
,
false
);
public
String
autoLogin
(
Long
openStaffId
,
Long
qwUserId
,
String
wxEnterpriseId
)
{
ServiceResponse
<
QwOpenResultInitBO
>
initResp
=
OpenUtils
.
init
(
qwUserId
,
false
,
this
.
getDeverType
(
wxEnterpriseId
)
);
log
.
info
(
"自动登录-初始化={},{}"
,
qwUserId
,
JSONObject
.
toJSONString
(
initResp
));
if
(
initResp
.
isSuccess
()
&&
StringUtils
.
isNotBlank
(
initResp
.
getResult
().
getUuid
()))
{
QwOpenResultInitBO
bo
=
initResp
.
getResult
();
...
...
@@ -268,7 +269,7 @@ public class OpenStaffServiceImpl implements OpenStaffService {
boolean
isLogin
=
OpenUtils
.
isLogin
(
uuid
);
// 未登录
if
(!
isLogin
)
{
String
autLogin
=
this
.
autoLogin
(
item
.
getOpenStaffId
(),
item
.
getQwUserId
());
String
autLogin
=
this
.
autoLogin
(
item
.
getOpenStaffId
(),
item
.
getQwUserId
()
,
item
.
getWxEnterpriseId
()
);
if
(
null
==
autLogin
)
{
this
.
logout
(
uuid
,
"定时检查异"
,
0
,
OpenStaffOfflineEnum
.
OFFLINE2
.
getDesc
());
}
...
...
@@ -320,4 +321,13 @@ public class OpenStaffServiceImpl implements OpenStaffService {
}
return
true
;
}
@Override
public
String
getDeverType
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
return
null
;
}
return
CustomSwitcher
.
qywx_open_type
.
get
(
wxEnterpriseId
)
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/OpenStaffApiServiceImpl.java
View file @
d9a14efc
...
...
@@ -5,6 +5,9 @@ import com.gic.api.base.commons.BasePageInfo;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.api.dto.EnterpriseUsingPermissionDto
;
import
com.gic.enterprise.api.dto.WechatWorkServiceSetting
;
import
com.gic.enterprise.api.service.EnterpriseUseForbidService
;
import
com.gic.haoban.manage.api.dto.OpenStaffDTO
;
import
com.gic.haoban.manage.api.dto.OpenStaffLicenseDTO
;
import
com.gic.haoban.manage.api.dto.OpenStaffListDTO
;
...
...
@@ -46,6 +49,8 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
private
OpenStaffService
openStaffService
;
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
private
EnterpriseUseForbidService
enterpriseUseForbidService
;
@Override
public
ServiceResponse
<
Void
>
delete
(
Long
id
)
{
...
...
@@ -159,6 +164,10 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
if
(
null
==
tab
)
{
return
ServiceResponse
.
failure
(
"9999"
,
"记录不存在"
);
}
if
(
StringUtils
.
isBlank
(
tab
.
getKey1
()))
{
this
.
openStaffMapper
.
updateLoginStep
(
tab
.
getOpenStaffId
(),
0
);
return
ServiceResponse
.
failure
(
"9999"
,
"用户退出后,需重新获取登录码"
);
}
return
OpenUtils
.
checkCode
(
tab
.
getUuid
(),
tab
.
getKey1
(),
validCode
);
}
...
...
@@ -193,6 +202,9 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
try
{
RedisUtil
.
lock
(
lockKey
,
3L
);
TabOpenStaff
openStaff
=
this
.
openStaffMapper
.
getByStaffId
(
staffId
);
if
(
qdto
.
getImportFlag
()==
1
&&
null
!=
openStaff
)
{
return
ServiceResponse
.
failure
(
"9999"
,
"导购账号已授权"
)
;
}
Long
qwUserId
=
null
;
if
(
null
!=
openStaff
)
{
if
(
openStaff
.
getStatusFlag
()
==
1
&&
qdto
.
getLoginAgainFlag
()
==
0
)
{
...
...
@@ -202,7 +214,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
log
.
info
(
"重新初始化"
);
this
.
openStaffService
.
logout
(
openStaff
.
getUuid
(),
"重新初始化"
,
0
,
null
);
// 自动登录
String
newUuid
=
this
.
openStaffService
.
autoLogin
(
openStaff
.
getOpenStaffId
(),
openStaff
.
getQwUserId
())
;
String
newUuid
=
this
.
openStaffService
.
autoLogin
(
openStaff
.
getOpenStaffId
(),
openStaff
.
getQwUserId
()
,
openStaff
.
getWxEnterpriseId
()
)
;
if
(
null
!=
newUuid
)
{
log
.
info
(
"自动登录成功"
);
openStaff
.
setAuthTime
(
new
Date
());
...
...
@@ -220,18 +232,27 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
openStaff
.
setWxEnterpriseId
(
qdto
.
getWxEnterpriseId
());
openStaff
.
setEnterpriseId
(
qdto
.
getEnterpriseId
());
}
ServiceResponse
<
QwOpenResultInitBO
>
resp
=
OpenUtils
.
init
(
qwUserId
,
true
);
log
.
info
(
"resp={}"
,
JSONObject
.
toJSONString
(
resp
));
QwOpenResultInitBO
init
=
resp
.
getResult
();
openStaff
.
setUuid
(
init
.
getUuid
());
openStaff
.
setQrCode1
(
init
.
getQrcode
());
openStaff
.
setKey1
(
init
.
getKey
());
openStaff
.
setStatusFlag
(
2
);
openStaff
.
setStep
(
0
);
openStaff
.
setValidFlag
(
0
);
openStaff
.
setValidQrcodeFlag
(
0
);
openStaff
.
setQrCode2
(
null
);
openStaff
.
setKey2
(
null
);
if
(
qdto
.
getImportFlag
()==
1
)
{
boolean
flag
=
this
.
getCheckInfo
(
qdto
.
getWxEnterpriseId
(),
qdto
.
getEnterpriseId
())
;
if
(!
flag
)
{
return
ServiceResponse
.
failure
(
"9999"
,
"托管账号数量已达上线"
)
;
}
openStaff
=
this
.
openStaffService
.
save
(
openStaff
);
return
ServiceResponse
.
success
(
null
);
}
ServiceResponse
<
QwOpenResultInitBO
>
resp
=
OpenUtils
.
init
(
qwUserId
,
true
,
this
.
openStaffService
.
getDeverType
(
qdto
.
getWxEnterpriseId
()));
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
);
OpenStaffDTO
dto
=
EntityUtil
.
changeEntityByJSON
(
OpenStaffDTO
.
class
,
openStaff
);
dto
.
setQrcodeData
(
init
.
getQrcode_data
());
...
...
@@ -308,4 +329,26 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
public
void
updateStopTime
(
Long
openStaffId
,
int
type
,
int
time
)
{
this
.
openStaffMapper
.
updateStopTime
(
openStaffId
,
type
,
time
);
}
private
boolean
getCheckInfo
(
String
wxEnterpriseId
,
String
enterpriseId
)
{
ServiceResponse
<
EnterpriseUsingPermissionDto
>
resp
=
this
.
enterpriseUseForbidService
.
getWxEnterpriseService
(
enterpriseId
,
wxEnterpriseId
);
log
.
info
(
"托管许可={}"
,
JSONObject
.
toJSONString
(
resp
));
if
(
resp
.
isSuccess
())
{
EnterpriseUsingPermissionDto
dto
=
resp
.
getResult
();
if
(
null
==
dto
)
{
return
false
;
}
else
{
if
(
dto
.
getServiceEndDate
().
before
(
new
Date
()))
{
return
false
;
}
String
json
=
dto
.
getModuleSetting
();
WechatWorkServiceSetting
bo
=
JSONObject
.
parseObject
(
json
,
WechatWorkServiceSetting
.
class
);
int
total
=
bo
.
getAccountNumber
()
;
int
useNum
=
this
.
openStaffMapper
.
getNum
(
wxEnterpriseId
,
enterpriseId
,
0
);
log
.
info
(
"总数={},使用{},{},{}"
,
total
,
useNum
,
wxEnterpriseId
,
enterpriseId
);
return
total
>
useNum
;
}
}
return
false
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/OpenStaffImportTaskApiServiceImpl.java
0 → 100644
View file @
d9a14efc
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.ToolUtil
;
import
com.gic.haoban.manage.api.dto.OpenStaffDTO
;
import
com.gic.haoban.manage.api.dto.OpenStaffImportDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.qdto.OpenStaffInitQDTO
;
import
com.gic.haoban.manage.api.service.OpenStaffApiService
;
import
com.gic.haoban.manage.api.service.OpenStaffImportTaskApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.service.dao.mapper.OpenStaffMapper
;
import
com.gic.haoban.manage.service.entity.TabOpenStaff
;
import
com.google.common.collect.Lists
;
import
com.task.allocation.dto.AuthDTO
;
import
com.task.allocation.exception.TaskAllocationException
;
import
com.task.allocation.operation.AbstractTaskCenterManageOperation
;
import
com.task.allocation.qo.TaskAllocationComputed
;
import
com.task.allocation.qo.TaskCenterInitTaskQo
;
import
com.task.allocation.qo.TaskFailInfoQo
;
import
com.task.allocation.util.TaskAllocationSdkClient
;
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.List
;
import
java.util.stream.Collectors
;
@Service
(
"openStaffImportTaskApiService"
)
public
class
OpenStaffImportTaskApiServiceImpl
extends
AbstractTaskCenterManageOperation
<
OpenStaffImportDTO
>
implements
OpenStaffImportTaskApiService
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
OpenStaffImportTaskApiService
.
class
);
@Autowired
private
StaffClerkRelationApiService
staffClerkRelationApiService
;
@Autowired
private
OpenStaffApiService
openStaffApiService
;
@Autowired
private
OpenStaffMapper
openStaffMapper
;
@Autowired
private
ClerkService
clerkService
;
// openStaffImportTaskMQ
@Override
public
ServiceResponse
<
Void
>
callBack
(
String
params
)
{
log
.
info
(
"批量导入托管账号callback"
,
params
);
super
.
run
(
params
);
return
ServiceResponse
.
success
();
}
@Override
public
List
<
OpenStaffImportDTO
>
getListTasks
(
String
params
)
{
OpenStaffImportDTO
dto
=
JSON
.
parseObject
(
params
,
OpenStaffImportDTO
.
class
);
List
<
OpenStaffImportDTO
>
tasks
=
Lists
.
partition
(
dto
.
getClerkCodeList
(),
1
)
.
stream
()
.
map
(
item
->
{
OpenStaffImportDTO
sub
=
new
OpenStaffImportDTO
();
sub
.
setWxEnterpriseId
(
dto
.
getWxEnterpriseId
());
sub
.
setEnterpriseId
(
dto
.
getEnterpriseId
());
sub
.
setLoginClerkId
(
dto
.
getLoginClerkId
());
sub
.
setClerkCode
(
item
.
get
(
0
));
return
sub
;
}).
collect
(
Collectors
.
toList
());
log
.
info
(
"导入托管总任务数 {}"
,
tasks
.
size
());
return
tasks
;
}
@Override
public
TaskFailInfoQo
dealSingle
(
OpenStaffImportDTO
obj
)
throws
TaskAllocationException
{
log
.
info
(
"导入托管dealSingle={}"
,
JSONObject
.
toJSONString
(
obj
));
String
wxEnterpriseId
=
obj
.
getWxEnterpriseId
();
String
enterpriseId
=
obj
.
getEnterpriseId
()
;
String
clerkCode
=
obj
.
getClerkCode
()
;
ClerkDTO
clerk
=
this
.
clerkService
.
getClerkByClerkCode
(
enterpriseId
,
clerkCode
)
;
if
(
null
==
clerk
)
{
return
fail
().
setColumns
(
"导购code"
,
"失败说明"
)
.
addValues
(
clerkCode
,
"该账号在当前企业下不存在"
);
}
String
clerkId
=
clerk
.
getClerkId
()
;
StaffClerkRelationDTO
staffClerkRelationDTO
=
this
.
staffClerkRelationApiService
.
getByClerkId
(
clerkId
)
;
if
(
null
==
staffClerkRelationDTO
)
{
return
fail
().
setColumns
(
"导购code"
,
"失败原因"
)
.
addValues
(
clerkCode
,
"该账号未绑定好办小程序"
);
}
String
staffId
=
staffClerkRelationDTO
.
getStaffId
()
;
TabOpenStaff
openStaff
=
this
.
openStaffMapper
.
getByStaffId
(
staffId
)
;
if
(
null
!=
openStaff
)
{
return
fail
().
setColumns
(
"导购code"
,
"失败说明"
)
.
addValues
(
clerkCode
,
"导购账号已授权"
);
}
OpenStaffInitQDTO
init
=
new
OpenStaffInitQDTO
()
;
init
.
setWxEnterpriseId
(
wxEnterpriseId
);
init
.
setEnterpriseId
(
enterpriseId
);
init
.
setStaffId
(
staffId
);
init
.
setImportFlag
(
1
);
ServiceResponse
<
OpenStaffDTO
>
resp
=
this
.
openStaffApiService
.
init
(
init
)
;
if
(!
resp
.
isSuccess
())
{
return
fail
().
setColumns
(
"导购code"
,
"失败说明"
)
.
addValues
(
clerkCode
,
resp
.
getMessage
());
}
return
success
();
}
@Override
public
void
computed
(
TaskAllocationComputed
computed
)
{
log
.
info
(
"导入托管完成={}"
,
JSONObject
.
toJSONString
(
computed
));
}
@Override
public
OpenStaffImportDTO
singleClass
()
{
return
new
OpenStaffImportDTO
();
}
@Override
public
ServiceResponse
<
String
>
createTask
(
OpenStaffImportDTO
dto
)
{
TaskCenterInitTaskQo
initTaskQo
=
new
TaskCenterInitTaskQo
();
String
uuid
=
ToolUtil
.
randomUUID
();
initTaskQo
.
setParams
(
JSONObject
.
toJSONString
(
dto
));
initTaskQo
.
setBusinessParams
(
uuid
);
initTaskQo
.
setTaskCategoryCode
(
"openStaffImportTask"
);
initTaskQo
.
setTaskType
(
1
);
AuthDTO
user
=
new
AuthDTO
();
user
.
setUserId
(
dto
.
getLoginClerkId
())
;
user
.
setEnterpriseId
(
dto
.
getEnterpriseId
())
;
user
.
setLoginName
(
dto
.
getLoginName
());
user
.
setRealName
(
dto
.
getRealName
())
;
initTaskQo
.
setLoginUser
(
user
);
initTaskQo
.
setTaskModelName
(
"好办企微托管"
);
initTaskQo
.
setTaskName
(
"导入托管账号"
);
initTaskQo
.
setTaskContent
(
"批量导入托管账号"
+
dto
.
getClerkCodeList
().
size
()
+
"个"
);
try
{
TaskAllocationSdkClient
instance
=
TaskAllocationSdkClient
.
getInstance
();
String
taskId
=
instance
.
initTask
(
initTaskQo
);
return
ServiceResponse
.
success
(
taskId
);
}
catch
(
Exception
e
)
{
log
.
info
(
"批量导入托管账号dto任务异常"
,
e
);
}
return
ServiceResponse
.
failure
(
"9999"
,
"创建任务异常"
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
d9a14efc
...
...
@@ -1008,7 +1008,7 @@ public class StaffApiServiceImpl implements StaffApiService {
pageParam
.
setCurrentPage
(
1
);
pageParam
.
setPageSize
(
1
);
if
(
clerkType
==
2
)
{
String
storeWidgetId
=
this
.
powerService
.
getStoreWidgetId
(
n
ew
Date
()
,
clerkId
);
String
storeWidgetId
=
this
.
powerService
.
getStoreWidgetId
(
n
ull
,
clerkId
);
if
(
null
!=
storeWidgetId
)
{
Page
<
StoreDTO
>
page
=
storeWidgetService
.
getStoreWidgetStore
(
storeWidgetId
,
null
,
clerkDTO
.
getEnterpriseId
(),
pageParam
,
null
,
null
);
storeId
=
page
.
getResult
().
get
(
0
).
getStoreId
();
...
...
@@ -1046,7 +1046,7 @@ public class StaffApiServiceImpl implements StaffApiService {
String
enterpriseId
=
clerkDTO
.
getEnterpriseId
();
EnterpriseSettingDTO
enterpriseSetting
=
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
);
if
(
enterpriseSetting
.
getEnableAccessControl
()
!=
null
&&
enterpriseSetting
.
getEnableAccessControl
()
==
1
)
{
String
storeWidgetId
=
this
.
powerService
.
getStoreWidgetId
(
n
ew
Date
()
,
clerkId
);
String
storeWidgetId
=
this
.
powerService
.
getStoreWidgetId
(
n
ull
,
clerkId
);
if
(
StringUtils
.
isBlank
(
storeWidgetId
))
{
logger
.
info
(
"导购无门店权限,门店组件id is null"
);
return
Collections
.
emptyList
();
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/CustomSwitcher.java
View file @
d9a14efc
...
...
@@ -3,9 +3,14 @@ package com.gic.haoban.manage.service.util;
import
com.gic.commons.switcher.Switcher
;
import
com.gic.commons.switcher.SwitcherNamespace
;
import
java.util.Map
;
@SwitcherNamespace
(
"BUZ.qywx.open"
)
public
class
CustomSwitcher
{
@Switcher
public
static
Map
<
String
,
String
>
qywx_open_type
;
/**
* 积分触不通知会员名单
*/
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/OpenUtils.java
View file @
d9a14efc
...
...
@@ -23,11 +23,14 @@ public class OpenUtils {
return
CustomSwitcher
.
qywx_open_host
;
}
public
static
ServiceResponse
<
QwOpenResultInitBO
>
init
(
Long
qwUserId
,
boolean
qrcodeFlag
)
{
public
static
ServiceResponse
<
QwOpenResultInitBO
>
init
(
Long
qwUserId
,
boolean
qrcodeFlag
,
String
deverType
)
{
JSONObject
initJson
=
new
JSONObject
();
if
(
null
!=
qwUserId
)
{
initJson
.
put
(
"vid"
,
qwUserId
);
}
if
(
null
!=
deverType
)
{
initJson
.
put
(
"deverType"
,
deverType
)
;
}
String
initStr
=
HttpClient
.
sendPostJSON
(
String
.
format
(
getHost
(),
"init"
),
initJson
.
toJSONString
(),
"utf-8"
);
logger
.
info
(
"企微初始化,req={},{}"
,
initJson
.
toJSONString
(),
initStr
);
QwOpenResultBO
initResult
=
result
(
initStr
);
...
...
haoban-manage3-service/src/main/resources/applicationContext-conf.xml
View file @
d9a14efc
...
...
@@ -11,4 +11,5 @@
<import
resource=
"classpath:jdbc-haoban-manage-service.xml"
/>
<import
resource=
"classpath*:log-record-init.xml"
/>
<import
resource=
"classpath*:kafka-setting-data.xml"
/>
<import
resource=
"classpath*:task-center-config.xml"
/>
</beans>
\ No newline at end of file
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
d9a14efc
...
...
@@ -21,7 +21,8 @@
<bean
class=
"com.gic.haoban.common.ext.LoggerLevelListen"
id=
"loggerLevelListen"
>
<constructor-arg
index=
"0"
value=
"haoban-manage-service"
/>
</bean>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.OpenStaffImportTaskApiService"
ref=
"openStaffImportTaskApiService"
timeout=
"10000"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseActiveDataApiService"
ref=
"wxEnterpriseActiveDataApiService"
timeout=
"10000"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.chat.GroupChatDataApiService"
ref=
"groupChatDataApiService"
timeout=
"10000"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.chat.GroupChatPlanApiService"
ref=
"groupChatPlanApiService"
timeout=
"10000"
/>
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/open/QywxOpenController.java
View file @
d9a14efc
This diff is collapsed.
Click to expand it.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/utils/ImportExcelUtil.java
0 → 100644
View file @
d9a14efc
package
com
.
gic
.
haoban
.
manage
.
web
.
utils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.util.ObjectUtils
;
import
java.io.InputStream
;
import
java.lang.reflect.Field
;
import
java.text.DecimalFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* Excel操作
*
* @author 徐波 2019-4-18
*/
public
class
ImportExcelUtil
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
ImportExcelUtil
.
class
);
private
final
static
String
excel2003L
=
".xls"
;
//2003- 版本的excel
private
final
static
String
excel2007U
=
".xlsx"
;
//2007+ 版本的excel
/**
* 描述:获取IO流中的数据,组装成List<List<Object>>对象
*
* @return 获取第一个sheet 中数据
*/
public
static
void
getBankListByExcelSheet1
(
InputStream
in
,
String
fileName
,
List
<
List
<
Object
>>
sheet1List
)
throws
Exception
{
//创建Excel工作薄
Workbook
work
=
getWorkbook
(
in
,
fileName
);
if
(
null
==
work
)
{
throw
new
Exception
(
"创建Excel工作薄为空!"
);
}
Sheet
sheet1
=
null
;
Row
row1
=
null
;
Cell
cell1
=
null
;
//遍历Excel中所有的sheet
sheet1
=
work
.
getSheetAt
(
0
);
if
(
sheet1
!=
null
)
{
//遍历当前sheet中的所有行
for
(
int
j
=
sheet1
.
getFirstRowNum
();
j
<=
sheet1
.
getLastRowNum
();
j
++)
{
row1
=
sheet1
.
getRow
(
j
);
if
(
row1
==
null
)
{
continue
;
}
//遍历所有的列
List
<
Object
>
li
=
new
ArrayList
<
Object
>();
log
.
info
(
"单元格数={}"
,
row1
.
getFirstCellNum
());
if
(
row1
.
getFirstCellNum
()
!=
0
)
{
for
(
int
i
=
0
;
i
<(
row1
.
getFirstCellNum
())
;
i
++)
{
li
.
add
(
""
)
;
}
}
for
(
int
y
=
row1
.
getFirstCellNum
();
y
<
row1
.
getLastCellNum
();
y
++)
{
cell1
=
row1
.
getCell
(
y
);
//1、代表单元格里面类型为String类型
if
(
cell1
!=
null
)
{
li
.
add
(
getCellValue
(
cell1
));
}
else
{
li
.
add
(
""
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
li
))
{
sheet1List
.
add
(
li
);
}
}
}
}
/**
* 描述:根据文件后缀,自适应上传文件的版本
*
* @param inStr,fileName
* @return
* @throws Exception
*/
public
static
Workbook
getWorkbook
(
InputStream
inStr
,
String
fileName
)
throws
Exception
{
Workbook
wb
=
null
;
String
fileType
=
fileName
.
substring
(
fileName
.
lastIndexOf
(
"."
));
if
(
excel2003L
.
equals
(
fileType
))
{
wb
=
new
HSSFWorkbook
(
inStr
);
//2003-
}
else
if
(
excel2007U
.
equals
(
fileType
))
{
wb
=
new
XSSFWorkbook
(
inStr
);
//2007+
}
else
{
throw
new
Exception
(
"解析的文件格式有误!"
);
}
return
wb
;
}
/**
* 描述:对表格中数值进行格式化
*
* @param cell
* @return
*/
public
static
Object
getCellValue
(
Cell
cell
)
{
Object
value
=
null
;
DecimalFormat
df
=
new
DecimalFormat
(
"0"
);
//格式化number String字符
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyy-MM-dd"
);
//日期格式化
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyy-MM-dd HH:mm"
);
//日期格式化
DecimalFormat
df2
=
new
DecimalFormat
(
"0.00"
);
//格式化数字
switch
(
cell
.
getCellType
())
{
case
Cell
.
CELL_TYPE_STRING
:
value
=
cell
.
getRichStringCellValue
().
getString
();
break
;
case
Cell
.
CELL_TYPE_NUMERIC
:
if
(
"General"
.
equals
(
cell
.
getCellStyle
().
getDataFormatString
()))
{
value
=
df
.
format
(
cell
.
getNumericCellValue
());
}
else
if
(
"m/d/yy"
.
equals
(
cell
.
getCellStyle
().
getDataFormatString
()))
{
value
=
sdf
.
format
(
cell
.
getDateCellValue
());
}
else
if
(
StringUtils
.
equals
(
"m/d/yy h:mm"
,
cell
.
getCellStyle
().
getDataFormatString
()))
{
value
=
dateFormat
.
format
(
cell
.
getDateCellValue
());
}
else
{
value
=
df2
.
format
(
cell
.
getNumericCellValue
());
}
break
;
case
Cell
.
CELL_TYPE_BOOLEAN
:
value
=
cell
.
getBooleanCellValue
();
break
;
case
Cell
.
CELL_TYPE_BLANK
:
value
=
""
;
break
;
default
:
break
;
}
return
value
;
}
}
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/open/OpenClerkVO.java
0 → 100644
View file @
d9a14efc
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
open
;
import
java.io.Serializable
;
public
class
OpenClerkVO
implements
Serializable
{
/**
* 成员id
*/
private
String
staffId
;
private
String
clerkId
;
private
String
storeId
;
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
String
getStoreId
()
{
return
storeId
;
}
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
;
}
}
haoban-manage3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
View file @
d9a14efc
...
...
@@ -14,6 +14,7 @@
<dubbo:application
name=
"haoban-manage3-web"
/>
<dubbo:protocol
name=
"dubbo"
port=
"30009"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.OpenStaffImportTaskApiService"
id=
"penStaffImportTaskApiService"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.EnterpriseUseForbidService"
id=
"enterpriseUseForbidService"
/>
<dubbo:reference
interface=
"com.gic.member.tag.api.service.MemberTagGroupApiService"
id=
"memberTagGroupApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.task.manage.api.service.OpenQwApiService"
id=
"openQwApiService"
/>
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxStaffController.java
View file @
d9a14efc
...
...
@@ -1772,7 +1772,7 @@ public class WxStaffController extends WebBaseController {
int
totalCount
=
0
;
List
<
StoreDTO
>
storeDTOList
=
new
ArrayList
<>();
if
(
storeIdList
.
get
(
0
).
contains
(
"-1"
))
{
String
storeWidgetId
=
this
.
powerService
.
getStoreWidgetId
(
n
ew
Date
()
,
clerkId
);
String
storeWidgetId
=
this
.
powerService
.
getStoreWidgetId
(
n
ull
,
clerkId
);
logger
.
info
(
"权限-所有门店storeWidgetId={}"
,
storeWidgetId
);
Page
<
Object
>
pageParam
=
new
Page
<
Object
>();
pageParam
.
setCurrentPage
(
currentPage
);
...
...
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