工作组变更

This commit is contained in:
梁琦涛
2022-04-20 14:54:17 +08:00
parent c3dc3cb2d2
commit dd895ca1b5
4 changed files with 575 additions and 197 deletions
@@ -37,6 +37,7 @@ import com.jero.pack.service.IPayPackCompanyService;
import com.jero.project.common.PayProjectCommon;
import com.jero.project.entity.PayWorkingGroup;
import com.jero.project.entity.PayWorkingGroupSubItem;
import com.jero.project.entity.PayWorkingGroupSubItemContacts;
import com.jero.project.service.IPayWorkingGroupService;
import com.jero.project.service.IPayWorkingGroupSubItemService;
import com.jero.project.vo.SetChargeInput;
@@ -511,7 +512,6 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
}
// Step.1 组装查询条件
QueryWrapper<PayWorkingGroupSubItem> queryWrapper = QueryGenerator.initQueryWrapper(payWorkingGroupSubItem, request.getParameterMap());
// todo 联系人关联表
// Step.2 获取导出数据
List<PayWorkingGroupSubItem> pageList = payWorkingGroupSubItemService.list(queryWrapper);
List<PayWorkingGroupSubItem> exportList;
@@ -528,40 +528,91 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
for (PayWorkingGroupSubItem workingGroupSubItem : exportList) {
PayWorkingGroupSubItemExcel excel = new PayWorkingGroupSubItemExcel();
BeanUtils.copyProperties(workingGroupSubItem,excel);
String contactsTemporaryIdOne = workingGroupSubItem.getContactsTemporaryIdOne();
if (StringUtils.isNotBlank(contactsTemporaryIdOne)){
PayContactsManagementTemporary temporary = payContactsManagementTemporaryService.getById(contactsTemporaryIdOne);
String email = temporary.getEmail();
if (StringUtils.isNotBlank(email)){
excel.setContactsEmailOne(PasswordUtil.decrypt(email));
}
String phone = temporary.getPhone();
if (StringUtils.isNotBlank(phone)){
excel.setContactsPhoneOne(PasswordUtil.decrypt(phone));
}
}
String contactsTemporaryIdTwo = workingGroupSubItem.getContactsTemporaryIdTwo();
if (StringUtils.isNotBlank(contactsTemporaryIdTwo)){
PayContactsManagementTemporary temporary = payContactsManagementTemporaryService.getById(contactsTemporaryIdTwo);
String email = temporary.getEmail();
if (StringUtils.isNotBlank(email)){
excel.setContactsEmailTwo(PasswordUtil.decrypt(email));
}
String phone = temporary.getPhone();
if (StringUtils.isNotBlank(phone)){
excel.setContactsPhoneTwo(PasswordUtil.decrypt(phone));
}
}
String contactsTemporaryIdThree = workingGroupSubItem.getContactsTemporaryIdThree();
if (StringUtils.isNotBlank(contactsTemporaryIdThree)){
PayContactsManagementTemporary temporary = payContactsManagementTemporaryService.getById(contactsTemporaryIdThree);
String email = temporary.getEmail();
if (StringUtils.isNotBlank(email)){
excel.setContactsEmailThree(PasswordUtil.decrypt(email));
}
String phone = temporary.getPhone();
if (StringUtils.isNotBlank(phone)){
excel.setContactsPhoneThree(PasswordUtil.decrypt(phone));
List<PayWorkingGroupSubItemContacts> listPayWorkingGroupSubItemContacts = workingGroupSubItem.getPayWorkingGroupSubItemContactsList();
if(!CollectionUtils.isEmpty(listPayWorkingGroupSubItemContacts)){
listPayWorkingGroupSubItemContacts.sort(Comparator.comparing(PayWorkingGroupSubItemContacts::getOrderNum));
List<String> listIds = listPayWorkingGroupSubItemContacts.stream().map(PayWorkingGroupSubItemContacts::getContactsTemporaryId).collect(Collectors.toList());
List<PayContactsManagementTemporary> listPayContactsManagementTemporary = payContactsManagementTemporaryService.listByIds(listIds);
for (int i = 0; i < listPayWorkingGroupSubItemContacts.size(); i++) {
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = listPayWorkingGroupSubItemContacts.get(i);
List<PayContactsManagementTemporary> temporary = listPayContactsManagementTemporary.stream().filter(s->Objects.equals(s.getId(),payWorkingGroupSubItemContacts.getContactsTemporaryId())).collect(Collectors.toList());
String email = "";
String phone = "";
String name = payWorkingGroupSubItemContacts.getContactsTemporaryName();
String remark = payWorkingGroupSubItemContacts.getRemarks();
if(!CollectionUtils.isEmpty(temporary)){
email = temporary.get(0).getEmail();
if (StringUtils.isNotBlank(email)){
email = PasswordUtil.decrypt(email);
}
phone = temporary.get(0).getPhone();
if (StringUtils.isNotBlank(phone)){
phone = PasswordUtil.decrypt(phone);
}
}
switch (i){
case 0:
excel.setContactsNameOne(name);
excel.setRemarksOne(remark);
excel.setContactsEmailOne(email);
excel.setContactsPhoneOne(phone);
break;
case 1:
excel.setContactsNameTwo(name);
excel.setRemarksTwo(remark);
excel.setContactsEmailTwo(email);
excel.setContactsPhoneTwo(phone);
break;
case 2:
excel.setContactsNameThree(name);
excel.setRemarksThree(remark);
excel.setContactsEmailThree(email);
excel.setContactsPhoneThree(phone);
break;
case 3:
excel.setContactsNameFour(name);
excel.setRemarksFour(remark);
excel.setContactsEmailFour(email);
excel.setContactsPhoneFour(phone);
break;
case 4:
excel.setContactsNameFive(name);
excel.setRemarksFive(remark);
excel.setContactsEmailFive(email);
excel.setContactsPhoneFive(phone);
break;
case 5:
excel.setContactsNameSix(name);
excel.setRemarksSix(remark);
excel.setContactsEmailSix(email);
excel.setContactsPhoneSix(phone);
break;
case 6:
excel.setContactsNameSeven(name);
excel.setRemarksSeven(remark);
excel.setContactsEmailSeven(email);
excel.setContactsPhoneSeven(phone);
break;
case 7:
excel.setContactsNameEight(name);
excel.setRemarksEight(remark);
excel.setContactsEmailEight(email);
excel.setContactsPhoneEight(phone);
break;
case 8:
excel.setContactsNameNine(name);
excel.setRemarksNine(remark);
excel.setContactsEmailNine(email);
excel.setContactsPhoneNine(phone);
break;
case 9:
excel.setContactsNameTen(name);
excel.setRemarksTen(remark);
excel.setContactsEmailTen(email);
excel.setContactsPhoneTen(phone);
break;
default:break;
}
}
}
excelList.add(excel);
@@ -598,7 +649,6 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
if (excelData.isEmpty()) {
throw new JeroBootException("导入数据为空,请填写数据之后重新导入!");
}
// todo 联系人关联表
payWorkingGroupSubItemService.importExcel(request);
return Result.OK("文件导入成功!");
}
@@ -14,7 +14,6 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@@ -68,46 +67,46 @@ public class PayWorkingGroupSubItem implements Serializable {
@ApiModelProperty(value = "临时企业联系人1id")
private java.lang.String contactsTemporaryIdOne;
/**临时企业联系人1名称*/
@Excel(name = "企业联系人1", width = 15)
// @Excel(name = "企业联系人1", width = 15)
@ApiModelProperty(value = "临时企业联系人1名称")
private java.lang.String contactsTemporaryNameOne;
/**联系人1备注*/
@Excel(name = "联系人1备注", width = 15)
@ApiModelProperty(value = "联系人1备注")
@Size(max = 50,message = "联系人1备注长度不能大于50个字符")
private java.lang.String remarksOne;
// @Excel(name = "联系人1备注", width = 15)
// @ApiModelProperty(value = "联系人1备注")
// @Size(max = 50,message = "联系人1备注长度不能大于50个字符")
// private java.lang.String remarksOne;
/**企业联系人2id*/
@ApiModelProperty(value = "企业联系人2id")
// @ApiModelProperty(value = "企业联系人2id")
@Size(max = 32,message = "企业联系人2id长度不能大于32个字符")
private java.lang.String contactsIdTwo;
/**临时企业联系人2id*/
@ApiModelProperty(value = "临时企业联系人2id")
private java.lang.String contactsTemporaryIdTwo;
/**临时企业联系人2名称*/
@Excel(name = "企业联系人2", width = 15)
// @Excel(name = "企业联系人2", width = 15)
@ApiModelProperty(value = "临时企业联系人2名称")
private java.lang.String contactsTemporaryNameTwo;
/**联系人2备注*/
@Excel(name = "联系人2备注", width = 15)
@ApiModelProperty(value = "联系人2备注")
@Size(max = 50,message = "联系人2备注长度不能大于50个字符")
private java.lang.String remarksTwo;
// @Excel(name = "联系人2备注", width = 15)
// @ApiModelProperty(value = "联系人2备注")
// @Size(max = 50,message = "联系人2备注长度不能大于50个字符")
// private java.lang.String remarksTwo;
/**企业联系人3id*/
@ApiModelProperty(value = "企业联系人3id")
// @ApiModelProperty(value = "企业联系人3id")
@Size(max = 32,message = "企业联系人3id长度不能大于32个字符")
private java.lang.String contactsIdThree;
/**临时企业联系人3id*/
@ApiModelProperty(value = "临时企业联系人3id")
private java.lang.String contactsTemporaryIdThree;
/**临时企业联系人3名称*/
@Excel(name = "企业联系人3", width = 15)
// @Excel(name = "企业联系人3", width = 15)
@ApiModelProperty(value = "临时企业联系人3名称")
private java.lang.String contactsTemporaryNameThree;
/**联系人3备注*/
@Excel(name = "联系人3备注", width = 15)
@ApiModelProperty(value = "联系人3备注")
@Size(max = 50,message = "联系人3备注长度不能大于50个字符")
private java.lang.String remarksThree;
// @Excel(name = "联系人3备注", width = 15)
// @ApiModelProperty(value = "联系人3备注")
// @Size(max = 50,message = "联系人3备注长度不能大于50个字符")
// private java.lang.String remarksThree;
/**临时邮寄联系人名称*/
@Excel(name = "邮寄联系人", width = 15)
@ApiModelProperty(value = "临时邮寄联系人名称")
@@ -284,4 +283,115 @@ public class PayWorkingGroupSubItem implements Serializable {
@ApiModelProperty(value = "企业联系人列表")
@TableField(exist = false)
private List<PayWorkingGroupSubItemContacts> payWorkingGroupSubItemContactsList;
/**企业联系人1名称*/
@Excel(name = "企业联系人1", width = 15)
@ApiModelProperty(value = "企业联系人1")
@TableField(exist = false)
private String contactsNameOne;
/**联系人1备注*/
@Excel(name = "联系人1备注", width = 15)
@ApiModelProperty(value = "联系人1备注")
@Size(max = 50,message = "联系人1备注长度不能大于50个字符")
@TableField(exist = false)
private String remarksOne;
/**企业联系人2名称*/
@Excel(name = "企业联系人2", width = 15)
@ApiModelProperty(value = "企业联系人2")
@TableField(exist = false)
private String contactsNameTwo;
/**联系人2备注*/
@Excel(name = "联系人2备注", width = 15)
@ApiModelProperty(value = "联系人2备注")
@Size(max = 50,message = "联系人2备注长度不能大于50个字符")
@TableField(exist = false)
private String remarksTwo;
/**企业联系人3名称*/
@Excel(name = "企业联系人3", width = 15)
@ApiModelProperty(value = "企业联系人3")
@TableField(exist = false)
private String contactsNameThree;
/**联系人3备注*/
@Excel(name = "联系人3备注", width = 15)
@ApiModelProperty(value = "联系人3备注")
@Size(max = 50,message = "联系人3备注长度不能大于50个字符")
@TableField(exist = false)
private String remarksThree;
/**企业联系人4名称*/
@Excel(name = "企业联系人4", width = 15)
@ApiModelProperty(value = "企业联系人4")
@TableField(exist = false)
private String contactsNameFour;
/**联系人4备注*/
@Excel(name = "联系人4备注", width = 15)
@ApiModelProperty(value = "联系人4备注")
@Size(max = 50,message = "联系人4备注长度不能大于50个字符")
@TableField(exist = false)
private String remarksFour;
/**企业联系人5名称*/
@Excel(name = "企业联系人5", width = 15)
@ApiModelProperty(value = "企业联系人5")
@TableField(exist = false)
private String contactsNameFive;
/**联系人5备注*/
@Excel(name = "联系人5备注", width = 15)
@ApiModelProperty(value = "联系人5备注")
@Size(max = 50,message = "联系人5备注长度不能大于50个字符")
@TableField(exist = false)
private String remarksFive;
/**企业联系人6名称*/
@Excel(name = "企业联系人6", width = 15)
@ApiModelProperty(value = "企业联系人6")
@TableField(exist = false)
private String contactsNameSix;
/**联系人6备注*/
@Excel(name = "联系人6备注", width = 15)
@ApiModelProperty(value = "联系人6备注")
@Size(max = 50,message = "联系人6备注长度不能大于50个字符")
@TableField(exist = false)
private String remarksSix;
/**企业联系人7名称*/
@Excel(name = "企业联系人7", width = 15)
@ApiModelProperty(value = "企业联系人7")
@TableField(exist = false)
private String contactsNameSeven;
/**联系人7备注*/
@Excel(name = "联系人7备注", width = 15)
@ApiModelProperty(value = "联系人7备注")
@Size(max = 50,message = "联系人7备注长度不能大于50个字符")
@TableField(exist = false)
private String remarksSeven;
/**企业联系人8名称*/
@Excel(name = "企业联系人8", width = 15)
@ApiModelProperty(value = "企业联系人8")
@TableField(exist = false)
private String contactsNameEight;
/**联系人8备注*/
@Excel(name = "联系人8备注", width = 15)
@ApiModelProperty(value = "联系人8备注")
@Size(max = 50,message = "联系人8备注长度不能大于50个字符")
@TableField(exist = false)
private String remarksEight;
/**企业联系人9名称*/
@Excel(name = "企业联系人9", width = 15)
@ApiModelProperty(value = "企业联系人9")
@TableField(exist = false)
private String contactsNameNine;
/**联系人9备注*/
@Excel(name = "联系人9备注", width = 15)
@ApiModelProperty(value = "联系人9备注")
@Size(max = 50,message = "联系人9备注长度不能大于50个字符")
@TableField(exist = false)
private String remarksNine;
/**企业联系人10名称*/
@Excel(name = "企业联系人10", width = 15)
@ApiModelProperty(value = "企业联系人10")
@TableField(exist = false)
private String contactsNameTen;
/**联系人10备注*/
@Excel(name = "联系人10备注", width = 15)
@ApiModelProperty(value = "联系人10备注")
@Size(max = 50,message = "联系人10备注长度不能大于50个字符")
@TableField(exist = false)
private String remarksTen;
}
@@ -507,20 +507,55 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
// msg.append("excel中企业不存在 ");
// }
List<String> listContactsName = new ArrayList<>();
// 获取excel中联系人名称
List<String> listContactsNameOne = list.stream().map(PayWorkingGroupSubItem::getContactsTemporaryNameOne).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsNameOne)){
listContactsName.addAll(listContactsNameOne);
// 获取excel中联系人1名称
List<String> listContactsName1 = list.stream().map(PayWorkingGroupSubItem::getContactsNameOne).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsName1)){
listContactsName.addAll(listContactsName1);
}
// 获取excel中联系人名称
List<String> listContactsNameTwo = list.stream().map(PayWorkingGroupSubItem::getContactsTemporaryNameTwo).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsNameTwo)){
listContactsName.addAll(listContactsNameTwo);
// 获取excel中联系人2名称
List<String> listContactsName2 = list.stream().map(PayWorkingGroupSubItem::getContactsNameTwo).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsName2)){
listContactsName.addAll(listContactsName2);
}
// 获取excel中联系人名称
List<String> listContactsNameThree = list.stream().map(PayWorkingGroupSubItem::getContactsTemporaryNameThree).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsNameThree)){
listContactsName.addAll(listContactsNameThree);
// 获取excel中联系人3名称
List<String> listContactsName3 = list.stream().map(PayWorkingGroupSubItem::getContactsNameThree).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsName3)){
listContactsName.addAll(listContactsName3);
}
// 获取excel中联系人4名称
List<String> listContactsName4 = list.stream().map(PayWorkingGroupSubItem::getContactsNameFour).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsName4)){
listContactsName.addAll(listContactsName4);
}
// 获取excel中联系人5名称
List<String> listContactsName5 = list.stream().map(PayWorkingGroupSubItem::getContactsNameFive).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsName5)){
listContactsName.addAll(listContactsName5);
}
// 获取excel中联系人6名称
List<String> listContactsName6 = list.stream().map(PayWorkingGroupSubItem::getContactsNameSix).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsName6)){
listContactsName.addAll(listContactsName6);
}
// 获取excel中联系人7名称
List<String> listContactsName7 = list.stream().map(PayWorkingGroupSubItem::getContactsNameSeven).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsName7)){
listContactsName.addAll(listContactsName7);
}
// 获取excel中联系人8名称
List<String> listContactsName8 = list.stream().map(PayWorkingGroupSubItem::getContactsNameEight).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsName8)){
listContactsName.addAll(listContactsName8);
}
// 获取excel中联系人9名称
List<String> listContactsName9 = list.stream().map(PayWorkingGroupSubItem::getContactsNameNine).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsName9)){
listContactsName.addAll(listContactsName9);
}
// 获取excel中联系人10名称
List<String> listContactsName10 = list.stream().map(PayWorkingGroupSubItem::getContactsNameTen).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContactsName10)){
listContactsName.addAll(listContactsName10);
}
// 获取excel中邮寄联系人名称
List<String> listContactsNameMail = list.stream().map(PayWorkingGroupSubItem::getMailContactsTemporaryName).collect(Collectors.toList());
@@ -568,67 +603,9 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
msg.append("").append(count + 3).append("行:工作组成员单位已存在,请修改。<br/>");
}
}
if(!StringUtils.isBlank(p.getContactsTemporaryNameOne()) && !StringUtils.isBlank(p.getContactsTemporaryNameTwo())
&& Objects.equals(p.getContactsTemporaryNameOne(),p.getContactsTemporaryNameTwo())){
msg.append("").append(count + 3).append("行:企业联系人1与企业联系人2重复,请修改。<br/>");
}
if(!StringUtils.isBlank(p.getContactsTemporaryNameOne()) && !StringUtils.isBlank(p.getContactsTemporaryNameThree())
&& Objects.equals(p.getContactsTemporaryNameOne(),p.getContactsTemporaryNameThree())){
msg.append("").append(count + 3).append("行:企业联系人1与企业联系人3重复,请修改。<br/>");
}
if(!StringUtils.isBlank(p.getContactsTemporaryNameTwo()) && !StringUtils.isBlank(p.getContactsTemporaryNameThree())
&& Objects.equals(p.getContactsTemporaryNameTwo(),p.getContactsTemporaryNameThree())){
msg.append("").append(count + 3).append("行:企业联系人2与企业联系人3重复,请修改。<br/>");
}
// 校验联系人一
if (StringUtils.isBlank(p.getContactsTemporaryNameOne())) {
msg.append("").append(count + 3).append("行:企业联系人1不能为空,请修改。<br/>");
} else {
if (!CollectionUtils.isEmpty(listCompany)) {
// 通过联系人获取联系人id
List<PayCompanyManagement> finalListCompany = listCompany;
List<PayContactsManagement> listContacts = listContactsInfo.stream().filter(item ->
Objects.equals(item.getName(), p.getContactsTemporaryNameOne())
&& Objects.equals(item.getCompanyId(), finalListCompany.get(0).getId())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(listContacts)) {
msg.append("").append(count + 3).append("行:该企业下不存在企业联系人1,请修改。<br/>");
} else {
p.setContactsIdOne(listContacts.get(0).getId());
}
}
}
// 校验联系人二
if (!StringUtils.isBlank(p.getContactsTemporaryNameTwo()) && !CollectionUtils.isEmpty(listCompany)) {
if (!CollectionUtils.isEmpty(listCompany)) {
// 通过联系人获取联系人id
List<PayCompanyManagement> finalListCompany = listCompany;
List<PayContactsManagement> listContacts = listContactsInfo.stream().filter(item ->
Objects.equals(item.getName(), p.getContactsTemporaryNameTwo())
&& Objects.equals(item.getCompanyId(), finalListCompany.get(0).getId())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(listContacts)) {
msg.append("").append(count + 3).append("行:该企业下不存在企业联系人2,请修改。<br/>");
} else {
p.setContactsIdTwo(listContacts.get(0).getId());
}
}
}
// 校验联系人三
if (!StringUtils.isBlank(p.getContactsTemporaryNameThree()) && !CollectionUtils.isEmpty(listCompany)) {
if (!CollectionUtils.isEmpty(listCompany)) {
// 通过联系人获取联系人id
List<PayCompanyManagement> finalListCompany = listCompany;
List<PayContactsManagement> listContacts = listContactsInfo.stream().filter(item ->
Objects.equals(item.getName(), p.getContactsTemporaryNameThree())
&& Objects.equals(item.getCompanyId(), finalListCompany.get(0).getId())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(listContacts)) {
msg.append("").append(count + 3).append("行:该企业下不存在企业联系人3,请修改。<br/>");
} else {
p.setContactsIdThree(listContacts.get(0).getId());
}
}
}
// 校验重复
List<PayWorkingGroupSubItemContacts> listPayWorkingGroupSubItemContacts = checkRepeat(p,msg,count,listCompany,listContactsInfo);
p.setPayWorkingGroupSubItemContactsList(listPayWorkingGroupSubItemContacts);
// 校验邮寄联系人
if (StringUtils.isBlank(p.getMailContactsTemporaryName())) {
msg.append("").append(count + 3).append("行:邮寄联系人不能为空,请修改。<br/>");
@@ -707,6 +684,14 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
// 更新数据
payWorkingGroupSubItemService.saveBatch(list);
list.forEach(p->{
List<PayWorkingGroupSubItemContacts> listPayWorkingGroupSubItemContacts = p.getPayWorkingGroupSubItemContactsList();
if(!CollectionUtils.isEmpty(listPayWorkingGroupSubItemContacts)){
listPayWorkingGroupSubItemContacts.forEach(s->{
s.setWorkingGroupId(p.getWorkingGroupId());
s.setWorkingGroupSubId(p.getId());
});
payWorkingGroupSubItemContactsService.saveBatch(listPayWorkingGroupSubItemContacts);
}
PayIncomeContract payIncomeContract = p.getPayIncomeContract();
if(Objects.isNull(payIncomeContract)){
return;
@@ -746,6 +731,86 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
}
}
}
/**
* @Description // 验证重复
* @Date 2022/4/20 10:26
* @param p
* @param msg
* @param count 行数
* @param listCompany 企业集合
* @param listContactsInfo 联系人集合
* @return java.lang.String
*/
private List<PayWorkingGroupSubItemContacts> checkRepeat(PayWorkingGroupSubItem p,StringBuilder msg,int count,List<PayCompanyManagement> listCompany,List<PayContactsManagement> listContactsInfo){
List<PayWorkingGroupSubItemContacts> list = new ArrayList<>();
HashMap<String,Integer> map = new HashMap<>();
if(!StringUtils.isBlank(p.getContactsNameOne())){
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = setContactsId(msg,p.getContactsNameOne(),1,count,listCompany,listContactsInfo,map);
list.add(payWorkingGroupSubItemContacts);
}else{
msg.append("").append(count + 3).append("行:企业联系人1不能为空,请修改。<br/>");
}
if(!StringUtils.isBlank(p.getContactsNameTwo())){
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = setContactsId(msg,p.getContactsNameTwo(),2,count,listCompany,listContactsInfo,map);
list.add(payWorkingGroupSubItemContacts);
}
if(!StringUtils.isBlank(p.getContactsNameThree())){
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = setContactsId(msg,p.getContactsNameThree(),3,count,listCompany,listContactsInfo,map);
list.add(payWorkingGroupSubItemContacts);
}
if(!StringUtils.isBlank(p.getContactsNameFour())){
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = setContactsId(msg,p.getContactsNameFour(),4,count,listCompany,listContactsInfo,map);
list.add(payWorkingGroupSubItemContacts);
}
if(!StringUtils.isBlank(p.getContactsNameFive())){
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = setContactsId(msg,p.getContactsNameFive(),5,count,listCompany,listContactsInfo,map);
list.add(payWorkingGroupSubItemContacts);
}
if(!StringUtils.isBlank(p.getContactsNameSix())){
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = setContactsId(msg,p.getContactsNameSix(),6,count,listCompany,listContactsInfo,map);
list.add(payWorkingGroupSubItemContacts);
}
if(!StringUtils.isBlank(p.getContactsNameSeven())){
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = setContactsId(msg,p.getContactsNameSeven(),7,count,listCompany,listContactsInfo,map);
list.add(payWorkingGroupSubItemContacts);
}
if(!StringUtils.isBlank(p.getContactsNameEight())){
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = setContactsId(msg,p.getContactsNameEight(),8,count,listCompany,listContactsInfo,map);
list.add(payWorkingGroupSubItemContacts);
}
if(!StringUtils.isBlank(p.getContactsNameNine())){
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = setContactsId(msg,p.getContactsNameNine(),9,count,listCompany,listContactsInfo,map);
list.add(payWorkingGroupSubItemContacts);
}
if(!StringUtils.isBlank(p.getContactsNameTen())){
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = setContactsId(msg,p.getContactsNameTen(),10,count,listCompany,listContactsInfo,map);
list.add(payWorkingGroupSubItemContacts);
}
return list;
}
private PayWorkingGroupSubItemContacts setContactsId(StringBuilder msg,String name,int num,int count,List<PayCompanyManagement> listCompany,List<PayContactsManagement> listContactsInfo,HashMap<String,Integer> map){
PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts = new PayWorkingGroupSubItemContacts();
if(map.containsKey(name)){
int c = map.get(name);
msg.append("").append(count + 3).append("行:企业联系人").append(c).append("与企业联系人3重复,请修改。<br/>");
}else{
map.put(name,3);
}
if (!CollectionUtils.isEmpty(listCompany)) {
// 通过联系人获取联系人id
List<PayContactsManagement> listContacts = listContactsInfo.stream().filter(item ->
Objects.equals(item.getName(), name)
&& Objects.equals(item.getCompanyId(), listCompany.get(0).getId())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(listContacts)) {
msg.append("").append(count + 3).append("行:该企业下不存在企业联系人").append(num).append(",请修改。<br/>");
} else {
payWorkingGroupSubItemContacts.setContactsId(listContacts.get(0).getId());
}
}
return payWorkingGroupSubItemContacts;
}
@Override
@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import javax.validation.constraints.DecimalMax;
import java.io.Serializable;
import java.math.BigDecimal;
@@ -26,75 +25,6 @@ public class PayWorkingGroupSubItemExcel implements Serializable {
@ApiModelProperty(value = "临时成员单位")
private String chargeCompanyTemporaryName;
/**
* 临时企业联系人1名称
*/
@Excel(name = "企业联系人1", width = 15)
@ApiModelProperty(value = "临时企业联系人1名称")
private String contactsTemporaryNameOne;
/**
* 企业联系人1手机号
*/
@Excel(name = "企业联系人1手机号", width = 17)
private String contactsPhoneOne;
/**
* 企业联系人1邮箱
*/
@Excel(name = "企业联系人1邮箱", width = 15)
private String contactsEmailOne;
/**
* 联系人1备注
*/
@Excel(name = "联系人1备注", width = 15)
@ApiModelProperty(value = "联系人1备注")
private String remarksOne;
/**
* 临时企业联系人2名称
*/
@Excel(name = "企业联系人2", width = 15)
@ApiModelProperty(value = "临时企业联系人2名称")
private String contactsTemporaryNameTwo;
/**
* 企业联系人2手机号
*/
@Excel(name = "企业联系人2手机号", width = 17)
private String contactsPhoneTwo;
/**
* 企业联系人2邮箱
*/
@Excel(name = "企业联系人2邮箱", width = 15)
private String contactsEmailTwo;
/**
* 联系人2备注
*/
@Excel(name = "联系人2备注", width = 15)
@ApiModelProperty(value = "联系人2备注")
private String remarksTwo;
/**
* 临时企业联系人3名称
*/
@Excel(name = "企业联系人3", width = 15)
@ApiModelProperty(value = "临时企业联系人3名称")
private String contactsTemporaryNameThree;
/**
* 企业联系人3手机号
*/
@Excel(name = "企业联系人3手机号", width = 17)
private String contactsPhoneThree;
/**
* 企业联系人3邮箱
*/
@Excel(name = "企业联系人3邮箱", width = 15)
private String contactsEmailThree;
/**
* 联系人3备注
*/
@Excel(name = "联系人3备注", width = 15)
@ApiModelProperty(value = "联系人3备注")
private String remarksThree;
/**
* 临时邮寄联系人名称
*/
@@ -138,4 +68,227 @@ public class PayWorkingGroupSubItemExcel implements Serializable {
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remarks;
/**
* 企业联系人1名称
*/
@Excel(name = "企业联系人1", width = 15)
@ApiModelProperty(value = "企业联系人1名称")
private String contactsNameOne;
/**
* 企业联系人1手机号
*/
@Excel(name = "企业联系人1手机号", width = 15)
private String contactsPhoneOne;
/**
* 企业联系人1邮箱
*/
@Excel(name = "企业联系人1邮箱", width = 15)
private String contactsEmailOne;
/**
* 联系人1备注
*/
@Excel(name = "联系人1备注", width = 15)
@ApiModelProperty(value = "联系人1备注")
private String remarksOne;
/**
* 企业联系人2名称
*/
@Excel(name = "企业联系人2", width = 15)
@ApiModelProperty(value = "企业联系人2名称")
private String contactsNameTwo;
/**
* 企业联系人2手机号
*/
@Excel(name = "企业联系人2手机号", width = 15)
private String contactsPhoneTwo;
/**
* 企业联系人2邮箱
*/
@Excel(name = "企业联系人2邮箱", width = 15)
private String contactsEmailTwo;
/**
* 联系人2备注
*/
@Excel(name = "联系人2备注", width = 15)
@ApiModelProperty(value = "联系人2备注")
private String remarksTwo;
/**
* 企业联系人3名称
*/
@Excel(name = "企业联系人3", width = 15)
@ApiModelProperty(value = "企业联系人3名称")
private String contactsNameThree;
/**
* 企业联系人3手机号
*/
@Excel(name = "企业联系人3手机号", width = 15)
private String contactsPhoneThree;
/**
* 企业联系人3邮箱
*/
@Excel(name = "企业联系人3邮箱", width = 15)
private String contactsEmailThree;
/**
* 联系人3备注
*/
@Excel(name = "联系人3备注", width = 15)
@ApiModelProperty(value = "联系人3备注")
private String remarksThree;
/**
* 企业联系人4名称
*/
@Excel(name = "企业联系人4", width = 15)
@ApiModelProperty(value = "企业联系人4名称")
private String contactsNameFour;
/**
* 企业联系人4手机号
*/
@Excel(name = "企业联系人4手机号", width = 15)
private String contactsPhoneFour;
/**
* 企业联系人4邮箱
*/
@Excel(name = "企业联系人4邮箱", width = 15)
private String contactsEmailFour;
/**
* 联系人4备注
*/
@Excel(name = "联系人4备注", width = 15)
@ApiModelProperty(value = "联系人4备注")
private String remarksFour;
/**
* 企业联系人5名称
*/
@Excel(name = "企业联系人5", width = 15)
@ApiModelProperty(value = "企业联系人5名称")
private String contactsNameFive;
/**
* 企业联系人5手机号
*/
@Excel(name = "企业联系人5手机号", width = 15)
private String contactsPhoneFive;
/**
* 企业联系人5邮箱
*/
@Excel(name = "企业联系人5邮箱", width = 15)
private String contactsEmailFive;
/**
* 联系人5备注
*/
@Excel(name = "联系人5备注", width = 15)
@ApiModelProperty(value = "联系人5备注")
private String remarksFive;
/**
* 企业联系人6名称
*/
@Excel(name = "企业联系人6", width = 15)
@ApiModelProperty(value = "企业联系人6名称")
private String contactsNameSix;
/**
* 企业联系人6手机号
*/
@Excel(name = "企业联系人6手机号", width = 15)
private String contactsPhoneSix;
/**
* 企业联系人6邮箱
*/
@Excel(name = "企业联系人6邮箱", width = 15)
private String contactsEmailSix;
/**
* 联系人6备注
*/
@Excel(name = "联系人6备注", width = 15)
@ApiModelProperty(value = "联系人6备注")
private String remarksSix;
/**
* 企业联系人7名称
*/
@Excel(name = "企业联系人7", width = 15)
@ApiModelProperty(value = "企业联系人7名称")
private String contactsNameSeven;
/**
* 企业联系人7手机号
*/
@Excel(name = "企业联系人7手机号", width = 15)
private String contactsPhoneSeven;
/**
* 企业联系人7邮箱
*/
@Excel(name = "企业联系人7邮箱", width = 15)
private String contactsEmailSeven;
/**
* 联系人7备注
*/
@Excel(name = "联系人7备注", width = 15)
@ApiModelProperty(value = "联系人7备注")
private String remarksSeven;
/**
* 企业联系人8名称
*/
@Excel(name = "企业联系人8", width = 15)
@ApiModelProperty(value = "企业联系人8名称")
private String contactsNameEight;
/**
* 企业联系人8手机号
*/
@Excel(name = "企业联系人8手机号", width = 15)
private String contactsPhoneEight;
/**
* 企业联系人8邮箱
*/
@Excel(name = "企业联系人8邮箱", width = 15)
private String contactsEmailEight;
/**
* 联系人8备注
*/
@Excel(name = "联系人8备注", width = 15)
@ApiModelProperty(value = "联系人8备注")
private String remarksEight;
/**
* 企业联系人9名称
*/
@Excel(name = "企业联系人9", width = 15)
@ApiModelProperty(value = "企业联系人9名称")
private String contactsNameNine;
/**
* 企业联系人9手机号
*/
@Excel(name = "企业联系人9手机号", width = 15)
private String contactsPhoneNine;
/**
* 企业联系人9邮箱
*/
@Excel(name = "企业联系人9邮箱", width = 15)
private String contactsEmailNine;
/**
* 联系人9备注
*/
@Excel(name = "联系人9备注", width = 15)
@ApiModelProperty(value = "联系人9备注")
private String remarksNine;
/**
* 企业联系人10名称
*/
@Excel(name = "企业联系人10", width = 15)
@ApiModelProperty(value = "企业联系人10名称")
private String contactsNameTen;
/**
* 企业联系人10手机号
*/
@Excel(name = "企业联系人10手机号", width = 15)
private String contactsPhoneTen;
/**
* 企业联系人10邮箱
*/
@Excel(name = "企业联系人10邮箱", width = 15)
private String contactsEmailTen;
/**
* 联系人10备注
*/
@Excel(name = "联系人10备注", width = 15)
@ApiModelProperty(value = "联系人10备注")
private String remarksTen;
}