|
|
@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.util.ArrayList;
|
|
|
@@ -130,6 +131,7 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
|
|
|
invAccountOp.setCardName(entCard.getBankName());
|
|
|
invAccountOp.setProfit(entry.getKey());
|
|
|
invAccountOp.setMoney(entry.getValue().toString());
|
|
|
+ invAccountOp.setInvoiceId(invAccountIncoice1.getInvoiceId());
|
|
|
list.add(invAccountOp);
|
|
|
}
|
|
|
|
|
|
@@ -170,6 +172,7 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
|
|
|
invAccountOp.setCardName(outCard.getBankName());
|
|
|
invAccountOp.setProfit(entry.getKey());
|
|
|
invAccountOp.setMoney(entry.getValue().toString());
|
|
|
+ invAccountOp.setInvoiceId(invAccountIncoice1.getInvoiceId());
|
|
|
list.add(invAccountOp);
|
|
|
}
|
|
|
|
|
|
@@ -251,11 +254,17 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
|
|
|
|
|
|
lambdaQuery1.eq(InvAccountOperate::getInvoiceId, invAccountIncoice.getInvoiceId());
|
|
|
|
|
|
+ LambdaQueryWrapper<InvAccountOp> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+
|
|
|
+ lambdaQueryWrapper.eq(InvAccountOp::getInvoiceId, invAccountIncoice.getInvoiceId());
|
|
|
+
|
|
|
+
|
|
|
try {
|
|
|
invAccountIncoiceMapper.updateById(invAccountIncoice);
|
|
|
invAccountCardService.updateBatchById(invAccount);
|
|
|
invAccountOperateService.remove(lambdaQuery);
|
|
|
invAccountOperateService.remove(lambdaQuery1);
|
|
|
+ invAccountOpService.remove(lambdaQueryWrapper);
|
|
|
} catch (Exception e) {
|
|
|
return HttpResult.error("撤销失败");
|
|
|
}
|
|
|
@@ -296,7 +305,17 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
|
|
|
invAccountIncoice.setRate(invAccountIncoice.getRate() + "%");
|
|
|
}
|
|
|
});
|
|
|
- return EasyExcelUtils.downExcel(uploadFilePath, InvAccountIncoice.class, invAccountIncoices);
|
|
|
+ File folder = new File(uploadFilePath);
|
|
|
+ if (folder.exists()){
|
|
|
+ return EasyExcelUtils.downExcel(uploadFilePath, InvAccountIncoice.class, invAccountIncoices);
|
|
|
+ }else {
|
|
|
+ if (folder.mkdirs()){
|
|
|
+ return EasyExcelUtils.downExcel(uploadFilePath, InvAccountIncoice.class, invAccountIncoices);
|
|
|
+ }else {
|
|
|
+ throw new SystemException("文件导出失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|