|
@@ -227,12 +227,15 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
|
|
|
map.put("userId",modifyOpeningTimeVO.getUserId());
|
|
|
map.put("productId",modifyOpeningTimeVO.getProductId());
|
|
|
List<OpenedProducts> opendList = openedProductsFacade.selectOpenedProducts(map);
|
|
|
+ List<Long> renewalsList = userRenewalsFacade.selectProductIdByUserId(map);
|
|
|
+ if(!renewalsList.contains(modifyOpeningTimeVO.getProductId())){
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "续费单单不存在,请刷新重试");
|
|
|
+ }
|
|
|
for (OpenedProducts openedProducts1 :opendList) {
|
|
|
- if(beforeTime(openedProducts1.getStartTime(),modifyOpeningTimeVO.getEndTime())){
|
|
|
+ if(beforeTime(openedProducts1.getEndTime(),modifyOpeningTimeVO.getEndTime())){
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "输入有误,续费时间需大于到期时间");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
openedProducts.setEndTime(DateUtil.parseDate(modifyOpeningTimeVO.getEndTime()));
|
|
|
openedProducts.setCreator(UserUtils.getCurrentPrincipleID());
|
|
|
openedProducts.setGmtCreate(DateUtil.now());
|
|
@@ -281,11 +284,11 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
|
|
|
//比较两个日期
|
|
|
int result = fomatDate2.compareTo(startTime);
|
|
|
//如果日期相等返回0
|
|
|
- if (result == 0 || result > 0) {
|
|
|
- //大于0,参数startTime小于endTime
|
|
|
+ if (result == 0 || result < 0) {
|
|
|
+ //小于0,参数startTime大于endTime
|
|
|
return true;
|
|
|
}
|
|
|
- //小于0,参数startTime大于endTime
|
|
|
+ //大于0,参数startTime小于endTime
|
|
|
return false;
|
|
|
}
|
|
|
}
|