|
@@ -135,8 +135,8 @@ public class BizArchiveInputServiceImpl extends ServiceImpl<BizArchiveInputMappe
|
|
|
Long userId = SecurityUtils.getUserId();
|
|
|
List<BizArchiveInputDetail> details = archiveInputDetailService.query().eq("contract_id", bizArchiveInput.getId()).list();
|
|
|
details.forEach(l -> {
|
|
|
- BizArchiveInputDetail detail = bizArchiveInput.getDetails().stream().filter(v -> v.getId().equals(l.getId())).findFirst().orElse(l);
|
|
|
- l.setRedirect(detail.getRedirect() != null ? detail.getRedirect() : false);
|
|
|
+// BizArchiveInputDetail detail = bizArchiveInput.getDetails().stream().filter(v -> v.getId().equals(l.getId())).findFirst().orElse(l);
|
|
|
+ l.setRedirect(l.getRedirect() != null ? l.getRedirect() : false);
|
|
|
});
|
|
|
List<BizArchiveInputDetailProcess> processes = archiveInputDetailProcessService.query().eq("contract_id", bizArchiveInput.getId()).list();
|
|
|
List<BizWorkOrder> newWorkOrders = new ArrayList<>();
|
|
@@ -1321,7 +1321,7 @@ public class BizArchiveInputServiceImpl extends ServiceImpl<BizArchiveInputMappe
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String importLoopNew(@Validated List<OrderExcelImportLoopNewModel> orderList, Long userId, long tenantId) {
|
|
|
+ public String importLoopNew(@Validated List<OrderExcelImportLoopNewModel> orderList, Long userId, long tenantId, Integer renew) {
|
|
|
if (StringUtils.isNull(orderList) || orderList.size() == 0) {
|
|
|
throw new ServiceException("导入数据不能为空!");
|
|
|
}
|
|
@@ -1717,10 +1717,22 @@ public class BizArchiveInputServiceImpl extends ServiceImpl<BizArchiveInputMappe
|
|
|
successMsg.append("<br/>").append(successNum).append("、订单 ").append(item.getContractNo()).append(" 导入成功");
|
|
|
}
|
|
|
super.saveBatch(archiveInputs);
|
|
|
+
|
|
|
+
|
|
|
archiveInputDetailService.saveBatch(archiveInputDetails);
|
|
|
- workOrderService.saveBatch(bizWorkOrders);
|
|
|
- workOrderDetailService.saveBatch(bizWorkOrderDetails);
|
|
|
- bizWorkOrders.forEach(this::addLoopTasks);
|
|
|
+
|
|
|
+ if(renew == 1) {
|
|
|
+ for(BizArchiveInput bizArchiveInput : archiveInputs) {
|
|
|
+ BizArchiveInput byId = getById(bizArchiveInput.getId());
|
|
|
+ verify(byId);
|
|
|
+ saveDetailMonth(byId);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ workOrderService.saveBatch(bizWorkOrders);
|
|
|
+ workOrderDetailService.saveBatch(bizWorkOrderDetails);
|
|
|
+ bizWorkOrders.forEach(this::addLoopTasks);
|
|
|
+ }
|
|
|
+
|
|
|
archiveInputs.forEach(this::saveDetailMonth);
|
|
|
if (failureNum > 0) {
|
|
|
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|