1.修改面试通知函通过节点
2.添加ec意向区域同步 3.定时同步800请求来源
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.HyPartnerFraSourceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface HyPartnerFraSourceMapper {
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(HyPartnerFraSourceDO record);
|
||||
|
||||
int insertSelective(HyPartnerFraSourceDO record);
|
||||
|
||||
HyPartnerFraSourceDO selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(HyPartnerFraSourceDO record);
|
||||
|
||||
int updateByPrimaryKey(HyPartnerFraSourceDO record);
|
||||
|
||||
List<HyPartnerFraSourceDO> selectAllFraSourceList();
|
||||
|
||||
int batchInsertSelective(@Param("insertList") List<HyPartnerFraSourceDO> collect);
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.HyPartnerFraSourceMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerFraSourceDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="code" jdbcType="VARCHAR" property="code" />
|
||||
<result column="dict_id" jdbcType="VARCHAR" property="dictId" />
|
||||
<result column="source_id" jdbcType="VARCHAR" property="sourceId" />
|
||||
<result column="enabled" jdbcType="BOOLEAN" property="enabled" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, `name`, code, dict_id, source_id, enabled, create_time, update_time, remark
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from hy_partner_fra_source
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<select id="selectAllFraSourceList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from hy_partner_fra_source where enabled=1
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from hy_partner_fra_source
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.cool.store.entity.HyPartnerFraSourceDO" useGeneratedKeys="true">
|
||||
insert into hy_partner_fra_source (`name`, code, dict_id,
|
||||
source_id, enabled, create_time,
|
||||
update_time, remark)
|
||||
values (#{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{dictId,jdbcType=VARCHAR},
|
||||
#{sourceId,jdbcType=VARCHAR}, #{enabled,jdbcType=BOOLEAN}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.cool.store.entity.HyPartnerFraSourceDO" useGeneratedKeys="true">
|
||||
insert into hy_partner_fra_source
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">
|
||||
`name`,
|
||||
</if>
|
||||
<if test="code != null">
|
||||
code,
|
||||
</if>
|
||||
<if test="dictId != null">
|
||||
dict_id,
|
||||
</if>
|
||||
<if test="sourceId != null">
|
||||
source_id,
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
enabled,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="code != null">
|
||||
#{code,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dictId != null">
|
||||
#{dictId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sourceId != null">
|
||||
#{sourceId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
#{enabled,jdbcType=BOOLEAN},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="batchInsertSelective">
|
||||
<foreach collection="insertList" item="record" separator=";">
|
||||
insert into hy_partner_fra_source
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="record.name != null">
|
||||
`name`,
|
||||
</if>
|
||||
<if test="record.code != null">
|
||||
`code`,
|
||||
</if>
|
||||
<if test="record.dictId != null">
|
||||
dict_id,
|
||||
</if>
|
||||
<if test="record.sourceId != null">
|
||||
source_id,
|
||||
</if>
|
||||
<if test="record.enabled != null">
|
||||
enabled,
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.name != null">
|
||||
#{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.code != null">
|
||||
#{record.code,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.dictId != null">
|
||||
#{record.dictId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.sourceId != null">
|
||||
#{record.sourceId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.enabled != null">
|
||||
#{record.enabled,jdbcType=BOOLEAN},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
#{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
#{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
ON DUPLICATE KEY UPDATE update_time = now(), enabled = values(enabled), `name` = values(`name`), `code` = values(`code`), dict_id = values(dict_id)
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyPartnerFraSourceDO">
|
||||
update hy_partner_fra_source
|
||||
<set>
|
||||
<if test="name != null">
|
||||
`name` = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="code != null">
|
||||
code = #{code,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dictId != null">
|
||||
dict_id = #{dictId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sourceId != null">
|
||||
source_id = #{sourceId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
enabled = #{enabled,jdbcType=BOOLEAN},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.cool.store.entity.HyPartnerFraSourceDO">
|
||||
update hy_partner_fra_source
|
||||
set `name` = #{name,jdbcType=VARCHAR},
|
||||
code = #{code,jdbcType=VARCHAR},
|
||||
dict_id = #{dictId,jdbcType=VARCHAR},
|
||||
source_id = #{sourceId,jdbcType=VARCHAR},
|
||||
enabled = #{enabled,jdbcType=BOOLEAN},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
remark = #{remark,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -166,6 +166,9 @@
|
||||
<if test="record.userChannelId!=null">
|
||||
user_channel_id,
|
||||
</if>
|
||||
<if test="record.ecWantShopArea!=null">
|
||||
ec_want_shop_area,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.partnerId != null">
|
||||
@@ -219,6 +222,9 @@
|
||||
<if test="record.userChannelId != null">
|
||||
#{record.userChannelId},
|
||||
</if>
|
||||
<if test="record.ecWantShopArea != null">
|
||||
#{record.ecWantShopArea},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective">
|
||||
@@ -272,6 +278,9 @@
|
||||
<if test="record.recommendPartnerMobile != null">
|
||||
recommend_partner_mobile = #{record.recommendPartnerMobile},
|
||||
</if>
|
||||
<if test="record.ecWantShopArea != null">
|
||||
ec_want_shop_area = #{record.ecWantShopArea},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.cool.store.dto.response;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author HXD
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DictResultDTO {
|
||||
private String id;
|
||||
private String createdBy;
|
||||
private String createdTime;
|
||||
private String groupCode;
|
||||
private String code;
|
||||
private String name;
|
||||
private String type;
|
||||
private String enabled;
|
||||
private String remark;
|
||||
private List<Dict> configList;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class Dict{
|
||||
private String id;
|
||||
private String dictId;
|
||||
private String code;
|
||||
private String name;
|
||||
private String parentId;
|
||||
private Boolean enabled;
|
||||
private String remark;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* hy_partner_fra_source
|
||||
* @author
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class HyPartnerFraSourceDO implements Serializable {
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 来源名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 来源code
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 所属字典枚举组的id
|
||||
*/
|
||||
private String dictId;
|
||||
|
||||
/**
|
||||
* 数据的id
|
||||
*/
|
||||
private String sourceId;
|
||||
|
||||
/**
|
||||
* 启用标识
|
||||
*/
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -75,4 +75,9 @@ public class HyPartnerUserInfoDO implements Serializable {
|
||||
|
||||
@ApiModelProperty("hy_partner_user_channel.channel_id")
|
||||
private Integer userChannelId;
|
||||
|
||||
|
||||
@ApiModelProperty("ec意向区域")
|
||||
private String ecWantShopArea;
|
||||
|
||||
}
|
||||
@@ -38,6 +38,9 @@ public class CreateQualifyVerifyReq {
|
||||
@ApiModelProperty(value = "加盟商类型", required = true)
|
||||
private KeyText fraType;
|
||||
|
||||
@ApiModelProperty(value = "请求来源", required = true)
|
||||
private KeyText fraSource;
|
||||
|
||||
@ApiModelProperty(value = "合作关系", required = true)
|
||||
private KeyText partnership;
|
||||
|
||||
|
||||
@@ -23,4 +23,7 @@ public class CustomerInfoRequest {
|
||||
private Long lastFollowUserId;
|
||||
|
||||
private String followUserName;
|
||||
|
||||
|
||||
private String ecWantShopArea;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.cool.store.job;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.cool.store.dto.mdm.AccessTokenDTO;
|
||||
import com.cool.store.dto.response.DictResultDTO;
|
||||
import com.cool.store.dto.response.MDMResultDTO;
|
||||
import com.cool.store.entity.HyPartnerFraSourceDO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.HyPartnerFraSourceMapper;
|
||||
import com.cool.store.request.RpcGetMdmTokenReq;
|
||||
import com.cool.store.utils.RestTemplateUtil;
|
||||
import com.xxl.job.core.context.XxlJobHelper;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author hxd
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class FraSourceSyncJob {
|
||||
|
||||
|
||||
@Value("${hs.mdm.baseUrl:null}")
|
||||
private String mdmBaseUrl;
|
||||
|
||||
@Value("${hs.mdm.appkey:null}")
|
||||
private String mdmAppKey;
|
||||
|
||||
@Value("${hs.mdm.appsec:null}")
|
||||
private String mdmAppSec;
|
||||
|
||||
@Resource
|
||||
private HyPartnerFraSourceMapper hyPartnerFraSourceMapper;
|
||||
|
||||
@XxlJob("FraSourceSyncJob")
|
||||
public void fraSourceSyncJob() {
|
||||
XxlJobHelper.log("-------------------------------定时同步800请求来源开始-------------------------------");
|
||||
execute();
|
||||
XxlJobHelper.log("-------------------------------定时同步800请求来源结束-------------------------------");
|
||||
XxlJobHelper.handleSuccess();
|
||||
}
|
||||
|
||||
private void execute() {
|
||||
DictResultDTO dictResultDTO = null;
|
||||
try {
|
||||
dictResultDTO = JSON.parseObject(getDictList(), new TypeReference<DictResultDTO>() {
|
||||
});
|
||||
} catch (ApiException e) {
|
||||
log.error("请求800获取字典报错:" + JSONObject.toJSONString(e));
|
||||
}
|
||||
if (ObjectUtil.isNull(dictResultDTO)) {
|
||||
return;
|
||||
}
|
||||
List<DictResultDTO.Dict> configList = dictResultDTO.getConfigList();
|
||||
List<HyPartnerFraSourceDO> collect = configList.stream().map(item -> {
|
||||
HyPartnerFraSourceDO hyPartnerFraSourceDO = new HyPartnerFraSourceDO();
|
||||
BeanUtil.copyProperties(item, hyPartnerFraSourceDO);
|
||||
hyPartnerFraSourceDO.setSourceId(item.getId());
|
||||
return hyPartnerFraSourceDO;
|
||||
}).collect(Collectors.toList());
|
||||
hyPartnerFraSourceMapper.batchInsertSelective(collect);
|
||||
}
|
||||
|
||||
public String getDictList() throws ApiException {
|
||||
String url = mdmBaseUrl + "/api/openapi/dict/api/dictListByCode?code=mdFraSource";
|
||||
ResponseEntity<MDMResultDTO> responseEntity = null;
|
||||
try {
|
||||
RpcGetMdmTokenReq rpcGetMDMTokenReq = new RpcGetMdmTokenReq();
|
||||
rpcGetMDMTokenReq.setAppKey(mdmAppKey);
|
||||
rpcGetMDMTokenReq.setAppSecret(mdmAppSec);
|
||||
Map<String, String> headers = new HashMap<>(1);
|
||||
headers.put("Authorization", getMdmAccessToken(rpcGetMDMTokenReq));
|
||||
responseEntity = RestTemplateUtil.get(url, headers, MDMResultDTO.class);
|
||||
log.info("url:{}, header:{}, response:{}", url, JSONObject.toJSONString(headers), JSONObject.toJSONString(responseEntity));
|
||||
if (Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()) {
|
||||
return JSONObject.toJSONString(responseEntity.getBody().getData());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("调用MDM接口出错 url{}, e{}", url, e);
|
||||
throw new ApiException(e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getMdmAccessToken(RpcGetMdmTokenReq rpcGetMDMTokenReq) throws ApiException {
|
||||
String url = mdmBaseUrl + "/api/oauth2/accessToken";
|
||||
ResponseEntity<MDMResultDTO> responseEntity = null;
|
||||
try {
|
||||
responseEntity = RestTemplateUtil.post(url, rpcGetMDMTokenReq, MDMResultDTO.class);
|
||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||
if (Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()) {
|
||||
AccessTokenDTO accessTokenDTO = JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getData()), AccessTokenDTO.class);
|
||||
if (accessTokenDTO == null || StringUtils.isBlank(accessTokenDTO.getAccessToken())) {
|
||||
throw new ServiceException("获取Mdm token失败!");
|
||||
}
|
||||
return accessTokenDTO.getAccessToken();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("获取MDM Token 出错 url:\t{}, e:\t{}", url, e);
|
||||
throw new ApiException(e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.entity.HyPartnerFraSourceDO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.request.CreateQualifyVerifyReq;
|
||||
import com.cool.store.request.QualificationCallbackReq;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
@@ -15,4 +17,7 @@ public interface FlowService {
|
||||
void createQualifyVerify(CreateQualifyVerifyReq request) throws ApiException, IOException;
|
||||
|
||||
void qualificationCallback(QualificationCallbackReq request) throws ApiException;
|
||||
|
||||
List<HyPartnerFraSourceDO> getDictList();
|
||||
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class EcSyncServiceImpl implements EcSyncService {
|
||||
try {
|
||||
insertSelectiveSync(customerInfoItem);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("ec同步至招商小程序报错"+JSONObject.toJSONString(e));
|
||||
sendFeiShuRobotMessage("推送:"+JSONObject.toJSONString(e),"27243d49-97ca-4981-8aec-7c3bf84eb660");
|
||||
}
|
||||
}
|
||||
@@ -125,8 +125,7 @@ public class EcSyncServiceImpl implements EcSyncService {
|
||||
}
|
||||
String newPartnerId = UUIDUtils.get32UUID();
|
||||
HyPartnerUserInfoDO resultUser = new HyPartnerUserInfoDO();
|
||||
resultUser.setUsername(customerInfoItem.getName()).setMobile(customerInfoItem.getMobile()).setUserChannelId(Convert.toInt(channelId));
|
||||
|
||||
resultUser.setUsername(customerInfoItem.getName()).setMobile(customerInfoItem.getMobile()).setUserChannelId(Convert.toInt(channelId)).setEcWantShopArea(customerInfoItem.getEcWantShopArea());
|
||||
HyPartnerLineInfoDO resultLine = new HyPartnerLineInfoDO();
|
||||
String followUserName = customerInfoItem.getFollowUserName();
|
||||
String followUserMobile = customerInfoItem.getFollowUserMobile();
|
||||
@@ -216,6 +215,9 @@ public class EcSyncServiceImpl implements EcSyncService {
|
||||
setCreateTime(new Date());
|
||||
hyPartnerBaseInfoDAO.insertSelective(resultBase);
|
||||
}
|
||||
newUserInfo.setEcWantShopArea(resultUser.getEcWantShopArea());
|
||||
//添加ec意向区域同步
|
||||
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(newUserInfo);
|
||||
} else {
|
||||
resultUser.setPartnerId(newPartnerId).setCreateTime(new Date());
|
||||
hyPartnerUserInfoDAO.insertSelective(resultUser);
|
||||
|
||||
@@ -104,8 +104,11 @@ public class FlowServiceImpl implements FlowService {
|
||||
@Autowired
|
||||
private HyInspectionMapper inspectionMapper;
|
||||
|
||||
@Autowired
|
||||
private HyPartnerFraSourceMapper hyPartnerFraSourceMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createQualifyVerify(CreateQualifyVerifyReq request) throws ApiException, IOException {
|
||||
//根据面试id获取面试信息
|
||||
HyPartnerInterviewDO hyPartnerInterviewDO = hyPartnerInterviewMapper.selectByPrimaryKeySelective(request.getInterviewId());
|
||||
@@ -119,10 +122,7 @@ public class FlowServiceImpl implements FlowService {
|
||||
//1.发起加盟商资质审核
|
||||
RpcCreateQualifyVerifyReq rpcRequest = new RpcCreateQualifyVerifyReq();
|
||||
RpcCreateQualifyVerifyReq.Data dataBody = new RpcCreateQualifyVerifyReq().new Data();
|
||||
KeyText fraSource = new KeyText();
|
||||
fraSource.setKey("HSAYPartner");
|
||||
fraSource.setText("沪上阿姨合伙人");
|
||||
dataBody.setFraSource(fraSource);
|
||||
dataBody.setFraSource(request.getFraSource());
|
||||
//copy properties
|
||||
BeanUtil.copyProperties(request, dataBody);
|
||||
//日期格式问题
|
||||
@@ -223,6 +223,24 @@ public class FlowServiceImpl implements FlowService {
|
||||
hyPartnerLineInfoDO.setDevelopmentDirector(request.getDevtDirectorId());
|
||||
hyPartnerLineInfoMapper.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
|
||||
}
|
||||
//3. 生成通过函并修改数据库相关信息
|
||||
String verifyCity = hyPartnerInterviewMapper.getVerifyCityByInterviewId(request.getInterviewId());
|
||||
String[] split = verifyCity.split("/");
|
||||
//根据长度来取市级行政区域
|
||||
if (split.length == 2) {
|
||||
verifyCity = split[1];
|
||||
} else if (split.length == 3) {
|
||||
verifyCity = split[1];
|
||||
} else if (split.length == 4) {
|
||||
verifyCity = split[2];
|
||||
} else {
|
||||
throw new ServiceException(ErrorCodeEnum.INTENT_INFO_NOT_EXIST);
|
||||
}
|
||||
// TODO pass_reason 暂无
|
||||
//将通过时间修改为本系统处理回调的时间,不以 request 的 modifiedTime 为准(有误)
|
||||
String partnerName = request.getIntentionSignerUsername();
|
||||
//TODO 问题:如果因为 pdf 生成失败或者其他原因导致异常,但是由于 MDM 只是做回调,不对回调是否成功负责,会导致流程信息缺失
|
||||
genPassLetterAndUpdateDB(partnerName, verifyCity, new Date(), request.getInterviewId());
|
||||
//记录日志
|
||||
CreateQualifyVerifyDTO log = CreateQualifyVerifyDTO.builder().mobile(operator.getMobile()).operateUserId(operator.getUserId()).operateUsername(operator.getName()).operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC))
|
||||
.summary(request.getSummary()).qualiVerifyContent(JSON.toJSONString(partnerCertificationInfoDO)).build();
|
||||
@@ -251,27 +269,10 @@ public class FlowServiceImpl implements FlowService {
|
||||
if ("FINISHED".equals(request.getInstanceStatus())) {
|
||||
//更新面试状态
|
||||
interviewDAO.updateInterviewWorkflowStatus(interviewPlanId, WorkflowStatusEnum.INTERVIEW_6);
|
||||
//2. 准备需要的信息
|
||||
String partnerName = request.getIntendedSigner();
|
||||
String verifyCity = hyPartnerInterviewMapper.getVerifyCityByInterviewId(interviewId);
|
||||
String[] split = verifyCity.split("/");
|
||||
//根据长度来取市级行政区域
|
||||
if (split.length == 2) {
|
||||
verifyCity = split[1];
|
||||
} else if (split.length == 3) {
|
||||
verifyCity = split[1];
|
||||
} else if (split.length == 4) {
|
||||
verifyCity = split[2];
|
||||
} else {
|
||||
throw new ServiceException(ErrorCodeEnum.INTENT_INFO_NOT_EXIST);
|
||||
}
|
||||
// TODO pass_reason 暂无
|
||||
//将通过时间修改为本系统处理回调的时间,不以 request 的 modifiedTime 为准(有误)
|
||||
Date passDate = new Date();
|
||||
//3. 生成通过函并修改数据库相关信息
|
||||
//TODO 问题:如果因为 pdf 生成失败或者其他原因导致异常,但是由于 MDM 只是做回调,不对回调是否成功负责,会导致流程信息缺失
|
||||
genPassLetterAndUpdateDB(partnerName, verifyCity, passDate, interviewId);
|
||||
//4. 向面试稽核表中新增一条信息
|
||||
//4. 向面试稽核表中新增一条信息
|
||||
HyInspectionDO hyInspectionDO = new HyInspectionDO();
|
||||
hyInspectionDO.setInterviewPlanId(Long.parseLong(interviewPlanId));
|
||||
hyInspectionDO.setCreateTime(DateUtil.formatDateTime(passDate));
|
||||
@@ -299,6 +300,11 @@ public class FlowServiceImpl implements FlowService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HyPartnerFraSourceDO> getDictList() {
|
||||
return hyPartnerFraSourceMapper.selectAllFraSourceList();
|
||||
}
|
||||
|
||||
public List<SkrRelshipProve> OSSFileToMDMFile(List<String> fileUrlList) throws ApiException, IOException {
|
||||
String url = mdmBaseUrl + "/api/openapi/ext/upload/file";
|
||||
ResponseEntity<MDMResultDTO> responseEntity = null;
|
||||
|
||||
@@ -9,10 +9,7 @@ import com.cool.store.service.FlowService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -28,6 +25,8 @@ public class FlowController {
|
||||
|
||||
@Autowired
|
||||
private FlowService flowService;
|
||||
|
||||
|
||||
@PostMapping("/qualifyVerify/create")
|
||||
@ApiOperation("发起加盟商资质审核")
|
||||
public ResponseResult createQualifyVerify(@RequestBody CreateQualifyVerifyReq request) throws ApiException, IOException {
|
||||
@@ -42,4 +41,10 @@ public class FlowController {
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/dictList")
|
||||
@ApiOperation("获取资质审核数据来源")
|
||||
public ResponseResult getDictList(){
|
||||
return ResponseResult.success(flowService.getDictList());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user