mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-06 11:00:13 +08:00
Compare commits
6 Commits
dev
...
feature-ex
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98bc86ef43 | ||
|
|
d9d60dd677 | ||
|
|
62bcad3007 | ||
|
|
fc3a941617 | ||
|
|
1c30406323 | ||
|
|
7df9283481 |
@@ -9,7 +9,8 @@ import com.jsowell.common.util.poi.ExcelUtil;
|
||||
import com.jsowell.pile.domain.OrderInvoiceRecord;
|
||||
import com.jsowell.pile.dto.GetInvoiceInfoDTO;
|
||||
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.OrderInvoiceRecordImportVO;
|
||||
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
@@ -37,9 +39,6 @@ public class OrderInvoiceRecordController extends BaseController {
|
||||
@Autowired
|
||||
private OrderInvoiceRecordService orderInvoiceRecordService;
|
||||
|
||||
@Autowired
|
||||
private PileMerchantInfoService pileMerchantInfoService;
|
||||
|
||||
/**
|
||||
* 查询申请开票列表
|
||||
*/
|
||||
@@ -58,12 +57,28 @@ public class OrderInvoiceRecordController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('order:invoice:export')")
|
||||
@Log(title = "申请开票", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, OrderInvoiceRecord orderInvoiceRecord) {
|
||||
List<OrderInvoiceRecord> list = orderInvoiceRecordService.selectOrderInvoiceRecordList(orderInvoiceRecord);
|
||||
ExcelUtil<OrderInvoiceRecord> util = new ExcelUtil<OrderInvoiceRecord>(OrderInvoiceRecord.class);
|
||||
public void export(HttpServletResponse response, GetInvoiceInfoDTO dto) {
|
||||
List<OrderInvoiceRecordExportVO> list = orderInvoiceRecordService.getInvoiceExportListWithAuth(dto);
|
||||
ExcelUtil<OrderInvoiceRecordExportVO> util = new ExcelUtil<OrderInvoiceRecordExportVO>(OrderInvoiceRecordExportVO.class);
|
||||
util.exportExcel(response, list, "申请开票数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入开票结果
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('order:invoice:edit')")
|
||||
@Log(title = "申请开票", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file) throws Exception {
|
||||
if (file == null || file.isEmpty()) {
|
||||
return AjaxResult.error("上传文件不能为空");
|
||||
}
|
||||
ExcelUtil<OrderInvoiceRecordImportVO> util = new ExcelUtil<OrderInvoiceRecordImportVO>(OrderInvoiceRecordImportVO.class);
|
||||
List<OrderInvoiceRecordImportVO> importList = util.importExcel(file.getInputStream());
|
||||
String message = orderInvoiceRecordService.importInvoiceImages(importList, getUsername());
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取申请开票详细信息
|
||||
*/
|
||||
|
||||
@@ -45,6 +45,11 @@ public class OrderInvoiceRecord extends BaseEntity {
|
||||
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 发票图片url
|
||||
*/
|
||||
private String invoiceUrl;
|
||||
|
||||
/**
|
||||
* 申请订单编号(逗号分割)
|
||||
*/
|
||||
@@ -154,6 +159,7 @@ public class OrderInvoiceRecord extends BaseEntity {
|
||||
.append("totalAmount", getTotalAmount())
|
||||
.append("totalServiceAmount", getTotalServiceAmount())
|
||||
.append("totalElecAmount", getTotalElecAmount())
|
||||
.append("invoiceUrl", getInvoiceUrl())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
|
||||
@@ -15,6 +15,11 @@ public class GetInvoiceInfoDTO {
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 勾选导出的申请开票记录id
|
||||
*/
|
||||
private Integer[] ids;
|
||||
|
||||
/**
|
||||
* 会员id
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.OrderInvoiceRecord;
|
||||
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
||||
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 org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -40,6 +41,14 @@ public interface OrderInvoiceRecordMapper {
|
||||
*/
|
||||
List<OrderInvoiceRecordVO> getInvoiceListWithAuth(@Param("dto") GetInvoiceInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 查询申请开票导出列表(带权限校验)
|
||||
*
|
||||
* @param dto 查询条件
|
||||
* @return 导出集合
|
||||
*/
|
||||
List<OrderInvoiceRecordExportVO> getInvoiceExportListWithAuth(@Param("dto") GetInvoiceInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 新增申请开票
|
||||
*
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.jsowell.pile.domain.OrderInvoiceRecord;
|
||||
import com.jsowell.pile.dto.GetInvoiceInfoDTO;
|
||||
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
||||
import com.jsowell.pile.vo.web.InvoiceRecordVO;
|
||||
import com.jsowell.pile.vo.web.OrderInvoiceRecordExportVO;
|
||||
import com.jsowell.pile.vo.web.OrderInvoiceRecordImportVO;
|
||||
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -41,6 +43,23 @@ public interface OrderInvoiceRecordService {
|
||||
*/
|
||||
List<OrderInvoiceRecordVO> getInvoiceListWithAuth(GetInvoiceInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 查询申请开票导出列表(带权限校验)
|
||||
*
|
||||
* @param dto 查询条件
|
||||
* @return 导出列表
|
||||
*/
|
||||
List<OrderInvoiceRecordExportVO> getInvoiceExportListWithAuth(GetInvoiceInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 导入发票图片并更新申请开票记录
|
||||
*
|
||||
* @param importList 导入数据
|
||||
* @param operName 操作人
|
||||
* @return 导入结果
|
||||
*/
|
||||
String importInvoiceImages(List<OrderInvoiceRecordImportVO> importList, String operName);
|
||||
|
||||
List<OrderInvoiceRecord> selectInvoiceRecordList(QueryInvoiceRecordDTO memberId);
|
||||
|
||||
List<OrderInvoiceRecordVO> selectInvoiceVOList(QueryInvoiceRecordDTO memberId);
|
||||
|
||||
@@ -2,6 +2,10 @@ package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.file.AliyunOssUploadUtils;
|
||||
import com.jsowell.common.util.file.FileUtils;
|
||||
import com.jsowell.common.config.JsowellConfig;
|
||||
import com.jsowell.pile.domain.OrderInvoiceRecord;
|
||||
import com.jsowell.pile.dto.GetInvoiceInfoDTO;
|
||||
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
||||
@@ -13,14 +17,22 @@ import com.jsowell.pile.util.UserUtils;
|
||||
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.InvoiceTitleVO;
|
||||
import com.jsowell.pile.vo.web.InvoiceRecordVO;
|
||||
import com.jsowell.pile.vo.web.OrderInvoiceRecordExportVO;
|
||||
import com.jsowell.pile.vo.web.OrderInvoiceRecordImportVO;
|
||||
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 申请开票Service业务层处理
|
||||
@@ -69,6 +81,7 @@ public class OrderInvoiceRecordServiceImpl implements OrderInvoiceRecordService
|
||||
.memberId(vo.getMemberId())
|
||||
.phoneNumber(vo.getPhoneNumber())
|
||||
.status(vo.getStatus())
|
||||
.invoiceUrl(vo.getInvoiceUrl())
|
||||
.invoiceTitle(invoiceTitleVO)
|
||||
.orderList(orderAmountDetailVOS)
|
||||
.createTime(vo.getCreateTime())
|
||||
@@ -94,16 +107,114 @@ public class OrderInvoiceRecordServiceImpl implements OrderInvoiceRecordService
|
||||
*/
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importInvoiceImages(List<OrderInvoiceRecordImportVO> importList, String operName) {
|
||||
if (CollectionUtils.isEmpty(importList)) {
|
||||
return "导入数据为空";
|
||||
}
|
||||
Set<Integer> requestedIds = importList.stream()
|
||||
.map(OrderInvoiceRecordImportVO::getId)
|
||||
.filter(id -> id != null)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
if (CollectionUtils.isEmpty(requestedIds)) {
|
||||
return "导入失败,文件中缺少申请记录ID";
|
||||
}
|
||||
GetInvoiceInfoDTO dto = new GetInvoiceInfoDTO();
|
||||
dto.setIds(requestedIds.toArray(new Integer[0]));
|
||||
Set<Integer> authorizedIds = getInvoiceExportListWithAuth(dto).stream()
|
||||
.map(OrderInvoiceRecordExportVO::getId)
|
||||
.filter(id -> id != null)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
|
||||
int successNum = 0;
|
||||
int skipNum = 0;
|
||||
List<String> messages = new ArrayList<>();
|
||||
for (int i = 0; i < importList.size(); i++) {
|
||||
OrderInvoiceRecordImportVO item = importList.get(i);
|
||||
int rowNum = i + 2;
|
||||
if (item.getId() == null) {
|
||||
messages.add("第" + rowNum + "行缺少申请记录ID");
|
||||
continue;
|
||||
}
|
||||
if (!authorizedIds.contains(item.getId())) {
|
||||
messages.add("第" + rowNum + "行申请记录无权限或不存在");
|
||||
continue;
|
||||
}
|
||||
if (StringUtils.isEmpty(item.getInvoiceImage())) {
|
||||
skipNum++;
|
||||
continue;
|
||||
}
|
||||
|
||||
String absolutePath = buildAbsoluteImportPath(item.getInvoiceImage());
|
||||
try {
|
||||
byte[] imageBytes = java.nio.file.Files.readAllBytes(Paths.get(absolutePath));
|
||||
String url = AliyunOssUploadUtils.upload2OSS(imageBytes, new File(absolutePath).getName());
|
||||
OrderInvoiceRecord updateRecord = new OrderInvoiceRecord();
|
||||
updateRecord.setId(item.getId());
|
||||
updateRecord.setInvoiceUrl(url);
|
||||
updateRecord.setStatus("1");
|
||||
updateRecord.setUpdateBy(operName);
|
||||
updateRecord.setUpdateTime(new Date());
|
||||
if (orderInvoiceRecordMapper.updateOrderInvoiceRecord(updateRecord) > 0) {
|
||||
successNum++;
|
||||
} else {
|
||||
messages.add("第" + rowNum + "行更新失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
messages.add("第" + rowNum + "行导入失败:" + e.getMessage());
|
||||
} finally {
|
||||
FileUtils.deleteFile(absolutePath);
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
result.append("成功导入").append(successNum).append("条发票数据");
|
||||
if (skipNum > 0) {
|
||||
result.append(",跳过未贴图记录").append(skipNum).append("条");
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(messages)) {
|
||||
result.append(",失败").append(messages.size()).append("条:<br/>")
|
||||
.append(String.join("<br/>", messages));
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
private boolean fillAuthorizedMerchantDeptIds(GetInvoiceInfoDTO dto) {
|
||||
// 获取登录账号信息
|
||||
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
|
||||
if (authorizedMap == null) {
|
||||
return new ArrayList<>();
|
||||
return false;
|
||||
}
|
||||
List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
|
||||
if (CollectionUtils.isNotEmpty(merchantDeptIds)) {
|
||||
dto.setMerchantDeptIds(merchantDeptIds);
|
||||
}
|
||||
return orderInvoiceRecordMapper.getInvoiceListWithAuth(dto);
|
||||
return true;
|
||||
}
|
||||
|
||||
private String buildAbsoluteImportPath(String relativePath) {
|
||||
if (StringUtils.isEmpty(relativePath)) {
|
||||
return relativePath;
|
||||
}
|
||||
File file = new File(relativePath);
|
||||
if (file.isAbsolute()) {
|
||||
return relativePath;
|
||||
}
|
||||
return Paths.get(JsowellConfig.getProfile(), relativePath).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -44,6 +44,11 @@ public class InvoiceRecordVO {
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 发票图片url
|
||||
*/
|
||||
private String invoiceUrl;
|
||||
|
||||
/**
|
||||
* 发票抬头信息
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.jsowell.pile.vo.web;
|
||||
|
||||
import com.jsowell.common.annotation.Excel;
|
||||
import com.jsowell.common.annotation.Excel.ColumnType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 申请开票导出对象
|
||||
*/
|
||||
@Data
|
||||
public class OrderInvoiceRecordExportVO {
|
||||
@Excel(name = "申请记录ID")
|
||||
private Integer id;
|
||||
|
||||
@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;
|
||||
|
||||
@Excel(name = "发票图片", cellType = ColumnType.IMAGE, width = 30, height = 80)
|
||||
private String invoiceImage;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.jsowell.pile.vo.web;
|
||||
|
||||
import com.jsowell.common.annotation.Excel;
|
||||
import com.jsowell.common.annotation.Excel.ColumnType;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 申请开票导入对象
|
||||
*/
|
||||
@Data
|
||||
public class OrderInvoiceRecordImportVO {
|
||||
@Excel(name = "申请记录ID")
|
||||
private Integer id;
|
||||
|
||||
@Excel(name = "发票图片", cellType = ColumnType.IMAGE)
|
||||
private String invoiceImage;
|
||||
}
|
||||
@@ -18,6 +18,7 @@ public class OrderInvoiceRecordVO {
|
||||
private String merchantName;
|
||||
private String titleId;
|
||||
private String email;
|
||||
private String invoiceUrl;
|
||||
private String orderCodes;
|
||||
private String status;
|
||||
private String createTime;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<result property="titleId" column="title_id" />
|
||||
<result property="phoneNumber" column="phone_number" />
|
||||
<result property="email" column="email" />
|
||||
<result property="invoiceUrl" column="invoice_url" />
|
||||
<result property="orderCodes" column="order_codes" />
|
||||
<result property="status" column="status" />
|
||||
<result property="totalAmount" column="total_amount" />
|
||||
@@ -25,7 +26,7 @@
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, member_id, merchant_id, title_id, phone_number, email, order_codes, status, total_amount, total_service_amount, total_elec_amount,
|
||||
id, member_id, merchant_id, title_id, phone_number, email, invoice_url, order_codes, status, total_amount, total_service_amount, total_elec_amount,
|
||||
create_by, create_time, update_by, update_time, del_flag
|
||||
</sql>
|
||||
|
||||
@@ -59,6 +60,7 @@
|
||||
<if test="titleId != null">title_id,</if>
|
||||
<if test="phoneNumber != null">phone_number,</if>
|
||||
<if test="email != null">email,</if>
|
||||
<if test="invoiceUrl != null">invoice_url,</if>
|
||||
<if test="orderCodes != null">order_codes,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="totalAmount != null">total_amount,</if>
|
||||
@@ -76,6 +78,7 @@
|
||||
<if test="titleId != null">#{titleId},</if>
|
||||
<if test="phoneNumber != null">#{phoneNumber},</if>
|
||||
<if test="email != null">#{email},</if>
|
||||
<if test="invoiceUrl != null">#{invoiceUrl},</if>
|
||||
<if test="orderCodes != null">#{orderCodes},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="totalAmount != null">#{totalAmount},</if>
|
||||
@@ -94,6 +97,10 @@
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="merchantId != null">merchant_id = #{merchantId},</if>
|
||||
<if test="titleId != null">title_id = #{titleId},</if>
|
||||
<if test="phoneNumber != null">phone_number = #{phoneNumber},</if>
|
||||
<if test="email != null">email = #{email},</if>
|
||||
<if test="invoiceUrl != null">invoice_url = #{invoiceUrl},</if>
|
||||
<if test="orderCodes != null">order_codes = #{orderCodes},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
|
||||
@@ -145,6 +152,7 @@
|
||||
t2.merchant_name as merchantName,
|
||||
t1.title_id as titleId,
|
||||
t1.email as email,
|
||||
t1.invoice_url as invoiceUrl,
|
||||
t1.order_codes as orderCodes,
|
||||
t1.STATUS as status,
|
||||
t1.create_time as createTime,
|
||||
@@ -169,6 +177,52 @@
|
||||
order by t1.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getInvoiceExportListWithAuth" resultType="com.jsowell.pile.vo.web.OrderInvoiceRecordExportVO">
|
||||
SELECT
|
||||
t1.id AS id,
|
||||
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,
|
||||
t1.invoice_url AS invoiceImage
|
||||
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>
|
||||
<if test="dto.ids != null and dto.ids.length != 0">
|
||||
and t1.id in
|
||||
<foreach collection="dto.ids" item="id" open="(" separator="," close=")">
|
||||
#{id,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</if>
|
||||
order by t1.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectInvoiceVOList" resultType="com.jsowell.pile.vo.web.OrderInvoiceRecordVO">
|
||||
SELECT
|
||||
t1.member_id,
|
||||
@@ -204,6 +258,7 @@
|
||||
t2.mobile_number AS phoneNumber,
|
||||
t1.merchant_id AS merchantId,
|
||||
t1.title_id AS titleId,
|
||||
t1.invoice_url AS invoiceUrl,
|
||||
t1.order_codes AS orderCodes,
|
||||
t1.STATUS,
|
||||
t1.total_amount AS totalAmount,
|
||||
@@ -216,4 +271,4 @@
|
||||
AND t1.del_flag = '0'
|
||||
where t1.id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
2
sql/20260415_add_invoice_url_to_order_invoice_record.sql
Normal file
2
sql/20260415_add_invoice_url_to_order_invoice_record.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE order_invoice_record
|
||||
ADD COLUMN invoice_url varchar(500) DEFAULT NULL COMMENT '发票图片url' AFTER email;
|
||||
Reference in New Issue
Block a user