Commit b6f7593a authored by zhangfeng's avatar zhangfeng

feat(wealth): 优化

parent 7bc11d44
...@@ -55,6 +55,10 @@ INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id ...@@ -55,6 +55,10 @@ INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id
INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('开票管理', '', 2, 2, 1624, 'invoiceManagement', 'order', 'ecw/financial/invoiceManagement', 0, '1', '2024-12-24 18:13:46', '1', '2024-12-24 18:13:46', b'0', b'1', 'invoiceManagement', b'0', NULL, NULL); INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('开票管理', '', 2, 2, 1624, 'invoiceManagement', 'order', 'ecw/financial/invoiceManagement', 0, '1', '2024-12-24 18:13:46', '1', '2024-12-24 18:13:46', b'0', b'1', 'invoiceManagement', b'0', NULL, NULL);
INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('收款数据审批列表', '', 2, 2, 1624, 'collectionApprovalList', 'clipboard', 'ecw/financial/collectionApprovalList', 0, '1', '2025-01-03 08:58:08', '1', '2025-01-03 08:58:08', b'0', b'1', 'collectionApprovalList', b'0', NULL, NULL); INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('收款数据审批列表', '', 2, 2, 1624, 'collectionApprovalList', 'clipboard', 'ecw/financial/collectionApprovalList', 0, '1', '2025-01-03 08:58:08', '1', '2025-01-03 08:58:08', b'0', b'1', 'collectionApprovalList', b'0', NULL, NULL);
INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('审批', 'ecw:collectionApprovalList:update', 3, 1, 2388, '', '', '', 0, '1', '2025-01-03 16:59:36', '1', '2025-01-03 16:59:36', b'0', b'1', 'approve', b'0', NULL, NULL); INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('审批', 'ecw:collectionApprovalList:update', 3, 1, 2388, '', '', '', 0, '1', '2025-01-03 16:59:36', '1', '2025-01-03 16:59:36', b'0', b'1', 'approve', b'0', NULL, NULL);
INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('批量生成收款单', '', 2, 12, 1624, 'batchGenerateReceipt/:id', 'button', 'ecw/financial/batchGenerateReceipt', 0, '2696', '2025-01-08 09:57:18', '2696', '2025-01-09 10:53:46', b'0', b'0', 'batchGenerateReceipt', b'0', NULL, NULL);
INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('批量生成收款单列表', '', 2, 7, 1624, 'batchGenerateReceiptList', 'component', 'ecw/financial/batchGenerateReceiptList', 0, '2696', '2025-01-08 09:58:54', '2696', '2025-01-08 09:58:54', b'0', b'1', 'batchGenerateReceiptList', b'0', NULL, NULL);
INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('银行收支明细', '', 2, 1, 1624, 'bankBalanceDetails', 'dashboard', 'ecw/financial/bankBalanceDetails', 0, '2696', '2025-01-09 13:44:20', '2696', '2025-01-09 13:50:15', b'0', b'1', 'bank Balance Details', b'0', NULL, NULL);
INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('单个订单费用明细', '', 2, 4, 1624, 'orderItemCostDetails/:id/:drawee', 'theme', 'ecw/financial/orderItemCostDetails', 0, '2696', '2025-01-09 15:30:19', '2696', '2025-01-13 10:17:48', b'0', b'0', 'orderItemCostDetails', b'0', NULL, NULL);
UPDATE `system_menu` SET `name` = '银行账户', `permission` = '', `menu_type` = 2, `sort` = 9, `parent_id` = 1624, `path` = 'bank-account', `icon` = 'lock', `component` = 'ecw/bankAccount/index', `status` = 0, `creator` = '', `create_time` = '2022-05-09 11:40:51', `updater` = '1', `update_time` = '2024-12-20 13:36:45', `deleted` = b'0', `is_show_in_menu_bar` = b'1', `name_en` = 'Bank account management', `keepalive` = b'0', `redirect` = NULL, `badge_field` = NULL WHERE `id` = 1269; UPDATE `system_menu` SET `name` = '银行账户', `permission` = '', `menu_type` = 2, `sort` = 9, `parent_id` = 1624, `path` = 'bank-account', `icon` = 'lock', `component` = 'ecw/bankAccount/index', `status` = 0, `creator` = '', `create_time` = '2022-05-09 11:40:51', `updater` = '1', `update_time` = '2024-12-20 13:36:45', `deleted` = b'0', `is_show_in_menu_bar` = b'1', `name_en` = 'Bank account management', `keepalive` = b'0', `redirect` = NULL, `badge_field` = NULL WHERE `id` = 1269;
......
...@@ -42,7 +42,7 @@ public class InternalMessageCreateDto { ...@@ -42,7 +42,7 @@ public class InternalMessageCreateDto {
@ApiModelProperty(value = "内容法文") @ApiModelProperty(value = "内容法文")
private String contentFr; private String contentFr;
@ApiModelProperty(value = "1订单消息,2出货消息,3提醒消息") @ApiModelProperty(value = "1订单消息,2出货消息,3提醒消息,4开票资料消息,5开票消息")
private Integer type; private Integer type;
} }
package cn.iocoder.boot.module.order.api; package cn.iocoder.boot.module.order.api;
import cn.iocoder.boot.module.order.api.dto.OrderCustomerInfoDTO;
import cn.iocoder.boot.module.order.api.dto.OrderItemRespDTO; import cn.iocoder.boot.module.order.api.dto.OrderItemRespDTO;
import cn.iocoder.boot.module.order.api.dto.OrderOperateLogDTO; import cn.iocoder.boot.module.order.api.dto.OrderOperateLogDTO;
import cn.iocoder.boot.module.order.api.dto.OrderRespDTO; import cn.iocoder.boot.module.order.api.dto.OrderRespDTO;
...@@ -46,4 +47,9 @@ public interface OrderApi { ...@@ -46,4 +47,9 @@ public interface OrderApi {
* 根据订单号获取目的国 * 根据订单号获取目的国
*/ */
Long getDestCountryByOrderId(Long orderId); Long getDestCountryByOrderId(Long orderId);
/**
* 创建收款单获取客户id
*/
OrderCustomerInfoDTO createReceiptGetOrderCustomerInfo(Long orderId);
} }
package cn.iocoder.boot.module.order.api.dto;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class OrderCustomerInfoDTO {
private Long customerId;
private String customerName;
}
...@@ -11,13 +11,14 @@ import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignee.OrderConsigne ...@@ -11,13 +11,14 @@ import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignee.OrderConsigne
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignor.OrderConsignorDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignor.OrderConsignorDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderObjective.OrderObjectiveDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderObjective.OrderObjectiveDO;
import cn.iocoder.yudao.module.order.dal.mysql.order.OrderMapper; import cn.iocoder.yudao.module.order.dto.OrderBackInfoDto;
import cn.iocoder.yudao.module.order.service.order.*; import cn.iocoder.yudao.module.order.service.order.*;
import cn.iocoder.yudao.module.order.service.order.impl.OrderItemServiceImpl; import cn.iocoder.yudao.module.order.service.order.impl.OrderItemServiceImpl;
import cn.iocoder.yudao.module.order.service.orderOperateLog.OrderOperateLogService; import cn.iocoder.yudao.module.order.service.orderOperateLog.OrderOperateLogService;
import cn.iocoder.yudao.module.order.vo.orderOperateLog.OrderOperateLogCreateReqVO; import cn.iocoder.yudao.module.order.vo.orderOperateLog.OrderOperateLogCreateReqVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -32,6 +33,7 @@ import java.util.stream.Collectors; ...@@ -32,6 +33,7 @@ import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.ORDER_IS_APPROVAL_IN_PROCESS_WITH_ORDERNOS; import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.ORDER_IS_APPROVAL_IN_PROCESS_WITH_ORDERNOS;
@Slf4j
@Service @Service
@Validated @Validated
public class OrderApiImpl implements OrderApi { public class OrderApiImpl implements OrderApi {
...@@ -51,6 +53,8 @@ public class OrderApiImpl implements OrderApi { ...@@ -51,6 +53,8 @@ public class OrderApiImpl implements OrderApi {
private OrderConsignorService orderConsignorService; private OrderConsignorService orderConsignorService;
@Resource @Resource
private OrderOperateLogService orderOperateLogService; private OrderOperateLogService orderOperateLogService;
@Resource
private OrderQueryService orderQueryService;
@Override @Override
public OrderRespDTO getOrder(Long id, String orderNo) { public OrderRespDTO getOrder(Long id, String orderNo) {
...@@ -199,4 +203,30 @@ public class OrderApiImpl implements OrderApi { ...@@ -199,4 +203,30 @@ public class OrderApiImpl implements OrderApi {
OrderObjectiveDO orderObjectiveDO = objectiveService.getByOrderId(orderId); OrderObjectiveDO orderObjectiveDO = objectiveService.getByOrderId(orderId);
return orderObjectiveDO == null ? null : orderObjectiveDO.getObjectiveCountryId(); return orderObjectiveDO == null ? null : orderObjectiveDO.getObjectiveCountryId();
} }
@Override
public OrderCustomerInfoDTO createReceiptGetOrderCustomerInfo(Long orderId) {
OrderBackInfoDto info = orderQueryService.info(orderId);
if (info == null) {
return null;
}
Long customerId = null;
if (info.getCustomerId() != null) {
customerId = info.getCustomerId();
}
if (info.getDrawee() == 1) {
customerId = info.getConsignorVO().getCustomerId();
}
if (info.getDrawee() == 2) {
customerId = info.getConsigneeVO().getCustomerId();
}
CustomerDO customer = customerService.getCustomer(customerId);
if (customer != null) {
return OrderCustomerInfoDTO.builder()
.customerId(customer.getId())
.customerName(customer.getName())
.build();
}
return null;
}
} }
...@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param; ...@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType; import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -91,4 +92,6 @@ public interface ReceiptMapper extends AbstractMapper<ReceiptDO> { ...@@ -91,4 +92,6 @@ public interface ReceiptMapper extends AbstractMapper<ReceiptDO> {
List<ReceiptRelationOrderInfoVO> getOrderInfoByReceiptId(Long id); List<ReceiptRelationOrderInfoVO> getOrderInfoByReceiptId(Long id);
void updateReceiptNewFieldBatch(List<ReceiptDO> receiptDOS); void updateReceiptNewFieldBatch(List<ReceiptDO> receiptDOS);
Date getReceiptItemPayat(Long id);
} }
...@@ -168,6 +168,7 @@ public interface ReceivableMapper extends AbstractMapper<ReceivableDO> { ...@@ -168,6 +168,7 @@ public interface ReceivableMapper extends AbstractMapper<ReceivableDO> {
"<when test = 'query.containerNumber != null'>", "<when test = 'query.containerNumber != null'>",
"AND o.`container_number` = #{query.containerNumber}", "AND o.`container_number` = #{query.containerNumber}",
"</when>", "</when>",
"group by r.id",
"</script>" "</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);
...@@ -423,4 +424,8 @@ public interface ReceivableMapper extends AbstractMapper<ReceivableDO> { ...@@ -423,4 +424,8 @@ public interface ReceivableMapper extends AbstractMapper<ReceivableDO> {
int countBatchGenReceiptPage(@Param("query") BatchGenReceiptPageQueryVO query); int countBatchGenReceiptPage(@Param("query") BatchGenReceiptPageQueryVO query);
List<CurrencyAmount> calculateReceivableAmountByOrderId(Long orderId); List<CurrencyAmount> calculateReceivableAmountByOrderId(Long orderId);
IPage<BatchGenReceiptReceivablePageVO> batchGenReceiptReceivablePage(IPage<BatchGenReceiptReceivablePageVO> mpPage, @Param("query") BatchGenReceiptReceivablePageQueryVO query);
List<CurrencyAmount> batchGenReceiptReceivablAmount(@Param("query") BatchGenReceiptReceivablePageQueryVO query);
} }
\ No newline at end of file
...@@ -16,13 +16,15 @@ import org.springframework.stereotype.Component; ...@@ -16,13 +16,15 @@ import org.springframework.stereotype.Component;
public class ReceiptItemWriteOffListener { public class ReceiptItemWriteOffListener {
private final ReceiptItemService receiptItemService; private final ReceiptItemService receiptItemService;
/** /**
* 银行收款明细审核通过更新应收核销金额 * 银行收款明细审核通过更新应收核销金额
*
* @param event 编号记录 * @param event 编号记录
*/ */
@EventListener(ReceiptItemWriteOffEvent.class) @EventListener(ReceiptItemWriteOffEvent.class)
@Async @Async
public void onReceiptItemWriteOff(ReceiptItemWriteOffEvent event) { public void onReceiptItemWriteOff(ReceiptItemWriteOffEvent event) {
receiptItemService.verification(event.getId(), event.getBpmResult()); receiptItemService.verification(event.getId(), event.getBpmResult(), event.getComment());
} }
} }
...@@ -18,4 +18,8 @@ public class ReceiptItemWriteOffEvent { ...@@ -18,4 +18,8 @@ public class ReceiptItemWriteOffEvent {
* 审核结果 * 审核结果
*/ */
private Integer bpmResult; private Integer bpmResult;
/**
* 备注
*/
private String comment;
} }
...@@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableWriteO ...@@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableWriteO
import cn.iocoder.yudao.module.wealth.dal.mysql.receipt.ReceiptMapper; 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.dal.mysql.receiptItem.ReceiptItemMapper;
import cn.iocoder.yudao.module.wealth.enums.ReceiptItemStatusEnum; import cn.iocoder.yudao.module.wealth.enums.ReceiptItemStatusEnum;
import cn.iocoder.yudao.module.wealth.enums.ReceiptLinkEnum;
import cn.iocoder.yudao.module.wealth.enums.ReceiptStatusEnum; import cn.iocoder.yudao.module.wealth.enums.ReceiptStatusEnum;
import cn.iocoder.yudao.module.wealth.listener.event.ReceiptItemWriteOffEvent; import cn.iocoder.yudao.module.wealth.listener.event.ReceiptItemWriteOffEvent;
import cn.iocoder.yudao.module.wealth.service.receipt.ReceiptService; import cn.iocoder.yudao.module.wealth.service.receipt.ReceiptService;
...@@ -97,7 +98,7 @@ public class FinanceReceiptApproveService { ...@@ -97,7 +98,7 @@ public class FinanceReceiptApproveService {
} }
updateReceipt.setComment(comment); updateReceipt.setComment(comment);
receiptMapper.updateById(updateReceipt); receiptMapper.updateById(updateReceipt);
receiptService.recordLog(receiptDO.getId(), ReceiptLinkEnum.APPROVE_RECEIPT, comment, WorkFlowEmus.FINANCE_RECEIPT_APPROVE.getValue());
} else if (StrUtil.equals(WorkFlowEmus.FINANCE_RECEIPT_APPROVE_NO.getKey(), bmpKey)) { } else if (StrUtil.equals(WorkFlowEmus.FINANCE_RECEIPT_APPROVE_NO.getKey(), bmpKey)) {
//收款单反审核 //收款单反审核
if (null == receiptApprovalDO.getReceiptId()) { if (null == receiptApprovalDO.getReceiptId()) {
...@@ -121,6 +122,7 @@ public class FinanceReceiptApproveService { ...@@ -121,6 +122,7 @@ public class FinanceReceiptApproveService {
} }
updateReceipt.setComment(comment); updateReceipt.setComment(comment);
receiptMapper.updateById(updateReceipt); receiptMapper.updateById(updateReceipt);
receiptService.recordLog(receiptDO.getId(), ReceiptLinkEnum.REJECT_RECEIPT, comment, WorkFlowEmus.FINANCE_RECEIPT_APPROVE_NO.getValue());
} else if (StrUtil.equals(WorkFlowEmus.FINANCE_RECEIPT_WRITE_OFF.getKey(), bmpKey)) { } else if (StrUtil.equals(WorkFlowEmus.FINANCE_RECEIPT_WRITE_OFF.getKey(), bmpKey)) {
//收款单核销审核 //收款单核销审核
if (null == receiptApprovalDO.getReceiptId()) { if (null == receiptApprovalDO.getReceiptId()) {
...@@ -163,6 +165,7 @@ public class FinanceReceiptApproveService { ...@@ -163,6 +165,7 @@ public class FinanceReceiptApproveService {
updateReceipt.setPayedAt(new Date()); updateReceipt.setPayedAt(new Date());
updateReceipt.setComment(comment); updateReceipt.setComment(comment);
receiptMapper.updateById(updateReceipt); receiptMapper.updateById(updateReceipt);
receiptService.recordLog(receiptDO.getId(), ReceiptLinkEnum.WRITE_OFF_RECEIPT, comment, WorkFlowEmus.FINANCE_RECEIPT_WRITE_OFF.getValue());
} else if (StrUtil.equals(WorkFlowEmus.FINANCE_RECEIPT_WRITE_OFF_NO.getKey(), bmpKey)) { } else if (StrUtil.equals(WorkFlowEmus.FINANCE_RECEIPT_WRITE_OFF_NO.getKey(), bmpKey)) {
//收款单核销反审核 //收款单核销反审核
if (null == receiptApprovalDO.getReceiptId()) { if (null == receiptApprovalDO.getReceiptId()) {
...@@ -208,6 +211,7 @@ public class FinanceReceiptApproveService { ...@@ -208,6 +211,7 @@ public class FinanceReceiptApproveService {
} }
updateReceipt.setComment(comment); updateReceipt.setComment(comment);
receiptMapper.updateById(updateReceipt); receiptMapper.updateById(updateReceipt);
receiptService.recordLog(receiptDO.getId(), ReceiptLinkEnum.REJECT_WRITE_OFF_RECEIPT, comment, WorkFlowEmus.FINANCE_RECEIPT_WRITE_OFF_NO.getValue());
} else if (StrUtil.equals(WorkFlowEmus.FINANCE_RECEIPT_ITEM_WRITE_OFF.getKey(), bmpKey)) { } else if (StrUtil.equals(WorkFlowEmus.FINANCE_RECEIPT_ITEM_WRITE_OFF.getKey(), bmpKey)) {
//收款单明细核销审核 //收款单明细核销审核
//if (null == receiptApprovalDO.getReceiptItemId()) { //if (null == receiptApprovalDO.getReceiptItemId()) {
...@@ -244,7 +248,7 @@ public class FinanceReceiptApproveService { ...@@ -244,7 +248,7 @@ public class FinanceReceiptApproveService {
// updateReceiptItem.setStatus(ReceiptItemStatusEnum.DRAFT.getValue()); // updateReceiptItem.setStatus(ReceiptItemStatusEnum.DRAFT.getValue());
//} //}
//receiptItemMapper.updateById(updateReceiptItem); //receiptItemMapper.updateById(updateReceiptItem);
applicationContext.publishEvent(new ReceiptItemWriteOffEvent(receiptApprovalDO.getReceiptItemId(), result)); applicationContext.publishEvent(new ReceiptItemWriteOffEvent(receiptApprovalDO.getReceiptItemId(), result, comment));
} else if (StrUtil.equals(WorkFlowEmus.FINANCE_RECEIPT_ITEM_WRITE_OFF_NO.getKey(), bmpKey)) { } else if (StrUtil.equals(WorkFlowEmus.FINANCE_RECEIPT_ITEM_WRITE_OFF_NO.getKey(), bmpKey)) {
//收款单明细核销反审核 //收款单明细核销反审核
if (null == receiptApprovalDO.getReceiptItemId()) { if (null == receiptApprovalDO.getReceiptItemId()) {
...@@ -293,7 +297,7 @@ public class FinanceReceiptApproveService { ...@@ -293,7 +297,7 @@ public class FinanceReceiptApproveService {
updateReceiptItem.setStatus(ReceiptItemStatusEnum.WRITE_OFF.getValue()); updateReceiptItem.setStatus(ReceiptItemStatusEnum.WRITE_OFF.getValue());
receiptItemMapper.updateById(updateReceiptItem); receiptItemMapper.updateById(updateReceiptItem);
} }
receiptService.recordLog(receiptItemDO.getReceiptId(), ReceiptLinkEnum.REJECT_BANK_RECEIPT, comment, WorkFlowEmus.FINANCE_RECEIPT_ITEM_WRITE_OFF_NO.getValue());
} }
ReceiptApprovalDO updateReceiptApproval = new ReceiptApprovalDO(); ReceiptApprovalDO updateReceiptApproval = new ReceiptApprovalDO();
updateReceiptApproval.setId(receiptApprovalDO.getId()); updateReceiptApproval.setId(receiptApprovalDO.getId());
......
...@@ -145,12 +145,14 @@ public interface ReceiptService extends IService<ReceiptDO> { ...@@ -145,12 +145,14 @@ public interface ReceiptService extends IService<ReceiptDO> {
/** /**
* 获得收款单银行明细核销范围 * 获得收款单银行明细核销范围
*
* @return * @return
*/ */
ReceiptBankWriteoffRangeVO getBankWriteoffRange(); ReceiptBankWriteoffRangeVO getBankWriteoffRange();
/** /**
* 设置收款单银行明细核销范围 * 设置收款单银行明细核销范围
*
* @param range * @param range
* @return * @return
*/ */
...@@ -170,10 +172,11 @@ public interface ReceiptService extends IService<ReceiptDO> { ...@@ -170,10 +172,11 @@ public interface ReceiptService extends IService<ReceiptDO> {
* @param createReqVO * @param createReqVO
* @return * @return
*/ */
Long generateReceiptRelevantData(ReceiptCreateReqVO createReqVO); Long generateReceiptRelevantData(ReceiptCreateReqVO createReqVO, boolean isBatch);
/** /**
* 更新收款明细状态 * 更新收款明细状态
*
* @param receiptId * @param receiptId
*/ */
void updateReceiptItemStatus(Long receiptId); void updateReceiptItemStatus(Long receiptId);
...@@ -190,10 +193,11 @@ public interface ReceiptService extends IService<ReceiptDO> { ...@@ -190,10 +193,11 @@ public interface ReceiptService extends IService<ReceiptDO> {
/** /**
* 获得收款单详情 * 获得收款单详情
*
* @param id * @param id
* @return * @return
*/ */
ReceiptBackVO getReceiptDetail(Long id); ReceiptBackVO getReceiptDetail(Long id);
void batchApprovedReceipt(ArrayList<Long> receiptIds); String getReceiptApprover(Long receiptId);
} }
...@@ -67,7 +67,7 @@ public interface ReceiptItemService extends IService<ReceiptItemDO> { ...@@ -67,7 +67,7 @@ public interface ReceiptItemService extends IService<ReceiptItemDO> {
* *
* @param id * @param id
*/ */
void verification(Long id,Integer bpmResult); void verification(Long id,Integer bpmResult, String comment);
/** /**
* 批量核销 * 批量核销
......
...@@ -128,12 +128,13 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R ...@@ -128,12 +128,13 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
} }
// TODO 校验当前收款单汇率是否过期,过期则更新为导入的汇率 没过期不更新?更新汇率后有效期是啥? // TODO 校验当前收款单汇率是否过期,过期则更新为导入的汇率 没过期不更新?更新汇率后有效期是啥?
//if (receiptDO.getRateValidateDate().before(new Date())) { //if (receiptDO.getRateValidateDate().before(new Date())) {
// 更新收款单汇率,且更新应收金额 // 更新收款单汇率,且更新应收金额
//} //}
// 创建收款明细的时候要判断收款单状态进行更新 // 创建收款明细的时候要判断收款单状态进行更新
if (receiptDO.getState() == 1) { if (receiptDO.getState() == 1) {
ReceiptDO update = new ReceiptDO(); ReceiptDO update = new ReceiptDO();
update.setId(receiptDO.getId()); update.setId(receiptDO.getId());
update.setPayedAt(new Date());
update.setState(2); update.setState(2);
receiptService.updateById(update); receiptService.updateById(update);
} }
...@@ -241,7 +242,7 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R ...@@ -241,7 +242,7 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void verification(Long id, Integer bpmResult) { public void verification(Long id, Integer bpmResult,String comment) {
//收款单明细核销审核 //收款单明细核销审核
if (null == id) { if (null == id) {
throw exception(RECEIPT_ITEM_NOT_FOUND); throw exception(RECEIPT_ITEM_NOT_FOUND);
...@@ -293,6 +294,7 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R ...@@ -293,6 +294,7 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
} }
receiptItemMapper.updateById(receiptItemDO); receiptItemMapper.updateById(receiptItemDO);
receiptService.updateReceiptItemStatus(receiptItemDO.getReceiptId()); receiptService.updateReceiptItemStatus(receiptItemDO.getReceiptId());
receiptService.recordLog(receiptItemDO.getReceiptId(), ReceiptLinkEnum.APPROVE_BANK_RECEIPT, comment, WorkFlowEmus.FINANCE_RECEIPT_ITEM_WRITE_OFF.getValue());
} }
@Override @Override
...@@ -505,7 +507,7 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R ...@@ -505,7 +507,7 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
update.setStatus(ReceiptItemStatusEnum.WRITE_OFF_APPROVE_ING.getValue()); update.setStatus(ReceiptItemStatusEnum.WRITE_OFF_APPROVE_ING.getValue());
update.setBmpId(bpmId); update.setBmpId(bpmId);
this.updateById(update); this.updateById(update);
receiptService.recordLog(receiptItemDO.getReceiptId(), ReceiptLinkEnum.SUBMIT_BANK_RECEIPT, financeReceiptItemVo.getRemark(), update.getBmpId()); receiptService.recordLog(receiptItemDO.getReceiptId(), ReceiptLinkEnum.SUBMIT_BANK_RECEIPT, financeReceiptItemVo.getRemark(), WorkFlowEmus.FINANCE_RECEIPT_ITEM_WRITE_OFF.getValue());
receiptService.updateReceiptItemStatus(receiptItemDO.getReceiptId()); receiptService.updateReceiptItemStatus(receiptItemDO.getReceiptId());
return approvalDO; return approvalDO;
} }
...@@ -539,14 +541,16 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R ...@@ -539,14 +541,16 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
if (writeOffRate.compareTo(writeOffDown) < 0 || writeOffRate.compareTo(writeOffUp) > 0) { if (writeOffRate.compareTo(writeOffDown) < 0 || writeOffRate.compareTo(writeOffUp) > 0) {
return; return;
} }
String remark = "核销比例为: " + writeOffRate + "%, " + "符合核销比例" + writeOffDown + "%-" + writeOffUp + "%";
ReceiptApprovalDO approvalDO = createFinanceReceiptItemWriteOff(FinanceReceiptItemVo.builder() ReceiptApprovalDO approvalDO = createFinanceReceiptItemWriteOff(FinanceReceiptItemVo.builder()
.receiptId(receiptItemDO.getReceiptId()) .receiptId(receiptItemDO.getReceiptId())
.receiptNo(receiptNo) .receiptNo(receiptNo)
.receiptItemId(receiptItemDO.getId()) .receiptItemId(receiptItemDO.getId())
.remark("核销比例为: " + writeOffRate + "%, " + "符合核销比例" + writeOffDown + "%-" + writeOffUp + "%") .remark(remark)
.build()); .build());
bpmProcessInstanceApi.approveTask(approvalDO.getBmpId(), "自动审批"); bpmProcessInstanceApi.approveTask(approvalDO.getBmpId(), "自动审批");
receiptService.recordLog(receiptItemDO.getReceiptId(), ReceiptLinkEnum.APPROVE_BANK_RECEIPT, "核销比例为: " + writeOffRate + "%, " + "符合核销比例" + writeOffDown + "%-" + writeOffUp + "%", approvalDO.getBmpId()); receiptService.recordLog(receiptItemDO.getReceiptId(), ReceiptLinkEnum.SUBMIT_BANK_RECEIPT, remark, WorkFlowEmus.FINANCE_RECEIPT_ITEM_WRITE_OFF.getValue());
receiptService.recordLog(receiptItemDO.getReceiptId(), ReceiptLinkEnum.APPROVE_BANK_RECEIPT, remark, WorkFlowEmus.FINANCE_RECEIPT_ITEM_WRITE_OFF.getValue());
} }
@Override @Override
...@@ -602,7 +606,6 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R ...@@ -602,7 +606,6 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
update.setStatus(ReceiptItemStatusEnum.WRITE_OFF_NO_APPROVE_ING.getValue()); update.setStatus(ReceiptItemStatusEnum.WRITE_OFF_NO_APPROVE_ING.getValue());
update.setBmpId(bpmId); update.setBmpId(bpmId);
this.updateById(update); this.updateById(update);
receiptService.recordLog(update.getReceiptId(), ReceiptLinkEnum.REJECT_BANK_RECEIPT, financeReceiptItemVo.getRemark(), update.getBmpId());
} }
@Override @Override
...@@ -666,11 +669,11 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R ...@@ -666,11 +669,11 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
StringBuilder errorMsg = new StringBuilder(); StringBuilder errorMsg = new StringBuilder();
// 拼接错误信息,每个错误一行 // 拼接错误信息,每个错误一行
respVOS.forEach(respVO -> { respVOS.forEach(respVO -> {
errorMsg.append("<div>") errorMsg.append("<div>")
.append(respVO.getErrorType() == 0 ? "错误:" : "提示:").append(respVO.getErrorMsg()).append(", ") .append(respVO.getErrorType() == 0 ? "错误:" : "提示:").append(respVO.getErrorMsg()).append(", ")
.append("订单号/提单号: ").append(respVO.getOrderNo()).append(", ") .append("订单号/提单号: ").append(respVO.getOrderNo()).append(", ")
.append("付款人: ").append(respVO.getPayer()) .append("付款人: ").append(respVO.getPayer())
.append("</div>"); .append("</div>");
}); });
throw exception(new ErrorCode(haveError ? 1004520042 : 1004520043, errorMsg.toString())); throw exception(new ErrorCode(haveError ? 1004520042 : 1004520043, errorMsg.toString()));
} }
......
...@@ -280,4 +280,6 @@ public interface ReceivableService extends IService<ReceivableDO> { ...@@ -280,4 +280,6 @@ public interface ReceivableService extends IService<ReceivableDO> {
void deleteWriteOffRecord(ReceiptItemDO receiptItemDO); void deleteWriteOffRecord(ReceiptItemDO receiptItemDO);
List<ReceivableInItemVO> getReceivableByReceiptItem(Long receiptItemId); List<ReceivableInItemVO> getReceivableByReceiptItem(Long receiptItemId);
ReceivablePageResult<BatchGenReceiptReceivablePageVO> batchGenReceiptReceivablePage(BatchGenReceiptReceivablePageQueryVO query, PageVO page);
} }
...@@ -332,7 +332,7 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec ...@@ -332,7 +332,7 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
if (receivableBackVO.getWriteOffAmount().compareTo(BigDecimal.ZERO) <= 0 || receivableBackVO.getActualAmount().compareTo(BigDecimal.ZERO) <= 0) { if (receivableBackVO.getWriteOffAmount().compareTo(BigDecimal.ZERO) <= 0 || receivableBackVO.getActualAmount().compareTo(BigDecimal.ZERO) <= 0) {
receivableBackVO.setWriteOffProportion("0.00%"); receivableBackVO.setWriteOffProportion("0.00%");
} else { } else {
receivableBackVO.setWriteOffProportion(receivableBackVO.getWriteOffAmount().divide(receivableBackVO.getActualAmount(), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).toString()); receivableBackVO.setWriteOffProportion(receivableBackVO.getWriteOffAmount().divide(receivableBackVO.getActualAmount(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")) + "%");
} }
}); });
return receivableBackVOList; return receivableBackVOList;
...@@ -664,6 +664,16 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec ...@@ -664,6 +664,16 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
return receivableInItemVOS; return receivableInItemVOS;
} }
@Override
public ReceivablePageResult<BatchGenReceiptReceivablePageVO> batchGenReceiptReceivablePage(BatchGenReceiptReceivablePageQueryVO query, PageVO page) {
IPage<BatchGenReceiptReceivablePageVO> mpPage = MyBatisUtils.buildPage(page);
receivableMapper.batchGenReceiptReceivablePage(mpPage, query);
ReceivablePageResult<BatchGenReceiptReceivablePageVO> pageResult = ReceivablePageResult.of(mpPage);
List<CurrencyAmount> totalActualAmount = receivableMapper.batchGenReceiptReceivablAmount(query);
pageResult.setTotalActualAmount(totalActualAmount);
return pageResult;
}
@Override @Override
public void deleteWriteOffRecord(ReceiptItemDO receiptItemDO) { public void deleteWriteOffRecord(ReceiptItemDO receiptItemDO) {
receivableWriteOffRecordMapper.deleteWriteOffRecord(receiptItemDO.getId()); receivableWriteOffRecordMapper.deleteWriteOffRecord(receiptItemDO.getId());
......
...@@ -177,4 +177,7 @@ public class ReceiptBackVO { ...@@ -177,4 +177,7 @@ public class ReceiptBackVO {
private String creator; private String creator;
@ApiModelProperty(value = "更新人") @ApiModelProperty(value = "更新人")
private String updater; private String updater;
@ApiModelProperty(value = "实收日期")
private Date payedAt;
} }
...@@ -135,10 +135,8 @@ public class ReceiptInvoiceDetailVO { ...@@ -135,10 +135,8 @@ public class ReceiptInvoiceDetailVO {
private List<ReceiptInvoiceLogBackVO> invoiceLog; private List<ReceiptInvoiceLogBackVO> invoiceLog;
@ApiModelProperty(value = "收款人") @ApiModelProperty(value = "收款人")
// TODO 待确认
private String payee; private String payee;
@ApiModelProperty(value = "核销人") @ApiModelProperty(value = "核销人")
// TODO 待确认
private String writeOffUser; private String writeOffUser;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
......
...@@ -18,7 +18,7 @@ public class ReceiptInvoiceOperateReqVO { ...@@ -18,7 +18,7 @@ public class ReceiptInvoiceOperateReqVO {
private Long id; private Long id;
@ApiModelProperty(value = "通知人") @ApiModelProperty(value = "通知人")
private List<Integer> notifyUserIdList; private List<Long> notifyUserIdList;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
......
...@@ -71,7 +71,7 @@ public class ReceiptInvoicePageBackVO { ...@@ -71,7 +71,7 @@ public class ReceiptInvoicePageBackVO {
private Integer receiptState; private Integer receiptState;
@ApiModelProperty(value = "核销比例") @ApiModelProperty(value = "核销比例")
private java.math.BigDecimal writeOffProportion; private String writeOffProportion;
@ApiModelProperty(value = "相关订单信息列表") @ApiModelProperty(value = "相关订单信息列表")
private List<ReceiptRelationOrderInfoVO> orderInfoList; private List<ReceiptRelationOrderInfoVO> orderInfoList;
......
package cn.iocoder.yudao.module.wealth.vo.receivable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@ApiModel("管理后台 - 批量生成收款单费用明细列表 Request VO")
public class BatchGenReceiptReceivablePageQueryVO {
@ApiModelProperty(value = "订单id")
@NotNull(message = "订单id不能为空")
private Long orderId;
@ApiModelProperty(value = "付款方(1 发货人 2 收货人)")
@NotNull(message = "付款方不能为空")
private Integer paymentUser;
@ApiModelProperty(value = "收款类型(字典 payment_type)")
private List<Integer> collectionType;
@ApiModelProperty(value = "收入类型(字典 receivable_fee_type)")
private List<Integer> feeType;
@ApiModelProperty(value = "费用来源:1 订单计算 2 费用申请 3 特需费用")
private List<Integer> feeSource;
}
package cn.iocoder.yudao.module.wealth.vo.receivable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel("管理后台 - 批量生成收款单费用明细列表 VO")
public class BatchGenReceiptReceivablePageVO {
@ApiModelProperty(value = "订单id")
private Long orderId;
@ApiModelProperty(value = "订单项商品ID")
private Long orderItemId;
@ApiModelProperty(value = "中文标题")
private String titleZh;
@ApiModelProperty(value = "英文标题")
private String titleEn;
@ApiModelProperty(value = "数量")
private Integer quantity;
@ApiModelProperty(value = "箱数")
private Integer num;
@ApiModelProperty(value = "体积/重量")
private BigDecimal weight;
@ApiModelProperty(value = "体积")
private BigDecimal volume;
@ApiModelProperty(value = "收款类型(字典 payment_type)")
private Integer collectionType;
@ApiModelProperty(value = "收入类型(字典 receivable_fee_type)")
private Integer feeType;
@ApiModelProperty(value = "费用来源:1 订单计算 2 费用申请 3 特需费用")
private Integer feeSource;
@ApiModelProperty(value = "付款人类型(1 发货人 2 收货人)")
private Integer paymentUser;
@ApiModelProperty(value = "单价")
private BigDecimal unitPrice;
@ApiModelProperty(value = "总金额")
private BigDecimal totalAmount;
@ApiModelProperty(value = "货币id")
private Long currencyId;
}
package cn.iocoder.yudao.module.wealth.vo.receivable;
import cn.iocoder.yudao.module.wealth.vo.receiptItem.CurrencyAmount;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data
@ApiModel("分页结果")
public final class ReceivablePageResult<T> implements Serializable {
@ApiModelProperty(value = "数据", required = true)
private List<T> list;
@ApiModelProperty(value = "总量", required = true, example = "0")
private Long total = 0L;
@ApiModelProperty(value = "每页记录数", required = true, example = "10")
private Long rows = 10L;
@ApiModelProperty(value = "当前页数", required = true, example = "1")
private Long page = 1L;
@ApiModelProperty(value = "总页数", required = true, example = "0")
private Long pages = 0L;
@ApiModelProperty(value = "合计金额")
private List<CurrencyAmount> totalActualAmount;
public ReceivablePageResult() {}
public ReceivablePageResult(List<T> list, long total) {
this.list = list;
this.total = total;
}
public ReceivablePageResult(List<T> list, long total, long rows, long page, long pages) {
this.list = list;
this.rows = rows;
this.page = page;
this.pages = pages;
this.total = total;
}
public ReceivablePageResult(long total) {
this.list = new ArrayList<>();
this.total = total;
}
public static <T> ReceivablePageResult<T> empty() {
return new ReceivablePageResult<>();
}
public static <T> ReceivablePageResult<T> empty(long total) {
return new ReceivablePageResult<>(total);
}
/****
* 分页转换
* @param pager
* @return
*/
public static <T> ReceivablePageResult<T> of(IPage<T> pager){
return new ReceivablePageResult<>(pager.getRecords(), pager.getTotal(), pager.getSize(), pager.getCurrent(), pager.getPages());
}
/****
* 分页转换
* @param pager
* @return
*/
public static <T> ReceivablePageResult<T> of(PageInfo<T> pager){
return new ReceivablePageResult<>(pager.getList(), pager.getTotal(), pager.getPageSize(), pager.getPageNum(), pager.getPages());
}
}
...@@ -111,6 +111,11 @@ public class ReceivableController { ...@@ -111,6 +111,11 @@ public class ReceivableController {
return success(receivableService.batchGenReceiptPage(query, page)); return success(receivableService.batchGenReceiptPage(query, page));
} }
@PostMapping("/batch-gen-receipt/receivable/page")
@ApiOperation("财务-批量生成收款单费用明细列表")
public CommonResult<ReceivablePageResult<BatchGenReceiptReceivablePageVO>> batchGenReceiptReceivablePage(@Valid @RequestBody BatchGenReceiptReceivablePageQueryVO query, PageVO page) {
return success(receivableService.batchGenReceiptReceivablePage(query, page));
}
@GetMapping("/getListForReceiptItem") @GetMapping("/getListForReceiptItem")
@ApiOperation("财务-创建收款明细获取应收明细") @ApiOperation("财务-创建收款明细获取应收明细")
public CommonResult<List<ReceivableInItemVO>> getListForCreateReceiptItem(Long receiptId) { public CommonResult<List<ReceivableInItemVO>> getListForCreateReceiptItem(Long receiptId) {
......
...@@ -68,6 +68,13 @@ ...@@ -68,6 +68,13 @@
GROUP BY er.receipt_no GROUP BY er.receipt_no
</if> </if>
</select> </select>
<select id="getReceiptItemPayat" resultType="java.util.Date">
SELECT eri.amount_date
FROM ecw_receipt_item eri
WHERE eri.receipt_id = #{id} AND eri.deleted = 0
ORDER BY eri.amount_date
LIMIT 1
</select>
<sql id="pageCondition"> <sql id="pageCondition">
<if test="query.receiptItemStatus != null"> <if test="query.receiptItemStatus != null">
<if test="query.receiptItemStatus.size() == 1"> <if test="query.receiptItemStatus.size() == 1">
......
...@@ -48,9 +48,11 @@ ...@@ -48,9 +48,11 @@
er.invoicing_status, er.invoicing_status,
er.invoice_data_status, er.invoice_data_status,
er.customer_id, er.customer_id,
er.customer_name er.customer_name,
su.nickname AS cancelUserName
FROM ecw_receipt_invoice eri FROM ecw_receipt_invoice eri
LEFT JOIN ecw_receipt er ON eri.receipt_id = er.id LEFT JOIN ecw_receipt er ON eri.receipt_id = er.id
LEFT JOIN system_user su ON eri.cancel_user_id = su.id
WHERE eri.id = #{id} WHERE eri.id = #{id}
</select> </select>
<select id="getCurrentMaxInvoiceCode" resultType="java.lang.String"> <select id="getCurrentMaxInvoiceCode" resultType="java.lang.String">
......
...@@ -315,6 +315,58 @@ ...@@ -315,6 +315,58 @@
WHERE r.deleted = 0 AND r.order_id = #{orderId} AND r.receipt_id IS NULL WHERE r.deleted = 0 AND r.order_id = #{orderId} AND r.receipt_id IS NULL
GROUP BY r.currency_id GROUP BY r.currency_id
</select> </select>
<select id="batchGenReceiptReceivablePage"
resultType="cn.iocoder.yudao.module.wealth.vo.receivable.BatchGenReceiptReceivablePageVO">
SELECT r.*
FROM ecw_receivable r
WHERE r.order_id = #{query.orderId} AND r.receipt_id IS NULL AND r.payment_user = #{query.paymentUser} AND r.deleted = 0
<include refid="feeCondition"></include>
</select>
<select id="batchGenReceiptReceivablAmount"
resultType="cn.iocoder.yudao.module.wealth.vo.receiptItem.CurrencyAmount">
SELECT
r.currency_id,
SUM(r.total_amount) AS amount
FROM ecw_receivable r
WHERE r.order_id = #{query.orderId} AND r.receipt_id IS NULL AND r.payment_user = #{query.paymentUser} AND r.deleted = 0
<include refid="feeCondition"></include>
GROUP BY r.currency_id
</select>
<sql id="feeCondition">
<if test="query.feeSource != null">
<if test="query.feeSource.size() == 1">
AND r.fee_source = #{query.feeSource[0]}
</if>
<if test="query.feeSource.size() > 1">
AND r.fee_source IN
<foreach collection="query.feeSource" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
<if test="query.feeType != null">
<if test="query.feeType.size() == 1">
AND r.fee_type = #{query.feeType[0]}
</if>
<if test="query.feeType.size() > 1">
AND r.fee_type IN
<foreach collection="query.feeType" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
<if test="query.collectionType != null">
<if test="query.collectionType.size() == 1">
AND r.collection_type = #{query.collectionType[0]}
</if>
<if test="query.collectionType.size() > 1">
AND r.collection_type IN
<foreach collection="query.collectionType" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
</sql>
<sql id="batchGenReceiptPageCondition"> <sql id="batchGenReceiptPageCondition">
<if test="query.orderIds != null"> <if test="query.orderIds != null">
<if test="query.orderIds.size() == 1"> <if test="query.orderIds.size() == 1">
...@@ -328,63 +380,63 @@ ...@@ -328,63 +380,63 @@
</if> </if>
</if> </if>
<if test="query.orderNo != null and query.orderNo != ''"> <if test="query.orderNo != null and query.orderNo != ''">
AND r.order_no = #{query.orderNo} AND r.order_no = #{query.orderNo}
</if> </if>
<if test="query.tidanNo != null and query.tidanNo!= ''"> <if test="query.tidanNo != null and query.tidanNo!= ''">
AND e.tidan_no = #{query.tidanNo} AND e.tidan_no = #{query.tidanNo}
</if> </if>
<if test="query.transportId != null"> <if test="query.transportId != null">
AND e.transport_id = #{query.transportId} AND e.transport_id = #{query.transportId}
</if> </if>
<if test="query.departureWareHouseId != null"> <if test="query.departureWareHouseId != null">
<if test="query.departureWareHouseId.size() == 1"> <if test="query.departureWareHouseId.size() == 1">
AND de.departure_warehouse_id = #{query.departureWareHouseId[0]} AND de.departure_warehouse_id = #{query.departureWareHouseId[0]}
</if> </if>
<if test="query.departureWareHouseId.size() > 1"> <if test="query.departureWareHouseId.size() > 1">
AND de.departure_warehouse_id IN AND de.departure_warehouse_id IN
<foreach collection="query.departureWareHouseId" item="item" open="(" separator="," close=")"> <foreach collection="query.departureWareHouseId" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
</if> </if>
<if test="query.destCountry != null"> <if test="query.destCountry != null">
<if test="query.destCountry.size() == 1"> <if test="query.destCountry.size() == 1">
AND ob.objective_country_id = #{query.destCountry[0]} AND ob.objective_country_id = #{query.destCountry[0]}
</if> </if>
<if test="query.destCountry.size() > 1"> <if test="query.destCountry.size() > 1">
AND ob.objective_country_id IN AND ob.objective_country_id IN
<foreach collection="query.destCountry" item="item" open="(" separator="," close=")"> <foreach collection="query.destCountry" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
</if> </if>
<if test="query.destCity != null"> <if test="query.destCity != null">
<if test="query.destCity.size() == 1"> <if test="query.destCity.size() == 1">
AND ob.objective_id = #{query.destCity[0]} AND ob.objective_id = #{query.destCity[0]}
</if> </if>
<if test="query.destCity.size() > 1"> <if test="query.destCity.size() > 1">
AND ob.objective_id IN AND ob.objective_id IN
<foreach collection="query.destCity" item="item" open="(" separator="," close=")"> <foreach collection="query.destCity" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
</if> </if>
<if test="query.objectiveWareHouseId != null"> <if test="query.objectiveWareHouseId != null">
<if test="query.objectiveWareHouseId.size() == 1"> <if test="query.objectiveWareHouseId.size() == 1">
AND ob.objective_warehouse_id = #{query.objectiveWareHouseId[0]} AND ob.objective_warehouse_id = #{query.objectiveWareHouseId[0]}
</if>
<if test="query.objectiveWareHouseId.size() > 1">
AND ob.objective_warehouse_id IN
<foreach collection="query.objectiveWareHouseId" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
<if test="query.consignee != null and query.consignee != ''">
AND nee.name = #{query.consignee}
</if>
<if test="query.consignor != null and query.consignor != ''">
AND nor.name = #{query.consignor}
</if> </if>
<if test="query.objectiveWareHouseId.size() > 1">
AND ob.objective_warehouse_id IN
<foreach collection="query.objectiveWareHouseId" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
<if test="query.consignee != null and query.consignee != ''">
AND nee.name = #{query.consignee}
</if>
<if test="query.consignor != null and query.consignor != ''">
AND nor.name = #{query.consignor}
</if>
</sql> </sql>
</mapper> </mapper>
...@@ -35,6 +35,10 @@ app.message.air.warehousein.title= ...@@ -35,6 +35,10 @@ app.message.air.warehousein.title=
app.message.air.warehousein.content= app.message.air.warehousein.content=
app.message.air.exception.warehousein.title= app.message.air.exception.warehousein.title=
app.message.air.exception.warehousein.content= app.message.air.exception.warehousein.content=
app.message.reject.invoice.title=
app.message.reject.invoice.content=
app.message.cancel.invoice.content=
app.message.cancel.invoice.title=
customer.enter.to.open.sea.cancel.delay.approval= customer.enter.to.open.sea.cancel.delay.approval=
order.label.repeat= order.label.repeat=
customer.referrer.commission.already.exists= customer.referrer.commission.already.exists=
......
...@@ -275,6 +275,10 @@ app.message.update.control.password.title=Cargo control password changed success ...@@ -275,6 +275,10 @@ app.message.update.control.password.title=Cargo control password changed success
app.message.update.password.content=Your password has been changed, please be careful to save! app.message.update.password.content=Your password has been changed, please be careful to save!
app.message.customer.complain.title=Customer Management "Customer Complaints" app.message.customer.complain.title=Customer Management "Customer Complaints"
app.message.customer.complain.content=The content of your complaint has been processed, please pay attention to review! app.message.customer.complain.content=The content of your complaint has been processed, please pay attention to review!
app.message.reject.invoice.title=%s-%s customer invoice information has been rejected
app.message.reject.invoice.content=Dear, Your submitted %s-%s customer invoice information has been rejected, please check
app.message.cancel.invoice.content=Dear, Your submitted %s-%s customer invoice has been cancelled, please check
app.message.cancel.invoice.title=%s-%s customer invoice has been cancelled
warehouse.approval.passed.cannot.cancel=warehouse approval passed can not cancel warehouse.approval.passed.cannot.cancel=warehouse approval passed can not cancel
warehouse.approval.batch.cannot.cancel=warehouse approval batch cannot cancel warehouse.approval.batch.cannot.cancel=warehouse approval batch cannot cancel
order.approval.info.not.find=order approval info not find order.approval.info.not.find=order approval info not find
......
...@@ -275,6 +275,10 @@ app.message.update.control.password.title=Le mot de passe de contr\u00F4le des m ...@@ -275,6 +275,10 @@ app.message.update.control.password.title=Le mot de passe de contr\u00F4le des m
app.message.update.password.content=Votre mot de passe a \u00E9t\u00E9 modifi\u00E9. Merci de le sauvegarder ! app.message.update.password.content=Votre mot de passe a \u00E9t\u00E9 modifi\u00E9. Merci de le sauvegarder !
app.message.customer.complain.title=Gestion des clients - "R\u00E9clamation" app.message.customer.complain.title=Gestion des clients - "R\u00E9clamation"
app.message.customer.complain.content=Votre plainte a \u00E9t\u00E9 trait\u00E9e, veuillez v\u00E9rifier les d\u00E9tails ! app.message.customer.complain.content=Votre plainte a \u00E9t\u00E9 trait\u00E9e, veuillez v\u00E9rifier les d\u00E9tails !
app.message.reject.invoice.title=%s-%s Les informations de facturation du client ont \u00E9t\u00E9 rejet\u00E9es
app.message.reject.invoice.content=Cher, Votre soumission %s-%s des informations de facturation du client a \u00E9t\u00E9 rejet\u00E9e, veuillez v\u00E9rifier
app.message.cancel.invoice.content=Cher, Votre soumission %s-%s facture client a \u00E9t\u00E9 annul\u00E9e, veuillez v\u00E9rifier
app.message.cancel.invoice.title=%s-%s facture client annul\u00E9e
warehouse.approval.passed.cannot.cancel=Les demandes d'approbation d\u00E9j\u00E0 approuv\u00E9es ne peuvent pas \u00EAtre annul\u00E9es warehouse.approval.passed.cannot.cancel=Les demandes d'approbation d\u00E9j\u00E0 approuv\u00E9es ne peuvent pas \u00EAtre annul\u00E9es
warehouse.approval.batch.cannot.cancel=Examen en cours pour le transfert de stock en masse, veuillez patienter warehouse.approval.batch.cannot.cancel=Examen en cours pour le transfert de stock en masse, veuillez patienter
order.approval.info.not.find=Informations d'approbation de la commande introuvables order.approval.info.not.find=Informations d'approbation de la commande introuvables
......
...@@ -271,6 +271,10 @@ app.message.update.password.content=\u60A8\u7684\u5BC6\u7801\u5DF2\u4FEE\u6539\u ...@@ -271,6 +271,10 @@ app.message.update.password.content=\u60A8\u7684\u5BC6\u7801\u5DF2\u4FEE\u6539\u
app.message.update.control.password.content=\u60A8\u7684\u63A7\u8D27\u5BC6\u7801\u5DF2\u4FEE\u6539\uFF0C\u8BF7\u6CE8\u610F\u4FDD\u5B58\uFF01 app.message.update.control.password.content=\u60A8\u7684\u63A7\u8D27\u5BC6\u7801\u5DF2\u4FEE\u6539\uFF0C\u8BF7\u6CE8\u610F\u4FDD\u5B58\uFF01
app.message.customer.complain.title=\u5BA2\u6237\u7BA1\u7406\u201C\u5BA2\u8BC9\u201D app.message.customer.complain.title=\u5BA2\u6237\u7BA1\u7406\u201C\u5BA2\u8BC9\u201D
app.message.customer.complain.content=\u60A8\u6295\u8BC9\u7684\u5185\u5BB9\u5DF2\u7ECF\u5904\u7406\uFF0C\u8BF7\u6CE8\u610F\u67E5\u770B\uFF01 app.message.customer.complain.content=\u60A8\u6295\u8BC9\u7684\u5185\u5BB9\u5DF2\u7ECF\u5904\u7406\uFF0C\u8BF7\u6CE8\u610F\u67E5\u770B\uFF01
app.message.reject.invoice.title=%s-%s\u5BA2\u6237\u5F00\u7968\u8D44\u6599\u88AB\u9A73\u56DE
app.message.reject.invoice.content=\u60A8\u597D,\u60A8\u63D0\u4EA4\u7684%s-%s.\u5BA2\u6237\u5F00\u7968\u8D44\u6599\u9A73\u56DE,\u8BF7\u6CE8\u610F\u67E5\u770B
app.message.cancel.invoice.content=\u60A8\u597D,\u60A8\u63D0\u4EA4\u7684%s-%s\u5BA2\u6237\u5F00\u7968\u5DF2\u53D6\u6D88,\u8BF7\u6CE8\u610F\u67E5\u770B
app.message.cancel.invoice.title=%s-%s\u5BA2\u6237\u5F00\u7968\u5DF2\u53D6\u6D88
warehouse.approval.passed.cannot.cancel=\u5DF2\u901A\u8FC7\u7684\u5BA1\u6838\u5355\u4E0D\u53EF\u53D6\u6D88 warehouse.approval.passed.cannot.cancel=\u5DF2\u901A\u8FC7\u7684\u5BA1\u6838\u5355\u4E0D\u53EF\u53D6\u6D88
warehouse.approval.batch.cannot.cancel=\u6279\u91CF\u8C03\u4ED3\u5BA1\u6838\u4E2D\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85\u5BA1\u6838\u7ED3\u679C warehouse.approval.batch.cannot.cancel=\u6279\u91CF\u8C03\u4ED3\u5BA1\u6838\u4E2D\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85\u5BA1\u6838\u7ED3\u679C
order.approval.info.not.find=\u8BA2\u5355\u5BA1\u6838\u4FE1\u606F\u4E0D\u5B58\u5728 order.approval.info.not.find=\u8BA2\u5355\u5BA1\u6838\u4FE1\u606F\u4E0D\u5B58\u5728
......
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