|
|
@@ -3,6 +3,7 @@ package com.ruoyi.agent.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
@@ -17,22 +18,22 @@ import com.ruoyi.agent.exception.AgentApplyExceptionEnum;
|
|
|
import com.ruoyi.agent.mapper.AgentApplyMapper;
|
|
|
import com.ruoyi.agent.service.IAgentApplyService;
|
|
|
import com.ruoyi.agent.service.IAgentService;
|
|
|
+import com.ruoyi.base.platform.domain.vo.PlatformInfoVo;
|
|
|
+import com.ruoyi.base.platform.service.IPlatformInfoService;
|
|
|
import com.ruoyi.common.core.domain.PageQuery;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
import com.ruoyi.common.enums.AuditStatus;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.BeanCopyUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
+import com.ruoyi.tool.service.JzqService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.Collection;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 代理申请Service业务层处理
|
|
|
@@ -48,6 +49,8 @@ public class AgentApplyServiceImpl implements IAgentApplyService {
|
|
|
@Lazy
|
|
|
@Resource
|
|
|
private IAgentService agentService;
|
|
|
+ private final IPlatformInfoService platformInfoService;
|
|
|
+ private final JzqService jzqService;
|
|
|
|
|
|
/**
|
|
|
* 查询代理申请分页
|
|
|
@@ -255,4 +258,34 @@ public class AgentApplyServiceImpl implements IAgentApplyService {
|
|
|
return agentApplyVo;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String contractPreview(AgentApplyBo bo) {
|
|
|
+ PlatformInfoVo platformInfoVo = platformInfoService.getInfo();
|
|
|
+ JSONObject templateParams = new JSONObject();
|
|
|
+ templateParams.set("enterpriseFullName", platformInfoVo.getEnterpriseFullName());
|
|
|
+ templateParams.set("legalPersonName", platformInfoVo.getLegalPersonName());
|
|
|
+ templateParams.set("uscCode", platformInfoVo.getUscCode());
|
|
|
+ templateParams.set("contractSigner", platformInfoVo.getContractSigner());
|
|
|
+ templateParams.set("signerMobile", platformInfoVo.getSignerMobile());
|
|
|
+ templateParams.set("registeredAddress", platformInfoVo.getRegisteredAddress());
|
|
|
+ templateParams.set("agentLevel", bo.getAgentLevel().getMsg());
|
|
|
+ templateParams.set("idCard", bo.getIdCard());
|
|
|
+ templateParams.set("realName", bo.getRealName());
|
|
|
+ templateParams.set("phone", bo.getPhone());
|
|
|
+ templateParams.set("provinceName", bo.getProvinceName());
|
|
|
+ templateParams.set("areaName", bo.getAreaName());
|
|
|
+ templateParams.set("bankName", platformInfoVo.getBankName());
|
|
|
+ templateParams.set("subBranchName", platformInfoVo.getSubBranchName());
|
|
|
+ templateParams.set("bankCardNumber", platformInfoVo.getBankCardNumber());
|
|
|
+ //构建请求参数
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ if (AgentLevel.PROVINCE_AGENT.equals(bo.getAgentLevel())) {
|
|
|
+ params.put("templateNo", "4");
|
|
|
+ } else {
|
|
|
+ params.put("templateNo", "2");
|
|
|
+ }
|
|
|
+ params.put("contractParams", templateParams.toString());
|
|
|
+ return jzqService.tmplPre(params);
|
|
|
+ }
|
|
|
+
|
|
|
}
|