|
|
|
|
@@ -16,6 +16,7 @@ import javax.annotation.Resource;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -43,8 +44,11 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean assignDesigner(AssignDesignerRequest request) {
|
|
|
|
|
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
|
|
|
|
|
if (shopInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
|
|
|
|
}
|
|
|
|
|
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfoDO.getId(), ShopSubStageEnum.SHOP_STAGE_9);
|
|
|
|
|
if (shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus())){
|
|
|
|
|
if (shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus())) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
|
|
|
|
}
|
|
|
|
|
DecorationDesignInfoDO designInfoDO = decorationDesignInfoDAO.getByShopId(shopInfoDO.getId());
|
|
|
|
|
@@ -73,6 +77,9 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean submitDesignDrawing(SubmitDesignDrawingRequest request) {
|
|
|
|
|
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
|
|
|
|
|
if (shopInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
|
|
|
|
}
|
|
|
|
|
DecorationDesignInfoDO designInfoDO = decorationDesignInfoDAO.getByShopId(shopInfoDO.getId());
|
|
|
|
|
if (designInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
|
|
|
|
@@ -96,6 +103,9 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean assignQuotation(AssignQuotationRequest request) {
|
|
|
|
|
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
|
|
|
|
|
if (shopInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
|
|
|
|
}
|
|
|
|
|
DecorationDesignInfoDO designInfoDO = decorationDesignInfoDAO.getByShopId(shopInfoDO.getId());
|
|
|
|
|
if (designInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
|
|
|
|
@@ -116,6 +126,9 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean submitQuotationSheet(SubmitQuotationSheetRequest request) {
|
|
|
|
|
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
|
|
|
|
|
if (shopInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
|
|
|
|
}
|
|
|
|
|
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfoDO.getLineId());
|
|
|
|
|
DecorationDesignInfoDO designInfoDO = decorationDesignInfoDAO.getByShopId(shopInfoDO.getId());
|
|
|
|
|
if (designInfoDO == null) {
|
|
|
|
|
@@ -140,6 +153,9 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean submitConstructionOrder(ConstructionOrderRequest request) {
|
|
|
|
|
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
|
|
|
|
|
if (shopInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
|
|
|
|
}
|
|
|
|
|
DecorationDesignInfoDO designInfoDO = decorationDesignInfoDAO.getByShopId(shopInfoDO.getId());
|
|
|
|
|
if (designInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
|
|
|
|
@@ -159,6 +175,9 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean entryConfirmation(EntryConfirmationRequest request) {
|
|
|
|
|
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
|
|
|
|
|
if (shopInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
|
|
|
|
}
|
|
|
|
|
DecorationDesignInfoDO designInfoDO = decorationDesignInfoDAO.getByShopId(shopInfoDO.getId());
|
|
|
|
|
if (designInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
|
|
|
|
@@ -177,6 +196,9 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean constructionCompleted(ConstructionCompletedRequest request) {
|
|
|
|
|
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
|
|
|
|
|
if (shopInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
|
|
|
|
}
|
|
|
|
|
DecorationDesignInfoDO designInfoDO = decorationDesignInfoDAO.getByShopId(shopInfoDO.getId());
|
|
|
|
|
if (designInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
|
|
|
|
@@ -186,6 +208,7 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|
|
|
|
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfoDO.getId(), ShopSubStageEnum.SHOP_STAGE_11);
|
|
|
|
|
if (shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_111.getShopSubStageStatus())) {
|
|
|
|
|
shopStageInfoDAO.updateShopStageInfo(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_112);
|
|
|
|
|
shopStageInfoDAO.updateShopStageInfo(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
@@ -194,12 +217,19 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean decorationAcceptance(HqtDecorationAcceptanceRequest request) {
|
|
|
|
|
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
|
|
|
|
|
if (shopInfoDO == null) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
|
|
|
|
}
|
|
|
|
|
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfoDO.getId(), ShopSubStageEnum.SHOP_STAGE_12);
|
|
|
|
|
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122.getShopSubStageStatus())
|
|
|
|
|
&& !shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123.getShopSubStageStatus())) {
|
|
|
|
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
|
|
|
|
}
|
|
|
|
|
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopInfoDO.getId());
|
|
|
|
|
if (Objects.isNull(acceptanceInfoDO)) {
|
|
|
|
|
acceptanceInfoDO = new AcceptanceInfoDO();
|
|
|
|
|
acceptanceInfoDO.setShopId(shopInfoDO.getId());
|
|
|
|
|
}
|
|
|
|
|
acceptanceInfoDO.setDeliveryOrderId(request.getDeliveryOrderId());
|
|
|
|
|
acceptanceInfoDO.setActualAcceptanceTime(request.getActualAcceptanceTime());
|
|
|
|
|
acceptanceInfoDO.setAcceptanceAttachment(String.join(",", request.getAcceptanceAttachmentUrl()));
|
|
|
|
|
@@ -207,7 +237,11 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|
|
|
|
acceptanceInfoDO.setShopInteriorPhoto(request.getShopInteriorPhotoUrl());
|
|
|
|
|
acceptanceInfoDO.setBackKitchenPhoto(request.getBackKitchenPhotoUrl());
|
|
|
|
|
acceptanceInfoDO.setAddReduceAmount(request.getAddReduceAmount());
|
|
|
|
|
acceptanceInfoDAO.updateAcceptanceInfo(acceptanceInfoDO);
|
|
|
|
|
if (acceptanceInfoDO.getId() == null) {
|
|
|
|
|
acceptanceInfoDAO.insertSelectiveAcceptanceInfo(acceptanceInfoDO);
|
|
|
|
|
} else {
|
|
|
|
|
acceptanceInfoDAO.updateAcceptanceInfo(acceptanceInfoDO);
|
|
|
|
|
}
|
|
|
|
|
if (shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122.getShopSubStageStatus())) {
|
|
|
|
|
shopStageInfoDAO.updateShopStageInfo(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123);
|
|
|
|
|
}
|
|
|
|
|
|