Преглед на файлове

修改bug: U店在这#723

ssk преди 1 месец
родител
ревизия
c7157dc7fb
променени са 1 файла, в които са добавени 8 реда и са изтрити 5 реда
  1. 8 5
      alien-store/src/main/java/shop/alien/store/service/impl/LifeGroupBuyServiceImpl.java

+ 8 - 5
alien-store/src/main/java/shop/alien/store/service/impl/LifeGroupBuyServiceImpl.java

@@ -103,6 +103,7 @@ public class LifeGroupBuyServiceImpl extends ServiceImpl<LifeGroupBuyMainMapper,
             Integer count = lifeGroupBuyMainMapper.selectCount(new LambdaQueryWrapper<LifeGroupBuyMain>().like(LifeGroupBuyMain::getCreatedTime, DateUtils.formatDate(new Date(), "yyyy-MM-dd")).eq(LifeGroupBuyMain::getStoreId, lifeGroupBuyMain.getStoreId()));
             lifeGroupBuyMain.setGroupNo("G" + DateUtils.formatDate(new Date(), "yyyyMMdd") + lifeGroupBuyMain.getStoreId() + org.apache.commons.lang3.StringUtils.leftPad(String.valueOf(count + 1), 5, "0"));
             lifeGroupBuyMain.setCreatedUserId(userId);
+            lifeGroupBuyMain.setCreatedTime(new Date());
             lifeGroupBuyMainMapper.insert(lifeGroupBuyMain);
             if (ObjectUtils.isNotEmpty(lifeGroupBuyThalis)) {
                 for (int i = 0; i < lifeGroupBuyThalis.size(); i++) {
@@ -110,14 +111,16 @@ public class LifeGroupBuyServiceImpl extends ServiceImpl<LifeGroupBuyMainMapper,
                     lifeGroupBuyThali.setParentId(lifeGroupBuyMain.getId().toString());
                     lifeGroupBuyThali.setDetailSort(i + 1);
                     lifeGroupBuyThali.setCreatedUserId(userId);
+                    lifeGroupBuyThali.setCreatedTime(new Date());
                     lifeGroupBuyThaliMapper.insert(lifeGroupBuyThali);
                 }
             }
             return lifeGroupBuyThali;
         } else {
             lifeGroupBuyMain.setUpdatedUserId(userId);
+            lifeGroupBuyMain.setCreatedTime(new Date());
             lifeGroupBuyMainMapper.updateById(lifeGroupBuyMain);
-            lifeGroupBuyThaliMapper.update(null, new LambdaUpdateWrapper<LifeGroupBuyThali>().eq(LifeGroupBuyThali::getParentId, lifeGroupBuyMain.getId()).set(LifeGroupBuyThali::getDeleteFlag, 1));
+            lifeGroupBuyThaliMapper.update(null, new LambdaUpdateWrapper<LifeGroupBuyThali>().eq(LifeGroupBuyThali::getParentId, lifeGroupBuyMain.getId()).set(LifeGroupBuyThali::getDeleteFlag, 1).set(LifeGroupBuyThali::getCreatedTime, new Date()));
             if (ObjectUtils.isNotEmpty(lifeGroupBuyThalis)) {
                 for (int i = 0; i < lifeGroupBuyThalis.size(); i++) {
                     lifeGroupBuyThali = lifeGroupBuyThalis.get(i);
@@ -135,9 +138,9 @@ public class LifeGroupBuyServiceImpl extends ServiceImpl<LifeGroupBuyMainMapper,
     public IPage<LifeGroupBuyThaliVo> getThaliList(int page, int size, String storeId, String status, String groupName, String groupType) {
         QueryWrapper<LifeGroupBuyThaliVo> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq(StringUtils.isNotEmpty(storeId), "store_id", storeId);
-        if(status.equals("8")){
+        if (status.equals("8")) {
             queryWrapper.in(StringUtils.isNotEmpty(status), "status", 2, 6);
-        }else{
+        } else {
             queryWrapper.eq(StringUtils.isNotEmpty(status), "status", status);
         }
         queryWrapper.eq(StringUtils.isNotEmpty(groupType), "group_type", groupType);
@@ -160,7 +163,7 @@ public class LifeGroupBuyServiceImpl extends ServiceImpl<LifeGroupBuyMainMapper,
         // 是否收藏了该团购
         LifeCollect lifeCollect = lifeCollectMapper.selectOne(new QueryWrapper<LifeCollect>().eq("user_id", userId).eq("coupon_id", id));
         lifeGroupBuyThaliVo.setIsCollect("0");
-        if(!Objects.isNull(lifeCollect)){
+        if (!Objects.isNull(lifeCollect)) {
             lifeGroupBuyThaliVo.setIsCollect("1");
         }
         //美食
@@ -210,7 +213,7 @@ public class LifeGroupBuyServiceImpl extends ServiceImpl<LifeGroupBuyMainMapper,
         }
             lifeGroupBuyMainMapper.update(null,lambdaUpdateWrapper);
         //处理中台审核记录
-        if(StringUtils.isNotEmpty(id) && StringUtils.isNotEmpty(status) && (status.equals("2") || status.equals("3"))){
+        if (StringUtils.isNotEmpty(id) && StringUtils.isNotEmpty(status) && (status.equals("2") || status.equals("3"))) {
             LambdaUpdateWrapper<WebAudit> wrapper = new LambdaUpdateWrapper<>();
             wrapper.eq(WebAudit::getLifeGroupPackageId, id);
             wrapper.set(WebAudit::getStatus, "1");