工作组关联合同
This commit is contained in:
+32
-5
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.project.service.impl;
|
package com.jero.project.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
@@ -124,10 +125,7 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
log.info("工作组成员-添加异常",e);
|
log.info("工作组成员-添加异常",e);
|
||||||
throw new JeroBootException("工作组成员单位已存在!");
|
throw new JeroBootException("工作组成员单位已存在!");
|
||||||
}
|
}
|
||||||
// 来款方式为合同,校验合同编号
|
|
||||||
if(Objects.equals(payWorkingGroupSubItem.getChargeWay(),PayProjectCommon.CHARGE_WAY2)){
|
|
||||||
payIncomeContractService.checkContractNum(payWorkingGroupSubItem.getContractNum());
|
|
||||||
}
|
|
||||||
payWorkingGroupSubItem = setPayWorkingGroupSubItem(payWorkingGroupSubItem);
|
payWorkingGroupSubItem = setPayWorkingGroupSubItem(payWorkingGroupSubItem);
|
||||||
payWorkingGroupSubItem.setPack(PayProjectCommon.PACKAGING0);
|
payWorkingGroupSubItem.setPack(PayProjectCommon.PACKAGING0);
|
||||||
payWorkingGroupSubItem.setInAccount(PayProjectCommon.IN_ACCOUNT0);
|
payWorkingGroupSubItem.setInAccount(PayProjectCommon.IN_ACCOUNT0);
|
||||||
@@ -135,6 +133,20 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
payWorkingGroupSubItem.setMail(PayProjectCommon.MAIL0);
|
payWorkingGroupSubItem.setMail(PayProjectCommon.MAIL0);
|
||||||
payWorkingGroupSubItem.setChargeUse(PayProjectCommon.CHARGE_USE1);
|
payWorkingGroupSubItem.setChargeUse(PayProjectCommon.CHARGE_USE1);
|
||||||
payWorkingGroupSubItemService.save(payWorkingGroupSubItem);
|
payWorkingGroupSubItemService.save(payWorkingGroupSubItem);
|
||||||
|
|
||||||
|
PayIncomeContract payIncomeContract = null;
|
||||||
|
// 来款方式为合同,校验合同编号
|
||||||
|
if(Objects.equals(payWorkingGroupSubItem.getChargeWay(),PayProjectCommon.CHARGE_WAY2)){
|
||||||
|
payIncomeContract = payIncomeContractService.setPayIncomeContractAssociated(payWorkingGroupSubItem.getContractNum(),payWorkingGroupSubItem.getChargeCompanyId(),payWorkingGroupSubItem.getId());
|
||||||
|
}
|
||||||
|
// 关联了合同,判断合同是否打包,更新项目打包状态,添加打包
|
||||||
|
if(!Objects.isNull(payIncomeContract) && Objects.equals(payIncomeContract.getPack(),PayProjectCommon.PACKAGING1)){
|
||||||
|
LambdaUpdateWrapper<PayWorkingGroupSubItem> update = new LambdaUpdateWrapper<>();
|
||||||
|
update.eq(PayWorkingGroupSubItem::getId,payWorkingGroupSubItem.getId());
|
||||||
|
update.set(PayWorkingGroupSubItem::getPack,PayProjectCommon.PACKAGING1);
|
||||||
|
payWorkingGroupSubItemService.update(update);
|
||||||
|
// todo 缺少添加打包功能
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -176,9 +188,24 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
log.info("工作组成员-编辑异常",e);
|
log.info("工作组成员-编辑异常",e);
|
||||||
throw new JeroBootException("工作组成员单位已存在!");
|
throw new JeroBootException("工作组成员单位已存在!");
|
||||||
}
|
}
|
||||||
|
// 校验项目是否已关联合同
|
||||||
|
PayIncomeContract payIncomeContract = payIncomeContractService.checkPayIncomeContractAssociated(payWorkingGroupSubItem.getId());
|
||||||
|
if(!Objects.isNull(payIncomeContract) && !Objects.equals(payIncomeContract.getContractNum(),payWorkingGroupSubItem.getContractNum())){
|
||||||
|
throw new JeroBootException("项目已关联合同,合同编号不可修改!");
|
||||||
|
}
|
||||||
|
|
||||||
|
PayIncomeContract payIncomeContractAdd = null;
|
||||||
// 来款方式为合同,校验合同编号
|
// 来款方式为合同,校验合同编号
|
||||||
if(Objects.equals(payWorkingGroupSubItem.getChargeWay(),PayProjectCommon.CHARGE_WAY2)){
|
if(Objects.equals(payWorkingGroupSubItem.getChargeWay(),PayProjectCommon.CHARGE_WAY2)){
|
||||||
payIncomeContractService.checkContractNum(payWorkingGroupSubItem.getContractNum());
|
payIncomeContractAdd = payIncomeContractService.setPayIncomeContractAssociated(payWorkingGroupSubItem.getContractNum(),payWorkingGroupSubItem.getChargeCompanyId(),payWorkingGroupSubItem.getId());
|
||||||
|
}
|
||||||
|
// 关联了合同,判断合同是否打包,更新项目打包状态,添加打包
|
||||||
|
if(!Objects.isNull(payIncomeContractAdd) && Objects.equals(payIncomeContractAdd.getPack(),PayProjectCommon.PACKAGING1)){
|
||||||
|
LambdaUpdateWrapper<PayWorkingGroupSubItem> update = new LambdaUpdateWrapper<>();
|
||||||
|
update.eq(PayWorkingGroupSubItem::getId,payWorkingGroupSubItem.getId());
|
||||||
|
update.set(PayWorkingGroupSubItem::getPack,PayProjectCommon.PACKAGING1);
|
||||||
|
payWorkingGroupSubItemService.update(update);
|
||||||
|
// todo 缺少添加打包功能
|
||||||
}
|
}
|
||||||
payWorkingGroupSubItem = setPayWorkingGroupSubItem(payWorkingGroupSubItem);
|
payWorkingGroupSubItem = setPayWorkingGroupSubItem(payWorkingGroupSubItem);
|
||||||
payWorkingGroupSubItem.setChargeUse(PayProjectCommon.CHARGE_USE1);
|
payWorkingGroupSubItem.setChargeUse(PayProjectCommon.CHARGE_USE1);
|
||||||
|
|||||||
Reference in New Issue
Block a user