|
@ -10,6 +10,7 @@ import com.yxt.yyth.biz.lpkgiftbag.LpkGiftBagService; |
|
|
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardMapper; |
|
|
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardMapper; |
|
|
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService; |
|
|
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService; |
|
|
import com.yxt.yyth.biz.lpkreserveorder.LpkReserveOrderService; |
|
|
import com.yxt.yyth.biz.lpkreserveorder.LpkReserveOrderService; |
|
|
|
|
|
import org.junit.Test; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
@ -32,7 +33,7 @@ public class scheduledRest { |
|
|
LpkReserveOrderService lpkReserveOrderService; |
|
|
LpkReserveOrderService lpkReserveOrderService; |
|
|
@Scheduled(cron = "0 0 1 * * ? ") |
|
|
@Scheduled(cron = "0 0 1 * * ? ") |
|
|
public void updateIsItInvalid() { |
|
|
public void updateIsItInvalid() { |
|
|
List<LpkGiftBag> lpkGiftBags = lpkGiftBagService.list(new QueryWrapper<LpkGiftBag>()); |
|
|
List<LpkGiftBag> lpkGiftBags = lpkGiftBagService.list(new QueryWrapper<LpkGiftBag>().eq("isSel","1")); |
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
for (LpkGiftBag lpkGiftBag : lpkGiftBags) { |
|
|
for (LpkGiftBag lpkGiftBag : lpkGiftBags) { |
|
|
//1>2 1 、1<2 -1 、1=2 0
|
|
|
//1>2 1 、1<2 -1 、1=2 0
|
|
@ -40,6 +41,8 @@ public class scheduledRest { |
|
|
if (String.valueOf(in).equals("-1")) { |
|
|
if (String.valueOf(in).equals("-1")) { |
|
|
Integer i = lpkGiftCardMapper.selectCount(new QueryWrapper<LpkGiftCard>().eq("giftbagSid", lpkGiftBag.getSid()).ne("state", "5")); |
|
|
Integer i = lpkGiftCardMapper.selectCount(new QueryWrapper<LpkGiftCard>().eq("giftbagSid", lpkGiftBag.getSid()).ne("state", "5")); |
|
|
if (i != 0) { |
|
|
if (i != 0) { |
|
|
|
|
|
lpkGiftBag.setIsSel("2"); |
|
|
|
|
|
lpkGiftBagService.updateById(lpkGiftBag); |
|
|
lpkGiftCardMapper.updateIsItInvalid(lpkGiftBag.getSid(), "5"); |
|
|
lpkGiftCardMapper.updateIsItInvalid(lpkGiftBag.getSid(), "5"); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
@ -50,6 +53,9 @@ public class scheduledRest { |
|
|
if (null != LpkReserveOrderVo) { |
|
|
if (null != LpkReserveOrderVo) { |
|
|
int c = DateUtil.parse(sdf.format(LpkReserveOrderVo.getReserveDate())).compareTo(DateUtil.parse(sdf.format(new Date()))); |
|
|
int c = DateUtil.parse(sdf.format(LpkReserveOrderVo.getReserveDate())).compareTo(DateUtil.parse(sdf.format(new Date()))); |
|
|
if (String.valueOf(c).equals("-1")) { |
|
|
if (String.valueOf(c).equals("-1")) { |
|
|
|
|
|
if(card.getState().equals("5")){ |
|
|
|
|
|
card.setIsItInvalid("1"); |
|
|
|
|
|
} |
|
|
card.setIsReservation("1"); |
|
|
card.setIsReservation("1"); |
|
|
lpkGiftCardMapper.updateById(card); |
|
|
lpkGiftCardMapper.updateById(card); |
|
|
} |
|
|
} |
|
|