Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tcm-system
Project
Project
Details
Activity
Releases
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
TCM
tcm-system
Commits
39f1127f
Commit
39f1127f
authored
Feb 13, 2026
by
tangfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户
parent
b15c01d1
Changes
46
Show whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
1555 additions
and
98 deletions
+1555
-98
pom.xml
pom.xml
+6
-9
SystemApp.java
src/main/java/com/tcm/SystemApp.java
+1
-2
WebChatConfig.java
src/main/java/com/tcm/system/api/WebChatConfig.java
+51
-0
WechatApi.java
src/main/java/com/tcm/system/api/WechatApi.java
+110
-0
WechatAppletApi.java
...main/java/com/tcm/system/applets/api/WechatAppletApi.java
+39
-0
AppletDao.java
src/main/java/com/tcm/system/applets/dao/AppletDao.java
+12
-0
AppletDaoImpl.java
...n/java/com/tcm/system/applets/dao/impl/AppletDaoImpl.java
+36
-0
AppletService.java
...in/java/com/tcm/system/applets/service/AppletService.java
+32
-0
AppletServiceImpl.java
...om/tcm/system/applets/service/impl/AppletServiceImpl.java
+53
-0
TcmAppletVo.java
src/main/java/com/tcm/system/applets/vo/TcmAppletVo.java
+200
-0
TcmAppletReqVo.java
...in/java/com/tcm/system/applets/vo/req/TcmAppletReqVo.java
+176
-0
TcmAppletResVo.java
...in/java/com/tcm/system/applets/vo/res/TcmAppletResVo.java
+6
-0
AppletController.java
...ain/java/com/tcm/system/applets/web/AppletController.java
+82
-0
TcmAuthorityServiceImpl.java
...ystem/authority/service/impl/TcmAuthorityServiceImpl.java
+1
-3
TcmAuthorityVo.java
...main/java/com/tcm/system/authority/vo/TcmAuthorityVo.java
+27
-3
TcmAuthorityController.java
.../com/tcm/system/authority/web/TcmAuthorityController.java
+1
-1
PositionDao.java
src/main/java/com/tcm/system/position/dao/PositionDao.java
+16
-0
PositionDaoImpl.java
...ava/com/tcm/system/position/dao/impl/PositionDaoImpl.java
+42
-0
PositionService.java
...java/com/tcm/system/position/service/PositionService.java
+20
-0
PositionServiceImpl.java
...tcm/system/position/service/impl/PositionServiceImpl.java
+51
-0
PositionPageReqVo.java
...ava/com/tcm/system/position/vo/req/PositionPageReqVo.java
+30
-0
PositionSaveReqVo.java
...ava/com/tcm/system/position/vo/req/PositionSaveReqVo.java
+6
-0
PositionListResVo.java
...ava/com/tcm/system/position/vo/res/PositionListResVo.java
+6
-0
PositionController.java
.../java/com/tcm/system/position/web/PositionController.java
+48
-0
TcmRoleDao.java
src/main/java/com/tcm/system/role/dao/TcmRoleDao.java
+5
-1
TcmRoleDaoImpl.java
...ain/java/com/tcm/system/role/dao/impl/TcmRoleDaoImpl.java
+9
-1
TcmRoleService.java
...main/java/com/tcm/system/role/service/TcmRoleService.java
+8
-1
TcmRoleServiceImpl.java
.../com/tcm/system/role/service/impl/TcmRoleServiceImpl.java
+15
-5
TcmRoleVo.java
src/main/java/com/tcm/system/role/vo/TcmRoleVo.java
+0
-23
TcmRoleResVo.java
src/main/java/com/tcm/system/role/vo/res/TcmRoleResVo.java
+6
-0
TcmRoleController.java
src/main/java/com/tcm/system/role/web/TcmRoleController.java
+18
-1
UserDaoImpl.java
src/main/java/com/tcm/system/user/dao/impl/UserDaoImpl.java
+5
-3
AppletLoginService.java
...in/java/com/tcm/system/user/other/AppletLoginService.java
+11
-0
AppletApiService.java
...java/com/tcm/system/user/other/impl/AppletApiService.java
+54
-0
AppletLoginServiceImpl.java
...om/tcm/system/user/other/impl/AppletLoginServiceImpl.java
+64
-0
LoginServiceImpl.java
...va/com/tcm/system/user/service/impl/LoginServiceImpl.java
+3
-0
UserServiceImpl.java
...ava/com/tcm/system/user/service/impl/UserServiceImpl.java
+10
-10
swagger.java
src/main/java/com/tcm/system/user/swagger.java
+2
-1
TcmUserVo.java
src/main/java/com/tcm/system/user/vo/TcmUserVo.java
+18
-29
AppletUserLoginReqVo.java
...java/com/tcm/system/user/vo/req/AppletUserLoginReqVo.java
+93
-0
AppletsUserByCodeResVo.java
...va/com/tcm/system/user/vo/res/AppletsUserByCodeResVo.java
+57
-0
LoginController.java
src/main/java/com/tcm/system/user/web/LoginController.java
+17
-3
TokenController.java
src/main/java/com/tcm/system/user/web/TokenController.java
+71
-0
bootstrap-prod.yml
src/main/resources/bootstrap-prod.yml
+22
-1
bootstrap.yml
src/main/resources/bootstrap.yml
+1
-1
tcm-prod.cmd
tcm-prod.cmd
+14
-0
No files found.
pom.xml
View file @
39f1127f
...
...
@@ -10,7 +10,7 @@
<version>
1.0-SNAPSHOT
</version>
</parent>
<groupId>
com.
pangding
.web
</groupId>
<groupId>
com.
tcm
.web
</groupId>
<artifactId>
tcm-system
</artifactId>
<packaging>
jar
</packaging>
<version>
1.0-SNAPSHOT
</version>
...
...
@@ -36,16 +36,13 @@
<dependencies>
<dependency>
<groupId>
com.yanzuoguang
</groupId>
<artifactId>
yzg-util-mq
</artifactId>
<groupId>
com.mysql
</groupId>
<artifactId>
mysql-connector-j
</artifactId>
<version>
8.0.33
</version>
</dependency>
<dependency>
<groupId>
com.pangding.web
</groupId>
<artifactId>
pd-log-feign
</artifactId>
</dependency>
<dependency>
<groupId>
com.pangding.web
</groupId>
<artifactId>
pd-partner-ref
</artifactId>
<groupId>
com.yanzuoguang
</groupId>
<artifactId>
yzg-util-mq
</artifactId>
</dependency>
<dependency>
<groupId>
com.github.penggle
</groupId>
...
...
src/main/java/com/tcm/SystemApp.java
View file @
39f1127f
...
...
@@ -28,8 +28,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
})
@EnableMethodCache
(
basePackages
=
{
"com.tcm.*"
,
"com.tourbida"
,
"com.yanzuoguang"
"com.yanzuoguang.*"
})
@EnableCreateCacheAnnotation
@EnableScheduling
...
...
src/main/java/com/tcm/system/api/WebChatConfig.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
api
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
/**
* @author zhongjf
* @description 接口地址配置类
* @date 2019/5/6
*/
@Component
public
class
WebChatConfig
{
/*================ 基础配置======**/
/**
* 获取access_token的接口地址(GET) 限2000(次/天)
*/
@Value
(
"${wechat.public.base.accesTokenUrl:https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET}"
)
public
String
accesTokenUrl
;
/**
* 授权登录地址
*/
@Value
(
"${wechat.public.base.authrizeUrl:https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect}"
)
public
String
authrizeUrl
;
/**
* 网页授权通过code获取access_token
*/
@Value
(
"${wechat.public.base.accessTokenSnsUrl:https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=APPSECRET&code=CODE&grant_type=authorization_code}"
)
public
String
accessTokenSnsUrl
;
/**
* 获取jsapi_ticket的接口地址(GET) 限2000(次/天)
*/
@Value
(
"${wechat.public.base.jsapiTicketUrl:dddd}"
)
public
String
jsapiTicketUrl
;
/*================ 中医院小程序配置======**/
@Value
(
"${wechat.applets.code2Session: https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code}"
)
public
String
code2Session
;
@Value
(
"${wechat.applets.getPaidUnionId: https://api.weixin.qq.com/wxa/getpaidunionid?access_token=ACCESS_TOKEN&openid=OPENID&mch_id=MCH_ID&out_trade_no=OUT_TRADE_NO}"
)
public
String
getPaidUnionId
;
@Value
(
"${wechat.applets.lx.appid: wxe678d5240e98a7b8}"
)
public
String
appletsAppId
;
@Value
(
"${wechat.applets.lx.appSecret:edc0e8778b245a3a4ac11e449ec3f35a}"
)
public
String
appletsAppSecret
;
}
src/main/java/com/tcm/system/api/WechatApi.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
api
;
import
com.pangding.web.constant.PangdConstant
;
import
com.pangding.web.vo.applet.pd.AppletVo
;
import
com.tcm.system.applets.dao.AppletDao
;
import
com.tcm.system.user.vo.req.AppletUserLoginReqVo
;
import
com.yanzuoguang.util.helper.HttpHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.codec.CodecException
;
import
org.springframework.stereotype.Component
;
@Component
public
class
WechatApi
{
@Autowired
private
WebChatConfig
webChatConfig
;
@Autowired
private
AppletDao
appletDao
;
/**
* 获取凭据
* @return
*/
public
String
getAccessToken
(
String
wechatType
)
{
String
result
=
""
;
String
appid
=
webChatConfig
.
appletsAppId
;
String
secret
=
webChatConfig
.
appletsAppSecret
;
try
{
String
url
=
webChatConfig
.
accesTokenUrl
.
replace
(
"APPID"
,
appid
).
replace
(
"APPSECRET"
,
secret
);
result
=
HttpHelper
.
get
(
url
);
}
catch
(
Exception
ex
)
{
throw
new
CodecException
(
ex
.
getMessage
());
}
return
result
;
}
/**
* 小程序获取凭据
* @return
*/
public
String
getAppletsAccessToken
()
{
String
result
=
""
;
try
{
String
url
=
webChatConfig
.
accesTokenUrl
.
replace
(
"APPID"
,
webChatConfig
.
appletsAppId
)
.
replace
(
"APPSECRET"
,
webChatConfig
.
appletsAppSecret
);
result
=
HttpHelper
.
get
(
url
);
}
catch
(
Exception
ex
)
{
throw
new
CodecException
(
ex
.
getMessage
());
}
return
result
;
}
/**
* 小程序登录
* @param req
* @return
*/
public
String
code2Session
(
AppletUserLoginReqVo
req
)
{
String
result
=
""
;
String
url
=
""
;
try
{
// 微信小程序appid默认为胖丁小程序
String
appid
=
webChatConfig
.
appletsAppId
;
String
secret
=
webChatConfig
.
appletsAppSecret
;
// 根据公司或者景区查询该景区的小程序参数
if
(!
StringHelper
.
isEmpty
(
req
.
getAppid
())){
AppletVo
appletReqVo
=
new
AppletVo
();
appletReqVo
.
setAppletType
(
PangdConstant
.
APPLET_WECHAT
);
appletReqVo
.
setAppletAppid
(
req
.
getAppid
());
AppletVo
appletVo
=
appletDao
.
load
(
appletReqVo
,
AppletVo
.
class
);
if
(!
StringHelper
.
isEmpty
(
appletVo
)){
appid
=
appletVo
.
getAppletAppid
();
secret
=
appletVo
.
getAppletSecret
();
}
}
url
=
webChatConfig
.
code2Session
.
replace
(
"APPID"
,
appid
).
replace
(
"SECRET"
,
secret
)
.
replace
(
"JSCODE"
,
req
.
getCode
());
result
=
HttpHelper
.
get
(
url
);
}
catch
(
Exception
ex
)
{
throw
new
CodecException
(
ex
.
getMessage
());
}
return
result
;
}
// /**
// * 小程序登录 TODO
// * @param req
// * @return
// */
// public String getPaidUnionId(AppletsPaidUnionIdReqVo req) {
// String result = "";
// try {
// String url = webChatConfig.getPaidUnionId
// .replace("ACCESS_TOKEN", req.getAccess_token()).replace("OPENID", req.getOpenid())
// .replace("MCH_ID", req.getMch_id()).replace("OUT_TRADE_NO", req.getOut_trade_no());
// result = HttpHelper.get(url);
// } catch (Exception ex) {
// throw new CodecException(ex.getMessage());
// }
// return result;
// }
}
src/main/java/com/tcm/system/applets/api/WechatAppletApi.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
applets
.
api
;
import
com.pangding.web.vo.applet.req.GenerateUrlLinkReqVo
;
import
com.yanzuoguang.util.helper.HttpHelper
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.codec.CodecException
;
import
org.springframework.stereotype.Component
;
/**
* 微信小程序 api
* @author 唐芳
*/
@Component
public
class
WechatAppletApi
{
@Value
(
"${wechat.applets.generateUrlLink:https://api.weixin.qq.com/wxa/generate_urllink?access_token=ACCESS_TOKEN}"
)
private
String
generateUrlLinkUrl
;
/**
*
* @param req
* @return
*/
public
String
generateUrlLink
(
String
token
,
GenerateUrlLinkReqVo
req
)
{
String
result
=
""
;
try
{
String
url
=
generateUrlLinkUrl
.
replace
(
"ACCESS_TOKEN"
,
token
);
String
param
=
JsonHelper
.
serialize
(
req
);
result
=
HttpHelper
.
postApplicationJSON
(
url
,
param
);
}
catch
(
Exception
ex
)
{
throw
new
CodecException
(
ex
.
getMessage
());
}
return
result
;
}
}
src/main/java/com/tcm/system/applets/dao/AppletDao.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
applets
.
dao
;
import
com.tcm.system.applets.vo.req.TcmAppletReqVo
;
import
com.tcm.system.applets.vo.res.TcmAppletResVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
com.yanzuoguang.util.vo.PageSizeData
;
public
interface
AppletDao
extends
BaseDao
{
PageSizeData
<
TcmAppletResVo
>
queryAppletPageList
(
TcmAppletReqVo
req
);
}
src/main/java/com/tcm/system/applets/dao/impl/AppletDaoImpl.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
applets
.
dao
.
impl
;
import
com.tcm.system.applets.dao.AppletDao
;
import
com.tcm.system.applets.vo.TcmAppletVo
;
import
com.tcm.system.applets.vo.req.TcmAppletReqVo
;
import
com.tcm.system.applets.vo.res.TcmAppletResVo
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Component
;
@Component
public
class
AppletDaoImpl
extends
BaseDaoImpl
implements
AppletDao
{
private
static
final
String
QUERY_LIST
=
"QUERY_LIST"
;
@Override
protected
void
init
()
{
// 根据实体生成增删改查语句
register
(
TcmAppletVo
.
class
);
table
.
add
(
QUERY_LIST
,
"SELECT * FROM pd_applet WHERE 1=1 "
)
.
add
(
"appletName"
,
" AND applet_name LIKE concat('%', ?,'%') "
)
.
add
(
"merchantName"
,
" AND merchant_name LIKE concat('%', ?,'%') "
)
.
add
(
"companyName"
,
"AND company_name LIKE concat('%', ?,'%') "
)
.
add
(
"appletAppid"
,
"AND applet_appid = ? "
)
.
add
(
"appletType"
,
"AND applet_type = ? "
);
}
@Override
public
PageSizeData
<
TcmAppletResVo
>
queryAppletPageList
(
TcmAppletReqVo
req
)
{
return
this
.
queryPage
(
TcmAppletResVo
.
class
,
req
,
QUERY_LIST
,
req
);
}
}
src/main/java/com/tcm/system/applets/service/AppletService.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
applets
.
service
;
import
com.tcm.system.applets.vo.req.TcmAppletReqVo
;
import
com.tcm.system.applets.vo.res.TcmAppletResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
public
interface
AppletService
{
/**
* 分页查询小程序列表
* @param req
* @return
*/
PageSizeData
<
TcmAppletResVo
>
queryAppletPageList
(
TcmAppletReqVo
req
);
/**
* 查询单条小程序信息
* @param req
* @return
*/
TcmAppletResVo
queryApplet
(
TcmAppletReqVo
req
);
/**
* 保存小程序信息
* @param req
* @return
*/
String
saveApplet
(
TcmAppletReqVo
req
);
}
src/main/java/com/tcm/system/applets/service/impl/AppletServiceImpl.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
applets
.
service
.
impl
;
import
com.tcm.system.applets.dao.AppletDao
;
import
com.tcm.system.applets.service.AppletService
;
import
com.tcm.system.applets.vo.TcmAppletVo
;
import
com.tcm.system.applets.vo.req.TcmAppletReqVo
;
import
com.tcm.system.applets.vo.res.TcmAppletResVo
;
import
com.yanzuoguang.util.base.ObjectHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Service
;
@Service
public
class
AppletServiceImpl
implements
AppletService
{
private
AppletDao
appletDao
;
public
AppletServiceImpl
(
AppletDao
appletDao
)
{
this
.
appletDao
=
appletDao
;
}
@Override
public
PageSizeData
<
TcmAppletResVo
>
queryAppletPageList
(
TcmAppletReqVo
req
)
{
return
appletDao
.
queryAppletPageList
(
req
);
}
@Override
public
TcmAppletResVo
queryApplet
(
TcmAppletReqVo
req
)
{
return
appletDao
.
load
(
req
.
getAppletId
(),
TcmAppletResVo
.
class
);
}
@Override
public
String
saveApplet
(
TcmAppletReqVo
req
)
{
// String appletId = StringHelper.getMD5Id(req.getAppletAppid(), req.getAppletType());
TcmAppletReqVo
appletReqVo
=
new
TcmAppletReqVo
();
appletReqVo
.
setAppletAppid
(
req
.
getAppletAppid
());
appletReqVo
.
setAppletType
(
req
.
getAppletType
());
TcmAppletVo
appletResVo
=
appletDao
.
load
(
appletReqVo
,
TcmAppletVo
.
class
);
if
(
StringHelper
.
isEmpty
(
appletResVo
))
{
req
.
setAppletId
(
req
.
getAppletAppid
());
appletDao
.
create
(
req
);
}
else
{
ObjectHelper
.
writeWithFromClass
(
appletResVo
,
req
);
appletDao
.
update
(
appletResVo
);
}
return
"处理成功"
;
}
}
src/main/java/com/tcm/system/applets/vo/TcmAppletVo.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
applets
.
vo
;
import
com.yanzuoguang.dao.TableAnnotation
;
import
com.yanzuoguang.util.vo.BaseVo
;
import
com.yanzuoguang.util.vo.InitDao
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
@TableAnnotation
(
"tcm_applet"
)
@ApiModel
(
description
=
"小程序配置实体"
)
public
class
TcmAppletVo
extends
BaseVo
implements
InitDao
{
@ApiModelProperty
(
notes
=
"小程序编号"
)
@TableAnnotation
(
"applet_id"
)
private
String
appletId
;
@ApiModelProperty
(
notes
=
"小程序名称"
)
@TableAnnotation
(
"applet_name"
)
private
String
appletName
;
@ApiModelProperty
(
notes
=
"小程序appid"
)
@TableAnnotation
(
"applet_appid"
)
private
String
appletAppid
;
@ApiModelProperty
(
notes
=
"小程序类型 0 微信 1支付宝"
)
@TableAnnotation
(
"applet_type"
)
private
Integer
appletType
;
@ApiModelProperty
(
notes
=
"商户编号"
)
@TableAnnotation
(
"merchant_id"
)
private
String
merchantId
;
@ApiModelProperty
(
notes
=
"商户名称"
)
@TableAnnotation
(
"merchant_name"
)
private
String
merchantName
;
@ApiModelProperty
(
notes
=
"商户编号"
)
@TableAnnotation
(
"company_id"
)
private
String
companyId
;
@ApiModelProperty
(
notes
=
"商户名称"
)
@TableAnnotation
(
"company_name"
)
private
String
companyName
;
@ApiModelProperty
(
notes
=
"平台私钥"
)
@TableAnnotation
(
"private_key"
)
private
String
privateKey
;
@ApiModelProperty
(
notes
=
"平台公钥"
)
@TableAnnotation
(
"public_key"
)
private
String
publicKey
;
@ApiModelProperty
(
notes
=
"应用私钥"
)
@TableAnnotation
(
"applets_private_key"
)
private
String
appletsPrivateKey
;
@ApiModelProperty
(
notes
=
"应用公钥"
)
@TableAnnotation
(
"applets_public_key"
)
private
String
appletsPublicKey
;
@ApiModelProperty
(
notes
=
"小程序秘钥"
)
@TableAnnotation
(
"applet_secret"
)
private
String
appletSecret
;
@ApiModelProperty
(
notes
=
"抖音小程序授权码"
)
@TableAnnotation
(
"authorization_code"
)
private
String
authorizationCode
;
public
void
init
()
{
}
public
String
getAppletId
()
{
return
appletId
;
}
public
void
setAppletId
(
String
appletId
)
{
this
.
appletId
=
appletId
;
}
public
String
getAppletName
()
{
return
appletName
;
}
public
void
setAppletName
(
String
appletName
)
{
this
.
appletName
=
appletName
;
}
public
String
getAppletAppid
()
{
return
appletAppid
;
}
public
void
setAppletAppid
(
String
appletAppid
)
{
this
.
appletAppid
=
appletAppid
;
}
public
Integer
getAppletType
()
{
return
appletType
;
}
public
void
setAppletType
(
Integer
appletType
)
{
this
.
appletType
=
appletType
;
}
public
String
getMerchantId
()
{
return
merchantId
;
}
public
void
setMerchantId
(
String
merchantId
)
{
this
.
merchantId
=
merchantId
;
}
public
String
getMerchantName
()
{
return
merchantName
;
}
public
void
setMerchantName
(
String
merchantName
)
{
this
.
merchantName
=
merchantName
;
}
public
String
getCompanyId
()
{
return
companyId
;
}
public
void
setCompanyId
(
String
companyId
)
{
this
.
companyId
=
companyId
;
}
public
String
getCompanyName
()
{
return
companyName
;
}
public
void
setCompanyName
(
String
companyName
)
{
this
.
companyName
=
companyName
;
}
public
String
getPrivateKey
()
{
return
privateKey
;
}
public
void
setPrivateKey
(
String
privateKey
)
{
this
.
privateKey
=
privateKey
;
}
public
String
getPublicKey
()
{
return
publicKey
;
}
public
void
setPublicKey
(
String
publicKey
)
{
this
.
publicKey
=
publicKey
;
}
public
String
getAppletsPrivateKey
()
{
return
appletsPrivateKey
;
}
public
void
setAppletsPrivateKey
(
String
appletsPrivateKey
)
{
this
.
appletsPrivateKey
=
appletsPrivateKey
;
}
public
String
getAppletsPublicKey
()
{
return
appletsPublicKey
;
}
public
void
setAppletsPublicKey
(
String
appletsPublicKey
)
{
this
.
appletsPublicKey
=
appletsPublicKey
;
}
public
String
getAppletSecret
()
{
return
appletSecret
;
}
public
void
setAppletSecret
(
String
appletSecret
)
{
this
.
appletSecret
=
appletSecret
;
}
public
String
getAuthorizationCode
()
{
return
authorizationCode
;
}
public
void
setAuthorizationCode
(
String
authorizationCode
)
{
this
.
authorizationCode
=
authorizationCode
;
}
}
src/main/java/com/tcm/system/applets/vo/req/TcmAppletReqVo.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
applets
.
vo
.
req
;
import
com.yanzuoguang.util.vo.PageSizeReqVo
;
import
io.swagger.annotations.ApiModelProperty
;
public
class
TcmAppletReqVo
extends
PageSizeReqVo
{
@ApiModelProperty
(
notes
=
"小程序编号"
)
private
String
appletId
;
@ApiModelProperty
(
notes
=
"小程序名称"
)
private
String
appletName
;
@ApiModelProperty
(
notes
=
"小程序appid"
)
private
String
appletAppid
;
@ApiModelProperty
(
notes
=
"小程序类型 0 微信 1支付宝"
)
private
Integer
appletType
;
@ApiModelProperty
(
notes
=
"商户编号"
)
private
String
merchantId
;
@ApiModelProperty
(
notes
=
"商户名称"
)
private
String
merchantName
;
@ApiModelProperty
(
notes
=
"商户编号"
)
private
String
companyId
;
@ApiModelProperty
(
notes
=
"商户名称"
)
private
String
companyName
;
@ApiModelProperty
(
notes
=
"平台私钥"
)
private
String
privateKey
;
@ApiModelProperty
(
notes
=
"平台公钥"
)
private
String
publicKey
;
@ApiModelProperty
(
notes
=
"小程序私钥"
)
private
String
appletsPrivateKey
;
@ApiModelProperty
(
notes
=
"小程序公钥"
)
private
String
appletsPublicKey
;
@ApiModelProperty
(
notes
=
"小程序秘钥"
)
private
String
appletSecret
;
@ApiModelProperty
(
notes
=
"抖音小程序授权码"
)
private
String
authorizationCode
;
public
String
getAppletId
()
{
return
appletId
;
}
public
void
setAppletId
(
String
appletId
)
{
this
.
appletId
=
appletId
;
}
public
String
getAppletName
()
{
return
appletName
;
}
public
void
setAppletName
(
String
appletName
)
{
this
.
appletName
=
appletName
;
}
public
String
getAppletAppid
()
{
return
appletAppid
;
}
public
void
setAppletAppid
(
String
appletAppid
)
{
this
.
appletAppid
=
appletAppid
;
}
public
Integer
getAppletType
()
{
return
appletType
;
}
public
void
setAppletType
(
Integer
appletType
)
{
this
.
appletType
=
appletType
;
}
public
String
getMerchantId
()
{
return
merchantId
;
}
public
void
setMerchantId
(
String
merchantId
)
{
this
.
merchantId
=
merchantId
;
}
public
String
getMerchantName
()
{
return
merchantName
;
}
public
void
setMerchantName
(
String
merchantName
)
{
this
.
merchantName
=
merchantName
;
}
public
String
getCompanyId
()
{
return
companyId
;
}
public
void
setCompanyId
(
String
companyId
)
{
this
.
companyId
=
companyId
;
}
public
String
getCompanyName
()
{
return
companyName
;
}
public
void
setCompanyName
(
String
companyName
)
{
this
.
companyName
=
companyName
;
}
public
String
getPrivateKey
()
{
return
privateKey
;
}
public
void
setPrivateKey
(
String
privateKey
)
{
this
.
privateKey
=
privateKey
;
}
public
String
getPublicKey
()
{
return
publicKey
;
}
public
void
setPublicKey
(
String
publicKey
)
{
this
.
publicKey
=
publicKey
;
}
public
String
getAppletsPrivateKey
()
{
return
appletsPrivateKey
;
}
public
void
setAppletsPrivateKey
(
String
appletsPrivateKey
)
{
this
.
appletsPrivateKey
=
appletsPrivateKey
;
}
public
String
getAppletsPublicKey
()
{
return
appletsPublicKey
;
}
public
void
setAppletsPublicKey
(
String
appletsPublicKey
)
{
this
.
appletsPublicKey
=
appletsPublicKey
;
}
public
String
getAppletSecret
()
{
return
appletSecret
;
}
public
void
setAppletSecret
(
String
appletSecret
)
{
this
.
appletSecret
=
appletSecret
;
}
public
String
getAuthorizationCode
()
{
return
authorizationCode
;
}
public
void
setAuthorizationCode
(
String
authorizationCode
)
{
this
.
authorizationCode
=
authorizationCode
;
}
}
src/main/java/com/tcm/system/applets/vo/res/TcmAppletResVo.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
applets
.
vo
.
res
;
import
com.pangding.web.vo.applet.pd.AppletVo
;
public
class
TcmAppletResVo
extends
AppletVo
{
}
src/main/java/com/tcm/system/applets/web/AppletController.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
applets
.
web
;
import
com.tcm.system.applets.service.AppletService
;
import
com.tcm.system.applets.vo.req.TcmAppletReqVo
;
import
com.tcm.system.applets.vo.res.TcmAppletResVo
;
import
com.yanzuoguang.util.helper.CheckerHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
value
=
"/applets"
)
public
class
AppletController
{
private
AppletService
appletService
;
public
AppletController
(
AppletService
appletService
)
{
this
.
appletService
=
appletService
;
}
/**
* 查询小程序分页列表
* @param req
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/queryAppletPageList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"查询小程序分页列表"
,
notes
=
"返回小程序分页列表"
)
public
ResponseResult
<
PageSizeData
<
TcmAppletResVo
>>
queryAppletPageList
(
@RequestBody
TcmAppletReqVo
req
)
{
return
ResponseResult
.
result
(
appletService
.
queryAppletPageList
(
req
));
}
/**
* 查看小程序详情
* @param req
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/queryApplet"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"查看小程序详情"
,
notes
=
"返回小程序详情"
)
public
ResponseResult
<
TcmAppletResVo
>
queryApplet
(
@RequestBody
TcmAppletReqVo
req
)
{
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"appletId"
,
req
.
getAppletId
())
.
checkException
();
return
ResponseResult
.
result
(
appletService
.
queryApplet
(
req
));
}
/**
* 查看小程序详情
* @param req
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/queryAppletByInfo"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"查看小程序详情"
,
notes
=
"返回小程序详情"
)
public
ResponseResult
<
TcmAppletResVo
>
queryAppletByInfo
(
@RequestBody
TcmAppletReqVo
req
)
{
return
ResponseResult
.
result
(
appletService
.
queryApplet
(
req
));
}
/**
* 保存小程序
* @param req
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/saveApplet"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"保存小程序"
,
notes
=
"返回保存小程序结果"
)
public
ResponseResult
<
String
>
saveApplet
(
@RequestBody
TcmAppletReqVo
req
)
{
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"appletAppid"
,
req
.
getAppletAppid
())
.
notBlankCheck
(
"appletSecret"
,
req
.
getAppletSecret
())
.
notBlankCheck
(
"appletName"
,
req
.
getAppletName
())
.
notBlankCheck
(
"appletType"
,
req
.
getAppletType
())
.
checkException
();
return
ResponseResult
.
result
(
appletService
.
saveApplet
(
req
));
}
}
src/main/java/com/tcm/system/authority/service/impl/TcmAuthorityServiceImpl.java
View file @
39f1127f
package
com
.
tcm
.
system
.
authority
.
service
.
impl
;
import
com.pangding.web.vo.system.pd.authority.*
;
import
com.pangding.web.vo.system.res.authority.AuthorityListByLevelResVo
;
import
com.tcm.system.authority.dao.TcmAuthorityDao
;
import
com.tcm.system.authority.dao.TcmRoleAuthorityDao
;
import
com.tcm.system.authority.service.TcmAuthorityService
;
...
...
@@ -106,7 +104,7 @@ public class TcmAuthorityServiceImpl implements TcmAuthorityService {
}
public
List
<
TcmAuthorityListByLevelResVo
>
getListByLevel
(
TcmRoleAuthorityReqVo
req
){
List
<
TcmAuthorityListByLevelResVo
>
roleAuthorityVoList
=
tcm
Role
AuthorityDao
.
loadList
(
req
,
TcmAuthorityListByLevelResVo
.
class
);
List
<
TcmAuthorityListByLevelResVo
>
roleAuthorityVoList
=
tcmAuthorityDao
.
loadList
(
req
,
TcmAuthorityListByLevelResVo
.
class
);
return
getChildList
(
roleAuthorityVoList
,
false
);
}
...
...
src/main/java/com/tcm/system/authority/vo/TcmAuthorityVo.java
View file @
39f1127f
...
...
@@ -19,7 +19,7 @@ public class TcmAuthorityVo extends BaseVo implements InitDao {
@TableAnnotation
(
"authority_name"
)
private
String
authorityName
;
@ApiModelProperty
(
notes
=
"权限类型"
)
@ApiModelProperty
(
notes
=
"权限类型
(0:菜单类型,1:按钮类型)
"
)
@TableAnnotation
(
"authority_type"
)
private
Integer
authorityType
;
...
...
@@ -28,10 +28,10 @@ public class TcmAuthorityVo extends BaseVo implements InitDao {
private
String
authorityAlias
;
@ApiModelProperty
(
notes
=
"权限url"
)
@TableAnnotation
(
"authority
U
rl"
)
@TableAnnotation
(
"authority
_u
rl"
)
private
String
authorityUrl
;
@ApiModelProperty
(
notes
=
"打开方式"
)
@ApiModelProperty
(
notes
=
"打开方式
0 html 1 弹窗
"
)
@TableAnnotation
(
"open_mode"
)
private
Integer
openMode
;
...
...
@@ -61,6 +61,14 @@ public class TcmAuthorityVo extends BaseVo implements InitDao {
@TableAnnotation
(
"platform_type"
)
private
Integer
platformType
;
@ApiModelProperty
(
notes
=
"点击前图标"
)
@TableAnnotation
(
"click_icon_before"
)
private
String
clickIconBefore
;
@ApiModelProperty
(
notes
=
"点击前图标"
)
@TableAnnotation
(
"click_icon_after"
)
private
String
clickIconAfter
;
@Override
public
void
init
()
{
...
...
@@ -177,4 +185,20 @@ public class TcmAuthorityVo extends BaseVo implements InitDao {
public
void
setPlatformType
(
Integer
platformType
)
{
this
.
platformType
=
platformType
;
}
public
String
getClickIconBefore
()
{
return
clickIconBefore
;
}
public
void
setClickIconBefore
(
String
clickIconBefore
)
{
this
.
clickIconBefore
=
clickIconBefore
;
}
public
String
getClickIconAfter
()
{
return
clickIconAfter
;
}
public
void
setClickIconAfter
(
String
clickIconAfter
)
{
this
.
clickIconAfter
=
clickIconAfter
;
}
}
src/main/java/com/tcm/system/authority/web/TcmAuthorityController.java
View file @
39f1127f
...
...
@@ -80,7 +80,7 @@ public class TcmAuthorityController {
public
ResponseResult
<
String
>
saveAuthority
(
@RequestBody
TcmAuthoritySaveReqVo
req
){
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"authorityName"
,
req
.
getAuthorityName
())
.
notBlankCheck
(
"auth
p
rityType"
,
req
.
getAuthorityType
())
.
notBlankCheck
(
"auth
o
rityType"
,
req
.
getAuthorityType
())
.
notBlankCheck
(
"authorityAlias"
,
req
.
getAuthorityAlias
())
.
notBlankCheck
(
"openMode"
,
req
.
getOpenMode
())
.
notBlankCheck
(
"authoritySort"
,
req
.
getAuthoritySort
())
...
...
src/main/java/com/tcm/system/position/dao/PositionDao.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
position
.
dao
;
import
com.tcm.system.position.vo.req.PositionPageReqVo
;
import
com.tcm.system.position.vo.res.PositionListResVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
java.util.List
;
public
interface
PositionDao
extends
BaseDao
{
PageSizeData
<
PositionListResVo
>
findPositionPage
(
PositionPageReqVo
req
);
List
<
PositionListResVo
>
findPositionList
(
PositionPageReqVo
req
);
}
src/main/java/com/tcm/system/position/dao/impl/PositionDaoImpl.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
position
.
dao
.
impl
;
import
com.tcm.system.position.dao.PositionDao
;
import
com.tcm.system.position.vo.PositionVo
;
import
com.tcm.system.position.vo.req.PositionPageReqVo
;
import
com.tcm.system.position.vo.res.PositionListResVo
;
import
com.tcm.system.role.vo.req.TcmRolePageReqVo
;
import
com.tcm.system.role.vo.res.TcmRoleListResVo
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Component
public
class
PositionDaoImpl
extends
BaseDaoImpl
implements
PositionDao
{
private
static
final
String
QUERY_LIST
=
"QUERY_LIST"
;
@Override
protected
void
init
()
{
register
(
PositionVo
.
class
);
table
.
add
(
QUERY_LIST
,
"select * from tcm_sys_position a "
+
" where 1=1 {WHERE}"
)
.
add
(
"positionId"
,
" and a.position_id = ? "
)
.
add
(
"positionName"
,
" and a.position_name LIKE concat(?,'%') "
);
}
@Override
public
PageSizeData
<
PositionListResVo
>
findPositionPage
(
PositionPageReqVo
req
)
{
return
this
.
queryPage
(
PositionListResVo
.
class
,
req
,
QUERY_LIST
,
req
);
}
@Override
public
List
<
PositionListResVo
>
findPositionList
(
PositionPageReqVo
req
)
{
return
this
.
query
(
PositionListResVo
.
class
,
QUERY_LIST
,
req
);
}
}
src/main/java/com/tcm/system/position/service/PositionService.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
position
.
service
;
import
com.tcm.system.position.vo.req.PositionPageReqVo
;
import
com.tcm.system.position.vo.req.PositionSaveReqVo
;
import
com.tcm.system.position.vo.res.PositionListResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
java.util.List
;
public
interface
PositionService
{
PageSizeData
<
PositionListResVo
>
findPositionPage
(
PositionPageReqVo
req
);
List
<
PositionListResVo
>
findPositionList
(
PositionPageReqVo
req
);
String
savePosition
(
PositionSaveReqVo
req
);
void
delPosition
(
PositionSaveReqVo
req
);
}
src/main/java/com/tcm/system/position/service/impl/PositionServiceImpl.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
position
.
service
.
impl
;
import
com.tcm.system.position.dao.PositionDao
;
import
com.tcm.system.position.service.PositionService
;
import
com.tcm.system.position.vo.PositionVo
;
import
com.tcm.system.position.vo.req.PositionPageReqVo
;
import
com.tcm.system.position.vo.req.PositionSaveReqVo
;
import
com.tcm.system.position.vo.res.PositionListResVo
;
import
com.yanzuoguang.util.base.ObjectHelper
;
import
com.yanzuoguang.util.helper.DateHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
PositionServiceImpl
implements
PositionService
{
private
PositionDao
positionDao
;
public
PositionServiceImpl
(
PositionDao
positionDao
)
{
this
.
positionDao
=
positionDao
;
}
public
PageSizeData
<
PositionListResVo
>
findPositionPage
(
PositionPageReqVo
req
)
{
return
positionDao
.
findPositionPage
(
req
);
}
public
List
<
PositionListResVo
>
findPositionList
(
PositionPageReqVo
req
)
{
return
positionDao
.
findPositionList
(
req
);
}
public
String
savePosition
(
PositionSaveReqVo
req
)
{
if
(
StringHelper
.
isEmpty
(
req
.
getPositionId
()))
{
req
.
setPositionId
(
StringHelper
.
getNewID
());
req
.
setCreateTime
(
DateHelper
.
getNow
());
positionDao
.
create
(
req
);
}
else
{
PositionVo
positionVo
=
positionDao
.
load
(
req
.
getPositionId
(),
PositionVo
.
class
);
ObjectHelper
.
writeWithFromClass
(
positionVo
,
req
);
positionDao
.
update
(
positionVo
);
}
return
req
.
getPositionId
();
}
public
void
delPosition
(
PositionSaveReqVo
req
)
{
positionDao
.
remove
(
req
);
}
}
src/main/java/com/tcm/system/position/vo/req/PositionPageReqVo.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
position
.
vo
.
req
;
import
com.yanzuoguang.util.vo.PageSizeReqVo
;
import
io.swagger.annotations.ApiModelProperty
;
public
class
PositionPageReqVo
extends
PageSizeReqVo
{
@ApiModelProperty
(
notes
=
"职务编号"
)
private
String
positionId
;
@ApiModelProperty
(
notes
=
"职务名称"
)
private
String
positionName
;
public
String
getPositionId
()
{
return
positionId
;
}
public
void
setPositionId
(
String
positionId
)
{
this
.
positionId
=
positionId
;
}
public
String
getPositionName
()
{
return
positionName
;
}
public
void
setPositionName
(
String
positionName
)
{
this
.
positionName
=
positionName
;
}
}
src/main/java/com/tcm/system/position/vo/req/PositionSaveReqVo.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
position
.
vo
.
req
;
import
com.tcm.system.position.vo.PositionVo
;
public
class
PositionSaveReqVo
extends
PositionVo
{
}
src/main/java/com/tcm/system/position/vo/res/PositionListResVo.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
position
.
vo
.
res
;
import
com.tcm.system.position.vo.PositionVo
;
public
class
PositionListResVo
extends
PositionVo
{
}
src/main/java/com/tcm/system/position/web/PositionController.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
position
.
web
;
import
com.tcm.system.position.service.PositionService
;
import
com.tcm.system.position.vo.req.PositionPageReqVo
;
import
com.tcm.system.position.vo.req.PositionSaveReqVo
;
import
com.tcm.system.position.vo.res.PositionListResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/position"
)
public
class
PositionController
{
private
PositionService
positionService
;
public
PositionController
(
PositionService
positionService
)
{
this
.
positionService
=
positionService
;
}
@RequestMapping
(
value
=
"/findPositionPage"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
PageSizeData
<
PositionListResVo
>>
findPositionPage
(
@RequestBody
PositionPageReqVo
req
){
return
ResponseResult
.
result
(
positionService
.
findPositionPage
(
req
));
}
@RequestMapping
(
value
=
"/findPositionList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
List
<
PositionListResVo
>>
findPositionList
(
@RequestBody
PositionPageReqVo
req
){
return
ResponseResult
.
result
(
positionService
.
findPositionList
(
req
));
}
@RequestMapping
(
value
=
"/savePosition"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
String
>
savePosition
(
@RequestBody
PositionSaveReqVo
req
){
positionService
.
savePosition
(
req
);
return
ResponseResult
.
result
(
"处理成功"
);
}
@RequestMapping
(
value
=
"/delPosition"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
String
>
delPosition
(
@RequestBody
PositionSaveReqVo
req
){
positionService
.
delPosition
(
req
);
return
ResponseResult
.
result
(
"处理成功"
);
}
}
src/main/java/com/tcm/system/role/dao/TcmRoleDao.java
View file @
39f1127f
...
...
@@ -5,8 +5,12 @@ import com.tcm.system.role.vo.res.TcmRoleListResVo;
import
com.yanzuoguang.dao.BaseDao
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
java.util.List
;
public
interface
TcmRoleDao
extends
BaseDao
{
PageSizeData
<
TcmRoleListResVo
>
queryList
(
TcmRolePageReqVo
req
);
PageSizeData
<
TcmRoleListResVo
>
findRolePage
(
TcmRolePageReqVo
req
);
List
<
TcmRoleListResVo
>
findRoleList
(
TcmRolePageReqVo
req
);
}
src/main/java/com/tcm/system/role/dao/impl/TcmRoleDaoImpl.java
View file @
39f1127f
...
...
@@ -8,6 +8,8 @@ import com.yanzuoguang.dao.impl.BaseDaoImpl;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Component
public
class
TcmRoleDaoImpl
extends
BaseDaoImpl
implements
TcmRoleDao
{
...
...
@@ -26,8 +28,14 @@ public class TcmRoleDaoImpl extends BaseDaoImpl implements TcmRoleDao {
}
@Override
public
PageSizeData
<
TcmRoleListResVo
>
queryList
(
TcmRolePageReqVo
req
)
{
public
PageSizeData
<
TcmRoleListResVo
>
findRolePage
(
TcmRolePageReqVo
req
)
{
return
this
.
queryPage
(
TcmRoleListResVo
.
class
,
req
,
QUERY_LIST
,
req
);
}
@Override
public
List
<
TcmRoleListResVo
>
findRoleList
(
TcmRolePageReqVo
req
)
{
return
this
.
query
(
TcmRoleListResVo
.
class
,
QUERY_LIST
,
req
);
}
}
src/main/java/com/tcm/system/role/service/TcmRoleService.java
View file @
39f1127f
...
...
@@ -3,11 +3,18 @@ package com.tcm.system.role.service;
import
com.tcm.system.role.vo.req.TcmRolePageReqVo
;
import
com.tcm.system.role.vo.req.TcmRoleSaveReqVo
;
import
com.tcm.system.role.vo.res.TcmRoleListResVo
;
import
com.tcm.system.role.vo.res.TcmRoleResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
java.util.List
;
public
interface
TcmRoleService
{
PageSizeData
<
TcmRoleListResVo
>
queryList
(
TcmRolePageReqVo
req
);
PageSizeData
<
TcmRoleListResVo
>
findRolePage
(
TcmRolePageReqVo
req
);
List
<
TcmRoleListResVo
>
findRoleList
(
TcmRolePageReqVo
req
);
TcmRoleResVo
findRoleInfo
(
TcmRolePageReqVo
req
);
String
saveRole
(
TcmRoleSaveReqVo
req
);
...
...
src/main/java/com/tcm/system/role/service/impl/TcmRoleServiceImpl.java
View file @
39f1127f
package
com
.
tcm
.
system
.
role
.
service
.
impl
;
import
com.pangding.web.constant.CompanyConstant
;
import
com.pangding.web.vo.system.pd.authority.AuthorityVo
;
import
com.pangding.web.vo.system.pd.authority.RoleAuthorityVo
;
import
com.pangding.web.vo.system.pd.authority.RoleVo
;
import
com.tcm.system.authority.dao.TcmRoleAuthorityDao
;
import
com.tcm.system.authority.vo.TcmRoleAuthorityVo
;
import
com.tcm.system.authority.vo.req.TcmRoleAuthorityReqVo
;
...
...
@@ -13,6 +10,7 @@ import com.tcm.system.role.vo.TcmRoleVo;
import
com.tcm.system.role.vo.req.TcmRolePageReqVo
;
import
com.tcm.system.role.vo.req.TcmRoleSaveReqVo
;
import
com.tcm.system.role.vo.res.TcmRoleListResVo
;
import
com.tcm.system.role.vo.res.TcmRoleResVo
;
import
com.yanzuoguang.util.base.ObjectHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
...
...
@@ -32,12 +30,24 @@ public class TcmRoleServiceImpl implements TcmRoleService {
this
.
tcmRoleAuthorityDao
=
tcmRoleAuthorityDao
;
}
public
PageSizeData
<
TcmRoleListResVo
>
queryList
(
TcmRolePageReqVo
req
)
{
public
PageSizeData
<
TcmRoleListResVo
>
findRolePage
(
TcmRolePageReqVo
req
)
{
PageSizeData
<
TcmRoleListResVo
>
roleVoPageSizeData
=
tcmRoleDao
.
queryList
(
req
);
PageSizeData
<
TcmRoleListResVo
>
roleVoPageSizeData
=
tcmRoleDao
.
findRolePage
(
req
);
return
roleVoPageSizeData
;
}
public
List
<
TcmRoleListResVo
>
findRoleList
(
TcmRolePageReqVo
req
)
{
List
<
TcmRoleListResVo
>
roleVoList
=
tcmRoleDao
.
findRoleList
(
req
);
return
roleVoList
;
}
public
TcmRoleResVo
findRoleInfo
(
TcmRolePageReqVo
req
)
{
TcmRoleResVo
roleResVo
=
tcmRoleDao
.
load
(
req
.
getRoleId
(),
TcmRoleResVo
.
class
);
return
roleResVo
;
}
/**
* 保存RoleVo对象,并保存角色权限的对应关系
*
...
...
src/main/java/com/tcm/system/role/vo/TcmRoleVo.java
View file @
39f1127f
...
...
@@ -31,14 +31,6 @@ public class TcmRoleVo extends BaseVo implements InitDao {
@TableAnnotation
(
"create_time"
)
private
String
createTime
;
@ApiModelProperty
(
notes
=
"创建者id"
)
@TableAnnotation
(
"create_id"
)
private
String
createId
;
@ApiModelProperty
(
notes
=
"创建者名称"
)
@TableAnnotation
(
"create_name"
)
private
String
createName
;
@ApiModelProperty
(
notes
=
"创建时间"
)
@TableAnnotation
(
"update_time"
)
private
String
updateTime
;
...
...
@@ -96,21 +88,6 @@ public class TcmRoleVo extends BaseVo implements InitDao {
this
.
createTime
=
createTime
;
}
public
String
getCreateId
()
{
return
createId
;
}
public
void
setCreateId
(
String
createId
)
{
this
.
createId
=
createId
;
}
public
String
getCreateName
()
{
return
createName
;
}
public
void
setCreateName
(
String
createName
)
{
this
.
createName
=
createName
;
}
public
String
getUpdateTime
()
{
return
updateTime
;
...
...
src/main/java/com/tcm/system/role/vo/res/TcmRoleResVo.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
role
.
vo
.
res
;
import
com.tcm.system.role.vo.TcmRoleVo
;
public
class
TcmRoleResVo
extends
TcmRoleVo
{
}
src/main/java/com/tcm/system/role/web/TcmRoleController.java
View file @
39f1127f
...
...
@@ -4,6 +4,7 @@ import com.tcm.system.role.service.TcmRoleService;
import
com.tcm.system.role.vo.req.TcmRolePageReqVo
;
import
com.tcm.system.role.vo.req.TcmRoleSaveReqVo
;
import
com.tcm.system.role.vo.res.TcmRoleListResVo
;
import
com.tcm.system.role.vo.res.TcmRoleResVo
;
import
com.yanzuoguang.util.helper.CheckerHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
...
...
@@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/roles"
)
public
class
TcmRoleController
{
...
...
@@ -28,9 +31,23 @@ public class TcmRoleController {
// CheckerHelper.newInstance()
// .notBlankCheck("companyId",req.getCompanyId())
// .checkException();
return
ResponseResult
.
result
(
tcmRoleService
.
queryList
(
req
));
return
ResponseResult
.
result
(
tcmRoleService
.
findRolePage
(
req
));
}
@RequestMapping
(
value
=
"/findRoleList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
List
<
TcmRoleListResVo
>>
findRoleList
(
@RequestBody
TcmRolePageReqVo
req
){
return
ResponseResult
.
result
(
tcmRoleService
.
findRoleList
(
req
));
}
@RequestMapping
(
value
=
"/findRoleInfo"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
TcmRoleResVo
>
findRoleInfo
(
@RequestBody
TcmRolePageReqVo
req
){
return
ResponseResult
.
result
(
tcmRoleService
.
findRoleInfo
(
req
));
}
/**
* 新增角色
* 返回角色id
...
...
src/main/java/com/tcm/system/user/dao/impl/UserDaoImpl.java
View file @
39f1127f
...
...
@@ -34,9 +34,11 @@ public class UserDaoImpl extends BaseDaoImpl implements UserDao {
" LEFT JOIN tcm_sys_role b on a.role_id = b.role_id "
+
" LEFT JOIN tcm_sys_position c on c.position_id = a.position_id "
+
" where 1=1 "
)
.
add
(
"startDate"
,
" a.create_time >= ? "
)
.
add
(
"endDate"
,
" a.create_time <= ? "
)
.
add
(
"roleId"
,
" role_id = ? "
)
.
add
(
"startDate"
,
" and a.create_time >= ? "
)
.
add
(
"endDate"
,
" and a.create_time <= ? "
)
.
add
(
"userId"
,
" and a.user_id = ? "
)
.
add
(
"thirdOpenid"
,
" and a.third_openid = ? "
)
.
add
(
"roleId"
,
" and role_id = ? "
)
.
add
(
"account"
,
"and username = ? "
)
.
add
(
"phone"
,
"and phone = ? "
)
.
add
(
"loginAccount"
,
"and (username = ? or phone = ?) "
)
...
...
src/main/java/com/tcm/system/user/other/AppletLoginService.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
user
.
other
;
import
com.tcm.system.user.vo.TcmUserVo
;
import
com.tcm.system.user.vo.req.AppletUserLoginReqVo
;
public
interface
AppletLoginService
{
TcmUserVo
getAppletsUserInfoByCode
(
AppletUserLoginReqVo
req
);
}
src/main/java/com/tcm/system/user/other/impl/AppletApiService.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
user
.
other
.
impl
;
import
com.pangding.web.constant.PangdConstant
;
import
com.pangding.web.vo.applet.pd.AppletVo
;
import
com.tcm.system.applets.dao.AppletDao
;
import
com.tcm.system.api.WebChatConfig
;
import
com.tcm.system.user.vo.req.AppletUserLoginReqVo
;
import
com.yanzuoguang.util.helper.HttpHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
org.springframework.core.codec.CodecException
;
import
org.springframework.stereotype.Component
;
@Component
public
class
AppletApiService
{
private
WebChatConfig
webChatConfig
;
private
AppletDao
appletDao
;
public
AppletApiService
(
WebChatConfig
webChatConfig
,
AppletDao
appletDao
)
{
this
.
webChatConfig
=
webChatConfig
;
this
.
appletDao
=
appletDao
;
}
public
String
code2Session
(
AppletUserLoginReqVo
req
)
{
String
result
=
""
;
String
url
=
""
;
try
{
// 微信小程序appid默认为胖丁小程序
String
appid
=
webChatConfig
.
appletsAppId
;
String
secret
=
webChatConfig
.
appletsAppSecret
;
// 根据公司或者景区查询该景区的小程序参数
if
(!
StringHelper
.
isEmpty
(
req
.
getCompanyId
())
&&
!
StringHelper
.
isEmpty
(
req
.
getAppid
())){
AppletVo
appletReqVo
=
new
AppletVo
();
appletReqVo
.
setCompanyId
(
req
.
getCompanyId
());
appletReqVo
.
setAppletType
(
PangdConstant
.
APPLET_WECHAT
);
appletReqVo
.
setAppletAppid
(
req
.
getAppid
());
AppletVo
appletVo
=
appletDao
.
load
(
appletReqVo
,
AppletVo
.
class
);
if
(!
StringHelper
.
isEmpty
(
appletVo
)){
appid
=
appletVo
.
getAppletAppid
();
secret
=
appletVo
.
getAppletSecret
();
}
}
url
=
webChatConfig
.
code2Session
.
replace
(
"APPID"
,
appid
).
replace
(
"SECRET"
,
secret
)
.
replace
(
"JSCODE"
,
req
.
getCode
());
result
=
HttpHelper
.
get
(
url
);
}
catch
(
Exception
ex
)
{
throw
new
CodecException
(
ex
.
getMessage
());
}
return
result
;
}
}
src/main/java/com/tcm/system/user/other/impl/AppletLoginServiceImpl.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
user
.
other
.
impl
;
import
com.pangding.web.constant.PangdConstant
;
import
com.pangding.web.constant.UserConstant
;
import
com.pangding.web.util.Base64Util
;
import
com.pangding.web.vo.applet.pd.AppletVo
;
import
com.pangding.web.vo.wechat.req.WxUserReqVo
;
import
com.tcm.system.api.WechatApi
;
import
com.tcm.system.applets.dao.AppletDao
;
import
com.tcm.system.user.dao.UserDao
;
import
com.tcm.system.user.other.AppletLoginService
;
import
com.tcm.system.user.vo.TcmUserVo
;
import
com.tcm.system.user.vo.req.AppletUserLoginReqVo
;
import
com.tcm.system.user.vo.res.AppletsUserByCodeResVo
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
org.springframework.stereotype.Service
;
@Service
public
class
AppletLoginServiceImpl
implements
AppletLoginService
{
private
WechatApi
wechatApi
;
private
UserDao
userDao
;
public
AppletLoginServiceImpl
(
WechatApi
wechatApi
,
UserDao
userDao
)
{
this
.
wechatApi
=
wechatApi
;
this
.
userDao
=
userDao
;
}
@Override
public
TcmUserVo
getAppletsUserInfoByCode
(
AppletUserLoginReqVo
req
)
{
try
{
String
result
=
wechatApi
.
code2Session
(
req
);
AppletsUserByCodeResVo
appletsUserByCodeResVo
=
JsonHelper
.
deserialize
(
result
,
AppletsUserByCodeResVo
.
class
);
if
(!
StringHelper
.
isEmpty
(
appletsUserByCodeResVo
.
getOpenid
()))
{
TcmUserVo
user
=
userDao
.
load
(
appletsUserByCodeResVo
.
getOpenid
(),
TcmUserVo
.
class
);
if
(
StringHelper
.
isEmpty
(
user
))
{
user
=
new
TcmUserVo
();
user
.
setUserId
(
StringHelper
.
getMD5Id
(
appletsUserByCodeResVo
.
getOpenid
()));
user
.
setThirdOpenid
(
appletsUserByCodeResVo
.
getOpenid
());
userDao
.
create
(
user
);
}
// user.setUnionid(appletsUserByCodeResVo.getUnionid());
// user.setNickname(Base64Util.getBASE64(appletsUserByCodeResVo.getOpenid()));
// user.setAccountType(UserConstant.ACCOUNT_TYPE_WECHAT_APPLET);
// user.setSourceId(req.getCompanyId());
// user.setSourceCompanyId(req.getCompanyId());
return
user
;
// userConsumer.saveUser(user);
}
else
{
return
null
;
}
}
catch
(
Exception
e
)
{
//处理异常
e
.
printStackTrace
();
return
null
;
}
}
}
src/main/java/com/tcm/system/user/service/impl/LoginServiceImpl.java
View file @
39f1127f
...
...
@@ -114,4 +114,7 @@ public class LoginServiceImpl implements LoginService {
}
return
token
;
}
}
src/main/java/com/tcm/system/user/service/impl/UserServiceImpl.java
View file @
39f1127f
package
com
.
tcm
.
system
.
user
.
service
.
impl
;
import
com.pangding.web.util.RSAUtils
;
import
com.pangding.web.vo.system.pd.authority.UserVo
;
import
com.tcm.system.user.dao.UserDao
;
import
com.tcm.system.user.service.UserService
;
import
com.tcm.system.user.vo.RsaContant
;
...
...
@@ -12,6 +11,7 @@ import com.tcm.system.user.vo.req.TcmUserSaveReqVo;
import
com.tcm.system.user.vo.res.TcmUserResVo
;
import
com.yanzuoguang.util.base.ObjectHelper
;
import
com.yanzuoguang.util.exception.CodeException
;
import
com.yanzuoguang.util.helper.DateHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Service
;
...
...
@@ -51,28 +51,28 @@ public class UserServiceImpl implements UserService {
@Override
public
String
saveUser
(
TcmUserSaveReqVo
req
)
{
this
.
isValid
(
req
.
getUsername
());
this
.
checkAccount
(
req
);
try
{
/*将RSA加密后的密码解密*/
String
password
=
RSAUtils
.
decryptionByPrivateKey
(
req
.
getPassword
(),
rsaContant
.
getPrivateKey
());
String
confirmPassword
=
RSAUtils
.
decryptionByPrivateKey
(
req
.
getConfirmPassword
(),
rsaContant
.
getPrivateKey
());
if
(!
StringHelper
.
compare
(
password
,
confirmPassword
))
{
throw
new
CodeException
(
"确认密码错误"
);
}
//
String confirmPassword = RSAUtils.decryptionByPrivateKey(req.getConfirmPassword(), rsaContant.getPrivateKey());
//
if (!StringHelper.compare(password, confirmPassword)) {
//
throw new CodeException("确认密码错误");
//
}
String
md5Password
=
this
.
passwordEncoder
(
password
);
req
.
setPassword
(
md5Password
);
TcmUserVo
userVo
=
new
TcmUserVo
();
if
(
StringHelper
.
isEmpty
(
req
.
getUserId
()))
{
this
.
isValid
(
req
.
getUsername
());
this
.
checkAccount
(
req
);
req
.
setUserId
(
StringHelper
.
getNewID
());
ObjectHelper
.
writeWithFrom
(
userVo
,
req
);
req
.
setCreateTime
(
DateHelper
.
getNow
());
userDao
.
create
(
userVo
);
}
else
{
ObjectHelper
.
writeWithFrom
(
userVo
,
req
);
userDao
.
update
(
userVo
);
}
}
catch
(
Exception
e
){
throw
new
CodeException
(
e
.
getMessage
());
}
...
...
@@ -96,9 +96,9 @@ public class UserServiceImpl implements UserService {
public
void
checkAccount
(
TcmUserSaveReqVo
userVo
)
{
TcmUserSaveReqVo
tcmUserSaveReqVo
=
new
TcmUserSaveReqVo
();
tcmUserSaveReqVo
.
setUsername
(
userVo
.
getUsername
());
UserVo
userVo1
=
userDao
.
load
(
tcmUserSaveReqVo
,
UserVo
.
class
);
TcmUserVo
userVo1
=
userDao
.
load
(
tcmUserSaveReqVo
,
Tcm
UserVo
.
class
);
if
((
null
!=
userVo1
&&
null
==
userVo
.
getUserId
())
||
(
null
!=
userVo1
&&
null
!=
userVo
.
getUserId
()
&&
!
userVo1
.
getId
().
equals
(
userVo
.
getUserId
())))
{
(
null
!=
userVo1
&&
null
!=
userVo
.
getUserId
()
&&
!
userVo1
.
get
User
Id
().
equals
(
userVo
.
getUserId
())))
{
throw
new
CodeException
(
"用户名"
+
userVo
.
getUsername
()
+
"已存在"
);
}
}
...
...
src/main/java/com/tcm/system/user/swagger.java
View file @
39f1127f
...
...
@@ -24,7 +24,8 @@ public class swagger {
.
apis
(
SwaggerHelper
.
basePackage
(
"com.tcm.system.authority.web"
,
"com.tcm.system.user.web"
,
"com.tcm.system.role.web"
"com.tcm.system.role.web"
,
"com.tcm.system.position.web"
))
.
paths
(
PathSelectors
.
any
())
.
build
();
...
...
src/main/java/com/tcm/system/user/vo/TcmUserVo.java
View file @
39f1127f
...
...
@@ -22,9 +22,9 @@ public class TcmUserVo extends BaseVo implements InitDao {
@TableAnnotation
(
"real_name"
)
private
String
realName
;
@ApiModelProperty
(
notes
=
"性别"
)
@ApiModelProperty
(
notes
=
"性别
:0-男,1-女,2-不详
"
)
@TableAnnotation
(
"user_sex"
)
private
String
userSex
;
private
Integer
userSex
;
@ApiModelProperty
(
notes
=
"身份证"
)
@TableAnnotation
(
"id_card"
)
...
...
@@ -50,6 +50,10 @@ public class TcmUserVo extends BaseVo implements InitDao {
@TableAnnotation
(
"role_id"
)
private
String
roleId
;
@ApiModelProperty
(
notes
=
"角色id"
)
@TableAnnotation
(
"position_id"
)
private
String
positionId
;
@ApiModelProperty
(
notes
=
"电话"
)
private
String
phone
;
...
...
@@ -61,11 +65,11 @@ public class TcmUserVo extends BaseVo implements InitDao {
@TableAnnotation
(
"user_status"
)
private
Integer
userStatus
;
@ApiModelProperty
(
notes
=
"
状态:0-启用,1-禁用
"
)
@ApiModelProperty
(
notes
=
"
审核状态:0-未审核,1-审核通过,2-审核不通过
"
)
@TableAnnotation
(
"user_examine_status"
)
private
Integer
userExamineStatus
;
@ApiModelProperty
(
notes
=
"
状态:0-启用,1-禁用
"
)
@ApiModelProperty
(
notes
=
"
审核不通过原因
"
)
@TableAnnotation
(
"examine_message"
)
private
Integer
examineMessage
;
...
...
@@ -73,13 +77,6 @@ public class TcmUserVo extends BaseVo implements InitDao {
@TableAnnotation
(
"create_time"
)
private
String
createTime
;
@ApiModelProperty
(
notes
=
"创建者id"
)
@TableAnnotation
(
"create_id"
)
private
String
createId
;
@ApiModelProperty
(
notes
=
"创建者名称"
)
@TableAnnotation
(
"create_name"
)
private
String
createName
;
@ApiModelProperty
(
notes
=
"创建时间"
)
@TableAnnotation
(
"update_time"
)
...
...
@@ -122,11 +119,11 @@ public class TcmUserVo extends BaseVo implements InitDao {
this
.
realName
=
realName
;
}
public
String
getUserSex
()
{
public
Integer
getUserSex
()
{
return
userSex
;
}
public
void
setUserSex
(
String
userSex
)
{
public
void
setUserSex
(
Integer
userSex
)
{
this
.
userSex
=
userSex
;
}
...
...
@@ -210,22 +207,6 @@ public class TcmUserVo extends BaseVo implements InitDao {
this
.
createTime
=
createTime
;
}
public
String
getCreateId
()
{
return
createId
;
}
public
void
setCreateId
(
String
createId
)
{
this
.
createId
=
createId
;
}
public
String
getCreateName
()
{
return
createName
;
}
public
void
setCreateName
(
String
createName
)
{
this
.
createName
=
createName
;
}
public
String
getUpdateTime
()
{
return
updateTime
;
}
...
...
@@ -249,4 +230,12 @@ public class TcmUserVo extends BaseVo implements InitDao {
public
void
setExamineMessage
(
Integer
examineMessage
)
{
this
.
examineMessage
=
examineMessage
;
}
public
String
getPositionId
()
{
return
positionId
;
}
public
void
setPositionId
(
String
positionId
)
{
this
.
positionId
=
positionId
;
}
}
src/main/java/com/tcm/system/user/vo/req/AppletUserLoginReqVo.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
user
.
vo
.
req
;
import
io.swagger.annotations.ApiModelProperty
;
public
class
AppletUserLoginReqVo
{
@ApiModelProperty
(
notes
=
"微信code"
)
private
String
code
;
@ApiModelProperty
(
notes
=
"小程序的appid"
)
private
String
appid
;
@ApiModelProperty
(
notes
=
"请求id"
)
private
String
reqId
;
@ApiModelProperty
(
notes
=
"公司ID"
)
private
String
companyId
;
@ApiModelProperty
(
notes
=
"授权类型"
+
"支付宝:"
+
" * auth_base(静默授权):静默授权,用户无需点击确认授权,默认返回 auth_code。"
+
" * auth_user(主动授权):首次授权需要用户手动点击同意,用户同意后,返回 auth_code;商家需要考虑用户拒绝授权的情况并进行相应容错。"
+
" * 如果授权关系依旧存在,下次进入页面时也会静默授权"
+
" * 微信:snsapi_base (不弹出授权页面,直接跳转,只能获取用户openid),"
+
" * snsapi_userinfo (弹出授权页面,可通过openid拿到昵称、性别、所在地。并且, 即使在未关注的情况下,只要用户授权,也能获取其信息 )"
)
private
String
scopes
;
/**
* 来源 1微信 2支付宝
*/
@ApiModelProperty
(
notes
=
"返回状态码"
)
private
Integer
source
;
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getAppid
()
{
return
appid
;
}
public
void
setAppid
(
String
appid
)
{
this
.
appid
=
appid
;
}
public
String
getReqId
()
{
return
reqId
;
}
public
void
setReqId
(
String
reqId
)
{
this
.
reqId
=
reqId
;
}
public
String
getCompanyId
()
{
return
companyId
;
}
public
void
setCompanyId
(
String
companyId
)
{
this
.
companyId
=
companyId
;
}
public
String
getScopes
()
{
return
scopes
;
}
public
void
setScopes
(
String
scopes
)
{
this
.
scopes
=
scopes
;
}
public
Integer
getSource
()
{
return
source
;
}
public
void
setSource
(
Integer
source
)
{
this
.
source
=
source
;
}
}
src/main/java/com/tcm/system/user/vo/res/AppletsUserByCodeResVo.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
user
.
vo
.
res
;
import
io.swagger.annotations.ApiModelProperty
;
public
class
AppletsUserByCodeResVo
{
@ApiModelProperty
(
notes
=
"用户唯一标识"
)
private
String
openid
;
@ApiModelProperty
(
notes
=
"会话密钥"
)
private
String
session_key
;
@ApiModelProperty
(
notes
=
"用户在开放平台的唯一标识符,若当前小程序已绑定到微信开放平台帐号下会返回"
)
private
String
unionid
;
@ApiModelProperty
(
notes
=
"错误码"
)
private
Integer
errcode
;
@ApiModelProperty
(
notes
=
"错误信息"
)
private
String
errmsg
;
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
public
String
getSession_key
()
{
return
session_key
;
}
public
void
setSession_key
(
String
session_key
)
{
this
.
session_key
=
session_key
;
}
public
String
getUnionid
()
{
return
unionid
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
Integer
getErrcode
()
{
return
errcode
;
}
public
void
setErrcode
(
Integer
errcode
)
{
this
.
errcode
=
errcode
;
}
public
String
getErrmsg
()
{
return
errmsg
;
}
public
void
setErrmsg
(
String
errmsg
)
{
this
.
errmsg
=
errmsg
;
}
}
src/main/java/com/tcm/system/user/web/LoginController.java
View file @
39f1127f
package
com
.
tcm
.
system
.
user
.
web
;
import
com.tcm.system.user.other.AppletLoginService
;
import
com.tcm.system.user.service.LoginService
;
import
com.tcm.system.user.vo.TcmUserVo
;
import
com.tcm.system.user.vo.req.AppletUserLoginReqVo
;
import
com.tcm.system.user.vo.req.UserLoginReqVo
;
import
com.tcm.system.user.vo.res.UserLoginResVo
;
import
com.yanzuoguang.util.helper.CheckerHelper
;
...
...
@@ -19,12 +22,13 @@ import org.springframework.web.bind.annotation.RestController;
public
class
LoginController
{
private
LoginService
loginService
;
private
AppletLoginService
AppletLoginService
;
public
LoginController
(
LoginService
loginService
)
{
public
LoginController
(
LoginService
loginService
,
com
.
tcm
.
system
.
user
.
other
.
AppletLoginService
appletLoginService
)
{
this
.
loginService
=
loginService
;
AppletLoginService
=
appletLoginService
;
}
/**
* 登陆,验证用户名或手机号,密码是否正确
* 返回token,account,LoginCompanyResVo对象(id:公司id,status:公司状态,companyAttribute:属性,bankCardCodeList:绑定的银行卡数组)
...
...
@@ -34,7 +38,7 @@ public class LoginController {
*/
@ApiOperation
(
value
=
"登录"
,
notes
=
"返回登录信息"
)
@RequestMapping
(
value
=
"/login"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
UserLoginResVo
>
mobile
(
@RequestBody
UserLoginReqVo
req
)
throws
Exception
{
public
ResponseResult
<
UserLoginResVo
>
webLogin
(
@RequestBody
UserLoginReqVo
req
)
{
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"account or phone"
,
req
.
getAccountOrPhone
())
.
notBlankCheck
(
"password"
,
req
.
getPassword
())
...
...
@@ -43,4 +47,14 @@ public class LoginController {
return
ResponseResult
.
result
(
loginService
.
login
(
req
));
}
@ApiOperation
(
value
=
"登录"
,
notes
=
"返回登录信息"
)
@RequestMapping
(
value
=
"/appletLogin"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
TcmUserVo
>
appletLogin
(
@RequestBody
AppletUserLoginReqVo
req
)
{
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"code"
,
req
.
getCode
())
.
notBlankCheck
(
"source"
,
req
.
getSource
())
.
checkException
(
req
);
return
ResponseResult
.
result
(
AppletLoginService
.
getAppletsUserInfoByCode
(
req
));
}
}
src/main/java/com/tcm/system/user/web/TokenController.java
0 → 100644
View file @
39f1127f
package
com
.
tcm
.
system
.
user
.
web
;
import
com.tcm.system.user.service.TokenService
;
import
com.tcm.system.user.vo.TcmLoginTokenVo
;
import
com.yanzuoguang.util.helper.CheckerHelper
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 日志操作控制类
*
* @author tf
*/
@RestController
@RequestMapping
(
"/token"
)
public
class
TokenController
{
@Autowired
private
TokenService
tokenService
;
/**
* 登录实体创建
*
* @param loginVo
*/
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
String
>
save
(
@RequestBody
TcmLoginTokenVo
loginVo
)
{
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"token"
,
loginVo
.
getToken
())
.
notBlankCheck
(
"data"
,
loginVo
.
getData
())
.
notBlankCheck
(
"expairTime"
,
loginVo
.
getExpairTime
())
.
checkDate
(
"expairTime"
,
loginVo
.
getExpairTime
())
.
checkException
(
loginVo
);
return
ResponseResult
.
result
(
tokenService
.
save
(
loginVo
));
}
/**
* 加载登录信息
*
* @param loginVo 登录信息
*/
@RequestMapping
(
value
=
"/load"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
TcmLoginTokenVo
>
load
(
@RequestBody
TcmLoginTokenVo
loginVo
)
{
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"token"
,
loginVo
.
getToken
())
.
checkException
(
loginVo
);
return
ResponseResult
.
result
(
tokenService
.
load
(
loginVo
));
}
/**
* 加载登录信息
*
* @param loginVo 登录信息
*/
@RequestMapping
(
value
=
"/remove"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
Integer
>
remove
(
@RequestBody
TcmLoginTokenVo
loginVo
)
{
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"token"
,
loginVo
.
getToken
())
.
checkException
(
loginVo
);
return
ResponseResult
.
result
(
tokenService
.
remove
(
loginVo
));
}
}
src/main/resources/bootstrap-prod.yml
View file @
39f1127f
spring
:
profiles
:
active
:
dev
application
:
name
:
tcm-system
cloud
:
config
:
# label: yidong
# base为所有服务的公共配置,pd-db-system为需要连接的数据库配置,${spring.application.name}为当前程序的配置,3个配置组合才为当前程序的启动配置
name
:
base,tcm-db-system,tcm-mq-mq,${spring.application.name}
label
:
master
fail-fast
:
true
# 设置从服务中拿取配置
discovery
:
enabled
:
true
service-id
:
tcm-config
# 设置配置拿取重试次数,可能有错误
retry
:
initial-interval
:
1000
max-interval
:
1000
max-attempts
:
1000
multiplier
:
1.1
rsa
:
privatekey
:
MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALZh0s9zLNdnF6OxW9R9nHXHewBs0YwTC9cpXVrjHMkrF+p/WLSwQItzwv+rTaEXCZazGxU2uv/IS58YEhG2i6HqwFJDZwgkQ3TimrGXkZ7w5x7JLXoAvIDgJRNJnL2qOPn1nw47DmZ+VsTK3nK/CPtyeJ+QWYgHXxQDcEyv8911AgMBAAECgYAyLaHhf4+zx+JiIBbi1JhqczKtQEM65baZQQE1U00FL/0JgHX4aJGpjHT3ALt/+aWit65Y3NEANKxRnj7CbtXlhG65zWGfZXoieqFlOxRFcHIWRpEFCtlnflGY1Os0n6dJ335YDWKuxbvq4TiLs6WIG8rIdD6tK1x49VNdukX+dQJBAOPX/rrQHjUuVK6kidhgbZXAjqRfQri50rFOxmvZvfpO+Fn7AuSA5NxXLj+7Jf/5SPJBXP5OhEiNIhh3qnoy1UcCQQDM653qBdR3KR3ro89mzc0RKJjooZVttqHc/FV9vd2dUPYGk0h94mSB2+ofsoOIZYa5eh0lDyBISbofnKjjVwVjAkA70HeSKZLUmU4n7xA1GtOKDdwksNF+V2JFpA2ZQLeMH/E5BhmzTVdHtSdyGbqXIaWR27EDHi/CMDL0Q24g2Hl/AkBP87YfMrsc6vvzjmxDbhSOl0phqXnF3rX0pLcuYj/vO0Fie2CTTRtt10HXsCzFsOcJwu1QIkC0M5/c6aCzYqaFAkBOaY9LoJXr2Fjga4XXWxE0oRvjCaV0p/dKTRAzXKdgqc6ADXc/OiAPr4nH48vnPH2w30nk17CR0WeMqhhgpMtM
publickey
:
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2YdLPcyzXZxejsVvUfZx1x3sAbNGMEwvXKV1a4xzJKxfqf1i0sECLc8L/q02hFwmWsxsVNrr/yEufGBIRtouh6sBSQ2cIJEN04pqxl5Ge8OceyS16ALyA4CUTSZy9qjj59Z8OOw5mflbEyt5yvwj7cnifkFmIB18UA3BMr/PddQIDAQAB
src/main/resources/bootstrap.yml
View file @
39f1127f
...
...
@@ -6,7 +6,7 @@ spring:
cloud
:
config
:
# base为所有服务的公共配置,pd-db-system为需要连接的数据库配置,${spring.application.name}为当前程序的配置,3个配置组合才为当前程序的启动配置
name
:
base,tcm-db-system,
pd-redis,pd
-mq-mq,${spring.application.name}
name
:
base,tcm-db-system,
tcm-redis,tcm
-mq-mq,${spring.application.name}
label
:
master
fail-fast
:
true
# 设置从服务中拿取配置
...
...
tcm-prod.cmd
0 → 100644
View file @
39f1127f
@echo off
SET SH=docker rm -f tcm-system;
SET SH=%SH% docker run --name tcm-system -it -d --restart always
SET SH=%SH% -v /home/tcm/conf:/home/java/conf/ -v /home/cache/:/home/cache/ -v /home/tcm/home/pangd/ --net tcm
SET SH=%SH% tcm-system:latest --spring.profiles.active=prod --yzg.config.url=/home/java/conf/pd_all.properties
if 1 equ 1 (
java_docker -ssh root@47.109.75.125 -sh "%SH%"
)
@echo on
\ No newline at end of file
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