Commit 74378351 by 崔彦峰

svn to git

0 parents
Showing 74 changed files with 4279 additions and 0 deletions
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>framework-rpc-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-geno-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>rpc-dj-geno-api</name>
<properties>
<deploy.scanPackage>cn.com.glsx.dj.remote</deploy.scanPackage>
</properties>
<build>
<plugins>
<plugin>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>rpc-api-deploy-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-geno-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package cn.com.glsx.dj.geno.dto;
import java.io.Serializable;
/**
* @Title: DemoDTO.java
* @Description:
* @author ${userName}
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@SuppressWarnings("serial")
public class DemoDTO implements Serializable{
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package cn.com.glsx.dj.geno.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
public class OrderDivisionDTO implements Serializable {
private static final long serialVersionUID = 7652041510739711787L;
@ApiModelProperty(notes="记录id")
private Integer id;
@ApiModelProperty(notes = "主订单编号", example = "240313111119326")
private String orderCode;
@ApiModelProperty(notes = "geno订单id")
private String genoOrderId;
@ApiModelProperty(notes = "交易参考号", example = "329458327383973888")
private String tradeNo;
@ApiModelProperty(notes = "支付成功时间", example = "2024-03-13 11:11:11")
private Date paySuccessDate;
@ApiModelProperty(notes = "分账方式(1线下对账,2线上分账)", example = "1")
private Byte divisionType;
@ApiModelProperty(notes = "分账时间", example = "2024-03-13 11:11:11")
private Date divisionDate;
@ApiModelProperty(notes = "分账状态(1待分账,2分账中,3分账成功,4分账失败)", example = "3")
private Byte divisionStatus;
@ApiModelProperty(notes = "失败消息内容", example = "分账失败,金额不足")
private String failMessage;
@ApiModelProperty(notes = "园区店(服务对接)商户号", example = "44209389")
private Integer yqMerchantId;
@ApiModelProperty(notes = "园区店(服务对接)商户名称", example = "园区店001")
private String yqMerchantName;
@ApiModelProperty(notes = "应收金额(元)", example = "47781.00")
private BigDecimal totalPrice;
@ApiModelProperty(notes = "实付金额", example = "45000.00")
private BigDecimal paidMoney;
@ApiModelProperty(notes = "总分账金额", example = "47494.31")
private BigDecimal actualIncomeMoney;
@ApiModelProperty(notes = "实际分账平台方商户号", example = "44289888")
private Integer realityPlatformMerchantId;
@ApiModelProperty(notes = "实际分账平台方商户名称", example = "广联平台002")
private String realityPlatformMerchantName;
@ApiModelProperty(notes = "平台方实际分账金额", example = "100.00")
private BigDecimal glDivisionMoney;
@ApiModelProperty(notes = "平台方应分账金额", example = "100.00")
private BigDecimal glShouldDivisionMoney;
@ApiModelProperty(notes = "4S店商户号", example = "44209389")
private Integer shopMerchantId;
@ApiModelProperty(notes = "4S店商户名称", example = "4S店001")
private String shopMerchantName;
@ApiModelProperty(notes = "实际分账4S店商户号", example = "44209390")
private Integer realityShopMerchantId;
@ApiModelProperty(notes = "实际分账4S店商户名称", example = "4S店002")
private String realityShopMerchantName;
@ApiModelProperty(notes = "4S店实际分账金额", example = "100.00")
private BigDecimal shopDivisionMoney;
@ApiModelProperty(notes = "4S店应分账金额", example = "100.00")
private BigDecimal shopShouldDivisionMoney;
@ApiModelProperty(notes = "开启多平台分账(Y:开启;N:关闭)", example = "Y")
private String multiPlatformMerchantFlag;
@ApiModelProperty(notes = "嘀加智慧云子商户商户号", example = "44211888")
private Integer djzhySubMerchantId;
@ApiModelProperty(notes = "嘀加智慧云子商户商户名称", example = "嘀加智慧云子商户")
private String djzhySubMerchantName;
@ApiModelProperty(notes = "嘀加智慧云子商户分账金额(如为线上分账时为实际分账金额)", example = "100.00")
private BigDecimal djzhySubMerchantDivisionMoney;
@ApiModelProperty(notes = "嘀加智慧云子商户应分账金额", example = "100.00")
private BigDecimal djzhySubMerchantShouldDivisionMoney;
@ApiModelProperty(name = "payStartDateStr", notes = "支付开始时间", dataType = "string", example = "2020-12-25 00:00:00")
private String payStartDateStr;
@ApiModelProperty(name = "payEndDateStr", notes = "支付结束时间", dataType = "string", example = "2020-12-25 23:59:59")
private String payEndDateStr;
@ApiModelProperty(notes = "分账时间-开始", dataType = "string")
private String divisionStartDate;
@ApiModelProperty(notes = "分账时间-结束", dataType = "string")
private String divisionEndDate;
@ApiModelProperty(notes = "业务场景:0-会员权益/升级;1-精品升级;2-次新车转化;3-售后众筹;4-积分商城;", example = "1")
private Byte sceneType;
@ApiModelProperty(notes="渠道")
private Integer channelType;
}
package cn.com.glsx.dj.geno.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
public class OrderPackageProfitAllocationDTO implements Serializable {
private static final long serialVersionUID = 5440413313089626976L;
@ApiModelProperty(notes = "主键ID")
private Long id;
@ApiModelProperty(notes = "主订单编号", example = "240313111119326")
private String orderCode;
@ApiModelProperty(notes = "geno订单id")
private String genoOrderId;
@ApiModelProperty(notes = "套餐编码", example = "MPG2024032622421835352")
private String packageCode;
@ApiModelProperty(notes = "套餐名称", example = "基础套餐")
private String packageName;
@ApiModelProperty(notes = "数量", example = "1")
private Integer nums;
@ApiModelProperty(notes = "零售价", example = "47781.00")
private BigDecimal sellPrice;
@ApiModelProperty(notes = "应收金额(元)", example = "47781.00")
private BigDecimal totalPrice;
@ApiModelProperty(notes = "实收金额/到账金额(元)", example = "47494.31")
private BigDecimal actualIncomeMoney;
@ApiModelProperty(notes = "流量费分润方式(1按毛利比例;2按收入比例;3按固定金额)", example = "1")
private Byte shopTrafficMoneyCalculateType;
@ApiModelProperty(notes = "流量费计算值(%/元)", example = "0.6")
private BigDecimal shopTrafficMoneyCalculateValue;
@ApiModelProperty(notes = "流量费金额(元)", example = "600.00")
private BigDecimal shopTrafficMoney;
@ApiModelProperty(notes = "4S店分润金额", example = "1000.00")
private BigDecimal shopProfitMoney;
@ApiModelProperty(notes = "园区店分润金额", example = "1000.00")
private BigDecimal yqProfitMoney;
@ApiModelProperty(notes = "服务商分润金额", example = "1000.00")
private BigDecimal franchiseeProfitMoney;
@ApiModelProperty(notes = "广联分润金额", example = "1000.00")
private BigDecimal glProfitMoney;
@ApiModelProperty(notes = "安装费计算方式(参见计算方式的额外说明)", example = "1")
private Byte installCostCalculateType;
@ApiModelProperty(notes = "安装费计算值(%/元)", example = "0.6")
private BigDecimal installCostCategoryValue;
@ApiModelProperty(notes = "服务商对账营销费金额", example = "1000.00")
private BigDecimal installCost;
@ApiModelProperty(notes = "营销费计算方式(参见计算方式的额外说明)", example = "1")
private Byte marketingCostCalculateType;
@ApiModelProperty(notes = "营销费计算值(%/元)", example = "0.6")
private BigDecimal marketingCostCategoryValue;
@ApiModelProperty(notes = "服务商对账营销费金额", example = "1000.00")
private BigDecimal marketingCost;
@ApiModelProperty(notes = "服务商对账奖惩费金额", example = "1000.00")
private BigDecimal rewardAndPenaltyCost;
@ApiModelProperty(notes = "园区店毛利收益", example = "1000.00")
private BigDecimal yqGrossProfit;
@ApiModelProperty(notes = "园区成本", example = "1000.00")
private BigDecimal yqCost;
@ApiModelProperty(notes = "公共参数费用", example = "1000.00")
private BigDecimal commonCost;
@ApiModelProperty(notes = "自定义公共参数费用", example = "1000.00")
private BigDecimal customCommonCost;
@ApiModelProperty(notes = "商品成本", example = "300.00")
private BigDecimal goodsCost;
@ApiModelProperty(notes = "嘀加成本", example = "100.00")
private BigDecimal djCost;
@ApiModelProperty(notes = "第三方成本", example = "50.00")
private BigDecimal thirdPartyCost;
@ApiModelProperty(notes="虚拟对账成本", example = "100.00")
private BigDecimal virtualAccountCost;
@ApiModelProperty(notes="回收成本", example = "50.00")
private BigDecimal recoveryCost;
@ApiModelProperty(notes = "子订单/商品粒度财务对账数据")
private List<SubOrderProfitAllocationDTO> subPackageProfits;
}
package cn.com.glsx.dj.geno.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 订单产值查询结果DTO
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class OrderProductivityDTO implements Serializable {
private static final long serialVersionUID = -5200641383632806362L;
/**
* 订单编码
*/
private String orderCode;
/**
* 订单总价
*/
private BigDecimal totalPrice;
/**
* 成功支付时间
*/
private Date successDate;
/**
* 退款金额
*/
private BigDecimal refundAmount;
}
\ No newline at end of file
package cn.com.glsx.dj.geno.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("订单分账信息DTO")
public class OrderProfitAllocationDTO implements Serializable {
private static final long serialVersionUID = 5509165131731579362L;
@ApiModelProperty(notes = "主键ID")
private Long id;
@ApiModelProperty(notes = "主订单编号", example = "240313113839326")
private String orderCode;
@ApiModelProperty(notes = "geno订单id")
private String genoOrderId;
@ApiModelProperty(notes = "业务场景:0-会员权益/升级;1-精品升级;2-次新车转化;3-售后众筹;4-积分商城;", example = "1")
private Byte sceneType;
@ApiModelProperty(notes = "客户genoId")
private String customerGenoId;
@ApiModelProperty(notes = "客户姓名(脱敏)", example = "张*三")
private String customerName;
@ApiModelProperty(notes = "客户手机号(脱敏)", example = "138****8000")
private String customerPhone;
@ApiModelProperty(notes = "转化员uuid", example = "8d3f61299d024a3dbe685687c756866d")
private String sellerUserId;
@ApiModelProperty(notes = "转化员名称", example = "园区店员工01")
private String sellerName;
@ApiModelProperty(notes = "销售顾问uuid", example = "584fdb460afa4dad835cbe8d73cfa923")
private String userId;
@ApiModelProperty(notes = "销售顾问名称", example = "李四")
private String employeeName;
@ApiModelProperty(notes = "交易参考号", example = "329458327383973888")
private String tradeNo;
@ApiModelProperty(notes = "支付成功时间", example = "2023-01-01 12:00:00")
private Date successDate;
@ApiModelProperty(notes = "支付方式(1:微信支付,2:线下收款(/4s店支付),3:pos机支付,4:支付宝支付,5:嘀加收款,6-对公转账,7-其他收款)", example = "1")
private Byte payType;
@ApiModelProperty(notes = "应收金额(元)", example = "47781.00")
private BigDecimal totalPrice;
@ApiModelProperty(notes = "实付金额", example = "45000.00")
private BigDecimal paidMoney;
@ApiModelProperty(notes = "总分账金额", example = "47494.31")
private BigDecimal actualIncomeMoney;
@ApiModelProperty(notes = "4s店商户号", example = "44209389")
private Integer shopMerchantId;
@ApiModelProperty(notes = "4s店商户名称", example = "4s店001")
private String shopMerchantName;
@ApiModelProperty(notes = "园区店(服务对接)商户号", example = "44209389")
private Integer yqMerchantId;
@ApiModelProperty(notes = "园区店(服务对接)商户名称", example = "好牛园区店")
private String yqMerchantName;
@ApiModelProperty(notes = "平台方商户号", example = "44289888")
private Integer platformMerchantId;
@ApiModelProperty(notes = "平台方商户名称", example = "广联平台")
private String platformMerchantName;
@ApiModelProperty(notes = "订单类型(1正常,2异常,3正常测试,4异常测试,5未收款,6退款订单)", example = "1")
private Byte orderType;
@ApiModelProperty(notes = "对账状态(Y:已对账;N:未对账)", example = "Y")
private String reconciliationFlag;
@ApiModelProperty(notes = "流量费金额(元)", example = "10511.82")
private BigDecimal shopTrafficMoney;
@ApiModelProperty(notes = "4S店分润金额", example = "1000.00")
private BigDecimal shopProfitMoney;
@ApiModelProperty(notes = "园区店分润金额", example = "28620.82")
private BigDecimal yqProfitMoney;
@ApiModelProperty(notes = "服务商分润金额", example = "18978.61")
private BigDecimal franchiseeProfitMoney;
@ApiModelProperty(notes = "服务商对账安装金额", example = "1000.00")
private BigDecimal installCost;
@ApiModelProperty(notes = "服务商对账营销费金额", example = "1000.00")
private BigDecimal marketingCost;
@ApiModelProperty(notes = "服务商对账奖惩费金额", example = "16978.61")
private BigDecimal rewardAndPenaltyCost;
@ApiModelProperty(notes = "广联分润金额", example = "9928.90")
private BigDecimal glProfitMoney;
@ApiModelProperty(notes = "流量费分润方式(参见计算方式的额外说明)", example = "1")
private Byte shopTrafficMoneyCalculateType;
@ApiModelProperty(notes = "流量费计算值(%/元)", example = "0.6")
private BigDecimal shopTrafficMoneyCalculateValue;
@ApiModelProperty(notes = "安装费分润方式(参见计算方式的额外说明)", example = "1")
private Byte installCostCalculateType;
@ApiModelProperty(notes = "安装费计算值(%/元)", example = "10")
private BigDecimal installCostCategoryValue;
@ApiModelProperty(notes = "营销费计算方式(参见计算方式的额外说明)", example = "1")
private Byte marketingCostCalculateType;
@ApiModelProperty(notes = "营销费计算值(%/元)", example = "10")
private BigDecimal marketingCostCategoryValue;
@ApiModelProperty(notes = "园区店毛利收益", example = "28219.90")
private BigDecimal yqGrossProfit;
@ApiModelProperty(notes = "园区成本", example = "400.92")
private BigDecimal yqCost;
@ApiModelProperty(notes = "公共参数费用", example = "388.92")
private BigDecimal commonCost;
@ApiModelProperty(notes = "自定义公共参数费用", example = "12.00")
private BigDecimal customCommonCost;
@ApiModelProperty(notes = "商品成本", example = "388.92")
private BigDecimal goodsCost;
@ApiModelProperty(notes = "嘀加成本", example = "0")
private BigDecimal djCost;
@ApiModelProperty(notes = "第三方成本", example = "0")
private BigDecimal thirdPartyCost;
@ApiModelProperty(notes = "虚拟对账成本", example = "0")
private BigDecimal virtualAccountCost;
@ApiModelProperty(notes = "回收成本", example = "0")
private BigDecimal recoveryCost;
@ApiModelProperty(name = "payStartDateStr", notes = "支付开始时间", dataType = "string", example = "2020-12-25 00:00:00")
private String payStartDateStr;
@ApiModelProperty(name = "payEndDateStr", notes = "支付结束时间", dataType = "string", example = "2020-12-25 23:59:59")
private String payEndDateStr;
@ApiModelProperty(notes = "数据日期")
private Date dataDate;
@ApiModelProperty(notes = "创建时间")
private Date createdDate;
@ApiModelProperty(notes = "更新时间")
private Date updatedDate;
@ApiModelProperty(notes = "套餐粒度财务对账数据")
private List<OrderPackageProfitAllocationDTO> packageProfits;
@ApiModelProperty(notes="渠道")
private Integer channelType;
}
\ No newline at end of file
package cn.com.glsx.dj.geno.dto;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class StatisticsOverviewDTO implements Serializable {
private static final long serialVersionUID = 6620323827461121091L;
private BigDecimal todayOutputValue = BigDecimal.ZERO; // 今日产值
private Integer todayOrderCount = 0; // 今日单量
private BigDecimal todayAvgOrderValue = BigDecimal.ZERO; // 日均客单价
private BigDecimal monthOutputValue = BigDecimal.ZERO; // 本月产值
private Integer monthOrderCount = 0; // 本月单量
private BigDecimal monthAvgOrderValue = BigDecimal.ZERO; // 月均客单价
private BigDecimal totalOutputValue = BigDecimal.ZERO; // 累计产值
private Integer totalOrderCount = 0; // 累计单量
private BigDecimal totalAvgOrderValue = BigDecimal.ZERO; // 平均客单价
}
package cn.com.glsx.dj.geno.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class StatisticsOverviewReqDTO implements Serializable {
private static final long serialVersionUID = -5814237497284402431L;
/**
* 商户号
*/
private Integer merchantId;
/**
* 销售用户ID(园区店)
*/
private String sellerUserId;
}
package cn.com.glsx.dj.geno.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class SubOrderProfitAllocationDTO implements Serializable {
private static final long serialVersionUID = 2021249906991156159L;
@ApiModelProperty(notes = "主键ID")
private Long id;
@ApiModelProperty(notes = "主订单编号", example = "240313111119326")
private String orderCode;
@ApiModelProperty(notes = "geno订单id")
private String genoOrderId;
@ApiModelProperty(notes = "子订单编号", example = "2011151314368394")
private String subOrderCode;
@ApiModelProperty(notes = "套餐编码", example = "TC001")
private String packageCode;
@ApiModelProperty(notes = "套餐名称", example = "基础套餐")
private String packageName;
@ApiModelProperty(notes = "商品缩略图", example = "http://qcimg01.glsx.net:7060/group1/M00/00/04/wKgD3l-2QE6AC1HGAACPWytordQ405.jpg")
private String goodsThumbUrl;
@ApiModelProperty(notes = "商品名称", example = "好亮太阳膜")
private String goodsName;
@ApiModelProperty(notes="商品别名", example = "太阳膜")
private String goodsAlias;
@ApiModelProperty(notes = "商品编码", example = "SAP001")
private String sapCode;
@ApiModelProperty(notes = "商品分类名", example = "太阳膜")
private String goodsTypeName;
@ApiModelProperty(notes = "产品品牌商名称", example = "3M/福膜")
private String goodsBrandMerchantName;
@ApiModelProperty(notes="部位", example = "1")
private Integer goodsPosition;
@ApiModelProperty(notes="部位名称", example = "前挡")
private String goodsPositionName;
@ApiModelProperty(notes = "数量", example = "1")
private Integer nums;
@ApiModelProperty(notes = "商品零售价", example = "1000.00")
private BigDecimal sellPrice;
@ApiModelProperty(notes = "应收金额(元)", example = "10000.00")
private BigDecimal totalPrice;
@ApiModelProperty(notes = "实收金额/到账金额(元)", example = "99800.00")
private BigDecimal actualIncomeMoney;
@ApiModelProperty(notes = "流量费分润方式(参见计算方式的额外说明)", example = "1")
private Byte shopTrafficMoneyCalculateType;
@ApiModelProperty(notes = "流量费计算值(%/元)", example = "0.6")
private BigDecimal shopTrafficMoneyCalculateValue;
@ApiModelProperty(notes = "流量费金额(元)", example = "600.00")
private BigDecimal shopTrafficMoney;
@ApiModelProperty(notes = "4S店分润金额", example = "1000.00")
private BigDecimal shopProfitMoney;
@ApiModelProperty(notes = "园区店分润金额", example = "1000.00")
private BigDecimal yqProfitMoney;
@ApiModelProperty(notes = "服务商分润金额", example = "1000.00")
private BigDecimal franchiseeProfitMoney;
@ApiModelProperty(notes = "广联分润金额", example = "1000.00")
private BigDecimal glProfitMoney;
@ApiModelProperty(notes = "安装费分润方式(参见计算方式的额外说明)", example = "1")
private Byte installCostCalculateType;
@ApiModelProperty(notes = "安装费计算值(%/元)", example = "0.6")
private BigDecimal installCostCategoryValue;
@ApiModelProperty(notes = "服务商对账营销费金额", example = "1000.00")
private BigDecimal installCost;
@ApiModelProperty(notes = "营销费计算方式(参见计算方式的额外说明)", example = "1")
private Byte marketingCostCalculateType;
@ApiModelProperty(notes = "营销费计算值(%/元)", example = "0.6")
private BigDecimal marketingCostCategoryValue;
@ApiModelProperty(notes = "服务商对账营销费金额", example = "1000.00")
private BigDecimal marketingCost;
@ApiModelProperty(notes = "服务商对账奖惩费金额", example = "1000.00")
private BigDecimal rewardAndPenaltyCost;
@ApiModelProperty(notes = "园区店毛利收益", example = "1000.00")
private BigDecimal yqGrossProfit;
@ApiModelProperty(notes = "园区成本", example = "1000.00")
private BigDecimal yqCost;
@ApiModelProperty(notes = "公共参数费用", example = "1000.00")
private BigDecimal commonCost;
@ApiModelProperty(notes = "自定义公共参数费用", example = "1000.00")
private BigDecimal customCommonCost;
@ApiModelProperty(notes = "商品成本", example = "300.00")
private BigDecimal goodsCost;
@ApiModelProperty(notes = "嘀加成本", example = "100.00")
private BigDecimal djCost;
@ApiModelProperty(notes = "第三方成本", example = "50.00")
private BigDecimal thirdPartyCost;
@ApiModelProperty(notes="虚拟对账成本", example = "100.00")
private BigDecimal virtualAccountCost;
@ApiModelProperty(notes="回收成本", example = "50.00")
private BigDecimal recoveryCost;
}
package cn.com.glsx.dj.geno.dto;
import java.io.Serializable;
import java.util.Date;
/**
* @Title: ThirdPlatformRequestLogDTO.java
* @Description: 第三方平台请求记录DTO
* @author system
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2024
*/
@SuppressWarnings("serial")
public class ThirdPlatformRequestLogDTO implements Serializable {
private Long id;
private String requestType;
private String thirdOrderCode;
private String orderCode;
private String requestParams;
private String responseData;
private Integer processStatus;
private String errorMessage;
private Date requestTime;
private Date processTime;
private String createdBy;
private Date createdDate;
private String updatedBy;
private Date updatedDate;
private String deletedFlag;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getRequestType() {
return requestType;
}
public void setRequestType(String requestType) {
this.requestType = requestType;
}
public String getThirdOrderCode() {
return thirdOrderCode;
}
public void setThirdOrderCode(String thirdOrderCode) {
this.thirdOrderCode = thirdOrderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getRequestParams() {
return requestParams;
}
public void setRequestParams(String requestParams) {
this.requestParams = requestParams;
}
public String getResponseData() {
return responseData;
}
public void setResponseData(String responseData) {
this.responseData = responseData;
}
public Integer getProcessStatus() {
return processStatus;
}
public void setProcessStatus(Integer processStatus) {
this.processStatus = processStatus;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public Date getRequestTime() {
return requestTime;
}
public void setRequestTime(Date requestTime) {
this.requestTime = requestTime;
}
public Date getProcessTime() {
return processTime;
}
public void setProcessTime(Date processTime) {
this.processTime = processTime;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public Date getUpdatedDate() {
return updatedDate;
}
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
public String getDeletedFlag() {
return deletedFlag;
}
public void setDeletedFlag(String deletedFlag) {
this.deletedFlag = deletedFlag;
}
}
\ No newline at end of file
package cn.com.glsx.dj.geno.dto;
import java.io.Serializable;
/**
* @Title: UpdateRequestResultDTO.java
* @Description: 更新请求结果DTO
* @author system
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2024
*/
@SuppressWarnings("serial")
public class UpdateRequestResultDTO implements Serializable {
private Long id;
private Integer processStatus;
private String responseData;
private String errorMessage;
private String orderCode;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getProcessStatus() {
return processStatus;
}
public void setProcessStatus(Integer processStatus) {
this.processStatus = processStatus;
}
public String getResponseData() {
return responseData;
}
public void setResponseData(String responseData) {
this.responseData = responseData;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
}
\ No newline at end of file
package cn.com.glsx.dj.geno.enums;
\ No newline at end of file
package cn.com.glsx.dj.geno.model;
import java.io.Serializable;
/**
* @Title: DemoModel.java
* @Description:
* @author ${userName}
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@SuppressWarnings("serial")
public class DemoModel implements Serializable{
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package cn.com.glsx.dj.geno.model;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@Table(name = "dj_car_life_goods_order")
public class GoodsOrder implements Serializable{
/**
*
*/
private static final long serialVersionUID = 2428842557880837521L;
/**
* 主键ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 订单编号
*/
@ApiModelProperty(name = "orderCode", notes = "订单编号", dataType = "string", required = true, example = "")
@Column(name = "order_code")
private String orderCode;
/**
* 订单编号
*/
@ApiModelProperty(name = "thirdOrderCode", notes = "第三方订单编号", dataType = "string", required = true, example = "")
@Column(name = "third_order_code")
private String thirdOrderCode;
/**
* 渠道类型
*/
@Column(name = "channel_type")
private Integer channelType;
/**
* 用户ID
*/
@Column(name = "user_id")
private String userId;
/**
* 商户号
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 商户名称
*/
@Column(name = "merchant_name")
private String merchantName;
@ApiModelProperty(notes = "二级流量方商户id")
@Column(name = "sub_shop_merchant_id")
private Integer subShopMerchantId;
@ApiModelProperty(notes = "二级流量方商户名称")
@Column(name = "sub_shop_merchant_name")
private String subShopMerchantName;
/**
* 4S店主营车品牌LOGO
*/
@Column(name = "merchant_car_brand_logo")
private String merchantCarBrandLogo;
/**
* 员工姓名
*/
@Column(name = "employee_name")
private String employeeName;
/**
* 4S店员工用户ID(交付专员)
*/
@Column(name = "delivery_user_id")
private String deliveryUserId;
/**
* 4S店员工名称(交付专员)
*/
@Column(name = "delivery_employee_name")
private String deliveryEmployeeName;
/**
* 订单状态(1待升级;3待支付;4已支付;5已退款;6:已完成)
*/
private Byte status;
/**
* 操作状态(1已录入,2待选择支付方式,3升级待确认,4升级已确认[待支付],5战败待确认,6已支付,7战败已确认,8已评论)
*/
@Column(name = "oper_status")
private Byte operStatus;
/**
* 升级标识(Y:已升级;N:未升级)
*/
@ApiModelProperty(name="upgradeFlag", notes = "升级状态(Y:已升级 N:战败 null:待升级)", dataType = "string", example = "Y")
@Column(name = "upgrade_flag")
private String upgradeFlag;
/**
* 安装/升级时间
*/
@Column(name = "install_upgrade_time")
private Date installUpgradeTime;
/**
* 订单总额
*/
@ApiModelProperty(name="totalPrice", notes = "订单总额", dataType = "double", example = "100.00")
@Column(name = "total_price")
private BigDecimal totalPrice;
/**
* 优惠后最终金额
*/
@ApiModelProperty(name="finalPrice", notes = "优惠后最终金额", dataType = "double", example = "100.00")
@Column(name = "final_price")
private BigDecimal finalPrice;
/**
* 销售用户ID(园区店)
*/
@Column(name = "seller_user_id")
private String sellerUserId;
/**
* 销售商户号(园区店)
*/
@Column(name = "seller_merchant_id")
private Integer sellerMerchantId;
@Column(name = "seller_merchant_name")
private String sellerMerchantName;
/**
* 销售姓名(园区店)
*/
@Column(name = "seller_name")
private String sellerName;
/**
* 订单来源(1后台录入,2移动端预录客户,3移动端升级下单)
*/
@Column(name = "source")
private Byte source;
/**
*备注
*/
@Column(name = "remark")
private String remark;
/**
* 撤单原因
*/
@Column(name = "revoke_reason")
private String revokeReason;
/**
* 下单时间
*/
@ApiModelProperty(name="orderTime", notes = "下单时间", dataType = "date", example = "")
@Column(name = "order_time")
private Date orderTime;
@ApiModelProperty(name="advanceUserId", notes = "预录员id", dataType = "int", example = "10034")
@Column(name = "advance_user_id")
private String advanceUserId;
@ApiModelProperty(name="advanceUserName", notes = "预录员用户名", dataType = "string", example = "小王")
@Column(name = "advance_user_name")
private String advanceUserName;
/**
* 客户优惠券ID
*/
@Column(name = "customer_coupon_id")
private Integer customerCouponId;
@ApiModelProperty(name="payType", notes = "支付收款方(0:嘀加收款,1:4s店收款)", dataType = "byte", example = "1")
@Column(name = "payee_type")
private Byte payeeType;
/**
* 选择的支付方式
*/
@Column(name = "select_pay_type")
private Byte selectPayType;
/**
* 订单类型
*/
@Column(name = "order_type")
private Byte orderType;
/**
* 施工标识(Y:已施工;N:未施工)
*/
@Column(name = "construction_flag")
private String constructionFlag;
@Column(name = "confirm_construction_date")
private Date confirmConstructionDate;
/**
* 出库状态(1待出库,2已查询待出库,3出库中,4出库成功,5出库失败)
*/
@Column(name = "outbound_status")
private String outboundStatus;
/**
* 出库信息
*/
@Column(name = "outbound_msg")
private String outboundMsg;
/**
* 退款备注
*/
@Column(name = "refund_remark")
private String refundRemark;
/**
* 关联订单号
*/
@Column(name = "associated_order_code")
private String associatedOrderCode;
/**
* 失效标识(Y:已失效,N:未失效)
*/
@Column(name = "failure_flag")
private String failureFlag;
@Column(name = "scene_type")
private Byte sceneType;
/**
* 业务类型(1:权益;2:延保)
*/
@Column(name = "business_type")
private Byte businessType;
@Column(name = "deposit_price")
private BigDecimal depositPrice;
@Column(name = "deposit_payee_type")
private Byte depositPayeeType;
/**
* 安装服务商商户名称
*/
@Column(name = "install_merchant_name")
private String installMerchantName;
/**
* 营销服务商商户名称
*/
@Column(name = "marketing_merchant_name")
private String marketingMerchantName;
/**
* 财务分账状态(1:未分账,2:已分账,3待确认,4待分账,5分账中,6挂单)
*/
@Column(name = "profit_allocation_status")
private Byte profitAllocationStatus;
/**
* 开始等待分账的时间
*/
@Column(name = "wait_profit_allocation_date")
private Date waitProfitAllocationDate;
/**
* 指定财务规则id
*/
@Column(name = "specify_account_rule_id")
private Integer specifyAccountRuleId;
/**
* 指定财务规则id
*/
@Column(name = "specify_division_rule_id")
private Integer specifyDivisionRuleId;
/**
* 指定对账规则id
*/
@Column(name = "specify_reconciliation_rule_id")
private Integer specifyReconciliationRuleId;
/**
* 技师名称
*/
@Column(name = "technician_name")
@ApiModelProperty(name = "technician_name", notes = "技师名称", dataType = "string")
private String technicianName;
@ApiModelProperty(notes="技师uuid")
@Column(name = "technician_uuid")
private String technicianUuid;
/**
* 技师id
*/
@Column(name = "technician_id")
@ApiModelProperty(name = "technician_id", notes = "技师id", dataType = "int")
private Integer technicianId;
@Column(name = "division_operator")
private String divisionOperator;
@Column(name = "division_operation_date")
private Date divisionOperationDate;
/*
0:膜类订单,1:非膜类订单
*/
@Column(name = "film_order")
private Byte filmOrder;
/**
* 开票状态(1:未开票;2:已开票)
*/
@Column(name = "invoice_status")
private Byte invoiceStatus;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
package cn.com.glsx.dj.geno.model;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@Table(name = "dj_car_life_goods_order_profit_allocation")
public class GoodsOrderProfitAllocation implements Serializable{
/**
*
*/
private static final long serialVersionUID = -1867199406514311692L;
/**
* 主键ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 粒度类型(1:主订单;2:子订单;3:套餐)
*/
@Column(name = "grain_size_type")
private Byte grainSizeType;
@Column(name = "order_flag")
private String orderFlag;
/**
* 主订单编号
*/
@Column(name = "order_code")
private String orderCode;
/**
* 套餐编码
*/
@Column(name = "package_code")
private String packageCode;
/**
* 子订单编号
*/
@Column(name = "sub_order_code")
private String subOrderCode;
/**
* 场景(0:1.0;1:1.1;2:1.2;3:1.3)
*/
@Column(name = "scene_type")
private Byte sceneType;
/**
* 子订单金额
*/
@Column(name = "total_price")
private BigDecimal totalPrice;
/**
* 财务结算规则ID
*/
@Column(name = "settle_rule_id")
private Integer settleRuleId;
/**
* 对账规则id
*/
@Column(name = "reconciliation_rule_id")
private Integer reconciliationRuleId;
/**
* 商户商品分类结算规则id
*/
@Column(name = "goods_type_group_rule_id")
private Integer goodsTypeGroupRuleId;
/**
* 导流方POS机支付是否扣除手续费(Y:扣除,N:不扣)
*/
@Column(name = "shop4s_deduct_charge_flag")
private String shop4sDeductChargeFlag;
/**
* 服务商POS机支付是否扣除手续费(Y:扣除,N:不扣)
*/
@Column(name = "partner_deduct_charge_flag")
private String partnerDeductChargeFlag;
/**
* 平台方是否扣除产品成本(Y:扣除,N:不扣)
*/
@Column(name = "goods_cost_charge_flag")
private String goodsCostChargeFlag;
/**
* 平台方是否扣除虚拟对账成本(Y:扣除,N:不扣)
*/
@Column(name = "virtual_account_cost_flag")
private String virtualAccountCostFlag;
/**
* 平台方是否扣除回收成本(Y:扣除,N:不扣)
*/
@Column(name = "recovery_cost_flag")
private String recoveryCostFlag;
/**
* 平台方是否扣除嘀加成本(Y:扣除,N:不扣)
*/
@Column(name = "dj_cost_flag")
private String djCostFlag;
/**
* 平台方是否扣除第三方成本(Y:扣除,N:不扣)
*/
@Column(name = "third_party_cost_flag")
private String thirdPartyCostFlag;
/**
* 子订单手续费(统一0.6%计算,非真实手续费)
*/
@Column(name = "service_charge")
private BigDecimal serviceCharge;
/**
* 子订单实收金额[元](统一0.6%计算,非真实实收金额,总分账金额)
*/
@Column(name = "actual_income_money")
private BigDecimal actualIncomeMoney;
/**
* 毛利
*/
@Column(name = "gross_profit")
private BigDecimal grossProfit;
/**
* 参与分账金额
*/
@Column(name = "allocation_money")
private BigDecimal allocationMoney;
/**
* 4S店分润商户号
*/
@Column(name = "shop_merchant_id")
private Integer shopMerchantId;
/**
* 4S店分润商户名称
*/
@Column(name = "shop_merchant_name")
private String shopMerchantName;
/**
* 流量费分润方式(1按毛利比例;2按收入比例;3按固定金额)
*/
@Column(name = "shop_traffic_money_calculate_type")
private Byte shopTrafficMoneyCalculateType;
/**
* 流量费计算值(%/元)
*/
@Column(name = "shop_traffic_money_calculate_value")
private BigDecimal shopTrafficMoneyCalculateValue;
/**
* 购买数量
*/
@Column(name = "purchase_num")
private Integer purchaseNum;
/**
* 4S店分润金额
*/
@Column(name = "shop_profit_money")
private BigDecimal shopProfitMoney;
/**
* 4S店流量费
*/
@Column(name = "shop_traffic_money")
private BigDecimal shopTrafficMoney;
/**
* 园区店分润商户号
*/
@Column(name = "yq_merchant_id")
private Integer yqMerchantId;
/**
* 园区店分润商户名称
*/
@Column(name = "yq_merchant_name")
private String yqMerchantName;
/**
* 园区店分润金额
*/
@Column(name = "yq_profit_money")
private BigDecimal yqProfitMoney;
/**
* 园区店毛利收益
*/
@Column(name = "yq_gross_profit")
private BigDecimal yqGrossProfit;
/**
* 园区店毛利收益(不包含产品成本)
*/
@Column(name = "yq_gross_profit_npc")
private BigDecimal yqGrossProfitNpc;
/**
* 收入-其他费用
*/
@Column(name = "income_n_common_cost")
private BigDecimal incomeNCommonCost;
/**
* 收入-自定义其他费用
*/
@Column(name = "income_n_custom_common_cost")
private BigDecimal incomeNCustomCommonCost;
/**
* 园区店总成本
*/
@Column(name = "yq_cost")
private BigDecimal yqCost;
/**
* 加盟商分润金额
*/
@Column(name = "franchisee_profit_money")
private BigDecimal franchiseeProfitMoney;
/**
* 服务商对账营销费金额
*/
@Column(name = "install_cost")
private BigDecimal installCost;
/**
* 安装费计算方式
*/
@Column(name = "install_cost_calculate_type")
private Byte installCostCalculateType;
/**
* 安装费计算值(%/元)
*/
@Column(name = "install_cost_category_value")
private BigDecimal installCostCategoryValue;
/**
* 服务商对账安装费金额
*/
@Column(name = "marketing_cost")
private BigDecimal marketingCost;
/**
* 营销费计算方式
*/
@Column(name = "marketing_cost_calculate_type")
private Byte marketingCostCalculateType;
/**
* 营销费计算值(%/元)
*/
@Column(name = "marketing_cost_category_value")
private BigDecimal marketingCostCategoryValue;
/**
* 服务商对账奖惩费金额
*/
@Column(name = "reward_and_penalty_cost")
private BigDecimal rewardAndPenaltyCost;
/**
* 服务商对账阳光激励费金额
*/
@Column(name = "sunshine_incentive_fee")
private BigDecimal sunshineIncentiveFee;
/**
* 服务商对账其他费用金额
*/
@Column(name = "other_fee")
private BigDecimal otherFee;
/**
* 平台方商户号
*/
@Column(name = "platform_merchant_id")
private Integer platformMerchantId;
/**
* 平台方商户名称
*/
@Column(name = "platform_merchant_name")
private String platformMerchantName;
/**
* 广联分润金额
*/
@Column(name = "gl_profit_money")
private BigDecimal glProfitMoney;
/**
* 分润日期(确认升级日期)
*/
@Column(name = "data_date")
private Date dataDate;
/**
* 商品成本
*/
@Column(name = "goods_cost")
private BigDecimal goodsCost;
/**
* 商品成本
*/
@Column(name = "dj_cost")
private BigDecimal djCost;
/**
* 商品成本
*/
@Column(name = "third_party_cost")
private BigDecimal thirdPartyCost;
@ApiModelProperty(notes="虚拟对账成本")
@Column(name = "virtual_account_cost")
private BigDecimal virtualAccountCost;
@ApiModelProperty(notes="回收成本")
@Column(name = "recovery_cost")
private BigDecimal recoveryCost;
/**
* 公共参数费用
*/
@Column(name = "common_cost")
private BigDecimal commonCost;
/**
* 公共参数费用
*/
@Column(name = "custom_common_cost")
private BigDecimal customCommonCost;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
package cn.com.glsx.dj.geno.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@Table(name = "dj_car_life_goods_position")
public class GoodsPosition implements Serializable {
private static final long serialVersionUID = -6413436395586698544L;
/**
* 主键ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 部位值
*/
@Column(name = "position_value")
private Integer positionValue;
/**
* 部位名称
*/
@Column(name = "position_name")
private String positionName;
/**
* 扣减标准(米/单)
*/
@Column(name = "deduction_standard")
private BigDecimal deductionStandard;
@Column(name = "goods_type")
private Integer goodsType;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
\ No newline at end of file
package cn.com.glsx.dj.geno.model;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@Table(name = "dj_car_life_order_division")
public class OrderDivision implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1949148388205130546L;
/**
* 主键ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 分账单编号
*/
@ApiModelProperty(name="divisionOrderCode", notes = "分账单编号", dataType = "string")
@Column(name = "division_order_code")
private String divisionOrderCode;
@ApiModelProperty(name="payOrderId", notes = "支付订单ID")
@Column(name = "pay_order_id")
private Long payOrderId;
/**
* 主订单编号
*/
@ApiModelProperty(name="orderCode", notes = "订单编号", dataType = "string")
@Column(name = "order_code")
private String orderCode;
/**
* 场景(0:1.0;1:1.1;2:1.2;3:1.3)
*/
@Column(name = "scene_type")
private Byte sceneType;
/**
* 园区店商户号
*/
@ApiModelProperty(name="yqMerchantId", notes = "园区店商户号", dataType = "int")
@Column(name = "yq_merchant_id")
private Integer yqMerchantId;
/**
* 园区店商户名称
*/
@ApiModelProperty(name="yqMerchantName", notes = "园区店商户名称", dataType = "string")
@Column(name = "yq_merchant_name")
private String yqMerchantName;
/**
* 交易单号
*/
@ApiModelProperty(name="outTradeNo", notes = "交易单号", dataType = "string")
@Column(name = "out_trade_no")
private String outTradeNo;
/**
* 自动结算标识(Y是,N否)
*/
@ApiModelProperty(name="autoFlag", notes = "自动结算标识(Y是,N否)", dataType = "string")
@Column(name = "auto_flag")
private String autoFlag;
/**
* 分账测试状态标识(Y测试通过,N测试中未通过)
*/
@Column(name = "test_flag")
private String testFlag;
/**
* 结算时间方式(1:T+1,2:每月)
*/
@ApiModelProperty(name="settleTimeType", notes = "结算时间方式(1:T+N,2:每月)", dataType = "byte")
@Column(name = "settle_time_type")
private Byte settleTimeType;
/**
* 结算时间
*/
@ApiModelProperty(name="settleTime", notes = "结算时间", dataType = "byte")
@Column(name = "settle_time")
private Byte settleTime;
/**
* 原手续费
*/
@ApiModelProperty(name="fee", notes = "原手续费", dataType = "double")
private BigDecimal fee;
@ApiModelProperty(notes="手续费扣除商户号")
@Column(name = "fee_merchant_id")
private Integer feeMerchantId;
/**
* 手续费承担方
*/
@ApiModelProperty(name="feePayer", notes = "手续费承担方", dataType = "string")
@Column(name = "fee_payer")
private String feePayer;
/**
* 分账方式(1线下对账,2线上分账)
*/
@ApiModelProperty(name="divisionType", notes = "分账方式(1线下对账,2线上分账)", dataType = "string")
@Column(name = "division_type")
private Byte divisionType;
/**
* 支付金额
*/
@ApiModelProperty(name="payMoney", notes = "支付金额", dataType = "string")
@Column(name = "pay_money")
private BigDecimal payMoney;
/**
* 实收金额[元](支付金额-实际手续费)
*/
@ApiModelProperty(name="actualIncomeMoney", notes = "实收金额[元](支付金额-实际手续费)", dataType = "double")
@Column(name = "actual_income_money")
private BigDecimal actualIncomeMoney;
/**
* 分账金额(减0.6%手续费)
*/
@ApiModelProperty(name="divisionMoney", notes = "分账金额(减0.6%手续费)", dataType = "double")
@Column(name = "division_money")
private BigDecimal divisionMoney;
/**
* 广联分账金额(如为线上分账时为实际分账金额)
*/
@ApiModelProperty(name="glDivisionMoney", notes = "广联分账金额", dataType = "double")
@Column(name = "gl_division_money")
private BigDecimal glDivisionMoney;
/**
* 广联应分账金额
*/
@ApiModelProperty(name="glShouldDivisionMoney", notes = "广联应分账金额", dataType = "double")
@Column(name = "gl_should_division_money")
private BigDecimal glShouldDivisionMoney;
/**
* 4S店商户号
*/
@ApiModelProperty(notes="4S店商户号", dataType="int")
@Column(name = "shop_merchant_id")
private Integer shopMerchantId;
/**
* 4S店商户名称
*/
@ApiModelProperty(notes="4S店商户名称", dataType="string")
@Column(name = "shop_merchant_name")
private String shopMerchantName;
/**
* 4S店渠道类型
*/
@ApiModelProperty(notes="4S店渠道类型", dataType="int")
@Column(name = "shop_channel_type")
private Integer shopChannelType;
/**
* 4S店分账金额(如为线上分账时为实际分账金额)
*/
@ApiModelProperty(notes="4S店分账金额(如为线上分账时为实际分账金额)", dataType="double")
@Column(name = "shop_division_money")
private BigDecimal shopDivisionMoney;
/**
* 4S店应分账金额
*/
@ApiModelProperty(notes="4S店应分账金额", dataType="double")
@Column(name = "shop_should_division_money")
private BigDecimal shopShouldDivisionMoney;
/**
* 分账状态(1待分账,2分账中,3分账成功,4分账失败)
*/
@ApiModelProperty(notes="分账状态(1待分账,2分账中,3分账成功,4分账失败)", dataType="byte")
@Column(name = "division_status")
private Byte divisionStatus;
/**
* 失败消息内容
*/
@ApiModelProperty(notes="失败消息内容", dataType="string")
@Column(name = "fail_message")
private String failMessage;
/**
* 支付成功时间
*/
@ApiModelProperty(notes="支付成功时间", dataType="date")
@Column(name = "pay_success_date")
private Date paySuccessDate;
/**
* 分账时间
*/
@ApiModelProperty(notes="分账时间", dataType="date")
@Column(name = "division_date")
private Date divisionDate;
/**
* 不再重新发起分账标志(Y:是;N:否)
*/
@ApiModelProperty(notes="不再重新发起分账标志(Y:是;N:否)", dataType="date")
@Column(name = "no_more_retry_flag")
private String noMoreRetryFlag;
/**
* 分账次数
*/
@ApiModelProperty(notes="分账次数", dataType="int")
@Column(name = "division_count")
private Integer divisionCount;
/**
* 使用的分账规则ID
*/
@ApiModelProperty(notes="使用的分账规则ID", dataType="int")
@Column(name = "division_rule_id")
private Integer divisionRuleId;
/**
* 创建人
*/
@ApiModelProperty(notes="创建人", dataType="string")
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@ApiModelProperty(notes="创建时间", dataType="date")
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@ApiModelProperty(notes="修改人", dataType="string")
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@ApiModelProperty(notes="修改时间", dataType="date")
@Column(name = "updated_date")
private Date updatedDate;
/**
* 实际分账4S店商户号
*/
@ApiModelProperty(notes="实际分账4S店商户号", dataType="int")
@Column(name = "reality_shop_merchant_id")
private Integer realityShopMerchantId;
/**
* 实际分账4S店商户名称
*/
@ApiModelProperty(notes="实际分账4S店商户名称", dataType="string")
@Column(name = "reality_shop_merchant_name")
private String realityShopMerchantName;
/**
* 实际分账4S店商户类型
*/
@ApiModelProperty(notes="实际分账4S店商户类型", dataType="int")
@Column(name = "reality_shop_user_type")
private Integer realityShopUserType;
/**
* 实际分账平台方商户号
*/
@ApiModelProperty(notes="实际分账平台方商户号", dataType="int")
@Column(name = "reality_platform_merchant_id")
private Integer realityPlatformMerchantId;
/**
* 实际分账平台方商户名称
*/
@ApiModelProperty(notes="实际分账平台方商户名称", dataType="string")
@Column(name = "reality_platform_merchant_name")
private String realityPlatformMerchantName;
/**
* 实际分账平台方商户用户类型
*/
@ApiModelProperty(notes="实际分账平台方商户用户类型", dataType="int")
@Column(name = "reality_platform_user_type")
private Integer realityPlatformUserType;
/**
* 开启多平台分账(Y:开启;N:关闭)
*/
@Column(name = "multi_platform_merchant_flag")
private String multiPlatformMerchantFlag;
/**
* 嘀加智慧云子商户商户号
*/
@Column(name = "djzhy_sub_merchant_id")
private Integer djzhySubMerchantId;
/**
* 嘀加智慧云子商户商户名称
*/
@Column(name = "djzhy_sub_merchant_name")
private String djzhySubMerchantName;
/**
* 嘀加智慧云子商户分账金额(如为线上分账时为实际分账金额)
*/
@Column(name = "djzhy_sub_merchant_division_money")
private BigDecimal djzhySubMerchantDivisionMoney;
/**
* 嘀加智慧云子商户应分账金额
*/
@Column(name = "djzhy_sub_merchant_should_division_money")
private BigDecimal djzhySubMerchantShouldDivisionMoney;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
\ No newline at end of file
package cn.com.glsx.dj.geno.model;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@ToString
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@Table(name = "dj_car_life_pay_order")
public class PayOrder implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1278165570120578878L;
/**
* 主键ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 主订单编号
*/
@Column(name = "order_code")
private String orderCode;
/**
* 园区店商户id
*/
@Column(name = "yq_merchant_id")
private Integer yqMerchantId;
@Column(name = "shop_merchant_id")
private Integer shopMerchantId;
@Column(name = "shop_merchant_name")
private String shopMerchantName;
/**
* 园区店商户名称
*/
@Column(name = "yq_merchant_name")
private String yqMerchantName;
/**
* 支付状态(1:未支付,2:已支付)
*/
@ApiModelProperty(name="payStatus", notes = "支付状态(1:未支付,2:已支付)", dataType = "byte", example = "1")
@Column(name = "pay_status")
private Byte payStatus;
/**
* 中邮凭证上传状态:0-无需上传,1-待上传,2-已上传
*/
@ApiModelProperty(name="zyVoucherStatus", notes = "中邮凭证上传状态:0-无需上传,1-待上传,2-已上传", dataType = "byte", example = "1")
@Column(name = "zy_voucher_status")
private Byte zyVoucherStatus;
/**
* 中邮凭证上传地址
*/
@ApiModelProperty(name="zyVoucherUrl", notes = "中邮凭证上传地址", dataType = "string", example = "boutique/upload/image/2020111516103253236a85bd50d8b4639807461df42d0da2a.png")
@Column(name = "zy_voucher_url")
private String zyVoucherUrl;
/**
* 订单金额
*/
@ApiModelProperty(name="orderMoney", notes = "订单金额", dataType = "double", example = "100.28")
@Column(name = "order_money")
private BigDecimal orderMoney;
/**
* 实付金额(元)
*/
@ApiModelProperty(name="actualMoney", notes = "实付金额(元)", dataType = "double", example = "100.00")
@Column(name = "actual_money")
private BigDecimal actualMoney;
/**
* 优惠券优惠金额
*/
@ApiModelProperty(name="couponDiscountMoney", notes = "优惠金额", dataType = "double", example = "5.55")
@Column(name = "coupon_discount_money")
private BigDecimal couponDiscountMoney;
/**
* 优惠券信息json数组
*/
@ApiModelProperty(name="couponJson", notes = "优惠券信息json数组", dataType = "string", example = "")
@Column(name = "coupon_json")
private String couponJson;
/**
* 手续费比例(百分比)
*/
@ApiModelProperty(name="serviceChargePer", notes = "手续费比例(百分比)", dataType = "double", example = "9.99")
@Column(name = "service_charge_per")
private BigDecimal serviceChargePer;
/**
* 手续费
*/
@ApiModelProperty(name="serviceCharge", notes = "手续费", dataType = "double", example = "5.55")
@Column(name = "service_charge")
private BigDecimal serviceCharge;
/**
* 实收金额[元](实付金额-手续费)
*/
@ApiModelProperty(name="actualIncomeMoney", notes = "实收金额[元](实付金额-手续费)", dataType = "double", example = "94.45")
@Column(name = "actual_income_money")
private BigDecimal actualIncomeMoney;
@ApiModelProperty(name="payType", notes = "支付收款方(0:嘀加收款,1:4s店收款)", dataType = "byte", example = "1")
@Column(name = "payee_type")
private Byte payeeType;
/**
* 支付方式(1:线上微信支付,2:线下收款)
*/
@ApiModelProperty(name="payType", notes = "支付方式(1:线上微信支付,2:线下收款,3:POS机收款,4:支付宝支付,5:嘀加收款,6:对公转账,7:其他收款)", dataType = "byte", example = "1")
@Column(name = "pay_type")
private Byte payType;
/**
* 收款方(1广联2银盛)
*/
@ApiModelProperty(name="payee", notes = "收款方(1广联2银盛)", dataType = "byte", example = "1")
@Column(name = "payee")
private Byte payee;
/**
* 请求支付时间
*/
@ApiModelProperty(name="requestPayDate", notes = "请求支付时间", dataType = "date", example = "")
@Column(name = "request_pay_date")
private Date requestPayDate;
/**
* 支付成功时间
*/
@ApiModelProperty(name="successDate", notes = "支付成功时间", dataType = "date", example = "")
@Column(name = "success_date")
private Date successDate;
/**
* 交易单号
*/
@ApiModelProperty(name="outTradeNo", notes = "交易单号(交易流水)", dataType = "string", example = "329458327383973888")
@Column(name = "out_trade_no")
private String outTradeNo;
@ApiModelProperty(name="tradeNo", notes = "交易凭证", dataType = "string", example = "329458327383973888")
@Column(name = "trade_no")
private String tradeNo;
/**
* 线下支付凭证
*/
@ApiModelProperty(name="payVoucher", notes = "线下支付凭证", dataType = "string", example = "boutique/upload/image/2020111516103253236a85bd50d8b4639807461df42d0da2a.png")
@Column(name = "pay_voucher")
private String payVoucher;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@ApiModelProperty(name="createdDate", notes = "创建时间", dataType = "date", example = "")
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
\ No newline at end of file
package cn.com.glsx.dj.geno.model;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* @Title: ThirdPlatformRequestLog.java
* @Description: 第三方平台请求记录表
* @author system
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2024
*/
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@Table(name = "dj_car_life_third_platform_request_log")
public class ThirdPlatformRequestLog implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 请求类型编码
*/
@ApiModelProperty(name = "requestType", notes = "请求类型编码", dataType = "string", required = true, example = "JL_ORDER_PUSH")
@Column(name = "request_type")
private String requestType;
/**
* 第三方订单号
*/
@ApiModelProperty(name = "thirdOrderCode", notes = "第三方订单号", dataType = "string", example = "JL202401010001")
@Column(name = "third_order_code")
private String thirdOrderCode;
/**
* 系统订单号
*/
@ApiModelProperty(name = "orderCode", notes = "系统订单号", dataType = "string", example = "DJ202401010001")
@Column(name = "order_code")
private String orderCode;
/**
* 请求入参(JSON格式)
*/
@ApiModelProperty(name = "requestParams", notes = "请求入参JSON", dataType = "string")
@Column(name = "request_params")
private String requestParams;
/**
* 响应结果(JSON格式)
*/
@ApiModelProperty(name = "responseData", notes = "响应结果JSON", dataType = "string")
@Column(name = "response_data")
private String responseData;
/**
* 处理状态:0-待处理,1-处理成功,2-处理失败
*/
@ApiModelProperty(name = "processStatus", notes = "处理状态", dataType = "int", example = "0")
@Column(name = "process_status")
private Integer processStatus;
/**
* 错误信息
*/
@ApiModelProperty(name = "errorMessage", notes = "错误信息", dataType = "string")
@Column(name = "error_message")
private String errorMessage;
/**
* 请求时间
*/
@ApiModelProperty(name = "requestTime", notes = "请求时间", dataType = "date")
@Column(name = "request_time")
private Date requestTime;
/**
* 处理完成时间
*/
@ApiModelProperty(name = "processTime", notes = "处理完成时间", dataType = "date")
@Column(name = "process_time")
private Date processTime;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
\ No newline at end of file
package cn.com.glsx.dj.geno.remote;
import cn.com.glsx.dj.geno.model.DemoModel;
import cn.com.glsx.dj.geno.dto.DemoDTO;
/**
* @Title: DemoService.java
* @Description:
* @author ${userName}
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
public interface DemoRemote {
DemoModel get(String name);
DemoDTO convert(DemoModel model);
}
package cn.com.glsx.dj.geno.remote;
import cn.com.glsx.dj.geno.dto.OrderDivisionDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import javax.validation.constraints.NotNull;
@ApiService(value = "分账接口", owner = "caiym", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface OrderDivisionRemote {
@ApiMethod("分页查询分账信息")
@ApiParam(name = "pagination", notes = "分页过滤条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("分账信息分页数据")
RpcResponse<RpcPagination<OrderDivisionDTO>> pageOrderDivision(@NotNull RpcPagination<OrderDivisionDTO> pagination);
}
package cn.com.glsx.dj.geno.remote;
import cn.com.glsx.dj.geno.dto.OrderProfitAllocationDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import javax.validation.constraints.NotNull;
/**
* 订单分账信息RPC接口
* @author system
* @date 2024-01-01
*/
@ApiService(value = "财务对账接口", owner = "caiym", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface OrderProfitAllocationRemote {
@ApiMethod("分页查询订单财务对账信息")
@ApiParam(name = "pagination", notes = "分页及过滤条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("订单财务对账信息分页")
RpcResponse<RpcPagination<OrderProfitAllocationDTO>> pageOrderProfitAllocation(@NotNull RpcPagination<OrderProfitAllocationDTO> pagination);
@ApiMethod("获取订单财务对账详情")
@ApiParam(name = "dto", notes = "过滤条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("订单财务对账详情")
RpcResponse<OrderProfitAllocationDTO> getDetail(@NotNull OrderProfitAllocationDTO dto);
}
\ No newline at end of file
package cn.com.glsx.dj.geno.remote;
import cn.com.glsx.dj.geno.dto.StatisticsOverviewDTO;
import cn.com.glsx.dj.geno.dto.StatisticsOverviewReqDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value = "统计查询接口", owner = "林冲", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface StatisticsRemote {
@ApiMethod("统计日、月、总的产值数据")
@ApiParam(name = "dto", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("日、月、总的产值数据")
RpcResponse<StatisticsOverviewDTO> getStatisticsOverview(StatisticsOverviewReqDTO reqDTO);
}
package cn.com.glsx.dj.geno.remote;
import cn.com.glsx.dj.geno.dto.ThirdPlatformRequestLogDTO;
import cn.com.glsx.dj.geno.dto.UpdateRequestResultDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
/**
* @Title: ThirdPlatformRequestLogRemote.java
* @Description: 第三方平台请求记录Remote接口
* @author system
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2024
*/
@ApiService(value = "记录第三方请求日志", owner = "林冲", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface ThirdPlatformRequestLogRemote {
/**
* 保存请求记录
* @param requestLogDTO 请求记录信息
* @return 保存结果
*/
@ApiMethod("保存请求记录")
@ApiParam(name = "dto", notes = "dto", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("请求记录ID")
RpcResponse<Long> saveRequestLog(ThirdPlatformRequestLogDTO requestLogDTO);
/**
* 更新请求处理结果
* @param updateRequestResultDTO 更新请求结果DTO
* @return 更新结果
*/
@ApiMethod("更新请求处理结果")
@ApiParam(name = "dto", notes = "dto", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("更新是否成功")
RpcResponse<Boolean> updateRequestResult(UpdateRequestResultDTO updateRequestResultDTO);
}
\ No newline at end of file
# framework-archetype-rpc-api
RPC-API项目骨架
```properties
└─src
├─main
├─java
├─cn.com.glsx.dj.dto 数据传输模型层
├─cn.com.glsx.dj.enums 枚举定义
├─cn.com.glsx.dj.model 数据模型层
└─cn.com.glsx.dj.remote RPC暴露服务层
└─resources 资源文件目录
└─rpc
└─dubbo.xml dubbo接口配置
└─pom.xml pom文件
```
```properties
1、API改动后,请及时deploy到Maven仓库
```
```properties
1、rpc-api-deploy-maven-plugin api上报插件需配置当前api的jar包的引用。
```
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>framework-rpc</artifactId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-geno</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>rpc-dj-geno</name>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-geno-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-system-api</artifactId>
<version>4.55.2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package cn.com.glsx.dj.geno;
import org.oreframework.boot.main.AbsOreBootStarter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
/**
* @Title: Main.java
* @Description:
* @author linchong
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@SpringBootApplication
@ServletComponentScan
public class Main extends AbsOreBootStarter {
@Override
public void run(String[] args)
{
SpringApplication.run(Main.class, args);
}
public static void main(String[] args)
{
Main main = new Main();
main.run(args);
}
}
package cn.com.glsx.dj.geno.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author linchong
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class DubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
/**
* 注册远程服务(示例)
* RpcRemote为需要调用的远程服务
* @return
*/
/*@Bean
public RpcRemote rpcApiMethodRemote(){
return factory.builder(RpcRemote.class).check(false).timeout(30000).build();
}*/
}
package cn.com.glsx.dj.geno.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* @Title: SystemProperty.java
* @Description:
* @author linchong
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Configuration
@ConfigurationProperties("system")
public class SystemProperty {
// 对应配置项:system.name
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package cn.com.glsx.dj.geno.converter;
import cn.com.glsx.framework.core.beans.converter.RpcBaseConverter;
import org.mapstruct.Mapper;
import cn.com.glsx.dj.geno.model.DemoModel;
import cn.com.glsx.dj.geno.dto.DemoDTO;
/**
* @Title: DemoConverter.java
* @Description:
* @author linchong
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Mapper(componentModel = "spring")
public abstract class DemoConverter extends RpcBaseConverter<DemoModel,DemoDTO>{
}
package cn.com.glsx.dj.geno.converter;
import cn.com.glsx.dj.geno.dto.ThirdPlatformRequestLogDTO;
import cn.com.glsx.dj.geno.model.ThirdPlatformRequestLog;
import cn.com.glsx.framework.core.beans.converter.RpcBaseConverter;
import org.mapstruct.Mapper;
/**
* @Title: ThirdPlatformRequestLogConverter.java
* @Description: 第三方平台请求记录转换器
* @author system
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2024
*/
@Mapper(componentModel = "spring")
public abstract class ThirdPlatformRequestLogConverter extends RpcBaseConverter<ThirdPlatformRequestLog, ThirdPlatformRequestLogDTO> {
}
\ No newline at end of file
package cn.com.glsx.dj.geno.manager;
import org.springframework.stereotype.Service;
import cn.com.glsx.dj.geno.model.DemoModel;
/**
* @Title: DemoManager.java
* @Description:
* @author linchong
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Service
public class DemoManager{
public DemoModel load(){
return null;
}
}
package cn.com.glsx.dj.geno.mapper;
import cn.com.glsx.dj.geno.model.DemoModel;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
/**
* @Title: DemoMapper.java
* @Description:
* @author linchong
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Mapper
public interface DemoMapper extends OreMapper<DemoModel> {
DemoModel load();
}
package cn.com.glsx.dj.geno.mapper;
import cn.com.glsx.dj.geno.dto.OrderProductivityDTO;
import cn.com.glsx.dj.geno.model.GoodsOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface GoodsOrderMapper extends OreMapper<GoodsOrder> {
/**
* 查询订单产值数据(用于内存计算)
* @param merchantId 商户ID
* @param sellerUserId 销售员ID
* @return 订单产值数据列表
*/
List<OrderProductivityDTO> getOrderProductivityData(@Param("merchantId") Integer merchantId,
@Param("sellerUserId") String sellerUserId);
}
package cn.com.glsx.dj.geno.mapper;
import cn.com.glsx.dj.geno.model.GoodsPosition;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface GoodsPositionMapper extends OreMapper<GoodsPosition> {
}
\ No newline at end of file
package cn.com.glsx.dj.geno.mapper;
import cn.com.glsx.dj.geno.dto.OrderDivisionDTO;
import cn.com.glsx.dj.geno.model.OrderDivision;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface OrderDivisionMapper extends OreMapper<OrderDivision> {
List<OrderDivisionDTO> listOrderDivision(OrderDivisionDTO condition);
}
package cn.com.glsx.dj.geno.mapper;
import cn.com.glsx.dj.geno.dto.OrderPackageProfitAllocationDTO;
import cn.com.glsx.dj.geno.dto.OrderProfitAllocationDTO;
import cn.com.glsx.dj.geno.dto.SubOrderProfitAllocationDTO;
import cn.com.glsx.dj.geno.model.GoodsOrderProfitAllocation;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface OrderProfitAllocationMapper extends OreMapper<GoodsOrderProfitAllocation> {
List<OrderProfitAllocationDTO> listOrderProfitAllocation(OrderProfitAllocationDTO condition);
List<OrderProfitAllocationDTO> listOrderDetailProfitAllocation(OrderProfitAllocationDTO dto);
List<OrderPackageProfitAllocationDTO> listOrderPackageDetailProfitAllocation(OrderProfitAllocationDTO dto);
List<SubOrderProfitAllocationDTO> listSubOrderPackageDetailProfitAllocation(OrderProfitAllocationDTO dto);
}
package cn.com.glsx.dj.geno.mapper;
import cn.com.glsx.dj.geno.model.PayOrder;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface PayOrderMapper extends OreMapper<PayOrder> {
}
\ No newline at end of file
package cn.com.glsx.dj.geno.mapper;
import cn.com.glsx.dj.geno.model.ThirdPlatformRequestLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
/**
* @Title: ThirdPlatformRequestLogMapper.java
* @Description: 第三方平台请求记录Mapper
* @author system
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2024
*/
@Mapper
public interface ThirdPlatformRequestLogMapper extends OreMapper<ThirdPlatformRequestLog> {
/**
* 更新请求处理结果
* @param id 记录ID
* @param processStatus 处理状态
* @param responseData 响应数据
* @param errorMessage 错误信息
* @param orderCode 系统订单号
* @param updatedBy 更新人
* @return 更新条数
*/
int updateRequestResult(@Param("id") Long id,
@Param("processStatus") Integer processStatus,
@Param("responseData") String responseData,
@Param("errorMessage") String errorMessage,
@Param("orderCode") String orderCode,
@Param("updatedBy") String updatedBy);
}
\ No newline at end of file
package cn.com.glsx.dj.geno.remote;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.geno.model.DemoModel;
import cn.com.glsx.dj.geno.dto.DemoDTO;
import cn.com.glsx.dj.geno.service.DemoService;
import cn.com.glsx.dj.geno.converter.DemoConverter;
import org.apache.dubbo.config.annotation.DubboService;
/**
* @Title: DemoRemoteImpl.java
* @Description:
* @author linchong
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@DubboService(retries = 0, timeout = 30000)
public class DemoRemoteImpl implements DemoRemote {
@Autowired
private DemoConverter demoConverter;
@Autowired
private DemoService demoService;
public DemoModel get(String name){
return demoService.load();
}
public DemoDTO convert(DemoModel model){
return demoConverter.convertToTarget(model);
}
}
package cn.com.glsx.dj.geno.remote;
import cn.com.glsx.dj.geno.dto.OrderDivisionDTO;
import cn.com.glsx.dj.geno.service.OrderDivisionService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class OrderDivisionRemoteImpl implements OrderDivisionRemote{
@Autowired
private OrderDivisionService orderDivisionService;
@Override
public RpcResponse<RpcPagination<OrderDivisionDTO>> pageOrderDivision(RpcPagination<OrderDivisionDTO> pagination) {
try{
pagination = RpcPagination.copyPage(orderDivisionService.pageOrderDivision(pagination));
return RpcResponse.success(pagination);
}catch(Exception e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.geno.remote;
import cn.com.glsx.dj.geno.dto.OrderProfitAllocationDTO;
import cn.com.glsx.dj.geno.service.OrderProfitAllocationService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class OrderProfitAllocationRemoteImpl implements OrderProfitAllocationRemote{
@Autowired
private OrderProfitAllocationService orderProfitAllocationService;
@Override
public RpcResponse<RpcPagination<OrderProfitAllocationDTO>> pageOrderProfitAllocation(RpcPagination<OrderProfitAllocationDTO> pagination) {
try{
pagination = RpcPagination.copyPage(orderProfitAllocationService.pageOrderProfitAllocation(pagination));
return RpcResponse.success(pagination);
}catch(Exception e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<OrderProfitAllocationDTO> getDetail(OrderProfitAllocationDTO dto) {
try{
return RpcResponse.success(orderProfitAllocationService.getDetail(dto));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.geno.remote;
import cn.com.glsx.dj.geno.dto.StatisticsOverviewDTO;
import cn.com.glsx.dj.geno.dto.StatisticsOverviewReqDTO;
import cn.com.glsx.dj.geno.service.StatisticsService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import javax.annotation.Resource;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class StatisticsRemoteImpl implements StatisticsRemote{
@Resource
private StatisticsService statisticsService;
@Override
public RpcResponse<StatisticsOverviewDTO> getStatisticsOverview(StatisticsOverviewReqDTO reqDTO) {
try{
return RpcResponse.success(statisticsService.getStatisticsOverview(reqDTO));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.geno.remote;
import cn.com.glsx.dj.geno.converter.ThirdPlatformRequestLogConverter;
import cn.com.glsx.dj.geno.dto.ThirdPlatformRequestLogDTO;
import cn.com.glsx.dj.geno.dto.UpdateRequestResultDTO;
import cn.com.glsx.dj.geno.model.ThirdPlatformRequestLog;
import cn.com.glsx.dj.geno.service.ThirdPlatformRequestLogService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Title: ThirdPlatformRequestLogRemoteImpl.java
* @Description: 第三方平台请求记录Remote实现类
* @author system
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2024
*/
@Slf4j
@DubboService(retries = 0, timeout = 30000, version = "1.0.0")
public class ThirdPlatformRequestLogRemoteImpl implements ThirdPlatformRequestLogRemote {
@Autowired
private ThirdPlatformRequestLogConverter thirdPlatformRequestLogConverter;
@Autowired
private ThirdPlatformRequestLogService thirdPlatformRequestLogService;
@Override
public RpcResponse<Long> saveRequestLog(ThirdPlatformRequestLogDTO requestLogDTO) {
try {
ThirdPlatformRequestLog requestLog = thirdPlatformRequestLogConverter.convertToSource(requestLogDTO);
Long id = thirdPlatformRequestLogService.saveRequestLog(requestLog);
return RpcResponse.success(id);
} catch (Exception e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> updateRequestResult(UpdateRequestResultDTO updateRequestResultDTO) {
try {
boolean result = thirdPlatformRequestLogService.updateRequestResult(
updateRequestResultDTO.getId(),
updateRequestResultDTO.getProcessStatus(),
updateRequestResultDTO.getResponseData(),
updateRequestResultDTO.getErrorMessage(),
updateRequestResultDTO.getOrderCode(),
"SYSTEM"
);
return RpcResponse.success(result);
} catch (Exception e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
\ No newline at end of file
package cn.com.glsx.dj.geno.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.com.glsx.dj.geno.mapper.DemoMapper;
import cn.com.glsx.dj.geno.model.DemoModel;
/**
* @Title: DemoService.java
* @Description:
* @author linchong
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Service
public class DemoService {
@Autowired
private DemoMapper demoMapper;
public DemoModel load(){
return demoMapper.load();
}
}
package cn.com.glsx.dj.geno.service;
import cn.com.glsx.dj.geno.mapper.GoodsPositionMapper;
import cn.com.glsx.dj.geno.model.GoodsPosition;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = RpcServiceException.class)
public class GoodsPositionService {
@Autowired
private GoodsPositionMapper goodsPositionMapper;
@Lazy
@Autowired
private GoodsPositionService thiz;
public List<GoodsPosition> list(GoodsPosition goodsPosition) {
try{
goodsPosition.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
return goodsPositionMapper.select(goodsPosition);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public Map<Integer, String> getPositionNameMap(GoodsPosition goodsPosition){
List<GoodsPosition> list = list(goodsPosition);
if (CollectionUtils.isNotEmpty(list)) {
return list.stream()
.filter(o->o!=null &&o.getId() != null && StringUtils.isNoneBlank(o.getPositionName()))
.collect(Collectors.toMap(GoodsPosition::getPositionValue, GoodsPosition::getPositionName, (o1,o2)->o2));
}
return null;
}
}
package cn.com.glsx.dj.geno.service;
import cn.com.glsx.dj.geno.dto.OrderDivisionDTO;
import cn.com.glsx.dj.geno.mapper.OrderDivisionMapper;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = RpcServiceException.class)
public class OrderDivisionService {
@Autowired
private OrderDivisionMapper orderDivisionMapper;
public Page<OrderDivisionDTO> pageOrderDivision(RpcPagination<OrderDivisionDTO> pagination){
try{
Page<OrderDivisionDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
orderDivisionMapper.listOrderDivision(pagination.getCondition());
return page;
}catch (RpcServiceException rpcServiceException){
throw rpcServiceException;
}catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
}
package cn.com.glsx.dj.geno.service;
import cn.com.glsx.dj.geno.dto.OrderPackageProfitAllocationDTO;
import cn.com.glsx.dj.geno.dto.OrderProfitAllocationDTO;
import cn.com.glsx.dj.geno.dto.SubOrderProfitAllocationDTO;
import cn.com.glsx.dj.geno.mapper.OrderProfitAllocationMapper;
import cn.com.glsx.dj.geno.model.GoodsPosition;
import cn.com.glsx.dj.geno.util.CommonUtil;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = RpcServiceException.class)
public class OrderProfitAllocationService {
@Autowired
private OrderProfitAllocationMapper orderProfitAllocationMapper;
@Autowired
private GoodsPositionService goodsPositionService;
public Page<OrderProfitAllocationDTO> pageOrderProfitAllocation(RpcPagination<OrderProfitAllocationDTO> pagination) {
try{
Page<OrderProfitAllocationDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
orderProfitAllocationMapper.listOrderProfitAllocation(pagination.getCondition());
return page;
}catch (RpcServiceException rpcServiceException){
throw rpcServiceException;
}catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
public OrderProfitAllocationDTO getDetail(OrderProfitAllocationDTO dto) {
RpcAssert.assertNotNull(dto, DefaultErrorEnum.DATA_NULL,"dto not be null");
RpcAssert.assertIsTrue(StringUtils.isNotBlank(dto.getOrderCode()) || StringUtils.isNotBlank(dto.getGenoOrderId()), DefaultErrorEnum.DATA_INVALID,"orderCode or genoOrderId not be blank");
try{
OrderProfitAllocationDTO orderProfit = CommonUtil.getFirst(orderProfitAllocationMapper.listOrderDetailProfitAllocation(dto));
if (orderProfit == null) {
return null;
}
dto.setOrderCode(orderProfit.getOrderCode());
List<OrderPackageProfitAllocationDTO> packageProfitAllocationDTOS = orderProfitAllocationMapper.listOrderPackageDetailProfitAllocation(dto);
List<SubOrderProfitAllocationDTO> subOrderProfitAllocationDTOS = orderProfitAllocationMapper.listSubOrderPackageDetailProfitAllocation(dto);
// 组装
if (CollectionUtils.isNotEmpty(subOrderProfitAllocationDTOS)) {
Map<String, OrderPackageProfitAllocationDTO> packageProfitMap = Optional.ofNullable(packageProfitAllocationDTOS).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(OrderPackageProfitAllocationDTO::getPackageCode, Function.identity(), (o1, o2) -> o2));
List<OrderPackageProfitAllocationDTO> packageProfits = subOrderProfitAllocationDTOS.stream()
.map(o->{
if (o.getPackageCode() == null) {
o.setPackageCode("");
}
return o;
})
.collect(Collectors.groupingBy(SubOrderProfitAllocationDTO::getPackageCode))
.entrySet().stream().flatMap(entry -> {
String packageCode = entry.getKey();
List<SubOrderProfitAllocationDTO> subOrderProfits = entry.getValue();
compilePositionName(subOrderProfits);
if (StringUtils.isBlank(packageCode) || packageProfitMap.get(packageCode) == null) {
return subOrderProfits.stream().map(o->OrderPackageProfitAllocationDTO.builder().subPackageProfits(Collections.singletonList(o)).build());
} else {
OrderPackageProfitAllocationDTO packageProfit = packageProfitMap.get(packageCode);
packageProfit.setSubPackageProfits(subOrderProfits);
return Stream.of(packageProfit);
}
}).collect(Collectors.toList());
orderProfit.setPackageProfits(packageProfits);
}
return orderProfit;
}catch (RpcServiceException rpcServiceException){
throw rpcServiceException;
}catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
private void compilePositionName(List<SubOrderProfitAllocationDTO> subOrderProfits) {
if (CollectionUtils.isEmpty(subOrderProfits)) {
return;
}
Map<Integer, String> positionNameMap = goodsPositionService.getPositionNameMap(GoodsPosition.builder().build());
for (SubOrderProfitAllocationDTO subOrderProfit : subOrderProfits) {
if (subOrderProfit.getGoodsPosition() != null) {
subOrderProfit.setGoodsPositionName(positionNameMap.get(subOrderProfit.getGoodsPosition()));
}
}
}
}
package cn.com.glsx.dj.geno.service;
import cn.com.glsx.dj.geno.dto.OrderProductivityDTO;
import cn.com.glsx.dj.geno.dto.StatisticsOverviewDTO;
import cn.com.glsx.dj.geno.dto.StatisticsOverviewReqDTO;
import cn.com.glsx.dj.geno.mapper.GoodsOrderMapper;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.util.RpcAssert;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.YearMonth;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
public class StatisticsService {
@Resource
private GoodsOrderMapper goodsOrderMapper;
/**
* 统计概览方法 - 内存计算版本
*
* 根据用户提供的SQL查询出数据,然后在内存中计算三种产值和平均产值
*
* @param reqDTO 查询请求参数
* @return 统计概览数据
*/
public StatisticsOverviewDTO getStatisticsOverview(StatisticsOverviewReqDTO reqDTO) {
// 参数校验
RpcAssert.assertNotNull(reqDTO.getMerchantId(), DefaultErrorEnum.DATA_NULL, "商户ID不能为空");
RpcAssert.assertNotEmpty(reqDTO.getSellerUserId(), DefaultErrorEnum.DATA_NULL, "销售用户Id不能为空");
log.info("开始统计产值概览(内存计算版本),merchantId={}, sellerUserId={}", reqDTO.getMerchantId(), reqDTO.getSellerUserId());
// 查询所有订单产值数据
List<OrderProductivityDTO> orderData = goodsOrderMapper.getOrderProductivityData(reqDTO.getMerchantId(), reqDTO.getSellerUserId());
log.info("查询到订单产值数据: {} 条", orderData.size());
// 调试:输出前几条数据的详情
if (orderData.size() > 0) {
log.info("前3条数据详情:");
for (int i = 0; i < Math.min(3, orderData.size()); i++) {
OrderProductivityDTO order = orderData.get(i);
log.info("订单{}: orderCode={}, totalPrice={}, successDate={}, refundAmount={}",
(i + 1), order.getOrderCode(), order.getTotalPrice(),
order.getSuccessDate(), order.getRefundAmount());
}
} else {
log.warn("没有查询到任何订单数据,请检查查询条件和数据库数据");
}
// 在内存中计算三种产值
StatisticsOverviewDTO result = calculateProductivityInMemory(orderData);
log.info("统计产值概览完成(内存计算),result={}", result);
return result;
}
/**
* 在内存中计算产值统计
*/
private StatisticsOverviewDTO calculateProductivityInMemory(List<OrderProductivityDTO> orderData) {
LocalDate today = LocalDate.now();
YearMonth currentMonth = YearMonth.now();
// 初始化统计变量
BigDecimal dayOutput = BigDecimal.ZERO;
BigDecimal monthOutput = BigDecimal.ZERO;
BigDecimal totalOutput = BigDecimal.ZERO;
int dayOrderCount = 0;
int monthOrderCount = 0;
int totalOrderCount = 0;
// 遍历订单数据进行统计
for (OrderProductivityDTO order : orderData) {
// 只处理有成功支付时间的订单
if (order.getSuccessDate() == null) {
continue;
}
// 计算净产值(订单总价 - 退款金额)
BigDecimal orderTotalPrice = order.getTotalPrice() != null ? order.getTotalPrice() : BigDecimal.ZERO;
BigDecimal refundAmount = order.getRefundAmount() != null ? order.getRefundAmount() : BigDecimal.ZERO;
BigDecimal netOrderValue = orderTotalPrice.subtract(refundAmount);
// 确保不为负数
if (netOrderValue.compareTo(BigDecimal.ZERO) < 0) {
netOrderValue = BigDecimal.ZERO;
}
// 将 Date 转换为 LocalDate 进行日期比较
Date successDate = order.getSuccessDate();
LocalDate orderDate = successDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
YearMonth orderMonth = YearMonth.from(orderDate);
// 累计统计
totalOutput = totalOutput.add(netOrderValue);
totalOrderCount++;
// 本月统计
if (orderMonth.equals(currentMonth)) {
monthOutput = monthOutput.add(netOrderValue);
monthOrderCount++;
// 今日统计
if (orderDate.equals(today)) {
dayOutput = dayOutput.add(netOrderValue);
dayOrderCount++;
}
}
}
// 构建返回结果
StatisticsOverviewDTO result = new StatisticsOverviewDTO();
// 今日数据
result.setTodayOutputValue(dayOutput);
result.setTodayOrderCount(dayOrderCount);
result.setTodayAvgOrderValue(calcAvg(dayOutput, dayOrderCount));
// 本月数据
result.setMonthOutputValue(monthOutput);
result.setMonthOrderCount(monthOrderCount);
result.setMonthAvgOrderValue(calcAvg(monthOutput, monthOrderCount));
// 累计数据
result.setTotalOutputValue(totalOutput);
result.setTotalOrderCount(totalOrderCount);
result.setTotalAvgOrderValue(calcAvg(totalOutput, totalOrderCount));
log.info("内存计算完成 - 今日产值: {}, 今日订单数: {}, 本月产值: {}, 本月订单数: {}, 累计产值: {}, 累计订单数: {}",
dayOutput, dayOrderCount, monthOutput, monthOrderCount, totalOutput, totalOrderCount);
return result;
}
/**
* 计算平均值
* @param total 总额
* @param count 数量
* @return 平均值(保留2位小数)
*/
private BigDecimal calcAvg(BigDecimal total, Integer count) {
if (count == null || count == 0 || total == null) {
return BigDecimal.ZERO;
}
return total.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP);
}
}
package cn.com.glsx.dj.geno.service;
import cn.com.glsx.dj.geno.mapper.ThirdPlatformRequestLogMapper;
import cn.com.glsx.dj.geno.model.ThirdPlatformRequestLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* @Title: ThirdPlatformRequestLogService.java
* @Description: 第三方平台请求记录Service
* @author system
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2024
*/
@Service
public class ThirdPlatformRequestLogService {
@Autowired
private ThirdPlatformRequestLogMapper thirdPlatformRequestLogMapper;
/**
* 保存请求记录
* @param requestLog 请求记录
* @return 保存的记录ID
*/
public Long saveRequestLog(ThirdPlatformRequestLog requestLog) {
Date now = new Date();
requestLog.setCreatedDate(now);
requestLog.setUpdatedDate(now);
requestLog.setDeletedFlag("N");
thirdPlatformRequestLogMapper.insertSelective(requestLog);
return requestLog.getId();
}
/**
* 更新请求处理结果
* @param id 记录ID
* @param processStatus 处理状态
* @param responseData 响应数据
* @param errorMessage 错误信息
* @param orderCode 系统订单号
* @param updatedBy 更新人
* @return 更新结果
*/
public boolean updateRequestResult(Long id, Integer processStatus, String responseData, String errorMessage, String orderCode, String updatedBy) {
int result = thirdPlatformRequestLogMapper.updateRequestResult(id, processStatus, responseData, errorMessage, orderCode, updatedBy);
return result > 0;
}
}
\ No newline at end of file
package cn.com.glsx.dj.geno.util;
import org.apache.commons.collections.CollectionUtils;
import java.util.List;
public class CommonUtil {
public static <T> T getFirst(List<T> list) {
if(CollectionUtils.isNotEmpty(list)) {
return list.get(0);
}
return null;
}
}
package cn.com.glsx.dj.geno.util;
\ 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="cn.com.glsx.dj.geno.mapper.DemoMapper">
<select id="load" resultType="cn.com.glsx.dj.geno.model.DemoModel">
</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="cn.com.glsx.dj.geno.mapper.GoodsOrderMapper">
<!-- 查询订单产值数据(用于内存计算) -->
<select id="getOrderProductivityData" resultType="cn.com.glsx.dj.geno.dto.OrderProductivityDTO">
SELECT
go.order_code as orderCode,
go.total_price as totalPrice,
po.success_date as successDate,
rd.refund_amount as refundAmount
FROM dj_car_life_goods_order go
LEFT JOIN dj_car_life_pay_order po ON go.order_code = po.order_code AND po.pay_status = 2 AND po.deleted_flag = 'N'
LEFT JOIN dj_car_life_goods_order_refund_details rd ON go.order_code = rd.order_code AND rd.deleted_flag = 'N'
WHERE go.merchant_id = #{merchantId}
AND go.seller_user_id = #{sellerUserId}
AND go.channel_type = 9
AND go.status != 9
AND (rd.refund_type is null or rd.refund_type != 1)
AND go.deleted_flag = 'N'
</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="cn.com.glsx.dj.geno.mapper.GoodsPositionMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.geno.model.GoodsPosition" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="position_value" property="positionValue" jdbcType="INTEGER" />
<result column="position_name" property="positionName" jdbcType="VARCHAR" />
<result column="deduction_standard" property="deductionStandard" jdbcType="DECIMAL" />
<result column="goods_type" property="goodsType"/>
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, position_value, position_name, deduction_standard,goods_type, created_by, created_date, updated_by, updated_date,
deleted_flag
</sql>
</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="cn.com.glsx.dj.geno.mapper.OrderDivisionMapper">
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.geno.dto.OrderDivisionDTO">
<id column="id" property="id"/>
<result column="order_code" property="orderCode"/>
<result column="scene_type" property="sceneType"/>
<result column="geno_order_id" property="genoOrderId"/>
<result column="trade_no" property="tradeNo"/>
<result column="pay_success_date" property="paySuccessDate"/>
<result column="division_type" property="divisionType"/>
<result column="division_date" property="divisionDate"/>
<result column="division_status" property="divisionStatus"/>
<result column="fail_message" property="failMessage"/>
<result column="yq_merchant_id" property="yqMerchantId"/>
<result column="yq_merchant_name" property="yqMerchantName"/>
<result column="total_price" property="totalPrice"/>
<result column="pay_money" property="paidMoney"/>
<result column="actual_income_money" property="actualIncomeMoney"/>
<result column="reality_platform_merchant_id" property="realityPlatformMerchantId"/>
<result column="reality_platform_merchant_name" property="realityPlatformMerchantName"/>
<result column="gl_division_money" property="glDivisionMoney"/>
<result column="gl_should_division_money" property="glShouldDivisionMoney"/>
<result column="shop_merchant_id" property="shopMerchantId"/>
<result column="shop_merchant_name" property="shopMerchantName"/>
<result column="reality_shop_merchant_id" property="realityShopMerchantId"/>
<result column="reality_shop_merchant_name" property="realityShopMerchantName"/>
<result column="shop_division_money" property="shopDivisionMoney"/>
<result column="shop_should_division_money" property="shopShouldDivisionMoney"/>
<result column="multi_platform_merchant_flag" property="multiPlatformMerchantFlag"/>
<result column="djzhy_sub_merchant_id" property="djzhySubMerchantId"/>
<result column="djzhy_sub_merchant_name" property="djzhySubMerchantName"/>
<result column="djzhy_sub_merchant_division_money" property="djzhySubMerchantDivisionMoney"/>
<result column="djzhy_sub_merchant_should_division_money" property="djzhySubMerchantShouldDivisionMoney"/>
</resultMap>
<select id="listOrderDivision" resultMap="DTOResultMap">
SELECT
od.id,
od.order_code,
od.scene_type,
go.third_order_code as geno_order_id,
po.trade_no,
od.pay_success_date,
od.division_type,
od.division_date,
od.division_status,
od.fail_message,
od.yq_merchant_id,
od.yq_merchant_name,
go.total_price,
od.pay_money,
od.actual_income_money,
od.reality_platform_merchant_id,
od.reality_platform_merchant_name,
od.gl_division_money,
od.gl_should_division_money,
od.shop_merchant_id,
od.shop_merchant_name,
od.reality_shop_merchant_id,
od.reality_shop_merchant_name,
od.shop_division_money,
od.shop_should_division_money,
od.multi_platform_merchant_flag,
od.djzhy_sub_merchant_id,
od.djzhy_sub_merchant_name,
od.djzhy_sub_merchant_division_money,
od.djzhy_sub_merchant_should_division_money
FROM dj_car_life_order_division od
LEFT JOIN dj_car_life_goods_order go ON od.order_code = go.order_code and go.deleted_flag = 'N'
LEFT JOIN dj_car_life_pay_order po ON od.order_code = po.order_code and po.deleted_flag = 'N'
<where>
od.deleted_flag = 'N' and go.order_type in (1,2)
<if test="channelType != null">
and go.channel_type = #{channelType}
</if>
<if test="orderCode != null and orderCode != ''">
AND od.order_code = #{orderCode}
</if>
<if test="genoOrderId != null and genoOrderId != ''">
AND go.third_order_code = #{genoOrderId}
</if>
<if test="sceneType != null">
AND od.scene_type = #{sceneType}
</if>
<if test="divisionType != null">
and od.division_type = #{divisionType}
</if>
<if test="divisionStatus != null">
and od.division_status = #{divisionStatus}
</if>
<if test="tradeNo != null and tradeNo != ''">
and po.trade_no = #{tradeNo}
</if>
<if test="payStartDateStr != null and payStartDateStr != ''">
AND od.pay_success_date &gt;= STR_TO_DATE(#{payStartDateStr}, '%Y-%m-%d %H:%i:%s')
</if>
<if test="payEndDateStr != null and payEndDateStr != ''">
AND od.pay_success_date &lt;= STR_TO_DATE(#{payEndDateStr}, '%Y-%m-%d %H:%i:%s')
</if>
<if test="divisionStartDate != null and divisionStartDate != ''">
AND od.division_date &gt;= STR_TO_DATE(#{divisionStartDate}, '%Y-%m-%d %H:%i:%s')
</if>
<if test="divisionEndDate != null and divisionEndDate != ''">
AND od.division_date &lt;= STR_TO_DATE(#{divisionEndDate}, '%Y-%m-%d %H:%i:%s')
</if>
</where>
ORDER BY od.id DESC
</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="cn.com.glsx.dj.geno.mapper.PayOrderMapper">
</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="cn.com.glsx.dj.geno.mapper.ThirdPlatformRequestLogMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.geno.model.ThirdPlatformRequestLog">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="request_type" property="requestType" jdbcType="VARCHAR"/>
<result column="third_order_code" property="thirdOrderCode" jdbcType="VARCHAR"/>
<result column="order_code" property="orderCode" jdbcType="VARCHAR"/>
<result column="request_params" property="requestParams" jdbcType="LONGVARCHAR"/>
<result column="response_data" property="responseData" jdbcType="LONGVARCHAR"/>
<result column="process_status" property="processStatus" jdbcType="INTEGER"/>
<result column="error_message" property="errorMessage" jdbcType="LONGVARCHAR"/>
<result column="request_time" property="requestTime" jdbcType="TIMESTAMP"/>
<result column="process_time" property="processTime" jdbcType="TIMESTAMP"/>
<result column="created_by" property="createdBy" jdbcType="VARCHAR"/>
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP"/>
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR"/>
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP"/>
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR"/>
</resultMap>
<sql id="Base_Column_List">
id, request_type, third_order_code, order_code, request_params, response_data,
process_status, error_message, request_time, process_time,
created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<update id="updateRequestResult">
UPDATE dj_car_life_third_platform_request_log
SET process_status = #{processStatus},
response_data = #{responseData},
error_message = #{errorMessage},
<if test="orderCode != null and orderCode != ''">
order_code = #{orderCode},
</if>
process_time = NOW(),
updated_by = #{updatedBy},
updated_date = NOW()
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
server.port=8989
server.display-name=rpc-dj-geno
server.servlet.context-path=/rpc-dj-geno
server.servlet.application-display-name=rpc-dj-geno
logging.config=classpath:logback.xml
logging.path=/data/java_log/jetty/rpc-dj-geno/rpc-dj-geno.log
logging.level.root=INFO
ore.starter.class-name=Main
# diamond config
ore.diamond.group=dijia
ore.diamond.dataId=rpc-dj-geno
ore.diamond.env=release
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<property resource="config/application.properties" />
<property name="APP_NAME" value="${server.display-name}" />
<property name="LOG_PATH" value="${logging.path}" />
<property name="LOG_LEVEL" value="${logging.level}" />
<contextName>${APP_NAME}</contextName>
<turboFilter class="org.oreframework.boot.logging.logback.OreBootTurboFilter">
<Marker>oreframework</Marker>
</turboFilter>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="org.oreframework.commons.log.OrePatternLayout">
<pattern>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${APP_NAME}] [%traceid] [%thread] %-5level [%logger{36}.%method %line] - %msg%n</pattern>
</pattern>
</layout>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- <Encoding> Label Old version of this label can not be used -->
<!-- <Encoding>UTF-8</Encoding> -->
<File>${LOG_PATH}</File>
<!-- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<FileNamePattern>${LOG_PATH}.%d{yyyy-MM-dd}.%i</FileNamePattern>
<MaxHistory>15</MaxHistory>
<maxFileSize>200MB</maxFileSize>
</rollingPolicy>
<layout class="org.oreframework.commons.log.OrePatternLayout">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${APP_NAME}] [%traceid] [%thread] %-5level [%logger{36}.%method %line] - %msg%n</pattern>
</layout>
<!-- 根据文件大小滚动,不支持 SizeBasedTriggeringPolicy 这种配置-->
<!-- <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>200MB</MaxFileSize>
</triggeringPolicy> -->
</appender>
<!-- druid连接池慢查询日志记录 -->
<appender name="DruidFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}.druid_slow_sql</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,例如今天是2020-01-01日志,当前写的日志文件路径为file节点指定,可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
而2020-01-01的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}.druid_slow_sql-%d{yyyy-MM-dd}.%i</fileNamePattern>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,命名日志文件,例如log-error-2020-01-01.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>200MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger Line:%-3L - %msg%n</pattern>
<charset>utf-8</charset>
</encoder>
<!-- 此日志文件只记录级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<root level="${LOG_LEVEL}">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
<appender-ref ref="DruidFILE" />
</root>
</configuration>
\ No newline at end of file
#!/bin/bash
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
CONF_DIR=$DEPLOY_DIR/classes
SERVER_NAME=`sed '/application.name/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
#LOGS_FILE=`sed '/log4j.appender.logToFile.File/!d;s/.*=//' classes/log4j.properties | tr -d '\r'`
LOGS_FILE=`sed '/name="LOG_PATH"/!d;s/.*value="\(.*\)".*/\1/g' classes/logback.xml`
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME=`hostname`
fi
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$CONF_DIR" |awk '{print $2}'`
if [ -z "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME does not started!"
exit 1
fi
LOGS_DIR=""
if [ -n "$LOGS_FILE" ]; then
LOGS_DIR=`dirname $LOGS_FILE`
else
LOGS_DIR=$DEPLOY_DIR/logs
fi
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
DUMP_DIR=$LOGS_DIR/dump
if [ ! -d $DUMP_DIR ]; then
mkdir $DUMP_DIR
fi
DUMP_DATE=`date +%Y%m%d%H%M%S`
DATE_DIR=$DUMP_DIR/$DUMP_DATE
if [ ! -d $DATE_DIR ]; then
mkdir $DATE_DIR
fi
echo -e "Dumping the $SERVER_NAME ...\c"
for PID in $PIDS ; do
jstack $PID > $DATE_DIR/jstack-$PID.dump 2>&1
echo -e ".\c"
jinfo $PID > $DATE_DIR/jinfo-$PID.dump 2>&1
echo -e ".\c"
jstat -gcutil $PID > $DATE_DIR/jstat-gcutil-$PID.dump 2>&1
echo -e ".\c"
jstat -gccapacity $PID > $DATE_DIR/jstat-gccapacity-$PID.dump 2>&1
echo -e ".\c"
jmap $PID > $DATE_DIR/jmap-$PID.dump 2>&1
echo -e ".\c"
jmap -heap $PID > $DATE_DIR/jmap-heap-$PID.dump 2>&1
echo -e ".\c"
jmap -histo $PID > $DATE_DIR/jmap-histo-$PID.dump 2>&1
echo -e ".\c"
if [ -r /usr/sbin/lsof ]; then
/usr/sbin/lsof -p $PID > $DATE_DIR/lsof-$PID.dump
echo -e ".\c"
fi
done
if [ -r /bin/netstat ]; then
/bin/netstat -an > $DATE_DIR/netstat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/iostat ]; then
/usr/bin/iostat > $DATE_DIR/iostat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/mpstat ]; then
/usr/bin/mpstat > $DATE_DIR/mpstat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/vmstat ]; then
/usr/bin/vmstat > $DATE_DIR/vmstat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/free ]; then
/usr/bin/free -t > $DATE_DIR/free.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/sar ]; then
/usr/bin/sar > $DATE_DIR/sar.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/uptime ]; then
/usr/bin/uptime > $DATE_DIR/uptime.dump 2>&1
echo -e ".\c"
fi
echo "OK!"
echo "DUMP: $DATE_DIR"
#!/bin/bash
ENV=$1
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
cd `dirname $0`
./stop.sh
./start.sh $ENV
\ No newline at end of file
#!/bin/bash
cd `dirname $0`
if [ "$1" = "start" ]; then
ENV=$2
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
./start.sh $ENV
else
if [ "$1" = "stop" ]; then
./stop.sh
else
if [ "$1" = "debug" ]; then
ENV=$2
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
./start.sh $ENV debug
else
if [ "$1" = "restart" ]; then
ENV=$2
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
./restart.sh $ENV
else
if [ "$1" = "dump" ]; then
./dump.sh
else
echo "ERROR: Please input argument: start or stop or debug or restart or dump"
exit 1
fi
fi
fi
fi
fi
#!/bin/bash
JAVA_HOME="/app/soft/jdk1.8.0_20"
ENV=$1
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
CONF_DIR=$DEPLOY_DIR/classes
SERVER_NAME=`sed '/server.display-name/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
SERVER_PORT=`sed '/server.port/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
#LOGS_FILE=`sed '/log4j.appender.logToFile.File/!d;s/.*=//' classes/log4j.properties | tr -d '\r'`
LOGS_FILE=`sed '/logging.path/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME=`hostname`
fi
echo "server name is $SERVER_NAME"
echo "server port is $SERVER_PORT"
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$CONF_DIR" |awk '{print $2}'`
if [ -n "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME already started!"
echo "PID: $PIDS"
exit 1
fi
if [ -n "$SERVER_PORT" ]; then
SERVER_PORT_COUNT=`netstat -tln | grep $SERVER_PORT | wc -l`
if [ $SERVER_PORT_COUNT -gt 0 ]; then
echo "ERROR: The $SERVER_NAME port $SERVER_PORT already used!"
exit 1
fi
fi
LOGS_DIR=""
if [ -n "$LOGS_FILE" ]; then
LOGS_DIR=`dirname $LOGS_FILE`
else
LOGS_DIR=$DEPLOY_DIR/logs
fi
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
STDOUT_FILE=$LOGS_DIR/stdout.log
LIB_DIR=$DEPLOY_DIR/lib
LIB_JARS=`ls $LIB_DIR|grep .jar|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"`
JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
JAVA_DEBUG_OPTS=""
if [ "$2" = "debug" ]; then
JAVA_DEBUG_OPTS=" -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n "
fi
JAVA_JMX_OPTS=""
if [ "$2" = "jmx" ]; then
JAVA_JMX_OPTS=" -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false "
fi
JAVA_MEM_OPTS=""
BITS=`file $JAVA_HOME/bin/java | grep 64-bit`
if [ -n "$BITS" ]; then
JAVA_MEM_OPTS=" -server -Xmx1g -Xms1g -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
else
JAVA_MEM_OPTS=" -server -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
fi
echo -e "Starting the $SERVER_NAME ...\c"
nohup $JAVA_HOME/bin/java $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS -classpath $CONF_DIR:$LIB_JARS org.oreframework.boot.bootstrap.OreBootApplication env=$ENV > $STDOUT_FILE 2>&1 &
COUNT=0
while [ $COUNT -lt 1 ]; do
echo -e ".\c"
sleep 1
if [ -n "$SERVER_PORT" ]; then
COUNT=`netstat -an | grep $SERVER_PORT | wc -l`
else
COUNT=`ps --no-heading -C java -f --width 1000 | grep "$DEPLOY_DIR" | awk '{print $2}' | wc -l`
fi
if [ $COUNT -gt 0 ]; then
break
fi
done
echo "OK!"
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$DEPLOY_DIR" | awk '{print $2}'`
echo "PID: $PIDS"
echo "STDOUT: $STDOUT_FILE"
#!/bin/bash
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
CONF_DIR=$DEPLOY_DIR/classes
SERVER_NAME=`sed '/application.name/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME=`hostname`
fi
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$CONF_DIR" |awk '{print $2}'`
if [ -z "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME does not started!"
exit 1
fi
#if [ "$1" != "skip" ]; then
#$BIN_DIR/dump.sh
#fi
echo -e "Stopping the $SERVER_NAME ...\c"
for PID in $PIDS ; do
kill $PID > /dev/null 2>&1
done
COUNT=0
while [ $COUNT -lt 1 ]; do
echo -e ".\c"
sleep 1
COUNT=1
for PID in $PIDS ; do
PID_EXIST=`ps --no-heading -p $PID`
if [ -n "$PID_EXIST" ]; then
COUNT=0
break
fi
done
done
echo "OK!"
echo "PID: $PIDS"
package cn.com.glsx.dj.remote;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import cn.com.glsx.dj.geno.Main;
/**
* @Title: BaseRemoteTest.java
* @Description:
* @author linchong
* @date 2018年1月6日 下午3:58:33
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class)
public class BaseRemoteTest {
}
package cn.com.glsx.dj.remote;
import cn.com.glsx.dj.geno.remote.DemoRemote;
import org.junit.Assert;
import org.junit.Test;
import org.apache.dubbo.config.annotation.DubboReference;
import cn.com.glsx.dj.geno.model.DemoModel;
/**
* @Title: DemoRemoteTest.java
* @Description:
* @author linchong
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
public class DemoRemoteTest extends BaseRemoteTest{
@DubboReference
private DemoRemote demoRemote;
@Test
public void load(){
DemoModel model = demoRemote.get("name");
Assert.assertNotNull(model);
}
}
package cn.com.glsx.dj.service;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import cn.com.glsx.dj.geno.Main;
/**
* @Title: BaseServiceTest.java
* @Description:
* @author linchong
* @date 2018年1月6日 下午1:23:03
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class)
public class BaseServiceTest {
}
package cn.com.glsx.dj.service;
import cn.com.glsx.dj.geno.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.junit.Assert;
import org.junit.Test;
import cn.com.glsx.dj.geno.model.DemoModel;
/**
* @Title: DemoServiceTest.java
* @Description:
* @author linchong
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
public class DemoServiceTest extends BaseServiceTest{
@Autowired
private DemoService demoService;
@Test
public void load(){
DemoModel model = demoService.load();
Assert.assertNotNull(model);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<!-- 确保已安装mybatis generator eclipse插件 -->
<generatorConfiguration>
<context id="DB2Tables" targetRuntime="MyBatis3">
<property name="javaFileEncoding" value="UTF-8"/>
<plugin type="tk.mybatis.mapper.generator.MapperPlugin">
<property name="mappers" value="org.oreframework.datasource.mybatis.mapper.OreMapper"/>
<property name="caseSensitive" value="true"/>
<property name="useActualColumnNames" value="true" />
<!--<property name="beginningDelimiter" value="`"/>-->
<!--<property name="endingDelimiter" value="`"/>-->
</plugin>
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.3.227:3306/数据库名?characterEncoding=utf8" userId="dev_admin" password="1f7e1ed2" />
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<javaModelGenerator targetPackage="cn.com.glsx.dj.model" targetProject="../rpc-dj-geno-api/src/main/java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<sqlMapGenerator targetPackage="META-INF/orm" targetProject="src/main/resources">
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<javaClientGenerator targetPackage="cn.com.glsx.dj.mapper" targetProject="MAVEN" type="XMLMAPPER">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!-- 可配置多个 -->
<table tableName="数据库表名" domainObjectName="Java数据模型名" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>
</context>
</generatorConfiguration>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!