Commit b9f9f30f authored by zhangc's avatar zhangc

提交接口代码

parent 5caeba35
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>druid</artifactId> <artifactId>druid</artifactId>
<version>1.0.29</version>
</dependency> </dependency>
<!-- 提供mysql驱动 --> <!-- 提供mysql驱动 -->
...@@ -52,12 +51,7 @@ ...@@ -52,12 +51,7 @@
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
<version>4.5.6</version> <version>4.5.6</version>
</dependency> </dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
<!--lang3工具类--> <!--lang3工具类-->
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
...@@ -68,6 +62,12 @@ ...@@ -68,6 +62,12 @@
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
...@@ -75,10 +79,7 @@ ...@@ -75,10 +79,7 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--阿里云服务器短信平台--> <!--阿里云服务器短信平台-->
<dependency> <dependency>
<groupId>com.aliyun</groupId> <groupId>com.aliyun</groupId>
......
...@@ -84,7 +84,10 @@ ...@@ -84,7 +84,10 @@
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>mybatis-plus-boot-starter</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
<!--mybatis分页插件 --> <!--mybatis分页插件 -->
<dependency> <dependency>
<groupId>com.github.pagehelper</groupId> <groupId>com.github.pagehelper</groupId>
...@@ -125,9 +128,6 @@ ...@@ -125,9 +128,6 @@
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -42,8 +42,8 @@ public class CompanyAuthController { ...@@ -42,8 +42,8 @@ public class CompanyAuthController {
*/ */
@PostMapping("/add") @PostMapping("/add")
@ApiOperation(value = "企业信息提交") @ApiOperation(value = "企业信息提交")
public Mono<Result> addCompanyAuth(@RequestBody @Validated CompanyAddReq req) { public Mono<Result> addCompanyAuth(@RequestBody @Validated CompanyAddReq req,HttpServletRequest request) {
return Mono.fromSupplier(() -> companyAuthService.addCompanyData(req)); return Mono.fromSupplier(() -> companyAuthService.addCompanyData(req,request));
} }
/** /**
...@@ -53,12 +53,8 @@ public class CompanyAuthController { ...@@ -53,12 +53,8 @@ public class CompanyAuthController {
*/ */
@GetMapping("/findCompany") @GetMapping("/findCompany")
@ApiOperation(value = "企业认证信息查询") @ApiOperation(value = "企业认证信息查询")
public Mono<Result> selectCompany(@RequestParam(value = "type") String type) { public Mono<Result> selectCompany(@RequestParam(value = "type") String type,HttpServletRequest request) {
return Mono.fromSupplier(() ->{ return Mono.fromSupplier(() ->Result.of_success(companyAuthService.selectCompany(type,request)));
//TODO 获取当前登录用户
//httpRequest.getSession().getServletContext().getAttribute("customer_id");
return Result.ok(companyAuthService.selectCompany(type));
});
} }
/** /**
* @Description: 企业认证信息更新 * @Description: 企业认证信息更新
...@@ -67,8 +63,8 @@ public class CompanyAuthController { ...@@ -67,8 +63,8 @@ public class CompanyAuthController {
*/ */
@GetMapping("/updateCompany") @GetMapping("/updateCompany")
@ApiOperation(value = "企业认证信息更新") @ApiOperation(value = "企业认证信息更新")
public Mono<Result> updateCompany(@RequestBody @Validated CompanyUpdateReq req) { public Mono<Result> updateCompany(@RequestBody @Validated CompanyUpdateReq req,HttpServletRequest request) {
return Mono.fromSupplier(() ->companyAuthService.updateCompanyInfo(req)); return Mono.fromSupplier(() ->companyAuthService.updateCompanyInfo(req,request));
} }
/** /**
* @Description: 企业认证信息更新 * @Description: 企业认证信息更新
...@@ -77,7 +73,7 @@ public class CompanyAuthController { ...@@ -77,7 +73,7 @@ public class CompanyAuthController {
*/ */
@GetMapping("/checkCompany") @GetMapping("/checkCompany")
@ApiOperation(value = "企业认证信息校验") @ApiOperation(value = "企业认证信息校验")
public Mono<Result> checkCompany() { public Mono<Result> checkCompany(HttpServletRequest request) {
return Mono.fromSupplier(() ->companyAuthService.checkCompanyInfo()); return Mono.fromSupplier(() ->companyAuthService.checkCompanyInfo(request));
} }
} }
...@@ -60,7 +60,7 @@ public class CompanyAddReq implements Serializable { ...@@ -60,7 +60,7 @@ public class CompanyAddReq implements Serializable {
private String telephone; private String telephone;
@ApiModelProperty(name = "登录用户id",hidden = true) @ApiModelProperty(name = "登录用户id",hidden = true)
private Long customerId; private Long loginId;
@ApiModelProperty(name = "登录用户名称",hidden = true) @ApiModelProperty(name = "登录用户名称",hidden = true)
private String LoginName; private String LoginName;
......
...@@ -62,7 +62,7 @@ public class CompanyUpdateReq implements Serializable { ...@@ -62,7 +62,7 @@ public class CompanyUpdateReq implements Serializable {
private String telephone; private String telephone;
@ApiModelProperty(name = "登录用户id",hidden = true) @ApiModelProperty(name = "登录用户id",hidden = true)
private Long customerId; private Long loginId;
@ApiModelProperty(name = "登录用户名称",hidden = true) @ApiModelProperty(name = "登录用户名称",hidden = true)
private String loginName; private String loginName;
} }
...@@ -14,6 +14,8 @@ import org.springframework.validation.annotation.Validated; ...@@ -14,6 +14,8 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
import javax.servlet.http.HttpServletRequest;
/** /**
* @author ZC * @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.controller.log * @PACKAGE_NAME: com.jz.dm.mall.moduls.controller.log
...@@ -39,8 +41,8 @@ public class LogInfoController { ...@@ -39,8 +41,8 @@ public class LogInfoController {
*/ */
@PostMapping("/getMallLogInfo") @PostMapping("/getMallLogInfo")
@ApiOperation(value = "获取商城用户日志信息列表") @ApiOperation(value = "获取商城用户日志信息列表")
public Mono<Result<PageInfoResponse<PlatformLog>>> getLogInfo(@RequestBody @Validated LogInfoQueryReq req) { public Mono<Result<PageInfoResponse<PlatformLog>>> getLogInfo(@RequestBody @Validated LogInfoQueryReq req, HttpServletRequest request) {
return Mono.fromSupplier(() -> logInfoService.getMallUserLogInfo(req)); return Mono.fromSupplier(() -> logInfoService.getMallUserLogInfo(req,request));
} }
/** /**
......
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
...@@ -3,6 +3,7 @@ package com.jz.dm.mall.moduls.mapper; ...@@ -3,6 +3,7 @@ package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType; import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
...@@ -39,8 +40,6 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> { ...@@ -39,8 +40,6 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
* @param customerId * @param customerId
* @return * @return
*/ */
@Select("select * from t_mall_customer where customer_id =#{customerId}") MallCustomer findById(@Param("customerId") Long customerId);
@ResultType(MallCustomer.class)
MallCustomer findById(Long customerId);
} }
\ No newline at end of file
...@@ -5,6 +5,8 @@ import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq; ...@@ -5,6 +5,8 @@ import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq; import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq;
import javax.servlet.http.HttpServletRequest;
/** /**
* @author ZC * @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.service * @PACKAGE_NAME: com.jz.dm.mall.moduls.service
...@@ -19,29 +21,33 @@ public interface CompanyAuthService { ...@@ -19,29 +21,33 @@ public interface CompanyAuthService {
/** /**
* 添加企业认证 * 添加企业认证
* @param req * @param req
* @param request
* @return * @return
*/ */
Result addCompanyData(CompanyAddReq req); Result addCompanyData(CompanyAddReq req, HttpServletRequest request);
/** /**
* 查询企业认证详情 * 查询企业认证详情
* @param request
* @param type * @param type
* @return * @return
*/ */
Result selectCompany(String type); Result selectCompany(String type,HttpServletRequest request);
/** /**
* 更新企业信息 * 更新企业信息
* @param request
* @param req * @param req
* @return * @return
*/ */
Result updateCompanyInfo(CompanyUpdateReq req); Result updateCompanyInfo(CompanyUpdateReq req,HttpServletRequest request);
/** /**
* 校验当前用户是否已经企业认证 * 校验当前用户是否已经企业认证
* @param request
* @return * @return
*/ */
Result checkCompanyInfo(); Result checkCompanyInfo(HttpServletRequest request);
} }
...@@ -6,6 +6,8 @@ import com.jz.common.utils.Result; ...@@ -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.log.bean.LogInfoQueryReq;
import com.jz.dm.mall.moduls.controller.order.bean.OrderDto; import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
import javax.servlet.http.HttpServletRequest;
/** /**
* @author ZC * @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.service * @PACKAGE_NAME: com.jz.dm.mall.moduls.service
...@@ -19,10 +21,11 @@ import com.jz.dm.mall.moduls.controller.order.bean.OrderDto; ...@@ -19,10 +21,11 @@ import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
public interface LogInfoService { public interface LogInfoService {
/** /**
* 获取用户调用日志列表 * 获取用户调用日志列表
* @param request
* @param req * @param req
* @return * @return
*/ */
Result<PageInfoResponse<PlatformLog>> getMallUserLogInfo(LogInfoQueryReq req); Result<PageInfoResponse<PlatformLog>> getMallUserLogInfo(LogInfoQueryReq req, HttpServletRequest request);
/** /**
* 获取商城用户日志信息详情 * 获取商城用户日志信息详情
......
package com.jz.dm.mall.moduls.service.impl; 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.ResultCode;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.entity.Department; import com.jz.common.entity.Department;
import com.jz.common.enums.UserTypeEnum;
import com.jz.common.exception.ResponseException; import com.jz.common.exception.ResponseException;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq; import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq;
import com.jz.dm.mall.moduls.controller.company.dto.CompanyInfoDto; import com.jz.dm.mall.moduls.controller.company.dto.CompanyInfoDto;
...@@ -22,6 +25,7 @@ import org.springframework.transaction.annotation.Propagation; ...@@ -22,6 +25,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date; import java.util.Date;
/** /**
...@@ -47,29 +51,29 @@ public class CompanyAuthServiceImpl implements CompanyAuthService { ...@@ -47,29 +51,29 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
/** /**
* 添加企业认证 * 添加企业认证
* * @param request
* @param req * @param req
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Result addCompanyData(CompanyAddReq req) { public Result addCompanyData(CompanyAddReq req, HttpServletRequest request) {
//TODO 获取当前用户ID判断当前用户是否已经关联企业 //获取当前用户ID判断当前用户是否已经关联企业
// Long customerId = (Long) UserContextUtil.pop("customer_id"); MallCustomerApiDto currentUser = CurrentUser.getCurrentUser(request);
Long customerId = 0L; if (null == currentUser) {
if (null == customerId) {
return Result.of_error(ResultMsg.USER_NOT_EXIST); return Result.of_error(ResultMsg.USER_NOT_EXIST);
} }
MallCustomer mallCustomer = mallCustomerDao.findById(customerId); MallCustomer mallCustomer = mallCustomerDao.findById(currentUser.getCustomerId());
if (null == mallCustomer) { if (null == mallCustomer) {
return Result.of_error(ResultMsg.USER_NOT_EXIST); return Result.of_error(ResultMsg.USER_NOT_EXIST);
} }
if (null != mallCustomer.getDepartmentId()) { if (null != mallCustomer.getDepartmentId()) {
return Result.of_error("用户已关联企业,请勿重复操作"); return Result.of_error("用户已关联企业,请勿重复操作");
} }
req.setCustomerId(mallCustomer.getCustomerId()); req.setLoginId(mallCustomer.getCustomerId());
if (StringUtils.isNotBlank(req.getDepartmentName()) && req.setLoginName(currentUser.getCustomerName());
StringUtils.isNotBlank(req.getUnifiedCreditCode())) { //企业名称 && 营业执照 if (StringUtils.isNotBlank(req.getDepartmentName()) ||
StringUtils.isNotBlank(req.getUnifiedCreditCode())) { //企业名称 && 统一社会编码
Department department = departmentDao.selectDepartmentData(req); Department department = departmentDao.selectDepartmentData(req);
if (null != department) { if (null != department) {
return Result.of_error("企业用户信息已存在"); return Result.of_error("企业用户信息已存在");
...@@ -81,14 +85,14 @@ public class CompanyAuthServiceImpl implements CompanyAuthService { ...@@ -81,14 +85,14 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
/** /**
* 查询企业认证详情 * 查询企业认证详情
* * @param request
* @param type * @param type
* @return * @return
*/ */
@Override @Override
public Result selectCompany(String type) { public Result selectCompany(String type,HttpServletRequest request) {
// TODO 查询用户判断用户是否认证 // 查询用户判断用户是否认证
MallCustomer currentUser = getCurrentUser(0L); MallCustomer currentUser = getCurrentUser(CurrentUser.getCustomerId(request));
if (null == currentUser) { if (null == currentUser) {
return Result.error("当前用户信息不存在"); return Result.error("当前用户信息不存在");
} }
...@@ -122,18 +126,18 @@ public class CompanyAuthServiceImpl implements CompanyAuthService { ...@@ -122,18 +126,18 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
/** /**
* 更新企业信息 * 更新企业信息
* * @param request
* @param req * @param req
* @return * @return
*/ */
@Override @Override
public Result updateCompanyInfo(CompanyUpdateReq req) { public Result updateCompanyInfo(CompanyUpdateReq req,HttpServletRequest request) {
Long coustomId = 0L; Long customerId = CurrentUser.getCustomerId(request);
MallCustomer currentUser = getCurrentUser(req.getCustomerId()); MallCustomer currentUser = getCurrentUser(customerId);
if (null == currentUser) { if (null == currentUser) {
return Result.of_error(ResultMsg.USER_NOT_EXIST); return Result.of_error(ResultMsg.USER_NOT_EXIST);
} }
if (!req.getDepartmentId().equals(coustomId)) { if (!req.getDepartmentId().equals(customerId)) {
return Result.of_error("更新企业用户信息与绑定企业信息不一致"); return Result.of_error("更新企业用户信息与绑定企业信息不一致");
} }
Department department = new Department(); Department department = new Department();
...@@ -148,14 +152,12 @@ public class CompanyAuthServiceImpl implements CompanyAuthService { ...@@ -148,14 +152,12 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
/** /**
* 校验用户是否已经企业认证 * 校验用户是否已经企业认证
* * @param request
* @return * @return
*/ */
@Override @Override
public Result checkCompanyInfo() { public Result checkCompanyInfo(HttpServletRequest request) {
//Todo 获取当前登录用户 MallCustomer currentUser = getCurrentUser(CurrentUser.getCustomerId(request));
Long customId = 0L;
MallCustomer currentUser = getCurrentUser(customId);
if (null == currentUser) { if (null == currentUser) {
return Result.of_success(ResultMsg.USER_NOT_EXIST); return Result.of_success(ResultMsg.USER_NOT_EXIST);
} }
...@@ -190,13 +192,13 @@ public class CompanyAuthServiceImpl implements CompanyAuthService { ...@@ -190,13 +192,13 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
throw ResponseException.of_error("初始化用户资产失败"); throw ResponseException.of_error("初始化用户资产失败");
} }
//更新用户企业信息 //更新用户企业信息
MallCustomer mallCustomer = new MallCustomer(); //MallCustomer mallCustomer = new MallCustomer();
mallCustomer.setCustomerId(req.getCustomerId());//用户ID //mallCustomer.setCustomerId(req.getLoginId());//用户ID
mallCustomer.setDepartmentId(departmentInset.getDepartmentId()); //mallCustomer.setDepartmentId(departmentInset.getDepartmentId());
mallCustomer.setUptTime(new Date()); //mallCustomer.setUptTime(new Date());
mallCustomer.setUptPerson(req.getLoginName()); //mallCustomer.setUptPerson(req.getLoginName());
if (mallCustomerDao.updateById(mallCustomer) != 1) { //if (mallCustomerDao.updateById(mallCustomer) != 1) {
throw ResponseException.of_error("更新用户企业信息失败"); // throw ResponseException.of_error("更新用户企业信息失败");
} //}
} }
} }
...@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; 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.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;
...@@ -20,6 +22,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -20,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
/** /**
...@@ -40,13 +43,22 @@ public class LogInfoServiceImpl implements LogInfoService { ...@@ -40,13 +43,22 @@ public class LogInfoServiceImpl implements LogInfoService {
private PlatformLogDao platformLogDao; private PlatformLogDao platformLogDao;
@Resource @Resource
private MallCustomerDao mallCustomerDao; private MallCustomerDao mallCustomerDao;
/**
* 获取商城用户日志列表
* @param req
* @param request
* @return
*/
@Override @Override
public Result<PageInfoResponse<PlatformLog>> getMallUserLogInfo(LogInfoQueryReq req) { public Result<PageInfoResponse<PlatformLog>> getMallUserLogInfo(LogInfoQueryReq req, HttpServletRequest request) {
Long customerId =0L; //MallCustomerApiDto currentUser = CurrentUser.getCurrentUser(request);
if (null == customerId) { //if (null == currentUser) {
return Result.of_error(ResultMsg.USER_NOT_EXIST); // return Result.of_error(ResultMsg.USER_NOT_EXIST);
} //}
MallCustomer mallCustomer = mallCustomerDao.findById(customerId); MallCustomerApiDto currentUser =new MallCustomerApiDto();
currentUser.setCustomerId(1L);
MallCustomer mallCustomer = mallCustomerDao.findById(currentUser.getCustomerId());
if (null == mallCustomer) { if (null == mallCustomer) {
return Result.of_error(ResultMsg.USER_NOT_EXIST); return Result.of_error(ResultMsg.USER_NOT_EXIST);
} }
......
...@@ -178,4 +178,13 @@ ...@@ -178,4 +178,13 @@
from t_mall_customer from t_mall_customer
where customer_phone = #{username}; where customer_phone = #{username};
</select> </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> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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"> <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" resultMap="TPlatformLogMap">
<select id="listMallLogInfo" resultType="com.jz.common.entity.PlatformLog"> SELECT * FROM t_platform_log WHERE caller_id=#{customerId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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 {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment