Commit 622492d1 authored by zhangfeng's avatar zhangfeng

feat(wealth): 优化

parent 20a43543
...@@ -2,11 +2,13 @@ package cn.iocoder.yudao.module.ecw.api.bank; ...@@ -2,11 +2,13 @@ package cn.iocoder.yudao.module.ecw.api.bank;
import cn.iocoder.yudao.module.ecw.api.bank.dto.BankAccountDTO; import cn.iocoder.yudao.module.ecw.api.bank.dto.BankAccountDTO;
import java.util.List;
public interface BankApi { public interface BankApi {
/** /**
* 根据银行账号获取账号信息 * 根据银行账号获取账号信息
*/ */
BankAccountDTO getBankAccountByAccountNo(String baAccountNum); List<BankAccountDTO> getBankAccountByAccountNo(String baAccountNum);
/** /**
* 根据银行账号id获取账号信息 * 根据银行账号id获取账号信息
*/ */
......
...@@ -34,4 +34,6 @@ public interface BankAccountConvert { ...@@ -34,4 +34,6 @@ public interface BankAccountConvert {
List<BankAccountExcelVO> convertList02(List<BankAccountDO> list); List<BankAccountExcelVO> convertList02(List<BankAccountDO> list);
BankAccountDTO convertDTO(BankAccountDO bankAccountDO); BankAccountDTO convertDTO(BankAccountDO bankAccountDO);
List<BankAccountDTO> convertDTOList(List<BankAccountDO> bankAccountDOs);
} }
...@@ -19,12 +19,9 @@ public class BankApiImpl implements BankApi { ...@@ -19,12 +19,9 @@ public class BankApiImpl implements BankApi {
private BankAccountMapper bankAccountMapper; private BankAccountMapper bankAccountMapper;
@Override @Override
public BankAccountDTO getBankAccountByAccountNo(String baAccountNum) { public List<BankAccountDTO> getBankAccountByAccountNo(String baAccountNum) {
List<BankAccountDO> bankAccountDO = bankAccountMapper.selectList("ba_account_num", baAccountNum); List<BankAccountDO> bankAccountDOs = bankAccountMapper.selectList("ba_account_num", baAccountNum);
if (bankAccountDO != null && !bankAccountDO.isEmpty()) { return BankAccountConvert.INSTANCE.convertDTOList(bankAccountDOs);
return BankAccountConvert.INSTANCE.convertDTO(bankAccountDO.get(0));
}
return null;
} }
@Override @Override
......
...@@ -231,4 +231,8 @@ public class ReceiptDO extends BaseDO { ...@@ -231,4 +231,8 @@ public class ReceiptDO extends BaseDO {
* 生成路径 * 生成路径
*/ */
private Integer generatePath; private Integer generatePath;
/**
* 核销误差兑额外费用主币种金额
*/
private String writeOffDiffMainCurrency;
} }
package cn.iocoder.yudao.module.wealth.dal.mysql.payment; package cn.iocoder.yudao.module.wealth.dal.mysql.payment;
import java.util.*; import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery;
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper; import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
...@@ -11,6 +12,7 @@ import cn.iocoder.yudao.module.wealth.vo.payment.*; ...@@ -11,6 +12,7 @@ import cn.iocoder.yudao.module.wealth.vo.payment.*;
/** /**
* 付款单 Mapper * 付款单 Mapper
*
* @author 郑屹 * @author 郑屹
*/ */
@Mapper @Mapper
...@@ -18,14 +20,16 @@ public interface PaymentMapper extends AbstractMapper<PaymentDO> { ...@@ -18,14 +20,16 @@ public interface PaymentMapper extends AbstractMapper<PaymentDO> {
@Override @Override
default PageResult<PaymentDO> selectPage(PageVO page, Object object) { default PageResult<PaymentDO> selectPage(PageVO page, Object object) {
if (object instanceof PaymentQueryVO) { if (object instanceof PaymentQueryVO) {
PaymentQueryVO vo = (PaymentQueryVO)object; PaymentQueryVO vo = (PaymentQueryVO) object;
return selectPage(page, new LambdaQuery<PaymentDO>() return selectPage(page, new LambdaQuery<PaymentDO>()
.eqIfPresent(PaymentDO::getPaymentNo, vo.getPaymentNo()) .eqIfPresent(PaymentDO::getPaymentNo, vo.getPaymentNo())
.eqIfPresent(PaymentDO::getDepartmentId, vo.getDepartmentId()) .eqIfPresent(PaymentDO::getDepartmentId, vo.getDepartmentId())
.likeIfPresent(PaymentDO::getDepartmentName, vo.getDepartmentName()) .likeIfPresent(PaymentDO::getDepartmentName, vo.getDepartmentName())
.eqIfPresent(PaymentDO::getSalesmanId, vo.getSalesmanId()) .eqIfPresent(PaymentDO::getSalesmanId, vo.getSalesmanId())
.inIfPresent(PaymentDO::getSalesmanId, vo.getSalesmanIdList())
.likeIfPresent(PaymentDO::getSalesmanName, vo.getSalesmanName()) .likeIfPresent(PaymentDO::getSalesmanName, vo.getSalesmanName())
.eqIfPresent(PaymentDO::getSupplierId, vo.getSupplierId()) .eqIfPresent(PaymentDO::getSupplierId, vo.getSupplierId())
.inIfPresent(PaymentDO::getSupplierId, vo.getSupplierIdList())
.likeIfPresent(PaymentDO::getSupplierName, vo.getSupplierName()) .likeIfPresent(PaymentDO::getSupplierName, vo.getSupplierName())
.eqIfPresent(PaymentDO::getSupplierBank, vo.getSupplierBank()) .eqIfPresent(PaymentDO::getSupplierBank, vo.getSupplierBank())
.eqIfPresent(PaymentDO::getSupplierBankAccount, vo.getSupplierBankAccount()) .eqIfPresent(PaymentDO::getSupplierBankAccount, vo.getSupplierBankAccount())
...@@ -33,8 +37,10 @@ public interface PaymentMapper extends AbstractMapper<PaymentDO> { ...@@ -33,8 +37,10 @@ public interface PaymentMapper extends AbstractMapper<PaymentDO> {
.eqIfPresent(PaymentDO::getLatestPayAt, vo.getLatestPayAt()) .eqIfPresent(PaymentDO::getLatestPayAt, vo.getLatestPayAt())
.eqIfPresent(PaymentDO::getAccountNumber, vo.getAccountNumber()) .eqIfPresent(PaymentDO::getAccountNumber, vo.getAccountNumber())
.eqIfPresent(PaymentDO::getInvoiceStatus, vo.getInvoiceStatus()) .eqIfPresent(PaymentDO::getInvoiceStatus, vo.getInvoiceStatus())
.inIfPresent(PaymentDO::getInvoiceStatus, vo.getInvoiceStatusList())
.eqIfPresent(PaymentDO::getInvoiceNumber, vo.getInvoiceNumber()) .eqIfPresent(PaymentDO::getInvoiceNumber, vo.getInvoiceNumber())
.eqIfPresent(PaymentDO::getState, vo.getState()) .eqIfPresent(PaymentDO::getState, vo.getState())
.inIfPresent(PaymentDO::getState, vo.getStateList())
.eqIfPresent(PaymentDO::getPaymentAddId, vo.getPaymentAddId()) .eqIfPresent(PaymentDO::getPaymentAddId, vo.getPaymentAddId())
.eqIfPresent(PaymentDO::getPaymentAddBy, vo.getPaymentAddBy()) .eqIfPresent(PaymentDO::getPaymentAddBy, vo.getPaymentAddBy())
.eqIfPresent(PaymentDO::getReviewId, vo.getReviewId()) .eqIfPresent(PaymentDO::getReviewId, vo.getReviewId())
...@@ -55,7 +61,7 @@ public interface PaymentMapper extends AbstractMapper<PaymentDO> { ...@@ -55,7 +61,7 @@ public interface PaymentMapper extends AbstractMapper<PaymentDO> {
@Override @Override
default List<PaymentDO> selectList(Object object) { default List<PaymentDO> selectList(Object object) {
if (object instanceof PaymentQueryVO) { if (object instanceof PaymentQueryVO) {
PaymentQueryVO vo = (PaymentQueryVO)object; PaymentQueryVO vo = (PaymentQueryVO) object;
return selectList(new LambdaQuery<PaymentDO>() return selectList(new LambdaQuery<PaymentDO>()
.eqIfPresent(PaymentDO::getPaymentNo, vo.getPaymentNo()) .eqIfPresent(PaymentDO::getPaymentNo, vo.getPaymentNo())
.eqIfPresent(PaymentDO::getDepartmentId, vo.getDepartmentId()) .eqIfPresent(PaymentDO::getDepartmentId, vo.getDepartmentId())
......
...@@ -87,91 +87,6 @@ public interface ReceivableMapper extends AbstractMapper<ReceivableDO> { ...@@ -87,91 +87,6 @@ public interface ReceivableMapper extends AbstractMapper<ReceivableDO> {
return null; return null;
} }
@ResultType(ReceivableBackVO.class)
@Select({
"<script>",
"select r.*, ",
"o.marks, ",
"o.`status`, ",
"o.abnormal_state, ",
"o.in_warehouse_state, ",
"o.shipment_state, ",
"o.pick_state, ",
"o.to_warehouse_state, ",
"o.tidan_no, ",
"o.container_number as container_number, ",
"nor.name as consignor_name, ",
"nor.phone as consignor_phone, ",
"nor.customer_id as consignor_id, ",
"nee.name as consignee_name, ",
"nee.customer_id as consignee_id, ",
"nee.phone as consignee_phone",
"from ecw_receivable r ",
"left join ecw_order o on o.order_id = r.order_id",
"left join ecw_warehouse_line de on o.line_id = de.id ",
"left join ecw_order_consignor nor on nor.order_id = o.order_id ",
"left join ecw_order_consignee nee on nee.order_id = o.order_id ",
"where r.deleted = 0 and r.receipt_id is null and o.order_id is not null",
"<when test = 'query.status != null'>",
"AND o.`status` = #{query.status}",
"</when>",
"<when test = 'query.isCargoControl != null'>",
"AND (o.`is_cargo_control` = #{query.isCargoControl} or o.`is_cargo_control` = #{query.isCargoControl})",
"</when>",
"<when test = 'query.customsType != null'>",
"AND o.`customs_type` = #{query.customsType}",
"</when>",
"<when test = 'query.transportId != null'>",
"AND o.`transport_id` = #{query.transportId}",
"</when>",
"<when test = 'query.isCargoControl != null '>",
"AND o.`is_cargo_control` = #{query.isCargoControl}",
"</when>",
"<when test = 'query.marks != null and query.marks != \"\" '>",
"AND o.`marks` like concat('%',concat(#{query.marks},'%'))",
"</when>",
"<when test = 'query.departureId != null '>",
"AND de.`start_warehouse_id` = #{query.departureId}",
"</when>",
"<when test = 'query.objectiveId != null '>",
"AND de.`dest_warehouse_id` = #{query.objectiveId}",
"</when>",
"<when test = 'query.title != null and query.title != \"\" '>",
"AND concat(r.`title_zh`, r.`title_en`) like concat('%',concat(#{query.title},'%'))",
"</when>",
"<when test = 'query.consignorNameOrPhone != null and query.consignorNameOrPhone != \"\" '>",
"AND concat(nor.`name`, nor.`phone`,nor.`company`) like concat('%',concat(#{query.consignorNameOrPhone},'%'))",
"</when>",
"<when test = 'query.consigneeNameOrPhone != null and query.consigneeNameOrPhone != \"\" '>",
"AND concat(nee.`name`, nee.`phone`,nee.`company`) like concat('%',concat(#{query.consigneeNameOrPhone},'%'))",
"</when>",
"<when test = 'query.orderNo != null and query.orderNo != \"\" '>",
"AND r.`order_no` like concat('%',concat(#{query.orderNo},'%'))",
"</when>",
"<when test = 'query.tidanNo != null and query.tidanNo != \"\" '>",
"AND o.`tidan_no` like concat('%',concat(#{query.tidanNo},'%'))",
"</when>",
"<when test = 'query.receiptNo != null and query.receiptNo != \"\" '>",
"AND r.`receipt_no` like concat('%',concat(#{query.receiptNo},'%'))",
"</when>",
"<when test = 'query.state != null '>",
"AND r.`state` #{query.state}",
"</when>",
"<when test = 'query.beginCreateTime != null and query.endCreateTime != null '>",
"AND r.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}",
"</when>",
"<when test = 'query.feeType != null'>",
"AND r.`fee_type` = #{query.feeType}",
"</when>",
"<when test = 'query.customerId != null'>",
"AND o.`customer_id` = #{query.customerId}",
"</when>",
"<when test = 'query.containerNumber != null'>",
"AND o.`container_number` = #{query.containerNumber}",
"</when>",
"group by r.id",
"</script>"
})
IPage<ReceivableBackVO> receivablePage(@Param("mpPage") IPage<ReceivableBackVO> mpPage, @Param("query") ReceivableQueryVO query); IPage<ReceivableBackVO> receivablePage(@Param("mpPage") IPage<ReceivableBackVO> mpPage, @Param("query") ReceivableQueryVO query);
......
...@@ -162,7 +162,6 @@ public class FinanceReceiptApproveService { ...@@ -162,7 +162,6 @@ public class FinanceReceiptApproveService {
List orderIds = orderList.stream().map(ReceivableDO::getOrderId).distinct().collect(Collectors.toList()); List orderIds = orderList.stream().map(ReceivableDO::getOrderId).distinct().collect(Collectors.toList());
receivableService.orderReceivableWriteOffLogAdd(orderIds, receiptDO.getReceiptNo()); receivableService.orderReceivableWriteOffLogAdd(orderIds, receiptDO.getReceiptNo());
// TODO 更新核销误差兑额外费用主币种金额
} else if (result == BpmProcessInstanceResultEnum.REJECT.getResult()) { } else if (result == BpmProcessInstanceResultEnum.REJECT.getResult()) {
updateReceipt.setState(ReceiptStatusEnum.WRITE_OFF_PART_ING.getValue()); updateReceipt.setState(ReceiptStatusEnum.WRITE_OFF_PART_ING.getValue());
...@@ -270,7 +269,7 @@ public class FinanceReceiptApproveService { ...@@ -270,7 +269,7 @@ public class FinanceReceiptApproveService {
.baAccountName(receiptItemDO.getAccountName()) .baAccountName(receiptItemDO.getAccountName())
.baAccountNum(receiptItemDO.getAccountNo()) .baAccountNum(receiptItemDO.getAccountNo())
.baBankName(receiptItemDO.getAccountBankName()) .baBankName(receiptItemDO.getAccountBankName())
.baBalance(receiptItemDO.getAmount()).build(), true); .baBalance(receiptItemDO.getAmount()).build(), false);
} else if (result == BpmProcessInstanceResultEnum.REJECT.getResult()) { } else if (result == BpmProcessInstanceResultEnum.REJECT.getResult()) {
updateWrapper.set(ReceiptItemDO::getStatus, ReceiptItemStatusEnum.WRITE_OFF.getValue()); updateWrapper.set(ReceiptItemDO::getStatus, ReceiptItemStatusEnum.WRITE_OFF.getValue());
receiptItemMapper.update(null, updateWrapper); receiptItemMapper.update(null, updateWrapper);
......
...@@ -22,6 +22,8 @@ import cn.iocoder.yudao.module.ecw.api.bank.BankApi; ...@@ -22,6 +22,8 @@ import cn.iocoder.yudao.module.ecw.api.bank.BankApi;
import cn.iocoder.yudao.module.ecw.api.bank.dto.BankAccountDTO; import cn.iocoder.yudao.module.ecw.api.bank.dto.BankAccountDTO;
import cn.iocoder.yudao.module.ecw.api.currency.CurrencyApi; 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.CurrencyRespDTO;
import cn.iocoder.yudao.module.ecw.api.region.RegionApi;
import cn.iocoder.yudao.module.ecw.api.region.dto.RegionDTO;
import cn.iocoder.yudao.module.system.api.dict.DictDataApi; import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi; import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
...@@ -120,6 +122,8 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO ...@@ -120,6 +122,8 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
@Resource @Resource
@Lazy @Lazy
private OrderApi orderApi; private OrderApi orderApi;
@Resource
private RegionApi regionApi;
private static final String RECEIPT_NEW_NUMBER = "receipt:new:number"; private static final String RECEIPT_NEW_NUMBER = "receipt:new:number";
...@@ -875,13 +879,15 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO ...@@ -875,13 +879,15 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
if (null == currencyId) { if (null == currencyId) {
throw exception(RECEIPT_CURRENCY_NOT_EXISTS); throw exception(RECEIPT_CURRENCY_NOT_EXISTS);
} }
BigDecimal diff = null;
if (totalAmount.compareTo(receiptDO.getReceivableTotalAmount()) < 0) { if (totalAmount.compareTo(receiptDO.getReceivableTotalAmount()) < 0) {
DictDataRespDTO dictDataRespDTO = dictDataApi.parseDictDataFromCache("write_off_diff", String.valueOf(currencyId)); DictDataRespDTO dictDataRespDTO = dictDataApi.parseDictDataFromCache("write_off_diff", String.valueOf(currencyId));
if (null == dictDataRespDTO) { if (null == dictDataRespDTO) {
throw exception(RECEIPT_CURRENCY_DIFF_NOT_EXISTS); throw exception(RECEIPT_CURRENCY_DIFF_NOT_EXISTS);
} }
//核销差额大于配置提示 //核销差额大于配置提示
if (receiptDO.getReceivableTotalAmount().subtract(totalAmount).compareTo(new BigDecimal(dictDataRespDTO.getValue())) == 1) { diff = receiptDO.getReceivableTotalAmount().subtract(totalAmount);
if (diff.compareTo(new BigDecimal(dictDataRespDTO.getValue())) > 0) {
throw exception(RECEIPT_CURRENCY_DIFF_BIG); throw exception(RECEIPT_CURRENCY_DIFF_BIG);
} else { } else {
String message = "收款单已全部核销,总金额差值小于{}{},允许全部核销,核销比例应为100%"; String message = "收款单已全部核销,总金额差值小于{}{},允许全部核销,核销比例应为100%";
...@@ -914,6 +920,17 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO ...@@ -914,6 +920,17 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
update.setState(ReceiptStatusEnum.WRITE_OFF_ALL_ING.getValue()); update.setState(ReceiptStatusEnum.WRITE_OFF_ALL_ING.getValue());
update.setBmpId(bpmId); update.setBmpId(bpmId);
update.setFinanceRemark(financeRemark); update.setFinanceRemark(financeRemark);
// 更新核销误差兑额外费用主币种金额
List<ReceiptRelationOrderInfoVO> relationOrder = receiptMapper.getOrderInfoByReceiptId(receiptDO.getId());
OrderVO orderVO = receiptMapper.getContainerNumberByOrderId(relationOrder.get(0).getOrderId());
if (null != orderVO) {
RegionDTO region = regionApi.getRegionById(Long.parseLong(orderVO.getCountry()));
Long importCurrency3 = Long.parseLong(region.getImportCurrency3());
if (!currencyId.equals(importCurrency3)) {
diff = diff == null ? null : diff.multiply(currencyApi.getCurrencyRate(currencyId, importCurrency3).getCurrencyRate());
}
update.setWriteOffDiffMainCurrency(diff == null ? "0" : diff.setScale(2, RoundingMode.HALF_UP).toString());
}
receiptMapper.updateById(update); receiptMapper.updateById(update);
} }
......
...@@ -120,9 +120,6 @@ public interface ReceiptItemService extends IService<ReceiptItemDO> { ...@@ -120,9 +120,6 @@ public interface ReceiptItemService extends IService<ReceiptItemDO> {
*/ */
void cancelFinanceReceiptItemWriteOffNo(FinanceReceiptItemCancelVo financeReceiptItemVo); void cancelFinanceReceiptItemWriteOffNo(FinanceReceiptItemCancelVo financeReceiptItemVo);
BigDecimal getWriteOffAmountByReceiptId( Long receiptId);
List<ReceiptItemBatchRespVO> receiptItemImport(List<ReceiptItemBatchCreateReqVO> list, Boolean ignoreItem); List<ReceiptItemBatchRespVO> receiptItemImport(List<ReceiptItemBatchCreateReqVO> list, Boolean ignoreItem);
ReceiptItemBackVO getReceiptItemDetail(Long id); ReceiptItemBackVO getReceiptItemDetail(Long id);
......
...@@ -39,6 +39,9 @@ public class CommissionPayableQueryVO { ...@@ -39,6 +39,9 @@ public class CommissionPayableQueryVO {
@ApiModelProperty(value = "佣金费用类型(字典:commission_fee_type)") @ApiModelProperty(value = "佣金费用类型(字典:commission_fee_type)")
private Integer feeType; private Integer feeType;
@ApiModelProperty(value = "佣金费用类型")
private List<Integer> feeTypeList;
@ApiModelProperty(value = "金额") @ApiModelProperty(value = "金额")
private java.math.BigDecimal totalAmount; private java.math.BigDecimal totalAmount;
...@@ -60,6 +63,9 @@ public class CommissionPayableQueryVO { ...@@ -60,6 +63,9 @@ public class CommissionPayableQueryVO {
@ApiModelProperty(value = "收款状态(0未付款,1付款中,2已付款)") @ApiModelProperty(value = "收款状态(0未付款,1付款中,2已付款)")
private Integer state; private Integer state;
@ApiModelProperty(value = "收款状态(0未付款,1付款中,2已付款)")
private List<Integer> stateList;
@ApiModelProperty(value = "数据来源(pc端,mobile端)") @ApiModelProperty(value = "数据来源(pc端,mobile端)")
private String source; private String source;
...@@ -82,12 +88,18 @@ public class CommissionPayableQueryVO { ...@@ -82,12 +88,18 @@ public class CommissionPayableQueryVO {
@ApiModelProperty(value = "始发地仓库ID") @ApiModelProperty(value = "始发地仓库ID")
private Long startWarehouseId; private Long startWarehouseId;
@ApiModelProperty(value = "始发地仓库ID")
private List<Long> startWarehouseIdList;
@ApiModelProperty(value = "目的地仓库ID") @ApiModelProperty(value = "目的地仓库ID")
private Long destWarehouseId; private Long destWarehouseId;
@ApiModelProperty(value = "目的地仓库ID")
private List<Long> destWarehouseIdList;
@ApiModelProperty(value = "运输方式") @ApiModelProperty(value = "运输方式")
private Long transportId; private Long transportId;
@ApiModelProperty(value = "运输方式")
private List<Long> transportIdList;
@ApiModelProperty(value = "搜索关键字(包括:客户名称、手机号、客户编号)") @ApiModelProperty(value = "搜索关键字(包括:客户名称、手机号、客户编号)")
private String searchKey; private String searchKey;
......
...@@ -24,12 +24,18 @@ public class CommissionPaymentQueryVO { ...@@ -24,12 +24,18 @@ public class CommissionPaymentQueryVO {
@ApiModelProperty(value = "业务员") @ApiModelProperty(value = "业务员")
private Long salesmanId; private Long salesmanId;
@ApiModelProperty(value = "业务员id")
private List<Long> salesmanIdList;
@ApiModelProperty(value = "业务员名称") @ApiModelProperty(value = "业务员名称")
private String salesmanName; private String salesmanName;
@ApiModelProperty(value = "客户id") @ApiModelProperty(value = "客户id")
private Long customerId; private Long customerId;
@ApiModelProperty(value = "客户id集合")
private List<Long> customerIdList;
@ApiModelProperty(value = "客户名称") @ApiModelProperty(value = "客户名称")
private String customerName; private String customerName;
...@@ -57,12 +63,16 @@ public class CommissionPaymentQueryVO { ...@@ -57,12 +63,16 @@ public class CommissionPaymentQueryVO {
@ApiModelProperty(value = "发票状态(0未开票,1已开票)") @ApiModelProperty(value = "发票状态(0未开票,1已开票)")
private Integer invoiceStatus; private Integer invoiceStatus;
private List<Integer> invoiceStatusList;
@ApiModelProperty(value = "发票号") @ApiModelProperty(value = "发票号")
private String invoiceNumber; private String invoiceNumber;
@ApiModelProperty(value = "付款单状态(1待审核,2已审核待核销,3已核销)") @ApiModelProperty(value = "付款单状态(1待审核,2已审核待核销,3已核销)")
private Integer state; private Integer state;
private List<Integer> stateList;
@ApiModelProperty(value = "付款单添加人id") @ApiModelProperty(value = "付款单添加人id")
private Long paymentAddId; private Long paymentAddId;
......
...@@ -7,9 +7,9 @@ import lombok.Data; ...@@ -7,9 +7,9 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data @Data
@ApiModel("管理后台 - 应付款查询 VO") @ApiModel("管理后台 - 应付款查询 VO")
...@@ -38,6 +38,9 @@ public class PayableQueryVO { ...@@ -38,6 +38,9 @@ public class PayableQueryVO {
@ApiModelProperty(value = "费用类型(字典:payable_fee_type)") @ApiModelProperty(value = "费用类型(字典:payable_fee_type)")
private Long feeType; private Long feeType;
@ApiModelProperty(value = "费用类型(字典:payable_fee_type)")
private List<Long> feeTypeList;
@ApiModelProperty(value = "金额") @ApiModelProperty(value = "金额")
private java.math.BigDecimal totalAmount; private java.math.BigDecimal totalAmount;
...@@ -90,20 +93,30 @@ public class PayableQueryVO { ...@@ -90,20 +93,30 @@ public class PayableQueryVO {
@ApiModelProperty(value = "运输方式id") @ApiModelProperty(value = "运输方式id")
private String transportId; private String transportId;
@ApiModelProperty(value = "运输方式id")
private List<String> transportIdList;
@ExcelProperty("始发地ID") @ExcelProperty("始发地ID")
@ApiModelProperty(value = "始发地ID") @ApiModelProperty(value = "始发地ID")
private String departureId; private String departureId;
@ApiModelProperty(value = "始发地ID")
private List<String> departureIdList;
@ExcelProperty("目的地ID") @ExcelProperty("目的地ID")
@ApiModelProperty(value = "目的地ID") @ApiModelProperty(value = "目的地ID")
private String objectiveId; private String objectiveId;
@ApiModelProperty(value = "目的地ID")
private List<String> objectiveIdList;
@ApiModelProperty(value = "客户名称") @ApiModelProperty(value = "客户名称")
private String customerName; private String customerName;
/* @ApiModelProperty(value = "时间节点查询类型")
时间节点查询类型
*/
private int dateType; private int dateType;
@ApiModelProperty(value = "时间节点查询类型")
private List<Integer> dateTypeList;
} }
...@@ -24,12 +24,18 @@ public class PaymentQueryVO { ...@@ -24,12 +24,18 @@ public class PaymentQueryVO {
@ApiModelProperty(value = "业务员") @ApiModelProperty(value = "业务员")
private Long salesmanId; private Long salesmanId;
@ApiModelProperty(value = "业务员")
private List<Long> salesmanIdList;
@ApiModelProperty(value = "业务员名称") @ApiModelProperty(value = "业务员名称")
private String salesmanName; private String salesmanName;
@ApiModelProperty(value = "供应商id") @ApiModelProperty(value = "供应商id")
private Long supplierId; private Long supplierId;
@ApiModelProperty(value = "供应商id")
private List<Long> supplierIdList;
@ApiModelProperty(value = "供应商名称") @ApiModelProperty(value = "供应商名称")
private String supplierName; private String supplierName;
...@@ -53,12 +59,18 @@ public class PaymentQueryVO { ...@@ -53,12 +59,18 @@ public class PaymentQueryVO {
@ApiModelProperty(value = "发票状态(0未开票,1已开票)") @ApiModelProperty(value = "发票状态(0未开票,1已开票)")
private Integer invoiceStatus; private Integer invoiceStatus;
@ApiModelProperty(value = "发票状态(0未开票,1已开票)")
private List<Integer> invoiceStatusList;
@ApiModelProperty(value = "发票号") @ApiModelProperty(value = "发票号")
private String invoiceNumber; private String invoiceNumber;
@ApiModelProperty(value = "付款单状态(1待审核,2已审核待核销,3已核销)") @ApiModelProperty(value = "付款单状态(1待审核,2已审核待核销,3已核销)")
private Integer state; private Integer state;
@ApiModelProperty(value = "付款单状态(1待审核,2已审核待核销,3已核销)")
private List<Integer> stateList;
@ApiModelProperty(value = "付款单添加人id") @ApiModelProperty(value = "付款单添加人id")
private Long paymentAddId; private Long paymentAddId;
......
...@@ -180,4 +180,7 @@ public class ReceiptBackVO { ...@@ -180,4 +180,7 @@ public class ReceiptBackVO {
@ApiModelProperty(value = "实收日期") @ApiModelProperty(value = "实收日期")
private Date payedAt; private Date payedAt;
@ApiModelProperty(value = "核销误差兑额外费用主币种金额")
private String writeOffDiffMainCurrency;
} }
...@@ -27,12 +27,18 @@ public class ReceiptQueryVO { ...@@ -27,12 +27,18 @@ public class ReceiptQueryVO {
@ApiModelProperty(value = "业务员") @ApiModelProperty(value = "业务员")
private Long salesmanId; private Long salesmanId;
@ApiModelProperty(value = "业务员")
private List<Long> salesmanIdList;
@ApiModelProperty(value = "业务员名称") @ApiModelProperty(value = "业务员名称")
private String salesmanName; private String salesmanName;
@ApiModelProperty(value = "客户id") @ApiModelProperty(value = "客户id")
private Long customerId; private Long customerId;
@ApiModelProperty(value = "客户id")
private List<Long> customerIdList;
@ApiModelProperty(value = "客户名称") @ApiModelProperty(value = "客户名称")
private String customerName; private String customerName;
...@@ -121,6 +127,9 @@ public class ReceiptQueryVO { ...@@ -121,6 +127,9 @@ public class ReceiptQueryVO {
@ApiModelProperty(value = "状态: 1待核销,2 已核销,3已核销待开票,4已开票") @ApiModelProperty(value = "状态: 1待核销,2 已核销,3已核销待开票,4已开票")
private Integer state; private Integer state;
@ApiModelProperty(value = "状态: 1待核销,2 已核销,3已核销待开票,4已开票")
private List<Integer> stateList;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "核销时间") @ApiModelProperty(value = "核销时间")
private Date writeOffAt; private Date writeOffAt;
......
...@@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat; ...@@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; 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; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
...@@ -51,6 +52,9 @@ public class ReceivableQueryVO { ...@@ -51,6 +52,9 @@ public class ReceivableQueryVO {
@ApiModelProperty(value = "费用类型(字典 receivable_fee_type)") @ApiModelProperty(value = "费用类型(字典 receivable_fee_type)")
private Integer feeType; private Integer feeType;
@ApiModelProperty(value = "费用类型(字典 receivable_fee_type)")
private List<Integer> feeTypeList;
@ApiModelProperty(value = "汇率") @ApiModelProperty(value = "汇率")
private BigDecimal exchangeRate; private BigDecimal exchangeRate;
...@@ -95,24 +99,39 @@ public class ReceivableQueryVO { ...@@ -95,24 +99,39 @@ public class ReceivableQueryVO {
@ApiModelProperty(value = "运输方式id") @ApiModelProperty(value = "运输方式id")
private Integer transportId; private Integer transportId;
@ApiModelProperty(value = "运输方式id")
private List<Integer> transportIdList;
@ApiModelProperty(value = "是否控货") @ApiModelProperty(value = "是否控货")
private Boolean isCargoControl; private Boolean isCargoControl;
@ApiModelProperty(value = "报关类别:我司全代:1,自单代报:2,混合报关:3") @ApiModelProperty(value = "报关类别:我司全代:1,自单代报:2,混合报关:3")
private Integer customsType; private Integer customsType;
@ApiModelProperty(value = "报关类别:我司全代:1,自单代报:2,混合报关:3")
private List<Integer> customsTypeList;
@ApiModelProperty(value = "始发地id") @ApiModelProperty(value = "始发地id")
private Long departureId; private Long departureId;
@ApiModelProperty(value = "始发地id")
private List<Long> departureIdList;
@ApiModelProperty(value = "目的地id") @ApiModelProperty(value = "目的地id")
private Long objectiveId; private Long objectiveId;
@ApiModelProperty(value = "目的地id")
private List<Long> objectiveIdList;
@ApiModelProperty(value = "唛头") @ApiModelProperty(value = "唛头")
private String marks; private String marks;
@ApiModelProperty(value = "订单状态详情见字典:order_status") @ApiModelProperty(value = "订单状态详情见字典:order_status")
private Integer status; private Integer status;
@ApiModelProperty(value = "订单状态详情见字典:order_status")
private List<Integer> statusList;
@ApiModelProperty(value = "订单异常状态(字典 order_abnormal_state)") @ApiModelProperty(value = "订单异常状态(字典 order_abnormal_state)")
private Integer abnormalState; private Integer abnormalState;
......
...@@ -72,10 +72,10 @@ public class CommissionPayableController { ...@@ -72,10 +72,10 @@ public class CommissionPayableController {
return success(list); return success(list);
} }
@GetMapping("/page") @PostMapping("/page")
@ApiOperation("获得订单佣金应付款分页") @ApiOperation("获得订单佣金应付款分页")
// @PreAuthorize("@ss.hasPermission('ecw:commission-payable:query')") // @PreAuthorize("@ss.hasPermission('ecw:commission-payable:query')")
public CommonResult<PageResult<CommissionPayableBackVO>> getCommissionPayablePage(@Valid CommissionPayableQueryVO query, PageVO page) { public CommonResult<PageResult<CommissionPayableBackVO>> getCommissionPayablePage(@RequestBody @Valid CommissionPayableQueryVO query, PageVO page) {
PageResult<CommissionPayableBackVO> pageResult = commissionPayableService.getCommissionPayablePage(query, page); PageResult<CommissionPayableBackVO> pageResult = commissionPayableService.getCommissionPayablePage(query, page);
return success(pageResult); return success(pageResult);
} }
......
package cn.iocoder.yudao.module.wealth.controller.admin.commissionPayment; package cn.iocoder.yudao.module.wealth.controller.admin.commissionPayment;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO; import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.wealth.convert.paymentApproval.PaymentApprovalConvert; import cn.iocoder.yudao.module.wealth.convert.paymentApproval.PaymentApprovalConvert;
import cn.iocoder.yudao.module.wealth.dal.dataobject.paymentApproval.PaymentApprovalDO; import cn.iocoder.yudao.module.wealth.dal.dataobject.paymentApproval.PaymentApprovalDO;
import cn.iocoder.yudao.module.wealth.service.commissionPayment.CommissionPaymentService;
import cn.iocoder.yudao.module.wealth.service.paymentApproval.PaymentApprovalService; import cn.iocoder.yudao.module.wealth.service.paymentApproval.PaymentApprovalService;
import cn.iocoder.yudao.module.wealth.vo.commissionPayment.CommissionPaymentBackVO;
import cn.iocoder.yudao.module.wealth.vo.commissionPayment.CommissionPaymentCreateReqVO;
import cn.iocoder.yudao.module.wealth.vo.commissionPayment.CommissionPaymentQueryVO;
import cn.iocoder.yudao.module.wealth.vo.commissionPayment.CommissionPaymentUpdateReqVO;
import cn.iocoder.yudao.module.wealth.vo.payment.FinancePaymentCancelVo; import cn.iocoder.yudao.module.wealth.vo.payment.FinancePaymentCancelVo;
import cn.iocoder.yudao.module.wealth.vo.payment.FinancePaymentVo; import cn.iocoder.yudao.module.wealth.vo.payment.FinancePaymentVo;
import cn.iocoder.yudao.module.wealth.vo.paymentApproval.PaymentApprovalBackVO; import cn.iocoder.yudao.module.wealth.vo.paymentApproval.PaymentApprovalBackVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize; import java.util.List;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.wealth.vo.commissionPayment.*;
import cn.iocoder.yudao.module.wealth.dal.dataobject.commissionPayment.CommissionPaymentDO;
import cn.iocoder.yudao.module.wealth.convert.commissionPayment.CommissionPaymentConvert;
import cn.iocoder.yudao.module.wealth.service.commissionPayment.CommissionPaymentService;
@Validated @Validated
@RestController @RestController
...@@ -82,10 +80,10 @@ public class CommissionPaymentController { ...@@ -82,10 +80,10 @@ public class CommissionPaymentController {
return success(list); return success(list);
} }
@GetMapping("/page") @PostMapping("/page")
@ApiOperation("获得佣金付款单分页") @ApiOperation("获得佣金付款单分页")
// @PreAuthorize("@ss.hasPermission('ecw:commission-payment:query')") // @PreAuthorize("@ss.hasPermission('ecw:commission-payment:query')")
public CommonResult<PageResult<CommissionPaymentBackVO>> getCommissionPaymentPage(@Valid CommissionPaymentQueryVO query, PageVO page) { public CommonResult<PageResult<CommissionPaymentBackVO>> getCommissionPaymentPage(@RequestBody @Valid CommissionPaymentQueryVO query, PageVO page) {
PageResult<CommissionPaymentBackVO> pageResult = commissionPaymentService.getCommissionPaymentPage(query, page); PageResult<CommissionPaymentBackVO> pageResult = commissionPaymentService.getCommissionPaymentPage(query, page);
return success(pageResult); return success(pageResult);
} }
......
...@@ -75,10 +75,10 @@ public class PayableController { ...@@ -75,10 +75,10 @@ public class PayableController {
return success(PayableConvert.INSTANCE.convertList(list)); return success(PayableConvert.INSTANCE.convertList(list));
} }
@GetMapping("/page") @PostMapping("/page")
@ApiOperation("应付款分页列表,添加供应商未付款项列表 两个用这一个查询") @ApiOperation("应付款分页列表,添加供应商未付款项列表 两个用这一个查询")
//@PreAuthorize("@ss.hasPermission('ecw:payable:query')") //@PreAuthorize("@ss.hasPermission('ecw:payable:query')")
public CommonResult<PageResult<PayableOrderBackVo>> getPayablePage(@Valid PayableQueryVO query, PageVO page) { public CommonResult<PageResult<PayableOrderBackVo>> getPayablePage(@RequestBody @Valid PayableQueryVO query, PageVO page) {
PageResult<PayableOrderBackVo> result = payableService.getPayablePage(query, page); PageResult<PayableOrderBackVo> result = payableService.getPayablePage(query, page);
return success(result); return success(result);
} }
......
...@@ -124,10 +124,10 @@ public class PaymentController { ...@@ -124,10 +124,10 @@ public class PaymentController {
} }
@GetMapping("/page") @PostMapping("/page")
@ApiOperation("获得付款单分页") @ApiOperation("获得付款单分页")
//@PreAuthorize("@ss.hasPermission('ecw:payment:query')") //@PreAuthorize("@ss.hasPermission('ecw:payment:query')")
public CommonResult<PageResult<PaymentBackVO>> getPaymentPage(@Valid PaymentQueryVO query, PageVO page) { public CommonResult<PageResult<PaymentBackVO>> getPaymentPage(@RequestBody @Valid PaymentQueryVO query, PageVO page) {
PageResult<PaymentDO> pageResult = paymentService.getPaymentPage(query, page); PageResult<PaymentDO> pageResult = paymentService.getPaymentPage(query, page);
return success(PaymentConvert.INSTANCE.convertPage(pageResult)); return success(PaymentConvert.INSTANCE.convertPage(pageResult));
} }
......
...@@ -36,17 +36,17 @@ public class ReceivableController { ...@@ -36,17 +36,17 @@ public class ReceivableController {
private ReceivableDiscountMapper receivableDiscountMapper; private ReceivableDiscountMapper receivableDiscountMapper;
@GetMapping("/page") @PostMapping("/page")
@ApiOperation("应收款分页列表") @ApiOperation("应收款分页列表")
//@PreAuthorize("@ss.hasPermission('ecw:receivable:query')") //@PreAuthorize("@ss.hasPermission('ecw:receivable:query')")
public CommonResult<PageResult<ReceivableBackVO>> getReceivablePage(@Valid ReceivableQueryVO query, PageVO page) { public CommonResult<PageResult<ReceivableBackVO>> getReceivablePage(@RequestBody @Valid ReceivableQueryVO query, PageVO page) {
PageResult<ReceivableBackVO> pageResult = receivableService.receivablePage(query, page); PageResult<ReceivableBackVO> pageResult = receivableService.receivablePage(query, page);
return success(pageResult); return success(pageResult);
} }
@GetMapping("/page/amount") @PostMapping("/page/amount")
@ApiOperation("应收款分页条件总金额合计") @ApiOperation("应收款分页条件总金额合计")
public CommonResult<List<WealthMoneyAmountVO>> getReceivablePage(@Valid ReceivableQueryVO query) { public CommonResult<List<WealthMoneyAmountVO>> getReceivablePage(@RequestBody @Valid ReceivableQueryVO query) {
List<WealthMoneyAmountVO> pageAmount = receivableService.receivablePageAmount(query); List<WealthMoneyAmountVO> pageAmount = receivableService.receivablePageAmount(query);
return success(pageAmount); return success(pageAmount);
} }
......
...@@ -17,9 +17,21 @@ ...@@ -17,9 +17,21 @@
<if test="query.state != null"> <if test="query.state != null">
AND cp.state = #{query.state} AND cp.state = #{query.state}
</if> </if>
<if test="query.stateList != null and query.stateList.size() > 1">
AND cp.`state` IN
<foreach collection="query.stateList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="query.invoiceStatus != null"> <if test="query.invoiceStatus != null">
AND cp.invoice_status = #{query.invoiceStatus} AND cp.invoice_status = #{query.invoiceStatus}
</if> </if>
<if test="query.invoiceStatusList != null and query.invoiceStatusList.size() > 1">
AND cp.`invoice_status` IN
<foreach collection="query.invoiceStatusList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="query.invoiceNumber != null and query.invoiceNumber != ''"> <if test="query.invoiceNumber != null and query.invoiceNumber != ''">
AND cp.invoice_number LIKE concat('%',#{query.invoiceNumber},'%') AND cp.invoice_number LIKE concat('%',#{query.invoiceNumber},'%')
</if> </if>
...@@ -33,7 +45,14 @@ ...@@ -33,7 +45,14 @@
AND cp.customer_name LIKE concat('%',#{query.customerName},'%') AND cp.customer_name LIKE concat('%',#{query.customerName},'%')
</if> </if>
<if test="query.salesmanId != null"> <if test="query.salesmanId != null">
AND (cp.`salesman_id` = #{query.salesmanId} or cp.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} )) AND (cp.`salesman_id` = #{query.salesmanId} or cp.`customer_id` in(select cus.id from ecw_customer cus where
cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))
</if>
<if test="query.salesmanIdList != null and query.salesmanIdList.size() > 1">
AND cp.`salesman_id` IN
<foreach collection="query.salesmanIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if> </if>
<if test="query.salesmanName != null and query.salesmanName != ''"> <if test="query.salesmanName != null and query.salesmanName != ''">
AND cp.salesman_name LIKE concat('%',#{query.salesmanName},'%') AND cp.salesman_name LIKE concat('%',#{query.salesmanName},'%')
...@@ -47,7 +66,7 @@ ...@@ -47,7 +66,7 @@
<if test="query.paymentNo != null and query.paymentNo !=''"> <if test="query.paymentNo != null and query.paymentNo !=''">
AND cp.payment_no LIKE concat('%',#{query.paymentNo},'%') AND cp.payment_no LIKE concat('%',#{query.paymentNo},'%')
</if> </if>
<if test = "query.beginCreateTime != null and query.endCreateTime != null "> <if test="query.beginCreateTime != null and query.endCreateTime != null ">
AND cp.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime} AND cp.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}
</if> </if>
<if test="query.ids != null "> <if test="query.ids != null ">
......
...@@ -116,16 +116,34 @@ ...@@ -116,16 +116,34 @@
<if test="query.customerId != null"> <if test="query.customerId != null">
AND er.`customer_id` = #{query.customerId} AND er.`customer_id` = #{query.customerId}
</if> </if>
<if test="query.customerIdList != null and query.customerIdList.size() > 1">
AND er.`customer_id` IN
<foreach collection="query.customerIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="query.customerName != null"> <if test="query.customerName != null">
AND er.`customer_name` = #{query.customerName} AND er.`customer_name` = #{query.customerName}
</if> </if>
<if test="query.state != null"> <if test="query.state != null">
AND er.`state` = #{query.state} AND er.`state` = #{query.state}
</if> </if>
<if test="query.stateList != null and query.stateList.size() > 1">
AND er.`state` IN
<foreach collection="query.stateList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="query.salesmanId != null"> <if test="query.salesmanId != null">
AND (er.`salesman_id` = #{query.salesmanId} or er.`customer_id` in(select cus.id from ecw_customer cus where AND (er.`salesman_id` = #{query.salesmanId} or er.`customer_id` in(select cus.id from ecw_customer cus where
cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} )) cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))
</if> </if>
<if test="query.salesmanIdList != null and query.salesmanIdList.size() > 1">
AND er.`salesman_id` IN
<foreach collection="query.salesmanIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="query.salesmanName != null"> <if test="query.salesmanName != null">
AND er.`salesman_name` = #{query.salesmanName} AND er.`salesman_name` = #{query.salesmanName}
</if> </if>
......
...@@ -589,4 +589,121 @@ ...@@ -589,4 +589,121 @@
#{item} #{item}
</foreach> </foreach>
</select> </select>
<select id="receivablePage" resultType="cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableBackVO">
SELECT r.*,
o.marks,
o.`status`,
o.abnormal_state,
o.in_warehouse_state,
o.shipment_state,
o.pick_state,
o.to_warehouse_state,
o.tidan_no,
o.container_number AS container_number,
nor.name AS consignor_name,
nor.phone AS consignor_phone,
nor.customer_id AS consignor_id,
nee.name AS consignee_name,
nee.customer_id AS consignee_id,
nee.phone AS consignee_phone
FROM ecw_receivable r
LEFT JOIN ecw_order o ON o.order_id = r.order_id
LEFT JOIN ecw_warehouse_line de ON o.line_id = de.id
LEFT JOIN ecw_order_consignor nor ON nor.order_id = o.order_id
LEFT JOIN ecw_order_consignee nee ON nee.order_id = o.order_id
WHERE r.deleted = 0
AND r.receipt_id IS NULL
<if test="query.status != null">
AND o.`status` = #{query.status}
</if>
<if test="query.statusList != null and query.statusList.size() > 0">
AND o.`status` IN
<foreach collection="query.statusList" item="status" open="(" separator="," close=")">
#{status}
</foreach>
</if>
<if test="query.isCargoControl != null">
AND (o.`is_cargo_control` = #{query.isCargoControl}
OR o.`is_cargo_control` = #{query.isCargoControl})
</if>
<if test="query.customsType != null">
AND o.`customs_type` = #{query.customsType}
</if>
<if test="query.customsTypeList != null and query.customsTypeList.size() > 0">
AND o.`customs_type` IN
<foreach collection="query.customsTypeList" item="status" open="(" separator="," close=")">
#{status}
</foreach>
</if>
<if test="query.transportId != null">
AND o.`transport_id` = #{query.transportId}
</if>
<if test="query.transportIdList != null and query.transportIdList.size() > 0">
AND o.`transport_id` IN
<foreach collection="query.transportIdList" item="status" open="(" separator="," close=")">
#{status}
</foreach>
</if>
<if test="query.marks != null and query.marks != ''">
AND o.`marks` LIKE CONCAT('%', #{query.marks}, '%')
</if>
<if test="query.departureId != null">
AND de.`start_warehouse_id` = #{query.departureId}
</if>
<if test="query.departureIdList != null and query.departureIdList.size() > 0">
AND de.`start_warehouse_id` IN
<foreach collection="query.departureIdList" item="status" open="(" separator="," close=")">
#{status}
</foreach>
</if>
<if test="query.objectiveId != null">
AND de.`dest_warehouse_id` = #{query.objectiveId}
</if>
<if test="query.objectiveIdList != null and query.objectiveIdList.size() > 0">
AND de.`dest_warehouse_id` IN
<foreach collection="query.objectiveIdList" item="status" open="(" separator="," close=")">
#{status}
</foreach>
</if>
<if test="query.title != null and query.title != ''">
AND CONCAT(r.`title_zh`, r.`title_en`) LIKE CONCAT('%', #{query.title}, '%')
</if>
<if test="query.consignorNameOrPhone != null and query.consignorNameOrPhone != ''">
AND CONCAT(nor.`name`, nor.`phone`, nor.`company`) LIKE CONCAT('%', #{query.consignorNameOrPhone}, '%')
</if>
<if test="query.consigneeNameOrPhone != null and query.consigneeNameOrPhone != ''">
AND CONCAT(nee.`name`, nee.`phone`, nee.`company`) LIKE CONCAT('%', #{query.consigneeNameOrPhone}, '%')
</if>
<if test="query.orderNo != null and query.orderNo != ''">
AND r.`order_no` LIKE CONCAT('%', #{query.orderNo}, '%')
</if>
<if test="query.tidanNo != null and query.tidanNo != ''">
AND o.`tidan_no` LIKE CONCAT('%', #{query.tidanNo}, '%')
</if>
<if test="query.receiptNo != null and query.receiptNo != ''">
AND r.`receipt_no` LIKE CONCAT('%', #{query.receiptNo}, '%')
</if>
<if test="query.state != null">
AND r.`state` = #{query.state}
</if>
<if test="query.beginCreateTime != null and query.endCreateTime != null">
AND r.`create_time` BETWEEN #{query.beginCreateTime} AND #{query.endCreateTime}
</if>
<if test="query.feeType != null">
AND r.`fee_type` = #{query.feeType}
</if>
<if test="query.feeTypeList != null and query.feeTypeList.size() > 0">
AND r.`fee_type` IN
<foreach collection="query.feeTypeList" item="status" open="(" separator="," close=")">
#{status}
</foreach>
</if>
<if test="query.customerId != null">
AND o.`customer_id` = #{query.customerId}
</if>
<if test="query.containerNumber != null">
AND o.`container_number` = #{query.containerNumber}
</if>
GROUP BY r.id
</select>
</mapper> </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