Merge branch 'master' into cc20250207_optimize_v2.5
# Conflicts: # coolstore-partner-dao/src/main/java/com/cool/store/mapper/FranchiseFeeMapper.java
This commit is contained in:
@@ -79,7 +79,7 @@ public enum ErrorCodeEnum {
|
||||
NO_TRANSFER_REQUIRED(500013, "招商经理现有私海线索无需转让,请检查后重试!", null),
|
||||
NO_BATCH_TRANSFER_REQUIRED(500014, "已选线索包含此招商经理现有私海线索,无需转让,请检查后重试!", null),
|
||||
PARTNER_MOBILE_EXIST(500010, "手机号码已存在,请核实!", null),
|
||||
MOBILE_EXIST(500015, "此手机号码已存在,请修改后重试", null),
|
||||
MOBILE_EXIST(500015, "此手机号码已存在,线索所属列表:{0},督导:{1},创建日期:{2}", null),
|
||||
INVESTMENT_MANAGER_NOT_EXIST(500016, "当前招商经理不存在", null),
|
||||
PARTNER_MOBILE_EXIST_0(500017, "手机号码已存在", null),
|
||||
TIME_OCCUPIED(500018, "预约时间被占用", null),
|
||||
@@ -200,6 +200,8 @@ public enum ErrorCodeEnum {
|
||||
|
||||
INVOICING_EXIST(109016, "当前门店发票信息已存在!", null),
|
||||
|
||||
SHOP_STATUS_NOT_SUPPORT_HANDLER(109016, "当前门店状态为:{0},不能进行结束跟进操作", null),
|
||||
|
||||
|
||||
INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),
|
||||
INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null),
|
||||
@@ -229,7 +231,8 @@ public enum ErrorCodeEnum {
|
||||
|
||||
UPDATE_FAIL(131000,"修改失败,表单不存在!",null),
|
||||
LICENSE_LEGAL_STAGE_FAIL(131001,"营业执照阶段未上传!",null),
|
||||
GET_JURIDICAL_ID_CARD_NO_FAIL(131002,"获取法人身份证信息失败!",null)
|
||||
GET_JURIDICAL_ID_CARD_NO_FAIL(131002,"获取法人身份证信息失败!",null),
|
||||
UPDATE_INVESTMENT_MANAGER_FAIL(131005,"当前用户已经为该门店招商经理",null)
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ public enum FileTypeEnum {
|
||||
MY_FRANCHISEES("my_franchisees","我的加盟商"),
|
||||
TEAM_FRANCHISEES("team_franchisees","团队加盟商"),
|
||||
PREPARATION("preparation","进度管理"),
|
||||
BRANCH_SHOP_LIST("branchShopList","开店管理")
|
||||
;
|
||||
private String fileType;
|
||||
private String desc;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/07/下午2:18
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public enum FollowLogTypeEnum {
|
||||
LINE(1,"线索"),
|
||||
SHOP(2,"门店");
|
||||
private int code;
|
||||
private String desc;
|
||||
private FollowLogTypeEnum(int code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,13 @@
|
||||
package com.cool.store.enums;/**
|
||||
package com.cool.store.enums;
|
||||
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2024/11/04/下午7:00
|
||||
* @Version 1.0
|
||||
@@ -23,4 +32,19 @@ public enum FranchiseBrandEnum {
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
public static String getDescByCode(String code) {
|
||||
if (StringUtils.isBlank(code)){
|
||||
return null;
|
||||
}
|
||||
List<Integer> integerList = Arrays.stream(code.split(","))
|
||||
.map(Integer::parseInt)
|
||||
.collect(Collectors.toList());
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
for (FranchiseBrandEnum e : FranchiseBrandEnum.values()) {
|
||||
if (integerList.contains(e.getCode())) {
|
||||
stringBuffer.append(e.getDesc()).append(",");
|
||||
}
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/08/下午5:51
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public enum JoinModeEnum {
|
||||
FRANCHISE_DEPARTMENT(1,"社会加盟模式/加盟部加盟店"),
|
||||
FRANCHISE_COMPANIES(2,"强加盟模式/加盟公司加盟店"),
|
||||
OWN_STORE(3,"加盟公司自有店");
|
||||
private int code;
|
||||
private String desc;
|
||||
private JoinModeEnum(int code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
public static String getByCode(Integer code) {
|
||||
if (code == null){
|
||||
return null;
|
||||
}
|
||||
for (JoinModeEnum e : JoinModeEnum.values()) {
|
||||
if (e.getCode() == code) {
|
||||
return e.desc;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,8 @@ public enum OperationLogTypeEnum {
|
||||
|
||||
TRANSFER_INVESTMENT_MANAGER(1, "转让招商经理_线索"),
|
||||
ENTRUST_INTERVIEW(2, "委托面试"),
|
||||
TRANSFER_INVESTMENT_MANAGER_3(3, "转让招商经理_加盟商");
|
||||
TRANSFER_INVESTMENT_MANAGER_3(3, "转让招商经理_加盟商"),
|
||||
TRANSFER_INVESTMENT_MANAGER_4(4, "转让招商经理_门店");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
@@ -43,6 +43,7 @@ public enum UserRoleEnum {
|
||||
TENT_PASS_CUSTOMER(380000000L,"营帐通客服"),
|
||||
DESIGN_CUSTOMER(390000000L,"设计客服"),
|
||||
CONSTRUCTION_CUSTOMER(400000000L,"施工客服"),
|
||||
BRANCH_OFFICE(1724233283449L,"分布内勤"),
|
||||
;
|
||||
|
||||
private Long code;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.cool.store.enums.point;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/08/下午3:54
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public enum ShopStatusEnum {
|
||||
ING(0,"跟进中"),
|
||||
DONE(1,"已完成"),
|
||||
ABANDON(2,"已放弃");
|
||||
private int code;
|
||||
private String desc;
|
||||
private ShopStatusEnum(int code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
public static String getDesc(int code){
|
||||
for (ShopStatusEnum shopStatusEnum:ShopStatusEnum.values()){
|
||||
if (shopStatusEnum.getCode()==code){
|
||||
return shopStatusEnum.getDesc();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -119,6 +119,9 @@ public class EnterpriseUserDAO {
|
||||
|
||||
public Map<String, EnterpriseUserDO> getUserInfoMap(List<String> userIds){
|
||||
List<EnterpriseUserDO> userList = getUserInfoByUserIds(userIds);
|
||||
if (CollectionUtils.isEmpty(userList)){
|
||||
return new HashMap<>();
|
||||
}
|
||||
return userList.stream().collect(Collectors.toMap(k -> k.getUserId(), Function.identity()));
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,9 @@ public class HyOpenAreaInfoDAO {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOS = hyOpenAreaInfoMapper.selectByIds(ids);
|
||||
if (CollectionUtils.isEmpty(hyOpenAreaInfoDOS)){
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return ListUtils.emptyIfNull(hyOpenAreaInfoDOS).stream().collect(Collectors.toMap(k->k.getId(), v->v.getAreaPath().replace("/"," ").trim()));
|
||||
}
|
||||
|
||||
@@ -171,4 +174,11 @@ public class HyOpenAreaInfoDAO {
|
||||
List<HyOpenAreaInfoDO> openAreaInfoList = selectByIds(wantShopAreaIds);
|
||||
return openAreaInfoList.stream().collect(Collectors.toMap(k->k.getId(), v->v, (k1, k2)->k1));
|
||||
}
|
||||
|
||||
public List<Long> getChildrenListByParentIds(List<Long> parentIds) {
|
||||
if (CollectionUtils.isEmpty(parentIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return hyOpenAreaInfoMapper.getChildrenListByParentIds(parentIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,14 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.InvoicingDO;
|
||||
import com.cool.store.mapper.InvoicingMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -41,5 +45,14 @@ public class InvoicingDAO {
|
||||
return invoicingMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<InvoicingDO> listByShopIds(List<Long> shopIds){
|
||||
if (CollectionUtils.isEmpty(shopIds)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Example example = new Example(InvoicingDO.class);
|
||||
example.createCriteria().andIn("shopId", shopIds);
|
||||
return invoicingMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.LineFollowLogDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.mapper.LineFollowLogMapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
@@ -24,9 +25,9 @@ public class LineFollowLogDAO {
|
||||
@Resource
|
||||
private LineFollowLogMapper lineFollowLogMapper;
|
||||
|
||||
public Page<LineFollowLogDO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize){
|
||||
public Page<LineFollowLogDO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize,Integer type){
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
return lineFollowLogMapper.getFollowLogPage(lineId);
|
||||
return lineFollowLogMapper.getFollowLogPage(lineId,type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,11 +38,19 @@ public class LineFollowLogDAO {
|
||||
* @param message
|
||||
* @return
|
||||
*/
|
||||
public Long addFollowLog(LineInfoDO lineInfo, String operateUserId, String operateUsername, String message){
|
||||
public Long addFollowLog(LineInfoDO lineInfo,String operateUserId, String operateUsername, String message,Integer type){
|
||||
if(Objects.isNull(lineInfo)){
|
||||
return null;
|
||||
}
|
||||
LineFollowLogDO followLog = new LineFollowLogDO(lineInfo.getPartnerId(), lineInfo.getId(), operateUserId, operateUsername, lineInfo.getWorkflowStage(), lineInfo.getWorkflowSubStage(), lineInfo.getWorkflowSubStageStatus(), message);
|
||||
LineFollowLogDO followLog = new LineFollowLogDO(lineInfo.getPartnerId(), lineInfo.getId(), operateUserId, operateUsername, lineInfo.getWorkflowStage(), lineInfo.getWorkflowSubStage(), lineInfo.getWorkflowSubStageStatus(), message,type);
|
||||
lineFollowLogMapper.insertSelective(followLog);
|
||||
return followLog.getId();
|
||||
}
|
||||
public Long addFollowLogByShop(ShopInfoDO shopInfoDO, String operateUserId, String operateUsername, String message,Integer type){
|
||||
if(Objects.isNull(shopInfoDO)){
|
||||
return null;
|
||||
}
|
||||
LineFollowLogDO followLog = new LineFollowLogDO(shopInfoDO.getPartnerId(), shopInfoDO.getId(), operateUserId, operateUsername,null,null,null, message,type);
|
||||
lineFollowLogMapper.insertSelective(followLog);
|
||||
return followLog.getId();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.aliyun.openservices.shade.com.google.common.collect.Lists;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.InvestmentCountDTO;
|
||||
import com.cool.store.dto.PendingCountDTO;
|
||||
@@ -15,6 +16,7 @@ import com.cool.store.request.PartnerRequest;
|
||||
import com.cool.store.request.PointLinePageRequest;
|
||||
import com.cool.store.request.PublicLineListRequest;
|
||||
import com.cool.store.utils.RandomEightCharCodeUtils;
|
||||
import com.cool.store.vo.LineVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.google.common.collect.Maps;
|
||||
@@ -26,6 +28,7 @@ import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -52,14 +55,15 @@ public class LineInfoDAO {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public Boolean getLineInfoByMobile(String mobile) {
|
||||
|
||||
public LineInfoDO getLineByMobile(String mobile) {
|
||||
Example example = new Example(LineInfoDO.class);
|
||||
example.createCriteria().andEqualTo("mobile", mobile);
|
||||
List<LineInfoDO> lineInfoDOS = lineInfoMapper.selectByExample(example);
|
||||
if(CollectionUtils.isNotEmpty(lineInfoDOS)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return lineInfoMapper.selectOneByExample(example);
|
||||
}
|
||||
|
||||
public Boolean getLineInfoByMobile(String mobile) {
|
||||
return Objects.nonNull(getLineByMobile(mobile));
|
||||
}
|
||||
|
||||
public Integer updateLineInfo(LineInfoDO param){
|
||||
@@ -198,4 +202,24 @@ public class LineInfoDAO {
|
||||
}
|
||||
return lineInfoMapper.batchUpdateInvestmentManager(lineIds, status, investmentManager,regionId);
|
||||
}
|
||||
|
||||
public List<LineVO> getLines(String keyword){
|
||||
return lineInfoMapper.getLinesByKeyword(keyword);
|
||||
}
|
||||
|
||||
public List<LineInfoDO> getByLineIds(List<Long> lineIds){
|
||||
if (CollectionUtils.isEmpty(lineIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return lineInfoMapper.getByLineIds(lineIds);
|
||||
}
|
||||
|
||||
public Map<Long, String> getUserNameMap(List<Long> lineIds){
|
||||
if(CollectionUtils.isEmpty(lineIds)){
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
List<LineInfoDO> lineMobile = lineInfoMapper.getByLineIds(lineIds);
|
||||
return lineMobile.stream().filter(o->StringUtils.isNotBlank(o.getMobile())).collect(Collectors.toMap(LineInfoDO::getId, LineInfoDO::getUsername, (k1, k2)-> k1));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -99,11 +99,11 @@ public class PointInfoDAO {
|
||||
return pointInfoMapper.getRecommendPointList(request);
|
||||
}
|
||||
|
||||
public Integer updateSelectedDevelopmentManager(Long lineId, String developmentManager) {
|
||||
if(Objects.isNull(lineId) || StringUtils.isBlank(developmentManager)){
|
||||
public Integer updateSelectedDevelopmentManager(Long shopId, String developmentManager) {
|
||||
if(Objects.isNull(shopId) || StringUtils.isBlank(developmentManager)){
|
||||
return null;
|
||||
}
|
||||
return pointInfoMapper.updateSelectedDevelopmentManager(lineId, developmentManager);
|
||||
return pointInfoMapper.updateSelectedDevelopmentManager(shopId, developmentManager);
|
||||
}
|
||||
|
||||
public Page<PointInfoDO> getTeamPointPage(AllPointPageRequest request) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.dao;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.point.LineCountDTO;
|
||||
import com.cool.store.dto.point.MiniPointPageDTO;
|
||||
import com.cool.store.dto.point.ShopCountDTO;
|
||||
import com.cool.store.entity.PointRecommendDO;
|
||||
import com.cool.store.enums.point.PointRecommendStatusEnum;
|
||||
import com.cool.store.mapper.PointRecommendMapper;
|
||||
@@ -70,6 +71,7 @@ public class PointRecommendDAO {
|
||||
* @param lineIds
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public Map<Long, Integer> getPushShopNumMap(List<Long> lineIds) {
|
||||
if(CollectionUtils.isEmpty(lineIds)){
|
||||
return Maps.newHashMap();
|
||||
@@ -78,6 +80,15 @@ public class PointRecommendDAO {
|
||||
return pushShopNumMap.stream().collect(Collectors.toMap(k->k.getLineId(), v->v.getRecommendShopNum()));
|
||||
}
|
||||
|
||||
|
||||
public Map<Long, Integer> getShopPushPointNumMap(List<Long> shopIds) {
|
||||
if(CollectionUtils.isEmpty(shopIds)){
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
List<ShopCountDTO> pushShopNumMap = pointRecommendMapper.getShopPushPointNumMap(shopIds);
|
||||
return pushShopNumMap.stream().collect(Collectors.toMap(k->k.getShopId(), v->v.getRecommendShopNum()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推荐列表
|
||||
* @param lineId
|
||||
@@ -90,6 +101,13 @@ public class PointRecommendDAO {
|
||||
return pointRecommendMapper.getRecommendPointList(lineId);
|
||||
}
|
||||
|
||||
public List<PointRecommendDO> getShopRecommendPointList(Long lineId) {
|
||||
if(Objects.isNull(lineId)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return pointRecommendMapper.getShopRecommendPointList(lineId);
|
||||
}
|
||||
|
||||
public Integer addRecommendPoint(List<PointRecommendDO> recommendList) {
|
||||
if(CollectionUtils.isEmpty(recommendList)){
|
||||
return CommonConstants.ZERO;
|
||||
@@ -102,8 +120,8 @@ public class PointRecommendDAO {
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
public Integer turnLineUpdateRecommendStatus(Long lineId, String developmentManager) {
|
||||
return pointRecommendMapper.turnLineUpdateRecommendStatus(lineId, developmentManager);
|
||||
public Integer turnLineUpdateRecommendStatus(Long shopId, String developmentManager) {
|
||||
return pointRecommendMapper.turnLineUpdateRecommendStatus(shopId, developmentManager);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,11 +134,11 @@ public class PointRecommendDAO {
|
||||
return pointRecommendMapper.getLineRecommendPointPage(request);
|
||||
}
|
||||
|
||||
public Integer updateStatusByPointIdAndLineId(Long pointId, Long lineId){
|
||||
if(Objects.isNull(pointId) || Objects.isNull(lineId)){
|
||||
public Integer updateStatusByPointIdAndLineId(Long pointId,Long shopId){
|
||||
if(Objects.isNull(pointId) || Objects.isNull(shopId)){
|
||||
return 0;
|
||||
}
|
||||
return pointRecommendMapper.updateStatusByPointIdAndLineId(pointId, lineId);
|
||||
return pointRecommendMapper.updateStatusByPointIdAndLineId(pointId,shopId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,11 +148,11 @@ public class PointRecommendDAO {
|
||||
* @param reason
|
||||
* @return
|
||||
*/
|
||||
public Integer rejectPoint(Long lineId, Long pointId, String reason) {
|
||||
if(Objects.isNull(lineId) || Objects.isNull(pointId)){
|
||||
public Integer rejectPoint(Long shopId, Long pointId, String reason) {
|
||||
if(Objects.isNull(shopId) || Objects.isNull(pointId)){
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
return pointRecommendMapper.rejectPoint(lineId, pointId, reason);
|
||||
return pointRecommendMapper.rejectPoint(shopId, pointId, reason);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,4 +166,16 @@ public class PointRecommendDAO {
|
||||
}
|
||||
return pointRecommendMapper.getRecommendPointListByPointId(pointId);
|
||||
}
|
||||
|
||||
|
||||
public List<PointRecommendDO> getAllRecommendPointList(Long lineId) {
|
||||
return pointRecommendMapper.getAllRecommendPointList(lineId);
|
||||
}
|
||||
|
||||
public Boolean batchUpdateShopId(List<PointRecommendDO> recommendList) {
|
||||
if (CollectionUtils.isEmpty(recommendList)){
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return pointRecommendMapper.batchUpdateShopId(recommendList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,15 @@ import com.cool.store.dto.LicenseSyncDTO;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||
import com.cool.store.dto.point.LineCountDTO;
|
||||
import com.cool.store.dto.point.ShopPointDTO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.ShopInfoMapper;
|
||||
import com.cool.store.request.BranchShopRequest;
|
||||
import com.cool.store.request.PlanListRequest;
|
||||
import com.cool.store.request.PointLinePageRequest;
|
||||
import com.cool.store.request.PreparationRequest;
|
||||
import com.cool.store.request.platformBuildListRequest;
|
||||
import com.cool.store.response.PlatformBuildListResponse;
|
||||
@@ -72,6 +76,13 @@ public class ShopInfoDAO {
|
||||
return shopInfoMapper.getShopList(lineId);
|
||||
}
|
||||
|
||||
public List<ShopInfoDO> getShopListByRegion(Long lineId,List<Long> regionIdList,String userId){
|
||||
if(Objects.isNull(lineId)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return shopInfoMapper.getShopListByRegion(lineId,regionIdList,userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增门店信息
|
||||
* @param shopInfo
|
||||
@@ -150,6 +161,10 @@ public class ShopInfoDAO {
|
||||
public List<PreparationDTO> ListByCondition(PreparationRequest request){
|
||||
return shopInfoMapper.ListByCondition(request);
|
||||
}
|
||||
|
||||
public List<PreparationDTO> ListByBranchShopRequest(BranchShopRequest request,String userId){
|
||||
return shopInfoMapper.ListByBranchShopRequest(request,userId);
|
||||
}
|
||||
public Long getRegionIdByid(Long shopId){
|
||||
return shopInfoMapper.getRegionIdByid(shopId);
|
||||
}
|
||||
@@ -181,5 +196,27 @@ public class ShopInfoDAO {
|
||||
return shopInfoMapper.getShopAndStoreList(eid,shopIds);
|
||||
}
|
||||
|
||||
public List<ShopPointDTO> getShopPointListByDevelopmentManager(PointLinePageRequest request) {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
return shopInfoMapper.getShopPointListByDevelopmentManager(request);
|
||||
}
|
||||
|
||||
|
||||
public List<ShopInfoDO> selectAllDataOrByLineId(Long shopId) {
|
||||
return shopInfoMapper.selectAllDataOrByLineId(shopId);
|
||||
}
|
||||
|
||||
public Boolean batchUpdate(List<ShopInfoDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
return shopInfoMapper.batchUpdate(list);
|
||||
}
|
||||
|
||||
public List<ShopInfoDO> selectInvestmentByLines(List<Long> lineIds) {
|
||||
if (CollectionUtils.isEmpty(lineIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return shopInfoMapper.selectInvestmentByList(lineIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -41,10 +42,10 @@ public class ShopStageInfoDAO {
|
||||
* 初始化店铺阶段信息
|
||||
* @param lineId
|
||||
* @param shopIds
|
||||
* @return
|
||||
* @return flag =true:表示意向加盟节点完成正常初始化。false:表示意向加盟节点未完成新建分店阶段都为未开始-100。
|
||||
*/
|
||||
public Integer initShopStageInfo(Long lineId, List<Long> shopIds) {
|
||||
if(CollectionUtils.isEmpty(shopIds)){
|
||||
public Integer initShopStageInfo(Long lineId, List<Long> shopIds, Boolean flag) {
|
||||
if (CollectionUtils.isEmpty(shopIds)) {
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
List<ShopStageInfoDO> addShopStageList = new ArrayList<>();
|
||||
@@ -57,9 +58,12 @@ public class ShopStageInfoDAO {
|
||||
ShopStageEnum shopStageEnum = shopSubStageEnum.getShopStageEnum();
|
||||
shopStageInfo.setShopStage(shopStageEnum.getShopStage());
|
||||
shopStageInfo.setShopSubStage(shopSubStageEnum.getShopSubStage());
|
||||
ShopSubStageStatusEnum initStatus = shopSubStageEnum.getInitStatus();
|
||||
ShopSubStageStatusEnum initStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00;
|
||||
if (flag) {
|
||||
initStatus = shopSubStageEnum.getInitStatus();
|
||||
}
|
||||
shopStageInfo.setShopSubStageStatus(initStatus.getShopSubStageStatus());
|
||||
shopStageInfo.setRemark(shopSubStageEnum.getShopSubStageName() + CommonConstants.PATH_BAR +shopSubStageEnum.getInitStatus().getShopSubStageStatusName());
|
||||
shopStageInfo.setRemark(shopSubStageEnum.getShopSubStageName() + CommonConstants.PATH_BAR + shopSubStageEnum.getInitStatus().getShopSubStageStatusName());
|
||||
shopStageInfo.setIsTerminated(Boolean.FALSE);
|
||||
shopStageInfo.setPlanCompleteTime(shopSubStageEnum.getPlanCompleteTime(selectStartDate));
|
||||
addShopStageList.add(shopStageInfo);
|
||||
@@ -69,22 +73,22 @@ public class ShopStageInfoDAO {
|
||||
return shopStageInfoMapper.batchInsert(addShopStageList);
|
||||
}
|
||||
|
||||
public Integer batchInsert( List<ShopStageInfoDO> addShopStageList){
|
||||
if(CollectionUtils.isEmpty(addShopStageList)){
|
||||
public Integer batchInsert(List<ShopStageInfoDO> addShopStageList) {
|
||||
if (CollectionUtils.isEmpty(addShopStageList)) {
|
||||
return 0;
|
||||
}
|
||||
return shopStageInfoMapper.batchInsert(addShopStageList);
|
||||
}
|
||||
|
||||
public Integer insertSelective(ShopStageInfoDO shopStageInfoDO) {
|
||||
if(Objects.isNull(shopStageInfoDO)){
|
||||
if (Objects.isNull(shopStageInfoDO)) {
|
||||
return 0;
|
||||
}
|
||||
return shopStageInfoMapper.insertSelective(shopStageInfoDO);
|
||||
}
|
||||
|
||||
public Integer updateByPrimaryKeySelective(ShopStageInfoDO shopStageInfoDO) {
|
||||
if(Objects.isNull(shopStageInfoDO)){
|
||||
if (Objects.isNull(shopStageInfoDO)) {
|
||||
return 0;
|
||||
}
|
||||
return shopStageInfoMapper.updateByPrimaryKeySelective(shopStageInfoDO);
|
||||
@@ -92,7 +96,7 @@ public class ShopStageInfoDAO {
|
||||
|
||||
|
||||
public Integer batchUpdate(List<ShopStageInfoDO> shopStageList) {
|
||||
if(CollectionUtils.isEmpty(shopStageList)){
|
||||
if (CollectionUtils.isEmpty(shopStageList)) {
|
||||
return 0;
|
||||
}
|
||||
return shopStageInfoMapper.batchUpdate(shopStageList);
|
||||
@@ -104,36 +108,38 @@ public class ShopStageInfoDAO {
|
||||
* @return
|
||||
*/
|
||||
public List<ShopStageInfoDO> getShopStageInfo(Long shopId, Integer shopStage) {
|
||||
if(Objects.isNull(shopId)){
|
||||
if (Objects.isNull(shopId)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return shopStageInfoMapper.getShopStageInfo(shopId, shopStage);
|
||||
}
|
||||
|
||||
public PreparationProcessVO getPreparationProcess(Long shopId) {
|
||||
if(Objects.isNull(shopId)){
|
||||
if (Objects.isNull(shopId)) {
|
||||
return null;
|
||||
}
|
||||
return shopStageInfoMapper.getPreparationProcess(shopId);
|
||||
}
|
||||
|
||||
public Integer getAllCompletionCount(Long shopId) {
|
||||
if(Objects.isNull(shopId)){
|
||||
if (Objects.isNull(shopId)) {
|
||||
return 0;
|
||||
}
|
||||
return shopStageInfoMapper.getAllCompletionCount(shopId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/3
|
||||
* @description:更新完成时间byshopId
|
||||
*/
|
||||
public Integer updateByShopId( ShopStageInfoDO shopStageInfoDO){
|
||||
if (Objects.isNull(shopStageInfoDO)){
|
||||
public Integer updateByShopId(ShopStageInfoDO shopStageInfoDO) {
|
||||
if (Objects.isNull(shopStageInfoDO)) {
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
return shopStageInfoMapper.updateByShopId(shopStageInfoDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子阶段信息
|
||||
* @param shopId
|
||||
@@ -141,17 +147,17 @@ public class ShopStageInfoDAO {
|
||||
* @return
|
||||
*/
|
||||
public ShopStageInfoDO getShopSubStageInfo(Long shopId, ShopSubStageEnum shopSubStageEnum) {
|
||||
if(Objects.isNull(shopId) || Objects.isNull(shopSubStageEnum)){
|
||||
if (Objects.isNull(shopId) || Objects.isNull(shopSubStageEnum)) {
|
||||
return null;
|
||||
}
|
||||
return shopStageInfoMapper.getShopSubStageInfo(shopId, shopSubStageEnum.getShopSubStage());
|
||||
}
|
||||
|
||||
public Integer updateShopStageInfo(Long shopId, ShopSubStageStatusEnum shopStageInfo) {
|
||||
if(Objects.isNull(shopId) || Objects.isNull(shopStageInfo)){
|
||||
if (Objects.isNull(shopId) || Objects.isNull(shopStageInfo)) {
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR +shopStageInfo.getShopSubStageStatusName();
|
||||
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR + shopStageInfo.getShopSubStageStatusName();
|
||||
boolean isTerminated = shopStageInfo.isTerminated();
|
||||
return shopStageInfoMapper.updateShopStageInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark);
|
||||
}
|
||||
@@ -164,10 +170,35 @@ public class ShopStageInfoDAO {
|
||||
* @return
|
||||
*/
|
||||
public Integer batchUpdateShopStageStatus(Long shopId, List<ShopSubStageStatusEnum> subStageStatusList) {
|
||||
if(Objects.isNull(shopId) || CollectionUtils.isEmpty(subStageStatusList)){
|
||||
if (Objects.isNull(shopId) || CollectionUtils.isEmpty(subStageStatusList)) {
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
|
||||
extracted(subStageStatusList, shopId, shopStageList);
|
||||
|
||||
return shopStageInfoMapper.batchUpdateShopStageStatus(shopId, shopStageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量更新店铺状态
|
||||
* @param shopIds
|
||||
* @param subStageStatusList
|
||||
* @return
|
||||
*/
|
||||
public Integer batchUpdateByShopIdsAndSubStageStatus(List<Long> shopIds, List<ShopSubStageStatusEnum> subStageStatusList) {
|
||||
if (CollectionUtils.isEmpty(shopIds) || CollectionUtils.isEmpty(subStageStatusList)) {
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
|
||||
for (Long shopId : shopIds) {
|
||||
extracted(subStageStatusList, shopId, shopStageList);
|
||||
}
|
||||
|
||||
return shopStageInfoMapper.batchUpdateByShopIdsAndSubStageStatus(shopIds, shopStageList);
|
||||
}
|
||||
|
||||
private static void extracted(List<ShopSubStageStatusEnum> subStageStatusList, Long shopId, List<ShopStageInfoDO> shopStageList) {
|
||||
for (ShopSubStageStatusEnum subStageStatus : subStageStatusList) {
|
||||
String remark = subStageStatus.getShopSubStageName() + CommonConstants.PATH_BAR + subStageStatus.getShopSubStageStatusName();
|
||||
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
|
||||
@@ -178,8 +209,6 @@ public class ShopStageInfoDAO {
|
||||
shopStageInfo.setIsTerminated(subStageStatus.isTerminated());
|
||||
shopStageList.add(shopStageInfo);
|
||||
}
|
||||
|
||||
return shopStageInfoMapper.batchUpdateShopStageStatus(shopId, shopStageList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,7 +218,7 @@ public class ShopStageInfoDAO {
|
||||
* @return
|
||||
*/
|
||||
public Integer updateShopStageToNotStarted(Long shopId, ShopSubStageEnum shopSubStageEnum) {
|
||||
if(Objects.isNull(shopId) || Objects.isNull(shopSubStageEnum)){
|
||||
if (Objects.isNull(shopId) || Objects.isNull(shopSubStageEnum)) {
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
return shopStageInfoMapper.updateShopStageToNotStarted(shopId, shopSubStageEnum.getShopSubStage());
|
||||
@@ -202,50 +231,57 @@ public class ShopStageInfoDAO {
|
||||
* @return
|
||||
*/
|
||||
public Integer updateShopStageAndAuditInfo(Long shopId, ShopSubStageStatusEnum shopStageInfo, Long auditId) {
|
||||
if(Objects.isNull(shopId) || Objects.isNull(shopStageInfo)){
|
||||
if (Objects.isNull(shopId) || Objects.isNull(shopStageInfo)) {
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR +shopStageInfo.getShopSubStageStatusName();
|
||||
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR + shopStageInfo.getShopSubStageStatusName();
|
||||
boolean isTerminated = shopStageInfo.isTerminated();
|
||||
return shopStageInfoMapper.updateShopStageAndAuditInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark, auditId);
|
||||
}
|
||||
|
||||
public Page<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNum, Integer pageSize){
|
||||
public Page<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNum, Integer pageSize) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
ShopSubStageStatusEnum shopSubStageStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21;
|
||||
return shopStageInfoMapper.getRentContractToDoPage(userId, shopSubStageStatus.getShopSubStageEnum().getShopSubStage(), shopSubStageStatus.getShopSubStageStatus());
|
||||
}
|
||||
public List<ShopStageInfoDO> getShopIdListByStageStatus(Integer shopSubStageStatus){
|
||||
if (shopSubStageStatus == null ||shopSubStageStatus ==CommonConstants.ZERO){
|
||||
|
||||
public List<ShopStageInfoDO> getShopIdListByStageStatus(Integer shopSubStageStatus) {
|
||||
if (shopSubStageStatus == null || shopSubStageStatus == CommonConstants.ZERO) {
|
||||
return null;
|
||||
}
|
||||
return shopStageInfoMapper.getShopIdListByStageStatus(shopSubStageStatus);
|
||||
return shopStageInfoMapper.getShopIdListByStageStatus(shopSubStageStatus);
|
||||
}
|
||||
|
||||
public List<ScheduleDTO> getScheduleList(List<Long> shopIdList){
|
||||
if (CollectionUtils.isEmpty(shopIdList)){
|
||||
return Collections.emptyList();
|
||||
public List<ScheduleDTO> getScheduleList(List<Long> shopIdList) {
|
||||
if (CollectionUtils.isEmpty(shopIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return shopStageInfoMapper.getScheduleList(shopIdList);
|
||||
}
|
||||
public List<ScheduleDTO> getPlatformBuildList(List<Long> shopIdList){
|
||||
if (CollectionUtils.isEmpty(shopIdList)){
|
||||
public ScheduleDTO getScheduleAll(Long shopId) {
|
||||
if (Objects.isNull(shopId)) {
|
||||
return null;
|
||||
}
|
||||
return shopStageInfoMapper.getScheduleAll(shopId);
|
||||
}
|
||||
public List<ScheduleDTO> getPlatformBuildList(List<Long> shopIdList) {
|
||||
if (CollectionUtils.isEmpty(shopIdList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return shopStageInfoMapper.getPlatformBuildList(shopIdList);
|
||||
}
|
||||
|
||||
public List<ShopStageInfoDO> getShopContractActualCompletionTime(List<Long> shopIdList){
|
||||
if (CollectionUtils.isEmpty(shopIdList)){
|
||||
public List<ShopStageInfoDO> getShopContractActualCompletionTime(List<Long> shopIdList) {
|
||||
if (CollectionUtils.isEmpty(shopIdList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return shopStageInfoMapper.getShopContractActualCompletionTime(shopIdList);
|
||||
}
|
||||
|
||||
|
||||
public List<ShopStageInfoDO> getOpenActivityActualCompletionTime(List<Long> shopIdList){
|
||||
if (CollectionUtils.isEmpty(shopIdList)){
|
||||
return Collections.emptyList();
|
||||
public List<ShopStageInfoDO> getOpenActivityActualCompletionTime(List<Long> shopIdList) {
|
||||
if (CollectionUtils.isEmpty(shopIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return shopStageInfoMapper.getOpenActivityActualCompletionTime(shopIdList);
|
||||
}
|
||||
@@ -256,53 +292,57 @@ public class ShopStageInfoDAO {
|
||||
* @return
|
||||
*/
|
||||
public List<Long> getCanSubmitRentContractShopIds(List<Long> shopIds) {
|
||||
if(CollectionUtils.isEmpty(shopIds)){
|
||||
if (CollectionUtils.isEmpty(shopIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return shopStageInfoMapper.getCanSubmitRentContractShopIds(shopIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/5
|
||||
* @description:获取施工阶段未完成的店铺
|
||||
*/
|
||||
public List<Long> getShopContractIncompletion(){
|
||||
public List<Long> getShopContractIncompletion() {
|
||||
return shopStageInfoMapper.getShopContractIncompletion();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/13
|
||||
* @description:批量更新店铺某一阶段的状态
|
||||
*/
|
||||
public Integer batchUpdateShopStageStatus(List<Long> shopIdList,Integer shopSubStageEnum, Integer shopSubStageStatusEnum) {
|
||||
if (CollectionUtils.isEmpty(shopIdList)){
|
||||
public Integer batchUpdateShopStageStatus(List<Long> shopIdList, Integer shopSubStageEnum, Integer shopSubStageStatusEnum) {
|
||||
if (CollectionUtils.isEmpty(shopIdList)) {
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
return shopStageInfoMapper.batchUpdateStatus(shopIdList,shopSubStageEnum,shopSubStageStatusEnum);
|
||||
return shopStageInfoMapper.batchUpdateStatus(shopIdList, shopSubStageEnum, shopSubStageStatusEnum);
|
||||
}
|
||||
|
||||
public List<ShopStageInfoDO> getSpecialShopStageInfo(List<Long> shopIds, Integer shopSubStage,
|
||||
List<Integer> shopSubStageStatusList,
|
||||
String investmentUserId,
|
||||
List<String> authRegionIds){
|
||||
return shopStageInfoMapper.getSpecialShopStageInfo( shopIds, shopSubStage, shopSubStageStatusList,investmentUserId,authRegionIds);
|
||||
List<String> authRegionIds) {
|
||||
return shopStageInfoMapper.getSpecialShopStageInfo(shopIds, shopSubStage, shopSubStageStatusList, investmentUserId, authRegionIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/9
|
||||
* @description:获取处于XXXX阶段的列表
|
||||
*/
|
||||
public List<ShopStageInfoDO> getSubStageList(List<Long> shopIds, Integer shopSubStage){
|
||||
if(CollectionUtils.isEmpty(shopIds) || shopSubStage == null){
|
||||
public List<ShopStageInfoDO> getSubStageList(List<Long> shopIds, Integer shopSubStage) {
|
||||
if (CollectionUtils.isEmpty(shopIds) || shopSubStage == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return shopStageInfoMapper.getSubStageList(shopIds,shopSubStage);
|
||||
return shopStageInfoMapper.getSubStageList(shopIds, shopSubStage);
|
||||
}
|
||||
public List<ShopStageInfoDO> getSubStages(List<Long> shopIds, Integer shopSubStage){
|
||||
if(CollectionUtils.isEmpty(shopIds) ){
|
||||
|
||||
public List<ShopStageInfoDO> getSubStages(List<Long> shopIds, Integer shopSubStage) {
|
||||
if (CollectionUtils.isEmpty(shopIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return shopStageInfoMapper.getSubStages(shopIds,shopSubStage);
|
||||
return shopStageInfoMapper.getSubStages(shopIds, shopSubStage);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -310,28 +350,30 @@ public class ShopStageInfoDAO {
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
public Integer getNotOpenShopCountByLineId(Long lineId){
|
||||
if(Objects.isNull(lineId)){
|
||||
public Integer getNotOpenShopCountByLineId(Long lineId) {
|
||||
if (Objects.isNull(lineId)) {
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
ShopSubStageEnum shopSubStageEnum = ShopSubStageEnum.SHOP_STAGE_16;
|
||||
return shopStageInfoMapper.getShopCountByLineIdAndStageStatus(lineId, shopSubStageEnum.getShopStageEnum().getShopStage(), shopSubStageEnum.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/11
|
||||
* @description:获取处于a阶段或b阶段,和c阶段的
|
||||
*/
|
||||
public List<ShopStageInfoDO> getSubStageListBySubStageStatus(ShopSubStageStatusEnum a,ShopSubStageStatusEnum b, ShopSubStageStatusEnum c){
|
||||
public List<ShopStageInfoDO> getSubStageListBySubStageStatus(ShopSubStageStatusEnum a, ShopSubStageStatusEnum b, ShopSubStageStatusEnum c) {
|
||||
|
||||
return shopStageInfoMapper.getSubStageListBySubStageStatus(a.getShopSubStageStatus(),b.getShopSubStageStatus(),c.getShopSubStageStatus());
|
||||
return shopStageInfoMapper.getSubStageListBySubStageStatus(a.getShopSubStageStatus(), b.getShopSubStageStatus(), c.getShopSubStageStatus());
|
||||
}
|
||||
|
||||
public ShopStageInfoDO getByShopIdAndSubStage(Long shopId, Integer shopSubStage) {
|
||||
return shopStageInfoMapper.getByShopIdAndSubStage(shopId,shopSubStage);
|
||||
return shopStageInfoMapper.getByShopIdAndSubStage(shopId, shopSubStage);
|
||||
}
|
||||
|
||||
public List<PlatformBuildStageDTO> getPlatformBuildStage(List<Long> shopIds) {
|
||||
if (CollectionUtils.isEmpty(shopIds)){
|
||||
if (CollectionUtils.isEmpty(shopIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return shopStageInfoMapper.getPlatformBuildStage(shopIds);
|
||||
@@ -342,8 +384,32 @@ public class ShopStageInfoDAO {
|
||||
* @param shopSubStage
|
||||
* @return
|
||||
*/
|
||||
public List<ShopStageInfoDO> getSubStages(Integer shopSubStage){
|
||||
return shopStageInfoMapper.getSubStageList(null,shopSubStage);
|
||||
public List<ShopStageInfoDO> getSubStages(Integer shopSubStage) {
|
||||
return shopStageInfoMapper.getSubStageList(null, shopSubStage);
|
||||
}
|
||||
|
||||
//获取新店筹备总阶段总数排除发票回传,flag=0查询全部 =1 查询已完成
|
||||
public Integer allNumber(Long shopId, Integer flag) {
|
||||
return shopStageInfoMapper.getAllNumber(shopId, flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/1/15
|
||||
* @description:批量获取线索下门店的选址未开始的数据
|
||||
*/
|
||||
public List<ShopStageInfoDO> getByLineIdAndSubStage(Long lineId) {
|
||||
if (lineId == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Example example = new Example(ShopStageInfoDO.class);
|
||||
example.createCriteria().andEqualTo("lineId", lineId).andEqualTo("shopSubStage", ShopSubStageEnum.SHOP_STAGE_1.getShopSubStage())
|
||||
.andEqualTo("shopSubStageStatus", ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus());
|
||||
List<ShopStageInfoDO> shopStageInfos = shopStageInfoMapper.selectByExample(example);
|
||||
if (CollectionUtils.isEmpty(shopStageInfos)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return shopStageInfos;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@ public class TransferLogDAO {
|
||||
}
|
||||
|
||||
|
||||
public List<TransferLogDTO> getTransferLogList(Long lindId){
|
||||
public List<TransferLogDTO> getTransferLogList(Long lindId,Integer lineShopType){
|
||||
if (lindId == null){
|
||||
return null;
|
||||
}
|
||||
return transferLogMapper.getTransferLogList(lindId);
|
||||
return transferLogMapper.getTransferLogList(lindId,lineShopType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.FranchiseFeeDTO;
|
||||
import com.cool.store.entity.FranchiseFeeDO;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface FranchiseFeeMapper extends Mapper<FranchiseFeeDO> {
|
||||
FranchiseFeeDO selectByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
List<FranchiseFeeDTO> getPayTimeByShopIds(@Param("shopIds") List<Long> shopIds);
|
||||
Integer updateDataHandleServiceV25();
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +61,8 @@ public interface HyOpenAreaInfoMapper {
|
||||
*/
|
||||
List<HyOpenAreaInfoDO> getChildrenList(@Param("parentId") Long parentId);
|
||||
|
||||
List<Long> getChildrenListByParentIds(@Param("parentIds") List<Long> parentIds);
|
||||
|
||||
Integer getChildrenCount(@Param("type") String type ,
|
||||
@Param("parentId") Long parentId);
|
||||
|
||||
|
||||
@@ -12,5 +12,5 @@ public interface LineFollowLogMapper extends Mapper<LineFollowLogDO> {
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
Page<LineFollowLogDO> getFollowLogPage(@Param("lineId")Long lineId);
|
||||
Page<LineFollowLogDO> getFollowLogPage(@Param("lineId")Long lineId,@Param("type")Integer type);
|
||||
}
|
||||
@@ -4,10 +4,12 @@ import com.cool.store.dto.InvestmentCountDTO;
|
||||
import com.cool.store.dto.PendingCountDTO;
|
||||
import com.cool.store.dto.openPreparation.PlanLineDTO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.request.LineListRequest;
|
||||
import com.cool.store.request.PartnerRequest;
|
||||
import com.cool.store.request.PointLinePageRequest;
|
||||
import com.cool.store.request.PublicLineListRequest;
|
||||
import com.cool.store.vo.LineVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
@@ -125,4 +127,7 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
|
||||
Integer batchUpdateInvestmentManager(@Param("lineIds") List<Long> lineIds,
|
||||
@Param("status") Integer status,
|
||||
@Param("investmentManager") String investmentManager, @Param("regionId") Long regionId);
|
||||
|
||||
List<LineVO> getLinesByKeyword(@Param("keyword") String keyword);
|
||||
|
||||
}
|
||||
@@ -53,11 +53,11 @@ public interface PointInfoMapper extends Mapper<PointInfoDO> {
|
||||
|
||||
/**
|
||||
* 更新铺位的拓展经理
|
||||
* @param lineId
|
||||
* @param shopId
|
||||
* @param developmentManager
|
||||
* @return
|
||||
*/
|
||||
Integer updateSelectedDevelopmentManager(@Param("lineId") Long lineId, @Param("developmentManager")String developmentManager);
|
||||
Integer updateSelectedDevelopmentManager(@Param("shopId") Long shopId, @Param("developmentManager")String developmentManager);
|
||||
|
||||
/**
|
||||
* 获取团队铺位
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.point.LineCountDTO;
|
||||
import com.cool.store.dto.point.MiniPointPageDTO;
|
||||
import com.cool.store.dto.point.ShopCountDTO;
|
||||
import com.cool.store.entity.PointRecommendDO;
|
||||
import com.cool.store.request.MiniPointPageRequest;
|
||||
import com.github.pagehelper.Page;
|
||||
@@ -36,6 +37,13 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
|
||||
*/
|
||||
List<LineCountDTO> getPushShopNumMap(@Param("lineIds") List<Long> lineIds);
|
||||
|
||||
/**
|
||||
* 查询门店推送的铺位数量
|
||||
* @param shopIds
|
||||
* @return
|
||||
*/
|
||||
List<ShopCountDTO> getShopPushPointNumMap(@Param("shopIds") List<Long> shopIds);
|
||||
|
||||
/**
|
||||
* 获取推荐列表
|
||||
* @param lineId
|
||||
@@ -43,6 +51,13 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
|
||||
*/
|
||||
List<PointRecommendDO> getRecommendPointList(@Param("lineId") Long lineId);
|
||||
|
||||
/**
|
||||
* 获取门店推荐列表
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
List<PointRecommendDO> getShopRecommendPointList(@Param("shopId") Long shopId);
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
* @param recommendList
|
||||
@@ -55,7 +70,7 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
Integer turnLineUpdateRecommendStatus(@Param("lineId") Long lineId, @Param("developmentManager")String developmentManager);
|
||||
Integer turnLineUpdateRecommendStatus(@Param("shopId") Long shopId, @Param("developmentManager")String developmentManager);
|
||||
|
||||
/**
|
||||
* 线索获取推荐铺位列表
|
||||
@@ -70,7 +85,7 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
Integer updateStatusByPointIdAndLineId(@Param("pointId") Long pointId, @Param("lineId") Long lineId);
|
||||
Integer updateStatusByPointIdAndLineId(@Param("pointId") Long pointId, @Param("shopId") Long shopId);
|
||||
|
||||
/**
|
||||
* 铺位拒绝
|
||||
@@ -79,7 +94,7 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
|
||||
* @param reason
|
||||
* @return
|
||||
*/
|
||||
Integer rejectPoint(@Param("lineId") Long lineId, @Param("pointId") Long pointId, @Param("reason") String reason);
|
||||
Integer rejectPoint(@Param("shopId") Long shopId, @Param("pointId") Long pointId, @Param("reason") String reason);
|
||||
|
||||
/**
|
||||
* 获取铺位推送过哪些线索
|
||||
@@ -87,4 +102,14 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
|
||||
* @return
|
||||
*/
|
||||
List<PointRecommendDO> getRecommendPointListByPointId(@Param("pointId") Long pointId);
|
||||
|
||||
/**
|
||||
* 数据处理
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
List<PointRecommendDO> getAllRecommendPointList(@Param("lineId") Long lineId);
|
||||
|
||||
Boolean batchUpdateShopId(@Param("recommendList") List<PointRecommendDO> recommendList);
|
||||
|
||||
}
|
||||
@@ -4,9 +4,12 @@ import com.cool.store.dto.LicenseSyncDTO;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||
import com.cool.store.dto.point.LineCountDTO;
|
||||
import com.cool.store.dto.point.ShopPointDTO;
|
||||
import com.cool.store.entity.PointInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.request.BranchShopRequest;
|
||||
import com.cool.store.request.PlanListRequest;
|
||||
import com.cool.store.request.PointLinePageRequest;
|
||||
import com.cool.store.request.PreparationRequest;
|
||||
import com.cool.store.request.platformBuildListRequest;
|
||||
import com.cool.store.response.PlatformBuildListResponse;
|
||||
@@ -36,6 +39,8 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
||||
*/
|
||||
List<ShopInfoDO> getShopList(@Param("lineId") Long lineId);
|
||||
|
||||
List<ShopInfoDO> getShopListByRegion(@Param("lineId") Long lineId,@Param("list") List<Long> regions,@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 店铺信息
|
||||
*
|
||||
@@ -81,6 +86,8 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
||||
|
||||
List<PreparationDTO> ListByCondition(@Param("request") PreparationRequest request);
|
||||
|
||||
List<PreparationDTO> ListByBranchShopRequest(@Param("request") BranchShopRequest request,@Param("userId") String userId);
|
||||
|
||||
Long getRegionIdByid(@Param("shopId") Long shopId);
|
||||
|
||||
ShopInfoDO selectByStoreNum(@Param("storeNum") String storeNum);
|
||||
@@ -98,4 +105,18 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
||||
|
||||
|
||||
List<LicenseSyncDTO> getShopAndStoreList(@Param("enterpriseId") String eid , @Param("shopIds") List<Long> shopIds);
|
||||
|
||||
|
||||
List<ShopPointDTO> getShopPointListByDevelopmentManager(@Param("request") PointLinePageRequest request);
|
||||
|
||||
/**
|
||||
* selectAllDataOrByShopId
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
List<ShopInfoDO> selectAllDataOrByLineId(@Param("lineId") Long lineId);
|
||||
|
||||
Boolean batchUpdate(List<ShopInfoDO> list);
|
||||
|
||||
List<ShopInfoDO> selectInvestmentByList (@Param("list") List<Long> list);
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
|
||||
* @return
|
||||
*/
|
||||
Integer batchUpdateShopStageStatus(@Param("shopId") Long shopId, @Param("updateList") List<ShopStageInfoDO> updateList);
|
||||
Integer batchUpdateByShopIdsAndSubStageStatus(@Param("shopIds") List<Long> shopIds, @Param("updateList") List<ShopStageInfoDO> updateList);
|
||||
|
||||
/**
|
||||
* 更新阶段及审核信息
|
||||
@@ -110,6 +111,9 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
|
||||
List<ShopStageInfoDO> getShopIdListByStageStatus(@Param("shopSubStageStatus") Integer shopSubStageStatus);
|
||||
|
||||
List<ScheduleDTO> getScheduleList(@Param("shopIds") List<Long> shopIds);
|
||||
|
||||
ScheduleDTO getScheduleAll(@Param("shopId") Long shopId);
|
||||
|
||||
List<ScheduleDTO> getPlatformBuildList(@Param("shopIds") List<Long> shopIds);
|
||||
|
||||
List<ShopStageInfoDO> getShopContractActualCompletionTime(@Param("shopIds") List<Long> shopIds);
|
||||
@@ -160,4 +164,6 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
|
||||
@Param("shopSubStage") Integer shopSubStage);
|
||||
|
||||
List<PlatformBuildStageDTO> getPlatformBuildStage( @Param("shopIds") List<Long> shopIds);
|
||||
|
||||
Integer getAllNumber(@Param("shopId") Long shopId,@Param("flag")Integer flag);
|
||||
}
|
||||
|
||||
@@ -4,10 +4,14 @@ import com.cool.store.entity.SignFranchiseDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SignFranchiseMapper extends Mapper<SignFranchiseDO> {
|
||||
|
||||
SignFranchiseDO selectByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
void updateAuditByShopId(@Param("auditId") Long auditId,
|
||||
@Param("shopId") Long shopId);
|
||||
|
||||
List<SignFranchiseDO> selectByShopIds( @Param("list")List<Long> shopIds);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public interface TransferLogMapper extends Mapper<TransferLogDO> {
|
||||
* @param lindId
|
||||
* @return
|
||||
*/
|
||||
List<TransferLogDTO> getTransferLogList(@Param("lindId") Long lindId);
|
||||
List<TransferLogDTO> getTransferLogList(@Param("lindId") Long lindId,@Param("lineShopType")Integer lineShopType);
|
||||
|
||||
|
||||
}
|
||||
@@ -14,4 +14,21 @@
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getPayTimeByShopIds" resultType="com.cool.store.dto.FranchiseFeeDTO">
|
||||
select a.shop_id AS shopId ,
|
||||
b.pay_time as payTime,
|
||||
a.year_franchise_fee as yearFranchiseFee,
|
||||
a.loan_margin as loanMargin,
|
||||
a.first_year_start_time as firstYearStartTime,
|
||||
a.first_year_end_time as firstYearEndTime,
|
||||
a.first_year_fee as firstYearFee,
|
||||
a.performance_bond as performanceBond
|
||||
from xfsg_franchise_fee a
|
||||
LEFT JOIN xfsg_line_pay b ON b.id = a.pay_id
|
||||
where a.shop_id in
|
||||
<foreach collection="shopIds" item="shopId" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -2,28 +2,29 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.HyOpenAreaInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyOpenAreaInfoDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
|
||||
<result column="area_name" jdbcType="VARCHAR" property="areaName" />
|
||||
<result column="area_path" jdbcType="VARCHAR" property="areaPath" />
|
||||
<result column="background_banner" jdbcType="VARCHAR" property="backgroundBanner" />
|
||||
<result column="detail_banner" jdbcType="VARCHAR" property="detailBanner" />
|
||||
<result column="area_status" jdbcType="VARCHAR" property="areaStatus" />
|
||||
<result column="deleted" jdbcType="TINYINT" property="deleted" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="parent_id" jdbcType="BIGINT" property="parentId"/>
|
||||
<result column="area_name" jdbcType="VARCHAR" property="areaName"/>
|
||||
<result column="area_path" jdbcType="VARCHAR" property="areaPath"/>
|
||||
<result column="background_banner" jdbcType="VARCHAR" property="backgroundBanner"/>
|
||||
<result column="detail_banner" jdbcType="VARCHAR" property="detailBanner"/>
|
||||
<result column="area_status" jdbcType="VARCHAR" property="areaStatus"/>
|
||||
<result column="deleted" jdbcType="TINYINT" property="deleted"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, parent_id, area_name, area_path, background_banner, detail_banner, area_status,
|
||||
deleted, create_time, update_time, update_user_id
|
||||
</sql>
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from xfsg_open_area_info where id = #{id}
|
||||
</select>
|
||||
<insert id="insertSelective" parameterType="com.cool.store.entity.HyOpenAreaInfoDO" keyProperty="record.id" useGeneratedKeys="true">
|
||||
<insert id="insertSelective" parameterType="com.cool.store.entity.HyOpenAreaInfoDO" keyProperty="record.id"
|
||||
useGeneratedKeys="true">
|
||||
insert into xfsg_open_area_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="record.id != null">
|
||||
@@ -137,7 +138,6 @@
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<update id="batchUpdateById">
|
||||
update xfsg_open_area_info
|
||||
<set>
|
||||
@@ -164,7 +164,6 @@
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<update id="batchUpdateByParentId">
|
||||
update xfsg_open_area_info
|
||||
<set>
|
||||
@@ -207,7 +206,7 @@
|
||||
xfsg_open_area_info
|
||||
<where>
|
||||
<if test="keyword!=null and keyword!=''">
|
||||
and area_path like concat('%',#{keyword},'%')
|
||||
and area_path like concat('%',#{keyword},'%')
|
||||
</if>
|
||||
<if test="applyFlag!=null and applyFlag==true">
|
||||
and (area_status = 'open' or area_status = 'keyOpen')
|
||||
@@ -239,7 +238,6 @@
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getChildrenList" resultMap="BaseResultMap">
|
||||
select * from
|
||||
xfsg_open_area_info
|
||||
@@ -280,7 +278,9 @@
|
||||
</select>
|
||||
|
||||
<select id="getAllOpenArea" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List"/> from xfsg_open_area_info
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from xfsg_open_area_info
|
||||
</select>
|
||||
|
||||
<select id="filterLeafNode" resultType="long">
|
||||
@@ -289,7 +289,8 @@
|
||||
from
|
||||
xfsg_open_area_info
|
||||
where
|
||||
deleted = '0' and province_city_flag = '0' and id in <foreach collection="openAreaIds" item="openAreaId" separator="," open="(" close=")">#{openAreaId}</foreach>
|
||||
deleted = '0' and province_city_flag = '0' and id in
|
||||
<foreach collection="openAreaIds" item="openAreaId" separator="," open="(" close=")">#{openAreaId}</foreach>
|
||||
</select>
|
||||
<select id="getSonArea" resultType="com.cool.store.entity.HyOpenAreaInfoDO">
|
||||
SELECT
|
||||
@@ -297,15 +298,15 @@
|
||||
FROM xfsg_open_area_info
|
||||
WHERE parent_id = #{id}
|
||||
</select>
|
||||
<select id="getProvinceAllCode" resultMap="BaseResultMap">
|
||||
SELECT b.* FROM `xfsg_open_area_info` a inner join xfsg_open_area_info b on a.`id`=b.`parent_id`
|
||||
WHERE a.parent_id=#{id} ORDER BY b.id desc
|
||||
<select id="getProvinceAllCode" resultMap="BaseResultMap">
|
||||
SELECT b.* FROM `xfsg_open_area_info` a inner join xfsg_open_area_info b on a.`id`=b.`parent_id`
|
||||
WHERE a.parent_id=#{id} ORDER BY b.id desc
|
||||
</select>
|
||||
<select id="selectByAreaPath" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"></include>
|
||||
FROM `xfsg_open_area_info`
|
||||
WHERE area_path= concat('/',#{areaPath},'/') and deleted=0 and province_city_flag=0
|
||||
WHERE area_path= concat('/',#{areaPath},'/') and deleted=0 and province_city_flag=0
|
||||
</select>
|
||||
|
||||
<select id="selectAllCity" resultMap="BaseResultMap">
|
||||
@@ -314,7 +315,15 @@
|
||||
FROM `xfsg_open_area_info`
|
||||
WHERE deleted=0 and province_city_flag = 1 and parent_id is not null
|
||||
</select>
|
||||
<select id="getChildrenListByParentIds" resultType="java.lang.Long">
|
||||
select id from xfsg_open_area_info where 1=1
|
||||
<if test="parentIds!=null and parentIds.size>0">
|
||||
and parent_id in
|
||||
<foreach collection="parentIds" item="parentId" separator="," open="(" close=")">
|
||||
#{parentId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -14,14 +14,15 @@
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="type" jdbcType="TINYINT" property="type"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getFollowLogPage" resultMap="BaseResultMap">
|
||||
select
|
||||
id, partner_id, line_id, operate_user_id, operate_username, workflow_stage, workflow_sub_stage, workflow_sub_stage_status, message, create_time
|
||||
id, partner_id, line_id, operate_user_id, operate_username, workflow_stage, workflow_sub_stage, workflow_sub_stage_status, message, create_time,type
|
||||
from
|
||||
xfsg_line_follow_log
|
||||
where
|
||||
line_id = #{lineId} and deleted = '0' order by create_time desc
|
||||
line_id = #{lineId} and deleted = '0' and type = #{type} order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -588,6 +588,19 @@
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="getLinesByKeyword" resultType="com.cool.store.vo.LineVO">
|
||||
select
|
||||
id as lineId,
|
||||
username,
|
||||
mobile
|
||||
from xfsg_line_info
|
||||
where workflow_sub_stage > 1
|
||||
<if test="keyword !=null and keyword != ''">
|
||||
and (mobile like CONCAT('%', #{keyword} ,'%')
|
||||
or username like CONCAT('%', #{keyword} ,'%'))
|
||||
</if>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
|
||||
<update id="batchUpdateInvestmentManager">
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
set
|
||||
development_manager = #{developmentManager}
|
||||
where
|
||||
line_id = #{lineId} and select_status = '1' and deleted = 0
|
||||
shop_id = #{shopId} and select_status = '1' and deleted = 0
|
||||
</update>
|
||||
|
||||
<select id="getTeamPointPage" resultMap="BaseResultMap">
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointRecommendDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId" />
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
||||
<result column="point_id" jdbcType="BIGINT" property="pointId" />
|
||||
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager" />
|
||||
<result column="status" jdbcType="TINYINT" property="status" />
|
||||
@@ -14,7 +15,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="allColumn">
|
||||
id, line_id, point_id, development_manager, status, reason, deleted, create_time, update_time
|
||||
id, line_id,shop_id, point_id, development_manager, status, reason, deleted, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<update id="updateShopPointRecommendStatus">
|
||||
@@ -48,6 +49,20 @@
|
||||
group by line_id
|
||||
</select>
|
||||
|
||||
<select id="getShopPushPointNumMap" resultType="com.cool.store.dto.point.ShopCountDTO">
|
||||
select
|
||||
shop_id as shopId,
|
||||
count(1) as recommendShopNum
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
deleted = 0 and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
group by shop_id
|
||||
</select>
|
||||
|
||||
<select id="getRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
@@ -62,10 +77,25 @@
|
||||
line_id = #{lineId} and deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getShopRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
point_id,
|
||||
line_id,
|
||||
development_manager,
|
||||
status,
|
||||
reason
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
shop_id = #{shopId} and deleted = 0
|
||||
</select>
|
||||
|
||||
<insert id="batchInsert">
|
||||
<foreach collection="recommendList" item="item" index="index" separator=";">
|
||||
insert into xfsg_point_recommend (line_id, point_id, development_manager, status)
|
||||
values (#{item.lineId}, #{item.pointId}, #{item.developmentManager}, #{item.status})
|
||||
insert into xfsg_point_recommend (shop_id, point_id, development_manager, status)
|
||||
values (#{item.shopId}, #{item.pointId}, #{item.developmentManager}, #{item.status})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@@ -76,7 +106,7 @@
|
||||
deleted = if(status = 1, 1, deleted),
|
||||
development_manager = if(status in (2,4), #{developmentManager}, development_manager)
|
||||
where
|
||||
line_id = #{lineId}
|
||||
shop_id = #{shopId}
|
||||
</update>
|
||||
|
||||
<select id="getLineRecommendPointPage" resultType="com.cool.store.dto.point.MiniPointPageDTO">
|
||||
@@ -96,12 +126,12 @@
|
||||
xfsg_point_recommend pr
|
||||
inner join xfsg_point_info p on p.id = pr.point_id
|
||||
where
|
||||
p.deleted = 0 and pr.line_id = #{request.lineId} and pr.deleted = 0
|
||||
p.deleted = 0 and pr.shop_id = #{request.shopId} and pr.deleted = 0
|
||||
<if test="request.status != null and request.status == 1">
|
||||
and pr.status = 1 and p.select_status = 0
|
||||
</if>
|
||||
<if test="request.status != null and request.status == 2">
|
||||
and pr.status = 2 and p.select_status = 1 and p.line_id = #{request.lineId}
|
||||
and pr.status = 2 and p.select_status = 1 and p.shop_id = #{request.shopId}
|
||||
</if>
|
||||
<if test="request.status != null and request.status == 3">
|
||||
and pr.status in (5, 6)
|
||||
@@ -112,7 +142,7 @@
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
status = if(line_id = #{lineId}, 2, 3)
|
||||
status = if(shop_id = #{shopId}, 2, 3)
|
||||
where point_id = #{pointId} and deleted = 0 and status = 1
|
||||
</update>
|
||||
|
||||
@@ -122,7 +152,7 @@
|
||||
set
|
||||
status = 5,
|
||||
reason = #{reason}
|
||||
where point_id = #{pointId} and line_id = #{lineId} and deleted = 0 and status = 1
|
||||
where point_id = #{pointId} and shop_id = #{shopId} and deleted = 0 and status = 1
|
||||
</update>
|
||||
|
||||
<select id="getRecommendPointListByPointId" resultMap="BaseResultMap">
|
||||
@@ -133,4 +163,34 @@
|
||||
where
|
||||
point_id = #{pointId} and deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="getAllRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_point_recommend
|
||||
<where>
|
||||
and (shop_id = 0 or shop_id is null)
|
||||
<if test="lineId!=null">
|
||||
and line_id = #{lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="batchUpdateShopId">
|
||||
update xfsg_point_recommend
|
||||
set
|
||||
shop_id = case id
|
||||
<foreach collection="recommendList" item="item" index="index" >
|
||||
when #{item.id} then #{item.shopId}
|
||||
</foreach>
|
||||
end
|
||||
where
|
||||
id in
|
||||
<foreach collection="recommendList" item="entity" open="(" separator="," close=")">
|
||||
#{entity.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -1,183 +1,206 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.ShopInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopInfoDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="region_id" jdbcType="BIGINT" property="regionId" />
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId" />
|
||||
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
|
||||
<result column="point_id" jdbcType="BIGINT" property="pointId" />
|
||||
<result column="shop_name" jdbcType="VARCHAR" property="shopName" />
|
||||
<result column="shop_code" jdbcType="VARCHAR" property="shopCode" />
|
||||
<result column="store_num" jdbcType="VARCHAR" property="storeNum" />
|
||||
<result column="shop_manager_user_id" jdbcType="VARCHAR" property="shopManagerUserId" />
|
||||
<result column="supervisor_user_id" jdbcType="VARCHAR" property="supervisorUserId" />
|
||||
<result column="plan_open_time" jdbcType="TIMESTAMP" property="planOpenTime" />
|
||||
<result column="cur_progress" jdbcType="DECIMAL" property="curProgress" />
|
||||
<result column="shop_type" jdbcType="TINYINT" property="shopType" />
|
||||
<result column="shop_stage" jdbcType="TINYINT" property="shopStage" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopInfoDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="region_id" jdbcType="BIGINT" property="regionId"/>
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId"/>
|
||||
<result column="partner_id" jdbcType="VARCHAR" property="partnerId"/>
|
||||
<result column="point_id" jdbcType="BIGINT" property="pointId"/>
|
||||
<result column="shop_name" jdbcType="VARCHAR" property="shopName"/>
|
||||
<result column="shop_code" jdbcType="VARCHAR" property="shopCode"/>
|
||||
<result column="store_num" jdbcType="VARCHAR" property="storeNum"/>
|
||||
<result column="shop_manager_user_id" jdbcType="VARCHAR" property="shopManagerUserId"/>
|
||||
<result column="supervisor_user_id" jdbcType="VARCHAR" property="supervisorUserId"/>
|
||||
<result column="plan_open_time" jdbcType="TIMESTAMP" property="planOpenTime"/>
|
||||
<result column="cur_progress" jdbcType="DECIMAL" property="curProgress"/>
|
||||
<result column="shop_type" jdbcType="TINYINT" property="shopType"/>
|
||||
<result column="shop_stage" jdbcType="TINYINT" property="shopStage"/>
|
||||
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="join_mode" jdbcType="TINYINT" property="joinMode"/>
|
||||
<result column="detail_address" jdbcType="VARCHAR" property="detailAddress"/>
|
||||
<result column="franchise_brand" jdbcType="VARCHAR" property="franchiseBrand"/>
|
||||
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager"/>
|
||||
<result column="want_shop_area_id" jdbcType="BIGINT" property="wantShopAreaId"/>
|
||||
<result column="investment_manager" jdbcType="VARCHAR" property="investmentManager"/>
|
||||
<result column="shop_status" jdbcType="TINYINT" property="shopStatus"/>
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="allColumn">
|
||||
id, region_id, line_id, partner_id, point_id, shop_name, shop_code, store_num, shop_manager_user_id, supervisor_user_id, plan_open_time, cur_progress, shop_type, shop_stage, deleted, create_time, update_time
|
||||
</sql>
|
||||
<sql id="allColumn">
|
||||
id
|
||||
, region_id, line_id, partner_id, point_id, shop_name,
|
||||
shop_code, store_num, shop_manager_user_id, supervisor_user_id,
|
||||
plan_open_time, cur_progress, shop_type, shop_stage, deleted, create_time, update_time,
|
||||
join_mode,detail_address,franchise_brand,development_manager,want_shop_area_id,investment_manager,shop_status,create_user_id,update_user_id
|
||||
</sql>
|
||||
|
||||
<insert id="batchAddShop" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
insert into xfsg_shop_info(region_id, line_id, partner_id, shop_name, store_num,supervisor_user_id) values
|
||||
<foreach collection="shopInfoList" item="shop" separator=",">
|
||||
(#{shop.regionId}, #{shop.lineId}, #{shop.partnerId}, #{shop.shopName}, #{shop.storeNum},#{shop.supervisorUserId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchAddShop" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
insert into xfsg_shop_info(region_id, line_id, partner_id, shop_name, store_num,supervisor_user_id,create_time,join_mode,franchise_brand,
|
||||
development_manager,want_shop_area_id,investment_manager) values
|
||||
<foreach collection="shopInfoList" item="shop" separator=",">
|
||||
(#{shop.regionId}, #{shop.lineId}, #{shop.partnerId}, #{shop.shopName},
|
||||
#{shop.storeNum},#{shop.supervisorUserId},#{shop.createTime},#{shop.joinMode},#{shop.franchiseBrand},#{shop.developmentManager},
|
||||
#{shop.wantShopAreaId},#{shop.investmentManager})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getShopList" resultMap="BaseResultMap">
|
||||
select <include refid="allColumn"/> from xfsg_shop_info where line_id = #{lineId} and deleted= '0'
|
||||
</select>
|
||||
<select id="getShopList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from xfsg_shop_info where line_id = #{lineId} and deleted= '0'
|
||||
</select>
|
||||
|
||||
<select id="getShopInfoByPointId" resultMap="BaseResultMap">
|
||||
select <include refid="allColumn"/> from xfsg_shop_info where point_id = #{pointId} and deleted= '0'
|
||||
</select>
|
||||
<select id="getShopInfoByPointId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from xfsg_shop_info where point_id = #{pointId} and deleted= '0'
|
||||
</select>
|
||||
|
||||
<select id="getStageShopCount" resultType="com.cool.store.vo.shop.StageShopCountVO">
|
||||
select
|
||||
sum(if(shop_stage = 1, 1, 0)) as selectPointCount,
|
||||
sum(if(shop_stage = 2, 1, 0)) as buildShopCount,
|
||||
sum(if(shop_stage = 3, 1, 0)) as openShopCount
|
||||
from
|
||||
xfsg_shop_info
|
||||
where
|
||||
deleted = '0' and line_id = #{lineId}
|
||||
</select>
|
||||
<select id="getStageShopCount" resultType="com.cool.store.vo.shop.StageShopCountVO">
|
||||
select sum(if(shop_stage = 1, 1, 0)) as selectPointCount,
|
||||
sum(if(shop_stage = 2, 1, 0)) as buildShopCount,
|
||||
sum(if(shop_stage = 3, 1, 0)) as openShopCount
|
||||
from xfsg_shop_info
|
||||
where deleted = '0'
|
||||
and line_id = #{lineId}
|
||||
</select>
|
||||
|
||||
<update id="unbindPoint">
|
||||
update xfsg_shop_info set point_id = null where id = #{shopId}
|
||||
</update>
|
||||
<update id="unbindPoint">
|
||||
update xfsg_shop_info
|
||||
set point_id = null
|
||||
where id = #{shopId}
|
||||
</update>
|
||||
|
||||
<select id="getShopListByIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_shop_info where id in
|
||||
<foreach collection="shopIds" item="shopId" separator="," open="(" close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryStoreNumeListByid" resultType="com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO">
|
||||
select id as shopId,store_num as storeNum
|
||||
from xfsg_shop_info
|
||||
where 1=1
|
||||
<if test="shopIdList != null and shopIdList.size >0">
|
||||
and id in
|
||||
<foreach collection="shopIdList" separator="," open="(" close=")" item="shopId">
|
||||
<select id="getShopListByIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_shop_info where id in
|
||||
<foreach collection="shopIds" item="shopId" separator="," open="(" close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</select>
|
||||
|
||||
<select id="getSelectedShopNum" resultType="com.cool.store.dto.point.LineCountDTO">
|
||||
select
|
||||
line_id as lineId,
|
||||
count(1) as selectedShopNum
|
||||
from xfsg_shop_info
|
||||
where deleted = 0 and point_id > 0 and line_id in
|
||||
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
group by line_id
|
||||
</select>
|
||||
|
||||
<select id="ListByCondition" resultType="com.cool.store.dto.Preparation.PreparationDTO">
|
||||
select
|
||||
a.id as id,
|
||||
a.line_id as lineId,
|
||||
a.shop_name as shopName,
|
||||
a.shop_code as shopCode,
|
||||
a.store_num as storeNum,
|
||||
a.shop_manager_user_id as shopManagerUserId,
|
||||
a.supervisor_user_id as supervisorUserId,
|
||||
a.region_id as regionId,
|
||||
b.username as username,
|
||||
b.mobile as mobile,
|
||||
b.investment_manager as investmentManager,
|
||||
DATE_ADD(b.create_time, INTERVAL 50 DAY) as planOpenTime,
|
||||
a.create_time as createTime
|
||||
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
|
||||
where a.deleted = 0
|
||||
<if test="request.keyword != null and request.keyword != ''">
|
||||
and (b.username like concat('%', #{request.keyword}, '%') or b.mobile like concat('%', #{request.keyword}, '%'))
|
||||
</if>
|
||||
<if test="request.shopName!=null and request.shopName!=''">
|
||||
and a.shop_name like concat('%', #{request.shopName}, '%')
|
||||
</if>
|
||||
<if test="request.investmentUserId != null and request.investmentUserId != ''">
|
||||
and b.investment_manager = #{request.investmentUserId}
|
||||
</if>
|
||||
<if test="request.supervisorUserId != null and request.supervisorUserId != ''">
|
||||
and a.supervisor_user_id = #{request.supervisorUserId}
|
||||
</if>
|
||||
<if test="request.planOpenStartTime != null and request.planOpenStartTime != ''">
|
||||
and DATE_ADD(b.create_time, INTERVAL 50 DAY) >= #{request.planOpenStartTime}
|
||||
</if>
|
||||
<if test="request.planOpenEndTime != null and request.planOpenEndTime != ''">
|
||||
<![CDATA[and DATE_ADD(b.create_time, INTERVAL 50 DAY) <= #{request.planOpenEndTime}]]>
|
||||
</if>
|
||||
<if test="request.regionIds != null and request.regionIds.size() > 0">
|
||||
and a.region_id in
|
||||
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
|
||||
and a.region_id in
|
||||
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
order by a.update_time desc
|
||||
</select>
|
||||
<select id="getRegionIdByid" resultType="java.lang.Long">
|
||||
select r.parent_id
|
||||
from xfsg_shop_info xsi
|
||||
join region_${enterpriseId} r on r.id = xsi.region_id
|
||||
where xsi.id = #{shopId}
|
||||
</select>
|
||||
<select id="queryStoreNumeListByid" resultType="com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO">
|
||||
select id as shopId,store_num as storeNum
|
||||
from xfsg_shop_info
|
||||
where 1=1
|
||||
<if test="shopIdList != null and shopIdList.size >0">
|
||||
and id in
|
||||
<foreach collection="shopIdList" separator="," open="(" close=")" item="shopId">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getSelectedShopNum" resultType="com.cool.store.dto.point.LineCountDTO">
|
||||
select
|
||||
line_id as lineId,
|
||||
count(1) as selectedShopNum
|
||||
from xfsg_shop_info
|
||||
where deleted = 0 and point_id > 0 and line_id in
|
||||
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
group by line_id
|
||||
</select>
|
||||
|
||||
<select id="ListByCondition" resultType="com.cool.store.dto.Preparation.PreparationDTO">
|
||||
select
|
||||
a.id as id,
|
||||
a.line_id as lineId,
|
||||
a.shop_name as shopName,
|
||||
a.shop_code as shopCode,
|
||||
a.store_num as storeNum,
|
||||
a.shop_manager_user_id as shopManagerUserId,
|
||||
a.supervisor_user_id as supervisorUserId,
|
||||
a.region_id as regionId,
|
||||
b.username as username,
|
||||
b.mobile as mobile,
|
||||
b.investment_manager as investmentManager,
|
||||
DATE_ADD(b.create_time, INTERVAL 50 DAY) as planOpenTime,
|
||||
a.create_time as createTime
|
||||
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
|
||||
where a.deleted = 0
|
||||
<if test="request.keyword != null and request.keyword != ''">
|
||||
and (b.username like concat('%', #{request.keyword}, '%') or b.mobile like concat('%', #{request.keyword},
|
||||
'%'))
|
||||
</if>
|
||||
<if test="request.shopName!=null and request.shopName!=''">
|
||||
and a.shop_name like concat('%', #{request.shopName}, '%')
|
||||
</if>
|
||||
<if test="request.investmentUserId != null and request.investmentUserId != ''">
|
||||
and b.investment_manager = #{request.investmentUserId}
|
||||
</if>
|
||||
<if test="request.supervisorUserId != null and request.supervisorUserId != ''">
|
||||
and a.supervisor_user_id = #{request.supervisorUserId}
|
||||
</if>
|
||||
<if test="request.planOpenStartTime != null and request.planOpenStartTime != ''">
|
||||
and DATE_ADD(b.create_time, INTERVAL 50 DAY) >= #{request.planOpenStartTime}
|
||||
</if>
|
||||
<if test="request.planOpenEndTime != null and request.planOpenEndTime != ''">
|
||||
<![CDATA[and DATE_ADD(b.create_time, INTERVAL 50 DAY) <= #{request.planOpenEndTime}]]>
|
||||
</if>
|
||||
<if test="request.regionIds != null and request.regionIds.size() > 0">
|
||||
and a.region_id in
|
||||
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
|
||||
and a.region_id in
|
||||
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
order by a.update_time desc
|
||||
</select>
|
||||
<select id="getRegionIdByid" resultType="java.lang.Long">
|
||||
select r.parent_id
|
||||
from xfsg_shop_info xsi
|
||||
join region_${enterpriseId} r on r.id = xsi.region_id
|
||||
where xsi.id = #{shopId}
|
||||
</select>
|
||||
<select id="selectByStoreNum" resultType="com.cool.store.entity.ShopInfoDO">
|
||||
select <include refid="allColumn"/>
|
||||
from xfsg_shop_info
|
||||
where store_num = #{storeNum}
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from xfsg_shop_info
|
||||
where store_num = #{storeNum}
|
||||
</select>
|
||||
<select id="selectShopListByRegionId" resultType="com.cool.store.entity.ShopInfoDO">
|
||||
select
|
||||
xsi.id,xsi.line_id as lineId,xsi.region_id as regionId,xsi.shop_name as shopName,xsi.store_num as storeNum,xsi.shop_code as shopCode
|
||||
from xfsg_shop_info xsi
|
||||
left join xfsg_shop_stage_info xssi on xssi.shop_id = xsi.id
|
||||
where
|
||||
xsi.deleted = 0
|
||||
<if test="regionIds != null and regionIds.size() > 0">
|
||||
and xsi.region_id in
|
||||
<foreach collection="regionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND xssi.shop_sub_stage_status != -100
|
||||
and xssi.shop_sub_stage = #{shopSubStage}
|
||||
<if test="subStageStatus != null and subStageStatus.size()>0">
|
||||
and xssi.shop_sub_stage_status in
|
||||
<foreach collection="subStageStatus" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != '' ">
|
||||
and xsi.shop_name Like concat("%",#{keyWord},"%") or xsi.store_num Like concat("%",#{keyWord},"%")
|
||||
</if>
|
||||
select
|
||||
xsi.id,xsi.line_id as lineId,xsi.region_id as regionId,xsi.shop_name as shopName,xsi.store_num as
|
||||
storeNum,xsi.shop_code as shopCode
|
||||
from xfsg_shop_info xsi
|
||||
left join xfsg_shop_stage_info xssi on xssi.shop_id = xsi.id
|
||||
where
|
||||
xsi.deleted = 0
|
||||
<if test="regionIds != null and regionIds.size() > 0">
|
||||
and xsi.region_id in
|
||||
<foreach collection="regionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND xssi.shop_sub_stage_status != -100
|
||||
and xssi.shop_sub_stage = #{shopSubStage}
|
||||
<if test="subStageStatus != null and subStageStatus.size()>0">
|
||||
and xssi.shop_sub_stage_status in
|
||||
<foreach collection="subStageStatus" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != '' ">
|
||||
and xsi.shop_name Like concat("%",#{keyWord},"%") or xsi.store_num Like concat("%",#{keyWord},"%")
|
||||
</if>
|
||||
</select>
|
||||
<select id="platformBuildList" resultType="com.cool.store.response.PlatformBuildListResponse">
|
||||
select
|
||||
DISTINCT
|
||||
DISTINCT
|
||||
xsi.id as shopId,
|
||||
xsi.shop_name as shopName,
|
||||
xsi.shop_code as shopCode,
|
||||
@@ -213,31 +236,172 @@
|
||||
order by xsi.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectByIdOrSelectAll" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_shop_info
|
||||
<where>
|
||||
<if test="shopId!=null">
|
||||
and id = #{shopId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectByIdOrSelectAll" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_shop_info
|
||||
<where>
|
||||
<if test="shopId!=null">
|
||||
and id = #{shopId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getShopAndStoreList" resultType="com.cool.store.dto.LicenseSyncDTO">
|
||||
<select id="getShopAndStoreList" resultType="com.cool.store.dto.LicenseSyncDTO">
|
||||
select
|
||||
a.id as shopId,
|
||||
a.shop_code as shopCode,
|
||||
b.store_id as storeId
|
||||
from
|
||||
xfsg_shop_info a
|
||||
left join store_${enterpriseId} b on a.shop_code = b.store_num
|
||||
where b.store_id is not null and a.id in
|
||||
<foreach collection="shopIds" item="shopId" separator="," open="(" close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="ListByBranchShopRequest" resultType="com.cool.store.dto.Preparation.PreparationDTO">
|
||||
select
|
||||
a.id as id,
|
||||
a.line_id as lineId,
|
||||
a.shop_name as shopName,
|
||||
a.want_shop_area_id as wantShopAreaId,
|
||||
a.shop_code as shopCode,
|
||||
a.store_num as storeNum,
|
||||
a.shop_manager_user_id as shopManagerUserId,
|
||||
a.supervisor_user_id as supervisorUserId,
|
||||
a.region_id as regionId,
|
||||
b.username as username,
|
||||
b.mobile as mobile,
|
||||
a.investment_manager as investmentManager,
|
||||
DATE_ADD(a.create_time, INTERVAL 50 DAY) as planOpenTime,
|
||||
a.create_time as createTime,
|
||||
a.join_mode as joinMode,
|
||||
a.franchise_brand as franchiseBrand,
|
||||
a.shop_status as shopStatus
|
||||
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
|
||||
where a.deleted = 0
|
||||
<if test="request.partnerKeyword != null and request.partnerKeyword != ''">
|
||||
and (b.username like concat('%', #{request.partnerKeyword}, '%') or b.mobile like concat('%',
|
||||
#{request.partnerKeyword}, '%'))
|
||||
</if>
|
||||
<if test="request.shopKeyword!=null and request.shopKeyword!=''">
|
||||
and (a.shop_name like concat('%',#{request.shopKeyword}, '%') or a.shop_code like concat('%',
|
||||
#{request.shopKeyword}, '%') )
|
||||
</if>
|
||||
<if test="request.regionIds != null and request.regionIds.size() > 0">
|
||||
and a.region_id in
|
||||
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.investmentManagerUserId != null and request.investmentManagerUserId != ''">
|
||||
and a.investment_manager = #{request.investmentManagerUserId}
|
||||
</if>
|
||||
<if test="request.openTimeStart != null ">
|
||||
and DATE_ADD(a.create_time, INTERVAL 50 DAY) >= #{request.openTimeStart}
|
||||
</if>
|
||||
<if test="request.openTimeEnd != null ">
|
||||
<![CDATA[and DATE_ADD(a.create_time, INTERVAL 50 DAY) <= #{request.openTimeEnd}]]>
|
||||
</if>
|
||||
<if test="request.joinMode!=null and request.joinMode.size >0">
|
||||
and a.join_mode in
|
||||
<foreach collection="request.joinMode" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.franchiseBrand!=null and request.franchiseBrand.size>0">
|
||||
and
|
||||
<foreach collection="request.franchiseBrand" item="item" index="index" open="(" separator="or" close=")">
|
||||
FIND_IN_SET(#{item}, a.franchise_brand)>0
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.shopStatus!=null and request.shopStatus.size>0">
|
||||
and a.shop_status in
|
||||
<foreach collection="request.shopStatus" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.wantShopAreaAllIds != null and request.wantShopAreaAllIds.size() > 0">
|
||||
and a.want_shop_area_id in
|
||||
<foreach collection="request.wantShopAreaAllIds" item="wantShopAreaId" index="index" open="(" separator=","
|
||||
close=")">
|
||||
#{wantShopAreaId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.flag == 1">
|
||||
and a.investment_manager = #{userId}
|
||||
</if>
|
||||
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
|
||||
and a.region_id in
|
||||
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
order by a.update_time desc
|
||||
</select>
|
||||
<select id="getShopListByRegion" resultType="com.cool.store.entity.ShopInfoDO">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from xfsg_shop_info where line_id = #{lineId} and deleted= '0'
|
||||
<if test="list!=null and list.size>0">
|
||||
and region_id in
|
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getShopPointListByDevelopmentManager" resultType="com.cool.store.dto.point.ShopPointDTO">
|
||||
select
|
||||
a.id as shopId,
|
||||
a.shop_code as shopCode,
|
||||
b.store_id as storeId
|
||||
from
|
||||
xfsg_shop_info a
|
||||
left join store_${enterpriseId} b on a.shop_code = b.store_num
|
||||
where b.store_id is not null and a.id in
|
||||
<foreach collection="shopIds" item="shopId" separator="," open="(" close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
a.id as shopId,
|
||||
a.point_id as pointId,
|
||||
a.shop_name as shopName,
|
||||
a.want_shop_area_id as wantShopAreaId,
|
||||
b.user_portrait as userPortrait,
|
||||
b.id as lineId,
|
||||
b.username as userName,
|
||||
b.mobile as mobile,
|
||||
b.investment_manager as investmentManager
|
||||
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
|
||||
where a.deleted = 0 and a.development_manager = #{request.developmentManager} and shop_status in (0, 1) and point_id is null
|
||||
<if test="request.keyword != null and request.keyword!=''">
|
||||
and (b.username like concat('%', #{request.keyword}, '%') or b.mobile like concat('%', #{request.keyword}, '%'))
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectAllDataOrByLineId" resultMap="BaseResultMap">
|
||||
select * from xfsg_shop_info
|
||||
<where>
|
||||
<if test="lineId!=null">
|
||||
and line_id = #{lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectInvestmentByList" resultType="com.cool.store.entity.ShopInfoDO">
|
||||
select line_id as LineId,
|
||||
investment_manager as InvestmentManager
|
||||
from xfsg_shop_info
|
||||
where line_id in
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<update id="batchUpdate" parameterType="list">
|
||||
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
||||
UPDATE xfsg_shop_info
|
||||
SET
|
||||
development_manager = #{item.developmentManager},
|
||||
join_mode = #{item.joinMode},
|
||||
shop_status = #{item.shopStatus},
|
||||
franchise_brand = #{item.franchiseBrand},
|
||||
investment_manager = #{item.investmentManager},
|
||||
want_shop_area_id = #{item.wantShopAreaId}
|
||||
WHERE id = #{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,368 +1,412 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.ShopStageInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopStageInfoDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId" />
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
||||
<result column="shop_stage" jdbcType="TINYINT" property="shopStage" />
|
||||
<result column="shop_sub_stage" jdbcType="TINYINT" property="shopSubStage" />
|
||||
<result column="shop_sub_stage_status" jdbcType="TINYINT" property="shopSubStageStatus" />
|
||||
<result column="is_terminated" jdbcType="BIT" property="isTerminated" />
|
||||
<result column="plan_complete_time" jdbcType="VARCHAR" property="planCompleteTime" />
|
||||
<result column="actual_complete_time" jdbcType="VARCHAR" property="actualCompleteTime" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="audit_id" jdbcType="BIGINT" property="auditId" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopStageInfoDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId"/>
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
|
||||
<result column="shop_stage" jdbcType="TINYINT" property="shopStage"/>
|
||||
<result column="shop_sub_stage" jdbcType="TINYINT" property="shopSubStage"/>
|
||||
<result column="shop_sub_stage_status" jdbcType="TINYINT" property="shopSubStageStatus"/>
|
||||
<result column="is_terminated" jdbcType="BIT" property="isTerminated"/>
|
||||
<result column="plan_complete_time" jdbcType="VARCHAR" property="planCompleteTime"/>
|
||||
<result column="actual_complete_time" jdbcType="VARCHAR" property="actualCompleteTime"/>
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
||||
<result column="audit_id" jdbcType="BIGINT" property="auditId"/>
|
||||
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="allColumn">
|
||||
id, line_id, shop_id, shop_stage, shop_sub_stage, shop_sub_stage_status, is_terminated, plan_complete_time, actual_complete_time, remark, audit_id, deleted, create_time, update_time
|
||||
</sql>
|
||||
<sql id="allColumn">
|
||||
id, line_id, shop_id, shop_stage, shop_sub_stage, shop_sub_stage_status, is_terminated, plan_complete_time,
|
||||
actual_complete_time, remark, audit_id, deleted, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<insert id="batchInsert">
|
||||
<foreach collection="addShopStageList" separator=";" item="shop">
|
||||
INSERT INTO xfsg_shop_stage_info(line_id, shop_id, shop_stage, shop_sub_stage, shop_sub_stage_status, is_terminated, plan_complete_time, remark)
|
||||
VALUES(#{shop.lineId}, #{shop.shopId}, #{shop.shopStage}, #{shop.shopSubStage}, #{shop.shopSubStageStatus}, #{shop.isTerminated}, #{shop.planCompleteTime}, #{shop.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert">
|
||||
<foreach collection="addShopStageList" separator=";" item="shop">
|
||||
INSERT INTO xfsg_shop_stage_info(line_id, shop_id, shop_stage, shop_sub_stage, shop_sub_stage_status,
|
||||
is_terminated, plan_complete_time, remark)
|
||||
VALUES(#{shop.lineId}, #{shop.shopId}, #{shop.shopStage}, #{shop.shopSubStage}, #{shop.shopSubStageStatus},
|
||||
#{shop.isTerminated}, #{shop.planCompleteTime}, #{shop.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="batchUpdate">
|
||||
update xfsg_shop_stage_info
|
||||
<set>
|
||||
shop_sub_stage_status = CASE id
|
||||
<foreach collection="addShopStageList" separator=" " item="item">
|
||||
WHEN #{item.id} THEN IFNULL(#{item.shopSubStageStatus},shop_sub_stage_status)
|
||||
</foreach>
|
||||
END
|
||||
</set>
|
||||
where id in (
|
||||
<foreach collection="addShopStageList" item="item" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
<update id="batchUpdate">
|
||||
update xfsg_shop_stage_info
|
||||
<set>
|
||||
shop_sub_stage_status = CASE id
|
||||
<foreach collection="addShopStageList" separator=" " item="item">
|
||||
WHEN #{item.id} THEN IFNULL(#{item.shopSubStageStatus},shop_sub_stage_status)
|
||||
</foreach>
|
||||
END
|
||||
</set>
|
||||
where id in (
|
||||
<foreach collection="addShopStageList" item="item" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
<select id="getShopStageInfo" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_shop_stage_info
|
||||
where
|
||||
shop_id = #{shopId} and deleted = 0
|
||||
<if test="shopStage != null">
|
||||
and shop_stage = #{shopStage}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getPreparationProcess" resultType="com.cool.store.vo.Preparation.PreparationProcessVO">
|
||||
select
|
||||
max(plan_complete_time) as planStartTime,
|
||||
sum(if(is_terminated = 1, 1, 0)) as finishCount
|
||||
from xfsg_shop_stage_info where shop_id = #{shopId}
|
||||
</select>
|
||||
|
||||
<select id="getAllCompletionCount" resultType="java.lang.Integer">
|
||||
select
|
||||
count(1)
|
||||
from
|
||||
xfsg_shop_stage_info
|
||||
where
|
||||
shop_id = #{shopId} and deleted = 0 and is_terminated = 1
|
||||
and shop_sub_stage in (60,40,120,140,150)
|
||||
</select>
|
||||
|
||||
<update id="updateShopStageInfo">
|
||||
update
|
||||
xfsg_shop_stage_info
|
||||
set
|
||||
shop_sub_stage_status = #{shopSubStageStatus},
|
||||
is_terminated = #{isTerminated},
|
||||
remark = #{remark},
|
||||
actual_complete_time = if(is_terminated, now(), null)
|
||||
where
|
||||
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="batchUpdateShopStageStatus">
|
||||
<foreach collection="updateList" separator=";" item="update">
|
||||
update
|
||||
<select id="getShopStageInfo" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_shop_stage_info
|
||||
set
|
||||
shop_sub_stage_status = #{update.shopSubStageStatus},
|
||||
is_terminated = #{update.isTerminated},
|
||||
remark = #{update.remark},
|
||||
where
|
||||
shop_id = #{shopId} and deleted = 0
|
||||
<if test="shopStage != null">
|
||||
and shop_stage = #{shopStage}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getPreparationProcess" resultType="com.cool.store.vo.Preparation.PreparationProcessVO">
|
||||
select
|
||||
max(plan_complete_time) as planStartTime,
|
||||
sum(if(is_terminated = 1, 1, 0)) as finishCount
|
||||
from xfsg_shop_stage_info where shop_id = #{shopId}
|
||||
</select>
|
||||
|
||||
<select id="getAllCompletionCount" resultType="java.lang.Integer">
|
||||
select
|
||||
count(1)
|
||||
from
|
||||
xfsg_shop_stage_info
|
||||
where
|
||||
shop_id = #{shopId} and deleted = 0 and is_terminated = 1
|
||||
and shop_sub_stage in (60,40,120,140,150)
|
||||
</select>
|
||||
|
||||
<update id="updateShopStageInfo">
|
||||
update
|
||||
xfsg_shop_stage_info
|
||||
set
|
||||
shop_sub_stage_status = #{shopSubStageStatus},
|
||||
is_terminated = #{isTerminated},
|
||||
remark = #{remark},
|
||||
actual_complete_time = if(is_terminated, now(), null)
|
||||
where
|
||||
shop_id = #{shopId} and shop_sub_stage = #{update.shopSubStage}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getShopSubStageInfo" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_shop_stage_info
|
||||
where
|
||||
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage} and deleted = 0
|
||||
</select>
|
||||
|
||||
<update id="updateShopStageAndAuditInfo">
|
||||
update
|
||||
xfsg_shop_stage_info
|
||||
set
|
||||
shop_sub_stage_status = #{shopSubStageStatus},
|
||||
is_terminated = #{isTerminated},
|
||||
remark = #{remark},
|
||||
actual_complete_time = if(is_terminated, now(), null),
|
||||
audit_id = #{auditId}
|
||||
where
|
||||
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
|
||||
</update>
|
||||
|
||||
<update id="updateShopStageToNotStarted">
|
||||
update
|
||||
xfsg_shop_stage_info
|
||||
set
|
||||
shop_sub_stage_status = -100,
|
||||
is_terminated = 0,
|
||||
remark = '未开始',
|
||||
actual_complete_time = null,
|
||||
audit_id = null
|
||||
where
|
||||
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
|
||||
</update>
|
||||
<update id="updateByShopId">
|
||||
update xfsg_shop_stage_info
|
||||
<set>
|
||||
<if test="shopStageInfoDO.planCompleteTime">
|
||||
plan_complete_time = #{shopStageInfoDO.planCompleteTime},
|
||||
</if>
|
||||
<if test="shopStageInfoDO.actualCompleteTime">
|
||||
actual_complete_time = #{shopStageInfoDO.actualCompleteTime},
|
||||
</if>
|
||||
</set>
|
||||
where shop_id = #{shopStageInfoDO.shopId} AND shop_sub_stage = #{shopStageInfoDO.shopSubStage}
|
||||
|
||||
</update>
|
||||
<update id="batchUpdateStatus">
|
||||
update xfsg_shop_stage_info
|
||||
<set>
|
||||
|
||||
<if test="shopSubStageStatusEnum !=null">
|
||||
shop_sub_stage_status = #{shopSubStageStatusEnum}
|
||||
</if>
|
||||
</set>
|
||||
where shop_id in
|
||||
<foreach collection="shopIdList" item="shopId" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
<if test="shopSubStageEnum != null">
|
||||
and shop_sub_stage = #{shopSubStageEnum}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<select id="getRentContractToDoPage" resultType="com.cool.store.vo.shop.RentInfoToDoVO">
|
||||
select
|
||||
b.id as lineId,
|
||||
b.username as lineUsername,
|
||||
b.mobile as lineMobile,
|
||||
a.shop_id as shopId,
|
||||
a.shop_sub_stage_status as shopSubStageStatus
|
||||
from
|
||||
xfsg_shop_stage_info a
|
||||
inner join xfsg_line_info b on a.line_id = b.id
|
||||
where
|
||||
a.shop_sub_stage = #{shopSubStage} and a.shop_sub_stage_status = #{shopSubStageStatus} and a.deleted = 0 and b.deleted = 0 and b.development_manager = #{userId}
|
||||
</select>
|
||||
where
|
||||
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getScheduleList" resultType="com.cool.store.dto.Preparation.ScheduleDTO">
|
||||
select
|
||||
shop_id as shopId,
|
||||
max(plan_complete_time) as planCompleteTime,
|
||||
count(1)-1 as totalColumn,
|
||||
sum(if(is_terminated = 1 and shop_sub_stage!=85, 1, 0)) as completionColumn
|
||||
from xfsg_shop_stage_info where shop_stage = 2
|
||||
<if test="shopIds != null and shopIds.size() > 0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
group by shop_id
|
||||
</select>
|
||||
<update id="batchUpdateShopStageStatus">
|
||||
<foreach collection="updateList" separator=";" item="update">
|
||||
update
|
||||
xfsg_shop_stage_info
|
||||
set
|
||||
shop_sub_stage_status = #{update.shopSubStageStatus},
|
||||
is_terminated = #{update.isTerminated},
|
||||
remark = #{update.remark},
|
||||
actual_complete_time = if(is_terminated, now(), null)
|
||||
where
|
||||
shop_id = #{shopId} and shop_sub_stage = #{update.shopSubStage}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getShopSubStageInfo" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_shop_stage_info
|
||||
where
|
||||
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage} and deleted = 0
|
||||
</select>
|
||||
|
||||
<update id="updateShopStageAndAuditInfo">
|
||||
update
|
||||
xfsg_shop_stage_info
|
||||
set
|
||||
shop_sub_stage_status = #{shopSubStageStatus},
|
||||
is_terminated = #{isTerminated},
|
||||
remark = #{remark},
|
||||
actual_complete_time = if(is_terminated, now(), null),
|
||||
audit_id = #{auditId}
|
||||
where
|
||||
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
|
||||
</update>
|
||||
|
||||
<update id="updateShopStageToNotStarted">
|
||||
update
|
||||
xfsg_shop_stage_info
|
||||
set
|
||||
shop_sub_stage_status = -100,
|
||||
is_terminated = 0,
|
||||
remark = '未开始',
|
||||
actual_complete_time = null,
|
||||
audit_id = null
|
||||
where
|
||||
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
|
||||
</update>
|
||||
<update id="updateByShopId">
|
||||
update xfsg_shop_stage_info
|
||||
<set>
|
||||
<if test="shopStageInfoDO.planCompleteTime">
|
||||
plan_complete_time = #{shopStageInfoDO.planCompleteTime},
|
||||
</if>
|
||||
<if test="shopStageInfoDO.actualCompleteTime">
|
||||
actual_complete_time = #{shopStageInfoDO.actualCompleteTime},
|
||||
</if>
|
||||
</set>
|
||||
where shop_id = #{shopStageInfoDO.shopId} AND shop_sub_stage = #{shopStageInfoDO.shopSubStage}
|
||||
|
||||
</update>
|
||||
<update id="batchUpdateStatus">
|
||||
update xfsg_shop_stage_info
|
||||
<set>
|
||||
|
||||
<if test="shopSubStageStatusEnum !=null">
|
||||
shop_sub_stage_status = #{shopSubStageStatusEnum}
|
||||
</if>
|
||||
</set>
|
||||
where shop_id in
|
||||
<foreach collection="shopIdList" item="shopId" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
<if test="shopSubStageEnum != null">
|
||||
and shop_sub_stage = #{shopSubStageEnum}
|
||||
</if>
|
||||
</update>
|
||||
<update id="batchUpdateByShopIdsAndSubStageStatus">
|
||||
<foreach collection="updateList" separator=";" item="update">
|
||||
update
|
||||
xfsg_shop_stage_info
|
||||
set
|
||||
shop_sub_stage_status = #{update.shopSubStageStatus},
|
||||
is_terminated = #{update.isTerminated},
|
||||
remark = #{update.remark},
|
||||
actual_complete_time = if(is_terminated, now(), null)
|
||||
where
|
||||
shop_id in
|
||||
<foreach collection="shopIds" item="shopId" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
and shop_sub_stage = #{update.shopSubStage}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getRentContractToDoPage" resultType="com.cool.store.vo.shop.RentInfoToDoVO">
|
||||
select
|
||||
b.id as lineId,
|
||||
b.username as lineUsername,
|
||||
b.mobile as lineMobile,
|
||||
a.shop_id as shopId,
|
||||
a.shop_sub_stage_status as shopSubStageStatus
|
||||
from
|
||||
xfsg_shop_stage_info a
|
||||
inner join xfsg_line_info b on a.line_id = b.id
|
||||
where
|
||||
a.shop_sub_stage = #{shopSubStage} and a.shop_sub_stage_status = #{shopSubStageStatus} and a.deleted = 0 and
|
||||
b.deleted = 0 and b.development_manager = #{userId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getShopContractActualCompletionTime" resultMap="BaseResultMap">
|
||||
select
|
||||
*
|
||||
from xfsg_shop_stage_info where shop_stage = 1 and shop_sub_stage = 20 and actual_complete_time is not null
|
||||
<if test="shopIds != null and shopIds.size() > 0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getCanSubmitRentContractShopIds" resultType="long">
|
||||
select
|
||||
shop_id
|
||||
from
|
||||
xfsg_shop_stage_info
|
||||
where shop_sub_stage_status in(200, 220) and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="getShopContractIncompletion" resultType="java.lang.Long">
|
||||
SELECT
|
||||
shop_id
|
||||
FROM
|
||||
xfsg_shop_stage_info
|
||||
WHERE
|
||||
shop_sub_stage = 110
|
||||
AND (shop_sub_stage_status = 1100 OR shop_sub_stage_status = 1110)
|
||||
</select>
|
||||
<select id="getScheduleList" resultType="com.cool.store.dto.Preparation.ScheduleDTO">
|
||||
select
|
||||
shop_id as shopId,
|
||||
max(plan_complete_time) as planCompleteTime,
|
||||
count(1)-1 as totalColumn,
|
||||
sum(if(is_terminated = 1 and shop_sub_stage!=85, 1, 0)) as completionColumn
|
||||
from xfsg_shop_stage_info where shop_stage = 2
|
||||
<if test="shopIds != null and shopIds.size() > 0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
group by shop_id
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getSpecialShopStageInfo" resultMap="BaseResultMap">
|
||||
select
|
||||
*
|
||||
from xfsg_shop_stage_info a
|
||||
<if test="investmentUserId!=null and investmentUserId!=''">
|
||||
left join xfsg_line_info b on a.line_id = b.id
|
||||
</if>
|
||||
<if test="authRegionIds != null and authRegionIds.size() > 0">
|
||||
left join xfsg_shop_info si on a.shop_id = si.id
|
||||
</if>
|
||||
<where>
|
||||
<if test="shopIds != null and shopIds.size() > 0">
|
||||
and a.shop_id in
|
||||
<select id="getShopContractActualCompletionTime" resultMap="BaseResultMap">
|
||||
select
|
||||
*
|
||||
from xfsg_shop_stage_info where shop_stage = 1 and shop_sub_stage = 20 and actual_complete_time is not null
|
||||
<if test="shopIds != null and shopIds.size() > 0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getCanSubmitRentContractShopIds" resultType="long">
|
||||
select
|
||||
shop_id
|
||||
from
|
||||
xfsg_shop_stage_info
|
||||
where shop_sub_stage_status in(200, 220) and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="shopSubStage!=null">
|
||||
and a.shop_sub_stage = #{shopSubStage}
|
||||
</if>
|
||||
<if test="shopSubStageStatusList != null and shopSubStageStatusList.size() > 0">
|
||||
and a.shop_sub_stage_status in
|
||||
<foreach collection="shopSubStageStatusList" item="stageStatus" index="index" open="(" separator="," close=")">
|
||||
#{stageStatus}
|
||||
</select>
|
||||
<select id="getShopContractIncompletion" resultType="java.lang.Long">
|
||||
SELECT
|
||||
shop_id
|
||||
FROM
|
||||
xfsg_shop_stage_info
|
||||
WHERE
|
||||
shop_sub_stage = 110
|
||||
AND (shop_sub_stage_status = 1100 OR shop_sub_stage_status = 1110)
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getSpecialShopStageInfo" resultMap="BaseResultMap">
|
||||
select
|
||||
*
|
||||
from xfsg_shop_stage_info a
|
||||
<if test="(authRegionIds != null and authRegionIds.size() > 0) or (investmentUserId != null and investmentUserId != '')">
|
||||
left join xfsg_shop_info si on a.shop_id = si.id
|
||||
</if>
|
||||
<where>
|
||||
<if test="shopIds != null and shopIds.size() > 0">
|
||||
and a.shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="shopSubStage!=null">
|
||||
and a.shop_sub_stage = #{shopSubStage}
|
||||
</if>
|
||||
<if test="shopSubStageStatusList != null and shopSubStageStatusList.size() > 0">
|
||||
and a.shop_sub_stage_status in
|
||||
<foreach collection="shopSubStageStatusList" item="stageStatus" index="index" open="(" separator=","
|
||||
close=")">
|
||||
#{stageStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="investmentUserId!=null and investmentUserId!='' and authRegionIds.size()==0">
|
||||
and si.investment_manager = #{investmentUserId}
|
||||
</if>
|
||||
<if test="authRegionIds != null and authRegionIds.size() > 0">
|
||||
and si.region_id in
|
||||
<foreach collection="authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
<select id="getSubStageList" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
select *
|
||||
from xfsg_shop_stage_info
|
||||
where 1=1
|
||||
<if test="shopIds !=null and shopIds.size()>0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="shopSubStage !=null">
|
||||
and shop_sub_stage =#{shopSubStage}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getShopIdListByStageStatus" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
select *
|
||||
from xfsg_shop_stage_info
|
||||
where shop_sub_stage_status = #{shopSubStageStatus}
|
||||
</select>
|
||||
|
||||
<select id="getShopCountByLineIdAndStageStatus" resultType="integer">
|
||||
select count(1) from xfsg_shop_stage_info where shop_stage = #{shopStage} and shop_sub_stage = #{shopSubStage}
|
||||
and shop_sub_stage_status = #{shopSubStageStatus} and line_id = #{lineId}
|
||||
</select>
|
||||
<select id="getSubStageListBySubStageStatus" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
select *
|
||||
from xfsg_shop_stage_info
|
||||
where 1=1
|
||||
<if test="subStageStatusA !=null">
|
||||
or shop_sub_stage_status = #{subStageStatusA}
|
||||
</if>
|
||||
<if test="subStageStatusB !=null">
|
||||
or shop_sub_stage_status = #{subStageStatusB}
|
||||
</if>
|
||||
<if test="subStageStatusC !=null">
|
||||
and shop_sub_stage_status = #{subStageStatusC}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getByShopIdAndSubStage" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
SELECT
|
||||
<include refid="allColumn"/>
|
||||
FROM xfsg_shop_stage_info
|
||||
WHERE shop_id = #{shopId}
|
||||
AND shop_sub_stage = #{shopSubStage}
|
||||
</select>
|
||||
<select id="getPlatformBuildList" resultType="com.cool.store.dto.Preparation.ScheduleDTO">
|
||||
select
|
||||
shop_id as shopId,
|
||||
count(1) as totalColumn,
|
||||
sum(if(is_terminated = 1, 1, 0)) as completionColumn
|
||||
from xfsg_shop_stage_info where shop_stage = 3
|
||||
<if test="shopIds != null and shopIds.size() > 0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
group by shop_id
|
||||
</select>
|
||||
<select id="getPlatformBuildStage" resultType="com.cool.store.dto.PlatformBuildStageDTO">
|
||||
select shop_id as shopId,
|
||||
shop_sub_stage as shopSubStage,
|
||||
shop_sub_stage_status as shopSubStageStatus
|
||||
from xfsg_shop_stage_info
|
||||
where shop_stage = 3
|
||||
and shop_sub_stage_status != -100
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="investmentUserId!=null and investmentUserId!='' and authRegionIds.size()==0">
|
||||
and b.investment_manager = #{investmentUserId}
|
||||
</if>
|
||||
<if test="authRegionIds != null and authRegionIds.size() > 0">
|
||||
and si.region_id in
|
||||
<foreach collection="authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
<select id="getSubStageList" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
select *
|
||||
from xfsg_shop_stage_info
|
||||
where 1=1
|
||||
<if test="shopIds !=null and shopIds.size()>0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="shopSubStage !=null">
|
||||
and shop_sub_stage =#{shopSubStage}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getShopIdListByStageStatus" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
select *
|
||||
from xfsg_shop_stage_info
|
||||
where shop_sub_stage_status = #{shopSubStageStatus}
|
||||
</select>
|
||||
|
||||
<select id="getShopCountByLineIdAndStageStatus" resultType="integer">
|
||||
select count(1) from xfsg_shop_stage_info where shop_stage = #{shopStage} and shop_sub_stage = #{shopSubStage} and shop_sub_stage_status = #{shopSubStageStatus} and line_id = #{lineId}
|
||||
</select>
|
||||
<select id="getSubStageListBySubStageStatus" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
select *
|
||||
from xfsg_shop_stage_info
|
||||
where 1=1
|
||||
<if test="subStageStatusA !=null">
|
||||
or shop_sub_stage_status = #{subStageStatusA}
|
||||
</if>
|
||||
<if test="subStageStatusB !=null">
|
||||
or shop_sub_stage_status = #{subStageStatusB}
|
||||
</if>
|
||||
<if test="subStageStatusC !=null">
|
||||
and shop_sub_stage_status = #{subStageStatusC}
|
||||
</if>
|
||||
</select>
|
||||
</select>
|
||||
<select id="getSubStages" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
select *
|
||||
from xfsg_shop_stage_info
|
||||
where is_terminated = 1
|
||||
<if test="shopIds !=null and shopIds.size()>0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="shopSubStage !=null">
|
||||
and shop_sub_stage =#{shopSubStage}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getOpenActivityActualCompletionTime" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
select
|
||||
*
|
||||
from xfsg_shop_stage_info where shop_stage = 2 and shop_sub_stage = 140 and actual_complete_time is not null
|
||||
<if test="shopIds != null and shopIds.size() > 0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getAllNumber" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from xfsg_shop_stage_info
|
||||
where shop_stage = 2
|
||||
<if test="flag !=null and flag = 1">
|
||||
and is_terminated =1
|
||||
</if>
|
||||
and shop_sub_stage != 85
|
||||
<if test="shopId !=null">
|
||||
and shop_id = #{shopId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getScheduleAll" resultType="com.cool.store.dto.Preparation.ScheduleDTO">
|
||||
select
|
||||
shop_id as shopId,
|
||||
max(plan_complete_time) as planCompleteTime,
|
||||
count(1)-1 as totalColumn,
|
||||
sum(if(is_terminated = 1 and shop_sub_stage!=85, 1, 0)) as completionColumn
|
||||
from xfsg_shop_stage_info where shop_stage = 2 and
|
||||
shop_id = #{shopId}
|
||||
|
||||
<select id="getByShopIdAndSubStage" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
SELECT <include refid="allColumn"/>
|
||||
FROM xfsg_shop_stage_info
|
||||
WHERE shop_id = #{shopId}
|
||||
AND shop_sub_stage = #{shopSubStage}
|
||||
</select>
|
||||
<select id="getPlatformBuildList" resultType="com.cool.store.dto.Preparation.ScheduleDTO">
|
||||
select
|
||||
shop_id as shopId,
|
||||
count(1) as totalColumn,
|
||||
sum(if(is_terminated = 1, 1, 0)) as completionColumn
|
||||
from xfsg_shop_stage_info where shop_stage = 3
|
||||
<if test="shopIds != null and shopIds.size() > 0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
group by shop_id
|
||||
</select>
|
||||
<select id="getPlatformBuildStage" resultType="com.cool.store.dto.PlatformBuildStageDTO">
|
||||
select shop_id as shopId,
|
||||
shop_sub_stage as shopSubStage,
|
||||
shop_sub_stage_status as shopSubStageStatus
|
||||
from xfsg_shop_stage_info
|
||||
where shop_stage = 3
|
||||
and shop_sub_stage_status != -100
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
<select id="getSubStages" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
select *
|
||||
from xfsg_shop_stage_info
|
||||
where is_terminated = 1
|
||||
<if test="shopIds !=null and shopIds.size()>0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="shopSubStage !=null">
|
||||
and shop_sub_stage =#{shopSubStage}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getOpenActivityActualCompletionTime" resultType="com.cool.store.entity.ShopStageInfoDO">
|
||||
select
|
||||
*
|
||||
from xfsg_shop_stage_info where shop_stage = 2 and shop_sub_stage = 140 and actual_complete_time is not null
|
||||
<if test="shopIds != null and shopIds.size() > 0">
|
||||
and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -13,4 +13,15 @@
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
<select id="selectByShopIds" resultType="com.cool.store.entity.SignFranchiseDO">
|
||||
select contract_code,shop_id,contract_start_time,contract_end_time
|
||||
from xfsg_sign_franchise
|
||||
where 1=1
|
||||
<if test="list !=null and list.size >0">
|
||||
and shop_id in
|
||||
<foreach collection="list" open="(" separator="," close=")" item="item" index="index">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,36 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.TransferLogMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.TransferLogDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId" />
|
||||
<result column="partner_id" jdbcType="BIGINT" property="partnerId" />
|
||||
<result column="from_user_id" jdbcType="VARCHAR" property="fromUserId" />
|
||||
<result column="to_user_id" jdbcType="VARCHAR" property="toUserId" />
|
||||
<result column="type" jdbcType="TINYINT" property="type" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||
</resultMap>
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.TransferLogDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId"/>
|
||||
<result column="partner_id" jdbcType="BIGINT" property="partnerId"/>
|
||||
<result column="from_user_id" jdbcType="VARCHAR" property="fromUserId"/>
|
||||
<result column="to_user_id" jdbcType="VARCHAR" property="toUserId"/>
|
||||
<result column="type" jdbcType="TINYINT" property="type"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
|
||||
<result column="line_shop_type" jdbcType="TINYINT" property="lineShopType"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="getTransferLogList" resultType="com.cool.store.dto.TransferLogDTO">
|
||||
select
|
||||
b.user_id as fromUserId ,
|
||||
b.name as fromUserName ,
|
||||
b.mobile as fromUserMobile ,
|
||||
c.user_id as toUserId ,
|
||||
c.name as toUserName ,
|
||||
c.mobile as toUserMobile ,
|
||||
a.type as type
|
||||
from
|
||||
xfsg_transfer_log a
|
||||
left join enterprise_user_${enterpriseId} b on b.user_id = a.from_user_id
|
||||
left join enterprise_user_${enterpriseId} c on c.user_id = a.to_user_id where a.line_id = #{lindId}
|
||||
</select>
|
||||
<select id="getTransferLogList" resultType="com.cool.store.dto.TransferLogDTO">
|
||||
select b.user_id as fromUserId,
|
||||
b.name as fromUserName,
|
||||
b.mobile as fromUserMobile,
|
||||
c.user_id as toUserId,
|
||||
c.name as toUserName,
|
||||
c.mobile as toUserMobile,
|
||||
a.type as type,
|
||||
a.line_shop_type as lineShopType
|
||||
from xfsg_transfer_log a
|
||||
left join enterprise_user_${enterpriseId} b on b.user_id = a.from_user_id
|
||||
left join enterprise_user_${enterpriseId} c on c.user_id = a.to_user_id
|
||||
where a.line_id = #{lindId} and a.line_shop_type = #{lineShopType}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.cool.store.dto;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/09/下午4:13
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class ExportBranchShopDTO {
|
||||
|
||||
@ExcelProperty(value = "加盟商名称",order = 1)
|
||||
@ColumnWidth(30)
|
||||
private String userName;
|
||||
|
||||
@ExcelProperty(value = "加盟商手机号",order = 2)
|
||||
@ColumnWidth(30)
|
||||
private String mobile;
|
||||
|
||||
@ExcelProperty(value = "门店名称",order = 3)
|
||||
@ColumnWidth(30)
|
||||
private String shopName;
|
||||
|
||||
@ExcelProperty(value = "门店编号",order = 4)
|
||||
@ColumnWidth(30)
|
||||
private String shopCode;
|
||||
|
||||
@ExcelProperty(value = "所属区域/分公司",order = 5)
|
||||
@ColumnWidth(30)
|
||||
private String regionName;
|
||||
|
||||
@ExcelProperty(value = "加盟模式",order = 6)
|
||||
@ColumnWidth(30)
|
||||
private String joinMode;
|
||||
|
||||
@ExcelProperty(value = "所属品牌",order = 6)
|
||||
@ColumnWidth(30)
|
||||
private String franchiseBrand;
|
||||
|
||||
@ExcelProperty(value = "督导",order = 7)
|
||||
@ColumnWidth(30)
|
||||
private String investmentManager;
|
||||
|
||||
@ExcelProperty(value = "合同编号",order = 8)
|
||||
@ColumnWidth(30)
|
||||
private String contractCode;
|
||||
|
||||
@ExcelProperty(value = "第一年加盟开始时间",order = 9)
|
||||
@ColumnWidth(30)
|
||||
private String firstYearStartTime;
|
||||
|
||||
@ExcelProperty(value = "第一年加盟结束时间",order = 10)
|
||||
@ColumnWidth(30)
|
||||
private String firstYearEndTime;
|
||||
|
||||
@ExcelProperty(value = "合同开始时间",order = 11)
|
||||
@ColumnWidth(30)
|
||||
private String contractStartTime;
|
||||
|
||||
@ExcelProperty(value = "合同结束时间",order = 12)
|
||||
@ColumnWidth(30)
|
||||
private String contractEndTime;
|
||||
|
||||
@ExcelProperty(value = "开票时间",order = 13)
|
||||
@ColumnWidth(30)
|
||||
private String invoicingTime;
|
||||
|
||||
@ExcelProperty(value = "币种",order = 14)
|
||||
@ColumnWidth(30)
|
||||
private String currency;
|
||||
|
||||
@ExcelProperty(value = "合计缴费金额(取自账单)",order = 15)
|
||||
@ColumnWidth(30)
|
||||
private String totalAmountContributions;
|
||||
|
||||
@ExcelProperty(value = "加盟费(取自账单)",order = 16)
|
||||
@ColumnWidth(30)
|
||||
private String franchiseFeeBill;
|
||||
|
||||
@ExcelProperty(value = "加盟费(含税金额)",order = 18)
|
||||
@ColumnWidth(30)
|
||||
private String franchiseFeeTax;
|
||||
|
||||
@ExcelProperty(value = "加盟费(不含税金额)",order = 19)
|
||||
@ColumnWidth(30)
|
||||
private String franchiseFee;
|
||||
|
||||
@ExcelProperty(value = "保证金(取自账单)",order = 20)
|
||||
@ColumnWidth(30)
|
||||
private String loanMargin;
|
||||
|
||||
@ExcelProperty(value = "第一年度管理费(取自账单)",order = 21)
|
||||
@ColumnWidth(30)
|
||||
private String firstYearManagementFeeBill;
|
||||
|
||||
@ExcelProperty(value = "第一年度管理费(含税金额)",order = 22)
|
||||
@ColumnWidth(30)
|
||||
private String firstYearManagementFeeTax;
|
||||
|
||||
@ExcelProperty(value = "第一年度管理费(不含税金额)",order = 23)
|
||||
@ColumnWidth(30)
|
||||
private String firstYearManagementFee;
|
||||
|
||||
@ExcelProperty(value = "第一年度品牌费(取自账单)",order = 24)
|
||||
@ColumnWidth(30)
|
||||
private String firstYearBrandingFeeBill;
|
||||
|
||||
@ExcelProperty(value = "第一年度品牌费(含税金额)",order = 25)
|
||||
@ColumnWidth(30)
|
||||
private String firstYearBrandingFeeTax;
|
||||
|
||||
@ExcelProperty(value = "第一年度品牌费(不含税金额)",order = 26)
|
||||
@ColumnWidth(30)
|
||||
private String firstYearBrandingFee;
|
||||
|
||||
@ExcelProperty(value = "设计费(取自账单)",order = 27)
|
||||
@ColumnWidth(30)
|
||||
private String performanceBondBill;
|
||||
|
||||
@ExcelProperty(value = "设计费(含税金额)",order = 28)
|
||||
@ColumnWidth(30)
|
||||
private String designFeeTax;
|
||||
|
||||
@ExcelProperty(value = "设计费(不含税金额)",order = 29)
|
||||
@ColumnWidth(30)
|
||||
private String designFee;
|
||||
|
||||
@ExcelProperty(value = "第1次缴纳时间",order = 30)
|
||||
@ColumnWidth(30)
|
||||
private String firstPayTime;
|
||||
|
||||
@ExcelProperty(value = "第2次缴纳时间",order = 31)
|
||||
@ColumnWidth(30)
|
||||
private String secondPayTime;
|
||||
|
||||
@ExcelProperty(value = "第3次缴纳时间",order = 32)
|
||||
@ColumnWidth(30)
|
||||
private String thirdPayTime;
|
||||
|
||||
@ExcelProperty(value = "第4次缴纳时间",order = 33)
|
||||
@ColumnWidth(30)
|
||||
private String fourthPayTime;
|
||||
|
||||
@ExcelProperty(value = "当前进度",order = 34)
|
||||
@ColumnWidth(30)
|
||||
private String currentProgress;
|
||||
|
||||
@ExcelProperty(value = "状态",order = 35)
|
||||
@ColumnWidth(30)
|
||||
private String shopStatus;
|
||||
|
||||
@ExcelProperty(value = "计划开店时间",order = 36)
|
||||
@ColumnWidth(30)
|
||||
private String planOpenTime;
|
||||
|
||||
@ExcelProperty(value = "开店时长(天)",order =37)
|
||||
@ColumnWidth(30)
|
||||
private String openDuration;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.cool.store.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/02/07/14:34
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class FranchiseFeeDTO {
|
||||
private Long shopId;
|
||||
|
||||
private Date payTime;
|
||||
|
||||
private String yearFranchiseFee;
|
||||
|
||||
private String loanMargin;
|
||||
|
||||
private Date firstYearStartTime;
|
||||
|
||||
private Date firstYearEndTime;
|
||||
|
||||
private String firstYearFee;
|
||||
|
||||
private String performanceBond;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.dto.Preparation;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -14,6 +15,10 @@ public class PreparationDTO {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long wantShopAreaId;
|
||||
|
||||
private Integer shopStatus;
|
||||
|
||||
private Long lineId;
|
||||
|
||||
private String shopName;
|
||||
@@ -37,4 +42,9 @@ public class PreparationDTO {
|
||||
private String supervisorUserId;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String franchiseBrand;
|
||||
|
||||
private Integer joinMode;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -9,19 +10,20 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class TransferLogDTO {
|
||||
|
||||
@ApiModelProperty("操作人id")
|
||||
private String fromUserId;
|
||||
|
||||
@ApiModelProperty("被分配人ID")
|
||||
private String toUserId;
|
||||
|
||||
@ApiModelProperty("操作人")
|
||||
private String fromUserName;
|
||||
|
||||
@ApiModelProperty("被分配人")
|
||||
private String toUserName;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String fromUserMobile;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String toUserMobile;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("'1-线索,2-门店'")
|
||||
private Integer lineShopType;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.cool.store.dto.point;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/1/8 15:41
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ShopCountDTO {
|
||||
|
||||
@ApiModelProperty("门店ID")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("推荐门店数量")
|
||||
private Integer recommendShopNum;
|
||||
|
||||
@ApiModelProperty("选择门店数量")
|
||||
private Integer selectedShopNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.cool.store.dto.point;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/1/8 15:12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ShopPointDTO {
|
||||
|
||||
private Long shopId;
|
||||
|
||||
private Long lineId;
|
||||
|
||||
private Long pointId;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String mobile;
|
||||
|
||||
private String shopName;
|
||||
|
||||
private Long wantShopAreaId;
|
||||
|
||||
private String userPortrait;
|
||||
|
||||
private String investmentManager;
|
||||
|
||||
}
|
||||
@@ -76,10 +76,13 @@ public class LineFollowLogDO {
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
//1-线索日志,2-门店日志
|
||||
private Integer type;
|
||||
|
||||
public LineFollowLogDO() {
|
||||
}
|
||||
|
||||
public LineFollowLogDO(String partnerId, Long lineId, String operateUserId, String operateUsername, Integer workflowStage, Integer workflowSubStage, Integer workflowSubStageStatus, String message) {
|
||||
public LineFollowLogDO(String partnerId, Long lineId, String operateUserId, String operateUsername, Integer workflowStage, Integer workflowSubStage, Integer workflowSubStageStatus, String message,Integer type) {
|
||||
this.partnerId = partnerId;
|
||||
this.lineId = lineId;
|
||||
this.operateUserId = operateUserId;
|
||||
@@ -89,5 +92,6 @@ public class LineFollowLogDO {
|
||||
this.workflowSubStageStatus = workflowSubStageStatus;
|
||||
this.message = message;
|
||||
this.createTime= new Date();
|
||||
this.type=type;
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,9 @@ public class PointRecommendDO {
|
||||
@Column(name = "line_id")
|
||||
private Long lineId;
|
||||
|
||||
@Column(name = "shop_id")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 点位id
|
||||
*/
|
||||
|
||||
@@ -104,11 +104,30 @@ public class ShopInfoDO {
|
||||
*/
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
@Column(name = "create_user_id")
|
||||
private String createUserId;
|
||||
@Column(name = "update_user_id")
|
||||
private String updateUserId;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
@Column(name = "join_mode")
|
||||
private Integer joinMode;
|
||||
|
||||
@Column(name = "franchise_brand")
|
||||
private String franchiseBrand;
|
||||
|
||||
@Column(name = "development_manager")
|
||||
private String developmentManager;
|
||||
@Column(name = "want_shop_area_id")
|
||||
private Long wantShopAreaId;
|
||||
@Column(name = "investment_manager")
|
||||
private String investmentManager;
|
||||
@Column(name = "shop_status")
|
||||
private Integer shopStatus;
|
||||
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ public class TransferLogDO {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
// line_info.id/shop_id',
|
||||
@Column(name = "line_id")
|
||||
private Long lineId;
|
||||
|
||||
@@ -58,6 +58,9 @@ public class TransferLogDO {
|
||||
*/
|
||||
@Column(name = "update_user_id")
|
||||
private String updateUserId;
|
||||
//'1-线索,2-门店'
|
||||
@Column(name = "line_shop_type")
|
||||
private String lineShopType;
|
||||
|
||||
/**
|
||||
* @return id
|
||||
@@ -110,7 +113,6 @@ public class TransferLogDO {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取创建时间
|
||||
*
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.enums.point.ShopStageEnum;
|
||||
import com.cool.store.enums.point.ShopStatusEnum;
|
||||
import com.cool.store.utils.NumberConverter;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/08/下午2:20
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class AddBranchShopRequest {
|
||||
@NotNull
|
||||
private Long lineId;
|
||||
@ApiModelProperty("门店名称")
|
||||
private String shopName;
|
||||
@ApiModelProperty("意向开店区域")
|
||||
@NotNull
|
||||
private Long wantShopAreaId;
|
||||
|
||||
@NotNull
|
||||
@Min(1)
|
||||
@Max(3)
|
||||
@ApiModelProperty(" 加盟模式//'1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店',")
|
||||
private Integer joinMode;
|
||||
@NotBlank
|
||||
@ApiModelProperty("'加盟品牌1,\"正新鸡排\",2,\"正新三明治\",3,\"正烧记\"4,\"大鼓米线\"5,\"串小妹\"6,\"茂掌柜\"'")
|
||||
private String franchiseBrand;
|
||||
@ApiModelProperty("督导")
|
||||
private String investmentManagerUserId;
|
||||
@NotNull
|
||||
@ApiModelProperty("所属大区")
|
||||
private Long regionId;
|
||||
|
||||
public ShopInfoDO toDO(AddBranchShopRequest request, LineInfoDO lineInfo) {
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
shopInfoDO.setLineId(request.getLineId());
|
||||
shopInfoDO.setShopName(StringUtils.isNotBlank(request.getShopName())?request.getShopName():"店铺" + NumberConverter.convertArabicToChinese(lineInfo.getWantShopNum()+1));
|
||||
shopInfoDO.setRegionId(request.getRegionId());
|
||||
shopInfoDO.setShopName(request.getShopName());
|
||||
shopInfoDO.setWantShopAreaId(request.getWantShopAreaId());
|
||||
shopInfoDO.setJoinMode(request.getJoinMode());
|
||||
shopInfoDO.setInvestmentManager(request.getInvestmentManagerUserId());
|
||||
shopInfoDO.setDevelopmentManager(request.getInvestmentManagerUserId());
|
||||
shopInfoDO.setSupervisorUserId(request.getInvestmentManagerUserId());
|
||||
shopInfoDO.setCreateTime(new Date());
|
||||
shopInfoDO.setShopStatus(ShopStatusEnum.ING.getCode());
|
||||
shopInfoDO.setShopStage(ShopStageEnum.SHOP_STAGE_1.getShopStage());
|
||||
shopInfoDO.setPartnerId(lineInfo.getPartnerId());
|
||||
shopInfoDO.setFranchiseBrand(request.getFranchiseBrand());
|
||||
return shopInfoDO;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,8 @@ public class AddShopRequest {
|
||||
@NotEmpty
|
||||
@ApiModelProperty("店铺名称")
|
||||
private List<String> shopNameList;
|
||||
@ApiModelProperty(value = "当前登录用户id",hidden = true)
|
||||
private String userId;
|
||||
|
||||
public AddShopRequest() {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/08/下午4:49
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class BranchShopDetailRequest {
|
||||
@NotNull
|
||||
private Long shopId;
|
||||
@ApiModelProperty("加盟意向区域")
|
||||
private Long wantShopAreaId;
|
||||
@ApiModelProperty("所属区域")
|
||||
private Long regionId;
|
||||
@NotNull
|
||||
@Min(1)
|
||||
@Max(3)
|
||||
@ApiModelProperty("加盟模式 1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店")
|
||||
private Integer joinMode;
|
||||
@NotBlank
|
||||
@ApiModelProperty("加盟品牌")
|
||||
private String franchiseBrand;
|
||||
@ApiModelProperty("门店代码")
|
||||
private String shopCode;
|
||||
@ApiModelProperty("门店名称")
|
||||
private String shopName;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import com.cool.store.common.PageBasicInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/08/下午6:00
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class BranchShopRequest extends PageBasicInfo{
|
||||
@ApiModelProperty("加盟商姓名或手机号")
|
||||
private String partnerKeyword;
|
||||
@ApiModelProperty("门店名称/编号")
|
||||
private String shopKeyword;
|
||||
@ApiModelProperty("所属大区")
|
||||
private List<String> regionIds;
|
||||
@ApiModelProperty("督导userId")
|
||||
private String investmentManagerUserId;
|
||||
@ApiModelProperty("意向开店区域")
|
||||
private List<Long> wantShopAreaId;
|
||||
@ApiModelProperty("加盟模式")
|
||||
private List<Integer> joinMode;
|
||||
@ApiModelProperty("加盟品牌")
|
||||
private List<Integer> franchiseBrand;
|
||||
@ApiModelProperty("开店状态")
|
||||
private List<Integer> shopStatus;
|
||||
@ApiModelProperty("计划开业日期开始")
|
||||
private Date openTimeStart;
|
||||
@ApiModelProperty("计划开业日期结束")
|
||||
private Date openTimeEnd;
|
||||
@ApiModelProperty(value = "管辖区域",hidden = true)
|
||||
private List<String> authRegionIds;
|
||||
@ApiModelProperty(value="意向开店区域+子节点",hidden = true)
|
||||
private List<Long> wantShopAreaAllIds;
|
||||
@ApiModelProperty("1-我负责的,2-我管辖的")
|
||||
@NotNull
|
||||
private Integer flag;
|
||||
|
||||
}
|
||||
@@ -12,10 +12,12 @@ import lombok.Data;
|
||||
@Data
|
||||
public class LineFollowLogRequest {
|
||||
|
||||
@ApiModelProperty("线索id")
|
||||
@ApiModelProperty("线索id/shopId")
|
||||
private Long lineId;
|
||||
|
||||
@ApiModelProperty("日志")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty("1-线索日志,2-门店日志")
|
||||
private Integer type = 1;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ import java.util.stream.Collectors;
|
||||
@Data
|
||||
public class LineRecommendPointRequest {
|
||||
|
||||
@ApiModelProperty("线索id")
|
||||
private Long lineId;
|
||||
@ApiModelProperty("门店ID")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("铺位ids")
|
||||
private List<Long> pointIds;
|
||||
@@ -30,12 +30,12 @@ public class LineRecommendPointRequest {
|
||||
private String developmentManager;
|
||||
|
||||
public List<PointRecommendDO> convertList(){
|
||||
if(Objects.isNull(this.lineId) || CollectionUtils.isEmpty(pointIds)){
|
||||
if(Objects.isNull(this.shopId) || CollectionUtils.isEmpty(pointIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return this.pointIds.stream().map(pointId -> {
|
||||
PointRecommendDO pointRecommendDO = new PointRecommendDO();
|
||||
pointRecommendDO.setLineId(this.lineId);
|
||||
pointRecommendDO.setShopId(this.shopId);
|
||||
pointRecommendDO.setDevelopmentManager(this.developmentManager);
|
||||
pointRecommendDO.setPointId(pointId);
|
||||
pointRecommendDO.setStatus(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode());
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/07/下午2:49
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class LinesRequest {
|
||||
@ApiModelProperty("姓名/手机号")
|
||||
private String keyword;
|
||||
private Integer pageSize = 10;
|
||||
private Integer pageNum = 1;
|
||||
}
|
||||
@@ -21,7 +21,7 @@ public class MiniPointPageRequest extends PageBasicInfo {
|
||||
@ApiModelProperty("1.待选择 2.已选择 3.拒绝/失效")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "线索id")
|
||||
private Long lineId;
|
||||
@ApiModelProperty(value = "门店线索ID")
|
||||
private Long shopId;
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.stream.Collectors;
|
||||
public class PointRecommendLineRequest {
|
||||
|
||||
@ApiModelProperty("线索ids")
|
||||
private List<Long> lineIds;
|
||||
private List<Long> shopIds;
|
||||
|
||||
@ApiModelProperty("铺位id")
|
||||
private Long pointId;
|
||||
@@ -30,12 +30,12 @@ public class PointRecommendLineRequest {
|
||||
private String developmentManager;
|
||||
|
||||
public List<PointRecommendDO> convertList(){
|
||||
if(Objects.isNull(this.lineIds) || CollectionUtils.isEmpty(this.lineIds) || Objects.isNull(pointId)){
|
||||
if(Objects.isNull(this.shopIds) || CollectionUtils.isEmpty(this.shopIds) || Objects.isNull(pointId)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return this.lineIds.stream().map(lineId -> {
|
||||
return this.shopIds.stream().map(shopId -> {
|
||||
PointRecommendDO pointRecommendDO = new PointRecommendDO();
|
||||
pointRecommendDO.setLineId(lineId);
|
||||
pointRecommendDO.setShopId(shopId);
|
||||
pointRecommendDO.setDevelopmentManager(this.developmentManager);
|
||||
pointRecommendDO.setPointId(pointId);
|
||||
pointRecommendDO.setStatus(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode());
|
||||
|
||||
@@ -23,8 +23,8 @@ public class RejectPointRequest {
|
||||
@ApiModelProperty("拒绝原因")
|
||||
private String reason;
|
||||
|
||||
@ApiModelProperty(value = "当前线索id", hidden = true)
|
||||
private Long lineId;
|
||||
@ApiModelProperty(value = "门店Id")
|
||||
private Long shopId;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ import lombok.Data;
|
||||
@Data
|
||||
public class TurnLineRequest {
|
||||
|
||||
@ApiModelProperty("线索id")
|
||||
private Long lineId;
|
||||
@ApiModelProperty("门店ID")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("新的选址人员")
|
||||
private String developmentManager;
|
||||
|
||||
@@ -26,8 +26,8 @@ public class UpdateLineRequest {
|
||||
private Long regionId;
|
||||
@NotNull
|
||||
@Min(1)
|
||||
@Max(2)
|
||||
@ApiModelProperty("加盟模式 1-社会加盟 2-强加盟")
|
||||
@Max(3)
|
||||
@ApiModelProperty("加盟模式 1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店")
|
||||
private Integer joinMode;
|
||||
@NotNull
|
||||
@ApiModelProperty("加盟品牌")
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.cool.store.response;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/08/下午4:11
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class BranchShopDetailResponse {
|
||||
|
||||
@ApiModelProperty("加盟商名称")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("加盟手机号")
|
||||
private String mobile;
|
||||
@ApiModelProperty(" 加盟模式//'1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店'")
|
||||
private Integer joinMode;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("门店编号")
|
||||
private String shopCode;
|
||||
|
||||
@ApiModelProperty("门店名称")
|
||||
private String shopName;
|
||||
|
||||
@ApiModelProperty("总项数")
|
||||
private Integer totalColumn;
|
||||
|
||||
@ApiModelProperty("完成项")
|
||||
private Integer completionColumn;
|
||||
|
||||
@ApiModelProperty("所属品牌 1,\"正新鸡排\",2,\"正新三明治\",3,\"正烧记\"4,\"大鼓米线\"5,\"串小妹\"6,\"茂掌柜\"")
|
||||
private String franchiseBrand;
|
||||
|
||||
@ApiModelProperty("预估完成时间")
|
||||
private Date planCompletionTime;
|
||||
|
||||
@ApiModelProperty("招商经理名称")
|
||||
private String investmentManagerName;
|
||||
|
||||
@ApiModelProperty("招商经理userId")
|
||||
private String investmentManagerId;
|
||||
|
||||
@ApiModelProperty("所属大区name")
|
||||
private String regionName;
|
||||
|
||||
@ApiModelProperty("所属大区id")
|
||||
private Long regionId;
|
||||
|
||||
@ApiModelProperty("意向开店区域")
|
||||
private String wantRegionName;
|
||||
|
||||
@ApiModelProperty("意向开店区域市id")
|
||||
private Long wantRegionId;
|
||||
@ApiModelProperty("意向开店区域省id")
|
||||
private Long wantRegionParentId;
|
||||
|
||||
@ApiModelProperty("门店状态:0.跟进中 1.已完成 2.已放弃")
|
||||
private Integer shopStatus;
|
||||
|
||||
@ApiModelProperty("铺位id")
|
||||
private Long pointId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.cool.store.response;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/08/下午5:46
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class BranchShopResponse {
|
||||
private Long shopId;
|
||||
private Long lineId;
|
||||
@ApiModelProperty("加盟商姓名")
|
||||
private String username;
|
||||
@ApiModelProperty("加盟商手机号")
|
||||
private String mobile;
|
||||
@ApiModelProperty("门店名称")
|
||||
private String shopName;
|
||||
@ApiModelProperty("门店编号")
|
||||
private String shopCode;
|
||||
@ApiModelProperty("所属大区")
|
||||
private String regionName;
|
||||
@ApiModelProperty("所属品牌")
|
||||
private String franchiseBrand;
|
||||
@ApiModelProperty("加盟模式")
|
||||
private Integer joinMode;
|
||||
@ApiModelProperty("意向开店区域")
|
||||
private String wantRegionName;
|
||||
@ApiModelProperty("计划开业时间")
|
||||
private Date planOpenTime;
|
||||
@ApiModelProperty("总项数")
|
||||
private Integer totalColumn;
|
||||
@ApiModelProperty("完成项")
|
||||
private Integer completionColumn;
|
||||
@ApiModelProperty("开店时长")
|
||||
private String days;
|
||||
@ApiModelProperty("督导/招商经理")
|
||||
private String investmentManagerName;
|
||||
@ApiModelProperty("状态")
|
||||
private String shopStatus;
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
@ApiModelProperty("开业活动完成时间")
|
||||
private Date openingActivityEndTime;
|
||||
|
||||
public void setDays() {
|
||||
if (this.openingActivityEndTime==null){
|
||||
long between = ChronoUnit.SECONDS.between(this.createTime.toInstant(), new Date().toInstant());
|
||||
double days = (double) between / (24*60*60);
|
||||
this.days=String.format("%.1f", days);
|
||||
}else{
|
||||
long between = ChronoUnit.SECONDS.between(this.createTime.toInstant(), this.openingActivityEndTime.toInstant());
|
||||
double days = (double) between / (24*60*60);
|
||||
this.days = String.format("%.1f", days);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/07/下午2:31
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class LineVO {
|
||||
private Long lineId;
|
||||
@ApiModelProperty("加盟商名字")
|
||||
private String username;
|
||||
@ApiModelProperty("手机号")
|
||||
private String mobile;
|
||||
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class MiniPointPageVO {
|
||||
@ApiModelProperty("1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效")
|
||||
private Integer recommendStatus;
|
||||
|
||||
public static List<MiniPointPageVO> convertVO(List<MiniPointPageDTO> pointList, Map<Long, String> regionNameMap, Long curLineId) {
|
||||
public static List<MiniPointPageVO> convertVO(List<MiniPointPageDTO> pointList, Map<Long, String> regionNameMap) {
|
||||
if(CollectionUtils.isEmpty(pointList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.cool.store.vo.shop;
|
||||
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.entity.ShopStageInfoDO;
|
||||
import com.cool.store.enums.FranchiseBrandEnum;
|
||||
import com.cool.store.enums.JoinModeEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -36,8 +40,29 @@ public class MiniShopPageVO {
|
||||
private Long regionId;
|
||||
@ApiModelProperty("门店所属区域name")
|
||||
private String regionName;
|
||||
@ApiModelProperty("督导name")
|
||||
private String investmentName;
|
||||
@ApiModelProperty("督导userId")
|
||||
private String investmentUserId;
|
||||
|
||||
public MiniShopPageVO(Long shopId, String shopName,String shopCode,Boolean flag,Long pointId,Long regionId,String regionName) {
|
||||
@ApiModelProperty("预估完成时间")
|
||||
private Date planCompletionTime;
|
||||
|
||||
@ApiModelProperty("总项数")
|
||||
private Integer totalColumn;
|
||||
|
||||
@ApiModelProperty("完成项")
|
||||
private Integer completionColumn;
|
||||
|
||||
@ApiModelProperty("所属品牌")
|
||||
private String franchiseBrand;
|
||||
@ApiModelProperty("加盟模式")
|
||||
private String joinMode;
|
||||
@ApiModelProperty("意向开店区域")
|
||||
private String wantRegionName;
|
||||
@ApiModelProperty("门店状态'0.跟进中 1.已完成 2.已放弃',")
|
||||
private Integer shopStatus;
|
||||
public MiniShopPageVO(Long shopId, String shopName, String shopCode, Boolean flag, Long pointId, Long regionId, String regionName) {
|
||||
this.shopId = shopId;
|
||||
this.shopName = shopName;
|
||||
this.shopCode = shopCode;
|
||||
@@ -47,7 +72,7 @@ public class MiniShopPageVO {
|
||||
this.regionName = regionName;
|
||||
}
|
||||
|
||||
public static List<MiniShopPageVO> convertList(List<ShopInfoDO> shopInfoList, Map<Long, ShopStageInfoDO> stageMap, Map<Long, String> regionNameMap ) {
|
||||
public static List<MiniShopPageVO> convertList(List<ShopInfoDO> shopInfoList, Map<Long, ShopStageInfoDO> stageMap, Map<Long, String> regionNameMap, Map<Long, ScheduleDTO> scheduleMap, Map<Long, String> wantRegionMap, Map<String, EnterpriseUserDO> userInfoMap) {
|
||||
List<MiniShopPageVO> resultList = new ArrayList<>();
|
||||
for (ShopInfoDO shopInfo : shopInfoList) {
|
||||
ShopStageInfoDO stageInfoDO = stageMap.get(shopInfo.getId());
|
||||
@@ -57,10 +82,27 @@ public class MiniShopPageVO {
|
||||
flag = Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
if(Objects.isNull(regionNameMap)){
|
||||
if (Objects.isNull(regionNameMap)) {
|
||||
regionNameMap = new HashMap<>();
|
||||
}
|
||||
resultList.add(new MiniShopPageVO(shopInfo.getId(), shopInfo.getShopName(),shopInfo.getShopCode(),flag,shopInfo.getPointId(),shopInfo.getRegionId(), regionNameMap.getOrDefault(shopInfo.getRegionId(),"")));
|
||||
MiniShopPageVO miniShopPageVO = new MiniShopPageVO(shopInfo.getId(), shopInfo.getShopName(), shopInfo.getShopCode(), flag, shopInfo.getPointId(), shopInfo.getRegionId(), regionNameMap.getOrDefault(shopInfo.getRegionId(), ""));
|
||||
miniShopPageVO.setInvestmentUserId(shopInfo.getInvestmentManager());
|
||||
if (userInfoMap!=null){
|
||||
miniShopPageVO.setInvestmentName(userInfoMap.getOrDefault(shopInfo.getInvestmentManager(),new EnterpriseUserDO()).getName());
|
||||
}
|
||||
if (scheduleMap != null) {
|
||||
miniShopPageVO.setTotalColumn(scheduleMap.getOrDefault(shopInfo.getId(),new ScheduleDTO()).getTotalColumn());
|
||||
miniShopPageVO.setCompletionColumn(scheduleMap.getOrDefault(shopInfo.getId(),new ScheduleDTO()).getCompletionColumn());
|
||||
miniShopPageVO.setPlanCompletionTime(scheduleMap.getOrDefault(shopInfo.getId(),new ScheduleDTO()).getPlanCompleteTime());
|
||||
}
|
||||
miniShopPageVO.setFranchiseBrand(shopInfo.getFranchiseBrand());
|
||||
miniShopPageVO.setJoinMode(JoinModeEnum.getByCode(shopInfo.getJoinMode()));
|
||||
if (Objects.nonNull(wantRegionMap)) {
|
||||
miniShopPageVO.setWantRegionName(wantRegionMap.get(shopInfo.getWantShopAreaId()));
|
||||
}
|
||||
miniShopPageVO.setShopStatus(shopInfo.getShopStatus());
|
||||
resultList.add(miniShopPageVO);
|
||||
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.cool.store.vo.shop;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.point.ShopPointDTO;
|
||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.vo.LinePointBaseInfoVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/1/8 14:59
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ShopPointBaseInfoVO {
|
||||
|
||||
@ApiModelProperty("门店ID")
|
||||
private Long shopId;
|
||||
|
||||
private String partnerName;
|
||||
|
||||
@ApiModelProperty("门店名称")
|
||||
private String shopName;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("区域名称")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty("区域路径")
|
||||
private String areaPath;
|
||||
|
||||
@ApiModelProperty("用户标签")
|
||||
private List<String> userPortraitList;
|
||||
|
||||
@ApiModelProperty("招商经理")
|
||||
private String investmentManagerUsername;
|
||||
|
||||
@ApiModelProperty("已推门店")
|
||||
private Integer recommendShopNum;
|
||||
|
||||
@ApiModelProperty("已选门店")
|
||||
private Integer selectedShopNum;
|
||||
|
||||
public ShopPointBaseInfoVO(Long shopId, String shopName, String mobile) {
|
||||
this.shopId = shopId;
|
||||
this.shopName = shopName;
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public static List<ShopPointBaseInfoVO> convertList(Map<Long, String> partnerNameMap,List<ShopPointDTO> lineList, Map<String, String> userNameMap, Map<Long, String> userPortraitMap, Map<Long, HyOpenAreaInfoDO> cityMap, Map<Long, Integer> recommendShopNumMap){
|
||||
List<ShopPointBaseInfoVO> resultList = new ArrayList<>();
|
||||
for (ShopPointDTO shopPointDTO : lineList) {
|
||||
ShopPointBaseInfoVO shopPointBaseInfoVO = new ShopPointBaseInfoVO(shopPointDTO.getShopId(), shopPointDTO.getShopName(), shopPointDTO.getMobile());
|
||||
String username = userNameMap.get(shopPointDTO.getInvestmentManager());
|
||||
shopPointBaseInfoVO.setInvestmentManagerUsername(username);
|
||||
shopPointBaseInfoVO.setPartnerName(partnerNameMap.get(shopPointDTO.getLineId()));
|
||||
HyOpenAreaInfoDO areaInfo = cityMap.get(shopPointDTO.getWantShopAreaId());
|
||||
if(Objects.nonNull(areaInfo)){
|
||||
shopPointBaseInfoVO.setAreaName(areaInfo.getAreaName());
|
||||
shopPointBaseInfoVO.setAreaPath(areaInfo.getAreaPath().replace("/", "").trim());
|
||||
}
|
||||
shopPointBaseInfoVO.setRecommendShopNum(recommendShopNumMap.get(shopPointDTO.getShopId()));
|
||||
shopPointBaseInfoVO.setSelectedShopNum((shopPointDTO.getPointId()!=null&&shopPointDTO.getPointId()> CommonConstants.ZERO)?CommonConstants.ONE:CommonConstants.ZERO);
|
||||
if(StringUtils.isNotBlank(shopPointDTO.getUserPortrait())){
|
||||
List<String> userPortraitList = new ArrayList<>();
|
||||
String[] parts = shopPointDTO.getUserPortrait().split(",");
|
||||
for (String part : parts) {
|
||||
String trimmedPart = part.trim();
|
||||
if (StringUtils.isNotBlank(trimmedPart)) {
|
||||
String s = userPortraitMap.get(Long.valueOf(part));
|
||||
if(StringUtils.isNotBlank(s)){
|
||||
userPortraitList.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
shopPointBaseInfoVO.setUserPortraitList(userPortraitList);
|
||||
}
|
||||
resultList.add(shopPointBaseInfoVO);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
public static ShopPointBaseInfoVO convert(LineInfoDO lineInfo, String username, Map<Long, String> userPortraitMap, HyOpenAreaInfoDO cityArea, Map<Long, Integer> recommendShopNumMap, Map<Long, Integer> selectedShopNumMap){
|
||||
ShopPointBaseInfoVO linePointBaseInfo = new ShopPointBaseInfoVO(lineInfo.getId(), lineInfo.getUsername(), lineInfo.getMobile());
|
||||
linePointBaseInfo.setInvestmentManagerUsername(username);
|
||||
if(Objects.nonNull(cityArea)){
|
||||
linePointBaseInfo.setAreaName(cityArea.getAreaName());
|
||||
linePointBaseInfo.setAreaPath(cityArea.getAreaPath().replace("/", "").trim());
|
||||
}
|
||||
linePointBaseInfo.setRecommendShopNum(recommendShopNumMap.get(lineInfo.getId()));
|
||||
linePointBaseInfo.setSelectedShopNum(selectedShopNumMap.get(lineInfo.getId()));
|
||||
if(StringUtils.isNotBlank(lineInfo.getUserPortrait())){
|
||||
List<String> userPortraitList = new ArrayList<>();
|
||||
String[] parts = lineInfo.getUserPortrait().split(",");
|
||||
for (String part : parts) {
|
||||
String trimmedPart = part.trim();
|
||||
if (StringUtils.isNotBlank(trimmedPart)) {
|
||||
String s = userPortraitMap.get(Long.valueOf(part));
|
||||
if(StringUtils.isNotBlank(s)){
|
||||
userPortraitList.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
linePointBaseInfo.setUserPortraitList(userPortraitList);
|
||||
}
|
||||
return linePointBaseInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -29,32 +29,6 @@ public interface DeskService {
|
||||
*/
|
||||
PageInfo<IntendPendingVO> intendPendingList(Integer pageNum, Integer pageSize,String userId);
|
||||
|
||||
/**
|
||||
* 面试待处理
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
PageInfo<InterviewPendingVO> interviewPendingList(Integer pageNum, Integer pageSize,String userId);
|
||||
|
||||
/**
|
||||
* 一审面试待处理
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
PageInfo<InterviewPendingVO> firstInterviewPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
|
||||
|
||||
/**
|
||||
* 二审面试待处理
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
PageInfo<InterviewPendingVO> secondInterviewPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
|
||||
|
||||
/**
|
||||
* payStagePendingList
|
||||
@@ -75,14 +49,6 @@ public interface DeskService {
|
||||
*/
|
||||
PageInfo<SigningPendingVO> signingPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
|
||||
|
||||
/**
|
||||
* storeExperiencePendingList
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
PageInfo<StoreExperiencePendingVO> storeExperiencePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
|
||||
|
||||
/**
|
||||
* convertToBaseInfoVO
|
||||
@@ -110,14 +76,6 @@ public interface DeskService {
|
||||
InvestmentCountDTO getInvestmentCount(LoginUserInfo user);
|
||||
|
||||
|
||||
/**
|
||||
* 系统建店待处理数据
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PreparationCommonPendingVO> systemBuildStorePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
|
||||
/**
|
||||
* 缴纳加盟费待处理数据
|
||||
* @param pageNum
|
||||
@@ -152,15 +110,14 @@ public interface DeskService {
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PreparationCommonPendingVO> openingAndOperationPlanPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
|
||||
|
||||
/**
|
||||
* 首批订货清单待处理数据
|
||||
* 培训清单待处理数据
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PreparationCommonPendingVO> firstOrderListPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
|
||||
|
||||
PageInfo<PreparationCommonPendingVO> trainListPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
|
||||
/**
|
||||
* 信发系统
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.entity.ImportTaskDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.PointInfoDO;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,5 +16,6 @@ import java.util.List;
|
||||
*/
|
||||
public interface ExportRealizeService {
|
||||
|
||||
void preparationList( List<PreparationDTO> preparationDTOS,ImportTaskDO importTaskDO);
|
||||
|
||||
void branchShopList(List<BranchShopResponse> list,ImportTaskDO importTaskDO);
|
||||
}
|
||||
|
||||
@@ -10,5 +10,6 @@ import com.cool.store.request.*;
|
||||
* @注释:
|
||||
*/
|
||||
public interface ExportService {
|
||||
Integer preparationList(PreparationRequest request,LoginUserInfo loginUserInfo);
|
||||
|
||||
Long branchShopList(BranchShopRequest request,LoginUserInfo user);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public interface LineFollowService {
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
PageInfo<LineFollowLogVO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize);
|
||||
PageInfo<LineFollowLogVO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize,Integer type);
|
||||
|
||||
/**
|
||||
* 新增跟进日志
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.cool.store.request.*;
|
||||
import com.cool.store.vo.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/3/25 13:45
|
||||
@@ -97,5 +99,7 @@ public interface LineService {
|
||||
|
||||
String getPayPicByLineId(Long lineId);
|
||||
|
||||
//增加查询资质审核的意向加盟商或正式加盟商搜索范围为全部
|
||||
PageInfo<LineVO> getLines(LinesRequest request);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.cool.store.request.*;
|
||||
import com.cool.store.vo.LinePointBaseInfoVO;
|
||||
import com.cool.store.vo.point.*;
|
||||
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||
import com.cool.store.vo.shop.ShopPointBaseInfoVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
@@ -124,6 +125,8 @@ public interface PointService {
|
||||
*/
|
||||
PageInfo<LinePointBaseInfoVO> getLinePage(PointLinePageRequest request);
|
||||
|
||||
PageInfo<ShopPointBaseInfoVO> getShopPage(PointLinePageRequest request);
|
||||
|
||||
|
||||
/**
|
||||
* 获取单个加盟商信息
|
||||
@@ -167,6 +170,13 @@ public interface PointService {
|
||||
*/
|
||||
List<PointRecommendPageVO> getLineRecommendPointList(Long lineId);
|
||||
|
||||
/**
|
||||
* 获取门店推荐列表
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
List<PointRecommendPageVO> getShopRecommendPointList(Long shopId);
|
||||
|
||||
/**
|
||||
* 获取我的可推荐铺位列表
|
||||
* @param request
|
||||
@@ -284,4 +294,11 @@ public interface PointService {
|
||||
* @return
|
||||
*/
|
||||
PageInfo<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNumber, Integer pageSize);
|
||||
|
||||
|
||||
/**
|
||||
* 数据处理 V2.4
|
||||
* @return
|
||||
*/
|
||||
Boolean linePointToShopPoint(Long lineId);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.cool.store.vo.Preparation.PreparationScheduleVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -19,7 +20,7 @@ public interface PreparationService {
|
||||
/**
|
||||
* 开业进度列表
|
||||
* @param preparationRequest
|
||||
* @return
|
||||
* @return //原先进度管理接口废弃,使用branchShopList
|
||||
*/
|
||||
PageInfo<PreparationScheduleVO> getPreparationSchedule(PreparationRequest preparationRequest);
|
||||
|
||||
@@ -66,5 +67,13 @@ public interface PreparationService {
|
||||
*/
|
||||
Boolean decorationFlush(Long shopId);
|
||||
|
||||
//阶段完成奢shop_status=1已完成
|
||||
void updateShopStatus(Long shopId);
|
||||
|
||||
/**
|
||||
* 获取店铺状态
|
||||
* @param shopIds
|
||||
* @return
|
||||
*/
|
||||
Map<Long,Integer> getShopStatus(List<Long> shopIds);
|
||||
}
|
||||
|
||||
@@ -2,15 +2,13 @@ package com.cool.store.service;
|
||||
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.request.AddShopRequest;
|
||||
import com.cool.store.request.DeleteShopRequest;
|
||||
import com.cool.store.request.UpdateShopCodeRequest;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.BranchShopDetailResponse;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.vo.shop.MiniShopPageVO;
|
||||
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||
import com.cool.store.vo.shop.ShopStageInfoVO;
|
||||
import com.cool.store.vo.shop.StageShopCountVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -34,7 +32,7 @@ public interface ShopService {
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
List<MiniShopPageVO> getShopList(Long lineId);
|
||||
List<MiniShopPageVO> getShopList(Long lineId,String userId);
|
||||
|
||||
/**
|
||||
* 获取店铺阶段信息
|
||||
@@ -70,5 +68,39 @@ public interface ShopService {
|
||||
*/
|
||||
ShopInfoDO getShopInfo(Long shopId);
|
||||
|
||||
Integer updateShopCode(UpdateShopCodeRequest request);
|
||||
Integer updateShopCode(UpdateShopCodeRequest request,String userId);
|
||||
|
||||
/**
|
||||
* 新建分店
|
||||
*/
|
||||
Long addBranchShop(AddBranchShopRequest request,String userId);
|
||||
|
||||
/**
|
||||
* 开店详情/左边小窗
|
||||
*/
|
||||
BranchShopDetailResponse getBranchShopDetail(Long shopId);
|
||||
/**
|
||||
* 修改开店详情/左边小窗
|
||||
*/
|
||||
Integer updateBranchShopDetail(BranchShopDetailRequest request,String userId);
|
||||
/**
|
||||
* 修改门店招商专员/督导
|
||||
*/
|
||||
Integer updateShopInvestment(Long shopId,String updateUserId,String userId);
|
||||
|
||||
|
||||
/**
|
||||
* 门店结束跟进
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
Boolean shopClose(Long shopId);
|
||||
|
||||
|
||||
/**
|
||||
* 分店列表
|
||||
*/
|
||||
PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId);
|
||||
|
||||
Boolean dataHandler(Long shopId);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.TransferLogDTO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.enums.OperationLogTypeEnum;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
@@ -14,13 +15,14 @@ public interface TransferLogService {
|
||||
|
||||
/**
|
||||
* 添加日志 操作日志类型
|
||||
* @param lineInfoDO
|
||||
* @param id 线索ID 或者 门店ID 如果是线索ID 则表示线索转让记录 如果是门店ID 则表示门店转移记录
|
||||
* @param partnerId
|
||||
* @param formUserId
|
||||
* @param toUserId
|
||||
* @param operationLogTypeEnum
|
||||
*/
|
||||
void addLog(LineInfoDO lineInfoDO, String formUserId, String toUserId, OperationLogTypeEnum operationLogTypeEnum);
|
||||
void addLog(Long id ,String partnerId, String formUserId, String toUserId, OperationLogTypeEnum operationLogTypeEnum);
|
||||
|
||||
|
||||
PageInfo<TransferLogDTO> getTransferLogPage(Integer pageNum, Integer pageSize, Long lineId);
|
||||
PageInfo<TransferLogDTO> getTransferLogPage(Integer pageNum, Integer pageSize, Long lineId,Integer lineShopType);
|
||||
}
|
||||
|
||||
@@ -124,6 +124,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
if (Constants.ONE_INTEGER.equals(request.getSubmitStatus()) && shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30.getShopSubStageStatus())) {
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33, null);
|
||||
preparationService.licenseCompleted(request.getShopId());
|
||||
preparationService.updateShopStatus(request.getShopId());
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
@@ -155,6 +156,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
if (Constants.ONE_INTEGER.equals(request.getSubmitStatus()) && shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_40.getShopSubStageStatus())) {
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_43, null);
|
||||
preparationService.licenseCompleted(request.getShopId());
|
||||
preparationService.updateShopStatus(request.getShopId());
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ public class AuditOpeningOperationPlanImpl implements AuditOpeningOperationPlanS
|
||||
}
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(),
|
||||
shopSubStageStatusEnum, auditId);
|
||||
preparationService.updateShopStatus(request.getShopId());
|
||||
if (flag){
|
||||
preparationService.whetherToOpenForAcceptance(request.getShopId());
|
||||
}
|
||||
|
||||
@@ -617,6 +617,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean confirmDesign(DecorationDesignRequest request, LoginUserInfo user) {
|
||||
//重复提交校验 3秒内不能重复提交
|
||||
String lockKey = "confirmDesign:" + request.getShopId();
|
||||
@@ -637,6 +638,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean confirmComplete(Long shopId, LoginUserInfo user) {
|
||||
//判断施工阶段是否时施工中 施工中才能施工完成
|
||||
ShopStageInfoDO shopStageInfoDO = shopStageInfoDAO.getByShopIdAndSubStage(shopId, ShopSubStageEnum.SHOP_STAGE_11.getShopSubStage());
|
||||
@@ -681,6 +683,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
&& CommonConstants.ONE == partner.getResult()) {
|
||||
//更新阶段状态验收完毕
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123, null);
|
||||
preparationService.updateShopStatus(request.getShopId());
|
||||
} else {
|
||||
//未通过至为待验收
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121, null);
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.cool.store.dto.PendingCountDTO;
|
||||
import com.cool.store.dto.DeskStageDTO;
|
||||
import com.cool.store.dto.openPreparation.PlanLineDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.UserRoleEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageStatusEnum;
|
||||
import com.cool.store.enums.point.PayBusinessTypeEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
@@ -104,98 +105,6 @@ public class DeskServiceImpl implements DeskService {
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<InterviewPendingVO> interviewPendingList(Integer pageNum, Integer pageSize, String userId) {
|
||||
// PageHelper.startPage(pageNum, pageSize);
|
||||
// List<LineInfoDO> lineInfoDOS = lineInfoDAO.listByInvestmentManager(userId,Arrays.asList(WorkflowSubStageStatusEnum.INVITING_INTERVIEWS_20.getCode()));
|
||||
// PageInfo page = new PageInfo(lineInfoDOS);
|
||||
// Map<Long, HyPartnerLabelDO> userPortraitMap = this.getUserPortraitMap(lineInfoDOS);
|
||||
// List<Long> wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
||||
// Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
|
||||
// List<Long> lineIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getId() != null).map(LineInfoDO::getId).collect(Collectors.toList());
|
||||
// List<LineInterviewDO> interviewByLindIds = lineInterviewDAO.getInterviewByLindIds(lineIds, InterviewTypeEnum.MEET);
|
||||
// Map<Long, LineInterviewDO> interviewDOMap = interviewByLindIds.stream().collect(Collectors.toMap(LineInterviewDO::getLineId, x -> x, (k1, k2) -> k1));
|
||||
//
|
||||
// List<InterviewPendingVO> list = new ArrayList<>();
|
||||
// lineInfoDOS.forEach(x->{
|
||||
// BaseInfoVO baseInfoVO = convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
|
||||
// InterviewPendingVO interviewPendingVO = new InterviewPendingVO(baseInfoVO);
|
||||
// LineInterviewDO lineInterviewDO = interviewDOMap.get(x.getId());
|
||||
// if (lineInterviewDO != null){
|
||||
// interviewPendingVO.setStartTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START,lineInterviewDO.getStartTime()));
|
||||
// interviewPendingVO.setEndTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_END,lineInterviewDO.getEndTime()));
|
||||
// }
|
||||
// list.add(interviewPendingVO);
|
||||
// });
|
||||
// page.setList(list);
|
||||
return new PageInfo<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<InterviewPendingVO> firstInterviewPendingList(Integer pageNum, Integer pageSize, LoginUserInfo userInfo) {
|
||||
// PageHelper.startPage(pageNum, pageSize);
|
||||
// List<LineInfoDO> lineInfoDOS = lineInfoDAO.listByInterview(userInfo.getUserId(),InterviewTypeEnum.INTERVIEW.getCode(),
|
||||
// Arrays.asList(WorkflowSubStageStatusEnum.FIRST_INTERVIEWS_30.getCode(),WorkflowSubStageStatusEnum.FIRST_INTERVIEWS_35.getCode()),WorkflowSubStageStatusEnum.FIRST_INTERVIEWS_40.getCode(),null);
|
||||
// PageInfo page = new PageInfo(lineInfoDOS);
|
||||
// Map<Long, HyPartnerLabelDO> userPortraitMap = this.getUserPortraitMap(lineInfoDOS);
|
||||
// List<Long> wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
||||
// Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
|
||||
// List<Long> lineIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getId() != null).map(LineInfoDO::getId).collect(Collectors.toList());
|
||||
// List<LineInterviewDO> interviewByLindIds = lineInterviewDAO.getInterviewByLindIds(lineIds, InterviewTypeEnum.INTERVIEW);
|
||||
// Map<Long, LineInterviewDO> interviewDOMap = interviewByLindIds.stream().collect(Collectors.toMap(LineInterviewDO::getLineId, x -> x, (k1, k2) -> k1));
|
||||
// List<String> userIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getFirstInterviewer() != null).map(LineInfoDO::getFirstInterviewer).collect(Collectors.toList());
|
||||
// Map<String, EnterpriseUserDO> userInfoMap = enterpriseUserDAO.getUserInfoMap(userIds);
|
||||
//
|
||||
// List<InterviewPendingVO> list = new ArrayList<>();
|
||||
// lineInfoDOS.forEach(x->{
|
||||
// BaseInfoVO baseInfoVO = convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
|
||||
// InterviewPendingVO interviewPendingVO = new InterviewPendingVO(baseInfoVO);
|
||||
// LineInterviewDO lineInterviewDO = interviewDOMap.get(x.getId());
|
||||
// if (lineInterviewDO != null){
|
||||
// interviewPendingVO.setStartTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START,lineInterviewDO.getStartTime()));
|
||||
// interviewPendingVO.setEndTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_END,lineInterviewDO.getEndTime()));
|
||||
// interviewPendingVO.setInterviewer(userInfoMap.getOrDefault(x.getFirstInterviewer(),new EnterpriseUserDO()).getName());
|
||||
// interviewPendingVO.setInterviewId(lineInterviewDO.getId());
|
||||
// }
|
||||
// list.add(interviewPendingVO);
|
||||
// });
|
||||
// page.setList(list);
|
||||
return new PageInfo<>();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<InterviewPendingVO> secondInterviewPendingList(Integer pageNum, Integer pageSize, LoginUserInfo userInfo) {
|
||||
// PageHelper.startPage(pageNum, pageSize);
|
||||
// List<LineInfoDO> lineInfoDOS = lineInfoDAO.listByInterview(userInfo.getUserId(),InterviewTypeEnum.SECOND_INTERVIEW.getCode(),
|
||||
// Arrays.asList(WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_105.getCode(),WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_110.getCode()), WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_115.getCode(),null);
|
||||
// PageInfo page = new PageInfo(lineInfoDOS);
|
||||
// Map<Long, HyPartnerLabelDO> userPortraitMap = this.getUserPortraitMap(lineInfoDOS);
|
||||
// List<Long> wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
||||
// Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
|
||||
// List<Long> lineIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getId() != null).map(LineInfoDO::getId).collect(Collectors.toList());
|
||||
// List<LineInterviewDO> interviewByLindIds = lineInterviewDAO.getInterviewByLindIds(lineIds, InterviewTypeEnum.SECOND_INTERVIEW);
|
||||
// Map<Long, LineInterviewDO> interviewDOMap = interviewByLindIds.stream().collect(Collectors.toMap(LineInterviewDO::getLineId, x -> x, (k1, k2) -> k1));
|
||||
// List<String> userIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getSecondInterviewer() != null).map(LineInfoDO::getSecondInterviewer).collect(Collectors.toList());
|
||||
// Map<String, EnterpriseUserDO> userInfoMap = enterpriseUserDAO.getUserInfoMap(userIds);
|
||||
//
|
||||
//
|
||||
// List<InterviewPendingVO> list = new ArrayList<>();
|
||||
// lineInfoDOS.forEach(x->{
|
||||
// BaseInfoVO baseInfoVO = convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
|
||||
// InterviewPendingVO interviewPendingVO = new InterviewPendingVO(baseInfoVO);
|
||||
// LineInterviewDO lineInterviewDO = interviewDOMap.get(x.getId());
|
||||
// if (lineInterviewDO != null){
|
||||
// interviewPendingVO.setStartTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START,lineInterviewDO.getStartTime()));
|
||||
// interviewPendingVO.setEndTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_END,lineInterviewDO.getEndTime()));
|
||||
// interviewPendingVO.setInterviewer(userInfoMap.getOrDefault(x.getSecondInterviewer(),new EnterpriseUserDO()).getName());
|
||||
// interviewPendingVO.setInterviewId(lineInterviewDO.getId());
|
||||
// }
|
||||
// list.add(interviewPendingVO);
|
||||
// });
|
||||
// page.setList(list);
|
||||
return new PageInfo<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PayStagePendingVO> payStagePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
@@ -248,38 +157,6 @@ public class DeskServiceImpl implements DeskService {
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<StoreExperiencePendingVO> storeExperiencePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
// PageHelper.startPage(pageNum, pageSize);
|
||||
// List<LineInfoDO> lineInfoDOS = lineInfoDAO.listByInvestmentManager(user.getUserId(),
|
||||
// Arrays.asList(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_85.getCode(),
|
||||
// WorkflowSubStageStatusEnum.STORE_EXPERIENCE_95.getCode()));
|
||||
// PageInfo page = new PageInfo(lineInfoDOS);
|
||||
// Map<Long, HyPartnerLabelDO> userPortraitMap = this.getUserPortraitMap(lineInfoDOS);
|
||||
// List<Long> wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
||||
// Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
|
||||
// List<Long> lineIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getId() != null).map(LineInfoDO::getId).collect(Collectors.toList());
|
||||
// Map<Long, LeaseBaseInfoDO> infoDOMap = new HashMap<>();
|
||||
// if (CollectionUtils.isNotEmpty(lineIds)){
|
||||
// List<LeaseBaseInfoDO> leaseBaseInfoDOS = trainingExperienceMapper.selectByLineIds(lineIds);
|
||||
// infoDOMap = leaseBaseInfoDOS.stream().collect(Collectors.toMap(LeaseBaseInfoDO::getLineId, x -> x));
|
||||
// }
|
||||
// List<StoreExperiencePendingVO> list = new ArrayList<>();
|
||||
// Map<Long, LeaseBaseInfoDO> finalInfoDOMap = infoDOMap;
|
||||
// lineInfoDOS.forEach(x->{
|
||||
// BaseInfoVO baseInfoVO = convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
|
||||
// StoreExperiencePendingVO storeExperiencePendingVO = new StoreExperiencePendingVO(baseInfoVO);
|
||||
// LeaseBaseInfoDO date = finalInfoDOMap.get(x.getId());
|
||||
// if (date != null && date.getExperienceStartTime() != null && date.getExperienceEndTime() != null){
|
||||
// storeExperiencePendingVO.setExperienceStartTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1,date.getExperienceStartTime()));
|
||||
// storeExperiencePendingVO.setExperienceEndTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_2,date.getExperienceEndTime()));
|
||||
// }
|
||||
// list.add(storeExperiencePendingVO);
|
||||
// });
|
||||
// page.setList(list);
|
||||
return new PageInfo<>();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* convertToBaseInfoVO
|
||||
@@ -347,21 +224,56 @@ public class DeskServiceImpl implements DeskService {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> systemBuildStorePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> payFranchiseFeesPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_7,
|
||||
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus()), Boolean.FALSE);
|
||||
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
||||
PageInfo<PreparationCommonPendingVO> pageInfo = new PageInfo<>();
|
||||
if (CollectionUtils.isNotEmpty(userRoleIds)
|
||||
&& (userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())
|
||||
||userRoleIds.contains(UserRoleEnum.INVESTMENT_COMMISSIONER.getCode())
|
||||
||userRoleIds.contains(UserRoleEnum.STRONG_INVESTMENT_COMMISSIONER.getCode()))){
|
||||
pageInfo = commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_7,
|
||||
Collections.singletonList(SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus()), Boolean.FALSE);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(userRoleIds)&& userRoleIds.contains(UserRoleEnum.BRANCH_OFFICE.getCode())){
|
||||
pageInfo = commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_7,
|
||||
Collections.singletonList(SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus()), Boolean.TRUE);
|
||||
}
|
||||
|
||||
|
||||
List<PreparationCommonPendingVO> list = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return pageInfo;
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, LinePayDO> shopPayDoMap = linePayDAO.getLinePayByShopIds(shopIds, PayBusinessTypeEnum.FRANCHISE_FEE.getCode());
|
||||
for (PreparationCommonPendingVO vo:list){
|
||||
vo.setSubmitTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START, shopPayDoMap.getOrDefault(vo.getShopId(), new LinePayDO()).getCreateTime()));
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> signingOfFranchiseContractPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_8,
|
||||
PageInfo<PreparationCommonPendingVO> pageInfo = commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_8,
|
||||
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_80.getShopSubStageStatus(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_85.getShopSubStageStatus()), Boolean.TRUE);
|
||||
|
||||
List<PreparationCommonPendingVO> list = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return pageInfo;
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_7.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (PreparationCommonPendingVO vo :list){
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -375,61 +287,183 @@ public class DeskServiceImpl implements DeskService {
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_14, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_140.getShopSubStageStatus()), Boolean.FALSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> firstOrderListPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> trainListPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_5,
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_5,
|
||||
Collections.singletonList(SHOP_SUB_STAGE_STATUS_50.getShopSubStageStatus()), Boolean.TRUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> xinFaListPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, null, ShopSubStageEnum.SHOP_STAGE_23,
|
||||
PageInfo<PreparationCommonPendingVO> pageInfo = commonPendingVOPageInfo(pageNum, pageSize, null, ShopSubStageEnum.SHOP_STAGE_23,
|
||||
Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_230.getShopSubStageStatus()), Boolean.FALSE);
|
||||
List<PreparationCommonPendingVO> list = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return pageInfo;
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (PreparationCommonPendingVO vo :list){
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> posListPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, null, ShopSubStageEnum.SHOP_STAGE_16,
|
||||
|
||||
PageInfo<PreparationCommonPendingVO> pageInfo = commonPendingVOPageInfo(pageNum, pageSize, null, ShopSubStageEnum.SHOP_STAGE_16,
|
||||
Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_160.getShopSubStageStatus()), Boolean.FALSE);
|
||||
List<PreparationCommonPendingVO> list = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return pageInfo;
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (PreparationCommonPendingVO vo :list){
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> tentPassListPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, null, ShopSubStageEnum.SHOP_STAGE_24,
|
||||
|
||||
PageInfo<PreparationCommonPendingVO> pageInfo = commonPendingVOPageInfo(pageNum, pageSize, null, ShopSubStageEnum.SHOP_STAGE_24,
|
||||
Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_240.getShopSubStageStatus()), Boolean.FALSE);
|
||||
List<PreparationCommonPendingVO> list = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return pageInfo;
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (PreparationCommonPendingVO vo :list){
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> orderSysPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, null, ShopSubStageEnum.SHOP_STAGE_17,
|
||||
PageInfo<PreparationCommonPendingVO> pageInfo = commonPendingVOPageInfo(pageNum, pageSize, null, ShopSubStageEnum.SHOP_STAGE_17,
|
||||
Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_170.getShopSubStageStatus()), Boolean.FALSE);
|
||||
List<PreparationCommonPendingVO> list = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return pageInfo;
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (PreparationCommonPendingVO vo :list){
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> designPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_9,
|
||||
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus()), Boolean.TRUE);
|
||||
PageInfo<PreparationCommonPendingVO> pageInfo = commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_9,
|
||||
Arrays.asList(SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus()), Boolean.TRUE);
|
||||
List<PreparationCommonPendingVO> list = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return pageInfo;
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (PreparationCommonPendingVO vo :list){
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> constructionPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_11,
|
||||
PageInfo<PreparationCommonPendingVO> pageInfo =commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_11,
|
||||
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_110.getShopSubStageStatus(),
|
||||
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_111.getShopSubStageStatus()), Boolean.TRUE);
|
||||
List<PreparationCommonPendingVO> list = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return pageInfo;
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
List<DecorationDesignInfoDO> decorationDesignInfos = decorationDesignInfoDAO.getByIds(shopIds);
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (DecorationDesignInfoDO decorationDesignInfoDO : decorationDesignInfos) {
|
||||
List<DeskStageDTO> deskStages = new ArrayList<>();
|
||||
deskStages.addAll(deskStageMap.get(decorationDesignInfoDO.getShopId()));
|
||||
if (CollectionUtils.isEmpty(deskStages)) {
|
||||
DeskStageDTO dto = new DeskStageDTO();
|
||||
dto.setActualCompleteTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START, decorationDesignInfoDO.getCreateTime()));
|
||||
dto.setShopSubStageStatus(SHOP_SUB_STAGE_STATUS_111.getShopSubStageStatus());
|
||||
deskStageMap.put(decorationDesignInfoDO.getShopId(), Collections.singletonList(dto));
|
||||
} else {
|
||||
DeskStageDTO dto = new DeskStageDTO();
|
||||
dto.setActualCompleteTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START, decorationDesignInfoDO.getCreateTime()));
|
||||
dto.setShopSubStageStatus(SHOP_SUB_STAGE_STATUS_111.getShopSubStageStatus());
|
||||
deskStages.add(dto);
|
||||
deskStageMap.put(decorationDesignInfoDO.getShopId(), deskStages);
|
||||
}
|
||||
}
|
||||
for (PreparationCommonPendingVO vo :list){
|
||||
for (DeskStageDTO deskStageDTO : deskStageMap.get(vo.getShopId())) {
|
||||
if (vo.getSubStageStatus().equals(deskStageDTO.getShopSubStageStatus())) {
|
||||
vo.setSubmitTime(deskStageDTO.getActualCompleteTime());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> fitmentPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_12,
|
||||
|
||||
PageInfo<PreparationCommonPendingVO> pageInfo = commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_12,
|
||||
Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122.getShopSubStageStatus()), Boolean.FALSE);
|
||||
List<PreparationCommonPendingVO> list = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return pageInfo;
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<AcceptanceInfoDO> acceptanceInfoDOList = acceptanceInfoDAO.selectByShopIds(shopIds);
|
||||
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceInfoDOList) {
|
||||
DeskStageDTO dto = new DeskStageDTO();
|
||||
dto.setActualCompleteTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START, acceptanceInfoDO.getCreateTime()));
|
||||
dto.setShopSubStageStatus(SHOP_SUB_STAGE_STATUS_122.getShopSubStageStatus());
|
||||
deskStageMap.put(acceptanceInfoDO.getShopId(), Collections.singletonList(dto));
|
||||
}
|
||||
for (PreparationCommonPendingVO vo :list){
|
||||
for (DeskStageDTO deskStageDTO : deskStageMap.get(vo.getShopId())) {
|
||||
if (vo.getSubStageStatus().equals(deskStageDTO.getShopSubStageStatus())) {
|
||||
vo.setSubmitTime(deskStageDTO.getActualCompleteTime());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -499,53 +533,7 @@ public class DeskServiceImpl implements DeskService {
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||
|
||||
|
||||
Map<Long, LinePayDO> shopPayDoMap = new HashMap<>(16);
|
||||
if (ShopSubStageEnum.SHOP_STAGE_7.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())) {
|
||||
shopPayDoMap = linePayDAO.getLinePayByShopIds(shopIds, PayBusinessTypeEnum.FRANCHISE_FEE.getCode());
|
||||
}
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
if (ShopSubStageEnum.SHOP_STAGE_16.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())
|
||||
|| ShopSubStageEnum.SHOP_STAGE_17.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())
|
||||
|| ShopSubStageEnum.SHOP_STAGE_9.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())
|
||||
|| ShopSubStageEnum.SHOP_STAGE_23.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())
|
||||
|| ShopSubStageEnum.SHOP_STAGE_24.getShopSubStage().equals(shopSubStageEnum.getShopSubStage()) ){
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
} else if (ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())) {
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_7.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
} else if (ShopSubStageEnum.SHOP_STAGE_11.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())) {
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
List<DecorationDesignInfoDO> decorationDesignInfos = decorationDesignInfoDAO.getByIds(shopIds);
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (DecorationDesignInfoDO decorationDesignInfoDO : decorationDesignInfos) {
|
||||
List<DeskStageDTO> deskStages = new ArrayList<>();
|
||||
deskStages.addAll(deskStageMap.get(decorationDesignInfoDO.getShopId()));
|
||||
if (CollectionUtils.isEmpty(deskStages)) {
|
||||
DeskStageDTO dto = new DeskStageDTO();
|
||||
dto.setActualCompleteTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START, decorationDesignInfoDO.getCreateTime()));
|
||||
dto.setShopSubStageStatus(SHOP_SUB_STAGE_STATUS_111.getShopSubStageStatus());
|
||||
deskStageMap.put(decorationDesignInfoDO.getShopId(), Collections.singletonList(dto));
|
||||
} else {
|
||||
DeskStageDTO dto = new DeskStageDTO();
|
||||
dto.setActualCompleteTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START, decorationDesignInfoDO.getCreateTime()));
|
||||
dto.setShopSubStageStatus(SHOP_SUB_STAGE_STATUS_111.getShopSubStageStatus());
|
||||
deskStages.add(dto);
|
||||
deskStageMap.put(decorationDesignInfoDO.getShopId(), deskStages);
|
||||
}
|
||||
}
|
||||
} else if (ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())) {
|
||||
List<AcceptanceInfoDO> list = acceptanceInfoDAO.selectByShopIds(shopIds);
|
||||
for (AcceptanceInfoDO acceptanceInfoDO : list) {
|
||||
DeskStageDTO dto = new DeskStageDTO();
|
||||
dto.setActualCompleteTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START, acceptanceInfoDO.getCreateTime()));
|
||||
dto.setShopSubStageStatus(SHOP_SUB_STAGE_STATUS_122.getShopSubStageStatus());
|
||||
deskStageMap.put(acceptanceInfoDO.getShopId(), Collections.singletonList(dto));
|
||||
}
|
||||
}
|
||||
List<PreparationCommonPendingVO> list = new ArrayList<>();
|
||||
Map<Long, LinePayDO> finalShopPayDoMap = shopPayDoMap;
|
||||
specialShopStageInfo.forEach(x -> {
|
||||
PreparationCommonPendingVO preparationCommonPendingVO = new PreparationCommonPendingVO();
|
||||
preparationCommonPendingVO.setLineId(x.getLineId());
|
||||
@@ -553,45 +541,15 @@ public class DeskServiceImpl implements DeskService {
|
||||
ShopInfoDO shopInfoDO = shopInfoMap.getOrDefault(x.getShopId(), new ShopInfoDO());
|
||||
if (shopInfoDO != null) {
|
||||
PointInfoDO pointInfoDO = pointMap.get(shopInfoDO.getPointId());
|
||||
if(pointInfoDO != null) {
|
||||
if (pointInfoDO != null) {
|
||||
preparationCommonPendingVO.setShopAddress(pointInfoDO.getAddress());
|
||||
}
|
||||
preparationCommonPendingVO.setShopCode(shopInfoDO.getShopCode());
|
||||
}
|
||||
preparationCommonPendingVO.setInvestmentManager(lineMap.getOrDefault(x.getLineId(),new PlanLineDTO()).getInvestmentManagerName());
|
||||
preparationCommonPendingVO.setInvestmentManager(lineMap.getOrDefault(x.getLineId(), new PlanLineDTO()).getInvestmentManagerName());
|
||||
preparationCommonPendingVO.setStage(x.getShopStage());
|
||||
preparationCommonPendingVO.setSubStage(x.getShopSubStage());
|
||||
preparationCommonPendingVO.setSubStageStatus(x.getShopSubStageStatus());
|
||||
|
||||
if (ShopSubStageEnum.SHOP_STAGE_7.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())) {
|
||||
preparationCommonPendingVO.setSubmitTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START, finalShopPayDoMap.getOrDefault(x.getShopId(), new LinePayDO()).getCreateTime()));
|
||||
}
|
||||
if (ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())) {
|
||||
preparationCommonPendingVO.setSubmitTime(deskStageMap.get(x.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
if (ShopSubStageEnum.SHOP_STAGE_16.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())
|
||||
|| ShopSubStageEnum.SHOP_STAGE_17.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())
|
||||
|| ShopSubStageEnum.SHOP_STAGE_9.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())
|
||||
|| ShopSubStageEnum.SHOP_STAGE_23.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())
|
||||
|| ShopSubStageEnum.SHOP_STAGE_24.getShopSubStage().equals(shopSubStageEnum.getShopSubStage()) ){
|
||||
preparationCommonPendingVO.setSubmitTime(deskStageMap.get(x.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
if (ShopSubStageEnum.SHOP_STAGE_11.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())) {
|
||||
for (DeskStageDTO deskStageDTO : deskStageMap.get(x.getShopId())) {
|
||||
if (x.getShopSubStageStatus().equals(deskStageDTO.getShopSubStageStatus())) {
|
||||
preparationCommonPendingVO.setSubmitTime(deskStageDTO.getActualCompleteTime());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())) {
|
||||
for (DeskStageDTO deskStageDTO : deskStageMap.get(x.getShopId())) {
|
||||
if (x.getShopSubStageStatus().equals(deskStageDTO.getShopSubStageStatus())) {
|
||||
preparationCommonPendingVO.setSubmitTime(deskStageDTO.getActualCompleteTime());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
preparationCommonPendingVO.setStoreName(shopInfoDO.getShopName());
|
||||
PlanLineDTO planLineDTO = lineMap.getOrDefault(x.getLineId(), new PlanLineDTO());
|
||||
preparationCommonPendingVO.setPartnerName(planLineDTO.getUsername());
|
||||
@@ -657,7 +615,7 @@ public class DeskServiceImpl implements DeskService {
|
||||
ShopInfoDO shopInfoDO = shopInfoMap.getOrDefault(x.getShopId(), new ShopInfoDO());
|
||||
if (shopInfoDO != null) {
|
||||
PointInfoDO pointInfoDO = pointMap.get(shopInfoDO.getPointId());
|
||||
if(pointInfoDO != null) {
|
||||
if (pointInfoDO != null) {
|
||||
preparationCommonPendingVO.setShopAddress(pointInfoDO.getAddress());
|
||||
}
|
||||
preparationCommonPendingVO.setShopCode(shopInfoDO.getShopCode());
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
|
||||
import com.cool.store.dto.ExportBranchShopDTO;
|
||||
import com.cool.store.dto.FranchiseFeeDTO;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.dto.PreparationScheduleDTO;
|
||||
@@ -13,10 +15,9 @@ import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.ImportTaskMapper;
|
||||
import com.cool.store.mapper.IntentAgreementMapper;
|
||||
import com.cool.store.mapper.PointInfoMapper;
|
||||
import com.cool.store.mapper.*;
|
||||
import com.cool.store.request.InitiatingRequest;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
@@ -27,20 +28,21 @@ import com.cool.store.utils.poi.StringUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigInteger;
|
||||
import java.text.MessageFormat;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cool.store.utils.poi.DateUtils.YYYY_MM_DD;
|
||||
import static com.cool.store.utils.poi.DateUtils.YYYY_MM_DD_HH_MM_SS;
|
||||
import static com.cool.store.utils.poi.DateUtils.*;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
@@ -52,7 +54,7 @@ import static com.cool.store.utils.poi.DateUtils.YYYY_MM_DD_HH_MM_SS;
|
||||
@Slf4j
|
||||
public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
@Resource
|
||||
private PointInfoMapper pointInfoMapper;
|
||||
private FranchiseFeeMapper franchiseFeeMapper;
|
||||
@Resource
|
||||
private ImportTaskMapper importTaskMapper;
|
||||
@Autowired
|
||||
@@ -62,7 +64,7 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
@Resource
|
||||
EnterpriseUserDAO enterpriseUserDAO;
|
||||
@Resource
|
||||
SysRoleService sysRoleService;
|
||||
SignFranchiseMapper signFranchiseMapper;
|
||||
@Resource
|
||||
UserAuthMappingService userAuthMappingService;
|
||||
@Resource
|
||||
@@ -91,59 +93,86 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
@Autowired
|
||||
private RegionDao regionDao;
|
||||
|
||||
@Async
|
||||
@Resource
|
||||
private InvoicingDAO invoicingDAO;
|
||||
@Override
|
||||
public void preparationList(List<PreparationDTO> preparationDTOS, ImportTaskDO importTaskDO) {
|
||||
@Async
|
||||
public void branchShopList(List<BranchShopResponse> list, ImportTaskDO importTaskDO) {
|
||||
Boolean flag = Boolean.TRUE;
|
||||
String url = "";
|
||||
try {
|
||||
List<Long> shopIds = preparationDTOS.stream().map(PreparationDTO::getId).collect(Collectors.toList());
|
||||
List<ScheduleDTO> scheduleList = shopStageInfoDAO.getScheduleList(shopIds);
|
||||
List<ShopStageInfoDO> shopContractActualCompletionTime = shopStageInfoDAO.getShopContractActualCompletionTime(shopIds);
|
||||
Map<Long, ScheduleDTO> scheduleDTOMap = scheduleList.stream().collect(Collectors.toMap(ScheduleDTO::getShopId, x -> x));
|
||||
Map<Long, ShopStageInfoDO> shopStageInfoDOMap = shopContractActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
|
||||
List<Long> regionIds = preparationDTOS.stream().map(PreparationDTO::getRegionId).collect(Collectors.toList());
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||
Set<String> userIds = preparationDTOS.stream().filter(x -> StringUtils.isNotEmpty(x.getShopManagerUserId())).map(PreparationDTO::getShopManagerUserId).collect(Collectors.toSet());
|
||||
userIds.addAll(preparationDTOS.stream().filter(x -> StringUtils.isNotEmpty(x.getInvestmentManager())).map(PreparationDTO::getInvestmentManager).collect(Collectors.toSet()));
|
||||
userIds.addAll(preparationDTOS.stream().filter(x -> StringUtils.isNotEmpty(x.getSupervisorUserId())).map(PreparationDTO::getSupervisorUserId).collect(Collectors.toSet()));
|
||||
Map<String, EnterpriseUserDO> userInfoMap = enterpriseUserDAO.getUserInfoMap(new ArrayList<>(userIds));
|
||||
List<ShopStageInfoDO> openActivityActualCompletionTime = shopStageInfoDAO.getOpenActivityActualCompletionTime(shopIds);
|
||||
Map<Long, ShopStageInfoDO> openActivityStageMap;
|
||||
if (openActivityActualCompletionTime !=null){
|
||||
openActivityStageMap = openActivityActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
|
||||
} else {
|
||||
openActivityStageMap = new HashMap<>();
|
||||
List<ExportBranchShopDTO> exportList = new ArrayList<>();
|
||||
List<Long> shopIds = list.stream().map(BranchShopResponse::getShopId).collect(Collectors.toList());
|
||||
List<SignFranchiseDO> signFranchises = signFranchiseMapper.selectByShopIds(shopIds);
|
||||
List<FranchiseFeeDTO> franchiseFees = franchiseFeeMapper.getPayTimeByShopIds(shopIds);
|
||||
Map<Long, Date> payTimeMap = franchiseFees.stream().filter(o -> o.getPayTime() != null)
|
||||
.filter(o -> o.getShopId() != null)
|
||||
.collect(Collectors.toMap(FranchiseFeeDTO::getShopId, FranchiseFeeDTO::getPayTime));
|
||||
Map<Long, FranchiseFeeDTO> franchiseFeeDTOMap = franchiseFees.stream().filter(o -> o.getShopId() != null)
|
||||
.collect(Collectors.toMap(FranchiseFeeDTO::getShopId, Function.identity()));
|
||||
Map<Long, SignFranchiseDO> signFranchiseMap = new HashMap<>();
|
||||
if (signFranchises != null) {
|
||||
signFranchiseMap = signFranchises.stream().collect(Collectors.toMap(SignFranchiseDO::getShopId, Function.identity()));
|
||||
}
|
||||
List<PreparationScheduleDTO> result = new ArrayList<>();
|
||||
preparationDTOS.forEach(x -> {
|
||||
PreparationScheduleDTO dto1 = new PreparationScheduleDTO();
|
||||
dto1.setMobile(x.getMobile());
|
||||
dto1.setUsername(x.getUsername());
|
||||
dto1.setShopName(x.getShopName());
|
||||
dto1.setPlanOpenTime(DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, x.getPlanOpenTime()));
|
||||
dto1.setShopCode(x.getShopCode());
|
||||
dto1.setSupervisionName(userInfoMap.getOrDefault(x.getSupervisorUserId(), new EnterpriseUserDO()).getName());
|
||||
dto1.setInvestmentManagerName(userInfoMap.getOrDefault(x.getInvestmentManager(), new EnterpriseUserDO()).getName());
|
||||
dto1.setRegionNodeName(regionNameMap.getOrDefault(x.getRegionId(), ""));
|
||||
ScheduleDTO dto = scheduleDTOMap.getOrDefault(x.getId(), new ScheduleDTO());
|
||||
dto1.setCurrentProgress(dto.getCompletionColumn().toString() + "/" + dto.getTotalColumn().toString());
|
||||
if ( openActivityStageMap.containsKey(x.getId())) {
|
||||
Date openActivity = DateUtils.strToDate(openActivityStageMap.get(x.getId()).getActualCompleteTime(), YYYY_MM_DD_HH_MM_SS);
|
||||
long between = ChronoUnit.SECONDS.between( x.getCreateTime().toInstant(),openActivity.toInstant());
|
||||
double days = (double) between / (24 * 60 * 60);
|
||||
dto1.setDays(String.format("%.1f", days));
|
||||
}else{
|
||||
long between = ChronoUnit.SECONDS.between( x.getCreateTime().toInstant(),new Date().toInstant());
|
||||
double days = (double) between / (24 * 60 * 60);
|
||||
dto1.setDays(String.format("%.1f", days));
|
||||
List<InvoicingDO> invoicingDOList = invoicingDAO.listByShopIds(shopIds);
|
||||
Map<Long, InvoicingDO> InvoicingMap = new HashMap<>();
|
||||
if (invoicingDOList != null) {
|
||||
InvoicingMap = invoicingDOList.stream().collect(Collectors.toMap(InvoicingDO::getShopId, Function.identity()));
|
||||
}
|
||||
for (BranchShopResponse response : list) {
|
||||
ExportBranchShopDTO dto = new ExportBranchShopDTO();
|
||||
FranchiseFeeDTO franchiseFeeDTO = franchiseFeeDTOMap.get(response.getShopId());
|
||||
if (ObjectUtils.isNotEmpty(franchiseFeeDTO)) {
|
||||
dto.setFirstYearStartTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, franchiseFeeDTO.getFirstYearStartTime()));
|
||||
dto.setFirstYearEndTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, franchiseFeeDTO.getFirstYearEndTime()));
|
||||
String total = (new BigInteger(franchiseFeeDTO.getPerformanceBond()).add(new BigInteger(franchiseFeeDTO.getFirstYearFee()))
|
||||
.add(new BigInteger(franchiseFeeDTO.getYearFranchiseFee())).add(new BigInteger(franchiseFeeDTO.getLoanMargin())).toString());
|
||||
dto.setTotalAmountContributions(total);
|
||||
dto.setFranchiseFeeBill(franchiseFeeDTO.getYearFranchiseFee());
|
||||
dto.setLoanMargin(franchiseFeeDTO.getLoanMargin());
|
||||
dto.setPerformanceBondBill(franchiseFeeDTO.getPerformanceBond());
|
||||
}
|
||||
result.add(dto1);
|
||||
});
|
||||
url = easyExcelUtil.exportExcel(PreparationScheduleDTO.class, result, null, FileTypeEnum.PREPARATION.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()), FileTypeEnum.PREPARATION.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()));
|
||||
dto.setUserName(response.getUsername());
|
||||
dto.setMobile(response.getMobile());
|
||||
dto.setShopName(response.getShopName());
|
||||
dto.setShopCode(response.getShopCode());
|
||||
dto.setRegionName(response.getRegionName());
|
||||
dto.setJoinMode(JoinModeEnum.getByCode(response.getJoinMode()));
|
||||
dto.setFranchiseBrand(FranchiseBrandEnum.getDescByCode(response.getFranchiseBrand()));
|
||||
dto.setInvestmentManager(response.getInvestmentManagerName());
|
||||
SignFranchiseDO signFranchiseDO = signFranchiseMap.get(response.getShopId());
|
||||
if (signFranchiseDO != null) {
|
||||
dto.setContractCode(signFranchiseDO.getContractCode());
|
||||
dto.setContractStartTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, signFranchiseDO.getContractStartTime()));
|
||||
dto.setContractEndTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, signFranchiseDO.getContractEndTime()));
|
||||
}
|
||||
Date payTime = payTimeMap.get(response.getShopId());
|
||||
if (Objects.nonNull(payTime)) {
|
||||
dto.setFirstPayTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, payTime));
|
||||
}
|
||||
InvoicingDO invoicingDO = InvoicingMap.get(response.getShopId());
|
||||
if (invoicingDO != null) {
|
||||
dto.setInvoicingTime(invoicingDO.getInvoiceDate());
|
||||
dto.setFirstYearManagementFeeTax(toString(invoicingDO.getManagementFeeTax()));
|
||||
dto.setFirstYearManagementFee(toString(invoicingDO.getManagementFee()));
|
||||
dto.setFirstYearBrandingFeeTax(toString(invoicingDO.getBrandUsageFeeTax()));
|
||||
dto.setFirstYearBrandingFee(toString(invoicingDO.getBrandUsageFee()));
|
||||
dto.setFranchiseFeeTax(toString(invoicingDO.getFranchiseFeeTax()));
|
||||
dto.setFranchiseFee(toString(invoicingDO.getFranchiseFee()));
|
||||
dto.setDesignFeeTax(toString(invoicingDO.getDesignServiceFeeTax()));
|
||||
dto.setDesignFee(toString(invoicingDO.getDesignServiceFee()));
|
||||
}
|
||||
dto.setCurrentProgress(response.getCompletionColumn() + "/" + response.getTotalColumn());
|
||||
dto.setShopStatus(response.getShopStatus());
|
||||
dto.setPlanOpenTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, response.getPlanOpenTime()));
|
||||
dto.setOpenDuration(response.getDays());
|
||||
dto.setCurrency("元");
|
||||
exportList.add(dto);
|
||||
}
|
||||
url = easyExcelUtil.exportExcel(ExportBranchShopDTO.class, exportList, null, FileTypeEnum.BRANCH_SHOP_LIST.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()), FileTypeEnum.BRANCH_SHOP_LIST.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()));
|
||||
} catch (Throwable e) {
|
||||
flag = Boolean.FALSE;
|
||||
log.error("fileUpload upload err, originFileName={}", FileTypeEnum.TEAM_LINE.getDesc(), e);
|
||||
log.error("fileUpload upload err, originFileName={}", FileTypeEnum.BRANCH_SHOP_LIST.getDesc(), e);
|
||||
throw new ServiceException(ErrorCodeEnum.INTERNAL_SERVER_ERROR);
|
||||
} finally {
|
||||
if (flag) {
|
||||
@@ -154,6 +183,14 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
}
|
||||
importTaskMapper.update(eid, importTaskDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String toString(Object o) {
|
||||
if (o == null) {
|
||||
return "";
|
||||
}
|
||||
return o.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service.impl;
|
||||
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
@@ -17,6 +18,7 @@ import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.ImportTaskMapper;
|
||||
import com.cool.store.mapper.PointInfoMapper;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.easyExcel.EasyExcelUtil;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
@@ -67,42 +69,37 @@ public class ExportServiceImpl implements ExportService {
|
||||
private String eid;
|
||||
@Autowired
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Autowired
|
||||
private ShopService shopService;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Integer preparationList(PreparationRequest request,LoginUserInfo loginUserInfo) {
|
||||
if (!sysRoleService.checkIsAdmin(request.getCurUserId())) {
|
||||
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(request.getCurUserId()));
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(request.getRegionIds())) {
|
||||
if (request.getRegionIds().contains(CommonConstants.ROOT_DEPT_ID_STR)) {
|
||||
request.setRegionIds(null);
|
||||
} else {
|
||||
request.setRegionIds(regionService.getSubRegionIdsByRegionIds(request.getRegionIds()));
|
||||
}
|
||||
}
|
||||
//进度数据
|
||||
List<PreparationDTO> preparationDTOS = shopInfoDAO.ListByCondition(request);
|
||||
if (CollectionUtils.isEmpty(preparationDTOS)) {
|
||||
throw new ServiceException(ErrorCodeEnum.NO_DATA);
|
||||
}
|
||||
List<PreparationDTO> result;
|
||||
if (preparationDTOS.size()>CommonConstants.MAX_EXPORT_SIZE){
|
||||
result= preparationDTOS.subList(0,CommonConstants.MAX_EXPORT_SIZE);
|
||||
public Long branchShopList(BranchShopRequest request, LoginUserInfo user) {
|
||||
request.setPageSize(CommonConstants.MAX_EXPORT_SIZE + 100);
|
||||
request.setPageNum(CommonConstants.ONE);
|
||||
PageInfo<BranchShopResponse> branchShopList = shopService.getBranchShopList(request, user.getUserId());
|
||||
long total = branchShopList.getTotal();
|
||||
List<BranchShopResponse> exportList = new ArrayList<>();
|
||||
if (total == CommonConstants.ZERO) {
|
||||
return CommonConstants.ZERO_LONG;
|
||||
} else if (total > CommonConstants.MAX_EXPORT_SIZE) {
|
||||
exportList.addAll(branchShopList.getList().subList(0, CommonConstants.MAX_EXPORT_SIZE));
|
||||
}else {
|
||||
result=preparationDTOS;
|
||||
exportList.addAll(branchShopList.getList());
|
||||
}
|
||||
ImportTaskDO importTaskDO = new ImportTaskDO();
|
||||
importTaskDO.setStatus(ImportStatusEnum.Ongoing.getCode());
|
||||
importTaskDO.setFileName(FileTypeEnum.PREPARATION.getDesc()+DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1,new Date()));
|
||||
importTaskDO.setFileName(FileTypeEnum.BRANCH_SHOP_LIST.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()));
|
||||
importTaskDO.setIsImport(Boolean.FALSE);
|
||||
importTaskDO.setFileType(FileTypeEnum.PREPARATION.getFileType());
|
||||
importTaskDO.setCreateUserId(request.getCurUserId());
|
||||
importTaskDO.setFileType(FileTypeEnum.BRANCH_SHOP_LIST.getFileType());
|
||||
importTaskDO.setCreateUserId(user.getUserId());
|
||||
importTaskDO.setCreateTime(new Date().getTime());
|
||||
importTaskDO.setCreateName(loginUserInfo.getName());
|
||||
importTaskDO.setCreateName(user.getName());
|
||||
importTaskMapper.insert(eid, importTaskDO);
|
||||
exportRealizeService.preparationList(result, importTaskDO);
|
||||
return result.size();
|
||||
exportRealizeService.branchShopList(branchShopList.getList(), importTaskDO);
|
||||
return total;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ package com.cool.store.service.impl;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.HyPartnerUserChannelDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.dao.QualificationsInfoDAO;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.*;
|
||||
@@ -32,6 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service
|
||||
@@ -80,8 +81,10 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
private ShopService shopService;
|
||||
@Resource
|
||||
QualificationsInfoDAO qualificationsInfoDAO;
|
||||
|
||||
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
private ShopStageInfoDAO shopStageInfoDAO;
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean submit(IntentAgreementSubmitRequest request) {
|
||||
@@ -137,16 +140,22 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo, String userId) {
|
||||
LineInfoDO updateLine = new LineInfoDO();
|
||||
updateLine.setId(lineInfo.getId());
|
||||
updateLine.setWorkflowStage(WorkflowStageEnum.STORE.getCode());
|
||||
updateLine.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode());
|
||||
updateLine.setDevelopmentManager(lineInfo.getInvestmentManager());
|
||||
updateLine.setUpdateUserId(userId);
|
||||
lineInfoDAO.updateLineInfo(updateLine);
|
||||
lineInfo.setId(lineInfo.getId());
|
||||
lineInfo.setWorkflowStage(WorkflowStageEnum.STORE.getCode());
|
||||
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode());
|
||||
lineInfo.setDevelopmentManager(lineInfo.getInvestmentManager());
|
||||
lineInfo.setUpdateUserId(userId);
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
//初始化店铺
|
||||
shopService.initShop(lineInfo);
|
||||
// 批量获取线索下门店的选址未开始的数据
|
||||
List<ShopStageInfoDO> stages = shopStageInfoDAO.getByLineIdAndSubStage(lineInfo.getId());
|
||||
List<Long> shopIds = stages.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
|
||||
shopStageInfoDAO.batchUpdateByShopIdsAndSubStageStatus(shopIds,
|
||||
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_10,
|
||||
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_50,ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70));
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -191,6 +200,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean skipIntentAgreement(Long lineId,LoginUserInfo user) {
|
||||
log.info("skipIntentAgreement lineId:{},操作人:{}",lineId,user.getName());
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||
@@ -200,15 +210,20 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
if ( !WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_70.getCode().equals(lineInfo.getWorkflowSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE);
|
||||
}
|
||||
LineInfoDO updateLine = new LineInfoDO();
|
||||
updateLine.setId(lineInfo.getId());
|
||||
updateLine.setWorkflowStage(WorkflowStageEnum.STORE.getCode());
|
||||
updateLine.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode());
|
||||
updateLine.setDevelopmentManager(lineInfo.getInvestmentManager());
|
||||
updateLine.setUpdateUserId(user.getUserId());
|
||||
lineInfoDAO.updateLineInfo(updateLine);
|
||||
|
||||
lineInfo.setWorkflowStage(WorkflowStageEnum.STORE.getCode());
|
||||
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode());
|
||||
lineInfo.setDevelopmentManager(lineInfo.getInvestmentManager());
|
||||
lineInfo.setUpdateUserId(user.getUserId());
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
//初始化店铺
|
||||
shopService.initShop(lineInfo);
|
||||
// 批量获取线索下门店的选址未开始的数据
|
||||
List<ShopStageInfoDO> stages = shopStageInfoDAO.getByLineIdAndSubStage(lineInfo.getId());
|
||||
List<Long> shopIds = stages.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
|
||||
shopStageInfoDAO.batchUpdateByShopIdsAndSubStageStatus(shopIds,
|
||||
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_10,
|
||||
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_50,ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70));
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ public class InvoicingServiceImpl implements InvoicingService {
|
||||
//新数据待提交时初始化 老数据已数据处理 阶段状态已完成 只做插入操作 无需初始化
|
||||
if (shopSubStageInfo!=null&&ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_85_1.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){
|
||||
shopStageInfoDAO.updateShopStageInfo(invoicingDTO.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_85_3);
|
||||
preparationService.updateShopStatus(invoicingDTO.getShopId());
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -2,9 +2,12 @@ package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.LineFollowLogDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.dao.ShopInfoDAO;
|
||||
import com.cool.store.entity.LineFollowLogDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.FollowLogTypeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.LineFollowLogRequest;
|
||||
import com.cool.store.service.LineFollowService;
|
||||
@@ -30,10 +33,12 @@ public class LineFollowServiceImpl implements LineFollowService {
|
||||
private LineFollowLogDAO lineFollowLogDAO;
|
||||
@Resource
|
||||
private LineInfoDAO lineInfoDAO;
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
|
||||
@Override
|
||||
public PageInfo<LineFollowLogVO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize) {
|
||||
Page<LineFollowLogDO> followLogPage = lineFollowLogDAO.getFollowLogPage(lineId, pageNum, pageSize);
|
||||
public PageInfo<LineFollowLogVO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize,Integer type) {
|
||||
Page<LineFollowLogDO> followLogPage = lineFollowLogDAO.getFollowLogPage(lineId, pageNum, pageSize,type);
|
||||
PageInfo resultPage = new PageInfo(followLogPage);
|
||||
List<LineFollowLogVO> resultList = LineFollowLogVO.convertList(followLogPage);
|
||||
resultPage.setList(resultList);
|
||||
@@ -42,10 +47,21 @@ public class LineFollowServiceImpl implements LineFollowService {
|
||||
|
||||
@Override
|
||||
public Long addFollowLog(LineFollowLogRequest followLog, String operateUserId, String operateUsername) {
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(followLog.getLineId());
|
||||
if(Objects.isNull(lineInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
if (followLog.getType().equals(FollowLogTypeEnum.LINE.getCode())){
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(followLog.getLineId());
|
||||
if(Objects.isNull(lineInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
return lineFollowLogDAO.addFollowLog(lineInfo, operateUserId, operateUsername, followLog.getMessage(),followLog.getType());
|
||||
}
|
||||
return lineFollowLogDAO.addFollowLog(lineInfo, operateUserId, operateUsername, followLog.getMessage());
|
||||
if (followLog.getType().equals(FollowLogTypeEnum.SHOP.getCode())){
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(followLog.getLineId());
|
||||
if (Objects.isNull(shopInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
}
|
||||
return lineFollowLogDAO.addFollowLogByShop(shopInfo,operateUserId,operateUsername, followLog.getMessage(),followLog.getType());
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ import java.util.stream.Stream;
|
||||
@Service
|
||||
public class LineServiceImpl implements LineService {
|
||||
|
||||
@Resource
|
||||
ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
LineInfoDAO lineInfoDAO;
|
||||
@Resource
|
||||
@@ -98,11 +100,21 @@ public class LineServiceImpl implements LineService {
|
||||
Map<Integer, String> channelMapByIds = hyPartnerUserChannelDAO.getChannelMapByIds(Arrays.asList(lineInfo.getLineSource()));
|
||||
result.setLineSourceName(channelMapByIds.get(lineInfo.getLineSource()));
|
||||
}
|
||||
if (StringUtil.isNotEmpty(lineInfo.getInvestmentManager())){
|
||||
EnterpriseUserDO user = enterpriseUserDAO.getUserInfoById(lineInfo.getInvestmentManager());
|
||||
result.setInvestmentManagerName(user.getName());
|
||||
result.setInvestmentManagerMobile(user.getMobile());
|
||||
|
||||
List<ShopInfoDO> shopInfoDOS = shopInfoDAO.selectInvestmentByLines(Collections.singletonList(lineInfo.getId()));
|
||||
Set<String> userIds = shopInfoDOS.stream().map(ShopInfoDO::getInvestmentManager).collect(Collectors.toSet());
|
||||
userIds.add(lineInfo.getInvestmentManager());
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(new ArrayList<>(userIds));
|
||||
StringBuilder investmentManagerName = new StringBuilder();
|
||||
for (String userId : userNameMap.keySet()){
|
||||
investmentManagerName.append(userNameMap.get(userId)).append(",");
|
||||
}
|
||||
result.setInvestmentManagerName(investmentManagerName.toString().substring(0, investmentManagerName.length() - 1));
|
||||
// if (StringUtil.isNotEmpty(lineInfo.getInvestmentManager())){
|
||||
// EnterpriseUserDO user = enterpriseUserDAO.getUserInfoById(lineInfo.getInvestmentManager());
|
||||
// result.setInvestmentManagerName(user.getName());
|
||||
// result.setInvestmentManagerMobile(user.getMobile());
|
||||
// }
|
||||
if(lineInfo.getRegionId() != null && lineInfo.getRegionId() != 0){
|
||||
Long bigRegionIdByAreaId = regionService.getBigRegionIdByAreaId(lineInfo.getWantShopAreaId());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(Arrays.asList(bigRegionIdByAreaId, lineInfo.getRegionId()));
|
||||
@@ -246,19 +258,22 @@ public class LineServiceImpl implements LineService {
|
||||
PageHelper.startPage(partnerRequest.getPageNum(), partnerRequest.getPageSize());
|
||||
List<LineInfoDO> lineInfoDOS = lineInfoDAO.partnerList(partnerRequest,areaName, userId, regionId);
|
||||
PageInfo page = new PageInfo(lineInfoDOS);
|
||||
List<Long> lineIds = lineInfoDOS.stream().map(LineInfoDO::getId).collect(Collectors.toList());
|
||||
List<ShopInfoDO> shopInfoDOS = shopInfoDAO.selectInvestmentByLines(lineIds);
|
||||
Map<Long,Set<String>> investmentManagerIdMapByLineId = shopInfoDOS.stream().collect(Collectors.groupingBy(ShopInfoDO::getLineId, Collectors.mapping(ShopInfoDO::getInvestmentManager, Collectors.toSet())));
|
||||
Set<String> investmentManagerIds =shopInfoDOS.stream().map(ShopInfoDO::getInvestmentManager).collect(Collectors.toSet());
|
||||
Map<Long, HyPartnerLabelDO> userPortraitMap = deskService.getUserPortraitMap(lineInfoDOS);
|
||||
List<Long> wantShopAreaIdList = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
||||
Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIdList);
|
||||
List<Integer> lineSourceIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getLineSource() != null).map(LineInfoDO::getLineSource).collect(Collectors.toList());
|
||||
Map<Integer, String> channelMapByIds = hyPartnerUserChannelDAO.getChannelMapByIds(lineSourceIds);
|
||||
|
||||
List<String> userIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getInvestmentManager() != null).map(LineInfoDO::getInvestmentManager).collect(Collectors.toList());
|
||||
Set<String> userIds = new HashSet<>();
|
||||
userIds.addAll(lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getInvestmentManager() != null).map(LineInfoDO::getInvestmentManager).collect(Collectors.toList()));
|
||||
userIds.addAll(lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getDevelopmentManager() != null).map(LineInfoDO::getDevelopmentManager).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);
|
||||
userIds.addAll(investmentManagerIds);
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(new ArrayList<>(userIds));
|
||||
|
||||
|
||||
List<Long> lineIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getId() != null).map(LineInfoDO::getId).collect(Collectors.toList());
|
||||
List<SigningBaseInfoDO> signingBaseInfoDOS = intentAgreementMapper.selectByLineIds(lineIds);
|
||||
Map<Long, Date> dateMap = signingBaseInfoDOS.stream().collect(Collectors.toMap(SigningBaseInfoDO::getLineId, SigningBaseInfoDO::getCreateTime));
|
||||
|
||||
@@ -275,12 +290,18 @@ public class LineServiceImpl implements LineService {
|
||||
if (regionNameMap!=null){
|
||||
partnerListVO.setRegionName(regionNameMap.get(x.getRegionId()));
|
||||
}
|
||||
StringBuilder investmentManagerUserName = new StringBuilder();
|
||||
Set<String> userIdSet = investmentManagerIdMapByLineId.getOrDefault(x.getId(),new HashSet<>());
|
||||
userIdSet.add(x.getInvestmentManager());
|
||||
for (String s : userIdSet) {
|
||||
investmentManagerUserName.append(userNameMap.get(s)).append(",");
|
||||
}
|
||||
partnerListVO.setUpdateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, x.getUpdateTime()));
|
||||
partnerListVO.setLineSourceName(channelMapByIds.get(x.getLineSource()));
|
||||
partnerListVO.setJoinStatus(x.getJoinStatus());
|
||||
partnerListVO.setJoinMode(x.getJoinMode());
|
||||
partnerListVO.setPartnerNum(x.getPartnerNum());
|
||||
partnerListVO.setInvestmentManagerUserName(userNameMap.get(x.getInvestmentManager()));
|
||||
partnerListVO.setInvestmentManagerUserName(investmentManagerUserName.toString().substring(0, investmentManagerUserName.length()-1));
|
||||
partnerListVO.setUpdateUserName(userNameMap.get(x.getUpdateUserId()));
|
||||
partnerListVO.setDevelopmentManagerUserName(userNameMap.get(x.getDevelopmentManager()));
|
||||
partnerListVO.setWantShopNum(x.getWantShopNum());
|
||||
@@ -331,7 +352,7 @@ public class LineServiceImpl implements LineService {
|
||||
if (lineInfo.getJoinStatus()!=0){
|
||||
operationLogTypeEnum = OperationLogTypeEnum.TRANSFER_INVESTMENT_MANAGER_3;
|
||||
}
|
||||
transferLogService.addLog(lineInfo,userInfo.getUserId(),changeInvestmentRequest.getInvestmentManagerId(),operationLogTypeEnum);
|
||||
transferLogService.addLog(lineInfo.getId(),lineInfo.getPartnerId(),userInfo.getUserId(),changeInvestmentRequest.getInvestmentManagerId(),operationLogTypeEnum);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
@@ -435,8 +456,10 @@ public class LineServiceImpl implements LineService {
|
||||
}
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByMobile(addLineRequest.getMobile());
|
||||
if (hyPartnerUserInfoDO!=null){
|
||||
throw new ServiceException(ErrorCodeEnum.MOBILE_EXIST);
|
||||
//校验
|
||||
validateAndProcessLineInfo(addLineRequest.getMobile());
|
||||
}
|
||||
|
||||
hyPartnerUserInfoDO = new HyPartnerUserInfoDO();
|
||||
hyPartnerUserInfoDO.setMobile(addLineRequest.getMobile());
|
||||
hyPartnerUserInfoDO.setUserChannelId(Integer.valueOf(UserChannelEnum.ADD.getCode()));
|
||||
@@ -465,6 +488,55 @@ public class LineServiceImpl implements LineService {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验线索
|
||||
* @param mobile
|
||||
*/
|
||||
public void validateAndProcessLineInfo(String mobile) {
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineByMobile(mobile);
|
||||
String investmentManager = getInvestmentManagerName(lineInfo);
|
||||
String listName = determineListName(lineInfo);
|
||||
|
||||
throw new ServiceException(ErrorCodeEnum.MOBILE_EXIST, listName, investmentManager,DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, lineInfo.getCreateTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提取获取招商经理姓名的方法
|
||||
* @param lineInfo
|
||||
* @return
|
||||
*/
|
||||
private String getInvestmentManagerName(LineInfoDO lineInfo) {
|
||||
if (lineInfo == null || StringUtils.isEmpty(lineInfo.getInvestmentManager())) {
|
||||
return "-";
|
||||
}
|
||||
return enterpriseUserDAO.getUserName(lineInfo.getInvestmentManager());
|
||||
}
|
||||
|
||||
/**
|
||||
* 提取判断列表名称的逻辑
|
||||
* @param lineInfo
|
||||
* @return
|
||||
*/
|
||||
private String determineListName(LineInfoDO lineInfo) {
|
||||
if (lineInfo == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
Integer lineStatus = lineInfo.getLineStatus();
|
||||
if (LineStatusEnum.PUBLIC_SEAS.getCode().equals(lineStatus)) {
|
||||
return StringUtils.isNotEmpty(lineInfo.getInvestmentManager()) ? "线索公海" : "待分配线索";
|
||||
}
|
||||
|
||||
if (LineStatusEnum.PRIVATE_SEAS.getCode().equals(lineStatus)) {
|
||||
return lineInfo.getJoinStatus() == 0 ? "线索管理" : "加盟商管理";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取招商经理id
|
||||
* @param addLineRequest
|
||||
@@ -497,6 +569,15 @@ public class LineServiceImpl implements LineService {
|
||||
return regionQrcodeConfigDao.getPayPicByRegionId(bigRegionId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<LineVO> getLines(LinesRequest request) {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<LineVO> lines = lineInfoDAO.getLines(request.getKeyword());
|
||||
PageInfo<LineVO> pageInfo = new PageInfo<>(lines);
|
||||
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算预期时间
|
||||
* @param startTime
|
||||
|
||||
@@ -143,6 +143,8 @@ public class OpenAcceptanceInfoServiceImpl implements OpenAcceptanceInfoService
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
shopInfoDO.setId(shopAcceptanceRequest.getShopId());
|
||||
shopInfoDO.setPlanOpenTime(shopAcceptanceRequest.getPlanOpenTime());
|
||||
shopInfoDO.setUpdateTime(new Date());
|
||||
shopInfoDO.setUpdateUserId(userId);
|
||||
shopInfoDAO.updateShopInfo(shopInfoDO);
|
||||
//开业验收完成
|
||||
// shopStageInfoDAO.updateShopStageInfo(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_161);
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.point.AuditNodeDTO;
|
||||
import com.cool.store.dto.point.MiniPointPageDTO;
|
||||
import com.cool.store.dto.point.ShopPointDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.*;
|
||||
@@ -18,6 +20,7 @@ import com.cool.store.vo.AuditInfoVO;
|
||||
import com.cool.store.vo.LinePointBaseInfoVO;
|
||||
import com.cool.store.vo.point.*;
|
||||
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||
import com.cool.store.vo.shop.ShopPointBaseInfoVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -25,6 +28,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -88,6 +92,8 @@ public class PointServiceImpl implements PointService {
|
||||
|
||||
private static final String AUDIT_SETTING_KEY = "audit_setting_key:{0}";
|
||||
private static final String POINT_SELECT_KEY = "point_select_key:{0}:{1}";
|
||||
@Autowired
|
||||
private PreparationService preparationService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -191,7 +197,7 @@ public class PointServiceImpl implements PointService {
|
||||
* 回退选址状态
|
||||
* @return
|
||||
*/
|
||||
private void rollbackSelectPoint(Long shopId, Long pointId){
|
||||
private void rollbackSelectPoint(Long shopId, Long pointId){
|
||||
//店铺回退待带选址
|
||||
shopInfoDAO.unbindPoint(shopId);
|
||||
//铺位回退
|
||||
@@ -201,7 +207,7 @@ public class PointServiceImpl implements PointService {
|
||||
//租赁合同回到未开始
|
||||
Integer result = shopStageInfoDAO.updateShopStageToNotStarted(shopId, ShopSubStageEnum.SHOP_STAGE_2);
|
||||
if(result > CommonConstants.ZERO){
|
||||
//删除租赁合同
|
||||
//删除租赁合同
|
||||
shopRentInfoDAO.deleteRentContractByShopId(shopId);
|
||||
}
|
||||
}
|
||||
@@ -452,6 +458,27 @@ public class PointServiceImpl implements PointService {
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<ShopPointBaseInfoVO> getShopPage(PointLinePageRequest request) {
|
||||
List<ShopPointDTO> listByDevelopmentManager = shopInfoDAO.getShopPointListByDevelopmentManager(request);
|
||||
List<String> userPortraitList = listByDevelopmentManager.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(ShopPointDTO::getUserPortrait).collect(Collectors.toList());
|
||||
List<String> investmentManagerUserIds = listByDevelopmentManager.stream().filter(x -> StringUtils.isNotEmpty(x.getInvestmentManager() )).map(ShopPointDTO::getInvestmentManager).collect(Collectors.toList());
|
||||
List<Long> shopIds = listByDevelopmentManager.stream().map(ShopPointDTO::getShopId).collect(Collectors.toList());
|
||||
List<Long> wantShopAreaIds = listByDevelopmentManager.stream().map(ShopPointDTO::getWantShopAreaId).collect(Collectors.toList());
|
||||
Map<Long, Integer> recommendShopNumMap = pointRecommendDAO.getShopPushPointNumMap(shopIds);
|
||||
Map<Long, HyOpenAreaInfoDO> cityMap = hyOpenAreaInfoDAO.getCityMap(wantShopAreaIds);
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(investmentManagerUserIds);
|
||||
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
|
||||
|
||||
List<Long> lineIds = listByDevelopmentManager.stream().map(ShopPointDTO::getLineId).collect(Collectors.toList());
|
||||
Map<Long, String> partnerNameMap = lineInfoDAO.getUserNameMap(lineIds);
|
||||
|
||||
List<ShopPointBaseInfoVO> resultList = ShopPointBaseInfoVO.convertList(partnerNameMap,listByDevelopmentManager, userNameMap, userPortraitMap, cityMap, recommendShopNumMap);
|
||||
PageInfo resultPage = new PageInfo(listByDevelopmentManager);
|
||||
resultPage.setList(resultList);
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个加盟商信息
|
||||
* @param lineId
|
||||
@@ -550,6 +577,20 @@ public class PointServiceImpl implements PointService {
|
||||
return PointRecommendPageVO.convertVO(recommendPointList, pointList, userNameMap, regionNameMap, canSubmitRentContractShopIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PointRecommendPageVO> getShopRecommendPointList(Long shopId) {
|
||||
List<PointRecommendDO> recommendPointList = pointRecommendDAO.getShopRecommendPointList(shopId);
|
||||
List<Long> pointIds = recommendPointList.stream().map(PointRecommendDO::getPointId).distinct().collect(Collectors.toList());
|
||||
List<PointInfoDO> pointList = pointInfoDAO.getPointListByIds(pointIds);
|
||||
List<Long> regionIds = pointList.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||
List<String> developmentManagers = pointList.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
|
||||
List<Long> shopIds = pointList.stream().map(PointInfoDO::getShopId).distinct().collect(Collectors.toList());
|
||||
List<Long> canSubmitRentContractShopIds = shopStageInfoDAO.getCanSubmitRentContractShopIds(shopIds);
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||
return PointRecommendPageVO.convertVO(recommendPointList, pointList, userNameMap, regionNameMap, canSubmitRentContractShopIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PointPageVO> getRecommendPointList(RecommendPointPageRequest request) {
|
||||
List<PointPageVO> resultList = new ArrayList();
|
||||
@@ -580,7 +621,7 @@ public class PointServiceImpl implements PointService {
|
||||
String pointNames = invalidList.stream().map(PointInfoDO::getPointName).collect(Collectors.joining(","));
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, pointNames + ",已失效");
|
||||
}
|
||||
List<PointRecommendDO> recommendPointList = pointRecommendDAO.getRecommendPointList(request.getLineId());
|
||||
List<PointRecommendDO> recommendPointList = pointRecommendDAO.getShopRecommendPointList(request.getShopId());
|
||||
if(CollectionUtils.isNotEmpty(recommendPointList)){
|
||||
List<PointRecommendDO> recommendList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus()) ||
|
||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(o.getStatus()) ||
|
||||
@@ -616,18 +657,17 @@ public class PointServiceImpl implements PointService {
|
||||
List<PointRecommendDO> recommendList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(o.getStatus()) ||
|
||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(o.getStatus()) ||
|
||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_4.getCode().equals(o.getStatus()))
|
||||
.filter(o->request.getLineIds().contains(o.getLineId())).collect(Collectors.toList());
|
||||
.filter(o->request.getShopIds().contains(o.getShopId())).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(recommendList)){
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "推送失败,铺位已被选");
|
||||
}
|
||||
List<Long> lineIds = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus())).filter(o->request.getLineIds().contains(o.getLineId())).map(PointRecommendDO::getLineId).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(lineIds)){
|
||||
lineIds.retainAll(request.getLineIds());
|
||||
if(CollectionUtils.isNotEmpty(lineIds)){
|
||||
List<Long> shopIds = recommendPointList.stream()
|
||||
.filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus()))
|
||||
.filter(o->request.getShopIds().contains(o.getShopId())).map(PointRecommendDO::getShopId).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(shopIds)){
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "请勿重复推送");
|
||||
}
|
||||
}
|
||||
}
|
||||
List<PointRecommendDO> recommendList = request.convertList();
|
||||
return pointRecommendDAO.addRecommendPoint(recommendList);
|
||||
}
|
||||
@@ -635,25 +675,19 @@ public class PointServiceImpl implements PointService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer turnLine(TurnLineRequest request) {
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
Long lineId = request.getLineId();
|
||||
//更改线索中的拓展经理
|
||||
LineInfoDO updateLineInfo = new LineInfoDO();
|
||||
updateLineInfo.setId(lineId);
|
||||
updateLineInfo.setDevelopmentManager(request.getDevelopmentManager());
|
||||
lineInfoDAO.updateLineInfo(updateLineInfo);
|
||||
//更新已被选择的铺位的拓展经理
|
||||
pointInfoDAO.updateSelectedDevelopmentManager(lineId, request.getDevelopmentManager());
|
||||
String wantShopName = hyOpenAreaInfoDAO.selectNameMapById(lineInfo.getWantShopAreaId());
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
Long shopId = request.getShopId();
|
||||
//更改门店中的拓展经理
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
shopInfoDO.setId(shopId);
|
||||
shopInfoDO.setDevelopmentManager(request.getDevelopmentManager());
|
||||
shopInfoDAO.updateShopInfo(shopInfoDO);
|
||||
|
||||
//更新已被选择的铺位的拓展经理
|
||||
pointInfoDAO.updateSelectedDevelopmentManager(shopId, request.getDevelopmentManager());
|
||||
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("lineId", String.valueOf(lineId));
|
||||
messageMap.put("partnerUsername", lineInfo.getUsername());
|
||||
messageMap.put("partnerMobile", lineInfo.getMobile());
|
||||
messageMap.put("wantShopName", wantShopName);
|
||||
commonService.sendMessage(Arrays.asList(request.getDevelopmentManager()), MessageEnum.MESSAGE_14, messageMap);
|
||||
//删除未选择的推荐铺位
|
||||
return pointRecommendDAO.turnLineUpdateRecommendStatus(lineId, request.getDevelopmentManager());
|
||||
return pointRecommendDAO.turnLineUpdateRecommendStatus(shopId, request.getDevelopmentManager());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -694,7 +728,7 @@ public class PointServiceImpl implements PointService {
|
||||
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
|
||||
List<Long> regionIds = pointPage.getResult().stream().map(MiniPointPageDTO::getRegionId).distinct().collect(Collectors.toList());
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||
resultList = MiniPointPageVO.convertVO(pointPage, regionNameMap, request.getLineId());
|
||||
resultList = MiniPointPageVO.convertVO(pointPage, regionNameMap);
|
||||
}
|
||||
PageInfo resultPage = new PageInfo(pointPage);
|
||||
resultPage.setList(resultList);
|
||||
@@ -755,11 +789,10 @@ public class PointServiceImpl implements PointService {
|
||||
updateStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20);
|
||||
Map<String, String> templateParam = new HashMap<>();
|
||||
templateParam.put("pointName", pointInfo.getAddress());
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
}
|
||||
updateStatusList.add(selectStatus);
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, updateStatusList);
|
||||
return pointRecommendDAO.updateStatusByPointIdAndLineId(pointId, lineId);
|
||||
return pointRecommendDAO.updateStatusByPointIdAndLineId(pointId, shopId);
|
||||
} catch (ServiceException e) {
|
||||
throw e;
|
||||
} finally {
|
||||
@@ -769,7 +802,7 @@ public class PointServiceImpl implements PointService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer lineRejectPoint(RejectPointRequest request){
|
||||
return pointRecommendDAO.rejectPoint(request.getLineId(), request.getPointId(), request.getReason());
|
||||
return pointRecommendDAO.rejectPoint(request.getShopId(), request.getPointId(), request.getReason());
|
||||
}
|
||||
|
||||
|
||||
@@ -805,6 +838,7 @@ public class PointServiceImpl implements PointService {
|
||||
shopInfoDAO.updateShopInfo(shopInfo);
|
||||
PointRecommendDO pointRecommendDO = new PointRecommendDO();
|
||||
pointRecommendDO.setLineId(lineId);
|
||||
pointRecommendDO.setShopId(request.getShopId());
|
||||
pointRecommendDO.setDevelopmentManager(lineInfo.getDevelopmentManager());
|
||||
pointRecommendDO.setPointId(pointId);
|
||||
pointRecommendDO.setStatus(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode());
|
||||
@@ -885,6 +919,7 @@ public class PointServiceImpl implements PointService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer auditRentContract(AuditRentContractRequest request) {
|
||||
Long shopId = request.getShopId();
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
@@ -933,7 +968,9 @@ public class PointServiceImpl implements PointService {
|
||||
// commonService.sendMessage(Arrays.asList(lineInfo.getInvestmentManager()),MessageEnum.MESSAGE_16_1,requestMap);
|
||||
// }
|
||||
}
|
||||
return shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, subStageStatus, auditId);
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, subStageStatus, auditId);
|
||||
|
||||
return CommonConstants.ONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -998,6 +1035,67 @@ public class PointServiceImpl implements PointService {
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean linePointToShopPoint(Long lineId) {
|
||||
//查询所有的推荐 如果传入的lineId 则查询该线索的所有推荐
|
||||
List<PointRecommendDO> allRecommendPointList = pointRecommendDAO.getAllRecommendPointList(lineId);
|
||||
if (CollectionUtils.isEmpty(allRecommendPointList)){
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
List<PointRecommendDO> recommendList = new ArrayList<>();
|
||||
List<PointRecommendDO> updateList = new ArrayList<>();
|
||||
allRecommendPointList.forEach(recommend -> {
|
||||
//如果是待选择
|
||||
if(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(recommend.getStatus())||
|
||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_5.getCode().equals(recommend.getStatus())||
|
||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_6.getCode().equals(recommend.getStatus())){
|
||||
//将单条加盟商数据 分配到各个门店商
|
||||
Long tempLineId = recommend.getLineId();
|
||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(tempLineId);
|
||||
for (ShopInfoDO shopInfoDO : shopList) {
|
||||
PointRecommendDO tempPointRecommendDO = new PointRecommendDO();
|
||||
BeanUtil.copyProperties(recommend,tempPointRecommendDO);
|
||||
tempPointRecommendDO.setShopId(shopInfoDO.getId());
|
||||
recommendList.add(tempPointRecommendDO);
|
||||
}
|
||||
}
|
||||
|
||||
//已选 已被他人选择
|
||||
if(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(recommend.getStatus())){
|
||||
//查询该加盟商选择的这个店
|
||||
ShopInfoDO shopInfoByPointId = shopInfoDAO.getShopInfoByPointId(recommend.getLineId(), recommend.getPointId());
|
||||
recommend.setShopId(shopInfoByPointId.getId());
|
||||
updateList.add(recommend);
|
||||
}
|
||||
if(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(recommend.getStatus())){
|
||||
List<PointRecommendDO> recommendPointListByPointId = pointRecommendDAO.getRecommendPointListByPointId(recommend.getPointId());
|
||||
for (PointRecommendDO pointRecommendDO: recommendPointListByPointId) {
|
||||
//表示当前门店已选址
|
||||
if (pointRecommendDO.getLineId().equals(recommend.getLineId())){
|
||||
continue;
|
||||
}
|
||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(pointRecommendDO.getLineId());
|
||||
for (ShopInfoDO shopInfoDO : shopList) {
|
||||
PointRecommendDO tempPointRecommendDO = new PointRecommendDO();
|
||||
BeanUtil.copyProperties(recommend,tempPointRecommendDO);
|
||||
tempPointRecommendDO.setShopId(shopInfoDO.getId());
|
||||
recommendList.add(tempPointRecommendDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (CollectionUtils.isNotEmpty(updateList)){
|
||||
pointRecommendDAO.batchUpdateShopId(updateList);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(recommendList)){
|
||||
log.info("linePointToShopPoint recommendList:{}", JSONObject.toJSONString(recommendList));
|
||||
pointRecommendDAO.addRecommendPoint(recommendList);
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
public List<AuditNodeDTO> dealAuditNode(AuditSettingVO auditSetting, Long regionId, String developmentManager) {
|
||||
List<String> roleIds = new ArrayList<>();
|
||||
//审核人
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.cool.store.request.PostAndOrderRequest;
|
||||
import com.cool.store.response.PosAndOrderResponse;
|
||||
import com.cool.store.service.PosAndOrderInfoService;
|
||||
import com.cool.store.mapper.PosAndOrderInfoMapper;
|
||||
import com.cool.store.service.PreparationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -37,7 +38,8 @@ public class PosAndOrderInfoServiceImpl implements PosAndOrderInfoService {
|
||||
private ShopStageInfoDAO shopStageInfoDAO;
|
||||
@Autowired
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
@Autowired
|
||||
private PreparationService preparationService;
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer submitOrUpdate(PostAndOrderRequest request, String user) {
|
||||
@@ -55,6 +57,7 @@ public class PosAndOrderInfoServiceImpl implements PosAndOrderInfoService {
|
||||
} else if (request.getType().equals(PosAndOrderEnum.TENT_PASS.getCode())) {
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_245);
|
||||
}
|
||||
preparationService.updateShopStatus(request.getShopId());
|
||||
return posAndOrderInfoDAO.insertSelective(posAndOrderInfo);
|
||||
} else {
|
||||
return posAndOrderInfoDAO.updateByShopIdSelective(posAndOrderInfo);
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.MessageEnum;
|
||||
import com.cool.store.enums.SMSMsgEnum;
|
||||
import com.cool.store.enums.point.ShopStageEnum;
|
||||
import com.cool.store.enums.point.ShopStatusEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
@@ -94,8 +95,8 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
Map<Long, ShopStageInfoDO> shopStageInfoDOMap = shopContractActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
|
||||
List<ShopStageInfoDO> openActivityActualCompletionTime = shopStageInfoDAO.getOpenActivityActualCompletionTime(shopIds);
|
||||
Map<Long, ShopStageInfoDO> openActivityStageMap;
|
||||
if (openActivityActualCompletionTime !=null){
|
||||
openActivityStageMap = openActivityActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
|
||||
if (openActivityActualCompletionTime != null) {
|
||||
openActivityStageMap = openActivityActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
|
||||
} else {
|
||||
openActivityStageMap = new HashMap<>();
|
||||
}
|
||||
@@ -118,7 +119,7 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
preparationScheduleVO.setPlanOpenTime(x.getPlanOpenTime());
|
||||
preparationScheduleVO.setStoreNum(x.getStoreNum());
|
||||
preparationScheduleVO.setShopCreateTime(x.getCreateTime());
|
||||
if ( openActivityStageMap.containsKey(x.getId())) {
|
||||
if (openActivityStageMap.containsKey(x.getId())) {
|
||||
preparationScheduleVO.setOpeningActivityEndTime(DateUtils.strToDate(openActivityStageMap.get(x.getId()).getActualCompleteTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||
}
|
||||
preparationScheduleVO.setShopManagerUserName(userInfoMap.getOrDefault(x.getShopManagerUserId(), new EnterpriseUserDO()).getName());
|
||||
@@ -194,7 +195,7 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
@Override
|
||||
public PreparationProcessVO getPreparationProcess(Long shopId) {
|
||||
PreparationProcessVO preparationProcess = shopStageInfoDAO.getPreparationProcess(shopId);
|
||||
if (preparationProcess == null){
|
||||
if (preparationProcess == null) {
|
||||
return null;
|
||||
}
|
||||
preparationProcess.setTotalCount(10);
|
||||
@@ -217,7 +218,7 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90);
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_140);
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_150);
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId,list);
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,13 +230,13 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
Map<Integer, ShopStageInfoDO> shopStageInfoDOMap = shopStageInfo.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopSubStage, data -> data));
|
||||
Boolean flag3 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_153.getShopSubStageStatus().
|
||||
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
|
||||
if (flag3){
|
||||
if (flag3) {
|
||||
List<ShopSubStageStatusEnum> list = new ArrayList<>();
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_160);
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_170);
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_230);
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_240);
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId,list);
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,7 +254,7 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
|
||||
|
||||
//都完成了 初始化后续流程数据
|
||||
if (flag1&&flag2&&flag3) {
|
||||
if (flag1 && flag2 && flag3) {
|
||||
//初始化后续流程数据s
|
||||
List<ShopSubStageStatusEnum> list = new ArrayList<>();
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_180);
|
||||
@@ -261,12 +262,12 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_200);
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_210);
|
||||
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_220);
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId,list);
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
Map<String, String> templateParam = new HashMap<>();
|
||||
templateParam.put("shopName", shopInfo.getShopName());
|
||||
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.PLATFORM_BUILD_STORE,templateParam);
|
||||
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.PLATFORM_BUILD_STORE, templateParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -281,5 +282,34 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShopStatus(Long shopId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (shopInfo.getShopStatus().equals(ShopStatusEnum.ING.getCode())) {
|
||||
ScheduleDTO scheduleAll = shopStageInfoDAO.getScheduleAll(shopId);
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
if (scheduleAll.getTotalColumn().equals(scheduleAll.getCompletionColumn())) {
|
||||
shopInfoDO.setShopStatus(ShopStatusEnum.DONE.getCode());
|
||||
}
|
||||
shopInfoDO.setUpdateTime(new Date());
|
||||
shopInfoDO.setId(shopId);
|
||||
shopInfoDAO.updateShopInfo(shopInfoDO);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, Integer> getShopStatus(List<Long> shopIds) {
|
||||
List<ScheduleDTO> scheduleList = shopStageInfoDAO.getScheduleList(shopIds);
|
||||
Map<Long, Integer> map = new HashMap<>();
|
||||
scheduleList.forEach(x -> {
|
||||
if (x.getTotalColumn().equals(x.getCompletionColumn())) {
|
||||
map.put(x.getShopId(), ShopStatusEnum.DONE.getCode());
|
||||
} else {
|
||||
map.put(x.getShopId(), ShopStatusEnum.ING.getCode());
|
||||
}
|
||||
});
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,32 +1,47 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.dto.RegionNode;
|
||||
import com.cool.store.dto.openPreparation.PlanLineDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.MessageEnum;
|
||||
import com.cool.store.enums.SMSMsgEnum;
|
||||
import com.cool.store.enums.UserRoleEnum;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.*;
|
||||
import com.cool.store.enums.point.ShopStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.AddShopRequest;
|
||||
import com.cool.store.request.DeleteShopRequest;
|
||||
import com.cool.store.request.UpdateShopCodeRequest;
|
||||
import com.cool.store.service.ShopService;
|
||||
import com.cool.store.service.UserAuthMappingService;
|
||||
import com.cool.store.mapper.RegionMapper;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.BranchShopDetailResponse;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.NumberConverter;
|
||||
import com.cool.store.utils.RandomEightCharCodeUtils;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.BaseInfoVO;
|
||||
import com.cool.store.vo.shop.MiniShopPageVO;
|
||||
import com.cool.store.vo.shop.ShopStageInfoVO;
|
||||
import com.cool.store.vo.shop.StageShopCountVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cool.store.enums.ErrorCodeEnum.UPDATE_INVESTMENT_MANAGER_FAIL;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: ShopServiceImpl
|
||||
@@ -34,8 +49,10 @@ import java.util.stream.Collectors;
|
||||
* @date 2024-04-11 10:26
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ShopServiceImpl implements ShopService {
|
||||
|
||||
@Resource
|
||||
private SysRoleService sysRoleService;
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
@@ -54,17 +71,30 @@ public class ShopServiceImpl implements ShopService {
|
||||
UserAuthMappingService userAuthMappingService;
|
||||
@Autowired
|
||||
private RegionDao regionDao;
|
||||
@Autowired
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
@Resource
|
||||
private HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
|
||||
@Autowired
|
||||
private RegionMapper regionMapper;
|
||||
@Autowired
|
||||
private TransferLogService transferLogService;
|
||||
@Resource
|
||||
private RegionService regionService;
|
||||
@Resource
|
||||
PreparationService preparationService;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer initShop(LineInfoDO lineInfo) {
|
||||
if(Objects.isNull(lineInfo)){
|
||||
if (Objects.isNull(lineInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
Integer wantShopNum = lineInfo.getWantShopNum();
|
||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(lineInfo.getId());
|
||||
int shopSize = shopList.size();
|
||||
if(shopSize >= wantShopNum){
|
||||
if (shopSize >= wantShopNum) {
|
||||
return 0;
|
||||
}
|
||||
List<ShopInfoDO> addShopList = new ArrayList<>();
|
||||
@@ -74,14 +104,20 @@ public class ShopServiceImpl implements ShopService {
|
||||
shopInfo.setLineId(lineInfo.getId());
|
||||
shopInfo.setPartnerId(lineInfo.getPartnerId());
|
||||
//初始化
|
||||
shopInfo.setWantShopAreaId(lineInfo.getWantShopAreaId());
|
||||
shopInfo.setDevelopmentManager(lineInfo.getDevelopmentManager());
|
||||
shopInfo.setFranchiseBrand(lineInfo.getFranchiseBrand());
|
||||
shopInfo.setJoinMode(lineInfo.getJoinMode());
|
||||
shopInfo.setStoreNum(RandomEightCharCodeUtils.getCode());
|
||||
shopInfo.setSupervisorUserId(lineInfo.getInvestmentManager());
|
||||
shopInfo.setShopName("店铺" + NumberConverter.convertArabicToChinese(i + 1));
|
||||
shopInfo.setCreateTime(new Date());
|
||||
shopInfo.setInvestmentManager(lineInfo.getInvestmentManager());
|
||||
addShopList.add(shopInfo);
|
||||
}
|
||||
shopInfoDAO.batchAddShop(addShopList);
|
||||
List<Long> shopIds = addShopList.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
|
||||
Integer result = shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), shopIds);
|
||||
Integer result = shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), shopIds, true);
|
||||
Map<String, String> requestMap = new HashMap<>();
|
||||
// for (Long shopId : shopIds) {
|
||||
// requestMap.put("partnerName",lineInfo.getUsername());
|
||||
@@ -93,27 +129,44 @@ public class ShopServiceImpl implements ShopService {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/1/13
|
||||
* @description: 当userId为空时,表示为mini,查看所有门店,否则为pc,查询的门店跟进管辖区域进行展示 二者都不关注门店状态
|
||||
*/
|
||||
@Override
|
||||
public List<MiniShopPageVO> getShopList(Long lineId) {
|
||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(lineId);
|
||||
public List<MiniShopPageVO> getShopList(Long lineId, String userId) {
|
||||
List<Long> authRegions = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(userId) && !sysRoleService.checkIsAdmin(userId)) {
|
||||
for (String region : userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId)) {
|
||||
authRegions.add(Long.valueOf(region));
|
||||
}
|
||||
}
|
||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopListByRegion(lineId, authRegions, userId);
|
||||
List<Long> shopIds = shopList.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
|
||||
List<Long> wantShopAreaIds = shopList.stream().map(ShopInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
||||
Map<Long, String> wantRegionMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
|
||||
List<ScheduleDTO> scheduleList = shopStageInfoDAO.getScheduleList(shopIds);
|
||||
Map<Long, ScheduleDTO> scheduleMap = scheduleList.stream().collect(Collectors.toMap(ScheduleDTO::getShopId, x -> x));
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
Map<Long, ShopStageInfoDO> stageMap = subStageList.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, Function.identity()));
|
||||
List<Long> regionIds = shopList.stream().map(ShopInfoDO::getRegionId).collect(Collectors.toList());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(regionIds);
|
||||
return MiniShopPageVO.convertList(shopList,stageMap,regionNameMap);
|
||||
List<String> investmentManagerIds = shopList.stream().map(ShopInfoDO::getInvestmentManager).collect(Collectors.toList());
|
||||
Map<String, EnterpriseUserDO> userInfoMap = enterpriseUserDAO.getUserInfoMap(investmentManagerIds);
|
||||
return MiniShopPageVO.convertList(shopList, stageMap, regionNameMap, scheduleMap, wantRegionMap, userInfoMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopStageInfoVO> getShopStageInfo(Long shopId, Integer shopStage) {
|
||||
if(Objects.nonNull(shopStage)){
|
||||
if (Objects.nonNull(shopStage)) {
|
||||
ShopStageEnum shopStageEnum = ShopStageEnum.getShopStageEnum(shopStage);
|
||||
if(Objects.isNull(shopStageEnum)){
|
||||
if (Objects.isNull(shopStageEnum)) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_ERROR);
|
||||
}
|
||||
}
|
||||
List<ShopStageInfoDO> shopStageInfo = shopStageInfoDAO.getShopStageInfo(shopId, shopStage);
|
||||
List<Long> auditIds = shopStageInfo.stream().filter(o->Objects.nonNull(o.getAuditId())).map(ShopStageInfoDO::getAuditId).distinct().collect(Collectors.toList());
|
||||
List<Long> auditIds = shopStageInfo.stream().filter(o -> Objects.nonNull(o.getAuditId())).map(ShopStageInfoDO::getAuditId).distinct().collect(Collectors.toList());
|
||||
List<ShopAuditInfoDO> auditList = shopAuditInfoDAO.getAuditInfoList(auditIds);
|
||||
return ShopStageInfoVO.convertList(shopStageInfo, auditList);
|
||||
}
|
||||
@@ -126,7 +179,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
@Override
|
||||
public Integer deleteShop(DeleteShopRequest request) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
if(Objects.nonNull(shopInfo)){
|
||||
if (Objects.nonNull(shopInfo)) {
|
||||
//进入选址不允许删除操作
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
@@ -134,9 +187,9 @@ public class ShopServiceImpl implements ShopService {
|
||||
// if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){
|
||||
// throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
// }
|
||||
if(Objects.nonNull(shopInfo.getPointId())){
|
||||
if (Objects.nonNull(shopInfo.getPointId())) {
|
||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(shopInfo.getPointId());
|
||||
if(Objects.nonNull(pointInfo) && SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
||||
if (Objects.nonNull(pointInfo) && SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) {
|
||||
pointInfoDAO.recyclePoint(pointInfo.getId());
|
||||
}
|
||||
pointRecommendDAO.updateRecommendStatus(shopInfo.getPointId(), PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1, Arrays.asList(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_5));
|
||||
@@ -151,7 +204,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long addShop(AddShopRequest request) {
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
if(Objects.isNull(lineInfo)){
|
||||
if (Objects.isNull(lineInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
List<String> shopNameList = request.getShopNameList();
|
||||
@@ -168,30 +221,267 @@ public class ShopServiceImpl implements ShopService {
|
||||
addShop.setPartnerId(lineInfo.getPartnerId());
|
||||
addShop.setShopName(shopName);
|
||||
addShop.setSupervisorUserId(lineInfo.getInvestmentManager());
|
||||
addShop.setInvestmentManager(lineInfo.getInvestmentManager());
|
||||
addShop.setDevelopmentManager(lineInfo.getInvestmentManager());
|
||||
addShopList.add(addShop);
|
||||
}
|
||||
shopInfoDAO.batchAddShop(addShopList);
|
||||
List<Long> shopIds = addShopList.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
|
||||
shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), shopIds);
|
||||
shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), shopIds, true);
|
||||
return 1L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopInfoDO getShopInfo(Long shopId) {
|
||||
|
||||
return shopInfoDAO.getShopInfo(shopId);
|
||||
return shopInfoDAO.getShopInfo(shopId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateShopCode(UpdateShopCodeRequest request) {
|
||||
public Integer updateShopCode(UpdateShopCodeRequest request, String userId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
if(Objects.isNull(shopInfo)){
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||
}
|
||||
shopInfo.setShopCode(request.getShopCode());
|
||||
shopInfo.setShopName(request.getShopName());
|
||||
shopInfo.setUpdateTime(new Date());
|
||||
shopInfo.setUpdateUserId(userId);
|
||||
shopInfo.setRegionId(request.getRegionId());
|
||||
return shopInfoDAO.updateShopInfo(shopInfo);
|
||||
return shopInfoDAO.updateShopInfo(shopInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long addBranchShop(AddBranchShopRequest request, String userId) {
|
||||
if (StringUtils.isBlank(request.getInvestmentManagerUserId())) {
|
||||
request.setInvestmentManagerUserId(userId);
|
||||
}
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
if (lineInfo.getWorkflowSubStageStatus() < WorkflowSubStageStatusEnum.PAY_DEPOSIT_45.getCode()) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopInfoDO shopInfoDO = request.toDO(request, lineInfo);
|
||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(lineInfo.getId());
|
||||
if(StringUtils.isBlank(request.getShopName())){
|
||||
if (CollectionUtils.isNotEmpty(shopList)) {
|
||||
shopInfoDO.setShopName("店铺"+NumberConverter.convertArabicToChinese(lineInfo.getWantShopNum() + 1));
|
||||
}else{
|
||||
shopInfoDO.setShopName("店铺"+NumberConverter.convertArabicToChinese(lineInfo.getWantShopNum()));
|
||||
}
|
||||
}else{
|
||||
shopInfoDO.setShopName(request.getShopName());
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(shopList)) {
|
||||
lineInfo.setWantShopNum(lineInfo.getWantShopNum() + 1);
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
}
|
||||
shopInfoDO.setCreateUserId(userId);
|
||||
Long shopId = shopInfoDAO.addShopInfo(shopInfoDO);
|
||||
if (lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode())) {
|
||||
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), true);
|
||||
} else {
|
||||
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), false);
|
||||
}
|
||||
return shopId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BranchShopDetailResponse getBranchShopDetail(Long shopId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
if (Objects.isNull(lineInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
EnterpriseUserDO invest = enterpriseUserDAO.getUserInfoById(shopInfo.getInvestmentManager());
|
||||
List<ScheduleDTO> shopContractActualCompletionTime = shopStageInfoDAO.getScheduleList(Collections.singletonList(shopId));
|
||||
RegionNode shopRegion = regionMapper.getRegionByRegionId(shopInfo.getRegionId().toString());
|
||||
String wantShopArea = hyOpenAreaInfoDAO.selectNameMapById(shopInfo.getWantShopAreaId());
|
||||
HyOpenAreaInfoDO hyOpenAreaInfoDO = hyOpenAreaInfoDAO.selectById(shopInfo.getWantShopAreaId());
|
||||
BranchShopDetailResponse response = new BranchShopDetailResponse();
|
||||
response.setUsername(lineInfo.getUsername());
|
||||
response.setMobile(lineInfo.getMobile());
|
||||
response.setShopId(shopId);
|
||||
response.setShopName(shopInfo.getShopName());
|
||||
response.setJoinMode(shopInfo.getJoinMode());
|
||||
response.setShopCode(shopInfo.getShopCode());
|
||||
response.setShopStatus(shopInfo.getShopStatus());
|
||||
response.setFranchiseBrand(shopInfo.getFranchiseBrand());
|
||||
if (CollectionUtils.isNotEmpty(shopContractActualCompletionTime)) {
|
||||
ScheduleDTO scheduleDTO = shopContractActualCompletionTime.get(CommonConstants.ZERO);
|
||||
response.setCompletionColumn(scheduleDTO.getCompletionColumn());
|
||||
response.setTotalColumn(scheduleDTO.getTotalColumn());
|
||||
response.setPlanCompletionTime(scheduleDTO.getPlanCompleteTime());
|
||||
}
|
||||
response.setInvestmentManagerId(shopInfo.getInvestmentManager());
|
||||
response.setInvestmentManagerName(invest.getName());
|
||||
response.setRegionId(shopInfo.getRegionId());
|
||||
response.setWantRegionId(shopInfo.getWantShopAreaId());
|
||||
response.setRegionName(shopRegion.getName());
|
||||
response.setWantRegionName(wantShopArea);
|
||||
response.setWantRegionParentId(hyOpenAreaInfoDO.getParentId());
|
||||
response.setPointId(shopInfo.getPointId());
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateBranchShopDetail(BranchShopDetailRequest request, String userId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
shopInfo.setUpdateUserId(userId);
|
||||
shopInfo.setUpdateTime(new Date());
|
||||
shopInfo.setShopCode(request.getShopCode());
|
||||
shopInfo.setShopName(request.getShopName());
|
||||
shopInfo.setWantShopAreaId(request.getWantShopAreaId());
|
||||
shopInfo.setRegionId(request.getRegionId());
|
||||
shopInfo.setJoinMode(request.getJoinMode());
|
||||
shopInfo.setFranchiseBrand(request.getFranchiseBrand());
|
||||
return shopInfoDAO.updateShopInfo(shopInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer updateShopInvestment(Long shopId, String updateUserId, String userId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (updateUserId.equals(shopInfo.getInvestmentManager())) {
|
||||
throw new ServiceException(UPDATE_INVESTMENT_MANAGER_FAIL);
|
||||
}
|
||||
transferLogService.addLog(shopInfo.getId(), shopInfo.getPartnerId(), shopInfo.getInvestmentManager(), updateUserId, OperationLogTypeEnum.TRANSFER_INVESTMENT_MANAGER_4);
|
||||
shopInfo.setUpdateTime(new Date());
|
||||
shopInfo.setUpdateUserId(userId);
|
||||
shopInfo.setInvestmentManager(updateUserId);
|
||||
shopInfo.setDevelopmentManager(updateUserId);
|
||||
shopInfo.setSupervisorUserId(updateUserId);
|
||||
return shopInfoDAO.updateShopInfo(shopInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean shopClose(Long shopId) {
|
||||
log.info("shopClose shopId:{}", shopId);
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
//只有跟进中才能结束跟进
|
||||
if (ShopStatusEnum.ING.getCode() != shopInfo.getShopStatus()) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_STATUS_NOT_SUPPORT_HANDLER, ShopStatusEnum.getDesc(shopInfo.getShopStatus()));
|
||||
}
|
||||
shopInfo.setShopStatus(ShopStatusEnum.ABANDON.getCode());
|
||||
shopInfoDAO.updateShopInfo(shopInfo);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId) {
|
||||
if (request.getFlag().equals(CommonConstants.TWO)) {
|
||||
if (!sysRoleService.checkIsAdmin(userId)) {
|
||||
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId));
|
||||
if (CollectionUtils.isEmpty(request.getAuthRegionIds())) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(request.getRegionIds())) {
|
||||
if (request.getRegionIds().contains(CommonConstants.ROOT_DEPT_ID_STR)) {
|
||||
request.setRegionIds(null);
|
||||
} else {
|
||||
request.setRegionIds(regionService.getSubRegionIdsByRegionIds(request.getRegionIds()));
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(request.getWantShopAreaId())) {
|
||||
List<Long> childrenListByParentIds = hyOpenAreaInfoDAO.getChildrenListByParentIds(request.getWantShopAreaId());
|
||||
childrenListByParentIds.addAll(request.getWantShopAreaId());
|
||||
request.setWantShopAreaAllIds(childrenListByParentIds);
|
||||
}
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<BranchShopResponse> responses = new ArrayList<>();
|
||||
List<PreparationDTO> preparations = shopInfoDAO.ListByBranchShopRequest(request,userId);
|
||||
PageInfo pageInfo = new PageInfo<>(preparations);
|
||||
if (CollectionUtils.isEmpty(preparations)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
List<Long> regionIds = preparations.stream().map(PreparationDTO::getRegionId).collect(Collectors.toList());
|
||||
List<Long> wantShopAreaIds = preparations.stream().map(PreparationDTO::getWantShopAreaId).collect(Collectors.toList());
|
||||
List<String> investmentManagerIds = preparations.stream().map(PreparationDTO::getInvestmentManager).collect(Collectors.toList());
|
||||
List<Long> shopIds = preparations.stream().map(PreparationDTO::getId).collect(Collectors.toList());
|
||||
List<ScheduleDTO> scheduleList = shopStageInfoDAO.getScheduleList(shopIds);
|
||||
Map<Long, ScheduleDTO> scheduleMap = scheduleList.stream().collect(Collectors.toMap(ScheduleDTO::getShopId, x -> x));
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||
Map<String, EnterpriseUserDO> userInfoMap = enterpriseUserDAO.getUserInfoMap(investmentManagerIds);
|
||||
Map<Long, String> wantRegionMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
|
||||
List<ShopStageInfoDO> openActivityActualCompletionTime = shopStageInfoDAO.getOpenActivityActualCompletionTime(shopIds);
|
||||
Map<Long, ShopStageInfoDO> openActivityStageMap = openActivityActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
|
||||
for (PreparationDTO dto : preparations) {
|
||||
BranchShopResponse response = new BranchShopResponse();
|
||||
response.setShopId(dto.getId());
|
||||
response.setLineId(dto.getLineId());
|
||||
response.setUsername(dto.getUsername());
|
||||
response.setMobile(dto.getMobile());
|
||||
response.setShopName(dto.getShopName());
|
||||
response.setShopCode(dto.getShopCode());
|
||||
response.setRegionName(regionNameMap.getOrDefault(dto.getRegionId(), ""));
|
||||
response.setFranchiseBrand(dto.getFranchiseBrand());
|
||||
response.setJoinMode(dto.getJoinMode());
|
||||
response.setWantRegionName(wantRegionMap.getOrDefault(dto.getWantShopAreaId(), ""));
|
||||
response.setPlanOpenTime(dto.getPlanOpenTime());
|
||||
ScheduleDTO scheduleDTO = scheduleMap.getOrDefault(dto.getId(), new ScheduleDTO());
|
||||
response.setTotalColumn(scheduleDTO.getTotalColumn());
|
||||
response.setCompletionColumn(scheduleDTO.getCompletionColumn());
|
||||
response.setOpeningActivityEndTime(DateUtils.strToDate(openActivityStageMap.getOrDefault(dto.getId(), new ShopStageInfoDO()).getActualCompleteTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||
response.setInvestmentManagerName(userInfoMap.getOrDefault(dto.getInvestmentManager(), new EnterpriseUserDO()).getName());
|
||||
response.setShopStatus(ShopStatusEnum.getDesc(dto.getShopStatus()));
|
||||
response.setCreateTime(dto.getCreateTime());
|
||||
response.setDays();
|
||||
responses.add(response);
|
||||
}
|
||||
pageInfo.setList(responses);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据处理
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean dataHandler(Long lineId) {
|
||||
log.info("------dataHandle start-----");
|
||||
boolean hasNext = true;
|
||||
int pageNum = 1;
|
||||
int pageSize = 50;
|
||||
while (hasNext) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<ShopInfoDO> shopInfoDOS = shopInfoDAO.selectAllDataOrByLineId(lineId);
|
||||
if (CollectionUtils.isEmpty(shopInfoDOS)) {
|
||||
log.info("------dataHandle end------");
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
Set<Long> lineIds = shopInfoDOS.stream().map(ShopInfoDO::getLineId).collect(Collectors.toSet());
|
||||
List<LineInfoDO> lines = lineInfoDAO.getByLineIds(new ArrayList<>(lineIds));
|
||||
//转为map
|
||||
Map<Long, LineInfoDO> lineMap = lines.stream().collect(Collectors.toMap(LineInfoDO::getId, line -> line));
|
||||
List<Long> shopIds = shopInfoDOS.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
|
||||
Map<Long, Integer> shopStatus = preparationService.getShopStatus(shopIds);
|
||||
for (ShopInfoDO shopInfoDO : shopInfoDOS) {
|
||||
LineInfoDO lineInfoDO = lineMap.get(shopInfoDO.getLineId());
|
||||
if (lineInfoDO == null) {
|
||||
continue;
|
||||
}
|
||||
shopInfoDO.setDevelopmentManager(lineInfoDO.getDevelopmentManager());
|
||||
shopInfoDO.setShopStatus(shopStatus.get(shopInfoDO.getId()));
|
||||
shopInfoDO.setJoinMode(lineInfoDO.getJoinMode());
|
||||
shopInfoDO.setFranchiseBrand(lineInfoDO.getFranchiseBrand());
|
||||
shopInfoDO.setInvestmentManager(lineInfoDO.getInvestmentManager());
|
||||
shopInfoDO.setWantShopAreaId(lineInfoDO.getWantShopAreaId());
|
||||
}
|
||||
shopInfoDAO.batchUpdate(shopInfoDOS);
|
||||
log.info("------shopInfoDOS:{}------", JSONObject.toJSONString(shopInfoDOS));
|
||||
hasNext = shopInfoDOS.size() >= pageSize;
|
||||
pageNum++;
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -201,6 +201,7 @@ public class TempUserDetailServiceImpl implements TempUserDetailService {
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_51);
|
||||
//状态结束
|
||||
preparationService.whetherToOpenForAcceptance(shopId);
|
||||
preparationService.updateShopStatus(shopId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.service.impl;
|
||||
import com.cool.store.dao.TransferLogDAO;
|
||||
import com.cool.store.dto.TransferLogDTO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.entity.TransferLogDO;
|
||||
import com.cool.store.enums.OperationLogTypeEnum;
|
||||
import com.cool.store.service.TransferLogService;
|
||||
@@ -25,10 +26,10 @@ public class TransferLogServiceImpl implements TransferLogService {
|
||||
private TransferLogDAO transferLogDAO;
|
||||
|
||||
@Override
|
||||
public void addLog(LineInfoDO lineInfoDO, String formUserId, String toUserId, OperationLogTypeEnum operationLogTypeEnum) {
|
||||
public void addLog(Long id ,String partnerId, String formUserId, String toUserId, OperationLogTypeEnum operationLogTypeEnum) {
|
||||
TransferLogDO transferLogDO = new TransferLogDO();
|
||||
transferLogDO.setLineId(lineInfoDO.getId());
|
||||
transferLogDO.setPartnerId(lineInfoDO.getPartnerId());
|
||||
transferLogDO.setLineId(id);
|
||||
transferLogDO.setPartnerId(partnerId);
|
||||
transferLogDO.setFromUserId(formUserId);
|
||||
transferLogDO.setToUserId(toUserId);
|
||||
transferLogDO.setType(operationLogTypeEnum.getCode());
|
||||
@@ -38,10 +39,11 @@ public class TransferLogServiceImpl implements TransferLogService {
|
||||
transferLogDAO.add(transferLogDO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<TransferLogDTO> getTransferLogPage(Integer pageNum, Integer pageSize, Long lineId) {
|
||||
public PageInfo<TransferLogDTO> getTransferLogPage(Integer pageNum, Integer pageSize, Long lineId,Integer lineShopType) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<TransferLogDTO> transferLogList = transferLogDAO.getTransferLogList(lineId);
|
||||
List<TransferLogDTO> transferLogList = transferLogDAO.getTransferLogList(lineId,lineShopType);
|
||||
PageInfo<TransferLogDTO> transferLogDTOPageInfo = new PageInfo<>(transferLogList);
|
||||
return transferLogDTOPageInfo;
|
||||
}
|
||||
|
||||
@@ -178,6 +178,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
* @return 解析后时间
|
||||
*/
|
||||
public static Date strToDate(String strDate, String pattern) {
|
||||
if (StringUtils.isBlank(strDate)){
|
||||
return null;
|
||||
}
|
||||
SimpleDateFormat formatter = new SimpleDateFormat(pattern);
|
||||
ParsePosition pos = new ParsePosition(0);
|
||||
return formatter.parse(strDate, pos);
|
||||
|
||||
@@ -39,29 +39,6 @@ public class DeskController {
|
||||
return ResponseResult.success(deskService.intendPendingList(pageNumber,pageSize,userInfo.getUserId()));
|
||||
}
|
||||
|
||||
@ApiOperation("待处理-邀约面谈")
|
||||
@GetMapping("/interviewPendingList")
|
||||
public ResponseResult<PageInfo<InterviewPendingVO>> interviewPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
|
||||
LoginUserInfo userInfo = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(deskService.interviewPendingList(pageNumber,pageSize,userInfo.getUserId()));
|
||||
}
|
||||
|
||||
@ApiOperation("待处理-一审")
|
||||
@GetMapping("/firstInterviewPendingList")
|
||||
public ResponseResult<PageInfo<InterviewPendingVO>> firstInterviewPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
|
||||
LoginUserInfo userInfo = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(deskService.firstInterviewPendingList(pageNumber,pageSize,userInfo));
|
||||
}
|
||||
|
||||
@ApiOperation("待处理-二审")
|
||||
@GetMapping("/secondInterviewPendingList")
|
||||
public ResponseResult<PageInfo<InterviewPendingVO>> secondInterviewPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
|
||||
LoginUserInfo userInfo = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(deskService.secondInterviewPendingList(pageNumber,pageSize,userInfo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("待处理-缴纳意向金")
|
||||
@@ -80,13 +57,6 @@ public class DeskController {
|
||||
return ResponseResult.success(deskService.signingPendingList(pageNumber,pageSize,userInfo));
|
||||
}
|
||||
|
||||
@ApiOperation("待处理-实训体验")
|
||||
@GetMapping("/storeExperiencePendingList")
|
||||
public ResponseResult<PageInfo<StoreExperiencePendingVO>> storeExperiencePendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
|
||||
LoginUserInfo userInfo = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(deskService.storeExperiencePendingList(pageNumber,pageSize,userInfo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("待处理-数据")
|
||||
@@ -105,13 +75,6 @@ public class DeskController {
|
||||
return ResponseResult.success(deskService.getInvestmentCount(userInfo));
|
||||
}
|
||||
|
||||
@ApiOperation("待处理-系统建店")
|
||||
@GetMapping("/systemBuildStorePendingList")
|
||||
public ResponseResult<PageInfo<PreparationCommonPendingVO>> systemBuildStorePendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
|
||||
LoginUserInfo userInfo = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(deskService.systemBuildStorePendingList(pageNumber,pageSize,userInfo));
|
||||
}
|
||||
@ApiOperation("待处理-支付加盟费保证金")
|
||||
@GetMapping("/payFranchiseFeesPendingList")
|
||||
public ResponseResult<PageInfo<PreparationCommonPendingVO>> payFranchiseFeesPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
|
||||
@@ -141,13 +104,6 @@ public class DeskController {
|
||||
LoginUserInfo userInfo = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(deskService.openingAndOperationPlanPendingList(pageNumber,pageSize,userInfo));
|
||||
}
|
||||
@ApiOperation("待处理-首批订货清单")
|
||||
@GetMapping("/firstOrderListPendingList")
|
||||
public ResponseResult<PageInfo<PreparationCommonPendingVO>> firstOrderListPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
|
||||
LoginUserInfo userInfo = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(deskService.firstOrderListPendingList(pageNumber,pageSize,userInfo));
|
||||
}
|
||||
|
||||
@ApiOperation("待处理-培训登记")
|
||||
@GetMapping("/trainListPendingList")
|
||||
|
||||
@@ -28,10 +28,16 @@ public class ExportController {
|
||||
private ExportService exportService;
|
||||
|
||||
|
||||
// @PostMapping("/preparationList")
|
||||
// @ApiOperation("进度管理")
|
||||
// public ResponseResult preparationList(@RequestBody BranchShopRequest request) {
|
||||
// return ResponseResult.success(exportService.branchShopList(request, CurrentUserHolder.getUser()));
|
||||
// }
|
||||
|
||||
|
||||
@PostMapping("/preparationList")
|
||||
@ApiOperation("进度管理")
|
||||
public ResponseResult preparationList(@RequestBody PreparationRequest request) {
|
||||
request.setCurUserId(CurrentUserHolder.getUserId());
|
||||
return ResponseResult.success(exportService.preparationList(request, CurrentUserHolder.getUser()));
|
||||
public ResponseResult preparationList(@RequestBody BranchShopRequest request) {
|
||||
return ResponseResult.success(exportService.branchShopList(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,10 +62,10 @@ public class LineAuditController {
|
||||
return ResponseResult.success(bankService.repayment(request));
|
||||
}
|
||||
|
||||
@ApiOperation("结束跟进")
|
||||
@PostMapping("/close")
|
||||
public ResponseResult<Boolean> auditClose(@RequestBody AuditCloseRequest request){
|
||||
return ResponseResult.success(lineFlowService.auditClose(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
// @ApiOperation("结束跟进")
|
||||
// @PostMapping("/close")
|
||||
// public ResponseResult<Boolean> auditClose(@RequestBody AuditCloseRequest request){
|
||||
// return ResponseResult.success(lineFlowService.auditClose(request, CurrentUserHolder.getUser()));
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.cool.store.vo.log.LineFollowLogVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.boot.context.properties.bind.DefaultValue;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -29,8 +30,8 @@ public class LineFollowController {
|
||||
|
||||
@ApiOperation("跟进日志分页")
|
||||
@GetMapping("/page")
|
||||
public ResponseResult<PageInfo<LineFollowLogVO>> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize){
|
||||
return ResponseResult.success(lineFollowService.getFollowLogPage(lineId, pageNum, pageSize));
|
||||
public ResponseResult<PageInfo<LineFollowLogVO>> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize, @RequestParam(value = "type",defaultValue = "1") Integer type){
|
||||
return ResponseResult.success(lineFollowService.getFollowLogPage(lineId, pageNum, pageSize,type));
|
||||
}
|
||||
|
||||
@ApiOperation("新增跟进日志")
|
||||
|
||||
@@ -118,12 +118,14 @@ public class LineInfoController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "lineId", value = "线索id", required = true),
|
||||
@ApiImplicitParam(name = "pageNum", value = "页码", required = true),
|
||||
@ApiImplicitParam(name = "pageSize", value = "大小", required = true)
|
||||
@ApiImplicitParam(name = "pageSize", value = "大小", required = true),
|
||||
@ApiImplicitParam(name = "lineShopType", value = "1-线索,2-门店", required = false)
|
||||
})
|
||||
public ResponseResult<PageInfo<TransferLogDTO>> getTransferLogPage(@RequestParam("lineId")Long lineId,
|
||||
@RequestParam(value = "pageNum" ,defaultValue = "1")Integer pageNum,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize) {
|
||||
return ResponseResult.success(transferLogService.getTransferLogPage(pageNum,pageSize,lineId));
|
||||
@RequestParam(value = "pageNum" ,defaultValue = "1")Integer pageNum,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize,
|
||||
@RequestParam(value = "lineShopType",defaultValue = "1") Integer lineShopType) {
|
||||
return ResponseResult.success(transferLogService.getTransferLogPage(pageNum,pageSize,lineId,lineShopType));
|
||||
}
|
||||
|
||||
@ApiOperation("查询意向金详情")
|
||||
@@ -172,5 +174,9 @@ public class LineInfoController {
|
||||
return ResponseResult.success(linePayService.skipPay(lineId,CurrentUserHolder.getUser()));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询加盟商")
|
||||
@PostMapping("/getLines")
|
||||
public ResponseResult<PageInfo<LineVO>> getLines(@RequestBody LinesRequest request) {
|
||||
return ResponseResult.success(lineService.getLines(request));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.request.AddShopRequest;
|
||||
import com.cool.store.request.DeleteShopRequest;
|
||||
import com.cool.store.request.UpdateShopCodeRequest;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.dto.TransferLogDTO;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.BranchShopDetailResponse;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.ShopService;
|
||||
import com.cool.store.service.TransferLogService;
|
||||
import com.cool.store.vo.shop.MiniShopPageVO;
|
||||
import com.cool.store.vo.shop.ShopStageInfoVO;
|
||||
import com.cool.store.vo.shop.StageShopCountVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -29,22 +35,24 @@ public class PCShopController {
|
||||
|
||||
@Resource
|
||||
private ShopService shopService;
|
||||
@Resource
|
||||
private TransferLogService transferLogService;
|
||||
|
||||
@ApiOperation("获取店铺列表")
|
||||
@GetMapping("/getShopList")
|
||||
public ResponseResult<List<MiniShopPageVO>> getShopList(@RequestParam("lineId")Long lineId) {
|
||||
return ResponseResult.success(shopService.getShopList(lineId));
|
||||
public ResponseResult<List<MiniShopPageVO>> getShopList(@RequestParam("lineId") Long lineId) {
|
||||
return ResponseResult.success(shopService.getShopList(lineId, CurrentUserHolder.getUserId()));
|
||||
}
|
||||
|
||||
@ApiOperation("获取各个阶段店铺数量")
|
||||
@GetMapping("/getStageShopCount")
|
||||
public ResponseResult<StageShopCountVO> getStageShopCount(@RequestParam("lineId")Long lineId) {
|
||||
public ResponseResult<StageShopCountVO> getStageShopCount(@RequestParam("lineId") Long lineId) {
|
||||
return ResponseResult.success(shopService.getStageShopCount(lineId));
|
||||
}
|
||||
|
||||
@ApiOperation("获取店铺的阶段信息")
|
||||
@GetMapping("/getShopStageInfo")
|
||||
public ResponseResult<List<ShopStageInfoVO>> getShopStageInfo(@RequestParam("shopId")Long shopId, @RequestParam(value = "shopStage", required = false)Integer shopStage) {
|
||||
public ResponseResult<List<ShopStageInfoVO>> getShopStageInfo(@RequestParam("shopId") Long shopId, @RequestParam(value = "shopStage", required = false) Integer shopStage) {
|
||||
return ResponseResult.success(shopService.getShopStageInfo(shopId, shopStage));
|
||||
}
|
||||
|
||||
@@ -57,13 +65,64 @@ public class PCShopController {
|
||||
@ApiOperation("新增店铺")
|
||||
@PostMapping("/addShop")
|
||||
public ResponseResult<Long> addShop(@RequestBody @Validated AddShopRequest request) {
|
||||
request.setUserId(CurrentUserHolder.getUserId());
|
||||
return ResponseResult.success(shopService.addShop(request));
|
||||
}
|
||||
|
||||
@ApiOperation("修改门店编号和门店名称和门店所属区域")
|
||||
@PostMapping("/updateShopCode")
|
||||
public ResponseResult<Integer> updateShopCode(@RequestBody @Validated UpdateShopCodeRequest request) {
|
||||
return ResponseResult.success(shopService.updateShopCode(request));
|
||||
return ResponseResult.success(shopService.updateShopCode(request, CurrentUserHolder.getUserId()));
|
||||
}
|
||||
|
||||
@ApiOperation("新建分店")
|
||||
@PostMapping("/addBranchShop")
|
||||
public ResponseResult<Long> addBranchShop(@RequestBody @Validated AddBranchShopRequest request) {
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
return ResponseResult.success(shopService.addBranchShop(request, userId));
|
||||
}
|
||||
|
||||
@ApiOperation("开店详情/左边小窗")
|
||||
@GetMapping("/getBranchShopDetail")
|
||||
public ResponseResult<BranchShopDetailResponse> getBranchShopDetail(@RequestParam("shopId") Long shopId) {
|
||||
return ResponseResult.success(shopService.getBranchShopDetail(shopId));
|
||||
}
|
||||
|
||||
@ApiOperation("修改开店详情/左边小窗")
|
||||
@PostMapping("/updateBranchShopDetail")
|
||||
public ResponseResult<Integer> updateBranchShopDetail(@RequestBody @Validated BranchShopDetailRequest request) {
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
return ResponseResult.success(shopService.updateBranchShopDetail(request, userId));
|
||||
}
|
||||
|
||||
@ApiOperation("门店转让,修改门店招商专员/督导")
|
||||
@GetMapping("/updateShopInvestment")
|
||||
public ResponseResult<Integer> updateShopInvestment(@RequestParam("shopId") Long shopId, @RequestParam("updateUserId") String updateUserId) {
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
return ResponseResult.success(shopService.updateShopInvestment(shopId, updateUserId, userId));
|
||||
}
|
||||
|
||||
@ApiOperation("门店转让记录")
|
||||
@GetMapping("/getTransferLogPage")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "lineId", value = "线索id", required = true),
|
||||
@ApiImplicitParam(name = "pageNum", value = "页码", required = true),
|
||||
@ApiImplicitParam(name = "pageSize", value = "大小", required = true),
|
||||
@ApiImplicitParam(name = "lineShopType", value = "1-线索,2-门店", required = true)
|
||||
})
|
||||
public ResponseResult<PageInfo<TransferLogDTO>> getTransferLogPage(@RequestParam("lineId") Long lineId,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(value = "lineShopType", defaultValue = "1") Integer lineShopType) {
|
||||
return ResponseResult.success(transferLogService.getTransferLogPage(pageNum, pageSize, lineId, lineShopType));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation("门店结束跟进")
|
||||
@GetMapping("/shopClose")
|
||||
public ResponseResult<Boolean> shopClose(@RequestParam("shopId")Long shopId) {
|
||||
return ResponseResult.success(shopService.shopClose(shopId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@ package com.cool.store.controller.webb;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.dto.point.ShopPointDTO;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.PointService;
|
||||
import com.cool.store.vo.LinePointBaseInfoVO;
|
||||
import com.cool.store.vo.point.*;
|
||||
import com.cool.store.vo.shop.ShopPointBaseInfoVO;
|
||||
import com.cool.store.vo.shop.ShopStageVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -126,6 +128,14 @@ public class PointController {
|
||||
return ResponseResult.success(pointService.getLinePage(request));
|
||||
}
|
||||
|
||||
@ApiOperation("查询我负责的门店列表-门店的选址经理是我")
|
||||
@PostMapping("/getShopPage")
|
||||
public ResponseResult<PageInfo<ShopPointBaseInfoVO>> getShopPage(@RequestBody PointLinePageRequest request) {
|
||||
request.setDevelopmentManager(CurrentUserHolder.getUserId());
|
||||
return ResponseResult.success(pointService.getShopPage(request));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取单个加盟商选址数据")
|
||||
@GetMapping("/getLineInfo")
|
||||
public ResponseResult<LinePointBaseInfoVO> getLineInfo(@RequestParam("lineId") Long lineId) {
|
||||
@@ -158,12 +168,20 @@ public class PointController {
|
||||
return ResponseResult.success(pointService.getPointAllAuditRecord(pointId));
|
||||
}
|
||||
|
||||
@ApiOperation("获取加盟商的推荐铺位列表")
|
||||
@ApiOperation("获取加盟商的推荐铺位列表-V2.4废弃")
|
||||
@GetMapping("/getLineRecommendPointList")
|
||||
@Deprecated
|
||||
public ResponseResult<List<PointRecommendPageVO>> getLineRecommendPointList(@RequestParam("lineId")Long lineId) {
|
||||
return ResponseResult.success(pointService.getLineRecommendPointList(lineId));
|
||||
}
|
||||
|
||||
@ApiOperation("获取门店的推荐铺位列表-V2.4新增")
|
||||
@GetMapping("/getShopRecommendPointList")
|
||||
public ResponseResult<List<PointRecommendPageVO>> getShopRecommendPointList(@RequestParam("shopId")Long shopId) {
|
||||
return ResponseResult.success(pointService.getShopRecommendPointList(shopId));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("选址人员获取可推荐铺位列表")
|
||||
@PostMapping("/getRecommendPointList")
|
||||
public ResponseResult<PageInfo<PointPageVO>> getRecommendPointList(@RequestBody @Validated RecommendPointPageRequest request) {
|
||||
@@ -171,21 +189,21 @@ public class PointController {
|
||||
return ResponseResult.success(pointService.getRecommendPointList(request));
|
||||
}
|
||||
|
||||
@ApiOperation("加盟商详情推送铺位")
|
||||
@ApiOperation("加盟商详情推送铺位->v2.4 门店详情推荐铺位")
|
||||
@PostMapping("/lineRecommendPoint")
|
||||
public ResponseResult<Integer> lineRecommendPoint(@RequestBody @Validated LineRecommendPointRequest request) {
|
||||
request.setDevelopmentManager(CurrentUserHolder.getUserId());
|
||||
return ResponseResult.success(pointService.lineRecommendPoint(request));
|
||||
}
|
||||
|
||||
@ApiOperation("铺位详情推送加盟商")
|
||||
@ApiOperation("铺位详情推送加盟商->v2.4 铺位详情推送门店")
|
||||
@PostMapping("/pointRecommendLine")
|
||||
public ResponseResult<Integer> pointRecommendLine(@RequestBody @Validated PointRecommendLineRequest request) {
|
||||
request.setDevelopmentManager(CurrentUserHolder.getUserId());
|
||||
return ResponseResult.success(pointService.pointRecommendLine(request));
|
||||
}
|
||||
|
||||
@ApiOperation("选址人员转让加盟商")
|
||||
@ApiOperation("选址人员转让加盟商->v2.4 选址人员转让门店选址经理")
|
||||
@PostMapping("/turnLine")
|
||||
public ResponseResult<Integer> turnLine(@RequestBody @Validated TurnLineRequest request) {
|
||||
return ResponseResult.success(pointService.turnLine(request));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user