@@ -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 ) {