工作组变更
This commit is contained in:
+85
@@ -0,0 +1,85 @@
|
||||
package com.jero.project.controller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.project.entity.PayWorkingGroupSubItemContacts;
|
||||
import com.jero.project.service.IPayWorkingGroupSubItemContactsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 成员联系人
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-04-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="成员联系人")
|
||||
@RestController
|
||||
@RequestMapping("/project/PayWorkingGroupSubItemContacts")
|
||||
@Slf4j
|
||||
public class PayWorkingGroupSubItemContactsController extends JeroController<PayWorkingGroupSubItemContacts, IPayWorkingGroupSubItemContactsService> {
|
||||
@Resource
|
||||
private IPayWorkingGroupSubItemContactsService payWorkingGroupSubItemContactsService;
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param payWorkingGroupSubItemContacts
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "成员联系人-添加")
|
||||
@ApiOperation(value="成员联系人-添加", notes="成员联系人-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts) {
|
||||
payWorkingGroupSubItemContactsService.save(payWorkingGroupSubItemContacts);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param payWorkingGroupSubItemContacts
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "成员联系人-编辑")
|
||||
@ApiOperation(value="成员联系人-编辑", notes="成员联系人-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody PayWorkingGroupSubItemContacts payWorkingGroupSubItemContacts) {
|
||||
payWorkingGroupSubItemContactsService.updateById(payWorkingGroupSubItemContacts);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "成员联系人-通过id删除")
|
||||
@ApiOperation(value="成员联系人-通过id删除", notes="成员联系人-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id") String id) {
|
||||
payWorkingGroupSubItemContactsService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "成员联系人-批量删除")
|
||||
@ApiOperation(value="成员联系人-批量删除", notes="成员联系人-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids") String ids) {
|
||||
payWorkingGroupSubItemContactsService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -48,7 +48,6 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -168,6 +167,7 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
||||
return Result.error("没有查到用户信息!");
|
||||
}
|
||||
List<String> listProjectIds = new ArrayList<>();
|
||||
// todo 关联企业联系人表
|
||||
// 工作组的企业联系人1,2,3
|
||||
LambdaQueryWrapper<PayWorkingGroupSubItem> queryPayWorkingGroupSubItem = new LambdaQueryWrapper<>();
|
||||
queryPayWorkingGroupSubItem.eq(PayWorkingGroupSubItem::getContactsIdOne,sysUser.getId()).or()
|
||||
|
||||
+7
@@ -20,6 +20,7 @@ import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: pay_working_group_subitem
|
||||
@@ -277,4 +278,10 @@ public class PayWorkingGroupSubItem implements Serializable {
|
||||
@ApiModelProperty(value = "任务及目标")
|
||||
@TableField(exist = false)
|
||||
private String missionAndObjectives;
|
||||
/**
|
||||
* 企业联系人列表
|
||||
*/
|
||||
@ApiModelProperty(value = "企业联系人列表")
|
||||
@TableField(exist = false)
|
||||
private List<PayWorkingGroupSubItemContacts> payWorkingGroupSubItemContactsList;
|
||||
}
|
||||
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.jero.project.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: pay_working_group_subitem_contacts
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-04-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("pay_working_group_subitem_contacts")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="pay_working_group_subitem_contacts对象", description="pay_working_group_subitem_contacts")
|
||||
public class PayWorkingGroupSubItemContacts implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
/**工作组id*/
|
||||
@Excel(name = "工作组id", width = 15)
|
||||
@ApiModelProperty(value = "工作组id")
|
||||
private String workingGroupId;
|
||||
/**工作组成员id*/
|
||||
@Excel(name = "工作组成员id", width = 15)
|
||||
@ApiModelProperty(value = "工作组成员id")
|
||||
private String workingGroupSubId;
|
||||
/**企业联系人id*/
|
||||
@Excel(name = "企业联系人id", width = 15)
|
||||
@ApiModelProperty(value = "企业联系人id")
|
||||
private String contactsId;
|
||||
/**临时企业联系人id*/
|
||||
@Excel(name = "临时企业联系人id", width = 15)
|
||||
@ApiModelProperty(value = "临时企业联系人id")
|
||||
private String contactsTemporaryId;
|
||||
/**临时企业联系人名称*/
|
||||
@Excel(name = "临时企业联系人名称", width = 15)
|
||||
@ApiModelProperty(value = "临时企业联系人名称")
|
||||
private String contactsTemporaryName;
|
||||
/**联系人备注*/
|
||||
@Excel(name = "联系人备注", width = 15)
|
||||
@ApiModelProperty(value = "联系人备注")
|
||||
private String remarks;
|
||||
/**序号*/
|
||||
@Excel(name = "序号", width = 15)
|
||||
@ApiModelProperty(value = "序号")
|
||||
private Integer orderNum;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
/**更新时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.jero.project.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.project.entity.PayWorkingGroupSubItemContacts;
|
||||
|
||||
/**
|
||||
* @Description: pay_working_group_subitem_contacts
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-04-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface PayWorkingGroupSubItemContactsMapper extends BaseMapper<PayWorkingGroupSubItemContacts> {
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.project.mapper.PayWorkingGroupSubItemContactsMapper">
|
||||
|
||||
</mapper>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.project.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.project.entity.PayWorkingGroupSubItemContacts;
|
||||
|
||||
/**
|
||||
* @Description: pay_working_group_subitem_contacts
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-04-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IPayWorkingGroupSubItemContactsService extends IService<PayWorkingGroupSubItemContacts> {
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.jero.project.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.project.entity.PayWorkingGroupSubItemContacts;
|
||||
import com.jero.project.mapper.PayWorkingGroupSubItemContactsMapper;
|
||||
import com.jero.project.service.IPayWorkingGroupSubItemContactsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: pay_working_group_subitem_contacts
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-04-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class PayWorkingGroupSubItemContactsServiceImpl extends ServiceImpl<PayWorkingGroupSubItemContactsMapper, PayWorkingGroupSubItemContacts> implements IPayWorkingGroupSubItemContactsService {
|
||||
|
||||
}
|
||||
+74
-83
@@ -38,12 +38,10 @@ import com.jero.pack.entity.PayPackCompanyProject;
|
||||
import com.jero.pack.service.IPayPackCompanyProjectService;
|
||||
import com.jero.payment.service.IPayPaymentCheckService;
|
||||
import com.jero.project.common.PayProjectCommon;
|
||||
import com.jero.project.entity.PayWorkGroupSubletStatistics;
|
||||
import com.jero.project.entity.PayWorkingGroup;
|
||||
import com.jero.project.entity.PayWorkingGroupSubItem;
|
||||
import com.jero.project.entity.PayWorkingGroupSubletSearch;
|
||||
import com.jero.project.entity.*;
|
||||
import com.jero.project.mapper.PayWorkingGroupSubItemMapper;
|
||||
import com.jero.project.service.IPayWorkingGroupService;
|
||||
import com.jero.project.service.IPayWorkingGroupSubItemContactsService;
|
||||
import com.jero.project.service.IPayWorkingGroupSubItemService;
|
||||
import com.jero.project.vo.SetChargeInput;
|
||||
import com.jero.statistics.entity.AllMoney;
|
||||
@@ -118,6 +116,8 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
||||
@Resource
|
||||
private IOSSFileService iossFileService;
|
||||
@Resource
|
||||
private IPayWorkingGroupSubItemContactsService payWorkingGroupSubItemContactsService;
|
||||
@Resource
|
||||
private Environment env;
|
||||
|
||||
|
||||
@@ -126,16 +126,30 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
||||
IPage<PayWorkingGroupSubItem> payWorkingGroupSubItemIPage = payWorkingGroupSubItemMapper.queryPageList(page, payWorkingGroupSubitem, paymentDate);
|
||||
if (StringUtils.isNotBlank(payWorkingGroupSubitem.getMeetingId())){
|
||||
List<PayWorkingGroupSubItem> records = payWorkingGroupSubItemIPage.getRecords();
|
||||
for (PayWorkingGroupSubItem workingGroupSubItem : records) {
|
||||
String workingGroupSubItemId = workingGroupSubItem.getId();
|
||||
LambdaQueryWrapper<PayMeetingRemindRecord> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PayMeetingRemindRecord::getSubitemId,workingGroupSubItemId);
|
||||
wrapper.eq(PayMeetingRemindRecord::getMeetingId,payWorkingGroupSubitem.getMeetingId());
|
||||
int count = payMeetingRemindRecordService.count(wrapper);
|
||||
if (count>0){
|
||||
workingGroupSubItem.setRemind(PayProjectCommon.YES);
|
||||
}else {
|
||||
workingGroupSubItem.setRemind(PayProjectCommon.NO);
|
||||
if(!CollectionUtils.isEmpty(records)){
|
||||
// 获取企业联系人
|
||||
List<String> listIds = records.stream().map(PayWorkingGroupSubItem::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<PayWorkingGroupSubItemContacts> queryPayWorkingGroupSubItemContacts = new LambdaQueryWrapper<>();
|
||||
queryPayWorkingGroupSubItemContacts.in(PayWorkingGroupSubItemContacts::getWorkingGroupSubId,listIds);
|
||||
List<PayWorkingGroupSubItemContacts> payWorkingGroupSubItemContactsList = payWorkingGroupSubItemContactsService.list(queryPayWorkingGroupSubItemContacts);
|
||||
for (PayWorkingGroupSubItem workingGroupSubItem : records) {
|
||||
String workingGroupSubItemId = workingGroupSubItem.getId();
|
||||
LambdaQueryWrapper<PayMeetingRemindRecord> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PayMeetingRemindRecord::getSubitemId,workingGroupSubItemId);
|
||||
wrapper.eq(PayMeetingRemindRecord::getMeetingId,payWorkingGroupSubitem.getMeetingId());
|
||||
int count = payMeetingRemindRecordService.count(wrapper);
|
||||
if (count>0){
|
||||
workingGroupSubItem.setRemind(PayProjectCommon.YES);
|
||||
}else {
|
||||
workingGroupSubItem.setRemind(PayProjectCommon.NO);
|
||||
}
|
||||
if(!CollectionUtils.isEmpty(payWorkingGroupSubItemContactsList)){
|
||||
List<PayWorkingGroupSubItemContacts> pwg = payWorkingGroupSubItemContactsList.stream().filter(p->Objects.equals(p.getWorkingGroupSubId(),workingGroupSubItem.getId())).collect(Collectors.toList());
|
||||
if(!CollectionUtils.isEmpty(pwg)){
|
||||
pwg.sort(Comparator.comparing(PayWorkingGroupSubItemContacts::getOrderNum));
|
||||
workingGroupSubItem.setPayWorkingGroupSubItemContactsList(pwg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,6 +205,16 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
||||
payWorkingGroupSubItem.setMail(PayProjectCommon.MAIL0);
|
||||
payWorkingGroupSubItem.setChargeUse(PayProjectCommon.CHARGE_USE1);
|
||||
payWorkingGroupSubItemService.save(payWorkingGroupSubItem);
|
||||
// 添加联系人表
|
||||
List<PayWorkingGroupSubItemContacts> listPayWorkingGroupSubItemContacts = payWorkingGroupSubItem.getPayWorkingGroupSubItemContactsList();
|
||||
if(!CollectionUtils.isEmpty(listPayWorkingGroupSubItemContacts)){
|
||||
for (int i = 0; i < listPayWorkingGroupSubItemContacts.size(); i++) {
|
||||
listPayWorkingGroupSubItemContacts.get(i).setOrderNum(i+1);
|
||||
listPayWorkingGroupSubItemContacts.get(i).setWorkingGroupId(payWorkingGroupSubItem.getWorkingGroupId());
|
||||
listPayWorkingGroupSubItemContacts.get(i).setWorkingGroupSubId(payWorkingGroupSubItem.getId());
|
||||
}
|
||||
payWorkingGroupSubItemContactsService.saveBatch(listPayWorkingGroupSubItemContacts);
|
||||
}
|
||||
List<String> listFile = new ArrayList<>();
|
||||
// 获取收费通知
|
||||
if(Objects.equals(payWorkingGroupSubItem.getChargeWay(),PayProjectCommon.CHARGE_WAY3) && StringUtils.isNotBlank(payWorkingGroupSubItem.getChargeNoticeId())){
|
||||
@@ -386,6 +410,12 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
||||
payPackCompanyProjectService.setPack(payWorkingGroupSubItem.getChargeCompanyId(),payWorkingGroupSubItem.getContactsIdOne(),payIncomeContractAdd.getPackYear(),payWorkingGroupSubItem.getId(),PayProjectCommon.PROJECT_TYPE2,payIncomeContractAdd.getPack());
|
||||
}
|
||||
}
|
||||
LambdaQueryWrapper<PayWorkingGroupSubItemContacts> queryPayWorkingGroupSubItemContacts = new LambdaQueryWrapper<>();
|
||||
queryPayWorkingGroupSubItemContacts.eq(PayWorkingGroupSubItemContacts::getWorkingGroupSubId,payWorkingGroupSubItemOld.getId());
|
||||
List<PayWorkingGroupSubItemContacts> listPayWorkingGroupSubItemContacts = payWorkingGroupSubItemContactsService.list(queryPayWorkingGroupSubItemContacts);
|
||||
if(!CollectionUtils.isEmpty(listPayWorkingGroupSubItemContacts)){
|
||||
payWorkingGroupSubItemOld.setPayWorkingGroupSubItemContactsList(listPayWorkingGroupSubItemContacts);
|
||||
}
|
||||
setPayWorkingGroupSubItemEdit(payWorkingGroupSubItem,payWorkingGroupSubItemOld);
|
||||
payWorkingGroupSubItem.setChargeUse(PayProjectCommon.CHARGE_USE1);
|
||||
// 变更应收金额,重新校验状态
|
||||
@@ -999,30 +1029,17 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
||||
}
|
||||
payWorkingGroupSubItem.setChargeCompanyTemporaryId(chargeCompanyName.getId());
|
||||
payWorkingGroupSubItem.setChargeCompanyTemporaryName(chargeCompanyName.getCompanyName());
|
||||
// 企业联系人1
|
||||
PayContactsManagementTemporary contactsNameOne = payContactsManagementTemporaryService.insertContactsManagementTemporary(payWorkingGroupSubItem.getContactsIdOne());
|
||||
if(Objects.isNull(contactsNameOne)){
|
||||
throw new JeroBootException("企业联系人1名称为空!");
|
||||
}
|
||||
payWorkingGroupSubItem.setContactsTemporaryIdOne(contactsNameOne.getId());
|
||||
payWorkingGroupSubItem.setContactsTemporaryNameOne(contactsNameOne.getName());
|
||||
if(!StringUtils.isBlank(payWorkingGroupSubItem.getContactsIdTwo())){
|
||||
// 企业联系人2
|
||||
PayContactsManagementTemporary contactsNameTwo = payContactsManagementTemporaryService.insertContactsManagementTemporary(payWorkingGroupSubItem.getContactsIdTwo());
|
||||
if(Objects.isNull(contactsNameTwo)){
|
||||
throw new JeroBootException("企业联系人2名称为空!");
|
||||
List<PayWorkingGroupSubItemContacts> payWorkingGroupSubItemContactsList = payWorkingGroupSubItem.getPayWorkingGroupSubItemContactsList();
|
||||
if(!CollectionUtils.isEmpty(payWorkingGroupSubItemContactsList)){
|
||||
for (int i = 0; i < payWorkingGroupSubItemContactsList.size(); i++) {
|
||||
// 企业联系人
|
||||
PayContactsManagementTemporary contactsName = payContactsManagementTemporaryService.insertContactsManagementTemporary(payWorkingGroupSubItemContactsList.get(i).getContactsId());
|
||||
if(Objects.isNull(contactsName)){
|
||||
throw new JeroBootException("企业联系人" + (i + 1) + "名称为空!");
|
||||
}
|
||||
payWorkingGroupSubItemContactsList.get(i).setContactsTemporaryId(contactsName.getId());
|
||||
payWorkingGroupSubItemContactsList.get(i).setContactsTemporaryName(contactsName.getName());
|
||||
}
|
||||
payWorkingGroupSubItem.setContactsTemporaryIdTwo(contactsNameTwo.getId());
|
||||
payWorkingGroupSubItem.setContactsTemporaryNameTwo(contactsNameTwo.getName());
|
||||
}
|
||||
if(!StringUtils.isBlank(payWorkingGroupSubItem.getContactsIdThree())){
|
||||
// 企业联系人3
|
||||
PayContactsManagementTemporary contactsNameThree = payContactsManagementTemporaryService.insertContactsManagementTemporary(payWorkingGroupSubItem.getContactsIdThree());
|
||||
if(Objects.isNull(contactsNameThree)){
|
||||
throw new JeroBootException("企业联系人3名称为空!");
|
||||
}
|
||||
payWorkingGroupSubItem.setContactsTemporaryIdThree(contactsNameThree.getId());
|
||||
payWorkingGroupSubItem.setContactsTemporaryNameThree(contactsNameThree.getName());
|
||||
}
|
||||
// 邮寄联系人
|
||||
PayContactsManagementTemporary mailContactsName = payContactsManagementTemporaryService.insertContactsManagementTemporary(payWorkingGroupSubItem.getMailContactsId());
|
||||
@@ -1053,56 +1070,30 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
||||
}else{
|
||||
payWorkingGroupSubItem.setChargeCompanyId(payWorkingGroupSubItemOld.getChargeCompanyId());
|
||||
}
|
||||
if(!Objects.equals(payWorkingGroupSubItemOld.getContactsTemporaryIdOne(),payWorkingGroupSubItem.getContactsIdOne())){
|
||||
// 企业联系人1
|
||||
PayContactsManagementTemporary contactsNameOne = payContactsManagementTemporaryService.insertContactsManagementTemporary(payWorkingGroupSubItem.getContactsIdOne());
|
||||
if(Objects.isNull(contactsNameOne)){
|
||||
throw new JeroBootException("企业联系人1名称为空!");
|
||||
}
|
||||
payWorkingGroupSubItem.setContactsTemporaryIdOne(contactsNameOne.getId());
|
||||
payWorkingGroupSubItem.setContactsTemporaryNameOne(contactsNameOne.getName());
|
||||
payContactsManagementTemporaryService.removeById(payWorkingGroupSubItemOld.getContactsTemporaryIdOne());
|
||||
}else{
|
||||
payWorkingGroupSubItem.setContactsIdOne(payWorkingGroupSubItemOld.getContactsIdOne());
|
||||
}
|
||||
|
||||
if(!StringUtils.isBlank(payWorkingGroupSubItem.getContactsIdTwo())){
|
||||
if(!Objects.equals(payWorkingGroupSubItemOld.getContactsTemporaryIdTwo(),payWorkingGroupSubItem.getContactsIdTwo())) {
|
||||
// 企业联系人2
|
||||
PayContactsManagementTemporary contactsNameTwo = payContactsManagementTemporaryService.insertContactsManagementTemporary(payWorkingGroupSubItem.getContactsIdTwo());
|
||||
if (Objects.isNull(contactsNameTwo)) {
|
||||
throw new JeroBootException("企业联系人2名称为空!");
|
||||
}
|
||||
payWorkingGroupSubItem.setContactsTemporaryIdTwo(contactsNameTwo.getId());
|
||||
payWorkingGroupSubItem.setContactsTemporaryNameTwo(contactsNameTwo.getName());
|
||||
payContactsManagementTemporaryService.removeById(payWorkingGroupSubItemOld.getContactsTemporaryIdTwo());
|
||||
}else{
|
||||
payWorkingGroupSubItem.setContactsIdTwo(payWorkingGroupSubItemOld.getContactsIdTwo());
|
||||
List<PayWorkingGroupSubItemContacts> payWorkingGroupSubItemContactsList = payWorkingGroupSubItem.getPayWorkingGroupSubItemContactsList();
|
||||
if(!CollectionUtils.isEmpty(payWorkingGroupSubItemContactsList)){
|
||||
// 删除临时表历史记录
|
||||
if(!CollectionUtils.isEmpty(payWorkingGroupSubItemOld.getPayWorkingGroupSubItemContactsList())){
|
||||
List<String> list = payWorkingGroupSubItemOld.getPayWorkingGroupSubItemContactsList().stream().map(PayWorkingGroupSubItemContacts::getContactsTemporaryId).collect(Collectors.toList());
|
||||
payContactsManagementTemporaryService.removeByIds(list);
|
||||
}
|
||||
}else{
|
||||
payWorkingGroupSubItem.setContactsIdTwo("");
|
||||
payWorkingGroupSubItem.setContactsTemporaryIdTwo("");
|
||||
payWorkingGroupSubItem.setContactsTemporaryNameTwo("");
|
||||
payContactsManagementTemporaryService.removeById(payWorkingGroupSubItemOld.getContactsTemporaryIdTwo());
|
||||
}
|
||||
if(!StringUtils.isBlank(payWorkingGroupSubItem.getContactsIdThree())){
|
||||
if(!Objects.equals(payWorkingGroupSubItemOld.getContactsTemporaryIdThree(),payWorkingGroupSubItem.getContactsIdThree())) {
|
||||
// 企业联系人3
|
||||
PayContactsManagementTemporary contactsNameThree = payContactsManagementTemporaryService.insertContactsManagementTemporary(payWorkingGroupSubItem.getContactsIdThree());
|
||||
if (Objects.isNull(contactsNameThree)) {
|
||||
throw new JeroBootException("企业联系人3名称为空!");
|
||||
// 删除联系人记录
|
||||
LambdaUpdateWrapper<PayWorkingGroupSubItemContacts> updatePayWorkingGroupSubItemContacts = new LambdaUpdateWrapper<>();
|
||||
updatePayWorkingGroupSubItemContacts.eq(PayWorkingGroupSubItemContacts::getWorkingGroupSubId,payWorkingGroupSubItem.getId());
|
||||
payWorkingGroupSubItemContactsService.remove(updatePayWorkingGroupSubItemContacts);
|
||||
// 新增
|
||||
for (int i = 0; i < payWorkingGroupSubItemContactsList.size(); i++) {
|
||||
if(!Objects.equals(payWorkingGroupSubItemOld.getContactsTemporaryIdOne(),payWorkingGroupSubItem.getContactsIdOne())) {
|
||||
// 企业联系人
|
||||
PayContactsManagementTemporary contactsName = payContactsManagementTemporaryService.insertContactsManagementTemporary(payWorkingGroupSubItemContactsList.get(i).getContactsId());
|
||||
if (Objects.isNull(contactsName)) {
|
||||
throw new JeroBootException("企业联系人" + (i + 1) + "名称为空!");
|
||||
}
|
||||
payWorkingGroupSubItemContactsList.get(i).setContactsTemporaryId(contactsName.getId());
|
||||
payWorkingGroupSubItemContactsList.get(i).setContactsTemporaryName(contactsName.getName());
|
||||
}
|
||||
payWorkingGroupSubItem.setContactsTemporaryIdThree(contactsNameThree.getId());
|
||||
payWorkingGroupSubItem.setContactsTemporaryNameThree(contactsNameThree.getName());
|
||||
payContactsManagementTemporaryService.removeById(payWorkingGroupSubItemOld.getContactsTemporaryIdThree());
|
||||
}else{
|
||||
payWorkingGroupSubItem.setContactsIdThree(payWorkingGroupSubItemOld.getContactsIdThree());
|
||||
}
|
||||
}else{
|
||||
payWorkingGroupSubItem.setContactsTemporaryIdThree("");
|
||||
payWorkingGroupSubItem.setContactsTemporaryNameThree("");
|
||||
payWorkingGroupSubItem.setContactsIdThree("");
|
||||
payContactsManagementTemporaryService.removeById(payWorkingGroupSubItemOld.getContactsTemporaryIdThree());
|
||||
}
|
||||
if(!Objects.equals(payWorkingGroupSubItemOld.getMailContactsTemporaryId(),payWorkingGroupSubItem.getMailContactsId())){
|
||||
// 邮寄联系人
|
||||
|
||||
Reference in New Issue
Block a user