Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
dm_project
Commits
17419f89
Commit
17419f89
authored
Dec 21, 2020
by
ysongq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
d8591742
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
155 additions
and
80 deletions
+155
-80
LoginController.java
...z/dm/mall/moduls/controller/customer/LoginController.java
+5
-5
MallCustomerController.java
...ll/moduls/controller/customer/MallCustomerController.java
+10
-3
PersonalUserController.java
...ll/moduls/controller/customer/PersonalUserController.java
+1
-1
ValidateCodeController.java
...ll/moduls/controller/customer/ValidateCodeController.java
+3
-6
MallHotRecommendGoodsDto.java
...s/controller/goods/bean/dto/MallHotRecommendGoodsDto.java
+8
-6
MallCustomerService.java
...va/com/jz/dm/mall/moduls/service/MallCustomerService.java
+6
-0
MallCustomerServiceImpl.java
.../dm/mall/moduls/service/impl/MallCustomerServiceImpl.java
+11
-0
MallHotRecommendGoodsServiceImpl.java
...moduls/service/impl/MallHotRecommendGoodsServiceImpl.java
+6
-1
MallHotRecommendGoodsDao.xml
...rc/main/resources/mapperconf/MallHotRecommendGoodsDao.xml
+1
-1
DepartmentController.java
...nage/moduls/controller/customer/DepartmentController.java
+3
-3
DataGoodsApiController.java
...anage/moduls/controller/goods/DataGoodsApiController.java
+1
-1
LoginController.java
.../com/jz/manage/moduls/controller/sys/LoginController.java
+46
-44
SysUserDto.java
.../jz/manage/moduls/controller/sys/bean/dto/SysUserDto.java
+1
-1
LoginRequest.java
...z/manage/moduls/controller/sys/bean/req/LoginRequest.java
+46
-0
DataGoodsApiService.java
...ava/com/jz/manage/moduls/service/DataGoodsApiService.java
+1
-1
DepartmentService.java
.../java/com/jz/manage/moduls/service/DepartmentService.java
+4
-4
DepartmentServiceImpl.java
.../jz/manage/moduls/service/impl/DepartmentServiceImpl.java
+1
-2
SysUserServiceImpl.java
...com/jz/manage/moduls/service/impl/SysUserServiceImpl.java
+1
-1
No files found.
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/customer/LoginController.java
View file @
17419f89
...
@@ -50,8 +50,8 @@ public class LoginController {
...
@@ -50,8 +50,8 @@ public class LoginController {
@PostMapping
(
value
=
"/login"
)
@PostMapping
(
value
=
"/login"
)
@ApiOperation
(
value
=
"登录功能"
,
notes
=
"登录功能"
)
@ApiOperation
(
value
=
"登录功能"
,
notes
=
"登录功能"
)
public
Result
<
CustomerDto
>
login
(
@RequestBody
LoginRequest
customer
,
HttpServletRequest
request
)
throws
Exception
{
public
Result
<
CustomerDto
>
login
(
@RequestBody
LoginRequest
customer
,
HttpServletRequest
request
)
throws
Exception
{
String
username
=
customer
.
getUsername
();
String
username
=
customer
.
getUsername
();
String
password
=
customer
.
getPassword
();
String
password
=
customer
.
getPassword
();
// 手机
// 手机
String
ph
=
"^[1][34578]\\d{9}$"
;
String
ph
=
"^[1][34578]\\d{9}$"
;
// 如果是手机验证
// 如果是手机验证
...
@@ -84,7 +84,7 @@ public class LoginController {
...
@@ -84,7 +84,7 @@ public class LoginController {
@PostMapping
(
value
=
"/getCode"
)
@PostMapping
(
value
=
"/getCode"
)
@ApiOperation
(
"通过手机号码获取验证码"
)
@ApiOperation
(
"通过手机号码获取验证码"
)
public
Result
loginCheck
(
@RequestParam
(
value
=
"telephone"
)
String
telephone
,
public
Result
loginCheck
(
@RequestParam
(
value
=
"telephone"
)
String
telephone
,
@RequestParam
(
value
=
"validateCode"
)
String
validateCode
)
{
@RequestParam
(
value
=
"validateCode"
)
String
validateCode
)
throws
Exception
{
// 获取手机号码
// 获取手机号码
String
key
=
RedisMessageConstant
.
SENDTYPE_LOGIN
+
"_"
+
telephone
;
String
key
=
RedisMessageConstant
.
SENDTYPE_LOGIN
+
"_"
+
telephone
;
// 获取redis中key对应的值
// 获取redis中key对应的值
...
@@ -110,7 +110,7 @@ public class LoginController {
...
@@ -110,7 +110,7 @@ public class LoginController {
*/
*/
@GetMapping
(
value
=
"/phoneCheck"
)
@GetMapping
(
value
=
"/phoneCheck"
)
@ApiOperation
(
value
=
"手机号码校验接口"
,
notes
=
"手机号码是否已注册"
)
@ApiOperation
(
value
=
"手机号码校验接口"
,
notes
=
"手机号码是否已注册"
)
public
Result
phoneCheck
(
@RequestParam
(
"telephone"
)
String
telephone
)
{
public
Result
phoneCheck
(
@RequestParam
(
"telephone"
)
String
telephone
)
throws
Exception
{
if
(
telephone
==
null
)
{
if
(
telephone
==
null
)
{
return
new
Result
(
false
,
"请重新输入手机号!"
,
StatusCode
.
ERROR
);
return
new
Result
(
false
,
"请重新输入手机号!"
,
StatusCode
.
ERROR
);
}
}
...
@@ -133,7 +133,7 @@ public class LoginController {
...
@@ -133,7 +133,7 @@ public class LoginController {
@GetMapping
(
value
=
"/phoneUserCheck"
)
@GetMapping
(
value
=
"/phoneUserCheck"
)
@ApiOperation
(
value
=
"手机号用户名重复校验接口"
,
notes
=
"手机号用户名是否重复"
)
@ApiOperation
(
value
=
"手机号用户名重复校验接口"
,
notes
=
"手机号用户名是否重复"
)
public
Result
phoneCheck
(
@RequestParam
(
value
=
"username"
)
String
username
,
public
Result
phoneCheck
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"password"
)
String
telephone
,
HttpServletRequest
request
)
{
@RequestParam
(
value
=
"password"
)
String
telephone
,
HttpServletRequest
request
)
throws
Exception
{
String
ph
=
"^[1][34578]\\d{9}$"
;
String
ph
=
"^[1][34578]\\d{9}$"
;
if
(
telephone
.
matches
(
ph
))
{
if
(
telephone
.
matches
(
ph
))
{
MallCustomer
mallCustomer
=
mallCustomerService
.
selectByPhone
(
telephone
);
MallCustomer
mallCustomer
=
mallCustomerService
.
selectByPhone
(
telephone
);
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/customer/MallCustomerController.java
View file @
17419f89
...
@@ -53,7 +53,7 @@ public class MallCustomerController extends BaseController {
...
@@ -53,7 +53,7 @@ public class MallCustomerController extends BaseController {
*/
*/
@PostMapping
(
"/saveCustomer"
)
@PostMapping
(
"/saveCustomer"
)
@ApiOperation
(
value
=
"注册用户"
,
notes
=
"添加用户"
)
@ApiOperation
(
value
=
"注册用户"
,
notes
=
"添加用户"
)
public
Result
saveCustomer
(
@RequestBody
CustomerRequest
customer
,
HttpServletRequest
request
)
{
public
Result
saveCustomer
(
@RequestBody
CustomerRequest
customer
,
HttpServletRequest
request
)
throws
Exception
{
if
(!
StringUtils
.
isEmpty
(
customer
))
{
if
(!
StringUtils
.
isEmpty
(
customer
))
{
String
ph
=
"^[1][34578]\\d{9}$"
;
String
ph
=
"^[1][34578]\\d{9}$"
;
String
telephone
=
customer
.
getTelephone
();
String
telephone
=
customer
.
getTelephone
();
...
@@ -75,7 +75,7 @@ public class MallCustomerController extends BaseController {
...
@@ -75,7 +75,7 @@ public class MallCustomerController extends BaseController {
mallCustomerService
.
saveCustomer
(
customer
);
mallCustomerService
.
saveCustomer
(
customer
);
return
new
Result
(
true
,
"注册成功!"
,
StatusCode
.
OK
);
return
new
Result
(
true
,
"注册成功!"
,
StatusCode
.
OK
);
}
}
return
new
Result
(
false
,
"注册失败!"
,
StatusCode
.
ERROR
);
return
new
Result
(
false
,
"注册失败!"
,
StatusCode
.
ERROR
);
}
}
...
@@ -85,7 +85,7 @@ public class MallCustomerController extends BaseController {
...
@@ -85,7 +85,7 @@ public class MallCustomerController extends BaseController {
*/
*/
@GetMapping
(
"/getLoginUserName"
)
@GetMapping
(
"/getLoginUserName"
)
@ApiOperation
(
value
=
"获取当前登录用户信息"
)
@ApiOperation
(
value
=
"获取当前登录用户信息"
)
public
Result
getLoginUserName
(
HttpServletRequest
request
)
{
public
Result
getLoginUserName
(
HttpServletRequest
request
)
throws
Exception
{
// 从session中获取id
// 从session中获取id
try
{
try
{
MallCustomerApiDto
mallCustomer
=
(
MallCustomerApiDto
)
SessionUtils
.
getUserCurrent
(
request
,
"mallCustomer"
);
MallCustomerApiDto
mallCustomer
=
(
MallCustomerApiDto
)
SessionUtils
.
getUserCurrent
(
request
,
"mallCustomer"
);
...
@@ -114,4 +114,11 @@ public class MallCustomerController extends BaseController {
...
@@ -114,4 +114,11 @@ public class MallCustomerController extends BaseController {
}
}
return
new
Result
(
false
,
"密码修改失败"
,
StatusCode
.
ERROR
);
return
new
Result
(
false
,
"密码修改失败"
,
StatusCode
.
ERROR
);
}
}
// @PostMapping(value = "/upPassword")
// @ApiModelProperty(value = "忘记密码")
// public Result upPassword(@RequestBody CustomerRequest customer) throws Exception {
// mallCustomerService.upPassword(customer);
// return new Result(true, "密码修改成功", StatusCode.OK);
// }
}
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/customer/PersonalUserController.java
View file @
17419f89
package
com
.
jz
.
dm
.
mall
.
moduls
.
controller
.
customer
;
package
com
.
jz
.
dm
.
mall
.
moduls
.
controller
.
customer
;
import
com.jz.common.utils.
Result
;
import
com.jz.common.utils.
*
;
import
com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq
;
import
com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq
;
import
com.jz.dm.mall.moduls.service.PersonalUserControllerService
;
import
com.jz.dm.mall.moduls.service.PersonalUserControllerService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/customer/ValidateCodeController.java
View file @
17419f89
...
@@ -12,10 +12,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -12,10 +12,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -39,7 +36,7 @@ public class ValidateCodeController {
...
@@ -39,7 +36,7 @@ public class ValidateCodeController {
* @param telephone
* @param telephone
* @return
* @return
*/
*/
@
Pos
tMapping
(
value
=
"/sendForLogin"
)
@
Ge
tMapping
(
value
=
"/sendForLogin"
)
@ApiOperation
(
value
=
"注册时发送的验证码"
)
@ApiOperation
(
value
=
"注册时发送的验证码"
)
public
Result
sendForLogin
(
@RequestParam
(
value
=
"telephone"
)
String
telephone
)
{
public
Result
sendForLogin
(
@RequestParam
(
value
=
"telephone"
)
String
telephone
)
{
String
key
=
RedisMessageConstant
.
SENDTYPE_LOGIN
+
"_"
+
telephone
;
String
key
=
RedisMessageConstant
.
SENDTYPE_LOGIN
+
"_"
+
telephone
;
...
@@ -70,7 +67,7 @@ public class ValidateCodeController {
...
@@ -70,7 +67,7 @@ public class ValidateCodeController {
* @param telephone
* @param telephone
* @return
* @return
*/
*/
@
Pos
tMapping
(
"/send4Code"
)
@
Ge
tMapping
(
"/send4Code"
)
@ApiOperation
(
value
=
"修改密码发送验证码"
)
@ApiOperation
(
value
=
"修改密码发送验证码"
)
public
Result
send4Code
(
@RequestParam
(
value
=
"telephone"
)
String
telephone
)
{
public
Result
send4Code
(
@RequestParam
(
value
=
"telephone"
)
String
telephone
)
{
String
key
=
RedisMessageConstant
.
SENDTYPE_LOGIN
+
"_"
+
telephone
;
String
key
=
RedisMessageConstant
.
SENDTYPE_LOGIN
+
"_"
+
telephone
;
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/goods/bean/dto/MallHotRecommendGoodsDto.java
View file @
17419f89
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
/**
* @ClassName:
* @ClassName:
...
@@ -30,10 +31,10 @@ public class MallHotRecommendGoodsDto implements Serializable {
...
@@ -30,10 +31,10 @@ public class MallHotRecommendGoodsDto implements Serializable {
private
String
dataPicture
;
private
String
dataPicture
;
@ApiModelProperty
(
value
=
"数据商品价格"
)
@ApiModelProperty
(
value
=
"数据商品价格"
)
private
String
dataPrice
;
private
BigDecimal
dataPrice
;
@ApiModelProperty
(
value
=
"优惠价格"
)
@ApiModelProperty
(
value
=
"优惠价格"
)
private
String
discountPrice
;
private
BigDecimal
discountPrice
;
@ApiModelProperty
(
value
=
"用户使用人数"
)
@ApiModelProperty
(
value
=
"用户使用人数"
)
private
Long
usePerson
;
private
Long
usePerson
;
...
@@ -78,19 +79,20 @@ public class MallHotRecommendGoodsDto implements Serializable {
...
@@ -78,19 +79,20 @@ public class MallHotRecommendGoodsDto implements Serializable {
this
.
dataPicture
=
dataPicture
;
this
.
dataPicture
=
dataPicture
;
}
}
public
String
getDataPrice
()
{
public
BigDecimal
getDataPrice
()
{
return
dataPrice
;
return
dataPrice
;
}
}
public
void
setDataPrice
(
String
dataPrice
)
{
public
void
setDataPrice
(
BigDecimal
dataPrice
)
{
this
.
dataPrice
=
dataPrice
;
this
.
dataPrice
=
dataPrice
;
}
}
public
String
getDiscountPrice
()
{
public
BigDecimal
getDiscountPrice
()
{
return
discountPrice
;
return
discountPrice
;
}
}
public
void
setDiscountPrice
(
String
discountPrice
)
{
public
void
setDiscountPrice
(
BigDecimal
discountPrice
)
{
this
.
discountPrice
=
discountPrice
;
this
.
discountPrice
=
discountPrice
;
}
}
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/MallCustomerService.java
View file @
17419f89
...
@@ -55,4 +55,10 @@ public interface MallCustomerService {
...
@@ -55,4 +55,10 @@ public interface MallCustomerService {
* @return
* @return
*/
*/
MallCustomer
selectByUser
(
Long
customerId
);
MallCustomer
selectByUser
(
Long
customerId
);
// /**
// * 忘记密码
// * @param customer
// */
// void upPassword(CustomerRequest customer);
}
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/MallCustomerServiceImpl.java
View file @
17419f89
...
@@ -160,5 +160,16 @@ public class MallCustomerServiceImpl implements MallCustomerService {
...
@@ -160,5 +160,16 @@ public class MallCustomerServiceImpl implements MallCustomerService {
return
mallCustomer
;
return
mallCustomer
;
}
}
// /**
// * 忘记密码
// *
// * @param customer
// */
// @Override
// public void upPassword(CustomerRequest customer) {
// // 通过手机号判断是否注册过
//
// }
}
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/MallHotRecommendGoodsServiceImpl.java
View file @
17419f89
...
@@ -7,6 +7,9 @@ import com.jz.dm.mall.moduls.service.MallHotRecommendGoodsService;
...
@@ -7,6 +7,9 @@ import com.jz.dm.mall.moduls.service.MallHotRecommendGoodsService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.math.MathContext
;
import
java.text.DecimalFormat
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -28,7 +31,9 @@ public class MallHotRecommendGoodsServiceImpl implements MallHotRecommendGoodsSe
...
@@ -28,7 +31,9 @@ public class MallHotRecommendGoodsServiceImpl implements MallHotRecommendGoodsSe
@Override
@Override
public
List
<
MallHotRecommendGoodsDto
>
selectByPopularApi
()
{
public
List
<
MallHotRecommendGoodsDto
>
selectByPopularApi
()
{
List
<
MallHotRecommendGoodsDto
>
popularApiList
=
tMallHotRecommendGoodsDao
.
selectByPopularApi
();
List
<
MallHotRecommendGoodsDto
>
popularApiList
=
tMallHotRecommendGoodsDao
.
selectByPopularApi
();
for
(
MallHotRecommendGoodsDto
goodsDto
:
popularApiList
)
{
goodsDto
.
getDataPrice
().
setScale
(
3
);
}
return
popularApiList
;
return
popularApiList
;
}
}
}
}
\ No newline at end of file
jz-dm-mall/src/main/resources/mapperconf/MallHotRecommendGoodsDao.xml
View file @
17419f89
...
@@ -94,7 +94,7 @@
...
@@ -94,7 +94,7 @@
SELECT
SELECT
t1.data_goods_id as dataGoodsId ,
t1.data_goods_id as dataGoodsId ,
t1.data_name as dataName,
t1.data_name as dataName,
(CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '0
1' then 'api
' end) dataTYpe,
(CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '0
2' then '数据包
' end) dataTYpe,
t1.data_label as dataLabel,
t1.data_label as dataLabel,
t1.data_picture as dataPicture,
t1.data_picture as dataPicture,
t1.data_price as dataPrice,
t1.data_price as dataPrice,
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/customer/DepartmentController.java
View file @
17419f89
...
@@ -65,7 +65,7 @@ public class DepartmentController extends BaseController {
...
@@ -65,7 +65,7 @@ public class DepartmentController extends BaseController {
*/
*/
@GetMapping
(
value
=
"/getDepartment/{id}"
)
@GetMapping
(
value
=
"/getDepartment/{id}"
)
@ApiOperation
(
value
=
"主键查询用户企业详情信息"
)
@ApiOperation
(
value
=
"主键查询用户企业详情信息"
)
public
Result
<
CompanyDetailsDto
>
selectById
(
@PathVariable
(
value
=
"id"
)
Long
id
,
HttpServletRequest
req
)
{
public
Result
<
CompanyDetailsDto
>
selectById
(
@PathVariable
(
value
=
"id"
)
Long
id
,
HttpServletRequest
req
)
throws
Exception
{
if
(
id
!=
null
)
{
if
(
id
!=
null
)
{
CompanyDetailsDto
companyDetails
=
departmentService
.
selectById
(
id
);
CompanyDetailsDto
companyDetails
=
departmentService
.
selectById
(
id
);
return
new
Result
<
CompanyDetailsDto
>(
true
,
"查询企业详情成功!"
,
StatusCode
.
OK
,
companyDetails
);
return
new
Result
<
CompanyDetailsDto
>(
true
,
"查询企业详情成功!"
,
StatusCode
.
OK
,
companyDetails
);
...
@@ -80,7 +80,7 @@ public class DepartmentController extends BaseController {
...
@@ -80,7 +80,7 @@ public class DepartmentController extends BaseController {
*/
*/
@PostMapping
(
value
=
"/audit/{id}"
)
@PostMapping
(
value
=
"/audit/{id}"
)
@ApiModelProperty
(
value
=
"企业审核"
)
@ApiModelProperty
(
value
=
"企业审核"
)
public
Result
audit
(
@PathVariable
(
value
=
"id"
)
Long
id
,
HttpServletRequest
req
)
{
public
Result
audit
(
@PathVariable
(
value
=
"id"
)
Long
id
,
HttpServletRequest
req
)
throws
Exception
{
if
(
id
!=
null
)
{
if
(
id
!=
null
)
{
departmentService
.
audit
(
id
,
req
);
departmentService
.
audit
(
id
,
req
);
return
new
Result
<
CompanyDetailsDto
>(
true
,
"企业审核成功!"
,
StatusCode
.
OK
);
return
new
Result
<
CompanyDetailsDto
>(
true
,
"企业审核成功!"
,
StatusCode
.
OK
);
...
@@ -106,4 +106,4 @@ public class DepartmentController extends BaseController {
...
@@ -106,4 +106,4 @@ public class DepartmentController extends BaseController {
}
}
return
new
Result
<
CompanyDetailsDto
>(
false
,
"添加用户失败!"
,
StatusCode
.
ERROR
);
return
new
Result
<
CompanyDetailsDto
>(
false
,
"添加用户失败!"
,
StatusCode
.
ERROR
);
}
}
}
}
\ No newline at end of file
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/goods/DataGoodsApiController.java
View file @
17419f89
...
@@ -35,7 +35,7 @@ public class DataGoodsApiController extends BaseController {
...
@@ -35,7 +35,7 @@ public class DataGoodsApiController extends BaseController {
*/
*/
@GetMapping
(
"/getDataDetails/{id}"
)
@GetMapping
(
"/getDataDetails/{id}"
)
@ApiOperation
(
value
=
"点击商品查看商品详情"
,
notes
=
"api商品"
)
@ApiOperation
(
value
=
"点击商品查看商品详情"
,
notes
=
"api商品"
)
public
Result
<
DataGoodsApiDto
>
findById
(
@PathVariable
(
value
=
"id"
)
Long
id
)
{
public
Result
<
DataGoodsApiDto
>
findById
(
@PathVariable
(
value
=
"id"
)
Long
id
)
throws
Exception
{
if
(
id
!=
null
)
{
if
(
id
!=
null
)
{
Result
<
DataGoodsApiDto
>
result
=
new
Result
<>();
Result
<
DataGoodsApiDto
>
result
=
new
Result
<>();
DataGoodsApiDto
dataGoodsApi
=
tDataGoodsApiService
.
selectById
(
id
);
DataGoodsApiDto
dataGoodsApi
=
tDataGoodsApiService
.
selectById
(
id
);
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/sys/LoginController.java
View file @
17419f89
...
@@ -6,6 +6,7 @@ import com.jz.common.utils.Result;
...
@@ -6,6 +6,7 @@ import com.jz.common.utils.Result;
import
com.jz.common.utils.SessionUtils
;
import
com.jz.common.utils.SessionUtils
;
import
com.jz.common.utils.StatusCode
;
import
com.jz.common.utils.StatusCode
;
import
com.jz.manage.moduls.controller.BaseController
;
import
com.jz.manage.moduls.controller.BaseController
;
import
com.jz.manage.moduls.controller.sys.bean.req.LoginRequest
;
import
com.jz.manage.moduls.service.SysUserService
;
import
com.jz.manage.moduls.service.SysUserService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -31,61 +32,62 @@ public class LoginController extends BaseController {
...
@@ -31,61 +32,62 @@ public class LoginController extends BaseController {
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
/**
/**
* 登录功能
* 登录功能
* @param username 账号
* @param password 密码
* @return
* @return
*/
*/
@PostMapping
(
value
=
"login"
)
@PostMapping
(
value
=
"login"
)
public
Result
login
(
String
username
,
String
password
,
HttpServletRequest
request
)
{
public
Result
login
(
@RequestBody
LoginRequest
user
,
HttpServletRequest
request
)
{
// 手机
if
(!
StringUtils
.
isEmpty
(
user
))
{
String
ph
=
"^[1][34578]\\d{9}$"
;
String
username
=
user
.
getUsername
();
String
password
=
user
.
getPassword
();
// 如果是手机验证
// 手机
if
(
username
.
matches
(
username
))
{
String
ph
=
"^[1][34578]\\d{9}$"
;
SysUser
sysUser
=
sysUserService
.
selectByPhone
(
username
,
request
);
// 如果是手机验证
if
(
username
.
matches
(
username
))
{
SysUser
sysUser
=
sysUserService
.
selectByPhone
(
username
,
request
);
if
(
sysUser
!=
null
)
{
if
(
sysUser
.
getTelephone
().
equals
(
username
)
&&
sysUser
.
getPassword
().
equals
(
password
))
{
return
new
Result
<>(
true
,
"登录成功!"
,
StatusCode
.
OK
);
}
return
new
Result
<>(
false
,
"用户名或密码错误!"
,
StatusCode
.
ERROR
);
}
}
SysUser
sysUser
=
sysUserService
.
selectByUsername
(
username
,
request
);
if
(
sysUser
!=
null
)
{
if
(
sysUser
!=
null
)
{
if
(
sysUser
.
get
Telephone
().
equals
(
username
)
&&
sysUser
.
getPassword
().
equals
(
password
))
{
if
(
sysUser
.
get
Account
().
equals
(
username
)
&&
sysUser
.
getPassword
().
equals
(
password
))
{
return
new
Result
<>(
true
,
"登录成功!"
,
StatusCode
.
OK
);
return
new
Result
<>(
true
,
"登录成功!"
,
StatusCode
.
OK
);
}
}
return
new
Result
<>(
false
,
"用户名或密码错误!"
,
StatusCode
.
ERROR
);
}
}
return
new
Result
<>(
false
,
"用户名或密码错误!"
,
StatusCode
.
ERROR
);
}
}
SysUser
sysUser
=
sysUserService
.
selectByUsername
(
username
,
request
);
return
new
Result
(
false
,
"用户名密码不能为空!"
,
StatusCode
.
ERROR
);
if
(
sysUser
!=
null
)
{
if
(
sysUser
.
getAccount
().
equals
(
username
)
&&
sysUser
.
getPassword
().
equals
(
password
)){
return
new
Result
<>(
true
,
"登录成功!"
,
StatusCode
.
OK
);
}
}
return
new
Result
<>(
false
,
"用户名或密码错误!"
,
StatusCode
.
ERROR
);
}
}
// /**
/**
// * 手机号码校验
* 手机号码校验
// * @param paramMap
* @param paramMap
// * @param res
* @param res
// * @return
* @return
// */
*/
// @PostMapping(value = "/check")
@PostMapping
(
value
=
"/check"
)
// public Result loginCheck(@RequestBody Map<String, String> paramMap, HttpServletResponse res) {
public
Result
loginCheck
(
@RequestBody
Map
<
String
,
String
>
paramMap
,
HttpServletResponse
res
)
{
// // 获取手机号码
// 获取手机号码
// String telephone = paramMap.get("telephone");
String
telephone
=
paramMap
.
get
(
"telephone"
);
// String key = RedisMessageConstant.SENDTYPE_LOGIN + "_" + telephone;
String
key
=
RedisMessageConstant
.
SENDTYPE_LOGIN
+
"_"
+
telephone
;
// // 获取redis中key对应的值
// 获取redis中key对应的值
// String codeInRedis = (String) redisTemplate.opsForValue().get(key);
String
codeInRedis
=
(
String
)
redisTemplate
.
opsForValue
().
get
(
key
);
// if (StringUtils.isEmpty(codeInRedis)) {
if
(
StringUtils
.
isEmpty
(
codeInRedis
))
{
// return new Result(false, "请重新获取验证码!", StatusCode.ERROR);
return
new
Result
(
false
,
"请重新获取验证码!"
,
StatusCode
.
ERROR
);
// }
}
// // 判断验证码是否一致
// 判断验证码是否一致
// if (!codeInRedis.equals(paramMap.get("validateCode"))) {
if
(!
codeInRedis
.
equals
(
paramMap
.
get
(
"validateCode"
)))
{
// return new Result(false, "验证码不正确!", StatusCode.ERROR);
return
new
Result
(
false
,
"验证码不正确!"
,
StatusCode
.
ERROR
);
// }
}
// // 删除redis的验证码
// 删除redis的验证码
// redisTemplate.delete(key);
redisTemplate
.
delete
(
key
);
//
// return new Result(true, "验证码正确!", StatusCode.OK);
return
new
Result
(
true
,
"验证码正确!"
,
StatusCode
.
OK
);
// }
}
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/sys/bean/SysUserDto.java
→
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/sys/bean/
dto/
SysUserDto.java
View file @
17419f89
package
com
.
jz
.
manage
.
moduls
.
controller
.
sys
.
bean
;
package
com
.
jz
.
manage
.
moduls
.
controller
.
sys
.
bean
.
dto
;
import
com.jz.common.enums.UserTypeEnum
;
import
com.jz.common.enums.UserTypeEnum
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/sys/bean/req/LoginRequest.java
0 → 100644
View file @
17419f89
package
com
.
jz
.
manage
.
moduls
.
controller
.
sys
.
bean
.
req
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/17
* @Version:
*/
@ApiModel
(
value
=
"用户登录接受的参数"
)
public
class
LoginRequest
{
@ApiModelProperty
(
value
=
"验证码"
)
private
String
vailCode
;
@ApiModelProperty
(
value
=
"密码"
)
private
String
password
;
@ApiModelProperty
(
value
=
"用户名"
)
private
String
username
;
public
String
getVailCode
()
{
return
vailCode
;
}
public
void
setVailCode
(
String
vailCode
)
{
this
.
vailCode
=
vailCode
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
}
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/DataGoodsApiService.java
View file @
17419f89
...
@@ -15,5 +15,5 @@ public interface DataGoodsApiService {
...
@@ -15,5 +15,5 @@ public interface DataGoodsApiService {
* @param id
* @param id
* @return
* @return
*/
*/
DataGoodsApiDto
selectById
(
Long
id
);
DataGoodsApiDto
selectById
(
Long
id
)
throws
Exception
;
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/DepartmentService.java
View file @
17419f89
...
@@ -24,24 +24,24 @@ public interface DepartmentService {
...
@@ -24,24 +24,24 @@ public interface DepartmentService {
* @param req
* @param req
* @return
* @return
*/
*/
PageInfoResponse
<
EnterpriseAuditDto
>
findList
(
EnterpriseAuditRequest
auditRequest
,
HttpServletRequest
req
);
PageInfoResponse
<
EnterpriseAuditDto
>
findList
(
EnterpriseAuditRequest
auditRequest
,
HttpServletRequest
req
)
throws
Exception
;
/**
/**
* 主键获取用户企业详情信息
* 主键获取用户企业详情信息
* @param id
* @param id
* @return
* @return
*/
*/
CompanyDetailsDto
selectById
(
Long
id
);
CompanyDetailsDto
selectById
(
Long
id
)
throws
Exception
;
/**
/**
* 企业审核信息
* 企业审核信息
* @param id
* @param id
*/
*/
void
audit
(
Long
id
,
HttpServletRequest
req
);
void
audit
(
Long
id
,
HttpServletRequest
req
)
throws
Exception
;
/**
/**
* 添加用户
* 添加用户
* @param saveCustomerRequest
* @param saveCustomerRequest
*/
*/
Result
add
(
SaveCustomerRequest
saveCustomerRequest
,
HttpServletRequest
req
);
Result
add
(
SaveCustomerRequest
saveCustomerRequest
,
HttpServletRequest
req
)
throws
Exception
;
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/impl/DepartmentServiceImpl.java
View file @
17419f89
...
@@ -3,7 +3,6 @@ package com.jz.manage.moduls.service.impl;
...
@@ -3,7 +3,6 @@ package com.jz.manage.moduls.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.jz.common.bean.MallCustomerApiDto
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.constant.Constants
;
import
com.jz.common.constant.Constants
;
import
com.jz.common.constant.ResultCode
;
import
com.jz.common.constant.ResultCode
;
...
@@ -17,7 +16,7 @@ import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
...
@@ -17,7 +16,7 @@ import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import
com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest
;
import
com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest
;
import
com.jz.manage.moduls.controller.customer.bean.request.SaveCustomerRequest
;
import
com.jz.manage.moduls.controller.customer.bean.request.SaveCustomerRequest
;
import
com.jz.manage.moduls.controller.sys.bean.SysUserDto
;
import
com.jz.manage.moduls.controller.sys.bean.
dto.
SysUserDto
;
import
com.jz.manage.moduls.entity.Department
;
import
com.jz.manage.moduls.entity.Department
;
import
com.jz.manage.moduls.entity.FinanceCustomerAssets
;
import
com.jz.manage.moduls.entity.FinanceCustomerAssets
;
import
com.jz.manage.moduls.entity.FinanceCustomerBalance
;
import
com.jz.manage.moduls.entity.FinanceCustomerBalance
;
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/impl/SysUserServiceImpl.java
View file @
17419f89
...
@@ -5,7 +5,7 @@ import com.jz.common.constant.RedisMessageConstant;
...
@@ -5,7 +5,7 @@ import com.jz.common.constant.RedisMessageConstant;
import
com.jz.common.entity.SysUser
;
import
com.jz.common.entity.SysUser
;
import
com.jz.common.enums.UserTypeEnum
;
import
com.jz.common.enums.UserTypeEnum
;
import
com.jz.common.utils.SessionUtils
;
import
com.jz.common.utils.SessionUtils
;
import
com.jz.manage.moduls.controller.sys.bean.SysUserDto
;
import
com.jz.manage.moduls.controller.sys.bean.
dto.
SysUserDto
;
import
com.jz.manage.moduls.mapper.SysUserDao
;
import
com.jz.manage.moduls.mapper.SysUserDao
;
import
com.jz.manage.moduls.service.SysUserService
;
import
com.jz.manage.moduls.service.SysUserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
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