Commit ece88681 authored by zhangfeng's avatar zhangfeng

feat(wealth): 银行收款明细

parent f9445154
......@@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.ecw.dal.mysql.bankAccount.BankAccountMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class BankApiImpl implements BankApi {
......@@ -16,9 +17,9 @@ public class BankApiImpl implements BankApi {
@Override
public BankAccountDTO getBankAccountByAccountNo(String baAccountNum) {
BankAccountDO bankAccountDO = bankAccountMapper.selectOne("ba_account_num", baAccountNum);
if (bankAccountDO != null) {
return BankAccountConvert.INSTANCE.convertDTO(bankAccountDO);
List<BankAccountDO> bankAccountDO = bankAccountMapper.selectList("ba_account_num", baAccountNum);
if (bankAccountDO != null && !bankAccountDO.isEmpty()) {
return BankAccountConvert.INSTANCE.convertDTO(bankAccountDO.get(0));
}
return null;
}
......
......@@ -734,17 +734,8 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
throw exception(RECEIPT_ITEM_NOT_FOUND);
}
ReceiptItemBackVO itemBackVO = ReceiptItemConvert.INSTANCE.convert(receiptItemDO);
List<ReceivableDO> receivableDOS = receivableService.selectList("receipt_id", itemBackVO.getReceiptId());
List<ReceivableInItemVO> receivableInItemVOS = ReceivableConvert.INSTANCE.convertToItemVOList(receivableDOS);
for (ReceivableInItemVO receivableInItemVO : receivableInItemVOS) {
ReceivableWriteOffRecordDO receivableWriteOffRecordDO = receivableService.getReceivableWriteOffRecord(receivableInItemVO.getId(), id);
if (null == receivableWriteOffRecordDO) {
receivableInItemVO.setWriteOffAmount(BigDecimal.ZERO);
} else {
receivableInItemVO.setWriteOffAmount(receivableWriteOffRecordDO.getWriteOffAmount());
}
}
itemBackVO.setReceivableList(receivableInItemVOS);
List<ReceivableInItemVO> listForCreateReceiptItem = receivableService.getListForCreateReceiptItem(receiptItemDO.getReceiptId());
itemBackVO.setReceivableList(listForCreateReceiptItem);
return itemBackVO;
}
......
......@@ -37,6 +37,9 @@ public class ReceiptItemBackVO {
@ApiModelProperty(value = "收款账号")
private String accountNo;
@ApiModelProperty(value = "收款账号id")
private Long accountId;
@ApiModelProperty(value = "当次实收金额不含税")
@ExcelProperty("当次实收金额不含税")
private java.math.BigDecimal amount;
......
......@@ -6,6 +6,8 @@ import cn.iocoder.yudao.framework.common.util.collectors.CollectorsUtil;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
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.currency.CurrencyApi;
import cn.iocoder.yudao.module.ecw.api.currency.dto.CurrencyRespDTO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
......@@ -26,7 +28,6 @@ import cn.iocoder.yudao.module.wealth.vo.receiptItem.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
......@@ -69,6 +70,9 @@ public class ReceiptItemController {
@Resource
private ReceiptApprovalMapper receiptApprovalMapper;
@Resource
private BankApi bankApi;
@PostMapping("/create")
@ApiOperation("创建收款明细")
//@PreAuthorize("@ss.hasPermission('ecw:receipt-item:create')")
......@@ -98,6 +102,8 @@ public class ReceiptItemController {
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
public CommonResult<ReceiptItemBackVO> getReceiptItemDetail(@RequestParam("id") Long id) {
ReceiptItemBackVO receiptItemVO = receiptItemService.getReceiptItemDetail(id);
BankAccountDTO account = bankApi.getBankAccountByAccountNo(receiptItemVO.getAccountNo());
receiptItemVO.setAccountId(account.getId());
getSY(receiptItemVO, receiptItemVO.getReceiptId());
SetData(receiptItemVO);
return success(receiptItemVO);
......@@ -196,7 +202,7 @@ public class ReceiptItemController {
int iId = Integer.parseInt(currencyId.toString());
bzName = currencyMap.get(iId).getTitleZh();
}
v.setSyValue(bResult.toString() + bzName);
v.setSyValue(bResult.toString());
return bResult;
}
......@@ -208,7 +214,12 @@ public class ReceiptItemController {
LambdaQueryWrapper<ReceiptItemDO> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(ReceiptItemDO::getReceiptId, id);
List<ReceiptItemDO> list = receiptItemService.list(lambdaQueryWrapper);
return success(ReceiptItemConvert.INSTANCE.convertList(list));
List<ReceiptItemBackVO> receiptItemBackVOS = ReceiptItemConvert.INSTANCE.convertList(list);
receiptItemBackVOS.forEach(vo -> {
BankAccountDTO account = bankApi.getBankAccountByAccountNo(vo.getAccountNo());
vo.setAccountId(account.getId());
});
return success(receiptItemBackVOS);
}
@PostMapping("/review/page")
......
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