Browse Source

bugfix:1186 团购详情 修改团购提前上架售卖时间时间

qxy 1 month ago
parent
commit
679f0a7b9d

+ 11 - 1
alien-store/src/main/java/shop/alien/store/service/impl/LifeGroupBuyServiceImpl.java

@@ -198,7 +198,17 @@ public class LifeGroupBuyServiceImpl extends ServiceImpl<LifeGroupBuyMainMapper,
 
     @Override
     public boolean updateStatus(String id, String status, String approvalComments) {
-        lifeGroupBuyMainMapper.update(null, new LambdaUpdateWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getId, id).set(LifeGroupBuyMain::getStatus, status).set(LifeGroupBuyMain::getApprovalComments, approvalComments));
+        LambdaUpdateWrapper<LifeGroupBuyMain> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
+        lambdaUpdateWrapper.eq(LifeGroupBuyMain::getId, id);
+        lambdaUpdateWrapper.set(LifeGroupBuyMain::getStatus, status);
+        lambdaUpdateWrapper.set(LifeGroupBuyMain::getApprovalComments, approvalComments);
+        if(status.equals("5")){
+            LifeGroupBuyMain lifeGroupBuyMain = lifeGroupBuyMainMapper.selectById(id);
+            if(lifeGroupBuyMain !=null && lifeGroupBuyMain.getStatus()==2){
+                lambdaUpdateWrapper.set(LifeGroupBuyMain::getStartTimeValue, new Date());
+            }
+        }
+            lifeGroupBuyMainMapper.update(null,lambdaUpdateWrapper);
         //处理中台审核记录
         if(StringUtils.isNotEmpty(id) && StringUtils.isNotEmpty(status) && (status.equals("2") || status.equals("3"))){
             LambdaUpdateWrapper<WebAudit> wrapper = new LambdaUpdateWrapper<>();