[修改]起草组管理--成员单位-导入-导入后备注1--备注10没有回显

This commit is contained in:
sunzheng
2024-01-15 12:00:53 +08:00
parent 1782b6d521
commit e50bd748e7
@@ -589,7 +589,7 @@ public class PayDraftingGroupSubItemServiceImpl extends ServiceImpl<PayDraftingG
msg.append("起草组不存在 ");
}
if(StringUtils.isBlank(msg)) {
// 获取工作组成员
// 获取起草组成员
LambdaQueryWrapper<PayDraftingGroupSubItem> query = new LambdaQueryWrapper<>();
query.eq(PayDraftingGroupSubItem::getDraftingGroupId, draftGroupId);
List<PayDraftingGroupSubItem> listData = payDraftingGroupSubItemService.list(query);
@@ -610,7 +610,7 @@ public class PayDraftingGroupSubItemServiceImpl extends ServiceImpl<PayDraftingG
p.setChargeCompanyId(listCompany.get(0).getId());
}
}
// 校验工作组成员单位是否已存在(是否重复)
// 校验起草组成员单位是否已存在(是否重复)
if (!StringUtils.isBlank(p.getChargeCompanyId())) {
List<PayDraftingGroupSubItem> listDateNew = listData.stream().filter(item -> Objects.equals(p.getChargeCompanyId(), item.getChargeCompanyId())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(listDateNew)) {
@@ -638,6 +638,8 @@ public class PayDraftingGroupSubItemServiceImpl extends ServiceImpl<PayDraftingG
// 更新数据
payDraftingGroupSubItemService.saveBatch(list);
list.forEach(p->{
// 处理联系人的备注字段
List<String> remarks = dealRemarkField(p);
String draftingGroupSubItemId = p.getId();
List<PayDraftingGroupSubItemContacts> listPayDraftingGroupSubItemContacts = p.getPayDraftingGroupSubItemContactsList();
if(!CollectionUtils.isEmpty(listPayDraftingGroupSubItemContacts)){
@@ -645,6 +647,8 @@ public class PayDraftingGroupSubItemServiceImpl extends ServiceImpl<PayDraftingG
listPayDraftingGroupSubItemContacts.get(i).setDraftingGroupId(p.getDraftingGroupId());
listPayDraftingGroupSubItemContacts.get(i).setDraftingGroupSubId(draftingGroupSubItemId);
listPayDraftingGroupSubItemContacts.get(i).setOrderNum(i + 1);
listPayDraftingGroupSubItemContacts.get(i).setRemarks(remarks.get(i));
}
payDraftingGroupSubItemContactsService.saveBatch(listPayDraftingGroupSubItemContacts);
}
@@ -668,6 +672,22 @@ public class PayDraftingGroupSubItemServiceImpl extends ServiceImpl<PayDraftingG
}
}
// 处理联系人的remark字段
public List<String> dealRemarkField(PayDraftingGroupSubItem p) {
ArrayList<String> arrayList = new ArrayList<>();
arrayList.add(p.getRemarksOne());
arrayList.add(p.getRemarksTwo());
arrayList.add(p.getRemarksThree());
arrayList.add(p.getRemarksFour());
arrayList.add(p.getRemarksFive());
arrayList.add(p.getRemarksSix());
arrayList.add(p.getRemarksSeven());
arrayList.add(p.getRemarksEight());
arrayList.add(p.getRemarksNine());
arrayList.add(p.getRemarksTen());
return arrayList;
}
/**
* 验证重复
* @param p