Commit 8df64eb0 authored by zhangfeng's avatar zhangfeng

feat(wealth): 批量导入收款明细

parent 0d1713c3
package cn.iocoder.yudao.module.ecw.api.bank;
import cn.iocoder.yudao.module.ecw.api.bank.dto.BankAccountDTO;
public interface BankApi {
/**
* 根据银行账号获取账号信息
*/
BankAccountDTO getBankAccountByAccountNo(String baAccountNum);
}
package cn.iocoder.yudao.module.ecw.api.bank.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class BankAccountDTO {
@ApiModelProperty(value = "银行账号编号", required = true)
private Long id;
@ApiModelProperty(value = "户名", required = true)
private String baAccountName;
@ApiModelProperty(value = "开户银行", required = true)
private String baBankName;
@ApiModelProperty(value = "银行账号", required = true)
private String baAccountNum;
@ApiModelProperty(value = "银行代码", required = true)
private String baSwiftCode;
@ApiModelProperty(value = "开户银行地址", required = true)
private String baBankAdd;
@ApiModelProperty(value = "类型字典(1公账,2私账)", required = true)
private Integer baType;
@ApiModelProperty(value = "状态(0正常 1停用)", required = false)
private Integer status;
@ApiModelProperty(value = "开户国家")
private Integer baCountry;
@ApiModelProperty(value = "收入归属")
private Integer baIncomeBelong;
@ApiModelProperty(value = "币种")
private Integer baCurrency;
@ApiModelProperty(value = "余额")
private java.math.BigDecimal baBalance;
}
......@@ -4,6 +4,7 @@ import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.ecw.api.bank.dto.BankAccountDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.ecw.controller.admin.bankAccount.vo.*;
......@@ -32,4 +33,5 @@ public interface BankAccountConvert {
List<BankAccountExcelVO> convertList02(List<BankAccountDO> list);
BankAccountDTO convertDTO(BankAccountDO bankAccountDO);
}
package cn.iocoder.yudao.module.ecw.service.api;
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.convert.bankAccount.BankAccountConvert;
import cn.iocoder.yudao.module.ecw.dal.dataobject.bankAccount.BankAccountDO;
import cn.iocoder.yudao.module.ecw.dal.mysql.bankAccount.BankAccountMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class BankApiImpl implements BankApi {
@Resource
private BankAccountMapper bankAccountMapper;
@Override
public BankAccountDTO getBankAccountByAccountNo(String baAccountNum) {
BankAccountDO bankAccountDO = bankAccountMapper.selectOne("ba_account_num", baAccountNum);
if (bankAccountDO != null) {
return BankAccountConvert.INSTANCE.convertDTO(bankAccountDO);
}
return null;
}
}
......@@ -35,4 +35,10 @@ public interface OrderApi {
* @return 是否合并成功
*/
boolean mergeOrder(Long customerIdSaved, Long customerIdDeleted);
/**
* 根据订单号/提单号获取订单
* @param orderNo
*/
OrderRespDTO getOrderByNo(String orderNo);
}
......@@ -17,6 +17,7 @@ import cn.iocoder.yudao.module.order.service.orderOperateLog.OrderOperateLogServ
import cn.iocoder.yudao.module.order.vo.orderOperateLog.OrderOperateLogCreateReqVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.base.Joiner;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
......@@ -172,4 +173,23 @@ public class OrderApiImpl implements OrderApi {
return false;
}
@Override
public OrderRespDTO getOrderByNo(String orderNo) {
if (StringUtils.isBlank(orderNo)) {
return null;
}
OrderDO orderDO;
if (orderNo.contains("-")) {
orderDO = orderService.selectOne(new LambdaQueryWrapper<OrderDO>().eq(OrderDO::getTidanNo, orderNo).last("limit 1"));
} else {
orderDO = orderService.selectOne(new LambdaQueryWrapper<OrderDO>().eq(OrderDO::getOrderNo, orderNo).last("limit 1"));
}
if (orderDO == null) {
return null;
}
OrderRespDTO orderRespDTO = new OrderRespDTO();
BeanUtils.copyProperties(orderDO, orderRespDTO);
return orderRespDTO;
}
}
......@@ -52,7 +52,11 @@
<artifactId>yudao-module-ecw-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-order-api</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</project>
......@@ -122,5 +122,5 @@ public interface ReceiptItemService extends IService<ReceiptItemDO> {
BigDecimal getWriteOffAmountByReceiptId( Long receiptId);
List<ReceiptItemBatchRespVO> receiptItemImport(List<ReceiptItemBatchCreateReqVO> list);
List<ReceiptItemBatchRespVO> receiptItemImport(List<ReceiptItemBatchCreateReqVO> list, Boolean ignoreItem);
}
......@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("管理后台 - 批量收款信息创建 Request VO")
public class ReceiptItemBatchCreateReqVO {
......
......@@ -2,9 +2,13 @@ package cn.iocoder.yudao.module.wealth.vo.receiptAccount;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("管理后台 - 批量导入收款信息结果 VO")
public class ReceiptItemBatchRespVO {
......@@ -14,6 +18,9 @@ public class ReceiptItemBatchRespVO {
@ApiModelProperty(value = "付款人")
private String payer;
@ApiModelProperty(value = "错误类型,0 错误 1 提示")
private Integer errorType;
@ApiModelProperty(value = "错误信息")
private String errorMsg;
......
......@@ -122,7 +122,7 @@ public class ReceiptItemController {
v.setUpdater(sT);
}
if (v.getBmpId() == null||v.getBmpId().length()==0) {
if (v.getBmpId() == null || v.getBmpId().length() == 0) {
v.setCreateBpm("");
v.setCreateTimeBpm(null);
v.setUpdateTimeBpm(null);
......@@ -134,7 +134,7 @@ public class ReceiptItemController {
lambdaQueryWrapper.eq(ReceiptApprovalDO::getBmpId, v.getBmpId());
List<ReceiptApprovalDO> list =
receiptApprovalMapper.selectList(lambdaQueryWrapper);
if (list==null||list.size() == 0) return;
if (list == null || list.size() == 0) return;
//审批创建人
if (list.get(0).getCreator() != null
......@@ -282,9 +282,9 @@ public class ReceiptItemController {
@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "Excel 文件", required = true, dataTypeClass = MultipartFile.class)
})
public CommonResult<List<ReceiptItemBatchRespVO>> receiptAccountImport(@RequestParam("file") MultipartFile file) throws IOException {
public CommonResult<List<ReceiptItemBatchRespVO>> receiptAccountImport(@RequestParam("file") MultipartFile file, @RequestParam(value = "ignoreItem") Boolean ignoreItem) throws IOException {
List<ReceiptItemBatchCreateReqVO> list = ExcelUtils.read(file, ReceiptItemBatchCreateReqVO.class);
return success(receiptItemService.receiptItemImport(list));
return success(receiptItemService.receiptItemImport(list, ignoreItem));
}
}
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