|
|
|
@ -65,7 +65,6 @@ public class ImageSubmitServiceImpl implements ImageSubmitService { |
|
|
|
|
uuidList.add(uuid); |
|
|
|
|
paramsInvoiceMap.put(uuid, item); |
|
|
|
|
}); |
|
|
|
|
DynamicContextHolder.push(DbConstant.BUSINESS_WRITE); |
|
|
|
|
QueryWrapper<SdnyTDxRecordInvoice> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.in("uuid", uuidList); |
|
|
|
|
List<SdnyTDxRecordInvoice> invoicesList = tdxRecordInvoiceDao.selectList(queryWrapper); |
|
|
|
@ -85,7 +84,6 @@ public class ImageSubmitServiceImpl implements ImageSubmitService { |
|
|
|
|
String errorMsg = msg.toString(); |
|
|
|
|
return R.error(500, "未查询到如下发票,请重新查验," + errorMsg); |
|
|
|
|
} |
|
|
|
|
DynamicContextHolder.push(DbConstant.DETAIL_WRITE); |
|
|
|
|
QueryWrapper<SdnyTDxRecordInvoiceDetail> detailQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
detailQueryWrapper.in("uuid", uuidList); |
|
|
|
|
List<SdnyTDxRecordInvoiceDetail> detailList = detailDao.selectList(detailQueryWrapper); |
|
|
|
@ -129,8 +127,11 @@ public class ImageSubmitServiceImpl implements ImageSubmitService { |
|
|
|
|
invoicesList.stream().forEach(invoice -> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DynamicContextHolder.push(DbConstant.BUSINESS_WRITE); |
|
|
|
|
SdnyTDxSaleRecordInvoice saleRecordInvoice = sdnyTDxSaleRecordInvoiceDao.selectOne(new QueryWrapper<SdnyTDxSaleRecordInvoice>().eq("uuid", invoice.getUuid())); |
|
|
|
|
List<SdnyTDxSaleRecordInvoice> saleRecordInvoices = sdnyTDxSaleRecordInvoiceDao.selectList(new QueryWrapper<SdnyTDxSaleRecordInvoice>().eq("uuid", invoice.getUuid())); |
|
|
|
|
SdnyTDxSaleRecordInvoice saleRecordInvoice = null; |
|
|
|
|
if (saleRecordInvoices!=null && saleRecordInvoices.size()>0) { |
|
|
|
|
saleRecordInvoice = saleRecordInvoices.get(0); |
|
|
|
|
} |
|
|
|
|
List<SdnyTDxRecordInvoiceDetailSales> salesDetailList = new ArrayList<>(); |
|
|
|
|
detailiMap.get(invoice.getUuid()).stream().forEach(item -> { |
|
|
|
|
SdnyTDxRecordInvoiceDetailSales salesDetail = JsonUtils.getInstance().parseObject(JSONObject.toJSONString(item), SdnyTDxRecordInvoiceDetailSales.class); |
|
|
|
@ -141,7 +142,6 @@ public class ImageSubmitServiceImpl implements ImageSubmitService { |
|
|
|
|
// 新增
|
|
|
|
|
saleRecordInvoice = JsonUtils.getInstance().parseObject(JSONObject.toJSONString(invoice), SdnyTDxSaleRecordInvoice.class); |
|
|
|
|
saleRecordInvoice.setId(null); |
|
|
|
|
DynamicContextHolder.push(DbConstant.BUSINESS_WRITE); |
|
|
|
|
sdnyTDxSaleRecordInvoiceDao.insert(saleRecordInvoice); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
@ -150,10 +150,8 @@ public class ImageSubmitServiceImpl implements ImageSubmitService { |
|
|
|
|
saleRecordInvoice.setBzdh(invoice.getBzdh()); |
|
|
|
|
saleRecordInvoice.setBzr(invoice.getBzr()); |
|
|
|
|
saleRecordInvoice.setCompCode(invoice.getCompCode()); |
|
|
|
|
DynamicContextHolder.push(DbConstant.BUSINESS_WRITE); |
|
|
|
|
sdnyTDxSaleRecordInvoiceDao.updateById(saleRecordInvoice); |
|
|
|
|
} |
|
|
|
|
DynamicContextHolder.push(DbConstant.DETAIL_READ); |
|
|
|
|
detailSalesDao.deleteByUUid(invoice.getUuid()); |
|
|
|
|
detailSalesDao.batchInsert(salesDetailList); |
|
|
|
|
|
|
|
|
@ -169,7 +167,6 @@ public class ImageSubmitServiceImpl implements ImageSubmitService { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R salesInvoiceRollback(SNRequestObject params) { |
|
|
|
|
DynamicContextHolder.push(DbConstant.BUSINESS_WRITE); |
|
|
|
|
List<SdnyTDxSaleRecordInvoice> data = sdnyTDxSaleRecordInvoiceDao.selectList(new QueryWrapper<SdnyTDxSaleRecordInvoice>().eq("image_id", params.getImageId())); |
|
|
|
|
if (data != null && data.size() > 0) { |
|
|
|
|
List<String> uuidList = new ArrayList<>(); |
|
|
|
|