Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev

new-dev
袁野 11 months ago
parent 8b8d3c74b3
commit 7fbbbd5563
  1. 33
      hai-schedule/src/main/java/com/hai/schedule/HighDiscountSchedule.java
  2. 1
      hai-service/src/main/java/com/hai/order/model/ExportOrderMobileModel.java
  3. 2
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  4. 6
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  5. 4
      hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java
  6. 5
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageAgentServiceImpl.java
  7. 4
      hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.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<BsTemporary> 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);
}
}
}

@ -62,7 +62,6 @@ public class ExportOrderMobileModel {
private String orderStatus;
@ColumnWidth(15)
@ExcelProperty("创建时间")
private Date createTime;

@ -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())) {

@ -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);

@ -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, "中石油卡券"),
;

@ -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);

@ -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) {

Loading…
Cancel
Save