fix bug null
This commit is contained in:
@@ -80,6 +80,7 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
private RegionMapper regionMapper;
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
|
||||
@Override
|
||||
public String juridicalIdCard(Long shopId) {
|
||||
BuildInformationDO informationDO = buildInformationDAO.selectOneByShopId(shopId);
|
||||
@@ -100,9 +101,9 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
Long regionId = shopInfo.getRegionId();
|
||||
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("partnerUsername",lineInfoDO.getUsername());
|
||||
map.put("partnerMobile",lineInfoDO.getMobile());
|
||||
map.put("storeName",shopInfo.getShopName());
|
||||
map.put("partnerUsername", lineInfoDO.getUsername());
|
||||
map.put("partnerMobile", lineInfoDO.getMobile());
|
||||
map.put("storeName", shopInfo.getShopName());
|
||||
//抖音
|
||||
if (type.equals(PlatformBuildEnum.DOU_YIN.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_18);
|
||||
@@ -111,8 +112,8 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
List<EnterpriseUserDO> dyCustomerUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.DOU_YIN_CUSTOMER, regionId);
|
||||
List<String> dyCustomerUserIds =new ArrayList<>();
|
||||
if(!dyCustomerUser.isEmpty()){
|
||||
List<String> dyCustomerUserIds = new ArrayList<>();
|
||||
if (!dyCustomerUser.isEmpty()) {
|
||||
dyCustomerUserIds.addAll(dyCustomerUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
|
||||
}
|
||||
commonService.sendQWMessage(dyCustomerUserIds,
|
||||
@@ -135,8 +136,8 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
List<EnterpriseUserDO> ksUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.KUAI_SHOU_CUSTOMER, regionId);
|
||||
List<String> ksUserIds =new ArrayList<>();
|
||||
if(!ksUser.isEmpty()){
|
||||
List<String> ksUserIds = new ArrayList<>();
|
||||
if (!ksUser.isEmpty()) {
|
||||
ksUserIds.addAll(ksUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
|
||||
}
|
||||
commonService.sendQWMessage(ksUserIds,
|
||||
@@ -159,8 +160,8 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
List<EnterpriseUserDO> mtbcUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.MEI_TUAN_BUY_CUSTOMER, regionId);
|
||||
List<String> mtbcUserIds =new ArrayList<>();
|
||||
if(!mtbcUser.isEmpty()){
|
||||
List<String> mtbcUserIds = new ArrayList<>();
|
||||
if (!mtbcUser.isEmpty()) {
|
||||
mtbcUserIds.addAll(mtbcUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
|
||||
}
|
||||
commonService.sendQWMessage(mtbcUserIds,
|
||||
@@ -183,8 +184,8 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
List<EnterpriseUserDO> elmUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.E_L_ME_TUAN_OPERATIONS_CUSTOMER, regionId);
|
||||
List<String> elmUserIds =new ArrayList<>();
|
||||
if(!elmUser.isEmpty()){
|
||||
List<String> elmUserIds = new ArrayList<>();
|
||||
if (!elmUser.isEmpty()) {
|
||||
elmUserIds.addAll(elmUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
|
||||
}
|
||||
commonService.sendQWMessage(elmUserIds,
|
||||
@@ -207,8 +208,8 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
List<EnterpriseUserDO> mtocUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.MEI_TUAN_OPERATIONS_CUSTOMER, regionId);
|
||||
List<String> mtocUserIds =new ArrayList<>();
|
||||
if(!mtocUser.isEmpty()){
|
||||
List<String> mtocUserIds = new ArrayList<>();
|
||||
if (!mtocUser.isEmpty()) {
|
||||
mtocUserIds.addAll(mtocUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
|
||||
}
|
||||
commonService.sendQWMessage(mtocUserIds,
|
||||
@@ -254,10 +255,12 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
platformBuildInfoVO.setShopName(shopInfo.getShopName());
|
||||
platformBuildInfoVO.setShopCode(shopInfo.getShopCode());
|
||||
platformBuildInfoVO.setRegionName(regionNameMap.get(shopInfo.getRegionId()));
|
||||
platformBuildInfoVO.setProvince(pointInfoDO.getProvince());
|
||||
platformBuildInfoVO.setCity(pointInfoDO.getCity());
|
||||
platformBuildInfoVO.setDistrict(pointInfoDO.getDistrict());
|
||||
platformBuildInfoVO.setAddress(pointInfoDO.getAddress());
|
||||
if (Objects.nonNull(pointInfoDO)) {
|
||||
platformBuildInfoVO.setProvince(pointInfoDO.getProvince());
|
||||
platformBuildInfoVO.setCity(pointInfoDO.getCity());
|
||||
platformBuildInfoVO.setDistrict(pointInfoDO.getDistrict());
|
||||
platformBuildInfoVO.setAddress(pointInfoDO.getAddress());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(shopContractActualCompletionTime)) {
|
||||
ScheduleDTO scheduleDTO = shopContractActualCompletionTime.get(CommonConstants.ZERO);
|
||||
platformBuildInfoVO.setCompletionColumn(scheduleDTO.getCompletionColumn());
|
||||
@@ -334,20 +337,20 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
ShopAuditInfoDO auditInfo = shopAuditInfoDAO.getAuditInfo(platformBuildDO.getAuditId());
|
||||
doSomething(platformBuildResponse, trial, auditInfo);
|
||||
|
||||
} else{
|
||||
ShopAuditInfoDO auditInfo = shopAuditInfoDAO.getAuditInfo(platformBuildDO.getAuditId());
|
||||
if (Objects.nonNull(auditInfo)) {
|
||||
if (auditInfo.getResultType().equals(AuditResultTypeEnum.PASS.getCode())) {
|
||||
platformBuildResponse.setReason(auditInfo.getPassReason());
|
||||
} else {
|
||||
platformBuildResponse.setReason(auditInfo.getRejectReason());
|
||||
} else {
|
||||
ShopAuditInfoDO auditInfo = shopAuditInfoDAO.getAuditInfo(platformBuildDO.getAuditId());
|
||||
if (Objects.nonNull(auditInfo)) {
|
||||
if (auditInfo.getResultType().equals(AuditResultTypeEnum.PASS.getCode())) {
|
||||
platformBuildResponse.setReason(auditInfo.getPassReason());
|
||||
} else {
|
||||
platformBuildResponse.setReason(auditInfo.getRejectReason());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return platformBuildResponse;
|
||||
}
|
||||
}
|
||||
|
||||
private void doSomething(PlatformBuildResponse platformBuildResponse, OperationLogDO trial, ShopAuditInfoDO auditInfo ) {
|
||||
private void doSomething(PlatformBuildResponse platformBuildResponse, OperationLogDO trial, ShopAuditInfoDO auditInfo) {
|
||||
if (Objects.nonNull(trial)) {
|
||||
ShopAuditInfoDO atrialAuditInfo = shopAuditInfoDAO.getAuditInfo(trial.getAuditResultId());
|
||||
if (Objects.nonNull(atrialAuditInfo)) {
|
||||
@@ -359,144 +362,144 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
}
|
||||
}
|
||||
if (Objects.nonNull(auditInfo)) {
|
||||
if (auditInfo.getResultType().equals(AuditResultTypeEnum.PASS.getCode())) {
|
||||
platformBuildResponse.setNewReason(auditInfo.getPassReason());
|
||||
} else {
|
||||
platformBuildResponse.setNewReason(auditInfo.getRejectReason());
|
||||
}
|
||||
if (auditInfo.getResultType().equals(AuditResultTypeEnum.PASS.getCode())) {
|
||||
platformBuildResponse.setNewReason(auditInfo.getPassReason());
|
||||
} else {
|
||||
platformBuildResponse.setNewReason(auditInfo.getRejectReason());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer firstAudit(PlatformBuildAuditRequest request) {
|
||||
Integer type = request.getType();
|
||||
Long shopId = request.getShopId();
|
||||
PlatformBuildDO platformBuildDO = platformBuildDAO.selectOneByShopId(shopId, type);
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer firstAudit(PlatformBuildAuditRequest request) {
|
||||
Integer type = request.getType();
|
||||
Long shopId = request.getShopId();
|
||||
PlatformBuildDO platformBuildDO = platformBuildDAO.selectOneByShopId(shopId, type);
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
Long regionId = shopInfo.getRegionId();
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("partnerUsername",lineInfoDO.getUsername());
|
||||
map.put("partnerMobile",lineInfoDO.getMobile());
|
||||
map.put("storeName",shopInfo.getShopName());
|
||||
if (type.equals(PlatformBuildEnum.DOU_YIN.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_18);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_181.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.DOU_YIN);
|
||||
return doThing(platformBuildDO, request, shopAuditInfoDO, shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_181, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_183, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_182);
|
||||
}
|
||||
|
||||
if (type.equals(PlatformBuildEnum.KUAI_SHOU.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_22);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_221.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.KUAI_SHOU);
|
||||
return doThing(platformBuildDO, request, shopAuditInfoDO, shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_221, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_223, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_222);
|
||||
|
||||
}
|
||||
if (type.equals(PlatformBuildEnum.MEI_TUAN_TUAN_GOU.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_20);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_201.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.MEI_TUAN_TUAN_GOU);
|
||||
return doThing(platformBuildDO, request, shopAuditInfoDO, shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_201, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_203, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_202);
|
||||
|
||||
}
|
||||
if (type.equals(PlatformBuildEnum.E_LE_ME.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_21);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_211.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.E_LE_ME);
|
||||
doThing(platformBuildDO, request, shopAuditInfoDO, shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_211, SHOP_SUB_STAGE_STATUS_213, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_214);
|
||||
if (request.getResultType().equals(AuditResultTypeEnum.PASS.getCode())) {
|
||||
List<EnterpriseUserDO> elmUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.E_L_ME_HEADQUARTERS_BUILD_CUSTOMER, regionId);
|
||||
List<String> elmUserIds = new ArrayList<>();
|
||||
if(!elmUser.isEmpty()){
|
||||
elmUserIds.addAll(elmUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
|
||||
map.put("partnerUsername", lineInfoDO.getUsername());
|
||||
map.put("partnerMobile", lineInfoDO.getMobile());
|
||||
map.put("storeName", shopInfo.getShopName());
|
||||
if (type.equals(PlatformBuildEnum.DOU_YIN.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_18);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_181.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
operationLogService.addOperationLog(shopId, SHOP_SUB_STAGE_STATUS_213, request.getOperateUserId(),
|
||||
elmUser, OperationTypeEnum.OPERATION_TYPE_1, null, OperationStatusEnum.NOT_PROCESSED);
|
||||
commonService.sendQWMessage(elmUserIds,
|
||||
MessageEnum.MESSAGE_48,
|
||||
map);
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.DOU_YIN);
|
||||
return doThing(platformBuildDO, request, shopAuditInfoDO, shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_181, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_183, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_182);
|
||||
}
|
||||
return CommonConstants.ONE;
|
||||
}
|
||||
|
||||
if (type.equals(PlatformBuildEnum.MEI_TUAN_WAI_MAI.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_19);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_191.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.MEI_TUAN_WAI_MAI);
|
||||
doThing(platformBuildDO, request, shopAuditInfoDO, shopId, SHOP_SUB_STAGE_STATUS_191, SHOP_SUB_STAGE_STATUS_193, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_194);
|
||||
if (request.getResultType().equals(AuditResultTypeEnum.PASS.getCode())) {
|
||||
List<EnterpriseUserDO> mtwmUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.MEI_TUAN_HEADQUARTERS_BUILD_CUSTOMER, regionId);
|
||||
List<String> mtwmUserIds = new ArrayList<>();
|
||||
if (!mtwmUser.isEmpty()){
|
||||
mtwmUserIds.addAll( mtwmUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
|
||||
if (type.equals(PlatformBuildEnum.KUAI_SHOU.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_22);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_221.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
commonService.sendQWMessage(mtwmUserIds,
|
||||
MessageEnum.MESSAGE_49,
|
||||
map);
|
||||
operationLogService.addOperationLog(shopId, SHOP_SUB_STAGE_STATUS_193, request.getOperateUserId(),
|
||||
mtwmUser, OperationTypeEnum.OPERATION_TYPE_1, null, OperationStatusEnum.NOT_PROCESSED);
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.KUAI_SHOU);
|
||||
return doThing(platformBuildDO, request, shopAuditInfoDO, shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_221, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_223, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_222);
|
||||
|
||||
}
|
||||
return CommonConstants.ONE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (type.equals(PlatformBuildEnum.MEI_TUAN_TUAN_GOU.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_20);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_201.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.MEI_TUAN_TUAN_GOU);
|
||||
return doThing(platformBuildDO, request, shopAuditInfoDO, shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_201, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_203, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_202);
|
||||
|
||||
@Override
|
||||
public Integer secondAudit(PlatformBuildAuditRequest request) {
|
||||
Integer type = request.getType();
|
||||
Long shopId = request.getShopId();
|
||||
PlatformBuildDO platformBuildDO = platformBuildDAO.selectOneByShopId(shopId, type);
|
||||
if (type.equals(PlatformBuildEnum.E_LE_ME.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_21);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_213.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.E_LE_ME);
|
||||
return doThing(platformBuildDO, request, shopAuditInfoDO, shopId, SHOP_SUB_STAGE_STATUS_213, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_215, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_214);
|
||||
}
|
||||
|
||||
if (type.equals(PlatformBuildEnum.MEI_TUAN_WAI_MAI.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_19);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_193.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
if (type.equals(PlatformBuildEnum.E_LE_ME.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_21);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_211.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.E_LE_ME);
|
||||
doThing(platformBuildDO, request, shopAuditInfoDO, shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_211, SHOP_SUB_STAGE_STATUS_213, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_214);
|
||||
if (request.getResultType().equals(AuditResultTypeEnum.PASS.getCode())) {
|
||||
List<EnterpriseUserDO> elmUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.E_L_ME_HEADQUARTERS_BUILD_CUSTOMER, regionId);
|
||||
List<String> elmUserIds = new ArrayList<>();
|
||||
if (!elmUser.isEmpty()) {
|
||||
elmUserIds.addAll(elmUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
|
||||
}
|
||||
operationLogService.addOperationLog(shopId, SHOP_SUB_STAGE_STATUS_213, request.getOperateUserId(),
|
||||
elmUser, OperationTypeEnum.OPERATION_TYPE_1, null, OperationStatusEnum.NOT_PROCESSED);
|
||||
commonService.sendQWMessage(elmUserIds,
|
||||
MessageEnum.MESSAGE_48,
|
||||
map);
|
||||
}
|
||||
return CommonConstants.ONE;
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.MEI_TUAN_WAI_MAI);
|
||||
return doThing(platformBuildDO, request, shopAuditInfoDO, shopId, SHOP_SUB_STAGE_STATUS_193, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_195, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_194);
|
||||
|
||||
if (type.equals(PlatformBuildEnum.MEI_TUAN_WAI_MAI.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_19);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_191.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.MEI_TUAN_WAI_MAI);
|
||||
doThing(platformBuildDO, request, shopAuditInfoDO, shopId, SHOP_SUB_STAGE_STATUS_191, SHOP_SUB_STAGE_STATUS_193, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_194);
|
||||
if (request.getResultType().equals(AuditResultTypeEnum.PASS.getCode())) {
|
||||
List<EnterpriseUserDO> mtwmUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.MEI_TUAN_HEADQUARTERS_BUILD_CUSTOMER, regionId);
|
||||
List<String> mtwmUserIds = new ArrayList<>();
|
||||
if (!mtwmUser.isEmpty()) {
|
||||
mtwmUserIds.addAll(mtwmUser.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
|
||||
}
|
||||
commonService.sendQWMessage(mtwmUserIds,
|
||||
MessageEnum.MESSAGE_49,
|
||||
map);
|
||||
operationLogService.addOperationLog(shopId, SHOP_SUB_STAGE_STATUS_193, request.getOperateUserId(),
|
||||
mtwmUser, OperationTypeEnum.OPERATION_TYPE_1, null, OperationStatusEnum.NOT_PROCESSED);
|
||||
}
|
||||
return CommonConstants.ONE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private Integer doThing(PlatformBuildDO platformBuildDO, PlatformBuildAuditRequest request, ShopAuditInfoDO shopAuditInfoDO, Long shopId, ShopSubStageStatusEnum nowStatus, ShopSubStageStatusEnum passStatus, ShopSubStageStatusEnum rejectStatus) {
|
||||
Long auditId = shopAuditInfoDAO.addAuditInfo(shopAuditInfoDO);
|
||||
if (request.getResultType().equals(AuditResultTypeEnum.PASS.getCode())) {
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, passStatus);
|
||||
} else {
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, rejectStatus);
|
||||
@Override
|
||||
public Integer secondAudit(PlatformBuildAuditRequest request) {
|
||||
Integer type = request.getType();
|
||||
Long shopId = request.getShopId();
|
||||
PlatformBuildDO platformBuildDO = platformBuildDAO.selectOneByShopId(shopId, type);
|
||||
if (type.equals(PlatformBuildEnum.E_LE_ME.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_21);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_213.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.E_LE_ME);
|
||||
return doThing(platformBuildDO, request, shopAuditInfoDO, shopId, SHOP_SUB_STAGE_STATUS_213, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_215, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_214);
|
||||
}
|
||||
|
||||
if (type.equals(PlatformBuildEnum.MEI_TUAN_WAI_MAI.getCode())) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_19);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_193.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = PlatformBuildAuditRequest.convert(request, AuditTypeEnum.MEI_TUAN_WAI_MAI);
|
||||
return doThing(platformBuildDO, request, shopAuditInfoDO, shopId, SHOP_SUB_STAGE_STATUS_193, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_195, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_194);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private Integer doThing(PlatformBuildDO platformBuildDO, PlatformBuildAuditRequest request, ShopAuditInfoDO shopAuditInfoDO, Long shopId, ShopSubStageStatusEnum nowStatus, ShopSubStageStatusEnum passStatus, ShopSubStageStatusEnum rejectStatus) {
|
||||
Long auditId = shopAuditInfoDAO.addAuditInfo(shopAuditInfoDO);
|
||||
if (request.getResultType().equals(AuditResultTypeEnum.PASS.getCode())) {
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, passStatus);
|
||||
} else {
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, rejectStatus);
|
||||
}
|
||||
List<OperationLogDO> operationLogs = operationLogDAO.getBySubStageStatusEnumAndsStatus(shopId, nowStatus, OperationTypeEnum.OPERATION_TYPE_1.getCode());
|
||||
operationLogService.batchUpdateProcessed(operationLogs, auditId, request.getOperateUserId(), request.getReason());
|
||||
platformBuildDO.setAuditId(auditId);
|
||||
platformBuildDO.setAccount(request.getAccount());
|
||||
platformBuildDO.setPassword(request.getPassword());
|
||||
platformBuildDO.setUpdateTime(new Date());
|
||||
platformBuildDO.setUpdateUser(request.getOperateUserId());
|
||||
platformBuildDO.setPoi(request.getPoi());
|
||||
platformBuildDO.setStoreId(request.getStoreId());
|
||||
return platformBuildDAO.updateByShopIdAndTypeSelective(platformBuildDO);
|
||||
}
|
||||
List<OperationLogDO> operationLogs = operationLogDAO.getBySubStageStatusEnumAndsStatus(shopId, nowStatus, OperationTypeEnum.OPERATION_TYPE_1.getCode());
|
||||
operationLogService.batchUpdateProcessed(operationLogs, auditId, request.getOperateUserId(), request.getReason());
|
||||
platformBuildDO.setAuditId(auditId);
|
||||
platformBuildDO.setAccount(request.getAccount());
|
||||
platformBuildDO.setPassword(request.getPassword());
|
||||
platformBuildDO.setUpdateTime(new Date());
|
||||
platformBuildDO.setUpdateUser(request.getOperateUserId());
|
||||
platformBuildDO.setPoi(request.getPoi());
|
||||
platformBuildDO.setStoreId(request.getStoreId());
|
||||
return platformBuildDAO.updateByShopIdAndTypeSelective(platformBuildDO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user