diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/api/XhpcInvoiceApiController.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/api/XhpcInvoiceApiController.java index 35198b86..6a375e8e 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/api/XhpcInvoiceApiController.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/api/XhpcInvoiceApiController.java @@ -22,6 +22,34 @@ public class XhpcInvoiceApiController extends BaseController { @Resource XhpcInvoiceService xhpcInvoiceService; + /** + * 查询用户显示小红点,查询用户有几个未读的已开发票 + * + * @author WH + * @date 2021/12/28 18:51 + * @since version-1.0 + */ + @GetMapping("/user/no-read") + public AjaxResult findNotReadCount(@RequestParam Long creatorId, @RequestParam Integer creatorType) { + + Long notRead = xhpcInvoiceService.findNotReadCount(creatorId, creatorType); + return AjaxResult.success(notRead); + } + + /** + * 保存用户所要开的发票信息 + * + * @author WH + * @date 2021/12/28 14:54 + * @since version-1.0 + */ + @PostMapping() + public AjaxResult saveInvoiceInfo(@RequestBody SaveInvoiceInfoRequest saveInvoiceInfoRequest) throws Exception { + + xhpcInvoiceService.saveInvoiceInfo(saveInvoiceInfoRequest); + return AjaxResult.success(); + } + /** * 查询用户开发票的历史记录 * diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceMapHistoryOrderStatusConst.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceMapHistoryOrderStatusConst.java new file mode 100644 index 00000000..185c5333 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceMapHistoryOrderStatusConst.java @@ -0,0 +1,27 @@ +package com.xhpc.invoice.constant; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 发票所包含的订单状态的常量类 + * + * @author WH + * @date 2021/12/29 10:34 + * @since version-1.0 + */ +@Data +@NoArgsConstructor +public class InvoiceMapHistoryOrderStatusConst { + + /** + * 已被发票包含,即锁定 + */ + public static final Integer LOCK = 0; + + /** + * 解除发票包含关系,即解锁 + */ + public static final Integer UNLOCK = 0; + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constPackage/InvoiceStatusConst.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceStatusConst.java similarity index 92% rename from xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constPackage/InvoiceStatusConst.java rename to xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceStatusConst.java index 8615d4af..111f5272 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constPackage/InvoiceStatusConst.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceStatusConst.java @@ -1,4 +1,4 @@ -package com.xhpc.invoice.constPackage; +package com.xhpc.invoice.constant; import lombok.Data; import lombok.NoArgsConstructor; 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 index c9126f51..239dd00f 100644 --- 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 @@ -2,7 +2,7 @@ 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.constPackage.InvoiceStatusConst; +import com.xhpc.invoice.constant.InvoiceStatusConst; import com.xhpc.invoice.domain.AllInvoiceOrdersRequest; import com.xhpc.invoice.domain.AllInvoiceOrdersResponse; import com.xhpc.invoice.domain.InvoiceToUserRequest; diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/InvoiceHistoryRecordsResponse.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/InvoiceHistoryRecordsResponse.java index 3656ed30..a8c47abb 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/InvoiceHistoryRecordsResponse.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/InvoiceHistoryRecordsResponse.java @@ -35,6 +35,8 @@ public class InvoiceHistoryRecordsResponse { private Integer status; @JsonProperty("invoicingMoney") private BigDecimal invoicingMoney; + @JsonProperty("isRead") + private Integer isRead; } diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/SaveInvoiceInfoRequest.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/SaveInvoiceInfoRequest.java new file mode 100644 index 00000000..6cd389be --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/SaveInvoiceInfoRequest.java @@ -0,0 +1,57 @@ +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; + +/** + * POST /invoice/接口的请求包装类 + * + * @author WH + * @date 2021/12/28 14:29 + * @since version-1.0 + */ +@NoArgsConstructor +@Data +public class SaveInvoiceInfoRequest { + + + @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("firmAddress") + private String firmAddress; + @JsonProperty("firmPhone") + private String firmPhone; + @JsonProperty("firmBank") + private String firmBank; + @JsonProperty("firmBankAccount") + private String firmBankAccount; + @JsonProperty("isShowDate") + private Integer isShowDate; + @JsonProperty("userNotes") + private String userNotes; + @JsonProperty("creatorId") + private Long creatorId; + @JsonProperty("creatorType") + private Integer creatorType; + @JsonProperty("creator") + private String creator; + @JsonProperty("createTime") + private String createTime; + @JsonProperty("historyOrderIds") + private List historyOrderIds; + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcHistoryOrderMapper.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcHistoryOrderMapper.java index ca16faf1..a32da202 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcHistoryOrderMapper.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcHistoryOrderMapper.java @@ -39,4 +39,15 @@ public interface XhpcHistoryOrderMapper { */ Long findAllOrdersByCondition(@Param("invoicedOrdersRequest") InvoicedOrdersRequest invoicedOrdersRequest, @Param("lockOrderNumberList") List lockOrderNumberList); + /** + * 查询指定id的历史订单 + * + * @param historyOrderIds 历史订单id集合 + * @return 历史订单 + * @author WH + * @date 2021/12/28 17:47 + * @since version-1.0 + */ + List findById(List historyOrderIds); + } 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 index 9603f691..c707e43f 100644 --- 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 @@ -62,4 +62,25 @@ public interface XhpcInvoiceMapHistoryOrderMapper { */ List findLockOrdersByUserIdAndUserType(InvoicedOrdersRequest invoicedOrdersRequest); + /** + * 解除锁定的用户历史订单 + * + * @param invoiceId 发票id + * @author WH + * @date 2021/12/29 11:00 + * @since version-1.0 + */ + void unlockHistoryOrdersByInvoiceId(Long invoiceId); + + /** + * 查询该发票关联表中,该历史订单是否已经被存储且被锁定 + * + * @param historyOrderIds 历史订单id集合 + * @return 返回被某发票包含,且已经锁定的历史订单记录 + * @author WH + * @date 2021/12/29 14:30 + * @since version-1.0 + */ + List getLockedOnesByHistoryOrderId(List historyOrderIds); + } \ 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 index 9f51f66b..7d612d8c 100644 --- 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 @@ -136,6 +136,7 @@ public interface XhpcInvoiceMapper { * * @param creatorId 用户id * @param creatorType 用户类型 + * * @return 用户发票条数 * @author WH * @date 2021/12/27 16:47 @@ -143,5 +144,26 @@ public interface XhpcInvoiceMapper { */ Long getUserInvoiceItemsByCreatorIdAndCreatorType(@Param("creatorId") Long creatorId, @Param("creatorType") Integer creatorType); + /** + * 插入发票记录,获取所插入的发票记录的发票id(会被放置到实体类id属性中) + * + * @param xhpcInvoice 发票记录 + * @author WH + * @date 2021/12/28 15:09 + * @since version-1.0 + */ + void insertSelectiveAndReturnId(XhpcInvoice xhpcInvoice); + + /** + * 查找指定用户开了的发票未读的数量 + * + * @param creatorId 用户id + * @param creatorType 用户类型 + * @return 返回发票未读的数量 + * @author WH + * @date 2021/12/28 20:31 + * @since version-1.0 + */ + Long findNotReadCount(@Param("creatorId") Long creatorId, @Param("creatorType") Integer creatorType); } \ No newline at end of file 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 index 4bfa93ce..aa635593 100644 --- 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 @@ -145,7 +145,7 @@ public class XhpcInvoice implements Serializable { private Date updateTime; /** - * 是否已经阅读(默认0表示没有阅读,1表示已经阅读) + * 是否已经阅读(默认未空,0表示没有阅读,1表示已经阅读) */ private Integer isRead; 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 index 7b955be7..278f745c 100644 --- 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 @@ -82,7 +82,7 @@ public class XhpcInvoiceMapHistoryOrder implements Serializable { /** * 该发票所选中的历史订单是否被锁定 */ - private Integer delLock; + private Integer lockFlag; /** * 逻辑删除字段 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 index a3821193..92cd12d4 100644 --- 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 @@ -110,4 +110,27 @@ public interface XhpcInvoiceService { */ InvoiceHistoryRecordsResponse selectInvoiceHistoryRecords(InvoiceHistoryRecordsRequest invoiceHistoryRecordsRequest); + /** + * 将用户申请的发票信息,保存到数据库中 + * + * @param saveInvoiceInfoRequest 发票信息 + * @throws Exception 传入发票金额参数与内部该发票所包含的所有订单金额参数不一致出现,出现此异常 + * @author WH + * @date 2021/12/28 14:33 + * @since version-1.0 + */ + void saveInvoiceInfo(SaveInvoiceInfoRequest saveInvoiceInfoRequest) throws Exception; + + /** + * 查询指定用户没有查看的已开的发票的数量,即该用户有几个未读发票 + * + * @param creatorId 用户id + * @param creatorType 用户类型 + * @return 未读发票数量 + * @author WH + * @date 2021/12/28 19:01 + * @since version-1.0 + */ + Long findNotReadCount(Long creatorId, Integer creatorType); + } 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 index c764362d..454c6209 100644 --- 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 @@ -4,6 +4,7 @@ import cn.hutool.extra.mail.MailUtil; 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.constant.InvoiceMapHistoryOrderStatusConst; import com.xhpc.invoice.domain.*; import com.xhpc.invoice.mapper.*; import com.xhpc.invoice.pojo.XhpcInvoice; @@ -131,8 +132,10 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { //根据操作人的id,查询操作人的名字 SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(requestData.getDrawer())); requestData.setDrawer(sysUser.getNickName()); - //入库更新 + //更新发票状态 xhpcInvoiceMapper.failInvoiceToUser(requestData); + //解除锁定 + xhpcInvoiceMapHistoryOrderMapper.unlockHistoryOrdersByInvoiceId(requestData.getInvoiceId()); } @Override @@ -246,6 +249,9 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { historyOrdersDTO.setHistoryOrdersData(historyOrdersDataDTOS); historyOrdersDTO.setTotalItems(historyOrdersList.size()); specificInvoicedResponse.setHistoryOrders(historyOrdersDTO); + + //todo 一旦掉了详情接口,去掉未读状态 + return specificInvoicedResponse; } @@ -276,6 +282,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { itemsDTO.setCreateTime(DateUtils.parseDateToStr(xhpcInvoice.getCreateTime())); itemsDTO.setStatus(xhpcInvoice.getStatus()); itemsDTO.setInvoicingMoney(xhpcInvoice.getInvoiceMoney()); + itemsDTO.setIsRead(xhpcInvoice.getIsRead()); itemsDTOS.add(itemsDTO); } InvoiceHistoryRecordsResponse invoiceHistoryRecordsResponse = new InvoiceHistoryRecordsResponse(); @@ -285,6 +292,100 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { return invoiceHistoryRecordsResponse; } + /** + * 将用户申请的发票信息,保存到数据库中 + * + * @param saveInvoiceInfoRequest 发票信息 + * @throws Exception 传入发票金额参数与内部该发票所包含的所有订单金额参数不一致出现,出现此异常 + * @author WH + * @date 2021/12/28 14:33 + * @since version-1.0 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveInvoiceInfo(SaveInvoiceInfoRequest saveInvoiceInfoRequest) throws Exception { + //判断传入的历史订单是否被其他发票包含 + List historyOrderIds = saveInvoiceInfoRequest.getHistoryOrderIds(); + List lockOrderList = xhpcInvoiceMapHistoryOrderMapper.getLockedOnesByHistoryOrderId(historyOrderIds); + if (lockOrderList != null) { + throw new Exception("该历史订单已被其他发票包含"); + } + //将该发票记录放入数据库生成发票记录,除了所包含的历史订单的总电费,总服务费 + XhpcInvoice xhpcInvoice = new XhpcInvoice(); + xhpcInvoice.setReceiveEmail(saveInvoiceInfoRequest.getReceiveEmail()); + xhpcInvoice.setTitleType(saveInvoiceInfoRequest.getTitleType()); + xhpcInvoice.setTitleContent(saveInvoiceInfoRequest.getTitleContent()); + xhpcInvoice.setDutyNumber(saveInvoiceInfoRequest.getDutyNumber()); + xhpcInvoice.setInvoiceContent(saveInvoiceInfoRequest.getInvoiceContent()); + xhpcInvoice.setInvoiceMoney(saveInvoiceInfoRequest.getInvoiceMoney()); + xhpcInvoice.setFirmAddress(saveInvoiceInfoRequest.getFirmAddress()); + xhpcInvoice.setFirmPhone(saveInvoiceInfoRequest.getFirmPhone()); + xhpcInvoice.setFirmBank(saveInvoiceInfoRequest.getFirmBank()); + xhpcInvoice.setFirmBankAccount(saveInvoiceInfoRequest.getFirmBankAccount()); + xhpcInvoice.setIsShowDate(saveInvoiceInfoRequest.getIsShowDate()); + xhpcInvoice.setUserNotes(saveInvoiceInfoRequest.getUserNotes()); + xhpcInvoice.setCreatorId(saveInvoiceInfoRequest.getCreatorId()); + xhpcInvoice.setCreatorType(saveInvoiceInfoRequest.getCreatorType()); + xhpcInvoice.setCreator(saveInvoiceInfoRequest.getCreator()); + xhpcInvoice.setCreateTime(DateUtils.parseDate(saveInvoiceInfoRequest.getCreateTime())); + xhpcInvoice.setStatus(0); + xhpcInvoiceMapper.insertSelectiveAndReturnId(xhpcInvoice); + //建立订单与发票之间的关联 + List xhpcHistoryOrderList = xhpcHistoryOrderMapper.findById(historyOrderIds); + //获取所插入的发票id + Long invoiceId = xhpcInvoice.getInvoiceId(); + //存储该发票所包含的所有历史订单总电量 + double totalPowerPrice = 0; + //存储该发票所包含的所有历史订单总服务费 + double totalServicePrice = 0; + //该变量是用来计算内部存储的历史订单金额是否与传入的一致 + double totalActPrice = 0; + for (XhpcHistoryOrder xhpcHistoryOrder : xhpcHistoryOrderList) { + XhpcInvoiceMapHistoryOrder xhpcInvoiceMapHistoryOrder = new XhpcInvoiceMapHistoryOrder(); + xhpcInvoiceMapHistoryOrder.setInvoiceId(invoiceId); + xhpcInvoiceMapHistoryOrder.setHistoryOrderId(xhpcHistoryOrder.getHistoryOrderId()); + xhpcInvoiceMapHistoryOrder.setHistoryUserId(xhpcHistoryOrder.getUserId()); + xhpcInvoiceMapHistoryOrder.setHistoryUserType(Long.valueOf(xhpcHistoryOrder.getSource())); + xhpcInvoiceMapHistoryOrder.setHisotrySerialNumber(xhpcHistoryOrder.getSerialNumber()); + xhpcInvoiceMapHistoryOrder.setPowerPriceTotal(xhpcHistoryOrder.getActPowerPrice()); + xhpcInvoiceMapHistoryOrder.setServicePriceTotal(xhpcHistoryOrder.getActServicePrice()); + xhpcInvoiceMapHistoryOrder.setPromotionDiscount(xhpcHistoryOrder.getPromotionDiscount()); + xhpcInvoiceMapHistoryOrder.setHistoryActPrice(xhpcHistoryOrder.getActPrice()); + xhpcInvoiceMapHistoryOrder.setCreateTime(xhpcHistoryOrder.getCreateTime()); + xhpcInvoiceMapHistoryOrder.setChargingMode(xhpcHistoryOrder.getChargingMode()); + xhpcInvoiceMapHistoryOrder.setChargingStationId(xhpcHistoryOrder.getChargingStationId()); + xhpcInvoiceMapHistoryOrder.setTerminalId(xhpcHistoryOrder.getTerminalId()); + xhpcInvoiceMapHistoryOrder.setLockFlag(InvoiceMapHistoryOrderStatusConst.LOCK); + xhpcInvoiceMapHistoryOrderMapper.insertSelective(xhpcInvoiceMapHistoryOrder); + totalPowerPrice += xhpcHistoryOrder.getActPowerPrice().doubleValue(); + totalServicePrice += xhpcHistoryOrder.getActServicePrice().doubleValue(); + totalActPrice += xhpcHistoryOrder.getActPrice().doubleValue(); + } + if (!BigDecimal.valueOf(totalActPrice).equals(saveInvoiceInfoRequest.getInvoiceMoney())) { + throw new Exception("传入的发票金额与实际包含的历史订单总金额参数不匹配"); + } + xhpcInvoice.setInvoiceOrderEletricTotalMoney(BigDecimal.valueOf(totalPowerPrice)); + xhpcInvoice.setInvoiceOrderServiceTotalMoney(BigDecimal.valueOf(totalServicePrice)); + xhpcInvoiceMapper.insertSelective(xhpcInvoice); + } + + /** + * 查询指定用户没有查看的已开的发票的数量,即该用户有几个未读发票 + * + * @param creatorId 用户id + * @param creatorType 用户类型 + * @return 未读发票数量 + * @author WH + * @date 2021/12/28 19:01 + * @since version-1.0 + */ + @Override + public Long findNotReadCount(Long creatorId, Integer creatorType) { + + return xhpcInvoiceMapper.findNotReadCount(creatorId, creatorType); + } + + /** * 通过发票id查找对应的发票数据 * diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcHistoryOrderMapper.xml index 0e20c160..f9748596 100644 --- a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -108,5 +108,19 @@ + diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml index abd34273..e27f2de6 100644 --- a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml @@ -19,6 +19,25 @@ + + `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`, + `lock_flag`, + `del_flag` + + insert into xhpc_invoice_map_history_order (invoice_id, history_order_id, history_user_id, history_user_type, hisotry_serial_number, power_price_total, @@ -76,6 +95,9 @@ terminal_id, + + lock_flag, + del_flag, @@ -120,6 +142,9 @@ #{terminalId,jdbcType=BIGINT}, + + #{lockFlag,jdbcType=INTEGER}, + #{delFlag,jdbcType=INTEGER}, @@ -136,11 +161,17 @@ ) ) + + UPDATE xhpc_invoice_map_history_order + SET lock_flag = NULL + WHERE invoice_id = #{invoiceId} + + \ 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 index e95a89a4..0f28e800 100644 --- a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapper.xml +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapper.xml @@ -30,14 +30,39 @@ + - 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 + `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`, + `is_read`, + `del_flag` + + delete from xhpc_invoice @@ -343,6 +378,170 @@ + + 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 @@ -464,7 +663,8 @@ invoicing_time = #{invoicingTime}, electric_invoice_url = #{eletricInvoiceUrl}, `status` = #{status}, - drawer = #{drawer} + drawer = #{drawer}, + is_read = 0 WHERE invoice_id = #{invoiceId}; @@ -474,7 +674,7 @@ invoicing_time = #{invoicingTime}, electric_invoice_url = #{eletricInvoiceUrl}, `status` = #{status}, - drawer = #{drawer} + drawer = #{drawer} is_read = 0 WHERE invoice_id = #{invoiceId}