mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-17 00:08:35 +08:00
update 导出申请记录
This commit is contained in:
@@ -9,7 +9,7 @@ import com.jsowell.common.util.poi.ExcelUtil;
|
|||||||
import com.jsowell.pile.domain.OrderInvoiceRecord;
|
import com.jsowell.pile.domain.OrderInvoiceRecord;
|
||||||
import com.jsowell.pile.dto.GetInvoiceInfoDTO;
|
import com.jsowell.pile.dto.GetInvoiceInfoDTO;
|
||||||
import com.jsowell.pile.service.OrderInvoiceRecordService;
|
import com.jsowell.pile.service.OrderInvoiceRecordService;
|
||||||
import com.jsowell.pile.service.PileMerchantInfoService;
|
import com.jsowell.pile.vo.web.OrderInvoiceRecordExportVO;
|
||||||
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
|
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@@ -37,9 +37,6 @@ public class OrderInvoiceRecordController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OrderInvoiceRecordService orderInvoiceRecordService;
|
private OrderInvoiceRecordService orderInvoiceRecordService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PileMerchantInfoService pileMerchantInfoService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询申请开票列表
|
* 查询申请开票列表
|
||||||
*/
|
*/
|
||||||
@@ -58,9 +55,9 @@ public class OrderInvoiceRecordController extends BaseController {
|
|||||||
@PreAuthorize("@ss.hasPermi('order:invoice:export')")
|
@PreAuthorize("@ss.hasPermi('order:invoice:export')")
|
||||||
@Log(title = "申请开票", businessType = BusinessType.EXPORT)
|
@Log(title = "申请开票", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, OrderInvoiceRecord orderInvoiceRecord) {
|
public void export(HttpServletResponse response, GetInvoiceInfoDTO dto) {
|
||||||
List<OrderInvoiceRecord> list = orderInvoiceRecordService.selectOrderInvoiceRecordList(orderInvoiceRecord);
|
List<OrderInvoiceRecordExportVO> list = orderInvoiceRecordService.getInvoiceExportListWithAuth(dto);
|
||||||
ExcelUtil<OrderInvoiceRecord> util = new ExcelUtil<OrderInvoiceRecord>(OrderInvoiceRecord.class);
|
ExcelUtil<OrderInvoiceRecordExportVO> util = new ExcelUtil<OrderInvoiceRecordExportVO>(OrderInvoiceRecordExportVO.class);
|
||||||
util.exportExcel(response, list, "申请开票数据");
|
util.exportExcel(response, list, "申请开票数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package com.jsowell.pile.mapper;
|
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.GetInvoiceInfoDTO;
|
import com.jsowell.pile.dto.GetInvoiceInfoDTO;
|
||||||
|
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
||||||
|
import com.jsowell.pile.vo.web.OrderInvoiceRecordExportVO;
|
||||||
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
|
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@@ -40,6 +41,14 @@ public interface OrderInvoiceRecordMapper {
|
|||||||
*/
|
*/
|
||||||
List<OrderInvoiceRecordVO> getInvoiceListWithAuth(@Param("dto") GetInvoiceInfoDTO dto);
|
List<OrderInvoiceRecordVO> getInvoiceListWithAuth(@Param("dto") GetInvoiceInfoDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询申请开票导出列表(带权限校验)
|
||||||
|
*
|
||||||
|
* @param dto 查询条件
|
||||||
|
* @return 导出集合
|
||||||
|
*/
|
||||||
|
List<OrderInvoiceRecordExportVO> getInvoiceExportListWithAuth(@Param("dto") GetInvoiceInfoDTO dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增申请开票
|
* 新增申请开票
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.jsowell.pile.domain.OrderInvoiceRecord;
|
|||||||
import com.jsowell.pile.dto.GetInvoiceInfoDTO;
|
import com.jsowell.pile.dto.GetInvoiceInfoDTO;
|
||||||
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
||||||
import com.jsowell.pile.vo.web.InvoiceRecordVO;
|
import com.jsowell.pile.vo.web.InvoiceRecordVO;
|
||||||
|
import com.jsowell.pile.vo.web.OrderInvoiceRecordExportVO;
|
||||||
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
|
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -41,6 +42,14 @@ public interface OrderInvoiceRecordService {
|
|||||||
*/
|
*/
|
||||||
List<OrderInvoiceRecordVO> getInvoiceListWithAuth(GetInvoiceInfoDTO dto);
|
List<OrderInvoiceRecordVO> getInvoiceListWithAuth(GetInvoiceInfoDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询申请开票导出列表(带权限校验)
|
||||||
|
*
|
||||||
|
* @param dto 查询条件
|
||||||
|
* @return 导出列表
|
||||||
|
*/
|
||||||
|
List<OrderInvoiceRecordExportVO> getInvoiceExportListWithAuth(GetInvoiceInfoDTO dto);
|
||||||
|
|
||||||
List<OrderInvoiceRecord> selectInvoiceRecordList(QueryInvoiceRecordDTO memberId);
|
List<OrderInvoiceRecord> selectInvoiceRecordList(QueryInvoiceRecordDTO memberId);
|
||||||
|
|
||||||
List<OrderInvoiceRecordVO> selectInvoiceVOList(QueryInvoiceRecordDTO memberId);
|
List<OrderInvoiceRecordVO> selectInvoiceVOList(QueryInvoiceRecordDTO memberId);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.jsowell.pile.util.UserUtils;
|
|||||||
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||||
import com.jsowell.pile.vo.uniapp.customer.InvoiceTitleVO;
|
import com.jsowell.pile.vo.uniapp.customer.InvoiceTitleVO;
|
||||||
import com.jsowell.pile.vo.web.InvoiceRecordVO;
|
import com.jsowell.pile.vo.web.InvoiceRecordVO;
|
||||||
|
import com.jsowell.pile.vo.web.OrderInvoiceRecordExportVO;
|
||||||
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
|
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -94,16 +95,31 @@ public class OrderInvoiceRecordServiceImpl implements OrderInvoiceRecordService
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<OrderInvoiceRecordVO> getInvoiceListWithAuth(GetInvoiceInfoDTO dto) {
|
public List<OrderInvoiceRecordVO> getInvoiceListWithAuth(GetInvoiceInfoDTO dto) {
|
||||||
|
if (!fillAuthorizedMerchantDeptIds(dto)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return orderInvoiceRecordMapper.getInvoiceListWithAuth(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OrderInvoiceRecordExportVO> getInvoiceExportListWithAuth(GetInvoiceInfoDTO dto) {
|
||||||
|
if (!fillAuthorizedMerchantDeptIds(dto)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return orderInvoiceRecordMapper.getInvoiceExportListWithAuth(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean fillAuthorizedMerchantDeptIds(GetInvoiceInfoDTO dto) {
|
||||||
// 获取登录账号信息
|
// 获取登录账号信息
|
||||||
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
|
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
|
||||||
if (authorizedMap == null) {
|
if (authorizedMap == null) {
|
||||||
return new ArrayList<>();
|
return false;
|
||||||
}
|
}
|
||||||
List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
|
List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
|
||||||
if (CollectionUtils.isNotEmpty(merchantDeptIds)) {
|
if (CollectionUtils.isNotEmpty(merchantDeptIds)) {
|
||||||
dto.setMerchantDeptIds(merchantDeptIds);
|
dto.setMerchantDeptIds(merchantDeptIds);
|
||||||
}
|
}
|
||||||
return orderInvoiceRecordMapper.getInvoiceListWithAuth(dto);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.jsowell.pile.vo.web;
|
||||||
|
|
||||||
|
import com.jsowell.common.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请开票导出对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OrderInvoiceRecordExportVO {
|
||||||
|
@Excel(name = "会员ID")
|
||||||
|
private String memberId;
|
||||||
|
|
||||||
|
@Excel(name = "会员手机号")
|
||||||
|
private String memberPhoneNumber;
|
||||||
|
|
||||||
|
@Excel(name = "运营商")
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
|
@Excel(name = "抬头类型", readConverterExp = "1=单位,2=个人")
|
||||||
|
private String titleType;
|
||||||
|
|
||||||
|
@Excel(name = "抬头名称")
|
||||||
|
private String titleName;
|
||||||
|
|
||||||
|
@Excel(name = "税号")
|
||||||
|
private String taxId;
|
||||||
|
|
||||||
|
@Excel(name = "单位地址")
|
||||||
|
private String unitAddress;
|
||||||
|
|
||||||
|
@Excel(name = "抬头电话")
|
||||||
|
private String titlePhoneNumber;
|
||||||
|
|
||||||
|
@Excel(name = "开票邮箱")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@Excel(name = "开户银行")
|
||||||
|
private String bankName;
|
||||||
|
|
||||||
|
@Excel(name = "银行账户")
|
||||||
|
private String bankAccountNumber;
|
||||||
|
|
||||||
|
@Excel(name = "申请订单编号")
|
||||||
|
private String orderCodes;
|
||||||
|
|
||||||
|
@Excel(name = "状态", readConverterExp = "0=未开票,1=已开票")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Excel(name = "开票总金额")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
@Excel(name = "总服务费金额")
|
||||||
|
private BigDecimal totalServiceAmount;
|
||||||
|
|
||||||
|
@Excel(name = "总电费金额")
|
||||||
|
private BigDecimal totalElecAmount;
|
||||||
|
|
||||||
|
@Excel(name = "申请时间")
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
@Excel(name = "开票时间")
|
||||||
|
private String updateTime;
|
||||||
|
}
|
||||||
@@ -169,6 +169,44 @@
|
|||||||
order by t1.create_time desc
|
order by t1.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getInvoiceExportListWithAuth" resultType="com.jsowell.pile.vo.web.OrderInvoiceRecordExportVO">
|
||||||
|
SELECT
|
||||||
|
t1.member_id AS memberId,
|
||||||
|
t4.mobile_number AS memberPhoneNumber,
|
||||||
|
t2.merchant_name AS merchantName,
|
||||||
|
t3.title_type AS titleType,
|
||||||
|
t3.name AS titleName,
|
||||||
|
t3.tax_id AS taxId,
|
||||||
|
t3.unit_address AS unitAddress,
|
||||||
|
t3.phone_number AS titlePhoneNumber,
|
||||||
|
t3.email AS email,
|
||||||
|
t3.bank_name AS bankName,
|
||||||
|
t3.bank_account_number AS bankAccountNumber,
|
||||||
|
t1.order_codes AS orderCodes,
|
||||||
|
t1.status AS status,
|
||||||
|
t1.total_amount AS totalAmount,
|
||||||
|
t1.total_service_amount AS totalServiceAmount,
|
||||||
|
t1.total_elec_amount AS totalElecAmount,
|
||||||
|
t1.create_time AS createTime,
|
||||||
|
t1.update_time AS updateTime
|
||||||
|
FROM order_invoice_record t1
|
||||||
|
LEFT JOIN pile_merchant_info t2 ON t1.merchant_id = t2.id
|
||||||
|
LEFT JOIN member_invoice_title t3 ON t1.title_id = t3.id AND t3.del_flag = '0'
|
||||||
|
LEFT JOIN member_basic_info t4 ON t1.member_id = t4.member_id
|
||||||
|
WHERE t1.del_flag = '0'
|
||||||
|
<if test="dto.merchantDeptIds != null and dto.merchantDeptIds.size() != 0">
|
||||||
|
and t2.dept_id in
|
||||||
|
<foreach collection="dto.merchantDeptIds" item="deptId" open="(" separator="," close=")">
|
||||||
|
#{deptId,jdbcType=VARCHAR}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="dto.memberId != null and dto.memberId != ''"> and t1.member_id = #{dto.memberId}</if>
|
||||||
|
<if test="dto.merchantId != null and dto.merchantId != ''"> and t1.merchant_id = #{dto.merchantId}</if>
|
||||||
|
<if test="dto.orderCodes != null and dto.orderCodes != ''"> and t1.order_codes like concat('%', #{dto.orderCodes}, '%')</if>
|
||||||
|
<if test="dto.status != null and dto.status != ''"> and t1.status = #{dto.status}</if>
|
||||||
|
order by t1.create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectInvoiceVOList" resultType="com.jsowell.pile.vo.web.OrderInvoiceRecordVO">
|
<select id="selectInvoiceVOList" resultType="com.jsowell.pile.vo.web.OrderInvoiceRecordVO">
|
||||||
SELECT
|
SELECT
|
||||||
t1.member_id,
|
t1.member_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user