新店装修阶段2.0+修改查询运营列表PSOT

This commit is contained in:
shuo.wang
2024-04-29 15:40:11 +08:00
parent cee949537b
commit 9539790a34
23 changed files with 531 additions and 372 deletions

View File

@@ -3,6 +3,7 @@ package com.cool.store.service;
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
import com.cool.store.dto.decoration.DecorationModelDTO;
import com.cool.store.request.DecorationPayRequest;
import com.cool.store.request.LinePaySubmitRequest;
import com.cool.store.vo.DesignInfoVo;
import com.cool.store.vo.PartnerUserInfoVO;
@@ -26,23 +27,23 @@ public interface DecorationService {
* @Date: 2024/4/28
* @description:设计阶段信息
*/
DesignInfoVo DesignInfo(String shopCode);
DesignInfoVo DesignInfo(Long shopId);
/**
* @Auther: wangshuo
* @Date: 2024/4/28
* @description:获取装修款和支付二维码
*/
DecorationModelDTO DecorationModel(String shopCode);
DecorationModelDTO DecorationModel(Long shopId);
/**
* @Auther: wangshuo
* @Date: 2024/4/28
* @description:提交装修款付款凭证
*/
String submitDecorationModel(DecorationPayRequest decorationPayRequest, PartnerUserInfoVO partnerUserInfoVO);
String submitDecorationModel(LinePaySubmitRequest LinePaySubmitRequest, PartnerUserInfoVO partnerUserInfoVO);
/**
* @Auther: wangshuo
* @Date: 2024/4/28
* @description:施工阶段
*/
List<ConstructionScheduleDTO> getConstruction(String shopCode);
List<ConstructionScheduleDTO> getConstruction(Long shopId);
}

View File

