增加清分模块

This commit is contained in:
panshuling321 2022-04-14 17:00:00 +08:00
parent 9987b721a5
commit b02f0bfdf3
38 changed files with 3776 additions and 4 deletions

View File

@ -687,7 +687,7 @@ CREATE TABLE `t_iccard_client_users`
`corpNo` VARCHAR(10) NOT NULL DEFAULT '0' COMMENT '所属运营商前缀' COLLATE 'utf8mb4_bin',
`corpName` VARCHAR(50) NOT NULL DEFAULT '0' COMMENT '所属运营商名称' COLLATE 'utf8mb4_bin',
`usersTime` DATETIME NULL DEFAULT NULL COMMENT '添加日期',
`status` smallint(4) DEFAULT '0' COMMENT '状态0-正常1-冻结)',
`status` smallint(4) DEFAULT '0' COMMENT '状态0-正常1-冻结)',
PRIMARY KEY (`usersID`),
UNIQUE INDEX `usersName` (`usersName`)
) COMMENT ='发卡客户端用户表'
@ -808,8 +808,8 @@ CREATE TABLE `xhpc_activity_cash`
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
`receive_count` int(9) DEFAULT '0' COMMENT '领取次数',
`auto_receive` smallint(2) DEFAULT '0' COMMENT '是否自动领取0-否1-是)',
`auto_status` smallint(2) DEFAULT '0' COMMENT '是否自动发送完成0-未完成1-已完成)',
`auto_receive` smallint(2) DEFAULT '0' COMMENT '是否自动领取0-否1-是)',
`auto_status` smallint(2) DEFAULT '0' COMMENT '是否自动发送完成0-未完成1-已完成)',
`amount` decimal(4, 2) DEFAULT '0' COMMENT '红包金额',
`app_user_list` text COMMENT 'C端用户ID-1表示全部',
`com_user_list` text COMMENT '社区用户ID列表-1表示全部',
@ -881,7 +881,8 @@ CREATE TABLE `xhpc_activity_formula`
`activity_id` int(11) DEFAULT NULL COMMENT '活动ID',
`start_time` time DEFAULT NULL COMMENT '开始时间',
`end_time` time DEFAULT NULL COMMENT '结束时间',
`service_price` decimal(10, 2) DEFAULT NULL COMMENT '服务费',
`power_price` decimal(10, 2) DEFAULT NULL COMMENT '电费',
`service_price` decimal(10, 2) DEFAULT null COMMENT '服务费',
`compute_formula` varchar(200) DEFAULT NULL COMMENT '计算公式',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
@ -912,6 +913,7 @@ CREATE TABLE `xhpc_activity_internet`
`internet_name` varchar(64) DEFAULT NULL COMMENT '流量方名称',
`compute_type` smallint(4) DEFAULT NULL COMMENT '计算类型1-总金额2-服务费3-电量)',
`compute_formula` varchar(200) DEFAULT NULL COMMENT '默认计算公式',
`power_price` decimal(10, 2) DEFAULT NULL COMMENT '默认电费',
`service_price` decimal(10, 2) DEFAULT NULL COMMENT '默认服务费',
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
@ -941,3 +943,129 @@ CREATE TABLE `xhpc_activity_record`
PRIMARY KEY (`activity_record_id`)
) ENGINE=InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT='活动参与领取表';
CREATE TABLE `xhpc_clearing_bank`
(
`clearing_bank_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '提现银行记录ID',
`operator_id` bigint(20) DEFAULT NULL COMMENT '运营商ID',
`operator_name` varchar(200) DEFAULT NULL COMMENT '运营商名称',
`area_code` int(10) DEFAULT NULL COMMENT '地址code',
`bank_name` varchar(200) DEFAULT NULL COMMENT '开户行名称',
`operator_account` varchar(200) DEFAULT NULL COMMENT '运营商收款账户名称',
`bank_no` varchar(64) DEFAULT NULL COMMENT '收款卡号',
`address` varchar(200) DEFAULT NULL COMMENT '地址',
`contact_name` varchar(64) DEFAULT NULL COMMENT '联系人',
`contact_phone` varchar(16) DEFAULT NULL COMMENT '联系电话',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`status` int(6) DEFAULT NULL COMMENT '状态1-正常)',
`del_flag` int(6) DEFAULT NULL COMMENT '是否删除0-正常2-已删除)',
`tenant_id` varchar(16) DEFAULT NULL COMMENT '租户ID',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`clearing_bank_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='清分提现银行账户信息表';
CREATE TABLE `xhpc_clearing_checkout`
(
`clearing_checkout_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '结算记录ID',
`clearing_bank_id` bigint(20) DEFAULT NULL COMMENT '收款账号信息',
`apply_amount` decimal(10, 2) DEFAULT NULL COMMENT '申请金额',
`handling_fee` decimal(10, 2) DEFAULT NULL COMMENT '手续费',
`bank_fee` decimal(10, 2) DEFAULT NULL COMMENT '银行手续费',
`received_amount` decimal(10, 2) DEFAULT NULL COMMENT '到账金额',
`status` int(6) DEFAULT NULL COMMENT '状态0-已审核待清分1-提现中2-审核失败3-审核成功4-转账失败5-转账成功6-提现完成)',
`del_flag` int(2) DEFAULT '0' COMMENT '删除标识0-正常2-删除)',
`operator_id` bigint(20) DEFAULT NULL COMMENT '运营商ID',
`tenant_id` varchar(16) DEFAULT NULL COMMENT '租户ID',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`check_by` varchar(64) DEFAULT NULL COMMENT '审核人',
`check_time` datetime DEFAULT NULL COMMENT '审核时间',
PRIMARY KEY (`clearing_checkout_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='清分提现订单表';
CREATE TABLE `xhpc_clearing_history_order`
(
`clearing_order_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '清分订单id',
`charging_station_id` bigint(20) DEFAULT NULL COMMENT '电站id',
`charge_order_id` bigint(20) DEFAULT NULL COMMENT '充电订单id',
`user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
`terminal_id` bigint(20) DEFAULT NULL COMMENT '终端id',
`serial_number` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '订单编号',
`internet_serial_number` varchar(30) DEFAULT NULL COMMENT '流量方订单号',
`power_price_total` decimal(10, 2) DEFAULT NULL COMMENT '总电费',
`service_price_total` decimal(10, 2) DEFAULT NULL COMMENT '总服务费',
`total_price` decimal(10, 2) DEFAULT '0.00' COMMENT '订单总价',
`promotion_discount` decimal(10, 2) DEFAULT '0.00' COMMENT '电站活动抵扣--抵扣的总金额',
`act_price` decimal(10, 2) DEFAULT '0.00' COMMENT '实际价格-用户支付的钱',
`act_power_price` decimal(10, 2) DEFAULT '0.00' COMMENT '实收电费-运营商电费',
`act_service_price` decimal(10, 2) DEFAULT '0.00' COMMENT '实收服务费-运营商服务费',
`internet_commission` decimal(10, 2) DEFAULT '0.00' COMMENT '流量方总金额抽成',
`internet_svc_commission` decimal(10, 2) DEFAULT '0.00' COMMENT '流量方服务费抽成',
`platform_commission` decimal(10, 2) DEFAULT '0.00' COMMENT '平台总金额抽成',
`platform_svc_commisssion` decimal(10, 2) DEFAULT '0.00' COMMENT '平台服务费抽成',
`operation_commission` decimal(10, 2) DEFAULT '0.00' COMMENT '运维总抽成',
`operation_svc_commission` decimal(10, 2) DEFAULT '0.00' COMMENT '运维服务费抽成',
`start_soc` varchar(10) CHARACTER SET utf8 DEFAULT NULL COMMENT '开始充电soc',
`end_soc` varchar(10) CHARACTER SET utf8 DEFAULT NULL COMMENT '结束时soc',
`reconciliation_status` int(10) DEFAULT NULL COMMENT '对账状态0待确认 1已确认2待提交3待审核',
`sorting_status` int(10) DEFAULT '0' COMMENT '清分状态0待清分 1清分在途2已提现3待提交4待审核',
`type` tinyint(2) DEFAULT NULL COMMENT '1 自动结算 2 平台结算',
`status` int(10) DEFAULT '0' COMMENT '状态0正常 1停用',
`del_flag` int(2) DEFAULT '0' COMMENT '删除标志0代表存在 2代表删除',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`create_by` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建者',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`update_by` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT '更新者',
`remark` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '备注',
`state` int(2) DEFAULT '0' COMMENT '0未统计 1小时统计 2 其他统计',
`vin_normal` varchar(100) DEFAULT NULL COMMENT 'VIN 码',
`search_value` varchar(255) DEFAULT NULL,
`operator_id_evcs` varchar(50) DEFAULT NULL COMMENT '运营商在EVCS分配的唯一OperatorID',
`charge_model_evcs` int(11) DEFAULT NULL COMMENT '终端客户开启充电方式',
`connector_power_evcs` double DEFAULT NULL COMMENT '接口额定功率',
`meter_value_end_evcs` double DEFAULT NULL COMMENT '电表总起值',
`meter_value_start_evcs` double DEFAULT NULL COMMENT '电表总结束值',
`operator_id3rdpty_evcs` varchar(50) DEFAULT NULL COMMENT '流量方OperatorID',
`start_time` datetime DEFAULT NULL,
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
`stop_reason_evcs` int(11) DEFAULT NULL,
`total_power` double(10, 4) DEFAULT NULL COMMENT '电量',
`user_name_evcs` varchar(100) DEFAULT NULL,
`phone` varchar(50) DEFAULT NULL,
`evcs_order_no` varchar(255) DEFAULT NULL COMMENT '互联网订单流水号',
`confirm_Result` int(4) DEFAULT '-1' COMMENT '-1:未推送/推送失败 0:成功 1:争议交易 299:自定义',
`rate_model_id` bigint(20) DEFAULT NULL,
`charging_mode` varchar(255) DEFAULT NULL COMMENT '充电方式',
`internet_degree_commission` decimal(10,2) DEFAULT NULL COMMENT '流量方电量抽成',
`source` int(10) DEFAULT NULL COMMENT '订单来源0 C端用户 1 流量方用户 2社区用户 3B端用户',
`tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户id',
`operator_id` bigint(20) DEFAULT NULL COMMENT '运营商ID',
`operator_name` varchar(200) DEFAULT NULL COMMENT '运营商名称',
`clearing_checkout_id` bigint(20) DEFAULT NULL COMMENT '清算记录ID',
`check_status` int(4) DEFAULT NULL COMMENT '审核状态0-未审核1-审核不通过2-审核通过)',
`check_by` varchar(64) DEFAULT NULL COMMENT '审核人',
`check_time` datetime DEFAULT NULL COMMENT '审核时间',
PRIMARY KEY (`clearing_order_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='历史订单清分审核表';
CREATE TABLE `xhpc_clearing_receipt`
(
`clearing_receipt_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '回执图片ID',
`type` int(4) DEFAULT NULL COMMENT '文件类型1-图片2-Excel',
`name` varchar(100) DEFAULT NULL COMMENT '文件名称',
`url` varchar(200) DEFAULT NULL COMMENT '文件地址',
`clearing_checkout_ids` varchar(200) DEFAULT NULL COMMENT '提现单ID',
`create_time` datetime DEFAULT NULL COMMENT '上传时间',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
PRIMARY KEY (`clearing_receipt_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='清分银行回执信息表';

View File

@ -26,6 +26,7 @@
<module>xhpc-tenant</module>
<module>xhpc-activity</module>
<module>xhpc-log</module>
<module>xhpc-clearing</module>
</modules>
<artifactId>xhpc-modules</artifactId>

35
xhpc-modules/xhpc-clearing/.gitignore vendored Normal file
View File

@ -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/

View File

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>xhpc-modules</artifactId>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xhpc-clearing</artifactId>
<description>
清分服务
</description>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.6</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- RuoYi Common DataSource -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-datasource</artifactId>
</dependency>
<!-- RuoYi Common Core -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-core</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>xhpc-common</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.12</version>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.10.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-log</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,28 @@
package com.xhpc;
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.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableConfigurationProperties
@ConfigurationPropertiesScan(basePackages = {"com.xhpc.clearing.config"})
@EnableScheduling
@EnableCustomConfig
@EnableRyFeignClients
@EnableFeignClients
@SpringBootApplication
@MapperScan("com.xhpc.clearing.mapper")
public class XhpcClearingApplication {
public static void main(String[] args) {
SpringApplication.run(XhpcClearingApplication.class, args);
}
}

View File

@ -0,0 +1,24 @@
package com.xhpc.clearing.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;
}

View File

@ -0,0 +1,95 @@
package com.xhpc.clearing.controller;
import com.xhpc.clearing.domain.XhpcClearingBankDomain;
import com.xhpc.clearing.service.XhpcClearingBankService;
import com.xhpc.common.core.domain.R;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.common.log.annotation.Log;
import com.xhpc.common.log.enums.BusinessType;
import com.xhpc.common.util.LogUserUtils;
import com.xhpc.system.api.model.LoginUser;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/clearing/bank")
public class XhpcClearingBankController extends BaseController {
@Resource
XhpcClearingBankService bankService;
@Resource
LogUserUtils logUserUtils;
@GetMapping("/getPage")
public TableDataInfo getPage(HttpServletRequest request,
String status) {
LoginUser loginUser = logUserUtils.getLogUser(request);
startPage();
Map<String, Object> params = new HashMap<>();
params.put("tenantId", loginUser.getTenantId());
params.put("status", status);
return getDataTable(bankService.getPage(params));
}
@GetMapping("/detail")
public R getDetail(@RequestParam("bankId") Long bankId) {
return R.ok(bankService.getDomainByPk(bankId));
}
@Log(title = "清分管理-发送绑定银行卡验证短信", businessType = BusinessType.INSERT)
@PostMapping("/sendBindSms")
public R sendBindBankSms(String phone){
return R.ok(bankService.sendBindBankSms(phone));
}
@Log(title = "清分管理-发送提现到银行卡验证短信", businessType = BusinessType.INSERT)
@PostMapping("/sendCashSms")
public R sendCashSms(String phone){
return R.ok(bankService.sendCashSms(phone));
}
@Log(title = "清分管理-增加清分转账银行信息", businessType = BusinessType.INSERT)
@PostMapping("/")
public R insertDomain(HttpServletRequest request, @RequestBody XhpcClearingBankDomain domain) {
LoginUser loginUser = logUserUtils.getLogUser(request);
domain.setCreateBy(loginUser.getUserid().toString());
domain.setUpdateBy(loginUser.getUserid().toString());
domain.setTenantId(loginUser.getTenantId());
return R.ok(bankService.insertDomain(domain));
}
@Log(title = "清分管理-更新清分转账银行信息", businessType = BusinessType.UPDATE)
@PutMapping("/detail")
public R updateDomain(HttpServletRequest request, @RequestBody XhpcClearingBankDomain domain) {
LoginUser loginUser = logUserUtils.getLogUser(request);
domain.setUpdateBy(loginUser.getUserid().toString());
return R.ok(bankService.updateDomain(domain));
}
@Log(title = "清分管理-删除现金红包活动", businessType = BusinessType.DELETE)
@DeleteMapping("/{bankId}")
public R deleteDomainByPk(@PathVariable("bankId") Long bankId) {
return R.ok(bankService.deleteByPk(bankId));
}
}

View File

@ -0,0 +1,125 @@
package com.xhpc.clearing.controller;
import com.xhpc.clearing.domain.XhpcClearingCheckoutDomain;
import com.xhpc.clearing.service.XhpcClearingCheckoutService;
import com.xhpc.clearing.vo.ClearingReceiptVo;
import com.xhpc.common.core.domain.R;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.common.log.annotation.Log;
import com.xhpc.common.log.enums.BusinessType;
import com.xhpc.common.util.LogUserUtils;
import com.xhpc.system.api.model.LoginUser;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/clearing/checkout")
public class XhpcClearingCheckoutController extends BaseController {
@Resource
XhpcClearingCheckoutService checkoutService;
@Resource
LogUserUtils logUserUtils;
@GetMapping("/getPage")
public TableDataInfo getPage(HttpServletRequest request,
String status,
String operatorId,
String startTime,
String endTime) {
LoginUser loginUser = logUserUtils.getLogUser(request);
startPage();
Map<String, Object> params = new HashMap<>();
params.put("tenantId", loginUser.getTenantId());
params.put("status", status);
params.put("operatorId", operatorId);
params.put("startTime", startTime);
params.put("endTime", endTime);
return getDataTable(checkoutService.getPage(params));
}
@GetMapping("/detail")
public R getDetail(@RequestParam("checkoutId") Long checkoutId) {
return R.ok(checkoutService.getDomainByPk(checkoutId));
}
@GetMapping("/temp")
public R getTmpCheckoutData(HttpServletRequest request) {
LoginUser loginUser = logUserUtils.getLogUser(request);
return R.ok(checkoutService.getTmpCheckoutData(loginUser.getSysUser().getOperatorId()));
}
@Log(title = "清分管理-新增提现申请", businessType = BusinessType.INSERT)
@PostMapping("/")
public R insertDomain(HttpServletRequest request, @RequestBody XhpcClearingCheckoutDomain domain) {
LoginUser loginUser = logUserUtils.getLogUser(request);
domain.setCreateBy(loginUser.getUserid().toString());
domain.setUpdateBy(loginUser.getUserid().toString());
domain.setTenantId(loginUser.getTenantId());
return R.ok(checkoutService.insertDomain(domain));
}
/**
* 导出银行转账单
*
* @param response
* @throws IOException
*/
@Log(title = "清分管理-导出待提现订单", businessType = BusinessType.INSERT)
@PostMapping("/bankExport")
public void getBankExport(HttpServletResponse response, String checkoutIds) throws IOException {
checkoutService.bankExport(response, checkoutIds);
}
/**
* 导出提现单订单记录
*
* @param response
* @throws IOException
*/
@Log(title = "清分管理-导出提现记录", businessType = BusinessType.INSERT)
@PostMapping("/orderExport")
public void getOrderExport(HttpServletResponse response, String checkoutIds) throws IOException {
checkoutService.orderExport(response, checkoutIds);
}
@Log(title = "清分管理-导入银行回执", businessType = BusinessType.INSERT)
@PostMapping("/importReceipt")
public R importReceipt(HttpServletRequest request, @RequestBody ClearingReceiptVo receiptVo) throws Exception {
LoginUser loginUser = logUserUtils.getLogUser(request);
receiptVo.setCreateBy(loginUser.getUserid().toString());
return R.ok(checkoutService.insertReceipt(receiptVo));
}
@GetMapping("/getListPage")
public TableDataInfo getListPage(String phone, String transactionNumber, @RequestParam("status") Integer status, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime, @RequestParam("userId") Long userId, Integer type,
String affiliationOrganization, String evcsOrderNo, String plateNum, Integer internetId, String internetSerialNumber, String terminalName, String vinCode, String overStartTime, String overEndTime, Long personnelId, Integer confirmResult, Integer checkoutId) {
List<Map<String, Object>> listPage = checkoutService.getListPage(phone, transactionNumber, status, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, affiliationOrganization, evcsOrderNo, plateNum, internetId, internetSerialNumber, terminalName, vinCode, overStartTime, overEndTime, personnelId, confirmResult, checkoutId);
return getDataTable(listPage);
}
}

View File

@ -0,0 +1,135 @@
package com.xhpc.clearing.controller;
import com.alibaba.fastjson.JSON;
import com.xhpc.clearing.domain.XhpcClearingCheckoutDomain;
import com.xhpc.clearing.service.XhpcClearingCheckoutService;
import com.xhpc.clearing.service.XhpcClearingHistoryOrderService;
import com.xhpc.clearing.vo.ClearingOrderVo;
import com.xhpc.common.core.domain.R;
import com.xhpc.common.core.exception.CustomException;
import com.xhpc.common.core.utils.StringUtils;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.common.log.annotation.Log;
import com.xhpc.common.log.enums.BusinessType;
import com.xhpc.common.util.LogUserUtils;
import com.xhpc.system.api.model.LoginUser;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/clearing/order")
public class XhpcClearingHistoryOrderController extends BaseController {
@Resource
XhpcClearingHistoryOrderService orderService;
@Resource
LogUserUtils logUserUtils;
@GetMapping("/getPage")
public TableDataInfo getUnclearingPage(HttpServletRequest request,
String startTime,
String endTime,
String orderNo,
String userType,
String internetName,
String operatorId,
String stationId) {
// LoginUser loginUser = logUserUtils.getLogUser(request);
startPage();
Map<String, Object> params = new HashMap<>();
// params.put("tenantId", loginUser.getTenantId());
params.put("startTime", startTime);
params.put("endTime", endTime);
params.put("orderNo", orderNo);
params.put("userType", userType);
params.put("internetName", internetName);
params.put("operatorId", operatorId);
params.put("stationId", stationId);
return getDataTable(orderService.getPage(params));
}
@Log(title = "清分管理-审核待清分清单", businessType = BusinessType.UPDATE)
@PutMapping("/check")
public R updateDomainConfig(HttpServletRequest request, @RequestBody ClearingOrderVo domain) {
LoginUser loginUser = logUserUtils.getLogUser(request);
domain.setCheckBy(loginUser.getUserid().toString());
return R.ok(orderService.checkDomainList(domain));
}
@Log(title = "清分管理-导出待清分清单", businessType = BusinessType.UPDATE)
@PostMapping("/export")
public void getExport(HttpServletResponse response,
HttpServletRequest request,
String startTime,
String endTime,
String orderNo,
String userType,
String internetName,
String operatorId,
String stationId,
String orderIds) throws IOException {
LoginUser loginUser = logUserUtils.getLogUser(request);
Map<String, Object> params = new HashMap<>();
params.put("tenantId", loginUser.getTenantId());
params.put("startTime", startTime);
params.put("endTime", endTime);
params.put("orderNo", orderNo);
params.put("userType", userType);
params.put("internetName", internetName);
params.put("operatorId", operatorId);
params.put("stationId", stationId);
params.put("orderIds", orderIds);
orderService.export(response, params);
}
// ============================== 清分 ============================
@GetMapping("/getOrderPage")
public TableDataInfo getOrderPage(HttpServletRequest request, String operatorId){
LoginUser loginUser = logUserUtils.getLogUser(request);
startPage();
Map<String, Object> params = new HashMap<>();
params.put("tenantId", loginUser.getTenantId());
if(StringUtils.isEmpty(operatorId)){
params.put("operatorId", loginUser.getSysUser().getOperatorId());
}else {
params.put("operatorId", operatorId);
}
if(StringUtils.isEmpty(params.get("operatorId").toString())){
throw new CustomException("缺少运营商ID");
}
return getDataTable(orderService.getOrderPage(params));
}
@GetMapping("/getOperatorData")
public R getOperatorData(HttpServletRequest request, String operatorId){
LoginUser loginUser = logUserUtils.getLogUser(request);
Map<String, Object> params = new HashMap<>();
params.put("tenantId", loginUser.getTenantId());
if(StringUtils.isEmpty(operatorId)){
params.put("operatorId", loginUser.getSysUser().getOperatorId());
}else {
params.put("operatorId", operatorId);
}
if(StringUtils.isEmpty(params.get("operatorId").toString())){
throw new CustomException("缺少运营商ID");
}
return R.ok(orderService.getOperatorData(params));
}
}

View File

@ -0,0 +1,106 @@
package com.xhpc.clearing.domain;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* xhpc_clearing_bank
* @author
*/
@Data
public class XhpcClearingBankDomain implements Serializable {
/**
* 提现银行记录ID
*/
private Long clearingBankId;
/**
* 运营商ID
*/
private Long operatorId;
/**
* 运营商名称
*/
private String operatorName;
/**
* 地址code
*/
private Integer areaCode;
/**
* 开户行名称
*/
private String bankName;
/**
* 运营商收款账户名称
*/
private String operatorAccount;
/**
* 收款卡号
*/
private String bankNo;
/**
* 地址
*/
private String address;
/**
* 联系人
*/
private String contactName;
/**
* 联系电话
*/
private String contactPhone;
/**
* 备注
*/
private String remark;
/**
* 状态1-正常
*/
private Integer status;
/**
* 是否删除0-正常2-已删除
*/
private Integer delFlag;
/**
* 租户ID
*/
private String tenantId;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
private String code;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,101 @@
package com.xhpc.clearing.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* xhpc_clearing_checkout
* @author
*/
@Data
public class XhpcClearingCheckoutDomain implements Serializable {
/**
* 结算记录ID
*/
private Long clearingCheckoutId;
/**
* 收款账号信息
*/
private Long clearingBankId;
/**
* 申请金额
*/
private BigDecimal applyAmount;
/**
* 手续费
*/
private BigDecimal handlingFee;
/**
* 银行手续费
*/
private BigDecimal bankFee;
/**
* 到账金额
*/
private BigDecimal receivedAmount;
/**
* 状态0-已审核待清分1-提现中2-审核失败3-审核成功4-转账失败5-转账成功6-提现完成
*/
private Integer status;
/**
* 删除标识0-正常2-删除
*/
private Integer delFlag;
private Long operatorId;
private String operatorName;
/**
* 租户ID
*/
private String tenantId;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 审核人
*/
private String checkBy;
/**
* 审核时间
*/
private Date checkTime;
private XhpcClearingBankDomain clearingBank;
private String code;
private String clearingOrderIds;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,305 @@
package com.xhpc.clearing.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* xhpc_clearing_history_order
* @author
*/
@Data
public class XhpcClearingHistoryOrderDomain implements Serializable {
/**
* 清分订单id
*/
private Long clearingOrderId;
/**
* 电站id
*/
private Long chargingStationId;
/**
* 充电订单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;
/**
* 流量方OperatorID
*/
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:争议交易 299:自定义
*/
private Integer confirmResult;
private Long rateModelId;
/**
* 充电方式
*/
private String chargingMode;
/**
* 流量方电量抽成
*/
private BigDecimal internetDegreeCommission;
/**
* 订单来源0 C端用户 1 流量方用户 2社区用户 3B端用户
*/
private Integer source;
/**
* 租户id
*/
private String tenantId;
/**
* 运营商ID
*/
private Long operatorId;
/**
* 运营商名称
*/
private String operatorName;
/**
* 清算记录ID
*/
private Long clearingCheckoutId;
/**
* 审核状态0-未审核1-审核不通过2-审核通过
*/
private Integer checkStatus;
/**
* 审核人
*/
private String checkBy;
/**
* 审核时间
*/
private Date checkTime;
private String stationName;
private String sourceName;
private String chargingModeName;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,49 @@
package com.xhpc.clearing.domain;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* xhpc_clearing_receipt
* @author
*/
@Data
public class XhpcClearingReceiptDomain implements Serializable {
/**
* 回执图片ID
*/
private Long clearingReceiptId;
/**
* 文件类型1-图片2-Excel
*/
private Integer type;
/**
* 文件名称
*/
private String name;
/**
* 文件地址
*/
private String url;
/**
* 提现单ID
*/
private String clearingCheckoutIds;
/**
* 上传时间
*/
private Date createTime;
/**
* 创建人
*/
private String createBy;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,277 @@
package com.xhpc.clearing.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;
/**
* 充电订单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;
/**
* 流量方OperatorID
*/
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:争议交易 299:自定义
*/
private Integer confirmResult;
private Long rateModelId;
/**
* 充电方式
*/
private String chargingMode;
/**
* 流量方电量抽成
*/
private BigDecimal internetDegreeCommission;
/**
* 订单来源0 C端用户 1 流量方用户 2社区用户 3B端用户
*/
private Integer source;
/**
* 租户id
*/
private String tenantId;
private String stationName;
private Long operatorId;
private String operatorName;
private String sourceName;
private String chargingModeName;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,28 @@
package com.xhpc.clearing.mapper;
import com.xhpc.clearing.domain.XhpcClearingBankDomain;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface XhpcClearingBankMapper {
int deleteByPrimaryKey(Long clearingBankId);
int insert(XhpcClearingBankDomain record);
XhpcClearingBankDomain selectByPrimaryKey(Long clearingBankId);
int updateByPrimaryKey(XhpcClearingBankDomain record);
int deleteLogicByPrimaryKey(Long clearingBankId);
int deleteLogicByOperatorId(Long operatorId);
List<XhpcClearingBankDomain> selectByParams(Map<String, Object> params);
XhpcClearingBankDomain selectOneByOperatorId(@Param("operatorId")String operatorId);
Map<String, Object> selectOneMapByOperatorId(@Param("operatorId")String operatorId);
}

View File

@ -0,0 +1,34 @@
package com.xhpc.clearing.mapper;
import com.xhpc.clearing.domain.XhpcClearingCheckoutDomain;
import com.xhpc.clearing.vo.CheckoutBankVo;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
public interface XhpcClearingCheckoutMapper {
int deleteByPrimaryKey(Long clearingCheckoutId);
int insert(XhpcClearingCheckoutDomain record);
XhpcClearingCheckoutDomain selectByPrimaryKey(Long clearingCheckoutId);
int updateByPrimaryKey(XhpcClearingCheckoutDomain record);
List<XhpcClearingCheckoutDomain> selectByParams(@Param("params") Map<String, Object> params);
int deleteLogicByPrimaryKey(Long clearingCheckoutId);
boolean checkByPrimaryKey(XhpcClearingCheckoutDomain domain);
boolean updateStatusByPrimaryKey(XhpcClearingCheckoutDomain domain);
BigDecimal selectAmountByStatus(@Param("tenantId")String tenantId, @Param("operatorId")String operatorId, @Param("status")Integer status);
List<CheckoutBankVo> selectOrderMapByCheckoutIds(@Param("checkoutIds")String checkoutIds);
int updateStatusByIds(@Param("checkoutIds")String checkoutIds, @Param("status")Integer status);
}

View File

@ -0,0 +1,53 @@
package com.xhpc.clearing.mapper;
import com.xhpc.clearing.domain.XhpcClearingHistoryOrderDomain;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
public interface XhpcClearingHistoryOrderMapper {
int deleteLogicByPrimaryKey(Long clearingOrderId);
int deleteByPrimaryKey(Long clearingOrderId);
int insertBatch(@Param("domainList") List<XhpcClearingHistoryOrderDomain> domainList);
int insert(XhpcClearingHistoryOrderDomain record);
XhpcClearingHistoryOrderDomain selectByPrimaryKey(Long clearingOrderId);
int updateByPrimaryKey(XhpcClearingHistoryOrderDomain record);
List<XhpcClearingHistoryOrderDomain> getListPage(@Param("params") Map params);
int updateStatusBatchByOrderIds(@Param("orderIds") String orderIds, @Param("status") Integer status, @Param("checkBy")String checkBy);
BigDecimal selectCheckedAmount(@Param("operatorId")String operatorId);
Map<String, Object> selectCashAmount(@Param("operatorId")String operatorId);
List<Map<String, Object>> selectOrderPage(@Param("params") Map<String, Object> params);
List<XhpcClearingHistoryOrderDomain> selectOrderListByOperator(@Param("operatorId")String operatorId);
int updateCheckoutByOperator(@Param("operatorId")Long operatorId, @Param("checkoutId")Long checkoutId);
int updateCheckoutByOrderId(@Param("orderIds")String orderIds, @Param("checkoutId")Long checkoutId);
/**
* 获取登陆用户信息
*/
Map<String, Object> getLandUser(@Param("userId")Long userId);
/**
* 历史订单记录PC
* @return
*/
List<Map<String,Object>> getOrderListPage(@Param("phone")String phone,@Param("transactionNumber")String transactionNumber,@Param("status")Integer status,@Param("chargingStationName")String chargingStationName,@Param("operatorId")Long operatorId,@Param("source")Integer source,@Param("beginStartTime")String beginStartTime,@Param("beginEndTime")String beginEndTime,@Param("userId")Long userId,@Param("type")Integer type,@Param("number")Integer number,@Param("affiliationOrganization")String affiliationOrganization,@Param("evcsOrderNo")String evcsOrderNo,@Param("plateNum")String plateNum,@Param("internetId")Integer internetId,@Param("internetSerialNumber")String internetSerialNumber,@Param("terminalName")String terminalName,@Param("vinCode")String vinCode,@Param("overStartTime")String overStartTime,@Param("overEndTime")String overEndTime,@Param("personnelId")Long personnelId,@Param("confirmResult")Integer confirmResult,@Param("tenantId")String tenantId,@Param("isNotNull")Integer isNotNull, @Param("checkoutId")Integer checkoutId);
}

View File

@ -0,0 +1,18 @@
package com.xhpc.clearing.mapper;
import com.xhpc.clearing.domain.XhpcClearingReceiptDomain;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface XhpcClearingReceiptMapper {
int deleteByPrimaryKey(Long clearingReceiptId);
int insert(XhpcClearingReceiptDomain record);
XhpcClearingReceiptDomain selectByPrimaryKey(Long clearingReceiptId);
int deleteByCheckoutId(@Param("checkoutId")Long checkoutId);
int insretBatch(List<XhpcClearingReceiptDomain> domainList);
}

View File

@ -0,0 +1,24 @@
package com.xhpc.clearing.mapper;
import com.xhpc.clearing.domain.XhpcHistoryOrderDomain;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
/**
* 历史订单信息 数据层
*
* @author ruoyi
*/
public interface XhpcHistoryOrderMapper {
List<XhpcHistoryOrderDomain> selectUnsyncOrderList();
int updateStatusBatchByOrderIds(@Param("orderIds") List<Long> orderIds, @Param("status") Integer status);
BigDecimal selectUnclearingAmount(@Param("operatorId")String operatorId);
}

View File

@ -0,0 +1,23 @@
package com.xhpc.clearing.service;
import com.xhpc.clearing.domain.XhpcClearingBankDomain;
import java.util.List;
import java.util.Map;
public interface XhpcClearingBankService {
List<XhpcClearingBankDomain> getPage(Map<String, Object> params);
XhpcClearingBankDomain getDomainByPk(Long bankId);
boolean insertDomain(XhpcClearingBankDomain domain);
boolean updateDomain(XhpcClearingBankDomain domain);
boolean deleteByPk(Long bankId);
boolean sendBindBankSms(String phone);
boolean sendCashSms(String phone);
}

View File

@ -0,0 +1,35 @@
package com.xhpc.clearing.service;
import com.xhpc.clearing.domain.XhpcClearingCheckoutDomain;
import com.xhpc.clearing.domain.XhpcClearingHistoryOrderDomain;
import com.xhpc.clearing.vo.ClearingReceiptVo;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
public interface XhpcClearingCheckoutService {
List<XhpcClearingCheckoutDomain> getPage(Map<String, Object> params);
XhpcClearingCheckoutDomain getDomainByPk(Long checkoutId);
Map<String, Object> getTmpCheckoutData(Long operatorId);
boolean insertDomain(XhpcClearingCheckoutDomain domain);
void bankExport(HttpServletResponse response, String checkoutIds) throws IOException;
void orderExport(HttpServletResponse response, String checkoutIds) throws IOException;
boolean insertReceipt(ClearingReceiptVo receiptVo) throws Exception;
/**
* 历史订单记录PC
* @return
*/
List<Map<String,Object>> getListPage(String phone,String transactionNumber,Integer status,String chargingStationName,Long operatorId,Integer source,String beginStartTime,String beginEndTime,Long userId,Integer type,String affiliationOrganization,String evcsOrderNo,String plateNum,Integer internetId,String internetSerialNumber,String terminalName,String vinCode,String overStartTime,String overEndTime,Long personnelId,Integer confirmResult, Integer checkoutId);
}

View File

@ -0,0 +1,23 @@
package com.xhpc.clearing.service;
import com.xhpc.clearing.domain.XhpcClearingHistoryOrderDomain;
import com.xhpc.clearing.vo.ClearingOrderVo;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
public interface XhpcClearingHistoryOrderService {
List<XhpcClearingHistoryOrderDomain> getPage(Map<String, Object> params);
void export(HttpServletResponse response, Map<String, Object> params) throws IOException;
boolean checkDomainList(ClearingOrderVo orderVo);
List<Map<String, Object>> getOrderPage(Map<String, Object> params);
Map<String, Object> getOperatorData(Map<String, Object> params);
}

View File

@ -0,0 +1,136 @@
package com.xhpc.clearing.service.impl;
import com.xhpc.clearing.domain.XhpcClearingBankDomain;
import com.xhpc.clearing.mapper.XhpcClearingBankMapper;
import com.xhpc.clearing.service.XhpcClearingBankService;
import com.xhpc.common.api.SmsService;
import com.xhpc.common.core.exception.CustomException;
import com.xhpc.common.core.utils.StringUtils;
import com.xhpc.common.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.TimeUnit;
@Service
public class XhpcClearingBankServiceImpl implements XhpcClearingBankService {
@Resource
XhpcClearingBankMapper bankMapper;
@Resource
SmsService smsService;
@Resource
RedisService redisService;
@Override
public List<XhpcClearingBankDomain> getPage(Map<String, Object> params){
return bankMapper.selectByParams(params);
}
@Override
public XhpcClearingBankDomain getDomainByPk(Long bankId){
return bankMapper.selectByPrimaryKey(bankId);
}
@Override
public boolean insertDomain(XhpcClearingBankDomain domain){
if(StringUtils.isEmpty(domain.getContactPhone()) || StringUtils.isEmpty(domain.getContactName())
|| StringUtils.isEmpty(domain.getBankNo()) || StringUtils.isEmpty(domain.getBankName())
|| StringUtils.isEmpty(domain.getCode())){
throw new CustomException("必填项不能为空");
}
String key = "opbind:" + domain.getContactPhone();
String redisCode = redisService.getCacheObject(key);
if(StringUtils.isEmpty(redisCode)){
throw new CustomException("短信验证码已失效,请重新发送");
}
if(!redisCode.equals(domain.getCode())){
throw new CustomException("短信验证码错误,请重试");
}
bankMapper.deleteLogicByOperatorId(domain.getOperatorId());
return bankMapper.insert(domain) > 0;
}
@Override
public boolean updateDomain(XhpcClearingBankDomain domain){
String key = "opbind:" + domain.getContactPhone();
String redisCode = redisService.getCacheObject(key);
if(StringUtils.isEmpty(redisCode)){
throw new CustomException("短信验证码已失效,请重新发送");
}
if(!redisCode.equals(domain.getCode())){
throw new CustomException("短信验证码错误,请重试");
}
return bankMapper.updateByPrimaryKey(domain) > 0;
}
@Override
public boolean deleteByPk(Long bankId){
return bankMapper.deleteLogicByPrimaryKey(bankId) > 0;
}
@Override
public boolean sendBindBankSms(String phone){
String random = getRandom();
HashMap<String, String> paramMap = new HashMap<>();
paramMap.put("phone", phone);
paramMap.put("code", random);
paramMap.put("content", "您的动态码为:" + random + ",您正在进行绑定对公银行账户操作,如非本人操作,请忽略本短信!");
smsService.sendNotice(paramMap);
String key = "opbind:" + phone;
redisService.setCacheObject(key, random, 300L, TimeUnit.SECONDS);
return true;
}
@Override
public boolean sendCashSms(String phone){
String random = getRandom();
HashMap<String, String> paramMap = new HashMap<>();
paramMap.put("phone", phone);
paramMap.put("code", random);
paramMap.put("content", "【小华充电】您的动态码为:" + random + ",您正在进行提现到银行账户操作,如非本人操作,请忽略本短信!");
smsService.sendNotice(paramMap);
String key = "opcash:" + phone;
redisService.setCacheObject(key, random, 300L, TimeUnit.SECONDS);
return true;
}
private String getRandom(){
Random rnd = new Random();
int i = rnd.nextInt(999999);
if(i<100000){
i=i+100000;
}
return i+"";
}
}

View File

@ -0,0 +1,320 @@
package com.xhpc.clearing.service.impl;
import cn.hutool.core.io.IoUtil;
import cn.hutool.poi.excel.BigExcelWriter;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import com.xhpc.clearing.config.AliOSSProperties;
import com.xhpc.clearing.domain.XhpcClearingBankDomain;
import com.xhpc.clearing.domain.XhpcClearingCheckoutDomain;
import com.xhpc.clearing.domain.XhpcClearingHistoryOrderDomain;
import com.xhpc.clearing.domain.XhpcClearingReceiptDomain;
import com.xhpc.clearing.mapper.XhpcClearingBankMapper;
import com.xhpc.clearing.mapper.XhpcClearingCheckoutMapper;
import com.xhpc.clearing.mapper.XhpcClearingHistoryOrderMapper;
import com.xhpc.clearing.mapper.XhpcClearingReceiptMapper;
import com.xhpc.clearing.service.XhpcClearingCheckoutService;
import com.xhpc.clearing.utils.DownloadUtil;
import com.xhpc.clearing.vo.CheckoutBankVo;
import com.xhpc.clearing.vo.ClearingReceiptVo;
import com.xhpc.common.core.exception.CustomException;
import com.xhpc.common.core.utils.SecurityUtils;
import com.xhpc.common.core.utils.StringUtils;
import com.xhpc.common.core.web.service.BaseService;
import com.xhpc.common.redis.service.RedisService;
import com.xhpc.common.security.service.TokenService;
import com.xhpc.common.util.UserTypeUtil;
import com.xhpc.system.api.domain.SysUser;
import com.xhpc.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@Transactional
public class XhpcClearingCheckoutServiceImpl extends BaseService implements XhpcClearingCheckoutService {
@Resource
XhpcClearingCheckoutMapper checkoutMapper;
@Resource
XhpcClearingHistoryOrderMapper historyOrderMapper;
@Resource
XhpcClearingBankMapper bankMapper;
@Resource
XhpcClearingReceiptMapper receiptMapper;
@Resource
RedisService redisService;
@Resource
AliOSSProperties ossProperties;
@Resource
TokenService tokenService;
@Override
public List<XhpcClearingCheckoutDomain> getPage(Map<String, Object> params) {
return checkoutMapper.selectByParams(params);
}
@Override
public Map<String, Object> getTmpCheckoutData(Long operatorId) {
XhpcClearingBankDomain bankDomain = bankMapper.selectOneByOperatorId(operatorId.toString());
if (bankDomain == null) {
throw new CustomException("请先输入一个有效的提现账户");
}
// 可提现金额
BigDecimal bankRate = new BigDecimal("0.006");
BigDecimal handlingRate = BigDecimal.TEN;
Map<String, Object> cashMap = historyOrderMapper.selectCashAmount(operatorId.toString());
BigDecimal bankFee = new BigDecimal(cashMap.get("amount").toString()).multiply(bankRate).setScale(2, BigDecimal.ROUND_UP);
BigDecimal actAmount = new BigDecimal(cashMap.get("amount").toString()).subtract(handlingRate).subtract(bankFee);
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("bankNo", bankDomain.getBankNo());
resultMap.put("contactPhone", bankDomain.getContactPhone());
resultMap.put("applyAmount", cashMap.get("amount"));
resultMap.put("clearingOrderIds", cashMap.get("clearingOrderIds"));
resultMap.put("handlingFee", handlingRate);
resultMap.put("bankFee", bankFee);
resultMap.put("receivedAmount", actAmount.compareTo(BigDecimal.ZERO) >= 0 ? actAmount : BigDecimal.ZERO);
resultMap.put("clearingBankId", bankDomain.getClearingBankId());
return resultMap;
}
@Override
public XhpcClearingCheckoutDomain getDomainByPk(Long checkoutId) {
XhpcClearingCheckoutDomain checkoutDomain = checkoutMapper.selectByPrimaryKey(checkoutId);
checkoutDomain.setClearingBank(bankMapper.selectByPrimaryKey(checkoutDomain.getClearingBankId()));
return checkoutDomain;
}
@Override
public boolean insertDomain(XhpcClearingCheckoutDomain domain) {
XhpcClearingBankDomain bankDomain;
if (domain.getClearingBankId() == null) {
bankDomain = bankMapper.selectOneByOperatorId(domain.getOperatorId().toString());
domain.setClearingBankId(bankDomain.getClearingBankId());
} else {
bankDomain = bankMapper.selectByPrimaryKey(domain.getClearingBankId());
}
String key = "opcash:" + bankDomain.getContactPhone();
String redisCode = redisService.getCacheObject(key);
if (StringUtils.isEmpty(redisCode)) {
throw new CustomException("短信验证码已失效,请重新发送");
}
if (!redisCode.equals(domain.getCode())) {
throw new CustomException("短信验证码错误,请重试");
}
checkoutMapper.insert(domain);
if (StringUtils.isEmpty(domain.getClearingOrderIds())) {
historyOrderMapper.updateCheckoutByOperator(domain.getOperatorId(), domain.getClearingCheckoutId());
} else {
// ...
historyOrderMapper.updateCheckoutByOrderId(domain.getClearingOrderIds(), domain.getClearingCheckoutId());
}
return true;
}
@Override
public void bankExport(HttpServletResponse response, String checkoutIds) throws IOException {
List<CheckoutBankVo> list = checkoutMapper.selectOrderMapByCheckoutIds(checkoutIds);
com.xhpc.common.core.utils.poi.ExcelUtil<CheckoutBankVo> util = new com.xhpc.common.core.utils.poi.ExcelUtil<CheckoutBankVo>(CheckoutBankVo.class);
util.exportExcel(response, list, "待提现订单列表");
// ExcelWriter writer = ExcelUtil.getWriter(true);
// writer.addHeaderAlias("curreyType", "币种");
// writer.addHeaderAlias("date", "日期");
// writer.addHeaderAlias("detailFlag", "明细标志");
// writer.addHeaderAlias("index", "顺序号");
// writer.addHeaderAlias("payBank", "付款帐号开户行");
// writer.addHeaderAlias("payBankAccount", "付款帐号/卡号");
// writer.addHeaderAlias("payBankName", "付款账号名称/卡名称");
// writer.addHeaderAlias("receiveBank", "收款账号开户行");
// writer.addHeaderAlias("receiveProvice", "收款账号省份");
// writer.addHeaderAlias("receiveCity", "收款账号地市");
// writer.addHeaderAlias("receiveCode", "收款账号地区码");
// writer.addHeaderAlias("receiveAccount", "收款账号");
// writer.addHeaderAlias("receiveName", "收款账号名称");
// writer.addHeaderAlias("amount", "金额");
// writer.addHeaderAlias("purposes", "汇款用途");
// writer.addHeaderAlias("remark", "备注信息");
// writer.addHeaderAlias("transType", "汇款方式");
// writer.addHeaderAlias("mobile", "收款账户短信通知手机号");
// writer.addHeaderAlias("customeIndex", "自定义序号");
// writer.addHeaderAlias("applyCheckNo", "预先审批编号");
//
// 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);
}
@Override
public void orderExport(HttpServletResponse response, String checkoutIds) throws IOException {
Map<String, Object> params = new HashMap<>();
params.put("checkoutIds", checkoutIds);
List<XhpcClearingHistoryOrderDomain> list = historyOrderMapper.getListPage(params);
// 通过工具类创建writer默认创建xls格式
BigExcelWriter writer = ExcelUtil.getBigWriter("HistoryOrder_" + System.currentTimeMillis() + ".xlsx");
writer.addHeaderAlias("serialNumber", "订单号");
writer.addHeaderAlias("sourceName", "用户类型");
writer.addHeaderAlias("chargingModeName", "流量方名称");
writer.addHeaderAlias("stationName", "电站名称");
writer.addHeaderAlias("terminalName", "终端名称");
writer.addHeaderAlias("operatorName", "运营商");
writer.addHeaderAlias("powerPriceTotal", "电费(元)");
writer.addHeaderAlias("servicePriceTotal", "服务费(元)");
writer.addHeaderAlias("totalPrice", "订单总金额(元)");
writer.addHeaderAlias("promotionDiscount", "抵扣总金额(元)");
writer.addHeaderAlias("actPrice", "用户支付的金额(元)");
writer.addHeaderAlias("internetCommission", "流量方总金额抽成(元)");
writer.addHeaderAlias("internetSvcCommission", "流量方服务费抽成(元)");
writer.addHeaderAlias("internetDegreeCommission", "流量方电量抽成(元)");
writer.addHeaderAlias("platformCommission", "平台总金额抽成(元)");
writer.addHeaderAlias("platformSvcCommisssion", "平台服务费抽成(元)");
writer.addHeaderAlias("operationCommission", "运维总抽成(元)");
writer.addHeaderAlias("operationSvcCommission", "运维服务费抽成(元)");
writer.addHeaderAlias("actPowerPrice", "运营商实收电费(元)");
writer.addHeaderAlias("actServicePrice", "运营商实收服务费(元)");
writer.addHeaderAlias("startSoc", "启动SOC");
writer.addHeaderAlias("endSoc", "结算SOC");
writer.addHeaderAlias("startTime", "开始充电时间");
writer.addHeaderAlias("endTime", "结束充电时间");
// 默认的未添加alias的属性也会写出如果想只写出加了别名的字段可以调用此方法排除之
writer.setOnlyAlias(true);
// 一次性写出内容使用默认样式强制输出标题
writer.write(list, true);
//out为OutputStream需要写出到的目标流
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
// //response为HttpServletResponse对象
// response.setContentType("application/vnd.ms-excel;charset=utf-8");
// //test.xls是弹出下载对话框的文件名不能为中文中文请自行编码
// response.setHeader("Content-Disposition", "attachment;filename=历史订单列表.xls");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
// 关闭writer释放内存
writer.close();
//此处记得关闭输出Servlet流
IoUtil.close(out);
}
@Override
public boolean insertReceipt(ClearingReceiptVo receiptVo) throws Exception {
String fileUrl = receiptVo.getFile();
if (!fileUrl.startsWith("http")) {
String domain = ossProperties.getDomain();
if (!domain.endsWith("/")) {
domain = domain + "/";
}
fileUrl = domain + fileUrl;
}
File dataFile = DownloadUtil.downloadFile(fileUrl);
com.xhpc.common.core.utils.poi.ExcelUtil<CheckoutBankVo> util = new com.xhpc.common.core.utils.poi.ExcelUtil<CheckoutBankVo>(CheckoutBankVo.class);
List<CheckoutBankVo> checkoutList = util.importExcel(new FileInputStream(dataFile));
String checkoutIds = checkoutList.stream().map(CheckoutBankVo::getIndex).collect(Collectors.joining(","));
if (checkoutIds.length() > 1) {
List<XhpcClearingReceiptDomain> receiptDomainList = receiptVo.getReceiptList();
for (XhpcClearingReceiptDomain receiptDomain : receiptDomainList) {
receiptDomain.setClearingCheckoutIds(checkoutIds);
receiptDomain.setCreateBy(receiptVo.getCreateBy());
}
receiptMapper.insretBatch(receiptDomainList);
}
checkoutMapper.updateStatusByIds(checkoutIds, 6);
return true;
}
@Override
public List<Map<String, Object>> getListPage(String phone, String transactionNumber, Integer status, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime, Long userId, Integer type, String affiliationOrganization, String evcsOrderNo, String plateNum, Integer internetId, String internetSerialNumber, String terminalName, String vinCode, String overStartTime, String overEndTime, Long personnelId, Integer confirmResult, Integer checkoutId) {
Integer number = 0;
//电话和用户类型都不为null number =3
//电话不为null用户类型为null number =1
//电话为null用户类型不为null number=2
//电话为null用户类型为null number=0
if (!"".equals(phone) && phone != null && !"".equals(source) && source != null) {
number = 3;
} else if (!"".equals(phone) && phone != null && source == null) {
number = 1;
} else if (phone == null && source != null) {
number = 2;
}
//获取登陆用户
Long logUserId = SecurityUtils.getUserId();
LoginUser loginUser = tokenService.getLoginUser();
String tenantId = loginUser.getTenantId();
//桩的统计该时段金额
List<Map<String, Object>> list = new ArrayList<>();
if (userId != UserTypeUtil.USER_ID) {
Map<String, Object> landUser = historyOrderMapper.getLandUser(logUserId);
if (landUser != null) {
if (landUser.get("userType") != null) {
startPage();
if (UserTypeUtil.SYS_USER_TYPE_ONE.equals(landUser.get("userType").toString())) {
Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString());
//运营商看自己的场站
list = historyOrderMapper.getOrderListPage(phone, transactionNumber, 1, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logOperatorId, type, number, affiliationOrganization, evcsOrderNo, plateNum, internetId, internetSerialNumber, terminalName, vinCode, overStartTime, overEndTime, personnelId, confirmResult, tenantId, 0, checkoutId);
} else {
//查询赋值的场站
list = historyOrderMapper.getOrderListPage(phone, transactionNumber, 2, chargingStationName, operatorId, source, beginStartTime, beginEndTime, logUserId, type, number, affiliationOrganization, evcsOrderNo, plateNum, internetId, internetSerialNumber, terminalName, vinCode, overStartTime, overEndTime, personnelId, confirmResult, tenantId, 0, checkoutId);
}
}
}
} else {
startPage();
list = historyOrderMapper.getOrderListPage(phone, transactionNumber, 0, chargingStationName, operatorId, source, beginStartTime, beginEndTime, userId, type, number, affiliationOrganization, evcsOrderNo, plateNum, internetId, internetSerialNumber, terminalName, vinCode, overStartTime, overEndTime, personnelId, confirmResult, tenantId, 0, checkoutId);
}
return list;
}
}

View File

@ -0,0 +1,172 @@
package com.xhpc.clearing.service.impl;
import cn.hutool.core.io.IoUtil;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import com.alibaba.fastjson.JSON;
import com.xhpc.clearing.domain.XhpcClearingBankDomain;
import com.xhpc.clearing.domain.XhpcClearingHistoryOrderDomain;
import com.xhpc.clearing.mapper.XhpcClearingBankMapper;
import com.xhpc.clearing.mapper.XhpcClearingCheckoutMapper;
import com.xhpc.clearing.mapper.XhpcClearingHistoryOrderMapper;
import com.xhpc.clearing.mapper.XhpcHistoryOrderMapper;
import com.xhpc.clearing.service.XhpcClearingHistoryOrderService;
import com.xhpc.clearing.vo.ClearingOrderVo;
import com.xhpc.common.core.exception.CustomException;
import com.xhpc.common.core.utils.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@Service
@Transactional
public class XhpcClearingHistoryOrderServiceImpl implements XhpcClearingHistoryOrderService {
@Resource
XhpcClearingHistoryOrderMapper historyOrderMapper;
@Resource
XhpcClearingCheckoutMapper checkoutMapper;
@Resource
XhpcClearingBankMapper bankMapper;
@Resource
XhpcHistoryOrderMapper orderMapper;
@Override
public List<XhpcClearingHistoryOrderDomain> getPage(Map<String, Object> params) {
return historyOrderMapper.getListPage(params);
}
@Override
public boolean checkDomainList(ClearingOrderVo orderVo) {
if (StringUtils.isEmpty(orderVo.getOrderIds())) {
throw new CustomException("缺少订单ID");
}
String orderIds = "";
if (orderVo.getOrderIds().equals("-1")) {
Map<String, Object> params = new HashMap<>();
params.put("startTime", orderVo.getStartTime());
params.put("endTime", orderVo.getEndTime());
params.put("orderNo", orderVo.getOrderNo());
params.put("userType", orderVo.getUserType());
params.put("internetName", orderVo.getInternetName());
params.put("operatorId", orderVo.getOperatorId());
params.put("stationId", orderVo.getStationId());
List<XhpcClearingHistoryOrderDomain> orderDomainList = historyOrderMapper.getListPage(params);
orderIds = orderDomainList.stream().map(n -> n.getClearingOrderId().toString()).collect(Collectors.joining(","));
} else {
orderIds = orderVo.getOrderIds();
}
return historyOrderMapper.updateStatusBatchByOrderIds(orderIds, orderVo.getStatus(), orderVo.getCheckBy()) > 0;
}
@Override
public void export(HttpServletResponse response, Map<String, Object> params) throws IOException {
List<XhpcClearingHistoryOrderDomain> list = historyOrderMapper.getListPage(params);
// 通过工具类创建writer默认创建xls格式
ExcelWriter writer = ExcelUtil.getWriter(true);
writer.addHeaderAlias("serialNumber", "订单号");
writer.addHeaderAlias("sourceName", "用户类型");
writer.addHeaderAlias("chargingModeName", "流量方名称");
writer.addHeaderAlias("stationName", "电站名称");
writer.addHeaderAlias("operatorName", "运营商");
writer.addHeaderAlias("powerPriceTotal", "电费(元)");
writer.addHeaderAlias("servicePriceTotal", "服务费(元)");
writer.addHeaderAlias("totalPrice", "订单总金额(元)");
writer.addHeaderAlias("promotionDiscount", "抵扣总金额(元)");
writer.addHeaderAlias("actPrice", "用户支付的金额(元)");
writer.addHeaderAlias("internetCommission", "流量方总金额抽成(元)");
writer.addHeaderAlias("internetSvcCommission", "流量方服务费抽成(元)");
writer.addHeaderAlias("internetDegreeCommission", "流量方电量抽成(元)");
writer.addHeaderAlias("platformCommission", "平台总金额抽成(元)");
writer.addHeaderAlias("platformSvcCommisssion", "平台服务费抽成(元)");
writer.addHeaderAlias("operationCommission", "运维总抽成(元)");
writer.addHeaderAlias("operationSvcCommission", "运维服务费抽成(元)");
writer.addHeaderAlias("actPowerPrice", "运营商实收电费(元)");
writer.addHeaderAlias("actServicePrice", "运营商实收服务费(元)");
writer.addHeaderAlias("startSoc", "启动SOC");
writer.addHeaderAlias("endSoc", "结算SOC");
writer.addHeaderAlias("startTime", "开始充电时间");
writer.addHeaderAlias("endTime", "结束充电时间");
// 默认的未添加alias的属性也会写出如果想只写出加了别名的字段可以调用此方法排除之
writer.setOnlyAlias(true);
// 一次性写出内容使用默认样式强制输出标题
writer.write(list, true);
//out为OutputStream需要写出到的目标流
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
// //response为HttpServletResponse对象
// response.setContentType("application/vnd.ms-excel;charset=utf-8");
// //test.xls是弹出下载对话框的文件名不能为中文中文请自行编码
// response.setHeader("Content-Disposition", "attachment;filename=历史订单列表.xls");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
// 关闭writer释放内存
writer.close();
//此处记得关闭输出Servlet流
IoUtil.close(out);
}
// ===========================
@Override
public List<Map<String, Object>> getOrderPage(Map<String, Object> params) {
return historyOrderMapper.selectOrderPage(params);
}
@Override
public Map<String, Object> getOperatorData(Map<String, Object> params) {
String operatorId = params.get("operatorId").toString();
String tenantId = params.get("tenantId").toString();
Map<String, Object> bankDomain = bankMapper.selectOneMapByOperatorId(operatorId);
// 待清分金额
BigDecimal unClearingAmount = orderMapper.selectUnclearingAmount(operatorId);
// 已审核通过金额
BigDecimal checkedAmount = historyOrderMapper.selectCheckedAmount(operatorId);
// 已提现金额
BigDecimal cashedAmount = checkoutMapper.selectAmountByStatus(tenantId, operatorId, 6);
// 提现中金额
BigDecimal cashingAmount = checkoutMapper.selectAmountByStatus(tenantId, operatorId, 1);
// 可提现金额
Map<String, Object> cashMap = historyOrderMapper.selectCashAmount(operatorId);
if (bankDomain == null) {
bankDomain = new HashMap<>();
}
bankDomain.put("cashedAmount", cashedAmount);
bankDomain.put("unclearingAmount", unClearingAmount);
bankDomain.put("cashingAmount", cashingAmount);
bankDomain.put("cashAmount", cashMap.get("amount"));
return bankDomain;
}
}

View File

@ -0,0 +1,54 @@
package com.xhpc.clearing.task;
import com.xhpc.clearing.domain.XhpcClearingHistoryOrderDomain;
import com.xhpc.clearing.domain.XhpcHistoryOrderDomain;
import com.xhpc.clearing.mapper.XhpcClearingHistoryOrderMapper;
import com.xhpc.clearing.mapper.XhpcHistoryOrderMapper;
import com.xhpc.common.core.utils.bean.BeanUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Component
@Transactional
public class SyncHistoryOrderTask {
@Resource
XhpcHistoryOrderMapper historyOrderMapper;
@Resource
XhpcClearingHistoryOrderMapper clearingHistoryOrderMapper;
/**
* 每天六点自动同步一天之前所有未同步订单
*/
@Scheduled(cron = "0 0 6 * * ? ")
private void ExpiredTenantStatusTask(){
List<XhpcHistoryOrderDomain> unclearingDomainList = historyOrderMapper.selectUnsyncOrderList();
List<XhpcClearingHistoryOrderDomain> clearingHistoryOrderDomainList = new ArrayList<>();
List<Long> orderIds = new ArrayList<>();
for (XhpcHistoryOrderDomain domain : unclearingDomainList){
XhpcClearingHistoryOrderDomain clearingDomain = new XhpcClearingHistoryOrderDomain();
BeanUtils.copyProperties(domain, clearingDomain);
clearingDomain.setClearingOrderId(domain.getHistoryOrderId());
clearingDomain.setCheckStatus(0);
clearingHistoryOrderDomainList.add(clearingDomain);
orderIds.add(domain.getHistoryOrderId());
}
clearingHistoryOrderMapper.insertBatch(clearingHistoryOrderDomainList);
historyOrderMapper.updateStatusBatchByOrderIds(orderIds, 3);
}
}

View File

@ -0,0 +1,20 @@
package com.xhpc.clearing.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));
}
}

View File

@ -0,0 +1,70 @@
package com.xhpc.clearing.vo;
import com.xhpc.common.core.annotation.Excel;
import lombok.Data;
@Data
public class CheckoutBankVo {
@Excel(name = "币种")
private String curreyType;
@Excel(name = "日期")
private String date;
@Excel(name = "明细标志")
private String detailFlag;
@Excel(name = "顺序号")
private String index;
@Excel(name = "付款帐号开户行")
private String payBank;
@Excel(name = "付款帐号/卡号")
private String payBankAccount;
@Excel(name = "付款账号名称/卡名称")
private String payBankName;
@Excel(name = "收款账号开户行")
private String receiveBank;
@Excel(name = "收款账号省份")
private String receiveProvice;
@Excel(name = "收款账号地市")
private String receiveCity;
@Excel(name = "收款账号地区码")
private String receiveCode;
@Excel(name = "收款账号")
private String receiveAccount;
@Excel(name = "收款账号名称")
private String receiveName;
@Excel(name = "金额")
private String amount;
@Excel(name = "汇款用途")
private String purposes;
@Excel(name = "备注信息")
private String remark;
@Excel(name = "汇款方式")
private String transType;
@Excel(name = "收款账户短信通知手机号")
private String mobile;
@Excel(name = "自定义序号")
private String customeIndex;
@Excel(name = "预先审批编号")
private String applyCheckNo;
}

View File

@ -0,0 +1,25 @@
package com.xhpc.clearing.vo;
import lombok.Data;
import java.util.List;
@Data
public class ClearingOrderVo {
private String orderIds;
private Integer status;
private String checkBy;
private String startTime;
private String endTime;
private String orderNo;
private String userType;
private String internetName;
private String operatorId;
private String stationId;
}

View File

@ -0,0 +1,18 @@
package com.xhpc.clearing.vo;
import com.xhpc.clearing.domain.XhpcClearingReceiptDomain;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@Data
public class ClearingReceiptVo {
private List<XhpcClearingReceiptDomain> receiptList;
private String file;
private String createBy;
}

View File

@ -0,0 +1,9 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}
_ _ _
__ _| |__ _ __ ___ ___| | ___ __ _ _ __(_)_ __ __ _
\ \/ / '_ \| '_ \ / __/ __| |/ _ \/ _` | '__| | '_ \ / _` |
> <| | | | |_) | (_| (__| | __/ (_| | | | | | | | (_| |
/_/\_\_| |_| .__/ \___\___|_|\___|\__,_|_| |_|_| |_|\__, |
|_| |___/

View File

@ -0,0 +1,34 @@
# Tomcat
server:
port: 8913
# Spring
spring:
application:
# 应用名称
name: xhpc-clearing
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.clearing.mapper: debug
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'

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/xhpc-clearing"/>
<!-- 日志输出格式 -->
<property name="log.pattern"
value="%d{MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.xhpc" level="info"/>
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn"/>
<root level="info">
<appender-ref ref="console"/>
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info"/>
<appender-ref ref="file_error"/>
</root>
</configuration>

View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.clearing.mapper.XhpcClearingBankMapper">
<resultMap id="BaseResultMap" type="com.xhpc.clearing.domain.XhpcClearingBankDomain">
<id column="clearing_bank_id" jdbcType="BIGINT" property="clearingBankId"/>
<result column="operator_id" jdbcType="BIGINT" property="operatorId"/>
<result column="operator_name" jdbcType="VARCHAR" property="operatorName"/>
<result column="area_code" jdbcType="INTEGER" property="areaCode"/>
<result column="bank_name" jdbcType="VARCHAR" property="bankName"/>
<result column="operator_account" jdbcType="VARCHAR" property="operatorAccount"/>
<result column="bank_no" jdbcType="VARCHAR" property="bankNo"/>
<result column="address" jdbcType="VARCHAR" property="address"/>
<result column="contact_name" jdbcType="VARCHAR" property="contactName"/>
<result column="contact_phone" jdbcType="VARCHAR" property="contactPhone"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
clearing_bank_id
, operator_id, operator_name, area_code, bank_name, operator_account,
bank_no, address, contact_name, contact_phone, remark, `status`, del_flag, tenant_id, create_by,
create_time, update_by, update_time
</sql>
<update id="deleteLogicByPrimaryKey">
update xhpc_clearing_bank
set del_flag=2
where clearing_bank_id = #{clearingBankId,jdbcType=BIGINT}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from xhpc_clearing_bank
where clearing_bank_id = #{clearingBankId,jdbcType=BIGINT}
</select>
<select id="selectByParams" resultType="com.xhpc.clearing.domain.XhpcClearingBankDomain">
select
<include refid="Base_Column_List"/>
from xhpc_clearing_bank
where del_flag=0
<if test="params.status!=null and params.status!=''">
and status=#{params.status}
</if>
<if test="params.tenantId!=null and params.tenantId!=''">
and tenant_id=#{params.tenantId}
</if>
<if test="params.operatorId != null and params.operatorId!=''">
and operator_id=#{params.operatorId}
</if>
</select>
<select id="selectOneByOperatorId" resultType="com.xhpc.clearing.domain.XhpcClearingBankDomain">
select
<include refid="Base_Column_List"/>
from xhpc_clearing_bank
where del_flag=0 and status=1 and operator_id=#{operatorId}
order by update_time desc limit 1
</select>
<select id="selectOneMapByOperatorId" resultType="java.util.Map">
select operator_name as 'operatorName', bank_name as 'bankName', bank_no as 'bankNo', contact_phone as 'contactPhone', contact_name as 'contactName'
from xhpc_clearing_bank
where del_flag = 0
and status = 1
and operator_id = #{operatorId}
order by update_time desc limit 1
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete
from xhpc_clearing_bank
where clearing_bank_id = #{clearingBankId,jdbcType=BIGINT}
</delete>
<update id="deleteLogicByOperatorId">
update xhpc_clearing_bank
set del_flag=2
where operator_id = #{operatorId}
</update>
<insert id="insert" keyColumn="clearing_bank_id" keyProperty="clearingBankId"
parameterType="com.xhpc.clearing.domain.XhpcClearingBankDomain" useGeneratedKeys="true">
insert into xhpc_clearing_bank (operator_id, operator_name, area_code,
bank_name, operator_account, bank_no,
address, contact_name, contact_phone,
remark, `status`, del_flag,
tenant_id, create_by, create_time,
update_by, update_time)
values (#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, #{areaCode,jdbcType=INTEGER},
#{bankName,jdbcType=VARCHAR}, #{operatorAccount,jdbcType=VARCHAR}, #{bankNo,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR}, #{contactPhone,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, 1, 0,
#{tenantId,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, sysdate(),
#{updateBy,jdbcType=VARCHAR}, sysdate())
</insert>
<update id="updateByPrimaryKey" parameterType="com.xhpc.clearing.domain.XhpcClearingBankDomain">
update xhpc_clearing_bank
set operator_id = #{operatorId,jdbcType=BIGINT},
operator_name = #{operatorName,jdbcType=VARCHAR},
area_code = #{areaCode,jdbcType=INTEGER},
bank_name = #{bankName,jdbcType=VARCHAR},
operator_account = #{operatorAccount,jdbcType=VARCHAR},
bank_no = #{bankNo,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
contact_name = #{contactName,jdbcType=VARCHAR},
contact_phone = #{contactPhone,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = sysdate()
where clearing_bank_id = #{clearingBankId,jdbcType=BIGINT}
</update>
</mapper>

View File

@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.clearing.mapper.XhpcClearingCheckoutMapper">
<resultMap id="BaseResultMap" type="com.xhpc.clearing.domain.XhpcClearingCheckoutDomain">
<id column="clearing_checkout_id" jdbcType="BIGINT" property="clearingCheckoutId" />
<result column="clearing_bank_id" jdbcType="BIGINT" property="clearingBankId" />
<result column="apply_amount" jdbcType="DECIMAL" property="applyAmount" />
<result column="handling_fee" jdbcType="DECIMAL" property="handlingFee" />
<result column="bank_fee" jdbcType="DECIMAL" property="bankFee" />
<result column="received_amount" jdbcType="DECIMAL" property="receivedAmount" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="del_flag" jdbcType="INTEGER" property="delFlag" />
<result column="operator_id" jdbcType="BIGINT" property="operatorId" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="check_by" jdbcType="VARCHAR" property="checkBy" />
<result column="check_time" jdbcType="TIMESTAMP" property="checkTime" />
</resultMap>
<sql id="Base_Column_List">
cc.clearing_checkout_id, cc.clearing_bank_id, cc.apply_amount, cc.handling_fee, cc.received_amount, cc.bank_fee, cc.del_flag,
cc.`status`, cc.operator_id, cc.tenant_id, cc.create_by, cc.create_time, cc.update_by, cc.update_time, cc.check_by, cc.check_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultType="com.xhpc.clearing.domain.XhpcClearingCheckoutDomain">
select
<include refid="Base_Column_List" />, xo.name as 'operator_name'
from xhpc_clearing_checkout cc
left join xhpc_operator xo on xo.operator_id = cc.operator_id
where cc.clearing_checkout_id = #{clearingCheckoutId,jdbcType=BIGINT}
</select>
<select id="selectByParams" resultType="com.xhpc.clearing.domain.XhpcClearingCheckoutDomain">
select
<include refid="Base_Column_List" />, xo.name as 'operator_name'
from xhpc_clearing_checkout cc
left join xhpc_operator xo on xo.operator_id = cc.operator_id
where cc.del_flag =0
<if test="params.status!=null and params.status!=''">
and cc.status=#{params.status}
</if>
<if test="params.tenantId!=null and params.tenantId!=''">
and cc.tenant_id=#{params.tenantId}
</if>
<if test="params.operatorId!=null and params.operatorId!='' ">
and cc.operator_id=#{params.operatorId}
</if>
<if test="params.startTime!=null and params.startTime!=''">
and cc.create_time <![CDATA[ >= ]]> #{params.startTime}
</if>
<if test="params.endTime!=null and params.endTime!=''">
and cc.create_time <![CDATA[ <= ]]> #{params.endTime}
</if>
</select>
<select id="selectAmountByStatus" resultType="java.math.BigDecimal">
select ifnull(sum(apply_amount), 0) from xhpc_clearing_checkout where del_flag =0 and tenant_id=#{tenantId} and operator_id=#{operatorId} and status=#{status}
</select>
<select id="selectOrderMapByCheckoutIds" resultType="com.xhpc.clearing.vo.CheckoutBankVo">
select
'RMB' as 'curreyType',
date_format(now(), '%Y%m%d') as 'date',
'' as 'detailFlag',
cc.clearing_checkout_id as 'index',
'' as 'payBank',
'' as 'payBankAccount',
'' as 'payBankName',
cb.bank_name as 'receiveBank',
'' as 'receiveProvice',
'' as 'receiveCity',
'' as 'receiveCode',
cb.bank_no as 'receiveAccount',
cb.operator_account as 'receiveName',
sum(cc.received_amount) as 'amount',
'' as 'purposes',
'' as 'remark',
'0' as 'transType',
'' as 'mobile',
'' as 'customeIndex',
'' as 'applyCheckNo'
from xhpc_clearing_checkout cc
left join xhpc_clearing_bank cb on cb.clearing_bank_id=cc.clearing_bank_id
where find_in_set(cc.clearing_checkout_id, #{checkoutIds})
group by cc.clearing_bank_id, cc.operator_id
</select>
<update id="deleteLogicByPrimaryKey" parameterType="java.lang.Long">
update xhpc_clearing_checkout set del_flag=2
where clearing_checkout_id = #{clearingCheckoutId,jdbcType=BIGINT}
</update>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from xhpc_clearing_checkout
where clearing_checkout_id = #{clearingCheckoutId,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="clearing_checkout_id" keyProperty="clearingCheckoutId" parameterType="com.xhpc.clearing.domain.XhpcClearingCheckoutDomain" useGeneratedKeys="true">
insert into xhpc_clearing_checkout (clearing_bank_id, apply_amount, handling_fee, bank_fee,
received_amount, del_flag, `status`, operator_id, tenant_id,
create_by, create_time,
update_by,update_time, check_by, check_time)
values (#{clearingBankId,jdbcType=BIGINT}, #{applyAmount,jdbcType=DECIMAL}, #{handlingFee,jdbcType=DECIMAL}, #{bankFee},
#{receivedAmount,jdbcType=DECIMAL}, 0, #{status}, #{operatorId}, #{tenantId,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, sysdate(), #{updateBy,jdbcType=VARCHAR},
sysdate(), #{checkBy}, sysdate())
</insert>
<update id="updateByPrimaryKey" parameterType="com.xhpc.clearing.domain.XhpcClearingCheckoutDomain">
update xhpc_clearing_checkout
set clearing_bank_id = #{clearingBankId,jdbcType=BIGINT},
apply_amount = #{applyAmount,jdbcType=DECIMAL},
handling_fee = #{handlingFee,jdbcType=DECIMAL},
bank_fee = #{bankFee},
received_amount = #{receivedAmount,jdbcType=DECIMAL},
`status` = #{status,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = sysdate()
where clearing_checkout_id = #{clearingCheckoutId,jdbcType=BIGINT}
</update>
<update id="checkByPrimaryKey">
update xhpc_clearing_checkout
set `status` = #{status,jdbcType=INTEGER},
check_by = #{updateBy,jdbcType=VARCHAR},
check_time = #{updateTime,jdbcType=TIMESTAMP}
where clearing_checkout_id = #{clearingCheckoutId,jdbcType=BIGINT}
</update>
<update id="updateStatusByPrimaryKey">
update xhpc_clearing_checkout
set `status` = #{status,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = sysdate()
where clearing_checkout_id = #{clearingCheckoutId,jdbcType=BIGINT}
</update>
<update id="updateStatusByIds">
update xhpc_clearing_checkout
set `status` = #{status}
where find_in_set(clearing_checkout_id, #{checkoutIds})
</update>
</mapper>

View File

@ -0,0 +1,609 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.clearing.mapper.XhpcClearingHistoryOrderMapper">
<resultMap id="BaseResultMap" type="com.xhpc.clearing.domain.XhpcClearingHistoryOrderDomain">
<id column="clearing_order_id" jdbcType="BIGINT" property="clearingOrderId"/>
<result column="charging_station_id" jdbcType="BIGINT" property="chargingStationId"/>
<result column="charge_order_id" jdbcType="BIGINT" property="chargeOrderId"/>
<result column="user_id" jdbcType="BIGINT" property="userId"/>
<result column="terminal_id" jdbcType="BIGINT" property="terminalId"/>
<result column="serial_number" jdbcType="VARCHAR" property="serialNumber"/>
<result column="internet_serial_number" jdbcType="VARCHAR" property="internetSerialNumber"/>
<result column="power_price_total" jdbcType="DECIMAL" property="powerPriceTotal"/>
<result column="service_price_total" jdbcType="DECIMAL" property="servicePriceTotal"/>
<result column="total_price" jdbcType="DECIMAL" property="totalPrice"/>
<result column="promotion_discount" jdbcType="DECIMAL" property="promotionDiscount"/>
<result column="act_price" jdbcType="DECIMAL" property="actPrice"/>
<result column="act_power_price" jdbcType="DECIMAL" property="actPowerPrice"/>
<result column="act_service_price" jdbcType="DECIMAL" property="actServicePrice"/>
<result column="internet_commission" jdbcType="DECIMAL" property="internetCommission"/>
<result column="internet_svc_commission" jdbcType="DECIMAL" property="internetSvcCommission"/>
<result column="platform_commission" jdbcType="DECIMAL" property="platformCommission"/>
<result column="platform_svc_commisssion" jdbcType="DECIMAL" property="platformSvcCommisssion"/>
<result column="operation_commission" jdbcType="DECIMAL" property="operationCommission"/>
<result column="operation_svc_commission" jdbcType="DECIMAL" property="operationSvcCommission"/>
<result column="start_soc" jdbcType="VARCHAR" property="startSoc"/>
<result column="end_soc" jdbcType="VARCHAR" property="endSoc"/>
<result column="reconciliation_status" jdbcType="INTEGER" property="reconciliationStatus"/>
<result column="sorting_status" jdbcType="INTEGER" property="sortingStatus"/>
<result column="type" jdbcType="TINYINT" property="type"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="state" jdbcType="INTEGER" property="state"/>
<result column="vin_normal" jdbcType="VARCHAR" property="vinNormal"/>
<result column="search_value" jdbcType="VARCHAR" property="searchValue"/>
<result column="operator_id_evcs" jdbcType="VARCHAR" property="operatorIdEvcs"/>
<result column="charge_model_evcs" jdbcType="INTEGER" property="chargeModelEvcs"/>
<result column="connector_power_evcs" jdbcType="DOUBLE" property="connectorPowerEvcs"/>
<result column="meter_value_end_evcs" jdbcType="DOUBLE" property="meterValueEndEvcs"/>
<result column="meter_value_start_evcs" jdbcType="DOUBLE" property="meterValueStartEvcs"/>
<result column="operator_id3rdpty_evcs" jdbcType="VARCHAR" property="operatorId3rdptyEvcs"/>
<result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
<result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
<result column="stop_reason_evcs" jdbcType="INTEGER" property="stopReasonEvcs"/>
<result column="total_power" jdbcType="DOUBLE" property="totalPower"/>
<result column="user_name_evcs" jdbcType="VARCHAR" property="userNameEvcs"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="evcs_order_no" jdbcType="VARCHAR" property="evcsOrderNo"/>
<result column="confirm_Result" jdbcType="INTEGER" property="confirmResult"/>
<result column="rate_model_id" jdbcType="BIGINT" property="rateModelId"/>
<result column="charging_mode" jdbcType="VARCHAR" property="chargingMode"/>
<result column="internet_degree_commission" jdbcType="DECIMAL" property="internetDegreeCommission"/>
<result column="source" jdbcType="INTEGER" property="source"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="operator_id" jdbcType="BIGINT" property="operatorId"/>
<result column="operator_name" jdbcType="VARCHAR" property="operatorName"/>
<result column="clearing_checkout_id" jdbcType="BIGINT" property="clearingCheckoutId"/>
<result column="check_status" jdbcType="INTEGER" property="checkStatus"/>
<result column="check_time" jdbcType="TIMESTAMP" property="checkTime"/>
<result column="check_by" jdbcType="VARCHAR" property="checkBy"/>
</resultMap>
<sql id="Base_Column_List">
ho.clearing_order_id, ho.charging_station_id, ho.charge_order_id, ho.user_id, ho.terminal_id, ho.serial_number,
ho.internet_serial_number, ho.power_price_total, ho.service_price_total, ho.total_price, ho.promotion_discount,
ho.act_price, ho.act_power_price, ho.act_service_price, ho.internet_commission, ho.internet_svc_commission,
ho.platform_commission, ho.platform_svc_commisssion, ho.operation_commission, ho.operation_svc_commission,
ho.start_soc, ho.end_soc, ho.reconciliation_status, ho.sorting_status, ho.`type`, ho.`status`, ho.del_flag,
ho.create_time, ho.create_by, ho.update_time, ho.update_by, ho.remark, ho.`state`, ho.vin_normal, ho.search_value,
ho.operator_id_evcs, ho.charge_model_evcs, ho.connector_power_evcs, ho.meter_value_end_evcs,
ho.meter_value_start_evcs, ho.operator_id3rdpty_evcs, ho.start_time, ho.end_time, ho.stop_reason_evcs,
ho.total_power, ho.user_name_evcs, ho.phone, ho.evcs_order_no, ho.confirm_Result, ho.rate_model_id,
ho.charging_mode, ho.internet_degree_commission, ho.`source`, ho.tenant_id, ho.operator_id, ho.operator_name,
ho.clearing_checkout_id, ho.check_status, ho.check_by, ho.check_time
</sql>
<update id="updateStatusBatchByOrderIds">
update xhpc_clearing_history_order set check_status=#{status}, check_by=#{checkBy}, check_time=sysdate()
where find_in_set(clearing_order_id, #{orderIds})
</update>
<select id="selectCheckedAmount" resultType="java.math.BigDecimal">
select
ifnull(sum(ho.total_price), 0)
from xhpc_clearing_history_order as ho
where ho.check_status=2 and ho.del_flag=0 and ho.operator_id=#{operatorId}
</select>
<select id="selectCashAmount" resultType="map">
select
ifnull(sum(ho.total_price), 0) as amount,
group_concat(clearing_order_id) as clearingOrderIds
from xhpc_clearing_history_order as ho
where ho.check_status=2 and ho.del_flag=0 and ho.clearing_checkout_id is null and ho.operator_id=#{operatorId}
</select>
<select id="selectOrderListByOperator"
resultType="com.xhpc.clearing.domain.XhpcClearingHistoryOrderDomain">
select
<include refid="Base_Column_List"/>
from xhpc_clearing_history_order as ho
where ho.del_flag=0 and ho.check_status=2 and ho.clearing_checkout_id is null and ho.operator_id=#{operatorId}
</select>
<select id="selectOrderPage" resultType="map">
select
ho.serial_number as 'serialNumber',
ct.name as 'stationName',
ho.total_price as 'totalPrice',
ho.start_time as 'startTime',
ho.end_time as 'endTime',
inu.phone as internetUserPhone,
apu.phone as appUserPhone,
cop.account as communityAccount,
cup.account as customersAccount,
CASE WHEN cc.STATUS = 1 THEN '提现中'
WHEN cc.STATUS = 6 THEN '已提现'
ELSE
case ho.check_status WHEN 1 THEN '审核失败'
when 2 THEN '可提现'
ELSE '待清分' end
END AS 'clearingStatus',
case when ho.source=0 then 'C端用户'
when ho.source=1 then '流量方用户'
when ho.source=2 then '社区用户'
else 'B端客户'
end as 'sourceName',
case when ho.charging_mode="1" then '快电'
when ho.charging_mode="2" then '恒大'
when ho.charging_mode="3" then '新电途'
when ho.charging_mode="4" then '小桔'
when ho.charging_mode="微信" then '微信'
when ho.charging_mode="支付宝" then '支付宝'
else '刷卡'
end as 'chargingModeName'
from xhpc_clearing_history_order ho
left join xhpc_charging_station ct on ct.charging_station_id = ho.charging_station_id
left join xhpc_clearing_checkout cc on ho.clearing_checkout_id=cc.clearing_checkout_id
left join xhpc_internet_user as inu on inu.internet_user_id = ho.user_id and ho.internet_serial_number is not null and ho.source=1
left join xhpc_app_user as apu on apu.app_user_id = ho.user_id and ho.internet_serial_number is null and ho.source=0
left join xhpc_community_personnel as cop on cop.community_personnel_id = ho.user_id and ho.internet_serial_number is null and ho.source=2
left join xhpc_customers_personnel as cup on cup.customers_personnel_id = ho.user_id and ho.internet_serial_number is null and ho.source=3
where ho.del_flag=0
<if test="params.tenantId!=null and params.tenantId!=''">
and ct.tenant_id=#{params.tenantId}
</if>
<if test="params.operatorId!=null and params.operatorId!=''">
and ct.operator_id=#{params.operatorId}
</if>
ORDER BY FIELD(cc.STATUS, NULL,1,2) ASC, FIELD(ho.check_status,NULL,0,2, 1) asc
</select>
<select id="getListPage" resultType="com.xhpc.clearing.domain.XhpcClearingHistoryOrderDomain">
select
<include refid="Base_Column_List" />,
ct.name as 'station_name',
op.name as 'operator_name',
xt.name as 'terminal_name',
case when co.source=0 then "C端用户"
when co.source=1 then "流量方用户"
when co.source=2 then "社区用户"
else "B端客户"
end as 'source_name',
case when ho.charging_mode="1" then "快电"
when ho.charging_mode="2" then "恒大"
when ho.charging_mode="3" then "新电途"
when ho.charging_mode="4" then "小桔"
else "--"
end as 'charging_mode_name'
from xhpc_clearing_history_order as ho
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
left join xhpc_operator as op on op.operator_id = ct.operator_id
left join xhpc_charge_order co on co.charge_order_id = ho.charge_order_id
left join xhpc_terminal xt on xt.terminal_id=ho.terminal_id
where ho.status =0 and ho.del_flag=0 and ho.check_status=0 and ho.state <![CDATA[ <> ]]> 3
<if test="params.startTime!=null and params.startTime!=''">
and ho.start_time <![CDATA[ >= ]]> #{params.startTime}
</if>
<if test="params.endTime!= null and params.endTime!=''">
and ho.start_time <![CDATA[ <= ]]> #{params.endTime}
</if>
<if test="params.tenantId!=null and params.tenantId !=''">
and ct.tenant_id=#{params.tenantId}
</if>
<if test="params.orderNo!=null and params.orderNo!=''">
and ho.serial_number like concat('%', #{params.orderNo}, '%')
</if>
<if test="params.userType!=null and params.userType!=''">
and co.source=#{params.userType}
</if>
<if test="params.internetName!=null and params.internetName!=''">
and ho.charging_mode=#{params.internetName}
</if>
<if test="params.operatorId!=null and params.operatorId!=''">
and ct.operator_id=#{params.operatorId}
</if>
<if test="params.stationId!=null and params.stationId!=''">
and ho.charging_station_id=#{params.stationId}
</if>
<if test="params.checkoutIds!=null and params.checkoutIds!=''">
and find_in_set(ho.clearing_checkout_id, #{params.checkoutIds})
</if>
<if test="params.orderIds!=null and params.orderIds!=''">
and find_in_set(ho.clearing_order_id, #{params.orderIds})
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from xhpc_clearing_history_order
where clearing_order_id = #{clearingOrderId,jdbcType=BIGINT}
</select>
<update id="deleteLogicByPrimaryKey" parameterType="java.lang.Long">
update xhpc_clearing_history_order
set del_flag=2
where clearing_order_id = #{clearingOrderId,jdbcType=BIGINT}
</update>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete
from xhpc_clearing_history_order
where clearing_order_id = #{clearingOrderId,jdbcType=BIGINT}
</delete>
<insert id="insertBatch">
insert into xhpc_clearing_history_order (clearing_order_id, charging_station_id, charge_order_id, user_id,
terminal_id, serial_number, internet_serial_number,
power_price_total, service_price_total, total_price,
promotion_discount, act_price, act_power_price,
act_service_price, internet_commission, internet_svc_commission,
platform_commission, platform_svc_commisssion,
operation_commission, operation_svc_commission,
start_soc, end_soc, reconciliation_status,
sorting_status, `type`, `status`,
del_flag, create_time, create_by,
update_time, update_by, remark,
`state`, vin_normal, search_value,
operator_id_evcs, charge_model_evcs, connector_power_evcs,
meter_value_end_evcs, meter_value_start_evcs, operator_id3rdpty_evcs,
start_time, end_time, stop_reason_evcs,
total_power, user_name_evcs, phone,
evcs_order_no, confirm_Result, rate_model_id,
charging_mode, internet_degree_commission,
`source`, tenant_id, operator_id,
operator_name, clearing_checkout_id, check_status)
values
<foreach collection="domainList" index="index" item="domain" separator=",">
(#{domain.clearingOrderId}, #{domain.chargingStationId,jdbcType=BIGINT}, #{domain.chargeOrderId,jdbcType=BIGINT},
#{domain.userId,jdbcType=BIGINT},
#{domain.terminalId,jdbcType=BIGINT}, #{domain.serialNumber,jdbcType=VARCHAR},
#{domain.internetSerialNumber,jdbcType=VARCHAR},
#{domain.powerPriceTotal,jdbcType=DECIMAL}, #{domain.servicePriceTotal,jdbcType=DECIMAL},
#{domain.totalPrice,jdbcType=DECIMAL},
#{domain.promotionDiscount,jdbcType=DECIMAL}, #{domain.actPrice,jdbcType=DECIMAL},
#{domain.actPowerPrice,jdbcType=DECIMAL},
#{domain.actServicePrice,jdbcType=DECIMAL}, #{domain.internetCommission,jdbcType=DECIMAL},
#{domain.internetSvcCommission,jdbcType=DECIMAL},
#{domain.platformCommission,jdbcType=DECIMAL}, #{domain.platformSvcCommisssion,jdbcType=DECIMAL},
#{domain.operationCommission,jdbcType=DECIMAL}, #{domain.operationSvcCommission,jdbcType=DECIMAL},
#{domain.startSoc,jdbcType=VARCHAR}, #{domain.endSoc,jdbcType=VARCHAR},
#{domain.reconciliationStatus,jdbcType=INTEGER},
#{domain.sortingStatus,jdbcType=INTEGER}, #{domain.type,jdbcType=TINYINT},
#{domain.status,jdbcType=INTEGER},
#{domain.delFlag,jdbcType=INTEGER}, #{domain.createTime,jdbcType=TIMESTAMP},
#{domain.createBy,jdbcType=VARCHAR},
#{domain.updateTime,jdbcType=TIMESTAMP}, #{domain.updateBy,jdbcType=VARCHAR},
#{domain.remark,jdbcType=VARCHAR},
#{domain.state,jdbcType=INTEGER}, #{domain.vinNormal,jdbcType=VARCHAR},
#{domain.searchValue,jdbcType=VARCHAR},
#{domain.operatorIdEvcs,jdbcType=VARCHAR}, #{domain.chargeModelEvcs,jdbcType=INTEGER},
#{domain.connectorPowerEvcs,jdbcType=DOUBLE},
#{domain.meterValueEndEvcs,jdbcType=DOUBLE}, #{domain.meterValueStartEvcs,jdbcType=DOUBLE},
#{domain.operatorId3rdptyEvcs,jdbcType=VARCHAR},
#{domain.startTime,jdbcType=TIMESTAMP}, #{domain.endTime,jdbcType=TIMESTAMP},
#{domain.stopReasonEvcs,jdbcType=INTEGER},
#{domain.totalPower,jdbcType=DOUBLE}, #{domain.userNameEvcs,jdbcType=VARCHAR},
#{domain.phone,jdbcType=VARCHAR},
#{domain.evcsOrderNo,jdbcType=VARCHAR}, #{domain.confirmResult,jdbcType=INTEGER},
#{domain.rateModelId,jdbcType=BIGINT},
#{domain.chargingMode,jdbcType=VARCHAR}, #{domain.internetDegreeCommission,jdbcType=DECIMAL},
#{domain.source,jdbcType=INTEGER}, #{domain.tenantId,jdbcType=VARCHAR},
#{domain.operatorId,jdbcType=BIGINT},
#{domain.operatorName,jdbcType=VARCHAR}, #{domain.clearingCheckoutId,jdbcType=BIGINT}, #{domain.checkStatus})
</foreach>
</insert>
<insert id="insert" keyColumn="clearing_order_id" keyProperty="clearingOrderId"
parameterType="com.xhpc.clearing.domain.XhpcClearingHistoryOrderDomain" useGeneratedKeys="true">
insert into xhpc_clearing_history_order (charging_station_id, charge_order_id, user_id,
terminal_id, serial_number, internet_serial_number,
power_price_total, service_price_total, total_price,
promotion_discount, act_price, act_power_price,
act_service_price, internet_commission, internet_svc_commission,
platform_commission, platform_svc_commisssion,
operation_commission, operation_svc_commission,
start_soc, end_soc, reconciliation_status,
sorting_status, `type`, `status`,
del_flag, create_time, create_by,
update_time, update_by, remark,
`state`, vin_normal, search_value,
operator_id_evcs, charge_model_evcs, connector_power_evcs,
meter_value_end_evcs, meter_value_start_evcs, operator_id3rdpty_evcs,
start_time, end_time, stop_reason_evcs,
total_power, user_name_evcs, phone,
evcs_order_no, confirm_Result, rate_model_id,
charging_mode, internet_degree_commission,
`source`, tenant_id, operator_id,
operator_name, clearing_checkout_id, check_status)
values (#{chargingStationId,jdbcType=BIGINT}, #{chargeOrderId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
#{terminalId,jdbcType=BIGINT}, #{serialNumber,jdbcType=VARCHAR},
#{internetSerialNumber,jdbcType=VARCHAR},
#{powerPriceTotal,jdbcType=DECIMAL}, #{servicePriceTotal,jdbcType=DECIMAL},
#{totalPrice,jdbcType=DECIMAL},
#{promotionDiscount,jdbcType=DECIMAL}, #{actPrice,jdbcType=DECIMAL}, #{actPowerPrice,jdbcType=DECIMAL},
#{actServicePrice,jdbcType=DECIMAL}, #{internetCommission,jdbcType=DECIMAL},
#{internetSvcCommission,jdbcType=DECIMAL},
#{platformCommission,jdbcType=DECIMAL}, #{platformSvcCommisssion,jdbcType=DECIMAL},
#{operationCommission,jdbcType=DECIMAL}, #{operationSvcCommission,jdbcType=DECIMAL},
#{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR}, #{reconciliationStatus,jdbcType=INTEGER},
#{sortingStatus,jdbcType=INTEGER}, #{type,jdbcType=TINYINT}, #{status,jdbcType=INTEGER},
#{delFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{state,jdbcType=INTEGER}, #{vinNormal,jdbcType=VARCHAR}, #{searchValue,jdbcType=VARCHAR},
#{operatorIdEvcs,jdbcType=VARCHAR}, #{chargeModelEvcs,jdbcType=INTEGER},
#{connectorPowerEvcs,jdbcType=DOUBLE},
#{meterValueEndEvcs,jdbcType=DOUBLE}, #{meterValueStartEvcs,jdbcType=DOUBLE},
#{operatorId3rdptyEvcs,jdbcType=VARCHAR},
#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{stopReasonEvcs,jdbcType=INTEGER},
#{totalPower,jdbcType=DOUBLE}, #{userNameEvcs,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
#{evcsOrderNo,jdbcType=VARCHAR}, #{confirmResult,jdbcType=INTEGER}, #{rateModelId,jdbcType=BIGINT},
#{chargingMode,jdbcType=VARCHAR}, #{internetDegreeCommission,jdbcType=DECIMAL},
#{source,jdbcType=INTEGER}, #{tenantId,jdbcType=VARCHAR}, #{operatorId,jdbcType=BIGINT},
#{operatorName,jdbcType=VARCHAR}, #{clearingCheckoutId,jdbcType=BIGINT}, #{checkStatus})
</insert>
<update id="updateByPrimaryKey" parameterType="com.xhpc.clearing.domain.XhpcClearingHistoryOrderDomain">
update xhpc_clearing_history_order
set charging_station_id = #{chargingStationId,jdbcType=BIGINT},
charge_order_id = #{chargeOrderId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
terminal_id = #{terminalId,jdbcType=BIGINT},
serial_number = #{serialNumber,jdbcType=VARCHAR},
internet_serial_number = #{internetSerialNumber,jdbcType=VARCHAR},
power_price_total = #{powerPriceTotal,jdbcType=DECIMAL},
service_price_total = #{servicePriceTotal,jdbcType=DECIMAL},
total_price = #{totalPrice,jdbcType=DECIMAL},
promotion_discount = #{promotionDiscount,jdbcType=DECIMAL},
act_price = #{actPrice,jdbcType=DECIMAL},
act_power_price = #{actPowerPrice,jdbcType=DECIMAL},
act_service_price = #{actServicePrice,jdbcType=DECIMAL},
internet_commission = #{internetCommission,jdbcType=DECIMAL},
internet_svc_commission = #{internetSvcCommission,jdbcType=DECIMAL},
platform_commission = #{platformCommission,jdbcType=DECIMAL},
platform_svc_commisssion = #{platformSvcCommisssion,jdbcType=DECIMAL},
operation_commission = #{operationCommission,jdbcType=DECIMAL},
operation_svc_commission = #{operationSvcCommission,jdbcType=DECIMAL},
start_soc = #{startSoc,jdbcType=VARCHAR},
end_soc = #{endSoc,jdbcType=VARCHAR},
reconciliation_status = #{reconciliationStatus,jdbcType=INTEGER},
sorting_status = #{sortingStatus,jdbcType=INTEGER},
`type` = #{type,jdbcType=TINYINT},
`status` = #{status,jdbcType=INTEGER},
del_flag = #{delFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
`state` = #{state,jdbcType=INTEGER},
vin_normal = #{vinNormal,jdbcType=VARCHAR},
search_value = #{searchValue,jdbcType=VARCHAR},
operator_id_evcs = #{operatorIdEvcs,jdbcType=VARCHAR},
charge_model_evcs = #{chargeModelEvcs,jdbcType=INTEGER},
connector_power_evcs = #{connectorPowerEvcs,jdbcType=DOUBLE},
meter_value_end_evcs = #{meterValueEndEvcs,jdbcType=DOUBLE},
meter_value_start_evcs = #{meterValueStartEvcs,jdbcType=DOUBLE},
operator_id3rdpty_evcs = #{operatorId3rdptyEvcs,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
stop_reason_evcs = #{stopReasonEvcs,jdbcType=INTEGER},
total_power = #{totalPower,jdbcType=DOUBLE},
user_name_evcs = #{userNameEvcs,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
evcs_order_no = #{evcsOrderNo,jdbcType=VARCHAR},
confirm_Result = #{confirmResult,jdbcType=INTEGER},
rate_model_id = #{rateModelId,jdbcType=BIGINT},
charging_mode = #{chargingMode,jdbcType=VARCHAR},
internet_degree_commission = #{internetDegreeCommission,jdbcType=DECIMAL},
`source` = #{source,jdbcType=INTEGER},
tenant_id = #{tenantId,jdbcType=VARCHAR},
operator_id = #{operatorId,jdbcType=BIGINT},
operator_name = #{operatorName,jdbcType=VARCHAR},
clearing_checkout_id = #{clearingCheckoutId,jdbcType=BIGINT}
where clearing_order_id = #{clearingOrderId,jdbcType=BIGINT}
</update>
<update id="updateCheckoutByOperator">
update xhpc_clearing_history_order set clearing_checkout_id=#{checkoutId}
where del_flag=0 and check_status=2 and clearing_checkout_id is null and operator_id=#{operatorId}
</update>
<update id="updateCheckoutByOrderId">
update xhpc_clearing_history_order set clearing_checkout_id=#{checkoutId}
where find_in_set(clearing_order_id, #{orderIds})
</update>
<select id="getLandUser" resultType="map">
select user_id as userId,user_type as userType,operator_id as operatorId from sys_user where user_id =#{userId}
</select>
<select id="getOrderListPage" resultType="map">
select
ho.clearing_order_id as clearingOrderId,
co.charge_order_id as chargeOrderId,
ho.serial_number as serialNumber,
ct.name as chargingStationName,
ter.pile_serial_number as pileSerialNumber,
ter.name as terminalName,
op.operator_id as operatorId,
op.name as operatorName,
cp.power as power,
cp.type as type,
ho.type as orderType,
ho.start_soc as startSoc,
ho.end_soc as endSoc,
ho.vin_normal as vinCode,
ho.internet_serial_number as internetSerialNumber,
ho.evcs_order_no as evcsOrderNo,
ho.total_price as totalPrice,
ho.act_price as actPrice,
ho.confirm_Result as confirmResult,
co.charging_time as chargingTime,
co.charging_degree as chargingDegree,
co.start_time as startTime,
co.end_time as endTime,
co.update_time as updateTime,
co.source as source,
co.Plate_num as plateNum,
dispute_order_status as disputeOrderStatus,
inu.phone as internetUserPhone,
inu.name as internetName,
apu.phone as appUserPhone,
ho.power_price_total as powerPriceTotal,
ho.service_price_total as servicePriceTotal,
ho.promotion_discount as promotionDiscount,
ho.act_power_price as actPowerPrice,
ho.act_service_price as actServicePrice,
(ho.act_power_price+ho.act_service_price) as actSumPrice,
ho.internet_commission as internetCommission,
ho.internet_svc_commission as internetSvcCommission,
ho.internet_degree_commission as internetDegreeCommission,
ho.platform_commission as platformCommission,
ho.platform_svc_commisssion as platformSvcCommisssion,
ho.operation_commission as operationCommission,
ho.operation_svc_commission as operationSvcCommission,
cop.account as communityAccount,
cup.account as customersAccount,
case when co.source=0 then "C端用户"
when co.source=1 then "流量方用户"
when co.source=2 then "社区用户"
else "B端客户!"
end sourceName,
case when ho.charging_mode="1" then "快电"
when ho.charging_mode="2" then "恒大"
when ho.charging_mode="3" then "新电途"
when ho.charging_mode="4" then "小桔"
when ho.charging_mode="微信" then "微信"
when ho.charging_mode="支付宝" then "支付宝"
else "刷卡"
end chargingModeName
from xhpc_clearing_history_order as ho
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
left join xhpc_operator as op on op.operator_id = ct.operator_id
left join xhpc_charge_order co on co.charge_order_id = ho.charge_order_id
left join xhpc_terminal as ter on ter.terminal_id = ho.terminal_id
left join xhpc_charging_pile as cp on cp.charging_pile_id = ter.charging_pile_id
left join et_dispute_orders as ed on ed.start_charge_seq = ho.internet_serial_number and ed.dispute_order_status !=2
left join xhpc_internet_user as inu on inu.internet_user_id = ho.user_id and ho.internet_serial_number is not null and ho.source=1
left join xhpc_app_user as apu on apu.app_user_id = ho.user_id and ho.internet_serial_number is null and ho.source=0
left join xhpc_community_personnel as cop on cop.community_personnel_id = ho.user_id and ho.internet_serial_number is null and ho.source=2
left join xhpc_customers_personnel as cup on cup.customers_personnel_id = ho.user_id and ho.internet_serial_number is null and ho.source=3
<if test="number==1">
inner join (
select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_app_user as xau on xau.app_user_id = hio.user_id where hio.source=0 and xau.phone LIKE concat('%',#{phone}, '%')
union
select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_internet_user as xiu on xiu.internet_user_id = hio.user_id where hio.source=1 and xiu.phone LIKE concat('%',#{phone}, '%')
union
select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_community_personnel as xcp on xcp.community_personnel_id = hio.user_id where hio.source=2 and xcp.account LIKE concat('%',#{phone}, '%')
union
select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_customers_personnel as xcup on xcup.customers_personnel_id = hio.user_id where hio.source=3 and xcup.account LIKE concat('%',#{phone}, '%')
) ut on ut.clearing_order_id = ho.clearing_order_id
</if>
where ho.status =0 and ho.del_flag=0 and ho.clearing_checkout_id = #{checkoutId}
<if test="confirmResult !=null">
and ho.confirm_Result =#{confirmResult}
</if>
<if test="type !=null">
and ho.type=#{type}
</if>
<if test="source !=null">
and ho.source=#{source}
</if>
<if test="plateNum !=null and plateNum !=''">
and co.Plate_num like concat('%', #{plateNum}, '%')
</if>
<if test="internetId !=null">
and inu.internet_user_id=#{internetId}
</if>
<if test="internetSerialNumber !=null and internetSerialNumber !=''">
and ho.internet_serial_number like concat('%', #{internetSerialNumber}, '%')
</if>
<if test="terminalName !=null and terminalName !=''">
and ter.name like concat(#{terminalName}, '%')
</if>
<if test="vinCode !=null and vinCode !=''">
and ho.vin_normal like concat('%', #{vinCode}, '%')
</if>
<if test="evcsOrderNo !=null and evcsOrderNo !=''">
and co.evcs_order_no like concat('%', #{evcsOrderNo}, '%')
</if>
<if test="beginStartTime !=null and beginStartTime !=''">
and ho.start_time &gt;= #{beginStartTime}
</if>
<if test="beginEndTime !=null and beginEndTime !=''">
and ho.start_time &lt;= #{beginEndTime}
</if>
<if test="overStartTime !=null and overStartTime !=''">
and ho.end_time &gt;= #{overStartTime}
</if>
<if test="overEndTime !=null and overEndTime !=''">
and ho.end_time &lt;= #{overEndTime}
</if>
<if test="transactionNumber !=null and transactionNumber !=''">
and ho.serial_number like concat('%', #{transactionNumber}, '%')
</if>
<if test="chargingStationName !=null and chargingStationName !=''">
and ct.name like concat('%', #{chargingStationName}, '%')
</if>
<if test="operatorId !=null">
and op.operator_id =#{operatorId}
</if>
<if test="number==2">
<if test="source ==0">
and ho.clearing_order_id in (select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_app_user as xau on xau.app_user_id = hio.user_id where hio.source=0)
</if>
<if test="source ==1">
and ho.clearing_order_id in(select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_internet_user as xiu on xiu.internet_user_id = hio.user_id where hio.source=1)
</if>
<if test="source ==2">
and ho.clearing_order_id in (select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_community_personnel as xcp on xcp.community_personnel_id = hio.user_id where hio.source=2)
</if>
<if test="source ==3">
and ho.clearing_order_id in (select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_customers_personnel as xcup on xcup.customers_personnel_id = hio.user_id where hio.source=3)
</if>
</if>
<if test="number==3">
<if test="source ==0">
and ho.clearing_order_id in(select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_app_user as xau on xau.app_user_id = hio.user_id where hio.source=0 and xau.phone LIKE concat('%',#{phone}, '%'))
</if>
<if test="source ==1">
and ho.clearing_order_id in(select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_internet_user as xiu on xiu.internet_user_id = hio.user_id where hio.source=1 and xiu.phone LIKE concat('%',#{phone}, '%'))
</if>
<if test="source ==2">
and ho.clearing_order_id in(select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_community_personnel as xcp on xcp.community_personnel_id = hio.user_id where hio.source=2 and xcp.account LIKE concat('%',#{phone}, '%'))
</if>
<if test="source ==3">
and ho.clearing_order_id in(select hio.clearing_order_id as clearing_order_id from xhpc_clearing_history_order as hio INNER JOIN xhpc_customers_personnel as xcup on xcup.customers_personnel_id = hio.user_id where hio.source=3 and xcup.account LIKE concat('%',#{phone}, '%'))
</if>
</if>
<if test="status==1">
and co.charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{userId})
</if>
<if test="status==2">
and co.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId})
</if>
<if test="personnelId !=null">
and ho.user_id=#{personnelId}
</if>
<if test="tenantId !=null and '' !=tenantId">
and ho.tenant_id=#{tenantId}
</if>
<if test="isNotNull==1">
and ho.total_price &gt;=0
</if>
order by ho.create_time desc
</select>
</mapper>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.clearing.mapper.XhpcClearingReceiptMapper">
<resultMap id="BaseResultMap" type="com.xhpc.clearing.domain.XhpcClearingReceiptDomain">
<id column="clearing_receipt_id" jdbcType="BIGINT" property="clearingReceiptId" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="clearing_checkout_ids" jdbcType="VARCHAR" property="clearingCheckoutIds" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
</resultMap>
<sql id="Base_Column_List">
clearing_receipt_id, `type`, `name`, url, clearing_checkout_ids, create_time, create_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from xhpc_clearing_receipt
where clearing_receipt_id = #{clearingReceiptId,jdbcType=BIGINT}
</select>
<insert id="insert" keyColumn="clearing_receipt_id" keyProperty="clearingReceiptId" parameterType="com.xhpc.clearing.domain.XhpcClearingReceiptDomain" useGeneratedKeys="true">
insert into xhpc_clearing_receipt (`type`, `name`, url,
clearing_checkout_ids, create_time, create_by
)
values (#{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},
#{clearingCheckoutIds,jdbcType=BIGINT}, sysdate(), #{createBy,jdbcType=VARCHAR}
)
</insert>
<insert id="insretBatch">
insert into xhpc_clearing_receipt (`type`, `name`, url,
clearing_checkout_ids, create_time, create_by
) values
<foreach collection="domainList" item="domain" separator=",">
(#{domain.type,jdbcType=INTEGER}, #{domain.name,jdbcType=VARCHAR}, #{domain.url,jdbcType=VARCHAR},
#{domain.clearingCheckoutIds,jdbcType=BIGINT}, sysdate(), #{domain.createBy,jdbcType=VARCHAR}
)
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.clearing.mapper.XhpcHistoryOrderMapper">
<resultMap type="com.xhpc.order.domain.XhpcHistoryOrder" id="XhpcHistoryOrderResult">
<id column="history_order_id" jdbcType="BIGINT" property="historyOrderId" />
<result column="charging_station_id" jdbcType="BIGINT" property="chargingStationId" />
<result column="charge_order_id" jdbcType="BIGINT" property="chargeOrderId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="terminal_id" jdbcType="BIGINT" property="terminalId" />
<result column="serial_number" jdbcType="VARCHAR" property="serialNumber" />
<result column="internet_serial_number" jdbcType="VARCHAR" property="internetSerialNumber" />
<result column="power_price_total" jdbcType="DECIMAL" property="powerPriceTotal" />
<result column="service_price_total" jdbcType="DECIMAL" property="servicePriceTotal" />
<result column="total_price" jdbcType="DECIMAL" property="totalPrice" />
<result column="promotion_discount" jdbcType="DECIMAL" property="promotionDiscount" />
<result column="act_price" jdbcType="DECIMAL" property="actPrice" />
<result column="act_power_price" jdbcType="DECIMAL" property="actPowerPrice" />
<result column="act_service_price" jdbcType="DECIMAL" property="actServicePrice" />
<result column="internet_commission" jdbcType="DECIMAL" property="internetCommission" />
<result column="internet_svc_commission" jdbcType="DECIMAL" property="internetSvcCommission" />
<result column="platform_commission" jdbcType="DECIMAL" property="platformCommission" />
<result column="platform_svc_commisssion" jdbcType="DECIMAL" property="platformSvcCommisssion" />
<result column="operation_commission" jdbcType="DECIMAL" property="operationCommission" />
<result column="operation_svc_commission" jdbcType="DECIMAL" property="operationSvcCommission" />
<result column="start_soc" jdbcType="VARCHAR" property="startSoc" />
<result column="end_soc" jdbcType="VARCHAR" property="endSoc" />
<result column="reconciliation_status" jdbcType="INTEGER" property="reconciliationStatus" />
<result column="sorting_status" jdbcType="INTEGER" property="sortingStatus" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="del_flag" jdbcType="INTEGER" property="delFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="vin_normal" jdbcType="VARCHAR" property="vinNormal" />
<result column="search_value" jdbcType="VARCHAR" property="searchValue" />
<result column="operator_id_evcs" jdbcType="VARCHAR" property="operatorIdEvcs" />
<result column="charge_model_evcs" jdbcType="INTEGER" property="chargeModelEvcs" />
<result column="connector_power_evcs" jdbcType="DOUBLE" property="connectorPowerEvcs" />
<result column="meter_value_end_evcs" jdbcType="DOUBLE" property="meterValueEndEvcs" />
<result column="meter_value_start_evcs" jdbcType="DOUBLE" property="meterValueStartEvcs" />
<result column="operator_id3rdpty_evcs" jdbcType="VARCHAR" property="operatorId3rdptyEvcs" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="stop_reason_evcs" jdbcType="INTEGER" property="stopReasonEvcs" />
<result column="total_power" jdbcType="DOUBLE" property="totalPower" />
<result column="user_name_evcs" jdbcType="VARCHAR" property="userNameEvcs" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="evcs_order_no" jdbcType="VARCHAR" property="evcsOrderNo" />
<result column="confirm_Result" jdbcType="INTEGER" property="confirmResult" />
<result column="rate_model_id" jdbcType="BIGINT" property="rateModelId" />
<result column="charging_mode" jdbcType="VARCHAR" property="chargingMode" />
<result column="internet_degree_commission" jdbcType="DECIMAL" property="internetDegreeCommission" />
<result column="source" jdbcType="INTEGER" property="source" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
</resultMap>
<sql id="Base_Column_List">
ho.history_order_id, ho.charging_station_id, ho.charge_order_id, ho.user_id, ho.terminal_id, ho.serial_number,
ho.internet_serial_number, ho.power_price_total, ho.service_price_total, ho.total_price, ho.promotion_discount,
ho.act_price, ho.act_power_price, ho.act_service_price, ho.internet_commission, ho.internet_svc_commission,
ho.platform_commission, ho.platform_svc_commisssion, ho.operation_commission, ho.operation_svc_commission,
ho.start_soc, ho.end_soc, ho.reconciliation_status, ho.sorting_status, ho.`type`, ho.`status`, ho.del_flag,
ho.create_time, ho.create_by, ho.update_time, ho.update_by, ho.remark, ho.`state`, ho.vin_normal, ho.search_value,
ho.operator_id_evcs, ho.charge_model_evcs, ho.connector_power_evcs, ho.meter_value_end_evcs,
ho.meter_value_start_evcs, ho.operator_id3rdpty_evcs, ho.start_time, ho.end_time, ho.stop_reason_evcs,
ho.total_power, ho.user_name_evcs, ho.phone, ho.evcs_order_no, ho.confirm_Result, ho.rate_model_id,
ho.charging_mode, ho.internet_degree_commission, ho.`source`, ho.tenant_id
</sql>
<select id="selectUnsyncOrderList" resultType="com.xhpc.clearing.domain.XhpcHistoryOrderDomain">
select
<include refid="Base_Column_List" />,
op.operator_id,
op.name as 'operator_name'
from xhpc_history_order as ho
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
left join xhpc_operator as op on op.operator_id = ct.operator_id
where ho.state <![CDATA[ <> ]]> 3 and ho.del_flag=0 and ho.create_time BETWEEN '2022-04-01' and '2022-04-05'
-- and date_format(end_time, '%Y-%m-%d') <![CDATA[ <= ]]> date_sub(curdate(), interval 1 day)
</select>
<select id="selectUnclearingAmount" resultType="java.math.BigDecimal">
select
ifnull(sum(ho.total_price), 0)
from xhpc_history_order as ho
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
left join xhpc_operator as op on op.operator_id = ct.operator_id
where ho.state <![CDATA[ <> ]]> 3 and ho.del_flag=0 and ct.operator_id=#{operatorId}
</select>
<update id="updateStatusBatchByOrderIds">
update xhpc_history_order set state=#{status}
where history_order_id in
<foreach collection="orderIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper>