|
|
@@ -26,6 +26,7 @@ import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
+import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.common.util.DictAnnotationUtil;
|
|
|
import org.jeecg.modules.app.dto.AppOrderInfoDTO;
|
|
|
import org.jeecg.modules.app.form.*;
|
|
|
@@ -58,6 +59,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
+import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.Instant;
|
|
|
import java.time.LocalDate;
|
|
|
@@ -711,13 +713,13 @@ public class OrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> impl
|
|
|
String date = DateUtil.format(Date.from(LocalDate.now().plusDays(indate).atStartOfDay(ZoneId.systemDefault()).toInstant()), "yyyy-MM-dd");
|
|
|
String startTime = DateUtil.format(appSite.getStartTime(), "HH:mm");
|
|
|
String endTime = DateUtil.format(appSite.getEndTime(), "HH:mm");
|
|
|
- String expireTime = date + " " + endTime;
|
|
|
- if (null == appSite.getStartTime()) {
|
|
|
+ if (ObjectUtil.isNotEmpty(appSite.getStartTime())) {
|
|
|
startTime = "00:00";
|
|
|
}
|
|
|
- if (null == appSite.getEndTime()) {
|
|
|
+ if (ObjectUtil.isNotEmpty(appSite.getEndTime())) {
|
|
|
endTime = "23:59";
|
|
|
}
|
|
|
+ String expireTime = date + " " + endTime;
|
|
|
AppOrderProInfo appOrderProInfo = new AppOrderProInfo();
|
|
|
appOrderProInfo.setProductId(createOrderForm.getProductIds());
|
|
|
appOrderProInfo.setProductName(appSitePlace.getName());
|
|
|
@@ -2141,7 +2143,7 @@ public class OrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> impl
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String refundOrder(RefundOrderForm refundOrderForm) {
|
|
|
+ public String refundOrder(RefundOrderForm refundOrderForm) throws ParseException {
|
|
|
AppOrder appOrder = appOrderMapper.selectOne(Wrappers.<AppOrder>lambdaQuery().eq(AppOrder::getOrderCode, refundOrderForm.getOrderCode()).last("limit 1"));
|
|
|
//退款金额
|
|
|
BigDecimal refundAmount = BigDecimal.ZERO;
|
|
|
@@ -2176,7 +2178,9 @@ public class OrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> impl
|
|
|
AppSitePriceRules sitePriceRules = appSitePriceRulesMapper.selectById(productId);
|
|
|
if(ObjectUtil.isNotEmpty(sitePriceRules)){
|
|
|
if(Objects.equals(sitePriceRules.getType(), CommonConstant.ORDER_PRO_INFO_TYPE_1)){
|
|
|
- Instant originalInstant = sitePriceRules.getStartTime().toInstant();
|
|
|
+ String timeStr = appOrderProInfo.getProductName().split("-")[0];
|
|
|
+ int year = LocalDate.now().getYear();
|
|
|
+ Instant originalInstant = DateUtils.parseDate(year+"-"+timeStr, "yyyy-MM-dd HH:mm").toInstant();
|
|
|
Instant time = originalInstant.minusSeconds(appSitePlace.getEarlyRefundTime() * 60);
|
|
|
Instant now = Instant.now();
|
|
|
if (!now.isBefore(time)) {
|