Quellcode durchsuchen

vip过期判断为空

小么熊🐻 vor 3 Jahren
Ursprung
Commit
cd01b11013

+ 16 - 1
jsjp-service/src/main/java/com/miaxis/newgzpt/service/impl/GzptVideoVipServiceImpl.java

@@ -10,6 +10,7 @@ import com.miaxis.newgzpt.service.IGzptVideoVipService;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.Date;
 
 
 /**
@@ -41,7 +42,21 @@ public class GzptVideoVipServiceImpl extends ServiceImpl<GzptVideoVipMapper, Gzp
 
     @Override
     public GzptVideoVip getGzptVideoVipByUserId(GzptVideoVipDTO gzptVideoVipDTO) {
-        return mapper.getGzptVideoVipByUserId(gzptVideoVipDTO);
+        GzptVideoVip vv =  mapper.getGzptVideoVipByUserId(gzptVideoVipDTO);
+        Date now = new Date();
+        if(vv!=null) {
+            if(vv.getSubject2()!=null) {
+                if(vv.getSubject2().compareTo(now)<0){
+                    vv.setSubject2(null);
+                }
+            }
+            if(vv.getSubject3()!=null) {
+                if(vv.getSubject3().compareTo(now)<0){
+                    vv.setSubject3(null);
+                }
+            }
+        }
+        return vv;
     }
 
 }