From 84cac956a5f423e4bc6fb3e47271c0507e49c66a Mon Sep 17 00:00:00 2001 From: XinYi Song <2037158277@qq.com> Date: Fri, 17 Dec 2021 10:44:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=90=84=E7=BA=A7?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=95=86=E5=93=81=E4=BF=A1=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/xkrs/service/impl/ProductServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/xkrs/service/impl/ProductServiceImpl.java b/src/main/java/com/xkrs/service/impl/ProductServiceImpl.java index f223b25..d345d06 100644 --- a/src/main/java/com/xkrs/service/impl/ProductServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/ProductServiceImpl.java @@ -15,6 +15,7 @@ import com.xkrs.utils.DateTimeUtil; import com.xkrs.utils.Query; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.time.LocalDateTime; @@ -59,7 +60,7 @@ public class ProductServiceImpl implements ProductService { List productCover = productQo.getProductCover(); // 商品内容图片 List productContent = productQo.getProductContent(); - BusinessEntity byBusinessId = businessDao.findByBusinessId(business); + BusinessEntity byBusinessId = businessDao.findByBusinessIdAndBusinessType(business,"1"); if(byBusinessId == null){ return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"您还未入驻,请先入驻!",locale); } @@ -142,6 +143,7 @@ public class ProductServiceImpl implements ProductService { * @param reviewType * @return */ + @Transactional(rollbackFor=Exception.class) @Override public String updateReviewType(Integer productId, String reviewType) { Locale locale = LocaleContextHolder.getLocale(); @@ -152,7 +154,7 @@ public class ProductServiceImpl implements ProductService { if(reviewType.equals(byId.getReviewType()) || reviewType.compareTo(byId.getReviewType()) < 0){ return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"操作错误!",locale); } - if(reviewType.equals("3")){ + if("3".equals(reviewType)){ String dateTimeToString = DateTimeUtil.dateTimeToString(LocalDateTime.now()); productDao.updateShelfType(productId,"1",dateTimeToString); }