多品牌使用
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.enums;/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2024/11/04/下午7:00
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public enum FranchiseBrandEnum {
|
||||
ZXJP(1,"正新鸡排"),
|
||||
ZXSMZ(2,"正新三明治"),
|
||||
ZJS(3,"正烧记"),
|
||||
DGMX(4,"大鼓米线"),
|
||||
CXM(5,"串小妹"),
|
||||
MZG(6,"茂掌柜");
|
||||
private int code;
|
||||
private String desc;
|
||||
FranchiseBrandEnum(int code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
@@ -123,13 +123,13 @@ public class LineInfoDAO {
|
||||
return lineInfo;
|
||||
}
|
||||
|
||||
public List<LineInfoDO> lineList(LineListRequest lineListRequest,String wantShopAreaName, String userId, List<Long> wantShopAreaIds) {
|
||||
List<LineInfoDO> lineInfo = lineInfoMapper.lineList(lineListRequest,wantShopAreaName,userId,wantShopAreaIds);
|
||||
public List<LineInfoDO> lineList(LineListRequest lineListRequest,String wantShopAreaName, String userId, List<Long> regionIds) {
|
||||
List<LineInfoDO> lineInfo = lineInfoMapper.lineList(lineListRequest,wantShopAreaName,userId,regionIds);
|
||||
return lineInfo;
|
||||
}
|
||||
|
||||
public List<LineInfoDO> partnerList(PartnerRequest partnerRequest,String wantShopAreaName, String userId, List<Long> wantShopAreaIds) {
|
||||
List<LineInfoDO> lineInfo = lineInfoMapper.partnerList(partnerRequest,wantShopAreaName,userId,wantShopAreaIds);
|
||||
public List<LineInfoDO> partnerList(PartnerRequest partnerRequest,String wantShopAreaName, String userId, List<Long> regionIds) {
|
||||
List<LineInfoDO> lineInfo = lineInfoMapper.partnerList(partnerRequest,wantShopAreaName,userId,regionIds);
|
||||
return lineInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,12 +47,12 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
|
||||
List<LineInfoDO> lineList(@Param("request") LineListRequest lineListRequest,
|
||||
@Param("wantShopAreaName") String wantShopAreaName,
|
||||
@Param("userId") String userId,
|
||||
@Param("wantShopAreaIds") List<Long> wantShopAreaIds);
|
||||
@Param("regionIds") List<Long> regionIds);
|
||||
|
||||
List<LineInfoDO> partnerList(@Param("request") PartnerRequest partnerRequest,
|
||||
@Param("wantShopAreaName") String wantShopAreaName,
|
||||
@Param("userId") String userId,
|
||||
@Param("wantShopAreaIds") List<Long> wantShopAreaIds);
|
||||
@Param("regionIds") List<Long> regionIds);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="partner_num" jdbcType="VARCHAR" property="partnerNum" />
|
||||
<result column="big_region_id" jdbcType="BIGINT" property="bigRegionId" />
|
||||
<result column="franchise_brand" jdbcType="TINYINT" property="franchiseBrand" />
|
||||
</resultMap>
|
||||
<insert id="insertOrUpdate" parameterType="com.cool.store.entity.LineInfoDO" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO xfsg_line_info
|
||||
@@ -437,9 +438,9 @@
|
||||
<if test="request.investmentManagerUserId != null and request.investmentManagerUserId != ''">
|
||||
and a.investment_manager = #{request.investmentManagerUserId}
|
||||
</if>
|
||||
<if test="wantShopAreaIds !=null and wantShopAreaIds.size>0">
|
||||
<foreach collection="wantShopAreaIds" item="wantShopAreaId" open="and a.want_shop_area_id in (" close=")" separator=",">
|
||||
#{wantShopAreaId}
|
||||
<if test="regionIds !=null and regionIds.size>0">
|
||||
<foreach collection="regionIds" item="regionId" open="and a.region_id in (" close=")" separator=",">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
order by a.id desc
|
||||
@@ -472,9 +473,9 @@
|
||||
and a.development_manager = #{request.queryUserId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="wantShopAreaIds !=null and wantShopAreaIds.size>0">
|
||||
<foreach collection="wantShopAreaIds" item="wantShopAreaId" open="and a.want_shop_area_id in (" close=")" separator=",">
|
||||
#{wantShopAreaId}
|
||||
<if test="regionIds !=null and regionIds.size>0">
|
||||
<foreach collection="regionIds" item="regionId" open="and a.region_id in (" close=")" separator=",">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
order by a.id desc
|
||||
|
||||
@@ -175,5 +175,6 @@ public class LineInfoDO {
|
||||
|
||||
@Column(name = "join_mode")
|
||||
private Integer joinMode;
|
||||
|
||||
@Column(name = "franchise_brand")
|
||||
private Integer franchiseBrand;
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/3/27 16:32
|
||||
@@ -18,6 +20,8 @@ public class LineListRequest extends PageBasicInfo {
|
||||
private String userName;
|
||||
@ApiModelProperty("线索手机号")
|
||||
private String mobile;
|
||||
@ApiModelProperty("所属区域")
|
||||
private List<Long> regionIds;
|
||||
@ApiModelProperty("关键字")
|
||||
private String keyword;
|
||||
@ApiModelProperty("线索子阶段")
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.cool.store.common.PageBasicInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/1 11:21
|
||||
@@ -12,7 +14,8 @@ import lombok.Data;
|
||||
@Data
|
||||
public class PartnerRequest extends PageBasicInfo {
|
||||
|
||||
|
||||
@ApiModelProperty("所属区域")
|
||||
private List<Long> regionIds;
|
||||
@ApiModelProperty("加密状态 1-蓄水池 2-正式")
|
||||
private Integer joinStatus;
|
||||
@ApiModelProperty("加盟上姓名或者手机号")
|
||||
|
||||
@@ -21,12 +21,15 @@ public class UpdateLineRequest {
|
||||
private String lineName;
|
||||
@ApiModelProperty("加盟意向区域")
|
||||
private Long wantShopAreaId;
|
||||
|
||||
@ApiModelProperty("所属区域")
|
||||
private Long regionId;
|
||||
@NotNull
|
||||
@Min(1)
|
||||
@Max(2)
|
||||
@ApiModelProperty("加盟模式 1-社会加盟 2-强加盟")
|
||||
private Integer joinMode;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty("加盟品牌")
|
||||
private Integer franchiseBrand;
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
public class BaseInfoVO {
|
||||
|
||||
@ApiModelProperty("所属区域")
|
||||
private String regionName;
|
||||
@ApiModelProperty("线索ID")
|
||||
private Long lineId;
|
||||
|
||||
|
||||
@@ -228,5 +228,6 @@ public class LineInfoVO {
|
||||
|
||||
private Long bigRegionId;
|
||||
|
||||
private Integer franchiseBrand;
|
||||
|
||||
}
|
||||
|
||||
@@ -76,26 +76,26 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
||||
lineInfoParam.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
|
||||
lineInfoParam.setWorkflowSubStage(WorkflowSubStageEnum.INTEND.getCode());
|
||||
lineInfoParam.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode());
|
||||
if ((Objects.nonNull(request.getAreaCode()) && Objects.nonNull(lineInfoDO) && StringUtils.isBlank(lineInfoDO.getInvestmentManager())) || (Objects.isNull(lineInfoDO))) {
|
||||
EnterpriseUserDO userByRoleNameAndAreaId = userAuthMappingService.getUserByRoleEnumAndWantShopAreaId(UserRoleEnum.SUPERVISION, Long.valueOf(request.getAreaCode()));
|
||||
lineInfoParam.setInvestmentManager(userByRoleNameAndAreaId.getUserId());
|
||||
}
|
||||
lineInfoParam.setLineStatus(1);
|
||||
// if ((Objects.nonNull(request.getAreaCode()) && Objects.nonNull(lineInfoDO) && StringUtils.isBlank(lineInfoDO.getInvestmentManager())) || (Objects.isNull(lineInfoDO))) {
|
||||
// EnterpriseUserDO userByRoleNameAndAreaId = userAuthMappingService.getUserByRoleEnumAndWantShopAreaId(UserRoleEnum.SUPERVISION, Long.valueOf(request.getAreaCode()));
|
||||
// lineInfoParam.setInvestmentManager(userByRoleNameAndAreaId.getUserId());
|
||||
// }
|
||||
lineInfoParam.setLineStatus(0);
|
||||
//强加盟 前期不确定意向区域
|
||||
if (lineInfoParam.getWantShopAreaId() != null&&lineInfoDO.getJoinMode()==1) {
|
||||
Long regionId = regionAreaConfigDao.getByWantShopAreaId(lineInfoParam.getWantShopAreaId());
|
||||
lineInfoParam.setRegionId(regionId);
|
||||
}
|
||||
// if (lineInfoParam.getWantShopAreaId() != null&&lineInfoDO.getJoinMode()==1) {
|
||||
// Long regionId = regionAreaConfigDao.getByWantShopAreaId(lineInfoParam.getWantShopAreaId());
|
||||
// lineInfoParam.setRegionId(regionId);
|
||||
// }
|
||||
lineInfoDAO.insertOrUpdate(lineInfoParam);
|
||||
QualificationsInfoDO qualificationsInfoDO = request.toQualificationsInfoDO();
|
||||
qualificationsInfoDAO.insertOrUpdate(qualificationsInfoDO);
|
||||
|
||||
Map<String, String> requestMap = new HashMap<>();
|
||||
requestMap.put("partnerUsername", lineInfoParam.getUsername());
|
||||
requestMap.put("partnerMobile", lineInfoParam.getMobile());
|
||||
requestMap.put("lineId", String.valueOf(lineInfoParam.getId()));
|
||||
HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(lineInfoParam.getWantShopAreaId());
|
||||
requestMap.put("regionName", openAreaInfoDO.getAreaName());
|
||||
// Map<String, String> requestMap = new HashMap<>();
|
||||
// requestMap.put("partnerUsername", lineInfoParam.getUsername());
|
||||
// requestMap.put("partnerMobile", lineInfoParam.getMobile());
|
||||
// requestMap.put("lineId", String.valueOf(lineInfoParam.getId()));
|
||||
// HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(lineInfoParam.getWantShopAreaId());
|
||||
// requestMap.put("regionName", openAreaInfoDO.getAreaName());
|
||||
//工作通知后面对接企业微信
|
||||
// commonService.sendMessage(Collections.singletonList(lineInfoParam.getInvestmentManager()),
|
||||
// MessageEnum.MESSAGE_29,
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -163,11 +164,15 @@ public class LineServiceImpl implements LineService {
|
||||
List<String> userIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getInvestmentManager() != null).map(LineInfoDO::getInvestmentManager).collect(Collectors.toList());
|
||||
userIds.addAll(lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getUpdateUserId() != null).map(LineInfoDO::getUpdateUserId).collect(Collectors.toList()));
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(userIds);
|
||||
|
||||
List<Long> regionIds = lineInfoDOS.stream().filter(x -> x.getRegionId() != null).map(LineInfoDO::getRegionId).collect(Collectors.toList());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(regionIds);
|
||||
List<LineListVO> result = new ArrayList<>();
|
||||
lineInfoDOS.forEach(x->{
|
||||
BaseInfoVO baseInfoVO = deskService.convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
|
||||
LineListVO lineListVO = new LineListVO(baseInfoVO);
|
||||
if (regionNameMap!=null){
|
||||
lineListVO.setRegionName(regionNameMap.get(x.getRegionId()));
|
||||
}
|
||||
lineListVO.setCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, x.getCreateTime()));
|
||||
lineListVO.setUpdateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, x.getUpdateTime()));
|
||||
lineListVO.setLineSourceName(channelMapByIds.get(x.getLineSource()));
|
||||
@@ -194,7 +199,6 @@ public class LineServiceImpl implements LineService {
|
||||
userIds.addAll(lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getCreateUserId() != null).map(LineInfoDO::getCreateUserId).collect(Collectors.toList()));
|
||||
userIds.addAll(lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getDevelopmentManager() != null).map(LineInfoDO::getDevelopmentManager).collect(Collectors.toList()));
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(userIds);
|
||||
|
||||
List<PublicLineListVO> result = new ArrayList<>();
|
||||
lineInfoDOS.forEach(x->{
|
||||
BaseInfoVO baseInfoVO = deskService.convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
|
||||
@@ -215,15 +219,17 @@ public class LineServiceImpl implements LineService {
|
||||
@Override
|
||||
public PageInfo<PartnerListVO> getPartnerList(PartnerRequest partnerRequest, LoginUserInfo loginUserInfo, Boolean teamFlag) {
|
||||
|
||||
List<Long> wantShopAreaIds = new ArrayList<>();
|
||||
List<Long> regionId = new ArrayList<>();
|
||||
String userId = null;
|
||||
if(!teamFlag){
|
||||
userId = loginUserInfo.getUserId();
|
||||
}
|
||||
if (teamFlag && !sysRoleService.checkIsAdmin(loginUserInfo.getUserId())){
|
||||
List<Long> list = userAuthMappingService.listWantShopAreaIdByUserId(loginUserInfo.getUserId());
|
||||
List<String> list = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(loginUserInfo.getUserId());
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
wantShopAreaIds = list;
|
||||
for (String s : list){
|
||||
regionId.add(Long.valueOf(s));
|
||||
}
|
||||
}else {
|
||||
userId = loginUserInfo.getUserId();
|
||||
}
|
||||
@@ -234,7 +240,7 @@ public class LineServiceImpl implements LineService {
|
||||
areaName = hyOpenAreaInfoDO.getAreaPath();
|
||||
}
|
||||
PageHelper.startPage(partnerRequest.getPageNum(), partnerRequest.getPageSize());
|
||||
List<LineInfoDO> lineInfoDOS = lineInfoDAO.partnerList(partnerRequest,areaName, userId, wantShopAreaIds);
|
||||
List<LineInfoDO> lineInfoDOS = lineInfoDAO.partnerList(partnerRequest,areaName, userId, regionId);
|
||||
PageInfo page = new PageInfo(lineInfoDOS);
|
||||
Map<Long, HyPartnerLabelDO> userPortraitMap = deskService.getUserPortraitMap(lineInfoDOS);
|
||||
List<Long> wantShopAreaIdList = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
||||
@@ -252,6 +258,8 @@ public class LineServiceImpl implements LineService {
|
||||
List<SigningBaseInfoDO> signingBaseInfoDOS = intentAgreementMapper.selectByLineIds(lineIds);
|
||||
Map<Long, Date> dateMap = signingBaseInfoDOS.stream().collect(Collectors.toMap(SigningBaseInfoDO::getLineId, SigningBaseInfoDO::getCreateTime));
|
||||
|
||||
List<Long> regionIds = lineInfoDOS.stream().filter(x -> x.getRegionId() != null).map(LineInfoDO::getRegionId).collect(Collectors.toList());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(regionIds);
|
||||
List<PartnerListVO> result = new ArrayList<>();
|
||||
lineInfoDOS.forEach(x->{
|
||||
BaseInfoVO baseInfoVO = deskService.convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
|
||||
@@ -260,6 +268,9 @@ public class LineServiceImpl implements LineService {
|
||||
if (date != null){
|
||||
partnerListVO.setJoinTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, date));
|
||||
}
|
||||
if (regionNameMap!=null){
|
||||
partnerListVO.setRegionName(regionNameMap.get(x.getId()));
|
||||
}
|
||||
partnerListVO.setUpdateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, x.getUpdateTime()));
|
||||
partnerListVO.setLineSourceName(channelMapByIds.get(x.getLineSource()));
|
||||
partnerListVO.setJoinStatus(x.getJoinStatus());
|
||||
@@ -332,9 +343,9 @@ public class LineServiceImpl implements LineService {
|
||||
if (lineInfo==null){
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
lineInfo.setFranchiseBrand(updateLineRequest.getFranchiseBrand());
|
||||
lineInfo.setJoinMode(updateLineRequest.getJoinMode());
|
||||
Long regionId = regionAreaConfigDao.getByWantShopAreaId(updateLineRequest.getWantShopAreaId());
|
||||
lineInfo.setRegionId(regionId);
|
||||
lineInfo.setRegionId(updateLineRequest.getRegionId());
|
||||
lineInfo.setWantShopAreaId(updateLineRequest.getWantShopAreaId());
|
||||
lineInfo.setUsername(updateLineRequest.getLineName());
|
||||
lineInfo.setUpdateTime(new Date());
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.controller.webb;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dto.TransferLogDTO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.enums.point.PayBusinessTypeEnum;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
@@ -19,6 +20,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
|
||||
Reference in New Issue
Block a user