|
|
@ -43,10 +43,10 @@ import com.github.pagehelper.PageInfo; |
|
|
|
* @date 2019-04-24 进项税转出相关操作 |
|
|
|
* @date 2019-04-24 进项税转出相关操作 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@SuppressWarnings({"AlibabaUndefineMagicConstant", "AlibabaCollectionInitShouldAssignCapacity", |
|
|
|
@SuppressWarnings({"AlibabaUndefineMagicConstant", "AlibabaCollectionInitShouldAssignCapacity", |
|
|
|
"AlibabaLowerCamelCaseVariableNaming"}) |
|
|
|
"AlibabaLowerCamelCaseVariableNaming"}) |
|
|
|
@Service("baseIReceiptOutService") |
|
|
|
@Service("baseIReceiptOutService") |
|
|
|
public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutDao, BaseTDxRecordInvoiceOut> |
|
|
|
public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutDao, BaseTDxRecordInvoiceOut> |
|
|
|
implements BaseIReceiptOutService { |
|
|
|
implements BaseIReceiptOutService { |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private BaseIInvoiceOutService baseIInvoiceOutService; |
|
|
|
private BaseIInvoiceOutService baseIInvoiceOutService; |
|
|
@ -67,8 +67,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 已转出进项税,列表页数据 |
|
|
|
* 已转出进项税,列表页数据 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param reqVO |
|
|
|
* @param reqVO 请求参数 |
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
* @return 返回结果 |
|
|
|
* @return 返回结果 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -108,19 +107,19 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
filter.put("invoiceNo", StringHelper.isBlank(reqVO.getInvoiceNo()) ? null : reqVO.getInvoiceNo()); |
|
|
|
filter.put("invoiceNo", StringHelper.isBlank(reqVO.getInvoiceNo()) ? null : reqVO.getInvoiceNo()); |
|
|
|
// 转出原因
|
|
|
|
// 转出原因
|
|
|
|
filter.put("reasonId", (StringHelper.isBlank(reqVO.getReasonId()) || "99".equals(reqVO.getReasonId())) ? null |
|
|
|
filter.put("reasonId", (StringHelper.isBlank(reqVO.getReasonId()) || "99".equals(reqVO.getReasonId())) ? null |
|
|
|
: reqVO.getReasonId()); |
|
|
|
: reqVO.getReasonId()); |
|
|
|
// 发票状态
|
|
|
|
// 发票状态
|
|
|
|
filter.put("invoiceStatus", |
|
|
|
filter.put("invoiceStatus", |
|
|
|
(StringHelper.isBlank(reqVO.getInvoiceStatus()) || "99".equals(reqVO.getInvoiceStatus())) ? null |
|
|
|
(StringHelper.isBlank(reqVO.getInvoiceStatus()) || "99".equals(reqVO.getInvoiceStatus())) ? null |
|
|
|
: reqVO.getInvoiceStatus()); |
|
|
|
: reqVO.getInvoiceStatus()); |
|
|
|
// 转出开始时间
|
|
|
|
// 转出开始时间
|
|
|
|
filter.put("outStartDate", reqVO.getOutStartDate()); |
|
|
|
filter.put("outStartDate", reqVO.getOutStartDate()); |
|
|
|
// 转出结束时间
|
|
|
|
// 转出结束时间
|
|
|
|
filter.put("outEndDate", reqVO.getOutEndDate()); |
|
|
|
filter.put("outEndDate", reqVO.getOutEndDate()); |
|
|
|
// 业务参数
|
|
|
|
// 业务参数
|
|
|
|
filter.put("businessCode", |
|
|
|
filter.put("businessCode", |
|
|
|
(StringHelper.isBlank(reqVO.getBusinessCode()) || "99".equals(reqVO.getBusinessCode())) ? null |
|
|
|
(StringHelper.isBlank(reqVO.getBusinessCode()) || "99".equals(reqVO.getBusinessCode())) ? null |
|
|
|
: reqVO.getBusinessCode()); |
|
|
|
: reqVO.getBusinessCode()); |
|
|
|
filter.put("company", reqVO.getCompany()); |
|
|
|
filter.put("company", reqVO.getCompany()); |
|
|
|
// 执行查询并排序
|
|
|
|
// 执行查询并排序
|
|
|
|
PageInfo<BaseReceiptInvoiceView> pageInfo = baseIInvoiceOutService.listPageByInvoice(filter); |
|
|
|
PageInfo<BaseReceiptInvoiceView> pageInfo = baseIInvoiceOutService.listPageByInvoice(filter); |
|
|
@ -134,7 +133,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
for (BaseReceiptInvoiceView view : pageInfo.getList()) { |
|
|
|
for (BaseReceiptInvoiceView view : pageInfo.getList()) { |
|
|
|
BaseReceiptOutRespVO vo = convertToInvoiceView(view, invoiceStatusMap); |
|
|
|
BaseReceiptOutRespVO vo = convertToInvoiceView(view, invoiceStatusMap); |
|
|
|
// 序号计算 = (当前页-1)*每页条数+1
|
|
|
|
// 序号计算 = (当前页-1)*每页条数+1
|
|
|
|
vo.setXh((long)((pageInfo.getPageNum() - 1) * pageInfo.getPageSize() + index)); |
|
|
|
vo.setXh((long) ((pageInfo.getPageNum() - 1) * pageInfo.getPageSize() + index)); |
|
|
|
index++; |
|
|
|
index++; |
|
|
|
respVos.add(vo); |
|
|
|
respVos.add(vo); |
|
|
|
} |
|
|
|
} |
|
|
@ -146,7 +145,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
// 合计金额 and 合计税额
|
|
|
|
// 合计金额 and 合计税额
|
|
|
|
BaseReceiptInvoiceView view = baseIInvoiceOutService.querySumForInvoice(filter); |
|
|
|
BaseReceiptInvoiceView view = baseIInvoiceOutService.querySumForInvoice(filter); |
|
|
|
BigDecimal totalAmount = |
|
|
|
BigDecimal totalAmount = |
|
|
|
(view == null || view.getInvoiceAmount() == null) ? new BigDecimal(0) : view.getInvoiceAmount(); |
|
|
|
(view == null || view.getInvoiceAmount() == null) ? new BigDecimal(0) : view.getInvoiceAmount(); |
|
|
|
BigDecimal taxAmount = (view == null || view.getTaxAmount() == null) ? new BigDecimal(0) : view.getTaxAmount(); |
|
|
|
BigDecimal taxAmount = (view == null || view.getTaxAmount() == null) ? new BigDecimal(0) : view.getTaxAmount(); |
|
|
|
json.put("sumInvoiceAmount", AmountFormatUtil.fmtMicrometer(MathUtil.round(totalAmount.toPlainString()))); |
|
|
|
json.put("sumInvoiceAmount", AmountFormatUtil.fmtMicrometer(MathUtil.round(totalAmount.toPlainString()))); |
|
|
|
json.put("sumTaxAmount", AmountFormatUtil.fmtMicrometer(MathUtil.round(taxAmount.toPlainString()))); |
|
|
|
json.put("sumTaxAmount", AmountFormatUtil.fmtMicrometer(MathUtil.round(taxAmount.toPlainString()))); |
|
|
@ -157,14 +156,12 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* pojo转为view |
|
|
|
* pojo转为view |
|
|
|
* |
|
|
|
* |
|
|
|
* @param record |
|
|
|
* @param record 请求参数 |
|
|
|
* 请求参数 |
|
|
|
* @param invoiceStatusMap 请求参数 |
|
|
|
* @param invoiceStatusMap |
|
|
|
|
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
* @return 返回结果 |
|
|
|
* @return 返回结果 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private BaseReceiptOutRespVO convertToInvoiceView(BaseReceiptInvoiceView record, |
|
|
|
private BaseReceiptOutRespVO convertToInvoiceView(BaseReceiptInvoiceView record, |
|
|
|
Map<String, String> invoiceStatusMap) { |
|
|
|
Map<String, String> invoiceStatusMap) { |
|
|
|
BaseReceiptOutRespVO vo = new BaseReceiptOutRespVO(); |
|
|
|
BaseReceiptOutRespVO vo = new BaseReceiptOutRespVO(); |
|
|
|
// uuid作为主键
|
|
|
|
// uuid作为主键
|
|
|
|
vo.setId(record.getUuid()); |
|
|
|
vo.setId(record.getUuid()); |
|
|
@ -179,7 +176,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
// 开票日期
|
|
|
|
// 开票日期
|
|
|
|
vo.setInvoiceDate(DateUtils.dateToStr(record.getInvoiceDate())); |
|
|
|
vo.setInvoiceDate(DateUtils.dateToStr(record.getInvoiceDate())); |
|
|
|
// 发票状态
|
|
|
|
// 发票状态
|
|
|
|
vo.setInvoiceStatusName(dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS,record.getInvoiceStatus())); |
|
|
|
vo.setInvoiceStatusName(dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS, record.getInvoiceStatus())); |
|
|
|
// 购方税号
|
|
|
|
// 购方税号
|
|
|
|
vo.setGfsh(record.getGfTaxNo()); |
|
|
|
vo.setGfsh(record.getGfTaxNo()); |
|
|
|
// 购方名称
|
|
|
|
// 购方名称
|
|
|
@ -209,16 +206,13 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据转出类型 set 抵账表中进项税转出相关字段 (部分转出 or 全部转出) |
|
|
|
* 根据转出类型 set 抵账表中进项税转出相关字段 (部分转出 or 全部转出) |
|
|
|
* |
|
|
|
* |
|
|
|
* @param invoices |
|
|
|
* @param invoices 请求参数 |
|
|
|
* 请求参数 |
|
|
|
* @param condVO 请求参数 |
|
|
|
* @param condVO |
|
|
|
* @param userInfo 请求参数 |
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
* @param userInfo |
|
|
|
|
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
* @return 返回结果 |
|
|
|
* @return 返回结果 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private List<BaseTDxRecordInvoice> setPartInvoiceByType(List<BaseTDxRecordInvoice> invoices, |
|
|
|
private List<BaseTDxRecordInvoice> setPartInvoiceByType(List<BaseTDxRecordInvoice> invoices, |
|
|
|
BaseInvoiceEditCondVO condVO, UserInfo userInfo) { |
|
|
|
BaseInvoiceEditCondVO condVO, UserInfo userInfo) { |
|
|
|
List<BaseTDxRecordInvoice> condList = new ArrayList<>(); |
|
|
|
List<BaseTDxRecordInvoice> condList = new ArrayList<>(); |
|
|
|
for (BaseTDxRecordInvoice record : invoices) { |
|
|
|
for (BaseTDxRecordInvoice record : invoices) { |
|
|
|
QueryWrapper<BaseTDxTaxCurrent> queryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<BaseTDxTaxCurrent> queryWrapper = new QueryWrapper<>(); |
|
|
@ -251,7 +245,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
if (JxszcZtEnum.BFZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
|
if (JxszcZtEnum.BFZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
|
// 转出金额累加
|
|
|
|
// 转出金额累加
|
|
|
|
BigDecimal oldOutAmount = |
|
|
|
BigDecimal oldOutAmount = |
|
|
|
record.getOutInvoiceAmout() == null ? new BigDecimal(0) : record.getOutInvoiceAmout(); |
|
|
|
record.getOutInvoiceAmout() == null ? new BigDecimal(0) : record.getOutInvoiceAmout(); |
|
|
|
BigDecimal newOutAmount = oldOutAmount.add(new BigDecimal(condVO.getOutAmount())); |
|
|
|
BigDecimal newOutAmount = oldOutAmount.add(new BigDecimal(condVO.getOutAmount())); |
|
|
|
// -1=小于; 0=等于; 1=大于;
|
|
|
|
// -1=小于; 0=等于; 1=大于;
|
|
|
|
int compareOut = newOutAmount.compareTo(record.getInvoiceAmount()); |
|
|
|
int compareOut = newOutAmount.compareTo(record.getInvoiceAmount()); |
|
|
@ -285,17 +279,13 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 构建进项税转出明细 |
|
|
|
* 构建进项税转出明细 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param condVO |
|
|
|
* @param condVO 请求参数 |
|
|
|
* 请求参数 |
|
|
|
* @param userInfo 请求参数 |
|
|
|
* @param userInfo |
|
|
|
* @param invoice 请求参数 |
|
|
|
* 请求参数 |
|
|
|
* @param record 请求参数 |
|
|
|
* @param invoice |
|
|
|
|
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
* @param record |
|
|
|
|
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void createInvoiceOut(BaseInvoiceEditCondVO condVO, UserInfo userInfo, BaseTDxRecordInvoice invoice, |
|
|
|
private void createInvoiceOut(BaseInvoiceEditCondVO condVO, UserInfo userInfo, BaseTDxRecordInvoice invoice, |
|
|
|
BaseTDxRecordInvoiceOut record) { |
|
|
|
BaseTDxRecordInvoiceOut record) { |
|
|
|
// uuid
|
|
|
|
// uuid
|
|
|
|
record.setUuid(invoice.getUuid()); |
|
|
|
record.setUuid(invoice.getUuid()); |
|
|
|
// 发票号码
|
|
|
|
// 发票号码
|
|
|
@ -317,7 +307,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
if (JxszcZtEnum.BFZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
|
if (JxszcZtEnum.BFZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
|
// 转出金额累加
|
|
|
|
// 转出金额累加
|
|
|
|
BigDecimal oldOutAmount = |
|
|
|
BigDecimal oldOutAmount = |
|
|
|
record.getOutInvoiceAmout() == null ? new BigDecimal(0) : record.getOutInvoiceAmout(); |
|
|
|
record.getOutInvoiceAmout() == null ? new BigDecimal(0) : record.getOutInvoiceAmout(); |
|
|
|
BigDecimal newOutAmount = oldOutAmount.add(new BigDecimal(condVO.getOutAmount())); |
|
|
|
BigDecimal newOutAmount = oldOutAmount.add(new BigDecimal(condVO.getOutAmount())); |
|
|
|
// -1=小于; 0=等于; 1=大于;
|
|
|
|
// -1=小于; 0=等于; 1=大于;
|
|
|
|
int compareOut = newOutAmount.compareTo(invoice.getInvoiceAmount()); |
|
|
|
int compareOut = newOutAmount.compareTo(invoice.getInvoiceAmount()); |
|
|
@ -361,10 +351,8 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* 查询底账表数据,查询转出流水 如果已经有转出流水,则update 如果没有转出流水,则insert 更正底账表转出相关字段 |
|
|
|
* 查询底账表数据,查询转出流水 如果已经有转出流水,则update 如果没有转出流水,则insert 更正底账表转出相关字段 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param condVO |
|
|
|
* @param condVO 请求参数 |
|
|
|
* 请求参数 |
|
|
|
* @param userInfo 请求参数 |
|
|
|
* @param userInfo |
|
|
|
|
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
* @return 返回结果 |
|
|
|
* @return 返回结果 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -379,7 +367,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
// second:根据uuids查询出转出明细并转为map,key=uuid ,value=转出明细
|
|
|
|
// second:根据uuids查询出转出明细并转为map,key=uuid ,value=转出明细
|
|
|
|
List<BaseTDxRecordInvoiceOut> outs = listByUuids(ids); |
|
|
|
List<BaseTDxRecordInvoiceOut> outs = listByUuids(ids); |
|
|
|
Map<String, BaseTDxRecordInvoiceOut> outMap = |
|
|
|
Map<String, BaseTDxRecordInvoiceOut> outMap = |
|
|
|
outs.stream().collect(Collectors.toMap(BaseTDxRecordInvoiceOut::getUuid, tri -> tri)); |
|
|
|
outs.stream().collect(Collectors.toMap(BaseTDxRecordInvoiceOut::getUuid, tri -> tri)); |
|
|
|
|
|
|
|
|
|
|
|
// third:设置底账表中的 进项税转出 部分相关字段
|
|
|
|
// third:设置底账表中的 进项税转出 部分相关字段
|
|
|
|
List<BaseTDxRecordInvoice> condList = setPartInvoiceByType(invoices, condVO, userInfo); |
|
|
|
List<BaseTDxRecordInvoice> condList = setPartInvoiceByType(invoices, condVO, userInfo); |
|
|
@ -406,10 +394,8 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 数据源设置end,事物处理 |
|
|
|
* 数据源设置end,事物处理 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param condList |
|
|
|
* @param condList 请求参数 |
|
|
|
* 请求参数 |
|
|
|
* @param outList 请求参数 |
|
|
|
* @param outList |
|
|
|
|
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void excuteTransferWrite(List<BaseTDxRecordInvoice> condList, List<BaseTDxRecordInvoiceOut> outList) { |
|
|
|
public void excuteTransferWrite(List<BaseTDxRecordInvoice> condList, List<BaseTDxRecordInvoiceOut> outList) { |
|
|
@ -422,8 +408,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 批量update 转出流水 |
|
|
|
* 批量update 转出流水 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param list |
|
|
|
* @param list 请求参数 |
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void saveOrUpdateBatch(List<BaseTDxRecordInvoiceOut> list) { |
|
|
|
private void saveOrUpdateBatch(List<BaseTDxRecordInvoiceOut> list) { |
|
|
|
if (list != null && list.size() > 0) { |
|
|
|
if (list != null && list.size() > 0) { |
|
|
@ -434,8 +419,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据uuids查询进项税转出明细 |
|
|
|
* 根据uuids查询进项税转出明细 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param uuids |
|
|
|
* @param uuids 请求参数 |
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
* @return 返回结果 |
|
|
|
* @return 返回结果 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private List<BaseTDxRecordInvoiceOut> listByUuids(String[] uuids) { |
|
|
|
private List<BaseTDxRecordInvoiceOut> listByUuids(String[] uuids) { |
|
|
@ -447,8 +431,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 取消已转出进项税 请求确认 |
|
|
|
* 取消已转出进项税 请求确认 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param reqVO |
|
|
|
* @param reqVO 请求参数 |
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
* @return 返回结果 |
|
|
|
* @return 返回结果 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -464,8 +447,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 数据库操作 |
|
|
|
* 数据库操作 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param uuids |
|
|
|
* @param uuids 请求参数 |
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void excuteCancelWrite(String[] uuids) { |
|
|
|
public void excuteCancelWrite(String[] uuids) { |
|
|
@ -478,8 +460,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 取消进项税转出,批量revert抵账表已经更新的字段 |
|
|
|
* 取消进项税转出,批量revert抵账表已经更新的字段 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param ids |
|
|
|
* @param ids 请求参数 |
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void updatePartInvoiceForCancel(String[] ids) { |
|
|
|
private void updatePartInvoiceForCancel(String[] ids) { |
|
|
|
List<BaseTDxRecordInvoice> list = baseIReceiptInvoiceService.selectByUuids(ids); |
|
|
|
List<BaseTDxRecordInvoice> list = baseIReceiptInvoiceService.selectByUuids(ids); |
|
|
@ -507,8 +488,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 进项税弹框显示 ,下拉框内容 |
|
|
|
* 进项税弹框显示 ,下拉框内容 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param map |
|
|
|
* @param map 请求参数 |
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
* @return 返回结果 |
|
|
|
* @return 返回结果 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -544,8 +524,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 取消已转出进项税列表 |
|
|
|
* 取消已转出进项税列表 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param reqVO |
|
|
|
* @param reqVO 请求参数 |
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
* @return 返回结果 |
|
|
|
* @return 返回结果 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -585,19 +564,19 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
filter.put("invoiceNo", StringHelper.isBlank(reqVO.getInvoiceNo()) ? null : reqVO.getInvoiceNo()); |
|
|
|
filter.put("invoiceNo", StringHelper.isBlank(reqVO.getInvoiceNo()) ? null : reqVO.getInvoiceNo()); |
|
|
|
// 转出原因
|
|
|
|
// 转出原因
|
|
|
|
filter.put("reasonId", (StringHelper.isBlank(reqVO.getReasonId()) || "99".equals(reqVO.getReasonId())) ? null |
|
|
|
filter.put("reasonId", (StringHelper.isBlank(reqVO.getReasonId()) || "99".equals(reqVO.getReasonId())) ? null |
|
|
|
: reqVO.getReasonId()); |
|
|
|
: reqVO.getReasonId()); |
|
|
|
// 发票状态
|
|
|
|
// 发票状态
|
|
|
|
filter.put("invoiceStatus", |
|
|
|
filter.put("invoiceStatus", |
|
|
|
(StringHelper.isBlank(reqVO.getInvoiceStatus()) || "99".equals(reqVO.getInvoiceStatus())) ? null |
|
|
|
(StringHelper.isBlank(reqVO.getInvoiceStatus()) || "99".equals(reqVO.getInvoiceStatus())) ? null |
|
|
|
: reqVO.getInvoiceStatus()); |
|
|
|
: reqVO.getInvoiceStatus()); |
|
|
|
// 转出开始时间
|
|
|
|
// 转出开始时间
|
|
|
|
filter.put("outStartDate", reqVO.getOutStartDate()); |
|
|
|
filter.put("outStartDate", reqVO.getOutStartDate()); |
|
|
|
// 转出结束时间
|
|
|
|
// 转出结束时间
|
|
|
|
filter.put("outEndDate", reqVO.getOutEndDate()); |
|
|
|
filter.put("outEndDate", reqVO.getOutEndDate()); |
|
|
|
// 业务参数
|
|
|
|
// 业务参数
|
|
|
|
filter.put("businessCode", |
|
|
|
filter.put("businessCode", |
|
|
|
(StringHelper.isBlank(reqVO.getBusinessCode()) || "99".equals(reqVO.getBusinessCode())) ? null |
|
|
|
(StringHelper.isBlank(reqVO.getBusinessCode()) || "99".equals(reqVO.getBusinessCode())) ? null |
|
|
|
: reqVO.getBusinessCode()); |
|
|
|
: reqVO.getBusinessCode()); |
|
|
|
filter.put("company", reqVO.getCompany()); |
|
|
|
filter.put("company", reqVO.getCompany()); |
|
|
|
// 执行查询并排序
|
|
|
|
// 执行查询并排序
|
|
|
|
PageInfo<BaseReceiptInvoiceView> pageInfo = baseIInvoiceOutService.listPageByInvoice(filter); |
|
|
|
PageInfo<BaseReceiptInvoiceView> pageInfo = baseIInvoiceOutService.listPageByInvoice(filter); |
|
|
@ -609,7 +588,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
for (BaseReceiptInvoiceView view : pageInfo.getList()) { |
|
|
|
for (BaseReceiptInvoiceView view : pageInfo.getList()) { |
|
|
|
BaseReceiptOutCancelRespVO vo = convertToInvoiceCancelView(view, invoiceStatusMap); |
|
|
|
BaseReceiptOutCancelRespVO vo = convertToInvoiceCancelView(view, invoiceStatusMap); |
|
|
|
// 序号计算 = (当前页-1)*每页条数+1
|
|
|
|
// 序号计算 = (当前页-1)*每页条数+1
|
|
|
|
vo.setXh((long)((pageInfo.getPageNum() - 1) * pageInfo.getPageSize() + index)); |
|
|
|
vo.setXh((long) ((pageInfo.getPageNum() - 1) * pageInfo.getPageSize() + index)); |
|
|
|
index++; |
|
|
|
index++; |
|
|
|
respVos.add(vo); |
|
|
|
respVos.add(vo); |
|
|
|
} |
|
|
|
} |
|
|
@ -621,7 +600,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
// 合计金额 and 合计税额
|
|
|
|
// 合计金额 and 合计税额
|
|
|
|
BaseReceiptInvoiceView view = baseIInvoiceOutService.querySumForInvoice(filter); |
|
|
|
BaseReceiptInvoiceView view = baseIInvoiceOutService.querySumForInvoice(filter); |
|
|
|
BigDecimal totalAmount = |
|
|
|
BigDecimal totalAmount = |
|
|
|
(view == null || view.getInvoiceAmount() == null) ? new BigDecimal(0) : view.getInvoiceAmount(); |
|
|
|
(view == null || view.getInvoiceAmount() == null) ? new BigDecimal(0) : view.getInvoiceAmount(); |
|
|
|
BigDecimal taxAmount = (view == null || view.getTaxAmount() == null) ? new BigDecimal(0) : view.getTaxAmount(); |
|
|
|
BigDecimal taxAmount = (view == null || view.getTaxAmount() == null) ? new BigDecimal(0) : view.getTaxAmount(); |
|
|
|
json.put("sumInvoiceAmount", AmountFormatUtil.fmtMicrometer(MathUtil.round(totalAmount.toPlainString()))); |
|
|
|
json.put("sumInvoiceAmount", AmountFormatUtil.fmtMicrometer(MathUtil.round(totalAmount.toPlainString()))); |
|
|
|
json.put("sumTaxAmount", AmountFormatUtil.fmtMicrometer(MathUtil.round(taxAmount.toPlainString()))); |
|
|
|
json.put("sumTaxAmount", AmountFormatUtil.fmtMicrometer(MathUtil.round(taxAmount.toPlainString()))); |
|
|
@ -632,14 +611,12 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 取消已转出进项税 pojo转vo |
|
|
|
* 取消已转出进项税 pojo转vo |
|
|
|
* |
|
|
|
* |
|
|
|
* @param record |
|
|
|
* @param record 请求参数 |
|
|
|
* 请求参数 |
|
|
|
* @param invoiceStatusMap 请求参数 |
|
|
|
* @param invoiceStatusMap |
|
|
|
|
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
* @return 返回结果 |
|
|
|
* @return 返回结果 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private BaseReceiptOutCancelRespVO convertToInvoiceCancelView(BaseReceiptInvoiceView record, |
|
|
|
private BaseReceiptOutCancelRespVO convertToInvoiceCancelView(BaseReceiptInvoiceView record, |
|
|
|
Map<String, String> invoiceStatusMap) { |
|
|
|
Map<String, String> invoiceStatusMap) { |
|
|
|
BaseReceiptOutCancelRespVO vo = new BaseReceiptOutCancelRespVO(); |
|
|
|
BaseReceiptOutCancelRespVO vo = new BaseReceiptOutCancelRespVO(); |
|
|
|
// uuid作为主键
|
|
|
|
// uuid作为主键
|
|
|
|
vo.setId(record.getUuid()); |
|
|
|
vo.setId(record.getUuid()); |
|
|
@ -652,7 +629,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
// 开票日期
|
|
|
|
// 开票日期
|
|
|
|
vo.setInvoiceDate(DateUtils.dateToStr(record.getInvoiceDate())); |
|
|
|
vo.setInvoiceDate(DateUtils.dateToStr(record.getInvoiceDate())); |
|
|
|
// 发票状态
|
|
|
|
// 发票状态
|
|
|
|
vo.setInvoiceStatusName(dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS,record.getInvoiceStatus())); |
|
|
|
vo.setInvoiceStatusName(dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS, record.getInvoiceStatus())); |
|
|
|
// 购方税号
|
|
|
|
// 购方税号
|
|
|
|
vo.setGfsh(record.getGfTaxNo()); |
|
|
|
vo.setGfsh(record.getGfTaxNo()); |
|
|
|
// 购方名称
|
|
|
|
// 购方名称
|
|
|
@ -677,16 +654,18 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD |
|
|
|
vo.setReason(reason.getOutReason()); |
|
|
|
vo.setReason(reason.getOutReason()); |
|
|
|
// 认证日期 string类型的长日期转为string类型的短日期
|
|
|
|
// 认证日期 string类型的长日期转为string类型的短日期
|
|
|
|
String certDate = record.getCertDate(); |
|
|
|
String certDate = record.getCertDate(); |
|
|
|
Date date = DateUtils.strToDate(certDate); |
|
|
|
Date date = new Date(); |
|
|
|
vo.setCertDate(DateUtils.dateToStr(date)); |
|
|
|
if (certDate != null) { |
|
|
|
|
|
|
|
date = DateUtils.strToDate(certDate); |
|
|
|
|
|
|
|
vo.setCertDate(DateUtils.dateToStr(date)); |
|
|
|
|
|
|
|
} |
|
|
|
return vo; |
|
|
|
return vo; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 批量将 进项税 明细转为已取消 |
|
|
|
* 批量将 进项税 明细转为已取消 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param uuids |
|
|
|
* @param uuids 请求参数 |
|
|
|
* 请求参数 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void updateBatchByUuid(String[] uuids) { |
|
|
|
private void updateBatchByUuid(String[] uuids) { |
|
|
|
BaseTDxRecordInvoiceOut entity = new BaseTDxRecordInvoiceOut(); |
|
|
|
BaseTDxRecordInvoiceOut entity = new BaseTDxRecordInvoiceOut(); |
|
|
|