Prechádzať zdrojové kódy

商家平台端财务管理

qrs 2 týždňov pred
rodič
commit
6b72722223

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreMainInfoVo.java

@@ -93,7 +93,7 @@ public class StoreMainInfoVo extends StoreInfo {
     private long countdown;
 
     @ApiModelProperty(value = "经营许可证到期时间")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+//    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date foodLicenceExpirationTime;
 
 }

+ 0 - 3
alien-store-platform/src/main/java/shop/alien/storeplatform/controller/LifeUserOrderPlatformController.java

@@ -73,9 +73,6 @@ public class LifeUserOrderPlatformController {
         if (storeId == null || storeId == "" ) {
             return R.data(null);
         }
-        if (userId == null || userId == "") {
-            return R.data(null);
-        }
         return R.data(lifeUserOrderService.queryUserOrderList(pageNum, pageSize, userId, storeId, couponType, status, couponName, startTime, endTime, orderNo));
     }
 

+ 9 - 0
alien-store-platform/src/main/java/shop/alien/storeplatform/controller/StorePlatformLoginController.java

@@ -1,5 +1,6 @@
 package shop.alien.storeplatform.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import io.swagger.annotations.*;
 import lombok.RequiredArgsConstructor;
@@ -167,4 +168,12 @@ public class StorePlatformLoginController {
         storePlatformLoginService.generateCaptcha(response, session);
     }
 
+    @ApiOperation("判断当前店铺是否已到期")
+    @ApiOperationSupport(order = 6)
+    @GetMapping("/getExpirationTime")
+    public JSONObject getExpirationTime(Integer storeId) throws Exception {
+        log.info("StorePlatformLoginController.getExpirationTime?storeId={}", storeId);
+        return storePlatformLoginService.getExpirationTime(storeId);
+    }
+
 }

+ 3 - 0
alien-store-platform/src/main/java/shop/alien/storeplatform/service/StorePlatformLoginervice.java

@@ -1,5 +1,6 @@
 package shop.alien.storeplatform.service;
 
+import com.alibaba.fastjson.JSONObject;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.StoreUser;
 import shop.alien.entity.store.vo.StoreUserVo;
@@ -30,4 +31,6 @@ public interface StorePlatformLoginervice {
 
     void generateCaptcha(HttpServletResponse response, HttpSession session) throws IOException;
 
+    JSONObject getExpirationTime(Integer storeId) throws Exception;
+
 }

+ 23 - 0
alien-store-platform/src/main/java/shop/alien/storeplatform/service/impl/StorePlatformLoginServiceImpl.java

@@ -203,6 +203,29 @@ public class StorePlatformLoginServiceImpl extends ServiceImpl<StoreUserMapper,
         }
     }
 
+    @Override
+    public JSONObject getExpirationTime(Integer storeId) throws Exception {
+        try {
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("expirationTime", 0);
+            jsonObject.put("foodLicenceExpirationTime", 0);
+
+            StoreInfo storeInfo = storeInfoMapper.selectById(storeId);
+            if (storeInfo != null) {
+                if (storeInfo.getExpirationTime().compareTo(new Date()) > 0) {
+                    jsonObject.put("expirationTime", 1);
+                }
+                if (storeInfo.getFoodLicenceExpirationTime().compareTo(new Date()) > 0) {
+                    jsonObject.put("foodLicenceExpirationTime", 1);
+                }
+            }
+            return jsonObject;
+        } catch (Exception e) {
+            log.error("StorePlatformLoginServiceImpl.getExpirationTime(): Error Msg={}", e.getMessage());
+            throw new RuntimeException(e.getMessage());
+        }
+    }
+
     private void passwordVerification(String phone, String password, String newPassword, String confirmNewPassword) {
         LambdaUpdateWrapper<StoreUser> wrapperFans = new LambdaUpdateWrapper<>();
         wrapperFans.eq(StoreUser::getPhone, phone);