From 441faa10a54076abb9b1a7117782daf4712f9ab3 Mon Sep 17 00:00:00 2001 From: wen <1455474577@qq.com> Date: Tue, 21 Dec 2021 11:49:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=BC=80=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E5=9B=9E=E6=98=BE=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xhpc-modules/pom.xml | 1 + xhpc-modules/xhpc-invoice/pom.xml | 136 +++ .../xhpc/invoice/XhpcInvoiceApplication.java | 37 + .../controller/XhpcInvoiceController.java | 65 ++ .../domain/AllInvoiceOrdersRequest.java | 64 ++ .../domain/AllInvoiceOrdersResponse.java | 89 ++ .../invoice/domain/SpecificInvoiceWrap.java | 211 ++++ .../mapper/XhpcChargingStationMapper.java | 270 +++++ .../XhpcInvoiceMapHistoryOrderMapper.java | 42 + .../invoice/mapper/XhpcInvoiceMapper.java | 28 + .../invoice/mapper/XhpcOperatorMapper.java | 114 +++ .../com/xhpc/invoice/pojo/XhpcInvoice.java | 154 +++ .../pojo/XhpcInvoiceMapHistoryOrder.java | 89 ++ .../com/xhpc/invoice/pojo/XhpcOperator.java | 408 ++++++++ .../invoice/service/XhpcInvoiceService.java | 25 + .../service/impl/XhpcInvoiceServiceImpl.java | 90 ++ .../src/main/resources/banner.txt | 10 + .../src/main/resources/bootstrap.yml | 25 + .../src/main/resources/logback.xml | 75 ++ .../mapper/XhpcChargingStationMapper.xml | 922 ++++++++++++++++++ .../XhpcInvoiceMapHistoryOrderMapper.xml | 143 +++ .../resources/mapper/XhpcInvoiceMapper.xml | 351 +++++++ .../resources/mapper/XhpcOperatorMapper.xml | 392 ++++++++ 23 files changed, 3741 insertions(+) create mode 100644 xhpc-modules/xhpc-invoice/pom.xml create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/XhpcInvoiceApplication.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersRequest.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersResponse.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/SpecificInvoiceWrap.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcChargingStationMapper.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapHistoryOrderMapper.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapper.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcOperatorMapper.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoice.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoiceMapHistoryOrder.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcOperator.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/XhpcInvoiceService.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java create mode 100644 xhpc-modules/xhpc-invoice/src/main/resources/banner.txt create mode 100644 xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml create mode 100644 xhpc-modules/xhpc-invoice/src/main/resources/logback.xml create mode 100644 xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcChargingStationMapper.xml create mode 100644 xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml create mode 100644 xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapper.xml create mode 100644 xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcOperatorMapper.xml diff --git a/xhpc-modules/pom.xml b/xhpc-modules/pom.xml index 50a08d65..9142499f 100644 --- a/xhpc-modules/pom.xml +++ b/xhpc-modules/pom.xml @@ -17,6 +17,7 @@ xhpc-payment xhpc-order xhpc-wxma + xhpc-invoice xhpc-modules diff --git a/xhpc-modules/xhpc-invoice/pom.xml b/xhpc-modules/xhpc-invoice/pom.xml new file mode 100644 index 00000000..a4ef328e --- /dev/null +++ b/xhpc-modules/xhpc-invoice/pom.xml @@ -0,0 +1,136 @@ + + + + xhpc-modules + com.ruoyi + 3.0.0 + + 4.0.0 + + xhpc-invoice + + + 发票服务 + + + + 8 + 8 + + + + + + + junit + junit + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + mysql + mysql-connector-java + + + + + com.ruoyi + ruoyi-common-datasource + + + + + com.ruoyi + ruoyi-common-datascope + + + + + com.ruoyi + ruoyi-common-log + + + + + com.ruoyi + ruoyi-common-swagger + + + com.ruoyi + ruoyi-common-core + + + com.squareup.okhttp3 + okhttp + + + com.ruoyi + xhpc-common + 3.0.0 + compile + + + + + ${project.artifactId} + + + src/main/resources + + + src/main/java + + **/*.xml + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.4.0 + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/XhpcInvoiceApplication.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/XhpcInvoiceApplication.java new file mode 100644 index 00000000..51a0ad3d --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/XhpcInvoiceApplication.java @@ -0,0 +1,37 @@ +package com.xhpc.invoice; + +import com.xhpc.common.security.annotation.EnableCustomConfig; +import com.xhpc.common.security.annotation.EnableRyFeignClients; +import com.xhpc.common.swagger.annotation.EnableCustomSwagger2; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author WH + * @date 2021/12/7 14:55 + * @since version-1.0 + */ +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableRyFeignClients +@SpringBootApplication +@MapperScan("com.xhpc.invoice.mapper") +public class XhpcInvoiceApplication { + + public static void main(String[] args) { + + SpringApplication.run(XhpcInvoiceApplication.class, args); + System.out.println("(♥◠‿◠)ノ゙ 发票模块启动成功 ლ(´ڡ`ლ)゙ \n" + + " .-------. ____ __ \n" + + " | _ _ \\ \\ \\ / / \n" + + " | ( ' ) | \\ _. / ' \n" + + " |(_ o _) / _( )_ .' \n" + + " | (_,_).' __ ___(_ o _)' \n" + + " | |\\ \\ | || |(_,_)' \n" + + " | | \\ `' /| `-' / \n" + + " | | \\ / \\ / \n" + + " ''-' `'-' `-..-' "); + } + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java new file mode 100644 index 00000000..393b0d3c --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java @@ -0,0 +1,65 @@ +package com.xhpc.invoice.controller; + +import com.xhpc.common.core.web.controller.BaseController; +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.invoice.domain.AllInvoiceOrdersRequest; +import com.xhpc.invoice.domain.SpecificInvoiceWrap; +import com.xhpc.invoice.service.XhpcInvoiceService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 关于后台处理发票的接口 + * + * @author WH + * @date 2021/12/20 10:47 + * @since version-1.0 + */ +@RestController +@RequestMapping("/invoice") +public class XhpcInvoiceController extends BaseController { + + @Resource + XhpcInvoiceService xhpcInvoiceService; + + /** + * 用于在财务点击开票时,回显开票数据 + * + * @param invoiceIdMap 一个存储着invoiceId的Map集合 + * @return specificInvoiceWrap 装着回显数据的包装类 + * @author WH + * @date 2021/12/20 10:48 + * @since version-1.0 + */ + @PostMapping("/selectSpecificInvoice") + public AjaxResult selectSpecificInvoice(@RequestBody Map invoiceIdMap) { + + Long invoiceId = Long.valueOf(String.valueOf(invoiceIdMap.get("invoiceId"))); + SpecificInvoiceWrap specificInvoiceWrap = xhpcInvoiceService.selectSpecificInvoice(invoiceId); + if (specificInvoiceWrap == null) { + AjaxResult.error("要回显的订单发票id有误"); + } + return AjaxResult.success(specificInvoiceWrap); + } + + /** + * 用于在后台显示,所有发票信息,包括待开发票和已开发票的信息 + * + * @param requestData 前端传递过来的要查询的参数 + * @return AllInvoiceOrdersResponse 装着回显数据的包装类 + * @author WH + * @date 2021/12/21 11:33 + * @since version-1.0 + */ + @PostMapping("/selectAllInvoiceOrders") + public AjaxResult selectAllInvoiceOrders(@RequestBody AllInvoiceOrdersRequest requestData) { + + return null; + } + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersRequest.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersRequest.java new file mode 100644 index 00000000..711ab6a3 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersRequest.java @@ -0,0 +1,64 @@ +package com.xhpc.invoice.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * /selectAllInvoiceOrders接口,接收请求的数据的包装类对象 + * + * @author WH + * @date 2021/12/21 10:51 + * @since version-1.0 + */ +@NoArgsConstructor +@Data +public class AllInvoiceOrdersRequest { + + /** + * 申请人(手机号) + */ + @JsonProperty("creator") + private String creator; + /** + * 申请人类型(0为c端用户,1为B端用户,2为机构用户) + */ + @JsonProperty("creatorType") + private Integer creatorType; + /** + * 发票状态(0表示未开票,1表示已经开票,2表示开票失败) + */ + @JsonProperty("status") + private Integer status; + /** + * 发票申请起始时间 + */ + @JsonProperty("startCreatorTime") + private String startCreatorTime; + /** + * 发票申请终点时间 + */ + @JsonProperty("endCreatorTime") + private String endCreatorTime; + /** + * 开票起始时间 + */ + @JsonProperty("startInvoicingTime") + private String startInvoicingTime; + /** + * 开票终点时间 + */ + @JsonProperty("endInvoicingTime") + private String endInvoicingTime; + /** + * 当前所在页数 + */ + @JsonProperty("currentPage") + private Integer currentPage; + /** + * 当前页要显示多少条记录 + */ + @JsonProperty("items") + private Integer items; + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersResponse.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersResponse.java new file mode 100644 index 00000000..f865a59e --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersResponse.java @@ -0,0 +1,89 @@ +package com.xhpc.invoice.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.List; + +/** + * /selectAllInvoiceOrders接口的响应包装数据类 + * + * @author WH + * @date 2021/12/21 10:50 + * @since version-1.0 + */ +@NoArgsConstructor +@Data +public class AllInvoiceOrdersResponse { + + /** + * 历史订单总记录条数 + */ + @JsonProperty("totalItems") + private Long totalItems; + /** + * 已开发票的金额 + */ + @JsonProperty("invoicedSumMoney") + private BigDecimal invoicedSumMoney; + /** + * 未开发票的金额 + */ + @JsonProperty("notInvoiceSumMoney") + private BigDecimal notInvoiceSumMoney; + /** + * 当前页的数据 + */ + @JsonProperty("items") + private List items; + + @NoArgsConstructor + @Data + public static class ItemsDTO { + + /** + * 发票id + */ + @JsonProperty("invoiceId") + private Long invoiceId; + /** + * 申请人(手机号) + */ + @JsonProperty("creator") + private String creator; + /** + * 申请人类型(0为c端用户,1为B端用户,2为机构用户) + */ + @JsonProperty("creatorType") + private Integer creatorType; + /** + * 发票金额 + */ + @JsonProperty("invoiceMoney") + private BigDecimal invoiceMoney; + /** + * 发票状态,0为未开票,1为已经开发票,2为开票失败 + */ + @JsonProperty("status") + private Integer status; + /** + * 发票申请时间 + */ + @JsonProperty("createTime") + private String createTime; + /** + * 开票时间 + */ + @JsonProperty("invoicingTime") + private String invoicingTime; + /** + * 开票人 + */ + @JsonProperty("drawer") + private String drawer; + + } + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/SpecificInvoiceWrap.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/SpecificInvoiceWrap.java new file mode 100644 index 00000000..c87fc1a4 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/SpecificInvoiceWrap.java @@ -0,0 +1,211 @@ +package com.xhpc.invoice.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 用于保存指定发票回显数据的DTO + * + * @author WH + * @date 2021/12/20 10:58 + * @since version-1.0 + */ +@NoArgsConstructor +@Data +public class SpecificInvoiceWrap { + + /** + * 申请人 + */ + @JsonProperty("creator") + private String creator; + /** + * 申请人类型,0为c端用户,1为b端用户,2为机构用户 + */ + @JsonProperty("creatorType") + private Integer creatorType; + /** + * 发票申请时间 + */ + @JsonProperty("invoiceCreateTime") + private String invoiceCreateTime; + /** + * 发票开票状态(0为未开票,1为已开票,2为开票失败) + */ + @JsonProperty("status") + private Integer status; + /** + * 发票id + */ + @JsonProperty("invoiceId") + private Long invoiceId; + /** + * 发票接收邮箱 + */ + @JsonProperty("receiveEmail") + private String receiveEmail; + /** + * 发票抬头类型 + */ + @JsonProperty("titleType") + private Integer titleType; + /** + * 发票抬头内容 + */ + @JsonProperty("titleContent") + private String titleContent; + /** + * 税号 + */ + @JsonProperty("dutyNumber") + private String dutyNumber; + /** + * 发票内容 + */ + @JsonProperty("invoiceContent") + private String invoiceContent; + /** + * 发票金额 + */ + @JsonProperty("invoiceMoney") + private BigDecimal invoiceMoney; + /** + * 发票包含的订单的总电费金额 + */ + @JsonProperty("invoiceTotalEletricMoney") + private BigDecimal invoiceTotalEletricMoney; + /** + * 发票包含的订单的总服务费金额 + */ + @JsonProperty("invoiceTotalServiceMoney") + private BigDecimal invoiceTotalServiceMoney; + /** + * 公司地址 + */ + @JsonProperty("firmAddress") + private String firmAddress; + /** + * 公司电话 + */ + @JsonProperty("firmPhone") + private String firmPhone; + /** + * 公司开户行 + */ + @JsonProperty("firmBank") + private String firmBank; + /** + * 公司开户行账号 + */ + @JsonProperty("firmBankAccount") + private String firmBankAccount; + /** + * 发票是否展示交易日期区间(0,不展示,1展示) + */ + @JsonProperty("isShowDate") + private Integer isShowDate; + /** + * 用户备注 + */ + @JsonProperty("userNotes") + private String userNotes; + /** + * 财务备注 + */ + @JsonProperty("financeNotes") + private String financeNotes; + /** + * 发票开票时间 + */ + @JsonProperty("invoicingTime") + private String invoicingTime; + /** + * 电子发票上传地址 + */ + @JsonProperty("electricInvoiceUrl") + private String electricInvoiceUrl; + /** + * 开票人(开这个发票的人) + */ + @JsonProperty("drawer") + private String drawer; + /** + * 该发票所包含的历史订单的开始时间-结束时间 + */ + @JsonProperty("historyOrderScope") + private String historyOrderScope; + /** + * 该发票所包含的历史订单对象 + */ + @JsonProperty("historyOrders") + private HistoryOrdersDTO historyOrders; + + @NoArgsConstructor + @Data + public static class HistoryOrdersDTO { + + /** + * 历史订单总条数 + */ + @JsonProperty("totalItems") + private Long totalItems; + /** + * 历史订单对象集合 + */ + @JsonProperty("historyOrdersData") + private List historyOrdersData; + + @NoArgsConstructor + @Data + public static class HistoryOrdersDataDTO { + + /** + * 历史订单id + */ + @JsonProperty("historyOrderId") + private String historyOrderId; + /** + * 历史订单来源 + */ + @JsonProperty("chargingMode") + private String chargingMode; + /** + * 历史订单运营商名称 + */ + @JsonProperty("operatorName") + private String operatorName; + /** + * 历史订单电费金额 + */ + @JsonProperty("eletricMoney") + private BigDecimal eletricMoney; + /** + * 历史订单服务费金额 + */ + @JsonProperty("serviceMoney") + private BigDecimal serviceMoney; + /** + * 历史订单实际价格 + */ + @JsonProperty("actPrice") + private BigDecimal actPrice; + /** + * 历史订单序列号 + */ + @JsonProperty("historySerialNumber") + private String historySerialNumber; + /** + * 历史订单创建时间 + */ + @JsonProperty("historyCreateTime") + private String historyCreateTime; + + } + + } + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcChargingStationMapper.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcChargingStationMapper.java new file mode 100644 index 00000000..214ef059 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcChargingStationMapper.java @@ -0,0 +1,270 @@ +package com.xhpc.invoice.mapper; + +import com.xhpc.common.domain.XhpcChargingStation; +import com.xhpc.common.domain.XhpcRate; +import com.xhpc.common.domain.XhpcRateModel; +import com.xhpc.common.domain.XhpcRateTime; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 电站Mapper接口 + * + * @author yuyang + * @date 2021-07-19 + */ +public interface XhpcChargingStationMapper { + + /** + * 查询电站 + * + * @param chargingStationId 电站ID + * @return 电站 + */ + XhpcChargingStation selectXhpcChargingStationById(Long chargingStationId); + + + /** + * 查询电站 + * + * @param chargingStationName 电站名称 + * @return 电站 + */ + XhpcChargingStation selectXhpcChargingStationByName(String chargingStationName); + + /** + * 查询电站列表 + * + * @param name 电站名称 + * @param operatorName 运营商名称 + * @return 电站集合 + */ + List> selectXhpcChargingStationList(@Param("name") String name, @Param("operatorName") String operatorName, @Param("operatorId") Long operatorId, @Param("type") Integer type); + + /** + * 新增电站 + * + * @param xhpcChargingStation 电站 + * @return 结果 + */ + int insertXhpcChargingStation(XhpcChargingStation xhpcChargingStation); + + /** + * 修改电站 + * + * @param xhpcChargingStation 电站 + * @return 结果 + */ + int updateXhpcChargingStation(XhpcChargingStation xhpcChargingStation); + + /** + * 删除电站 + * + * @param chargingStationId 电站ID + * @return 结果 + */ + int updateXhpcChargingStationById(Long chargingStationId); + + /** + * 批量删除电站 + * + * @param chargingStationIds 需要删除的数据ID + * @return 结果 + */ + int updateXhpcChargingStationByIds(Long[] chargingStationIds); + + /** + * 状态(0启用 1停用) + * + * @param status 0启用 1停用 + * @return 结果 + */ + void status(@Param("status") Integer status, @Param("chargingStationId") Long chargingStationId); + + + /** + * APP端、小程序是否可见 + * + * @param clientVisible app可见值 + * @param chargingStationId 场站id + * @return 结果 + */ + void clientVisible(@Param("clientVisible") String clientVisible, @Param("chargingStationId") Long chargingStationId); + + /** + * 合作的电站 + * + * @param chargingStationId 电站ID + * @return 电站 + */ + List> stationInternetBlackList(Long chargingStationId); + + + /** + * 电站详情信息 + * + * @param chargingStationId 电站ID + * @return 电站 + */ + Map getXhpcChargingStationMessage(@Param("chargingStationId") Long chargingStationId); + + + /** + * 微信小程序电站列表 + * + * @param name 电站名称 + * @param serviceFacilities 标签集合(服务设施) + * @param code 城市id + * @param longitude 经度 + * @param latitude 维度 + * @param clientVisible 微信小程序是否可见 2可见 + * @return + */ + List> getWXList(@Param("name") String name, @Param("serviceFacilities") List serviceFacilities, @Param("code") Integer code, @Param("longitude") String longitude, @Param("latitude") String latitude, @Param("clientVisible") Integer clientVisible, @Param("date") String date); + + + /** + * 根据code获取数据 + * + * @param code 字典code + * @param serviceFacilities 筛选条件 + * @return 电站 + */ + List> getCode(@Param("code") String code, @Param("serviceFacilities") List serviceFacilities); + + /** + * 电站详情(站点详情) + * + * @param chargingStationId 电站ID + * @return 电站 + */ + Map getWXXhpcChargingStationMessage(@Param("chargingStationId") Long chargingStationId, @Param("longitude") String longitude, @Param("latitude") String latitude); + + + /** + * 获取图片信息 + * + * @param imgIds + * @return + */ + List> getImageList(@Param("imgIds") List imgIds); + + + /** + * 电站详情---价格详情 + * + * @param chargingStationId 电站ID + * @return 电站 + */ + List> getWXXhpcRateTimeMassage(@Param("chargingStationId") Long chargingStationId); + + + /** + * 电站详情---终端列表 + * + * @param chargingStationId 电站ID + * @return 电站 + */ + List> getWXXhpcTerminalMassage(@Param("chargingStationId") Long chargingStationId); + + + /** + * 添加费率模型 + */ + int addXhpcRateModel(XhpcRateModel xhpcRateModel); + + /** + * 添加场站信息 + */ + int addXhpcChargingStation(XhpcChargingStation xhpcChargingStation); + + /** + * 添加费率 + */ + int addXhpcRate(XhpcRate xhpcRate); + + + /** + * 添加费率时段 + */ + int addXhpcRateTime(XhpcRateTime xhpcRateTime); + + + /** + * 返回费率 + */ + List> getXhpcRateList(@Param("chargingStationId") Long chargingStationId); + + + /** + * 返回费率时段(设置时段) + */ + List> getXhpcRateTimeTypeList(@Param("chargingStationId") Long chargingStationId, @Param("type") Integer type); + + + /** + * 今日充电量、今日充电用户、今日充电次数 + */ + Map getXhpcRateTimeOrderStatistics(@Param("chargingStationId") Long chargingStationId, @Param("createTime") String createTime); + + /** + * 删除之前的费率 + * + * @param chargingStationId + * @return + */ + int updateXhpcRate(@Param("chargingStationId") Long chargingStationId); + + /** + * 删除之前的费率时段 + * + * @param chargingStationId + * @return + */ + int updateXhpcRateTime(@Param("chargingStationId") Long chargingStationId); + + /** + * 根据场站id获取桩编号 + * + * @param chargingStationId + * @return + */ + Set getXchargingPileList(@Param("chargingStationId") Long chargingStationId); + + /** + * 按照没30分钟为一段进行分组 + * + * @param chargingStationId + * @return + */ + List> getXhpcRateTimeNumber(@Param("chargingStationId") Long chargingStationId); + + /** + * 修改桩的计费模型id + * + * @param chargingStationId + */ + void updateXhpcChargingPile(@Param("chargingStationId") Long chargingStationId, @Param("rateModelId") Long rateModelId); + + /** + * 修改终端的计费模型id + * + * @param chargingStationId + */ + void updateXhpcTerminal(@Param("chargingStationId") Long chargingStationId, @Param("rateModelId") Long rateModelId); + + + /** + * 获取登陆用户信息 + */ + Map getLandUser(@Param("userId") Long userId); + + /** + * 添加场站数据权限 + */ + void addXhpcUserPrivilege(@Param("userId") Long userId, @Param("chargingStationId") Long chargingStationId); + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapHistoryOrderMapper.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapHistoryOrderMapper.java new file mode 100644 index 00000000..5fa916da --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapHistoryOrderMapper.java @@ -0,0 +1,42 @@ +package com.xhpc.invoice.mapper; + +import com.xhpc.invoice.pojo.XhpcInvoiceMapHistoryOrder; + +import java.util.List; + +/** + * XhpcInvoiceMapHistoryOrderMapper + * + * @author WH + * @date 2021/12/20 15:47 + * @since version-1.0 + */ +public interface XhpcInvoiceMapHistoryOrderMapper { + + int insert(XhpcInvoiceMapHistoryOrder record); + + int insertSelective(XhpcInvoiceMapHistoryOrder record); + + /** + * 通过发票id,查询对应的发票所包含的历史订单信息 + * + * @param invoiceId 发票id + * @return 装有多个历史订单集合 + * @author WH + * @date 2021/12/20 15:46 + * @since version-1.0 + */ + List findOrdersByInvoiceId(Long invoiceId); + + /** + * 通过发票id,查询其所属的历史订单的生成的时间区间,即最大历史订单时间与最小历史订单时间 + * + * @param invoiceId 发票id + * @return 装有最大订单时间与最小订单时间的一个List集合,第一个参数为最小值,第二个最大值 + * @author WH + * @date 2021/12/21 9:51 + * @since version-1.0 + */ + List getHistoryOrderScopeByInvoiceId(Long invoiceId); + +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapper.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapper.java new file mode 100644 index 00000000..6a21515d --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapper.java @@ -0,0 +1,28 @@ +package com.xhpc.invoice.mapper; + +import com.xhpc.invoice.pojo.XhpcInvoice; + +public interface XhpcInvoiceMapper { + + int deleteByPrimaryKey(Long invoiceId); + + int insert(XhpcInvoice record); + + int insertSelective(XhpcInvoice record); + + /** + * 通过发票id查询发票信息 + * + * @param invoiceId 发票id + * @return 发票信息实体类 + * @author WH + * @date 2021/12/20 17:18 + * @since version-1.0 + */ + XhpcInvoice selectByPrimaryKey(Long invoiceId); + + int updateByPrimaryKeySelective(XhpcInvoice record); + + int updateByPrimaryKey(XhpcInvoice record); + +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcOperatorMapper.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcOperatorMapper.java new file mode 100644 index 00000000..c754db50 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcOperatorMapper.java @@ -0,0 +1,114 @@ +package com.xhpc.invoice.mapper; + +import com.xhpc.invoice.pojo.XhpcOperator; +import com.xhpc.system.api.domain.SysUser; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 运营商信息 数据层 + * + * @author ruoyi + */ +public interface XhpcOperatorMapper { + + /** + * 修改运营商信息 + * + * @param xhpcOperator 运营商信息 + * @return 结果 + */ + public int update(XhpcOperator xhpcOperator); + + /** + * 新增运营商信息 + * + * @param xhpcOperator 运营商信息 + * @return 结果 + */ + public int insert(XhpcOperator xhpcOperator); + + /** + * 批量删除运营商信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteByIds(String[] ids); + + /** + * 校验账号是否唯一 + * + * @param phone 用户手机号 + * @return 结果 + */ + public XhpcOperator checkAccountUnique(@Param("phone") String phone); + + /** + * 查询运营商详情 + * + * @param operatorId 运营商id + * @return 结果 + */ + public Map info(@Param("operatorId") Long operatorId); + + /** + * 获取运营商分页列表 + * + * @param name 运营商名称 + * @param contactName 联系人 + * @param contactPhone 联系人电话 + * @return 结果 + */ + public List> selectOperatorList(@Param("name") String name, @Param("contactName") String contactName, @Param("contactPhone") String contactPhone, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd); + + /** + * 通过用户ID删除用户和角色关联 + * + * @param userId 用户ID + * @return 结果 + */ + public int deleteUserRoleByUserId(@Param("userId") Long userId); + + /** + * 通过用户ID删除用户和岗位关联 + * + * @param userId 用户ID + * @return 结果 + */ + public int deleteUserPostByUserId(@Param("userId") Long userId); + + /** + * 删除角色信息 + * + * @param roleName 角色名称 + * @return 结果 + */ + public int deleteRoleByName(@Param("roleName") String roleName); + + /** + * 通过用户ID删除用户 + * + * @param sysUser 用户 + * @return 结果 + */ + public int deleteUserById(SysUser sysUser); + + /** + * 通过运营商ID查询用户 + * + * @param operatorId 运营商ID + * @return 结果 + */ + public SysUser getUserByOperatorId(@Param("operatorId") Long operatorId); + + /** + * 查询运营商列表 + * + * @return 结果 + */ + public List> getOperatorId(); + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoice.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoice.java new file mode 100644 index 00000000..eea35a73 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoice.java @@ -0,0 +1,154 @@ +package com.xhpc.invoice.pojo; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * xhpc_invoice + * + * @author + */ +@Data +public class XhpcInvoice implements Serializable { + + /** + * 发票id + */ + private Long invoiceId; + + /** + * 接收邮箱 + */ + private String receiveEmail; + + /** + * 0为企业抬头 1为非企业抬头 + */ + private Integer titleType; + + /** + * 发票抬头内容 + */ + private String titleContent; + + /** + * 税号 + */ + private String dutyNumber; + + /** + * 发票内容 + */ + private String invoiceContent; + + /** + * 发票金额 + */ + private BigDecimal invoiceMoney; + + /** + * 发票包含的订单的总电费金额 + */ + private BigDecimal invoiceOrderEletricTotalMoney; + + /** + * 发票包含的订单的总服务费金额 + */ + private BigDecimal invoiceOrderServiceTotalMoney; + + /** + * 公司地址 + */ + private String firmAddress; + + /** + * 公司电话 + */ + private String firmPhone; + + /** + * 公司开户行 + */ + private String firmBank; + + /** + * 公司开户行账号 + */ + private String firmBankAccount; + + /** + * 所开发票是否展示交易记录(0为不展示,1为展示) + */ + private Integer isShowDate; + + /** + * 用户备注 + */ + private String userNotes; + + /** + * 创建者id + */ + private Long creatorId; + + /** + * 创建者类型(0为c端用户,1为B端用户,2为机构用户) + */ + private Integer creatorType; + + /** + * 创建人(用户手机号) + */ + private String creator; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 开票状态(0表示未开票,1表示已经开票,2表示开票失败) + */ + private Integer status; + + /** + * 财务输入的开票时间 + */ + private Date invoicingTime; + + /** + * 开票人 + */ + private String drawer; + + /** + * 开票人(财务备注) + */ + private String financeNotes; + + /** + * 开票的电子发票pdf保存地址 + */ + private String electricInvoiceUrl; + + /** + * 更新者 + */ + private Long updator; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 逻辑删除字段 + */ + private Integer delFlag; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoiceMapHistoryOrder.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoiceMapHistoryOrder.java new file mode 100644 index 00000000..62428c30 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoiceMapHistoryOrder.java @@ -0,0 +1,89 @@ +package com.xhpc.invoice.pojo; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * xhpc_invoice_map_history_order + * + * @author + */ +@Data +public class XhpcInvoiceMapHistoryOrder implements Serializable { + + /** + * 发票id + */ + private Long invoiceId; + + /** + * 该发票所选中的历史订单id + */ + private Long historyOrderId; + + /** + * 该发票所选中的历史订单的用户id + */ + private Long historyUserId; + + /** + * 该发票所选中的历史订单的用户类型(0为C端用户 1流量用户) + */ + private Long historyUserType; + + /** + * 该发票所选中的历史订单订单编号 + */ + private String hisotrySerialNumber; + + /** + * 该发票所选中的历史订单电费 + */ + private BigDecimal powerPriceTotal; + + /** + * 该发票所选中的历史订单服务费 + */ + private BigDecimal servicePriceTotal; + + /** + * 该发票所选中的历史订单电站活动抵扣 + */ + private BigDecimal promotionDiscount; + + /** + * 该发票所选中的历史订单实际价格(用户支付的钱) + */ + private BigDecimal historyActPrice; + + /** + * 该发票所选中的历史订单创建时间 + */ + private Date createTime; + + /** + * 充电方式(订单来源) + */ + private String chargingMode; + + /** + * 电站id(通过它查询运营商) + */ + private Long chargingStationId; + + /** + * 该发票所选中的历史订单充电的终端id + */ + private Long terminalId; + + /** + * 逻辑删除字段 + */ + private Integer delFlag; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcOperator.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcOperator.java new file mode 100644 index 00000000..88c92569 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcOperator.java @@ -0,0 +1,408 @@ +package com.xhpc.invoice.pojo; + +import com.xhpc.common.core.web.domain.BaseEntity; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 运营商表 xhpc_operator + * + * @author ruoyi + */ +public class XhpcOperator extends BaseEntity { + + /** + * 运营商id + */ + private Long operatorId; + + /** + * 名称 + */ + @NotBlank(message = "运营商名称不能为空") + @Length(max = 12, message = "运营商名称不能超过12位") + private String name; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空") + @Length(max = 12, message = "联系人不能超过12位") + private String contactName; + + /** + * 联系人电话 + */ + @NotBlank(message = "联系人电话不能为空") + private String contactPhone; + + /** + * 手机号(账号) + */ + @NotBlank(message = "手机号不能为空") + @Length(max = 11, message = "手机号不能超过11位") + private String phone; + + /** + * 运营商属性 + */ + @NotNull(message = "运营商属性不能为空") + private Integer attribute; + + + /** + * 税号 + */ + @NotNull(message = "税号不能为空") + @Length(max = 50, message = "税号不能超过50位") + private String dutyParagraph; + + + /** + * 开户行 + */ + @NotBlank(message = "开户行不能为空") + @Length(max = 20, message = "开户行电话不能超过20位") + private String openBank; + + /** + * 卡号 + */ + @NotNull(message = "卡号不能为空") + @Length(max = 20, message = "卡号不能超过20位") + private String cardNumber; + + /** + * 地址code + */ + @NotBlank(message = "地址不能为空") + private String areaCode; + + /** + * 地址 + */ + @NotBlank(message = "地址不能为空") + @Length(max = 50, message = "地址不能超过50位") + private String address; + + /** + * 详细地址 + */ + @NotBlank(message = "详细地址不能为空") + @Length(max = 50, message = "详细地址不能超过50位") + private String detailedAddress; + + /** + * 经度 + */ + @NotNull(message = "经度不能为空") + private String longitude; + + /** + * 纬度 + */ + @NotBlank(message = "纬度不能为空") + private String latitude; + + /** + * 邮箱 + */ + @NotBlank(message = "邮箱不能为空") + @Length(max = 50, message = "邮箱不能超过50位") + private String email; + + /** + * 提成类型(0总金额提成 1服务费提成) + */ + @NotNull(message = "提成类型不能为空") + private Integer commissionType; + + /** + * 平台提成 + */ + @NotNull(message = "平台提成不能为空") + private Double platformCommissionRate; + + /** + * 运维提成 + */ + @NotNull(message = "运维提成不能为空") + private Double maintenanceCommissionRate; + + /** + * 营业执照id + */ + @NotBlank(message = "营业执照不能为空") + private String businessLicenseId; + + /** + * 提现时间(tn) + */ + @NotNull(message = "提现时间不能为空") + private Integer withdrawalTime; + + /** + * 设置充电终止的soc + */ + @NotBlank(message = "充电终止的soc不能为空") + @Length(max = 10, message = "充电终止的soc不能超过10位") + private String soc; + + /** + * 状态(0正常 1停用) + */ + private Integer status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private Integer delFlag; + + /** + * 对接第三方平台及监管平台的operatorId + */ + private String operatorIdEvcs; + + public String getOperatorIdEvcs() { + + return operatorIdEvcs; + } + + public void setOperatorIdEvcs(String operatorIdEvcs) { + + this.operatorIdEvcs = operatorIdEvcs; + } + + public Long getOperatorId() { + + return operatorId; + } + + public void setOperatorId(Long operatorId) { + + this.operatorId = operatorId; + } + + public String getName() { + + return name; + } + + public void setName(String name) { + + this.name = name; + } + + public String getContactName() { + + return contactName; + } + + public void setContactName(String contactName) { + + this.contactName = contactName; + } + + public String getContactPhone() { + + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + + this.contactPhone = contactPhone; + } + + public String getPhone() { + + return phone; + } + + public void setPhone(String phone) { + + this.phone = phone; + } + + public Integer getAttribute() { + + return attribute; + } + + public void setAttribute(Integer attribute) { + + this.attribute = attribute; + } + + public String getAreaCode() { + + return areaCode; + } + + public void setAreaCode(String areaCode) { + + this.areaCode = areaCode; + } + + public String getAddress() { + + return address; + } + + public void setAddress(String address) { + + this.address = address; + } + + public String getLongitude() { + + return longitude; + } + + public void setLongitude(String longitude) { + + this.longitude = longitude; + } + + public String getLatitude() { + + return latitude; + } + + public void setLatitude(String latitude) { + + this.latitude = latitude; + } + + public String getEmail() { + + return email; + } + + public void setEmail(String email) { + + this.email = email; + } + + public Integer getCommissionType() { + + return commissionType; + } + + public void setCommissionType(Integer commissionType) { + + this.commissionType = commissionType; + } + + public Double getPlatformCommissionRate() { + + return platformCommissionRate; + } + + public void setPlatformCommissionRate(Double platformCommissionRate) { + + this.platformCommissionRate = platformCommissionRate; + } + + public Double getMaintenanceCommissionRate() { + + return maintenanceCommissionRate; + } + + public void setMaintenanceCommissionRate(Double maintenanceCommissionRate) { + + this.maintenanceCommissionRate = maintenanceCommissionRate; + } + + public String getBusinessLicenseId() { + + return businessLicenseId; + } + + public void setBusinessLicenseId(String businessLicenseId) { + + this.businessLicenseId = businessLicenseId; + } + + public Integer getWithdrawalTime() { + + return withdrawalTime; + } + + public void setWithdrawalTime(Integer withdrawalTime) { + + this.withdrawalTime = withdrawalTime; + } + + public String getSoc() { + + return soc; + } + + public void setSoc(String soc) { + + this.soc = soc; + } + + public Integer getStatus() { + + return status; + } + + public void setStatus(Integer status) { + + this.status = status; + } + + public Integer getDelFlag() { + + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + + this.delFlag = delFlag; + } + + public String getOpenBank() { + + return openBank; + } + + public void setOpenBank(String openBank) { + + this.openBank = openBank; + } + + public String getCardNumber() { + + return cardNumber; + } + + public void setCardNumber(String cardNumber) { + + this.cardNumber = cardNumber; + } + + public String getDutyParagraph() { + + return dutyParagraph; + } + + public void setDutyParagraph(String dutyParagraph) { + + this.dutyParagraph = dutyParagraph; + } + + public String getDetailedAddress() { + + return detailedAddress; + } + + public void setDetailedAddress(String detailedAddress) { + + this.detailedAddress = detailedAddress; + } + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/XhpcInvoiceService.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/XhpcInvoiceService.java new file mode 100644 index 00000000..67ecf7a4 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/XhpcInvoiceService.java @@ -0,0 +1,25 @@ +package com.xhpc.invoice.service; + +import com.xhpc.invoice.domain.SpecificInvoiceWrap; + +/** + * 用于处理发票相关请求的Service + * + * @author WH + * @date 2021/12/20 14:04 + * @since version-1.0 + */ +public interface XhpcInvoiceService { + + /** + * 通过发票id查询指定发票信息,用于回显 + * + * @param invoiceId 指定的发票id + * @return 一个保存着所有返回需要的信息的包装类 + * @author WH + * @date 2021/12/20 14:10 + * @since version-1.0 + */ + SpecificInvoiceWrap selectSpecificInvoice(Long invoiceId); + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java new file mode 100644 index 00000000..792c6870 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java @@ -0,0 +1,90 @@ +package com.xhpc.invoice.service.impl; + +import com.xhpc.common.core.utils.DateUtils; +import com.xhpc.common.core.utils.bean.BeanUtils; +import com.xhpc.common.domain.XhpcChargingStation; +import com.xhpc.invoice.domain.SpecificInvoiceWrap; +import com.xhpc.invoice.mapper.XhpcChargingStationMapper; +import com.xhpc.invoice.mapper.XhpcInvoiceMapHistoryOrderMapper; +import com.xhpc.invoice.mapper.XhpcInvoiceMapper; +import com.xhpc.invoice.mapper.XhpcOperatorMapper; +import com.xhpc.invoice.pojo.XhpcInvoice; +import com.xhpc.invoice.pojo.XhpcInvoiceMapHistoryOrder; +import com.xhpc.invoice.service.XhpcInvoiceService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * XhpcInvoiceService的实现类 + * + * @author WH + * @date 2021/12/20 14:09 + * @since version-1.0 + */ +@Service +public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { + + @Resource + XhpcInvoiceMapper xhpcInvoiceMapper; + @Resource + XhpcInvoiceMapHistoryOrderMapper xhpcInvoiceMapHistoryOrderMapper; + @Resource + XhpcOperatorMapper xhpcOperatorMapper; + @Resource + XhpcChargingStationMapper xhpcChargingStationMapper; + + /** + * 通过发票id查找对应的发票数据 + * + * @author WH + * @date 2021/12/20 16:44 + * @since version-1.0 + */ + @Override + public SpecificInvoiceWrap selectSpecificInvoice(Long invoiceId) { + + //处理包装类外层数据 + XhpcInvoice xhpcInvoice = xhpcInvoiceMapper.selectByPrimaryKey(invoiceId); + SpecificInvoiceWrap specificInvoiceWrap = new SpecificInvoiceWrap(); + BeanUtils.copyProperties(xhpcInvoice, specificInvoiceWrap); + specificInvoiceWrap.setInvoiceCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getCreateTime())); + specificInvoiceWrap.setInvoiceMoney(xhpcInvoice.getInvoiceMoney()); + specificInvoiceWrap.setInvoiceTotalEletricMoney(xhpcInvoice.getInvoiceOrderEletricTotalMoney()); + specificInvoiceWrap.setInvoiceTotalServiceMoney(xhpcInvoice.getInvoiceOrderServiceTotalMoney()); + specificInvoiceWrap.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime())); + //处理包装类内层数据 + specificInvoiceWrap.setHistoryOrders(new SpecificInvoiceWrap.HistoryOrdersDTO()); + SpecificInvoiceWrap.HistoryOrdersDTO historyOrdersDTO = specificInvoiceWrap.getHistoryOrders(); + List ordersList = xhpcInvoiceMapHistoryOrderMapper.findOrdersByInvoiceId(xhpcInvoice.getInvoiceId()); + historyOrdersDTO.setTotalItems(Long.valueOf(String.valueOf(ordersList.size()))); + historyOrdersDTO.setHistoryOrdersData(new ArrayList<>()); + List historyOrdersDataList = historyOrdersDTO.getHistoryOrdersData(); + for (XhpcInvoiceMapHistoryOrder xhpcInvoiceMapHistoryOrder : ordersList) { + //创建封装历史订单记录的DTO,封装数据 + SpecificInvoiceWrap.HistoryOrdersDTO.HistoryOrdersDataDTO historyOrdersDataDTO = new SpecificInvoiceWrap.HistoryOrdersDTO.HistoryOrdersDataDTO(); + historyOrdersDataDTO.setHistoryOrderId(String.valueOf(xhpcInvoiceMapHistoryOrder.getHistoryOrderId())); + historyOrdersDataDTO.setActPrice(xhpcInvoiceMapHistoryOrder.getHistoryActPrice()); + historyOrdersDataDTO.setChargingMode(xhpcInvoiceMapHistoryOrder.getChargingMode()); + historyOrdersDataDTO.setHistoryCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoiceMapHistoryOrder.getCreateTime())); + historyOrdersDataDTO.setServiceMoney(xhpcInvoiceMapHistoryOrder.getServicePriceTotal()); + historyOrdersDataDTO.setEletricMoney(xhpcInvoiceMapHistoryOrder.getPowerPriceTotal()); + historyOrdersDataDTO.setHistorySerialNumber(xhpcInvoiceMapHistoryOrder.getHisotrySerialNumber()); + XhpcChargingStation xhpcChargingStation = xhpcChargingStationMapper.selectXhpcChargingStationById(xhpcInvoiceMapHistoryOrder.getChargingStationId()); + Map operatorInfo = xhpcOperatorMapper.info(xhpcChargingStation.getOperatorId()); + String operatorName = (String) operatorInfo.get("name"); + historyOrdersDataDTO.setOperatorName(operatorName); + historyOrdersDataList.add(historyOrdersDataDTO); + } + //处理historyOrderScope数据 + List historyOrderScope = xhpcInvoiceMapHistoryOrderMapper.getHistoryOrderScopeByInvoiceId(xhpcInvoice.getInvoiceId()); + String minTime = historyOrderScope.get(0); + String maxTime = historyOrderScope.get(1); + specificInvoiceWrap.setHistoryOrderScope(minTime + "," + maxTime); + return specificInvoiceWrap; + } + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/banner.txt b/xhpc-modules/xhpc-invoice/src/main/resources/banner.txt new file mode 100644 index 00000000..27cacb9c --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/resources/banner.txt @@ -0,0 +1,10 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} + _ __ _ _ + (_) / _|(_)| | + _ __ _ _ ___ _ _ _ ______ | |_ _ | | ___ +| '__|| | | | / _ \ | | | || ||______|| _|| || | / _ \ +| | | |_| || (_) || |_| || | | | | || || __/ +|_| \__,_| \___/ \__, ||_| |_| |_||_| \___| + __/ | + |___/ \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml new file mode 100644 index 00000000..bacdb6d8 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml @@ -0,0 +1,25 @@ +# Tomcat +server: + port: 9804 + +# Spring +spring: + application: + # 应用名称 + name: xhpc-invoice + 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} \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/logback.xml b/xhpc-modules/xhpc-invoice/src/main/resources/logback.xml new file mode 100644 index 00000000..ab865c63 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/resources/logback.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcChargingStationMapper.xml new file mode 100644 index 00000000..fdbfa050 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcChargingStationMapper.xml @@ -0,0 +1,922 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select charging_station_id, + name, + operator_id, + type, + construction_site, + service_facilities, + periphery_facilities, + area_code, + address, + detailed_address, + longitude, + latitude, + parking_instructions, + serial_number, + client_visible, + status, + del_flag, + create_time, + create_by, + update_time, + update_by, + remark, + rate_model_id + from xhpc_charging_station + + + + + + + + + + + + insert into xhpc_charging_station + + charging_station_id, + name, + operator_id, + type, + construction_site, + service_facilities, + periphery_facilities, + area_code, + address, + detailed_address, + longitude, + latitude, + parking_instructions, + serial_number, + client_visible, + status, + del_flag, + create_time, + create_by, + update_time, + update_by, + remark, + rate_model_id, + + + #{chargingStationId}, + #{name}, + #{operatorId}, + #{type}, + #{constructionSite}, + #{serviceFacilities}, + #{peripheryFacilities}, + #{areaCode}, + #{address}, + #{detailedAddress}, + #{longitude}, + #{latitude}, + #{parkingInstructions}, + #{serialNumber}, + #{clientVisible}, + #{status}, + #{delFlag}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + #{remark}, + #{rateModelId}, + + + + + update xhpc_charging_station + + name = #{name}, + operator_id = #{operatorId}, + type = #{type}, + construction_site = #{constructionSite}, + service_facilities = #{serviceFacilities}, + periphery_facilities = #{peripheryFacilities}, + area_code = #{areaCode}, + address = #{address}, + detailed_address = #{detailedAddress}, + longitude = #{longitude}, + latitude = #{latitude}, + parking_instructions = #{parkingInstructions}, + serial_number = #{serialNumber}, + client_visible = #{clientVisible}, + status = #{status}, + del_flag = #{delFlag}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + remark = #{remark}, + rate_model_id = #{rateModelId}, + business_instructions = #{businessInstructions}, + reminder_instructions = #{reminderInstructions}, + img_id = #{imgId}, + station_type = #{stationType}, + operator_id_evcs = #{operatorIdEvcs}, + service_tel = #{serviceTel}, + park_nums = #{parkNums} + + where charging_station_id = #{chargingStationId} + + + + update xhpc_charging_station + set del_flag =1 + where charging_station_id = #{chargingStationId} + + + + update xhpc_charging_station set del_flag =1 where charging_station_id in + + #{chargingStationId} + + + + + update xhpc_charging_station + set status =#{status} + where charging_station_id = #{chargingStationId} + and del_flag = 0 + + + + update xhpc_charging_station + set client_visible =#{clientVisible} + where charging_station_id = #{chargingStationId} + and del_flag = 0 + + + + + + + + + + + + + + + + + + + + + insert into xhpc_rate_model + + + status, + + + del_flag, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + remark + + + + + #{status}, + + + #{delFlag}, + + + #{createTime}, + + + #{createBy}, + + + #{updateTime}, + + + #{updateBy}, + + + #{remark} + + + + + + insert into xhpc_charging_station + + + name, + + + operator_id, + + + type, + + + construction_site, + + + service_facilities, + + + periphery_facilities, + + + area_code, + + + address, + + + detailed_address, + + + longitude, + + + latitude, + + + parking_instructions, + + + serial_number, + + + client_visible, + + + rate_model_id, + + + img_id, + + + business_instructions, + + + reminder_instructions, + + + status, + + + del_flag, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + remark, + + + station_type, + + + operator_id_evcs, + + + service_tel, + + + park_nums + + + + + #{name}, + + + #{operatorId}, + + + #{type}, + + + #{constructionSite}, + + + #{serviceFacilities}, + + + #{peripheryFacilities}, + + + #{areaCode}, + + + #{address}, + + + #{detailedAddress}, + + + #{longitude}, + + + #{latitude}, + + + #{parkingInstructions}, + + + #{serialNumber}, + + + #{clientVisible}, + + + #{rateModelId}, + + + #{imgId}, + + + #{businessInstructions}, + + + #{reminderInstructions}, + + + #{status}, + + + #{delFlag}, + + + #{createTime}, + + + #{createBy}, + + + #{updateTime}, + + + #{updateBy}, + + + #{remark}, + + + #{stationType}, + + + #{operatorIdEvcs}, + + + #{serviceTel}, + + + #{parkNums} + + + + + + insert into xhpc_rate + + + charging_station_id, + + + power_fee, + + + service_fee, + + + name, + + + del_flag, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + remark, + + + rate_value, + + + rate_model_id + + + + + #{chargingStationId}, + + + #{powerFee}, + + + #{serviceFee}, + + + #{name}, + + + #{status}, + + + #{delFlag}, + + + #{createTime}, + + + #{createBy}, + + + #{updateTime}, + + + #{updateBy}, + + + #{remark}, + + + #{rateValue}, + + + #{rateModelId} + + + + + + + + insert into xhpc_rate_time + + + charging_station_id, + + + rate_id, + + + start_time, + + + end_time, + + + rate_model_id, + + + sort, + + + status, + + + del_flag, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + remark, + + + type, + + + rate_value + + + + + #{chargingStationId}, + + + #{rateId}, + + + #{startTime}, + + + #{endTime}, + + + #{rateModelId}, + + + #{sort}, + + + #{status}, + + + #{delFlag}, + + + #{createTime}, + + + #{createBy}, + + + #{updateTime}, + + + #{updateBy}, + + + #{remark}, + + + #{type}, + + + #{rateValue} + + + + + + + + + + + + update xhpc_rate + set del_flag =1 + where charging_station_id = #{chargingStationId} + and del_flag = 0 + + + + update xhpc_rate_time + set del_flag =1 + where charging_station_id = #{chargingStationId} + and del_flag = 0 + + + + + + + + update xhpc_charging_pile + set rate_model_id=#{rateModelId} + WHERE charging_station_id = #{chargingStationId} + + + + update xhpc_terminal + set rate_model_id=#{rateModelId} + WHERE charging_station_id = #{chargingStationId} + + + + + + insert into xhpc_user_privilege( + + user_id, + + + charging_station_id + + )values( + + #{userId}, + + + #{chargingStationId} + + ) + + diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml new file mode 100644 index 00000000..f1c4a559 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + insert into xhpc_invoice_map_history_order (invoice_id, history_order_id, history_user_id, + history_user_type, hisotry_serial_number, power_price_total, + service_price_total, promotion_discount, history_act_price, + create_time, charging_mode, charging_station_id, + terminal_id, del_flag) + values (#{invoiceId,jdbcType=BIGINT}, #{historyOrderId,jdbcType=BIGINT}, #{historyUserId,jdbcType=BIGINT}, + #{historyUserType,jdbcType=BIGINT}, #{hisotrySerialNumber,jdbcType=VARCHAR}, + #{powerPriceTotal,jdbcType=DECIMAL}, + #{servicePriceTotal,jdbcType=DECIMAL}, #{promotionDiscount,jdbcType=DECIMAL}, + #{historyActPrice,jdbcType=DECIMAL}, + #{createTime,jdbcType=TIMESTAMP}, #{chargingMode,jdbcType=VARCHAR}, + #{chargingStationId,jdbcType=BIGINT}, + #{terminalId,jdbcType=BIGINT}, #{delFlag,jdbcType=INTEGER}) + + + insert into xhpc_invoice_map_history_order + + + invoice_id, + + + history_order_id, + + + history_user_id, + + + history_user_type, + + + hisotry_serial_number, + + + power_price_total, + + + service_price_total, + + + promotion_discount, + + + history_act_price, + + + create_time, + + + charging_mode, + + + charging_station_id, + + + terminal_id, + + + del_flag, + + + + + #{invoiceId,jdbcType=BIGINT}, + + + #{historyOrderId,jdbcType=BIGINT}, + + + #{historyUserId,jdbcType=BIGINT}, + + + #{historyUserType,jdbcType=BIGINT}, + + + #{hisotrySerialNumber,jdbcType=VARCHAR}, + + + #{powerPriceTotal,jdbcType=DECIMAL}, + + + #{servicePriceTotal,jdbcType=DECIMAL}, + + + #{promotionDiscount,jdbcType=DECIMAL}, + + + #{historyActPrice,jdbcType=DECIMAL}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{chargingMode,jdbcType=VARCHAR}, + + + #{chargingStationId,jdbcType=BIGINT}, + + + #{terminalId,jdbcType=BIGINT}, + + + #{delFlag,jdbcType=INTEGER}, + + + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapper.xml b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapper.xml new file mode 100644 index 00000000..550ed304 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapper.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + invoice_id + , receive_email, title_type, title_content, duty_number, invoice_content, + invoice_money, invoice_order_eletric_total_money, invoice_order_service_total_money, + firm_address, firm_phone, firm_bank, firm_bank_account, is_show_date, user_notes, + creator_id, creator_type, creator, create_time, `status`, invoicing_time, drawer, + finance_notes, electric_invoice_url, updator, update_time, del_flag + + + + delete + from xhpc_invoice + where invoice_id = #{invoiceId,jdbcType=BIGINT} + + + insert into xhpc_invoice (receive_email, title_type, title_content, + duty_number, invoice_content, invoice_money, + invoice_order_eletric_total_money, invoice_order_service_total_money, + firm_address, firm_phone, firm_bank, + firm_bank_account, is_show_date, user_notes, + creator_id, creator_type, creator, + create_time, `status`, invoicing_time, + drawer, finance_notes, electric_invoice_url, + updator, update_time, del_flag) + values (#{receiveEmail,jdbcType=VARCHAR}, #{titleType,jdbcType=INTEGER}, #{titleContent,jdbcType=VARCHAR}, + #{dutyNumber,jdbcType=VARCHAR}, #{invoiceContent,jdbcType=VARCHAR}, #{invoiceMoney,jdbcType=DECIMAL}, + #{invoiceOrderEletricTotalMoney,jdbcType=DECIMAL}, #{invoiceOrderServiceTotalMoney,jdbcType=DECIMAL}, + #{firmAddress,jdbcType=VARCHAR}, #{firmPhone,jdbcType=VARCHAR}, #{firmBank,jdbcType=VARCHAR}, + #{firmBankAccount,jdbcType=VARCHAR}, #{isShowDate,jdbcType=INTEGER}, #{userNotes,jdbcType=VARCHAR}, + #{creatorId,jdbcType=BIGINT}, #{creatorType,jdbcType=INTEGER}, #{creator,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{invoicingTime,jdbcType=TIMESTAMP}, + #{drawer,jdbcType=VARCHAR}, #{financeNotes,jdbcType=VARCHAR}, #{electricInvoiceUrl,jdbcType=VARCHAR}, + #{updator,jdbcType=BIGINT}, #{updateTime,jdbcType=DATE}, #{delFlag,jdbcType=INTEGER}) + + + insert into xhpc_invoice + + + receive_email, + + + title_type, + + + title_content, + + + duty_number, + + + invoice_content, + + + invoice_money, + + + invoice_order_eletric_total_money, + + + invoice_order_service_total_money, + + + firm_address, + + + firm_phone, + + + firm_bank, + + + firm_bank_account, + + + is_show_date, + + + user_notes, + + + creator_id, + + + creator_type, + + + creator, + + + create_time, + + + `status`, + + + invoicing_time, + + + drawer, + + + finance_notes, + + + electric_invoice_url, + + + updator, + + + update_time, + + + del_flag, + + + + + #{receiveEmail,jdbcType=VARCHAR}, + + + #{titleType,jdbcType=INTEGER}, + + + #{titleContent,jdbcType=VARCHAR}, + + + #{dutyNumber,jdbcType=VARCHAR}, + + + #{invoiceContent,jdbcType=VARCHAR}, + + + #{invoiceMoney,jdbcType=DECIMAL}, + + + #{invoiceOrderEletricTotalMoney,jdbcType=DECIMAL}, + + + #{invoiceOrderServiceTotalMoney,jdbcType=DECIMAL}, + + + #{firmAddress,jdbcType=VARCHAR}, + + + #{firmPhone,jdbcType=VARCHAR}, + + + #{firmBank,jdbcType=VARCHAR}, + + + #{firmBankAccount,jdbcType=VARCHAR}, + + + #{isShowDate,jdbcType=INTEGER}, + + + #{userNotes,jdbcType=VARCHAR}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{creatorType,jdbcType=INTEGER}, + + + #{creator,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{status,jdbcType=INTEGER}, + + + #{invoicingTime,jdbcType=TIMESTAMP}, + + + #{drawer,jdbcType=VARCHAR}, + + + #{financeNotes,jdbcType=VARCHAR}, + + + #{electricInvoiceUrl,jdbcType=VARCHAR}, + + + #{updator,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=DATE}, + + + #{delFlag,jdbcType=INTEGER}, + + + + + update xhpc_invoice + + + receive_email = #{receiveEmail,jdbcType=VARCHAR}, + + + title_type = #{titleType,jdbcType=INTEGER}, + + + title_content = #{titleContent,jdbcType=VARCHAR}, + + + duty_number = #{dutyNumber,jdbcType=VARCHAR}, + + + invoice_content = #{invoiceContent,jdbcType=VARCHAR}, + + + invoice_money = #{invoiceMoney,jdbcType=DECIMAL}, + + + invoice_order_eletric_total_money = #{invoiceOrderEletricTotalMoney,jdbcType=DECIMAL}, + + + invoice_order_service_total_money = #{invoiceOrderServiceTotalMoney,jdbcType=DECIMAL}, + + + firm_address = #{firmAddress,jdbcType=VARCHAR}, + + + firm_phone = #{firmPhone,jdbcType=VARCHAR}, + + + firm_bank = #{firmBank,jdbcType=VARCHAR}, + + + firm_bank_account = #{firmBankAccount,jdbcType=VARCHAR}, + + + is_show_date = #{isShowDate,jdbcType=INTEGER}, + + + user_notes = #{userNotes,jdbcType=VARCHAR}, + + + creator_id = #{creatorId,jdbcType=BIGINT}, + + + creator_type = #{creatorType,jdbcType=INTEGER}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + `status` = #{status,jdbcType=INTEGER}, + + + invoicing_time = #{invoicingTime,jdbcType=TIMESTAMP}, + + + drawer = #{drawer,jdbcType=VARCHAR}, + + + finance_notes = #{financeNotes,jdbcType=VARCHAR}, + + + electric_invoice_url = #{electricInvoiceUrl,jdbcType=VARCHAR}, + + + updator = #{updator,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=DATE}, + + + del_flag = #{delFlag,jdbcType=INTEGER}, + + + where invoice_id = #{invoiceId,jdbcType=BIGINT} + + + update xhpc_invoice + set receive_email = #{receiveEmail,jdbcType=VARCHAR}, + title_type = #{titleType,jdbcType=INTEGER}, + title_content = #{titleContent,jdbcType=VARCHAR}, + duty_number = #{dutyNumber,jdbcType=VARCHAR}, + invoice_content = #{invoiceContent,jdbcType=VARCHAR}, + invoice_money = #{invoiceMoney,jdbcType=DECIMAL}, + invoice_order_eletric_total_money = #{invoiceOrderEletricTotalMoney,jdbcType=DECIMAL}, + invoice_order_service_total_money = #{invoiceOrderServiceTotalMoney,jdbcType=DECIMAL}, + firm_address = #{firmAddress,jdbcType=VARCHAR}, + firm_phone = #{firmPhone,jdbcType=VARCHAR}, + firm_bank = #{firmBank,jdbcType=VARCHAR}, + firm_bank_account = #{firmBankAccount,jdbcType=VARCHAR}, + is_show_date = #{isShowDate,jdbcType=INTEGER}, + user_notes = #{userNotes,jdbcType=VARCHAR}, + creator_id = #{creatorId,jdbcType=BIGINT}, + creator_type = #{creatorType,jdbcType=INTEGER}, + creator = #{creator,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + `status` = #{status,jdbcType=INTEGER}, + invoicing_time = #{invoicingTime,jdbcType=TIMESTAMP}, + drawer = #{drawer,jdbcType=VARCHAR}, + finance_notes = #{financeNotes,jdbcType=VARCHAR}, + electric_invoice_url = #{electricInvoiceUrl,jdbcType=VARCHAR}, + updator = #{updator,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=DATE}, + del_flag = #{delFlag,jdbcType=INTEGER} + where invoice_id = #{invoiceId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcOperatorMapper.xml b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcOperatorMapper.xml new file mode 100644 index 00000000..912fc288 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcOperatorMapper.xml @@ -0,0 +1,392 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + xo + . + operator_id + operatorId, xo.name, xo.contact_name contactName, xo.contact_phone contactPhone, + xo.phone, xo.attribute,xo.open_bank openBank,xo.card_number cardNumber, xo.area_code areaCode, xo.address, + xo.detailed_address detailedAddress, xo.duty_paragraph dutyParagraph, + xo.longitude, xo.latitude, xo.email, xo.commission_type commissionType, + xo.platform_commission_rate platformCommissionRate, + xo.maintenance_commission_rate maintenanceCommissionRate, + xo.business_license_id businessLicenseId, xo.withdrawal_time withdrawalTime, xo.soc, + xo.status, xo.del_flag delFlag, xo.create_time createTime, + xo.create_by createBy, xo.update_time updateTime, xo.update_by updateBy, xo.remark, + + + + insert into xhpc_operator + + + name, + + + contact_name, + + + contact_phone, + + + phone, + + + attribute, + + + duty_paragraph, + + + detailed_address, + + + open_bank, + + + card_number, + + + area_code, + + + address, + + + longitude, + + + latitude, + + + email, + + + commission_type, + + + platform_commission_rate, + + + maintenance_commission_rate, + + + business_license_id, + + + withdrawal_time, + + + soc, + + + status, + + + del_flag, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + remark, + + + operator_id_evcs + + + + + #{name}, + + + #{contactName}, + + + #{contactPhone}, + + + #{phone}, + + + #{attribute}, + + + #{dutyParagraph}, + + + #{detailedAddress}, + + + #{openBank}, + + + #{cardNumber}, + + + #{areaCode}, + + + #{address}, + + + #{longitude}, + + + #{latitude}, + + + #{email}, + + + #{commissionType}, + + + #{platformCommissionRate}, + + + #{maintenanceCommissionRate}, + + + #{businessLicenseId}, + + + #{withdrawalTime}, + + + #{soc}, + + + #{status}, + + + #{delFlag}, + + + #{createTime}, + + + #{createBy}, + + + #{updateTime}, + + + #{updateBy}, + + + #{remark}, + + + #{operatorIdEvcs} + + + + + + UPDATE xhpc_operator + + operator_id = #{operatorId}, + name = #{name}, + contact_name = #{contactName}, + contact_phone = #{contactPhone}, + phone = #{phone}, + attribute = #{attribute}, + open_bank = #{openBank}, + card_number = #{cardNumber}, + area_code = #{areaCode}, + address = #{address}, + longitude = #{longitude}, + latitude = #{latitude}, + email = #{email}, + commission_type = #{commissionType}, + platform_commission_rate = + #{platformCommissionRate}, + + maintenance_commission_rate + = #{maintenanceCommissionRate}, + + business_license_id = + #{businessLicenseId}, + + withdrawal_time = #{withdrawalTime}, + soc = #{soc}, + status = #{status}, + del_flag = #{delFlag}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + remark = #{remark}, + operator_id_evcs = #{operatorIdEvcs} + + WHERE operator_id = #{operatorId} + + + + delete from xhpc_operator where operator_id in + + #{ids} + + + + + + + + + + + delete + from sys_user_role + where user_id = #{userId} + + + + delete + from sys_user_post + where user_id = #{userId} + + + + update sys_user + set del_flag = #{delFlag} + where user_id = #{userId} + + + + + + + + + delete + from sys_role + where role_name = #{roleName} + +