@@ -1,5 +1,6 @@
package com.cool.store.service.impl ;
package com.cool.store.service.impl ;
import com.alibaba.fastjson.JSONObject ;
import com.cool.store.constants.CommonConstants ;
import com.cool.store.constants.CommonConstants ;
import com.cool.store.context.CurrentUserHolder ;
import com.cool.store.context.CurrentUserHolder ;
import com.cool.store.dao.* ;
import com.cool.store.dao.* ;
@@ -8,8 +9,8 @@ import com.cool.store.dto.openPreparation.OpeningOperationPlanDTO;
import com.cool.store.dto.openPreparation.PlanLineDTO ;
import com.cool.store.dto.openPreparation.PlanLineDTO ;
import com.cool.store.dto.openPreparation.UserInfoDTO ;
import com.cool.store.dto.openPreparation.UserInfoDTO ;
import com.cool.store.entity.OpeningOperationPlanDO ;
import com.cool.store.entity.OpeningOperationPlanDO ;
import com.cool.store.enums.AuditTypeEnum ;
import com.cool.store.enums.ErrorCodeEnum ;
import com.cool.store.enums.ErrorCodeEnum ;
import com.cool.store.enums.ShopAuditInfoTypeEnum ;
import com.cool.store.enums.point.ShopSubStageStatusEnum ;
import com.cool.store.enums.point.ShopSubStageStatusEnum ;
import com.cool.store.exception.ServiceException ;
import com.cool.store.exception.ServiceException ;
import com.cool.store.request.OpeningOperationPlanAuditRequest ;
import com.cool.store.request.OpeningOperationPlanAuditRequest ;
@@ -59,7 +60,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
@Override
@Override
@Transactional ( rollbackFor = Exception . class )
@Transactional ( rollbackFor = Exception . class )
public Long savePlan ( OpeningOperationPlanRequest request ) {
public Long savePlan ( OpeningOperationPlanRequest request ) {
log . info ( " addNewPlan request:{} " , request ) ;
log . info ( " addNewPlan request:{} " , JSONObject . toJSONString ( request) ) ;
if ( request . getActivityTheme ( ) . length ( ) > CommonConstants . MAX_LENGTH_ONE_HUNDRED ) {
if ( request . getActivityTheme ( ) . length ( ) > CommonConstants . MAX_LENGTH_ONE_HUNDRED ) {
log . error ( " addNewPlan ActivityTheme length error " ) ;
log . error ( " addNewPlan ActivityTheme length error " ) ;
throw new ServiceException ( ErrorCodeEnum . ACTIVITY_THEME_LENGTH_FALSE ) ;
throw new ServiceException ( ErrorCodeEnum . ACTIVITY_THEME_LENGTH_FALSE ) ;
@@ -77,7 +78,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
}
}
OpeningOperationPlanAuditRequest openingOperationPlanAuditRequest = new OpeningOperationPlanAuditRequest ( ) ;
OpeningOperationPlanAuditRequest openingOperationPlanAuditRequest = new OpeningOperationPlanAuditRequest ( ) ;
openingOperationPlanAuditRequest . setShopId ( request . getShopId ( ) ) ;
openingOperationPlanAuditRequest . setShopId ( request . getShopId ( ) ) ;
openingOperationPlanAuditRequest . setAuditType ( Shop AuditInfo TypeEnum. OPENING_OPERATION_PLAN . getCode ( ) ) ;
openingOperationPlanAuditRequest . setAuditType ( AuditTypeEnum . OPENING_OPERATION_PLAN . getCode ( ) ) ;
openingOperationPlanAuditRequest . setSubmittedUserName ( userName ) ;
openingOperationPlanAuditRequest . setSubmittedUserName ( userName ) ;
openingOperationPlanAuditRequest . setSubmittedUserId ( userId ) ;
openingOperationPlanAuditRequest . setSubmittedUserId ( userId ) ;
Long AuditId = openingOperationPlanAuditService . addNewPlanAudit ( openingOperationPlanAuditRequest ) ;
Long AuditId = openingOperationPlanAuditService . addNewPlanAudit ( openingOperationPlanAuditRequest ) ;
@@ -150,12 +151,12 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
@Override
@Override
public List < OpeningOperationPlanListVO > getPlanListPage ( PlanListRequest request ) {
public List < OpeningOperationPlanListVO > getPlanListPage ( PlanListRequest request ) {
log . info ( " getPlanListPage request:{} " , request ) ;
log . info ( " getPlanListPage request:{} " , JSONObject . toJSONString ( request) ) ;
//根据ShopName等查询门店名字1, 门店代码1, 开店负责人1, 督导id1
//根据ShopName等查询门店名字1, 门店代码1, 开店负责人1, 督导id1
Page < OpenPlanShopInfoDTO > openPlanShopList = shopInfoDAO .
Page < OpenPlanShopInfoDTO > openPlanShopList = shopInfoDAO .
getOpenPlanShopListByShopName ( request . getShopName ( ) , request . getBigName ( ) , request . getFightName ( ) ,
getOpenPlanShopListByShopName ( request . getShopName ( ) , request . getBigName ( ) , request . getFightName ( ) ,
request . getPageNum ( ) , request . getPageSize ( ) ) ;
request . getPageNum ( ) , request . getPageSize ( ) ) ;
log . info ( " getPlanListPage openPlanShopList:{} " , openPlanShopList ) ;
log . info ( " getPlanListPage openPlanShopList:{} " , JSONObject . toJSONString ( openPlanShopList) ) ;
List < OpeningOperationPlanListVO > openingOperationPlanListVOList = openPlanShopList . stream ( ) . map ( dto - > {
List < OpeningOperationPlanListVO > openingOperationPlanListVOList = openPlanShopList . stream ( ) . map ( dto - > {
OpeningOperationPlanListVO vO = new OpeningOperationPlanListVO ( ) ;
OpeningOperationPlanListVO vO = new OpeningOperationPlanListVO ( ) ;
vO . setShopId ( dto . getShopId ( ) ) ;
vO . setShopId ( dto . getShopId ( ) ) ;
@@ -168,7 +169,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
vO . setFightName ( dto . getFightName ( ) ) ;
vO . setFightName ( dto . getFightName ( ) ) ;
return vO ;
return vO ;
} ) . collect ( Collectors . toList ( ) ) ;
} ) . collect ( Collectors . toList ( ) ) ;
log . info ( " getPlanListPage openingOperationPlanVOList:{} " , openingOperationPlanListVOList ) ;
log . info ( " getPlanListPage openingOperationPlanVOList:{} " , JSONObject . toJSONString ( openingOperationPlanListVOList) ) ;
//提交时间,审核状态
//提交时间,审核状态
List < Long > shopIdList = openPlanShopList . stream ( )
List < Long > shopIdList = openPlanShopList . stream ( )
. map ( OpenPlanShopInfoDTO : : getShopId )
. map ( OpenPlanShopInfoDTO : : getShopId )
@@ -177,37 +178,37 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
openingOperationPlanDTO . setPlanStartDate ( request . getPlanStartDate ( ) ) ;
openingOperationPlanDTO . setPlanStartDate ( request . getPlanStartDate ( ) ) ;
openingOperationPlanDTO . setPlanEndDate ( request . getPlanEndDate ( ) ) ;
openingOperationPlanDTO . setPlanEndDate ( request . getPlanEndDate ( ) ) ;
List < OpeningOperationPlanDTO > openingOperationPlanDTOS = openingOperationPlanDAO . selectConditionPlanList ( shopIdList , openingOperationPlanDTO ) ;
List < OpeningOperationPlanDTO > openingOperationPlanDTOS = openingOperationPlanDAO . selectConditionPlanList ( shopIdList , openingOperationPlanDTO ) ;
log . info ( " getPlanListPage openingOperationPlanDTOS:{} " , openingOperationPlanDTOS ) ;
log . info ( " getPlanListPage openingOperationPlanDTOS:{} " , JSONObject . toJSONString ( openingOperationPlanDTOS) ) ;
Map < Long , OpeningOperationPlanDTO > voPlanMap = openingOperationPlanDTOS . stream ( )
Map < Long , OpeningOperationPlanDTO > voPlanMap = openingOperationPlanDTOS . stream ( )
. collect ( Collectors . toMap ( OpeningOperationPlanDTO : : getShopId , vo - > vo ) ) ;
. collect ( Collectors . toMap ( OpeningOperationPlanDTO : : getShopId , vo - > vo ) ) ;
log . info ( " getPlanListPage voPlanMap:{} " , voPlanMap ) ;
log . info ( " getPlanListPage voPlanMap:{} " , JSONObject . toJSONString ( voPlanMap) ) ;
//开店负责人name
//开店负责人name
List < String > shopManagerUserIdList = openPlanShopList . stream ( )
List < String > shopManagerUserIdList = openPlanShopList . stream ( )
. map ( OpenPlanShopInfoDTO : : getShopManagerUserId )
. map ( OpenPlanShopInfoDTO : : getShopManagerUserId )
. collect ( Collectors . toList ( ) ) ;
. collect ( Collectors . toList ( ) ) ;
List < UserInfoDTO > shopManagerList = enterpriseUserDAO . getNameByUserId ( shopManagerUserIdList ) ;
List < UserInfoDTO > shopManagerList = enterpriseUserDAO . getNameByUserId ( shopManagerUserIdList ) ;
log . info ( " getPlanListPage hopManagerList :{} " , shopManagerList ) ;
log . info ( " getPlanListPage hopManagerList :{} " , JSONObject . toJSONString ( shopManagerList) ) ;
Map < Long , UserInfoDTO > voManagerMap = shopManagerList . stream ( )
Map < Long , UserInfoDTO > voManagerMap = shopManagerList . stream ( )
. collect ( Collectors . toMap ( UserInfoDTO : : getUserId , vo - > vo ) ) ;
. collect ( Collectors . toMap ( UserInfoDTO : : getUserId , vo - > vo ) ) ;
log . info ( " getPlanListPage voManagerMap:{} " , voManagerMap ) ;
log . info ( " getPlanListPage voManagerMap:{} " , JSONObject . toJSONString ( voManagerMap) ) ;
//督导name
//督导name
List < String > supervisorUserIdList = openPlanShopList . stream ( )
List < String > supervisorUserIdList = openPlanShopList . stream ( )
. map ( OpenPlanShopInfoDTO : : getSupervisorUserId )
. map ( OpenPlanShopInfoDTO : : getSupervisorUserId )
. collect ( Collectors . toList ( ) ) ;
. collect ( Collectors . toList ( ) ) ;
List < UserInfoDTO > supervisorList = enterpriseUserDAO . getNameByUserId ( supervisorUserIdList ) ;
List < UserInfoDTO > supervisorList = enterpriseUserDAO . getNameByUserId ( supervisorUserIdList ) ;
log . info ( " getPlanListPage supervisorList :{} " , supervisorList ) ;
log . info ( " getPlanListPage supervisorList :{} " , JSONObject . toJSONString ( supervisorList) ) ;
Map < Long , UserInfoDTO > voSupervisorList = supervisorList . stream ( )
Map < Long , UserInfoDTO > voSupervisorList = supervisorList . stream ( )
. collect ( Collectors . toMap ( UserInfoDTO : : getUserId , vo - > vo ) ) ;
. collect ( Collectors . toMap ( UserInfoDTO : : getUserId , vo - > vo ) ) ;
log . info ( " getPlanListPage openingOperationPlanVOList:{} " , openingOperationPlanListVOList ) ;
log . info ( " getPlanListPage openingOperationPlanVOList:{} " , JSONObject . toJSONString ( openingOperationPlanListVOList) ) ;
//加盟商姓名,手机号,招商name
//加盟商姓名,手机号,招商name
List < Long > lines = openPlanShopList . stream ( )
List < Long > lines = openPlanShopList . stream ( )
. map ( OpenPlanShopInfoDTO : : getLineId )
. map ( OpenPlanShopInfoDTO : : getLineId )
. collect ( Collectors . toList ( ) ) ;
. collect ( Collectors . toList ( ) ) ;
List < PlanLineDTO > getLines = lineInfoDAO . getLines ( lines ) ;
List < PlanLineDTO > getLines = lineInfoDAO . getLines ( lines ) ;
log . info ( " getPlanListPage getLines:{} " , getLines ) ;
log . info ( " getPlanListPage getLines:{} " , JSONObject . toJSONString ( getLines) ) ;
Map < Long , PlanLineDTO > linemap = getLines . stream ( )
Map < Long , PlanLineDTO > linemap = getLines . stream ( )
. collect ( Collectors . toMap ( PlanLineDTO : : getLineId , vo - > vo ) ) ;
. collect ( Collectors . toMap ( PlanLineDTO : : getLineId , vo - > vo ) ) ;
log . info ( " getPlanListPage linemap:{} " , linemap ) ;
log . info ( " getPlanListPage linemap:{} " , JSONObject . toJSONString ( linemap) ) ;
for ( OpeningOperationPlanListVO vo : openingOperationPlanListVOList ) {
for ( OpeningOperationPlanListVO vo : openingOperationPlanListVOList ) {
vo . setSubmissionTime ( voPlanMap . get ( vo . getShopId ( ) ) . getSubmissionTime ( ) ) ;
vo . setSubmissionTime ( voPlanMap . get ( vo . getShopId ( ) ) . getSubmissionTime ( ) ) ;
vo . setResultType ( voPlanMap . get ( vo . getShopId ( ) ) . getResultType ( ) ) ;
vo . setResultType ( voPlanMap . get ( vo . getShopId ( ) ) . getResultType ( ) ) ;