销项发票提交

release
王琦 2 years ago
parent 4bd8bc3d09
commit 8e9fbbdff1
  1. 24
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ImageSubmitServiceImpl.java

@ -164,19 +164,19 @@ public class ImageSubmitServiceImpl implements ImageSubmitService {
public R salesInvoiceRollback(SNRequestObject params) { public R salesInvoiceRollback(SNRequestObject params) {
DynamicContextHolder.push(DbConstant.BUSINESS_WRITE); DynamicContextHolder.push(DbConstant.BUSINESS_WRITE);
List<SdnyTDxSaleRecordInvoice> data = sdnyTDxSaleRecordInvoiceDao.selectList(new QueryWrapper<SdnyTDxSaleRecordInvoice>().eq("image_id", params.getImageId())); List<SdnyTDxSaleRecordInvoice> data = sdnyTDxSaleRecordInvoiceDao.selectList(new QueryWrapper<SdnyTDxSaleRecordInvoice>().eq("image_id", params.getImageId()));
if (data == null || data.size() == 0) { if (data != null && data.size() > 0) {
return R.error(500, "影像ID不存在"); List<String> uuidList = new ArrayList<>();
data.stream().forEach(item -> {
uuidList.add(item.getUuid());
});
UpdateWrapper<SdnyTDxSaleRecordInvoice> updateWrapper = new UpdateWrapper<>();
updateWrapper.set(true, "image_id", null);
updateWrapper.set(true, "bzdh", null);
updateWrapper.set(true, "bzr", null);
updateWrapper.in("uuid", uuidList);
sdnyTDxSaleRecordInvoiceDao.update(null,updateWrapper);
} }
List<String> uuidList = new ArrayList<>(); // 影像调用提交前会先调用撤回 不管发票有没有这个影像ID都调一遍SAP
data.stream().forEach(item -> {
uuidList.add(item.getUuid());
});
UpdateWrapper<SdnyTDxSaleRecordInvoice> updateWrapper = new UpdateWrapper<>();
updateWrapper.set(true, "image_id", null);
updateWrapper.set(true, "bzdh", null);
updateWrapper.set(true, "bzr", null);
updateWrapper.in("uuid", uuidList);
sdnyTDxSaleRecordInvoiceDao.update(null,updateWrapper);
return pushSap(null, params); return pushSap(null, params);
} }

Loading…
Cancel
Save