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
7653fa9f
Commit
7653fa9f
authored
Jul 14, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:活码
parent
562e8468
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
29 deletions
+36
-29
HmQrcodeApiService.java
.../gic/haoban/manage/api/service/hm/HmQrcodeApiService.java
+1
-1
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+5
-3
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+10
-6
ServiceTest.java
haoban-manage3-service/src/test/java/ServiceTest.java
+1
-1
HmQrcodeController.java
...c/haoban/manage/web/controller/hm/HmQrcodeController.java
+19
-18
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/hm/HmQrcodeApiService.java
View file @
7653fa9f
...
@@ -22,7 +22,7 @@ public interface HmQrcodeApiService {
...
@@ -22,7 +22,7 @@ public interface HmQrcodeApiService {
* @author mozhu
* @author mozhu
* @date 2022-07-05 10:59:08
* @date 2022-07-05 10:59:08
*/
*/
int
add
(
HmQrcodeQDTO
hmQrcodeQDTO
);
ServiceResponse
add
(
HmQrcodeQDTO
hmQrcodeQDTO
);
/**
/**
* 更新
* 更新
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
7653fa9f
...
@@ -642,14 +642,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
...
@@ -642,14 +642,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
* @return
* @return
*/
*/
private
String
getRefId
(
String
state
)
{
private
String
getRefId
(
String
state
)
{
String
substring
=
state
.
substring
(
2
);
String
id
=
state
.
substring
(
2
);
String
refId
=
""
;
String
refId
=
""
;
if
(
state
.
contains
(
"HM"
))
{
if
(
state
.
contains
(
"HM"
))
{
refId
=
substring
;
refId
=
id
;
}
else
if
(
state
.
contains
(
"DT"
))
{
}
else
if
(
state
.
contains
(
"DT"
))
{
KeyDataLinkBO
dataForHmLink
=
keyDataService
.
getDataForHmLink
(
refId
);
KeyDataLinkBO
dataForHmLink
=
keyDataService
.
getDataForHmLink
(
id
);
if
(
dataForHmLink
!=
null
)
{
refId
=
Convert
.
toStr
(
dataForHmLink
.
getLinkId
());
refId
=
Convert
.
toStr
(
dataForHmLink
.
getLinkId
());
}
}
}
return
refId
;
return
refId
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
7653fa9f
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
hm
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
hm
;
import
cn.hutool.core.convert.Convert
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.dto.ClerkDTO
;
...
@@ -88,8 +89,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
...
@@ -88,8 +89,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@Autowired
@Autowired
private
StaffService
staffService
;
private
StaffService
staffService
;
@Autowired
@Autowired
private
HmGroupService
groupService
;
@Autowired
private
WelcomeRelationService
welcomeRelationService
;
private
WelcomeRelationService
welcomeRelationService
;
@Autowired
@Autowired
private
HmGroupService
hmGroupService
;
private
HmGroupService
hmGroupService
;
...
@@ -106,12 +105,12 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
...
@@ -106,12 +105,12 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
afterFunc
=
LogRecordAfterServiceImpl
.
class
)
afterFunc
=
LogRecordAfterServiceImpl
.
class
)
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
int
add
(
HmQrcodeQDTO
hmQrcodeQDTO
)
{
public
ServiceResponse
add
(
HmQrcodeQDTO
hmQrcodeQDTO
)
{
String
wxEnterpriseId
=
hmQrcodeQDTO
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
hmQrcodeQDTO
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
)
{
if
(
wxEnterpriseDTO
==
null
)
{
logger
.
error
(
"未查询到微信企业"
);
logger
.
error
(
"未查询到微信企业"
);
return
HaoBanErrCodeCommon
.
ERR_8
.
getCode
(
);
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"微信企业不存在"
);
}
}
hmQrcodeQDTO
.
setHmId
(
UniqueIdUtils
.
uniqueLong
());
hmQrcodeQDTO
.
setHmId
(
UniqueIdUtils
.
uniqueLong
());
...
@@ -124,7 +123,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
...
@@ -124,7 +123,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
}
List
<
String
>
clerkIdList
=
setStoreClerk
(
hmQrcodeQDTO
,
wxEnterpriseId
,
hmId
,
hmType
);
List
<
String
>
clerkIdList
=
setStoreClerk
(
hmQrcodeQDTO
,
wxEnterpriseId
,
hmId
,
hmType
);
if
(
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"该导购已经生成过活码或未关联过好办"
);
}
//生成活码
//生成活码
QywxExternalcontactDTO
qywxExternalcontactDTO
=
new
QywxExternalcontactDTO
();
QywxExternalcontactDTO
qywxExternalcontactDTO
=
new
QywxExternalcontactDTO
();
qywxExternalcontactDTO
.
setType
(
hmQrcodeQDTO
.
getHmType
());
qywxExternalcontactDTO
.
setType
(
hmQrcodeQDTO
.
getHmType
());
...
@@ -133,6 +134,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
...
@@ -133,6 +134,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
qywxExternalcontactDTO
.
setSkipVerify
(
hmQrcodeQDTO
.
getPassFlag
()
==
1
);
qywxExternalcontactDTO
.
setSkipVerify
(
hmQrcodeQDTO
.
getPassFlag
()
==
1
);
qywxExternalcontactDTO
.
setState
(
"HM"
+
hmId
);
qywxExternalcontactDTO
.
setState
(
"HM"
+
hmId
);
List
<
String
>
userIds
=
staffClerkRelationService
.
listWxUserIdByClerkIds
(
clerkIdList
,
wxEnterpriseId
);
List
<
String
>
userIds
=
staffClerkRelationService
.
listWxUserIdByClerkIds
(
clerkIdList
,
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
userIds
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"导购未关联好办"
);
}
qywxExternalcontactDTO
.
setUser
(
userIds
);
qywxExternalcontactDTO
.
setUser
(
userIds
);
logger
.
info
(
"新增活码参数:{}"
,
JSON
.
toJSONString
(
qywxExternalcontactDTO
));
logger
.
info
(
"新增活码参数:{}"
,
JSON
.
toJSONString
(
qywxExternalcontactDTO
));
QywxExternalcontactResultDTO
qywxExternalcontactResultDTO
=
qywxUserApiService
.
addContactWay
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
(),
qywxExternalcontactDTO
);
QywxExternalcontactResultDTO
qywxExternalcontactResultDTO
=
qywxUserApiService
.
addContactWay
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
(),
qywxExternalcontactDTO
);
...
@@ -147,7 +151,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
...
@@ -147,7 +151,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
}
setLoggerContext
(
hmQrcodeQDTO
.
getEnterpriseId
(),
wxEnterpriseId
,
hmQrcodeQDTO
.
getCreatorId
(),
hmQrcodeQDTO
.
getCreatorName
());
setLoggerContext
(
hmQrcodeQDTO
.
getEnterpriseId
(),
wxEnterpriseId
,
hmQrcodeQDTO
.
getCreatorId
(),
hmQrcodeQDTO
.
getCreatorName
());
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
"【"
+
hmId
+
"-"
+
hmQrcodeQDTO
.
getName
()
+
"】"
);
GicLogRecordEvaluationContext
.
putAttribute
(
"logContent"
,
"【"
+
hmId
+
"-"
+
hmQrcodeQDTO
.
getName
()
+
"】"
);
return
saveResult
;
return
ServiceResponse
.
success
()
;
}
}
/**
/**
...
...
haoban-manage3-service/src/test/java/ServiceTest.java
View file @
7653fa9f
...
@@ -45,7 +45,7 @@ public class ServiceTest {
...
@@ -45,7 +45,7 @@ public class ServiceTest {
hmQrcodeQDTO
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
hmQrcodeQDTO
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
hmQrcodeQDTO
.
setName
(
"徐高华"
);
hmQrcodeQDTO
.
setName
(
"徐高华"
);
hmQrcodeQDTO
.
setPassFlag
(
1
);
hmQrcodeQDTO
.
setPassFlag
(
1
);
hmQrcodeQDTO
.
setStoreId
(
"ff
1307040a7748699cf3109615fb24d7
"
);
hmQrcodeQDTO
.
setStoreId
(
"ff
8080816ad96137016ad97c87580000
"
);
hmQrcodeQDTO
.
setClerkIdList
(
Collections
.
singletonList
(
"ff1307040a7748699cf3109615fb24d7"
));
hmQrcodeQDTO
.
setClerkIdList
(
Collections
.
singletonList
(
"ff1307040a7748699cf3109615fb24d7"
));
hmQrcodeApiService
.
add
(
hmQrcodeQDTO
);
hmQrcodeApiService
.
add
(
hmQrcodeQDTO
);
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmQrcodeController.java
View file @
7653fa9f
...
@@ -57,37 +57,38 @@ public class HmQrcodeController {
...
@@ -57,37 +57,38 @@ public class HmQrcodeController {
/**
/**
* 新增
* 新增
* @param
H
mQrcodeQDTO
* @param
h
mQrcodeQDTO
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"add"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"add"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
add
(
@RequestBody
HmQrcodeQDTO
H
mQrcodeQDTO
)
{
public
RestResponse
add
(
@RequestBody
HmQrcodeQDTO
h
mQrcodeQDTO
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
HmQrcodeQDTO
.
setCreatorId
(
loginUser
.
getClerkId
());
hmQrcodeQDTO
.
setCreatorId
(
loginUser
.
getClerkId
());
HmQrcodeQDTO
.
setCreatorName
(
loginUser
.
getClerkName
());
hmQrcodeQDTO
.
setCreatorName
(
loginUser
.
getClerkName
());
HmQrcodeQDTO
.
setModifierId
(
loginUser
.
getClerkId
());
hmQrcodeQDTO
.
setModifierId
(
loginUser
.
getClerkId
());
HmQrcodeQDTO
.
setModifierName
(
loginUser
.
getClerkName
());
hmQrcodeQDTO
.
setModifierName
(
loginUser
.
getClerkName
());
HmQrcodeQDTO
.
setWxEnterpriseId
(
loginUser
.
getWxEnterpriseId
());
hmQrcodeQDTO
.
setWxEnterpriseId
(
loginUser
.
getWxEnterpriseId
());
HmQrcodeQDTO
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
hmQrcodeQDTO
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
this
.
hmQrcodeApiService
.
add
(
HmQrcodeQDTO
);
ServiceResponse
serviceResponse
=
this
.
hmQrcodeApiService
.
add
(
hmQrcodeQDTO
);
if
(!
"0000"
.
equals
(
serviceResponse
.
getCode
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_0
.
getCode
()),
serviceResponse
.
getMessage
());
}
return
RestResponse
.
successResult
();
return
RestResponse
.
successResult
();
}
}
/**
/**
* 修改
* 修改
* @param
H
mQrcodeQDTO
* @param
h
mQrcodeQDTO
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"update"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"update"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
update
(
@RequestBody
HmQrcodeQDTO
H
mQrcodeQDTO
)
{
public
RestResponse
update
(
@RequestBody
HmQrcodeQDTO
h
mQrcodeQDTO
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
HmQrcodeQDTO
.
setCreatorId
(
loginUser
.
getClerkId
());
hmQrcodeQDTO
.
setModifierId
(
loginUser
.
getClerkId
());
HmQrcodeQDTO
.
setCreatorName
(
loginUser
.
getClerkName
());
hmQrcodeQDTO
.
setModifierName
(
loginUser
.
getClerkName
());
HmQrcodeQDTO
.
setModifierId
(
loginUser
.
getClerkId
());
hmQrcodeQDTO
.
setWxEnterpriseId
(
loginUser
.
getWxEnterpriseId
());
HmQrcodeQDTO
.
setModifierName
(
loginUser
.
getClerkName
());
hmQrcodeQDTO
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
HmQrcodeQDTO
.
setWxEnterpriseId
(
loginUser
.
getWxEnterpriseId
());
this
.
hmQrcodeApiService
.
update
(
hmQrcodeQDTO
);
HmQrcodeQDTO
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
this
.
hmQrcodeApiService
.
update
(
HmQrcodeQDTO
);
return
RestResponse
.
successResult
();
return
RestResponse
.
successResult
();
}
}
...
...
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