Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
736bb303
Commit
736bb303
authored
Feb 04, 2021
by
于桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
羊小咩小程序的渠道,合同内容不包含现金分期业务,增加独立的注册合同
parent
6c0e9bd4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
17 deletions
+27
-17
AppletController.java
...xyqb/controller/middleoffice/applet/AppletController.java
+21
-15
BlackHoleRegisteredEventListener.java
...antgroup/xyqb/event/BlackHoleRegisteredEventListener.java
+6
-2
No files found.
src/main/java/cn/quantgroup/xyqb/controller/middleoffice/applet/AppletController.java
View file @
736bb303
package
cn
.
quantgroup
.
xyqb
.
controller
.
middleoffice
.
applet
;
import
cn.quantgroup.xyqb.controller.middleoffice.common.VerifyTypeEnum
;
import
java.util.Arrays
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.quantgroup.xyqb.controller.middleoffice.login.ILoginModule
;
import
cn.quantgroup.xyqb.controller.middleoffice.login.LoginVo
;
import
cn.quantgroup.xyqb.entity.middleoffice.AppletParamEntry
;
import
cn.quantgroup.xyqb.exception.DataException
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.service.middleoffice.applet.IAppletService
;
import
com.google.common.collect.ImmutableMap
;
import
com.google.common.collect.Lists
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.Assert
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
* @author :dongjianhua
...
...
@@ -30,9 +30,11 @@ import java.util.List;
@RestController
@RequestMapping
(
"/middle_office/applet"
)
public
class
AppletController
{
@Value
(
"${applet.appNames:luckii,xyqb,wuxi,yangxiaomie}"
)
private
String
appletAppNames
;
//先这么干 多了的话建表去存
private
static
final
List
<
String
>
appNames
=
Lists
.
newArrayList
(
"luckii"
,
"xyqb"
,
"wuxi"
);
// private static final List<String> appNames = Lists.newArrayList("luckii", "xyqb", "wuxi");
private
final
IAppletService
iAppletService
;
private
ILoginModule
loginModule
;
...
...
@@ -49,7 +51,7 @@ public class AppletController {
*/
@PostMapping
(
"/relevance"
)
public
JsonResult
relevance
(
@Validated
@RequestBody
AppletParamEntry
appletParamEntry
)
{
if
(!
appNames
.
contains
(
appletParamEntry
.
getAppName
()))
{
if
(!
containsAppName
(
appletParamEntry
.
getAppName
()))
{
throw
new
DataException
(
"appName不合法"
);
}
Long
userId
=
iAppletService
.
relevance
(
appletParamEntry
);
...
...
@@ -67,11 +69,15 @@ public class AppletController {
@Validated
@PostMapping
(
"/login"
)
public
JsonResult
login
(
@RequestParam
String
appName
,
@RequestParam
String
openId
,
String
utmSource
)
{
if
(!
appNames
.
contains
(
appName
))
{
if
(!
containsAppName
(
appName
))
{
throw
new
DataException
(
"appName不合法"
);
}
LoginVo
login
=
iAppletService
.
login
(
appName
,
openId
,
utmSource
);
return
JsonResult
.
buildSuccessResultGeneric
(
login
);
}
private
boolean
containsAppName
(
String
appName
)
{
return
Arrays
.
asList
(
appletAppNames
.
split
(
","
)).
contains
(
appName
);
}
}
src/main/java/cn/quantgroup/xyqb/event/BlackHoleRegisteredEventListener.java
View file @
736bb303
...
...
@@ -25,16 +25,20 @@ public class BlackHoleRegisteredEventListener implements ApplicationListener<Reg
@Resource
private
RabbitTemplate
registeredNotifyBlackHoleRabbitTemplate
;
long
[]
templateIds
=
{
8
l
,
280
l
};
long
[]
templateIds_159913
=
{
433
l
,
434
l
};
// 羊小咩小程序的渠道,合同内容不包含现金分期业务,如果这种情况较多可以考虑配置化
private
static
final
Long
YXM_CHANNEL
=
159913L
;
// 羊小咩小程序的渠道(小程序_电商,小程序_VCC)
@Override
public
void
onApplicationEvent
(
RegisterEvent
event
)
{
UserRegisterParam
userRegisterParam
=
event
.
getUserRegisterParam
();
User
user
=
userRegisterParam
.
getUser
();
log
.
info
(
"onApplicationEvent cn.quantgroup.xyqb.event.BlackHoleRegisteredEventListener start userId = 【{}】
"
,
user
.
getId
());
log
.
info
(
"onApplicationEvent cn.quantgroup.xyqb.event.BlackHoleRegisteredEventListener start userId = 【{}】
, registerFrom = 【{}】"
,
user
.
getId
(),
userRegisterParam
.
getRegisterFrom
());
LocalDate
signDate
=
LocalDate
.
now
();
String
dateStr
=
signDate
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy年MM月dd日"
));
int
day
=
signDate
.
getDayOfMonth
();
// 信用钱包服务与隐私协议
for
(
long
id
:
templateIds
)
{
long
[]
regTempIds
=
userRegisterParam
.
getRegisterFrom
().
equals
(
YXM_CHANNEL
)
?
templateIds_159913
:
templateIds
;
for
(
long
id
:
regTempIds
)
{
JSONObject
fields
=
new
JSONObject
();
fields
.
put
(
"phoneNo"
,
user
.
getPhoneNo
());
fields
.
put
(
"genarateDateStr"
,
dateStr
);
...
...
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