mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-28 18:03:47 +08:00
Merge branch 'dev' into HuiFu
This commit is contained in:
@@ -364,6 +364,11 @@ public class MemberService {
|
|||||||
.titleId(memberInvoiceTitle.getId() + "")
|
.titleId(memberInvoiceTitle.getId() + "")
|
||||||
.titleName(memberInvoiceTitle.getName())
|
.titleName(memberInvoiceTitle.getName())
|
||||||
.titleType(TitleTypeEnum.getLabel(memberInvoiceTitle.getTitleType()))
|
.titleType(TitleTypeEnum.getLabel(memberInvoiceTitle.getTitleType()))
|
||||||
|
.taxId(memberInvoiceTitle.getTaxId())
|
||||||
|
.unitAddress(memberInvoiceTitle.getUnitAddress())
|
||||||
|
.phoneNumber(memberInvoiceTitle.getPhoneNumber())
|
||||||
|
.bankName(memberInvoiceTitle.getBankName())
|
||||||
|
.bankAccountNumber(memberInvoiceTitle.getBankAccountNumber())
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import com.jsowell.common.core.redis.RedisCache;
|
|||||||
import com.jsowell.common.enums.InvoiceRecordEnum;
|
import com.jsowell.common.enums.InvoiceRecordEnum;
|
||||||
import com.jsowell.common.enums.MemberWalletEnum;
|
import com.jsowell.common.enums.MemberWalletEnum;
|
||||||
import com.jsowell.common.enums.ykc.ActionTypeEnum;
|
import com.jsowell.common.enums.ykc.ActionTypeEnum;
|
||||||
import com.jsowell.common.enums.ykc.BillingTimeEnum;
|
|
||||||
import com.jsowell.common.enums.ykc.OrderPayModeEnum;
|
import com.jsowell.common.enums.ykc.OrderPayModeEnum;
|
||||||
import com.jsowell.common.enums.ykc.OrderPayRecordEnum;
|
import com.jsowell.common.enums.ykc.OrderPayRecordEnum;
|
||||||
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
||||||
@@ -69,6 +68,8 @@ import com.jsowell.pile.service.WechatPayService;
|
|||||||
import com.jsowell.pile.service.WxpayCallbackRecordService;
|
import com.jsowell.pile.service.WxpayCallbackRecordService;
|
||||||
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
|
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
|
||||||
import com.jsowell.pile.transaction.service.TransactionService;
|
import com.jsowell.pile.transaction.service.TransactionService;
|
||||||
|
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||||
|
import com.jsowell.pile.vo.base.OrderPeriodAmountVO;
|
||||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.InvoiceRecordVO;
|
import com.jsowell.pile.vo.uniapp.InvoiceRecordVO;
|
||||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||||
@@ -858,48 +859,12 @@ public class OrderService {
|
|||||||
// 查订单明细
|
// 查订单明细
|
||||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||||
if (orderDetail != null) {
|
if (orderDetail != null) {
|
||||||
OrderDetailInfoVO.BillingDetails billingDetails = new OrderDetailInfoVO.BillingDetails();
|
OrderAmountDetailVO billingDetails = new OrderAmountDetailVO();
|
||||||
BeanUtils.copyBeanProp(billingDetails, orderDetail);
|
BeanUtils.copyBeanProp(billingDetails, orderDetail);
|
||||||
vo.setBillingDetails(billingDetails);
|
vo.setBillingDetails(billingDetails);
|
||||||
|
|
||||||
// new 收费明细
|
List<OrderPeriodAmountVO> orderPeriodAmountVOS = orderBasicInfoService.transformPeriodAmountByOrderDetail(orderDetail);
|
||||||
OrderDetailInfoVO.ChargeDetail sharp = new OrderDetailInfoVO.ChargeDetail();
|
vo.setChargeDetails(orderPeriodAmountVOS);
|
||||||
sharp.setPeriodType(BillingTimeEnum.SHARP.getLabel());
|
|
||||||
sharp.setElectricityPrice(orderDetail.getSharpElectricityPrice());
|
|
||||||
sharp.setServicePrice(orderDetail.getSharpServicePrice());
|
|
||||||
BigDecimal sharpUsedElectricity = orderDetail.getSharpUsedElectricity() == null ? BigDecimal.ZERO : orderDetail.getSharpUsedElectricity();
|
|
||||||
sharp.setUsedElectricity(sharpUsedElectricity);
|
|
||||||
sharp.setElectricityAmount(sharp.getElectricityPrice().multiply(sharp.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
||||||
sharp.setServiceAmount(sharp.getServicePrice().multiply(sharp.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
||||||
|
|
||||||
OrderDetailInfoVO.ChargeDetail peak = new OrderDetailInfoVO.ChargeDetail();
|
|
||||||
peak.setPeriodType(BillingTimeEnum.PEAK.getLabel());
|
|
||||||
peak.setElectricityPrice(orderDetail.getPeakElectricityPrice());
|
|
||||||
peak.setServicePrice(orderDetail.getPeakServicePrice());
|
|
||||||
BigDecimal peakUsedElectricity = orderDetail.getPeakUsedElectricity() == null ? BigDecimal.ZERO : orderDetail.getPeakUsedElectricity();
|
|
||||||
peak.setUsedElectricity(peakUsedElectricity);
|
|
||||||
peak.setElectricityAmount(peak.getElectricityPrice().multiply(peak.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
||||||
peak.setServiceAmount(peak.getServicePrice().multiply(peak.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
||||||
|
|
||||||
OrderDetailInfoVO.ChargeDetail flat = new OrderDetailInfoVO.ChargeDetail();
|
|
||||||
flat.setPeriodType(BillingTimeEnum.FLAT.getLabel());
|
|
||||||
flat.setElectricityPrice(orderDetail.getFlatElectricityPrice());
|
|
||||||
flat.setServicePrice(orderDetail.getFlatServicePrice());
|
|
||||||
BigDecimal flatUsedElectricity = orderDetail.getFlatUsedElectricity() == null ? BigDecimal.ZERO : orderDetail.getFlatUsedElectricity();
|
|
||||||
flat.setUsedElectricity(flatUsedElectricity);
|
|
||||||
flat.setElectricityAmount(flat.getElectricityPrice().multiply(flat.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
||||||
flat.setServiceAmount(flat.getServicePrice().multiply(flat.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
||||||
|
|
||||||
OrderDetailInfoVO.ChargeDetail valley = new OrderDetailInfoVO.ChargeDetail();
|
|
||||||
valley.setPeriodType(BillingTimeEnum.VALLEY.getLabel());
|
|
||||||
valley.setElectricityPrice(orderDetail.getValleyElectricityPrice());
|
|
||||||
valley.setServicePrice(orderDetail.getValleyServicePrice());
|
|
||||||
BigDecimal valleyUsedElectricity = orderDetail.getValleyUsedElectricity() == null ? BigDecimal.ZERO : orderDetail.getValleyUsedElectricity();
|
|
||||||
valley.setUsedElectricity(valleyUsedElectricity);
|
|
||||||
valley.setElectricityAmount(valley.getElectricityPrice().multiply(valley.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
||||||
valley.setServiceAmount(valley.getServicePrice().multiply(valley.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
||||||
|
|
||||||
vo.setChargeDetails(Lists.newArrayList(sharp, peak, flat, valley));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
@@ -1004,10 +969,9 @@ public class OrderService {
|
|||||||
|
|
||||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||||
if (orderDetail != null) {
|
if (orderDetail != null) {
|
||||||
UniAppOrderVO.BillingDetails billingDetails = new UniAppOrderVO.BillingDetails();
|
OrderAmountDetailVO billingDetails = new OrderAmountDetailVO();
|
||||||
BeanUtils.copyBeanProp(billingDetails, orderDetail);
|
BeanUtils.copyBeanProp(billingDetails, orderDetail);
|
||||||
vo.setBillingDetails(billingDetails);
|
vo.setBillingDetails(billingDetails);
|
||||||
// orderDetail.getSharpElectricityPrice()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class OrderInvoiceRecordController extends BaseController {
|
|||||||
@PreAuthorize("@ss.hasPermi('order:invoice:query')")
|
@PreAuthorize("@ss.hasPermi('order:invoice:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Integer id) {
|
public AjaxResult getInfo(@PathVariable("id") Integer id) {
|
||||||
return AjaxResult.success(orderInvoiceRecordService.selectOrderInvoiceRecordById(id));
|
return AjaxResult.success(orderInvoiceRecordService.selectInvoiceTitleVO(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.common.util;
|
package com.jsowell.common.util;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.jsowell.common.constant.HttpStatus;
|
import com.jsowell.common.constant.HttpStatus;
|
||||||
import com.jsowell.common.core.domain.entity.SysDept;
|
import com.jsowell.common.core.domain.entity.SysDept;
|
||||||
@@ -8,6 +9,7 @@ import com.jsowell.common.core.domain.entity.SysUser;
|
|||||||
import com.jsowell.common.core.domain.model.LoginUser;
|
import com.jsowell.common.core.domain.model.LoginUser;
|
||||||
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
|
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
|
||||||
import com.jsowell.common.exception.ServiceException;
|
import com.jsowell.common.exception.ServiceException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
@@ -19,6 +21,7 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
* @author jsowell
|
* @author jsowell
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
public class SecurityUtils {
|
public class SecurityUtils {
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
@@ -120,8 +123,10 @@ public class SecurityUtils {
|
|||||||
// 登录用户所属部门(运营商或站点 根据父级id判断)
|
// 登录用户所属部门(运营商或站点 根据父级id判断)
|
||||||
SysDept dept = user.getDept();
|
SysDept dept = user.getDept();
|
||||||
if (dept == null) {
|
if (dept == null) {
|
||||||
|
log.info("用户id:{}, 获取不到所属部门信息", user.getUserId());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
log.info("用户id:{}, 所属部门信息:{}", user.getUserId(), JSONObject.toJSONString(dept));
|
||||||
// 登录用户角色
|
// 登录用户角色
|
||||||
List<SysRole> roles = user.getRoles();
|
List<SysRole> roles = user.getRoles();
|
||||||
Long parentId = dept.getParentId();
|
Long parentId = dept.getParentId();
|
||||||
|
|||||||
@@ -138,14 +138,10 @@ public class LoginRequestHandler extends AbstractHandler{
|
|||||||
|
|
||||||
if (pileInfoVO != null) {
|
if (pileInfoVO != null) {
|
||||||
flag = Constants.zeroByteArray;
|
flag = Constants.zeroByteArray;
|
||||||
|
|
||||||
// 登录成功,保存桩号和channel的关系
|
// 登录成功,保存桩号和channel的关系
|
||||||
PileChannelEntity.put(pileSn, channel);
|
PileChannelEntity.put(pileSn, channel);
|
||||||
|
|
||||||
// 更改桩和该桩下的枪口状态分别为 在线、空闲 公共方法修改状态
|
// 更改桩和该桩下的枪口状态分别为 在线、空闲 公共方法修改状态
|
||||||
pileBasicInfoService.updateStatus(BytesUtil.bcd2Str(ykcDataProtocol.getFrameType()), pileSn, null, null, null);
|
pileBasicInfoService.updateStatus(BytesUtil.bcd2Str(ykcDataProtocol.getFrameType()), pileSn, null, null, null);
|
||||||
}
|
|
||||||
|
|
||||||
// 充电桩使用的sim卡,把信息存库
|
// 充电桩使用的sim卡,把信息存库
|
||||||
if (StringUtils.equals("00", internetConnection)) {
|
if (StringUtils.equals("00", internetConnection)) {
|
||||||
try {
|
try {
|
||||||
@@ -155,10 +151,6 @@ public class LoginRequestHandler extends AbstractHandler{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存报文
|
|
||||||
String jsonMsg = JSONObject.toJSONString(loginRequestData);
|
|
||||||
pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, ykcDataProtocol.getHEXString());
|
|
||||||
|
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(200);
|
Thread.sleep(200);
|
||||||
@@ -181,6 +173,11 @@ public class LoginRequestHandler extends AbstractHandler{
|
|||||||
IssueQRCodeCommand issueQRCodeCommand = IssueQRCodeCommand.builder().pileSn(pileSn).build();
|
IssueQRCodeCommand issueQRCodeCommand = IssueQRCodeCommand.builder().pileSn(pileSn).build();
|
||||||
ykcPushCommandService.pushIssueQRCodeCommand(issueQRCodeCommand);
|
ykcPushCommandService.pushIssueQRCodeCommand(issueQRCodeCommand);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存报文 TODO 没有登录认证通过还要不要保存报文?
|
||||||
|
String jsonMsg = JSONObject.toJSONString(loginRequestData);
|
||||||
|
pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, ykcDataProtocol.getHEXString());
|
||||||
|
|
||||||
// 消息体
|
// 消息体
|
||||||
byte[] messageBody = Bytes.concat(pileSnByte, flag);
|
byte[] messageBody = Bytes.concat(pileSnByte, flag);
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.jsowell.pile.dto;
|
|||||||
import com.jsowell.common.core.domain.BaseEntity;
|
import com.jsowell.common.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页数据展示DTO
|
* 首页数据展示DTO
|
||||||
*
|
*
|
||||||
@@ -15,4 +17,6 @@ public class IndexQueryDTO extends BaseEntity {
|
|||||||
* 站点id
|
* 站点id
|
||||||
*/
|
*/
|
||||||
private String stationId;
|
private String stationId;
|
||||||
|
|
||||||
|
private List<String> stationIdList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,4 +205,6 @@ public interface OrderBasicInfoMapper {
|
|||||||
List<OrderDetail> queryElecAmountNullList();
|
List<OrderDetail> queryElecAmountNullList();
|
||||||
|
|
||||||
int batchUpdateOrderDetail(@Param("list") List<OrderDetail> orderDetailList);
|
int batchUpdateOrderDetail(@Param("list") List<OrderDetail> orderDetailList);
|
||||||
|
|
||||||
|
List<OrderDetail> getOrderDetailList(List<String> orderCodes);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.jsowell.pile.mapper;
|
|||||||
|
|
||||||
import com.jsowell.pile.domain.OrderInvoiceRecord;
|
import com.jsowell.pile.domain.OrderInvoiceRecord;
|
||||||
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -11,6 +12,7 @@ import java.util.List;
|
|||||||
* @author jsowell
|
* @author jsowell
|
||||||
* @date 2023-04-10
|
* @date 2023-04-10
|
||||||
*/
|
*/
|
||||||
|
@Repository
|
||||||
public interface OrderInvoiceRecordMapper {
|
public interface OrderInvoiceRecordMapper {
|
||||||
/**
|
/**
|
||||||
* 查询申请开票
|
* 查询申请开票
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.pile.mapper;
|
package com.jsowell.pile.mapper;
|
||||||
|
|
||||||
import com.jsowell.pile.domain.PileMerchantInfo;
|
import com.jsowell.pile.domain.PileMerchantInfo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -67,4 +68,6 @@ public interface PileMerchantInfoMapper {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePileMerchantInfoByIds(Long[] ids);
|
public int deletePileMerchantInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
List<String> queryByMerchantDeptIds(@Param("merchantDeptIds") List<String> merchantDeptIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,4 +77,6 @@ public interface PileStationInfoMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PileStationInfo> getStationInfoForLianLian();
|
List<PileStationInfo> getStationInfoForLianLian();
|
||||||
|
|
||||||
|
List<String> queryByStationDeptIds(@Param("stationDeptIds") List<String> stationDeptIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.pile.service;
|
package com.jsowell.pile.service;
|
||||||
|
|
||||||
import com.jsowell.pile.domain.MemberInvoiceTitle;
|
import com.jsowell.pile.domain.MemberInvoiceTitle;
|
||||||
|
import com.jsowell.pile.vo.uniapp.InvoiceTitleVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -11,6 +12,8 @@ import java.util.List;
|
|||||||
* @date 2023-04-13
|
* @date 2023-04-13
|
||||||
*/
|
*/
|
||||||
public interface IMemberInvoiceTitleService {
|
public interface IMemberInvoiceTitleService {
|
||||||
|
InvoiceTitleVO selectByTitleId(String titleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询会员发票抬头
|
* 查询会员发票抬头
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
|||||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||||
import com.jsowell.pile.domain.OrderDetail;
|
import com.jsowell.pile.domain.OrderDetail;
|
||||||
import com.jsowell.pile.dto.*;
|
import com.jsowell.pile.dto.*;
|
||||||
|
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||||
|
import com.jsowell.pile.vo.base.OrderPeriodAmountVO;
|
||||||
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.OrderVO;
|
import com.jsowell.pile.vo.uniapp.OrderVO;
|
||||||
import com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO;
|
import com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO;
|
||||||
@@ -108,6 +110,8 @@ public interface IOrderBasicInfoService {
|
|||||||
*/
|
*/
|
||||||
OrderDetail getOrderDetailByOrderCode(String orderCode);
|
OrderDetail getOrderDetailByOrderCode(String orderCode);
|
||||||
|
|
||||||
|
List<OrderDetail> getOrderDetailList(List<String> orderCodes);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过会员Id和订单状态查询订单信息
|
* 通过会员Id和订单状态查询订单信息
|
||||||
*
|
*
|
||||||
@@ -231,4 +235,8 @@ public interface IOrderBasicInfoService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map<String, Object> generateOrderForLianLian(QueryStartChargeDTO dto);
|
Map<String, Object> generateOrderForLianLian(QueryStartChargeDTO dto);
|
||||||
|
|
||||||
|
List<OrderAmountDetailVO> queryOrderAmountDetail(List<String> orderCodes);
|
||||||
|
|
||||||
|
List<OrderPeriodAmountVO> transformPeriodAmountByOrderDetail(OrderDetail orderDetail);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.jsowell.pile.service;
|
|||||||
|
|
||||||
import com.jsowell.pile.domain.OrderInvoiceRecord;
|
import com.jsowell.pile.domain.OrderInvoiceRecord;
|
||||||
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
||||||
|
import com.jsowell.pile.vo.web.InvoiceRecordVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -20,6 +21,8 @@ public interface IOrderInvoiceRecordService {
|
|||||||
*/
|
*/
|
||||||
public OrderInvoiceRecord selectOrderInvoiceRecordById(Integer id);
|
public OrderInvoiceRecord selectOrderInvoiceRecordById(Integer id);
|
||||||
|
|
||||||
|
InvoiceRecordVO selectInvoiceTitleVO(Integer id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询申请开票列表
|
* 查询申请开票列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -63,4 +63,11 @@ public interface IPileMerchantInfoService {
|
|||||||
String getMerchantIdByAppId(String appId);
|
String getMerchantIdByAppId(String appId);
|
||||||
|
|
||||||
MerchantInfoVO getMerchantInfo(String merchantId);
|
MerchantInfoVO getMerchantInfo(String merchantId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据运营商部门ids 查询所有站点id
|
||||||
|
* @param merchantDeptIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> queryByMerchantDeptIds(List<String> merchantDeptIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,4 +92,6 @@ public interface IPileStationInfoService {
|
|||||||
PileStationVO getStationInfoByPileSn(String pileSn);
|
PileStationVO getStationInfoByPileSn(String pileSn);
|
||||||
|
|
||||||
List<PileStationInfo> getStationInfoForLianLian();
|
List<PileStationInfo> getStationInfoForLianLian();
|
||||||
|
|
||||||
|
List<String> queryByStationDeptIds(List<String> stationIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.jsowell.pile.service.impl;
|
package com.jsowell.pile.service.impl;
|
||||||
|
|
||||||
|
import com.jsowell.common.enums.TitleTypeEnum;
|
||||||
import com.jsowell.common.util.DateUtils;
|
import com.jsowell.common.util.DateUtils;
|
||||||
import com.jsowell.pile.domain.MemberInvoiceTitle;
|
import com.jsowell.pile.domain.MemberInvoiceTitle;
|
||||||
import com.jsowell.pile.mapper.MemberInvoiceTitleMapper;
|
import com.jsowell.pile.mapper.MemberInvoiceTitleMapper;
|
||||||
import com.jsowell.pile.service.IMemberInvoiceTitleService;
|
import com.jsowell.pile.service.IMemberInvoiceTitleService;
|
||||||
|
import com.jsowell.pile.vo.uniapp.InvoiceTitleVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -20,6 +22,24 @@ public class MemberInvoiceTitleServiceImpl implements IMemberInvoiceTitleService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MemberInvoiceTitleMapper memberInvoiceTitleMapper;
|
private MemberInvoiceTitleMapper memberInvoiceTitleMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InvoiceTitleVO selectByTitleId(String titleId) {
|
||||||
|
MemberInvoiceTitle memberInvoiceTitle = memberInvoiceTitleMapper.selectMemberInvoiceTitleById(Long.parseLong(titleId));
|
||||||
|
if (memberInvoiceTitle == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return InvoiceTitleVO.builder()
|
||||||
|
.titleId(memberInvoiceTitle.getId() + "")
|
||||||
|
.titleName(memberInvoiceTitle.getName())
|
||||||
|
.titleType(TitleTypeEnum.getLabel(memberInvoiceTitle.getTitleType()))
|
||||||
|
.taxId(memberInvoiceTitle.getTaxId())
|
||||||
|
.unitAddress(memberInvoiceTitle.getUnitAddress())
|
||||||
|
.phoneNumber(memberInvoiceTitle.getPhoneNumber())
|
||||||
|
.bankName(memberInvoiceTitle.getBankName())
|
||||||
|
.bankAccountNumber(memberInvoiceTitle.getBankAccountNumber())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询会员发票抬头
|
* 查询会员发票抬头
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
|||||||
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||||
import com.jsowell.common.core.redis.RedisCache;
|
import com.jsowell.common.core.redis.RedisCache;
|
||||||
import com.jsowell.common.enums.MemberWalletEnum;
|
import com.jsowell.common.enums.MemberWalletEnum;
|
||||||
|
import com.jsowell.common.enums.ykc.BillingTimeEnum;
|
||||||
import com.jsowell.common.enums.ykc.OrderPayModeEnum;
|
import com.jsowell.common.enums.ykc.OrderPayModeEnum;
|
||||||
import com.jsowell.common.enums.ykc.OrderPayStatusEnum;
|
import com.jsowell.common.enums.ykc.OrderPayStatusEnum;
|
||||||
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
||||||
@@ -54,12 +55,16 @@ import com.jsowell.pile.service.IPileAuthCardService;
|
|||||||
import com.jsowell.pile.service.IPileBasicInfoService;
|
import com.jsowell.pile.service.IPileBasicInfoService;
|
||||||
import com.jsowell.pile.service.IPileBillingTemplateService;
|
import com.jsowell.pile.service.IPileBillingTemplateService;
|
||||||
import com.jsowell.pile.service.IPileConnectorInfoService;
|
import com.jsowell.pile.service.IPileConnectorInfoService;
|
||||||
|
import com.jsowell.pile.service.IPileMerchantInfoService;
|
||||||
|
import com.jsowell.pile.service.IPileStationInfoService;
|
||||||
import com.jsowell.pile.service.OrderMonitorDataService;
|
import com.jsowell.pile.service.OrderMonitorDataService;
|
||||||
import com.jsowell.pile.service.WechatPayService;
|
import com.jsowell.pile.service.WechatPayService;
|
||||||
import com.jsowell.pile.service.WxpayCallbackRecordService;
|
import com.jsowell.pile.service.WxpayCallbackRecordService;
|
||||||
import com.jsowell.pile.service.WxpayRefundCallbackService;
|
import com.jsowell.pile.service.WxpayRefundCallbackService;
|
||||||
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
|
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
|
||||||
import com.jsowell.pile.transaction.service.TransactionService;
|
import com.jsowell.pile.transaction.service.TransactionService;
|
||||||
|
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||||
|
import com.jsowell.pile.vo.base.OrderPeriodAmountVO;
|
||||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||||
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||||
@@ -156,6 +161,12 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OrderMonitorDataService orderMonitorDataService;
|
private OrderMonitorDataService orderMonitorDataService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileStationInfoService pileStationInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileMerchantInfoService pileMerchantInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 条件查询订单基本信息
|
* 条件查询订单基本信息
|
||||||
*
|
*
|
||||||
@@ -1091,6 +1102,28 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<IndexOrderInfoVO> getIndexOrderInfo(IndexQueryDTO dto) {
|
public List<IndexOrderInfoVO> getIndexOrderInfo(IndexQueryDTO dto) {
|
||||||
|
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
|
||||||
|
if (authorizedMap == null) {
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
List<String> stationIdList = Lists.newArrayList();
|
||||||
|
List<String> stationDeptIds = authorizedMap.getStationDeptIds();
|
||||||
|
if (CollectionUtils.isNotEmpty(stationDeptIds)) {
|
||||||
|
// 根据部门id查询站点id
|
||||||
|
List<String> list = pileStationInfoService.queryByStationDeptIds(stationDeptIds);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
stationIdList.addAll(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
|
||||||
|
if (CollectionUtils.isNotEmpty(merchantDeptIds)) {
|
||||||
|
// 根据运营商部门id查询下面所有站点id
|
||||||
|
List<String> list = pileMerchantInfoService.queryByMerchantDeptIds(merchantDeptIds);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
stationIdList.addAll(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dto.setStationIdList(stationIdList);
|
||||||
return orderBasicInfoMapper.getIndexOrderInfo(dto);
|
return orderBasicInfoMapper.getIndexOrderInfo(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1323,6 +1356,11 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
return orderBasicInfoMapper.getOrderDetailByOrderCode(orderCode);
|
return orderBasicInfoMapper.getOrderDetailByOrderCode(orderCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OrderDetail> getOrderDetailList(List<String> orderCodes) {
|
||||||
|
return orderBasicInfoMapper.getOrderDetailList(orderCodes);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过会员Id和订单状态查询订单信息
|
* 通过会员Id和订单状态查询订单信息
|
||||||
*
|
*
|
||||||
@@ -1558,4 +1596,68 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
|
|
||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OrderAmountDetailVO> queryOrderAmountDetail(List<String> orderCodes) {
|
||||||
|
List<OrderDetail> orderDetailList = getOrderDetailList(orderCodes);
|
||||||
|
if (CollectionUtils.isEmpty(orderDetailList)) {
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
List<OrderAmountDetailVO> resultList = Lists.newArrayList();
|
||||||
|
OrderAmountDetailVO vo = null;
|
||||||
|
for (OrderDetail orderDetail : orderDetailList) {
|
||||||
|
vo = new OrderAmountDetailVO();
|
||||||
|
BeanUtils.copyBeanProp(vo, orderDetail);
|
||||||
|
resultList.add(vo);
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单详情 转换为各个时段的详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OrderPeriodAmountVO> transformPeriodAmountByOrderDetail(OrderDetail orderDetail) {
|
||||||
|
// 尖时段
|
||||||
|
OrderPeriodAmountVO sharp = new OrderPeriodAmountVO();
|
||||||
|
sharp.setPeriodType(BillingTimeEnum.SHARP.getLabel());
|
||||||
|
sharp.setElectricityPrice(orderDetail.getSharpElectricityPrice());
|
||||||
|
sharp.setServicePrice(orderDetail.getSharpServicePrice());
|
||||||
|
BigDecimal sharpUsedElectricity = orderDetail.getSharpUsedElectricity() == null ? BigDecimal.ZERO : orderDetail.getSharpUsedElectricity();
|
||||||
|
sharp.setUsedElectricity(sharpUsedElectricity);
|
||||||
|
sharp.setElectricityAmount(sharp.getElectricityPrice().multiply(sharp.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
||||||
|
sharp.setServiceAmount(sharp.getServicePrice().multiply(sharp.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
||||||
|
|
||||||
|
// 峰时段
|
||||||
|
OrderPeriodAmountVO peak = new OrderPeriodAmountVO();
|
||||||
|
peak.setPeriodType(BillingTimeEnum.PEAK.getLabel());
|
||||||
|
peak.setElectricityPrice(orderDetail.getPeakElectricityPrice());
|
||||||
|
peak.setServicePrice(orderDetail.getPeakServicePrice());
|
||||||
|
BigDecimal peakUsedElectricity = orderDetail.getPeakUsedElectricity() == null ? BigDecimal.ZERO : orderDetail.getPeakUsedElectricity();
|
||||||
|
peak.setUsedElectricity(peakUsedElectricity);
|
||||||
|
peak.setElectricityAmount(peak.getElectricityPrice().multiply(peak.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
||||||
|
peak.setServiceAmount(peak.getServicePrice().multiply(peak.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
||||||
|
|
||||||
|
// 平时段
|
||||||
|
OrderPeriodAmountVO flat = new OrderPeriodAmountVO();
|
||||||
|
flat.setPeriodType(BillingTimeEnum.FLAT.getLabel());
|
||||||
|
flat.setElectricityPrice(orderDetail.getFlatElectricityPrice());
|
||||||
|
flat.setServicePrice(orderDetail.getFlatServicePrice());
|
||||||
|
BigDecimal flatUsedElectricity = orderDetail.getFlatUsedElectricity() == null ? BigDecimal.ZERO : orderDetail.getFlatUsedElectricity();
|
||||||
|
flat.setUsedElectricity(flatUsedElectricity);
|
||||||
|
flat.setElectricityAmount(flat.getElectricityPrice().multiply(flat.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
||||||
|
flat.setServiceAmount(flat.getServicePrice().multiply(flat.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
||||||
|
|
||||||
|
// 谷时段
|
||||||
|
OrderPeriodAmountVO valley = new OrderPeriodAmountVO();
|
||||||
|
valley.setPeriodType(BillingTimeEnum.VALLEY.getLabel());
|
||||||
|
valley.setElectricityPrice(orderDetail.getValleyElectricityPrice());
|
||||||
|
valley.setServicePrice(orderDetail.getValleyServicePrice());
|
||||||
|
BigDecimal valleyUsedElectricity = orderDetail.getValleyUsedElectricity() == null ? BigDecimal.ZERO : orderDetail.getValleyUsedElectricity();
|
||||||
|
valley.setUsedElectricity(valleyUsedElectricity);
|
||||||
|
valley.setElectricityAmount(valley.getElectricityPrice().multiply(valley.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
||||||
|
valley.setServiceAmount(valley.getServicePrice().multiply(valley.getUsedElectricity()).setScale(2, BigDecimal.ROUND_DOWN));
|
||||||
|
|
||||||
|
return Lists.newArrayList(sharp, peak, flat, valley);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
package com.jsowell.pile.service.impl;
|
package com.jsowell.pile.service.impl;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.jsowell.common.util.DateUtils;
|
||||||
import com.jsowell.pile.domain.OrderInvoiceRecord;
|
import com.jsowell.pile.domain.OrderInvoiceRecord;
|
||||||
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
||||||
import com.jsowell.pile.mapper.OrderInvoiceRecordMapper;
|
import com.jsowell.pile.mapper.OrderInvoiceRecordMapper;
|
||||||
|
import com.jsowell.pile.service.IMemberInvoiceTitleService;
|
||||||
|
import com.jsowell.pile.service.IOrderBasicInfoService;
|
||||||
import com.jsowell.pile.service.IOrderInvoiceRecordService;
|
import com.jsowell.pile.service.IOrderInvoiceRecordService;
|
||||||
|
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||||
|
import com.jsowell.pile.vo.uniapp.InvoiceTitleVO;
|
||||||
|
import com.jsowell.pile.vo.web.InvoiceRecordVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -20,6 +27,12 @@ public class OrderInvoiceRecordServiceImpl implements IOrderInvoiceRecordService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OrderInvoiceRecordMapper orderInvoiceRecordMapper;
|
private OrderInvoiceRecordMapper orderInvoiceRecordMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMemberInvoiceTitleService memberInvoiceTitleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOrderBasicInfoService orderBasicInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询申请开票
|
* 查询申请开票
|
||||||
*
|
*
|
||||||
@@ -31,6 +44,33 @@ public class OrderInvoiceRecordServiceImpl implements IOrderInvoiceRecordService
|
|||||||
return orderInvoiceRecordMapper.selectOrderInvoiceRecordById(id);
|
return orderInvoiceRecordMapper.selectOrderInvoiceRecordById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InvoiceRecordVO selectInvoiceTitleVO(Integer id) {
|
||||||
|
// 申请记录信息
|
||||||
|
OrderInvoiceRecord orderInvoiceRecord = selectOrderInvoiceRecordById(id);
|
||||||
|
if (orderInvoiceRecord == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// 发票抬头信息
|
||||||
|
InvoiceTitleVO invoiceTitleVO = memberInvoiceTitleService.selectByTitleId(orderInvoiceRecord.getTitleId());
|
||||||
|
|
||||||
|
// 订单信息
|
||||||
|
List<String> orderCodes = Lists.newArrayList(orderInvoiceRecord.getOrderCodes().split(","));
|
||||||
|
List<OrderAmountDetailVO> orderAmountDetailVOS = orderBasicInfoService.queryOrderAmountDetail(orderCodes);
|
||||||
|
|
||||||
|
InvoiceRecordVO vo = InvoiceRecordVO.builder()
|
||||||
|
.id(orderInvoiceRecord.getId() + "")
|
||||||
|
.memberId(orderInvoiceRecord.getMemberId())
|
||||||
|
.status(orderInvoiceRecord.getStatus())
|
||||||
|
.invoiceTitle(invoiceTitleVO)
|
||||||
|
.orderList(orderAmountDetailVOS)
|
||||||
|
.createTime(DateUtils.formatDateTime(orderInvoiceRecord.getCreateTime()))
|
||||||
|
.updateTime(DateUtils.formatDateTime(orderInvoiceRecord.getUpdateTime()))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询申请开票列表
|
* 查询申请开票列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import com.jsowell.pile.service.IPileConnectorInfoService;
|
|||||||
import com.jsowell.pile.service.IPileMerchantInfoService;
|
import com.jsowell.pile.service.IPileMerchantInfoService;
|
||||||
import com.jsowell.pile.service.IPileModelInfoService;
|
import com.jsowell.pile.service.IPileModelInfoService;
|
||||||
import com.jsowell.pile.service.IPileSimInfoService;
|
import com.jsowell.pile.service.IPileSimInfoService;
|
||||||
|
import com.jsowell.pile.service.IPileStationInfoService;
|
||||||
import com.jsowell.pile.service.SimCardService;
|
import com.jsowell.pile.service.SimCardService;
|
||||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||||
@@ -71,6 +72,9 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPileMerchantInfoService pileMerchantInfoService;
|
private IPileMerchantInfoService pileMerchantInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileStationInfoService pileStationInfoService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPileSimInfoService pileSimInfoService;
|
private IPileSimInfoService pileSimInfoService;
|
||||||
|
|
||||||
@@ -565,8 +569,25 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
if (authorizedMap == null) {
|
if (authorizedMap == null) {
|
||||||
return new IndexGeneralSituationVO();
|
return new IndexGeneralSituationVO();
|
||||||
}
|
}
|
||||||
dto.setStationDeptIds(authorizedMap.getStationDeptIds());
|
List<String> stationIdList = Lists.newArrayList();
|
||||||
dto.setMerchantDeptIds(authorizedMap.getMerchantDeptIds());
|
List<String> stationDeptIds = authorizedMap.getStationDeptIds();
|
||||||
|
if (CollectionUtils.isNotEmpty(stationDeptIds)) {
|
||||||
|
// 根据部门id查询站点id
|
||||||
|
List<String> list = pileStationInfoService.queryByStationDeptIds(stationDeptIds);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
stationIdList.addAll(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
|
||||||
|
if (CollectionUtils.isNotEmpty(merchantDeptIds)) {
|
||||||
|
// 根据运营商部门id查询下面所有站点id
|
||||||
|
List<String> list = pileMerchantInfoService.queryByMerchantDeptIds(merchantDeptIds);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
stationIdList.addAll(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.info("后管首页基本信息查询 authorizedMap:{}, dto:{}", JSONObject.toJSONString(authorizedMap), JSONObject.toJSONString(dto));
|
||||||
|
dto.setStationIdList(stationIdList);
|
||||||
return pileBasicInfoMapper.getGeneralSituation(dto);
|
return pileBasicInfoMapper.getGeneralSituation(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -175,4 +175,9 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
|
|||||||
.build();
|
.build();
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> queryByMerchantDeptIds(List<String> merchantDeptIds) {
|
||||||
|
return pileMerchantInfoMapper.queryByMerchantDeptIds(merchantDeptIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,11 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
|||||||
return pileStationInfoMapper.getStationInfoForLianLian();
|
return pileStationInfoMapper.getStationInfoForLianLian();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> queryByStationDeptIds(List<String> stationIds) {
|
||||||
|
return pileStationInfoMapper.queryByStationDeptIds(stationIds);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询充电站信息列表
|
* 查询充电站信息列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.jsowell.pile.vo.base;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单金额明细
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class OrderAmountDetailVO {
|
||||||
|
private String orderCode; // 订单编号
|
||||||
|
|
||||||
|
private BigDecimal totalUsedElectricity; // 总用电量
|
||||||
|
private BigDecimal totalOrderAmount; // 订单总金额(电费总额+服务费总额)
|
||||||
|
private BigDecimal totalElectricityAmount; // 电费总金额(各时段消耗电费总金额)
|
||||||
|
private BigDecimal totalServiceAmount; // 服务费总金额(各时段服务费总金额)
|
||||||
|
|
||||||
|
private BigDecimal sharpUsedElectricity; // 尖时段用电量
|
||||||
|
private BigDecimal sharpElectricityPrice; // 尖时段电费单价
|
||||||
|
private BigDecimal sharpServicePrice; // 尖时段服务费单价
|
||||||
|
|
||||||
|
private BigDecimal peakUsedElectricity; // 峰时段用电量
|
||||||
|
private BigDecimal peakElectricityPrice; // 峰时段电费单价
|
||||||
|
private BigDecimal peakServicePrice; // 峰时段服务费单价
|
||||||
|
|
||||||
|
private BigDecimal flatUsedElectricity; // 平时段用电量
|
||||||
|
private BigDecimal flatElectricityPrice; // 平时段电费单价
|
||||||
|
private BigDecimal flatServicePrice; // 平时段服务费单价
|
||||||
|
|
||||||
|
private BigDecimal valleyUsedElectricity; // 谷时段用电量
|
||||||
|
private BigDecimal valleyElectricityPrice; // 谷时段电费单价
|
||||||
|
private BigDecimal valleyServicePrice; // 谷时段服务费单价
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.jsowell.pile.vo.base;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单时段收费明细
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class OrderPeriodAmountVO {
|
||||||
|
private String periodType; // 时段类型
|
||||||
|
private BigDecimal usedElectricity; // 用电量
|
||||||
|
private BigDecimal electricityPrice; // 电费单价
|
||||||
|
private BigDecimal servicePrice; // 服务费单价
|
||||||
|
private BigDecimal electricityAmount; // 电费金额
|
||||||
|
private BigDecimal serviceAmount; // 服务费金额
|
||||||
|
}
|
||||||
@@ -18,4 +18,29 @@ public class InvoiceTitleVO {
|
|||||||
|
|
||||||
// 抬头类型 (单位或个人)
|
// 抬头类型 (单位或个人)
|
||||||
private String titleType;
|
private String titleType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 税号
|
||||||
|
*/
|
||||||
|
private String taxId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位地址
|
||||||
|
*/
|
||||||
|
private String unitAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电话号码
|
||||||
|
*/
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户银行
|
||||||
|
*/
|
||||||
|
private String bankName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行账户
|
||||||
|
*/
|
||||||
|
private String bankAccountNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.jsowell.pile.vo.uniapp;
|
package com.jsowell.pile.vo.uniapp;
|
||||||
|
|
||||||
|
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -162,25 +162,6 @@ public class UniAppOrderVO {
|
|||||||
private String batteryMaxTemperature;
|
private String batteryMaxTemperature;
|
||||||
}
|
}
|
||||||
|
|
||||||
private BillingDetails billingDetails;
|
private OrderAmountDetailVO billingDetails;
|
||||||
|
|
||||||
@Data
|
|
||||||
public static class BillingDetails{
|
|
||||||
private BigDecimal totalUsedElectricity; // 总用电量
|
|
||||||
private BigDecimal totalOrderAmount; // 订单总金额(电费总额+服务费总额)
|
|
||||||
private BigDecimal totalElectricityAmount; // 电费总金额(各时段消耗电费总金额)
|
|
||||||
private BigDecimal totalServiceAmount; // 服务费总金额(各时段服务费总金额)
|
|
||||||
private BigDecimal sharpUsedElectricity; // 尖时段用电量
|
|
||||||
private BigDecimal sharpElectricityPrice; // 尖时段电费单价
|
|
||||||
private BigDecimal sharpServicePrice; // 尖时段服务费单价
|
|
||||||
private BigDecimal peakUsedElectricity; // 峰时段用电量
|
|
||||||
private BigDecimal peakElectricityPrice; // 峰时段电费单价
|
|
||||||
private BigDecimal peakServicePrice; // 峰时段服务费单价
|
|
||||||
private BigDecimal flatUsedElectricity; // 平时段用电量
|
|
||||||
private BigDecimal flatElectricityPrice; // 平时段电费单价
|
|
||||||
private BigDecimal flatServicePrice; // 平时段服务费单价
|
|
||||||
private BigDecimal valleyUsedElectricity; // 谷时段用电量
|
|
||||||
private BigDecimal valleyElectricityPrice; // 谷时段电费单价
|
|
||||||
private BigDecimal valleyServicePrice; // 谷时段服务费单价
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.jsowell.pile.vo.web;
|
||||||
|
|
||||||
|
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||||
|
import com.jsowell.pile.vo.uniapp.InvoiceTitleVO;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class InvoiceRecordVO {
|
||||||
|
/**
|
||||||
|
* 申请记录主键id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员id
|
||||||
|
*/
|
||||||
|
private String memberId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 0-未开票 1-已开票
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间x
|
||||||
|
*/
|
||||||
|
private String updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票抬头信息
|
||||||
|
*/
|
||||||
|
private InvoiceTitleVO invoiceTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单明细
|
||||||
|
*/
|
||||||
|
private List<OrderAmountDetailVO> orderList;
|
||||||
|
}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
package com.jsowell.pile.vo.web;
|
package com.jsowell.pile.vo.web;
|
||||||
|
|
||||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||||
|
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||||
|
import com.jsowell.pile.vo.base.OrderPeriodAmountVO;
|
||||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,7 +17,8 @@ public class OrderDetailInfoVO {
|
|||||||
// 订单信息
|
// 订单信息
|
||||||
private OrderInfo orderInfo;
|
private OrderInfo orderInfo;
|
||||||
|
|
||||||
private BillingDetails billingDetails;
|
// 账单明细
|
||||||
|
private OrderAmountDetailVO billingDetails;
|
||||||
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
private MemberVO memberInfo;
|
private MemberVO memberInfo;
|
||||||
@@ -36,37 +38,7 @@ public class OrderDetailInfoVO {
|
|||||||
private RealTimeMonitorData lastMonitorData;
|
private RealTimeMonitorData lastMonitorData;
|
||||||
|
|
||||||
// 收费明细
|
// 收费明细
|
||||||
private List<ChargeDetail> chargeDetails;
|
private List<OrderPeriodAmountVO> chargeDetails;
|
||||||
|
|
||||||
@Data
|
|
||||||
public static class ChargeDetail{
|
|
||||||
private String periodType; // 时段类型
|
|
||||||
private BigDecimal usedElectricity; // 用电量
|
|
||||||
private BigDecimal electricityPrice; // 电费单价
|
|
||||||
private BigDecimal servicePrice; // 服务费单价
|
|
||||||
private BigDecimal electricityAmount; // 电费金额
|
|
||||||
private BigDecimal serviceAmount; // 服务费金额
|
|
||||||
}
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public static class BillingDetails{
|
|
||||||
private BigDecimal totalUsedElectricity; // 总用电量
|
|
||||||
private BigDecimal totalOrderAmount; // 订单总金额(电费总额+服务费总额)
|
|
||||||
private BigDecimal totalElectricityAmount; // 电费总金额(各时段消耗电费总金额)
|
|
||||||
private BigDecimal totalServiceAmount; // 服务费总金额(各时段服务费总金额)
|
|
||||||
private BigDecimal sharpUsedElectricity; // 尖时段用电量
|
|
||||||
private BigDecimal sharpElectricityPrice; // 尖时段电费单价
|
|
||||||
private BigDecimal sharpServicePrice; // 尖时段服务费单价
|
|
||||||
private BigDecimal peakUsedElectricity; // 峰时段用电量
|
|
||||||
private BigDecimal peakElectricityPrice; // 峰时段电费单价
|
|
||||||
private BigDecimal peakServicePrice; // 峰时段服务费单价
|
|
||||||
private BigDecimal flatUsedElectricity; // 平时段用电量
|
|
||||||
private BigDecimal flatElectricityPrice; // 平时段电费单价
|
|
||||||
private BigDecimal flatServicePrice; // 平时段服务费单价
|
|
||||||
private BigDecimal valleyUsedElectricity; // 谷时段用电量
|
|
||||||
private BigDecimal valleyElectricityPrice; // 谷时段电费单价
|
|
||||||
private BigDecimal valleyServicePrice; // 谷时段服务费单价
|
|
||||||
}
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class OrderInfo {
|
public static class OrderInfo {
|
||||||
|
|||||||
@@ -779,7 +779,13 @@
|
|||||||
date(t1.create_time) >= DATE_SUB(CURDATE(),INTERVAL 30 day)
|
date(t1.create_time) >= DATE_SUB(CURDATE(),INTERVAL 30 day)
|
||||||
and t1.order_status = '6'
|
and t1.order_status = '6'
|
||||||
<if test="dto.stationId != null and dto.stationId != ''">
|
<if test="dto.stationId != null and dto.stationId != ''">
|
||||||
and t1,station_id = #{dto.stationId,jdbcType=VARCHAR}
|
and t1.station_id = #{dto.stationId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="dto.stationIdList != null and dto.stationIdList.size() != 0">
|
||||||
|
and t1.station_id in
|
||||||
|
<foreach collection="dto.stationIdList" item="item" open="(" separator="," close=")">
|
||||||
|
#{item,jdbcType=VARCHAR}
|
||||||
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
group by DATE_FORMAT(t1.create_time,'%Y-%m-%d')
|
group by DATE_FORMAT(t1.create_time,'%Y-%m-%d')
|
||||||
</select>
|
</select>
|
||||||
@@ -974,4 +980,15 @@
|
|||||||
id=#{i.id}
|
id=#{i.id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getOrderDetailList" resultMap="OrderDetailResult">
|
||||||
|
select
|
||||||
|
<include refid="Detail_Base_Column_List"/>
|
||||||
|
from order_detail
|
||||||
|
where del_flag = '0'
|
||||||
|
and order_code in
|
||||||
|
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||||
|
#{item,jdbcType=VARCHAR}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
<resultMap type="com.jsowell.pile.domain.OrderInvoiceRecord" id="OrderInvoiceRecordResult">
|
<resultMap type="com.jsowell.pile.domain.OrderInvoiceRecord" id="OrderInvoiceRecordResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="memberId" column="member_id" />
|
<result property="memberId" column="member_id" />
|
||||||
|
<result property="titleId" column="title_id" />
|
||||||
<result property="orderCodes" column="order_codes" />
|
<result property="orderCodes" column="order_codes" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="totalAmount" column="total_amount" />
|
<result property="totalAmount" column="total_amount" />
|
||||||
@@ -21,7 +22,8 @@
|
|||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
id, member_id, order_codes, status, total_amount, total_service_amount, total_elec_amount, create_by, create_time, update_by, update_time, del_flag
|
id, member_id, title_id, order_codes, status, total_amount, total_service_amount, total_elec_amount,
|
||||||
|
create_by, create_time, update_by, update_time, del_flag
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="selectOrderInvoiceRecordVo">
|
<sql id="selectOrderInvoiceRecordVo">
|
||||||
|
|||||||
@@ -330,10 +330,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
and t1.station_id = #{IndexQueryDTO.stationId,jdbcType=VARCHAR}
|
and t1.station_id = #{IndexQueryDTO.stationId,jdbcType=VARCHAR}
|
||||||
</if>
|
</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
<if test="IndexQueryDTO.stationDeptIds != null and IndexQueryDTO.stationDeptIds.size() != 0">
|
<if test="IndexQueryDTO.stationIdList != null and IndexQueryDTO.stationIdList.size() != 0">
|
||||||
and t1.station_id in
|
and t1.station_id in
|
||||||
<foreach collection="IndexQueryDTO.stationDeptIds" item="stationDeptId" open="(" separator="," close=")">
|
<foreach collection="IndexQueryDTO.stationIdList" item="item" open="(" separator="," close=")">
|
||||||
#{stationDeptId}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
group by t4.totalMemberAmount
|
group by t4.totalMemberAmount
|
||||||
|
|||||||
@@ -264,4 +264,18 @@
|
|||||||
where
|
where
|
||||||
app_id = #{appId,jdbcType=VARCHAR}
|
app_id = #{appId,jdbcType=VARCHAR}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryByMerchantDeptIds" resultType="java.lang.String">
|
||||||
|
SELECT
|
||||||
|
t2.id
|
||||||
|
FROM
|
||||||
|
pile_merchant_info t1
|
||||||
|
LEFT JOIN pile_station_info t2 ON t2.merchant_id = t1.id and t2.del_flag = '0'
|
||||||
|
WHERE
|
||||||
|
t1.del_flag = '0'
|
||||||
|
AND t1.dept_id IN
|
||||||
|
<foreach collection="merchantDeptIds" item="item" open="(" separator="," close=")">
|
||||||
|
#{item,jdbcType=VARCHAR}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -373,4 +373,14 @@
|
|||||||
<include refid="selectPileStationInfoVo"/>
|
<include refid="selectPileStationInfoVo"/>
|
||||||
where public_flag = '1'
|
where public_flag = '1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryByStationDeptIds" resultType="java.lang.String">
|
||||||
|
select id
|
||||||
|
from pile_station_info
|
||||||
|
where del_flag = '0'
|
||||||
|
and dept_id in
|
||||||
|
<foreach collection="stationDeptIds" item="item" open="(" separator="," close=")">
|
||||||
|
#{item,jdbcType=VARCHAR}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -140,6 +140,19 @@ export const constantRoutes = [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/invoice/index",
|
||||||
|
component: Layout,
|
||||||
|
hidden: true,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: "invoiceDetail",
|
||||||
|
path: "invoice/:id",
|
||||||
|
component: () => import("@/views/order/invoice/detail"),
|
||||||
|
meta: { title: "发票详情", activeMenu: "/invoice/detail" },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
// 动态路由,基于用户权限动态去加载
|
// 动态路由,基于用户权限动态去加载
|
||||||
|
|||||||
128
jsowell-ui/src/views/order/invoice/detail.vue
Normal file
128
jsowell-ui/src/views/order/invoice/detail.vue
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card class="cardStyle" style="padding: 10px 0" >
|
||||||
|
<div v-if="data.status === '0'" style="display: flex;justify-content: space-between;align-items: center">
|
||||||
|
<div style="margin-right: 10px">当前状态为未开票,请点击按钮完成开票</div>
|
||||||
|
<el-button type="primary" round @click="dialogVisible=true">完成开票</el-button>
|
||||||
|
</div>
|
||||||
|
<div v-if="data.status === '1'" style="display: flex;justify-content: space-between;align-items: center">
|
||||||
|
<div style="margin-right: 10px">当前状态为已开票,{{data.updateTime}}完成开票</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="cardStyle">
|
||||||
|
<h3>开票明细</h3>
|
||||||
|
<el-descriptions :column="1" border>
|
||||||
|
<el-descriptions-item label="单位" labelStyle="width: 80px" contentStyle="width: 150px">{{ invoiceTitle.titleName }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="税号">{{ invoiceTitle.taxId }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="地址">{{ invoiceTitle.unitAddress }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<div class="marginTop"></div>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="cardStyle">
|
||||||
|
<h3>申请订单明细</h3>
|
||||||
|
<el-table :data="orderList" border show-summary style="width: 100%">
|
||||||
|
<el-table-column prop="orderCode" label="订单号" align="center" width="180"></el-table-column>
|
||||||
|
<el-table-column prop="totalElectricityAmount" align="center" label="电费总金额"></el-table-column>
|
||||||
|
<el-table-column prop="totalServiceAmount" align="center" label="服务费总金额"></el-table-column>
|
||||||
|
<el-table-column prop="totalOrderAmount" align="center" label="订单总金额"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="marginTop"></div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="提示"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="35%"
|
||||||
|
>
|
||||||
|
点击确定,将此记录更改为已开票状态!
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="updateInvoiceStatus">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {getInvoice, updateInvoice} from "@/api/order/invoice";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 申请开票 id
|
||||||
|
invoiceRecordId: null,
|
||||||
|
// 接口返回结果
|
||||||
|
data: null,
|
||||||
|
// 订单金额列表
|
||||||
|
orderList: [],
|
||||||
|
// 发票抬头
|
||||||
|
invoiceTitle: null,
|
||||||
|
dialogVisible: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.invoiceRecordId = this.$route.params.id;
|
||||||
|
console.log("发票详情:", this.invoiceRecordId);//打印结果为{user:'david'}
|
||||||
|
this.selectInvoiceRecord();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 查询申请开票信息详情
|
||||||
|
selectInvoiceRecord() {
|
||||||
|
getInvoice(this.invoiceRecordId).then(response => {
|
||||||
|
console.log("查询申请开票信息详情结果", response);
|
||||||
|
this.data = response.data;
|
||||||
|
this.orderList = this.data.orderList;
|
||||||
|
this.invoiceTitle = this.data.invoiceTitle;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 修改开票为已开票
|
||||||
|
updateInvoiceStatus() {
|
||||||
|
console.log('修改申请开票状态', this.invoiceRecordId);
|
||||||
|
const param = {
|
||||||
|
id: this.invoiceRecordId,
|
||||||
|
status: "1"
|
||||||
|
};
|
||||||
|
updateInvoice(param).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.selectInvoiceRecord();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 合计
|
||||||
|
getSummaries(param) {
|
||||||
|
const { columns, data } = param;
|
||||||
|
const sums = [];
|
||||||
|
columns.forEach((column, index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
sums[index] = '总价';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const values = data.map(item => Number(item[column.property]));
|
||||||
|
if (!values.every(value => isNaN(value))) {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr);
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr;
|
||||||
|
} else {
|
||||||
|
return prev;
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
sums[index] += ' 元';
|
||||||
|
} else {
|
||||||
|
sums[index] = 'N/A';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return sums;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style >
|
||||||
|
.cardStyle{
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.marginTop{
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -9,14 +9,14 @@
|
|||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="申请订单编号" prop="orderCodes">
|
<!--<el-form-item label="申请订单编号" prop="orderCodes">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.orderCodes"
|
v-model="queryParams.orderCodes"
|
||||||
placeholder="请输入申请订单编号"
|
placeholder="请输入申请订单编号"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>-->
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.status"
|
v-model="queryParams.status"
|
||||||
@@ -102,9 +102,9 @@
|
|||||||
|
|
||||||
<el-table v-loading="loading" :data="invoiceList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="invoiceList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<!--<el-table-column label="" align="center" prop="id" />-->
|
<!--<el-table-column label="ID" align="center" prop="id" />-->
|
||||||
<el-table-column label="会员id" align="center" prop="memberId" />
|
<el-table-column label="会员id" align="center" prop="memberId" />
|
||||||
<el-table-column label="申请订单编号" align="center" prop="orderCodes" />
|
<!--<el-table-column label="申请订单编号" align="center" prop="orderCodes" />-->
|
||||||
<el-table-column label="状态" align="center" prop="status" >
|
<el-table-column label="状态" align="center" prop="status" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag
|
<dict-tag
|
||||||
@@ -116,16 +116,17 @@
|
|||||||
<el-table-column label="开票总金额" align="center" prop="totalAmount" />
|
<el-table-column label="开票总金额" align="center" prop="totalAmount" />
|
||||||
<el-table-column label="总服务费金额" align="center" prop="totalServiceAmount" />
|
<el-table-column label="总服务费金额" align="center" prop="totalServiceAmount" />
|
||||||
<el-table-column label="总电费金额" align="center" prop="totalElecAmount" />
|
<el-table-column label="总电费金额" align="center" prop="totalElecAmount" />
|
||||||
|
<el-table-column label="申请时间" align="center" prop="createTime" />
|
||||||
|
<el-table-column label="开票时间" align="center" prop="updateTime" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.status === '0'"
|
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-info"
|
||||||
@click="clickInvoiceStatus(scope.row.id)"
|
@click="clickSelectDetail(scope.row.id)"
|
||||||
v-hasPermi="['order:invoice:edit']"
|
v-hasPermi="['order:invoice:edit']"
|
||||||
>已开发票</el-button>
|
>查看详情</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -137,46 +138,6 @@
|
|||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改申请开票对话框 -->
|
|
||||||
<!--<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
|
|
||||||
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
|
|
||||||
<!-- <el-form-item label="会员id" prop="memberId">-->
|
|
||||||
<!-- <el-input v-model="form.memberId" placeholder="请输入会员id" />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- <el-form-item label="申请订单编号" prop="orderCodes">-->
|
|
||||||
<!-- <el-input v-model="form.orderCodes" placeholder="请输入申请订单编号" />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- <el-form-item label="开票总金额" prop="totalAmount">-->
|
|
||||||
<!-- <el-input v-model="form.totalAmount" placeholder="请输入开票总金额" />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- <el-form-item label="总服务费金额" prop="totalServiceAmount">-->
|
|
||||||
<!-- <el-input v-model="form.totalServiceAmount" placeholder="请输入总服务费金额" />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- <el-form-item label="总电费金额" prop="totalElecAmount">-->
|
|
||||||
<!-- <el-input v-model="form.totalElecAmount" placeholder="请输入总电费金额" />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- <el-form-item label="删除标识" prop="delFlag">-->
|
|
||||||
<!-- <el-input v-model="form.delFlag" placeholder="请输入删除标识" />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- </el-form>-->
|
|
||||||
<!-- <div slot="footer" class="dialog-footer">-->
|
|
||||||
<!-- <el-button type="primary" @click="submitForm">确 定</el-button>-->
|
|
||||||
<!-- <el-button @click="cancel">取 消</el-button>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!--</el-dialog>-->
|
|
||||||
|
|
||||||
<el-dialog
|
|
||||||
title="提示"
|
|
||||||
:visible.sync="dialogVisible"
|
|
||||||
width="35%"
|
|
||||||
>
|
|
||||||
点击确定,将此记录更改为已开票状态!
|
|
||||||
<span slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
||||||
<el-button type="primary" @click="updateInvoiceStatus">确 定</el-button>
|
|
||||||
</span>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -331,11 +292,11 @@ export default {
|
|||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `invoice_${new Date().getTime()}.xlsx`)
|
}, `invoice_${new Date().getTime()}.xlsx`)
|
||||||
},
|
},
|
||||||
clickInvoiceStatus(id) {
|
// clickInvoiceStatus(id) {
|
||||||
console.log("点击更改开票状态",id);
|
// console.log("点击更改开票状态",id);
|
||||||
this.updateInvoiceId = id
|
// this.updateInvoiceId = id
|
||||||
this.dialogVisible = true;
|
// this.dialogVisible = true;
|
||||||
},
|
// },
|
||||||
/** 修改申请开票状态 */
|
/** 修改申请开票状态 */
|
||||||
updateInvoiceStatus() {
|
updateInvoiceStatus() {
|
||||||
console.log('修改申请开票状态', this.updateInvoiceId);
|
console.log('修改申请开票状态', this.updateInvoiceId);
|
||||||
@@ -346,7 +307,13 @@ export default {
|
|||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
// 点击查看详情
|
||||||
|
clickSelectDetail(id) {
|
||||||
|
console.log("点击查看详情",id);
|
||||||
|
// 路径/home对应我在router目录下index.js中定义的path属性值
|
||||||
|
this.$router.push({name:'invoiceDetail', params:{id: id}});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
:on-remove="handleRemove"
|
:on-remove="handleRemove"
|
||||||
:on-success="handleSuccess"
|
:on-success="handleSuccess"
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
|
style="margin: 10px 0"
|
||||||
>
|
>
|
||||||
<i class="el-icon-plus"></i>
|
<i class="el-icon-plus"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|||||||
Reference in New Issue
Block a user