@@ -3,17 +3,26 @@ package com.cool.store.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.dao.LinePayDAO;
import com.cool.store.dao.RegionQrcodeConfigDao;
import com.cool.store.dao.ShopInfoDAO;
import com.cool.store.dto.decoration.*;
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.LinePayDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.enums.point.PayTypeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.DecorationPayRequest;
import com.cool.store.request.LinePaySubmitRequest;
import com.cool.store.service.DecorationService;
import com.cool.store.service.LinePayService;
import com.cool.store.service.YlfService;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.utils.poi.constant.Constants;
import com.cool.store.vo.DesignInfoVo;
import com.cool.store.vo.PartnerUserInfoVO;
import com.cool.store.vo.log.DesignLogVo;
@@ -21,6 +30,7 @@ import org.apache.poi.ss.formula.functions.T;
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.*;
@@ -44,7 +54,10 @@ public class DecorationServiceImpl implements DecorationService {
@Resource
private ShopInfoDAO shopInfoDAO;
@Resource
private LinePayDAO linePayDAO;
private LineInfoDAO lineInfoDAO;
@Resource
private LinePayService linePayService;
private static String MEASURING_THE_ROOM = "量房";
private static String CONSTRUCTION_DRAWING = "施工图+预算";
@Override
@@ -53,10 +66,8 @@ public class DecorationServiceImpl implements DecorationService {
}
@Override
public DesignInfoVo DesignInfo(String shopCode) {
ProjectDTO projectList = ylfService.getProjectList(shopCode);
String projectId = projectList.getProjectId();
DecorationDTO decoration = ylfService.getDecoration(Long.parseLong(projectId));
public DesignInfoVo DesignInfo(Long shopId) {
DecorationDTO decoration = getDecorationDTO(shopId);
List<DesignSchemeDTO> designScheme = decoration.getDesignScheme();
List<ConstructionScheduleDTO> constructionSchedule = decoration.getConstructionSchedule();
@@ -78,54 +89,61 @@ public class DecorationServiceImpl implements DecorationService {
return designInfoVo;
}
@Override
public DecorationModelDTO DecorationModel(String shopCode) {
if (StringUtils.isEmpty(shopCode)){
public DecorationModelDTO DecorationModel(Long shopId) {
if (shopId == null){
log.error("DecorationModel shopCode is null");
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
ProjectDTO projectList = ylfService.getProjectList(shopCode);
String projectId = projectList.getProjectId();
DecorationDTO decoration = ylfService.getDecoration(Long.parseLong(projectId));
DecorationDTO decoration = getDecorationDTO(shopId);
//TODO 验证
//预算
List<BudgetDTO> proposedBookBudget = decoration.getProposedBookBudget();
Collections.sort(decoration.getProposedBookBudget(),(x1,x2)->x2.getId().compareTo(x1.getId()));
String totalAmount = proposedBookBudget.get(0).getTotalAmount();
//支付二维码url
Long regionId = shopInfoDAO.getRegionIdByShopCode(shopCode);
Long regionId = shopInfoDAO.getRegionIdByid(shopId);
String payPic = regionQrcodeConfigDao.getPayPicByRegionId(regionId);
DecorationModelDTO decorationModelDTO = new DecorationModelDTO();
decorationModelDTO.setPayUrl(payPic);
decorationModelDTO.setTotalAmount(totalAmount);
return decorationModelDTO;
}
@Transactional(rollbackFor = Exception.class)
@Override
public String submitDecorationModel(DecorationPayRequest decorationPayRequest, PartnerUserInfoVO partnerUserInfoVO) {
LinePayDO linePayDO =new LinePayDO();
BeanUtil.copyProperties(decorationPayRequest, linePayDO);
linePayDO.setCreateTime(new Date());
linePayDO.setUpdateTime(new Date());
linePayDO.setLineId(partnerUserInfoVO.getLineId());
linePayDO.setCreateUserId(partnerUserInfoVO.getUsername());
linePayDO.setUpdateUserId(partnerUserInfoVO.getUsername());
linePayDO.setPayBusinessType(2);
linePayDO.setPayType(2);
return "";
public String submitDecorationModel(LinePaySubmitRequest request, PartnerUserInfoVO partnerUserInfoVO) {
DecorationDTO decoration = getDecorationDTO(request.getShopId());
if ( decoration.getPayment() != null && decoration.getPayment().size()>0){
request.setPayStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode());
}else {
request.setPayStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_45.getCode());
}
Long payId = linePayService.submitPayInfo(request, partnerUserInfoVO);
return payId.toString();
}
@Override
public List<ConstructionScheduleDTO> getConstruction(String shopCode) {
ProjectDTO projectList = ylfService.getProjectList(shopCode);
String projectId = projectList.getProjectId();
DecorationDTO decoration = ylfService.getDecoration(Long.parseLong(projectId));
public List<ConstructionScheduleDTO> getConstruction(Long shopId) {
DecorationDTO decoration = getDecorationDTO(shopId);
List<ConstructionScheduleDTO> constructionSchedule = decoration.getConstructionSchedule();
Map<String, ConstructionScheduleDTO> constructionScheduleMap = constructionSchedule.stream().collect(Collectors.toMap(ConstructionScheduleDTO::getName,
dto -> dto));
constructionScheduleMap.remove(MEASURING_THE_ROOM);
constructionScheduleMap.remove(CONSTRUCTION_DRAWING);
List<ConstructionScheduleDTO> collect = constructionScheduleMap.values().stream().collect(Collectors.toList());
collect.sort(Comparator.comparing(ConstructionScheduleDTO::getId));
return collect;
}
private DecorationDTO getDecorationDTO(Long shopId) {
List<Long> shopIds =new ArrayList<>();
shopIds.add(shopId);
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = shopInfoDAO.queryStoreNumeListByid(shopIds);
String storeNum = openPlanShopInfoDTOS.get(0).getStoreNum();
ProjectDTO projectList = ylfService.getProjectList(storeNum);
String projectId = projectList.getProjectId();
DecorationDTO decoration = ylfService.getDecoration(Long.parseLong(projectId));
return decoration;
}
}

View File

@@ -11,6 +11,8 @@ import com.cool.store.entity.LinePayDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.enums.point.PayTypeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.FranchiseFeeMapper;
import com.cool.store.mapper.LineInfoMapper;
@@ -82,7 +84,10 @@ public class LinePayServiceImpl implements LinePayService {
fillLinePay(false, linePayDO, request, partnerUser);
linePayDAO.updateLinePay(linePayDO);
}
}else {
}
if(request.getPayBusinessType() != null
&& request.getPayBusinessType() == 0
&& request.getShopId() != null) {
LinePayDO linePayDO = linePayDAO.getLinePayByLineIdAndPayType(request.getLineId(),0);
if(linePayDO == null){
linePayDO = new LinePayDO();
@@ -98,6 +103,20 @@ public class LinePayServiceImpl implements LinePayService {
lineInfoDAO.insertOrUpdate(lineInfo);
return linePayDO.getId();
}
if (request.getPayBusinessType() != null
&& request.getPayBusinessType() == PayBusinessTypeEnum.DECORATION_MODEL.getCode()
&& request.getShopId() != null){
LinePayDO linePayDO = linePayDAO.getLinePayByLineIdAndPayType(request.getLineId(),PayBusinessTypeEnum.DECORATION_MODEL.getCode());
if(linePayDO == null){
linePayDO = new LinePayDO();
fillLinePay(true, linePayDO, request, partnerUser);
linePayDAO.addLinePay(linePayDO);
}else {
fillLinePay(false, linePayDO, request, partnerUser);
linePayDAO.updateLinePay(linePayDO);
}
return linePayDO.getId();
}
return null;
}

View File

@@ -164,7 +164,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
OpeningOperationPlanListVO openingOperationPlanListVO = new OpeningOperationPlanListVO();
openingOperationPlanListVO.setShopId(x.getShopId());
openingOperationPlanListVO.setShopName(x.getShopName());
openingOperationPlanListVO.setShopCode(x.getShopCode());
openingOperationPlanListVO.setStoreNum(x.getStoreNum());
openingOperationPlanListVO.setPartnerName(x.getPartnerName());
openingOperationPlanListVO.setMobile(x.getMobile());
String[] split = regionNameMap.getOrDefault(x.getRegionId(), "").split("-");