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

This commit is contained in:
zhangchenbiao
2023-06-13 18:52:48 +08:00
14 changed files with 322 additions and 37 deletions

View File

@@ -0,0 +1,33 @@
package com.cool.store.enums;
/**
* @Author suzhuhong
* @Date 2023/6/13 11:45
* @Version 1.0
*/
public enum LineStatusEnum {
PUBLIC_SEAS(0,"公海线索"),
PRIVATE_SEAS(1,"私海线索"),
COOPERATION(2,"合作"),
BLACKLIST(3,"黑名单"),
;
private Integer code;
private String message;
LineStatusEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
}

View File

@@ -1,5 +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;
@@ -54,6 +55,10 @@ public class HyPartnerLineInfoDAO {
return hyPartnerLineInfoMapper.selectByPrimaryKeySelective(id);
}
public int updateByPrimaryKeySelective(HyPartnerLineInfoDO hyPartnerLineInfoDO){
return hyPartnerLineInfoMapper.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
}
public Integer getAdventLineCount( String userId, String currentDate){
if (StringUtils.isEmpty(userId)){
@@ -108,4 +113,16 @@ public class HyPartnerLineInfoDAO {
}
public PageInfo<PartnerBlackListDTO> getBlackList( String keyWord, String intentArea , Integer acceptAdjustType){
return hyPartnerLineInfoMapper.getBlackList(keyWord,intentArea,acceptAdjustType);
}
public Boolean joinAndRemoveBlack( Long lineId, Integer status, String joinReason, String removeReason){
if (lineId==null){
return Boolean.FALSE;
}
return hyPartnerLineInfoMapper.joinAndRemoveBlack(lineId,status,joinReason,removeReason);
}
}

View File

@@ -1,5 +1,6 @@
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;
@@ -105,4 +106,30 @@ public interface HyPartnerLineInfoMapper {
* @return
*/
List<HyPartnerLineInfoDO> getLineListByLineIds(List<Long> lineIdList);
/**
* 查询黑名单列表
* @param keyWord
* @param intentArea
* @param acceptAdjustType
* @return
*/
PageInfo<PartnerBlackListDTO> getBlackList(@Param("keyWord") String keyWord,
@Param("intentArea") String intentArea ,
@Param("acceptAdjustType") Integer acceptAdjustType);
/**
* 加入/移除 黑名单
* @param lineId
* @param status
* @param joinReason
* @param removeReason
* @return
*/
Boolean joinAndRemoveBlack(@Param("lineId") Long lineId,
@Param("status") Integer status,
@Param("joinReason") String joinReason,
@Param("removeReason") String removeReason);
}

View File

@@ -233,6 +233,12 @@
<if test="record.closeUserId != null">
close_user_id = #{record.closeUserId},
</if>
<if test="record.joinBlackReason != null">
join_black_reason = #{record.joinBlackReason},
</if>
<if test="record.removeBlackReason != null">
remove_black_reason = #{record.removeBlackReason},
</if>
</set>
where id = #{record.id}
</update>
@@ -336,4 +342,45 @@
</if>
</select>
<select id="getBlackList" resultType="com.cool.store.dto.partner.PartnerBlackListDTO" >
select
b.partner_id as partnerId,
b.mobile as mobile,
b.username as partnerUserName,
a.id as lineId,
a.create_time as createTime,
a.close_user_id as closeUserId,
a.close_time as closeTime,
a.join_black_reason as joinBlackReason
from hy_partner_line_info a inner join hy_partner_user_info b where a.partner_id = b.partner_id
where deleted = 0
and line_status = 3
<if test="keyWord!=null and keyWord !=''">
and (b.username like concat('%', #{keyWord}, '%') or b.mobile like concat('%', #{keyWord}, '%'))
</if>
<if test="intentArea!=null and intentArea!=''">
and b.want_shop_area = #{intentArea}
</if>
<if test="acceptAdjustType!=null">
and b.accept_adjust_type =#{acceptAdjustType}
</if>
</select>
<update id="joinAndRemoveBlack">
update hy_partner_line_info
<set>
<if test="line_status != null">
line_status = #{status},
</if>
<if test="joinCause != null and joinCause!=''">
join_black_reason = #{joinCause},
</if>
<if test="removeReason != null and removeReason!=''">
remove_black_reason = #{removeReason},
</if>
</set>
where id = #{lineId}
</update>
</mapper>

View File

@@ -0,0 +1,31 @@
package com.cool.store.dto.partner;
import lombok.Data;
import java.util.Date;
/**
* @Author suzhuhong
* @Date 2023/6/13 10:26
* @Version 1.0
*/
@Data
public class PartnerBlackListDTO {
private Long lineId;
private String partnerId;
private String mobile;
private String partnerUserName;
private Date createTime;
private String closeUserId;
private Date closeTime;
private String joinBlackReason;
}

View File

@@ -71,4 +71,10 @@ public class HyPartnerLineInfoDO implements Serializable {
@ApiModelProperty("结束跟进人员ID")
private String closeUserId;
@ApiModelProperty("加入黑名单原因")
private String joinBlackReason;
@ApiModelProperty("移除黑名单原因")
private String removeBlackReason;
}

View File

@@ -14,7 +14,7 @@ import java.util.Date;
*/
@Data
@ApiModel
public class LineRequest {
public class LineRequest extends PageInfoRequest{
@ApiModelProperty("关键字")

View File

@@ -18,15 +18,6 @@ public class BlackListVO {
@ApiModelProperty("线索ID")
private Long id;
@ApiModelProperty("hy_partner_user_info.partner_id")
private String partnerId;
@ApiModelProperty("流程阶段:1意向申请审核;2预约面试时间;3加盟资格面试;4分配选址开发经理;5商圈点位评估;6上传店铺租赁信息;7完善加盟签约信息;8支付加盟费用;9签订加盟合同")
private String workflowStage;
@ApiModelProperty("流程子状态")
private String workflowStatus;
@ApiModelProperty("加盟商用户ID")
private String partnerUserId;
@@ -54,14 +45,8 @@ public class BlackListVO {
@ApiModelProperty("结束人员手机号")
private String closeUserPhone;
@ApiModelProperty("结束人员手机号归属地")
private String closeUserPhoneAddress;
@ApiModelProperty("加入黑名单原因")
private String joinBlackReason;
}

View File

@@ -19,7 +19,7 @@ public class IntentAreaSettingVO {
private String zoneName;
private List<orgVO> orgVOS;
private List<OrganizationVO> orgVOS;
private Date updateTime;

View File

@@ -11,7 +11,7 @@ import lombok.Data;
*/
@Data
@ApiModel
public class orgVO {
public class OrganizationVO {
@ApiModelProperty("id")
private Long id;

View File

@@ -0,0 +1,33 @@
package com.cool.store.vo;
import lombok.Data;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/6/13 15:27
* @Version 1.0
*/
@Data
public class ZoneVO {
private Long id;
private String zoneName;
private String updateTime;
private String updateUserId;
private String updateUserName;
private List<OrganizationVO> orgVos;
private List<OpenAreaVO> openAreaVOS;
}

View File

@@ -1,5 +1,7 @@
package com.cool.store.Service;
import com.cool.store.request.LineRequest;
import com.cool.store.vo.BlackListVO;
import com.cool.store.vo.PartnerLineInfoAndBaseInfoVO;
import com.cool.store.vo.PartnerLineInfoVO;
import com.cool.store.vo.StageCountVO;
@@ -63,5 +65,30 @@ public interface HyPartnerLineInfoService {
Boolean allocationInvestmentManager(String userId, List<Long> lineIdList);
/**
* 黑名单列表
* @param LineRequest LineRequest
* @return
*/
PageInfo<BlackListVO> getBlackList(LineRequest LineRequest);
/**
* 加入或者移除 黑名单
* @param lineId
* @param status
* @param joinReason
* @return
*/
Boolean joinBlackList( Long lineId, Integer status, String joinReason);
/**
* 移除黑名单
* @param lineId
* @param status
* @param removeReason
* @return
*/
Boolean removeBlackList( Long lineId, Integer status, String removeReason);
}

View File

@@ -4,16 +4,20 @@ import cn.hutool.core.date.DateUtil;
import com.cool.store.Service.HyPartnerLineInfoService;
import com.cool.store.dao.HyPartnerLineInfoDAO;
import com.cool.store.dao.HyPartnerUserInfoDAO;
import com.cool.store.dto.partner.PartnerBlackListDTO;
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.HyPartnerUserInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.LineStatusEnum;
import com.cool.store.enums.WorkflowStageEnum;
import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.LineRequest;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.StringUtil;
import com.cool.store.vo.BlackListVO;
import com.cool.store.vo.PartnerLineInfoAndBaseInfoVO;
import com.cool.store.vo.PartnerLineInfoVO;
import com.cool.store.vo.StageCountVO;
@@ -129,6 +133,82 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
return null;
}
@Override
public PageInfo<BlackListVO> getBlackList(LineRequest LineRequest) {
PageHelper.startPage(LineRequest.getPageNum(),LineRequest.getPageSize());
PageInfo blackListDTOPageInfo = hyPartnerLineInfoDAO.getBlackList(LineRequest.getKeyWord(), LineRequest.getIntentArea(), LineRequest.getAcceptAdjustType());
List<PartnerBlackListDTO> list = blackListDTOPageInfo.getList();
List<BlackListVO> result = new ArrayList<>();
list.stream().forEach(x->{
BlackListVO blackListVO = convertPartnerBlackListDTOToVo(x);
//todo su 员工名称手机号 手机号归属地
result.add(blackListVO);
});
blackListDTOPageInfo.setList(result);
return blackListDTOPageInfo;
}
@Override
public Boolean joinBlackList(Long lineId, Integer status, String joinReason) {
if (lineId==null){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
//加入黑名单 阶段回到第一步待提交状态
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
hyPartnerLineInfoDO.setId(lineId);
hyPartnerLineInfoDO.setLineStatus(status);
hyPartnerLineInfoDO.setJoinBlackReason(joinReason);
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
return Boolean.TRUE;
}
@Override
public Boolean removeBlackList(Long lineId, Integer status, String removeReason) {
//移除黑名单 黑名单线索置为删除状态 新增一条线索
if (lineId==null){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
hyPartnerLineInfoDO.setId(lineId);
hyPartnerLineInfoDO.setLineStatus(status);
hyPartnerLineInfoDO.setRemoveBlackReason(removeReason);
hyPartnerLineInfoDO.setDeleted(Boolean.TRUE);
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
HyPartnerLineInfoDO newHyPartnerLineInfoDO = new HyPartnerLineInfoDO();
hyPartnerLineInfoDO.setPartnerId(hyPartnerLineInfoDO.getPartnerId());
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
hyPartnerLineInfoDO.setLineStatus(0);
hyPartnerLineInfoDAO.batchInsert(Arrays.asList(newHyPartnerLineInfoDO));
return Boolean.TRUE;
}
/**
* convertPartnerBlackListDTOToVo
* @param partnerBlackListDTO
* @return
*/
public BlackListVO convertPartnerBlackListDTOToVo(PartnerBlackListDTO partnerBlackListDTO){
BlackListVO blackListVO = new BlackListVO();
blackListVO.setId(partnerBlackListDTO.getLineId());
blackListVO.setPartnerUserId(partnerBlackListDTO.getPartnerId());
blackListVO.setPartnerUserName(partnerBlackListDTO.getPartnerUserName());
blackListVO.setPartnerUserPhone(partnerBlackListDTO.getMobile());
blackListVO.setCreateTime(partnerBlackListDTO.getCreateTime());
blackListVO.setCloseTime(partnerBlackListDTO.getCloseTime());
blackListVO.setJoinBlackReason(partnerBlackListDTO.getJoinBlackReason());
blackListVO.setCloseUserId(partnerBlackListDTO.getCloseUserId());
return blackListVO;
}
/**
* convertPartnerLineInfoAndBaseInfoDTOToVo

View File

@@ -4,6 +4,7 @@ import com.cool.store.Service.DeskService;
import com.cool.store.Service.HyPartnerIntentInfoService;
import com.cool.store.Service.HyPartnerInterviewPlanService;
import com.cool.store.Service.HyPartnerLineInfoService;
import com.cool.store.enums.LineStatusEnum;
import com.cool.store.request.*;
import com.cool.store.response.ResponseResult;
import com.cool.store.vo.*;
@@ -200,7 +201,7 @@ public class DeskController {
@ApiOperation("黑名单列表")
public ResponseResult<PageInfo<BlackListVO>> queryBlackList(@RequestBody LineRequest LineRequest){
return ResponseResult.success();
return ResponseResult.success(hyPartnerLineInfoService.getBlackList(LineRequest));
}
@@ -208,16 +209,14 @@ public class DeskController {
@ApiOperation("移出黑名单")
public ResponseResult<Boolean> removeBlackList(@RequestBody LineBlackListRequest lineBlackListRequest){
return ResponseResult.success();
return ResponseResult.success(hyPartnerLineInfoService.removeBlackList(lineBlackListRequest.getLineId(), LineStatusEnum.PUBLIC_SEAS.getCode(),lineBlackListRequest.getCause()));
}
@PostMapping(path = "/joinBlackList")
@ApiOperation("加入黑名单")
public ResponseResult<Boolean> joinBlackList(@RequestBody LineBlackListRequest lineBlackListRequest){
return ResponseResult.success();
return ResponseResult.success(hyPartnerLineInfoService.joinBlackList(lineBlackListRequest.getLineId(),LineStatusEnum.BLACKLIST.getCode(),lineBlackListRequest.getCause()));
}
@@ -244,15 +243,17 @@ public class DeskController {
return ResponseResult.success();
}
@GetMapping(path = "/queryPartnerIntentApplyInfo")
@ApiOperation("查看意向审核信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
})
public ResponseResult<PartnerSummaryInfoVO> queryPartnerIntentApplyInfo(@RequestParam(value = "lineId",required = false)Long lineId){
return ResponseResult.success();
}
// TODO: 2023/6/13 添加根据线索查询店员接口列表接口
// @GetMapping(path = "/queryPartnerIntentApplyInfo")
// @ApiOperation("查看意向审核信息")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
// })
// public ResponseResult<PartnerSummaryInfoVO> queryPartnerIntentApplyInfo(@RequestParam(value = "lineId",required = false)Long lineId){
//
// return ResponseResult.success();
// }
@@ -293,14 +294,12 @@ public class DeskController {
return ResponseResult.success();
}
@GetMapping(path = "/getZoneList")
@ApiOperation("战区列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "意向区域-intent 开发区域=dev", required = false),
})
public ResponseResult<List<OpenAreaVO>> getZoneList(@RequestParam(value = "type",required = false)String type,
public ResponseResult<PageInfo<ZoneVO>> getZoneList(@RequestParam(value = "type",required = false)String type,
@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
return ResponseResult.success();
@@ -312,7 +311,7 @@ public class DeskController {
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "意向区域-intent 开发区域=dev", required = false),
})
public ResponseResult<List<OpenAreaVO>> deletedZoneList(@RequestParam(value = "id",required = false)Long id){
public ResponseResult<Boolean> deletedZoneList(@RequestParam(value = "id",required = false)Long id){
return ResponseResult.success();
}