This commit is contained in:
wucongxing8150 2025-07-08 09:20:36 +08:00
parent 333da783cb
commit 327698768f

View File

@ -219,8 +219,8 @@ public class ExpertFxqService {
// 获取数据库模版数据 // 获取数据库模版数据
LambdaQueryWrapper<FxqTemplateEntity> templateQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FxqTemplateEntity> templateQueryWrapper = new LambdaQueryWrapper<>();
templateQueryWrapper.eq(FxqTemplateEntity::getCompanyId, companyId); templateQueryWrapper.eq(FxqTemplateEntity::getCompanyId, companyId);
FxqTemplateEntity fxqTemplate = fxqTemplateDao.selectOne(templateQueryWrapper); List<FxqTemplateEntity> fxqTemplates = fxqTemplateDao.selectList(templateQueryWrapper);
if (fxqTemplate == null) { if (fxqTemplates == null || fxqTemplates.isEmpty()){
// 获取企业模版数据 // 获取企业模版数据
GetTemplateListResponse templateList = fxqTask.getTemplateList(companyFxqCompany.getUnionId()); GetTemplateListResponse templateList = fxqTask.getTemplateList(companyFxqCompany.getUnionId());
if (templateList.getData() == null || templateList.getData().isEmpty()) { if (templateList.getData() == null || templateList.getData().isEmpty()) {
@ -262,14 +262,26 @@ public class ExpertFxqService {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return null; return null;
} }
// 把第一条数据赋值出去
if (fxqTemplate == null) {
fxqTemplate = fxqTemplateData;
}
} }
} }
fxqTemplates = fxqTemplateDao.selectList(templateQueryWrapper);
if (fxqTemplates == null || fxqTemplates.isEmpty()) {
throw new BusinessException("操作失败:未找到合适模版");
}
FxqTemplateEntity fxqTemplate = null;
for (FxqTemplateEntity m : fxqTemplates) {
if (m.getTemplateNo().equals("FT1751936689226311")) {
fxqTemplate = m;
break;
}
}
if (fxqTemplate == null) {
throw new BusinessException("操作失败:未找到合适模版");
}
return fxqTemplate; return fxqTemplate;
} catch (Exception e) { } catch (Exception e) {
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());