Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -27,7 +27,7 @@ public interface CoolStoreStartFlowService {
|
||||
/**
|
||||
*特许经营合同
|
||||
* @param request
|
||||
* @param type 0:个人 1:企业
|
||||
* @param type 1:个人 2:企业
|
||||
* @return
|
||||
*/
|
||||
ResponseResult franchiseAgreement(FranchiseAgreementRequest request,Integer type);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
|
||||
import com.cool.store.entity.ShopAuditInfoDO;
|
||||
import com.cool.store.request.AcceptanceListRequest;
|
||||
import com.cool.store.request.SeeAcceptanceRequest;
|
||||
import com.cool.store.request.SeeAccetanceListRequest;
|
||||
import com.cool.store.vo.fitmentCheckVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Auther: WangShuo
|
||||
* @Date: 2024/05/17/下午5:57
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public interface SeeAcceptanceService {
|
||||
Boolean auditSeeAcceptance(SeeAcceptanceRequest seeAcceptanceRequest, LoginUserInfo user);
|
||||
ConstructionScheduleDTO getWithdrawal(Long shopId);
|
||||
List<ShopAuditInfoDO> getAuditInfo(Long shopId);
|
||||
PageInfo<fitmentCheckVO> getAcceptanceList(AcceptanceListRequest request, LoginUserInfo user);
|
||||
}
|
||||
@@ -29,6 +29,13 @@ public interface UserAuthMappingService {
|
||||
*/
|
||||
List<String> getAuthRegionIdAndSubRegionIdByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 获取用户授权的所有门店id
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<String> getAuthStoreIdAndSubRegionIdByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 提供 根据职位 意向区域 查 对应人的接口 同时返回人名字
|
||||
* @param userRoleEnum
|
||||
|
||||
@@ -52,7 +52,8 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
|
||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
|
||||
log.info("newStore API response:{}", JSONObject.toJSONString(initiatingResponse));
|
||||
if (initiatingResponse.getCode() != 0L) {
|
||||
return new ResponseResult(500, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
throw new ServiceException(ErrorCodeEnum.FRANCHISE_AGREEMENT_FALSE, initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||
// return new ResponseResult(500, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
} else {
|
||||
//更新阶段信息
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_31, null);
|
||||
@@ -69,15 +70,17 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
fillSignatureInfo(requestMap);
|
||||
String url = null;
|
||||
if (Constants.ONE_INTEGER == type) {
|
||||
if (Constants.TWO_INTEGER == type) {
|
||||
url = xfsgUrl + Constants.FRANCHISE_AGREEMENT_COMPANY + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
|
||||
} else if (Constants.TWO_INTEGER == type) {
|
||||
request.setZxhtywfl("3121375929356587766");
|
||||
} else if (Constants.ONE_INTEGER == type) {
|
||||
url = xfsgUrl + Constants.FRANCHISE_AGREEMENT_PERSON + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
|
||||
}
|
||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
|
||||
log.info("franchiseAgreement API response:{}", JSONObject.toJSONString(initiatingResponse));
|
||||
if (initiatingResponse.getCode() != 0L) {
|
||||
return new ResponseResult(500, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
// throw new ServiceException(500, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
throw new ServiceException(ErrorCodeEnum.FRANCHISE_AGREEMENT_FALSE, initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||
} else {
|
||||
return new ResponseResult(200000, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
}
|
||||
//预算
|
||||
BudgetDTO proposedBookBudget = getBudgetDTOS(decoration);
|
||||
if (proposedBookBudget == null) return null;
|
||||
if (proposedBookBudget == null) {return null;}
|
||||
BigDecimal vzHj = proposedBookBudget.getVzHj();
|
||||
//支付二维码url
|
||||
Long regionId = shopInfoDAO.getRegionIdByid(shopId);
|
||||
@@ -286,15 +286,32 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
name.add(CommonConstants.WITHDRAWAL);
|
||||
ConstructionScheduleDTO approach = new ConstructionScheduleDTO();
|
||||
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId);
|
||||
|
||||
ConstructionScheduleDTO constructionSage = new ConstructionScheduleDTO();
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
LineInfoDO lineInfo = lineInfoMapper.getByLineId(shopInfo.getLineId());
|
||||
for (ConstructionScheduleDTO constructionScheduleDTO : constructionSchedule) {
|
||||
if (name.contains(constructionScheduleDTO.getName())) {
|
||||
collect.add(constructionScheduleDTO);
|
||||
if (constructionScheduleDTO.getName().equals(CommonConstants.APPROACH)) {
|
||||
approach = constructionScheduleDTO;
|
||||
}
|
||||
//计划撤场时间
|
||||
//计划撤场时间 //如果撤场并且视觉验收状态为-100则更新待验收
|
||||
if (constructionScheduleDTO.getName().equals(CommonConstants.WITHDRAWAL)) {
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_13);
|
||||
if(shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus())
|
||||
&& constructionScheduleDTO.getState().equals(ConstructionPhaseEnum.construction_FINSH.getCode())){
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_130);
|
||||
//发送给品牌设计经理
|
||||
EnterpriseUserDO enterpriseUser = userAuthMappingService.getUserByRoleEnumAndWantShopAreaId(UserRoleEnum.DESIGN_MANAGER, lineInfo.getWantShopAreaId());
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("storeName",shopInfo.getShopName());
|
||||
messageMap.put("shopId",String.valueOf(shopId));
|
||||
messageMap.put("shopName",shopInfo.getShopName());
|
||||
messageMap.put("partnerUsername",lineInfo.getUsername());
|
||||
messageMap.put("partnerMobile",lineInfo.getMobile());
|
||||
commonService.sendMessage(Arrays.asList(enterpriseUser.getUserId()), MessageEnum.MESSAGE_28, messageMap);
|
||||
}
|
||||
ConstructionScheduleDTO withdrawal = constructionScheduleDTO;
|
||||
if (Objects.nonNull(acceptanceInfoDO)) {
|
||||
Date date = CoolDateUtils.parseDate(withdrawal.getPlanBeginDate(), CoolDateUtils.DATE_FORMAT_DAY);
|
||||
@@ -306,12 +323,12 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
constructionSage = constructionScheduleDTO;
|
||||
}
|
||||
}
|
||||
|
||||
//设置进场时间xfsg_acceptance_info
|
||||
if (Objects.nonNull(acceptanceInfoDO) && StringUtils.isNotEmpty(approach.getActualBeginDate())) {
|
||||
Date date = CoolDateUtils.parseDate(approach.getActualBeginDate(), CoolDateUtils.DATE_FORMAT_DAY);
|
||||
acceptanceInfoDO.setActualEntryTime(date);
|
||||
}
|
||||
|
||||
//施工完成时间,计划开始和完成时间 //
|
||||
if (Objects.nonNull(acceptanceInfoDO) && StringUtils.isNotEmpty(constructionSage.getActualEndDate())) {
|
||||
Date date = CoolDateUtils.parseDate(constructionSage.getActualEndDate(), CoolDateUtils.DATE_FORMAT_DAY);
|
||||
@@ -327,6 +344,8 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
}
|
||||
acceptanceInfoDO.setUpdateTime(new Date());
|
||||
acceptanceInfoDAO.updateAcceptanceInfo(acceptanceInfoDO);
|
||||
|
||||
|
||||
//如果完成更新施工阶段状态
|
||||
if (ConstructionPhaseEnum.construction_FINSH.getCode().equals(constructionSage.getState())) {
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_112);
|
||||
@@ -465,7 +484,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
List<fitmentCheckVO> fitmentCheckVOList = new ArrayList<>();
|
||||
//shopId,lineid,regionid,shopname,storenum,
|
||||
|
||||
List<ShopInfoDO> shopInfoDOS = shopInfoMapper.selectShopListByRegionId(regions, request.getSubStageStatus());
|
||||
List<ShopInfoDO> shopInfoDOS = shopInfoMapper.selectShopListByRegionId(regions, request.getSubStageStatus(),null);
|
||||
PageInfo pageInfo = new PageInfo<>(shopInfoDOS);
|
||||
if (shopInfoDOS.isEmpty()) {
|
||||
log.info("该工程部监理下门店为空");
|
||||
|
||||
@@ -431,18 +431,27 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
@Override
|
||||
public PageInfo<EmployeeTrainingVO> assessmentUserList(String userId, EmployeeAssessmentRequest request) {
|
||||
|
||||
List<String> authRegionIdList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(userId) && !sysRoleService.checkIsAdmin(userId)) {
|
||||
authRegionIdList = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId);
|
||||
List<String> requestStoreIdList = request.getStoreIdList();
|
||||
Boolean isAdmin = sysRoleService.checkIsAdmin(userId);
|
||||
if (CollectionUtils.isEmpty(requestStoreIdList) && StringUtils.isNotBlank(userId) && !isAdmin) {
|
||||
requestStoreIdList = userAuthMappingService.getAuthStoreIdAndSubRegionIdByUserId(userId);
|
||||
if(CollectionUtils.isEmpty(requestStoreIdList)){
|
||||
return new PageInfo<>();
|
||||
}
|
||||
}
|
||||
String practicalAssessmentUserId = userId;
|
||||
//空意味着管理员
|
||||
if(isAdmin){
|
||||
practicalAssessmentUserId = null;
|
||||
}
|
||||
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<EmployeeTrainingVO> employeeTrainingVOList = employeeTrainingDAO
|
||||
.assessmentUserList(request.getName(), userId, request.getAssessmentStatus(),
|
||||
.assessmentUserList(request.getName(), practicalAssessmentUserId, request.getAssessmentStatus(),
|
||||
DateUtils.parseLongDateToStr(request.getEstimatedAssessmentBeginTime()),
|
||||
DateUtils.parseLongDateToStr(request.getEstimatedAssessmentEndTime()),
|
||||
DateUtils.parseLongDateToStr(request.getActualAssessmentBeginTime()),
|
||||
DateUtils.parseLongDateToStr(request.getActualAssessmentEndTime()), request.getStoreIdList(), authRegionIdList);
|
||||
DateUtils.parseLongDateToStr(request.getActualAssessmentEndTime()), requestStoreIdList);
|
||||
if (CollectionUtils.isEmpty(employeeTrainingVOList)) {
|
||||
return new PageInfo<>(employeeTrainingVOList);
|
||||
}
|
||||
@@ -640,10 +649,10 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
}
|
||||
|
||||
|
||||
if (employeeTrainingDO.getPracticalExamStatus() == CommonConstants.TWO || employeeTrainingDO.getTheoreticalExamStatus() == CommonConstants.TWO) {
|
||||
if (employeeTrainingDO.getPracticalExamStatus() == CommonConstants.TWO) {
|
||||
employeeTrainingDO.setAssessmentStatus(CommonConstants.THREE);
|
||||
}
|
||||
if (employeeTrainingDO.getPracticalExamStatus() == 1 && employeeTrainingDO.getTheoreticalExamStatus() == 1) {
|
||||
if (employeeTrainingDO.getPracticalExamStatus() == 1) {
|
||||
employeeTrainingDO.setAssessmentStatus(CommonConstants.TWO);
|
||||
}
|
||||
employeeTrainingDAO.updateByPrimaryKeySelective(employeeTrainingDO);
|
||||
|
||||
@@ -113,7 +113,8 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
preparationScheduleVO.setRegionNodeName(regionNameMap.getOrDefault(x.getRegionId(), ""));
|
||||
ScheduleDTO dto = scheduleDTOMap.getOrDefault(x.getId(), new ScheduleDTO());
|
||||
preparationScheduleVO.setCompletionColumn(dto.getCompletionColumn());
|
||||
preparationScheduleVO.setTotalColumn(dto.getTotalColumn());
|
||||
//-1 去掉视觉验收
|
||||
preparationScheduleVO.setTotalColumn(dto.getTotalColumn()-1);
|
||||
ShopStageInfoDO stageInfoDO = shopStageInfoDOMap.getOrDefault(x.getId(), new ShopStageInfoDO());
|
||||
if (StringUtils.isNotEmpty(stageInfoDO.getActualCompleteTime())) {
|
||||
preparationScheduleVO.setContractCompletionTime(DateUtils.strToDate(stageInfoDO.getActualCompleteTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
|
||||
import com.cool.store.dto.decoration.DecorationDTO;
|
||||
import com.cool.store.dto.decoration.ProjectDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.AuditResultTypeEnum;
|
||||
import com.cool.store.enums.AuditTypeEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.UserRoleEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.LineInfoMapper;
|
||||
import com.cool.store.mapper.ShopInfoMapper;
|
||||
import com.cool.store.request.AcceptanceListRequest;
|
||||
import com.cool.store.request.SeeAcceptanceRequest;
|
||||
import com.cool.store.request.SeeAccetanceListRequest;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.fitmentCheckVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Auther: WangShuo
|
||||
* @Date: 2024/05/17/下午5:58
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Service
|
||||
public class SeeAcceptanceServiceImpl implements SeeAcceptanceService {
|
||||
private static final Logger log = LoggerFactory.getLogger(SeeAcceptanceServiceImpl.class);
|
||||
@Resource
|
||||
private DecorationService decorationService;
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
private YlfService ylfService;
|
||||
@Resource
|
||||
private ShopAuditInfoDAO shopAuditInfoDAO;
|
||||
@Resource
|
||||
private TempUserDetailDAO tempUserDetailDAO;
|
||||
@Resource
|
||||
private ShopStageInfoDAO shopStageInfoDAO;
|
||||
@Resource
|
||||
private PreparationService preparationService;
|
||||
@Resource
|
||||
private UserAuthMappingService userAuthMappingService;
|
||||
@Resource
|
||||
private ShopInfoMapper shopInfoMapper;
|
||||
@Resource
|
||||
private LineInfoMapper lineInfoMapper;
|
||||
@Resource
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
@Resource
|
||||
private RegionService regionService;
|
||||
@Resource
|
||||
private SysRoleService sysRoleService;
|
||||
@Resource
|
||||
private AcceptanceInfoDAO acceptanceInfoDAO;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean auditSeeAcceptance(SeeAcceptanceRequest request, LoginUserInfo user) {
|
||||
if (request.getShopId() == null || request.getShopId() == 0) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_ID_IS_NULL);
|
||||
}
|
||||
if (request.getResultType() == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.SEE_ACCEPTANCE_AUDIT_NULL);
|
||||
}
|
||||
if (Objects.isNull(user)) {
|
||||
throw new ServiceException(ErrorCodeEnum.USER_NOT_LOGIN);
|
||||
}
|
||||
|
||||
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
||||
shopAuditInfoDO.setShopId(request.getShopId());
|
||||
shopAuditInfoDO.setAuditType(AuditTypeEnum.VISUAL_ACCEPTANCE.getCode());
|
||||
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
|
||||
shopAuditInfoDO.setSubmittedUserName(user.getName());
|
||||
shopAuditInfoDO.setResultType(request.getResultType());
|
||||
if (AuditResultTypeEnum.PASS.getCode().equals(request.getResultType())) {
|
||||
shopAuditInfoDO.setPassReason(request.getReason());
|
||||
} else {
|
||||
shopAuditInfoDO.setRejectReason(request.getReason());
|
||||
}
|
||||
// TODO xfsg_user_detail_id
|
||||
shopAuditInfoDO.setCreateTime(new Date());
|
||||
shopAuditInfoDO.setDataType(CommonConstants.ONE);
|
||||
Long id = shopAuditInfoDAO.addAuditInfo(shopAuditInfoDO);
|
||||
if (AuditResultTypeEnum.PASS.getCode().equals(request.getResultType())) {
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_132, id);
|
||||
preparationService.whetherToOpenForAcceptance(request.getShopId());
|
||||
} else {
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_131, id);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstructionScheduleDTO getWithdrawal(Long shopId) {
|
||||
DecorationDTO decoration = getDecorationDTO(shopId);
|
||||
if (decoration == null) {
|
||||
log.error("DecorationModel is null");
|
||||
return null;
|
||||
}
|
||||
ConstructionScheduleDTO constructionScheduleDTO = new ConstructionScheduleDTO();
|
||||
List<ConstructionScheduleDTO> constructionSchedule = decoration.getConstructionSchedule();
|
||||
for (ConstructionScheduleDTO a : constructionSchedule) {
|
||||
if (CommonConstants.WITHDRAWAL.equals(a.getName())) {
|
||||
constructionScheduleDTO = a;
|
||||
}
|
||||
}
|
||||
if (Objects.isNull(constructionScheduleDTO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.SEE_ACCEPTANCE_ERROR);
|
||||
}
|
||||
return constructionScheduleDTO;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopAuditInfoDO> getAuditInfo(Long shopId) {
|
||||
return shopAuditInfoDAO.getAuditList(shopId, AuditTypeEnum.VISUAL_ACCEPTANCE.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<fitmentCheckVO> getAcceptanceList(AcceptanceListRequest request, LoginUserInfo user) {
|
||||
List<String> authRegionIds = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(user.getUserId());
|
||||
List<Long> regions = new ArrayList<>();
|
||||
for (String authRegionId : authRegionIds) {
|
||||
regions.add(Long.parseLong(authRegionId));
|
||||
}
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
if (regions.isEmpty()) {
|
||||
log.info("该用户下权限没有管理区域");
|
||||
return new PageInfo<>();
|
||||
}
|
||||
List<fitmentCheckVO> fitmentCheckVOList = new ArrayList<>();
|
||||
//shopId,lineid,regionid,shopname,storenum,
|
||||
|
||||
List<ShopInfoDO> shopInfoDOS = shopInfoMapper.selectShopListByRegionId(regions, request.getSubStageStatus(),request.getRequest());
|
||||
PageInfo pageInfo = new PageInfo<>(shopInfoDOS);
|
||||
if (shopInfoDOS.isEmpty()) {
|
||||
log.info("该工程部监理下门店为空");
|
||||
return pageInfo;
|
||||
}
|
||||
Map<Long, ShopInfoDO> ShopIdmap = shopInfoDOS.stream().collect(Collectors.toMap(ShopInfoDO::getId, dto1 -> dto1));
|
||||
//招商经理,选址人员(拓展经理)id
|
||||
List<Long> lineIds = shopInfoDOS.stream().filter(o -> o.getLineId() != null)
|
||||
.map(ShopInfoDO::getLineId).distinct().collect(Collectors.toList());
|
||||
List<LineInfoDO> lineInfos = lineInfoMapper.getByLineIds(lineIds);
|
||||
Map<Long, LineInfoDO> lineInfoDOMap = lineInfos.stream().collect(Collectors.toMap(LineInfoDO::getId, dto -> dto));
|
||||
//招商name
|
||||
List<String> userIds = new ArrayList<>();
|
||||
userIds.addAll(lineInfos.stream().filter(o -> o.getInvestmentManager() != null)
|
||||
.map(LineInfoDO::getInvestmentManager).distinct().collect(Collectors.toList()));
|
||||
//选址人员(拓展经理)name
|
||||
userIds.addAll(lineInfos.stream().filter(o -> o.getDevelopmentManager() != null)
|
||||
.map(LineInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList()));
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(userIds);
|
||||
//所属战区
|
||||
List<Long> regionIds = shopInfoDOS.stream().filter(o -> o.getRegionId() != null).
|
||||
map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||
//战区经理name
|
||||
Map<Long, String> fightManger = new HashMap<>();
|
||||
for (Long regionId : regionIds) {
|
||||
String fightMangerUserId = sysRoleService.getUserIdByRegionIdWithRolePriority(regionId, Arrays.asList(UserRoleEnum.THEATER_MANAGER));
|
||||
String userName = enterpriseUserDAO.getUserName(fightMangerUserId);
|
||||
fightManger.put(regionId, userName);
|
||||
}
|
||||
//施工实际完成实际
|
||||
List<Long> shopIds = new ArrayList<>(ShopIdmap.keySet());
|
||||
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO.selectByShopIds(shopIds);
|
||||
Map<Long, AcceptanceInfoDO> acceptanceInfoDOSMap = acceptanceInfoDOS.stream()
|
||||
.collect(Collectors.toMap(AcceptanceInfoDO::getShopId, dto1 -> dto1));
|
||||
//验收状态
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_13.getShopSubStage());
|
||||
List<Long> audits = subStageList.stream().filter(o -> o.getAuditId() != null).map(ShopStageInfoDO::getAuditId).collect(Collectors.toList());
|
||||
//验收时间
|
||||
List<ShopAuditInfoDO> auditInfoList = shopAuditInfoDAO.getAuditInfoList(audits);
|
||||
Map<Long, ShopAuditInfoDO> auditMap = auditInfoList.stream().filter(o -> o.getShopId() != null).collect(Collectors.toMap(ShopAuditInfoDO::getShopId, Function.identity()));
|
||||
|
||||
Map<Long, ShopStageInfoDO> ShopStageInfoDOMap = subStageList.stream()
|
||||
.collect(Collectors.toMap(ShopStageInfoDO::getShopId, dto1 -> dto1));
|
||||
for (ShopInfoDO shopInfoDO : shopInfoDOS) {
|
||||
Long shopId = shopInfoDO.getId();
|
||||
Long lineId = shopInfoDO.getLineId();
|
||||
Long regionId = shopInfoDO.getRegionId();
|
||||
fitmentCheckVO fitmentCheckVO = new fitmentCheckVO();
|
||||
fitmentCheckVO.setShopId(shopId);
|
||||
fitmentCheckVO.setLineId(lineId);
|
||||
fitmentCheckVO.setShopName(shopInfoDO.getShopName());
|
||||
fitmentCheckVO.setStoreNum(shopInfoDO.getStoreNum());
|
||||
fitmentCheckVO.setRegionId(regionId);
|
||||
fitmentCheckVO.setRegion(regionNameMap.get(regionId));
|
||||
fitmentCheckVO.setFightManager(fightManger.get(regionId));
|
||||
if (lineId != null) {
|
||||
fitmentCheckVO.setInvestmentManagerId(lineInfoDOMap.get(lineId)
|
||||
.getInvestmentManager());
|
||||
fitmentCheckVO.setInvestmentManager(userNameMap.get(lineInfoDOMap.get(lineId)
|
||||
.getInvestmentManager()));
|
||||
fitmentCheckVO.setSitterId(lineInfoDOMap.get(lineId)
|
||||
.getDevelopmentManager());
|
||||
fitmentCheckVO.setSitterName(userNameMap.get(lineInfoDOMap.get(lineId)
|
||||
.getDevelopmentManager()));
|
||||
fitmentCheckVO.setPartnerName(lineInfoDOMap.get(lineId).getUsername());
|
||||
}
|
||||
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDOSMap.get(shopId);
|
||||
if (shopId != null) {
|
||||
if (Objects.nonNull(acceptanceInfoDO)) {
|
||||
fitmentCheckVO.setActualEndTime(acceptanceInfoDO.getConstructionCompletionTime());
|
||||
}
|
||||
}
|
||||
if (Objects.nonNull(auditMap.get(shopId))) {
|
||||
fitmentCheckVO.setAcceptanceTime(auditMap.get(shopId).getCreateTime());
|
||||
}
|
||||
if (Objects.nonNull(ShopStageInfoDOMap.get(shopId))) {
|
||||
fitmentCheckVO.setShopSubStageStatus(ShopStageInfoDOMap.get(shopId).getShopSubStageStatus());
|
||||
}
|
||||
fitmentCheckVOList.add(fitmentCheckVO);
|
||||
}
|
||||
pageInfo.setList(fitmentCheckVOList);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private DecorationDTO getDecorationDTO(Long shopId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
|
||||
}
|
||||
String storeNum = shopInfo.getStoreNum();
|
||||
if (StringUtils.isNotEmpty(storeNum)) {
|
||||
ProjectDTO projectList = ylfService.getProjectList(storeNum);
|
||||
Long projectId = projectList.getProjectId();
|
||||
DecorationDTO decoration = ylfService.getDecoration(projectId);
|
||||
return decoration;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -114,7 +114,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
|
||||
Long auditId = shopAuditInfoDO.getId();
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum, auditId);
|
||||
systemBuildingShopMapper.updateAuditByShopId(auditId, shopId);
|
||||
signFranchiseMapper.updateAuditByShopId(auditId, shopId);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
|
||||
FranchiseAgreementRequest franchiseAgreementRequest = convertFranchiseAgreement(request, shopInfoDO, user);
|
||||
MemberQuestionDO memberQuestionDO = joinIntentionMapper.getByLineId(shopInfoDO.getLineId());
|
||||
log.info("submitSignFranchise franchiseAgreementRequest :{}",JSONObject.toJSONString(franchiseAgreementRequest));
|
||||
ResponseResult responseResult = coolStoreStartFlowService.franchiseAgreement(franchiseAgreementRequest, memberQuestionDO.getJoinType());
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83);
|
||||
return responseResult;
|
||||
@@ -249,7 +250,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
.jmsxm1(lineInfoDO.getUsername())
|
||||
.jsrq(getDateTimeFormat(Constants.TIME_STAMP_FLAG, request.getContractStartEndTime()))
|
||||
.jszhhz(linePayDO.getPayAccount())
|
||||
.kdzBusinessId(AuditEnum.SIGN_FRANCHISE + "_" + shopId + "_" + lineId)
|
||||
.kdzBusinessId(AuditEnum.SIGN_FRANCHISE.getCode() + "_" + shopId + "_" + lineId)
|
||||
.khhjzh(linePayDO.getBankName())
|
||||
.lvbzj(Integer.valueOf(franchiseFeeDO.getPerformanceBond()))
|
||||
.lybzjdx(Integer.valueOf(franchiseFeeDO.getPerformanceBond()))
|
||||
@@ -263,7 +264,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
.partyb_type(licenseTransactDO.getLicenseType())
|
||||
.ppsyfbl(Double.parseDouble(request.getBrandFee()))
|
||||
.psfl("以实际结算为准")
|
||||
.qsdz("PUBLIC_COMPANY")
|
||||
.qsdz("PUBLIC_COMPANY,PUBLIC_OPERATOR")
|
||||
.qsrq(getDateTimeFormat(Constants.TIME_STAMP_FLAG, request.getContractStartTime()))
|
||||
.qylx(SignTypeEnum.getWorkflowStageByCode(request.getSignType()).getCode())
|
||||
.qys_dzyz("2731707107593166911")
|
||||
@@ -378,7 +379,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
if (Objects.nonNull(lineInfoDO)) {
|
||||
addSignFranchiseResponse.setPartnerName(lineInfoDO.getUsername());
|
||||
}
|
||||
if (Objects.nonNull(signingBaseInfoDO)) {
|
||||
if (Objects.nonNull(signingBaseInfoDO) && Objects.nonNull(memberQuestionDO)) {
|
||||
if (JoinTypeEnum.JOIN_TYPE_ONE.getCode().equals(memberQuestionDO.getJoinType())) {
|
||||
addSignFranchiseResponse.setIdCardNo(signingBaseInfoDO.getIdCardNo());
|
||||
} else if (JoinTypeEnum.JOIN_TYPE_TWO.getCode().equals(memberQuestionDO.getJoinType())) {
|
||||
|
||||
@@ -383,7 +383,7 @@ public class SysStoreAppServiceImpl implements SysStoreAppService, AuditResultSe
|
||||
// zmdzt
|
||||
newStoreRequest.setZmdzt(10);
|
||||
// zmrjkllzs1
|
||||
newStoreRequest.setZmrjkllzs1(sysStoreAppRequest.getStoreDetail().getAverageDailyRs());
|
||||
newStoreRequest.setZmrjkllzs1(PassengerFlowEnum.getByCode(sysStoreAppRequest.getStoreDetail().getAverageDailyRs()).getType());
|
||||
// zppsyfy
|
||||
newStoreRequest.setZppsyfy(0.05);
|
||||
// zq
|
||||
|
||||
@@ -79,6 +79,20 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
|
||||
return regionIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAuthStoreIdAndSubRegionIdByUserId(String userId){
|
||||
List<UserAuthMappingDO> userAuthMapping = listUserAuthMappingByUserId(userId);
|
||||
if(CollectionUtils.isEmpty(userAuthMapping)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<String> regionIds = userAuthMapping.stream().map(UserAuthMappingDO::getMappingId).collect(Collectors.toList());
|
||||
List<String> subRegionIds = regionMapper.getStoreIdsByRegionIds(regionIds);
|
||||
if(CollectionUtils.isNotEmpty(subRegionIds)){
|
||||
regionIds.addAll(subRegionIds);
|
||||
}
|
||||
return regionIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供 根据职位 意向区域 查 对应人的接口 同时返回人名字
|
||||
* @param userRoleEnum
|
||||
|
||||
Reference in New Issue
Block a user