意向书信息维护
This commit is contained in:
@@ -55,6 +55,8 @@ public enum ErrorCodeEnum {
|
||||
WORK_FLOW_STAGE_PASS_ERROR(500002, "通过错误,非对应阶段!", null),
|
||||
PARTNER_USER_NOT_EXIST(500003, "加盟商用户信息不存在!", null),
|
||||
ZONE_NOT_EXIST(500004, "战区不存在!", null),
|
||||
PARTNER_BASEINFO_NOT_EXIST(500005, "基本信息不存在!", null),
|
||||
INTENT_INFO_NOT_EXIST(500006, "意向信息不存在!", null),
|
||||
|
||||
INTERVIEW_ENTER_FAIL(1021101, "进入面试间失败", null),
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.HyPartnerBaseInfoDO;
|
||||
import com.cool.store.mapper.HyPartnerBaseInfoMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -38,4 +38,11 @@ public class HyPartnerBaseInfoDAO {
|
||||
return hyPartnerBaseInfoMapper.updateByPartnerId(userName,mobile,partnerId);
|
||||
}
|
||||
|
||||
public HyPartnerBaseInfoDO getByPartnerIdAndLineId(String partnerId, Long partnerLineId){
|
||||
if (StringUtils.isEmpty(partnerId) || partnerLineId == null){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerBaseInfoMapper.getByPartnerIdAndLineId(partnerId, partnerLineId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.HyPartnerClerkDO;
|
||||
import com.cool.store.mapper.HyPartnerClerkMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -31,4 +34,25 @@ public class HyPartnerClerkDAO {
|
||||
return hyPartnerClerkMapper.getHyPartnerClerkList(lineId);
|
||||
}
|
||||
|
||||
public int batchInsert(List<HyPartnerClerkDO> hyPartnerClerkDOList){
|
||||
if (CollectionUtils.isEmpty(hyPartnerClerkDOList)){
|
||||
return -1;
|
||||
}
|
||||
return hyPartnerClerkMapper.batchInsert(hyPartnerClerkDOList);
|
||||
}
|
||||
|
||||
public void deleteByPartnerIdAndLineId(String partnerId, Long partnerLineId){
|
||||
if (StringUtils.isEmpty(partnerId) || Objects.isNull(partnerLineId)){
|
||||
return;
|
||||
}
|
||||
hyPartnerClerkMapper.deleteByPartnerIdAndLineId(partnerId, partnerLineId);
|
||||
}
|
||||
|
||||
public List<HyPartnerClerkDO> listByPartnerIdAndLineId(String partnerId, Long partnerLineId){
|
||||
if (StringUtils.isEmpty(partnerId) || Objects.isNull(partnerLineId)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return hyPartnerClerkMapper.listByPartnerIdAndLineId(partnerId, partnerLineId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,13 +4,11 @@ import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.entity.HyPartnerIntentInfoDO;
|
||||
import com.cool.store.mapper.HyPartnerIntentInfoMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -55,5 +53,12 @@ public class HyPartnerIntentInfoDAO {
|
||||
return hyPartnerIntentInfoMapper.selectByLineId(lineId);
|
||||
}
|
||||
|
||||
public HyPartnerIntentInfoDO getByPartnerIdAndLineId(String partnerId, Long partnerLineId){
|
||||
if (StringUtils.isEmpty(partnerId) || Objects.isNull(partnerLineId)){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerIntentInfoMapper.getByPartnerIdAndLineId(partnerId, partnerLineId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerBlackListDTO;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
|
||||
import com.cool.store.dto.partner.StageCountDTO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
@@ -10,7 +9,6 @@ import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -125,7 +123,12 @@ public class HyPartnerLineInfoDAO {
|
||||
return hyPartnerLineInfoMapper.joinAndRemoveBlack(lineId,status,joinReason,removeReason);
|
||||
}
|
||||
|
||||
|
||||
public HyPartnerLineInfoDO getByPartnerId(String partnerId){
|
||||
if (StringUtils.isEmpty(partnerId)){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.getByPartnerId(partnerId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -68,5 +68,12 @@ public class HyPartnerUserInfoDAO {
|
||||
return hyPartnerUserInfoMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
public int updateJoinKnowById(Integer isWritePartnerKnow, Long id){
|
||||
if (id == null || isWritePartnerKnow == null){
|
||||
return 0;
|
||||
}
|
||||
return hyPartnerUserInfoMapper.updateJoinKnowById(isWritePartnerKnow, id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -33,4 +33,7 @@ public interface HyPartnerBaseInfoMapper {
|
||||
int updateByPartnerId(@Param("userName") String userName,
|
||||
@Param("mobile") String mobile,
|
||||
@Param("partnerId") String partnerId);
|
||||
|
||||
HyPartnerBaseInfoDO getByPartnerIdAndLineId(@Param("partnerId") String partnerId, @Param("partnerLineId") Long partnerLineId);
|
||||
|
||||
}
|
||||
@@ -27,4 +27,17 @@ public interface HyPartnerClerkMapper {
|
||||
|
||||
List<HyPartnerClerkDO> getHyPartnerClerkList(@Param("lineId") Long lineId);
|
||||
|
||||
|
||||
int batchInsert(@Param("recordList") List<HyPartnerClerkDO> recordList);
|
||||
|
||||
void deleteByPartnerIdAndLineId(@Param("partnerId") String partnerId, @Param("partnerLineId") Long partnerLineId);
|
||||
|
||||
/**
|
||||
* 查询店员信息
|
||||
* @return
|
||||
*/
|
||||
List<HyPartnerClerkDO> listByPartnerIdAndLineId(@Param("partnerId") String partnerId,
|
||||
@Param("partnerLineId") Long partnerLineId);
|
||||
|
||||
|
||||
}
|
||||
@@ -47,4 +47,6 @@ public interface HyPartnerIntentInfoMapper {
|
||||
* @return
|
||||
*/
|
||||
HyPartnerIntentInfoDO selectByLineId(@Param("lineId") Long lineId);
|
||||
|
||||
HyPartnerIntentInfoDO getByPartnerIdAndLineId(@Param("partnerId") String partnerId, @Param("partnerLineId") Long partnerLineId);
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerBlackListDTO;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
|
||||
import com.cool.store.dto.partner.StageCountDTO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -132,4 +130,7 @@ public interface HyPartnerLineInfoMapper {
|
||||
@Param("joinReason") String joinReason,
|
||||
@Param("removeReason") String removeReason);
|
||||
|
||||
HyPartnerLineInfoDO getByPartnerId(@Param("partnerId") String partnerId);
|
||||
|
||||
|
||||
}
|
||||
@@ -40,4 +40,7 @@ public interface HyPartnerUserInfoMapper {
|
||||
* @return
|
||||
*/
|
||||
List<HyPartnerUserInfoDO> selectByPartnerIds(@Param("partnerIdList") List<String> partnerIdList);
|
||||
|
||||
int updateJoinKnowById(@Param("isWritePartnerKnow")Integer isWritePartnerKnow, @Param("id")Long id);
|
||||
|
||||
}
|
||||
@@ -216,4 +216,12 @@
|
||||
where partner_id = #{partnerId}
|
||||
</set>
|
||||
</update>
|
||||
|
||||
<select id="getByPartnerIdAndLineId" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_base_info
|
||||
where partner_id = #{partnerId} and partner_line_id = #{partnerLineId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -108,4 +108,37 @@
|
||||
from hy_partner_clerk
|
||||
where partner_line_id = #{lineId}
|
||||
</select>
|
||||
|
||||
<insert id="batchInsert">
|
||||
insert into
|
||||
hy_partner_clerk
|
||||
(
|
||||
partner_line_id,
|
||||
partner_id,
|
||||
username,
|
||||
relationship,
|
||||
age,
|
||||
choose_reason
|
||||
)
|
||||
values
|
||||
<foreach collection="recordList" item="record" separator=",">
|
||||
(#{record.partnerLineId},
|
||||
#{record.partnerId},
|
||||
#{record.username},
|
||||
#{record.relationship},
|
||||
#{record.age},
|
||||
#{record.chooseReason})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByPartnerIdAndLineId">
|
||||
delete from hy_partner_clerk where partner_id = #{partnerId} and partner_line_id = #{partnerLineId}
|
||||
</delete>
|
||||
|
||||
<select id="listByPartnerIdAndLineId" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List"></include> from
|
||||
hy_partner_clerk
|
||||
where partner_id = #{partnerId} and partner_line_id = #{partnerLineId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -288,4 +288,11 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getByPartnerIdAndLineId" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_intent_info
|
||||
where partner_id = #{partnerId} and partner_line_id = #{partnerLineId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -384,4 +384,11 @@
|
||||
where id = #{lineId}
|
||||
</update>
|
||||
|
||||
<select id="getByPartnerId" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_line_info
|
||||
where partner_id = #{partnerId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -147,4 +147,11 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<update id="updateJoinKnowById">
|
||||
update hy_partner_user_info
|
||||
set `is_write_partner_know`=#{isWritePartnerKnow,jdbcType=INTEGER}
|
||||
where id=#{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -18,6 +18,12 @@ public class PartnerIntentInfoRequest {
|
||||
@ApiModelProperty("")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("线索表ID")
|
||||
private Long partnerLineId;
|
||||
|
||||
@ApiModelProperty("加盟商C端用户表ID partnerId ")
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("常驻区域")
|
||||
private String liveArea;
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.AddTagsRequest;
|
||||
import com.cool.store.request.PartnerBaseInfoRequest;
|
||||
import com.cool.store.vo.PartnerBaseInfoVO;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -16,4 +18,8 @@ public interface HyPartnerBaseInfoService {
|
||||
* @return
|
||||
*/
|
||||
Boolean addTags(AddTagsRequest addTagsRequest);
|
||||
|
||||
Boolean submitPartnerBaseInfo(PartnerBaseInfoRequest request);
|
||||
|
||||
PartnerBaseInfoVO queryPartnerBaseInfo(String partnerId, Long lineId);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.PartnerClerkInfoRequest;
|
||||
import com.cool.store.vo.PartnerClerkVO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -19,6 +20,10 @@ public interface HyPartnerClerkService {
|
||||
*/
|
||||
List<PartnerClerkVO> getPartnerClerkList(Long lineId);
|
||||
|
||||
Boolean submitPartnerClerkInfo(PartnerClerkInfoRequest request);
|
||||
|
||||
List<PartnerClerkVO> queryPartnerClerkInfo(String partnerId, Long lineId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.BaseUserInfoRequest;
|
||||
import com.cool.store.request.PartnerIntentInfoRequest;
|
||||
import com.cool.store.vo.PartnerIntentApplyInfoVO;
|
||||
import com.cool.store.vo.PartnerIntentInfoVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
@@ -37,4 +38,8 @@ public interface HyPartnerIntentInfoService {
|
||||
*/
|
||||
Boolean updatePartnerIntentInfo(BaseUserInfoRequest baseUserInfoRequest);
|
||||
|
||||
Boolean submitPartnerIntentInfo(PartnerIntentInfoRequest partnerIntentInfoRequest);
|
||||
|
||||
PartnerIntentInfoVO queryPartnerIntentInfo(String partnerId, Long lineId);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
|
||||
public interface PartnerUserInfoService {
|
||||
|
||||
HyPartnerUserInfoDO selectByPartnerId(String partnerId);
|
||||
|
||||
Boolean queryJoinNotice(String partnerId);
|
||||
|
||||
Boolean completeJoinNotice(String partnerId);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dao.HyPartnerBaseInfoDAO;
|
||||
import com.cool.store.dao.HyPartnerLineInfoDAO;
|
||||
import com.cool.store.entity.HyPartnerBaseInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.AddTagsRequest;
|
||||
import com.cool.store.request.PartnerBaseInfoRequest;
|
||||
import com.cool.store.service.HyPartnerBaseInfoService;
|
||||
import com.cool.store.vo.PartnerBaseInfoVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -29,4 +35,49 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(hyPartnerBaseInfoDO);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* //前提 未提交加盟申请
|
||||
* //成功 意向区域变更成功 失败 您已进入意向申请流程,当前不可变更意向区域
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean submitPartnerBaseInfo(PartnerBaseInfoRequest request) {
|
||||
HyPartnerBaseInfoDO baseInfoDO = hyPartnerBaseInfoDAO.getByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
|
||||
if(baseInfoDO == null){
|
||||
baseInfoDO = new HyPartnerBaseInfoDO();
|
||||
fillBaseInfo(baseInfoDO, request);
|
||||
hyPartnerBaseInfoDAO.insertSelective(baseInfoDO);
|
||||
}else {
|
||||
fillBaseInfo(baseInfoDO, request);
|
||||
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(baseInfoDO);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartnerBaseInfoVO queryPartnerBaseInfo(String partnerId, Long lineId) {
|
||||
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerIdAndLineId(partnerId, lineId);
|
||||
if (hyPartnerBaseInfoDO == null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARTNER_BASEINFO_NOT_EXIST);
|
||||
}
|
||||
PartnerBaseInfoVO baseInfoVO = new PartnerBaseInfoVO();
|
||||
BeanUtil.copyProperties(hyPartnerBaseInfoDO, baseInfoVO);
|
||||
return baseInfoVO;
|
||||
}
|
||||
|
||||
private void fillBaseInfo(HyPartnerBaseInfoDO baseInfoDO, PartnerBaseInfoRequest request) {
|
||||
baseInfoDO.setPartnerId(request.getPartnerId());
|
||||
baseInfoDO.setPartnerLineId(request.getPartnerLineId());
|
||||
baseInfoDO.setMobile(request.getMobile());
|
||||
baseInfoDO.setUsername(request.getUsername());
|
||||
baseInfoDO.setSex(request.getSex());
|
||||
baseInfoDO.setNation(request.getNation());
|
||||
baseInfoDO.setBirthdate(request.getBirthdate());
|
||||
baseInfoDO.setIdCard(request.getIdCard());
|
||||
baseInfoDO.setIdCardPhotoFront(request.getIdCardPhotoFront());
|
||||
baseInfoDO.setIdCardPhotoBlack(request.getIdCardPhotoBlack());
|
||||
baseInfoDO.setLiveAddress(request.getLiveAddress());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.HyPartnerClerkDAO;
|
||||
import com.cool.store.entity.HyPartnerClerkDO;
|
||||
import com.cool.store.service.HyPartnerClerkService;
|
||||
import com.cool.store.vo.PartnerClerkVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/15 11:05
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class HyPartnerClerkImpl implements HyPartnerClerkService {
|
||||
|
||||
@Resource
|
||||
HyPartnerClerkDAO hyPartnerClerkDAO;
|
||||
|
||||
|
||||
@Override
|
||||
public List<PartnerClerkVO> getPartnerClerkList(Long lineId) {
|
||||
List<HyPartnerClerkDO> hyPartnerClerkList = hyPartnerClerkDAO.getHyPartnerClerkList(lineId);
|
||||
List<PartnerClerkVO> result= new ArrayList<>();
|
||||
hyPartnerClerkList.forEach(x->{
|
||||
PartnerClerkVO partnerClerkVO = new PartnerClerkVO();
|
||||
partnerClerkVO.setPartnerId(x.getPartnerId());
|
||||
partnerClerkVO.setPartnerLineId(x.getPartnerLineId());
|
||||
partnerClerkVO.setAge(x.getAge());
|
||||
partnerClerkVO.setChooseReason(x.getChooseReason());
|
||||
partnerClerkVO.setUsername(x.getUsername());
|
||||
partnerClerkVO.setRelationship(x.getRelationship());
|
||||
result.add(partnerClerkVO);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.cool.store.dao.HyPartnerClerkDAO;
|
||||
import com.cool.store.entity.HyPartnerClerkDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.PartnerClerkInfoRequest;
|
||||
import com.cool.store.service.HyPartnerClerkService;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.vo.PartnerClerkVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author wxp
|
||||
* @Date 2023/6/14 21:37
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class HyPartnerClerkServiceImpl implements HyPartnerClerkService {
|
||||
|
||||
@Resource
|
||||
HyPartnerClerkDAO hyPartnerClerkDAO;
|
||||
|
||||
@Override
|
||||
public List<PartnerClerkVO> getPartnerClerkList(Long lineId) {
|
||||
List<HyPartnerClerkDO> hyPartnerClerkList = hyPartnerClerkDAO.getHyPartnerClerkList(lineId);
|
||||
List<PartnerClerkVO> result= new ArrayList<>();
|
||||
hyPartnerClerkList.forEach(x->{
|
||||
PartnerClerkVO partnerClerkVO = new PartnerClerkVO();
|
||||
partnerClerkVO.setPartnerId(x.getPartnerId());
|
||||
partnerClerkVO.setPartnerLineId(x.getPartnerLineId());
|
||||
partnerClerkVO.setAge(x.getAge());
|
||||
partnerClerkVO.setChooseReason(x.getChooseReason());
|
||||
partnerClerkVO.setUsername(x.getUsername());
|
||||
partnerClerkVO.setRelationship(x.getRelationship());
|
||||
result.add(partnerClerkVO);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean submitPartnerClerkInfo(PartnerClerkInfoRequest request) {
|
||||
if (StringUtil.isBlank(request.getPartnerId()) || Objects.isNull(request.getPartnerLineId()) || CollectionUtils.isEmpty(request.getPartnerClerkRequestList())){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
hyPartnerClerkDAO.deleteByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
|
||||
List<HyPartnerClerkDO> clerkDOList = new ArrayList<>();
|
||||
request.getPartnerClerkRequestList().stream().forEach(x->{
|
||||
HyPartnerClerkDO clerkDO = new HyPartnerClerkDO();
|
||||
clerkDO.setPartnerLineId(request.getPartnerLineId());
|
||||
clerkDO.setPartnerId(request.getPartnerId());
|
||||
clerkDO.setUsername(x.getUsername());
|
||||
clerkDO.setRelationship(x.getRelationship());
|
||||
clerkDO.setAge(x.getAge());
|
||||
clerkDO.setChooseReason(x.getChooseReason());
|
||||
clerkDOList.add(clerkDO);
|
||||
});
|
||||
hyPartnerClerkDAO.batchInsert(clerkDOList);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PartnerClerkVO> queryPartnerClerkInfo(String partnerId, Long lineId) {
|
||||
List<HyPartnerClerkDO> clerkDOList = hyPartnerClerkDAO.listByPartnerIdAndLineId(partnerId, lineId);
|
||||
List<PartnerClerkVO> clerkVOList = ListUtils.emptyIfNull(clerkDOList).stream().map(clerkDO -> {
|
||||
PartnerClerkVO clerkVO = new PartnerClerkVO();
|
||||
BeanUtil.copyProperties(clerkDO, clerkVO);
|
||||
return clerkVO;
|
||||
}).collect(Collectors.toList());
|
||||
return clerkVOList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.HyPartnerBaseInfoDAO;
|
||||
import com.cool.store.dao.HyPartnerIntentInfoDAO;
|
||||
@@ -14,6 +15,7 @@ import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.enums.WorkflowStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.BaseUserInfoRequest;
|
||||
import com.cool.store.request.PartnerIntentInfoRequest;
|
||||
import com.cool.store.service.HyPartnerIntentInfoService;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.vo.PartnerIntentApplyInfoVO;
|
||||
@@ -27,6 +29,7 @@ import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -107,6 +110,57 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
return partnerIntentInfoVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean submitPartnerIntentInfo(PartnerIntentInfoRequest request) {
|
||||
if (StringUtil.isBlank(request.getPartnerId()) || Objects.isNull(request.getPartnerLineId())){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
HyPartnerIntentInfoDO intentInfoDO = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
|
||||
if(intentInfoDO == null){
|
||||
intentInfoDO = new HyPartnerIntentInfoDO();
|
||||
fillIntentInfo(intentInfoDO, request);
|
||||
hyPartnerIntentInfoDAO.insertSelective(intentInfoDO);
|
||||
}else {
|
||||
fillIntentInfo(intentInfoDO, request);
|
||||
hyPartnerIntentInfoDAO.updateByPrimaryKeySelective(intentInfoDO);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartnerIntentInfoVO queryPartnerIntentInfo(String partnerId, Long lineId) {
|
||||
HyPartnerIntentInfoDO intentInfoDO = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(partnerId, lineId);
|
||||
if (intentInfoDO == null){
|
||||
throw new ServiceException(ErrorCodeEnum.INTENT_INFO_NOT_EXIST);
|
||||
}
|
||||
PartnerIntentInfoVO intentInfoVO = new PartnerIntentInfoVO();
|
||||
BeanUtil.copyProperties(intentInfoDO, intentInfoVO);
|
||||
return intentInfoVO;
|
||||
}
|
||||
|
||||
private void fillIntentInfo(HyPartnerIntentInfoDO intentInfoDO, PartnerIntentInfoRequest request) {
|
||||
intentInfoDO.setPartnerId(request.getPartnerId());
|
||||
intentInfoDO.setPartnerLineId(request.getPartnerLineId());
|
||||
intentInfoDO.setLiveArea(request.getLiveArea());
|
||||
intentInfoDO.setWantShopArea(request.getWantShopArea());
|
||||
intentInfoDO.setAcceptAdjustType(request.getAcceptAdjustType());
|
||||
intentInfoDO.setIsHaveWantShop(request.getIsHaveWantShop());
|
||||
intentInfoDO.setWantShopInfo(request.getWantShopInfo());
|
||||
intentInfoDO.setMaxBudget(request.getMaxBudget());
|
||||
intentInfoDO.setMoneySource(request.getMoneySource());
|
||||
intentInfoDO.setMoneyProve(String.join(",", request.getMoneyProve()));
|
||||
intentInfoDO.setEducation(request.getEducation());
|
||||
intentInfoDO.setWorkYear(request.getWorkYear());
|
||||
intentInfoDO.setIsHaveWorkExp(request.getIsHaveWorkExp());
|
||||
intentInfoDO.setWorkExp(request.getWorkExp());
|
||||
intentInfoDO.setIsConsumer(request.getIsConsumer());
|
||||
intentInfoDO.setOtherBand(request.getOtherBand());
|
||||
intentInfoDO.setBrandStrength(request.getBrandStrength());
|
||||
intentInfoDO.setNeedImprove(request.getNeedImprove());
|
||||
intentInfoDO.setStrength(request.getStrength());
|
||||
intentInfoDO.setWeakness(request.getWeakness());
|
||||
}
|
||||
|
||||
/**
|
||||
* partnerIntentApplyInfoDTOToVo
|
||||
* @param partnerIntentApplyInfoDTO
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.HyPartnerUserInfoDAO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.service.PartnerUserInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -11,4 +15,27 @@ public class PartnerUserInfoServiceImpl implements PartnerUserInfoService {
|
||||
@Autowired
|
||||
private HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||
|
||||
@Override
|
||||
public HyPartnerUserInfoDO selectByPartnerId(String partnerId) {
|
||||
return hyPartnerUserInfoDAO.selectByPartnerId(partnerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean queryJoinNotice(String partnerId) {
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerId);
|
||||
if (hyPartnerUserInfoDO==null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARTNER_USER_NOT_EXIST);
|
||||
}
|
||||
return hyPartnerUserInfoDO.getIsWritePartnerKnow() == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean completeJoinNotice(String partnerId) {
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerId);
|
||||
if (hyPartnerUserInfoDO == null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARTNER_USER_NOT_EXIST);
|
||||
}
|
||||
hyPartnerUserInfoDAO.updateJoinKnowById(CommonConstants.ONE, hyPartnerUserInfoDO.getId());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.request.BaseUserInfoRequest;
|
||||
import com.cool.store.request.PartnerBaseInfoRequest;
|
||||
import com.cool.store.request.PartnerClerkInfoRequest;
|
||||
import com.cool.store.request.PartnerIntentInfoRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.HyPartnerBaseInfoService;
|
||||
import com.cool.store.service.HyPartnerClerkService;
|
||||
import com.cool.store.service.HyPartnerIntentInfoService;
|
||||
import com.cool.store.service.PartnerUserInfoService;
|
||||
import com.cool.store.vo.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
@@ -36,6 +38,14 @@ public class PartnerController {
|
||||
@Resource
|
||||
HyPartnerIntentInfoService hyPartnerIntentInfoService;
|
||||
|
||||
@Resource
|
||||
HyPartnerBaseInfoService hyPartnerBaseInfoService;
|
||||
@Resource
|
||||
HyPartnerClerkService hyPartnerClerkService;
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping(path = "/applyBaseInfo")
|
||||
@ApiOperation("提交基本信息")
|
||||
public ResponseResult<Boolean> applyBaseInfo(@RequestBody BaseUserInfoRequest baseUserInfoRequest){
|
||||
@@ -79,26 +89,24 @@ public class PartnerController {
|
||||
|
||||
@PostMapping(path = "/submitPartnerBaseInfo")
|
||||
@ApiOperation("提交加盟商基本信息")
|
||||
public ResponseResult<Boolean> submitPartnerBaseInfo(@RequestBody PartnerBaseInfoRequest PartnerBaseInfoRequest){
|
||||
|
||||
public ResponseResult<Boolean> submitPartnerBaseInfo(@RequestBody PartnerBaseInfoRequest baseInfoRequest){
|
||||
//前提 未提交加盟申请
|
||||
//成功 意向区域变更成功 失败 您已进入意向申请流程,当前不可变更意向区域
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(hyPartnerBaseInfoService.submitPartnerBaseInfo(baseInfoRequest));
|
||||
}
|
||||
|
||||
@PostMapping(path = "/submitPartnerClerkInfo")
|
||||
@ApiOperation("提交加盟商店员信息")
|
||||
public ResponseResult<Boolean> submitPartnerClerkInfo(@RequestBody PartnerClerkInfoRequest partnerClerkInfoRequest){
|
||||
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(hyPartnerClerkService.submitPartnerClerkInfo(partnerClerkInfoRequest));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path = "/submitPartnerIntentInfo")
|
||||
@ApiOperation("提交加盟商意向信息/行业认知")
|
||||
public ResponseResult<Boolean> submitPartnerIntentInfo(@RequestBody PartnerIntentInfoRequest partnerIntentInfoRequest){
|
||||
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest));
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +115,7 @@ public class PartnerController {
|
||||
@ApiOperation("修改加盟商店员信息")
|
||||
public ResponseResult<Boolean> changePartnerClerkInfo(@RequestBody PartnerClerkInfoRequest partnerClerkInfoRequest){
|
||||
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(hyPartnerClerkService.submitPartnerClerkInfo(partnerClerkInfoRequest));
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +123,7 @@ public class PartnerController {
|
||||
@ApiOperation("修改加盟商意向信息/行业认知")
|
||||
public ResponseResult<Boolean> changePartnerIntentInfo(@RequestBody PartnerIntentInfoRequest partnerIntentInfoRequest){
|
||||
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest));
|
||||
}
|
||||
|
||||
|
||||
@@ -140,9 +148,8 @@ public class PartnerController {
|
||||
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
|
||||
})
|
||||
public ResponseResult<PartnerBaseInfoVO> queryPartnerBaseInfo(@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
|
||||
|
||||
return ResponseResult.success();
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(hyPartnerBaseInfoService.queryPartnerBaseInfo(userInfoVO.getPartnerId(), lineId));
|
||||
}
|
||||
|
||||
|
||||
@@ -153,8 +160,8 @@ public class PartnerController {
|
||||
})
|
||||
public ResponseResult<List<PartnerClerkVO>> queryPartnerClerkInfo(@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
|
||||
|
||||
return ResponseResult.success();
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(hyPartnerClerkService.queryPartnerClerkInfo(userInfoVO.getPartnerId(), lineId));
|
||||
}
|
||||
|
||||
|
||||
@@ -165,8 +172,8 @@ public class PartnerController {
|
||||
})
|
||||
public ResponseResult<PartnerIntentInfoVO> queryPartnerIntentInfo(@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
|
||||
|
||||
return ResponseResult.success();
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(hyPartnerIntentInfoService.queryPartnerIntentInfo(userInfoVO.getPartnerId(), lineId));
|
||||
}
|
||||
|
||||
|
||||
@@ -177,10 +184,8 @@ public class PartnerController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "partnerId", value = "加盟商ID", required = false),
|
||||
})
|
||||
public ResponseResult<Boolean> completeJoinNotice(@RequestParam(value = "partnerId",required = false)Long partnerId){
|
||||
|
||||
|
||||
return ResponseResult.success();
|
||||
public ResponseResult<Boolean> completeJoinNotice(@RequestParam(value = "partnerId",required = false)String partnerId){
|
||||
return ResponseResult.success(partnerUserInfoService.completeJoinNotice(partnerId));
|
||||
}
|
||||
|
||||
|
||||
@@ -189,10 +194,8 @@ public class PartnerController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "partnerId", value = "加盟商ID", required = false),
|
||||
})
|
||||
public ResponseResult<Boolean> queryJoinNotice(@RequestParam(value = "partnerId",required = false)Long partnerId){
|
||||
|
||||
|
||||
return ResponseResult.success();
|
||||
public ResponseResult<Boolean> queryJoinNotice(@RequestParam(value = "partnerId",required = false)String partnerId){
|
||||
return ResponseResult.success(partnerUserInfoService.queryJoinNotice(partnerId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user