Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner

# Conflicts:
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java
This commit is contained in:
俞扬
2023-06-21 16:12:04 +08:00
40 changed files with 516 additions and 147 deletions

View File

@@ -57,6 +57,7 @@ public enum ErrorCodeEnum {
ZONE_NOT_EXIST(500004, "战区不存在!", null),
PARTNER_BASEINFO_NOT_EXIST(500005, "基本信息不存在!", null),
INTENT_INFO_NOT_EXIST(500006, "意向信息不存在!", null),
INTENT_AREA_NOT_BING_ZONE(500007, "意向区域没有绑定战区 分配招商经理失败!", null),
INTERVIEW_ENTER_FAIL(1021101, "进入面试间失败", null),
DINGDING_USER_NOT_EXIST(1021102, "用户钉钉信息不存在,无法发起资质审核!", null),

View File

@@ -25,6 +25,7 @@ public class CoolDateUtils {
public static final String DATE_FORMAT_SEC_4 = "yyyy.MM.dd HH:mm";
public static final String DATE_FORMAT_SEC_5 = "yyyy.MM.dd HH:mm";
public static final String DATE_FORMAT_SEC_6 = "yyyy.MM.dd";
public static final String DATE_FORMAT_SEC_7 = "yyyy/MM/dd HH:mm";
/**
* 几天后的当前
* @param d

View File

@@ -10,6 +10,8 @@ import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author zhangchenbiao
@@ -98,4 +100,9 @@ public class EnterpriseUserDAO {
}
return enterpriseUserMapper.getUserListByRegionIds(regionIds);
}
public Map<String, String> getUserNameAndMobile(List<String> userIds){
List<EnterpriseUserDO> userList = getUserInfoByUserIds(userIds);
return userList.stream().filter(o->!StringUtils.isAnyBlank(o.getMobile(), o.getName())).collect(Collectors.toMap(k -> k.getUserId(), v -> v.getName() + " " + v.getMobile()));
}
}

View File

@@ -52,13 +52,19 @@ public class HyIntendDevMappingDAO {
return hyIntendDevelopementMappingMapper.selectByMappingIdList(idList);
}
public List<ZoneCheckDTO> selectByOpenAreaMappingIdList(List<Long> idList){
public List<ZoneCheckDTO> selectByOpenAreaMappingIdList(List<Long> idList,String type){
if (CollectionUtils.isEmpty(idList)){
return new ArrayList<>();
}
return hyIntendDevelopementMappingMapper.selectByOpenAreaMappingIdList(idList);
return hyIntendDevelopementMappingMapper.selectByOpenAreaMappingIdList(idList,type);
}
public HyIntendDevelopementMappingDO selectByOpenAreaMappingId(Long id,String type){
if (id==null){
return null;
}
return hyIntendDevelopementMappingMapper.selectByOpenAreaMappingId(id,type);
}
public int batchInsert(List<HyIntendDevelopementMappingDO> recordList){
if (CollectionUtils.isEmpty(recordList)){

View File

@@ -42,6 +42,13 @@ public class HyIntendDevZoneInfoDAO {
return hyIntendDevZoneInfoMapper.selectById(id);
}
public List<HyIntendDevZoneInfoDO> selectByIds(List<Long> ids){
if (CollectionUtils.isEmpty(ids)){
return new ArrayList<>();
}
return hyIntendDevZoneInfoMapper.selectByIds(ids);
}
public List<HyIntendDevZoneInfoDO> getHyIntendDevZoneInfoList(String type){
if (StringUtils.isEmpty(type)){

View File

@@ -6,13 +6,17 @@ import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.mapper.HyOpenAreaInfoMapper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
@@ -85,6 +89,14 @@ public class HyOpenAreaInfoDAO {
return hyOpenAreaInfoMapper.selectByIds(ids);
}
public Map<String, String> selectNameMapByIds(List<Long> ids){
if (CollectionUtils.isEmpty(ids)){
return Maps.newHashMap();
}
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOS = hyOpenAreaInfoMapper.selectByIds(ids);
return ListUtils.emptyIfNull(hyOpenAreaInfoDOS).stream().collect(Collectors.toMap(k->String.valueOf(k.getId()), v->v.getAreaName()));
}
public HyOpenAreaInfoDO selectById(Long id){
if (id==null){

View File

@@ -2,10 +2,13 @@ package com.cool.store.dao;
import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.mapper.HyPartnerBaseInfoMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @Author suzhuhong
@@ -25,6 +28,13 @@ public class HyPartnerBaseInfoDAO {
return hyPartnerBaseInfoMapper.insertSelective(record);
}
public int batchInsert( List<HyPartnerBaseInfoDO> records){
if (CollectionUtils.isEmpty(records)){
return 0;
}
return hyPartnerBaseInfoMapper.batchInsert(records);
}
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
@@ -34,6 +44,11 @@ public class HyPartnerBaseInfoDAO {
return hyPartnerBaseInfoMapper.updateByPrimaryKeySelective(record);
}
public int updateByPrimaryKey(HyPartnerBaseInfoDO record){
return hyPartnerBaseInfoMapper.updateByPrimaryKey(record);
}
public int updateByPartnerId(String userName,String mobile,String partnerId){
return hyPartnerBaseInfoMapper.updateByPartnerId(userName,mobile,partnerId);
}
@@ -57,10 +72,17 @@ public class HyPartnerBaseInfoDAO {
return hyPartnerBaseInfoMapper.getByPartnerLineId(partnerLineId);
}
public Long getLineIdByIdCard(String idCard){
public List<HyPartnerBaseInfoDO> getByPartnerLineIds(List<Long> partnerLineId){
if (CollectionUtils.isEmpty(partnerLineId)){
return new ArrayList<>();
}
return hyPartnerBaseInfoMapper.getByPartnerLineIds(partnerLineId);
}
public HyPartnerBaseInfoDO getByIdCard(String idCard){
if (StringUtils.isEmpty(idCard)){
return null;
}
return hyPartnerBaseInfoMapper.getLineIdByIdCard(idCard);
return hyPartnerBaseInfoMapper.getByIdCard(idCard);
}
}

View File

@@ -33,6 +33,9 @@ public interface HyIntendDevZoneInfoMapper {
*/
HyIntendDevZoneInfoDO selectById(@Param("id") Long id);
List<HyIntendDevZoneInfoDO> selectByIds(@Param("ids") List<Long> ids);
/**
* 查询战区列表
* @param type

View File

@@ -55,5 +55,11 @@ public interface HyIntendDevelopementMappingMapper {
*/
List<ZoneCheckDTO> selectByMappingIdList(@Param("mappingIdList") List<Long> mappingIdList);
List<ZoneCheckDTO> selectByOpenAreaMappingIdList(@Param("openAreaMappingIdList") List<Long> openAreaMappingIdList);
List<ZoneCheckDTO> selectByOpenAreaMappingIdList(@Param("openAreaMappingIdList") List<Long> openAreaMappingIdList,
@Param("type") String type);
HyIntendDevelopementMappingDO selectByOpenAreaMappingId(@Param("openAreaMappingId") Long openAreaMappingId,
@Param("type") String type);
}

View File

@@ -3,6 +3,8 @@ package com.cool.store.mapper;
import com.cool.store.entity.HyPartnerBaseInfoDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-05-29 03:51
@@ -16,6 +18,8 @@ public interface HyPartnerBaseInfoMapper {
*/
int insertSelective(@Param("record") HyPartnerBaseInfoDO record);
int batchInsert(@Param("records") List<HyPartnerBaseInfoDO> records);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
@@ -23,6 +27,9 @@ public interface HyPartnerBaseInfoMapper {
*/
int updateByPrimaryKeySelective(@Param("record") HyPartnerBaseInfoDO record);
int updateByPrimaryKey(@Param("record") HyPartnerBaseInfoDO record);
/**
* 根据加盟商ID修改用户名称与手机号
* @param userName
@@ -38,7 +45,11 @@ public interface HyPartnerBaseInfoMapper {
HyPartnerBaseInfoDO getByPartnerLineId(@Param("partnerLineId") Long partnerLineId);
List<HyPartnerBaseInfoDO> getByPartnerLineIds(@Param("partnerLineId") List<Long> partnerLineIds);
Long getLineIdByIdCard(@Param("idCard") String idCard);
HyPartnerBaseInfoDO getByIdCard(@Param("idCard") String idCard);
int cleanIdCardInfoByPartnerLineId(@Param("idCard") String idCard,
@Param("idCardPhotoFront") String idCardPhotoFront,

View File

@@ -305,5 +305,9 @@
enterprise_user
where
deleted = 0 and <foreach collection="regionIds" separator="or" open="(" close=")" item="regionId"> user_region_ids like concat("%", #{regionId}, "%") </foreach>
ORDER BY
CASE WHEN jobnumber='' OR jobnumber IS NULL THEN 1 ELSE 0 END,
SUBSTR(jobnumber,1,1),
CAST(SUBSTR(jobnumber,2) AS UNSIGNED) ASC
</select>
</mapper>

View File

@@ -137,4 +137,18 @@
where
deleted = 0 and <foreach collection="regionIds" separator="or" open="(" close=")" item="regionId">associated_region_id like concat("%", #{regionId}, "%")</foreach>
</select>
<select id="selectByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from hy_intend_dev_zone_info
<where>
<if test="ids !=null and ids.size>0">
<foreach collection="ids" item="id" open="and id in (" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>
</mapper>

View File

@@ -135,9 +135,13 @@
<select id="selectByOpenAreaMappingIdList" resultType="com.cool.store.dto.partner.ZoneCheckDTO">
select
a.open_area_mapping_id as openAreaMappingId,
b.zone_name as zoneName
b.zone_name as zoneName,
b.id as zoneId
from hy_intend_developement_mapping a inner join hy_intend_dev_zone_info b on a.mapping_id = b.id
<where>
<if test="type!=null and type !=''">
and type = #{type}
</if>
<if test="openAreaMappingIdList!=null and openAreaMappingIdList.size>0">
<foreach collection="openAreaMappingIdList" open="and a.open_area_mapping_id in (" close=")" separator="," item="mappingId">
#{mappingId}
@@ -145,4 +149,18 @@
</if>
</where>
</select>
<select id="selectByOpenAreaMappingId" resultMap="BaseResultMap">
select
*
from hy_intend_developement_mapping a
<where>
<if test="type!=null and type !=''">
and a.type = #{type}
</if>
<if test="openAreaMappingId!=null">
and a.open_area_mapping_id = #{openAreaMappingId}
</if>
</where>
</select>
</mapper>

View File

@@ -27,6 +27,21 @@
id_card_photo_front, id_card_photo_black, live_address, user_portrait, status, latest_log_message,
pass_reason, certify_file, create_time, update_time
</sql>
<insert id="batchInsert">
insert into
hy_partner_base_info
(
partner_id,
partner_line_id
)
values
<foreach collection="records" item="record" separator=",">
(#{record.partnerId},
#{record.partnerLineId}
</foreach>
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_base_info
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -142,6 +157,9 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update hy_partner_base_info
<set>
@@ -203,6 +221,18 @@
where id = #{record.id}
</update>
<update id="updateByPrimaryKey">
update hy_partner_base_info
set
nation = #{record.nation},
birthdate = #{record.birthdate},
id_card = #{record.idCard},
id_card_photo_front = #{record.idCardPhotoFront},
id_card_photo_black = #{record.idCardPhotoBlack},
live_address = #{record.liveAddress}
where id = #{record.id}
</update>
<update id="updateByPartnerId">
update hy_partner_base_info
@@ -231,9 +261,22 @@
where partner_line_id = #{partnerLineId}
</select>
<select id="getLineIdByIdCard" resultType="java.lang.Long">
<select id="getByPartnerLineIds" resultMap="BaseResultMap" >
select
partner_line_id
<include refid="Base_Column_List"></include>
from hy_partner_base_info
<where>
<if test="partnerLineIds !=null and partnerLineIds.size>0">
<foreach collection="partnerLineIds" item="lineId" open="and partner_line_id in (" close=")" separator=",">
#{lineId}
</foreach>
</if>
</where>
</select>
<select id="getByIdCard" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from hy_partner_base_info
where id_card = #{idCard}
</select>

View File

@@ -36,7 +36,7 @@
</select>
<insert id="batchInsert">
<insert id="batchInsert" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into
hy_partner_line_info
(
@@ -323,7 +323,7 @@
<include refid="Base_Column_List"></include>
from hy_partner_line_info
<where>
<if test="userId">
<if test="userId != null">
and investment_manager = #{userId}
</if>
<if test="lastMonthTodayDate!=null">

View File

@@ -43,11 +43,13 @@
select
<include refid="Base_Column_List"></include>
from hy_partner_user_info
<if test="partnerIdList!=null and partnerIdList.size>0">
<foreach collection="partnerIdList" open="and partner_id in (" close=")" separator="," item="partnerId">
#{partnerId}
</foreach>
</if>
<where>
<if test="partnerIdList!=null and partnerIdList.size>0">
<foreach collection="partnerIdList" open="and partner_id in (" close=")" separator="," item="partnerId">
#{partnerId}
</foreach>
</if>
</where>
</select>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">

View File

@@ -12,6 +12,8 @@ public class ZoneCheckDTO {
private Long openAreaMappingId;
private Long zoneId;
private String areaName;
private String zoneName;

View File

@@ -31,10 +31,10 @@ public class BlackListVO {
private String phoneAddress;
@ApiModelProperty("创建时间")
private Date createTime;
private String createTime;
@ApiModelProperty("操作时间")
private Date closeTime;
private String closeTime;
@ApiModelProperty("操作人ID")
private String closeUserId;

View File

@@ -1,10 +1,19 @@
package com.cool.store.vo;
import cn.hutool.core.date.DateUtil;
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
import com.cool.store.entity.HyPartnerUserInfoDO;
import com.cool.store.utils.CoolDateUtils;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
@@ -16,7 +25,6 @@ import java.util.Date;
@ApiModel
public class PartnerIntentApplyInfoVO {
@ApiModelProperty("")
private Long id;
@@ -45,7 +53,7 @@ public class PartnerIntentApplyInfoVO {
private Integer acceptAdjustType;
@ApiModelProperty("截止时间")
private Date deadline;
private String deadline;
@ApiModelProperty("阶段提交时间")
private Date partnerSubmitTime;
@@ -53,4 +61,31 @@ public class PartnerIntentApplyInfoVO {
@ApiModelProperty("阶段状态")
private String WorkflowStatus;
public static List<PartnerIntentApplyInfoVO> convertList(List<PartnerIntentApplyInfoDTO> list, Map<String, HyPartnerUserInfoDO> infoDOMap, Map<String, String> wantShopAreaNameMap, String workflowStatus){
if(CollectionUtils.isEmpty(list)){
return Lists.newArrayList();
}
List<PartnerIntentApplyInfoVO> resultList = new ArrayList<>();
for (PartnerIntentApplyInfoDTO partnerIntentApplyInfoDTO : list) {
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO();
partnerIntentApplyInfoVO.setId(partnerIntentApplyInfoDTO.getId());
partnerIntentApplyInfoVO.setPartnerId(partnerIntentApplyInfoDTO.getPartnerId());
partnerIntentApplyInfoVO.setLineId(partnerIntentApplyInfoDTO.getPartnerLineId());
partnerIntentApplyInfoVO.setPartnerSubmitTime(partnerIntentApplyInfoDTO.getPartnerSubmitTime());
partnerIntentApplyInfoVO.setAcceptAdjustType(partnerIntentApplyInfoDTO.getAcceptAdjustType());
partnerIntentApplyInfoVO.setLiveArea(partnerIntentApplyInfoDTO.getLiveArea());
partnerIntentApplyInfoVO.setWantShopArea(partnerIntentApplyInfoDTO.getWantShopArea());
String deadLine = DateUtil.format(partnerIntentApplyInfoDTO.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC);
partnerIntentApplyInfoVO.setDeadline(deadLine);
HyPartnerUserInfoDO infoDOMapOrDefault = infoDOMap.getOrDefault(partnerIntentApplyInfoDTO.getPartnerId(), new HyPartnerUserInfoDO());
partnerIntentApplyInfoVO.setPartnerUserName(infoDOMapOrDefault.getUsername());
partnerIntentApplyInfoVO.setPartnerUserPhone(infoDOMapOrDefault.getMobile());
partnerIntentApplyInfoVO.setWorkflowStatus(workflowStatus);
partnerIntentApplyInfoVO.setWantShopAreaName(wantShopAreaNameMap.get(partnerIntentApplyInfoDTO.getWantShopArea()));
resultList.add(partnerIntentApplyInfoVO);
}
return resultList;
}
}

View File

@@ -1,11 +1,15 @@
package com.cool.store.vo;
import io.swagger.annotations.Api;
import cn.hutool.core.date.DateUtil;
import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.utils.CoolDateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @Author suzhuhong
@@ -19,7 +23,6 @@ public class PartnerLineInfoVO {
@ApiModelProperty("")
private Long lineId;
@ApiModelProperty("hy_partner_user_info.partner_id")
private String partnerId;
@@ -42,7 +45,7 @@ public class PartnerLineInfoVO {
private String developmentManager;
@ApiModelProperty("截止时间")
private Date deadline;
private String deadline;
@ApiModelProperty("通过原因")
private String passReason;
@@ -59,20 +62,50 @@ public class PartnerLineInfoVO {
@ApiModelProperty("冷静期首次登录 是-true 否-false")
private Boolean coolingPeriodFirstLoginFlag;
@ApiModelProperty("加盟商用户ID")
private String partnerUserId;
@ApiModelProperty("加盟商用户名称")
private String partnerUserName;
@ApiModelProperty("加盟商用户手机号")
private String partnerUserPhone;
@ApiModelProperty("结束操作人ID")
private String closeUserId ;
private String closeUserId ;
@ApiModelProperty("结束操作人名称")
private String closeUserName ;
private String closeUserName ;
@ApiModelProperty("结束时间")
private Date closeDate ;
private String closeDate ;
/**
*
* @param lineList
* @return
*/
public static List<PartnerLineInfoVO> convertList(List<HyPartnerLineInfoDO> lineList, Map<String, String> userNamePhoneMap){
List<PartnerLineInfoVO> resultList = new ArrayList<>();
for (HyPartnerLineInfoDO line : lineList) {
PartnerLineInfoVO result = new PartnerLineInfoVO();
result.setLineId(line.getId());
result.setPartnerId(line.getPartnerId());
result.setCertifyFile(line.getCertifyFile());
result.setWorkflowStage(line.getWorkflowStage());
result.setWorkflowStatus(line.getWorkflowStatus());
result.setLineStatus(line.getLineStatus());
String deadLine = DateUtil.format(line.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC);
result.setDeadline(deadLine);
result.setPassReason(line.getPassReason());
result.setRejectPublicReason(line.getRejectPublicReason());
result.setRejectRealReason(line.getRejectRealReason());
result.setCertifyFile(line.getCertifyFile());
result.setCloseUserId(line.getCloseUserId());
result.setCloseUserName(userNamePhoneMap.get(line.getCloseUserId()));
String closeDate = DateUtil.format(line.getCloseTime(), CoolDateUtils.DATE_FORMAT_SEC_7);
result.setCloseDate(closeDate);
resultList.add(result);
}
return resultList;
}
}

View File

@@ -1,10 +1,17 @@
package com.cool.store.vo;
import cn.hutool.core.date.DateUtil;
import com.cool.store.dto.partner.PrivateSeaLineDTO;
import com.cool.store.utils.CoolDateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.time.DateUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @Author suzhuhong
@@ -35,7 +42,7 @@ public class PrivateSeaLineListVo {
private String partnerUserPhone;
@ApiModelProperty("截止时间")
private Date deadline;
private String deadline;
@ApiModelProperty("招商经理")
private String investmentManager;
@@ -52,11 +59,14 @@ public class PrivateSeaLineListVo {
@ApiModelProperty("意向开店区域")
private String wantShopArea;
@ApiModelProperty("意向开店区域名称")
private String wantShopAreaName;
@ApiModelProperty("0不接受调剂、1全国调剂、2省内调剂、3市内调剂")
private Integer acceptAdjustType;
@ApiModelProperty("更新时间")
private Date updateTime;
private String updateTime;
@ApiModelProperty("门店编码")
private String storeCode;
@@ -73,4 +83,40 @@ public class PrivateSeaLineListVo {
@ApiModelProperty("推荐加盟商名称")
private String recommendPartnerName;
public static List<PrivateSeaLineListVo> convertList(List<PrivateSeaLineDTO> list, Map<String, String> finalDevManagerMap, Map<String, String> wantShopAreaNameMap){
List<PrivateSeaLineListVo> resultList = new ArrayList<>();
for (PrivateSeaLineDTO x : list) {
PrivateSeaLineListVo privateSeaLineListVo = new PrivateSeaLineListVo();
privateSeaLineListVo.setLineId(x.getLineId());
privateSeaLineListVo.setLineStatus(x.getLineStatus());
privateSeaLineListVo.setPartnerId(x.getPartnerId());
privateSeaLineListVo.setWorkflowStatus(x.getWorkflowStatus());
String deadLine = DateUtil.format(x.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC);
privateSeaLineListVo.setDeadline(deadLine);
privateSeaLineListVo.setPartnerUserPhone(x.getPartnerUserPhone());
privateSeaLineListVo.setPartnerUserName(x.getPartnerUserName());
privateSeaLineListVo.setAcceptAdjustType(x.getAcceptAdjustType());
privateSeaLineListVo.setInvestmentManagerName(x.getInvestmentManager());
privateSeaLineListVo.setDevelopmentManager(x.getDevelopmentManager());
privateSeaLineListVo.setInvestmentManagerName(x.getInvestmentManagerName());
privateSeaLineListVo.setStoreCode(x.getStoreCode());
privateSeaLineListVo.setStoreName(x.getStoreName());
String updateTime = DateUtil.format(x.getUpdateTime(), CoolDateUtils.DATE_FORMAT_SEC);
privateSeaLineListVo.setUpdateTime(updateTime);
privateSeaLineListVo.setRecommendPartnerId(x.getRecommendPartnerId());
privateSeaLineListVo.setAcceptAdjustType(x.getAcceptAdjustType());
privateSeaLineListVo.setWantShopArea(x.getWantShopArea());
privateSeaLineListVo.setWantShopAreaName(wantShopAreaNameMap.get(x.getWantShopArea()));
privateSeaLineListVo.setInvestmentManager(x.getInvestmentManager());
privateSeaLineListVo.setRecommendPartnerName(x.getRecommendPartnerName());
privateSeaLineListVo.setWorkflowStage(x.getWorkflowStage());
privateSeaLineListVo.setWantShopArea(x.getWantShopArea());
privateSeaLineListVo.setWorkflowStage(x.getWorkflowStage());
privateSeaLineListVo.setDevelopmentManagerName(finalDevManagerMap.get(x.getDevelopmentManager()));
resultList.add(privateSeaLineListVo);
}
return resultList;
}
}

View File

@@ -53,7 +53,7 @@ public class PublicSeaLineListVo {
private String rejectRealReason;
@ApiModelProperty("返回公海时间")
private Date LastCloseDate ;
private String LastCloseDate ;
@ApiModelProperty("招商经理")
private String lastInvestmentManager;

View File

@@ -34,7 +34,7 @@ public class CustomExceptionHandler {
@ExceptionHandler(value = ServiceException.class)
public void handleCustomException(ServiceException e, HttpServletResponse httpServletResponse) {
log.error(e.getMessage(), e);
ResponseResult responseResult = new ResponseResult(e.getErrorCode(), e.getMessage());
ResponseResult responseResult = new ResponseResult(e.getErrorCode(), e.getErrorMessage());
responseResult(httpServletResponse, responseResult);
}
@@ -52,7 +52,6 @@ public class CustomExceptionHandler {
responseResult(httpServletResponse, responseResult);
}
private void responseResult(HttpServletResponse response, ResponseResult result) {
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-type", "application/json;charset=UTF-8");

View File

@@ -0,0 +1,17 @@
package com.cool.store.service;
/**
* @Author suzhuhong
* @Date 2023/6/21 15:01
* @Version 1.0
*/
public interface GaoDeService {
/**
* 根据经纬度生成图片
* @param latitudeLongitude
* @return
*/
String getGaoDePicture(String latitudeLongitude);
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.service;
import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.request.AddTagsRequest;
import com.cool.store.request.PartnerBaseInfoRequest;
import com.cool.store.vo.PartnerBaseInfoVO;
@@ -26,7 +27,7 @@ public interface HyPartnerBaseInfoService {
PartnerBaseInfoVO getByPartnerLineId(Long lineId);
Long getLineIdByIdCard(String idCard);
HyPartnerBaseInfoDO getByIdCard(String idCard);
Boolean changeBinding(String idCard, Long lineId, PartnerUserInfoVO currentUser);

View File

@@ -128,7 +128,7 @@ public interface HyPartnerLineInfoService {
* @param lineId
* @return
*/
Boolean assignFollowUser(Long lineId);
Boolean assignFollowUser(String partnerId, String wantShopArea, Integer acceptAdjustType);
/**
* 线索状态
@@ -138,6 +138,12 @@ public interface HyPartnerLineInfoService {
*/
Boolean getLineStatus(Long wantShopAreaId,Integer acceptAdjustType);
/**
* 查询跟进人
* @param partnerId
* @return
*/
String getAssignFollowUser(String partnerId,String type);

View File

@@ -0,0 +1,31 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.service.GaoDeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
/**
* @Author suzhuhong
* @Date 2023/6/21 15:04
* @Version 1.0
*/
@Service
@Slf4j
public class GaoDeServiceImpl implements GaoDeService {
@Resource
RestTemplate restTemplate;
@Override
public String getGaoDePicture(String latitudeLongitude) {
String url = "https://restapi.amap.com/v3/staticmap?location=120.21201,30.2084&zoom=10&size=750*300&markers=mid,,A:116.481485,39.990464&key=fb6332444cab4eba54655571dfc68f5b&markersStyle=-1";
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
String body = forEntity.getBody();
log.info("--------------{}", JSONObject.toJSON(body));
return body;
}
}

View File

@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.MessageFormat;
import java.util.Date;
/**
* @Author suzhuhong
@@ -120,15 +121,15 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
}
@Override
public Long getLineIdByIdCard(String idCard) {
return hyPartnerBaseInfoDAO.getLineIdByIdCard(idCard);
public HyPartnerBaseInfoDO getByIdCard(String idCard) {
return hyPartnerBaseInfoDAO.getByIdCard(idCard);
}
@Override
public Boolean changeBinding(String idCard, Long lineId, PartnerUserInfoVO currentUser) {
// 把旧线索的身份证号置空,状态改为待提交
Long oldLineId = hyPartnerBaseInfoDAO.getLineIdByIdCard(idCard);
HyPartnerLineInfoDO oldLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(oldLineId);
HyPartnerBaseInfoDO oldBaseInfo = hyPartnerBaseInfoDAO.getByIdCard(idCard);
HyPartnerLineInfoDO oldLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(oldBaseInfo.getPartnerLineId());
// 该身份证当前申请状态同步至该账号下,原账号变为【加盟意向申请 待提交状态】
HyPartnerLineInfoDO newLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(lineId);
newLineInfo.setWorkflowStage(oldLineInfo.getWorkflowStage());
@@ -139,11 +140,32 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
oldLineInfo.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
oldLineInfo.setLineStatus(LineStatusEnum.PUBLIC_SEAS.getCode());
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(oldLineInfo);
hyPartnerBaseInfoDAO.cleanIdCardInfoByPartnerLineId(null, null, null, oldLineId);
// 新线索绑定身份证号
HyPartnerBaseInfoDO newBaseInfo = hyPartnerBaseInfoDAO.getByPartnerIdAndLineId(currentUser.getPartnerId(), lineId);
fillBaseInfoIdCard(newBaseInfo, oldBaseInfo.getIdCard(), oldBaseInfo.getIdCardPhotoFront(), oldBaseInfo.getIdCardPhotoBlack(), oldBaseInfo.getUsername(),
oldBaseInfo.getSex(), oldBaseInfo.getBirthdate(), oldBaseInfo.getNation(), oldBaseInfo.getLiveAddress(), oldBaseInfo.getStatus());
newBaseInfo.setStatus(oldBaseInfo.getStatus());
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(newBaseInfo);
// 老的身份证信息置空
fillBaseInfoIdCard(oldBaseInfo, null, null, null, null, null, null, null, null, null);
oldBaseInfo.setStatus(Integer.valueOf(WorkflowStatusEnum.INTENT_0.getCode()));
hyPartnerBaseInfoDAO.updateByPrimaryKey(oldBaseInfo);
return true;
}
private void fillBaseInfoIdCard(HyPartnerBaseInfoDO newBaseInfo, String idCard, String idCardPhotoFront, String idCardPhotoBlack,
String username, Integer sex, Date birthdate, String nation, String liveAddress, Integer status) {
newBaseInfo.setIdCard(idCard);
newBaseInfo.setIdCardPhotoBlack(idCardPhotoFront);
newBaseInfo.setIdCardPhotoFront(idCardPhotoBlack);
newBaseInfo.setUsername(username);
newBaseInfo.setSex(sex);
newBaseInfo.setBirthdate(birthdate);
newBaseInfo.setNation(nation);
newBaseInfo.setLiveAddress(liveAddress);
newBaseInfo.setStatus(status);
}
private void fillBaseInfo(HyPartnerBaseInfoDO baseInfoDO, PartnerBaseInfoRequest request) {
baseInfoDO.setPartnerId(request.getPartnerId());
baseInfoDO.setPartnerLineId(request.getPartnerLineId());

View File

@@ -6,6 +6,7 @@ import com.cool.store.constants.CommonConstants;
import com.cool.store.constants.RedisConstant;
import com.cool.store.dao.*;
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
import com.cool.store.dto.partner.PrivateSeaLineDTO;
import com.cool.store.entity.HyOpenAreaInfoDO;
import com.cool.store.entity.HyPartnerIntentInfoDO;
import com.cool.store.entity.HyPartnerUserInfoDO;
@@ -78,17 +79,10 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
List<String> partnerIds = list.stream().map(PartnerIntentApplyInfoDTO::getPartnerId).collect(Collectors.toList());
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds);
Map<String, HyPartnerUserInfoDO> infoDOMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, data -> data));
List<PartnerIntentApplyInfoVO> result = new ArrayList<>();
String finalWorkflowStatus = workflowStatus;
list.stream().forEach(x->{
PartnerIntentApplyInfoVO pat = partnerIntentApplyInfoDTOToVo(x);
HyPartnerUserInfoDO infoDOMapOrDefault = infoDOMap.getOrDefault(x.getPartnerId(), new HyPartnerUserInfoDO());
pat.setPartnerUserName(infoDOMapOrDefault.getUsername());
pat.setPartnerUserPhone(infoDOMapOrDefault.getMobile());
pat.setWorkflowStatus(finalWorkflowStatus);
result.add(pat);
});
partnerIntentApplyInfo.setList(result);
List<Long> wantShopAreaList = list.stream().map(PartnerIntentApplyInfoDTO::getWantShopArea).map(Long::parseLong).distinct().collect(Collectors.toList());
Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList);
List<PartnerIntentApplyInfoVO> resultList = PartnerIntentApplyInfoVO.convertList(list, infoDOMap, wantShopAreaNameMap, workflowStatus);
partnerIntentApplyInfo.setList(resultList);
return partnerIntentApplyInfo;
}
@@ -179,7 +173,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
intentInfoDO.setMaxBudget(request.getMaxBudget());
intentInfoDO.setMoneySource(request.getMoneySource());
if(CollectionUtils.isNotEmpty(request.getMoneyProve())){
intentInfoDO.setMoneyProve(String.join(",", request.getMoneyProve()));
intentInfoDO.setMoneyProve(JSONObject.toJSONString(request.getMoneyProve()));
}
intentInfoDO.setEducation(request.getEducation());
intentInfoDO.setWorkYear(request.getWorkYear());
@@ -193,23 +187,6 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
intentInfoDO.setWeakness(request.getWeakness());
}
/**
* partnerIntentApplyInfoDTOToVo
* @param partnerIntentApplyInfoDTO
* @return
*/
private PartnerIntentApplyInfoVO partnerIntentApplyInfoDTOToVo(PartnerIntentApplyInfoDTO partnerIntentApplyInfoDTO){
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO();
partnerIntentApplyInfoVO.setId(partnerIntentApplyInfoDTO.getId());
partnerIntentApplyInfoVO.setPartnerId(partnerIntentApplyInfoDTO.getPartnerId());
partnerIntentApplyInfoVO.setLineId(partnerIntentApplyInfoDTO.getPartnerLineId());
partnerIntentApplyInfoVO.setPartnerSubmitTime(partnerIntentApplyInfoDTO.getPartnerSubmitTime());
partnerIntentApplyInfoVO.setAcceptAdjustType(partnerIntentApplyInfoDTO.getAcceptAdjustType());
partnerIntentApplyInfoVO.setLiveArea(partnerIntentApplyInfoDTO.getLiveArea());
partnerIntentApplyInfoVO.setWantShopArea(partnerIntentApplyInfoDTO.getWantShopArea());
partnerIntentApplyInfoVO.setDeadline(partnerIntentApplyInfoDTO.getDeadline());
return partnerIntentApplyInfoVO;
}
/**
@@ -240,6 +217,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
partnerIntentInfoVO.setOtherBand(hyPartnerIntentInfoDO.getOtherBand());
partnerIntentInfoVO.setStrength(hyPartnerIntentInfoDO.getStrength());
partnerIntentInfoVO.setNeedImprove(hyPartnerIntentInfoDO.getNeedImprove());
partnerIntentInfoVO.setWantShopInfo(hyPartnerIntentInfoDO.getWantShopInfo());
return partnerIntentInfoVO;
}

View File

@@ -8,10 +8,7 @@ import com.cool.store.constants.RedisConstant;
import com.cool.store.dao.*;
import com.cool.store.dto.buser.UserPositionAndUserScopeDTO;
import com.cool.store.dto.partner.*;
import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.entity.HyOpenAreaInfoDO;
import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.entity.HyPartnerUserInfoDO;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.CloseFollowRequest;
@@ -32,6 +29,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.sql.Array;
import java.text.MessageFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -60,6 +58,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
EnterpriseUserService enterpriseUserService;
@Resource
AliyunService aliyunService;
@Resource
HyPartnerBaseInfoDAO hyPartnerBaseInfoDAO;
@Override
public StageCountVO selectStagePendingCount(String userId) {
@@ -87,7 +87,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
}
if (StringUtils.isNotEmpty(partnerLineInfoAndBaseInfoVO.getPartnerUserPhone())){
DescribePhoneNumberDTO phoneNumberAttribute = aliyunService.getPhoneNumberAttribute(partnerLineInfoAndBaseInfoVO.getPartnerUserPhone());
partnerLineInfoAndBaseInfoVO.setPhoneAddress(phoneNumberAttribute!=null?phoneNumberAttribute.getCity():"");
partnerLineInfoAndBaseInfoVO.setPhoneAddress(phoneNumberAttribute!=null? phoneNumberAttribute.getProvince() + " " + phoneNumberAttribute.getCity():"");
}
if (StringUtils.isNotEmpty(partnerLineInfoAndBaseInfoDTO.getWantShopArea())){
HyOpenAreaInfoDO hyOpenAreaInfoDO = hyOpenAreaInfoDAO.selectById(Long.valueOf(partnerLineInfoAndBaseInfoDTO.getWantShopArea()));
@@ -106,16 +106,11 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
PageHelper.startPage(pageNumber,pageSize);
String lastMonthTodayDate = DateUtil.format(CoolDateUtils.getDateBefore(new Date(),-30), CoolDateUtils.DATE_FORMAT_SEC);
PageInfo hyPartnerLineInfoDOPageInfo = new PageInfo(hyPartnerLineInfoDAO.lastMonthCloseLine(userId, lastMonthTodayDate));
List<HyPartnerLineInfoDO> list = hyPartnerLineInfoDOPageInfo.getList();
List<PartnerLineInfoVO> result = new ArrayList<>();
list.stream().forEach(x->{
PartnerLineInfoVO partnerLineInfoVO = new PartnerLineInfoVO();
BeanUtils.copyProperties(x,partnerLineInfoVO);
partnerLineInfoVO.setLineId(x.getId());
result.add(partnerLineInfoVO);
});
hyPartnerLineInfoDOPageInfo.setList(result);
List<String> closeUserIds = list.stream().filter(o -> Objects.nonNull(o.getCloseUserId())).map(HyPartnerLineInfoDO::getCloseUserId).distinct().collect(Collectors.toList());
Map<String, String> userNamePhoneMap = enterpriseUserDAO.getUserNameAndMobile(closeUserIds);
List<PartnerLineInfoVO> resultList = PartnerLineInfoVO.convertList(list, userNamePhoneMap);
hyPartnerLineInfoDOPageInfo.setList(resultList);
return hyPartnerLineInfoDOPageInfo;
}
@@ -138,6 +133,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
//过滤出已结束的线索 这块线索需要重新生成新的线索
List<HyPartnerLineInfoDO> closeLineList = partnerLineInfoList.stream().filter(x -> x.getCloseTime() != null).collect(Collectors.toList());
List<Long> closeLineIdList = closeLineList.stream().map(HyPartnerLineInfoDO::getId).collect(Collectors.toList());
//已结束的线索 需要重新生成一条新的线索
List<HyPartnerLineInfoDO> list = new ArrayList<>();
closeLineList.stream().forEach(x->{
@@ -150,6 +146,14 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
list.add(hyPartnerLineInfoDO);
});
hyPartnerLineInfoDAO.batchInsert(list);
List<HyPartnerBaseInfoDO> hyPartnerBaseInfoDOS = new ArrayList<>();
list.forEach(x->{
HyPartnerBaseInfoDO newHyPartnerBaseInfoDO = new HyPartnerBaseInfoDO();
newHyPartnerBaseInfoDO.setPartnerId(x.getPartnerId());
newHyPartnerBaseInfoDO.setPartnerLineId(x.getId());
hyPartnerBaseInfoDOS.add(newHyPartnerBaseInfoDO);
});
hyPartnerBaseInfoDAO.batchInsert(hyPartnerBaseInfoDOS);
//将老的线索置为删除状态
hyPartnerLineInfoDAO.batchDeleted(closeLineIdList);
//没有结束的线索直接分配招商经理
@@ -157,7 +161,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
List<Long> otherLineIdList = otherLineList.stream().map(HyPartnerLineInfoDO::getId).collect(Collectors.toList());
hyPartnerLineInfoDAO.updateInvestmentManager(userId, otherLineIdList);
return null;
return Boolean.TRUE;
}
@Override
@@ -166,8 +170,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
PageInfo blackListDTOPageInfo = new PageInfo(hyPartnerLineInfoDAO.getBlackList(LineRequest.getUserNameKeyword(), LineRequest.getPhoneKeyword(),LineRequest.getIntentArea(), LineRequest.getAcceptAdjustType()));
List<PartnerBlackListDTO> list = blackListDTOPageInfo.getList();
List<String> closeUserIdList = list.stream().map(PartnerBlackListDTO::getCloseUserId).collect(Collectors.toList());
List<EnterpriseUserDO> userInfoByUserIds = enterpriseUserDAO.getUserInfoByUserIds(closeUserIdList);
Map<String, String> userPhoneMap = userInfoByUserIds.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getMobile));
Map<String, String> userPhoneMap = enterpriseUserDAO.getUserNameAndMobile(closeUserIdList);
List<BlackListVO> result = new ArrayList<>();
list.stream().forEach(x->{
BlackListVO blackListVO = convertPartnerBlackListDTOToVo(x);
@@ -255,6 +258,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
hyPartnerLineInfoDO.setCertifyFile(JSONObject.toJSONString(closeFollowRequest.getCertifyFile()));
}
hyPartnerLineInfoDO.setLineStatus(LineStatusEnum.PUBLIC_SEAS.getCode());
hyPartnerLineInfoDO.setCloseTime(new Date());
hyPartnerLineInfoDO.setCloseUserId(userId);
}
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
return Boolean.TRUE;
@@ -287,8 +292,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
List<HyPartnerLineInfoDO> partnerLastLine = hyPartnerLineInfoDAO.getPartnerLastLine(partnerIdList);
List<String> investmentManagerIds = partnerLastLine.stream().map(HyPartnerLineInfoDO::getInvestmentManager).collect(Collectors.toList());
List<EnterpriseUserDO> userInfoList = enterpriseUserDAO.getUserInfoByUserIds(investmentManagerIds);
Map<String, String> mobileMap = userInfoList.stream().filter(x ->
StringUtil.isNotEmpty(x.getMobile())).collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getMobile));
Map<String, String> nameMobileMap = userInfoList.stream().filter(x ->
StringUtil.isNotEmpty(x.getMobile())).collect(Collectors.toMap(EnterpriseUserDO::getUserId, v-> v.getName() + " "+ v.getMobile()));
Map<String, HyPartnerLineInfoDO> hyPartnerLineInfoDOMap = partnerLastLine.stream().collect(Collectors.toMap(HyPartnerLineInfoDO::getPartnerId, data -> data));
List<LineCountDTO> followCountList = hyPartnerLineInfoDAO.getFollowCountList(partnerIdList);
@@ -297,7 +302,6 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
List<PublicSeaLineListVo> result = new ArrayList<>();
list.forEach(x->{
PublicSeaLineListVo publicSeaLineListVo = new PublicSeaLineListVo();
publicSeaLineListVo.setPartnerId(x.getPartnerId());
publicSeaLineListVo.setCreateTime(DateUtil.format(x.getCreateTime(),CoolDateUtils.DATE_FORMAT_SEC));
publicSeaLineListVo.setPartnerUserName(x.getUserName());
@@ -308,13 +312,12 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
publicSeaLineListVo.setId(x.getLineId());
publicSeaLineListVo.setAcceptAdjustType(x.getAcceptAdjustType());
publicSeaLineListVo.setFollowCount(countMap.getOrDefault(x.getPartnerId(),0));
HyPartnerLineInfoDO hy = hyPartnerLineInfoDOMap.getOrDefault(x.getPartnerId(), new HyPartnerLineInfoDO());
publicSeaLineListVo.setRejectPublicReason(hy.getRejectPublicReason());
publicSeaLineListVo.setRejectRealReason(hy.getRejectRealReason());
publicSeaLineListVo.setLastCloseDate(hy.getCloseTime());
publicSeaLineListVo.setLastInvestmentManager(hy.getInvestmentManager());
publicSeaLineListVo.setLastInvestmentManager(mobileMap.get(hy.getInvestmentManager()));
String closeTime = DateUtil.format(hy.getCloseTime(), CoolDateUtils.DATE_FORMAT_SEC);
publicSeaLineListVo.setLastCloseDate(closeTime);
publicSeaLineListVo.setLastInvestmentManager(nameMobileMap.get(hy.getInvestmentManager()));
result.add(publicSeaLineListVo);
});
publicSeaLineList.setList(result);
@@ -341,37 +344,9 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
List<EnterpriseUserDO> devManagerList = enterpriseUserDAO.getUserInfoByUserIds(devManagerIdList);
devManagerMap = devManagerList.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getName));
}
List<PrivateSeaLineListVo> result = new ArrayList<>();
Map<String, String> finalDevManagerMap = devManagerMap;
list.forEach(x->{
PrivateSeaLineListVo privateSeaLineListVo = new PrivateSeaLineListVo();
privateSeaLineListVo.setLineId(x.getLineId());
privateSeaLineListVo.setLineStatus(x.getLineStatus());
privateSeaLineListVo.setPartnerId(x.getPartnerId());
privateSeaLineListVo.setWorkflowStatus(x.getWorkflowStatus());
privateSeaLineListVo.setDeadline(x.getDeadline());
privateSeaLineListVo.setPartnerUserPhone(x.getPartnerUserPhone());
privateSeaLineListVo.setPartnerUserName(x.getPartnerUserName());
privateSeaLineListVo.setAcceptAdjustType(x.getAcceptAdjustType());
privateSeaLineListVo.setInvestmentManagerName(x.getInvestmentManager());
privateSeaLineListVo.setDevelopmentManager(x.getDevelopmentManager());
privateSeaLineListVo.setInvestmentManagerName(x.getInvestmentManagerName());
privateSeaLineListVo.setStoreCode(x.getStoreCode());
privateSeaLineListVo.setStoreName(x.getStoreName());
privateSeaLineListVo.setUpdateTime(x.getUpdateTime());
privateSeaLineListVo.setDeadline(x.getDeadline());
privateSeaLineListVo.setRecommendPartnerId(x.getRecommendPartnerId());
privateSeaLineListVo.setAcceptAdjustType(x.getAcceptAdjustType());
privateSeaLineListVo.setWantShopArea(x.getWantShopArea());
privateSeaLineListVo.setInvestmentManager(x.getInvestmentManager());
privateSeaLineListVo.setRecommendPartnerName(x.getRecommendPartnerName());
privateSeaLineListVo.setWorkflowStage(x.getWorkflowStage());
privateSeaLineListVo.setWantShopArea(x.getWantShopArea());
privateSeaLineListVo.setWorkflowStage(x.getWorkflowStage());
privateSeaLineListVo.setDevelopmentManagerName(finalDevManagerMap.get(x.getDevelopmentManager()));
result.add(privateSeaLineListVo);
});
List<Long> wantShopAreaList = list.stream().map(PrivateSeaLineDTO::getWantShopArea).map(Long::parseLong).distinct().collect(Collectors.toList());
Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList);
List<PrivateSeaLineListVo> result = PrivateSeaLineListVo.convertList(list, devManagerMap, wantShopAreaNameMap);
privateLineList.setList(result);
return privateLineList;
}
@@ -409,18 +384,19 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
}
@Override
public Boolean assignFollowUser(Long lineId) {
HyPartnerLineInfoDO hyPartnerLineInfoDO = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(lineId);
if (hyPartnerLineInfoDO==null){
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
public Boolean assignFollowUser(String partnerId, String wantShopArea, Integer acceptAdjustType) {
List<HyPartnerLineInfoDO> lineFollowHistoryList = hyPartnerLineInfoDAO.getLineFollowHistoryList(partnerId);
//当前加盟商线索
HyPartnerLineInfoDO HyPartnerLineInfo = hyPartnerLineInfoDAO.getByPartnerId(partnerId);
if(HyPartnerLineInfo == null){
Boolean lineStatus = getLineStatus(Long.valueOf(wantShopArea), acceptAdjustType);
return lineStatus;
}
List<HyPartnerLineInfoDO> lineFollowHistoryList = hyPartnerLineInfoDAO.getLineFollowHistoryList(hyPartnerLineInfoDO.getPartnerId());
//如果是私海线索 不需要重新分配招商经理 或者跟进次数大于1
if (hyPartnerLineInfoDO.getLineStatus()==1||CollectionUtils.isEmpty(lineFollowHistoryList)){
if (HyPartnerLineInfo.getLineStatus()==1||CollectionUtils.isEmpty(lineFollowHistoryList)){
return Boolean.FALSE;
}
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(hyPartnerLineInfoDO.getPartnerId());
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerId);
Boolean lineStatus = getLineStatus(Long.valueOf(hyPartnerUserInfoDO.getWantShopArea()), hyPartnerUserInfoDO.getAcceptAdjustType());
return lineStatus;
}
@@ -462,6 +438,51 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
return Boolean.FALSE;
}
@Resource
HyIntendDevMappingDAO hyIntendDevMappingDAO;
@Resource
HyIntendDevZoneInfoDAO hyIntendDevZoneInfoDAO;
@Override
public String getAssignFollowUser(String partnerId,String type) {
//查询意向区域
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerId);
//意向区域
String wantShopArea = hyPartnerUserInfoDO.getWantShopArea();
EnterpriseUserDO enterpriseUserDO = new EnterpriseUserDO();
// TODO: 2023/6/21 如果意向区域没有绑定战区 分配给谁
//查询意向区域绑定的组织架构
HyIntendDevelopementMappingDO hyIntendDevelopementMappingDO = hyIntendDevMappingDAO.selectByOpenAreaMappingId(Long.valueOf(wantShopArea),type);
if (hyIntendDevelopementMappingDO==null){
throw new ServiceException(ErrorCodeEnum.INTENT_AREA_NOT_BING_ZONE);
}
List<String> result = new ArrayList<>();
if (hyIntendDevelopementMappingDO!=null){
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = hyIntendDevZoneInfoDAO.selectById(Long.valueOf(hyIntendDevelopementMappingDO.getMappingId()));
if (hyIntendDevZoneInfoDO!=null && StringUtil.isNotEmpty(hyIntendDevZoneInfoDO.getAssociatedRegionId())) {
List<String> list = JSONObject.parseArray(hyIntendDevZoneInfoDO.getAssociatedRegionId(), String.class);
result.addAll(list);
}
}
String userId = "";
List<EnterpriseUserDO> userListByRegionIds = enterpriseUserDAO.getUserListByRegionIds(result);
String zoneId = hyIntendDevelopementMappingDO.getMappingId();
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = hyIntendDevZoneInfoDAO.selectById(Long.valueOf(zoneId));
if (CollectionUtils.isNotEmpty(userListByRegionIds)){
List<String> userIdList = userListByRegionIds.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList());
int i = userIdList.indexOf(hyIntendDevZoneInfoDO.getLastAllotUserId());
if (i==(userListByRegionIds.size()-1)){
i = -1;
}
userId = userIdList.get(++i);
}
return userId;
}
/**
* convertPartnerBlackListDTOToVo
* @param partnerBlackListDTO
@@ -473,8 +494,10 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
blackListVO.setPartnerId(partnerBlackListDTO.getPartnerId());
blackListVO.setPartnerUserName(partnerBlackListDTO.getPartnerUserName());
blackListVO.setPartnerUserPhone(partnerBlackListDTO.getMobile());
blackListVO.setCreateTime(partnerBlackListDTO.getCreateTime());
blackListVO.setCloseTime(partnerBlackListDTO.getCloseTime());
String createTime = DateUtil.format(partnerBlackListDTO.getCreateTime(), CoolDateUtils.DATE_FORMAT_SEC);
String closeTime = DateUtil.format(partnerBlackListDTO.getCloseTime(), CoolDateUtils.DATE_FORMAT_SEC);
blackListVO.setCreateTime(createTime);
blackListVO.setCloseTime(closeTime);
blackListVO.setJoinBlackReason(partnerBlackListDTO.getJoinBlackReason());
blackListVO.setCloseUserId(partnerBlackListDTO.getCloseUserId());
blackListVO.setCloseUserPhone(partnerBlackListDTO.getCloseUserId());

View File

@@ -365,7 +365,7 @@ public class InterviewServiceImpl implements InterviewService {
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_2.getCode()));
hyPartnerInterviewDO.setUpdateTime(new Date());
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);
//TODO 异步发送短信给加盟商
//异步发送短信给加盟商
InterviewSmsReq interviewSmsReq = new InterviewSmsReq();
interviewSmsReq.setInterviewStartTime(DateUtil.format(DateUtil.parse(interviewVO.getStartTime()), DatePattern.NORM_DATETIME_MINUTE_PATTERN));
smsService.sendSms(JSON.toJSONString(interviewSmsReq),templateCode, partnerBaseInfo.getMobile());

View File

@@ -107,9 +107,11 @@ public class PartnerUserInfoServiceImpl implements PartnerUserInfoService {
hyPartnerLineInfoDO.setPartnerId(hyPartnerUserInfoDO.getPartnerId());
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
Boolean flag = hyPartnerLineInfoService.getLineStatus(Long.valueOf(partnerUserInfoRequest.getWantShopArea()), partnerUserInfoRequest.getAcceptAdjustType());
Boolean flag = hyPartnerLineInfoService.assignFollowUser(hyPartnerLineInfoDO.getPartnerId(), partnerUserInfoRequest.getWantShopArea(), partnerUserInfoRequest.getAcceptAdjustType());
hyPartnerLineInfoDO.setLineStatus(flag ? LineStatusEnum.PRIVATE_SEAS.getCode() : LineStatusEnum.PUBLIC_SEAS.getCode());
hyPartnerLineInfoDO.setInvestmentManager("ou_7a6a19ae800afde783b0ec2dabaabf95");
if (flag){
hyPartnerLineInfoDO.setInvestmentManager("ou_7a6a19ae800afde783b0ec2dabaabf95");
}
hyPartnerLineInfoDAO.insertSelective(hyPartnerLineInfoDO);
}
// 生成意向基本信息

View File

@@ -202,7 +202,7 @@ public class ZoneServiceImpl implements ZoneService {
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
//查询已经绑定战区的 意向区域
List<ZoneCheckDTO> list = hyIntendDevMappingDAO.selectByOpenAreaMappingIdList(intentAreaSettingRequest.getOpenAreaIdList());
List<ZoneCheckDTO> list = hyIntendDevMappingDAO.selectByOpenAreaMappingIdList(intentAreaSettingRequest.getOpenAreaIdList(),intentAreaSettingRequest.getType());
List<Long> openAreaIdList = list.stream().map(ZoneCheckDTO::getOpenAreaMappingId).collect(Collectors.toList());
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList = openAreaInfoDAO.selectByIds(openAreaIdList);
Map<Long, String> areaNameMap = hyOpenAreaInfoDOList.stream().collect(Collectors.toMap(HyOpenAreaInfoDO::getId, HyOpenAreaInfoDO::getAreaName));

View File

@@ -79,7 +79,6 @@ public class TokenValidateFilter implements Filter {
LoginUserInfo currentUser = null;
boolean isInWhiteList = excludePath(uri);
String accessToken = reqs.getHeader("accessToken");
//String accessToken = "1cd17699b7dc1f64161485c2d365e0e0";
String key = "access_token:" + accessToken;
if(StringUtils.isNotBlank(accessToken)){
userStr = redisUtilPool.getString(key);

View File

@@ -57,7 +57,7 @@ public class ContentController {
@PostMapping("/detail")
@ApiOperation("动态详情")
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestParam String contentId) {
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestBody String contentId) {
return ResponseResult.success(contentService.queryContentInfo(contentId));
}

View File

@@ -273,4 +273,13 @@ public class DeskController {
return ResponseResult.success(hyPartnerBaseInfoService.addTags(addTagsRequest));
}
@GetMapping(path = "/getAssignFollowUser")
@ApiImplicitParams({
@ApiImplicitParam(name = "partnerId", value = "partnerId", required = false),
})
public ResponseResult<String> getFollowHistory(@RequestParam(value = "partnerId",required = false)String partnerId,
@RequestParam(value = "type",required = false)String type){
return ResponseResult.success(hyPartnerLineInfoService.getAssignFollowUser(partnerId,type));
}
}

View File

@@ -25,6 +25,7 @@ import com.cool.store.response.ResponseResult;
import com.cool.store.service.AliyunService;
import com.cool.store.service.EnterpriseSyncService;
import com.cool.store.service.EnterpriseUserService;
import com.cool.store.service.GaoDeService;
import com.cool.store.vo.cuser.IdentityCardInfoVO;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -47,6 +48,8 @@ public class TestController {
@Resource
private EnterpriseUserService enterpriseUserService;
@Resource
GaoDeService gaoDeService;
@Resource
private ISVHttpRequest isvHttpRequest;
@Resource
private HyOpenAreaInfoMapper hyOpenAreaInfoMapper;
@@ -239,4 +242,8 @@ public class TestController {
return ResponseResult.success(enterpriseUserService.getDevelopmentByZoneId(zoneId));
}
@GetMapping("getGaoDePicture")
public ResponseResult getDevelopmentByZoneId(){
return ResponseResult.success(gaoDeService.getGaoDePicture(""));
}
}

View File

@@ -35,7 +35,7 @@ public class ContentController {
@PostMapping("/detail")
@ApiOperation("动态详情")
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestParam String contentId) {
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestBody String contentId) {
return ResponseResult.success(contentService.queryContentInfo(contentId));
}

View File

@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
@Api(tags = "加盟商资格面试")
@RestController
@RequestMapping("/interview")
@CrossOrigin
public class InterviewController {
@Autowired
@@ -29,7 +30,7 @@ public class InterviewController {
@PostMapping("/queryByPartnerId")
@ApiOperation("根据用户id查询面试信息")
public ResponseResult<PartnerInterviewInfoVO> queryByPartnerId(@RequestParam String partnerId) {
public ResponseResult<PartnerInterviewInfoVO> queryByPartnerId(@RequestBody String partnerId) {
return ResponseResult.success(interviewService.queryByPartnerId(partnerId));
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.controller;
import com.cool.store.constants.RedisConstant;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.IDCardSideEnum;
import com.cool.store.enums.WorkflowStatusEnum;
@@ -70,10 +71,10 @@ public class PartnerController {
@ApiImplicitParams({
@ApiImplicitParam(name = "idCard", value = "身份证号码", required = false),
})
public ResponseResult<Boolean> getLineByIdCard(@RequestParam(value = "idCard",required = false)String idCard){
public ResponseResult<Boolean> getByIdCard(@RequestParam(value = "idCard",required = false)String idCard){
Long lineId = hyPartnerBaseInfoService.getLineIdByIdCard(idCard);
return ResponseResult.success(lineId != null && lineId > 0L);
HyPartnerBaseInfoDO baseInfoDO = hyPartnerBaseInfoService.getByIdCard(idCard);
return ResponseResult.success(baseInfoDO != null && baseInfoDO.getPartnerLineId() > 0L);
}
@@ -136,7 +137,7 @@ public class PartnerController {
@PostMapping(path = "/delCoolDownFirstLoginFlag")
@ApiOperation("删除冷静期是否首次登录缓存")
public ResponseResult<Boolean> delCoolDownFirstLoginFlag(@RequestParam(value = "lineId",required = true)String lineId){
public ResponseResult<Boolean> delCoolDownFirstLoginFlag(@RequestParam(value = "lineId",required = true)Long lineId){
String coolingPeriodFirstLoginCacheKey = MessageFormat.format(RedisConstant.COOLINGPERIOD_FIRSTLOGIN_KEY, lineId);
redisUtilPool.delKey(coolingPeriodFirstLoginCacheKey);
return ResponseResult.success(true);