diff --git a/hai-service/src/main/java/com/hai/config/ThirdProductConfig.java b/hai-service/src/main/java/com/hai/config/ThirdProductConfig.java index b8a4877a..c18df8b9 100644 --- a/hai-service/src/main/java/com/hai/config/ThirdProductConfig.java +++ b/hai-service/src/main/java/com/hai/config/ThirdProductConfig.java @@ -120,7 +120,7 @@ public class ThirdProductConfig { } else { object.put("productPayType" , bsConfigService.getProductPayTypeByMap(listMap)); } - + object.put("productPayTypeNew" , bsConfigService.getProductPayTypeNewByMap(listMap)); object.put("productPlatform" , bsConfigService.getProductPlatformByMap(listMap)); return object; diff --git a/hai-service/src/main/java/com/hai/entity/ApiStarbucksProductsExample.java b/hai-service/src/main/java/com/hai/entity/ApiStarbucksProductsExample.java index b521617b..b8bb1ebc 100644 --- a/hai-service/src/main/java/com/hai/entity/ApiStarbucksProductsExample.java +++ b/hai-service/src/main/java/com/hai/entity/ApiStarbucksProductsExample.java @@ -1921,4 +1921,4 @@ public class ApiStarbucksProductsExample { this(condition, value, secondValue, null); } } -} \ No newline at end of file +} diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java index 736fd74f..2c9a6ceb 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java @@ -217,6 +217,12 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getString("msg")); } childOrder.setChannelOrderNo(response.getJSONObject("data").getString("rechargeOrderId")); + } else if (coupon.getCouponSource().equals(5)) { + // 重庆中石油业务状态 + SecConfig cqCnpcStatus = secConfigService.findByCodeType("CQ_CNPC_STATUS_" + coupon.getCouponKey()); + if (cqCnpcStatus != null && StringUtils.isNotBlank(cqCnpcStatus.getCodeValue())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, cqCnpcStatus.getCodeValue()); + } } // 校验优惠券是否可用 如果使用优惠券就只能使用卡券的原价 diff --git a/hai-service/src/main/java/com/hai/service/BsConfigService.java b/hai-service/src/main/java/com/hai/service/BsConfigService.java index 5c97c2c5..af6f138c 100644 --- a/hai-service/src/main/java/com/hai/service/BsConfigService.java +++ b/hai-service/src/main/java/com/hai/service/BsConfigService.java @@ -1,9 +1,11 @@ package com.hai.service; +import com.alibaba.fastjson.JSONObject; import com.hai.entity.BsProductDiscount; import com.hai.entity.BsProductPayType; import com.hai.entity.BsProductPlatform; +import java.util.List; import java.util.Map; /** @@ -45,4 +47,7 @@ public interface BsConfigService { */ String getProductPayTypeByMap(Map map); + List getProductPayTypeNewByMap(Map map); + + } diff --git a/hai-service/src/main/java/com/hai/service/BsPushScheduleTaskService.java b/hai-service/src/main/java/com/hai/service/BsPushScheduleTaskService.java new file mode 100644 index 00000000..15b84b84 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/BsPushScheduleTaskService.java @@ -0,0 +1,62 @@ +package com.hai.service; + +import com.hai.entity.BsMsg; +import com.hai.entity.BsPushScheduleTask; +import com.hai.entity.HighUser; + +import java.util.List; +import java.util.Map; + +/** + * @serviceName BsPushScheduleTaskService.java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 定时发布任务功能 + * @createTime 15:41 2023/6/27 + **/ +public interface BsPushScheduleTaskService { + + + /** + * @Author Sum1Dream + * @Name insertPushScheduleTask + * @Description // 新增发布任务 + * @Date 18:06 2023/6/28 + * @Param [bsPushScheduleTask] + * @Return void + */ + void insertPushScheduleTask(BsPushScheduleTask bsPushScheduleTask); + + + /** + * @Author Sum1Dream + * @Name updatePushScheduleTask + * @Description // 更新发布任务 + * @Date 18:07 2023/6/28 + * @Param [bsPushScheduleTask5] + * @Return void + */ + void updatePushScheduleTask(BsPushScheduleTask bsPushScheduleTask5); + + /** + * @Author Sum1Dream + * @Name findPushScheduleTask + * @Description // 查询发布任务详情 + * @Date 18:07 2023/6/28 + * @Param [id] + * @Return com.hai.entity.BsMsg + */ + BsMsg findPushScheduleTask(Long id); + + + /** + * @Author Sum1Dream + * @Name getPushScheduleTaskByList + * @Description // 查询发布任务列表 + * @Date 18:07 2023/6/28 + * @Param [map] + * @Return java.util.List + */ + List getPushScheduleTaskByList(Map map); + +} diff --git a/hai-service/src/main/java/com/hai/service/impl/BsConfigServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsConfigServiceImpl.java index e4a1b3e7..45ed3f50 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsConfigServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsConfigServiceImpl.java @@ -1,5 +1,6 @@ package com.hai.service.impl; +import com.alibaba.fastjson.JSONObject; import com.hai.dao.BsProductDiscountMapper; import com.hai.dao.BsProductPayTypeMapper; import com.hai.dao.BsProductPlatformMapper; @@ -9,6 +10,7 @@ import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -121,4 +123,53 @@ public class BsConfigServiceImpl implements BsConfigService { } } + + @Override + public List getProductPayTypeNewByMap(Map map) { + + try { + + BsProductPayTypeExample example = new BsProductPayTypeExample(); + BsProductPayTypeExample.Criteria criteria = example.createCriteria(); + + // 获取平台编码 + Integer platformId = MapUtils.getInteger(map , "platformId"); + if (MapUtils.getInteger(map , "productType") != null) { + criteria.andProductTypeEqualTo(MapUtils.getInteger(map , "productType")); + } + + if (MapUtils.getLong(map , "sourceId") != null) { + criteria.andSourceIdEqualTo(MapUtils.getLong(map , "sourceId")); + } + + List list = bsProductPayTypeMapper.selectByExample(example); + + List productPayTypes = new ArrayList<>(); + + // 1:支付宝 2:微信 3:汇联通工会卡 4:银联 5:银联分期 6 嗨森逛油卡 7:嗨森逛车队油卡 8:积分兑换 + for (BsProductPayType productPayType : list) { + // platformId 1:小程序 2:h5 3:银联 + if (platformId != null) { + if (platformId == 1 || platformId == 2) { + if (!(productPayType.getPayTypeId() == 4 || productPayType.getPayTypeId() == 5 )) { + productPayTypes.add(productPayType); + } + } else if (platformId == 3) { + if (productPayType.getPayTypeId() != 2) { + productPayTypes.add(productPayType); + } + } + } + + } + + + return productPayTypes; + } catch (Exception e) { + System.out.println(e); + return null; + } + + } + } diff --git a/hai-service/src/main/java/com/hai/service/impl/BsPushScheduleTaskServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsPushScheduleTaskServiceImpl.java new file mode 100644 index 00000000..a6150a4d --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/BsPushScheduleTaskServiceImpl.java @@ -0,0 +1,35 @@ +package com.hai.service.impl; + +import com.hai.entity.BsMsg; +import com.hai.entity.BsPushScheduleTask; +import com.hai.service.BsPushScheduleTaskService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@Service("bsPushScheduleTaskService") +public class BsPushScheduleTaskServiceImpl implements BsPushScheduleTaskService { + + + @Override + public void insertPushScheduleTask(BsPushScheduleTask bsPushScheduleTask) { + + } + + @Override + public void updatePushScheduleTask(BsPushScheduleTask bsPushScheduleTask5) { + + } + + @Override + public BsMsg findPushScheduleTask(Long id) { + return null; + } + + @Override + public List getPushScheduleTaskByList(Map map) { + return null; + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java index ac863337..96342a80 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java @@ -78,6 +78,9 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe @Resource private RedisTemplate redisTemplate; + @Resource + private SecConfigService secConfigService; + @Override public void insertCodeList(List discountAgentCodeList) { highDiscountAgentCodeMapper.insertListCode(discountAgentCodeList); @@ -258,6 +261,11 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe if (couponList.size() == 0) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券未配置重庆中石油卡券"); } + // 重庆中石油业务状态 + SecConfig cqCnpcStatus = secConfigService.findByCodeType("CQ_CNPC_STATUS_" + couponList.get(0).getHighCoupon().getCouponKey()); + if (cqCnpcStatus != null && StringUtils.isNotBlank(cqCnpcStatus.getCodeValue())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, cqCnpcStatus.getCodeValue()); + } String tradeId = discountAgentCode.getId()+""+System.currentTimeMillis()+""; // 预发码 JSONObject preSendCoupon = ChongQingCNPCService.preSendCoupon(couponList.get(0).getHighCoupon().getCouponKey(), tradeId, 1, userModel.getHighUser().getPhone());