成功开店代码改造

This commit is contained in:
shuo.wang
2025-07-03 10:58:37 +08:00
parent 80966b3ddb
commit 8a4dd5693e
5 changed files with 62 additions and 40 deletions

View File

@@ -0,0 +1,22 @@
package com.cool.store.request;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @Author: WangShuo
* @Date: 2025/07/03/10:54
* @Version 1.0
* @注释:
*/
@Data
public class ShopListSuccessOpenRequest {
@NotNull
private Long lineId;
private Integer pageNum = 1;
private Integer pageSize = 10 ;
private String storeName;
}

View File

@@ -107,7 +107,7 @@ public interface ShopService {
Boolean dataHandler(Long shopId); Boolean dataHandler(Long shopId);
PageInfo<MiniShopsResponse> getShopListSuccessOpen(Long lineId,Integer pageNum,Integer pageSize,String storeName); PageInfo<MiniShopsResponse> getShopListSuccessOpen(ShopListSuccessOpenRequest request);
ShopResponse getShopNameAndCode(Long shopId,Long lineId); ShopResponse getShopNameAndCode(Long shopId,Long lineId);

View File

@@ -236,16 +236,16 @@ public class ShopServiceImpl implements ShopService {
// //进入选址不允许删除操作 // //进入选址不允许删除操作
// throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE); // throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
// } // }
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfo.getId(), ShopSubStageEnum.SHOP_STAGE_7); ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfo.getId(), ShopSubStageEnum.SHOP_STAGE_7);
if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){ if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())) {
throw new ServiceException(ErrorCodeEnum.IS_EXIST_CLAIM); throw new ServiceException(ErrorCodeEnum.IS_EXIST_CLAIM);
} }
List<LinePayDO> franchiseFeePayInfoByShopId = linePayDAO.getFranchiseFeePayInfoByShopId(request.getShopId()); List<LinePayDO> franchiseFeePayInfoByShopId = linePayDAO.getFranchiseFeePayInfoByShopId(request.getShopId());
if (ListUtils.emptyIfNull(franchiseFeePayInfoByShopId) if (ListUtils.emptyIfNull(franchiseFeePayInfoByShopId)
.stream() .stream()
.anyMatch(lineInfoDO->lineInfoDO.getXgjClaimStatus().equals(ClaimStatusEnum.CLAIMED.getCode()))){ .anyMatch(lineInfoDO -> lineInfoDO.getXgjClaimStatus().equals(ClaimStatusEnum.CLAIMED.getCode()))) {
throw new ServiceException(ErrorCodeEnum.IS_EXIST_CLAIM); throw new ServiceException(ErrorCodeEnum.IS_EXIST_CLAIM);
} }
// if (Objects.nonNull(shopInfo.getPointId())) { // if (Objects.nonNull(shopInfo.getPointId())) {
// PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(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())) {
@@ -600,14 +600,18 @@ public class ShopServiceImpl implements ShopService {
} }
@Override @Override
public PageInfo<MiniShopsResponse> getShopListSuccessOpen(Long lineId,Integer pageNum,Integer pageSize,String storeName) { public PageInfo<MiniShopsResponse> getShopListSuccessOpen(ShopListSuccessOpenRequest request) {
Long lineId = request.getLineId();
Integer pageNum = request.getPageNum();
Integer pageSize = request.getPageSize();
String storeName = request.getStoreName();
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(lineId); LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(lineId);
PageInfo<MiniShopsResponse> storeListByMobile = storeService.getStoreListByMobile(lineInfoDO.getMobile(),pageNum,pageSize,storeName); PageInfo<MiniShopsResponse> storeListByMobile = storeService.getStoreListByMobile(lineInfoDO.getMobile(), pageNum, pageSize, storeName);
if (CollectionUtils.isEmpty(storeListByMobile.getList())){ if (CollectionUtils.isEmpty(storeListByMobile.getList())) {
return new PageInfo<>(); return new PageInfo<>();
} }
for (MiniShopsResponse response : storeListByMobile.getList()){ for (MiniShopsResponse response : storeListByMobile.getList()) {
response.setYlsCode("ZXA8_"+response.getShopCode()); response.setYlsCode("ZXA8_" + response.getShopCode());
} }
return storeListByMobile; return storeListByMobile;
} }
@@ -642,7 +646,7 @@ public class ShopServiceImpl implements ShopService {
} }
} }
List<StoreDO> storeDOS = storeDao.listByMobile(lineInfoDO.getMobile()); List<StoreDO> storeDOS = storeDao.listByMobile(lineInfoDO.getMobile());
storeDOS.stream().forEach(x->{ storeDOS.stream().forEach(x -> {
ShopNameAndCodeDTO dto = new ShopNameAndCodeDTO(); ShopNameAndCodeDTO dto = new ShopNameAndCodeDTO();
dto.setShopName(x.getStoreName()); dto.setShopName(x.getStoreName());
dto.setShopCode(x.getStoreNum()); dto.setShopCode(x.getStoreNum());
@@ -662,7 +666,7 @@ public class ShopServiceImpl implements ShopService {
)) ))
.values()); .values());
response.setShopList(distinctList); response.setShopList(distinctList);
log.info("shopInfo{}",JSONObject.toJSONString(response)); log.info("shopInfo{}", JSONObject.toJSONString(response));
return response; return response;
} }
@@ -685,41 +689,41 @@ public class ShopServiceImpl implements ShopService {
List<PointInfoDO> pointListByIds = pointInfoDAO.getPointListByIds(pointIdList); List<PointInfoDO> pointListByIds = pointInfoDAO.getPointListByIds(pointIdList);
Map<Long, PointInfoDO> pointInfoDOMap = pointListByIds.stream().collect(Collectors.toMap(PointInfoDO::getId, Function.identity())); Map<Long, PointInfoDO> pointInfoDOMap = pointListByIds.stream().collect(Collectors.toMap(PointInfoDO::getId, Function.identity()));
for (ShopInfoDO shopInfoDO : shopList) { for (ShopInfoDO shopInfoDO : shopList) {
if (shopInfoDO.getPointId() == null ){ if (shopInfoDO.getPointId() == null) {
continue; continue;
} }
PointInfoDO pointInfoDO = pointInfoDOMap.get(shopInfoDO.getPointId()); PointInfoDO pointInfoDO = pointInfoDOMap.get(shopInfoDO.getPointId());
if (pointInfoDO == null ){ if (pointInfoDO == null) {
continue; continue;
} }
shopInfoDO.setProvince(pointInfoDO.getProvince()); shopInfoDO.setProvince(pointInfoDO.getProvince());
shopInfoDO.setCity(pointInfoDO.getCity()); shopInfoDO.setCity(pointInfoDO.getCity());
shopInfoDO.setDistrict(pointInfoDO.getDistrict()); shopInfoDO.setDistrict(pointInfoDO.getDistrict());
} }
return shopInfoDAO.updateShopCity(shopList); return shopInfoDAO.updateShopCity(shopList);
} }
@Override @Override
public List<UserDTO> getIntendSubStageHandle(Long lineId,Integer subStage) { public List<UserDTO> getIntendSubStageHandle(Long lineId, Integer subStage) {
//查询线索 //查询线索
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId); LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
List<UserDTO> userList = new ArrayList<>(); List<UserDTO> userList = new ArrayList<>();
//如果阶段对应不上 直接返回空 //如果阶段对应不上 直接返回空
if(!lineInfo.getWorkflowSubStage().equals(subStage)){ if (!lineInfo.getWorkflowSubStage().equals(subStage)) {
return userList; return userList;
} }
//加盟商处理时子阶段状态 //加盟商处理时子阶段状态
List<Integer> intendPartnerList = Arrays.asList(INTENT_0.getCode(), PAY_DEPOSIT_45.getCode()); List<Integer> intendPartnerList = Arrays.asList(INTENT_0.getCode(), PAY_DEPOSIT_45.getCode());
if (intendPartnerList.contains(lineInfo.getWorkflowSubStageStatus())){ if (intendPartnerList.contains(lineInfo.getWorkflowSubStageStatus())) {
UserDTO userDTO = new UserDTO(lineInfo.getUsername(), lineInfo.getMobile()); UserDTO userDTO = new UserDTO(lineInfo.getUsername(), lineInfo.getMobile());
userList.add(userDTO); userList.add(userDTO);
return userList; return userList;
} }
//督导处理阶段 //督导处理阶段
List<Integer> intendManagerList = Arrays.asList(INTENT_5.getCode(), PAY_DEPOSIT_50.getCode(),SIGN_INTENT_AGREEMENT_70.getCode()); List<Integer> intendManagerList = Arrays.asList(INTENT_5.getCode(), PAY_DEPOSIT_50.getCode(), SIGN_INTENT_AGREEMENT_70.getCode());
if (intendManagerList.contains(lineInfo.getWorkflowSubStageStatus())){ if (intendManagerList.contains(lineInfo.getWorkflowSubStageStatus())) {
EnterpriseUserDO userInfo = enterpriseUserDAO.getUserInfoById(lineInfo.getInvestmentManager()); EnterpriseUserDO userInfo = enterpriseUserDAO.getUserInfoById(lineInfo.getInvestmentManager());
if (Objects.nonNull(userInfo)){ if (Objects.nonNull(userInfo)) {
UserDTO userDTO = new UserDTO(userInfo.getName(), userInfo.getMobile()); UserDTO userDTO = new UserDTO(userInfo.getName(), userInfo.getMobile());
userList.add(userDTO); userList.add(userDTO);
} }
@@ -786,7 +790,7 @@ public class ShopServiceImpl implements ShopService {
case SHOP_SUB_STAGE_STATUS_85: case SHOP_SUB_STAGE_STATUS_85:
return getUsersByRolesAndRegion(Arrays.asList(REGION_OFFICE, JOIN_OFFICE), shopInfo.getRegionId()); return getUsersByRolesAndRegion(Arrays.asList(REGION_OFFICE, JOIN_OFFICE), shopInfo.getRegionId());
// case SHOP_SUB_STAGE_STATUS_72: // case SHOP_SUB_STAGE_STATUS_72:
case SHOP_SUB_STAGE_STATUS_83: case SHOP_SUB_STAGE_STATUS_83:
return getUsersByRolesAndRegion(Arrays.asList(REGION_OFFICE, BRANCH_OFFICE), shopInfo.getRegionId()); return getUsersByRolesAndRegion(Arrays.asList(REGION_OFFICE, BRANCH_OFFICE), shopInfo.getRegionId());
@@ -815,7 +819,7 @@ public class ShopServiceImpl implements ShopService {
return getUsersByRoleAndRegion(UserRoleEnum.LOGISTICS, shopInfo.getRegionId()); return getUsersByRoleAndRegion(UserRoleEnum.LOGISTICS, shopInfo.getRegionId());
case SHOP_SUB_STAGE_STATUS_152: case SHOP_SUB_STAGE_STATUS_152:
UserRoleEnum financeRole = JoinModeEnum.OWN_STORE.getCode()==shopInfo.getJoinMode() UserRoleEnum financeRole = JoinModeEnum.OWN_STORE.getCode() == shopInfo.getJoinMode()
? UserRoleEnum.OWN_SHOP_OFFICE ? UserRoleEnum.OWN_SHOP_OFFICE
: UserRoleEnum.FINANCE; : UserRoleEnum.FINANCE;
return getUsersByRole(financeRole); return getUsersByRole(financeRole);
@@ -868,12 +872,12 @@ public class ShopServiceImpl implements ShopService {
@Override @Override
public ShopStageInfoVO getShopStageStatus(Long shopId, Integer subStage) { public ShopStageInfoVO getShopStageStatus(Long shopId, Integer subStage) {
if(shopId == null|| subStage == null ){ if (shopId == null || subStage == null) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR); throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
} }
ShopStageInfoDO stage = shopStageInfoDAO.getByShopIdAndSubStage(shopId, subStage); ShopStageInfoDO stage = shopStageInfoDAO.getByShopIdAndSubStage(shopId, subStage);
if (stage!=null){ if (stage != null) {
return new ShopStageInfoVO(stage.getShopStage(), stage.getShopSubStage(), stage.getShopSubStageStatus(),stage.getIsTerminated()); return new ShopStageInfoVO(stage.getShopStage(), stage.getShopSubStage(), stage.getShopSubStageStatus(), stage.getIsTerminated());
} }
return null; return null;
} }
@@ -902,7 +906,7 @@ public class ShopServiceImpl implements ShopService {
private List<UserDTO> getUsersByRole(UserRoleEnum role) { private List<UserDTO> getUsersByRole(UserRoleEnum role) {
SysRoleRequest request = new SysRoleRequest(); SysRoleRequest request = new SysRoleRequest();
request.setRoleName(role.getDesc()); request.setRoleName(role.getDesc());
return convertToUserDTOs(userAuthMappingService.findUserListByRole(request,false)); return convertToUserDTOs(userAuthMappingService.findUserListByRole(request, false));
} }
private List<UserDTO> getUsersByRoleAndRegion(UserRoleEnum role, Long regionId) { private List<UserDTO> getUsersByRoleAndRegion(UserRoleEnum role, Long regionId) {

View File

@@ -82,7 +82,7 @@ public class StoreServiceImpl implements StoreService {
List<SysRoleDO> sysRoleDOS = roleIds.stream().filter(role -> "store_inside".equals(role.getPositionType())).collect(Collectors.toList()); List<SysRoleDO> sysRoleDOS = roleIds.stream().filter(role -> "store_inside".equals(role.getPositionType())).collect(Collectors.toList());
List<String> regionIds = new ArrayList<>(); List<String> regionIds = new ArrayList<>();
if (CollectionUtils.isNotEmpty(sysRoleDOS)){ if (CollectionUtils.isNotEmpty(sysRoleDOS)){
//获取用户管辖门店 //获取用户管辖区域
List<UserAuthMappingDO> userAuthMapping = userAuthMappingService.listUserAuthMappingByUserId(enterpriseUserDO.getUserId()); List<UserAuthMappingDO> userAuthMapping = userAuthMappingService.listUserAuthMappingByUserId(enterpriseUserDO.getUserId());
if (CollectionUtils.isNotEmpty(userAuthMapping)){ if (CollectionUtils.isNotEmpty(userAuthMapping)){
regionIds.addAll(userAuthMapping.stream().map(UserAuthMappingDO::getMappingId).collect(Collectors.toList())); regionIds.addAll(userAuthMapping.stream().map(UserAuthMappingDO::getMappingId).collect(Collectors.toList()));

View File

@@ -116,13 +116,9 @@ public class MiniShopController {
return ResponseResult.success(pointService.updateRentContract(request)); return ResponseResult.success(pointService.updateRentContract(request));
} }
@ApiOperation("成功开店的门店") @ApiOperation("成功开店的门店")
@GetMapping("/getShopListSuccessOpen") @PostMapping("/getShopListSuccessOpen")
public ResponseResult<PageInfo<MiniShopsResponse>> getShopListSuccessOpen(@RequestParam("lineId")Long lineId, public ResponseResult<PageInfo<MiniShopsResponse>> getShopListSuccessOpen(@RequestBody @Validated ShopListSuccessOpenRequest request ) {
@RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize, return ResponseResult.success(shopService.getShopListSuccessOpen(request));
@RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum,
@RequestParam(value = "storeName",required = false,defaultValue = "") String storeName
) {
return ResponseResult.success(shopService.getShopListSuccessOpen(lineId,pageNum,pageSize,storeName));
} }
@ApiOperation("获取推荐铺位和我创建的") @ApiOperation("获取推荐铺位和我创建的")