Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
rop-merchant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit de990fcf
authored
Jan 01, 2022
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]分支代码合并主干
1 parent
c68a5218
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
309 additions
and
19 deletions
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
src/main/java/cn/com/glsx/merchants/controller/OpenController.java
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantSearchResquest.java
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantUpdatePathRequest.java
src/main/java/cn/com/glsx/merchants/request/open/AccountInfoOpenRequest.java
src/main/java/cn/com/glsx/merchants/request/open/MerchantListOpenRequest.java
src/main/java/cn/com/glsx/merchants/request/open/MerchantTreeOpenRequest.java
src/main/java/cn/com/glsx/merchants/request/open/OpenLoginAccountRequest.java
src/main/java/cn/com/glsx/merchants/request/open/OpenMerchantListRequest.java
src/main/java/cn/com/glsx/merchants/request/open/StaffListOpenRequest.java
src/main/java/cn/com/glsx/merchants/request/open/StaffSaveOpenRequest.java
src/main/java/cn/com/glsx/merchants/request/open/UpdatePasswordOpenRequest.java
src/main/java/cn/com/glsx/merchants/response/MerchantBaseInfoRopResponse.java
src/main/java/cn/com/glsx/merchants/response/MerchantTreeOpenResponse.java
src/main/java/cn/com/glsx/merchants/response/OpenUserResponse.java
src/main/java/cn/com/glsx/merchants/response/RoleResponse.java
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
src/main/java/cn/com/glsx/merchants/service/OpenService.java
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
View file @
de990fc
...
@@ -303,4 +303,16 @@ public class MerchantController {
...
@@ -303,4 +303,16 @@ public class MerchantController {
}
}
}
}
@ServiceMethod
(
method
=
"merchants.api.merchant.updateMerchantDepth"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"根据商户号修改商户层级关系(闭包)"
)
public
RopResponse
<
Boolean
>
updateMerchantPath
(
MerchantUpdatePathRequest
merchantUpdatePathRequest
){
try
{
merchantService
.
updateMerchantPath
(
merchantUpdatePathRequest
);
return
RopResponse
.
success
(
Boolean
.
TRUE
);
}
catch
(
RpcServiceException
e
){
log
.
info
(
"MerchantController_updateMerchantPath_exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
}
src/main/java/cn/com/glsx/merchants/controller/OpenController.java
View file @
de990fc
...
@@ -2,6 +2,7 @@ package cn.com.glsx.merchants.controller;
...
@@ -2,6 +2,7 @@ package cn.com.glsx.merchants.controller;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
cn.com.glsx.merchants.model.response.MerchantUserResponse
;
import
cn.com.glsx.merchants.request.merchant.MerchantSaveOpenRequest
;
import
cn.com.glsx.merchants.request.merchant.MerchantSaveOpenRequest
;
import
cn.com.glsx.merchants.request.merchant.OpenMerchantPageRequest
;
import
cn.com.glsx.merchants.request.merchant.OpenMerchantPageRequest
;
import
cn.com.glsx.merchants.request.merchant.OpenMerchantRequest
;
import
cn.com.glsx.merchants.request.merchant.OpenMerchantRequest
;
...
@@ -18,7 +19,10 @@ import io.swagger.annotations.Api;
...
@@ -18,7 +19,10 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
javax.validation.Valid
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -141,9 +145,9 @@ public class OpenController {
...
@@ -141,9 +145,9 @@ public class OpenController {
*/
*/
@ServiceMethod
(
method
=
"merchants.api.open.saveMerchant"
,
needInSession
=
NeedInSessionType
.
NO
)
@ServiceMethod
(
method
=
"merchants.api.open.saveMerchant"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"保存或者更新商户信息接口(对外)"
)
@ApiOperation
(
"保存或者更新商户信息接口(对外)"
)
public
RopResponse
<
Integer
>
saveMerchant
(
MerchantSaveOpenRequest
merchantSaveRequest
)
{
public
RopResponse
<
String
>
saveMerchant
(
MerchantSaveOpenRequest
merchantSaveRequest
)
{
try
{
try
{
Integer
merchant
=
openService
.
saveMerchant
(
merchantSaveRequest
);
String
merchant
=
openService
.
saveMerchant
(
merchantSaveRequest
);
return
RopResponse
.
success
(
merchant
);
return
RopResponse
.
success
(
merchant
);
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======OpenController__invoke__saveMerchant__exception:{}"
,
e
.
getMessage
());
log
.
info
(
"=======OpenController__invoke__saveMerchant__exception:{}"
,
e
.
getMessage
());
...
@@ -177,9 +181,9 @@ public class OpenController {
...
@@ -177,9 +181,9 @@ public class OpenController {
*/
*/
@ServiceMethod
(
method
=
"merchants.api.open.saveStaff"
,
needInSession
=
NeedInSessionType
.
NO
)
@ServiceMethod
(
method
=
"merchants.api.open.saveStaff"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"保存或者更新员工接口(对外)"
)
@ApiOperation
(
"保存或者更新员工接口(对外)"
)
public
RopResponse
<
Integer
>
saveStaff
(
StaffSaveOpenRequest
staffSaveOpenRequest
)
{
public
RopResponse
<
String
>
saveStaff
(
StaffSaveOpenRequest
staffSaveOpenRequest
)
{
try
{
try
{
Integer
id
=
openService
.
saveStaff
(
staffSaveOpenRequest
);
String
id
=
openService
.
saveStaff
(
staffSaveOpenRequest
);
return
RopResponse
.
success
(
id
);
return
RopResponse
.
success
(
id
);
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======OpenController__invoke__saveStaff__exception:{}"
,
e
.
getMessage
());
log
.
info
(
"=======OpenController__invoke__saveStaff__exception:{}"
,
e
.
getMessage
());
...
@@ -326,7 +330,7 @@ public class OpenController {
...
@@ -326,7 +330,7 @@ public class OpenController {
}
}
@ServiceMethod
(
method
=
"merchants.api.open.findUserById"
,
needInSession
=
NeedInSessionType
.
NO
)
@ServiceMethod
(
method
=
"merchants.api.open.findUserById"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"
md5
"
)
@ApiOperation
(
"
查询账户
"
)
public
RopResponse
<
List
<
OpenUserResponse
>>
findUserById
(
UserRequest
userRequest
)
{
public
RopResponse
<
List
<
OpenUserResponse
>>
findUserById
(
UserRequest
userRequest
)
{
try
{
try
{
return
RopResponse
.
success
(
openService
.
findUserById
(
userRequest
));
return
RopResponse
.
success
(
openService
.
findUserById
(
userRequest
));
...
@@ -336,5 +340,60 @@ public class OpenController {
...
@@ -336,5 +340,60 @@ public class OpenController {
}
}
}
}
@ServiceMethod
(
method
=
"merchants.api.open.checkUniquenessAccount"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"用户登录名校验"
)
public
RopResponse
<
OpenUserResponse
>
checkUniquenessAccount
(
OpenLoginAccountRequest
openLoginAccountRequest
)
{
try
{
return
RopResponse
.
success
(
openService
.
checkUniquenessAccount
(
openLoginAccountRequest
));
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======OpenController__invoke__userLogin__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
@ServiceMethod
(
method
=
"merchants.api.open.checkUniquenessPhone"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"用户登录手机号校验"
)
public
RopResponse
<
OpenUserResponse
>
checkUniquenessPhone
(
OpenLoginAccountRequest
openLoginAccountRequest
)
{
try
{
return
RopResponse
.
success
(
openService
.
checkUniquenessPhone
(
openLoginAccountRequest
));
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======OpenController__invoke__userLogin__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
@ServiceMethod
(
method
=
"merchants.api.open.updatePassword"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"密码修改"
)
public
RopResponse
<
Boolean
>
updatePassword
(
UpdatePasswordOpenRequest
updatePasswordOpenRequest
)
{
try
{
return
RopResponse
.
success
(
openService
.
updatePassword
(
updatePasswordOpenRequest
));
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======OpenController__invoke__userLogin__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
@ServiceMethod
(
method
=
"merchants.api.open.getAccountInfoByUuid"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"根据uuid获取账户信息"
)
public
RopResponse
<
OpenUserResponse
>
getAccountInfoByUuid
(
AccountInfoOpenRequest
accountInfoOpenRequest
){
try
{
OpenUserResponse
openUserResponse
=
openService
.
getAccountInfoByUuid
(
accountInfoOpenRequest
.
getUuid
());
return
RopResponse
.
success
(
openUserResponse
);
}
catch
(
RpcServiceException
e
){
log
.
info
(
"根据uuid获取账户信息异常:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
@ServiceMethod
(
method
=
"merchants.api.open.findStaffListByMerchantNo"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"根据商户号查询员工列表"
)
public
RopResponse
<
List
<
StaffResponse
>>
findStaffListByMerchantNo
(
StaffListOpenRequest
staffListOpenRequest
){
try
{
List
<
StaffResponse
>
list
=
openService
.
findStaffListByMerchantNo
(
staffListOpenRequest
);
return
RopResponse
.
success
(
list
);
}
catch
(
RpcServiceException
e
){
log
.
info
(
"根据商户号查询员工列表异常:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantSearchResquest.java
View file @
de990fc
...
@@ -67,4 +67,16 @@ public class MerchantSearchResquest extends DefaultRequest {
...
@@ -67,4 +67,16 @@ public class MerchantSearchResquest extends DefaultRequest {
@ApiModelProperty
(
notes
=
"父商户"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"父商户"
,
required
=
true
)
private
String
parentMerchant
;
private
String
parentMerchant
;
/**
* 商户号
*/
@ApiModelProperty
(
notes
=
"商户号"
,
required
=
true
)
private
Integer
merchantNo
;
/**
* 父商户号
*/
@ApiModelProperty
(
notes
=
"父商户号"
,
required
=
true
)
private
Integer
parentMerchantNo
;
}
}
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantUpdatePathRequest.java
0 → 100644
View file @
de990fc
package
cn
.
com
.
glsx
.
merchants
.
request
.
merchant
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
MerchantUpdatePathRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
value
=
"商户号source"
)
private
String
merchantNoSource
;
@ApiModelProperty
(
value
=
"商户号target"
)
private
String
merchantNoTarget
;
}
src/main/java/cn/com/glsx/merchants/request/open/AccountInfoOpenRequest.java
0 → 100644
View file @
de990fc
package
cn
.
com
.
glsx
.
merchants
.
request
.
open
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
@Data
@ApiModel
(
"获取账户信息"
)
public
class
AccountInfoOpenRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
value
=
"uuid"
)
private
String
uuid
;
}
src/main/java/cn/com/glsx/merchants/request/open/MerchantListOpenRequest.java
View file @
de990fc
...
@@ -60,4 +60,10 @@ public class MerchantListOpenRequest extends DefaultRequest {
...
@@ -60,4 +60,10 @@ public class MerchantListOpenRequest extends DefaultRequest {
@NotNull
@NotNull
@ApiModelProperty
(
notes
=
"当前页"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"当前页"
,
required
=
true
)
private
Integer
pageNum
;
private
Integer
pageNum
;
@ApiModelProperty
(
value
=
"多个商户号适用参数,','分割"
)
private
String
merchantNoStrSet
;
@ApiModelProperty
(
value
=
"商户号or商户名"
)
private
String
merchantNoOrName
;
}
}
src/main/java/cn/com/glsx/merchants/request/open/MerchantTreeOpenRequest.java
View file @
de990fc
...
@@ -23,6 +23,6 @@ public class MerchantTreeOpenRequest extends DefaultRequest {
...
@@ -23,6 +23,6 @@ public class MerchantTreeOpenRequest extends DefaultRequest {
/**
/**
* 是否展示自己
* 是否展示自己
*/
*/
@ApiModelProperty
(
notes
=
"是否展示自己"
)
@ApiModelProperty
(
notes
=
"是否展示自己
, 默认展示
"
)
private
Boolean
flag
;
private
Boolean
flag
;
}
}
src/main/java/cn/com/glsx/merchants/request/open/OpenLoginAccountRequest.java
0 → 100644
View file @
de990fc
package
cn
.
com
.
glsx
.
merchants
.
request
.
open
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/12/17 13:39
*/
@Data
public
class
OpenLoginAccountRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"登录账号"
)
private
String
account
;
@ApiModelProperty
(
notes
=
"登录手机号"
)
private
String
phone
;
@ApiModelProperty
(
notes
=
"商户号"
)
private
Integer
merchantId
;
}
src/main/java/cn/com/glsx/merchants/request/open/OpenMerchantListRequest.java
View file @
de990fc
...
@@ -4,6 +4,8 @@ import cn.com.glsx.merchants.request.DefaultRequest;
...
@@ -4,6 +4,8 @@ import cn.com.glsx.merchants.request.DefaultRequest;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Set
;
/**
/**
* @author zhouhaibao
* @author zhouhaibao
* @version 1.0
* @version 1.0
...
@@ -25,4 +27,10 @@ public class OpenMerchantListRequest extends DefaultRequest {
...
@@ -25,4 +27,10 @@ public class OpenMerchantListRequest extends DefaultRequest {
@ApiModelProperty
(
notes
=
"渠道类型 1.广联 2.广汇"
)
@ApiModelProperty
(
notes
=
"渠道类型 1.广联 2.广汇"
)
private
Integer
channelType
;
private
Integer
channelType
;
@ApiModelProperty
(
name
=
"accountType"
,
notes
=
"账户类型id, 多个时','分割"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
private
String
accountType
;
@ApiModelProperty
(
name
=
"merchantNoStr"
,
notes
=
"商户号, 多个时','分割"
)
private
String
merchantNoStr
;
}
}
src/main/java/cn/com/glsx/merchants/request/open/StaffListOpenRequest.java
0 → 100644
View file @
de990fc
package
cn
.
com
.
glsx
.
merchants
.
request
.
open
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
"根据商户号查询员工列表param"
)
public
class
StaffListOpenRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
value
=
"商户号"
)
private
String
merchantNo
;
}
src/main/java/cn/com/glsx/merchants/request/open/StaffSaveOpenRequest.java
View file @
de990fc
...
@@ -81,4 +81,6 @@ public class StaffSaveOpenRequest extends DefaultRequest {
...
@@ -81,4 +81,6 @@ public class StaffSaveOpenRequest extends DefaultRequest {
private
Integer
oldMerchantId
;
private
Integer
oldMerchantId
;
private
String
oldPhone
;
}
}
src/main/java/cn/com/glsx/merchants/request/open/UpdatePasswordOpenRequest.java
0 → 100644
View file @
de990fc
package
cn
.
com
.
glsx
.
merchants
.
request
.
open
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/12/17 13:43
*/
@Data
public
class
UpdatePasswordOpenRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"用户名"
)
private
String
userAccount
;
/**
* 用户uuid
*/
@ApiModelProperty
(
notes
=
"用户uuid"
)
private
String
uuid
;
/**
* 旧密码
*/
@ApiModelProperty
(
notes
=
"旧密码"
)
private
String
oldPassword
;
/**
* 新密码
*/
@ApiModelProperty
(
notes
=
"新密码"
)
private
String
newPassword
;
}
src/main/java/cn/com/glsx/merchants/response/MerchantBaseInfoRopResponse.java
View file @
de990fc
...
@@ -34,5 +34,9 @@ public class MerchantBaseInfoRopResponse {
...
@@ -34,5 +34,9 @@ public class MerchantBaseInfoRopResponse {
@ApiModelProperty
(
notes
=
"门店数"
)
@ApiModelProperty
(
notes
=
"门店数"
)
private
int
numberStores
;
private
int
numberStores
;
@ApiModelProperty
(
notes
=
"有效期"
)
private
String
effectiveTimeName
;
private
List
<
StoreRopResponse
>
stores
;
private
List
<
StoreRopResponse
>
stores
;
}
}
src/main/java/cn/com/glsx/merchants/response/MerchantTreeOpenResponse.java
View file @
de990fc
package
cn
.
com
.
glsx
.
merchants
.
response
;
package
cn
.
com
.
glsx
.
merchants
.
response
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -14,13 +15,19 @@ import java.util.List;
...
@@ -14,13 +15,19 @@ import java.util.List;
@Data
@Data
public
class
MerchantTreeOpenResponse
implements
Serializable
{
public
class
MerchantTreeOpenResponse
implements
Serializable
{
@ApiModelProperty
(
notes
=
"商户号"
)
private
Integer
id
;
private
Integer
id
;
private
String
label
;
private
String
label
;
@ApiModelProperty
(
notes
=
"商户账户类型"
)
private
Integer
merchantAccountLevel
;
private
Integer
merchantAccountLevel
;
@ApiModelProperty
(
notes
=
"企微名"
)
private
String
entmicroName
;
private
String
entmicroName
;
@ApiModelProperty
(
notes
=
"商户名"
)
private
String
merchantName
;
private
List
<
MerchantTreeOpenResponse
>
children
;
private
List
<
MerchantTreeOpenResponse
>
children
;
}
}
src/main/java/cn/com/glsx/merchants/response/OpenUserResponse.java
View file @
de990fc
...
@@ -10,7 +10,7 @@ import lombok.Data;
...
@@ -10,7 +10,7 @@ import lombok.Data;
* @date 2021/9/17 10:14
* @date 2021/9/17 10:14
*/
*/
@Data
@Data
public
class
OpenUserResponse
{
public
class
OpenUserResponse
{
/**
/**
* id
* id
...
@@ -21,7 +21,7 @@ public class OpenUserResponse {
...
@@ -21,7 +21,7 @@ public class OpenUserResponse {
/**
/**
* 1.员工 2.商户
* 1.员工 2.商户
*/
*/
@ApiModelProperty
(
name
=
"userType"
,
notes
=
"登录类型 1.
员工 2.商户
"
)
@ApiModelProperty
(
name
=
"userType"
,
notes
=
"登录类型 1.
商户 2.员工
"
)
private
Byte
userType
;
private
Byte
userType
;
/**
/**
...
@@ -75,7 +75,7 @@ public class OpenUserResponse {
...
@@ -75,7 +75,7 @@ public class OpenUserResponse {
/**
/**
* 商户状态
* 商户状态
*/
*/
@ApiModelProperty
(
name
=
"
accountLevel"
,
notes
=
"商户层级
"
)
@ApiModelProperty
(
name
=
"
状态"
,
notes
=
"状态
"
)
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
name
=
"merchantId"
,
notes
=
"商户Id"
)
@ApiModelProperty
(
name
=
"merchantId"
,
notes
=
"商户Id"
)
...
...
src/main/java/cn/com/glsx/merchants/response/RoleResponse.java
View file @
de990fc
...
@@ -94,6 +94,8 @@ public class RoleResponse implements Serializable {
...
@@ -94,6 +94,8 @@ public class RoleResponse implements Serializable {
@ApiModelProperty
(
name
=
"updatedAccount"
,
notes
=
"更新账户"
,
dataType
=
"String"
)
@ApiModelProperty
(
name
=
"updatedAccount"
,
notes
=
"更新账户"
,
dataType
=
"String"
)
private
String
updatedAccount
;
private
String
updatedAccount
;
private
boolean
isDefalutRole
;
/**
/**
* 角色关联账户类型列表
* 角色关联账户类型列表
*/
*/
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
View file @
de990fc
...
@@ -5,6 +5,7 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
...
@@ -5,6 +5,7 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.enums.BusinessExceptionEnum
;
import
cn.com.glsx.merchants.model.request.*
;
import
cn.com.glsx.merchants.model.request.*
;
import
cn.com.glsx.merchants.model.response.*
;
import
cn.com.glsx.merchants.model.response.*
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
...
@@ -19,6 +20,8 @@ import com.glsx.plat.common.annotation.SysLog;
...
@@ -19,6 +20,8 @@ import com.glsx.plat.common.annotation.SysLog;
import
com.glsx.plat.common.enums.OperateType
;
import
com.glsx.plat.common.enums.OperateType
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.dubbo.rpc.RpcException
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -258,4 +261,17 @@ public class MerchantService {
...
@@ -258,4 +261,17 @@ public class MerchantService {
}
}
throw
new
RpcServiceException
(
merchantBaseInfo
.
getException
().
getErrId
(),
merchantBaseInfo
.
getMessage
());
throw
new
RpcServiceException
(
merchantBaseInfo
.
getException
().
getErrId
(),
merchantBaseInfo
.
getMessage
());
}
}
public
void
updateMerchantPath
(
MerchantUpdatePathRequest
merchantUpdatePathRequest
)
{
MerchantUpdatePathApiRequest
pathApiRequest
=
new
MerchantUpdatePathApiRequest
();
BeanUtils
.
copyProperties
(
merchantUpdatePathRequest
,
pathApiRequest
);
RpcResponse
<
Boolean
>
rpcResponse
=
merchantRemote
.
merchantUpdatePath
(
pathApiRequest
);
if
(!
rpcResponse
.
isSuccess
()){
RpcServiceException
exception
=
rpcResponse
.
getException
();
if
(
null
!=
exception
)
throw
new
RpcServiceException
(
rpcResponse
.
getException
().
getErrId
(),
rpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
rpcResponse
.
getError
().
getValue
(),
rpcResponse
.
getError
().
getDisplayName
());
}
}
}
}
src/main/java/cn/com/glsx/merchants/service/OpenService.java
View file @
de990fc
...
@@ -30,8 +30,11 @@ import org.springframework.beans.BeanUtils;
...
@@ -30,8 +30,11 @@ import org.springframework.beans.BeanUtils;
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
javax.xml.crypto.Data
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
...
@@ -133,7 +136,7 @@ public class OpenService {
...
@@ -133,7 +136,7 @@ public class OpenService {
throw
new
RpcServiceException
(
menuFunPermission
.
getException
().
getErrId
(),
menuFunPermission
.
getMessage
());
throw
new
RpcServiceException
(
menuFunPermission
.
getException
().
getErrId
(),
menuFunPermission
.
getMessage
());
}
}
public
Integer
saveMerchant
(
MerchantSaveOpenRequest
merchantSaveRequest
)
{
public
String
saveMerchant
(
MerchantSaveOpenRequest
merchantSaveRequest
)
{
List
<
FileSaveRequest
>
merchantFiles
=
merchantSaveRequest
.
getMerchantFiles
();
List
<
FileSaveRequest
>
merchantFiles
=
merchantSaveRequest
.
getMerchantFiles
();
MerchantRequest
merchantRequest
=
ConvertRequest
.
convertRequest
(
merchantSaveRequest
,
new
MerchantRequest
());
MerchantRequest
merchantRequest
=
ConvertRequest
.
convertRequest
(
merchantSaveRequest
,
new
MerchantRequest
());
if
(
CollectionUtils
.
isNotEmpty
(
merchantFiles
))
{
if
(
CollectionUtils
.
isNotEmpty
(
merchantFiles
))
{
...
@@ -144,7 +147,7 @@ public class OpenService {
...
@@ -144,7 +147,7 @@ public class OpenService {
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
merchantRequest
.
setMerchantFiles
(
collect
);
merchantRequest
.
setMerchantFiles
(
collect
);
}
}
RpcResponse
<
Integer
>
booleanRpcResponse
=
merchantRemote
.
saveOrUpdateMerchantRemote
(
merchantRequest
);
RpcResponse
<
String
>
booleanRpcResponse
=
merchantRemote
.
saveOrUpdateMerchantRemote
(
merchantRequest
);
if
(
booleanRpcResponse
.
isSuccess
())
{
if
(
booleanRpcResponse
.
isSuccess
())
{
return
booleanRpcResponse
.
getResult
();
return
booleanRpcResponse
.
getResult
();
}
}
...
@@ -159,14 +162,14 @@ public class OpenService {
...
@@ -159,14 +162,14 @@ public class OpenService {
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
public
Integer
saveStaff
(
StaffSaveOpenRequest
staffSaveOpenRequest
)
{
public
String
saveStaff
(
StaffSaveOpenRequest
staffSaveOpenRequest
)
{
MerchantStaffRequest
merchantStaffRequest
=
ConvertRequest
.
convertRequest
(
staffSaveOpenRequest
,
new
MerchantStaffRequest
());
MerchantStaffRequest
merchantStaffRequest
=
ConvertRequest
.
convertRequest
(
staffSaveOpenRequest
,
new
MerchantStaffRequest
());
if
(
StringUtils
.
isNotEmpty
(
staffSaveOpenRequest
.
getMerchantFileRequest
()))
{
if
(
StringUtils
.
isNotEmpty
(
staffSaveOpenRequest
.
getMerchantFileRequest
()))
{
MerchantFileRequest
merchantFileRequest
=
new
MerchantFileRequest
();
MerchantFileRequest
merchantFileRequest
=
new
MerchantFileRequest
();
merchantFileRequest
.
setFileUrl
(
staffSaveOpenRequest
.
getMerchantFileRequest
());
merchantFileRequest
.
setFileUrl
(
staffSaveOpenRequest
.
getMerchantFileRequest
());
merchantStaffRequest
.
setMerchantFileRequest
(
merchantFileRequest
);
merchantStaffRequest
.
setMerchantFileRequest
(
merchantFileRequest
);
}
}
RpcResponse
<
Integer
>
booleanRpcResponse
=
merchantStaffRemote
.
saveOrUpdateStaffRemote
(
merchantStaffRequest
);
RpcResponse
<
String
>
booleanRpcResponse
=
merchantStaffRemote
.
saveOrUpdateStaffRemote
(
merchantStaffRequest
);
if
(
booleanRpcResponse
.
isSuccess
())
{
if
(
booleanRpcResponse
.
isSuccess
())
{
return
booleanRpcResponse
.
getResult
();
return
booleanRpcResponse
.
getResult
();
}
}
...
@@ -174,11 +177,10 @@ public class OpenService {
...
@@ -174,11 +177,10 @@ public class OpenService {
}
}
public
List
<
StaffResponse
>
syncEntmicroStaff
(
SyncStaffOpenRequest
staffSaveOpenRequest
)
{
public
List
<
StaffResponse
>
syncEntmicroStaff
(
SyncStaffOpenRequest
staffSaveOpenRequest
)
{
List
<
StaffSaveOpenRequest
>
list
=
null
;
String
data
=
staffSaveOpenRequest
.
getData
();
String
data
=
staffSaveOpenRequest
.
getData
();
if
(
StringUtils
.
isNotEmpty
(
data
))
{
List
<
StaffSaveOpenRequest
>
list
=
StringUtils
.
isEmpty
(
staffSaveOpenRequest
.
getData
())
list
=
JSONObject
.
parseArray
(
data
,
StaffSaveOpenRequest
.
class
);
?
staffSaveOpenRequest
.
getList
()
}
:
JSONObject
.
parseArray
(
data
,
StaffSaveOpenRequest
.
class
);
RpcResponse
<
List
<
MerchantStaffResponse
>>
listRpcResponse
=
merchantStaffRemote
.
syncEntmicroStaff
(
ConvertRequest
.
convertListRequest
(
list
,
MerchantStaffRequest
.
class
));
RpcResponse
<
List
<
MerchantStaffResponse
>>
listRpcResponse
=
merchantStaffRemote
.
syncEntmicroStaff
(
ConvertRequest
.
convertListRequest
(
list
,
MerchantStaffRequest
.
class
));
if
(
listRpcResponse
.
isSuccess
())
{
if
(
listRpcResponse
.
isSuccess
())
{
return
ConvertResponse
.
convertList
(
listRpcResponse
.
getResult
(),
StaffResponse
.
class
);
return
ConvertResponse
.
convertList
(
listRpcResponse
.
getResult
(),
StaffResponse
.
class
);
...
@@ -195,13 +197,29 @@ public class OpenService {
...
@@ -195,13 +197,29 @@ public class OpenService {
}
}
public
Pagination
<
MerchantRopResponse
>
findMerchantListByPage
(
MerchantListOpenRequest
merchantListOpenRequest
)
{
public
Pagination
<
MerchantRopResponse
>
findMerchantListByPage
(
MerchantListOpenRequest
merchantListOpenRequest
)
{
RpcResponse
<
RpcPagination
<
MerchantResponse
>>
merchantListByPageRemote
=
merchantRemote
.
findMerchantListByPageRemote
(
ConvertRequest
.
convertPage
(
merchantListOpenRequest
,
new
cn
.
com
.
glsx
.
merchants
.
model
.
request
.
MerchantListOpenRequest
()));
cn
.
com
.
glsx
.
merchants
.
model
.
request
.
MerchantListOpenRequest
openRequest
=
buildOpenRequest
(
merchantListOpenRequest
);
RpcResponse
<
RpcPagination
<
MerchantResponse
>>
merchantListByPageRemote
=
merchantRemote
.
findMerchantListByPageRemote
(
ConvertRequest
.
convertPage
(
merchantListOpenRequest
,
openRequest
));
if
(
merchantListByPageRemote
.
isSuccess
())
{
if
(
merchantListByPageRemote
.
isSuccess
())
{
return
ConvertResponse
.
convertPage
(
merchantListByPageRemote
.
getResult
(),
MerchantRopResponse
.
class
);
return
ConvertResponse
.
convertPage
(
merchantListByPageRemote
.
getResult
(),
MerchantRopResponse
.
class
);
}
}
throw
new
RpcServiceException
(
merchantListByPageRemote
.
getException
().
getErrId
(),
merchantListByPageRemote
.
getMessage
());
throw
new
RpcServiceException
(
merchantListByPageRemote
.
getException
().
getErrId
(),
merchantListByPageRemote
.
getMessage
());
}
}
private
cn
.
com
.
glsx
.
merchants
.
model
.
request
.
MerchantListOpenRequest
buildOpenRequest
(
MerchantListOpenRequest
merchantListOpenRequest
){
cn
.
com
.
glsx
.
merchants
.
model
.
request
.
MerchantListOpenRequest
openRequest
=
new
cn
.
com
.
glsx
.
merchants
.
model
.
request
.
MerchantListOpenRequest
();
String
merchantNoStrSet
=
merchantListOpenRequest
.
getMerchantNoStrSet
();
Set
<
Integer
>
merchantNoSet
=
new
HashSet
<>();
if
(
null
!=
merchantListOpenRequest
.
getMerchantId
())
merchantNoSet
.
add
(
merchantListOpenRequest
.
getMerchantId
());
if
(
StringUtils
.
isNotEmpty
(
merchantNoStrSet
)){
String
[]
split
=
merchantNoStrSet
.
split
(
","
);
for
(
String
merchantNo
:
split
)
{
merchantNoSet
.
add
(
Integer
.
valueOf
(
merchantNo
));
}
}
return
openRequest
;
}
public
StaffResponse
findStaffByAccount
(
StaffSearchOpenRequest
staffSearchOpenRequest
)
{
public
StaffResponse
findStaffByAccount
(
StaffSearchOpenRequest
staffSearchOpenRequest
)
{
RpcResponse
<
MerchantStaffResponse
>
staffByAccount
=
merchantStaffRemote
.
findStaffByAccount
(
ConvertRequest
.
convertRequest
(
staffSearchOpenRequest
,
new
StaffOpenRequest
()));
RpcResponse
<
MerchantStaffResponse
>
staffByAccount
=
merchantStaffRemote
.
findStaffByAccount
(
ConvertRequest
.
convertRequest
(
staffSearchOpenRequest
,
new
StaffOpenRequest
()));
if
(
staffByAccount
.
isSuccess
())
{
if
(
staffByAccount
.
isSuccess
())
{
...
@@ -258,4 +276,42 @@ public class OpenService {
...
@@ -258,4 +276,42 @@ public class OpenService {
}
}
throw
new
RpcServiceException
(
bySapCode
.
getException
().
getErrId
(),
bySapCode
.
getMessage
());
throw
new
RpcServiceException
(
bySapCode
.
getException
().
getErrId
(),
bySapCode
.
getMessage
());
}
}
public
OpenUserResponse
checkUniquenessAccount
(
OpenLoginAccountRequest
openLoginAccountRequest
)
{
RpcResponse
<
MerchantUserResponse
>
booleanRpcResponse
=
merchantUserRemote
.
checkAccount
(
openLoginAccountRequest
.
getAccount
());
if
(
booleanRpcResponse
.
isSuccess
())
{
return
ConvertResponse
.
convertObject
(
booleanRpcResponse
.
getResult
(),
OpenUserResponse
.
class
);
}
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
public
OpenUserResponse
checkUniquenessPhone
(
OpenLoginAccountRequest
openLoginAccountRequest
)
{
RpcResponse
<
MerchantUserResponse
>
booleanRpcResponse
=
merchantUserRemote
.
checkUniquenessPhone
(
openLoginAccountRequest
.
getPhone
(),
openLoginAccountRequest
.
getMerchantId
());
if
(
booleanRpcResponse
.
isSuccess
())
{
return
ConvertResponse
.
convertObject
(
booleanRpcResponse
.
getResult
(),
OpenUserResponse
.
class
);
}
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
public
Boolean
updatePassword
(
UpdatePasswordOpenRequest
updatePasswordOpenRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantUserRemote
.
updatePassword
(
ConvertRequest
.
convertRequest
(
updatePasswordOpenRequest
,
new
UpdatePasswordRequest
()));
if
(
booleanRpcResponse
.
isSuccess
())
{
return
booleanRpcResponse
.
getResult
();
}
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
public
OpenUserResponse
getAccountInfoByUuid
(
String
uuid
)
{
RpcResponse
<
MerchantUserResponse
>
rpcResponse
=
merchantUserRemote
.
getAccountInfoByUuid
(
uuid
);
if
(
rpcResponse
.
isSuccess
())
return
ConvertResponse
.
convertObject
(
rpcResponse
.
getResult
(),
OpenUserResponse
.
class
);
throw
new
RpcServiceException
(
rpcResponse
.
getException
().
getErrId
(),
rpcResponse
.
getMessage
());
}
public
List
<
StaffResponse
>
findStaffListByMerchantNo
(
StaffListOpenRequest
staffListOpenRequest
)
{
RpcResponse
<
List
<
MerchantStaffResponse
>>
rpcResponse
=
merchantStaffRemote
.
findStaffListByMerchantNo
(
staffListOpenRequest
.
getMerchantNo
());
if
(
rpcResponse
.
isSuccess
())
return
ConvertResponse
.
convertList
(
rpcResponse
.
getResult
(),
StaffResponse
.
class
);
throw
new
RpcServiceException
(
rpcResponse
.
getException
().
getErrId
(),
rpcResponse
.
getMessage
());
}
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment