|
|
|
@ -27,6 +27,8 @@ import org.dromara.oa.erp.mapper.ErpContractMaterialMapper;
|
|
|
|
import org.dromara.oa.erp.mapper.ErpContractPaymentMethodMapper;
|
|
|
|
import org.dromara.oa.erp.mapper.ErpContractPaymentMethodMapper;
|
|
|
|
import org.dromara.oa.base.domain.bo.BaseRelationMaterialBo;
|
|
|
|
import org.dromara.oa.base.domain.bo.BaseRelationMaterialBo;
|
|
|
|
import org.dromara.oa.base.service.IBaseRelationMaterialService;
|
|
|
|
import org.dromara.oa.base.service.IBaseRelationMaterialService;
|
|
|
|
|
|
|
|
import org.dromara.oa.crm.domain.vo.CrmPaymentAccountVo;
|
|
|
|
|
|
|
|
import org.dromara.oa.crm.service.ICrmPaymentAccountService;
|
|
|
|
import org.dromara.workflow.api.RemoteWorkflowService;
|
|
|
|
import org.dromara.workflow.api.RemoteWorkflowService;
|
|
|
|
import org.dromara.workflow.api.domain.RemoteStartProcess;
|
|
|
|
import org.dromara.workflow.api.domain.RemoteStartProcess;
|
|
|
|
import org.dromara.workflow.api.event.ProcessEvent;
|
|
|
|
import org.dromara.workflow.api.event.ProcessEvent;
|
|
|
|
@ -61,6 +63,8 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
|
|
|
|
|
|
|
|
|
|
|
|
private final IBaseRelationMaterialService baseRelationMaterialService;
|
|
|
|
private final IBaseRelationMaterialService baseRelationMaterialService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ICrmPaymentAccountService crmPaymentAccountService;
|
|
|
|
|
|
|
|
|
|
|
|
@DubboReference(timeout = 30000)
|
|
|
|
@DubboReference(timeout = 30000)
|
|
|
|
private RemoteWorkflowService remoteWorkflowService;
|
|
|
|
private RemoteWorkflowService remoteWorkflowService;
|
|
|
|
|
|
|
|
|
|
|
|
@ -72,13 +76,24 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ErpContractInfoVo queryById(Long contractId) {
|
|
|
|
public ErpContractInfoVo queryById(Long contractId) {
|
|
|
|
ErpContractInfoVo contractInfoVo = baseMapper.selectVoById(contractId);
|
|
|
|
MPJLambdaWrapper<ErpContractInfo> infoLqw = JoinWrappers.lambda(ErpContractInfo.class)
|
|
|
|
|
|
|
|
.selectAll(ErpContractInfo.class)
|
|
|
|
|
|
|
|
.eq(contractId != null, ErpContractInfo::getContractId, contractId)
|
|
|
|
|
|
|
|
.eq("t.del_flag", "0");
|
|
|
|
|
|
|
|
List<ErpContractInfoVo> infoList = baseMapper.selectCustomErpContractInfoVoList(infoLqw);
|
|
|
|
|
|
|
|
ErpContractInfoVo contractInfoVo = infoList.isEmpty() ? null : infoList.get(0);
|
|
|
|
|
|
|
|
if (contractInfoVo == null) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
MPJLambdaWrapper<ErpContractMaterial> lqw = JoinWrappers.lambda(ErpContractMaterial.class)
|
|
|
|
MPJLambdaWrapper<ErpContractMaterial> lqw = JoinWrappers.lambda(ErpContractMaterial.class)
|
|
|
|
.selectAll(ErpContractMaterial.class)
|
|
|
|
.selectAll(ErpContractMaterial.class)
|
|
|
|
.eq(contractId != null, ErpContractMaterial::getContractId, contractId)
|
|
|
|
.eq(contractId != null, ErpContractMaterial::getContractId, contractId)
|
|
|
|
.eq("t.del_flag", "0");
|
|
|
|
.eq("t.del_flag", "0");
|
|
|
|
List<ErpContractMaterialVo> contractMaterialList = contractMaterialMapper
|
|
|
|
List<ErpContractMaterialVo> contractMaterialList = contractMaterialMapper
|
|
|
|
.selectCustomErpContractMaterialVoList(lqw);
|
|
|
|
.selectCustomErpContractMaterialVoList(lqw);
|
|
|
|
|
|
|
|
for (int i = 0; i < contractMaterialList.size(); i++) {
|
|
|
|
|
|
|
|
contractMaterialList.get(i).setSeq(i + 1L);
|
|
|
|
|
|
|
|
}
|
|
|
|
contractInfoVo.setContractMaterialList(contractMaterialList);
|
|
|
|
contractInfoVo.setContractMaterialList(contractMaterialList);
|
|
|
|
// 查询合同付款方式列表
|
|
|
|
// 查询合同付款方式列表
|
|
|
|
MPJLambdaWrapper<ErpContractPaymentMethod> paymentLqw = JoinWrappers.lambda(ErpContractPaymentMethod.class)
|
|
|
|
MPJLambdaWrapper<ErpContractPaymentMethod> paymentLqw = JoinWrappers.lambda(ErpContractPaymentMethod.class)
|
|
|
|
@ -87,9 +102,46 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
|
|
|
|
.eq(ErpContractPaymentMethod::getDelFlag, "0");
|
|
|
|
.eq(ErpContractPaymentMethod::getDelFlag, "0");
|
|
|
|
List<ErpContractPaymentMethodVo> contractPaymentMethodList = contractPaymentMethodMapper.selectCustomErpContractPaymentMethodVoList(paymentLqw);
|
|
|
|
List<ErpContractPaymentMethodVo> contractPaymentMethodList = contractPaymentMethodMapper.selectCustomErpContractPaymentMethodVoList(paymentLqw);
|
|
|
|
contractInfoVo.setContractPaymentMethodList(contractPaymentMethodList);
|
|
|
|
contractInfoVo.setContractPaymentMethodList(contractPaymentMethodList);
|
|
|
|
|
|
|
|
// 查询关联的付款账户并格式化为付款账户信息字符串
|
|
|
|
|
|
|
|
if (contractInfoVo.getPaymentAccountId() != null) {
|
|
|
|
|
|
|
|
CrmPaymentAccountVo paymentAccount = crmPaymentAccountService.queryById(contractInfoVo.getPaymentAccountId());
|
|
|
|
|
|
|
|
contractInfoVo.setPaymentAccountInfo(buildPaymentAccountInfo(paymentAccount));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
contractInfoVo.setPaymentAccountInfo("");
|
|
|
|
|
|
|
|
}
|
|
|
|
return contractInfoVo;
|
|
|
|
return contractInfoVo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 构建付款账户信息字符串
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param paymentAccount 付款账户
|
|
|
|
|
|
|
|
* @return 格式化后的付款账户信息字符串
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private String buildPaymentAccountInfo(CrmPaymentAccountVo paymentAccount) {
|
|
|
|
|
|
|
|
if (paymentAccount == null) {
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String accountType = paymentAccount.getAccountType();
|
|
|
|
|
|
|
|
String accountName = paymentAccount.getAccountName() != null ? paymentAccount.getAccountName() : "";
|
|
|
|
|
|
|
|
String accountNumber = paymentAccount.getAccountNumber() != null ? paymentAccount.getAccountNumber() : "";
|
|
|
|
|
|
|
|
String bankName = paymentAccount.getBankName() != null ? paymentAccount.getBankName() : "";
|
|
|
|
|
|
|
|
String bankCode = paymentAccount.getBankCode() != null ? paymentAccount.getBankCode() : "";
|
|
|
|
|
|
|
|
String swiftCode = paymentAccount.getSwiftCode() != null ? paymentAccount.getSwiftCode() : "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
|
|
|
sb.append(accountType).append(":\n");
|
|
|
|
|
|
|
|
sb.append("账户名称:").append(accountName).append("\n");
|
|
|
|
|
|
|
|
sb.append("账户:").append(accountNumber).append("\n");
|
|
|
|
|
|
|
|
sb.append("开户行:").append(bankName).append("\n");
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(swiftCode)) {
|
|
|
|
|
|
|
|
sb.append("SWIFT号:").append(swiftCode);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
sb.append("开户银行代码:").append(bankCode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return sb.toString();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 分页查询合同信息列表
|
|
|
|
* 分页查询合同信息列表
|
|
|
|
*
|
|
|
|
*
|
|
|
|
|