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
4f2273ad
Commit
4f2273ad
authored
Dec 04, 2020
by
machengbo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dm_dev' of
http://gitlab.ioubuy.cn/yaobenzhang/dm_project
into dm_dev
parents
88a0be2c
ca1aa927
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
429 additions
and
81 deletions
+429
-81
pom.xml
jz-dm-apigateway/pom.xml
+7
-7
pom.xml
jz-dm-common/pom.xml
+5
-4
pom.xml
jz-dm-mall/pom.xml
+5
-5
CompanyAuthController.java
...mall/moduls/controller/company/CompanyAuthController.java
+8
-12
CompanyAddReq.java
...dm/mall/moduls/controller/company/bean/CompanyAddReq.java
+1
-1
CompanyUpdateReq.java
...mall/moduls/controller/company/bean/CompanyUpdateReq.java
+1
-1
LogInfoController.java
...m/jz/dm/mall/moduls/controller/log/LogInfoController.java
+4
-2
PlatformLog.java
...c/main/java/com/jz/dm/mall/moduls/entity/PlatformLog.java
+274
-0
MallCustomerDao.java
...in/java/com/jz/dm/mall/moduls/mapper/MallCustomerDao.java
+2
-3
CompanyAuthService.java
...ava/com/jz/dm/mall/moduls/service/CompanyAuthService.java
+10
-4
LogInfoService.java
...in/java/com/jz/dm/mall/moduls/service/LogInfoService.java
+4
-1
CompanyAuthServiceImpl.java
...z/dm/mall/moduls/service/impl/CompanyAuthServiceImpl.java
+34
-32
LogInfoServiceImpl.java
...om/jz/dm/mall/moduls/service/impl/LogInfoServiceImpl.java
+18
-6
MallCustomerDao.xml
jz-dm-mall/src/main/resources/mapperconf/MallCustomerDao.xml
+9
-0
PlatformLogDao.xml
jz-dm-mall/src/main/resources/mapperconf/PlatformLogDao.xml
+25
-3
ManageLogInfoQueryReq.java
...age/moduls/controller/log/bean/ManageLogInfoQueryReq.java
+22
-0
No files found.
jz-dm-apigateway/pom.xml
View file @
4f2273ad
...
...
@@ -38,7 +38,6 @@
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
<version>
1.0.29
</version>
</dependency>
<!-- 提供mysql驱动 -->
...
...
@@ -52,12 +51,7 @@
<artifactId>
httpclient
</artifactId>
<version>
4.5.6
</version>
</dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter
</artifactId>
<version>
RELEASE
</version>
<scope>
test
</scope>
</dependency>
<!--lang3工具类-->
<dependency>
<groupId>
org.apache.commons
</groupId>
...
...
@@ -68,6 +62,12 @@
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
</dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter
</artifactId>
<version>
RELEASE
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
...
...
jz-dm-common/pom.xml
View file @
4f2273ad
...
...
@@ -19,6 +19,10 @@
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
...
...
@@ -75,10 +79,7 @@
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!--阿里云服务器短信平台-->
<dependency>
<groupId>
com.aliyun
</groupId>
...
...
jz-dm-mall/pom.xml
View file @
4f2273ad
...
...
@@ -84,7 +84,10 @@
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
io.projectreactor
</groupId>
<artifactId>
reactor-core
</artifactId>
</dependency>
<!--mybatis分页插件 -->
<dependency>
<groupId>
com.github.pagehelper
</groupId>
...
...
@@ -125,9 +128,6 @@
<version>
1.0.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
io.projectreactor
</groupId>
<artifactId>
reactor-core
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/company/CompanyAuthController.java
View file @
4f2273ad
...
...
@@ -42,8 +42,8 @@ public class CompanyAuthController {
*/
@PostMapping
(
"/add"
)
@ApiOperation
(
value
=
"企业信息提交"
)
public
Mono
<
Result
>
addCompanyAuth
(
@RequestBody
@Validated
CompanyAddReq
req
)
{
return
Mono
.
fromSupplier
(()
->
companyAuthService
.
addCompanyData
(
req
));
public
Mono
<
Result
>
addCompanyAuth
(
@RequestBody
@Validated
CompanyAddReq
req
,
HttpServletRequest
request
)
{
return
Mono
.
fromSupplier
(()
->
companyAuthService
.
addCompanyData
(
req
,
request
));
}
/**
...
...
@@ -53,12 +53,8 @@ public class CompanyAuthController {
*/
@GetMapping
(
"/findCompany"
)
@ApiOperation
(
value
=
"企业认证信息查询"
)
public
Mono
<
Result
>
selectCompany
(
@RequestParam
(
value
=
"type"
)
String
type
)
{
return
Mono
.
fromSupplier
(()
->{
//TODO 获取当前登录用户
//httpRequest.getSession().getServletContext().getAttribute("customer_id");
return
Result
.
ok
(
companyAuthService
.
selectCompany
(
type
));
});
public
Mono
<
Result
>
selectCompany
(
@RequestParam
(
value
=
"type"
)
String
type
,
HttpServletRequest
request
)
{
return
Mono
.
fromSupplier
(()
->
Result
.
of_success
(
companyAuthService
.
selectCompany
(
type
,
request
)));
}
/**
* @Description: 企业认证信息更新
...
...
@@ -67,8 +63,8 @@ public class CompanyAuthController {
*/
@GetMapping
(
"/updateCompany"
)
@ApiOperation
(
value
=
"企业认证信息更新"
)
public
Mono
<
Result
>
updateCompany
(
@RequestBody
@Validated
CompanyUpdateReq
req
)
{
return
Mono
.
fromSupplier
(()
->
companyAuthService
.
updateCompanyInfo
(
req
));
public
Mono
<
Result
>
updateCompany
(
@RequestBody
@Validated
CompanyUpdateReq
req
,
HttpServletRequest
request
)
{
return
Mono
.
fromSupplier
(()
->
companyAuthService
.
updateCompanyInfo
(
req
,
request
));
}
/**
* @Description: 企业认证信息更新
...
...
@@ -77,7 +73,7 @@ public class CompanyAuthController {
*/
@GetMapping
(
"/checkCompany"
)
@ApiOperation
(
value
=
"企业认证信息校验"
)
public
Mono
<
Result
>
checkCompany
()
{
return
Mono
.
fromSupplier
(()
->
companyAuthService
.
checkCompanyInfo
());
public
Mono
<
Result
>
checkCompany
(
HttpServletRequest
request
)
{
return
Mono
.
fromSupplier
(()
->
companyAuthService
.
checkCompanyInfo
(
request
));
}
}
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/company/bean/CompanyAddReq.java
View file @
4f2273ad
...
...
@@ -60,7 +60,7 @@ public class CompanyAddReq implements Serializable {
private
String
telephone
;
@ApiModelProperty
(
name
=
"登录用户id"
,
hidden
=
true
)
private
Long
customer
Id
;
private
Long
login
Id
;
@ApiModelProperty
(
name
=
"登录用户名称"
,
hidden
=
true
)
private
String
LoginName
;
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/company/bean/CompanyUpdateReq.java
View file @
4f2273ad
...
...
@@ -62,7 +62,7 @@ public class CompanyUpdateReq implements Serializable {
private
String
telephone
;
@ApiModelProperty
(
name
=
"登录用户id"
,
hidden
=
true
)
private
Long
customer
Id
;
private
Long
login
Id
;
@ApiModelProperty
(
name
=
"登录用户名称"
,
hidden
=
true
)
private
String
loginName
;
}
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/log/LogInfoController.java
View file @
4f2273ad
...
...
@@ -14,6 +14,8 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
reactor.core.publisher.Mono
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.controller.log
...
...
@@ -39,8 +41,8 @@ public class LogInfoController {
*/
@PostMapping
(
"/getMallLogInfo"
)
@ApiOperation
(
value
=
"获取商城用户日志信息列表"
)
public
Mono
<
Result
<
PageInfoResponse
<
PlatformLog
>>>
getLogInfo
(
@RequestBody
@Validated
LogInfoQueryReq
req
)
{
return
Mono
.
fromSupplier
(()
->
logInfoService
.
getMallUserLogInfo
(
req
));
public
Mono
<
Result
<
PageInfoResponse
<
PlatformLog
>>>
getLogInfo
(
@RequestBody
@Validated
LogInfoQueryReq
req
,
HttpServletRequest
request
)
{
return
Mono
.
fromSupplier
(()
->
logInfoService
.
getMallUserLogInfo
(
req
,
request
));
}
/**
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/entity/PlatformLog.java
0 → 100644
View file @
4f2273ad
package
com
.
jz
.
dm
.
mall
.
moduls
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 日志管理(TPlatformLog)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:42
*/
@TableName
(
"t_platform_Log"
)
@ApiModel
public
class
PlatformLog
implements
Serializable
{
private
static
final
long
serialVersionUID
=
112371340504875570L
;
/**
* 日志id
*/
private
Long
platformLogId
;
/**
* 请求ip
*/
private
String
requestIp
;
/**
* 调用人id
*/
private
String
callerId
;
/**
* 商品id
*/
private
Long
dataGoodsId
;
/**
* apikey
*/
private
String
apiKey
;
/**
* 请求参数
*/
private
String
requestParams
;
/**
* 返回参数
*/
private
String
returnParams
;
/**
* 请求路径
*/
private
String
requestUrl
;
/**
* 请求时间
*/
private
Date
requestTime
;
/**
* 服务类型:01年,02月,03次
*/
private
String
serviceType
;
/**
* 数据类型:01api,02数据包
*/
private
String
dataGoodsType
;
/**
* 下载地址
*/
private
String
downloadAddress
;
/**
* 数据商品单价
*/
private
BigDecimal
dataPrice
;
/**
* 价格类型:01免费,02收费
*/
private
String
priceType
;
/**
* 调用总次数
*/
private
Long
totalTimes
;
/**
* 已使用次数
*/
private
Long
usedTimes
;
/**
* 剩余次数
*/
private
Long
remainTimes
;
/**
* 有效开始时间
*/
private
Date
startTime
;
/**
* 有效结束时间
*/
private
Date
endTime
;
/**
* 创建时间
*/
private
Date
creTime
;
/**
* 删除标识
*/
private
String
delFlag
;
public
Long
getPlatformLogId
()
{
return
platformLogId
;
}
public
void
setPlatformLogId
(
Long
platformLogId
)
{
this
.
platformLogId
=
platformLogId
;
}
public
String
getRequestIp
()
{
return
requestIp
;
}
public
void
setRequestIp
(
String
requestIp
)
{
this
.
requestIp
=
requestIp
;
}
public
String
getCallerId
()
{
return
callerId
;
}
public
void
setCallerId
(
String
callerId
)
{
this
.
callerId
=
callerId
;
}
public
Long
getDataGoodsId
()
{
return
dataGoodsId
;
}
public
void
setDataGoodsId
(
Long
dataGoodsId
)
{
this
.
dataGoodsId
=
dataGoodsId
;
}
public
String
getApiKey
()
{
return
apiKey
;
}
public
void
setApiKey
(
String
apiKey
)
{
this
.
apiKey
=
apiKey
;
}
public
String
getRequestParams
()
{
return
requestParams
;
}
public
void
setRequestParams
(
String
requestParams
)
{
this
.
requestParams
=
requestParams
;
}
public
String
getReturnParams
()
{
return
returnParams
;
}
public
void
setReturnParams
(
String
returnParams
)
{
this
.
returnParams
=
returnParams
;
}
public
String
getRequestUrl
()
{
return
requestUrl
;
}
public
void
setRequestUrl
(
String
requestUrl
)
{
this
.
requestUrl
=
requestUrl
;
}
public
Date
getRequestTime
()
{
return
requestTime
;
}
public
void
setRequestTime
(
Date
requestTime
)
{
this
.
requestTime
=
requestTime
;
}
public
String
getServiceType
()
{
return
serviceType
;
}
public
void
setServiceType
(
String
serviceType
)
{
this
.
serviceType
=
serviceType
;
}
public
String
getDataGoodsType
()
{
return
dataGoodsType
;
}
public
void
setDataGoodsType
(
String
dataGoodsType
)
{
this
.
dataGoodsType
=
dataGoodsType
;
}
public
String
getDownloadAddress
()
{
return
downloadAddress
;
}
public
void
setDownloadAddress
(
String
downloadAddress
)
{
this
.
downloadAddress
=
downloadAddress
;
}
public
BigDecimal
getDataPrice
()
{
return
dataPrice
;
}
public
void
setDataPrice
(
BigDecimal
dataPrice
)
{
this
.
dataPrice
=
dataPrice
;
}
public
String
getPriceType
()
{
return
priceType
;
}
public
void
setPriceType
(
String
priceType
)
{
this
.
priceType
=
priceType
;
}
public
Long
getTotalTimes
()
{
return
totalTimes
;
}
public
void
setTotalTimes
(
Long
totalTimes
)
{
this
.
totalTimes
=
totalTimes
;
}
public
Long
getUsedTimes
()
{
return
usedTimes
;
}
public
void
setUsedTimes
(
Long
usedTimes
)
{
this
.
usedTimes
=
usedTimes
;
}
public
Long
getRemainTimes
()
{
return
remainTimes
;
}
public
void
setRemainTimes
(
Long
remainTimes
)
{
this
.
remainTimes
=
remainTimes
;
}
public
Date
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
Date
startTime
)
{
this
.
startTime
=
startTime
;
}
public
Date
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
Date
endTime
)
{
this
.
endTime
=
endTime
;
}
public
Date
getCreTime
()
{
return
creTime
;
}
public
void
setCreTime
(
Date
creTime
)
{
this
.
creTime
=
creTime
;
}
public
String
getDelFlag
()
{
return
delFlag
;
}
public
void
setDelFlag
(
String
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/mapper/MallCustomerDao.java
View file @
4f2273ad
...
...
@@ -3,6 +3,7 @@ package com.jz.dm.mall.moduls.mapper;
import
com.jz.common.base.BaseMapper
;
import
com.jz.dm.mall.moduls.entity.MallCustomer
;
import
org.apache.ibatis.annotations.Insert
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.ResultType
;
import
org.apache.ibatis.annotations.Select
;
...
...
@@ -51,8 +52,6 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
* @param customerId
* @return
*/
@Select
(
"select * from t_mall_customer where customer_id =#{customerId}"
)
@ResultType
(
MallCustomer
.
class
)
MallCustomer
findById
(
Long
customerId
);
MallCustomer
findById
(
@Param
(
"customerId"
)
Long
customerId
);
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/CompanyAuthService.java
View file @
4f2273ad
...
...
@@ -5,6 +5,8 @@ import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq;
import
com.jz.common.utils.Result
;
import
com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.service
...
...
@@ -19,29 +21,33 @@ public interface CompanyAuthService {
/**
* 添加企业认证
* @param req
* @param request
* @return
*/
Result
addCompanyData
(
CompanyAddReq
req
);
Result
addCompanyData
(
CompanyAddReq
req
,
HttpServletRequest
request
);
/**
* 查询企业认证详情
* @param request
* @param type
* @return
*/
Result
selectCompany
(
String
type
);
Result
selectCompany
(
String
type
,
HttpServletRequest
request
);
/**
* 更新企业信息
* @param request
* @param req
* @return
*/
Result
updateCompanyInfo
(
CompanyUpdateReq
req
);
Result
updateCompanyInfo
(
CompanyUpdateReq
req
,
HttpServletRequest
request
);
/**
* 校验当前用户是否已经企业认证
* @param request
* @return
*/
Result
checkCompanyInfo
();
Result
checkCompanyInfo
(
HttpServletRequest
request
);
}
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/LogInfoService.java
View file @
4f2273ad
...
...
@@ -6,6 +6,8 @@ import com.jz.common.utils.Result;
import
com.jz.dm.mall.moduls.controller.log.bean.LogInfoQueryReq
;
import
com.jz.dm.mall.moduls.controller.order.bean.OrderDto
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.service
...
...
@@ -19,10 +21,11 @@ import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
public
interface
LogInfoService
{
/**
* 获取用户调用日志列表
* @param request
* @param req
* @return
*/
Result
<
PageInfoResponse
<
PlatformLog
>>
getMallUserLogInfo
(
LogInfoQueryReq
req
);
Result
<
PageInfoResponse
<
PlatformLog
>>
getMallUserLogInfo
(
LogInfoQueryReq
req
,
HttpServletRequest
request
);
/**
* 获取商城用户日志信息详情
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/CompanyAuthServiceImpl.java
View file @
4f2273ad
package
com
.
jz
.
dm
.
mall
.
moduls
.
service
.
impl
;
import
com.jz.common.base.CurrentUser
;
import
com.jz.common.bean.MallCustomerApiDto
;
import
com.jz.common.constant.ResultCode
;
import
com.jz.common.constant.ResultMsg
;
import
com.jz.common.entity.Department
;
import
com.jz.common.enums.UserTypeEnum
;
import
com.jz.common.exception.ResponseException
;
import
com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq
;
import
com.jz.dm.mall.moduls.controller.company.dto.CompanyInfoDto
;
...
...
@@ -22,6 +25,7 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
/**
...
...
@@ -47,29 +51,29 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
/**
* 添加企业认证
*
*
@param request
* @param req
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRES_NEW
)
public
Result
addCompanyData
(
CompanyAddReq
req
)
{
//TODO 获取当前用户ID判断当前用户是否已经关联企业
// Long customerId = (Long) UserContextUtil.pop("customer_id");
Long
customerId
=
0L
;
if
(
null
==
customerId
)
{
public
Result
addCompanyData
(
CompanyAddReq
req
,
HttpServletRequest
request
)
{
//获取当前用户ID判断当前用户是否已经关联企业
MallCustomerApiDto
currentUser
=
CurrentUser
.
getCurrentUser
(
request
);
if
(
null
==
currentUser
)
{
return
Result
.
of_error
(
ResultMsg
.
USER_NOT_EXIST
);
}
MallCustomer
mallCustomer
=
mallCustomerDao
.
findById
(
cu
stomerId
);
MallCustomer
mallCustomer
=
mallCustomerDao
.
findById
(
cu
rrentUser
.
getCustomerId
()
);
if
(
null
==
mallCustomer
)
{
return
Result
.
of_error
(
ResultMsg
.
USER_NOT_EXIST
);
}
if
(
null
!=
mallCustomer
.
getDepartmentId
())
{
return
Result
.
of_error
(
"用户已关联企业,请勿重复操作"
);
}
req
.
setCustomerId
(
mallCustomer
.
getCustomerId
());
if
(
StringUtils
.
isNotBlank
(
req
.
getDepartmentName
())
&&
StringUtils
.
isNotBlank
(
req
.
getUnifiedCreditCode
()))
{
//企业名称 && 营业执照
req
.
setLoginId
(
mallCustomer
.
getCustomerId
());
req
.
setLoginName
(
currentUser
.
getCustomerName
());
if
(
StringUtils
.
isNotBlank
(
req
.
getDepartmentName
())
||
StringUtils
.
isNotBlank
(
req
.
getUnifiedCreditCode
()))
{
//企业名称 && 统一社会编码
Department
department
=
departmentDao
.
selectDepartmentData
(
req
);
if
(
null
!=
department
)
{
return
Result
.
of_error
(
"企业用户信息已存在"
);
...
...
@@ -81,14 +85,14 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
/**
* 查询企业认证详情
*
*
@param request
* @param type
* @return
*/
@Override
public
Result
selectCompany
(
String
type
)
{
//
TODO
查询用户判断用户是否认证
MallCustomer
currentUser
=
getCurrentUser
(
0L
);
public
Result
selectCompany
(
String
type
,
HttpServletRequest
request
)
{
// 查询用户判断用户是否认证
MallCustomer
currentUser
=
getCurrentUser
(
CurrentUser
.
getCustomerId
(
request
)
);
if
(
null
==
currentUser
)
{
return
Result
.
error
(
"当前用户信息不存在"
);
}
...
...
@@ -122,18 +126,18 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
/**
* 更新企业信息
*
*
@param request
* @param req
* @return
*/
@Override
public
Result
updateCompanyInfo
(
CompanyUpdateReq
req
)
{
Long
c
oustomId
=
0L
;
MallCustomer
currentUser
=
getCurrentUser
(
req
.
getCustomerId
()
);
public
Result
updateCompanyInfo
(
CompanyUpdateReq
req
,
HttpServletRequest
request
)
{
Long
c
ustomerId
=
CurrentUser
.
getCustomerId
(
request
)
;
MallCustomer
currentUser
=
getCurrentUser
(
customerId
);
if
(
null
==
currentUser
)
{
return
Result
.
of_error
(
ResultMsg
.
USER_NOT_EXIST
);
}
if
(!
req
.
getDepartmentId
().
equals
(
c
oustom
Id
))
{
if
(!
req
.
getDepartmentId
().
equals
(
c
ustomer
Id
))
{
return
Result
.
of_error
(
"更新企业用户信息与绑定企业信息不一致"
);
}
Department
department
=
new
Department
();
...
...
@@ -148,14 +152,12 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
/**
* 校验用户是否已经企业认证
*
*
@param request
* @return
*/
@Override
public
Result
checkCompanyInfo
()
{
//Todo 获取当前登录用户
Long
customId
=
0L
;
MallCustomer
currentUser
=
getCurrentUser
(
customId
);
public
Result
checkCompanyInfo
(
HttpServletRequest
request
)
{
MallCustomer
currentUser
=
getCurrentUser
(
CurrentUser
.
getCustomerId
(
request
));
if
(
null
==
currentUser
)
{
return
Result
.
of_success
(
ResultMsg
.
USER_NOT_EXIST
);
}
...
...
@@ -190,13 +192,13 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
throw
ResponseException
.
of_error
(
"初始化用户资产失败"
);
}
//更新用户企业信息
MallCustomer
mallCustomer
=
new
MallCustomer
();
mallCustomer
.
setCustomerId
(
req
.
getCustomer
Id
());
//用户ID
mallCustomer
.
setDepartmentId
(
departmentInset
.
getDepartmentId
());
mallCustomer
.
setUptTime
(
new
Date
());
mallCustomer
.
setUptPerson
(
req
.
getLoginName
());
if
(
mallCustomerDao
.
updateById
(
mallCustomer
)
!=
1
)
{
throw
ResponseException
.
of_error
(
"更新用户企业信息失败"
);
}
//
MallCustomer mallCustomer = new MallCustomer();
//mallCustomer.setCustomerId(req.getLogin
Id());//用户ID
//
mallCustomer.setDepartmentId(departmentInset.getDepartmentId());
//
mallCustomer.setUptTime(new Date());
//
mallCustomer.setUptPerson(req.getLoginName());
//
if (mallCustomerDao.updateById(mallCustomer) != 1) {
//
throw ResponseException.of_error("更新用户企业信息失败");
//
}
}
}
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/LogInfoServiceImpl.java
View file @
4f2273ad
...
...
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.jz.common.base.CurrentUser
;
import
com.jz.common.bean.MallCustomerApiDto
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.constant.Constants
;
import
com.jz.common.constant.ResultCode
;
...
...
@@ -20,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
...
...
@@ -40,13 +43,22 @@ public class LogInfoServiceImpl implements LogInfoService {
private
PlatformLogDao
platformLogDao
;
@Resource
private
MallCustomerDao
mallCustomerDao
;
/**
* 获取商城用户日志列表
* @param req
* @param request
* @return
*/
@Override
public
Result
<
PageInfoResponse
<
PlatformLog
>>
getMallUserLogInfo
(
LogInfoQueryReq
req
)
{
Long
customerId
=
0L
;
if
(
null
==
customerId
)
{
return
Result
.
of_error
(
ResultMsg
.
USER_NOT_EXIST
);
}
MallCustomer
mallCustomer
=
mallCustomerDao
.
findById
(
customerId
);
public
Result
<
PageInfoResponse
<
PlatformLog
>>
getMallUserLogInfo
(
LogInfoQueryReq
req
,
HttpServletRequest
request
)
{
//MallCustomerApiDto currentUser = CurrentUser.getCurrentUser(request);
//if (null == currentUser) {
// return Result.of_error(ResultMsg.USER_NOT_EXIST);
//}
MallCustomerApiDto
currentUser
=
new
MallCustomerApiDto
();
currentUser
.
setCustomerId
(
1L
);
MallCustomer
mallCustomer
=
mallCustomerDao
.
findById
(
currentUser
.
getCustomerId
());
if
(
null
==
mallCustomer
)
{
return
Result
.
of_error
(
ResultMsg
.
USER_NOT_EXIST
);
}
...
...
jz-dm-mall/src/main/resources/mapperconf/MallCustomerDao.xml
View file @
4f2273ad
...
...
@@ -185,4 +185,13 @@
from t_mall_customer
where customer_phone = #{telephone};
</select>
<select
id=
"findById"
resultType=
"com.jz.dm.mall.moduls.entity.MallCustomer"
>
SELECT customer_id AS customerId,
department_id AS departmentId,
password AS password,
FROM t_mall_customer
WHERE customer_id =#{customerId}
AND del_flag ='N'"
</select>
</mapper>
\ No newline at end of file
jz-dm-mall/src/main/resources/mapperconf/PlatformLogDao.xml
View file @
4f2273ad
<?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=
"com.jz.dm.mall.moduls.mapper.PlatformLogDao"
>
<resultMap
type=
"com.jz.dm.mall.moduls.entity.PlatformLog"
id=
"TPlatformLogMap"
>
<result
property=
"platformLogId"
column=
"platform_log_id"
jdbcType=
"INTEGER"
/>
<result
property=
"requestIp"
column=
"request_ip"
jdbcType=
"VARCHAR"
/>
<result
property=
"callerId"
column=
"caller_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"dataGoodsId"
column=
"data_goods_id"
jdbcType=
"INTEGER"
/>
<result
property=
"apiKey"
column=
"api_key"
jdbcType=
"VARCHAR"
/>
<result
property=
"requestParams"
column=
"request_params"
jdbcType=
"VARCHAR"
/>
<result
property=
"returnParams"
column=
"return_params"
jdbcType=
"VARCHAR"
/>
<result
property=
"requestUrl"
column=
"request_url"
jdbcType=
"VARCHAR"
/>
<result
property=
"requestTime"
column=
"request_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"serviceType"
column=
"service_type"
jdbcType=
"VARCHAR"
/>
<result
property=
"dataGoodsType"
column=
"data_goods_type"
jdbcType=
"VARCHAR"
/>
<result
property=
"downloadAddress"
column=
"download_address"
jdbcType=
"VARCHAR"
/>
<result
property=
"dataPrice"
column=
"data_price"
jdbcType=
"NUMERIC"
/>
<result
property=
"priceType"
column=
"price_type"
jdbcType=
"VARCHAR"
/>
<result
property=
"totalTimes"
column=
"total_times"
jdbcType=
"INTEGER"
/>
<result
property=
"usedTimes"
column=
"used_times"
jdbcType=
"INTEGER"
/>
<result
property=
"remainTimes"
column=
"remain_times"
jdbcType=
"INTEGER"
/>
<result
property=
"startTime"
column=
"start_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"endTime"
column=
"end_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"creTime"
column=
"cre_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"delFlag"
column=
"del_flag"
jdbcType=
"VARCHAR"
/>
</resultMap>
<select
id=
"listMallLogInfo"
resultType=
"com.jz.common.entity.PlatformLog"
>
<select
id=
"listMallLogInfo"
resultMap=
"TPlatformLogMap"
>
SELECT * FROM t_platform_log WHERE caller_id=#{customerId}
</select>
</mapper>
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/log/bean/ManageLogInfoQueryReq.java
0 → 100644
View file @
4f2273ad
package
com
.
jz
.
manage
.
moduls
.
controller
.
log
.
bean
;
import
com.jz.common.bean.BasePageBean
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.manage.moduls.controller.log.bean
* @PROJECT_NAME: jz-dm-parent
* @NAME: ManageLogInfoQueryReq
* @USER: key
* @DATE: 2020-12-4/10:31
* @DAY_NAME_SHORT: 周五
* @Description:
**/
@ApiModel
@Data
public
class
ManageLogInfoQueryReq
extends
BasePageBean
implements
Serializable
{
}
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