diff --git a/xhpc-modules/xhpc-tradebill/.gitignore b/xhpc-modules/xhpc-tradebill/.gitignore new file mode 100644 index 00000000..54283dd4 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/.gitignore @@ -0,0 +1,35 @@ +HELP.md +target/ +.mvn/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea/ +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/xhpc-modules/xhpc-tradebill/pom.xml b/xhpc-modules/xhpc-tradebill/pom.xml new file mode 100644 index 00000000..facfa818 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/pom.xml @@ -0,0 +1,157 @@ + + + + com.ruoyi + xhpc-modules + 3.0.0 + + 4.0.0 + + xhpc-tradebill + + + 账单对账服务 + + + 8 + 8 + + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + + + org.mybatis + mybatis + 3.5.6 + + + com.github.pagehelper + pagehelper-spring-boot-starter + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.springframework.boot + spring-boot-starter-web + + + + + mysql + mysql-connector-java + + + + + com.ruoyi + ruoyi-common-datasource + + + + + com.ruoyi + ruoyi-common-core + + + + com.ruoyi + xhpc-common + 3.0.0 + compile + + + + javax.websocket + javax.websocket-api + 1.1 + provided + + + org.springframework.boot + spring-boot-starter-websocket + + + + + com.alipay.sdk + alipay-sdk-java + 4.15.14.ALL + + + + + com.github.binarywang + weixin-java-pay + 4.2.0 + + + + org.apache.ant + ant + 1.10.12 + + + com.aliyun.oss + aliyun-sdk-oss + 3.10.2 + compile + + + + + + ${project.artifactId} + + + src/main/resources + + + src/main/java + + **/*.xml + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.4.0 + + + + repackage + + + + + + + + diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/XhpcTradebillApplication.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/XhpcTradebillApplication.java new file mode 100644 index 00000000..f31c95bb --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/XhpcTradebillApplication.java @@ -0,0 +1,26 @@ +package com.xhpc.tradebill; + +import com.xhpc.common.security.annotation.EnableCustomConfig; +import com.xhpc.common.security.annotation.EnableRyFeignClients; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.ConfigurationPropertiesScan; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + + +@EnableConfigurationProperties +@ConfigurationPropertiesScan(basePackages = {"com.xhpc.tradebill.config"}) +@EnableCustomConfig +@SpringBootApplication +@EnableRyFeignClients +@EnableDiscoveryClient +@MapperScan("com.xhpc.tradebill.mapper") +public class XhpcTradebillApplication { + + public static void main(String[] args) { + + SpringApplication.run(XhpcTradebillApplication.class, args); + } +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/AliOSSProperties.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/AliOSSProperties.java new file mode 100644 index 00000000..8a27c310 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/AliOSSProperties.java @@ -0,0 +1,24 @@ +package com.xhpc.tradebill.config; + + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + + +/** + * 支付宝支付配置类 + */ +@Data +@ConfigurationProperties(prefix = "oss") +public class AliOSSProperties { + + private boolean enabled; + private String name; + private boolean tenantMode; + private String endpoint; + private String accessKey; + private String secretKey; + private String bucketName; + private String region; + private String domain; +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/AliPayProperties.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/AliPayProperties.java new file mode 100644 index 00000000..140b3346 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/AliPayProperties.java @@ -0,0 +1,23 @@ +package com.xhpc.tradebill.config; + + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + + +/** + * 支付宝支付配置类 + */ +@Data +@ConfigurationProperties(prefix = "alibaba.pay") +public class AliPayProperties { + + private String gatewayDomain; + private String serverDomain; + private String publicKey; + private String privateKey; + private String appId; + private String certPath; + private String publicCertPath; + private String rootCertPath; +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/WxPayProperties.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/WxPayProperties.java new file mode 100644 index 00000000..e61cffd3 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/WxPayProperties.java @@ -0,0 +1,42 @@ +package com.xhpc.tradebill.config; + + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * 微信支付配置类 + */ +@Data +@ConfigurationProperties(prefix = "wx.pay") +public class WxPayProperties { + /** + * 设置微信公众号或者小程序等的appid + */ + private String appId; + + /** + * 微信支付商户号 + */ + private String mchId; + + /** + * 微信支付商户密钥 + */ + private String mchKey; + + /** + * 服务商模式下的子商户公众账号ID,普通模式请不要配置,请在配置文件中将对应项删除 + */ + private String subAppId; + + /** + * 服务商模式下的子商户号,普通模式请不要配置,最好是请在配置文件中将对应项删除 + */ + private String subMchId; + + /** + * apiclient_cert.p12文件的绝对路径,或者如果放在项目中,请以classpath:开头指定 + */ + private String keyPath; +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/constant/WeixinPayConstant.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/constant/WeixinPayConstant.java new file mode 100644 index 00000000..295f222f --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/constant/WeixinPayConstant.java @@ -0,0 +1,42 @@ +package com.xhpc.tradebill.constant; + +/** + * 微信支付常量 + */ +public class WeixinPayConstant { + + /** + * 返回当日所有订单信息(不含充值退款订单) + */ + public static final String BILL_TYPE_ALL = "ALL"; + + /** + * 返回当日成功支付的订单(不含充值退款订单) + */ + public static final String BILL_TYPE_SUCCESS = "SUCCESS"; + + /** + * 返回当日退款订单(不含充值退款订单) + */ + public static final String BILL_TYPE_REFUND = "REFUND"; + + /** + * 返回格式为.gzip的压缩包账单 + */ + public static final String TAR_TYPE_GZIP = "GZIP"; + + /** + * 基本账户 + */ + public static final String ACCOUNT_TYPE_BASIC = "BASIC"; + + /** + * 运营账户 + */ + public static final String ACCOUNT_TYPE_OPERATION = "OPERATION"; + + /** + * 手续费账户 + */ + public static final String ACCOUNT_TYPE_FEES = "FEES"; +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/CommonController.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/CommonController.java new file mode 100644 index 00000000..51505ba7 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/CommonController.java @@ -0,0 +1,49 @@ +package com.xhpc.tradebill.controller; + + +import com.xhpc.common.core.utils.SecurityUtils; +import com.xhpc.common.core.web.controller.BaseController; +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.tradebill.domain.XhpcTradebillUploadRecordDomain; +import com.xhpc.tradebill.service.CommonService; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + + +@RestController +@RequestMapping("/common") +public class CommonController extends BaseController { + + @Resource + CommonService commonService; + + @PostMapping("/oss/upload") + public AjaxResult OssUpload(@RequestBody XhpcTradebillUploadRecordDomain domain) throws Exception{ + return AjaxResult.success(commonService.ossUpload(domain)); + } + + + @PostMapping("/file/upload") + public AjaxResult fileUpload(MultipartFile file, int type) throws Exception { + if (file ==null || type < 1){ + return AjaxResult.error("文件或者对账类型为空"); + } + return AjaxResult.success(commonService.fileUpload(file, type)); + } + + @GetMapping("/file/getPage") + public AjaxResult getFilePage(int type, + String name) throws Exception { + startPage(); + Map parmas = new HashMap<>(); + parmas.put("type", type); + parmas.put("createBy", SecurityUtils.getUserId()); + parmas.put("name", name); + + return AjaxResult.success(commonService.getFilePage(parmas)); + } +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/InternetBillController.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/InternetBillController.java new file mode 100644 index 00000000..8d49f917 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/InternetBillController.java @@ -0,0 +1,106 @@ +package com.xhpc.tradebill.controller; + + +import com.xhpc.common.core.web.controller.BaseController; +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.tradebill.domain.XhpcTradebillInternetCheckRecordDomain; +import com.xhpc.tradebill.service.InternetBillService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("/internet") +public class InternetBillController extends BaseController { + + + @Resource + InternetBillService internetBillService; + + @GetMapping("/checkList/{uploadId}") + public AjaxResult getCheckList(@RequestParam(required = false) Integer uploadId, + @RequestParam(required = false) String orderNumber, + @RequestParam(required = false) String stationName, + @RequestParam(required = false) String internetName, + @RequestParam(required = false) Integer status){ + Map params = new HashMap<>(); + params.put("uploadId", uploadId); + params.put("orderNumber",orderNumber); + params.put("stationName", stationName); + params.put("internetName", internetName); + params.put("status", status); + return AjaxResult.success(internetBillService.getInternetCheckList(params)); + } + + + @GetMapping("/checkPage") + public TableDataInfo getCheckPage(@RequestParam(required = false) Integer uploadId, + @RequestParam(required = false) String orderNumber, + @RequestParam(required = false) String station, + @RequestParam(required = false) String internetName, + @RequestParam(required = false) Integer status){ + + Map params = new HashMap<>(); + params.put("uploadId", uploadId); + params.put("orderNumber",orderNumber); + params.put("stationName", station); + params.put("internetName", internetName); + params.put("status", status); + + startPage(); + return getDataTable(internetBillService.getInternetCheckList(params)); + } + + @GetMapping("/statusTotal") + public AjaxResult getStatusTotal(@RequestParam(required = false) Integer uploadId, + @RequestParam(required = false) String orderNumber, + @RequestParam(required = false) String stationName, + @RequestParam(required = false) String internetName, + @RequestParam(required = false) Integer status){ + + Map params = new HashMap<>(); + params.put("uploadId", uploadId); + params.put("orderNumber",orderNumber); + params.put("stationName", stationName); + params.put("internetName", internetName); + params.put("status", status); + return AjaxResult.success(internetBillService.getStatusTotal(params)); + } + + + @GetMapping("/checkInfo/{id}") + public AjaxResult getCheckInfo(@PathVariable Integer id){ + + return AjaxResult.success(internetBillService.getInfoByPk(id)); + } + + + @PostMapping("/checkInfo") + public AjaxResult updateCheckInfo(@RequestBody XhpcTradebillInternetCheckRecordDomain domain){ + + return AjaxResult.success(internetBillService.updateInfoByDomain(domain)); + } + + @PostMapping("/export") + public void export(HttpServletResponse response, + @RequestParam(required = false) Integer uploadId, + @RequestParam(required = false) String orderNumber, + @RequestParam(required = false) String stationName, + @RequestParam(required = false) String internetName, + @RequestParam(required = false) Integer status) throws Exception { + + Map params = new HashMap<>(); + params.put("uploadId", uploadId); + params.put("orderNumber",orderNumber); + params.put("stationName", stationName); + params.put("internetName", internetName); + params.put("status", status); + + internetBillService.export(response, params); + } + +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/PaymentBillController.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/PaymentBillController.java new file mode 100644 index 00000000..9a140fb9 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/PaymentBillController.java @@ -0,0 +1,96 @@ +package com.xhpc.tradebill.controller; + + +import com.xhpc.common.core.web.controller.BaseController; +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.tradebill.domain.XhpcTradebillPaymentCheckRecordDomain; +import com.xhpc.tradebill.service.PaymentBillService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("/payment") +public class PaymentBillController extends BaseController { + + @Resource + PaymentBillService paymentBillService; + + @GetMapping("/checkList/{uploadId}") + public AjaxResult getCheckList(@RequestParam(required = false) Integer uploadId, + @RequestParam(required = false) String orderNumber, + @RequestParam(required = false) String userId, + @RequestParam(required = false) Integer status){ + Map params = new HashMap<>(); + params.put("uploadId", uploadId); + params.put("orderNumber",orderNumber); + params.put("userId", userId); + params.put("status", status); + return AjaxResult.success(paymentBillService.getPaymentCheckList(params)); + } + + + @GetMapping("/checkPage") + public TableDataInfo getCheckPage(@RequestParam(required = false) Integer uploadId, + @RequestParam(required = false) String orderNumber, + @RequestParam(required = false) String userId, + @RequestParam(required = false) Integer status){ + + startPage(); + Map params = new HashMap<>(); + params.put("uploadId", uploadId); + params.put("orderNumber",orderNumber); + params.put("userId", userId); + params.put("status", status); + return getDataTable(paymentBillService.getPaymentCheckList(params)); + } + + + @GetMapping("/statusTotal") + public AjaxResult getStatusTotal(@RequestParam(required = false) Integer uploadId, + @RequestParam(required = false) String orderNumber, + @RequestParam(required = false) String userId, + @RequestParam(required = false) Integer status){ + + Map params = new HashMap<>(); + params.put("uploadId", uploadId); + params.put("orderNumber",orderNumber); + params.put("userId", userId); + params.put("status", status); + return AjaxResult.success(paymentBillService.getStatusTotal(params)); + } + + @GetMapping("/checkInfo/{id}") + public AjaxResult getCheckInfo(@PathVariable Integer id){ + + return AjaxResult.success(paymentBillService.getInfoByPk(id)); + } + + + @PostMapping("/checkInfo") + public AjaxResult updateCheckInfo(@RequestBody XhpcTradebillPaymentCheckRecordDomain domain){ + return AjaxResult.success(paymentBillService.updateInfoByDomain(domain)); + } + + + @PostMapping("/export") + public void export(HttpServletResponse response, + @RequestParam(required = false) Integer uploadId, + @RequestParam(required = false) String orderNumber, + @RequestParam(required = false) String userId, + @RequestParam(required = false) Integer status) throws Exception { + + Map params = new HashMap<>(); + params.put("uploadId", uploadId); + params.put("orderNumber",orderNumber); + params.put("userId", userId); + params.put("status", status); + + paymentBillService.export(response, params); + } + +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/EtOrderMappingDomain.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/EtOrderMappingDomain.java new file mode 100644 index 00000000..a1e3b40c --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/EtOrderMappingDomain.java @@ -0,0 +1,17 @@ +package com.xhpc.tradebill.domain; + + +import lombok.Data; + +import javax.persistence.Table; + +@Data +@Table(name = "et_order_mapping") +public class EtOrderMappingDomain { + + private Long id; + + private String xhOrderNo; + + private String evcsOrderNo; +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcChargeOrderDomain.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcChargeOrderDomain.java new file mode 100644 index 00000000..84e6315f --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcChargeOrderDomain.java @@ -0,0 +1,170 @@ +package com.xhpc.tradebill.domain; + +import lombok.Data; + +import javax.persistence.Table; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +@Data +@Table(name="xhpc_charge_order") +public class XhpcChargeOrderDomain implements Serializable { + /** + * 充电订单id + */ + private Long chargeOrderId; + + /** + * 电站id + */ + private Long chargingStationId; + + /** + * 用户id + */ + private Long userId; + + /** + * 终端id + */ + private Long terminalId; + + /** + * 互联网流水订单号 + */ + private String internetSerialNumber; + + /** + * 订单编号 + */ + private String serialNumber; + + /** + * 充电启始soc + */ + private String startSoc; + + /** + * 结束soc + */ + private String endSoc; + + /** + * 订单来源(0C端用户 1流量用户) + */ + private Integer source; + + /** + * 状态(-1准备充电 0开始充电 1自动结算,2异常,3平台结算) + */ + private Integer status; + + /** + * 删除标志(0代表存在 1代表删除) + */ + private Integer delFlag; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 创建者 + */ + private String createBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 备注 + */ + private String remark; + + /** + * 费率模型id + */ + private Long rateModelId; + + /** + * 充电方式 + */ + private String chargingMode; + + /** + * 开始充电时间 + */ + private Date startTime; + + /** + * 结束充电时间 + */ + private Date endTime; + + /** + * 充电时长 + */ + private String chargingTime; + + /** + * 充电度数 + */ + private BigDecimal chargingDegree; + + /** + * 协议定,停止方式 + */ + private Integer type; + + /** + * 异常备注 + */ + private String erroRemark; + + /** + * 总金额 + */ + private BigDecimal amountCharged; + + /** + * 功率 + */ + private String power; + + /** + * 充电时长(秒) + */ + private Long chargingTimeNumber; + + /** + * 司机唯一标识(手机号) + */ + private String driverId; + + /** + * 充电金额 + */ + private Integer chargingAmt; + + /** + * 车牌 + */ + private String plateNum; + + /** + * 符合Evcs标准的订单号,并非来自第三方的订单号 + */ + private String evcsOrderNo; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcHistoryOrderDomain.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcHistoryOrderDomain.java new file mode 100644 index 00000000..94af4242 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcHistoryOrderDomain.java @@ -0,0 +1,249 @@ +package com.xhpc.tradebill.domain; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import lombok.Data; + +/** + * xhpc_history_order + * @author + */ +@Data +public class XhpcHistoryOrderDomain implements Serializable { + /** + * 历史订单id + */ + private Long historyOrderId; + + /** + * 电站id + */ + private Long chargingStationId; + + /** + * 场站名称 + */ + private String chargingStationName; + + /** + * 充电订单id + */ + private Long chargeOrderId; + + /** + * 用户id + */ + private Long userId; + + /** + * 终端id + */ + private Long terminalId; + + /** + * 订单编号 + */ + private String serialNumber; + + /** + * 流量方订单号 + */ + private String internetSerialNumber; + + /** + * 总电费 + */ + private BigDecimal powerPriceTotal; + + /** + * 总服务费 + */ + private BigDecimal servicePriceTotal; + + /** + * 订单总价 + */ + private BigDecimal totalPrice; + + /** + * 电站活动抵扣--抵扣的总金额 + */ + private BigDecimal promotionDiscount; + + /** + * 实际价格-用户支付的钱 + */ + private BigDecimal actPrice; + + /** + * 实收电费-运营商电费 + */ + private BigDecimal actPowerPrice; + + /** + * 实收服务费-运营商服务费 + */ + private BigDecimal actServicePrice; + + /** + * 流量方总金额抽成 + */ + private BigDecimal internetCommission; + + /** + * 流量方服务费抽成 + */ + private BigDecimal internetSvcCommission; + + /** + * 平台总金额抽成 + */ + private BigDecimal platformCommission; + + /** + * 平台服务费抽成 + */ + private BigDecimal platformSvcCommisssion; + + /** + * 运维总抽成 + */ + private BigDecimal operationCommission; + + /** + * 运维服务费抽成 + */ + private BigDecimal operationSvcCommission; + + /** + * 开始充电soc + */ + private String startSoc; + + /** + * 结束时soc + */ + private String endSoc; + + /** + * 对账状态(0待确认 1已确认,2待提交,3待审核) + */ + private Integer reconciliationStatus; + + /** + * 清分状态(0待清分 1清分在途,2已提现,3待提交,4待审核) + */ + private Integer sortingStatus; + + /** + * 1 自动结算 2 平台结算 + */ + private Byte type; + + /** + * 状态(0正常 1停用) + */ + private Integer status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private Integer delFlag; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 创建者 + */ + private String createBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 备注 + */ + private String remark; + + /** + * 0未统计 1小时统计 2 其他统计 + */ + private Integer state; + + /** + * VIN 码 + */ + private String vinNormal; + + private String searchValue; + + /** + * 运营商在EVCS分配的唯一OperatorID + */ + private String operatorIdEvcs; + + private Integer chargeModelEvcs; + + private Double connectorPowerEvcs; + + private Double meterValueEndEvcs; + + private Double meterValueStartEvcs; + + private String operatorId3rdptyEvcs; + + private Date startTime; + + /** + * 结束时间 + */ + private Date endTime; + + private Integer stopReasonEvcs; + + private Double totalPower; + + private String userNameEvcs; + + private String phone; + + /** + * 互联网订单流水号 + */ + private String evcsOrderNo; + + /** + * -1:未推送/推送失败 0:成功 1:争议交易 2~99:自定义 + */ + private Integer confirmResult; + + private Long rateModelId; + + /** + * 充电方式 + */ + private String chargingMode; + + /** + * 充电度数 + */ + private Double chargingDegree; + + /** + * 充电时长 + */ + private String chargingTime; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcRechargeOrderDomain.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcRechargeOrderDomain.java new file mode 100644 index 00000000..2a0d8eb4 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcRechargeOrderDomain.java @@ -0,0 +1,79 @@ +package com.xhpc.tradebill.domain; + +import lombok.Data; + +import javax.persistence.Table; +import java.math.BigDecimal; +import java.util.Date; + + +/** + * 充值订单实体对象 + */ +@Data +@Table(name = "xhpc_recharge_order") +public class XhpcRechargeOrderDomain { + + + /** + * 充值订单id + */ + private Long rechargeOrderId; + + /** + * 用户id + */ + private Long userId; + + /** + * 充值订单编号 + */ + private String rechargeOrderNumber; + + /** + * 微信支付订单号 + */ + private String prepayId; + + /** + * 支付宝订单编号 + */ + private String alipayNumber; + + /** + * 充值金额 + */ + private BigDecimal amount; + + /** + * 充值渠道(1微信 2支付宝 3平台) + */ + private Integer type; + + + /** + * 状态(0待支付 1充值成功,2充值失败) + */ + private Integer status; + + /** + * 订单来源(0 C端用户 1 流量方用户 2社区用户 3B端用户) + */ + private Integer source; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private Integer delFlag; + + + private Date updateTime; + + private String updateBy; + + + private Date createTime; + + private String createBy; + +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcRefundOrderDomain.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcRefundOrderDomain.java new file mode 100644 index 00000000..36d727ab --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcRefundOrderDomain.java @@ -0,0 +1,82 @@ +package com.xhpc.tradebill.domain; + +import lombok.Data; + +import javax.persistence.Table; +import java.math.BigDecimal; +import java.util.Date; + + +/** + * 退款订单实体对象 + */ +@Data +@Table(name = "xhpc_refund_order") +public class XhpcRefundOrderDomain { + + + /** + * 退款订单id + */ + private Long refundOrderId; + + /** + * 退款订单编号 + */ + private String refundOrderNumber; + + /** + * 用户id + */ + private Long userId; + + /** + * 微信支付订单号 + */ + private String openId; + + /** + * 支付宝订单编号 + */ + private String alipayId; + + /** + * 充值金额 + */ + private BigDecimal amount; + + /** + * 退款渠道(1微信 2支付宝 3平台) + */ + private Integer type; + + /** + * 审核状态(0审核中 1审核通过,2审核失败) + */ + private Integer examineStatus; + + /** + * 订单来源(0 C端用户 1 流量方用户 2社区用户 3B端用户) + */ + private Integer source; + + /** + * 状态(0退款中 1退款成功,2退款失败,3取消订单) + */ + private Integer status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private Integer delFlag; + + + private Date createTime; + + private String createBy; + + private Date updateTime; + + private String updateBy; + +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcTradebillInternetCheckRecordDomain.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcTradebillInternetCheckRecordDomain.java new file mode 100644 index 00000000..cc50d65e --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcTradebillInternetCheckRecordDomain.java @@ -0,0 +1,119 @@ +package com.xhpc.tradebill.domain; + +import lombok.Data; + +import javax.persistence.Table; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +@Data +@Table(name="xhpc_tradebill_internet_check_record") +public class XhpcTradebillInternetCheckRecordDomain implements Serializable { + + + private Integer id; + + private Date createTime; + + private Long createBy; + + private String createName; + + private Date updateTime; + + private Long updateBy; + + private String updateName; + + private Integer uploadId; + + private Long historyOrderNo; + + private String userId; + + private String internetName; + + private String platformInternetSerialNumber; + + private String platformSerialNumber; + + private String platformChargeStation; + + private String platformStartSoc; + + private String platformEndSoc; + + + private BigDecimal platformChargingDegree; + + + private String platformChargingTime; + + + private Date platformStartTime; + + + private Date platformEndTime; + + + private BigDecimal platformOrderAmount; + + private BigDecimal platformPowerAmount; + + private BigDecimal platformServerAmount; + + private BigDecimal platformDiscountAmount; + + + private BigDecimal platformPayAmount; + + + private String internetSerialNumber; + + + private String internetChargeStation; + + + private String internetStartSoc; + + + private String internetEndSoc; + + + private BigDecimal internetChargingDegree; + + + private String internetChargingTime; + + + private Date internetStartTime; + + + private Date internetEndTime; + + + private BigDecimal internetOrderAmount; + + private BigDecimal internetPowerAmount; + + private BigDecimal internetServerAmount; + + private BigDecimal internetDiscountAmount; + + + private BigDecimal internetPayAmount; + + private String remark; + + + private Integer status; + + private String statusName; + + + private String source; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcTradebillPaymentCheckRecordDomain.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcTradebillPaymentCheckRecordDomain.java new file mode 100644 index 00000000..ee5541b9 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcTradebillPaymentCheckRecordDomain.java @@ -0,0 +1,62 @@ +package com.xhpc.tradebill.domain; + +import lombok.Data; + +import javax.persistence.Table; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +@Data +@Table(name="xhpc_tradebill_payment_check_record") +public class XhpcTradebillPaymentCheckRecordDomain implements Serializable { + + private Integer id; + + + private Date createTime; + + private Long createBy; + + private String createName; + + private Date updateTime; + + private Long updateBy; + + private String updateName; + + private Integer uploadId; + + private Integer orderType; + + private Integer paymentChannel; + + private String platformOrderNumber; + + private String platformPayNumber; + + private String platformUserId; + + private BigDecimal platformAmount; + + private Date platformPayTime; + + private String paymentPayNumber; + + private String paymentUserId; + + private BigDecimal paymentAmount; + + private Date paymentPayTime; + + + private Integer status; + + private String statusName; + + private String remark; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcTradebillUploadRecordDomain.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcTradebillUploadRecordDomain.java new file mode 100644 index 00000000..96e6f219 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/domain/XhpcTradebillUploadRecordDomain.java @@ -0,0 +1,46 @@ +package com.xhpc.tradebill.domain; + +import lombok.Data; + +import javax.persistence.Table; +import java.io.Serializable; +import java.util.Date; + + +@Data +@Table(name="xhpc_tradebill_upload_record") +public class XhpcTradebillUploadRecordDomain implements Serializable { + + private Integer id; + + private Date createTime; + + private Long createBy; + + private Date updateTime; + + private Long updateBy; + + private String source; + + private String fileName; + + private String url; + + private Integer type; + + private Integer status; + + private Integer delFlag; + + private Integer successCount; + + private Integer failCount; + + private Integer uncheckCount; + + private Integer checkedCount; + + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/EtOrderMappingMapper.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/EtOrderMappingMapper.java new file mode 100644 index 00000000..2ce49980 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/EtOrderMappingMapper.java @@ -0,0 +1,15 @@ +package com.xhpc.tradebill.mapper; + + +import com.xhpc.tradebill.domain.EtOrderMappingDomain; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface EtOrderMappingMapper { + + + EtOrderMappingDomain selectByXhOrderNo(String xhOrderNo); + + + EtOrderMappingDomain selectByEvcsOrderNo(String evcsOrderNo); +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcChargeOrderMapper.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcChargeOrderMapper.java new file mode 100644 index 00000000..3c6e4f6f --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcChargeOrderMapper.java @@ -0,0 +1,8 @@ +package com.xhpc.tradebill.mapper; + +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface XhpcChargeOrderMapper { + +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcHistoryOrderMapper.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcHistoryOrderMapper.java new file mode 100644 index 00000000..5c5db393 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcHistoryOrderMapper.java @@ -0,0 +1,14 @@ +package com.xhpc.tradebill.mapper; + +import com.xhpc.tradebill.domain.XhpcHistoryOrderDomain; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface XhpcHistoryOrderMapper { + + + XhpcHistoryOrderDomain findOneBySerialNumber(String serialNumber); + + + XhpcHistoryOrderDomain findOneByInternetSerialNumber(String internetSerialNumber); +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcRechargeOrderMapper.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcRechargeOrderMapper.java new file mode 100644 index 00000000..4de7dcab --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcRechargeOrderMapper.java @@ -0,0 +1,11 @@ +package com.xhpc.tradebill.mapper; + +import com.xhpc.tradebill.domain.XhpcRechargeOrderDomain; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface XhpcRechargeOrderMapper { + + XhpcRechargeOrderDomain findOneByOrderNumber(String orderNumber); + +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcRefundOrderMapper.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcRefundOrderMapper.java new file mode 100644 index 00000000..417bf135 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcRefundOrderMapper.java @@ -0,0 +1,11 @@ +package com.xhpc.tradebill.mapper; + +import com.xhpc.tradebill.domain.XhpcRefundOrderDomain; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface XhpcRefundOrderMapper { + + XhpcRefundOrderDomain findByOrderNumber(String orderNumber); + +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcTradebillInternetCheckRecordMapper.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcTradebillInternetCheckRecordMapper.java new file mode 100644 index 00000000..c3360614 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcTradebillInternetCheckRecordMapper.java @@ -0,0 +1,35 @@ +package com.xhpc.tradebill.mapper; + +import com.xhpc.tradebill.domain.XhpcTradebillInternetCheckRecordDomain; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface XhpcTradebillInternetCheckRecordMapper { + + int deleteByPrimaryKey(Integer id); + + int insert(XhpcTradebillInternetCheckRecordDomain record); + + int insertSelective(XhpcTradebillInternetCheckRecordDomain record); + + XhpcTradebillInternetCheckRecordDomain selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(XhpcTradebillInternetCheckRecordDomain record); + + int updateByPrimaryKey(XhpcTradebillInternetCheckRecordDomain record); + + List selectListByParams(@Param("params") Map params); + + List> selectTotalGroupbyStatus(@Param("params") Map params); + + int insertCheckList(List paymentCheckList); + + boolean updateStatusByPk(XhpcTradebillInternetCheckRecordDomain record); + + List> selectByParams(Map params); + +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcTradebillPaymentCheckRecordMapper.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcTradebillPaymentCheckRecordMapper.java new file mode 100644 index 00000000..3aaacc76 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcTradebillPaymentCheckRecordMapper.java @@ -0,0 +1,35 @@ +package com.xhpc.tradebill.mapper; + +import com.xhpc.tradebill.domain.XhpcTradebillPaymentCheckRecordDomain; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface XhpcTradebillPaymentCheckRecordMapper { + + int deleteByPrimaryKey(Integer id); + + int insert(XhpcTradebillPaymentCheckRecordDomain record); + + int insertSelective(XhpcTradebillPaymentCheckRecordDomain record); + + XhpcTradebillPaymentCheckRecordDomain selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(XhpcTradebillPaymentCheckRecordDomain record); + + int updateByPrimaryKey(XhpcTradebillPaymentCheckRecordDomain record); + + List selectListByParams(@Param("params") Map params); + + int insertCheckList(List paymentCheckList); + + + List> selectTotalGroupbyStatus(@Param("params") Map params); + + boolean updateStatusByPk(XhpcTradebillPaymentCheckRecordDomain record); + + List> selectByParams(@Param("params") Map params); +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcTradebillUploadRecordMapper.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcTradebillUploadRecordMapper.java new file mode 100644 index 00000000..d056f8e4 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/mapper/XhpcTradebillUploadRecordMapper.java @@ -0,0 +1,28 @@ +package com.xhpc.tradebill.mapper; + +import com.xhpc.tradebill.domain.XhpcTradebillUploadRecordDomain; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface XhpcTradebillUploadRecordMapper { + + XhpcTradebillUploadRecordDomain selectByUrl(String url); + + int deleteByPrimaryKey(Integer id); + + int insert(XhpcTradebillUploadRecordDomain record); + + int insertSelective(XhpcTradebillUploadRecordDomain record); + + XhpcTradebillUploadRecordDomain selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(XhpcTradebillUploadRecordDomain record); + + int updateByPrimaryKey(XhpcTradebillUploadRecordDomain record); + + List selectByType(@Param("params") Map params); +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/CommonService.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/CommonService.java new file mode 100644 index 00000000..a61ad5af --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/CommonService.java @@ -0,0 +1,18 @@ +package com.xhpc.tradebill.service; + + +import com.xhpc.tradebill.domain.XhpcTradebillPaymentCheckRecordDomain; +import com.xhpc.tradebill.domain.XhpcTradebillUploadRecordDomain; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; + +public interface CommonService { + + XhpcTradebillUploadRecordDomain ossUpload(XhpcTradebillUploadRecordDomain domain) throws Exception; + + XhpcTradebillUploadRecordDomain fileUpload(MultipartFile file, int type) throws Exception; + + List getFilePage(Map params); +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/InternetBillService.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/InternetBillService.java new file mode 100644 index 00000000..b70073a9 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/InternetBillService.java @@ -0,0 +1,114 @@ +package com.xhpc.tradebill.service; + + +import com.xhpc.tradebill.domain.XhpcTradebillInternetCheckRecordDomain; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.util.List; +import java.util.Map; + +public interface InternetBillService { + + + XhpcTradebillInternetCheckRecordDomain getInfoByPk(int pk); + + + boolean updateInfoByDomain(XhpcTradebillInternetCheckRecordDomain domain); + + + Integer insertInternetCheckList(int uploadId, List internetCheckRecordDomainList); + + + /** + * 获取对账列表 + * @param uploadId 上传文件ID + * @return 对账数据 + */ + List getInternetCheckList(Map params); + + + Map getStatusTotal(Map params); + + /** + * 获取恒大对账数据 + * @param fileUrl 文件访问地址 + * @return 对账数据 + * @throws Exception 异常 + */ + List getHdInternetDataList(String fileUrl) throws Exception; + + + /** + * 获取恒大对账数据 + * @param dataFile 文件 + * @return 对账数据 + * @throws Exception 异常 + */ + List getHdInternetDataList(File dataFile) throws Exception; + + + /** + * 获取小桔对账数据 + * @param fileUrl 文件访问地址 + * @return 对账数据 + * @throws Exception 异常 + */ + List getXjInternetDataList(String fileUrl) throws Exception; + + + + /** + * 获取小桔对账数据 + * @param dataFile 文件 + * @return 对账数据 + * @throws Exception 异常 + */ + List getXjInternetDataList(File dataFile) throws Exception; + + + /** + * 获取新电途对账数据 + * @param fileUrl 文件访问地址 + * @return 对账数据 + * @throws Exception 异常 + */ + List getXDTInternetDataList(String fileUrl) throws Exception; + + + /** + * 获取新电途对账数据 + * @param dataFile 文件 + * @return 对账数据 + * @throws Exception 异常 + */ + List getXDTInternetDataList(File dataFile) throws Exception; + + + + /** + * 获取快电对账数据 + * @param fileUrl 文件访问地址 + * @return 对账数据 + * @throws Exception 异常 + */ + List getKDInternetDataList(String fileUrl) throws Exception; + + + /** + * 获取快电对账数据 + * @param dataFile 文件 + * @return 对账数据 + * @throws Exception 异常 + */ + List getKDInternetDataList(File dataFile) throws Exception; + + + /** + * 导出对账单 + * @param response 返回体 + * @param params 查询参数 + * @throws Exception 异常 + */ + void export(HttpServletResponse response, Map params) throws Exception; +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/PaymentBillService.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/PaymentBillService.java new file mode 100644 index 00000000..b06fd4f4 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/PaymentBillService.java @@ -0,0 +1,106 @@ +package com.xhpc.tradebill.service; + + +import com.alipay.api.response.AlipayDataBillAccountlogQueryResponse; +import com.github.binarywang.wxpay.bean.result.WxPayFundFlowResult; +import com.github.binarywang.wxpay.exception.WxPayException; +import com.xhpc.tradebill.domain.XhpcTradebillPaymentCheckRecordDomain; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.util.List; +import java.util.Map; + +public interface PaymentBillService { + + XhpcTradebillPaymentCheckRecordDomain getInfoByPk(int pk); + + + boolean updateInfoByDomain(XhpcTradebillPaymentCheckRecordDomain domain); + + + Integer insertPaymentCheckList(int uploadId, List paymentCheckList); + + + Map getStatusTotal(Map params); + /** + * 获取对账列表 + * @param params 参数Map + * @return 对账数据 + */ + List getPaymentCheckList(Map params); + + + /** + * 支付宝订单对账 + * + * @param fileUrl 数据文件存放地址 + * @return 对账完成的数据列表 + */ + List getAliPayDataList(String fileUrl) throws Exception ; + + + /** + * 支付宝订单对账 + * + * @param dataFile 数据文件 + * @return 对账完成的数据列表 + */ + List getAliPayDataList(File dataFile) throws Exception ; + + + /** + * 微信订单对账 + * + * @param fileUrl 数据文件存放地址 + * @return 对账完成的数据列表 + */ + List getWechatDataList(String fileUrl) throws Exception ; + + + /** + * 微信订单对账 + * + * @param dataFile 数据文件 + * @return 对账完成的数据列表 + */ + List getWechatDataList(File dataFile) throws Exception ; + + + /** + * 计算财务支付数据和订单是否对照正常 + * + * @param domain 需对账的数据 + * @return 对账完成的数据 + */ + XhpcTradebillPaymentCheckRecordDomain computeTradebillData(XhpcTradebillPaymentCheckRecordDomain domain) ; + + + /** + * 使用微信支付SDK获取账单信息 + * + * @param billDate 账单日期,格式:2021-12-20 + * @return 账单数据 + * @throws WxPayException 异常 + */ + WxPayFundFlowResult getWechatPayBill(String billDate) throws WxPayException; + + /** + * 使用支付宝SDK获取账单信息 + * + * @param startTime 账单开始时间 + * @param endTime 账单结束时间 + * @return 账单数据 + * @throws Exception 异常 + */ + AlipayDataBillAccountlogQueryResponse getAliPayBill(String startTime, String endTime) throws Exception; + + + /** + * 导出对账单 + * @param response 返回体 + * @param params 查询参数 + * @throws Exception 异常 + */ + void export(HttpServletResponse response, Map params) throws Exception; +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/CommonServiceImpl.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/CommonServiceImpl.java new file mode 100644 index 00000000..c9bc4a0c --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/CommonServiceImpl.java @@ -0,0 +1,192 @@ +package com.xhpc.tradebill.service.impl; + +import com.aliyun.oss.OSSClient; +import com.xhpc.common.core.utils.SecurityUtils; +import com.xhpc.tradebill.config.AliOSSProperties; +import com.xhpc.tradebill.domain.XhpcTradebillInternetCheckRecordDomain; +import com.xhpc.tradebill.domain.XhpcTradebillPaymentCheckRecordDomain; +import com.xhpc.tradebill.domain.XhpcTradebillUploadRecordDomain; +import com.xhpc.tradebill.mapper.XhpcTradebillUploadRecordMapper; +import com.xhpc.tradebill.service.CommonService; +import com.xhpc.tradebill.service.InternetBillService; +import com.xhpc.tradebill.service.PaymentBillService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@Slf4j +@Service +public class CommonServiceImpl implements CommonService { + + @Resource + XhpcTradebillUploadRecordMapper uploadRecordMapper; + + @Resource + PaymentBillService paymentBillService; + + @Resource + InternetBillService internetBillService; + + @Resource + AliOSSProperties ossProperties; + + @Override + public XhpcTradebillUploadRecordDomain ossUpload(XhpcTradebillUploadRecordDomain domain) throws Exception{ + Long userId = SecurityUtils.getUserId(); + domain.setCreateBy(userId); + domain.setUpdateBy(userId); + domain.setSource("上传"); + domain.setFileName(domain.getFileName()); + domain.setStatus(0); + domain.setDelFlag(0); + domain.setSuccessCount(0); + domain.setFailCount(0); + domain.setUncheckCount(0); + domain.setCheckedCount(0); + uploadRecordMapper.insertSelective(domain); + + XhpcTradebillUploadRecordDomain resDomain = uploadRecordMapper.selectByUrl(domain.getUrl()); + List paymentCheckRecordDomainList = null; + List recordDomainList = null; + Map totalMap = new HashMap<>(); + int insertCount = 0; + resDomain.setStatus(2); + switch (domain.getType()){ + case 1: + case 2: + // 微信支付 + paymentCheckRecordDomainList = paymentBillService.getWechatDataList(domain.getUrl()); + insertCount = paymentBillService.insertPaymentCheckList(resDomain.getId(), paymentCheckRecordDomainList); + totalMap = computePaymentRecord(paymentCheckRecordDomainList); + break; + case 3: + case 4: + // 支付宝支付 + paymentCheckRecordDomainList = paymentBillService.getAliPayDataList(domain.getUrl()); + insertCount = paymentBillService.insertPaymentCheckList(resDomain.getId(), paymentCheckRecordDomainList); + totalMap = computePaymentRecord(paymentCheckRecordDomainList); + break; + case 5: + // 恒大 + recordDomainList = internetBillService.getHdInternetDataList(domain.getUrl()); + insertCount = internetBillService.insertInternetCheckList(resDomain.getId(), recordDomainList); + totalMap = computeInternetRecord(recordDomainList); + break; + case 6: + // 小桔 + recordDomainList = internetBillService.getXjInternetDataList(domain.getUrl()); + insertCount = internetBillService.insertInternetCheckList(resDomain.getId(), recordDomainList); + totalMap = computeInternetRecord(recordDomainList); + break; + case 7: + // 新电途 + recordDomainList = internetBillService.getXDTInternetDataList(domain.getUrl()); + insertCount = internetBillService.insertInternetCheckList(resDomain.getId(), recordDomainList); + totalMap = computeInternetRecord(recordDomainList); + break; + case 8: + // 快电 + recordDomainList = internetBillService.getKDInternetDataList(domain.getUrl()); + insertCount = internetBillService.insertInternetCheckList(resDomain.getId(), recordDomainList); + totalMap = computeInternetRecord(recordDomainList); + break; + default: + resDomain.setStatus(1); + totalMap.put("successCount", 0); + totalMap.put("failCount", 0); + totalMap.put("checkCount", 0); + totalMap.put("uncheckCount", 0); + break; + } + resDomain.setStatus(1); + resDomain.setSuccessCount(totalMap.get("successCount")); + resDomain.setFailCount(totalMap.get("failCount")); + resDomain.setCheckedCount(totalMap.get("checkCount")); + resDomain.setUncheckCount(totalMap.get("uncheckCount")); + uploadRecordMapper.updateByPrimaryKey(resDomain); + return resDomain; + } + + + + @Override + public XhpcTradebillUploadRecordDomain fileUpload(MultipartFile file, int type) throws Exception{ + XhpcTradebillUploadRecordDomain domain = new XhpcTradebillUploadRecordDomain(); + // 创建OSSClient实例 + String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1); + File dataFile = File.createTempFile("temp_", suffix); + + file.transferTo(dataFile); + + String ossPath = "bill/" + file.getOriginalFilename().substring(0, file.getOriginalFilename().lastIndexOf(".")) + "_" +System.currentTimeMillis() + "." + suffix; + OSSClient ossClient = new OSSClient(ossProperties.getEndpoint(), ossProperties.getAccessKey(), ossProperties.getSecretKey()); + // 上传文件流 + ossClient.putObject(ossProperties.getBucketName(), ossPath, dataFile); + ossClient.shutdown(); + + domain.setFileName(file.getOriginalFilename()); + domain.setUrl(ossProperties.getDomain() + ossPath); + domain.setType(type); + + return ossUpload(domain); + } + + @Override + public List getFilePage(Map params){ + + return uploadRecordMapper.selectByType(params); + } + + + private Map computePaymentRecord(List domainList){ + Integer successCount = 0; + Integer failCount = 0; + Integer checkCount = 0; + Integer uncheckCount = 0; + Map result = new HashMap<>(); + for (XhpcTradebillPaymentCheckRecordDomain domain: domainList){ + if(domain.getStatus() == 2){ + successCount++; checkCount++; + } else if(domain.getStatus() == 1 || domain.getStatus() == 0){ + failCount++; checkCount++; + } else { + uncheckCount++; + } + } + result.put("successCount", successCount); + result.put("failCount", failCount); + result.put("checkCount", checkCount); + result.put("uncheckCount", uncheckCount); + return result; + } + + + private Map computeInternetRecord(List domainList){ + Integer successCount = 0; + Integer failCount = 0; + Integer checkCount = 0; + Integer uncheckCount = 0; + Map result = new HashMap<>(); + for (XhpcTradebillInternetCheckRecordDomain domain: domainList){ + if(domain.getStatus() == 2){ + successCount++; checkCount++; + } else if(domain.getStatus() == 1 || domain.getStatus() == 0){ + failCount++; checkCount++; + } else { + uncheckCount++; + } + } + result.put("successCount", successCount); + result.put("failCount", failCount); + result.put("checkCount", checkCount); + result.put("uncheckCount", uncheckCount); + return result; + } +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/InternetBillServiceImpl.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/InternetBillServiceImpl.java new file mode 100644 index 00000000..202643e4 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/InternetBillServiceImpl.java @@ -0,0 +1,467 @@ +package com.xhpc.tradebill.service.impl; + +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.io.file.FileReader; +import cn.hutool.core.text.csv.CsvReader; +import cn.hutool.core.text.csv.CsvUtil; +import cn.hutool.poi.excel.ExcelWriter; +import com.xhpc.common.core.utils.SecurityUtils; +import com.xhpc.common.core.utils.poi.ExcelUtil; +import com.xhpc.tradebill.domain.XhpcHistoryOrderDomain; +import com.xhpc.tradebill.domain.XhpcTradebillInternetCheckRecordDomain; +import com.xhpc.tradebill.mapper.EtOrderMappingMapper; +import com.xhpc.tradebill.mapper.XhpcHistoryOrderMapper; +import com.xhpc.tradebill.mapper.XhpcTradebillInternetCheckRecordMapper; +import com.xhpc.tradebill.service.InternetBillService; +import com.xhpc.tradebill.utils.DownloadUtil; +import com.xhpc.tradebill.vo.HDTradebillVo; +import com.xhpc.tradebill.vo.KDTradebillVo; +import com.xhpc.tradebill.vo.XDTTradebillVo; +import com.xhpc.tradebill.vo.XJTradeBillVo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileInputStream; +import java.math.BigDecimal; +import java.nio.charset.Charset; +import java.util.*; + + +@Slf4j +@Service +public class InternetBillServiceImpl implements InternetBillService { + + @Resource + XhpcTradebillInternetCheckRecordMapper internetCheckRecordMapper; + + @Resource + XhpcHistoryOrderMapper historyOrderMapper; + + @Resource + EtOrderMappingMapper orderMappingMapper; + + + + @Override + public XhpcTradebillInternetCheckRecordDomain getInfoByPk(int pk){ + return internetCheckRecordMapper.selectByPrimaryKey(pk); + } + + @Override + public boolean updateInfoByDomain(XhpcTradebillInternetCheckRecordDomain domain){ + domain.setUpdateBy(SecurityUtils.getUserId()); + return internetCheckRecordMapper.updateStatusByPk(domain); + } + + + @Override + public Integer insertInternetCheckList(int uploadId, List internetCheckRecordDomainList){ + Long userId = SecurityUtils.getUserId(); + for(XhpcTradebillInternetCheckRecordDomain domain: internetCheckRecordDomainList){ + domain.setUploadId(uploadId); + domain.setCreateBy(userId); + domain.setUpdateBy(userId); + } + return internetCheckRecordMapper.insertCheckList(internetCheckRecordDomainList); + } + + + @Override + public List getInternetCheckList(Map params){ + return internetCheckRecordMapper.selectListByParams(params); + } + + @Override + public Map getStatusTotal(Map params){ + List> resultList = internetCheckRecordMapper.selectTotalGroupbyStatus(params); + int successCount = 0; + int failCount = 0; + int uncheckCount = 0; + int checkCount = 0; + for(Map res : resultList){ + switch (res.get("status").toString()){ + case "0": + uncheckCount = Integer.parseInt(res.get("total").toString()); break; + case "1": + failCount = Integer.parseInt(res.get("total").toString()); break; + case "2": + successCount = Integer.parseInt(res.get("total").toString()); break; + default: break; + } + } + checkCount = successCount + failCount; + Map resultMap = new HashMap<>(); + resultMap.put("successCount", successCount); + resultMap.put("failCount", failCount); + resultMap.put("uncheckCount", uncheckCount); + resultMap.put("checkCount", checkCount); + return resultMap; + } + + + /** + * 获取恒大对账数据 + * @param fileUrl 文件访问地址 + * @return 对账数据 + * @throws Exception 异常 + */ + @Override + public List getHdInternetDataList(String fileUrl) throws Exception { + File dataFile = DownloadUtil.downloadFile(fileUrl); + return getHdInternetDataList(dataFile); + } + + + /** + * 获取小桔对账数据 + * @param fileUrl 文件访问地址 + * @return 对账数据 + * @throws Exception 异常 + */ + @Override + public List getXjInternetDataList(String fileUrl) throws Exception { + File dataFile = DownloadUtil.downloadFile(fileUrl); + return getXjInternetDataList(dataFile); + } + + + /** + * 获取新电途对账数据 + * @param fileUrl 文件访问地址 + * @return 对账数据 + * @throws Exception 异常 + */ + @Override + public List getXDTInternetDataList(String fileUrl) throws Exception { + File dataFile = DownloadUtil.downloadFile(fileUrl); + return getXDTInternetDataList(dataFile); + } + + + /** + * 获取快电对账数据 + * @param fileUrl 文件访问地址 + * @return 对账数据 + * @throws Exception 异常 + */ + @Override + public List getKDInternetDataList(String fileUrl) throws Exception { + File dataFile = DownloadUtil.downloadFile(fileUrl); + return getKDInternetDataList(dataFile); + } + + /** + * 获取恒大对账数据 + * @param dataFile 对账单文件,格式为xlsx + * @return 对账数据 + */ + @Override + public List getHdInternetDataList(File dataFile) throws Exception { + List checkRecordDomainList = new ArrayList<>(); + String suffix = dataFile.getName().substring(dataFile.getName().lastIndexOf(".") + 1); + List hdTradebillVoList = new ArrayList<>(); + + switch (suffix.toUpperCase()){ + case "XLS": + case "XLSX": + ExcelUtil util = new ExcelUtil(HDTradebillVo.class); + hdTradebillVoList = util.importExcel(new FileInputStream(dataFile)); + break; + case "CSV": + CsvReader reader = CsvUtil.getReader(); + FileReader fileReader = new FileReader(dataFile.getAbsolutePath(), Charset.forName("GBK")); + hdTradebillVoList = reader.read(fileReader.readString(), HDTradebillVo.class); + break; + default:break; + } + + for(HDTradebillVo vo: hdTradebillVoList){ + XhpcTradebillInternetCheckRecordDomain domain = new XhpcTradebillInternetCheckRecordDomain(); + domain.setPlatformInternetSerialNumber(vo.getOrderNo().trim()); + domain.setInternetSerialNumber(vo.getOrderNo().trim()); + domain.setSource("恒大"); + domain.setInternetName("恒大"); + domain.setInternetChargeStation(vo.getStationName()); + BigDecimal chargingDegree = vo.getChargeDegree()!=null ? BigDecimal.valueOf(vo.getChargeDegree()) : BigDecimal.ZERO; + domain.setInternetChargingDegree(chargingDegree); + + BigDecimal orderAmount = vo.getOrderTotalAmount() !=null? BigDecimal.valueOf(vo.getOrderTotalAmount()): BigDecimal.ZERO; + domain.setInternetOrderAmount(orderAmount); + + BigDecimal powerAmount = vo.getPowerAmount()!=null? BigDecimal.valueOf(vo.getPowerAmount()): BigDecimal.ZERO; + domain.setInternetPowerAmount(powerAmount); + + BigDecimal serverAmount = vo.getServerAmount()!= null? BigDecimal.valueOf(vo.getServerAmount()): BigDecimal.ZERO; + domain.setInternetServerAmount(serverAmount); + domain.setInternetDiscountAmount(BigDecimal.ZERO); + + BigDecimal payAmount = vo.getOrderTotalAmount()!=null ? BigDecimal.valueOf(vo.getOrderTotalAmount()): BigDecimal.ZERO; + domain.setInternetPayAmount(payAmount); + + getHistoryOrderInfo(domain); + checkRecordDomainList.add(domain); + } + checkRecordDomainList.sort(Comparator.comparing(XhpcTradebillInternetCheckRecordDomain::getStatus)); + return checkRecordDomainList; + } + + + /** + * 获取小桔对账数据 + * @param dataFile 对账单文件,格式为xlsx + * @return 对账数据 + */ + @Override + public List getXjInternetDataList(File dataFile) throws Exception { + + String suffix = dataFile.getName().substring(dataFile.getName().lastIndexOf(".") + 1); + List checkRecordDomainList = new ArrayList<>(); + List xjTradeBillVoList = new ArrayList<>(); + + switch (suffix.toUpperCase()){ + case "XLS": + case "XLSX": + ExcelUtil util = new ExcelUtil(XJTradeBillVo.class); + xjTradeBillVoList = util.importExcel(new FileInputStream(dataFile)); + break; + case "CSV": + CsvReader reader = CsvUtil.getReader(); + FileReader fileReader = new FileReader(dataFile.getAbsolutePath(), Charset.forName("GBK")); + xjTradeBillVoList = reader.read(fileReader.readString(), XJTradeBillVo.class); + break; + default: break; + } + + for(XJTradeBillVo vo: xjTradeBillVoList){ + XhpcTradebillInternetCheckRecordDomain domain = new XhpcTradebillInternetCheckRecordDomain(); + domain.setPlatformInternetSerialNumber(vo.getOrderNo().trim()); + domain.setInternetSerialNumber(vo.getOrderNo().trim()); + domain.setSource("小桔"); + domain.setInternetName("小桔"); + domain.setInternetChargeStation(vo.getStationName()); + domain.setInternetStartSoc(vo.getStartSoc()); + domain.setInternetEndSoc(vo.getEndSoc()); + BigDecimal chargingDegree = vo.getChargingDegree()!=null ? BigDecimal.valueOf(vo.getChargingDegree()): BigDecimal.ZERO; + domain.setInternetChargingDegree(chargingDegree); + domain.setInternetChargingTime(vo.getChargingTime().toString()); + domain.setInternetStartTime(vo.getChargingStartTime()); + domain.setInternetEndTime(vo.getChargingEndTime()); + + BigDecimal orderAmount = vo.getBillAmount() !=null? BigDecimal.valueOf(vo.getBillAmount()): BigDecimal.ZERO; + domain.setInternetOrderAmount(orderAmount); + + BigDecimal powerAmount = vo.getOrderPowerAmount()!=null? BigDecimal.valueOf(vo.getOrderPowerAmount()): BigDecimal.ZERO; + domain.setInternetPowerAmount(powerAmount); + + BigDecimal serverAmount = vo.getOrderServerAmount()!= null? BigDecimal.valueOf(vo.getOrderServerAmount()): BigDecimal.ZERO; + domain.setInternetServerAmount(serverAmount); + domain.setInternetDiscountAmount(BigDecimal.ZERO); + + BigDecimal payAmount = vo.getOrderTotalAmount()!=null ? BigDecimal.valueOf(vo.getOrderTotalAmount()): BigDecimal.ZERO; + domain.setInternetPayAmount(payAmount); + + getHistoryOrderInfo(domain); + + checkRecordDomainList.add(domain); + } + checkRecordDomainList.sort(Comparator.comparing(XhpcTradebillInternetCheckRecordDomain::getStatus)); + return checkRecordDomainList; + } + + + /** + * 获取新电途对账数据 + * @param dataFile 对账单文件,格式为xlsx + * @return 对账数据 + */ + @Override + public List getXDTInternetDataList(File dataFile) throws Exception { + String suffix = dataFile.getName().substring(dataFile.getName().lastIndexOf(".") + 1); + List checkRecordDomainList = new ArrayList<>(); + List xdtTradebillVoList = new ArrayList<>(); + + switch (suffix.toUpperCase()){ + case "XLS": + case "XLSX": + ExcelUtil util = new ExcelUtil(XDTTradebillVo.class); + xdtTradebillVoList = util.importExcel(new FileInputStream(dataFile)); + break; + case "CSV": + CsvReader reader = CsvUtil.getReader(); + FileReader fileReader = new FileReader(dataFile.getAbsolutePath(), Charset.forName("GBK")); + xdtTradebillVoList = reader.read(fileReader.readString(), XDTTradebillVo.class); + break; + default: break; + } + + for(XDTTradebillVo vo: xdtTradebillVoList){ + XhpcTradebillInternetCheckRecordDomain domain = new XhpcTradebillInternetCheckRecordDomain(); + domain.setPlatformInternetSerialNumber(vo.getOrderNo().trim()); + domain.setInternetSerialNumber(vo.getOrderNo().trim()); + domain.setSource("新电途"); + domain.setInternetName("新电途"); + domain.setInternetChargeStation(vo.getStationName()); + + BigDecimal chargingDegree = vo.getChargingDegree()!=null? BigDecimal.valueOf(vo.getChargingDegree()): BigDecimal.ZERO; + domain.setInternetChargingDegree(chargingDegree); + + BigDecimal orderAmount = vo.getOrderAmount() !=null? BigDecimal.valueOf(vo.getOrderAmount()): BigDecimal.ZERO; + domain.setInternetOrderAmount(orderAmount); + + BigDecimal powerAmount = vo.getPowerAmount()!=null? BigDecimal.valueOf(vo.getPowerAmount()): BigDecimal.ZERO; + domain.setInternetPowerAmount(powerAmount); + + BigDecimal serverAmount = vo.getServerAmount()!= null? BigDecimal.valueOf(vo.getServerAmount()): BigDecimal.ZERO; + domain.setInternetServerAmount(serverAmount); + domain.setInternetDiscountAmount(BigDecimal.ZERO); + + BigDecimal payAmount = vo.getPayAmount()!=null ? BigDecimal.valueOf(vo.getPayAmount()): BigDecimal.ZERO; + domain.setInternetPayAmount(payAmount); + getHistoryOrderInfo(domain); + checkRecordDomainList.add(domain); + } + checkRecordDomainList.sort(Comparator.comparing(XhpcTradebillInternetCheckRecordDomain::getStatus)); + return checkRecordDomainList; + } + + + /** + * 获取快电对账数据 + * @param dataFile 对账单文件,格式为xlsx + * @return 对账数据 + */ + @Override + public List getKDInternetDataList(File dataFile) throws Exception { + String suffix = dataFile.getName().substring(dataFile.getName().lastIndexOf(".") + 1); + List checkRecordDomainList = new ArrayList<>(); + List kdTradebillVoList = new ArrayList<>(); + + switch (suffix.toUpperCase()){ + case "XLS": + case "XLSX": + ExcelUtil util = new ExcelUtil(KDTradebillVo.class); + kdTradebillVoList = util.importExcel(new FileInputStream(dataFile)); + break; + case "CSV": + CsvReader reader = CsvUtil.getReader(); + FileReader fileReader = new FileReader(dataFile.getAbsolutePath(), Charset.forName("GBK")); + kdTradebillVoList = reader.read(fileReader.readString(), KDTradebillVo.class); + break; + default: break; + } + + for(KDTradebillVo vo: kdTradebillVoList){ + XhpcTradebillInternetCheckRecordDomain domain = new XhpcTradebillInternetCheckRecordDomain(); + domain.setSource("快电"); + domain.setInternetName("快电"); + + getHistoryOrderInfo(domain); + checkRecordDomainList.add(domain); + } + checkRecordDomainList.sort(Comparator.comparing(XhpcTradebillInternetCheckRecordDomain::getStatus)); + return checkRecordDomainList; + } + + /** + * 导出对账单 + * @param response 返回体 + * @param params 查询参数 + * @throws Exception 异常 + */ + @Override + public void export(HttpServletResponse response, Map params) throws Exception{ + List> list = internetCheckRecordMapper.selectByParams(params); + +// 通过工具类创建writer,默认创建xls格式 + ExcelWriter writer = cn.hutool.poi.excel.ExcelUtil.getWriter(true); + writer.addHeaderAlias("internet_name", "流量方名称"); + writer.addHeaderAlias("user_id", "用户账号"); + + writer.addHeaderAlias("platform_order_number", "平台-订单编号"); + writer.addHeaderAlias("platform_charge_station", "平台-充电场站名称"); + writer.addHeaderAlias("platform_start_soc", "平台-开始SOC"); + writer.addHeaderAlias("platform_end_soc", "平台-结束SOC"); + writer.addHeaderAlias("platform_charging_degree", "平台-充电电量"); + writer.addHeaderAlias("platform_charging_time", "平台-充电时长"); + writer.addHeaderAlias("platform_start_time", "平台-开始充电时间"); + writer.addHeaderAlias("platform_end_time", "平台-结束充电时间"); + writer.addHeaderAlias("platform_order_amount", "平台-订单总金额"); + writer.addHeaderAlias("platform_power_amount", "平台-电费金额"); + writer.addHeaderAlias("platform_server_amount", "平台-服务费金额"); + writer.addHeaderAlias("platform_discount_amount", "平台-折扣费用"); + writer.addHeaderAlias("platform_pay_amount", "平台-实际支付金额"); + + writer.addHeaderAlias("internet_order_number", "流量方-订单编号"); + writer.addHeaderAlias("internet_charge_station", "流量方-充电场站名称"); + writer.addHeaderAlias("internet_start_soc", "流量方-开始SOC"); + writer.addHeaderAlias("internet_end_soc", "流量方-结束SOC"); + writer.addHeaderAlias("internet_charging_degree", "流量方-充电电量"); + writer.addHeaderAlias("internet_charging_time", "流量方-充电时长"); + writer.addHeaderAlias("internet_start_time", "流量方-开始充电时间"); + writer.addHeaderAlias("internet_end_time", "流量方-结束充电时间"); + writer.addHeaderAlias("internet_order_amount", "流量方-订单总金额"); + writer.addHeaderAlias("internet_power_amount", "流量方-电费金额"); + writer.addHeaderAlias("internet_server_amount", "流量方-服务费金额"); + writer.addHeaderAlias("internet_discount_amount", "流量方-折扣费用"); + writer.addHeaderAlias("internet_pay_amount", "流量方-实际支付金额"); + + writer.addHeaderAlias("status", "对账状态(0-待对账,1-对账错误,2-对账正确)"); + writer.addHeaderAlias("remark", "备注"); + + writer.setOnlyAlias(true); + writer.write(list, true); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setCharacterEncoding("utf-8"); + ServletOutputStream out = response.getOutputStream(); + + writer.flush(out, true); + writer.close(); + IoUtil.close(out); + } + + + + private void getHistoryOrderInfo(XhpcTradebillInternetCheckRecordDomain domain){ + XhpcHistoryOrderDomain orderDomain = historyOrderMapper.findOneByInternetSerialNumber(domain.getInternetSerialNumber()); + if(orderDomain != null){ + domain.setHistoryOrderNo(orderDomain.getHistoryOrderId()); + domain.setPlatformInternetSerialNumber(orderDomain.getInternetSerialNumber()); + domain.setPlatformSerialNumber(orderDomain.getSerialNumber()); + domain.setPlatformChargeStation(orderDomain.getChargingStationName()); + domain.setPlatformStartSoc(orderDomain.getStartSoc()); + domain.setPlatformEndSoc(orderDomain.getEndSoc()); + BigDecimal chargingDegree = orderDomain.getChargingDegree() != null? + BigDecimal.valueOf(orderDomain.getChargingDegree()): BigDecimal.ZERO; + domain.setPlatformChargingDegree(chargingDegree); + domain.setPlatformChargingTime(orderDomain.getChargingTime()); + domain.setPlatformStartTime(orderDomain.getStartTime()); + domain.setPlatformEndTime(orderDomain.getEndTime()); + domain.setPlatformOrderAmount(orderDomain.getTotalPrice()); + domain.setPlatformPowerAmount(orderDomain.getPowerPriceTotal()); + domain.setPlatformServerAmount(orderDomain.getServicePriceTotal()); + domain.setPlatformDiscountAmount(orderDomain.getPromotionDiscount()); + domain.setPlatformPayAmount(orderDomain.getActPrice()); + } + checkoutOrderResult(domain); + } + + + private void checkoutOrderResult(XhpcTradebillInternetCheckRecordDomain domain){ + int checkoutStatus = 0; + // 流量方的订单金额大于本平台的历史订单的订单金额,就可以判断成功 + if(domain.getPlatformOrderAmount() != null && domain.getPlatformOrderAmount().compareTo(domain.getInternetOrderAmount()) == 0 + && domain.getPlatformPowerAmount() != null && domain.getPlatformPowerAmount().compareTo(domain.getInternetPowerAmount()) == 0 + && domain.getPlatformServerAmount() != null && domain.getPlatformServerAmount().compareTo(domain.getInternetServerAmount()) == 0 + && domain.getPlatformChargingDegree() != null && domain.getPlatformChargingDegree().compareTo(domain.getInternetChargingDegree()) == 0){ + checkoutStatus = 2; + } + domain.setStatus(checkoutStatus); + } + + + +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/PaymentBillServiceImpl.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/PaymentBillServiceImpl.java new file mode 100644 index 00000000..171ecf6a --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/PaymentBillServiceImpl.java @@ -0,0 +1,443 @@ +package com.xhpc.tradebill.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.text.csv.CsvData; +import cn.hutool.core.text.csv.CsvReader; +import cn.hutool.core.text.csv.CsvRow; +import cn.hutool.core.text.csv.CsvUtil; +import cn.hutool.core.util.CharsetUtil; +import cn.hutool.poi.excel.ExcelUtil; +import cn.hutool.poi.excel.ExcelWriter; +import com.alibaba.fastjson.JSON; +import com.alipay.api.AlipayApiException; +import com.alipay.api.AlipayClient; +import com.alipay.api.DefaultAlipayClient; +import com.alipay.api.request.AlipayDataBillAccountlogQueryRequest; +import com.alipay.api.response.AlipayDataBillAccountlogQueryResponse; +import com.github.binarywang.wxpay.bean.result.WxPayFundFlowResult; +import com.github.binarywang.wxpay.exception.WxPayException; +import com.github.binarywang.wxpay.service.WxPayService; +import com.xhpc.common.core.utils.SecurityUtils; +import com.xhpc.tradebill.config.AliPayProperties; +import com.xhpc.tradebill.constant.WeixinPayConstant; +import com.xhpc.tradebill.domain.XhpcRechargeOrderDomain; +import com.xhpc.tradebill.domain.XhpcRefundOrderDomain; +import com.xhpc.tradebill.domain.XhpcTradebillPaymentCheckRecordDomain; +import com.xhpc.tradebill.mapper.XhpcRechargeOrderMapper; +import com.xhpc.tradebill.mapper.XhpcRefundOrderMapper; +import com.xhpc.tradebill.mapper.XhpcTradebillPaymentCheckRecordMapper; +import com.xhpc.tradebill.service.PaymentBillService; +import com.xhpc.tradebill.utils.DownloadUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.tools.zip.ZipEntry; +import org.apache.tools.zip.ZipFile; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.util.*; + + +@Slf4j +@Service +public class PaymentBillServiceImpl implements PaymentBillService { + + public WxPayService wxPayService; + + @Resource + AliPayProperties aliPayProperties; + + @Resource + XhpcRechargeOrderMapper rechargeOrderMapper; + + @Resource + XhpcRefundOrderMapper refundOrderMapper; + + @Resource + XhpcTradebillPaymentCheckRecordMapper paymentCheckRecordMapper; + + + @Override + public XhpcTradebillPaymentCheckRecordDomain getInfoByPk(int pk){ + return paymentCheckRecordMapper.selectByPrimaryKey(pk); + } + + @Override + public boolean updateInfoByDomain(XhpcTradebillPaymentCheckRecordDomain domain){ + domain.setUpdateBy(SecurityUtils.getUserId()); + return paymentCheckRecordMapper.updateStatusByPk(domain); + } + + + @Override + public Integer insertPaymentCheckList(int uploadId, List paymentCheckList){ + Long userId = SecurityUtils.getUserId(); + for(XhpcTradebillPaymentCheckRecordDomain domain: paymentCheckList){ + domain.setUploadId(uploadId); + domain.setCreateBy(userId); + domain.setUpdateBy(userId); + } + return paymentCheckRecordMapper.insertCheckList(paymentCheckList); + } + + @Override + public Map getStatusTotal(Map params){ + List> resultList = paymentCheckRecordMapper.selectTotalGroupbyStatus(params); + int successCount = 0; + int failCount = 0; + int uncheckCount = 0; + int checkCount = 0; + for(Map res : resultList){ + switch (res.get("status").toString()){ + case "0": + uncheckCount = Integer.parseInt(res.get("total").toString()); break; + case "1": + failCount = Integer.parseInt(res.get("total").toString()); break; + case "2": + successCount = Integer.parseInt(res.get("total").toString()); break; + default: break; + } + } + checkCount = successCount + failCount; + Map resultMap = new HashMap<>(); + resultMap.put("successCount", successCount); + resultMap.put("failCount", failCount); + resultMap.put("uncheckCount", uncheckCount); + resultMap.put("checkCount", checkCount); + return resultMap; + } + + @Override + public List getPaymentCheckList(Map params){ + return paymentCheckRecordMapper.selectListByParams(params); + } + + + /** + * 支付宝订单对账 + * + * @param fileUrl 数据文件存放地址 + * @return 对账完成的数据列表 + */ + public List getAliPayDataList(String fileUrl) throws Exception{ + File dataFile = DownloadUtil.downloadFile(fileUrl); + return getAliPayDataList(dataFile); + } + + + /** + * 支付宝订单对账 + * + * @param dataFile 数据文件 + * @return 对账完成的数据列表 + */ + public List getAliPayDataList(File dataFile) throws + Exception { + + Long userId = SecurityUtils.getUserId(); + + List paymentCheckRecordDomainList = new ArrayList<>(); + String suffix = dataFile.getName().substring(dataFile.getName().lastIndexOf(".") + 1); + System.out.println(dataFile.getAbsolutePath()); + switch (suffix.toUpperCase()) { + case "CSV": + CsvReader csvReader = CsvUtil.getReader(); + CsvData data = csvReader.read(dataFile, CharsetUtil.CHARSET_GBK); + List rows = data.getRows(); + for (CsvRow row : rows) { + // 列数是22,则是正文内容 + if (row.getRawList().size() != 22) { + continue; + } + // 判断内容是否是中文,如果是中文就认为是标题,则跳过 + if (row.get(0).getBytes(StandardCharsets.UTF_8).length != row.get(0).length()) { + continue; + } + XhpcTradebillPaymentCheckRecordDomain domain = new XhpcTradebillPaymentCheckRecordDomain(); + domain.setCreateBy(userId); + domain.setUpdateBy(userId); + domain.setPaymentChannel(2); + domain.setPaymentUserId(row.get(12)); + domain.setPaymentPayTime(DateUtil.parse(row.get(1))); + + BigDecimal paymentAmount = BigDecimal.ZERO; + if (row.get(5).equals("在线支付")) { + // 充值订单 + domain.setPaymentPayNumber(row.get(4).trim().replaceAll("`", "").replaceAll("'", "")); + domain.setOrderType(1); + System.out.println(row); + paymentAmount = row.get(6) != null && !"".equals(row.get(6).trim())? new BigDecimal(row.get(6)): BigDecimal.ZERO; + domain.setPaymentAmount(paymentAmount); + XhpcRechargeOrderDomain rechargeOrderDomain = rechargeOrderMapper.findOneByOrderNumber(row.get(4)); + if (rechargeOrderDomain != null) { + domain.setPlatformOrderNumber(rechargeOrderDomain.getRechargeOrderNumber()); + domain.setPlatformUserId(rechargeOrderDomain.getUserId().toString()); + domain.setPlatformPayNumber(rechargeOrderDomain.getRechargeOrderId().toString()); + domain.setPlatformAmount(rechargeOrderDomain.getAmount()); + domain.setPlatformPayTime(rechargeOrderDomain.getUpdateTime()); + } + } else if (row.get(5).equals("转账")) { + // 退款订单 + domain.setPaymentPayNumber(row.get(16).trim().replaceAll("`", "").replaceAll("'", "").replaceAll("单笔转账--", "")); + domain.setOrderType(2); + + paymentAmount = row.get(7) != null && !"".equals(row.get(7).trim())? new BigDecimal(row.get(7)): BigDecimal.ZERO; + domain.setPaymentAmount(paymentAmount); + XhpcRefundOrderDomain refundOrderDomain = refundOrderMapper.findByOrderNumber(row.get(4)); + if (refundOrderDomain != null) { + domain.setPlatformOrderNumber(refundOrderDomain.getRefundOrderNumber()); + domain.setPlatformUserId(refundOrderDomain.getUserId().toString()); + domain.setPlatformPayNumber(refundOrderDomain.getRefundOrderId().toString()); + domain.setPlatformAmount(refundOrderDomain.getAmount()); + domain.setPlatformPayTime(refundOrderDomain.getUpdateTime()); + } + } + + paymentCheckRecordDomainList.add(computeTradebillData(domain)); + } + break; + case "ZIP": + ZipFile zip = new ZipFile(dataFile); + File file = null; + for (Enumeration enumeration = zip.getEntries(); enumeration.hasMoreElements(); ) { + ZipEntry entry = enumeration.nextElement(); + InputStream in = zip.getInputStream(entry); + if (entry.isDirectory()) { + continue; + } + file = File.createTempFile("alipay_", entry.getName().substring(entry.getName().lastIndexOf("."))); + OutputStream outputStream = new FileOutputStream(file); + byte[] buff = new byte[1024]; + int len; + while ((len = in.read(buff)) > 0) { + outputStream.write(buff, 0, len); + } + in.close(); + outputStream.close(); + } + if (file != null) { + paymentCheckRecordDomainList = getAliPayDataList(file); + } + + break; + default: + throw new Exception("暂不支持的文件格式"); + } + + paymentCheckRecordDomainList.sort(Comparator.comparing(XhpcTradebillPaymentCheckRecordDomain::getStatus)); + return paymentCheckRecordDomainList; + } + + /** + * 微信订单对账 + * + * @param fileUrl 数据文件存放地址 + * @return 对账完成的数据列表 + */ + public List getWechatDataList(String fileUrl) throws Exception { + File dataFile = DownloadUtil.downloadFile(fileUrl); + return getWechatDataList(dataFile); + } + + + + /** + * 微信订单对账 + * + * @param dataFile 数据文件 + * @return 对账完成的数据列表 + */ + public List getWechatDataList(File dataFile) throws Exception { + + Long userId = SecurityUtils.getUserId(); + List paymentCheckRecordDomainList = new ArrayList<>(); + String suffix = dataFile.getName().substring(dataFile.getName().lastIndexOf(".") + 1); + + if ("CSV".equalsIgnoreCase(suffix)) {// 微信充值订单格式 + CsvReader csvReader = CsvUtil.getReader(); + CsvData data = csvReader.read(dataFile); + List rows = data.getRows(); + for (CsvRow row : rows) { + // 列数是6,则是充值订单 + // 列数是13,则是退款订单 + if (row.getRawList().size() != 6 && row.getRawList().size() != 13) { + continue; + } + XhpcTradebillPaymentCheckRecordDomain domain = new XhpcTradebillPaymentCheckRecordDomain(); + domain.setPaymentChannel(1); + domain.setCreateBy(userId); + domain.setUpdateBy(userId); + if (row.getRawList().size() == 6) { + if (row.get(0).getBytes(StandardCharsets.UTF_8).length != row.get(0).length()) { + continue; + } + domain.setOrderType(1); + domain.setPaymentPayNumber(StringFormat(row.get(2))); + + BigDecimal paymentAmount = row.get(5)!=null &&!"".equals(row.get(5).trim())? new BigDecimal(StringFormat(row.get(5))) : BigDecimal.ZERO; + + domain.setPaymentAmount(paymentAmount); + domain.setPaymentPayTime(DateUtil.parse(row.get(0))); + + XhpcRechargeOrderDomain rechargeOrderDomain = rechargeOrderMapper.findOneByOrderNumber(StringFormat(row.get(2))); + if(rechargeOrderDomain != null){ + domain.setPlatformOrderNumber(rechargeOrderDomain.getRechargeOrderNumber()); + domain.setPlatformUserId(rechargeOrderDomain.getUserId().toString()); + domain.setPlatformPayNumber(rechargeOrderDomain.getRechargeOrderId().toString()); + domain.setPlatformAmount(rechargeOrderDomain.getAmount()); + domain.setPlatformPayTime(rechargeOrderDomain.getUpdateTime()); + } + + } else if (row.getRawList().size() == 13) { + // 微信退款订单 + if (row.get(0).getBytes(StandardCharsets.UTF_8).length != row.get(0).length()) { + continue; + } + domain.setOrderType(2); + domain.setPaymentPayNumber(StringFormat(row.get(2))); + + BigDecimal paymentAmount = row.get(10) != null && ! "".equals(row.get(10).trim()) ? + new BigDecimal(StringFormat(row.get(10))) + : BigDecimal.ZERO; + + domain.setPaymentAmount(paymentAmount); + domain.setPaymentUserId(StringFormat(row.get(4))); + domain.setPaymentPayTime(DateUtil.parse(row.get(6))); + + XhpcRefundOrderDomain refundOrderDomain = refundOrderMapper.findByOrderNumber(StringFormat(row.get(2))); + if (refundOrderDomain!=null){ + domain.setPlatformOrderNumber(refundOrderDomain.getRefundOrderNumber()); + domain.setPlatformUserId(refundOrderDomain.getUserId().toString()); + domain.setPlatformPayNumber(refundOrderDomain.getRefundOrderId().toString()); + domain.setPlatformAmount(refundOrderDomain.getAmount()); + domain.setPlatformPayTime(refundOrderDomain.getUpdateTime()); + } + + } + + paymentCheckRecordDomainList.add(computeTradebillData(domain)); + } + } else { + throw new Exception("暂不支持的文件格式"); + } + paymentCheckRecordDomainList.sort(Comparator.comparing(XhpcTradebillPaymentCheckRecordDomain::getStatus)); + return paymentCheckRecordDomainList; + } + + private String StringFormat(String dataStr){ + return dataStr.replaceAll("'", "").replaceAll("`", ""); + } + + + /** + * 计算财务支付数据和订单是否对照正常 + * + * @param domain 需对账的数据 + * @return 对账完成的数据 + */ + public XhpcTradebillPaymentCheckRecordDomain computeTradebillData(XhpcTradebillPaymentCheckRecordDomain domain) { + + if (domain.getPaymentAmount().equals(domain.getPlatformAmount())) { + domain.setStatus(2); + } else { + domain.setStatus(0); + } + return domain; + } + + + /** + * 使用微信支付SDK获取账单信息 + * + * @param billDate 账单日期,格式:2021-12-20 + * @return 账单数据 + * @throws WxPayException 异常 + */ + public WxPayFundFlowResult getWechatPayBill(String billDate) throws WxPayException { + + return this.wxPayService.downloadFundFlow(billDate, + WeixinPayConstant.ACCOUNT_TYPE_BASIC, + WeixinPayConstant.TAR_TYPE_GZIP); + } + + /** + * 使用支付宝SDK获取账单信息 + * + * @param startTime 账单开始时间 + * @param endTime 账单结束时间 + * @return 账单数据 + * @throws Exception 异常 + */ + public AlipayDataBillAccountlogQueryResponse getAliPayBill(String startTime, String endTime) throws + Exception { + + try { + AlipayClient alipayClient = new DefaultAlipayClient(aliPayProperties.getGatewayDomain(), + aliPayProperties.getAppId(), + aliPayProperties.getPrivateKey(), + aliPayProperties.getPublicKey(), + "json", "GBK", "RSA2"); + AlipayDataBillAccountlogQueryRequest request = new AlipayDataBillAccountlogQueryRequest(); + + HashMap params = new HashMap<>(); + params.put("start_time", startTime); + params.put("end_time", endTime); + params.put("page_no", "1"); + params.put("page_size", "2000"); + + request.setBizContent(JSON.toJSONString(params)); + log.debug(JSON.toJSONString(params)); + AlipayDataBillAccountlogQueryResponse response = alipayClient.execute(request); + if (response.isSuccess()) { + log.info("调用支付宝对账接口成功"); + return response; + } else { + log.debug("调用支付宝对账接口失败, 失败原因:" + response.getMsg()); + throw new AlipayApiException(response.getMsg()); + } + } catch (Exception e) { + throw new Exception(e.getMessage()); + } + } + + + @Override + public void export(HttpServletResponse response, Map params) throws Exception{ + List> list = paymentCheckRecordMapper.selectByParams(params); + + ExcelWriter writer = ExcelUtil.getWriter(true); + writer.addHeaderAlias("order_type", "订单类型(1-充值,2-退款)"); + writer.addHeaderAlias("paymengt_channel", "支付渠道(1-微信,2-支付宝)"); + + writer.addHeaderAlias("platform_order_number", "平台-订单编号"); + writer.addHeaderAlias("platform_user_id", "平台-用户帐号"); + writer.addHeaderAlias("platform_amount", "平台-支付金额"); + writer.addHeaderAlias("platform_pay_time", "平台-支付时间"); + + writer.addHeaderAlias("payment_pay_number", "支付方-订单编号"); + writer.addHeaderAlias("payment_user_id", "支付方-用户帐号"); + writer.addHeaderAlias("payment_amount", "支付方-支付金额"); + writer.addHeaderAlias("payment_pay_time", "支付方-支付时间"); + + writer.addHeaderAlias("status", "对账状态(0-待对账,1-对账错误,2-对账正确)"); + writer.addHeaderAlias("remark", "备注"); + + writer.setOnlyAlias(true); + writer.write(list, true); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setCharacterEncoding("utf-8"); + ServletOutputStream out = response.getOutputStream(); + + writer.flush(out, true); + writer.close(); + IoUtil.close(out); + } +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/utils/DownloadUtil.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/utils/DownloadUtil.java new file mode 100644 index 00000000..ab9bdf9c --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/utils/DownloadUtil.java @@ -0,0 +1,18 @@ +package com.xhpc.tradebill.utils; + +import cn.hutool.http.HttpUtil; +import com.xhpc.common.core.utils.StringUtils; + +import java.io.File; + +public class DownloadUtil { + + public static File downloadFile(String fileUrl) throws Exception { + + if (StringUtils.isEmpty(fileUrl)) { + throw new Exception("文件地址为空"); + } + String suffix = fileUrl.substring(fileUrl.lastIndexOf(".")); + return HttpUtil.downloadFileFromUrl(fileUrl, File.createTempFile("temp_", suffix)); + } +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/HDTradebillVo.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/HDTradebillVo.java new file mode 100644 index 00000000..9d15c50c --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/HDTradebillVo.java @@ -0,0 +1,96 @@ +package com.xhpc.tradebill.vo; + +import cn.hutool.core.annotation.Alias; +import com.xhpc.common.core.annotation.Excel; +import lombok.Data; + +import java.util.Date; + + +/** + * 恒大对账单对象 + */ +@Data +public class HDTradebillVo { + + @Excel(name = "订单号") + @Alias("订单号") + private String orderNo = ""; + + @Excel(name = "分账时间") + @Alias("分账时间") + private Date billDate; + + @Excel(name = "分账商户名称") + @Alias("分账商户名称") + private String billAccount = ""; + + @Excel(name = "场站名称") + @Alias("场站名称") + private String stationName = ""; + + @Excel(name = "总电量") + @Alias("总电量") + private Double chargeDegree = 0.0; + + @Excel(name = "订单电费总额") + @Alias("订单电费总额") + private Double powerAmount = 0.0; + + @Excel(name = "订单服务费总额") + @Alias("订单服务费总额") + private Double ServerAmount = 0.0; + + @Excel(name = "订单总金额") + @Alias("订单总金额") + private Double orderTotalAmount = 0.0; + + @Excel(name = "客戶实付电费") + @Alias("客戶实付电费") + private Double customerPowerAmount = 0.0; + + @Excel(name = "客户实付服务费") + @Alias("客户实付服务费") + private Double customerServerAmount = 0.0; + + @Excel(name = "客戶实付总金额") + @Alias("客戶实付总金额") + private Double customerTotalAmount = 0.0; + + @Excel(name = "运营商补贴电费") + @Alias("运营商补贴电费") + private Double operatorDiscountPowerAmount; + + @Excel(name = "运营商补贴服务费") + @Alias("运营商补贴服务费") + private Double operatorDiscountServerAmount = 0.0; + + @Excel(name = "运营商补贴总金额") + @Alias("运营商补贴总金额") + private Double operatorDiscountTotalAmount = 0.0; + + @Excel(name = "充电通补贴电费") + @Alias("充电通补贴电费") + private Double internetDiscountPowerAmount = 0.0; + + @Excel(name = "充电通补贴服务费") + @Alias("充电通补贴服务费") + private Double internetDiscountServerAmount = 0.0; + + @Excel(name = "充电通补贴总金额") + @Alias("充电通补贴总金额") + private Double internetDiscountTotalAmount = 0.0; + + @Excel(name = "充电通补贴分账实得") + @Alias("充电通补贴分账实得") + private Double internetRealAmount = 0.0; + + @Excel(name = "客戶实付分账实得") + @Alias("客戶实付分账实得") + private Double customerRealAmount = 0.0; + + @Excel(name = "总资产入账金额") + @Alias("总资产入账金额") + private Double totalAmount = 0.0; + +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/KDTradebillVo.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/KDTradebillVo.java new file mode 100644 index 00000000..6ebf5c26 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/KDTradebillVo.java @@ -0,0 +1,9 @@ +package com.xhpc.tradebill.vo; + + +import lombok.Data; + +@Data +public class KDTradebillVo { + +} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/XDTTradebillVo.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/XDTTradebillVo.java new file mode 100644 index 00000000..8027956c --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/XDTTradebillVo.java @@ -0,0 +1,133 @@ +package com.xhpc.tradebill.vo; + + +import cn.hutool.core.annotation.Alias; +import com.xhpc.common.core.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 新电途对账单对象 + */ +@Data +public class XDTTradebillVo { + + @Excel(name = "订单时间") + @Alias("订单时间") + private Date orderTime; + + @Excel(name = "订单号") + @Alias("订单号") + private String orderNo = ""; + + @Excel(name = "订单类型") + @Alias("订单类型") + private String orderType = ""; + + @Excel(name = "异常类型") + @Alias("异常类型") + private String exceptionType = ""; + + @Excel(name = "城市") + @Alias("城市") + private String city = ""; + + @Excel(name = "站点名称") + @Alias("站点名称") + private String stationName = ""; + + @Excel(name = "充电量") + @Alias("充电量") + private Double chargingDegree = 0.0; + + @Excel(name = "订单金额") + @Alias("订单金额") + private Double orderAmount = 0.0; + + @Excel(name = "运营商承担费用") + @Alias("运营商承担费用") + private Double operatorCost = 0.0; + + @Excel(name = "新电途承担费用") + @Alias("新电途承担费用") + private Double xdtCost = 0.0; + + @Excel(name = "本期新电途补贴金额") + @Alias("本期新电途补贴金额") + private Double xdtSubsidyAmount = 0.0; + + @Excel(name = "历史新电途补贴金额") + @Alias("历史新电途补贴金额") + private Double xdtHistorySubsidyAmount = 0.0; + + @Excel(name = "本期用户实付金额") + @Alias("本期用户实付金额") + private Double payAmount = 0.0; + + @Excel(name = "历史用户实付金额") + @Alias("历史用户实付金额") + private Double payHistoryAmount = 0.0; + + @Excel(name = "未结清金额") + @Alias("未结清金额") + private Double outStandingAmount = 0.0; + + @Excel(name = "坏账金额") + @Alias("坏账金额") + private Double badDebtsAmount = 0.0; + + @Excel(name = "新电途线上分润金额") + @Alias("新电途线上分润金额") + private Double xdtOnlineAmount = 0.0; + + @Excel(name = "新电途线下分润金额") + @Alias("新电途线下分润金额") + private Double xdtOfflineAmount = 0.0; + + @Excel(name = "本期支付手续费") + @Alias("本期支付手续费") + private Double handlingFeeAmount = 0.0; + + @Excel(name = "历史支付手续费") + @Alias("历史支付手续费") + private Double handlingFeeHistoryAmount = 0.0; + + @Excel(name = "平台分润方式") + @Alias("平台分润方式") + private String profitSharingMethod = ""; + + @Excel(name = "自动扣除平台活费用") + @Alias("自动扣除平台活费用") + private String autoDiscountAmount = ""; + + @Excel(name = "充电费") + @Alias("充电费") + private Double powerAmount = 0.0; + + @Excel(name = "服务费") + @Alias("服务费") + private Double serverAmount = 0.0; + + @Excel(name = "附加费") + @Alias("附加费") + private Double surchargeAmount = 0.0; + + @Excel(name = "结算状态") + @Alias("结算状态") + private String checkedStatus = ""; + + @Excel(name = "订单渠道") + @Alias("订单渠道") + private String orderSource = ""; + + @Excel(name = "结算日期") + @Alias("结算日期") + private Date checkoutDate; + + @Excel(name = "分润账号") + @Alias("分润账号") + private String profitSharingAccount = ""; +} + + diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/XJTradeBillVo.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/XJTradeBillVo.java new file mode 100644 index 00000000..9e54a4c2 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/vo/XJTradeBillVo.java @@ -0,0 +1,177 @@ +package com.xhpc.tradebill.vo; + +import cn.hutool.core.annotation.Alias; +import com.xhpc.common.core.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 小桔对账单对象 + */ +@Data +public class XJTradeBillVo { + + @Excel(name = "订单id") + @Alias("订单id") + private String orderNo = ""; + + @Excel(name = "外部订单id") + @Alias("外部订单id") + private String operatorOrderNo = ""; + + @Excel(name = "城市") + @Alias("城市") + private String city = ""; + + @Excel(name = "运营商") + @Alias("运营商") + private String operator = ""; + + @Excel(name = "商户") + @Alias("商户") + private String merchant = ""; + + @Excel(name = "充电站名称") + @Alias("充电站名称") + private String stationName = ""; + + @Excel(name = "订单充电时长(分钟)") + @Alias("订单充电时长(分钟)") + private Integer chargingTime = 0; + + @Excel(name = "订单充电量(度)") + @Alias("订单充电量(度)") + private Double chargingDegree = 0.0; + + @Excel(name = "充电前soc") + @Alias("充电前soc") + private String startSoc = ""; + + @Excel(name = "充电后soc") + @Alias("充电后soc") + private String endSoc = ""; + + @Excel(name = "挂单状态") + @Alias("挂单状态") + private String orderStatus = ""; + + @Excel(name = "充电状态") + @Alias("充电状态") + private String chargingStatus = ""; + + @Excel(name = "异常类型") + @Alias("异常类型") + private String exceptionType = ""; + + @Excel(name = "订单来源") + @Alias("订单来源") + private String orderSource = ""; + + @Excel(name = "启动方式") + @Alias("启动方式") + private String startType = ""; + + @Excel(name = "实体卡号") + @Alias("实体卡号") + private String physicalCardNo = ""; + + @Excel(name = "创建订单时间") + @Alias("创建订单时间") + private Date orderStartTime; + + @Excel(name = "充电开始时间") + @Alias("充电开始时间") + private Date chargingStartTime; + + @Excel(name = "充电完成时间") + @Alias("充电完成时间") + private Date chargingEndTime; + + @Excel(name = "账单生成时间") + @Alias("账单生成时间") + private Date billCreateTime; + + @Excel(name = "支付完成时间") + @Alias("支付完成时间") + private Date orderPayTime; + + @Excel(name = "充电枪ID") + @Alias("充电枪ID") + private Long gunId = 0L; + + @Excel(name = "充电桩类型") + @Alias("充电桩类型") + private String pileType = ""; + + @Excel(name = "活动价总额(元)") + @Alias("活动价总额(元)") + private Double orderTotalAmount = 0.0; + + @Excel(name = "电费-活动价(元)") + @Alias("电费-活动价(元)") + private Double orderPowerAmount = 0.0; + + @Excel(name = "服务费-活动价(元)") + @Alias("服务费-活动价(元)") + private Double orderServerAmount = 0.0; + + @Excel(name = "账单总金额") + @Alias("账单总金额") + private Double billAmount = 0.0; + + @Excel(name = "支付状态") + @Alias("支付状态") + private String paymentStatus = ""; + + @Excel(name = "支付渠道") + @Alias("支付渠道") + private String paymentChannel = ""; + + @Excel(name = "卡ID") + @Alias("卡ID") + private String cardID = ""; + + @Excel(name = "尖时电量") + @Alias("尖时电量") + private Double tipChargingDegree = 0.0; + + @Excel(name = "峰时电量") + @Alias("峰时电量") + private Double peakChargingDegree = 0.0; + + + @Excel(name = "平时电量") + @Alias("平时电量") + private Double flatChargingDegree = 0.0; + + @Excel(name = "谷时电量") + @Alias("谷时电量") + private Double valleyChargingDegree = 0.0; + + @Excel(name = "车型") + @Alias("车型") + private String carType = ""; + + @Excel(name = "VIN码") + @Alias("VIN码") + private String vinCode = ""; + + @Excel(name = "车牌号") + @Alias("车牌号") + private String carNo = ""; + + @Excel(name = "自编号") + @Alias("自编号") + private String serialNumber = ""; + + @Excel(name = "路线") + @Alias("路线") + private String line = ""; + + @Excel(name = "所属公司") + @Alias("所属公司") + private String company = ""; + +} + diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/banner.txt b/xhpc-modules/xhpc-tradebill/src/main/resources/banner.txt new file mode 100644 index 00000000..be49df70 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/banner.txt @@ -0,0 +1,9 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} + + ,--. +,--. ,--. | ,---. ,---. ,---. + \ `' / | .-. | | .-. | | .--' + / /. \ | | | | | '-' ' \ `--. +'--' '--' `--' `--' | |-' `---' + `--' diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-tradebill/src/main/resources/bootstrap.yml new file mode 100644 index 00000000..6565119a --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/bootstrap.yml @@ -0,0 +1,90 @@ + +# Tomcat +server: + port: 8889 + +# Spring +spring: + application: + # 应用名称 + name: xhpc-tradebill + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +logging: + level: + root: info + com.xhpc.tradebill.mapper: debug + + file: + path: "d:\\logs" + + pattern: + console: '%d{yyyy/MM/dd-HH:mm:ss} [%thread] %-5level %logger- %msg%n' + file: '%d{yyyy/MM/dd-HH:mm:ss} [%thread] %-5level %logger- %msg%n' + +wx: + pay: + appId: "wxd0a48e00319ef8a7" + mchId: "1514355771" + mchKey: "sichuanxianghuakejiyouxiangongsi" + keyPath: + + +alibaba: + pay: + gatewayDomain: "https://openapi.alipay.com/gateway.do" + serverDomain: "https://www.scxhua.cn/prod-api/xhpc-payment/alipay/notifyUrl" + publicKey: + privateKey: "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCGHX1s315EKjoIBkNiF3IxCAmvtVg+TdCDL/XmJZWdcZ23tEWmmIMsLRCLUKsaPfTEhnqD6EFJnmpJu4teDImo3aDbOoO31YFEXjMXUnTTS/dtDVEo1OecsRL+Re43KSohOkIL1TMyTuNfeIglQTuhCSZ3LOEOx4OHpYwcrLp8p1ORvAS7x35nsmjLp3oQTJo9RWfzfEaKbm6cxsWLKyr5/5eGDXrUHNC5hIDLjoJbe6iqNKyIiPJHtPZfJ36PcWa7PFvx4X+Ded32KZb2AA3p9w/HX7gn1MnRfT5NGH0k3ggxLNarDU8g6JjQYgNtmE/R8gbp99BudZNfDoSF1llNAgMBAAECggEAaTa9bSoXM/bErALt3ghyx1B8+OGVpts5F5IKoVEe/PNjPfkpIzdGwONhtUnF0cKFQaAWgWE1xuGGlO2Sumevn1Cvnw1axF+1F8Om5UcE67cPFvh5kUTlpyGrutt1tMSQjpy7r7jEf1UwP3e5pzBz7TPWf2wv635OC56uOtivPJZ+8vg7VYon/mNXQuL4AavoxfSDtvo0ad30X2fK1WKeeBtgiT4UzV6ZGZh5igKQHM4lVvmbo/jOeQD0KAod7pRe/h4FBFmCVIWwgW+I+Hnzp8A/nJezoowJ3jiTt0FodC9uBCT64ZCz5dVCryD62LDVjKBxB7cfIoQA+PxCiXr9QQKBgQD+2v38J/MlfK/XCYldclzumizwIw6T0Mv6XvYwXQHYgYDKYNF6k1LhMEUo7fP3EsPdV8h/nXmdU4qadOVm6QSJ/rGEl22yGlO7woUzTY/Ls9eknoqfMYuyI1+ICMnNxmesQbWyc0cOHh44cEF+icfJxEDAmrHGLmBVsKuLUJUuVQKBgQCGt663TF7mixghiUOcT11zC1fqG+dIcvAwHpCHfdxsniYRqnv+SLf6eC5PCkQ5aNAAl/ywOLQAWS0XgYti3LyZ4iuGIYcUE0IDDmhWl68V27iXcLIK+rBRqBGxSdk8xR+zSE8fpO4mXpxn8SH0Butex8PJ+oHTbmdXIUAXdn6HGQKBgQCvAB1rqtsRoL72ADxtCHy78u5srwXxhmyqrc6LgzIjQzn2vejaLJO6wfSbmFnwDNimAwNQbgf2ekkwqphjxBozz8qB66GNrPpWccoZYmcdT48CIUO68MCmQBf3R2GbhWPnKu/ja7kc/p1tz9eJVn70E2kLWK4+EdZgwQHqlhj6SQKBgF4AmbdpYOb5s9Li1vyhHJIEHkpLQi15lkPdb/g7SK26BNJa5b5fu5DYf2fDwCtXCZ0AcN/+EQwVLbOzPzGy2R9/g+NKTdkiPvOnAAM8QH2+HaX+ix3CI3o3DnFpGF6hJieRkzR/f3Ximryks451rZMrTWEIncKMzSstFm3Izy0xAoGBAJQaMqlzpM+QaJiytJNeqRpPWRsi0Dkf4XqJXPWLOrApSISsafZF5vk2ZOeIqRsVCBH3LdfVIJxEBAF4l/Sd2q7xC9JHawJDqa4ea7VwL68ANH2w3jcJ3j6DQqf7NIe/lSGxYF6Jt+74oRFHxN3GDSf+z91DYfZz8hQnyphKDNEJ" + appId: "2021002156615717" + certPath: "/www/wwwroot/scxhua.cn/xhpc-payment/appCertPublicKey.crt" + publicCertPath: "/www/wwwroot/scxhua.cn/xhpc-payment/alipayCertPublicKey_RSA2.crt" + rootCertPath: "/www/wwwroot/scxhua.cn/xhpc-payment/alipayRootCert.crt" + +###获取微信openid地址 +#WXGETJSCODE: "https://api.weixin.qq.com/sns/jscode2session?appid=wxb14ef93e9b7901f3&secret=b5c5672141b5930c30a1abee95a2dcbf&js_code=" +###阿里云身份证验证地址 +#VERIFYCARD: "http://idenauthen.market.alicloudapi.com/idenAuthentication" +##阿里云身份证验证地址appcode +#APPCODE: "APPCODE e26d9088b58e24af69411d5933cece47" +##小程序appid +#APPID: "wxd0a48e00319ef8a7" +##小程序绑定商户id +#MCHID: "1514355771" +##商户后台设置的key +#KEY: "sichuanxianghuakejiyouxiangongsi" +##微信小程序支付地址 +#WXPAYUNIFIEDORDER: "https://api.mch.weixin.qq.com/pay/unifiedorder" +##微信支付回调地址 +#SERVERDOMAIN: "http://www.scxhua.cn/prod-api/xhpc-payment/wx/paymentCallback" +##微信小程序支付地址 +#WXTRANSFERS: "https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers" + +##支付宝支付回调地址 +#ALIPAYPSERVERDOMAIN: "https://www.scxhua.cn/prod-api/xhpc-payment/alipay/notifyUrl" +##支付宝公钥 +#ALIPAYPUBLICKEY: +##应用私钥 +#ALIPAYPRIVATEKEY: "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCGHX1s315EKjoIBkNiF3IxCAmvtVg+TdCDL/XmJZWdcZ23tEWmmIMsLRCLUKsaPfTEhnqD6EFJnmpJu4teDImo3aDbOoO31YFEXjMXUnTTS/dtDVEo1OecsRL+Re43KSohOkIL1TMyTuNfeIglQTuhCSZ3LOEOx4OHpYwcrLp8p1ORvAS7x35nsmjLp3oQTJo9RWfzfEaKbm6cxsWLKyr5/5eGDXrUHNC5hIDLjoJbe6iqNKyIiPJHtPZfJ36PcWa7PFvx4X+Ded32KZb2AA3p9w/HX7gn1MnRfT5NGH0k3ggxLNarDU8g6JjQYgNtmE/R8gbp99BudZNfDoSF1llNAgMBAAECggEAaTa9bSoXM/bErALt3ghyx1B8+OGVpts5F5IKoVEe/PNjPfkpIzdGwONhtUnF0cKFQaAWgWE1xuGGlO2Sumevn1Cvnw1axF+1F8Om5UcE67cPFvh5kUTlpyGrutt1tMSQjpy7r7jEf1UwP3e5pzBz7TPWf2wv635OC56uOtivPJZ+8vg7VYon/mNXQuL4AavoxfSDtvo0ad30X2fK1WKeeBtgiT4UzV6ZGZh5igKQHM4lVvmbo/jOeQD0KAod7pRe/h4FBFmCVIWwgW+I+Hnzp8A/nJezoowJ3jiTt0FodC9uBCT64ZCz5dVCryD62LDVjKBxB7cfIoQA+PxCiXr9QQKBgQD+2v38J/MlfK/XCYldclzumizwIw6T0Mv6XvYwXQHYgYDKYNF6k1LhMEUo7fP3EsPdV8h/nXmdU4qadOVm6QSJ/rGEl22yGlO7woUzTY/Ls9eknoqfMYuyI1+ICMnNxmesQbWyc0cOHh44cEF+icfJxEDAmrHGLmBVsKuLUJUuVQKBgQCGt663TF7mixghiUOcT11zC1fqG+dIcvAwHpCHfdxsniYRqnv+SLf6eC5PCkQ5aNAAl/ywOLQAWS0XgYti3LyZ4iuGIYcUE0IDDmhWl68V27iXcLIK+rBRqBGxSdk8xR+zSE8fpO4mXpxn8SH0Butex8PJ+oHTbmdXIUAXdn6HGQKBgQCvAB1rqtsRoL72ADxtCHy78u5srwXxhmyqrc6LgzIjQzn2vejaLJO6wfSbmFnwDNimAwNQbgf2ekkwqphjxBozz8qB66GNrPpWccoZYmcdT48CIUO68MCmQBf3R2GbhWPnKu/ja7kc/p1tz9eJVn70E2kLWK4+EdZgwQHqlhj6SQKBgF4AmbdpYOb5s9Li1vyhHJIEHkpLQi15lkPdb/g7SK26BNJa5b5fu5DYf2fDwCtXCZ0AcN/+EQwVLbOzPzGy2R9/g+NKTdkiPvOnAAM8QH2+HaX+ix3CI3o3DnFpGF6hJieRkzR/f3Ximryks451rZMrTWEIncKMzSstFm3Izy0xAoGBAJQaMqlzpM+QaJiytJNeqRpPWRsi0Dkf4XqJXPWLOrApSISsafZF5vk2ZOeIqRsVCBH3LdfVIJxEBAF4l/Sd2q7xC9JHawJDqa4ea7VwL68ANH2w3jcJ3j6DQqf7NIe/lSGxYF6Jt+74oRFHxN3GDSf+z91DYfZz8hQnyphKDNEJ" +##支付宝appid +#ALIPAYAPPID: "2021002156615717" +##应用公钥证书路径 +#CERTPATH: "/www/wwwroot/scxhua.cn/xhpc-payment/appCertPublicKey.crt" +##支付宝公钥证书路径 +#PUBLICCERTPATH: "/www/wwwroot/scxhua.cn/xhpc-payment/alipayCertPublicKey_RSA2.crt" +##支付宝根证书路径 +#ROOTCRETPATH: "/www/wwwroot/scxhua.cn/xhpc-payment/alipayRootCert.crt" \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/logback.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/logback.xml new file mode 100644 index 00000000..05979096 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/logback.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/EtOrderMappingMapper.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/EtOrderMappingMapper.xml new file mode 100644 index 00000000..def2aa53 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/EtOrderMappingMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcChargeOrderMapper.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcChargeOrderMapper.xml new file mode 100644 index 00000000..c0aaecf5 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcChargeOrderMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcHistoryOrderMapper.xml new file mode 100644 index 00000000..ddc8b1bc --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRechargeOrderMapper.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRechargeOrderMapper.xml new file mode 100644 index 00000000..75720b88 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRechargeOrderMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRefundOrderMapper.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRefundOrderMapper.xml new file mode 100644 index 00000000..d77d588f --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRefundOrderMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcTradebillInternetCheckRecordMapper.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcTradebillInternetCheckRecordMapper.xml new file mode 100644 index 00000000..93396977 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcTradebillInternetCheckRecordMapper.xml @@ -0,0 +1,593 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, create_time, create_by, update_time, update_by, upload_id, history_order_no, + user_id, internet_name, platform_internet_serial_number, platform_charge_station, platform_start_soc, + platform_end_soc, platform_charging_degree, platform_charging_time, platform_start_time, + platform_end_time, platform_order_amount, platform_power_amount, platform_server_amount, + platform_discount_amount, platform_pay_amount, internet_serial_number, internet_charge_station, + internet_start_soc, internet_end_soc, internet_charging_degree, internet_charging_time, internet_start_time, + internet_end_time, internet_order_amount, internet_power_amount, internet_server_amount, internet_discount_amount, + internet_pay_amount, remark, `status` + + + + + + + + + + + delete + from xhpc_tradebill_internet_check_record + where id = #{id} + + + insert into xhpc_tradebill_internet_check_record (create_time, create_by, update_time, + update_by, upload_id, history_order_no, + user_id, internet_name, platform_internet_serial_number, + platform_serial_number, + platform_charge_station, platform_start_soc, + platform_end_soc, platform_charging_degree, + platform_charging_time, platform_start_time, + platform_end_time, platform_order_amount, + platform_power_amount, platform_server_amount, + platform_discount_amount, platform_pay_amount, + internet_serial_number, internet_charge_station, + internet_start_soc, + internet_end_soc, internet_charging_degree, + internet_charging_time, + internet_start_time, internet_end_time, internet_order_amount, + internet_power_amount, internet_server_amount, + internet_discount_amount, + internet_pay_amount, remark, `status`) + values (now(), #{createBy}, now(), + #{updateBy}, #{uploadId}, #{historyOrderNo}, + #{userId}, #{internetName}, + #{platformInternetSerialNumber},#{platformSerialNumber}, + #{platformChargeStation}, #{platformStartSoc}, + #{platformEndSoc}, #{platformChargingDegree}, + #{platformChargingTime}, #{platformStartTime}, + #{platformEndTime}, #{platformOrderAmount}, + #{platformPowerAmount}, #{platformServerAmount}, + #{platformDiscountAmount}, #{platformPayAmount}, + #{internetSerialNumber}, #{internetChargeStation}, + #{internetStartSoc}, + #{internetEndSoc}, #{internetChargingDegree}, + #{internetChargingTime}, + #{internetStartTime}, #{internetEndTime}, + #{internetOrderAmount}, + #{internetPowerAmount}, #{internetServerAmount}, + #{internetDiscountAmount}, + #{internetPayAmount}, #{remark}, #{status,jdbcType=SMALLINT}) + + + + insert into xhpc_tradebill_internet_check_record (create_time, create_by, update_time, + update_by, upload_id, history_order_no, + user_id, internet_name, platform_internet_serial_number, platform_serial_number, + platform_charge_station, platform_start_soc, + platform_end_soc, platform_charging_degree, + platform_charging_time, platform_start_time, + platform_end_time, platform_order_amount, + platform_power_amount, platform_server_amount, + platform_discount_amount, platform_pay_amount, + internet_serial_number, internet_charge_station, internet_start_soc, + internet_end_soc, internet_charging_degree, internet_charging_time, + internet_start_time, internet_end_time, internet_order_amount, + internet_power_amount, internet_server_amount, internet_discount_amount, + internet_pay_amount, remark, `status` + ) values + + ( + now(), #{check.createBy}, now(), + #{check.updateBy}, #{check.uploadId}, + #{check.historyOrderNo}, + #{check.userId}, #{check.internetName}, + #{check.platformInternetSerialNumber},#{check.platformSerialNumber}, + #{check.platformChargeStation}, #{check.platformStartSoc}, + #{check.platformEndSoc}, #{check.platformChargingDegree}, + #{check.platformChargingTime}, #{check.platformStartTime}, + #{check.platformEndTime}, #{check.platformOrderAmount}, + #{check.platformPowerAmount}, #{check.platformServerAmount}, + #{check.platformDiscountAmount}, #{check.platformPayAmount}, + #{check.internetSerialNumber}, #{check.internetChargeStation}, + #{check.internetStartSoc}, + #{check.internetEndSoc}, #{check.internetChargingDegree}, + #{check.internetChargingTime}, + #{check.internetStartTime}, #{check.internetEndTime}, + #{check.internetOrderAmount}, + #{check.internetPowerAmount}, #{check.internetServerAmount}, + #{check.internetDiscountAmount}, + #{check.internetPayAmount}, #{check.remark}, + #{check.status}) + + + + + + insert into xhpc_tradebill_internet_check_record + + create_time, + + create_by, + + update_time, + + update_by, + + + upload_id, + + + history_order_no, + + + user_id, + + + internet_name, + + + platform_internet_serial_number, + + + platform_charge_station, + + + platform_start_soc, + + + platform_end_soc, + + + platform_charging_degree, + + + platform_charging_time, + + + platform_start_time, + + + platform_end_time, + + + platform_order_amount, + + + platform_power_amount, + + + platform_server_amount, + + + platform_discount_amount, + + + platform_pay_amount, + + + internet_serial_number, + + + internet_charge_station, + + + internet_start_soc, + + + internet_end_soc, + + + internet_charging_degree, + + + internet_charging_time, + + + internet_start_time, + + + internet_end_time, + + + internet_order_amount, + + + internet_power_amount, + + + internet_server_amount, + + + internet_discount_amount, + + + internet_pay_amount, + + + remark, + + + `status`, + + + + now(), + + #{createBy}, + + now(), + + #{updateBy}, + + + #{uploadId}, + + + #{historyOrderNo}, + + + #{userId}, + + + #{internetName}, + + + #{platformInternetSerialNumber}, + + + #{platformChargeStation}, + + + #{platformStartSoc}, + + + #{platformEndSoc}, + + + #{platformChargingDegree}, + + + #{platformChargingTime}, + + + #{platformStartTime}, + + + #{platformEndTime}, + + + #{platformOrderAmount}, + + + #{platformPowerAmount}, + + + #{platformServerAmount}, + + + #{platformDiscountAmount}, + + + #{platformPayAmount}, + + + #{internetSerialNumber}, + + + #{internetChargeStation}, + + + #{internetStartSoc}, + + + #{internetEndSoc}, + + + #{internetChargingDegree}, + + + #{internetChargingTime}, + + + #{internetStartTime}, + + + #{internetEndTime}, + + + #{internetOrderAmount}, + + + #{internetPowerAmount}, + + + #{internetServerAmount}, + + + #{internetDiscountAmount}, + + + #{internetPayAmount}, + + + #{remark}, + + + #{status}, + + + + + update xhpc_tradebill_internet_check_record + + update_time = now(), + + update_by = #{updateBy}, + + + upload_id = #{uploadId}, + + + history_order_no = #{historyOrderNo}, + + + user_id = #{userId}, + + + internet_name = #{internetName}, + + + platform_internet_serial_number = #{platformInternetSerialNumber}, + + + platform_charge_station = #{platformChargeStation}, + + + platform_start_soc = #{platformStartSoc}, + + + platform_end_soc = #{platformEndSoc}, + + + platform_charging_degree = #{platformChargingDegree}, + + + platform_charging_time = #{platformChargingTime}, + + + platform_start_time = #{platformStartTime}, + + + platform_end_time = #{platformEndTime}, + + + platform_order_amount = #{platformOrderAmount}, + + + platform_power_amount = #{platformPowerAmount}, + + + platform_server_amount = #{platformServerAmount}, + + + platform_discount_amount = #{platformDiscountAmount}, + + + platform_pay_amount = #{platformPayAmount}, + + + internet_serial_number = #{internetSerialNumber}, + + + internet_charge_station = #{internetChargeStation}, + + + internet_start_soc = #{internetStartSoc}, + + + internet_end_soc = #{internetEndSoc}, + + + internet_charging_degree = #{internetChargingDegree}, + + + internet_charging_time = #{internetChargingTime}, + + + internet_start_time = #{internetStartTime}, + + + internet_end_time = #{internetEndTime}, + + + internet_order_amount = #{internetOrderAmount}, + + + internet_power_amount = #{internetPowerAmount}, + + + internet_server_amount = #{internetServerAmount}, + + + internet_discount_amount = #{internetDiscountAmount}, + + + internet_pay_amount = #{internetPayAmount}, + + + remark = #{remark}, + + + `status` = #{status,jdbcType=SMALLINT}, + + + where id = #{id} + + + update xhpc_tradebill_internet_check_record + set update_time = now(), + update_by = #{updateBy}, + upload_id = #{uploadId}, + history_order_no = #{historyOrderNo}, + user_id = #{userId}, + internet_name = #{internetName}, + platform_internet_serial_number = #{platformInternetSerialNumber}, + platform_charge_station = #{platformChargeStation}, + platform_start_soc = #{platformStartSoc}, + platform_end_soc = #{platformEndSoc}, + platform_charging_degree = #{platformChargingDegree}, + platform_charging_time = #{platformChargingTime}, + platform_start_time = #{platformStartTime}, + platform_end_time = #{platformEndTime}, + platform_order_amount = #{platformOrderAmount}, + platform_power_amount = #{platformPowerAmount}, + platform_server_amount = #{platformServerAmount}, + platform_discount_amount = #{platformDiscountAmount}, + platform_pay_amount = #{platformPayAmount}, + internet_serial_number = #{internetSerialNumber}, + internet_charge_station = #{internetChargeStation}, + internet_start_soc = #{internetStartSoc}, + internet_end_soc = #{internetEndSoc}, + internet_charging_degree = #{internetChargingDegree}, + internet_charging_time = #{internetChargingTime}, + internet_start_time = #{internetStartTime}, + internet_end_time = #{internetEndTime}, + internet_order_amount = #{internetOrderAmount}, + internet_power_amount = #{internetPowerAmount}, + internet_server_amount = #{internetServerAmount}, + internet_discount_amount = #{internetDiscountAmount}, + internet_pay_amount = #{internetPayAmount}, + remark = #{remark}, + `status` = #{status,jdbcType=SMALLINT} + where id = #{id} + + + + + update xhpc_tradebill_internet_check_record + set update_time = now(), + update_by = #{updateBy}, + remark = #{remark}, + `status` = #{status,jdbcType=SMALLINT} + where id = #{id} + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcTradebillPaymentCheckRecordMapper.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcTradebillPaymentCheckRecordMapper.xml new file mode 100644 index 00000000..312edeb1 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcTradebillPaymentCheckRecordMapper.xml @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + id, create_time, create_by, update_time, update_by, upload_id, order_type, payment_channel, + platform_order_number, platform_pay_number, platform_user_id, platform_amount, platform_pay_time, + payment_pay_number, payment_user_id, payment_amount, payment_pay_time, `status`, remark + + + + + + + + + + + + + delete + from xhpc_tradebill_payment_check_record + where id = #{id} + + + + insert into xhpc_tradebill_payment_check_record (create_time, create_by, update_time, + update_by, upload_id, order_type, + payment_channel, platform_order_number, platform_pay_number, + platform_user_id, platform_amount, platform_pay_time, + payment_pay_number, payment_user_id, payment_amount, + payment_pay_time, `status`, remark) + values (now(), #{createBy}, now(), + #{updateBy}, #{uploadId}, #{orderType}, + #{paymentChannel}, #{platformOrderNumber}, + #{platformPayNumber}, + #{platformUserId}, #{platformAmount}, + #{platformPayTime}, + #{paymentPayNumber}, #{paymentUserId}, + #{paymentAmount}, + #{paymentPayTime}, #{status}, #{remark}) + + + + insert into xhpc_tradebill_payment_check_record (create_time, create_by, update_time, + update_by, upload_id, order_type, + payment_channel, platform_order_number, platform_pay_number, + platform_user_id, platform_amount, platform_pay_time, + payment_pay_number, payment_user_id, payment_amount, + payment_pay_time, `status`, remark) values + + ( + now(), #{check.createBy}, now(), + #{check.updateBy}, #{check.uploadId}, + #{check.orderType}, + #{check.paymentChannel}, #{check.platformOrderNumber}, + #{check.platformPayNumber}, + #{check.platformUserId}, #{check.platformAmount}, + #{check.platformPayTime}, + #{check.paymentPayNumber}, #{check.paymentUserId}, + #{check.paymentAmount}, + #{check.paymentPayTime}, #{check.status}, + #{check.remark} + ) + + + + + + insert into xhpc_tradebill_payment_check_record + + create_time, + + create_by, + + update_time, + + update_by, + + + upload_id, + + + order_type, + + + payment_channel, + + + platform_order_number, + + + platform_pay_number, + + + platform_user_id, + + + platform_amount, + + + platform_pay_time, + + + payment_pay_number, + + + payment_user_id, + + + payment_amount, + + + payment_pay_time, + + + `status`, + + + remark, + + + + now(), + + #{createBy}, + + now(), + + #{updateBy}, + + + #{uploadId}, + + + #{orderType}, + + + #{paymentChannel}, + + + #{platformOrderNumber}, + + + #{platformPayNumber}, + + + #{platformUserId}, + + + #{platformAmount}, + + + #{platformPayTime}, + + + #{paymentPayNumber}, + + + #{paymentUserId}, + + + #{paymentAmount}, + + + #{paymentPayTime}, + + + #{status}, + + + #{remark}, + + + + + update xhpc_tradebill_payment_check_record + + update_time = now(), + + update_by = #{updateBy}, + + + upload_id = #{uploadId}, + + + order_type = #{orderType}, + + + payment_channel = #{paymentChannel}, + + + platform_order_number = #{platformOrderNumber}, + + + platform_pay_number = #{platformPayNumber}, + + + platform_user_id = #{platformUserId}, + + + platform_amount = #{platformAmount}, + + + platform_pay_time = #{platformPayTime}, + + + payment_pay_number = #{paymentPayNumber}, + + + payment_user_id = #{paymentUserId}, + + + payment_amount = #{paymentAmount}, + + + payment_pay_time = #{paymentPayTime}, + + + `status` = #{status}, + + + remark = #{remark}, + + + where id = #{id} + + + update xhpc_tradebill_payment_check_record + set update_time = now(), + update_by = #{updateBy}, + upload_id = #{uploadId}, + order_type = #{orderType}, + payment_channel = #{paymentChannel}, + platform_order_number = #{platformOrderNumber}, + platform_pay_number = #{platformPayNumber}, + platform_user_id = #{platformUserId}, + platform_amount = #{platformAmount}, + platform_pay_time = #{platformPayTime}, + payment_pay_number = #{paymentPayNumber}, + payment_user_id = #{paymentUserId}, + payment_amount = #{paymentAmount}, + payment_pay_time = #{paymentPayTime}, + `status` = #{status}, + remark = #{remark} + where id = #{id} + + + + update xhpc_tradebill_payment_check_record + set update_time = now(), + update_by = #{updateBy}, + `status` = #{status}, + remark = #{remark} + where id = #{id} + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcTradebillUploadRecordMapper.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcTradebillUploadRecordMapper.xml new file mode 100644 index 00000000..922f5f99 --- /dev/null +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcTradebillUploadRecordMapper.xml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + id, create_time, create_by, update_time, update_by, `source`, file_name, url, `type`, + `status`, del_flag, success_count, fail_count, uncheck_count, checked_count + + + + + + + + + + delete from xhpc_tradebill_upload_record + where id = #{id,jdbcType=INTEGER} + + + insert into xhpc_tradebill_upload_record (create_time, create_by, update_time, + update_by, `source`, file_name, + url, `type`, `status`, + del_flag, success_count, fail_count, + uncheck_count, checked_count) + values (now(), #{createBy,jdbcType=VARCHAR}, now(), + #{updateBy,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, + #{url,jdbcType=VARCHAR}, #{type,jdbcType=SMALLINT}, #{status,jdbcType=SMALLINT}, + #{delFlag,jdbcType=SMALLINT}, #{successCount,jdbcType=INTEGER}, #{failCount,jdbcType=INTEGER}, + #{uncheckCount,jdbcType=INTEGER}, #{checkedCount,jdbcType=INTEGER}) + + + insert into xhpc_tradebill_upload_record + + create_time, + + create_by, + + update_time, + + update_by, + + + `source`, + + + file_name, + + + url, + + + `type`, + + + `status`, + + + del_flag, + + + success_count, + + + fail_count, + + + uncheck_count, + + + checked_count, + + + + now(), + + #{createBy,jdbcType=VARCHAR}, + + now(), + + #{updateBy,jdbcType=VARCHAR}, + + + #{source,jdbcType=VARCHAR}, + + + #{fileName,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{type,jdbcType=SMALLINT}, + + + #{status,jdbcType=SMALLINT}, + + + #{delFlag,jdbcType=SMALLINT}, + + + #{successCount,jdbcType=INTEGER}, + + + #{failCount,jdbcType=INTEGER}, + + + #{uncheckCount,jdbcType=INTEGER}, + + + #{checkedCount,jdbcType=INTEGER}, + + + + + update xhpc_tradebill_upload_record + + update_time = now(), + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + `source` = #{source,jdbcType=VARCHAR}, + + + file_name = #{fileName,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + `type` = #{type,jdbcType=SMALLINT}, + + + `status` = #{status,jdbcType=SMALLINT}, + + + del_flag = #{delFlag,jdbcType=SMALLINT}, + + + success_count = #{successCount,jdbcType=INTEGER}, + + + fail_count = #{failCount,jdbcType=INTEGER}, + + + uncheck_count = #{uncheckCount,jdbcType=INTEGER}, + + + checked_count = #{checkedCount,jdbcType=INTEGER}, + + + where id = #{id,jdbcType=INTEGER} + + + update xhpc_tradebill_upload_record + set update_time = now(), + update_by = #{updateBy,jdbcType=VARCHAR}, + `source` = #{source,jdbcType=VARCHAR}, + file_name = #{fileName,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=SMALLINT}, + `status` = #{status,jdbcType=SMALLINT}, + del_flag = #{delFlag,jdbcType=SMALLINT}, + success_count = #{successCount,jdbcType=INTEGER}, + fail_count = #{failCount,jdbcType=INTEGER}, + uncheck_count = #{uncheckCount,jdbcType=INTEGER}, + checked_count = #{checkedCount,jdbcType=INTEGER} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file