Commit 58e75822 authored by ysongq's avatar ysongq

ggg

parents 9b9b4d30 4f2273ad
alter table t_finance_customer_assets add remark text COMMENT '备注'; alter table t_finance_customer_assets add remark text COMMENT '备注';
alter table t_platform_log add caller_type char(2) NOT NULL COMMENT '调用类型:01商城用户,02平台用户'; alter table t_platform_log add caller_type char(2) NOT NULL COMMENT '调用类型:01商城用户,02平台用户';
\ No newline at end of file alter table t_finance_trade_flow add assets_id Bigint(20) default NULL COMMENT'企业资产id';
\ No newline at end of file
...@@ -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>
......
package com.jz.common.bean; package com.jz.common.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**分页信息封装 /**分页信息封装
* @author ybz * @author ybz
* *
*/ */
@ApiModel(value = "分页参数对象", description = "分页参数对象")
public class BasePageBean { public class BasePageBean {
@ApiModelProperty(value = "当前页码值")
private int pageNum = 1; private int pageNum = 1;
@ApiModelProperty(value = "每页条数")
private int pageSize = 10; private int pageSize = 10;
public int getPageNum() { public int getPageNum() {
......
...@@ -43,4 +43,15 @@ public class CommonsUtil implements Serializable { ...@@ -43,4 +43,15 @@ public class CommonsUtil implements Serializable {
} }
return dt; return dt;
} }
/**
* 按指定格式返回字符串当前日期时间
*
* @return
*/
public static String getDate2String(String curDateFormat,Date date) {
SimpleDateFormat sdf = new SimpleDateFormat(curDateFormat);
String sd = sdf.format(date);
return sd;
}
} }
...@@ -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;
} }
package com.jz.dm.mall.moduls.controller.finance; package com.jz.dm.mall.moduls.controller.finance;
import com.jz.common.base.BaseController; import com.jz.common.base.BaseController;
import com.jz.common.bean.BasePageBean;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto; import com.jz.dm.mall.moduls.controller.finance.bean.*;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerBalanceRequest;
import com.jz.dm.mall.moduls.service.FinanceTradeFlowService; import com.jz.dm.mall.moduls.service.FinanceTradeFlowService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -26,7 +26,7 @@ import java.util.Map; ...@@ -26,7 +26,7 @@ import java.util.Map;
*/ */
@RestController @RestController
@RequestMapping("/financeTradeFlow") @RequestMapping("/financeTradeFlow")
@Api(tags = "利润中心") @Api(tags = "商城--利润中心")
public class FinanceTradeFlowController extends BaseController { public class FinanceTradeFlowController extends BaseController {
/** /**
* 服务对象 * 服务对象
...@@ -63,14 +63,14 @@ public class FinanceTradeFlowController extends BaseController { ...@@ -63,14 +63,14 @@ public class FinanceTradeFlowController extends BaseController {
@ApiOperation(value = "充值----保存充值金额", notes = "保存充值金额") @ApiOperation(value = "充值----保存充值金额", notes = "保存充值金额")
@ApiParam() @ApiParam()
public Result<Object> uptAccountMoney(@RequestBody FinanceCustomerBalanceRequest customerBalanceRequest, HttpServletRequest requset) throws Exception { public Result<Object> uptAccountMoney(@RequestBody FinanceCustomerBalanceRequest customerBalanceRequest, HttpServletRequest requset) throws Exception {
if(StringUtils.isEmpty(customerBalanceRequest.getAssetsId().toString())){ //企业资产id if (StringUtils.isEmpty(customerBalanceRequest.getAssetsId().toString())) { //企业资产id
return Result.error("参数不能为空!"); return Result.error("参数不能为空!");
} }
if(StringUtils.isEmpty(customerBalanceRequest.getBalanceMoney().toString())){ //充值金额 if (StringUtils.isEmpty(customerBalanceRequest.getBalanceMoney().toString())) { //充值金额
return Result.error("参数不能为空!"); return Result.error("参数不能为空!");
} }
Boolean str = financeTradeFlowService.uptAccountMoney(customerBalanceRequest); Boolean str = financeTradeFlowService.uptAccountMoney(customerBalanceRequest);
if(!str){ if (!str) {
return Result.error("提交失败!"); return Result.error("提交失败!");
} }
return Result.ok("提交成功!"); return Result.ok("提交成功!");
...@@ -110,7 +110,7 @@ public class FinanceTradeFlowController extends BaseController { ...@@ -110,7 +110,7 @@ public class FinanceTradeFlowController extends BaseController {
map.put("assetsId", 1); //企业资产账户id map.put("assetsId", 1); //企业资产账户id
map.put("departmentId", 1); //企业ID map.put("departmentId", 1); //企业ID
FinanceCashOutDto dto = financeTradeFlowService.getCashOutAuditStutas(map); FinanceCashOutDto dto = financeTradeFlowService.getCashOutAuditStutas(map);
if(dto.getCashOutMoney() != null){ if (dto.getCashOutMoney() != null) {
result.setData(dto.getCashOutMoney()); result.setData(dto.getCashOutMoney());
result.setMessage("存在提现审核记录!"); result.setMessage("存在提现审核记录!");
} else { } else {
...@@ -128,30 +128,58 @@ public class FinanceTradeFlowController extends BaseController { ...@@ -128,30 +128,58 @@ public class FinanceTradeFlowController extends BaseController {
@PostMapping(value = "/addCashOutMoney") @PostMapping(value = "/addCashOutMoney")
@ApiOperation(value = "提现----保存提现金额", notes = "保存提现金额") @ApiOperation(value = "提现----保存提现金额", notes = "保存提现金额")
public Result<Object> addCashOutMoney(@RequestBody FinanceCashOutRequest financeCashOutRequest, HttpServletRequest requset) throws Exception { public Result<Object> addCashOutMoney(@RequestBody FinanceCashOutRequest financeCashOutRequest, HttpServletRequest requset) throws Exception {
if(financeCashOutRequest.getCashOutMoney() == null){ //提现金额 if (financeCashOutRequest.getCashOutMoney() == null) { //提现金额
return Result.error("参数不能为空!"); return Result.error("参数不能为空!");
} }
Result<Object> result = financeTradeFlowService.addCashOutMoney(financeCashOutRequest); Result<Object> result = financeTradeFlowService.addCashOutMoney(financeCashOutRequest);
return result; return result;
} }
/** /**
* 订单管理列表(分页查询) * 收支情况(分页查询)
* *
* @author Bellamy * @author Bellamy
* @since 2020-12-04
*/ */
/*@PostMapping(value = "/list") @PostMapping(value = "/receiveListInfo")
@ApiOperation(value = "订单管理列表(分页查询)", notes = "订单列表(分页查询)") @ApiOperation(value = "收支情况(分页查询)", notes = "收支情况(分页查询)")
public PageInfoResponse<FinanceTradeFlow> queryPageList(HttpServletRequest req) throws Exception { public PageInfoResponse<FinanceTradeFlowDto> queryPageList(@RequestBody BasePageBean pageBean, HttpServletRequest req) throws Exception {
PageInfoResponse<FinanceTradeFlow> pageInfo = new PageInfoResponse<FinanceTradeFlow>(); PageInfoResponse<FinanceTradeFlowDto> pageInfo = new PageInfoResponse<FinanceTradeFlowDto>();
Map map = new HashMap(); Map map = new HashMap();
try { try {
pageInfo = financeTradeFlowService.findListTradeFlow(map,req); pageInfo = financeTradeFlowService.findListScTradeFlow(pageBean, req);
} catch (Exception e) { } catch (Exception e) {
pageInfo.setMessage("查询失败"); pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE); pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace(); e.printStackTrace();
} }
return pageInfo; return pageInfo;
}*/ }
/**
* 点击查看--每天--收支情况(分页查询)
*
* @author Bellamy
* @since 2020-12-04
*/
@PostMapping(value = "/everyPageLisInfo")
@ApiOperation(value = "点击查看--每天--收支情况(分页查询)", notes = "点击查看--每天--收支情况(分页查询)")
public PageInfoResponse<EveryTradeFlowDto> queryEveryDayPageList(@RequestBody EveryTradeFlowRequest everyTradeFlowRequest, HttpServletRequest req) throws Exception {
PageInfoResponse<EveryTradeFlowDto> pageInfo = new PageInfoResponse<EveryTradeFlowDto>();
if (everyTradeFlowRequest.getCreTime() == null || "".equals(everyTradeFlowRequest.getCreTime())) {
pageInfo.setMessage("参数为空");
pageInfo.setCode(Constants.FAILURE_CODE);
return pageInfo;
}
Map map = new HashMap();
try {
pageInfo = financeTradeFlowService.findListEveryDayScInfo(everyTradeFlowRequest, req);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.finance.bean;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
/**
* 企业客户交易流水 收支情况
*
* @author makejava
* @since 2020-12-01 10:41:39
*/
@ApiModel(value = "每天收支情况明细返回对象", description = "每天收支情况明细返回对象")
public class EveryTradeFlowDto {
/**
* 交易流水编号
*/
@ApiModelProperty(value = "交易流水编号")
private String tradeFlowNumber;
/**
* 交易流水金额
*/
@ApiModelProperty(value = "交易流水金额")
private BigDecimal tradeMoney;
/**
* 交易类型:01提现,02充值,03付款,04收款,05续费
*/
@ApiModelProperty(value = "交易类型")
private String tradeType;
/**
* 交易类型id
*/
@ApiModelProperty(value = "交易类型:01提现,02充值,03付款,04收款,05续费")
private String tradeTypeId;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern="HH:mm:ss")
private Date creTime;
/**
* 数据名称
*/
@ApiModelProperty(value = "数据名称")
private String dataName;
/**
* 订单方式
*/
@ApiModelProperty(value = "订单方式")
private String purchaseMethod;
/**
* 余额
*/
@ApiModelProperty(value = "余额")
private BigDecimal balanceMoney;
public String getTradeFlowNumber() {
return tradeFlowNumber;
}
public void setTradeFlowNumber(String tradeFlowNumber) {
this.tradeFlowNumber = tradeFlowNumber;
}
public BigDecimal getTradeMoney() {
return tradeMoney;
}
public void setTradeMoney(BigDecimal tradeMoney) {
this.tradeMoney = tradeMoney;
}
public String getTradeType() {
return tradeType;
}
public void setTradeType(String tradeType) {
this.tradeType = tradeType;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getTradeTypeId() {
return tradeTypeId;
}
public void setTradeTypeId(String tradeTypeId) {
this.tradeTypeId = tradeTypeId;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getPurchaseMethod() {
return purchaseMethod;
}
public void setPurchaseMethod(String purchaseMethod) {
this.purchaseMethod = purchaseMethod;
}
public BigDecimal getBalanceMoney() {
return balanceMoney;
}
public void setBalanceMoney(BigDecimal balanceMoney) {
this.balanceMoney = balanceMoney;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.finance.bean;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 每天收支情况参数接收对象
*
* @author Bellamy
* @since 2020-12-04 10:41:39
*/
@ApiModel(value = "每天收支情况参数接收对象", description = "每天收支情况参数接收对象")
public class EveryTradeFlowRequest extends BasePageBean {
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间 yyyy-MM-dd")
private String creTime;
public String getCreTime() {
return creTime;
}
public void setCreTime(String creTime) {
this.creTime = creTime;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.finance.bean;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 企业客户交易流水(TFinanceTradeFlow)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:39
*/
@ApiModel(value = "收支情况返回对象", description = "收支情况返回对象")
public class FinanceTradeFlowDto implements Serializable {
private static final long serialVersionUID = -55257582310832314L;
/**
* 收入金额
*/
@ApiModelProperty(value = "收入金额")
private BigDecimal receiveMoey;
/**
* 提现金额
*/
@ApiModelProperty(value = "提现金额")
private BigDecimal cashOutMoney;
/**
* 充值金额
*/
@ApiModelProperty(value = "充值金额")
private BigDecimal rechargeMoney;
/**
* 支出金额
*/
@ApiModelProperty(value = "支出金额")
private BigDecimal payMoey;
/**
* 结余
*/
@ApiModelProperty(value = "结余")
private BigDecimal balanceMoney;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern="yyyy-MM-dd")
private Date creTime;
public BigDecimal getReceiveMoey() {
return receiveMoey;
}
public void setReceiveMoey(BigDecimal receiveMoey) {
this.receiveMoey = receiveMoey;
}
public BigDecimal getCashOutMoney() {
return cashOutMoney;
}
public void setCashOutMoney(BigDecimal cashOutMoney) {
this.cashOutMoney = cashOutMoney;
}
public BigDecimal getRechargeMoney() {
return rechargeMoney;
}
public void setRechargeMoney(BigDecimal rechargeMoney) {
this.rechargeMoney = rechargeMoney;
}
public BigDecimal getPayMoey() {
return payMoey;
}
public void setPayMoey(BigDecimal payMoey) {
this.payMoey = payMoey;
}
public BigDecimal getBalanceMoney() {
return balanceMoney;
}
public void setBalanceMoney(BigDecimal balanceMoney) {
this.balanceMoney = balanceMoney;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
}
\ No newline at end of file
...@@ -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
package com.jz.dm.mall.moduls.mapper; 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.controller.finance.bean.EveryTradeFlowDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto; import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto; import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceTradeFlowDto;
import com.jz.dm.mall.moduls.entity.FinanceCashOut; import com.jz.dm.mall.moduls.entity.FinanceCashOut;
import com.jz.dm.mall.moduls.entity.FinanceTradeFlow; import com.jz.dm.mall.moduls.entity.FinanceTradeFlow;
...@@ -24,4 +26,8 @@ public interface FinanceTradeFlowDao extends BaseMapper<FinanceTradeFlow> { ...@@ -24,4 +26,8 @@ public interface FinanceTradeFlowDao extends BaseMapper<FinanceTradeFlow> {
List<FinanceCashOutDto> getCashOutAuditStutas(Map map) throws Exception; List<FinanceCashOutDto> getCashOutAuditStutas(Map map) throws Exception;
int addCashOutMoney(FinanceCashOut financeCashOut) throws Exception; int addCashOutMoney(FinanceCashOut financeCashOut) throws Exception;
List<FinanceTradeFlowDto> findListScTradeFlow(Map param) throws Exception;
List<EveryTradeFlowDto> findListEveryDayScInfo(Map param) throws Exception;
} }
\ No newline at end of file
...@@ -2,7 +2,14 @@ package com.jz.dm.mall.moduls.mapper; ...@@ -2,7 +2,14 @@ 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;
<<<<<<< HEAD
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
=======
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
>>>>>>> 4f2273addb37e5eb2f1b255fb4f521ccb462856f
import java.util.Map; import java.util.Map;
...@@ -49,9 +56,7 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> { ...@@ -49,9 +56,7 @@ 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);
@Update(" update t_mall_customer set password = #{password} where customer_account = #{customer_account}") @Update(" update t_mall_customer set password = #{password} where customer_account = #{customer_account}")
......
...@@ -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);
} }
package com.jz.dm.mall.moduls.service; package com.jz.dm.mall.moduls.service;
import com.jz.common.bean.BasePageBean;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto; import com.jz.dm.mall.moduls.controller.finance.bean.*;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerBalanceRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.Map; import java.util.Map;
/** /**
...@@ -24,4 +24,8 @@ public interface FinanceTradeFlowService { ...@@ -24,4 +24,8 @@ public interface FinanceTradeFlowService {
FinanceCashOutDto getCashOutAuditStutas(Map map) throws Exception; FinanceCashOutDto getCashOutAuditStutas(Map map) throws Exception;
Result<Object> addCashOutMoney(FinanceCashOutRequest financeCashOutRequest) throws Exception; Result<Object> addCashOutMoney(FinanceCashOutRequest financeCashOutRequest) throws Exception;
PageInfoResponse<FinanceTradeFlowDto> findListScTradeFlow(BasePageBean pageBean, HttpServletRequest req) throws Exception;
PageInfoResponse<EveryTradeFlowDto> findListEveryDayScInfo(EveryTradeFlowRequest everyTradeFlowRequest, HttpServletRequest req) throws Exception;
} }
\ No newline at end of file
...@@ -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("更新用户企业信息失败");
} //}
} }
} }
package com.jz.dm.mall.moduls.service.impl; package com.jz.dm.mall.moduls.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.BasePageBean;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.enums.AuditStatusEnum; import com.jz.common.enums.AuditStatusEnum;
import com.jz.common.utils.CommonsUtil;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto; import com.jz.dm.mall.moduls.controller.finance.bean.*;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerBalanceRequest;
import com.jz.dm.mall.moduls.entity.FinanceCashOut; import com.jz.dm.mall.moduls.entity.FinanceCashOut;
import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets; import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets;
import com.jz.dm.mall.moduls.entity.FinanceCustomerBalance; import com.jz.dm.mall.moduls.entity.FinanceCustomerBalance;
import com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao; import com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao;
import com.jz.dm.mall.moduls.mapper.FinanceTradeFlowDao; import com.jz.dm.mall.moduls.mapper.FinanceTradeFlowDao;
import com.jz.dm.mall.moduls.service.FinanceTradeFlowService; import com.jz.dm.mall.moduls.service.FinanceTradeFlowService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
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 org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -124,11 +129,47 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService { ...@@ -124,11 +129,47 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService {
return result; return result;
} }
} else { } else {
result.setMessage("提交失败!"); result.setMessage("提现金额必须小于等于可用金额!");
result.setCode(500); result.setCode(500);
return result; return result;
} }
} }
return result; return result;
} }
@Override
public PageInfoResponse<FinanceTradeFlowDto> findListScTradeFlow(BasePageBean pageBean, HttpServletRequest req) throws Exception {
PageInfoResponse<FinanceTradeFlowDto> pageInfoResponse = new PageInfoResponse<>();
PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize());
Map param = new HashMap();
//param.put("assetsId",assetsId); //企业资产id
List<FinanceTradeFlowDto> list = financeTradeFlowDao.findListScTradeFlow(param);
PageInfo<FinanceTradeFlowDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
@Override
public PageInfoResponse<EveryTradeFlowDto> findListEveryDayScInfo(EveryTradeFlowRequest everyTradeFlowRequest, HttpServletRequest req) throws Exception {
PageInfoResponse<EveryTradeFlowDto> pageInfoResponse = new PageInfoResponse<>();
PageHelper.startPage(everyTradeFlowRequest.getPageNum(), everyTradeFlowRequest.getPageSize());
Map param = new HashMap();
//商品分类id(行业)
if (!StringUtils.isEmpty(everyTradeFlowRequest.getCreTime())) {
param.put("creTime", everyTradeFlowRequest.getCreTime());
}
//param.put("assetsId",assetsId); //企业资产id
List<EveryTradeFlowDto> list = financeTradeFlowDao.findListEveryDayScInfo(param);
PageInfo<EveryTradeFlowDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
} }
\ No newline at end of file
...@@ -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);
} }
......
...@@ -136,6 +136,9 @@ ...@@ -136,6 +136,9 @@
<if test="totalMoney != null"> <if test="totalMoney != null">
total_money = #{totalMoney}, total_money = #{totalMoney},
</if> </if>
<if test="frozenMoney != null">
frozen_money = #{frozenMoney},
</if>
<if test="uptTime != null"> <if test="uptTime != null">
upt_time = #{uptTime}, upt_time = #{uptTime},
</if> </if>
......
...@@ -35,4 +35,56 @@ ...@@ -35,4 +35,56 @@
#{payTime}, #{payPerson}, #{remark}, #{auditStatus}, #{crePerson}, #{creTime}, #{delFlag}) #{payTime}, #{payPerson}, #{remark}, #{auditStatus}, #{crePerson}, #{creTime}, #{delFlag})
</insert> </insert>
<!--商城利润中心每天收支情况-->
<select id="findListScTradeFlow" resultType="com.jz.dm.mall.moduls.controller.finance.bean.FinanceTradeFlowDto" parameterType="map">
select
sum(case when a.tradeType='01' then a.tradeMoney else 0 end) cashOutMoney,
sum(case when a.tradeType='02' then a.tradeMoney else 0 end) rechargeMoney,
sum(case when a.tradeType='03' then a.tradeMoney else 0 end) payMoey,
sum(case when a.tradeType='04' then a.tradeMoney else 0 end) receiveMoey,
a.creTime,
a.balanceMoney
from(
select
t.trade_type as tradeType,
t.trade_money as tradeMoney,
t.balance_money as balanceMoney,
date_format(t.cre_time,'%Y-%m-%d') as creTime
from t_finance_trade_flow t
inner join t_finance_customer_assets t1 on t1.assets_id=t.assets_id
where 1=1 and date_format(NOW(),'%Y-%m-%d') > date_format(t.cre_time,'%Y-%m-%d')
<if test="assetsId != null">and t.assets_id = #{assetsId}</if>
) a
group by a.creTime
order by a.creTime desc
</select>
<!--商城利润中心每天收支情况明细-->
<select id="findListEveryDayScInfo" resultType="com.jz.dm.mall.moduls.controller.finance.bean.EveryTradeFlowDto" parameterType="map">
select
t.trade_flow_number as tradeFlowNumber,
(case when t.trade_type ='01' then '提现' when t.trade_type ='02' then '充值' when t.trade_type ='03' then '支付'
when t.trade_type ='04' then '收入' end) as tradeType,
t.trade_type as tradeTypeId,
t.cre_time as creTime,
t.trade_money as tradeMoney,
t.balance_money as balanceMoney,
a.data_name as dataName,
(case when a.purchase_method ='01' then '年' when a.purchase_method ='02' then '季' when a.purchase_method ='03' then '月'
when a.purchase_method ='04' then '次' end) as purchaseMethod
from t_finance_trade_flow t
left join (
select
t1.order_id,
t3.data_name,
t1.purchase_method
from t_order_goods_info t2
inner join t_order t1 on t1.order_id=t2.order_id
inner join t_data_goods t3 on t2.data_goods_id=t3.data_goods_id
) a on a.order_id=t.order_id
where 1=1
<if test="assetsId != null">and t.assets_id = #{assetsId}</if>
<if test="creTime != null">and date_format(t.cre_time,'%Y-%m-%d')= #{creTime}</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -185,4 +185,13 @@ ...@@ -185,4 +185,13 @@
from t_mall_customer from t_mall_customer
where customer_phone = #{telephone}; where customer_phone = #{telephone};
</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