mini设计阶段确认加校验

This commit is contained in:
shuo.wang
2025-04-14 16:29:43 +08:00
parent efe854c416
commit 8564e70e13
3 changed files with 11 additions and 3 deletions

View File

@@ -637,6 +637,13 @@ public class DecorationServiceImpl implements DecorationService {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean confirmDesign(DecorationDesignRequest request, LoginUserInfo user) {
DecorationDesignInfoDO decoration = decorationDesignInfoDAO.getByShopId(request.getShopId());
if (StringUtils.isBlank(decoration.getQuotationUrl())){
throw new ServiceException(ErrorCodeEnum.QUOTATION_URL_REQUIRED);
}
if (StringUtils.isBlank(decoration.getDesignUrl())){
throw new ServiceException(ErrorCodeEnum.DESIGN_URL_REQUIRED);
}
//重复提交校验 3秒内不能重复提交
String lockKey = "confirmDesign:" + request.getShopId();
String lockValue = UUID.randomUUID().toString();
@@ -645,7 +652,6 @@ public class DecorationServiceImpl implements DecorationService {
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
}
DecorationDesignInfoDO decorationDesignInfoDO = request.toDecorationDesignInfoDO();
DecorationDesignInfoDO decoration = decorationDesignInfoDAO.getByShopId(request.getShopId());
if (Objects.nonNull(decoration)) {
decorationDesignInfoDO.setId(decoration.getId());
decorationDesignInfoDAO.updateByPrimaryKeySelective(decorationDesignInfoDO);