Commit 6d90857e authored by zhangc's avatar zhangc

Merge branch 'dm_dev' of gitlab.ioubuy.cn:yaobenzhang/dm_project into dm_dev

 Conflicts:
	jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/mapper/MallCustomerDao.java
parents f0396d33 b153b3ad
package com.jz.dm.mall.moduls.controller.finance;
import com.jz.common.base.BaseController;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
import com.jz.dm.mall.moduls.service.FinanceTradeFlowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* 企业客户交易流水(TFinanceTradeFlow)表控制层
*
* @author Bellamy
* @since 2020-12-01 10:41:39
*/
@RestController
@RequestMapping("/financeTradeFlow")
@Api(tags = "利润中心")
public class FinanceTradeFlowController extends BaseController {
/**
* 服务对象
*/
@Autowired
private FinanceTradeFlowService financeTradeFlowService;
/**
* 订单管理列表(分页查询)
*
* @author Bellamy
*/
@GetMapping(value = "/getAccountMoney")
@ApiOperation(value = "充值----获取账户余额", notes = "获取账户余额")
public Result<OrderDto> getAccountMoney(HttpServletRequest req) throws Exception {
return new Result<>();
}
}
\ No newline at end of file
......@@ -2,18 +2,20 @@ package com.jz.dm.mall.moduls.controller.order;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
import com.jz.dm.mall.moduls.controller.order.bean.OrderRequest;
import com.jz.dm.mall.moduls.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
* 订单表(TOrder)表控制层
......@@ -29,14 +31,19 @@ public class OrderController {
* 服务对象
*/
@Autowired
private OrderService tOrderService;
private OrderService orderService;
/**
* 订单管理列表(分页查询)
*
* @author Bellamy
*/
@PostMapping(value = "/list")
@ApiOperation(value = "订单管理列表(分页查询)", notes = "订单列表(分页查询)")
public PageInfoResponse<OrderDto> queryPageList(@RequestBody OrderRequest orderRequest, HttpServletRequest req) throws Exception {
PageInfoResponse<OrderDto> pageInfo = new PageInfoResponse<OrderDto>();
try {
pageInfo = tOrderService.findList(orderRequest, req);
pageInfo = orderService.findList(orderRequest, req);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
......@@ -44,4 +51,47 @@ public class OrderController {
}
return pageInfo;
}
/**
* 根据订单主键查询,订单详情
*
* @param orderId
* @author Bellamy
*/
@GetMapping(value = "/orderDetail")
@ApiOperation(value = "订单详情", notes = "订单详情")
public Result<OrderDto> getOrderDetail(@RequestParam(value = "orderId") String orderId, HttpServletRequest req) throws Exception {
Result<OrderDto> result = new Result<OrderDto>();
if (StringUtils.isNotEmpty(orderId)) {
OrderDto orderDto = orderService.getOrderDetail(orderId);
result.setResult(orderDto);
} else {
result.setMessage("参数为不能为空!");
}
return result;
}
/**
* 根据订单主键查询,订单详情
*
* @param orderId,dataGoodsId
* @author Bellamy
*/
@GetMapping(value = "/apiInterfaceDetail")
@ApiOperation(value = "订单详情---接口文档", notes = "接口文档")
public Result<Map> getApiInterfaceDetail(@RequestParam(value = "orderId") String orderId, @RequestParam(value = "dataGoodsId") String dataGoodsId, HttpServletRequest req) throws Exception {
Result<Map> result = new Result<Map>();
Map params = new HashMap();
if (StringUtils.isNotEmpty(dataGoodsId)) {
params.put("dataGoodsId", dataGoodsId);
}
if (StringUtils.isNotEmpty(orderId)) {
params.put("orderId", orderId);
}
//查询接口文档 和参数信息
Map dataGoodsApi = orderService.getApiInterfaceDetail(params);
result.setResult(dataGoodsApi);
return result;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.order.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* api商品(DataGoodsApiDto)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
@ApiModel
public class DataGoodsApiDto implements Serializable {
private static final long serialVersionUID = -14346819849726413L;
/**
* api商品id
*/
@ApiModelProperty(value = "api商品id")
private Long goodsApi;
/**
* 数据id
*/
@ApiModelProperty(value = "数据id")
private Long dataGoodsId;
/**
* api服务名称
*/
@ApiModelProperty(value = "api服务名称")
private String apiName;
/**
* 请求类型(方式)
*/
@ApiModelProperty(value = "请求类型(方式)")
private String requestType;
/**
* api接口地址
*/
@ApiModelProperty(value = "api接口地址")
private String apiUrl;
/**
* api接口方法
*/
@ApiModelProperty(value = "api接口方法")
private String apiMethod;
/**
* api请求协议:http,https
*/
@ApiModelProperty(value = "api请求协议:http,https")
private String apiProtocl;
/**
* api返回数据样例
*/
@ApiModelProperty(value = "api返回数据样例")
private String returnDataExample;
/**
* api请求样例
*/
@ApiModelProperty(value = "api请求样例")
private String requestExample;
/**
* 返回类型
*/
@ApiModelProperty(value = "返回类型")
private String returnType;
/**
* apikey
*/
@ApiModelProperty(value = "apikey")
private String apiKey;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private Date creTime;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String crePerson;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private String uptPerson;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private Date uptTime;
/**
* 授权码token
*/
@ApiModelProperty(value = "授权码token")
private String requestToken;
/**
* 接口参数信息
*/
@ApiModelProperty(value = "接口参数信息")
private List<DataGoodsApiParamsDto> apiParamsDto;
public Long getGoodsApi() {
return goodsApi;
}
public void setGoodsApi(Long goodsApi) {
this.goodsApi = goodsApi;
}
public Long getDataGoodsId() {
return dataGoodsId;
}
public void setDataGoodsId(Long dataGoodsId) {
this.dataGoodsId = dataGoodsId;
}
public String getApiName() {
return apiName;
}
public void setApiName(String apiName) {
this.apiName = apiName;
}
public String getRequestType() {
return requestType;
}
public void setRequestType(String requestType) {
this.requestType = requestType;
}
public String getApiUrl() {
return apiUrl;
}
public void setApiUrl(String apiUrl) {
this.apiUrl = apiUrl;
}
public String getApiMethod() {
return apiMethod;
}
public void setApiMethod(String apiMethod) {
this.apiMethod = apiMethod;
}
public String getApiProtocl() {
return apiProtocl;
}
public void setApiProtocl(String apiProtocl) {
this.apiProtocl = apiProtocl;
}
public String getReturnDataExample() {
return returnDataExample;
}
public void setReturnDataExample(String returnDataExample) {
this.returnDataExample = returnDataExample;
}
public String getRequestExample() {
return requestExample;
}
public void setRequestExample(String requestExample) {
this.requestExample = requestExample;
}
public String getReturnType() {
return returnType;
}
public void setReturnType(String returnType) {
this.returnType = returnType;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getRequestToken() {
return requestToken;
}
public void setRequestToken(String requestToken) {
this.requestToken = requestToken;
}
public List<DataGoodsApiParamsDto> getApiParamsDto() {
return apiParamsDto;
}
public void setApiParamsDto(List<DataGoodsApiParamsDto> apiParamsDto) {
this.apiParamsDto = apiParamsDto;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.order.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* api商品参数配置(TDataGoodsApiParams)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
@ApiModel
public class DataGoodsApiParamsDto implements Serializable {
private static final long serialVersionUID = 944366688061324185L;
/**
* api参数id
*/
@ApiModelProperty(value = "api参数id")
private Long apiParamsId;
/**
* api商品id
*/
@ApiModelProperty(value = "api商品id")
private Long goodsApi;
/**
* 参数分类:01公共参数,02请求参数,03响应参数,04请求头参数,05状态码参数
*/
@ApiModelProperty(value = "参数分类:01公共参数,02请求参数,03响应参数,04请求头参数,05状态码参数")
private String paramsDiff;
/**
* 参数名称
*/
@ApiModelProperty(value = "参数名称")
private String paramsName;
/**
* 参数类型
*/
@ApiModelProperty(value = "参数类型")
private String paramsType;
/**
* 参数描述
*/
@ApiModelProperty(value = "参数描述")
private String paramsDesc;
/**
* 默认值
*/
@ApiModelProperty(value = "默认值")
private String defaultValue;
/**
* 是否必选:Y是,N否
*/
@ApiModelProperty(value = "是否必选:Y是,N否")
private String ifRequird;
/*
* 参数分类:名称
* */
@ApiModelProperty(value = "参数分类名称")
private String paramsDiffName;
public Long getGoodsApi() {
return goodsApi;
}
public void setGoodsApi(Long goodsApi) {
this.goodsApi = goodsApi;
}
public String getParamsDiff() {
return paramsDiff;
}
public void setParamsDiff(String paramsDiff) {
this.paramsDiff = paramsDiff;
}
public String getParamsName() {
return paramsName;
}
public void setParamsName(String paramsName) {
this.paramsName = paramsName;
}
public String getParamsType() {
return paramsType;
}
public void setParamsType(String paramsType) {
this.paramsType = paramsType;
}
public String getParamsDesc() {
return paramsDesc;
}
public void setParamsDesc(String paramsDesc) {
this.paramsDesc = paramsDesc;
}
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public String getIfRequird() {
return ifRequird;
}
public void setIfRequird(String ifRequird) {
this.ifRequird = ifRequird;
}
public String getParamsDiffName() {
return paramsDiffName;
}
public void setParamsDiffName(String paramsDiffName) {
this.paramsDiffName = paramsDiffName;
}
public Long getApiParamsId() {
return apiParamsId;
}
public void setApiParamsId(Long apiParamsId) {
this.apiParamsId = apiParamsId;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.order.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;
......@@ -18,50 +20,63 @@ public class OrderDto {
/**
* 订单id
*/
@ApiModelProperty(value = "订单id")
private Long orderId;
/**
* 订单编号
*/
@ApiModelProperty(value = "订单编号")
private String orderNumber;
/**
* 用户id
*/
@ApiModelProperty(value = "用户id")
private Long customerId;
/**
* 订单状态:01待支付,02已支付,03已取消
*/
@ApiModelProperty(value = "订单状态:01待支付,02已支付,03已取消")
private String orderStatus;
/**
* 订单金额
*/
@ApiModelProperty(value = "订单金额")
private BigDecimal orderMoney;
/**
* 订单时间
*/
@ApiModelProperty(value = "订单时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date orderTime;
/**
* 卖家id
*/
@ApiModelProperty(value = "卖家id")
private Long sellerId;
/**
* 支付金额
*/
@ApiModelProperty(value = "支付金额")
private BigDecimal paymentMoney;
/**
* 支付时间
*/
@ApiModelProperty(value = "支付时间")
private Date paymentTime;
/**
* 支付方式:01余额
*/
@ApiModelProperty(value = "支付方式:01余额")
private String paymentMethod;
/**
* 优惠金额
*/
@ApiModelProperty(value = "优惠金额")
private BigDecimal districtMoney;
/**
* 购买方式:01年,02季,03月,04次(服务类型)
*/
@ApiModelProperty(value = "购买方式:01年,02季,03月,04次(服务类型)")
private String purchaseMethod;
/**
* 商品token
......@@ -70,18 +85,22 @@ public class OrderDto {
/**
* 盐值
*/
@ApiModelProperty(value = "盐值")
private String saltValue;
/**
* apikey
*/
@ApiModelProperty(value = "apikey")
private String apiKey;
/**
* 生效日期
*/
@ApiModelProperty(value = "生效日期")
private Date takeEffectTime;
/**
* 失效日期
*/
@ApiModelProperty(value = "失效日期")
private Date invalidTime;
/**
* 价格类型:01免费,02收费
......@@ -110,10 +129,12 @@ public class OrderDto {
/**
* 数据名称
*/
@ApiModelProperty(value = "数据名称")
private String dataName;
/**
* 数据分类
*/
@ApiModelProperty(value = "数据分类")
private String dataType;
......
......@@ -2,6 +2,7 @@ package com.jz.dm.mall.moduls.controller.order.bean;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 订单表(TOrder)实体类
......@@ -16,22 +17,27 @@ public class OrderRequest extends BasePageBean {
/**
* 订单编号
*/
@ApiModelProperty(value = "订单编号")
private String orderNumber;
/**
* 数据行业
*/
@ApiModelProperty(value = "数据行业")
private String categoryId;
/**
* 购买方式:01年,02季,03月,04次(服务类型)
*/
@ApiModelProperty(value = "购买方式:01年,02季,03月,04次(服务类型)")
private String purchaseMethod;
/**
* 数据名称
*/
@ApiModelProperty(value = "数据名称")
private String dataName;
/**
* 数据分类
*/
@ApiModelProperty(value = "数据分类")
private String dataType;
......
package com.jz.dm.mall.moduls.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 商城企业客户资产(TFinanceCustomerAssets)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:38
*/
@TableName("t_finance_customer_assets")
@ApiModel
public class FinanceCustomerAssets implements Serializable {
private static final long serialVersionUID = -86484762300825431L;
/**
* 资产id
*/
@TableId(value = "customer_id",type = IdType.AUTO)
@ApiModelProperty(value = "企业id")
private Long assetsId;
/**
* 企业id
*/
@ApiModelProperty(value = "企业id")
private Long departmentId;
/**
* 可用金额
*/
@ApiModelProperty(value = "可用金额")
private BigDecimal useMoney;
/**
* 冻结金额
*/
@ApiModelProperty(value = "冻结金额")
private BigDecimal frozenMoney;
/**
* 总金额
*/
@ApiModelProperty(value = "总金额")
private BigDecimal totalMoney;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private Date creTime;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String crePerson;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private Date uptTime;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private String uptPerson;
/**
* 删除标识
*/
@ApiModelProperty(value = "删除标识")
private String delFlag;
public Long getAssetsId() {
return assetsId;
}
public void setAssetsId(Long assetsId) {
this.assetsId = assetsId;
}
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public BigDecimal getUseMoney() {
return useMoney;
}
public void setUseMoney(BigDecimal useMoney) {
this.useMoney = useMoney;
}
public BigDecimal getFrozenMoney() {
return frozenMoney;
}
public void setFrozenMoney(BigDecimal frozenMoney) {
this.frozenMoney = frozenMoney;
}
public BigDecimal getTotalMoney() {
return totalMoney;
}
public void setTotalMoney(BigDecimal totalMoney) {
this.totalMoney = totalMoney;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
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.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 企业客户交易流水(TFinanceTradeFlow)实体类
*
* @author makejava
* @since 2020-12-01 10:41:39
*/
@TableName("t_finance_trade_flow")
@ApiModel
public class FinanceTradeFlow implements Serializable {
private static final long serialVersionUID = -55257582310832314L;
/**
* 交易流水id
*/
private Long tradeFlowId;
/**
* 订单id
*/
private Long orderId;
/**
* 提现id
*/
private Long cashOutId;
/**
* 充值id
*/
private Long customerBalanceId;
/**
* 交易流水编号
*/
private String tradeFlowNumber;
/**
* 交易流水金额
*/
private BigDecimal tradeMoney;
/**
* 交易类型:01提现,02充值,03付款,04收款,05续费
*/
private String tradeType;
/**
* 创建时间
*/
private Date creTime;
/**
* 创建人
*/
private String crePerson;
/**
* 删除标识
*/
private String delFlag;
public Long getTradeFlowId() {
return tradeFlowId;
}
public void setTradeFlowId(Long tradeFlowId) {
this.tradeFlowId = tradeFlowId;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Long getCashOutId() {
return cashOutId;
}
public void setCashOutId(Long cashOutId) {
this.cashOutId = cashOutId;
}
public Long getCustomerBalanceId() {
return customerBalanceId;
}
public void setCustomerBalanceId(Long customerBalanceId) {
this.customerBalanceId = customerBalanceId;
}
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 getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
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;
import com.jz.common.base.BaseMapper;
import com.jz.common.entity.FinanceCustomerAssets;
import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets;
/**
* 商城企业客户资产(TFinanceCustomerAssets)表数据库访问层
......
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.entity.FinanceTradeFlow;
/**
* 企业客户交易流水(TFinanceTradeFlow)表数据库访问层
*
* @author Bellamy
* @since 2020-12-01 10:41:39
*/
public interface FinanceTradeFlowDao extends BaseMapper<FinanceTradeFlow> {
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.order.bean.DataGoodsApiDto;
import com.jz.dm.mall.moduls.controller.order.bean.DataGoodsApiParamsDto;
import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
import com.jz.dm.mall.moduls.entity.Order;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -16,5 +19,13 @@ import java.util.Map;
public interface OrderDao extends BaseMapper<Order> {
List<OrderDto> findList(Map<String, Object> param)throws Exception;
List<OrderDto> findList(Map<String, Object> param) throws Exception;
OrderDto getOrderDetail(@Param("orderId") String orderId) throws Exception;
List<DataGoodsApiDto> getApiInterfaceDetail(Map params) throws Exception;
List<DataGoodsApiDto> getApiInterface(Map params) throws Exception;
List<DataGoodsApiParamsDto> getApiParamsInfo(@Param("goodsApi") Long goodsApi);
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.common.entity.OrderGoodsInfo;
import com.jz.dm.mall.moduls.entity.OrderGoodsInfo;
/**
* 订单商品信息(TOrderGoodsInfo)表数据库访问层
......
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.common.entity.OrderPayment;
import com.jz.dm.mall.moduls.entity.OrderPayment;
/**
* 订单支付(TOrderPayment)表数据库访问层
......
package com.jz.dm.mall.moduls.service;
/**
* 企业客户交易流水(TFinanceTradeFlow)表服务接口
*
* @author Bellamy
* @since 2020-12-01 10:41:39
*/
public interface FinanceTradeFlowService {
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
import com.jz.dm.mall.moduls.controller.order.bean.OrderRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/**
* 订单表(TOrder)表服务接口
......@@ -15,5 +16,9 @@ import javax.servlet.http.HttpServletRequest;
public interface OrderService {
PageInfoResponse<OrderDto> findList(OrderRequest order, HttpServletRequest req)throws Exception;
PageInfoResponse<OrderDto> findList(OrderRequest order, HttpServletRequest req) throws Exception;
OrderDto getOrderDetail(String orderId) throws Exception;
Map getApiInterfaceDetail(Map params) throws Exception;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.jz.dm.mall.moduls.mapper.FinanceTradeFlowDao;
import com.jz.dm.mall.moduls.service.FinanceTradeFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 企业客户交易流水(TFinanceTradeFlow)表服务实现类
*
* @author Bellamy
* @since 2020-12-01 10:41:39
*/
@Service("financeTradeFlowService")
public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService {
@Autowired
private FinanceTradeFlowDao tFinanceTradeFlowDao;
}
\ No newline at end of file
......@@ -4,18 +4,16 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
import com.jz.dm.mall.moduls.controller.order.bean.OrderRequest;
import com.jz.dm.mall.moduls.controller.order.bean.*;
import com.jz.dm.mall.moduls.mapper.OrderDao;
import com.jz.dm.mall.moduls.service.OrderService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 订单表(TOrder)表服务实现类
......@@ -28,32 +26,36 @@ import java.util.Map;
public class OrderServiceImpl implements OrderService {
@Autowired
private OrderDao tOrderDao;
private OrderDao orderDao;
@Override
public PageInfoResponse<OrderDto> findList(OrderRequest order, HttpServletRequest req) throws Exception{
public PageInfoResponse<OrderDto> findList(OrderRequest order, HttpServletRequest req) throws Exception {
PageInfoResponse<OrderDto> pageInfoResponse = new PageInfoResponse<>();
Map<String, Object> param = new HashMap<>();
//数据商品id
if (order.getOrderNumber() != null) {
//数据编号
if (StringUtils.isNotEmpty(order.getOrderNumber())) {
param.put("orderNumber", order.getOrderNumber());
}
//商品分类id(行业)
if (order.getPurchaseMethod() != null) {
//购买(订单)方式
if (StringUtils.isNotEmpty(order.getPurchaseMethod())) {
param.put("purchaseMethod", order.getPurchaseMethod());
}
/* //数据商户id
if (order.getUserId() != null) {
param.put("userId", order.getUserId());
//数据类型
if (StringUtils.isNotEmpty(order.getDataType())) {
param.put("dataType", order.getDataType());
}
//数据商品名称
if (!StringUtils.isEmpty(order.getDataName())) {
param.put("dataName", order.getDataName());
}*/
}
//商品分类id(行业)
if (!StringUtils.isEmpty(order.getCategoryId())) {
param.put("categoryId", order.getCategoryId());
}
PageHelper.startPage(order.getPageNum(), order.getPageSize());
List<OrderDto> list = tOrderDao.findList(param);
List<OrderDto> list = orderDao.findList(param);
PageInfo<OrderDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
......@@ -61,4 +63,72 @@ public class OrderServiceImpl implements OrderService {
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
@Override
public OrderDto getOrderDetail(String orderId) throws Exception {
OrderDto orderDto = null;
if (StringUtils.isNotEmpty(orderId)) {
orderDto = orderDao.getOrderDetail(orderId);
if (orderDto != null) {
/*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long effectTimes = orderDto.getTakeEffectTime().getTime(); //开始生效日期
long invalidTimes = orderDto.getInvalidTime().getTime(); //有效结束日期
long syTime = invalidTimes - effectTimes; //有效时间毫秒数
Date mtime = new Date(syTime);
int month = mtime.getMonth();*/
//getEffectTime(orderDto.getTakeEffectTime(), orderDto.getInvalidTime());
}
}
return orderDto;
}
@Override
public Map getApiInterfaceDetail(Map params) throws Exception {
Map returnMap = new HashMap();
DataGoodsApiDto dataGoodsApi = new DataGoodsApiDto(); //接口文档信息
List<DataGoodsApiParamsDto> goodsApiParamsLst = new ArrayList<>(); //接口参数信息
if (params.size() > 0) {
List<DataGoodsApiDto> dataGoodsApiDto = orderDao.getApiInterface(params);//接口文档信息
dataGoodsApi = dataGoodsApiDto.get(0);
Long goodsApiId = dataGoodsApi.getGoodsApi();
goodsApiParamsLst = orderDao.getApiParamsInfo(goodsApiId);//接口参数信息
}
returnMap.put("dataGoodsApi", dataGoodsApi);
returnMap.put("goodsApiParamsLst", goodsApiParamsLst);
return returnMap;
}
public void getEffectTime(Date takeEffectTime, Date invalidTime) {
Calendar startTime = Calendar.getInstance();
startTime.setTime(takeEffectTime); //开始日期
Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(invalidTime); //结束日期
int hour = endCalendar.get(Calendar.HOUR_OF_DAY) - startTime.get(Calendar.HOUR_OF_DAY);
int day = endCalendar.get(Calendar.DAY_OF_MONTH) - startTime.get(Calendar.DAY_OF_MONTH);
int month = endCalendar.get(Calendar.MONTH) - startTime.get(Calendar.MONTH);
int year = endCalendar.get(Calendar.YEAR) - startTime.get(Calendar.YEAR);
// 按照减法原理,先day相减,不够向month借;然后month相减,不够向year借;最后year相减。
if (day < 0) {
month -= 1;
endCalendar.add(Calendar.MONTH, -1);// 得到上一个月,用来得到上个月的天数。
day = day + endCalendar.getActualMaximum(Calendar.DAY_OF_MONTH);
}
if (month < 0) {
month = (month + 12) % 12;
year--;
}
System.out.println("结果:" + year + "年" + month + "月" + day + "天");
/*for (int i = 0; i < month; i++) {
endCalendar.add(Calendar.MONTH, -1);// 得到上一个月,用来得到上个月的天数。
day = day + endCalendar.getActualMaximum(Calendar.DAY_OF_MONTH);
}
System.out.println("过去时间与现在有:" + year + "年" + "" + day + "天");*/
}
}
\ No newline at end of file
......@@ -225,27 +225,27 @@
<select id="findList" resultType="com.jz.dm.mall.moduls.controller.order.bean.OrderDto" parameterType="map">
select
t.order_id as orderId,
t.order_number as orderNumber,
t.customer_id as customerId,
(case when t.order_status ='01' then '待支付'
when t.order_status ='02' then '已支付'
when t.order_status ='03' then '已取消'
end) as orderStatus,
t.order_money as orderMoney,
t.order_time as orderTime,
t.payment_money as paymentMoney,
t.payment_time as paymentTime,
t.payment_method AS paymentMethod,
(case when t.purchase_method ='01' then '年'
when t.purchase_method ='02' then '季'
when t.purchase_method ='03' then '月'
when t.purchase_method ='04' then '次'
end) as purchaseMethod,
t.price_type as priceType,
t.cre_time as creTime,
t2.data_name as dataName,
(case when t2.data_type ='01' then 'API' when t2.data_type ='02' then '数据包' end) as dataType
t.order_id as orderId,
t.order_number as orderNumber,
t.customer_id as customerId,
(case when t.order_status ='01' then '待支付'
when t.order_status ='02' then '已支付'
when t.order_status ='03' then '已取消'
end) as orderStatus,
t.order_money as orderMoney,
t.order_time as orderTime,
t.payment_money as paymentMoney,
t.payment_time as paymentTime,
t.payment_method AS paymentMethod,
(case when t.purchase_method ='01' then '年'
when t.purchase_method ='02' then '季'
when t.purchase_method ='03' then '月'
when t.purchase_method ='04' then '次'
end) as purchaseMethod,
t.price_type as priceType,
t.cre_time as creTime,
t2.data_name as dataName,
(case when t2.data_type ='01' then 'API' when t2.data_type ='02' then '数据包' end) as dataType
from t_order t
left join t_order_goods_info t1 on t.order_id=t1.order_id
inner join t_data_goods t2 on t2.data_goods_id=t1.data_goods_id
......@@ -259,5 +259,116 @@
<if test="orderStatus != null and orderStatus != ''">and t.order_status = #{orderStatus}</if>
<if test="orderTime != null">and t.order_time = #{orderTime}</if>
</select>
<!--根据订单id 查询详情-->
<select id="getOrderDetail" resultType="com.jz.dm.mall.moduls.controller.order.bean.OrderDto" parameterType="map">
select
t.order_id as orderId,
t.order_number as orderNumber,
(case when t.order_status ='01' then '待支付' when t.order_status ='02' then '已支付' when t.order_status ='03' then '已取消' end) as orderStatus,
t.order_time as orderTime,
(case when t.purchase_method ='01' then '年' when t.purchase_method ='02' then '季' when t.purchase_method ='03' then '月'
when t.purchase_method ='04' then '次' end) as purchaseMethod,
t.take_effect_time as takeEffectTime,
t.invalid_time as invalidTime,
t.api_key as apiKey,
t2.data_name as dataName,
(case when t2.data_type ='01' then 'API' when t2.data_type ='02' then '数据包' end) as dataType
from t_order t
left join t_order_goods_info t1 on t.order_id=t1.order_id
inner join t_data_goods t2 on t2.data_goods_id=t1.data_goods_id
where 1=1
<if test="orderId != null">and t.order_id = #{orderId}</if>
</select>
<resultMap id="apiParamsInfo" type="com.jz.dm.mall.moduls.controller.order.bean.DataGoodsApiDto">
<id column="goods_api" property="goodsApi" />
<result column="api_name" property="apiName" />
<result column="request_type" property="requestType" />
<result column="api_url" property="apiUrl" />
<result column="api_method" property="apiMethod" />
<result column="api_protocl" property="apiProtocl" />
<result column="return_data_example" property="returnDataExample" />
<result column="return_type" property="returnType" />
<result column="api_key" property="apiKey" />
<result column="request_token" property="requestToken" />
<collection property="apiParamsDto" ofType="com.jz.dm.mall.moduls.controller.order.bean.DataGoodsApiParamsDto">
<id column="api_params_id" property="apiParamsId" />
<result column="params_diff" property="paramsDiff" />
<result column="params_name" property="paramsName" />
<result column="params_type" property="paramsType" />
<result column="params_desc" property="paramsDesc" />
<result column="if_requird" property="ifRequird" />
</collection>
</resultMap>
<select id="getApiInterfaceDetail" resultMap="apiParamsInfo" parameterType="map">
select
t3.goods_api as goodsApi,
t3.api_name as apiName,
t3.request_type as requestType,
t3.api_url as apiUrl,
t3.api_method as apiMethod,
t3.api_protocl as apiProtocl,
t3.return_data_example as returnDataExample,
t3.request_example as requestExample,
t3.return_type as returnType,
t3.api_key as apiKey,
t3.request_token as requestToken,
(case when t4.params_diff ='01' then '公共参数' when t4.params_diff ='02' then '请求参数'
when t4.params_diff ='03' then '响应参数'
when t4.params_diff ='04' then '请求头参数' when t4.params_diff ='05' then '状态码参数' end) as paramsDiff,
t4.params_name as paramsName,
t4.params_type as paramsType,
t4.params_desc as paramsDesc,
t4.default_value as defaultValue,
t4.if_requird as ifRequird,
t4.api_params_id as apiParamsId
from t_order t
inner join t_order_goods_info t1 on t.order_id=t1.order_id
inner join t_data_goods t2 on t2.data_goods_id=t1.data_goods_id <if test="dataGoodsId != null">and t2.data_goods_id = #{dataGoodsId}</if>
inner join t_data_goods_api t3 on t3.data_goods_id=t2.data_goods_id
left join t_data_goods_api_params t4 on t4.goods_api=t3.goods_api
where 1=1 and t.order_status='02'
<if test="orderId != null">and t.order_id = #{orderId}</if>
</select>
<select id="getApiInterface" resultType="com.jz.dm.mall.moduls.controller.order.bean.DataGoodsApiDto" parameterType="map">
select
t3.goods_api as goodsApi,
t3.api_name as apiName,
t3.request_type as requestType,
t3.api_url as apiUrl,
t3.api_method as apiMethod,
t3.api_protocl as apiProtocl,
t3.return_data_example as returnDataExample,
t3.request_example as requestExample,
t3.return_type as returnType,
t3.api_key as apiKey,
t3.request_token as requestToken
from t_order t
inner join t_order_goods_info t1 on t.order_id=t1.order_id
inner join t_data_goods t2 on t2.data_goods_id=t1.data_goods_id <if test="dataGoodsId != null">and t2.data_goods_id = #{dataGoodsId}</if>
inner join t_data_goods_api t3 on t3.data_goods_id=t2.data_goods_id
where 1=1 and t.order_status='02'
<if test="orderId != null">and t.order_id = #{orderId}</if>
</select>
<select id="getApiParamsInfo" resultType="com.jz.dm.mall.moduls.controller.order.bean.DataGoodsApiParamsDto" parameterType="map">
select
(case when t4.params_diff ='01' then '公共参数' when t4.params_diff ='02' then '请求参数'
when t4.params_diff ='03' then '响应参数'
when t4.params_diff ='04' then '请求头参数' when t4.params_diff ='05' then '状态码参数' end) as paramsDiffName ,
t4.params_diff as paramsDiff,
t4.params_name as paramsName,
t4.params_type as paramsType,
t4.params_desc as paramsDesc,
t4.default_value as defaultValue,
t4.if_requird as ifRequird,
t4.api_params_id as apiParamsId
from t_data_goods_api t3
inner join t_data_goods_api_params t4 on t4.goods_api=t3.goods_api
where 1=1
<if test="goodsApi != null">and t4.goods_api = #{goodsApi}</if>
</select>
</mapper>
\ No newline at end of file
<?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.FinanceTradeFlowDao">
<resultMap type="com.jz.dm.mall.moduls.entity.FinanceTradeFlow" id="TPlatformTradeFlowInfoMap">
<result property="tradeFlowInfoId" column="trade_flow_info_id" jdbcType="INTEGER"/>
<result property="receiveInfoId" column="receive_info_id" jdbcType="INTEGER"/>
<result property="platformTradeMoney" column="platform_trade_money" jdbcType="NUMERIC"/>
<result property="tradeType" column="trade_type" jdbcType="VARCHAR"/>
<result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>
<result property="crePerson" column="cre_person" jdbcType="VARCHAR"/>
<result property="uptTime" column="upt_time" jdbcType="TIMESTAMP"/>
<result property="uptPerson" column="upt_person" jdbcType="VARCHAR"/>
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="TPlatformTradeFlowInfoMap">
select
trade_flow_info_id, receive_info_id, platform_trade_money, trade_type, cre_time, cre_person, upt_time, upt_person, del_flag
from t_platform_trade_flow_info
where trade_flow_info_id = #{tradeFlowInfoId}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="TPlatformTradeFlowInfoMap">
select
trade_flow_info_id, receive_info_id, platform_trade_money, trade_type, cre_time, cre_person, upt_time, upt_person, del_flag
from t_platform_trade_flow_info
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryAll" resultMap="TPlatformTradeFlowInfoMap">
select
trade_flow_info_id, receive_info_id, platform_trade_money, trade_type, cre_time, cre_person, upt_time,
upt_person, del_flag
from t_platform_trade_flow_info
<where>
<if test="tradeFlowInfoId != null">
and trade_flow_info_id = #{tradeFlowInfoId}
</if>
<if test="receiveInfoId != null">
and receive_info_id = #{receiveInfoId}
</if>
<if test="platformTradeMoney != null">
and platform_trade_money = #{platformTradeMoney}
</if>
<if test="tradeType != null and tradeType != ''">
and trade_type = #{tradeType}
</if>
<if test="creTime != null">
and cre_time = #{creTime}
</if>
<if test="crePerson != null and crePerson != ''">
and cre_person = #{crePerson}
</if>
<if test="uptTime != null">
and upt_time = #{uptTime}
</if>
<if test="uptPerson != null and uptPerson != ''">
and upt_person = #{uptPerson}
</if>
<if test="delFlag != null and delFlag != ''">
and del_flag = #{delFlag}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="tradeFlowInfoId" useGeneratedKeys="true">
insert into t_platform_trade_flow_info(receive_info_id, platform_trade_money, trade_type, cre_time, cre_person, upt_time, upt_person, del_flag)
values (#{receiveInfoId}, #{platformTradeMoney}, #{tradeType}, #{creTime}, #{crePerson}, #{uptTime}, #{uptPerson}, #{delFlag})
</insert>
<insert id="insertBatch" keyProperty="tradeFlowInfoId" useGeneratedKeys="true">
insert into t_platform_trade_flow_info(receive_info_id, platform_trade_money, trade_type,
cre_time, cre_person, upt_time, upt_person, del_flag)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.receiveInfoId}, #{entity.platformTradeMoney}, #{entity.tradeType}, #{entity.creTime},
#{entity.crePerson}, #{entity.uptTime}, #{entity.uptPerson}, #{entity.delFlag})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update t_platform_trade_flow_info
<set>
<if test="receiveInfoId != null">
receive_info_id = #{receiveInfoId},
</if>
<if test="platformTradeMoney != null">
platform_trade_money = #{platformTradeMoney},
</if>
<if test="tradeType != null and tradeType != ''">
trade_type = #{tradeType},
</if>
<if test="creTime != null">
cre_time = #{creTime},
</if>
<if test="crePerson != null and crePerson != ''">
cre_person = #{crePerson},
</if>
<if test="uptTime != null">
upt_time = #{uptTime},
</if>
<if test="uptPerson != null and uptPerson != ''">
upt_person = #{uptPerson},
</if>
<if test="delFlag != null and delFlag != ''">
del_flag = #{delFlag},
</if>
</set>
where trade_flow_info_id = #{tradeFlowInfoId}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from t_platform_trade_flow_info where trade_flow_info_id = #{tradeFlowInfoId}
</delete>
</mapper>
\ No newline at end of file
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