|
@ -1,5 +1,6 @@ |
|
|
package com.yxt.yyth.api.empcard; |
|
|
package com.yxt.yyth.api.empcard; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUnit; |
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import com.yxt.common.base.utils.StringUtils; |
|
|
import com.yxt.common.base.utils.StringUtils; |
|
|
import com.yxt.yyth.api.empcardgift.EmpCardGiftVo; |
|
|
import com.yxt.yyth.api.empcardgift.EmpCardGiftVo; |
|
@ -10,6 +11,10 @@ import com.yxt.yyth.api.lpkstore.StoreSelect; |
|
|
import lombok.Data; |
|
|
import lombok.Data; |
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
|
import java.time.LocalTime; |
|
|
|
|
|
import java.time.ZoneId; |
|
|
import java.util.Date; |
|
|
import java.util.Date; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
|
|
@ -49,21 +54,47 @@ public class EmpAppletVo { |
|
|
private String giftCodeKey; |
|
|
private String giftCodeKey; |
|
|
private String qrCode; |
|
|
private String qrCode; |
|
|
private List<LpkReserveOrderCardVo> orderCardVoList; |
|
|
private List<LpkReserveOrderCardVo> orderCardVoList; |
|
|
|
|
|
private String isTransfer; |
|
|
|
|
|
|
|
|
public String getStart() { |
|
|
public String getStart() { |
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
|
SimpleDateFormat sdf1 =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
LocalDate today = LocalDate.now(); // 获取今天的日期
|
|
|
|
|
|
LocalTime timeOfDay = LocalTime.of(15, 0); // 设置下午3点的小时数为15,分钟数为0
|
|
|
|
|
|
LocalDateTime dateAndTime = LocalDateTime.of(today, timeOfDay); // 将日期和时间合并成完整的日期时间对象
|
|
|
|
|
|
|
|
|
|
|
|
ZoneId zoneId = ZoneId.systemDefault(); |
|
|
|
|
|
Date date = Date.from(dateAndTime.atZone(zoneId).toInstant()); |
|
|
|
|
|
// System.out.println(date);
|
|
|
|
|
|
//1>2 1 、1<2 -1 、1=2 0
|
|
|
|
|
|
int k=DateUtil.parse(sdf1.format(DateUtil.parse(sdf1.format(new Date())))).compareTo(DateUtil.parse(sdf1.format(DateUtil.parse(sdf1.format(date))))); |
|
|
|
|
|
if(String.valueOf(k).equals("1")){ |
|
|
start=sdf.format(DateUtil.offsetDay(new Date(),+2)); |
|
|
start=sdf.format(DateUtil.offsetDay(new Date(),+2)); |
|
|
|
|
|
}else{ |
|
|
|
|
|
start=sdf.format(DateUtil.offsetDay(new Date(),+1)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(dateEnd)){ |
|
|
if(StringUtils.isNotBlank(dateEnd)){ |
|
|
int i=DateUtil.parse(sdf.format(DateUtil.parse(start))).compareTo(DateUtil.parse(sdf.format(DateUtil.parse(dateEnd)))); |
|
|
int i=DateUtil.parse(sdf.format(DateUtil.parse(start))).compareTo(DateUtil.parse(sdf.format(DateUtil.parse(dateEnd)))); |
|
|
if(String.valueOf(i).equals("-1")){ |
|
|
if(String.valueOf(i).equals("-1")){ |
|
|
end=sdf.format(DateUtil.parse(dateEnd)); |
|
|
long o=DateUtil.between(DateUtil.parse(start),DateUtil.parse(dateEnd), DateUnit.DAY); |
|
|
|
|
|
if(o<10){ |
|
|
|
|
|
end=sdf.format(DateUtil.offsetDay(DateUtil.parse(dateEnd),10)); |
|
|
|
|
|
}else{ |
|
|
|
|
|
// end=sdf.format(DateUtil.parse(dateEnd));
|
|
|
|
|
|
end=sdf.format(DateUtil.offsetDay(DateUtil.parse(start),4)); |
|
|
|
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
if(String.valueOf(k).equals("1")){ |
|
|
end=sdf.format(DateUtil.offsetDay(DateUtil.parse(dateEnd),2)); |
|
|
end=sdf.format(DateUtil.offsetDay(DateUtil.parse(dateEnd),2)); |
|
|
|
|
|
}else{ |
|
|
|
|
|
end=sdf.format(DateUtil.offsetDay(DateUtil.parse(dateEnd),1)); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
reserveDate=start; |
|
|
return start; |
|
|
return start; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public String getName() { |
|
|
public String getName() { |
|
|
name=name+code; |
|
|
name=name+code; |
|
|
return name; |
|
|
return name; |
|
@ -120,7 +151,12 @@ public class EmpAppletVo { |
|
|
if( String.valueOf(i).equals("-1")){ |
|
|
if( String.valueOf(i).equals("-1")){ |
|
|
state="已过期"; |
|
|
state="已过期"; |
|
|
showBtn=false; |
|
|
showBtn=false; |
|
|
} else{ |
|
|
}else if(isTransfer.equals("1")){ |
|
|
|
|
|
state="已转赠"; |
|
|
|
|
|
showBtn=false; |
|
|
|
|
|
this.notRese=false; |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
state="待提货"; |
|
|
state="待提货"; |
|
|
if(states.equals("5")){ |
|
|
if(states.equals("5")){ |
|
|
if(isReservation.equals("0")){ |
|
|
if(isReservation.equals("0")){ |
|
|