| @@ -66,6 +66,9 @@ public class WxCouponSend extends BaseEntity { | |||||
| @JsonIgnore | @JsonIgnore | ||||
| public static final String SORT_REMAIN = "merchantRemain" ; | public static final String SORT_REMAIN = "merchantRemain" ; | ||||
| @JsonIgnore | |||||
| public static final String SORT_CREATE_DATE = "create_date" ; | |||||
| @Id | @Id | ||||
| protected Long id; | protected Long id; | ||||
| @@ -85,6 +85,11 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||||
| JSONObject jo = JSONObject.parseObject(cs.getConditions()); | JSONObject jo = JSONObject.parseObject(cs.getConditions()); | ||||
| int inventory = jo.getIntValue(WxCouponSend.KEY_MERCHANT_LNVENTORY); | int inventory = jo.getIntValue(WxCouponSend.KEY_MERCHANT_LNVENTORY); | ||||
| cs.setInventory(inventory); | cs.setInventory(inventory); | ||||
| int expired = 1; | |||||
| if (DateUtils.isDateBefore(cs.getValidEndDate())) { | |||||
| expired = 0; | |||||
| } | |||||
| cs.setExpired(expired); | |||||
| } | } | ||||
| } else { | } else { | ||||
| pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponSendMapper.findListVo(record)); | pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponSendMapper.findListVo(record)); | ||||
| @@ -7,10 +7,7 @@ import java.text.ParseException; | |||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
| import java.time.*; | import java.time.*; | ||||
| import java.time.temporal.ChronoUnit; | import java.time.temporal.ChronoUnit; | ||||
| import java.util.ArrayList; | |||||
| import java.util.Calendar; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| import java.util.*; | |||||
| /** | /** | ||||
| * 日期处理 | * 日期处理 | ||||
| @@ -137,6 +134,20 @@ public class DateUtils { | |||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * 时间比较 系统时间早于输入时间 | |||||
| * | |||||
| * @param date2 | |||||
| * @return | |||||
| */ | |||||
| public static boolean isDateBefore(Date date2) { | |||||
| if(Objects.isNull(date2)) return false ; | |||||
| // 获得系统时间 | |||||
| Date date1 = new Date(); | |||||
| DateFormat df = DateFormat.getDateTimeInstance(); | |||||
| return date1.before(date2); | |||||
| } | |||||
| /** | /** | ||||
| * 系统时间晚于输入时间 | * 系统时间晚于输入时间 | ||||
| * | * | ||||
| @@ -97,7 +97,6 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != sendSms "> | <if test=" null != sendSms "> | ||||
| and cs.send_sms = #{sendSms} | and cs.send_sms = #{sendSms} | ||||
| </if> | </if> | ||||
| <if test=" null != sortColumns"> | <if test=" null != sortColumns"> | ||||
| order by ${sortColumns} | order by ${sortColumns} | ||||