From 98b1a0affd69bbe63223c21fdd2c404e8bedfccb Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 20 五月 2020 17:25:08 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into 2.1.2 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/DynamicController.java | 40 ++++++++++++++++++++++++++-------------- 1 files changed, 26 insertions(+), 14 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/DynamicController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/DynamicController.java index 48e8ffd..d870327 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/DynamicController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/DynamicController.java @@ -26,7 +26,7 @@ import com.yeshi.fanli.service.inter.common.JumpDetailV2Service; import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService; import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService; -import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService; +import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.taobao.DaTaoKeUtil; @@ -199,21 +199,33 @@ long old = value.getTime(); long now = nowDate.getTime(); - long oldDay = old/ (1000 * 60 * 60 * 24L); - long nowDay = now / (1000 * 60 * 60 * 24L); - if (y1 == y2 && d1 == d2) {//鍒ゆ柇鏄笉鏄悓涓�骞寸殑鍚屼竴澶� - long cha = now - old; - if (cha < 1000 * 60 * 2L) - desc = "鍒氬垰"; - else if (cha < 1000 * 60 * 60L) - desc = (cha / (1000 * 60)) + "鍒嗛挓鍓�"; - else - desc = (cha / (1000 * 60 * 60)) + "灏忔椂鍓�"; - } else if (nowDay - oldDay == 1) { - desc = "鏄ㄥぉ"; + if (y1 == y2) { + if (d1 == d2) { + long cha = now - old; + if (cha < 1000 * 60 * 2L) { + desc = "鍒氬垰"; + }else if (cha < 1000 * 60 * 60L) { + desc = (cha / (1000 * 60)) + "鍒嗛挓鍓�"; + }else { + desc = (cha / (1000 * 60 * 60)) + "灏忔椂鍓�"; + } + } else if (d2 - d1 == 1) { + desc = "鏄ㄥぉ"; + } else { + desc = (d2 - d1) + "澶╁墠"; + } } else { - desc = (nowDay - oldDay) + "澶╁墠"; + int timeDistance = 0; + for (int i = y1; i < y2; i++) { + if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) { + timeDistance += 366; // 闂板勾 + } else { + timeDistance += 365; // 涓嶆槸闂板勾 + } + } + desc = timeDistance + (d2 - d1) + "澶╁墠"; } + return new JsonPrimitive(desc); } -- Gitblit v1.8.0