成功开店代码改造
This commit is contained in:
@@ -107,7 +107,7 @@ public interface ShopService {
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -236,16 +236,16 @@ public class ShopServiceImpl implements ShopService {
|
||||
// //进入选址不允许删除操作
|
||||
// throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
// }
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfo.getId(), ShopSubStageEnum.SHOP_STAGE_7);
|
||||
if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.IS_EXIST_CLAIM);
|
||||
}
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfo.getId(), ShopSubStageEnum.SHOP_STAGE_7);
|
||||
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.IS_EXIST_CLAIM);
|
||||
}
|
||||
List<LinePayDO> franchiseFeePayInfoByShopId = linePayDAO.getFranchiseFeePayInfoByShopId(request.getShopId());
|
||||
if (ListUtils.emptyIfNull(franchiseFeePayInfoByShopId)
|
||||
.stream()
|
||||
.anyMatch(lineInfoDO->lineInfoDO.getXgjClaimStatus().equals(ClaimStatusEnum.CLAIMED.getCode()))){
|
||||
throw new ServiceException(ErrorCodeEnum.IS_EXIST_CLAIM);
|
||||
}
|
||||
if (ListUtils.emptyIfNull(franchiseFeePayInfoByShopId)
|
||||
.stream()
|
||||
.anyMatch(lineInfoDO -> lineInfoDO.getXgjClaimStatus().equals(ClaimStatusEnum.CLAIMED.getCode()))) {
|
||||
throw new ServiceException(ErrorCodeEnum.IS_EXIST_CLAIM);
|
||||
}
|
||||
// if (Objects.nonNull(shopInfo.getPointId())) {
|
||||
// PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(shopInfo.getPointId());
|
||||
// if (Objects.nonNull(pointInfo) && SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) {
|
||||
@@ -600,14 +600,18 @@ public class ShopServiceImpl implements ShopService {
|
||||
}
|
||||
|
||||
@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);
|
||||
PageInfo<MiniShopsResponse> storeListByMobile = storeService.getStoreListByMobile(lineInfoDO.getMobile(),pageNum,pageSize,storeName);
|
||||
if (CollectionUtils.isEmpty(storeListByMobile.getList())){
|
||||
PageInfo<MiniShopsResponse> storeListByMobile = storeService.getStoreListByMobile(lineInfoDO.getMobile(), pageNum, pageSize, storeName);
|
||||
if (CollectionUtils.isEmpty(storeListByMobile.getList())) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
for (MiniShopsResponse response : storeListByMobile.getList()){
|
||||
response.setYlsCode("ZXA8_"+response.getShopCode());
|
||||
for (MiniShopsResponse response : storeListByMobile.getList()) {
|
||||
response.setYlsCode("ZXA8_" + response.getShopCode());
|
||||
}
|
||||
return storeListByMobile;
|
||||
}
|
||||
@@ -642,7 +646,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
}
|
||||
}
|
||||
List<StoreDO> storeDOS = storeDao.listByMobile(lineInfoDO.getMobile());
|
||||
storeDOS.stream().forEach(x->{
|
||||
storeDOS.stream().forEach(x -> {
|
||||
ShopNameAndCodeDTO dto = new ShopNameAndCodeDTO();
|
||||
dto.setShopName(x.getStoreName());
|
||||
dto.setShopCode(x.getStoreNum());
|
||||
@@ -662,7 +666,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
))
|
||||
.values());
|
||||
response.setShopList(distinctList);
|
||||
log.info("shopInfo:{}",JSONObject.toJSONString(response));
|
||||
log.info("shopInfo:{}", JSONObject.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -685,41 +689,41 @@ public class ShopServiceImpl implements ShopService {
|
||||
List<PointInfoDO> pointListByIds = pointInfoDAO.getPointListByIds(pointIdList);
|
||||
Map<Long, PointInfoDO> pointInfoDOMap = pointListByIds.stream().collect(Collectors.toMap(PointInfoDO::getId, Function.identity()));
|
||||
for (ShopInfoDO shopInfoDO : shopList) {
|
||||
if (shopInfoDO.getPointId() == null ){
|
||||
if (shopInfoDO.getPointId() == null) {
|
||||
continue;
|
||||
}
|
||||
PointInfoDO pointInfoDO = pointInfoDOMap.get(shopInfoDO.getPointId());
|
||||
if (pointInfoDO == null ){
|
||||
if (pointInfoDO == null) {
|
||||
continue;
|
||||
}
|
||||
shopInfoDO.setProvince(pointInfoDO.getProvince());
|
||||
shopInfoDO.setCity(pointInfoDO.getCity());
|
||||
shopInfoDO.setDistrict(pointInfoDO.getDistrict());
|
||||
}
|
||||
return shopInfoDAO.updateShopCity(shopList);
|
||||
return shopInfoDAO.updateShopCity(shopList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserDTO> getIntendSubStageHandle(Long lineId,Integer subStage) {
|
||||
public List<UserDTO> getIntendSubStageHandle(Long lineId, Integer subStage) {
|
||||
//查询线索
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||
List<UserDTO> userList = new ArrayList<>();
|
||||
//如果阶段对应不上 直接返回空
|
||||
if(!lineInfo.getWorkflowSubStage().equals(subStage)){
|
||||
if (!lineInfo.getWorkflowSubStage().equals(subStage)) {
|
||||
return userList;
|
||||
}
|
||||
//加盟商处理时子阶段状态
|
||||
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());
|
||||
userList.add(userDTO);
|
||||
return userList;
|
||||
}
|
||||
//督导处理阶段
|
||||
List<Integer> intendManagerList = Arrays.asList(INTENT_5.getCode(), PAY_DEPOSIT_50.getCode(),SIGN_INTENT_AGREEMENT_70.getCode());
|
||||
if (intendManagerList.contains(lineInfo.getWorkflowSubStageStatus())){
|
||||
List<Integer> intendManagerList = Arrays.asList(INTENT_5.getCode(), PAY_DEPOSIT_50.getCode(), SIGN_INTENT_AGREEMENT_70.getCode());
|
||||
if (intendManagerList.contains(lineInfo.getWorkflowSubStageStatus())) {
|
||||
EnterpriseUserDO userInfo = enterpriseUserDAO.getUserInfoById(lineInfo.getInvestmentManager());
|
||||
if (Objects.nonNull(userInfo)){
|
||||
if (Objects.nonNull(userInfo)) {
|
||||
UserDTO userDTO = new UserDTO(userInfo.getName(), userInfo.getMobile());
|
||||
userList.add(userDTO);
|
||||
}
|
||||
@@ -786,7 +790,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
case SHOP_SUB_STAGE_STATUS_85:
|
||||
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:
|
||||
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());
|
||||
|
||||
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.FINANCE;
|
||||
return getUsersByRole(financeRole);
|
||||
@@ -868,12 +872,12 @@ public class ShopServiceImpl implements ShopService {
|
||||
|
||||
@Override
|
||||
public ShopStageInfoVO getShopStageStatus(Long shopId, Integer subStage) {
|
||||
if(shopId == null|| subStage == null ){
|
||||
if (shopId == null || subStage == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
ShopStageInfoDO stage = shopStageInfoDAO.getByShopIdAndSubStage(shopId, subStage);
|
||||
if (stage!=null){
|
||||
return new ShopStageInfoVO(stage.getShopStage(), stage.getShopSubStage(), stage.getShopSubStageStatus(),stage.getIsTerminated());
|
||||
if (stage != null) {
|
||||
return new ShopStageInfoVO(stage.getShopStage(), stage.getShopSubStage(), stage.getShopSubStageStatus(), stage.getIsTerminated());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -902,7 +906,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
private List<UserDTO> getUsersByRole(UserRoleEnum role) {
|
||||
SysRoleRequest request = new SysRoleRequest();
|
||||
request.setRoleName(role.getDesc());
|
||||
return convertToUserDTOs(userAuthMappingService.findUserListByRole(request,false));
|
||||
return convertToUserDTOs(userAuthMappingService.findUserListByRole(request, false));
|
||||
}
|
||||
|
||||
private List<UserDTO> getUsersByRoleAndRegion(UserRoleEnum role, Long regionId) {
|
||||
|
||||
@@ -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<String> regionIds = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(sysRoleDOS)){
|
||||
//获取用户管辖门店
|
||||
//获取用户管辖区域
|
||||
List<UserAuthMappingDO> userAuthMapping = userAuthMappingService.listUserAuthMappingByUserId(enterpriseUserDO.getUserId());
|
||||
if (CollectionUtils.isNotEmpty(userAuthMapping)){
|
||||
regionIds.addAll(userAuthMapping.stream().map(UserAuthMappingDO::getMappingId).collect(Collectors.toList()));
|
||||
|
||||
Reference in New Issue
Block a user