|
@@ -2134,6 +2134,7 @@ public class ExpenseOrderServiceImpl implements ExpenseOrderService {
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Transactional
|
|
|
public void batchGenerateExpenseBill(ExpenseOrderSaveVO saveVO, String taskId) {
|
|
public void batchGenerateExpenseBill(ExpenseOrderSaveVO saveVO, String taskId) {
|
|
|
Long tenantId = saveVO.getTenantId();
|
|
Long tenantId = saveVO.getTenantId();
|
|
|
String billingMonth = saveVO.getBillingMonth();
|
|
String billingMonth = saveVO.getBillingMonth();
|
|
@@ -2308,27 +2309,40 @@ public class ExpenseOrderServiceImpl implements ExpenseOrderService {
|
|
|
|
|
|
|
|
// 账单不存在
|
|
// 账单不存在
|
|
|
if (expenseOrder == null) {
|
|
if (expenseOrder == null) {
|
|
|
- handleNewExpenseOrder(elderlyInfo, elderId, tenantId, billingMonth, billYearMonth, expireYearMonth, expireTime);
|
|
|
|
|
- if (!checkContractNearlyExpire(elderId, billingMonth)) {
|
|
|
|
|
|
|
+ try{
|
|
|
|
|
+ handleNewExpenseOrder(elderlyInfo, elderId, tenantId, billingMonth, billYearMonth, expireYearMonth, expireTime);
|
|
|
|
|
+ if (!checkContractNearlyExpire(elderId, billingMonth)) {
|
|
|
|
|
+ if (taskId != null) {
|
|
|
|
|
+ taskStatusManager.addProcessDetail(taskId, elderlyInfo.getId(), elderlyInfo.getElderName(), "CONFIRM", "合同即将过期,请确认");
|
|
|
|
|
+ }
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
if (taskId != null) {
|
|
if (taskId != null) {
|
|
|
- taskStatusManager.addProcessDetail(taskId, elderlyInfo.getId(), elderlyInfo.getElderName(), "CONFIRM", "合同即将过期,请确认");
|
|
|
|
|
|
|
+ taskStatusManager.addProcessDetail(taskId, elderlyInfo.getId(), elderlyInfo.getElderName(), "SUCCESS", "新账单生成成功");
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ if (taskId != null) {
|
|
|
|
|
+ taskStatusManager.addProcessDetail(taskId, elderlyInfo.getId(), elderlyInfo.getElderName(), "SKIPPED", e.getMessage());
|
|
|
}
|
|
}
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- if (taskId != null) {
|
|
|
|
|
- taskStatusManager.addProcessDetail(taskId, elderlyInfo.getId(), elderlyInfo.getElderName(), "SUCCESS", "新账单生成成功");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
- // 账单存在,添加未缴费的日常费用
|
|
|
|
|
- handleExistingExpenseOrder(expenseOrder, elderId, tenantId, billingMonth, true);
|
|
|
|
|
- if (!checkContractNearlyExpire(elderId, billingMonth)) {
|
|
|
|
|
|
|
+ try{
|
|
|
|
|
+ // 账单存在,添加未缴费的日常费用
|
|
|
|
|
+ handleExistingExpenseOrder(expenseOrder, elderId, tenantId, billingMonth, true);
|
|
|
|
|
+ if (!checkContractNearlyExpire(elderId, billingMonth)) {
|
|
|
|
|
+ if (taskId != null) {
|
|
|
|
|
+ taskStatusManager.addProcessDetail(taskId, elderlyInfo.getId(), elderlyInfo.getElderName(), "CONFIRM", "合同即将过期,请确认");
|
|
|
|
|
+ }
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
if (taskId != null) {
|
|
if (taskId != null) {
|
|
|
- taskStatusManager.addProcessDetail(taskId, elderlyInfo.getId(), elderlyInfo.getElderName(), "CONFIRM", "合同即将过期,请确认");
|
|
|
|
|
|
|
+ taskStatusManager.addProcessDetail(taskId, elderlyInfo.getId(), elderlyInfo.getElderName(), "SUCCESS", "现有账单更新成功");
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ if (taskId != null) {
|
|
|
|
|
+ taskStatusManager.addProcessDetail(taskId, elderlyInfo.getId(), elderlyInfo.getElderName(), "SKIPPED", e.getMessage());
|
|
|
}
|
|
}
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- if (taskId != null) {
|
|
|
|
|
- taskStatusManager.addProcessDetail(taskId, elderlyInfo.getId(), elderlyInfo.getElderName(), "SUCCESS", "现有账单更新成功");
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|