|
|
|
|
@ -25,7 +25,9 @@ import org.dromara.common.tenant.helper.TenantHelper;
|
|
|
|
|
import org.dromara.oa.base.domain.bo.BaseRelationMaterialBo;
|
|
|
|
|
import org.dromara.oa.base.domain.vo.BaseRelationMaterialVo;
|
|
|
|
|
import org.dromara.oa.base.service.IBaseRelationMaterialService;
|
|
|
|
|
import org.dromara.oa.crm.domain.vo.CrmCustomerInfoVo;
|
|
|
|
|
import org.dromara.oa.crm.domain.vo.CrmPaymentAccountVo;
|
|
|
|
|
import org.dromara.oa.crm.service.ICrmCustomerInfoService;
|
|
|
|
|
import org.dromara.oa.crm.service.ICrmPaymentAccountService;
|
|
|
|
|
import org.dromara.oa.erp.domain.ErpContractInfo;
|
|
|
|
|
import org.dromara.oa.erp.domain.ErpContractMaterial;
|
|
|
|
|
@ -76,6 +78,8 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
|
|
|
|
|
|
|
|
|
|
private final ICrmPaymentAccountService crmPaymentAccountService;
|
|
|
|
|
|
|
|
|
|
private final ICrmCustomerInfoService crmCustomerInfoService;
|
|
|
|
|
|
|
|
|
|
private final RemoteUserService remoteUserService;
|
|
|
|
|
|
|
|
|
|
@DubboReference(timeout = 30000)
|
|
|
|
|
@ -381,6 +385,23 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
|
|
|
|
|
* 保存前的数据校验
|
|
|
|
|
*/
|
|
|
|
|
private void validEntityBeforeSave(ErpContractInfo entity) {
|
|
|
|
|
// 校验客户基础信息是否已完善(附件、税号、开户银行、银行账号不能为空)
|
|
|
|
|
Long oneCustomerId = entity.getOneCustomerId();
|
|
|
|
|
if (oneCustomerId != null) {
|
|
|
|
|
CrmCustomerInfoVo customerInfo = crmCustomerInfoService.queryById(oneCustomerId);
|
|
|
|
|
if (customerInfo == null) {
|
|
|
|
|
throw new ServiceException("合同甲方客户信息不存在,请先在客户管理中维护客户信息");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isBlank(customerInfo.getOssId())
|
|
|
|
|
|| StringUtils.isBlank(customerInfo.getTaxNumber())
|
|
|
|
|
|| StringUtils.isBlank(customerInfo.getBankAccountOpening())
|
|
|
|
|
|| StringUtils.isBlank(customerInfo.getBankNumber())) {
|
|
|
|
|
String customerName = StringUtils.isNotBlank(customerInfo.getCustomerName())
|
|
|
|
|
? customerInfo.getCustomerName()
|
|
|
|
|
: String.valueOf(oneCustomerId);
|
|
|
|
|
throw new ServiceException("客户【" + customerName + "】的附件、税号、开户银行、银行账号不能为空,请先在客户管理中完善!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 物料列表的强制校验
|
|
|
|
|
// if (entity.getContractMaterialList() == null ||
|
|
|
|
|
// entity.getContractMaterialList().isEmpty()) {
|
|
|
|
|
|