修复部分Bug

This commit is contained in:
wen 2022-01-03 21:02:32 +08:00
parent cf89e40ccf
commit 45a69c2296
9 changed files with 142 additions and 40 deletions

View File

@ -25,6 +25,11 @@ public class AllInvoiceOrdersRequest {
*/ */
@JsonProperty("creatorType") @JsonProperty("creatorType")
private Integer creatorType; private Integer creatorType;
/**
* 发票类型 0为普票1为专票
*/
@JsonProperty("invoiceType")
private Integer invoiceType;
/** /**
* 发票状态0表示未开票1表示已经开票2表示开票失败 * 发票状态0表示未开票1表示已经开票2表示开票失败
*/ */

View File

@ -58,6 +58,11 @@ public class AllInvoiceOrdersResponse {
*/ */
@JsonProperty("creatorType") @JsonProperty("creatorType")
private Integer creatorType; private Integer creatorType;
/**
* 发票类型 0为普票1为专票
*/
@JsonProperty("invoiceType")
private Integer invoiceType;
/** /**
* 发票金额 * 发票金额
*/ */

View File

@ -188,4 +188,14 @@ public interface XhpcInvoiceMapper {
*/ */
List<ExcelInvoiceRow> selectExcelInvoiceById(Long invoiceId); List<ExcelInvoiceRow> selectExcelInvoiceById(Long invoiceId);
/**
* 更新发票所包含的电量总金额服务费总金额
*
* @param xhpcInvoice 存放要更新数据的实体类
* @author WH
* @date 2022/1/3 17:06
* @since version-1.0
*/
void updateElectricAndServiceById(XhpcInvoice xhpcInvoice);
} }

View File

@ -9,7 +9,7 @@ import java.util.Date;
/** /**
* xhpc_invoice * xhpc_invoice
* *
* @author * @author WH
*/ */
@Data @Data
public class XhpcInvoice implements Serializable { public class XhpcInvoice implements Serializable {
@ -19,6 +19,11 @@ public class XhpcInvoice implements Serializable {
*/ */
private Long invoiceId; private Long invoiceId;
/**
* 发票类型(默认0普票1为专票)
*/
private Integer invoiceType;
/** /**
* 接收邮箱 * 接收邮箱
*/ */

View File

@ -1,6 +1,7 @@
package com.xhpc.invoice.pojo; package com.xhpc.invoice.pojo;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -9,8 +10,9 @@ import java.util.Date;
/** /**
* xhpc_invoice_map_history_order * xhpc_invoice_map_history_order
* *
* @author * @author WH
*/ */
@NoArgsConstructor
@Data @Data
public class XhpcInvoiceMapHistoryOrder implements Serializable { public class XhpcInvoiceMapHistoryOrder implements Serializable {
@ -37,7 +39,7 @@ public class XhpcInvoiceMapHistoryOrder implements Serializable {
/** /**
* 该发票所选中的历史订单订单编号 * 该发票所选中的历史订单订单编号
*/ */
private String hisotrySerialNumber; private String historySerialNumber;
/** /**
* 该发票所选中的历史订单电费 * 该发票所选中的历史订单电费

View File

@ -9,6 +9,7 @@ import com.xhpc.common.core.utils.bean.BeanUtils;
import com.xhpc.common.domain.XhpcChargingStation; import com.xhpc.common.domain.XhpcChargingStation;
import com.xhpc.common.redis.service.RedisService; import com.xhpc.common.redis.service.RedisService;
import com.xhpc.invoice.constant.InvoiceMapHistoryOrderStatusConst; import com.xhpc.invoice.constant.InvoiceMapHistoryOrderStatusConst;
import com.xhpc.invoice.constant.InvoiceStatusConst;
import com.xhpc.invoice.domain.*; import com.xhpc.invoice.domain.*;
import com.xhpc.invoice.mapper.*; import com.xhpc.invoice.mapper.*;
import com.xhpc.invoice.pojo.XhpcInvoice; import com.xhpc.invoice.pojo.XhpcInvoice;
@ -57,7 +58,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
RedisService redisService; RedisService redisService;
/** /**
* 通过requestData中的申请人申请人类型发票状态发票起始时间发票申请终止时间开票起始时间开票终点时间当前所在页数当前页所要显示几行来查询发票列表信息 * 通过requestData中的申请人申请人类型发票类型发票状态发票起始时间发票申请终止时间开票起始时间开票终点时间当前所在页数当前页所要显示几行来查询发票列表信息
* *
* @param requestData 传递过来的查询参数 * @param requestData 传递过来的查询参数
* @return AllInvoiceOrdersResponse 发票列表对象 * @return AllInvoiceOrdersResponse 发票列表对象
@ -69,19 +70,22 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
public AllInvoiceOrdersResponse selectAllInvoiceOrders(AllInvoiceOrdersRequest requestData) { public AllInvoiceOrdersResponse selectAllInvoiceOrders(AllInvoiceOrdersRequest requestData) {
//计算分页索引 //计算分页索引
requestData.setCurrentPage((requestData.getCurrentPage() - 1) * requestData.getItems()); requestData.setCurrentPage((requestData.getCurrentPage() - 1) * requestData.getItems());
//获取每个历史订单信息 //获取每张发票信息
List<XhpcInvoice> xhpcInvoiceList = xhpcInvoiceMapper.selectAllInvoiceOrdersByCondition(requestData); List<XhpcInvoice> xhpcInvoiceList = xhpcInvoiceMapper.selectAllInvoiceOrdersByCondition(requestData);
//对拷放置到itemsDTO中,然后将itemsDTO存放到itemsDTOList中 //对拷放置到itemsDTO中,然后将itemsDTO存放到itemsDTOList中
ArrayList<AllInvoiceOrdersResponse.ItemsDTO> itemsDTOList = new ArrayList<>(); ArrayList<AllInvoiceOrdersResponse.ItemsDTO> itemsDTOList = new ArrayList<>();
for (XhpcInvoice xhpcInvoice : xhpcInvoiceList) { for (XhpcInvoice xhpcInvoice : xhpcInvoiceList) {
AllInvoiceOrdersResponse.ItemsDTO itemsDTO = new AllInvoiceOrdersResponse.ItemsDTO(); AllInvoiceOrdersResponse.ItemsDTO itemsDTO = new AllInvoiceOrdersResponse.ItemsDTO();
itemsDTO.setInvoiceId(xhpcInvoice.getInvoiceId()); itemsDTO.setInvoiceId(xhpcInvoice.getInvoiceId());
itemsDTO.setInvoiceType(xhpcInvoice.getInvoiceType());
itemsDTO.setCreator(xhpcInvoice.getCreator()); itemsDTO.setCreator(xhpcInvoice.getCreator());
itemsDTO.setCreatorType(xhpcInvoice.getCreatorType()); itemsDTO.setCreatorType(xhpcInvoice.getCreatorType());
itemsDTO.setInvoiceMoney(xhpcInvoice.getInvoiceMoney()); itemsDTO.setInvoiceMoney(xhpcInvoice.getInvoiceMoney());
itemsDTO.setStatus(xhpcInvoice.getStatus()); itemsDTO.setStatus(xhpcInvoice.getStatus());
itemsDTO.setCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getCreateTime())); itemsDTO.setCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getCreateTime()));
itemsDTO.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime())); if (xhpcInvoice.getInvoicingTime() != null) {
itemsDTO.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime()));
}
itemsDTO.setDrawer(xhpcInvoice.getDrawer()); itemsDTO.setDrawer(xhpcInvoice.getDrawer());
itemsDTOList.add(itemsDTO); itemsDTOList.add(itemsDTO);
} }
@ -99,6 +103,10 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
allInvoiceOrdersResponse.setInvoicedSumMoney(allInvoicedMoney); allInvoiceOrdersResponse.setInvoicedSumMoney(allInvoicedMoney);
//查询所有未开发票总金额 //查询所有未开发票总金额
BigDecimal allNotInvoicedMoney = xhpcInvoiceMapper.allNotInvoicedMoney(); BigDecimal allNotInvoicedMoney = xhpcInvoiceMapper.allNotInvoicedMoney();
if (allNotInvoicedMoney == null) {
//如果没有任何未开发票那么总金额就设置成0.00
allNotInvoicedMoney = new BigDecimal("0.00");
}
allInvoiceOrdersResponse.setNotInvoiceSumMoney(allNotInvoicedMoney); allInvoiceOrdersResponse.setNotInvoiceSumMoney(allNotInvoicedMoney);
return allInvoiceOrdersResponse; return allInvoiceOrdersResponse;
} }
@ -283,7 +291,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
SpecificInvoicedResponse.HistoryOrdersDTO.HistoryOrdersDataDTO historyOrdersDataDTO = new SpecificInvoicedResponse.HistoryOrdersDTO.HistoryOrdersDataDTO(); SpecificInvoicedResponse.HistoryOrdersDTO.HistoryOrdersDataDTO historyOrdersDataDTO = new SpecificInvoicedResponse.HistoryOrdersDTO.HistoryOrdersDataDTO();
historyOrdersDataDTO.setHistoryOrderId(xhpcInvoiceMapHistoryOrder.getHistoryOrderId()); historyOrdersDataDTO.setHistoryOrderId(xhpcInvoiceMapHistoryOrder.getHistoryOrderId());
historyOrdersDataDTO.setActPrice(xhpcInvoiceMapHistoryOrder.getHistoryActPrice()); historyOrdersDataDTO.setActPrice(xhpcInvoiceMapHistoryOrder.getHistoryActPrice());
historyOrdersDataDTO.setHistorySerialNumber(xhpcInvoiceMapHistoryOrder.getHisotrySerialNumber()); historyOrdersDataDTO.setHistorySerialNumber(xhpcInvoiceMapHistoryOrder.getHistorySerialNumber());
historyOrdersDataDTO.setOrderCreateTime(DateUtils.parseDateToStr(xhpcInvoiceMapHistoryOrder.getCreateTime())); historyOrdersDataDTO.setOrderCreateTime(DateUtils.parseDateToStr(xhpcInvoiceMapHistoryOrder.getCreateTime()));
historyOrdersDataDTOS.add(historyOrdersDataDTO); historyOrdersDataDTOS.add(historyOrdersDataDTO);
} }
@ -292,6 +300,11 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
historyOrdersDTO.setTotalItems(historyOrdersList.size()); historyOrdersDTO.setTotalItems(historyOrdersList.size());
specificInvoicedResponse.setHistoryOrders(historyOrdersDTO); specificInvoicedResponse.setHistoryOrders(historyOrdersDTO);
//如果用户在该发票还没有被处理时点击查看该发票详情那么就直接返回数据
if (xhpcInvoice.getStatus().equals(InvoiceStatusConst.INVOICING)) {
return specificInvoicedResponse;
}
//一旦调了详情接口就去掉该已开发票的未读状态同时redis中的未读数量数据-1 //一旦调了详情接口就去掉该已开发票的未读状态同时redis中的未读数量数据-1
xhpcInvoiceMapper.updateByInvoiceId(invoiceId); xhpcInvoiceMapper.updateByInvoiceId(invoiceId);
reduceNoReadInvoiceCount(xhpcInvoice); reduceNoReadInvoiceCount(xhpcInvoice);
@ -400,7 +413,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
//判断传入的历史订单是否被其他发票包含 //判断传入的历史订单是否被其他发票包含
List<Integer> historyOrderIds = saveInvoiceInfoRequest.getHistoryOrderIds(); List<Integer> historyOrderIds = saveInvoiceInfoRequest.getHistoryOrderIds();
List<XhpcInvoiceMapHistoryOrder> lockOrderList = xhpcInvoiceMapHistoryOrderMapper.getLockedOnesByHistoryOrderId(historyOrderIds); List<XhpcInvoiceMapHistoryOrder> lockOrderList = xhpcInvoiceMapHistoryOrderMapper.getLockedOnesByHistoryOrderId(historyOrderIds);
if (lockOrderList != null) { if (lockOrderList.size() > 0) {
throw new Exception("该历史订单已被其他发票包含"); throw new Exception("该历史订单已被其他发票包含");
} }
//将该发票记录放入数据库生成发票记录,除了所包含的历史订单的总电费总服务费 //将该发票记录放入数据库生成发票记录,除了所包含的历史订单的总电费总服务费
@ -439,9 +452,9 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
xhpcInvoiceMapHistoryOrder.setHistoryOrderId(xhpcHistoryOrder.getHistoryOrderId()); xhpcInvoiceMapHistoryOrder.setHistoryOrderId(xhpcHistoryOrder.getHistoryOrderId());
xhpcInvoiceMapHistoryOrder.setHistoryUserId(xhpcHistoryOrder.getUserId()); xhpcInvoiceMapHistoryOrder.setHistoryUserId(xhpcHistoryOrder.getUserId());
xhpcInvoiceMapHistoryOrder.setHistoryUserType(Long.valueOf(xhpcHistoryOrder.getSource())); xhpcInvoiceMapHistoryOrder.setHistoryUserType(Long.valueOf(xhpcHistoryOrder.getSource()));
xhpcInvoiceMapHistoryOrder.setHisotrySerialNumber(xhpcHistoryOrder.getSerialNumber()); xhpcInvoiceMapHistoryOrder.setHistorySerialNumber(xhpcHistoryOrder.getSerialNumber());
xhpcInvoiceMapHistoryOrder.setPowerPriceTotal(xhpcHistoryOrder.getActPowerPrice()); xhpcInvoiceMapHistoryOrder.setPowerPriceTotal(xhpcHistoryOrder.getPowerPriceTotal());
xhpcInvoiceMapHistoryOrder.setServicePriceTotal(xhpcHistoryOrder.getActServicePrice()); xhpcInvoiceMapHistoryOrder.setServicePriceTotal(BigDecimal.valueOf(xhpcHistoryOrder.getServicePriceTotal().doubleValue() - xhpcHistoryOrder.getPromotionDiscount().doubleValue()));
xhpcInvoiceMapHistoryOrder.setPromotionDiscount(xhpcHistoryOrder.getPromotionDiscount()); xhpcInvoiceMapHistoryOrder.setPromotionDiscount(xhpcHistoryOrder.getPromotionDiscount());
xhpcInvoiceMapHistoryOrder.setHistoryActPrice(xhpcHistoryOrder.getActPrice()); xhpcInvoiceMapHistoryOrder.setHistoryActPrice(xhpcHistoryOrder.getActPrice());
xhpcInvoiceMapHistoryOrder.setCreateTime(xhpcHistoryOrder.getCreateTime()); xhpcInvoiceMapHistoryOrder.setCreateTime(xhpcHistoryOrder.getCreateTime());
@ -450,16 +463,16 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
xhpcInvoiceMapHistoryOrder.setTerminalId(xhpcHistoryOrder.getTerminalId()); xhpcInvoiceMapHistoryOrder.setTerminalId(xhpcHistoryOrder.getTerminalId());
xhpcInvoiceMapHistoryOrder.setLockFlag(InvoiceMapHistoryOrderStatusConst.LOCK); xhpcInvoiceMapHistoryOrder.setLockFlag(InvoiceMapHistoryOrderStatusConst.LOCK);
xhpcInvoiceMapHistoryOrderMapper.insertSelective(xhpcInvoiceMapHistoryOrder); xhpcInvoiceMapHistoryOrderMapper.insertSelective(xhpcInvoiceMapHistoryOrder);
totalPowerPrice += xhpcHistoryOrder.getActPowerPrice().doubleValue(); totalPowerPrice += xhpcHistoryOrder.getPowerPriceTotal().doubleValue();
totalServicePrice += xhpcHistoryOrder.getActServicePrice().doubleValue(); totalServicePrice += (xhpcHistoryOrder.getServicePriceTotal().doubleValue() - xhpcHistoryOrder.getPromotionDiscount().doubleValue());
totalActPrice += xhpcHistoryOrder.getActPrice().doubleValue(); totalActPrice += xhpcHistoryOrder.getTotalPrice().doubleValue();
} }
if (!BigDecimal.valueOf(totalActPrice).equals(saveInvoiceInfoRequest.getInvoiceMoney())) { if (!BigDecimal.valueOf(totalActPrice).equals(saveInvoiceInfoRequest.getInvoiceMoney())) {
throw new Exception("传入的发票金额与实际包含的历史订单总金额参数不匹配"); throw new Exception("传入的发票金额与实际包含的历史订单总金额参数不匹配");
} }
xhpcInvoice.setInvoiceOrderEletricTotalMoney(BigDecimal.valueOf(totalPowerPrice)); xhpcInvoice.setInvoiceOrderEletricTotalMoney(BigDecimal.valueOf(totalPowerPrice));
xhpcInvoice.setInvoiceOrderServiceTotalMoney(BigDecimal.valueOf(totalServicePrice)); xhpcInvoice.setInvoiceOrderServiceTotalMoney(BigDecimal.valueOf(totalServicePrice));
xhpcInvoiceMapper.insertSelective(xhpcInvoice); xhpcInvoiceMapper.updateElectricAndServiceById(xhpcInvoice);
} }
/** /**
@ -591,7 +604,9 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
specificInvoiceWrap.setInvoiceMoney(xhpcInvoice.getInvoiceMoney()); specificInvoiceWrap.setInvoiceMoney(xhpcInvoice.getInvoiceMoney());
specificInvoiceWrap.setInvoiceTotalEletricMoney(xhpcInvoice.getInvoiceOrderEletricTotalMoney()); specificInvoiceWrap.setInvoiceTotalEletricMoney(xhpcInvoice.getInvoiceOrderEletricTotalMoney());
specificInvoiceWrap.setInvoiceTotalServiceMoney(xhpcInvoice.getInvoiceOrderServiceTotalMoney()); specificInvoiceWrap.setInvoiceTotalServiceMoney(xhpcInvoice.getInvoiceOrderServiceTotalMoney());
specificInvoiceWrap.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime())); if (xhpcInvoice.getInvoicingTime() != null) {
specificInvoiceWrap.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime()));
}
//处理包装类内层数据 //处理包装类内层数据
specificInvoiceWrap.setHistoryOrders(new SpecificInvoiceWrap.HistoryOrdersDTO()); specificInvoiceWrap.setHistoryOrders(new SpecificInvoiceWrap.HistoryOrdersDTO());
SpecificInvoiceWrap.HistoryOrdersDTO historyOrdersDTO = specificInvoiceWrap.getHistoryOrders(); SpecificInvoiceWrap.HistoryOrdersDTO historyOrdersDTO = specificInvoiceWrap.getHistoryOrders();
@ -608,7 +623,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
historyOrdersDataDTO.setHistoryCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoiceMapHistoryOrder.getCreateTime())); historyOrdersDataDTO.setHistoryCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoiceMapHistoryOrder.getCreateTime()));
historyOrdersDataDTO.setServiceMoney(xhpcInvoiceMapHistoryOrder.getServicePriceTotal()); historyOrdersDataDTO.setServiceMoney(xhpcInvoiceMapHistoryOrder.getServicePriceTotal());
historyOrdersDataDTO.setEletricMoney(xhpcInvoiceMapHistoryOrder.getPowerPriceTotal()); historyOrdersDataDTO.setEletricMoney(xhpcInvoiceMapHistoryOrder.getPowerPriceTotal());
historyOrdersDataDTO.setHistorySerialNumber(xhpcInvoiceMapHistoryOrder.getHisotrySerialNumber()); historyOrdersDataDTO.setHistorySerialNumber(xhpcInvoiceMapHistoryOrder.getHistorySerialNumber());
XhpcChargingStation xhpcChargingStation = xhpcChargingStationMapper.selectXhpcChargingStationById(xhpcInvoiceMapHistoryOrder.getChargingStationId()); XhpcChargingStation xhpcChargingStation = xhpcChargingStationMapper.selectXhpcChargingStationById(xhpcInvoiceMapHistoryOrder.getChargingStationId());
Map<String, Object> operatorInfo = xhpcOperatorMapper.info(xhpcChargingStation.getOperatorId()); Map<String, Object> operatorInfo = xhpcOperatorMapper.info(xhpcChargingStation.getOperatorId());
String operatorName = (String) operatorInfo.get("name"); String operatorName = (String) operatorInfo.get("name");

View File

@ -53,21 +53,67 @@
<result column="total_power" jdbcType="DOUBLE" property="totalPower"/> <result column="total_power" jdbcType="DOUBLE" property="totalPower"/>
<result column="user_name_evcs" jdbcType="VARCHAR" property="userNameEvcs"/> <result column="user_name_evcs" jdbcType="VARCHAR" property="userNameEvcs"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/> <result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="charging_mode" jdbcType="VARCHAR" property="chargingMode"/>
<result column="internet_degree_commission" jdbcType="DECIMAL" property="internetDegreeCommission"/> <result column="internet_degree_commission" jdbcType="DECIMAL" property="internetDegreeCommission"/>
<result column="source" jdbcType="INTEGER" property="source"/> <result column="source" jdbcType="INTEGER" property="source"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
history_order_id history_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, charging_station_id,
act_price, act_power_price, act_service_price, internet_commission, internet_svc_commission, charge_order_id,
platform_commission, platform_svc_commisssion, operation_commission, operation_svc_commission, user_id,
start_soc, end_soc, reconciliation_status, sorting_status, `type`, `status`, del_flag, terminal_id,
create_time, create_by, update_time, update_by, remark, `state`, vin_normal, search_value, serial_number,
operator_id_evcs, charge_model_evcs, connector_power_evcs, meter_value_end_evcs, internet_serial_number,
meter_value_start_evcs, operator_id3rdpty_evcs, start_time, stop_reason_evcs, total_power, power_price_total,
user_name_evcs, phone, rate_model_id 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
</sql> </sql>
<select id="findByCondition" resultMap="XhpcHistoryOrderResult"> <select id="findByCondition" resultMap="XhpcHistoryOrderResult">
@ -108,16 +154,16 @@
</foreach> </foreach>
</if> </if>
</select> </select>
<select id="findById" resultType="com.xhpc.order.domain.XhpcHistoryOrder"> <select id="findById" resultMap="XhpcHistoryOrderResult">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM FROM
xhpc_history_order xhpc_history_order
WHERE WHERE
del_flag IS NULL del_flag = 0
<if test="historyOrderIds!=null"> <if test="collection!=null">
AND history_order_id IN AND history_order_id IN
<foreach collection="historyOrderIds" open="(" close=")" item="historyOrderId" separator=","> <foreach collection="collection" open="(" close=")" item="historyOrderId" separator=",">
#{historyOrderId} #{historyOrderId}
</foreach> </foreach>
</if> </if>

View File

@ -6,7 +6,7 @@
<result column="history_order_id" jdbcType="BIGINT" property="historyOrderId"/> <result column="history_order_id" jdbcType="BIGINT" property="historyOrderId"/>
<result column="history_user_id" jdbcType="BIGINT" property="historyUserId"/> <result column="history_user_id" jdbcType="BIGINT" property="historyUserId"/>
<result column="history_user_type" jdbcType="BIGINT" property="historyUserType"/> <result column="history_user_type" jdbcType="BIGINT" property="historyUserType"/>
<result column="hisotry_serial_number" jdbcType="VARCHAR" property="hisotrySerialNumber"/> <result column="history_serial_number" jdbcType="VARCHAR" property="historySerialNumber"/>
<result column="power_price_total" jdbcType="DECIMAL" property="powerPriceTotal"/> <result column="power_price_total" jdbcType="DECIMAL" property="powerPriceTotal"/>
<result column="service_price_total" jdbcType="DECIMAL" property="servicePriceTotal"/> <result column="service_price_total" jdbcType="DECIMAL" property="servicePriceTotal"/>
<result column="promotion_discount" jdbcType="DECIMAL" property="promotionDiscount"/> <result column="promotion_discount" jdbcType="DECIMAL" property="promotionDiscount"/>
@ -25,7 +25,7 @@
`history_order_id`, `history_order_id`,
`history_user_id`, `history_user_id`,
`history_user_type`, `history_user_type`,
`hisotry_serial_number`, `history_serial_number`,
`power_price_total`, `power_price_total`,
`service_price_total`, `service_price_total`,
`promotion_discount`, `promotion_discount`,
@ -68,8 +68,8 @@
<if test="historyUserType != null"> <if test="historyUserType != null">
history_user_type, history_user_type,
</if> </if>
<if test="hisotrySerialNumber != null"> <if test="historySerialNumber != null">
hisotry_serial_number, history_serial_number,
</if> </if>
<if test="powerPriceTotal != null"> <if test="powerPriceTotal != null">
power_price_total, power_price_total,
@ -115,8 +115,8 @@
<if test="historyUserType != null"> <if test="historyUserType != null">
#{historyUserType,jdbcType=BIGINT}, #{historyUserType,jdbcType=BIGINT},
</if> </if>
<if test="hisotrySerialNumber != null"> <if test="historySerialNumber != null">
#{hisotrySerialNumber,jdbcType=VARCHAR}, #{historySerialNumber,jdbcType=VARCHAR},
</if> </if>
<if test="powerPriceTotal != null"> <if test="powerPriceTotal != null">
#{powerPriceTotal,jdbcType=DECIMAL}, #{powerPriceTotal,jdbcType=DECIMAL},
@ -199,7 +199,7 @@
xhpc_invoice_map_history_order xhpc_invoice_map_history_order
WHERE WHERE
history_order_id IN history_order_id IN
<foreach collection="historyOrderIds" open="(" close=")" separator="," item="historyOrderId"> <foreach collection="collection" open="(" close=")" separator="," item="historyOrderId">
#{historyOrderId} #{historyOrderId}
</foreach> </foreach>
AND lock_flag = 0; AND lock_flag = 0;

View File

@ -3,6 +3,7 @@
<mapper namespace="com.xhpc.invoice.mapper.XhpcInvoiceMapper"> <mapper namespace="com.xhpc.invoice.mapper.XhpcInvoiceMapper">
<resultMap id="BaseResultMap" type="com.xhpc.invoice.pojo.XhpcInvoice"> <resultMap id="BaseResultMap" type="com.xhpc.invoice.pojo.XhpcInvoice">
<id column="invoice_id" jdbcType="BIGINT" property="invoiceId"/> <id column="invoice_id" jdbcType="BIGINT" property="invoiceId"/>
<result column="invoice_type" jdbcType="INTEGER" property="invoiceType"/>
<result column="receive_email" jdbcType="VARCHAR" property="receiveEmail"/> <result column="receive_email" jdbcType="VARCHAR" property="receiveEmail"/>
<result column="title_type" jdbcType="INTEGER" property="titleType"/> <result column="title_type" jdbcType="INTEGER" property="titleType"/>
<result column="title_content" jdbcType="VARCHAR" property="titleContent"/> <result column="title_content" jdbcType="VARCHAR" property="titleContent"/>
@ -72,6 +73,7 @@
<select id="selectAllInvoiceOrdersByCondition" resultMap="BaseResultMap"> <select id="selectAllInvoiceOrdersByCondition" resultMap="BaseResultMap">
SELECT SELECT
invoice_id, invoice_id,
invoice_type,
creator, creator,
creator_type, creator_type,
invoice_money, invoice_money,
@ -87,7 +89,10 @@
and creator = #{creator} and creator = #{creator}
</if> </if>
<if test="creatorType!=null"> <if test="creatorType!=null">
and creatorType = #{creatorType} and creator_type = #{creatorType}
</if>
<if test="invoiceType!=null">
and invoice_type = #{invoiceType}
</if> </if>
<if test="status!=null"> <if test="status!=null">
and status = #{status} and status = #{status}
@ -118,7 +123,10 @@
and creator = #{creator} and creator = #{creator}
</if> </if>
<if test="creatorType!=null"> <if test="creatorType!=null">
and creatorType = #{creatorType} and creator_type = #{creatorType}
</if>
<if test="invoiceType!=null">
and invoice_type = #{invoiceType}
</if> </if>
<if test="status!=null"> <if test="status!=null">
and status = #{status} and status = #{status}
@ -421,7 +429,7 @@
</trim> </trim>
</insert> </insert>
<insert id="insertSelectiveAndReturnId" parameterType="com.xhpc.invoice.pojo.XhpcInvoice" <insert id="insertSelectiveAndReturnId" parameterType="com.xhpc.invoice.pojo.XhpcInvoice"
keyProperty="invoiceId"> keyProperty="invoiceId" useGeneratedKeys="true">
insert into xhpc_invoice insert into xhpc_invoice
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="receiveEmail != null"> <if test="receiveEmail != null">
@ -725,5 +733,11 @@
WHERE del_flag IS NULL WHERE del_flag IS NULL
AND invoice_id = #{invoiceId} AND invoice_id = #{invoiceId}
</update> </update>
<update id="updateElectricAndServiceById">
UPDATE xhpc_invoice
SET invoice_order_eletric_total_money = #{invoiceOrderEletricTotalMoney},
invoice_order_service_total_money = #{invoiceOrderServiceTotalMoney}
WHERE invoice_id = #{invoiceId};
</update>
</mapper> </mapper>