From 7fbbbd556388038aeb424b538433d8dc68b34b7a Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 26 Dec 2023 16:29:55 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev --- .../hai/schedule/HighDiscountSchedule.java | 33 +++++++++++++++++-- .../order/model/ExportOrderMobileModel.java | 1 - .../impl/OrderPaySuccessServiceImpl.java | 2 -- .../order/service/impl/OrderServiceImpl.java | 6 ---- .../hai/order/type/OrderChildGoodsType.java | 4 +-- .../HighDiscountPackageAgentServiceImpl.java | 5 +-- .../impl/HighDiscountUserRelServiceImpl.java | 4 +-- 7 files changed, 37 insertions(+), 18 deletions(-) diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighDiscountSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighDiscountSchedule.java index 0c3eb470..92908b3e 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighDiscountSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighDiscountSchedule.java @@ -1,9 +1,9 @@ package com.hai.schedule; -import com.hai.entity.HighDiscountAgentCode; -import com.hai.entity.HighDiscountUserRel; -import com.hai.entity.HighOrder; +import com.hai.entity.*; +import com.hai.service.BsTemporaryServices; import com.hai.service.HighDiscountAgentCodeService; +import com.hai.service.HighDiscountPackageAgentService; import com.hai.service.HighDiscountUserRelService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -11,6 +11,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.Scheduled; import javax.annotation.Resource; +import java.util.Date; +import java.util.HashMap; import java.util.List; /** @@ -29,6 +31,12 @@ public class HighDiscountSchedule { @Resource private HighDiscountAgentCodeService highDiscountAgentCodeService; + @Resource + private BsTemporaryServices bsTemporaryServices; + + @Resource + private HighDiscountPackageAgentService discountPackageAgentService; + /** * @Author 胡锐 * @Description 处理过期的优惠券 @@ -55,4 +63,23 @@ public class HighDiscountSchedule { } } + + @Scheduled(cron = "0 5 0 * * ?") // 每日凌晨00:00:5执行一次 + public void deleteOilNo() { + List list = bsTemporaryServices.getList(new HashMap<>()); + + for (BsTemporary bsTemporary : list) { + + HighDiscountPackageAgentCode discountPackageAgentCode = discountPackageAgentService.findDiscountPackageAgentCode(bsTemporary.getCode()); + discountPackageAgentCode.setStatus(1); + discountPackageAgentCode.setUpdateTime(new Date()); + discountPackageAgentService.updateDiscountPackageAgentCode(discountPackageAgentCode); + bsTemporary.setStatus(0); + bsTemporary.setUpdateTime(new Date()); + bsTemporaryServices.update(bsTemporary); + + } + + } + } diff --git a/hai-service/src/main/java/com/hai/order/model/ExportOrderMobileModel.java b/hai-service/src/main/java/com/hai/order/model/ExportOrderMobileModel.java index 1b2f224a..7ef07873 100644 --- a/hai-service/src/main/java/com/hai/order/model/ExportOrderMobileModel.java +++ b/hai-service/src/main/java/com/hai/order/model/ExportOrderMobileModel.java @@ -62,7 +62,6 @@ public class ExportOrderMobileModel { private String orderStatus; - @ColumnWidth(15) @ExcelProperty("创建时间") private Date createTime; diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java index 9c024acb..a3fcaf05 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java @@ -257,8 +257,6 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { blxCouponHandle(order , childOrder); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE13.getNumber())) { blxOrderHandle(order); - } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE14.getNumber())) { - oilCardHandle(childOrder.getGoodsSpecName(), order); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE14.getNumber())) { levelUp(order); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE17.getNumber())) { diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java index f20fdf6d..18445eeb 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java @@ -377,12 +377,6 @@ public class OrderServiceImpl implements OrderService { order.setProductType(OrderProductType.PRODUCT_TYPE17.getNumber()); order.setSecUserId(childOrder.getId()); order.setTitle("团购套餐"); - } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE17.getNumber())) { - HighChildOrder childOrder = orderCreateHandleService.group(order , child); - childOrderList.add(childOrder); - order.setProductType(OrderProductType.PRODUCT_TYPE17.getNumber()); - order.setSecUserId(childOrder.getId()); - order.setTitle("团购套餐"); } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE18.getNumber())) { HighChildOrder childOrder = orderCreateHandleService.petroCoupon(order , child); childOrderList.add(childOrder); diff --git a/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java b/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java index cff944d3..3dd5be66 100644 --- a/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java +++ b/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java @@ -22,8 +22,8 @@ public enum OrderChildGoodsType { TYPE11(11, "实物商品购买"), TYPE12(12, "比邻星停车券"), TYPE13(13, "比邻星停车"), - TYPE14(14, "个人油卡充值"), - TYPE15(15, "升级会员"), + TYPE14(14, "升级会员"), + TYPE15(15, "个人油卡充值"), TYPE17(17, "团购套餐"), TYPE18(18, "中石油卡券"), ; diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageAgentServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageAgentServiceImpl.java index 1f498174..5a425322 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageAgentServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageAgentServiceImpl.java @@ -154,11 +154,12 @@ public class HighDiscountPackageAgentServiceImpl implements HighDiscountPackageA HighDiscountPackageAgentCode discountPackageAgentCode ; mapCode.put("type" , "DISCOUNT_PACKAGE"); int percent; + int num = object.getInteger("num"); - for (int i = 0; i <= object.getInteger("num"); i++) { + for (int i = 0; i < object.getInteger("num"); i++) { // 生成百分比 - percent = i*100/object.getInteger("num"); + percent = i*100/(num -1); redisUtil.set(object.getString("serialNumber") , percent , 3600); HighDiscountPackageActual discountPackageActual = discountPackageActualList.get(i); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java index ee8e1e14..f392b619 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java @@ -279,8 +279,8 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic if (MapUtils.getLong(map, "agentId") != null) { criteria.andAgentIdEqualTo(MapUtils.getLong(map, "agentId")); } - if (MapUtils.getLong(map, "discountName") != null) { - criteria.andDiscountNameLike(MapUtils.getString(map, "discountName")); + if (MapUtils.getString(map, "discountName") != null) { + criteria.andDiscountNameLike("%" + MapUtils.getString(map, "discountName") + "%"); } if (MapUtils.getInteger(map, "discountPlatform") != null) {