Commit 076b357b authored by zhangfeng's avatar zhangfeng

feat(wealth): 收款单,应收明细查询

parent 094ad590
This diff is collapsed.
UPDATE ecw_receivable er
SET base_currency_id = (SELECT er.import_currency5
FROM ecw_region er
WHERE er.id = (SELECT eoo.objective_country_id
FROM ecw_order_objective eoo
WHERE eoo.order_id = er.order_id));
\ No newline at end of file
This diff is collapsed.
......@@ -38,8 +38,6 @@ public class OrderApiImpl implements OrderApi {
@Resource
private OrderService orderService;
@Resource
private OrderMapper orderMapper;
@Resource
private OrderBusinessService orderBusinessService;
@Resource
private CustomerService customerService;
......@@ -198,7 +196,7 @@ public class OrderApiImpl implements OrderApi {
@Override
public Long getDestCountryByOrderId(Long orderId) {
String destCountryByOrderId = orderMapper.getDestCountryByOrderId(orderId);
return destCountryByOrderId == null ? null : Long.valueOf(destCountryByOrderId);
OrderObjectiveDO orderObjectiveDO = objectiveService.getByOrderId(orderId);
return orderObjectiveDO == null ? null : orderObjectiveDO.getObjectiveCountryId();
}
}
......@@ -85,8 +85,11 @@ public interface ReceiptMapper extends AbstractMapper<ReceiptDO> {
ReceiptExportDto getReceiptExportByOrderId(@Param("orderId") Long orderId);
IPage<ReceiptBackVO> getReceiptBackPage(@Param("mpPage") IPage<ReceiptBackVO> mpPage, @Param("query") ReceiptQueryVO query);
List<ReceiptBackVO> getReceiptBackPage(@Param("start") int start,@Param("size") int size, @Param("query") ReceiptQueryVO query);
int countReceiptBackPage(@Param("query") ReceiptQueryVO query);
List<ReceiptRelationOrderInfoVO> getOrderInfoByReceiptId(Long id);
void updateReceiptNewFieldBatch(List<ReceiptDO> receiptDOS);
}
......@@ -5,10 +5,11 @@ import cn.iocoder.yudao.module.wealth.dal.dataobject.receipt.ReceiptDO;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptItem.ReceiptItemDO;
import cn.iocoder.yudao.module.wealth.dal.mysql.receipt.ReceiptMapper;
import cn.iocoder.yudao.module.wealth.dal.mysql.receiptItem.ReceiptItemMapper;
import cn.iocoder.yudao.module.wealth.enums.InvoiceDataStatusEnum;
import cn.iocoder.yudao.module.wealth.enums.InvoicingStatusEnum;
import cn.iocoder.yudao.module.wealth.enums.ReceiptItemStatusInReceiptEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
......@@ -17,7 +18,7 @@ import java.util.stream.Collectors;
@Component
@Slf4j
public class UpdateReceiptNewFeildTask implements JobHandler {
public class UpdateReceiptNewFieldTask implements JobHandler {
@Resource
private ReceiptItemMapper receiptItemMapper;
@Resource
......@@ -28,23 +29,37 @@ public class UpdateReceiptNewFeildTask implements JobHandler {
*/
@Override
public String execute(String param) throws Exception {
log.info("更新收款单新字段:应收明细状态");
long l = System.currentTimeMillis();
LambdaQueryWrapper<ReceiptDO> receiptDOLambdaQueryWrapper = new LambdaQueryWrapper<>();
receiptDOLambdaQueryWrapper.select(ReceiptDO::getId)
receiptDOLambdaQueryWrapper.select(ReceiptDO::getId,ReceiptDO::getOpenInvoice)
.eq(ReceiptDO::getDeleted, false);
List<ReceiptDO> receiptDOS = receiptMapper.selectList(receiptDOLambdaQueryWrapper);
List<Long> idList = receiptDOS.stream().map(ReceiptDO::getId).collect(Collectors.toList());
LambdaQueryWrapper<ReceiptItemDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(ReceiptItemDO::getReceiptId, idList)
.select(ReceiptItemDO::getReceiptId, ReceiptItemDO::getStatus);
List<ReceiptItemDO> listItem = receiptItemMapper.selectList(lambdaQueryWrapper);
for (ReceiptDO receiptDO : receiptDOS) {
LambdaQueryWrapper<ReceiptItemDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ReceiptItemDO::getReceiptId, receiptDO.getId())
.select(ReceiptItemDO::getReceiptId, ReceiptItemDO::getStatus);
List<ReceiptItemDO> listItem = receiptItemMapper.selectList(lambdaQueryWrapper);
if (!listItem.isEmpty()) {
ReceiptItemStatusInReceiptEnum sMxStatus = getReceiptMxStatus(listItem, receiptDO.getId());
receiptDO.setReceiptItemStatus(sMxStatus.getValue());
} else {
receiptDO.setReceiptItemStatus(ReceiptItemStatusInReceiptEnum.NO_INPUT.getValue());
}
if (receiptDO.getOpenInvoice().equals(1)) {
receiptDO.setInvoiceDataStatus(InvoiceDataStatusEnum.SUBMIT.getValue());
receiptDO.setInvoicingStatus(InvoicingStatusEnum.WAIT.getValue());
} else if (receiptDO.getOpenInvoice().equals(0)) {
receiptDO.setInvoiceDataStatus(InvoiceDataStatusEnum.NO_AUDIT.getValue());
receiptDO.setInvoicingStatus(InvoicingStatusEnum.NO_INVOICE.getValue());
}
}
List<List<ReceiptDO>> receiptDOSList = receiptDOS.stream().collect(Collectors.groupingBy(item -> receiptDOS.indexOf(item) / 500)).values().stream().map(list -> list.stream().limit(1000).collect(Collectors.toList())).collect(Collectors.toList());
for (List<ReceiptDO> dos : receiptDOSList) {
receiptMapper.updateReceiptNewFieldBatch(dos);
}
receiptMapper.updateBatch(receiptDOS);
log.info("更新收款单新字段:应收明细状态,耗时:{}", System.currentTimeMillis() - l);
return "success";
}
......
......@@ -192,7 +192,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
receivableDO.setBaseCurrencyId(destCountryCurrencyId);
ExchangeRateRespDTO currencyRate = currencyApi.getCurrencyRate(receipt.getCurrencyId(), destCountryCurrencyId);
receivableDO.setExchangeRate(currencyRate.getCurrencyRate());
BigDecimal actualAmount = receivableDO.getTaxAmount().subtract(receivableDO.getDiscountTotal());
BigDecimal actualAmount = receivableDO.getTaxAmount().subtract(receivableDO.getDiscountTotal() == null ? BigDecimal.ZERO : receivableDO.getDiscountTotal());
receivableDO.setBaseAmount(actualAmount.multiply(currencyRate.getCurrencyRate()));
return receivableDO;
}).collect(Collectors.toList());
......@@ -220,7 +220,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
try {
validateCreateVO(createReqVO);
} catch (Exception e) {
respVOS.add(new ReceiptBatchGenRespVO(createReqVO.getOrderNo(), createReqVO.getCustomerName(), e.getMessage()));
respVOS.add(new ReceiptBatchGenRespVO(null, createReqVO.getCustomerName(), e.getMessage()));
}
});
if (!respVOS.isEmpty()) {
......@@ -231,7 +231,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
try {
currentProxy.generateReceiptRelevantData(receiptCreateReqVO);
} catch (Exception e) {
respVOS.add(new ReceiptBatchGenRespVO(receiptCreateReqVO.getOrderNo(), receiptCreateReqVO.getCustomerName(), e.getMessage()));
respVOS.add(new ReceiptBatchGenRespVO(null, receiptCreateReqVO.getCustomerName(), e.getMessage()));
}
}
return respVOS;
......@@ -297,7 +297,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
*
* @param receivableUpdateReqVOList 收款明细
*/
public void validateSameCustomerReceivable(List<ReceivableUpdateReqVO> receivableUpdateReqVOList) {
private void validateSameCustomerReceivable(List<ReceivableUpdateReqVO> receivableUpdateReqVOList) {
if (CollectionUtil.isEmpty(receivableUpdateReqVOList)) {
throw exception(RECEIVABLE_NOT_NULL);
}
......@@ -436,21 +436,19 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
@Override
public PageResult<ReceiptBackVO> getReceiptPage(ReceiptQueryVO query, PageVO page) {
page.setField("er.id");
IPage<ReceiptBackVO> mpPage = MyBatisUtils.buildPage(page);
receiptMapper.getReceiptBackPage(mpPage, query);
if (mpPage.getTotal() == 0) {
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
List<ReceiptBackVO> receiptBackPage = receiptMapper.getReceiptBackPage(start, size, query);
if (receiptBackPage.isEmpty()) {
return PageResult.empty();
}
mpPage.getRecords().forEach(receiptBackVO -> {
int total = receiptMapper.countReceiptBackPage(query);
receiptBackPage.forEach(receiptBackVO -> {
// 根据收款单id获取关联订单信息
List<ReceiptRelationOrderInfoVO> orderInfoList = receiptMapper.getOrderInfoByReceiptId(receiptBackVO.getId());
receiptBackVO.setOrderInfoList(orderInfoList);
});
//添加明细状态计算列表
//MxStatus
//获取List指定字段的List
List<Long> idList = mpPage.getRecords().stream().map(ReceiptBackVO::getId).collect(Collectors.toList());
List<Long> idList = receiptBackPage.stream().map(ReceiptBackVO::getId).collect(Collectors.toList());
//一定要判空,不然会报错
if (CollectionUtil.isNotEmpty(idList)) {
//根据List获取本页中所有的明细信息
......@@ -465,7 +463,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
Map<Integer, CurrencyRespDTO> currencyMap = currencyApi.getAllCurrency();
for (ReceiptBackVO r : mpPage.getRecords()) {
for (ReceiptBackVO r : receiptBackPage) {
String sR = getReceiptMxStatus(listItem, r.getId()).getNameZh();
r.setMxStatus(sR);
......@@ -480,7 +478,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
r.setHxBiLi(getHxBili(ReceiptAccountList, listItem, r.getId()));
}
}
return PageResult.of(mpPage);
return new PageResult<>(receiptBackPage, total);
}
private String getPercentage(BigDecimal part, BigDecimal total) {
......
......@@ -103,6 +103,8 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
receivable.setCreator(creator);
receivable.setUpdateTime(new Date());
receivable.setUpdater(creator);
// 设置基准币种
receivable.setBaseCurrencyId(getDestCountryCurrencyId(createReqVO.getOrderId()));
this.save(receivable);
// 返回
return receivable.getId();
......@@ -246,6 +248,16 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
page.setField("r.id");
IPage<ReceivableBackVO> mpPage = MyBatisUtils.buildPage(page);
receivableMapper.receivablePage(mpPage, query);
mpPage.getRecords().forEach(receivableBackVO -> {
if (receivableBackVO.getDiscountTotal() == null) {
receivableBackVO.setDiscountTotal(BigDecimal.ZERO);
}
receivableBackVO.setNotIncludedTaxAmount(receivableBackVO.getTotalAmount());
receivableBackVO.setActualAmount(receivableBackVO.getTaxAmount().subtract(receivableBackVO.getDiscountTotal()));
ExchangeRateRespDTO currencyRate = currencyApi.getCurrencyRate(receivableBackVO.getCurrencyId(), receivableBackVO.getBaseCurrencyId());
receivableBackVO.setExchangeRate(currencyRate.getCurrencyRate());
receivableBackVO.setBaseAmount(receivableBackVO.getActualAmount().multiply(currencyRate.getCurrencyRate()));
});
return PageResult.of(mpPage);
}
......@@ -263,15 +275,13 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
@Override
public List<ReceivableBackVO> getReceivableByOrderId(Long orderId) {
List<ReceivableBackVO> receivableBackVOList = receivableMapper.getReceivableByOrderId(orderId);
Long destCountryCurrencyId = getDestCountryCurrencyId(orderId);
receivableBackVOList.forEach(receivableBackVO -> {
if (receivableBackVO.getDiscountTotal() == null) {
receivableBackVO.setDiscountTotal(BigDecimal.ZERO);
}
receivableBackVO.setNotIncludedTaxAmount(receivableBackVO.getTotalAmount());
receivableBackVO.setActualAmount(receivableBackVO.getTaxAmount().subtract(receivableBackVO.getDiscountTotal()));
receivableBackVO.setBaseCurrencyId(destCountryCurrencyId);
ExchangeRateRespDTO currencyRate = currencyApi.getCurrencyRate(receivableBackVO.getCurrencyId(), destCountryCurrencyId);
ExchangeRateRespDTO currencyRate = currencyApi.getCurrencyRate(receivableBackVO.getCurrencyId(), receivableBackVO.getBaseCurrencyId());
receivableBackVO.setExchangeRate(currencyRate.getCurrencyRate());
receivableBackVO.setBaseAmount(receivableBackVO.getActualAmount().multiply(currencyRate.getCurrencyRate()));
});
......@@ -312,7 +322,6 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
receivableBackVO.setWriteOffAmountUsd(BigDecimal.ZERO);
receivableBackVO.setNotWriteOffAmountUsd(BigDecimal.ZERO);
receivableBackVO.setBaseAmount(BigDecimal.ZERO);
receivableBackVO.setBaseCurrencyId(1L);
// 核销比例 = 已核销金额 / 实际金额,保留两位小数字符串
receivableBackVO.setWriteOffProportion(receivableBackVO.getWriteOffAmount().divide(receivableBackVO.getActualAmount(), 2, RoundingMode.HALF_UP).toString());
});
......
......@@ -201,15 +201,6 @@ public class ReceiptBackVO {
@ApiModelProperty(value = "明细状态")
private String mxStatus;
@ApiModelProperty(value = "订单号")
private String orderNo;
@ApiModelProperty(value = "订单ID")
private Long orderId;
@ApiModelProperty(value = "提单号")
private String tidanNo;
@ApiModelProperty(value = "应收金额")
private String ysShow;
......
......@@ -149,11 +149,4 @@ public class ReceiptBaseVO {
@ApiModelProperty(value = "财务备注")
private String financeRemark;
@ApiModelProperty(value = "订单ID")
private String orderId;
@ApiModelProperty(value = "订单编号")
private String orderNo;
}
......@@ -5,7 +5,9 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
......@@ -142,11 +144,11 @@ public class ReceiptQueryVO {
private String numberNo;
@ApiModelProperty(value = "明细状态")
private Integer receiptItemStatus;
private List<Integer> receiptItemStatus;
@ApiModelProperty(value = "开票状态")
private Integer invoicingStatus;
private List<Integer> invoicingStatus;
@ApiModelProperty(value = "开票资料状态")
private Integer invoiceDataStatus;
private List<Integer> invoiceDataStatus;
}
......@@ -108,7 +108,9 @@ public class ReceivableBaseVO {
@ApiModelProperty(value = "基准金额")
private BigDecimal baseAmount;
@ApiModelProperty(value = "基准币种")
private Long baseCurrencyId;
@ApiModelProperty(value = "备注")
private String remark;
}
......@@ -16,14 +16,13 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.ecw.api.currency.CurrencyApi;
import cn.iocoder.yudao.module.ecw.api.currency.dto.CurrencyRespDTO;
import cn.iocoder.yudao.module.ecw.api.currency.dto.ExchangeRateRespDTO;
import cn.iocoder.yudao.module.ecw.service.bankAccount.BankAccountService;
import cn.iocoder.yudao.module.wealth.convert.receipt.ReceiptConvert;
import cn.iocoder.yudao.module.wealth.convert.receiptAccount.ReceiptAccountConvert;
import cn.iocoder.yudao.module.wealth.convert.receiptApproval.ReceiptApprovalConvert;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receipt.ReceiptDO;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptAccount.ReceiptAccountDO;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptApproval.ReceiptApprovalDO;
import cn.iocoder.yudao.module.wealth.job.UpdateReceiptNewFeildTask;
import cn.iocoder.yudao.module.wealth.job.UpdateReceiptNewFieldTask;
import cn.iocoder.yudao.module.wealth.service.receipt.ReceiptService;
import cn.iocoder.yudao.module.wealth.service.receiptAccount.ReceiptAccountService;
import cn.iocoder.yudao.module.wealth.service.receiptApproval.ReceiptApprovalService;
......@@ -71,29 +70,22 @@ import static cn.iocoder.yudao.module.wealth.enums.ErrorCodeConstants.PAYMENT_NO
public class ReceiptController {
@Resource
private ReceiptService receiptService;
@Resource
private ReceivableService receivableService;
@Resource
private ReceiptAccountService receiptAccountService;
@Resource
private CurrencyApi currencyApi;
@Resource
private BankAccountService bankAccountService;
@Resource
private ReceiptApprovalService receiptApprovalService;
@Resource
private UpdateReceiptNewFeildTask updateReceiptNewFeildTask;
private UpdateReceiptNewFieldTask updateReceiptNewFieldTask;
@GetMapping("/page")
@PostMapping("/page")
@ApiOperation("获得收款单分页")
//@PreAuthorize("@ss.hasPermission('ecw:receipt:query')")
public CommonResult<PageResult<ReceiptBackVO>> getReceiptPage(@Valid ReceiptQueryVO query, PageVO page) {
public CommonResult<PageResult<ReceiptBackVO>> getReceiptPage(@RequestBody @Valid ReceiptQueryVO query, PageVO page) {
//添加收款单明细状态计算功能
//添加订单号和提单号的关联展示
PageResult<ReceiptBackVO> pageResult = receiptService.getReceiptPage(query, page);
......@@ -112,7 +104,6 @@ public class ReceiptController {
@ApiOperation("创建收款单")
@Idempotent(timeout = 5)
public CommonResult<Long> createReceipt(@Valid @RequestBody ReceiptCreateReqVO createReqVO) {
//
return success(receiptService.createReceipt(createReqVO));
}
......@@ -714,9 +705,10 @@ public class ReceiptController {
return "¥";
}
}
@GetMapping("/updateReceiptNewFeild")
@ApiOperation("更新应收明细")
public CommonResult<String> updateReceiptNewFeild() throws Exception {
return success(updateReceiptNewFeildTask.execute(""));
public CommonResult<String> updateReceiptNewField() throws Exception {
return success(updateReceiptNewFieldTask.execute(""));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.wealth.dal.mysql.receipt.ReceiptMapper">
<update id="updateReceiptNewFieldBatch">
UPDATE ecw_receipt
<trim prefix="set" suffixOverrides=",">
<trim prefix="receipt_item_status=case" suffix="end,">
<foreach collection="list" item="i" index="index">
when id=#{i.id} then #{i.receiptItemStatus}
</foreach>
</trim>
<trim prefix="invoicing_status=case" suffix="end,">
<foreach collection="list" item="i" index="index">
when id=#{i.id} then #{i.invoicingStatus}
</foreach>
</trim>
<trim prefix="invoice_data_status=case" suffix="end,">
<foreach collection="list" item="i" index="index">
when id=#{i.id} then #{i.invoiceDataStatus}
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="i" index="index">
id = #{i.id}
</foreach>
</update>
<select id="getReceiptBackPage" resultType="cn.iocoder.yudao.module.wealth.vo.receipt.ReceiptBackVO">
<!--添加关联订单和应收款表的关联-->
SELECT
er.*,
er.*
FROM ecw_receipt er
<if test="query.numberNo != null and query.numberNo != ''">
INNER JOIN (SELECT receipt_id,order_id FROM ecw_receivable GROUP BY receipt_id, order_id ) AS rb ON rb.receipt_id = er.id
LEFT JOIN ecw_order o ON o.order_id=rb.order_id AND o.deleted=0
</if>
WHERE er.deleted = 0
<include refid="pageCondition"/>
<if test="query.numberNo != null and query.numberNo != ''">
GROUP BY er.receipt_no
</if>
LIMIT #{start}, #{size}
</select>
<select id="getOrderInfoByReceiptId"
resultType="cn.iocoder.yudao.module.wealth.vo.receipt.ReceiptRelationOrderInfoVO">
SELECT
o.order_no AS orderNo,
o.tidan_no AS tidanNo,
o.order_id AS orderId
FROM ecw_receivable er
LEFT JOIN ecw_order o ON o.order_id=er.order_id
WHERE er.deleted= 0 AND er.receipt_id = #{id}
GROUP BY o.order_id
</select>
<select id="countReceiptBackPage" resultType="java.lang.Integer">
SELECT count(1)
FROM ecw_receipt er
INNER JOIN (SELECT receipt_id,order_id FROM ecw_receivable GROUP BY receipt_id, order_id ) rb ON rb.receipt_id = er.id
LEFT JOIN ecw_order o ON o.order_id=rb.order_id AND o.deleted=0
<if test="query.numberNo != null and query.numberNo != ''">
INNER JOIN (SELECT receipt_id,order_id FROM ecw_receivable GROUP BY receipt_id, order_id ) AS rb ON rb.receipt_id = er.id
LEFT JOIN ecw_order o ON o.order_id=rb.order_id AND o.deleted=0
</if>
WHERE er.deleted = 0
<include refid="pageCondition"/>
<if test="query.numberNo != null and query.numberNo != ''">
GROUP BY er.receipt_no
</if>
</select>
<sql id="pageCondition">
<if test="query.receiptItemStatus != null">
AND er.`detail_status` = #{query.receiptItemStatus}
<if test="query.receiptItemStatus.size() == 1">
AND er.`receipt_item_status` = #{query.receiptItemStatus[0]}
</if>
<if test="query.receiptItemStatus.size() > 1">
AND er.`receipt_item_status` IN
<foreach collection="query.receiptItemStatus" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
<if test="query.invoicingStatus != null">
AND er.`invoicing_status` = #{query.invoicingStatus}
<if test="query.invoicingStatus.size() == 1">
AND er.`invoicing_status` = #{query.invoicingStatus[0]}
</if>
<if test="query.invoicingStatus.size() > 1">
AND er.`invoicing_status` IN
<foreach collection="query.invoicingStatus" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
<if test="query.invoiceDataStatus != null">
AND er.`invoice_data_status` = #{query.invoiceDataStatus}
<if test="query.invoiceDataStatus.size() == 1">
AND er.`invoice_data_status` = #{query.invoiceDataStatus[0]}
</if>
<if test="query.invoiceDataStatus.size() > 1">
AND er.`invoice_data_status` IN
<foreach collection="query.invoiceDataStatus" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
<if test="query.receiptNo != null">
AND er.`receipt_no` = #{query.receiptNo}
......@@ -45,20 +123,7 @@
AND er.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}
</if>
<if test="query.numberNo != null and query.numberNo != '' ">
AND (o.order_no = #{query.numberNo} OR o.tidan_no = #{query.numberNo} OR o.container_number =
#{query.numberNo}))
AND (o.order_no = #{query.numberNo} OR o.tidan_no = #{query.numberNo} OR o.container_number = #{query.numberNo})
</if>
GROUP BY er.receipt_no
</select>
<select id="getOrderInfoByReceiptId"
resultType="cn.iocoder.yudao.module.wealth.vo.receipt.ReceiptRelationOrderInfoVO">
SELECT
o.order_no AS orderNo,
o.tidan_no AS tidanNo,
o.order_id AS orderId
FROM ecw_receivable er
LEFT JOIN ecw_order o ON o.order_id=er.order_id
WHERE er.deleted= 0 AND er.receipt_id = #{id}
GROUP BY o.order_id
</select>
</sql>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment