Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
tianjin-cement
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
竹天卫
tianjin-cement
Commits
7bcee9e9
Commit
7bcee9e9
authored
Aug 18, 2020
by
zhutianwei@hyzcservice.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
天津院项目 配置管理
parent
b34ddd49
Show whitespace changes
Inline
Side-by-side
Showing
87 changed files
with
2939 additions
and
848 deletions
+2939
-848
pom.xml
cement-business/pom.xml
+17
-6
GlobalDefaultExceptionHandler.java
...cement/business/config/GlobalDefaultExceptionHandler.java
+2
-2
Swagger2Configuration.java
...wise/sc/cement/business/config/Swagger2Configuration.java
+42
-22
ClientController.java
.../wise/sc/cement/business/controller/ClientController.java
+139
-0
MethodController.java
.../wise/sc/cement/business/controller/MethodController.java
+126
-0
ProjectController.java
...wise/sc/cement/business/controller/ProjectController.java
+130
-0
SysCouponController.java
...se/sc/cement/business/controller/SysCouponController.java
+0
-160
SysEnterpriseController.java
...c/cement/business/controller/SysEnterpriseController.java
+0
-178
SysGroupController.java
...ise/sc/cement/business/controller/SysGroupController.java
+127
-0
SysUserController.java
...wise/sc/cement/business/controller/SysUserController.java
+4
-6
TeamController.java
...cn/wise/sc/cement/business/controller/TeamController.java
+130
-0
WeiXinController.java
.../wise/sc/cement/business/controller/WeiXinController.java
+53
-0
Client.java
...c/main/java/cn/wise/sc/cement/business/entity/Client.java
+6
-7
Method.java
...c/main/java/cn/wise/sc/cement/business/entity/Method.java
+66
-0
Project.java
.../main/java/cn/wise/sc/cement/business/entity/Project.java
+7
-8
SysEnterprise.java
...java/cn/wise/sc/cement/business/entity/SysEnterprise.java
+0
-120
SysGroup.java
...main/java/cn/wise/sc/cement/business/entity/SysGroup.java
+39
-0
SysUser.java
.../main/java/cn/wise/sc/cement/business/entity/SysUser.java
+41
-14
Team.java
...src/main/java/cn/wise/sc/cement/business/entity/Team.java
+88
-0
Assert.java
...ain/java/cn/wise/sc/cement/business/exception/Assert.java
+1
-1
BaseException.java
...a/cn/wise/sc/cement/business/exception/BaseException.java
+1
-1
BizException.java
...va/cn/wise/sc/cement/business/exception/BizException.java
+0
-15
BusinessException.java
.../wise/sc/cement/business/exception/BusinessException.java
+12
-37
BusinessExceptionAssert.java
...sc/cement/business/exception/BusinessExceptionAssert.java
+1
-1
BusinessExceptionEnum.java
...e/sc/cement/business/exception/BusinessExceptionEnum.java
+1
-1
BusinessOldException.java
...se/sc/cement/business/exception/BusinessOldException.java
+44
-0
CodeException.java
...a/cn/wise/sc/cement/business/exception/CodeException.java
+2
-2
CodeExceptionAssert.java
...ise/sc/cement/business/exception/CodeExceptionAssert.java
+1
-1
CodeExceptionEnum.java
.../wise/sc/cement/business/exception/CodeExceptionEnum.java
+2
-2
IResponseEnum.java
...a/cn/wise/sc/cement/business/exception/IResponseEnum.java
+1
-1
TokenFilter.java
...n/java/cn/wise/sc/cement/business/filter/TokenFilter.java
+70
-0
ClientMapper.java
.../java/cn/wise/sc/cement/business/mapper/ClientMapper.java
+5
-4
MethodMapper.java
.../java/cn/wise/sc/cement/business/mapper/MethodMapper.java
+21
-0
ProjectMapper.java
...java/cn/wise/sc/cement/business/mapper/ProjectMapper.java
+22
-0
SysGroupMapper.java
...ava/cn/wise/sc/cement/business/mapper/SysGroupMapper.java
+3
-3
SysUserMapper.java
...java/cn/wise/sc/cement/business/mapper/SysUserMapper.java
+16
-0
TeamMapper.java
...in/java/cn/wise/sc/cement/business/mapper/TeamMapper.java
+22
-0
ClientMapper.xml
...va/cn/wise/sc/cement/business/mapper/xml/ClientMapper.xml
+43
-0
MethodMapper.xml
...va/cn/wise/sc/cement/business/mapper/xml/MethodMapper.xml
+28
-0
ProjectMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/ProjectMapper.xml
+32
-0
SysCouponMapper.xml
...cn/wise/sc/cement/business/mapper/xml/SysCouponMapper.xml
+0
-5
SysGroupMapper.xml
.../cn/wise/sc/cement/business/mapper/xml/SysGroupMapper.xml
+1
-1
SysUserMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/SysUserMapper.xml
+1
-1
TeamMapper.xml
...java/cn/wise/sc/cement/business/mapper/xml/TeamMapper.xml
+34
-0
BaseController.java
...java/cn/wise/sc/cement/business/model/BaseController.java
+3
-9
BaseEntity.java
...ain/java/cn/wise/sc/cement/business/model/BaseEntity.java
+2
-2
BaseResponse.java
...n/java/cn/wise/sc/cement/business/model/BaseResponse.java
+2
-2
PageQuery.java
...main/java/cn/wise/sc/cement/business/model/PageQuery.java
+1
-1
PageWrapperQueryMyBatisResolver.java
...ement/business/model/PageWrapperQueryMyBatisResolver.java
+1
-1
WrapperQuery.java
...n/java/cn/wise/sc/cement/business/model/WrapperQuery.java
+1
-1
BaseQuery.java
...ava/cn/wise/sc/cement/business/model/query/BaseQuery.java
+1
-1
ClientQuery.java
...a/cn/wise/sc/cement/business/model/query/ClientQuery.java
+2
-1
MethodQuery.java
...a/cn/wise/sc/cement/business/model/query/MethodQuery.java
+21
-0
ProjectQuery.java
.../cn/wise/sc/cement/business/model/query/ProjectQuery.java
+1
-1
TeamQuery.java
...ava/cn/wise/sc/cement/business/model/query/TeamQuery.java
+21
-0
BaseVo.java
...main/java/cn/wise/sc/cement/business/model/vo/BaseVo.java
+1
-1
ClientVo.java
...in/java/cn/wise/sc/cement/business/model/vo/ClientVo.java
+1
-1
ProjectVo.java
...n/java/cn/wise/sc/cement/business/model/vo/ProjectVo.java
+1
-1
TeamVo.java
...main/java/cn/wise/sc/cement/business/model/vo/TeamVo.java
+60
-0
IClientService.java
...va/cn/wise/sc/cement/business/service/IClientService.java
+17
-7
IMethodService.java
...va/cn/wise/sc/cement/business/service/IMethodService.java
+69
-0
IProjectService.java
...a/cn/wise/sc/cement/business/service/IProjectService.java
+19
-7
ISysEnterpriseService.java
...ise/sc/cement/business/service/ISysEnterpriseService.java
+0
-21
ISysGroupService.java
.../cn/wise/sc/cement/business/service/ISysGroupService.java
+32
-0
ISysUserService.java
...a/cn/wise/sc/cement/business/service/ISysUserService.java
+3
-3
ITeamService.java
...java/cn/wise/sc/cement/business/service/ITeamService.java
+73
-0
ClientServiceImpl.java
...se/sc/cement/business/service/impl/ClientServiceImpl.java
+74
-15
MethodServiceImpl.java
...se/sc/cement/business/service/impl/MethodServiceImpl.java
+133
-0
ProjectServiceImpl.java
...e/sc/cement/business/service/impl/ProjectServiceImpl.java
+72
-15
SysEnterpriseServiceImpl.java
...ement/business/service/impl/SysEnterpriseServiceImpl.java
+0
-37
SysGroupServiceImpl.java
.../sc/cement/business/service/impl/SysGroupServiceImpl.java
+65
-0
TeamServiceImpl.java
...wise/sc/cement/business/service/impl/TeamServiceImpl.java
+172
-0
UserServiceImpl.java
...wise/sc/cement/business/service/impl/UserServiceImpl.java
+28
-0
WeiXinService.java
...n/wise/sc/cement/business/service/impl/WeiXinService.java
+158
-0
ExcelUtil.java
.../main/java/cn/wise/sc/cement/business/util/ExcelUtil.java
+179
-0
JwtUtil.java
...rc/main/java/cn/wise/sc/cement/business/util/JwtUtil.java
+224
-0
Global.java
...n/java/cn/wise/sc/cement/business/util/weixin/Global.java
+36
-0
WeixinInterfaceUtil.java
...e/sc/cement/business/util/weixin/WeixinInterfaceUtil.java
+77
-0
ClientController.java
.../cn/wise/sc/cement/tcdri/controller/ClientController.java
+0
-21
UserController.java
...va/cn/wise/sc/cement/tcdri/controller/UserController.java
+0
-21
BusinessException.java
.../cn/wise/sc/cement/tcdri/exception/BusinessException.java
+0
-19
UserMapper.java
.../main/java/cn/wise/sc/cement/tcdri/mapper/UserMapper.java
+0
-16
UserMapper.xml
...in/java/cn/wise/sc/cement/tcdri/mapper/xml/UserMapper.xml
+0
-5
IUserService.java
...in/java/cn/wise/sc/cement/tcdri/service/IUserService.java
+0
-16
UserServiceImpl.java
...cn/wise/sc/cement/tcdri/service/impl/UserServiceImpl.java
+0
-20
application.yml
cement-business/src/main/resources/application.yml
+6
-2
GeneratorApplication.java
.../main/java/cn/wise/sc/cement/mg/GeneratorApplication.java
+2
-2
No files found.
cement-business/pom.xml
View file @
7bcee9e9
...
...
@@ -91,18 +91,29 @@
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-collections4
</artifactId>
</dependency>
<!--<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
<version>5.3.0</version>
</dependency>-->
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<version>
4.6.8
</version>
</dependency>
<!-- JwtUtil类需要jjwt -->
<dependency>
<groupId>
io.jsonwebtoken
</groupId>
<artifactId>
jjwt
</artifactId>
<version>
0.9.0
</version>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
<version>
23.0
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi
</artifactId>
<version>
3.17
</version>
</dependency>
</dependencies>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/config/GlobalDefaultExceptionHandler.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
config
;
import
cn.wise.sc.cement.business.exception.BusinessException
;
import
cn.wise.sc.cement.business.exception.Business
Old
Exception
;
import
cn.wise.sc.cement.business.wrapper.WrapMapper
;
import
cn.wise.sc.cement.business.wrapper.Wrapper
;
import
org.springframework.boot.autoconfigure.web.servlet.error.AbstractErrorController
;
...
...
@@ -24,7 +24,7 @@ public class GlobalDefaultExceptionHandler extends AbstractErrorController {
@ExceptionHandler
(
value
=
RuntimeException
.
class
)
@ResponseBody
public
Wrapper
defaultErrorHandler
(
HttpServletResponse
response
,
BusinessException
e
)
{
public
Wrapper
defaultErrorHandler
(
HttpServletResponse
response
,
Business
Old
Exception
e
)
{
response
.
setStatus
(
e
.
getStatusCode
().
value
());
return
WrapMapper
.
error
(
e
.
getMessage
());
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/config/Swagger2Configuration.java
View file @
7bcee9e9
...
...
@@ -10,38 +10,58 @@ import org.springframework.web.servlet.handler.MappedInterceptor;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.
ApiInfo
;
import
springfox.documentation.service.
*
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.service.contexts.SecurityContext
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
java.util.List
;
import
static
com
.
google
.
common
.
collect
.
Lists
.
newArrayList
;
@Configuration
@EnableSwagger2
public
class
Swagger2Configuration
{
//api接口包扫描路径
public
static
final
String
SWAGGER_SCAN_BASE_PACKAGE
=
"cn.wise.sc.c
onsume
"
;
public
static
final
String
SWAGGER_SCAN_BASE_PACKAGE
=
"cn.wise.sc.c
ement
"
;
public
static
final
String
VERSION
=
"1.0.0"
;
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
apiInfo
(
apiInfo
())
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
SWAGGER_SCAN_BASE_PACKAGE
))
.
paths
(
PathSelectors
.
any
())
// 可以根据url路径设置哪些请求加入文档,忽略哪些请求
.
build
();
public
Docket
docket
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
).
groupName
(
"swagger接口文档"
)
.
apiInfo
(
new
ApiInfoBuilder
().
title
(
"swagger接口文档"
)
.
contact
(
new
Contact
(
"Wisenergy"
,
"http://www.wisenergy.cn/"
,
"service@wisenergy.cn"
)).
version
(
"1.0"
).
build
())
.
select
().
paths
(
PathSelectors
.
any
()).
build
()
.
securitySchemes
(
newArrayList
(
apiKey
()))
.
securityContexts
(
newArrayList
(
securityContext
()))
.
enableUrlTemplating
(
false
)
;
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
"came"
)
//设置文档的标题
.
description
(
"came接口服务 API 接口文档"
)
// 设置文档的描述
.
version
(
VERSION
)
// 设置文档的版本信息-> 1.0.0 Version information
.
termsOfServiceUrl
(
"http://www.wisenergy.cn"
)
// 设置文档的License信息->1.3 License information
private
ApiKey
apiKey
()
{
return
new
ApiKey
(
"BearerToken"
,
"Authorization"
,
"header"
);
}
private
SecurityContext
securityContext
()
{
return
SecurityContext
.
builder
()
.
securityReferences
(
defaultAuth
())
.
forPaths
(
PathSelectors
.
regex
(
"/.*"
))
.
build
();
}
List
<
SecurityReference
>
defaultAuth
()
{
AuthorizationScope
authorizationScope
=
new
AuthorizationScope
(
"global"
,
"accessEverything"
);
AuthorizationScope
[]
authorizationScopes
=
new
AuthorizationScope
[
1
];
authorizationScopes
[
0
]
=
authorizationScope
;
return
newArrayList
(
new
SecurityReference
(
"BearerToken"
,
authorizationScopes
));
}
@Value
(
"${swagger.basic.username}"
)
private
String
username
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ClientController.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.Client
;
import
cn.wise.sc.cement.business.mapper.ClientMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageTableRequest
;
import
cn.wise.sc.cement.business.model.query.ClientQuery
;
import
cn.wise.sc.cement.business.service.IClientService
;
import
cn.wise.sc.cement.business.util.ExcelUtil
;
import
cn.wise.sc.cement.business.wrapper.WrapMapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2020-08-07
*/
@Api
(
tags
=
"委托单位配置"
)
@RestController
@RequestMapping
(
"/tcdri/client"
)
public
class
ClientController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"ClientController"
);
@Autowired
private
IClientService
clientService
;
@ApiOperation
(
value
=
"委托单位分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态0:禁用 1:启用"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"region"
,
value
=
"所在地区"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"principal"
,
value
=
"负责人名字"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
Integer
status
,
String
region
,
String
principal
)
{
try
{
return
clientService
.
getPage
(
pageQuery
,
status
,
region
,
principal
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"委托单位分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
"委托单位导出"
)
@PostMapping
(
"/export"
)
public
void
export
(
Integer
status
,
String
region
,
String
principal
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
clientService
.
export
(
status
,
region
,
principal
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"委托单位导出{}"
,
e
);
}
}
@ApiOperation
(
value
=
"委托单位详情"
)
@GetMapping
(
"{id}"
)
public
BaseResponse
getById
(
@PathVariable
Integer
id
){
try
{
Client
e
=
clientService
.
getById
(
id
);
if
(
e
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
return
BaseResponse
.
okData
(
e
);
}
catch
(
Exception
e
){
log
.
debug
(
"委托单位详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"获取所有启动的单位信息"
)
@GetMapping
(
"/getList"
)
public
BaseResponse
getList
()
{
try
{
return
clientService
.
getList
();
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取所有启动的单位信息{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"新增委托单位"
)
@PostMapping
(
"/create"
)
public
BaseResponse
create
(
@RequestBody
ClientQuery
clientQuery
){
try
{
return
clientService
.
create
(
clientQuery
);
}
catch
(
Exception
e
){
log
.
debug
(
"新增委托单位{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"更新委托单位"
)
@PostMapping
(
"/update"
)
public
BaseResponse
update
(
@RequestBody
ClientQuery
clientQuery
){
try
{
return
clientService
.
update
(
clientQuery
);
}
catch
(
Exception
e
){
log
.
debug
(
"更新委托单位{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"启用禁用"
)
@PostMapping
(
"/status"
)
public
BaseResponse
status
(
Integer
status
,
Integer
id
){
try
{
return
clientService
.
status
(
status
,
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"启用禁用{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/MethodController.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.entity.Method
;
import
cn.wise.sc.cement.business.entity.Team
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.MethodQuery
;
import
cn.wise.sc.cement.business.model.query.TeamQuery
;
import
cn.wise.sc.cement.business.service.IMethodService
;
import
cn.wise.sc.cement.business.service.ITeamService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2020-08-18
*/
@Api
(
tags
=
"检测方法配置"
)
@RestController
@RequestMapping
(
"/business/method"
)
public
class
MethodController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"MethodController"
);
@Autowired
private
IMethodService
methodService
;
@ApiOperation
(
value
=
"检测方法分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"name"
,
value
=
"标准名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"standard"
,
value
=
"标准号"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
String
name
,
String
standard
)
{
try
{
return
methodService
.
getPage
(
pageQuery
,
name
,
standard
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"检测方法分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
"检测方法导出"
)
@PostMapping
(
"/export"
)
public
void
export
(
String
name
,
String
standard
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
methodService
.
export
(
name
,
standard
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"检测方法导出{}"
,
e
);
}
}
@ApiOperation
(
value
=
"检测方法详情"
)
@GetMapping
(
"{id}"
)
public
BaseResponse
getById
(
@PathVariable
Integer
id
){
try
{
Method
e
=
methodService
.
getById
(
id
);
if
(
e
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
return
BaseResponse
.
okData
(
e
);
}
catch
(
Exception
e
){
log
.
debug
(
"检测方法详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"获取所有检测方法信息"
)
@GetMapping
(
"/getList"
)
public
BaseResponse
getList
()
{
try
{
return
methodService
.
getList
();
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取所有检测方法信息{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"新增检测方法"
)
@PostMapping
(
"/create"
)
public
BaseResponse
create
(
@RequestBody
MethodQuery
query
){
try
{
return
methodService
.
create
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"新增检测方法{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"更新检测方法"
)
@PostMapping
(
"/update"
)
public
BaseResponse
update
(
@RequestBody
MethodQuery
query
){
try
{
return
methodService
.
update
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"更新检测方法{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"删除检测方法"
)
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
){
try
{
return
methodService
.
delete
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"更新检测方法{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ProjectController.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.entity.Client
;
import
cn.wise.sc.cement.business.entity.Project
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageTableRequest
;
import
cn.wise.sc.cement.business.model.query.ClientQuery
;
import
cn.wise.sc.cement.business.model.query.ProjectQuery
;
import
cn.wise.sc.cement.business.service.IProjectService
;
import
cn.wise.sc.cement.business.wrapper.WrapMapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2020-08-07
*/
@Api
(
tags
=
"项目配置"
)
@RestController
@RequestMapping
(
"/tcdri/project"
)
public
class
ProjectController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"ProjectController"
);
@Autowired
private
IProjectService
projectService
;
@ApiOperation
(
value
=
"项目分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态0:禁用 1:启用"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"clientId"
,
value
=
"客户id"
,
paramType
=
"query"
,
dataType
=
"Integer"
)
})
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
Integer
status
,
Integer
clientId
)
{
try
{
return
projectService
.
getPage
(
pageQuery
,
status
,
clientId
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"项目分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
"项目导出"
)
@PostMapping
(
"/export"
)
public
void
export
(
String
code
,
Integer
clientId
,
String
name
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
projectService
.
export
(
code
,
clientId
,
name
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"项目导出{}"
,
e
);
}
}
@ApiOperation
(
value
=
"项目详情"
)
@GetMapping
(
"{id}"
)
public
BaseResponse
getById
(
@PathVariable
Integer
id
){
try
{
Project
e
=
projectService
.
getById
(
id
);
if
(
e
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
return
BaseResponse
.
okData
(
e
);
}
catch
(
Exception
e
){
log
.
debug
(
"项目详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"获取所有启动的项目信息"
)
@GetMapping
(
"/getList"
)
public
BaseResponse
getList
()
{
try
{
return
projectService
.
getList
();
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取所有启动的项目信息{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"新增项目"
)
@PostMapping
(
"/create"
)
public
BaseResponse
create
(
@RequestBody
ProjectQuery
query
){
try
{
return
projectService
.
create
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"新增项目{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"更新项目"
)
@PostMapping
(
"/update"
)
public
BaseResponse
update
(
@RequestBody
ProjectQuery
query
){
try
{
return
projectService
.
update
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"更新项目{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"启用禁用"
)
@PostMapping
(
"/status"
)
public
BaseResponse
status
(
Integer
status
,
Integer
id
){
try
{
return
projectService
.
status
(
status
,
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"启用禁用{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/SysCouponController.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.entity.SysCoupon
;
import
cn.wise.sc.cement.business.mapper.SysCouponMapper
;
import
cn.wise.sc.cement.business.model.PageTableRequest
;
import
cn.wise.sc.cement.business.service.ISysCouponService
;
import
cn.wise.sc.cement.business.wrapper.WrapMapper
;
import
cn.wise.sc.cement.business.wrapper.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2020-06-17
*/
@Api
(
tags
=
"优惠券管理"
)
@RestController
@RequestMapping
(
"/business/sys-coupon"
)
public
class
SysCouponController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"SysCouponController"
);
@Resource
private
SysCouponMapper
couponMapper
;
@Autowired
private
ISysCouponService
couponService
;
@ApiOperation
(
value
=
"优惠券列表(Wrapper实现)"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"current"
,
value
=
"当前页数(从1开始)"
,
paramType
=
"query"
,
dataType
=
"Long"
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"当前每页显示数"
,
paramType
=
"query"
,
dataType
=
"Long"
),
@ApiImplicitParam
(
name
=
"couponName"
,
value
=
"企业名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态:0禁用, 1启用"
,
paramType
=
"query"
,
dataType
=
"Integer"
)
})
@GetMapping
(
"getList"
)
public
Wrapper
getList
(
PageTableRequest
request
,
String
couponName
,
Integer
status
)
{
try
{
QueryWrapper
<
SysCoupon
>
wrapper
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNotBlank
(
couponName
))
{
wrapper
.
like
(
"coupon_name"
,
couponName
);
}
if
(
status
!=
null
)
{
wrapper
.
eq
(
"status"
,
status
);
}
wrapper
.
orderByDesc
(
"create_time"
);
IPage
<
SysCoupon
>
page
=
new
Page
<>(
request
.
getCurrent
(),
request
.
getSize
());
page
=
couponMapper
.
selectPage
(
page
,
wrapper
);
return
WrapMapper
.
wrap
(
200
,
"成功"
,
page
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"优惠券列表{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
@ApiOperation
(
value
=
"添加优惠券"
)
@PostMapping
(
"save"
)
public
Wrapper
save
(
@RequestBody
SysCoupon
coupon
){
try
{
coupon
.
setStatus
(
1
);
coupon
.
setIsDelete
(
1
);
coupon
.
setCreateTime
(
LocalDateTime
.
now
());
couponService
.
save
(
coupon
);
return
WrapMapper
.
wrap
(
200
,
"成功"
);
}
catch
(
Exception
e
){
log
.
debug
(
"添加优惠券{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
@ApiOperation
(
value
=
"修改优惠券"
)
@PostMapping
(
"update"
)
public
Wrapper
update
(
@RequestBody
SysCoupon
coupon
){
try
{
SysCoupon
c
=
couponService
.
getById
(
coupon
.
getId
());
if
(
c
==
null
){
return
WrapMapper
.
wrap
(
400
,
"信息错误"
);
}
couponService
.
updateById
(
coupon
);
return
WrapMapper
.
wrap
(
200
,
"成功"
);
}
catch
(
Exception
e
){
log
.
debug
(
"修改优惠券{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
@ApiOperation
(
value
=
"优惠券详情"
)
@GetMapping
(
"{id}"
)
public
Wrapper
getById
(
@PathVariable
Long
id
){
try
{
SysCoupon
c
=
couponService
.
getById
(
id
);
if
(
c
==
null
){
return
WrapMapper
.
wrap
(
400
,
"信息错误"
);
}
return
WrapMapper
.
wrap
(
200
,
"成功"
,
c
);
}
catch
(
Exception
e
){
log
.
debug
(
"优惠券详情{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
@ApiOperation
(
value
=
"删除优惠券"
)
@DeleteMapping
(
"/{id}"
)
public
Wrapper
delete
(
@PathVariable
Long
id
)
{
try
{
SysCoupon
c
=
couponService
.
getById
(
id
);
if
(
c
==
null
)
{
return
WrapMapper
.
wrap
(
400
,
"优惠券不存在"
);
}
couponService
.
removeById
(
id
);
return
WrapMapper
.
wrap
(
200
,
"成功"
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"删除优惠券{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
@ApiOperation
(
value
=
"领取优惠券"
)
@DeleteMapping
(
"/receive/{id}"
)
public
Wrapper
receive
(
@PathVariable
Long
id
)
{
try
{
SysCoupon
c
=
couponService
.
getById
(
id
);
if
(
c
==
null
)
{
return
WrapMapper
.
wrap
(
400
,
"优惠券不存在"
);
}
c
.
setIsReceive
(
1
);
couponService
.
updateById
(
c
);
return
WrapMapper
.
wrap
(
200
,
"成功"
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"领取优惠券{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/SysEnterpriseController.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.entity.SysEnterprise
;
import
cn.wise.sc.cement.business.mapper.SysEnterpriseMapper
;
import
cn.wise.sc.cement.business.model.PageTableRequest
;
import
cn.wise.sc.cement.business.service.ISysEnterpriseService
;
import
cn.wise.sc.cement.business.util.RedisUtil
;
import
cn.wise.sc.cement.business.wrapper.WrapMapper
;
import
cn.wise.sc.cement.business.wrapper.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2020-06-17
*/
@Api
(
tags
=
"企业管理"
)
@RestController
@RequestMapping
(
"/business/sys-enterprise"
)
public
class
SysEnterpriseController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"SysEnterpriseController"
);
@Autowired
RedisUtil
redisUtil
;
@Autowired
private
ISysEnterpriseService
enterpriseService
;
@Resource
private
SysEnterpriseMapper
enterpriseMapper
;
public
String
redisExample
()
{
redisUtil
.
setString
(
"token"
,
new
Object
(),
2000
);
return
"sucess"
;
}
@ApiOperation
(
value
=
"企业列表(Wrapper实现)"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"current"
,
value
=
"当前页数(从1开始)"
,
paramType
=
"query"
,
dataType
=
"Long"
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"当前每页显示数"
,
paramType
=
"query"
,
dataType
=
"Long"
),
@ApiImplicitParam
(
name
=
"enterpriseName"
,
value
=
"企业名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态:0禁用, 1启用"
,
paramType
=
"query"
,
dataType
=
"Integer"
)
})
@GetMapping
(
"getList"
)
public
Wrapper
getList
(
PageTableRequest
request
,
String
enterpriseName
,
Integer
status
)
{
try
{
QueryWrapper
<
SysEnterprise
>
wrapper
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNotBlank
(
enterpriseName
))
{
wrapper
.
like
(
"enterprise_name"
,
enterpriseName
);
}
if
(
status
!=
null
)
{
wrapper
.
eq
(
"status"
,
status
);
}
wrapper
.
orderByDesc
(
"create_time"
);
IPage
<
SysEnterprise
>
page
=
new
Page
<>(
request
.
getCurrent
(),
request
.
getSize
());
page
=
enterpriseMapper
.
selectPage
(
page
,
wrapper
);
return
WrapMapper
.
wrap
(
200
,
"成功"
,
page
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"企业列表{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
@ApiOperation
(
value
=
"添加企业"
)
@PostMapping
(
"save"
)
public
Wrapper
save
(
@RequestBody
SysEnterprise
enterprise
){
try
{
enterprise
.
setStatus
(
1
);
enterprise
.
setIsDelete
(
1
);
enterprise
.
setCreateTime
(
LocalDateTime
.
now
());
enterpriseService
.
save
(
enterprise
);
return
WrapMapper
.
wrap
(
200
,
"成功"
);
}
catch
(
Exception
e
){
log
.
debug
(
"添加企业{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
@ApiOperation
(
value
=
"修改企业"
)
@PostMapping
(
"update"
)
public
Wrapper
update
(
@RequestBody
SysEnterprise
enterprise
){
try
{
SysEnterprise
e
=
enterpriseService
.
getById
(
enterprise
.
getId
());
if
(
e
==
null
){
return
WrapMapper
.
wrap
(
400
,
"信息错误"
);
}
enterpriseService
.
updateById
(
enterprise
);
return
WrapMapper
.
wrap
(
200
,
"成功"
);
}
catch
(
Exception
e
){
log
.
debug
(
"修改企业{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
@ApiOperation
(
value
=
"企业详情"
)
@GetMapping
(
"{id}"
)
public
Wrapper
getById
(
@PathVariable
Long
id
){
try
{
SysEnterprise
e
=
enterpriseService
.
getById
(
id
);
if
(
e
==
null
){
return
WrapMapper
.
wrap
(
400
,
"信息错误"
);
}
return
WrapMapper
.
wrap
(
200
,
"成功"
,
e
);
}
catch
(
Exception
e
){
log
.
debug
(
"企业详情{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
@ApiOperation
(
value
=
"删除企业"
)
@DeleteMapping
(
"/{id}"
)
public
Wrapper
delete
(
@PathVariable
Long
id
)
{
try
{
SysEnterprise
e
=
enterpriseService
.
getById
(
id
);
if
(
e
==
null
)
{
return
WrapMapper
.
wrap
(
400
,
"企业不存在"
);
}
enterpriseService
.
removeById
(
id
);
return
WrapMapper
.
wrap
(
200
,
"成功"
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"删除企业{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
//****************************************************************************************************
/*@ApiOperation(value = "企业列表(自定义sql实现)")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "current", value = "当前页数(从1开始)", paramType = "query", dataType = "Long"),
@ApiImplicitParam(name = "size", value = "当前每页显示数", paramType = "query", dataType = "Long"),
@ApiImplicitParam(name = "enterpriseName", value = "企业名称", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "status", value = "状态:0禁用, 1启用", paramType = "query", dataType = "Integer")
})
@GetMapping("getList1")
public Wrapper getList1(PageTableRequest request, String enterpriseName, Integer status){
try {
Page<SysEnterprise> page = new Page<>(request.getCurrent(), request.getSize());
Map<String, Object> map = new HashMap<>();
map.put("enterpriseName", enterpriseName);
map.put("status", status);
List<SysEnterprise> enterpriseList = enterpriseService.getPage(map);
page.setRecords(enterpriseList).setTotal(enterpriseList.size());
return WrapMapper.wrap(200,"成功",page);
}catch (Exception e){
log.debug("企业列表{}",e);
}
return WrapMapper.error("失败");
}*/
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/SysGroupController.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.Method
;
import
cn.wise.sc.cement.business.entity.SysGroup
;
import
cn.wise.sc.cement.business.entity.Team
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.TeamQuery
;
import
cn.wise.sc.cement.business.service.ISysGroupService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2020-08-18
*/
@Api
(
tags
=
"组别管理"
)
@RestController
@RequestMapping
(
"/business/sys-group"
)
public
class
SysGroupController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"SysGroupController"
);
@Autowired
private
ISysGroupService
groupService
;
@ApiOperation
(
value
=
"组别分页列表"
)
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
)
{
try
{
return
groupService
.
getPage
(
pageQuery
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"组别分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"组别详情"
)
@GetMapping
(
"{id}"
)
public
BaseResponse
getById
(
@PathVariable
Integer
id
){
try
{
SysGroup
e
=
groupService
.
getById
(
id
);
if
(
e
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
return
BaseResponse
.
okData
(
e
);
}
catch
(
Exception
e
){
log
.
debug
(
"组别详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"获取组别信息"
)
@GetMapping
(
"/getList"
)
public
BaseResponse
getList
()
{
try
{
return
groupService
.
getList
();
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取组别信息{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"新增"
)
@PostMapping
(
"/create"
)
public
BaseResponse
create
(
@RequestBody
SysGroup
query
){
try
{
return
groupService
.
create
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"新增{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"更新"
)
@PostMapping
(
"/update"
)
public
BaseResponse
update
(
@RequestBody
SysGroup
query
){
try
{
return
groupService
.
update
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"更新{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri/controller/Project
Controller.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business/controller/SysUser
Controller.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
controller
;
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
...
...
@@ -11,11 +9,11 @@ import org.springframework.web.bind.annotation.RestController;
* </p>
*
* @author ztw
* @since 2020-08-
07
* @since 2020-08-
14
*/
@RestController
@RequestMapping
(
"/tcdri/
project
"
)
public
class
Project
Controller
{
@RequestMapping
(
"/tcdri/
sys-user
"
)
public
class
SysUser
Controller
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/TeamController.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.entity.Project
;
import
cn.wise.sc.cement.business.entity.Team
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageTableRequest
;
import
cn.wise.sc.cement.business.model.query.ProjectQuery
;
import
cn.wise.sc.cement.business.model.query.TeamQuery
;
import
cn.wise.sc.cement.business.service.ITeamService
;
import
cn.wise.sc.cement.business.wrapper.WrapMapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2020-08-18
*/
@Api
(
tags
=
"检测项配置"
)
@RestController
@RequestMapping
(
"/business/team"
)
public
class
TeamController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"TeamController"
);
@Autowired
private
ITeamService
teamService
;
@ApiOperation
(
value
=
"检测项分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态0:禁用 1:启用"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"gourpId"
,
value
=
"所在分组id"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"检测项目名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
Integer
status
,
Integer
gourpId
,
String
name
)
{
try
{
return
teamService
.
getPage
(
pageQuery
,
status
,
gourpId
,
name
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"检测项分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
"检测项导出"
)
@PostMapping
(
"/export"
)
public
void
export
(
Integer
status
,
Integer
gourpId
,
String
name
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
teamService
.
export
(
status
,
gourpId
,
name
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"检测项导出{}"
,
e
);
}
}
@ApiOperation
(
value
=
"检测项详情"
)
@GetMapping
(
"{id}"
)
public
BaseResponse
getById
(
@PathVariable
Integer
id
){
try
{
Team
e
=
teamService
.
getById
(
id
);
if
(
e
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
return
BaseResponse
.
okData
(
e
);
}
catch
(
Exception
e
){
log
.
debug
(
"检测项详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"获取所有启动的检测项信息"
)
@GetMapping
(
"/getList"
)
public
BaseResponse
getList
()
{
try
{
return
teamService
.
getList
();
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取所有启动的检测项信息{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"新增检测项"
)
@PostMapping
(
"/create"
)
public
BaseResponse
create
(
@RequestBody
TeamQuery
query
){
try
{
return
teamService
.
create
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"新增检测项{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"更新检测项"
)
@PostMapping
(
"/update"
)
public
BaseResponse
update
(
@RequestBody
TeamQuery
query
){
try
{
return
teamService
.
update
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"更新检测项{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"启用禁用"
)
@PostMapping
(
"/status"
)
public
BaseResponse
status
(
Integer
status
,
Integer
id
){
try
{
return
teamService
.
status
(
status
,
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"启用禁用{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/WeiXinController.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.service.impl.WeiXinService
;
import
cn.wise.sc.cement.business.wrapper.WrapMapper
;
import
cn.wise.sc.cement.business.wrapper.Wrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
@Api
(
tags
=
"微信接口"
)
@RestController
@RequestMapping
(
"/tcdri/weixin"
)
public
class
WeiXinController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"WeiXinController"
);
@Autowired
private
WeiXinService
weiXinService
;
@ApiOperation
(
value
=
"获取登录token"
)
@GetMapping
(
"/getToken"
)
public
Wrapper
getToken
(
String
code
){
try
{
Wrapper
wrapper
=
weiXinService
.
getToken
(
code
);
return
wrapper
;
}
catch
(
Exception
e
){
log
.
debug
(
"获取登录token{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
@ApiOperation
(
value
=
"当前登录用户"
)
@GetMapping
(
"/getLoginUser"
)
public
Wrapper
getLoginUser
(
HttpServletRequest
request
){
try
{
Wrapper
wrapper
=
weiXinService
.
getLoginUser
(
request
);
return
wrapper
;
}
catch
(
Exception
e
){
log
.
debug
(
"获取登录token{}"
,
e
);
}
return
WrapMapper
.
error
(
"失败"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/entity/Client.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/entity/Client.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
entity
;
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
cn.wise.sc.cement.
tcdri
.model.BaseEntity
;
import
cn.wise.sc.cement.
tcdri
.model.query.ClientQuery
;
import
cn.wise.sc.cement.
tcdri
.model.vo.ClientVo
;
import
cn.wise.sc.cement.
business
.model.BaseEntity
;
import
cn.wise.sc.cement.
business
.model.query.ClientQuery
;
import
cn.wise.sc.cement.
business
.model.vo.ClientVo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.beans.BeanUtils
;
import
java.io.Serializable
;
/**
* <p>
* 委托单位
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/
SysCoupon
.java
→
cement-business/src/main/java/cn/wise/sc/cement/business/entity/
Method
.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
java.math.BigDecimal
;
import
cn.wise.sc.cement.business.model.query.MethodQuery
;
import
cn.wise.sc.cement.business.model.query.TeamQuery
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
java.time.LocalDate
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.beans.BeanUtils
;
/**
* <p>
...
...
@@ -16,72 +17,50 @@ import lombok.experimental.Accessors;
* </p>
*
* @author ztw
* @since 2020-0
6-17
* @since 2020-0
8-18
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
SysCoupon
implements
Serializable
{
public
class
Method
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
public
static
Method
crate
(
MethodQuery
query
)
{
Method
newObj
=
new
Method
();
BeanUtils
.
copyProperties
(
query
,
newObj
);
return
newObj
;
}
/**
* 优惠券名称
*/
private
String
couponName
;
/**
* 企业表id
*/
private
Double
enterpriseId
;
/**
* 优惠金额
*/
private
BigDecimal
couponMoney
;
/**
* 使用范围
*/
private
String
useScope
;
/**
* 活动开始时间
*/
private
LocalDate
startDate
;
/**
* 活动结束时间
*/
private
LocalDate
endDate
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
/**
*
是否领取:0未领取,1已领取
*
检测标准名
*/
private
Integer
isReceiv
e
;
private
String
nam
e
;
/**
*
状态(0禁用,1启用)
*
标准号
*/
private
Integer
status
;
private
String
standard
;
/**
*
创建时间
*
编号
*/
private
LocalDateTime
createTime
;
private
String
number
;
/**
*
是否删除(0删除,1存在)
*
实施日期
*/
private
Integer
isDele
te
;
private
LocalDate
doDa
te
;
/**
*
备注
*
更新日期
*/
private
String
remark
;
private
LocalDate
upDate
;
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/entity/Project.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/entity/Project.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
entity
;
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
cn.wise.sc.cement.
tcdri
.model.BaseEntity
;
import
cn.wise.sc.cement.
tcdri
.model.query.ProjectQuery
;
import
cn.wise.sc.cement.
tcdri
.model.vo.ProjectVo
;
import
cn.wise.sc.cement.
business
.model.BaseEntity
;
import
cn.wise.sc.cement.
business
.model.query.ProjectQuery
;
import
cn.wise.sc.cement.
business
.model.vo.ProjectVo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.beans.BeanUtils
;
import
java.io.Serializable
;
/**
* <p>
*
委托
项目
* 项目
* </p>
*
* @author ztw
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/SysEnterprise.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
java.math.BigDecimal
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <p>
*
* </p>
*
* @author ztw
* @since 2020-06-17
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
SysEnterprise
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 企业名称
*/
@ApiModelProperty
(
"xxx"
)
private
String
enterpriseName
;
/**
* 企业成立年限
*/
@ApiModelProperty
(
"xxx"
)
private
Double
years
;
/**
* 注册资金
*/
@ApiModelProperty
(
"xxx"
)
private
BigDecimal
registerCapital
;
/**
* 经营范围
*/
@ApiModelProperty
(
"xxx"
)
private
String
businessScope
;
/**
* 经营产品或者服务
*/
private
String
product
;
/**
* 希望入驻的模块(会员、商圈、物业、出行)
*/
private
String
modular
;
/**
* 联系人姓名
*/
private
String
contacts
;
/**
* 联系人电话
*/
private
String
phone
;
/**
* 联系人邮箱
*/
private
String
email
;
/**
* 200字以内推荐理由
*/
private
String
recommendReason
;
/**
* 租户logo
*/
private
String
logo
;
/**
* 状态(0禁用,1启用)
*/
private
Integer
status
;
/**
* 创建时间
*/
private
LocalDateTime
createTime
;
/**
* 租户地址
*/
private
String
address
;
/**
* 是否删除(0删除,1存在)
*/
private
Integer
isDelete
;
private
String
remark
;
/**
* 企业app企业ID
*/
private
String
coridc
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/SysGroup.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <p>
*
* </p>
*
* @author ztw
* @since 2020-08-18
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
SysGroup
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
/**
* 组别名称
*/
private
String
name
;
/**
* 状态 0:禁用 1:激活
*/
private
Boolean
status
;
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri/entity/
User.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business/entity/Sys
User.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
entity
;
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
cn.wise.sc.cement.tcdri.model.BaseEntity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
/**
* <p>
*
人员
*
* </p>
*
* @author ztw
* @since 2020-08-
07
* @since 2020-08-
14
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
User
extends
BaseEntity
implements
Serializable
{
public
class
SysUser
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -64,12 +64,12 @@ public class User extends BaseEntity implements Serializable {
private
String
qualifications
;
/**
* 状态
* 状态
(0禁用,1启用)
*/
private
Boolean
status
;
/**
*
当前
工作年限
* 工作年限
*/
private
Double
workYear
;
...
...
@@ -89,12 +89,39 @@ public class User extends BaseEntity implements Serializable {
private
String
email
;
/**
* 从事本
专业开始时间
* 从事本
技术领域日期
*/
private
Date
majorStart
;
private
LocalDate
technologyDate
;
/**
*
* 从事本技术领域年限
*/
private
Double
technologyYear
;
/**
* 文化程度
*/
private
String
education
;
/**
* (0删除,1正常)
*/
private
Double
majorYear
;
private
Integer
isDelete
;
/**
* 创建时间
*/
private
LocalDateTime
createTime
;
/**
* 修改时间
*/
private
LocalDateTime
updateTime
;
/**
* 备注
*/
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/Team.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
java.math.BigDecimal
;
import
cn.wise.sc.cement.business.model.BaseEntity
;
import
cn.wise.sc.cement.business.model.query.ProjectQuery
;
import
cn.wise.sc.cement.business.model.query.TeamQuery
;
import
cn.wise.sc.cement.business.model.vo.ClientVo
;
import
cn.wise.sc.cement.business.model.vo.TeamVo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.beans.BeanUtils
;
/**
* <p>
* 检测项
* </p>
*
* @author ztw
* @since 2020-08-18
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
Team
extends
BaseEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
public
static
Team
crate
(
TeamQuery
query
)
{
Team
newObj
=
new
Team
();
BeanUtils
.
copyProperties
(
query
,
newObj
);
newObj
.
setStatus
(
true
);
return
newObj
;
}
@Override
public
TeamVo
toVo
()
{
TeamVo
teamVo
=
new
TeamVo
();
BeanUtils
.
copyProperties
(
this
,
teamVo
,
"status"
);
teamVo
.
setStatus
(
this
.
getStatus
()
?
"启用"
:
"禁用"
);
return
teamVo
;
}
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
/**
* 检测项目
*/
private
String
name
;
/**
* 分组
*/
private
Integer
groupId
;
/**
* 检测依据
*/
private
String
basis
;
/**
* 收费标准
*/
private
BigDecimal
charge
;
/**
* 建议产值
*/
private
BigDecimal
proCharge
;
/**
* 资质范围
*/
private
String
qualifications
;
/**
* 状态 0:禁用 1:激活
*/
private
Boolean
status
;
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/exception/Assert.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/exception/Assert.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
exception
;
package
cn
.
wise
.
sc
.
cement
.
business
.
exception
;
import
cn.hutool.core.util.StrUtil
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/exception/BaseException.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/exception/BaseException.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
exception
;
package
cn
.
wise
.
sc
.
cement
.
business
.
exception
;
/**
* @description: 基础异常
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/exception/BizException.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
business
.
exception
;
/**
* 根据业务定制的具体异常类
* @author shulidong
* @since 2019/2/19/0019 16:45
*/
public
class
BizException
extends
BusinessException
{
public
BizException
(
String
message
)
{
super
(
message
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/exception/BusinessException.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
exception
;
import
org.springframework.http.HttpStatus
;
/**
* @author shulidong
* @since 2019/2/19/0019 16:48
* @description: 业务方面的异常
* @author: qh
* @create: 2020-05-15 15:28
**/
public
abstract
class
BusinessException
extends
RuntimeException
{
protected
HttpStatus
statusCode
=
HttpStatus
.
INTERNAL_SERVER_ERROR
;
private
String
errorCode
;
public
class
BusinessException
extends
BaseException
{
private
static
final
long
serialVersionUID
=
1L
;
public
HttpStatus
getStatusCode
()
{
return
statusCode
;
}
public
void
setStatusCode
(
HttpStatus
statusCode
)
{
this
.
statusCode
=
statusCode
;
}
public
BusinessException
(
String
errorCode
,
String
message
)
{
super
(
message
);
this
.
errorCode
=
errorCode
;
public
BusinessException
(
IResponseEnum
responseEnum
,
Object
[]
args
,
String
message
)
{
super
(
responseEnum
,
args
,
message
);
}
public
BusinessException
(
String
message
,
Throwable
e
)
{
super
(
message
,
e
);
}
public
BusinessException
(
String
message
)
{
super
(
message
);
}
public
String
getErrorCode
()
{
return
errorCode
;
}
public
void
setErrorCode
(
String
errorCode
)
{
this
.
errorCode
=
errorCode
;
public
BusinessException
(
IResponseEnum
responseEnum
,
Object
[]
args
,
String
message
,
Throwable
cause
)
{
super
(
responseEnum
,
args
,
message
,
cause
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/exception/BusinessExceptionAssert.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/exception/BusinessExceptionAssert.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
exception
;
package
cn
.
wise
.
sc
.
cement
.
business
.
exception
;
import
java.text.MessageFormat
;
import
java.util.Date
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/exception/BusinessExceptionEnum.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/exception/BusinessExceptionEnum.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
exception
;
package
cn
.
wise
.
sc
.
cement
.
business
.
exception
;
import
lombok.Getter
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/exception/BusinessOldException.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
exception
;
import
org.springframework.http.HttpStatus
;
/**
* @author shulidong
* @since 2019/2/19/0019 16:48
**/
public
abstract
class
BusinessOldException
extends
RuntimeException
{
protected
HttpStatus
statusCode
=
HttpStatus
.
INTERNAL_SERVER_ERROR
;
private
String
errorCode
;
public
HttpStatus
getStatusCode
()
{
return
statusCode
;
}
public
void
setStatusCode
(
HttpStatus
statusCode
)
{
this
.
statusCode
=
statusCode
;
}
public
BusinessOldException
(
String
errorCode
,
String
message
)
{
super
(
message
);
this
.
errorCode
=
errorCode
;
}
public
BusinessOldException
(
String
message
,
Throwable
e
)
{
super
(
message
,
e
);
}
public
BusinessOldException
(
String
message
)
{
super
(
message
);
}
public
String
getErrorCode
()
{
return
errorCode
;
}
public
void
setErrorCode
(
String
errorCode
)
{
this
.
errorCode
=
errorCode
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/exception/CodeException.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/exception/CodeException.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
exception
;
package
cn
.
wise
.
sc
.
cement
.
business
.
exception
;
/**
* @description: 代码错误
* @author: qh
* @create: 2020-07-09 16:07
**/
public
class
CodeException
extends
BaseException
{
public
class
CodeException
extends
BaseException
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/exception/CodeExceptionAssert.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/exception/CodeExceptionAssert.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
exception
;
package
cn
.
wise
.
sc
.
cement
.
business
.
exception
;
import
java.text.MessageFormat
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/exception/CodeExceptionEnum.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/exception/CodeExceptionEnum.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
exception
;
package
cn
.
wise
.
sc
.
cement
.
business
.
exception
;
import
lombok.Getter
;
...
...
@@ -8,7 +8,7 @@ import lombok.Getter;
* @create: 2020-07-09 16:09
**/
@Getter
public
enum
CodeExceptionEnum
implements
CodeExceptionAssert
{
public
enum
CodeExceptionEnum
implements
CodeExceptionAssert
{
OBJECT_NOT_EMPTY
(
6001
,
"{0} is NULL!"
),
STRING_NOT_EMPTY
(
6001
,
"{0} is Empty!"
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/exception/IResponseEnum.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/exception/IResponseEnum.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
exception
;
package
cn
.
wise
.
sc
.
cement
.
business
.
exception
;
/**
* @description: 公共属性接口 提供公共属性
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/filter/TokenFilter.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
filter
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.Map
;
import
javax.servlet.FilterChain
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
cn.wise.sc.cement.business.exception.BusinessException
;
import
cn.wise.sc.cement.business.util.JwtUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.filter.OncePerRequestFilter
;
/**
* Token过滤器
*
* @author zhutianwei
*
*/
@Component
public
class
TokenFilter
extends
OncePerRequestFilter
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"WeiXinService"
);
public
static
final
String
TOKEN_KEY
=
"Authorization"
;
@Override
protected
void
doFilterInternal
(
HttpServletRequest
request
,
HttpServletResponse
response
,
FilterChain
filterChain
)
throws
ServletException
,
IOException
{
String
token
=
getToken
(
request
);
if
(
StringUtils
.
isNotBlank
(
token
))
{
Map
map
=
null
;
try
{
map
=
JwtUtil
.
parserToken
(
token
);
//过期时间
Long
gqTime
=
Long
.
valueOf
(
map
.
get
(
"timeStamp"
).
toString
())+
60
*
60
*
1000
;
long
nowTime
=
(
new
Date
()).
getTime
();
if
(
nowTime
>
gqTime
){
log
.
error
(
"token过期"
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
filterChain
.
doFilter
(
request
,
response
);
}
/**
* 根据参数或者header获取token
*
* @param request
* @return
*/
public
static
String
getToken
(
HttpServletRequest
request
)
{
String
token
=
request
.
getParameter
(
TOKEN_KEY
);
if
(
StringUtils
.
isBlank
(
token
))
{
token
=
request
.
getHeader
(
TOKEN_KEY
);
}
return
token
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/
SysEnterprise
Mapper.java
→
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/
Client
Mapper.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.
SysEnterprise
;
import
cn.wise.sc.cement.business.entity.
Client
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -13,11 +13,12 @@ import java.util.Map;
* </p>
*
* @author ztw
* @since 2020-0
6-1
7
* @since 2020-0
8-0
7
*/
public
interface
ClientMapper
extends
BaseMapper
<
Client
>
{
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
public
interface
SysEnterpriseMapper
extends
BaseMapper
<
SysEnterprise
>
{
List
<
SysEnterprise
>
getPage
(
@Param
(
"map"
)
Map
<
String
,
Object
>
map
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/MethodMapper.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.Method
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author ztw
* @since 2020-08-18
*/
public
interface
MethodMapper
extends
BaseMapper
<
Method
>
{
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/mapper/ProjectMapper.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/mapper/ProjectMapper.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
mapper
;
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.
tcdri
.entity.Project
;
import
cn.wise.sc.cement.
business
.entity.Project
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -13,4 +17,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
ProjectMapper
extends
BaseMapper
<
Project
>
{
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/Sys
Coupon
Mapper.java
→
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/Sys
Group
Mapper.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.Sys
Coupon
;
import
cn.wise.sc.cement.business.entity.Sys
Group
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
...
...
@@ -9,8 +9,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author ztw
* @since 2020-0
6-17
* @since 2020-0
8-18
*/
public
interface
Sys
CouponMapper
extends
BaseMapper
<
SysCoupon
>
{
public
interface
Sys
GroupMapper
extends
BaseMapper
<
SysGroup
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri/mapper/Client
Mapper.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business/mapper/SysUser
Mapper.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
mapper
;
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.
tcdri.entity.Client
;
import
cn.wise.sc.cement.
business.entity.SysUser
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
...
...
@@ -9,8 +9,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author ztw
* @since 2020-08-
07
* @since 2020-08-
14
*/
public
interface
ClientMapper
extends
BaseMapper
<
Client
>
{
public
interface
SysUserMapper
extends
BaseMapper
<
SysUser
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/TeamMapper.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.Team
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author ztw
* @since 2020-08-18
*/
public
interface
TeamMapper
extends
BaseMapper
<
Team
>
{
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/ClientMapper.xml
0 → 100644
View file @
7bcee9e9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.ClientMapper"
>
<sql
id=
"where"
>
<where>
<if
test=
"params.status != null and params.status != ''"
>
and t.status = #{params.status}
</if>
<if
test=
"params.region != null and params.region != ''"
>
and t.region = #{params.region}
</if>
<if
test=
"params.principal != null and params.principal != ''"
>
and t.principal like concat('%', #{params.principal}, '%')
</if>
</where>
</sql>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
t.name as 单位名称,
t.principal as 联系人,
t.principal_phone as 联系电话,
t.region as 所在地区,
0 as 项目数,
(
CASE t.status
WHEN 0 THEN '已禁用'
WHEN 1 THEN '已启用'
ELSE NULL
END
) as 状态
FROM client t,(select @i:=0)t
<include
refid=
"where"
/>
ORDER BY t.id DESC
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/
SysEnterprise
Mapper.xml
→
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/
Method
Mapper.xml
View file @
7bcee9e9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.SysEnterpriseMapper"
>
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.MethodMapper"
>
<sql
id=
"where"
>
<where>
<if
test=
"
map.enterpriseName != null and map.enterpriseName
!= ''"
>
and t.
enterprise_name like concat('%', #{map.enterpriseName}, '%')
<if
test=
"
params.standard != null and params.standard
!= ''"
>
and t.
standard = #{params.standard}
</if>
<if
test=
"
map.status != null
"
>
and t.
status = #{map.status}
<if
test=
"
params.name != null and params.name != ''
"
>
and t.
name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select
id=
"getPage"
resultType=
"cn.wise.sc.cement.business.entity.SysEnterprise"
>
select t.* from sys_enterprise t
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
t.name as 检测标准名,
t.standard as 标准号,
t.number as 编号,
t.do_date as 实施日期,
t.up_date as 更新日期
FROM method t ,(select @i:=0)t
<include
refid=
"where"
/>
order by t.create_time desc
ORDER BY t.id DESC
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/ProjectMapper.xml
0 → 100644
View file @
7bcee9e9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.ProjectMapper"
>
<sql
id=
"where"
>
<where>
<if
test=
"params.code != null and params.code != ''"
>
and t.code = #{params.code}
</if>
<if
test=
"params.clientId != null and params.clientId != ''"
>
and t.client_id = #{params.clientId}
</if>
<if
test=
"params.name != null and params.name != ''"
>
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
t.name as 项目名称,
t.code as 项目编号,
cl.name as 所属单位,
FROM project t
left join client cl on cl.id = t.client_id
,(select @i:=0)t
<include
refid=
"where"
/>
ORDER BY t.id DESC
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SysCouponMapper.xml
deleted
100644 → 0
View file @
b34ddd49
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.SysCouponMapper"
>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/
tcdri/mapper/xml/Client
Mapper.xml
→
cement-business/src/main/java/cn/wise/sc/cement/
business/mapper/xml/SysGroup
Mapper.xml
View file @
7bcee9e9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.
tcdri.mapper.Client
Mapper"
>
<mapper
namespace=
"cn.wise.sc.cement.
business.mapper.SysGroup
Mapper"
>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/
tcdri/mapper/xml/Project
Mapper.xml
→
cement-business/src/main/java/cn/wise/sc/cement/
business/mapper/xml/SysUser
Mapper.xml
View file @
7bcee9e9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.
tcdri.mapper.Project
Mapper"
>
<mapper
namespace=
"cn.wise.sc.cement.
business.mapper.SysUser
Mapper"
>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/TeamMapper.xml
0 → 100644
View file @
7bcee9e9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.TeamMapper"
>
<sql
id=
"where"
>
<where>
<if
test=
"params.status != null and params.status != ''"
>
and t.status = #{params.status}
</if>
<if
test=
"params.gourpId != null and params.gourpId != ''"
>
and t.group_id = #{params.gourpId}
</if>
<if
test=
"params.name != null and params.name != ''"
>
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
t.name as 检测项目,
sg.name as 分组,
t.basis as 检测依据,
t.charge as 收费标准,
t.pro_charge as 建议产值,
t.qualifications as 资质范围
FROM team t
left join sys_group sg on cl.id = t.client_id
,(select @i:=0)t
<include
refid=
"where"
/>
ORDER BY t.id DESC
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/BaseController.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/BaseController.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
;
import
cn.hutool.core.lang.func.Func
;
import
cn.wise.sc.cement.tcdri.model.vo.BaseVo
;
import
cn.wise.sc.cement.business.model.vo.BaseVo
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/BaseEntity.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/BaseEntity.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
;
import
cn.wise.sc.cement.
tcdri
.model.vo.BaseVo
;
import
cn.wise.sc.cement.
business
.model.vo.BaseVo
;
/**
* @description:
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/BaseResponse.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/BaseResponse.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
;
import
cn.wise.sc.cement.
tcdri
.exception.BusinessExceptionEnum
;
import
cn.wise.sc.cement.
business
.exception.BusinessExceptionEnum
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/PageQuery.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/PageQuery.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
;
import
io.swagger.annotations.ApiModel
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/PageWrapperQueryMyBatisResolver.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/PageWrapperQueryMyBatisResolver.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/WrapperQuery.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/WrapperQuery.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/query/BaseQuery.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/query/BaseQuery.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
.
query
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
/**
* @description:
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/query/ClientQuery.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/query/ClientQuery.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
.
query
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
lombok.NonNull
;
import
lombok.RequiredArgsConstructor
;
import
javax.validation.constraints.NotEmpty
;
/**
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/MethodQuery.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
/**
* @description:
* @author: qh
* @create: 2020-08-07 15:42
**/
@Data
public
class
MethodQuery
{
private
Integer
id
;
private
String
name
;
private
String
standard
;
private
String
number
;
private
LocalDate
doDate
;
private
LocalDate
upDate
;
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/query/ProjectQuery.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/query/ProjectQuery.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
.
query
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
lombok.Data
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/TeamQuery.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @description:
* @author: qh
* @create: 2020-08-07 15:42
**/
@Data
public
class
TeamQuery
{
private
Integer
id
;
private
String
name
;
private
Integer
groupId
;
private
String
basis
;
private
BigDecimal
charge
;
private
BigDecimal
proCharge
;
private
String
qualifications
;
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/vo/BaseVo.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/vo/BaseVo.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
.
vo
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
/**
* @description:
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/vo/ClientVo.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/vo/ClientVo.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
.
vo
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
lombok.Data
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/model/vo/ProjectVo.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/model/vo/ProjectVo.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
model
.
vo
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
lombok.Data
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/TeamVo.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @description: 检测项Vo
* @author: qh
* @create: 2020-08-07 15:09
**/
@Data
public
class
TeamVo
extends
BaseVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
id
;
/**
* 检测项目
*/
private
String
name
;
/**
* 分组
*/
private
Integer
groupId
;
/**
* 检测依据
*/
private
String
basis
;
/**
* 收费标准
*/
private
BigDecimal
charge
;
/**
* 建议产值
*/
private
BigDecimal
proCharge
;
/**
* 资质范围
*/
private
String
qualifications
;
/**
* 状态 0:禁用 1:激活
*/
private
String
status
;
/**
* 分组名称
*/
private
String
groupName
;
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/service/IClientService.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/service/IClientService.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
service
;
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.
tcdri
.entity.Client
;
import
cn.wise.sc.cement.
tcdri
.model.BaseResponse
;
import
cn.wise.sc.cement.
tcdri
.model.PageQuery
;
import
cn.wise.sc.cement.
tcdri
.model.query.ClientQuery
;
import
cn.wise.sc.cement.
tcdri
.model.vo.ClientVo
;
import
cn.wise.sc.cement.
business
.entity.Client
;
import
cn.wise.sc.cement.
business
.model.BaseResponse
;
import
cn.wise.sc.cement.
business
.model.PageQuery
;
import
cn.wise.sc.cement.
business
.model.query.ClientQuery
;
import
cn.wise.sc.cement.
business
.model.vo.ClientVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -20,7 +21,6 @@ import java.util.List;
*/
public
interface
IClientService
extends
IService
<
Client
>
{
/**
* 获取分页
* @param pageQuery 分页
...
...
@@ -62,4 +62,14 @@ public interface IClientService extends IService<Client> {
* @return Boolean
*/
BaseResponse
<
Boolean
>
status
(
Integer
status
,
Integer
id
);
/**
* 委托单位导出
* @param status 状态
* @param region 所在地
* @param principal 联系人
* @param fileName 文件名称
* @param response
*/
void
export
(
Integer
status
,
String
region
,
String
principal
,
String
fileName
,
HttpServletResponse
response
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IMethodService.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.Method
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.MethodQuery
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2020-08-18
*/
public
interface
IMethodService
extends
IService
<
Method
>
{
/**
* 获取分页
* @param pageQuery
* @param name
* @param standard
* @return
*/
BaseResponse
<
IPage
<
Method
>>
getPage
(
PageQuery
pageQuery
,
String
name
,
String
standard
);
/**
* 获取所有信息
* @return
*/
BaseResponse
<
List
<
Method
>>
getList
();
/**
* 新增
* @param query
* @return
*/
BaseResponse
<
Method
>
create
(
MethodQuery
query
);
/**
* 编辑
* @param query
* @return
*/
BaseResponse
<
Method
>
update
(
MethodQuery
query
);
/**
* 导出
* @param name
* @param standard
* @param fileName
* @param response
*/
void
export
(
String
name
,
String
standard
,
String
fileName
,
HttpServletResponse
response
);
/**
* 删除检测方法
* @param id
* @return
*/
BaseResponse
delete
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/service/IProjectService.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/service/IProjectService.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
service
;
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.tcdri.entity.Project
;
import
cn.wise.sc.cement.tcdri.model.BaseResponse
;
import
cn.wise.sc.cement.tcdri.model.PageQuery
;
import
cn.wise.sc.cement.tcdri.model.query.ProjectQuery
;
import
cn.wise.sc.cement.tcdri.model.vo.ProjectVo
;
import
cn.wise.sc.cement.business.entity.Project
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.ProjectQuery
;
import
cn.wise.sc.cement.business.model.vo.ProjectVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -32,7 +34,7 @@ public interface IProjectService extends IService<Project> {
BaseResponse
<
IPage
<
ProjectVo
>>
getPage
(
PageQuery
pageQuery
,
Integer
status
,
Integer
clientId
);
/**
* 获取所有启动的
单位
信息
* 获取所有启动的
项目
信息
*
* @return List
*/
...
...
@@ -62,4 +64,14 @@ public interface IProjectService extends IService<Project> {
* @return Boolean
*/
BaseResponse
<
Boolean
>
status
(
Integer
status
,
Integer
id
);
/**
* 项目导出
* @param code
* @param clientId
* @param name
* @param fileName
* @param response
*/
void
export
(
String
code
,
Integer
clientId
,
String
name
,
String
fileName
,
HttpServletResponse
response
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/ISysEnterpriseService.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.SysEnterprise
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2020-06-17
*/
public
interface
ISysEnterpriseService
extends
IService
<
SysEnterprise
>
{
List
<
SysEnterprise
>
getPage
(
Map
<
String
,
Object
>
map
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/ISysGroupService.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.SysGroup
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2020-08-18
*/
public
interface
ISysGroupService
extends
IService
<
SysGroup
>
{
BaseResponse
<
IPage
<
SysGroup
>>
getPage
(
PageQuery
pageQuery
);
BaseResponse
<
List
<
SysGroup
>>
getList
();
BaseResponse
<
SysGroup
>
create
(
SysGroup
query
);
BaseResponse
<
SysGroup
>
update
(
SysGroup
query
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/ISys
Coupon
Service.java
→
cement-business/src/main/java/cn/wise/sc/cement/business/service/ISys
User
Service.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.Sys
Coupon
;
import
cn.wise.sc.cement.business.entity.Sys
User
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
...
...
@@ -9,8 +9,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
* </p>
*
* @author ztw
* @since 2020-0
6-17
* @since 2020-0
8-14
*/
public
interface
ISys
CouponService
extends
IService
<
SysCoupon
>
{
public
interface
ISys
UserService
extends
IService
<
SysUser
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/ITeamService.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.Team
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.TeamQuery
;
import
cn.wise.sc.cement.business.model.vo.TeamVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2020-08-18
*/
public
interface
ITeamService
extends
IService
<
Team
>
{
/**
* 获取分页
* @param pageQuery
* @param status
* @param gourpId
* @param name
* @return
*/
BaseResponse
<
IPage
<
TeamVo
>>
getPage
(
PageQuery
pageQuery
,
Integer
status
,
Integer
gourpId
,
String
name
);
/**
* 获取所有启动的信息
* @return
*/
BaseResponse
<
List
<
TeamVo
>>
getList
();
/**
* 新增
* @param query
* @return
*/
BaseResponse
<
TeamVo
>
create
(
TeamQuery
query
);
/**
* 编辑
* @param query
* @return
*/
BaseResponse
<
TeamVo
>
update
(
TeamQuery
query
);
/**
* 启用禁用
* @param status
* @param id
* @return
*/
BaseResponse
<
Boolean
>
status
(
Integer
status
,
Integer
id
);
/**
* 检测项导出
* @param status
* @param gourpId
* @param name
* @param fileName
* @param response
*/
void
export
(
Integer
status
,
Integer
gourpId
,
String
name
,
String
fileName
,
HttpServletResponse
response
);
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/service/impl/ClientServiceImpl.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/service/impl/ClientServiceImpl.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
service
.
impl
;
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.tcdri.entity.Client
;
import
cn.wise.sc.cement.tcdri.entity.Project
;
import
cn.wise.sc.cement.tcdri.exception.BusinessExceptionEnum
;
import
cn.wise.sc.cement.tcdri.mapper.ClientMapper
;
import
cn.wise.sc.cement.tcdri.model.BaseResponse
;
import
cn.wise.sc.cement.tcdri.model.PageQuery
;
import
cn.wise.sc.cement.tcdri.model.query.ClientQuery
;
import
cn.wise.sc.cement.tcdri.model.vo.ClientVo
;
import
cn.wise.sc.cement.tcdri.service.IClientService
;
import
cn.wise.sc.cement.tcdri.service.IProjectService
;
import
cn.wise.sc.cement.business.entity.Client
;
import
cn.wise.sc.cement.business.entity.Project
;
import
cn.wise.sc.cement.business.exception.BusinessExceptionEnum
;
import
cn.wise.sc.cement.business.mapper.ClientMapper
;
import
cn.wise.sc.cement.business.mapper.ProjectMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.ClientQuery
;
import
cn.wise.sc.cement.business.model.vo.ClientVo
;
import
cn.wise.sc.cement.business.service.IClientService
;
import
cn.wise.sc.cement.business.util.ExcelUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -31,13 +41,20 @@ import java.util.stream.Collectors;
@Service
public
class
ClientServiceImpl
extends
ServiceImpl
<
ClientMapper
,
Client
>
implements
IClientService
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"ClientServiceImpl"
);
final
IProjectService
iProjectService
;
ProjectMapper
projectMapper
;
@Resource
private
ClientMapper
clientMapper
;
public
ClientServiceImpl
(
IProjectService
iProjectService
)
{
this
.
iProjectService
=
iProjectService
;
public
ClientServiceImpl
(
ProjectMapper
projectMapper
)
{
this
.
projectMapper
=
projectMapper
;
}
@Override
public
BaseResponse
<
IPage
<
ClientVo
>>
getPage
(
PageQuery
pageQuery
,
Integer
status
,
String
region
,
String
principal
)
{
...
...
@@ -64,7 +81,7 @@ public class ClientServiceImpl extends ServiceImpl<ClientMapper, Client> impleme
BusinessExceptionEnum
.
COLLECTION_NOT_ILLEGAL
.
assertCollectionNotILLEGAL
(
clientIds
);
QueryWrapper
<
Project
>
qwProject
=
new
QueryWrapper
<>();
qwProject
.
in
(
"client_id"
,
clientIds
);
List
<
Project
>
projects
=
iProjectService
.
l
ist
(
qwProject
);
List
<
Project
>
projects
=
projectMapper
.
selectL
ist
(
qwProject
);
List
<
ClientVo
>
rtsRe
=
new
ArrayList
<>(
page
.
getRecords
().
size
());
for
(
Client
client
:
page
.
getRecords
())
{
...
...
@@ -148,4 +165,46 @@ public class ClientServiceImpl extends ServiceImpl<ClientMapper, Client> impleme
int
count
=
this
.
count
(
qw
);
return
count
>
0
;
}
@Override
public
void
export
(
Integer
status
,
String
region
,
String
principal
,
String
fileName
,
HttpServletResponse
response
){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"status"
,
status
);
params
.
put
(
"region"
,
region
);
params
.
put
(
"principal"
,
principal
);
List
<
Map
<
String
,
Object
>>
list
=
clientMapper
.
exportList
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
String
[]
headers
=
new
String
[
map
.
size
()];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"单位名称"
;
headers
[
2
]
=
"联系人"
;
headers
[
3
]
=
"联系电话"
;
headers
[
4
]
=
"所在地区"
;
headers
[
5
]
=
"项目数"
;
headers
[
6
]
=
"状态"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
m
.
get
(
headers
[
j
]).
toString
();
if
(
j
==
0
){
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
datas
.
add
(
objects
);
}
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托单位"
:
fileName
,
headers
,
datas
,
response
);
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/MethodServiceImpl.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.Method
;
import
cn.wise.sc.cement.business.entity.SysGroup
;
import
cn.wise.sc.cement.business.entity.Team
;
import
cn.wise.sc.cement.business.mapper.MethodMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.MethodQuery
;
import
cn.wise.sc.cement.business.model.query.TeamQuery
;
import
cn.wise.sc.cement.business.model.vo.TeamVo
;
import
cn.wise.sc.cement.business.service.IMethodService
;
import
cn.wise.sc.cement.business.util.ExcelUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 服务实现类
* </p>
*
* @author ztw
* @since 2020-08-18
*/
@Service
public
class
MethodServiceImpl
extends
ServiceImpl
<
MethodMapper
,
Method
>
implements
IMethodService
{
@Autowired
private
MethodMapper
methodMapper
;
@Override
public
BaseResponse
<
IPage
<
Method
>>
getPage
(
PageQuery
pageQuery
,
String
name
,
String
standard
)
{
QueryWrapper
<
Method
>
qw
=
new
QueryWrapper
<>();
qw
.
orderByDesc
(
"id"
);
if
(
StrUtil
.
isNotBlank
(
name
))
{
qw
.
like
(
"name"
,
name
);
}
if
(
StrUtil
.
isNotBlank
(
standard
))
{
qw
.
like
(
"standard"
,
standard
);
}
IPage
<
Method
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
this
.
page
(
page
);
return
BaseResponse
.
okData
(
page
);
}
@Override
public
BaseResponse
<
List
<
Method
>>
getList
()
{
QueryWrapper
<
Method
>
qw
=
new
QueryWrapper
<>();
List
<
Method
>
list
=
this
.
list
(
qw
);
return
BaseResponse
.
okData
(
list
);
}
@Override
public
BaseResponse
<
Method
>
create
(
MethodQuery
query
)
{
Method
crate
=
Method
.
crate
(
query
);
this
.
save
(
crate
);
return
BaseResponse
.
okData
(
crate
);
}
@Override
public
BaseResponse
<
Method
>
update
(
MethodQuery
query
)
{
Method
update
=
Method
.
crate
(
query
);
update
.
setId
(
query
.
getId
());
this
.
updateById
(
update
);
return
BaseResponse
.
okData
(
update
);
}
@Override
public
void
export
(
String
name
,
String
standard
,
String
fileName
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"standard"
,
standard
);
params
.
put
(
"name"
,
name
);
List
<
Map
<
String
,
Object
>>
list
=
methodMapper
.
exportList
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
String
[]
headers
=
new
String
[
map
.
size
()];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"检测标准名"
;
headers
[
2
]
=
"标准号"
;
headers
[
3
]
=
"编号"
;
headers
[
4
]
=
"实施日期"
;
headers
[
5
]
=
"更新日期"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
m
.
get
(
headers
[
j
]).
toString
();
if
(
j
==
0
){
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
datas
.
add
(
objects
);
}
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"检测方法"
:
fileName
,
headers
,
datas
,
response
);
}
}
@Override
public
BaseResponse
delete
(
Integer
id
)
{
Method
method
=
methodMapper
.
selectById
(
id
);
if
(
method
==
null
){
return
BaseResponse
.
errorMsg
(
"检测方法不存在"
);
}
methodMapper
.
deleteById
(
id
);
return
BaseResponse
.
okData
(
"删除成功"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/
tcdri
/service/impl/ProjectServiceImpl.java
→
cement-business/src/main/java/cn/wise/sc/cement/
business
/service/impl/ProjectServiceImpl.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
service
.
impl
;
import
cn.wise.sc.cement.tcdri.entity.Client
;
import
cn.wise.sc.cement.tcdri.entity.Project
;
import
cn.wise.sc.cement.tcdri.exception.BusinessExceptionEnum
;
import
cn.wise.sc.cement.tcdri.mapper.ProjectMapper
;
import
cn.wise.sc.cement.tcdri.model.BaseResponse
;
import
cn.wise.sc.cement.tcdri.model.PageQuery
;
import
cn.wise.sc.cement.tcdri.model.query.ProjectQuery
;
import
cn.wise.sc.cement.tcdri.model.vo.ProjectVo
;
import
cn.wise.sc.cement.tcdri.service.IClientService
;
import
cn.wise.sc.cement.tcdri.service.IProjectService
;
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.Client
;
import
cn.wise.sc.cement.business.entity.Project
;
import
cn.wise.sc.cement.business.exception.BusinessExceptionEnum
;
import
cn.wise.sc.cement.business.mapper.ProjectMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.ProjectQuery
;
import
cn.wise.sc.cement.business.model.vo.ProjectVo
;
import
cn.wise.sc.cement.business.service.IClientService
;
import
cn.wise.sc.cement.business.service.IProjectService
;
import
cn.wise.sc.cement.business.util.ExcelUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -30,9 +41,14 @@ import java.util.stream.Collectors;
@Service
public
class
ProjectServiceImpl
extends
ServiceImpl
<
ProjectMapper
,
Project
>
implements
IProjectService
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"ProjectServiceImpl"
);
final
IClientService
iClientService
;
@Resource
private
ProjectMapper
projectMapper
;
public
ProjectServiceImpl
(
IClientService
iClientService
)
{
this
.
iClientService
=
iClientService
;
}
...
...
@@ -103,7 +119,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
@Override
public
BaseResponse
<
ProjectVo
>
update
(
ProjectQuery
query
)
{
//判断名字是否重复
if
(
projectIsExisting
(
query
.
getName
(),
query
.
getClientId
()))
{
return
BaseResponse
.
errorMsg
(
"项目编号已存在!"
);
...
...
@@ -142,4 +157,46 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
}
return
count
>
0
;
}
@Override
public
void
export
(
String
code
,
Integer
clientId
,
String
name
,
String
fileName
,
HttpServletResponse
response
){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"code"
,
code
);
params
.
put
(
"clientId"
,
clientId
);
params
.
put
(
"name"
,
name
);
List
<
Map
<
String
,
Object
>>
list
=
projectMapper
.
exportList
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
String
[]
headers
=
new
String
[
map
.
size
()];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"项目名称"
;
headers
[
2
]
=
"项目编号"
;
headers
[
3
]
=
"所属单位"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
m
.
get
(
headers
[
j
]).
toString
();
if
(
j
==
0
){
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
datas
.
add
(
objects
);
}
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"项目"
:
fileName
,
headers
,
datas
,
response
);
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/SysEnterpriseServiceImpl.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.SysEnterprise
;
import
cn.wise.sc.cement.business.mapper.SysEnterpriseMapper
;
import
cn.wise.sc.cement.business.service.ISysEnterpriseService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 服务实现类
* </p>
*
* @author ztw
* @since 2020-06-17
*/
@Service
public
class
SysEnterpriseServiceImpl
extends
ServiceImpl
<
SysEnterpriseMapper
,
SysEnterprise
>
implements
ISysEnterpriseService
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"SysEnterpriseServiceImpl"
);
@Resource
private
SysEnterpriseMapper
enterpriseMapper
;
@Override
public
List
<
SysEnterprise
>
getPage
(
Map
<
String
,
Object
>
map
)
{
List
<
SysEnterprise
>
enterprise
=
enterpriseMapper
.
getPage
(
map
);
log
.
debug
(
"企业列表{}"
);
return
enterprise
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/SysGroupServiceImpl.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.Method
;
import
cn.wise.sc.cement.business.entity.SysGroup
;
import
cn.wise.sc.cement.business.mapper.SysGroupMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.MethodQuery
;
import
cn.wise.sc.cement.business.service.ISysGroupService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* <p>
* 服务实现类
* </p>
*
* @author ztw
* @since 2020-08-18
*/
@Service
public
class
SysGroupServiceImpl
extends
ServiceImpl
<
SysGroupMapper
,
SysGroup
>
implements
ISysGroupService
{
@Override
public
BaseResponse
<
IPage
<
SysGroup
>>
getPage
(
PageQuery
pageQuery
)
{
QueryWrapper
<
SysGroup
>
qw
=
new
QueryWrapper
<>();
qw
.
orderByDesc
(
"id"
);
IPage
<
SysGroup
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
this
.
page
(
page
);
return
BaseResponse
.
okData
(
page
);
}
@Override
public
BaseResponse
<
List
<
SysGroup
>>
getList
()
{
QueryWrapper
<
SysGroup
>
qw
=
new
QueryWrapper
<>();
List
<
SysGroup
>
list
=
this
.
list
(
qw
);
return
BaseResponse
.
okData
(
list
);
}
@Override
public
BaseResponse
<
SysGroup
>
create
(
SysGroup
query
)
{
query
.
setStatus
(
true
);
this
.
save
(
query
);
return
BaseResponse
.
okData
(
query
);
}
@Override
public
BaseResponse
<
SysGroup
>
update
(
SysGroup
query
)
{
this
.
updateById
(
query
);
return
BaseResponse
.
okData
(
query
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/TeamServiceImpl.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.Client
;
import
cn.wise.sc.cement.business.entity.Project
;
import
cn.wise.sc.cement.business.entity.SysGroup
;
import
cn.wise.sc.cement.business.entity.Team
;
import
cn.wise.sc.cement.business.exception.BusinessExceptionEnum
;
import
cn.wise.sc.cement.business.mapper.ProjectMapper
;
import
cn.wise.sc.cement.business.mapper.SysGroupMapper
;
import
cn.wise.sc.cement.business.mapper.TeamMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.ProjectQuery
;
import
cn.wise.sc.cement.business.model.query.TeamQuery
;
import
cn.wise.sc.cement.business.model.vo.ClientVo
;
import
cn.wise.sc.cement.business.model.vo.ProjectVo
;
import
cn.wise.sc.cement.business.model.vo.TeamVo
;
import
cn.wise.sc.cement.business.service.ITeamService
;
import
cn.wise.sc.cement.business.util.ExcelUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.swagger.annotations.Api
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* <p>
* 服务实现类
* </p>
*
* @author ztw
* @since 2020-08-18
*/
@Service
public
class
TeamServiceImpl
extends
ServiceImpl
<
TeamMapper
,
Team
>
implements
ITeamService
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"TeamServiceImpl"
);
final
TeamMapper
teamMapper
;
@Autowired
private
SysGroupMapper
groupMapper
;
public
TeamServiceImpl
(
TeamMapper
teamMapper
)
{
this
.
teamMapper
=
teamMapper
;
}
@Override
public
BaseResponse
<
IPage
<
TeamVo
>>
getPage
(
PageQuery
pageQuery
,
Integer
status
,
Integer
gourpId
,
String
name
)
{
QueryWrapper
<
Team
>
qw
=
new
QueryWrapper
<>();
qw
.
orderByDesc
(
"id"
);
if
(
status
!=
null
)
{
qw
.
eq
(
"status"
,
status
);
}
if
(
gourpId
!=
null
)
{
qw
.
eq
(
"group_id"
,
gourpId
);
}
if
(
StrUtil
.
isNotBlank
(
name
))
{
qw
.
like
(
"name"
,
name
);
}
IPage
<
Team
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
this
.
page
(
page
);
IPage
<
TeamVo
>
rts
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
//关联组名名
List
<
Team
>
records
=
page
.
getRecords
();
if
(
records
==
null
)
{
return
BaseResponse
.
okData
(
rts
);
}
List
<
TeamVo
>
rtsRe
=
new
ArrayList
<>(
page
.
getRecords
().
size
());
for
(
Team
team
:
page
.
getRecords
())
{
SysGroup
group
=
groupMapper
.
selectById
(
team
.
getGroupId
());
TeamVo
teamVo
=
team
.
toVo
();
teamVo
.
setGroupName
(
group
.
getName
());
rtsRe
.
add
(
teamVo
);
}
rts
.
setRecords
(
rtsRe
);
return
BaseResponse
.
okData
(
rts
);
}
@Override
public
BaseResponse
<
List
<
TeamVo
>>
getList
()
{
QueryWrapper
<
Team
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"status"
,
1
);
List
<
Team
>
list
=
this
.
list
(
qw
);
List
<
TeamVo
>
rts
=
new
ArrayList
<>(
list
.
size
());
list
.
forEach
(
arg
->
{
TeamVo
teamVo
=
new
TeamVo
();
teamVo
.
setId
(
arg
.
getId
());
teamVo
.
setName
(
arg
.
getName
());
rts
.
add
(
teamVo
);
});
return
BaseResponse
.
okData
(
rts
);
}
@Override
public
BaseResponse
<
TeamVo
>
create
(
TeamQuery
query
)
{
Team
crate
=
Team
.
crate
(
query
);
this
.
save
(
crate
);
return
BaseResponse
.
okData
(
crate
.
toVo
());
}
@Override
public
BaseResponse
<
TeamVo
>
update
(
TeamQuery
query
)
{
Team
update
=
Team
.
crate
(
query
);
update
.
setId
(
query
.
getId
());
this
.
updateById
(
update
);
return
BaseResponse
.
okData
(
update
.
toVo
());
}
@Override
public
BaseResponse
<
Boolean
>
status
(
Integer
status
,
Integer
id
)
{
BusinessExceptionEnum
.
BAD_LICENCE_TYPE
.
assertNotNull
(
status
);
BusinessExceptionEnum
.
BAD_LICENCE_TYPE
.
assertNotNull
(
id
);
Team
update
=
new
Team
();
update
.
setId
(
id
);
update
.
setStatus
(
status
==
1
);
return
BaseResponse
.
okData
(
this
.
updateById
(
update
));
}
@Override
public
void
export
(
Integer
status
,
Integer
gourpId
,
String
name
,
String
fileName
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"status"
,
status
);
params
.
put
(
"gourpId"
,
gourpId
);
params
.
put
(
"name"
,
name
);
List
<
Map
<
String
,
Object
>>
list
=
teamMapper
.
exportList
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
String
[]
headers
=
new
String
[
map
.
size
()];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"检测项目"
;
headers
[
2
]
=
"分组"
;
headers
[
3
]
=
"检测依据"
;
headers
[
4
]
=
"收费标准"
;
headers
[
5
]
=
"建议产值"
;
headers
[
6
]
=
"资质范围"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
m
.
get
(
headers
[
j
]).
toString
();
if
(
j
==
0
){
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
datas
.
add
(
objects
);
}
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"检测项"
:
fileName
,
headers
,
datas
,
response
);
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/
SysCoupon
ServiceImpl.java
→
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/
User
ServiceImpl.java
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.Sys
Coupon
;
import
cn.wise.sc.cement.business.mapper.Sys
Coupon
Mapper
;
import
cn.wise.sc.cement.business.service.ISys
Coupon
Service
;
import
cn.wise.sc.cement.business.entity.Sys
User
;
import
cn.wise.sc.cement.business.mapper.Sys
User
Mapper
;
import
cn.wise.sc.cement.business.service.ISys
User
Service
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
...
...
@@ -12,9 +12,17 @@ import org.springframework.stereotype.Service;
* </p>
*
* @author ztw
* @since 2020-0
6-1
7
* @since 2020-0
8-0
7
*/
@Service
public
class
SysCouponServiceImpl
extends
ServiceImpl
<
SysCouponMapper
,
SysCoupon
>
implements
ISysCouponService
{
public
class
UserServiceImpl
extends
ServiceImpl
<
SysUserMapper
,
SysUser
>
implements
ISysUserService
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/WeiXinService.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.SysUser
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
cn.wise.sc.cement.business.util.JwtUtil
;
import
cn.wise.sc.cement.business.util.RedisUtil
;
import
cn.wise.sc.cement.business.util.weixin.Global
;
import
cn.wise.sc.cement.business.util.weixin.WeixinInterfaceUtil
;
import
cn.wise.sc.cement.business.wrapper.WrapMapper
;
import
cn.wise.sc.cement.business.wrapper.Wrapper
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Map
;
@Service
public
class
WeiXinService
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"WeiXinService"
);
@Value
(
"${weixin.corpid}"
)
private
String
corpid
;
@Value
(
"${weixin.corpsecret}"
)
private
String
corpsecret
;
@Autowired
private
ISysUserService
userService
;
@Autowired
RedisUtil
redisUtil
;
/**
* 获取登录token
* @param code
* @return
*/
public
Wrapper
getToken
(
String
code
)
{
if
(
StrUtil
.
isEmpty
(
code
))
{
return
WrapMapper
.
error
(
"code为必填项!"
);
}
System
.
out
.
println
(
"==================code==================="
);
System
.
out
.
println
(
code
);
try
{
String
accessToken
=
getAccessToken
();
String
param
=
"access_token=%s&code=%s"
;
param
=
String
.
format
(
param
,
accessToken
,
code
);
JSONObject
jsonObject
=
WeixinInterfaceUtil
.
doGet
(
Global
.
USERINFOURL
,
param
);
if
(
jsonObject
.
get
(
"errcode"
).
toString
().
equals
(
"40029"
)){
return
WrapMapper
.
error
(
"code失效!"
);
}
String
UserId
=
jsonObject
.
getString
(
"UserId"
);
System
.
out
.
println
(
"==================UserId==================="
);
System
.
out
.
println
(
UserId
);
JSONObject
userJson
=
getUser
(
accessToken
,
UserId
);
QueryWrapper
<
SysUser
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"phone"
,
userJson
.
get
(
"mobile"
));
SysUser
sysUser
=
userService
.
getOne
(
wrapper
);
if
(
sysUser
==
null
){
return
WrapMapper
.
error
(
"非系统用户不允许登录!"
);
}
if
(
sysUser
.
getStatus
()==
false
){
return
WrapMapper
.
error
(
"用户被禁用!"
);
}
if
(
sysUser
.
getIsDelete
()
==
0
){
return
WrapMapper
.
error
(
"用户被删除!"
);
}
//生成token,存入redis
String
token
=
JwtUtil
.
createToken
(
sysUser
.
getId
(),
sysUser
.
getUsername
(),
sysUser
.
getName
(),
sysUser
.
getPhone
());
System
.
out
.
println
(
token
);
redisUtil
.
setString
(
sysUser
.
getId
().
toString
(),
token
,
3600
);
return
WrapMapper
.
wrap
(
200
,
"成功"
,
token
);
}
catch
(
Exception
e
)
{
log
.
error
(
"异常! 参数:{}"
,
code
);
return
WrapMapper
.
error
(
e
.
getMessage
());
}
}
//获取accessToken信息
public
String
getAccessToken
()
{
try
{
String
param
=
"corpid=%s&corpsecret=%s"
;
param
=
String
.
format
(
param
,
corpid
,
corpsecret
);
JSONObject
jsonObject
=
WeixinInterfaceUtil
.
doGet
(
Global
.
ACCESSTOKENURL
,
param
);
String
accessToken
=
jsonObject
.
getString
(
"access_token"
);
System
.
out
.
println
(
"==================accessToken==================="
);
System
.
out
.
println
(
accessToken
);
return
accessToken
;
}
catch
(
Exception
e
)
{
log
.
error
(
"异常! 参数:{}"
,
corpid
);
return
null
;
}
}
//获取用户信息
public
JSONObject
getUser
(
String
accessToken
,
String
userId
)
{
try
{
String
param
=
"access_token=%s&userid=%s"
;
param
=
String
.
format
(
param
,
accessToken
,
userId
);
JSONObject
jsonObject
=
WeixinInterfaceUtil
.
doGet
(
Global
.
USERURL
,
param
);
System
.
out
.
println
(
"==================jsonObject==================="
);
System
.
out
.
println
(
jsonObject
);
return
jsonObject
;
}
catch
(
Exception
e
)
{
log
.
error
(
"异常! 参数:{}"
,
accessToken
+
accessToken
);
return
null
;
}
}
public
Wrapper
getLoginUser
(
HttpServletRequest
request
)
{
try
{
String
token
=
request
.
getHeader
(
"Authorization"
);
System
.
out
.
println
(
"==================Authorization==================="
);
System
.
out
.
println
(
token
);
Map
map
=
JwtUtil
.
parserToken
(
token
);
Object
obj
=
redisUtil
.
getString
(
map
.
get
(
"id"
).
toString
());
if
(
obj
==
null
){
return
WrapMapper
.
error
(
"token过期或失效!"
);
}
return
WrapMapper
.
wrap
(
200
,
"成功"
,
map
);
}
catch
(
Exception
e
)
{
log
.
error
(
"异常"
);
return
WrapMapper
.
error
(
e
.
getMessage
());
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/util/ExcelUtil.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
util
;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.CellStyle
;
import
org.apache.poi.ss.usermodel.Font
;
import
org.apache.poi.ss.usermodel.HorizontalAlignment
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
/**
* excel工具类
*
* @author zhutianwei
*
*/
public
class
ExcelUtil
{
public
static
void
excelLocal
(
String
path
,
String
fileName
,
String
[]
headers
,
List
<
Object
[]>
datas
)
{
Workbook
workbook
=
getWorkbook
(
headers
,
datas
);
if
(
workbook
!=
null
)
{
ByteArrayOutputStream
byteArrayOutputStream
=
null
;
FileOutputStream
fileOutputStream
=
null
;
try
{
byteArrayOutputStream
=
new
ByteArrayOutputStream
();
workbook
.
write
(
byteArrayOutputStream
);
String
suffix
=
".xls"
;
File
file
=
new
File
(
path
+
File
.
separator
+
fileName
+
suffix
);
if
(!
file
.
getParentFile
().
exists
())
{
file
.
getParentFile
().
mkdirs
();
}
fileOutputStream
=
new
FileOutputStream
(
file
);
fileOutputStream
.
write
(
byteArrayOutputStream
.
toByteArray
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
fileOutputStream
!=
null
)
{
fileOutputStream
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
try
{
if
(
byteArrayOutputStream
!=
null
)
{
byteArrayOutputStream
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
try
{
workbook
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
/**
* 导出excel
*
* @param fileName
* @param headers
* @param datas
* @param response
*/
public
static
void
excelExport
(
String
fileName
,
String
[]
headers
,
List
<
Object
[]>
datas
,
HttpServletResponse
response
)
{
Workbook
workbook
=
getWorkbook
(
headers
,
datas
);
if
(
workbook
!=
null
)
{
ByteArrayOutputStream
byteArrayOutputStream
=
null
;
try
{
byteArrayOutputStream
=
new
ByteArrayOutputStream
();
workbook
.
write
(
byteArrayOutputStream
);
String
suffix
=
".xls"
;
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
new
String
((
fileName
+
suffix
).
getBytes
(),
"iso-8859-1"
));
OutputStream
outputStream
=
response
.
getOutputStream
();
outputStream
.
write
(
byteArrayOutputStream
.
toByteArray
());
outputStream
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
byteArrayOutputStream
!=
null
)
{
byteArrayOutputStream
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
try
{
workbook
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
/**
*
* @param headers
* 列头
* @param datas
* 数据
* @return
*/
public
static
Workbook
getWorkbook
(
String
[]
headers
,
List
<
Object
[]>
datas
)
{
Workbook
workbook
=
new
HSSFWorkbook
();
Sheet
sheet
=
workbook
.
createSheet
();
Row
row
=
null
;
Cell
cell
=
null
;
CellStyle
style
=
workbook
.
createCellStyle
();
style
.
setAlignment
(
HorizontalAlignment
.
CENTER_SELECTION
);
Font
font
=
workbook
.
createFont
();
int
line
=
0
,
maxColumn
=
0
;
if
(
headers
!=
null
&&
headers
.
length
>
0
)
{
// 设置列头
row
=
sheet
.
createRow
(
line
++);
row
.
setHeightInPoints
(
23
);
font
.
setBold
(
true
);
font
.
setFontHeightInPoints
((
short
)
13
);
style
.
setFont
(
font
);
maxColumn
=
headers
.
length
;
for
(
int
i
=
0
;
i
<
maxColumn
;
i
++)
{
cell
=
row
.
createCell
(
i
);
cell
.
setCellValue
(
headers
[
i
]);
cell
.
setCellStyle
(
style
);
}
}
if
(
datas
!=
null
&&
datas
.
size
()
>
0
)
{
// 渲染数据
for
(
int
index
=
0
,
size
=
datas
.
size
();
index
<
size
;
index
++)
{
Object
[]
data
=
datas
.
get
(
index
);
if
(
data
!=
null
&&
data
.
length
>
0
)
{
row
=
sheet
.
createRow
(
line
++);
row
.
setHeightInPoints
(
20
);
int
length
=
data
.
length
;
if
(
length
>
maxColumn
)
{
maxColumn
=
length
;
}
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
cell
=
row
.
createCell
(
i
);
cell
.
setCellValue
(
data
[
i
]
==
null
?
null
:
data
[
i
].
toString
());
}
}
}
}
for
(
int
i
=
0
;
i
<
maxColumn
;
i
++)
{
sheet
.
autoSizeColumn
(
i
);
}
return
workbook
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/util/JwtUtil.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
util
;
import
java.security.Key
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.xml.bind.DatatypeConverter
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.alibaba.fastjson.JSONObject
;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.JwtBuilder
;
import
io.jsonwebtoken.Jwts
;
import
io.jsonwebtoken.SignatureAlgorithm
;
import
io.jsonwebtoken.impl.DefaultClaims
;
/**
* 通过 jwt 生成token 及 验证
*
* @author ztw
*/
public
class
JwtUtil
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
JwtUtil
.
class
);
private
static
final
String
SECRET_KEY
=
"_MeD5CiNov0_TecH"
;
/**
* 签名算法
*/
private
static
final
SignatureAlgorithm
DEFAULTSIGN
=
SignatureAlgorithm
.
HS256
;
/**
* 根据用户信息生成 token
* @return
*/
public
static
String
createToken
(
Integer
id
,
String
username
,
String
name
,
String
phone
)
{
Claims
claim
=
new
DefaultClaims
();
// 设置 签发人
long
timeStamp
=
(
new
Date
()).
getTime
();
claim
.
setIssuer
(
"cement"
);
claim
.
put
(
"id"
,
id
);
claim
.
put
(
"username"
,
username
);
claim
.
put
(
"name"
,
name
);
claim
.
put
(
"phone"
,
phone
);
claim
.
put
(
"timeStamp"
,
timeStamp
);
Key
signingKey
=
getKey
(
SECRET_KEY
,
DEFAULTSIGN
.
getJcaName
());
JwtBuilder
builder
=
Jwts
.
builder
().
setClaims
(
claim
).
signWith
(
DEFAULTSIGN
,
signingKey
);
return
builder
.
compact
();
}
/**
* 根据 params 生成 token
*
* @return
*/
public
static
String
createToken
(
JSONObject
params
)
{
Claims
claim
=
new
DefaultClaims
();
// 设置 签发人
long
timeStamp
=
(
new
Date
()).
getTime
();
claim
.
setIssuer
(
"cement"
);
Set
<
String
>
keys
=
params
.
keySet
();
for
(
String
key
:
keys
)
{
claim
.
put
(
key
,
params
.
getString
(
key
));
}
claim
.
put
(
"timeStamp"
,
timeStamp
);
Key
signingKey
=
getKey
(
SECRET_KEY
,
DEFAULTSIGN
.
getJcaName
());
JwtBuilder
builder
=
Jwts
.
builder
().
setClaims
(
claim
).
signWith
(
DEFAULTSIGN
,
signingKey
);
return
builder
.
compact
();
}
/**
* 根据 userId 生成 token
* @param userId
* @return
*/
public
static
String
createToken
(
String
userId
)
{
Claims
claim
=
new
DefaultClaims
();
// claim.setAudience("www.bizconf.cn");// 设置接收方
// 设置 签发人
long
timeStamp
=
(
new
Date
()).
getTime
();
claim
.
setIssuer
(
"goldwind"
);
claim
.
put
(
"userId"
,
userId
);
claim
.
put
(
"timeStamp"
,
timeStamp
);
Key
signingKey
=
getKey
(
SECRET_KEY
,
DEFAULTSIGN
.
getJcaName
());
JwtBuilder
builder
=
Jwts
.
builder
().
setClaims
(
claim
).
signWith
(
DEFAULTSIGN
,
signingKey
);
return
builder
.
compact
();
}
/**
* 该方法使用 HS256 算法和 Secret: 生成signKey
*
* @param key
* @param jcaName
* @return
*/
private
static
Key
getKey
(
String
key
,
String
jcaName
)
{
byte
[]
keyb
=
null
;
if
(
""
.
equals
(
key
)
||
key
==
null
)
{
keyb
=
DatatypeConverter
.
parseBase64Binary
(
SECRET_KEY
);
}
else
{
keyb
=
DatatypeConverter
.
parseBase64Binary
(
key
);
}
String
jcaName1
=
null
;
if
(
""
.
equals
(
jcaName
)
||
jcaName
==
null
)
{
jcaName1
=
DEFAULTSIGN
.
getJcaName
();
}
else
{
jcaName1
=
jcaName
;
}
Key
signKey
=
new
SecretKeySpec
(
keyb
,
jcaName1
);
return
signKey
;
}
/**
* 解析 token
*
* @param token
* @return
*/
public
static
Map
parserToken
(
String
token
)
throws
Exception
{
Claims
claims
=
null
;
claims
=
Jwts
.
parser
().
setSigningKey
(
getKey
(
SECRET_KEY
,
DEFAULTSIGN
.
getJcaName
())).
parseClaimsJws
(
token
)
.
getBody
();
//userid = (String) claims.get("userId");
return
claims
;
}
/**
* 获得userId 如果解析错误返回 -1
*
* @param token
* @return
*/
public
static
String
getUserIdByToken
(
String
token
)
{
Claims
claims
=
null
;
String
userid
=
"-1"
;
try
{
claims
=
Jwts
.
parser
().
setSigningKey
(
getKey
(
SECRET_KEY
,
DEFAULTSIGN
.
getJcaName
())).
parseClaimsJws
(
token
)
.
getBody
();
userid
=
(
String
)
claims
.
get
(
"id"
);
}
catch
(
Exception
e
)
{
LOGGER
.
info
(
"解密userId失败:"
+
token
);
return
userid
;
}
return
userid
;
}
/**
* 获得username 如果解析错误返回 -1
*
* @param token
* @return
*/
public
static
String
getUserNameByToken
(
String
token
)
{
Claims
claims
=
null
;
String
username
=
"-1"
;
try
{
claims
=
Jwts
.
parser
().
setSigningKey
(
getKey
(
SECRET_KEY
,
DEFAULTSIGN
.
getJcaName
())).
parseClaimsJws
(
token
)
.
getBody
();
username
=
(
String
)
claims
.
get
(
"username"
);
}
catch
(
Exception
e
)
{
LOGGER
.
info
(
"解密userId失败:"
+
token
);
return
username
;
}
return
username
;
}
/**
* 获得userId 如果解析错误返回 -1
*
* @param token
* @return
*/
public
static
String
getValueByToken
(
String
token
,
String
value
)
{
Claims
claims
=
null
;
try
{
claims
=
Jwts
.
parser
().
setSigningKey
(
getKey
(
SECRET_KEY
,
DEFAULTSIGN
.
getJcaName
())).
parseClaimsJws
(
token
)
.
getBody
();
value
=
String
.
valueOf
(
claims
.
get
(
value
));
if
(
value
==
null
||
""
.
equals
(
value
))
{
value
=
"-1"
;
return
value
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
value
=
"-1"
;
return
value
;
}
return
value
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
token
=
createToken
(
1
,
"34466"
,
"荀玉龙"
,
"17601636518"
);
System
.
out
.
println
(
token
);
System
.
out
.
println
(
parserToken
(
token
));
System
.
out
.
println
(
getValueByToken
(
token
,
"enterpriseId"
));
System
.
out
.
println
(
getUserIdByToken
(
token
));
long
timeStamp
=
(
long
)
parserToken
(
token
).
get
(
"timeStamp"
);
long
ts
=
System
.
currentTimeMillis
();
if
(
ts
-
timeStamp
>
1000
*
120
)
{
System
.
out
.
println
(
"token超时"
);
}
else
{
System
.
out
.
println
(
"token有效"
);
}
//System.out.println(UUID.randomUUID().toString().replace("-", "").substring(0, 16));
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/util/weixin/Global.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
util
.
weixin
;
/**
* 功能说明:企业微信全局接口地址
* 修改说明:
* @author zhenglibing
* @date 2018年1月8日 下午2:27:43
* @version 0.1
*/
public
interface
Global
{
/**
* 微信公众平台,获取AccessToken的接口地址,Https请求方式:GET
* 接口地址示例:https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=id&corpsecret=secrect
*/
public
static
final
String
ACCESSTOKENURL
=
"https://qyapi.weixin.qq.com/cgi-bin/gettoken"
;
/**
* 微信公众平台,获取访问用户身份的接口地址,Https请求方式:GET
* 接口地址示例:https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=ACCESS_TOKEN&code=CODE
*/
public
static
final
String
USERINFOURL
=
"https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo"
;
/**
* 微信公众平台,获取访问用户信息的接口地址,Https请求方式:GET
* 接口地址示例:https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&userid=USERID
*/
public
static
final
String
USERURL
=
"https://qyapi.weixin.qq.com/cgi-bin/user/get"
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/util/weixin/WeixinInterfaceUtil.java
0 → 100644
View file @
7bcee9e9
package
cn
.
wise
.
sc
.
cement
.
business
.
util
.
weixin
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.*
;
/**
* 艺哚哚对外开放接口 工具类
*/
public
class
WeixinInterfaceUtil
{
private
static
final
String
HOST
=
"https://ydd.whlyj.sh.gov.cn/"
;
//服务器IP与端口
private
static
final
String
APPID
=
"DSACTSYS"
;
private
static
final
String
APPSECRET
=
"uzRpwnG6USeZDR0C"
;
// private static final Long TIMESTAMP = System.currentTimeMillis();
private
static
final
String
NONCE
=
UUID
.
randomUUID
().
toString
();
public
static
void
main
(
String
[]
args
){
String
param
=
"corpid=%s&corpsecret=%s"
;
param
=
String
.
format
(
param
,
"ww348f91b2573c1867"
,
"gFa_7XvXtCaoeAYERzjRwwz_OTJkJfgBb8weOKjmI3o"
);
try
{
JSONObject
jsonObject
=
WeixinInterfaceUtil
.
doGet
(
Global
.
ACCESSTOKENURL
,
param
);
String
accessToken
=
jsonObject
.
getString
(
"access_token"
);
System
.
out
.
println
(
"accessToken"
+
accessToken
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
static
JSONObject
doGet
(
String
url
,
String
param
)
{
String
path
=
url
+
"?"
+
param
;
RestTemplate
restTemplate
=
new
RestTemplate
();
JSONObject
resultMap
=
restTemplate
.
getForObject
(
path
,
JSONObject
.
class
);
return
resultMap
;
}
/**
* 将请求参数放到map里,
* 按照字母请求参数名的字母升序排列非空请求参数(包含 appid)
* @param sortedParams
* @return
*/
private
static
String
getSignContent
(
Map
<
String
,
String
>
sortedParams
)
{
System
.
out
.
println
(
"signData = "
+
JSON
.
toJSONString
(
sortedParams
));
Set
<
String
>
keySet
=
sortedParams
.
keySet
();
StringBuffer
content
=
new
StringBuffer
();
List
<
String
>
keys
=
new
ArrayList
<
String
>();
for
(
String
key
:
keySet
)
{
keys
.
add
(
key
);
}
Collections
.
sort
(
keys
);
int
index
=
0
;
for
(
int
i
=
0
;
i
<
keys
.
size
();
i
++)
{
String
key
=
keys
.
get
(
i
);
String
value
=
sortedParams
.
get
(
key
);
if
(
StringUtils
.
isNotEmpty
(
key
)
&&
StringUtils
.
isNotEmpty
(
value
))
{
content
.
append
((
index
==
0
?
""
:
"&"
)
+
key
+
"="
+
value
);
index
++;
}
}
return
content
.
toString
();
}
}
cement-business/src/main/java/cn/wise/sc/cement/tcdri/controller/ClientController.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2020-08-07
*/
@RestController
@RequestMapping
(
"/tcdri/client"
)
public
class
ClientController
{
}
cement-business/src/main/java/cn/wise/sc/cement/tcdri/controller/UserController.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2020-08-07
*/
@RestController
@RequestMapping
(
"/tcdri/user"
)
public
class
UserController
{
}
cement-business/src/main/java/cn/wise/sc/cement/tcdri/exception/BusinessException.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
exception
;
/**
* @description: 业务方面的异常
* @author: qh
* @create: 2020-05-15 15:28
**/
public
class
BusinessException
extends
BaseException
{
private
static
final
long
serialVersionUID
=
1L
;
public
BusinessException
(
IResponseEnum
responseEnum
,
Object
[]
args
,
String
message
)
{
super
(
responseEnum
,
args
,
message
);
}
public
BusinessException
(
IResponseEnum
responseEnum
,
Object
[]
args
,
String
message
,
Throwable
cause
)
{
super
(
responseEnum
,
args
,
message
,
cause
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/tcdri/mapper/UserMapper.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
mapper
;
import
cn.wise.sc.cement.tcdri.entity.User
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author ztw
* @since 2020-08-07
*/
public
interface
UserMapper
extends
BaseMapper
<
User
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/tcdri/mapper/xml/UserMapper.xml
deleted
100644 → 0
View file @
b34ddd49
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.tcdri.mapper.UserMapper"
>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/tcdri/service/IUserService.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
service
;
import
cn.wise.sc.cement.tcdri.entity.User
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2020-08-07
*/
public
interface
IUserService
extends
IService
<
User
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/tcdri/service/impl/UserServiceImpl.java
deleted
100644 → 0
View file @
b34ddd49
package
cn
.
wise
.
sc
.
cement
.
tcdri
.
service
.
impl
;
import
cn.wise.sc.cement.tcdri.entity.User
;
import
cn.wise.sc.cement.tcdri.mapper.UserMapper
;
import
cn.wise.sc.cement.tcdri.service.IUserService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 服务实现类
* </p>
*
* @author ztw
* @since 2020-08-07
*/
@Service
public
class
UserServiceImpl
extends
ServiceImpl
<
UserMapper
,
User
>
implements
IUserService
{
}
cement-business/src/main/resources/application.yml
View file @
7bcee9e9
server
:
port
:
700
5
port
:
700
7
spring
:
application
:
tianjin-cement
...
...
@@ -33,3 +33,7 @@ mybatis-plus:
check-config-location
:
true
type-aliases-package
:
cn.wise.sc.cement.business.entity.**
mapper-locations
:
classpath:/cn/wise/sc/cement/business/mapper/xml/*Mapper.xml
weixin
:
corpsecret
:
gFa_7XvXtCaoeAYERzjRwwz_OTJkJfgBb8weOKjmI3o
corpid
:
ww348f91b2573c1867
\ No newline at end of file
mybatis-generator/src/main/java/cn/wise/sc/cement/mg/GeneratorApplication.java
View file @
7bcee9e9
...
...
@@ -56,7 +56,7 @@ public class GeneratorApplication {
// 全局配置
GlobalConfig
gc
=
new
GlobalConfig
();
String
projectPath
=
System
.
getProperty
(
"user.dir"
);
gc
.
setOutputDir
(
projectPath
+
"/c
onsume
-business/src/main/java"
);
gc
.
setOutputDir
(
projectPath
+
"/c
ement
-business/src/main/java"
);
gc
.
setAuthor
(
"ztw"
);
gc
.
setOpen
(
false
);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
...
...
@@ -67,7 +67,7 @@ public class GeneratorApplication {
// 包配置
PackageConfig
pc
=
new
PackageConfig
();
pc
.
setModuleName
(
scanner
(
"模块名"
));
pc
.
setParent
(
"cn.wise.sc.c
onsume
"
);
pc
.
setParent
(
"cn.wise.sc.c
ement
"
);
mpg
.
setPackageInfo
(
pc
);
// 自定义配置
...
...
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