From cea4c347191a95058be2a529b38c9f97035b5779 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 4 Jul 2023 09:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=9D=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hai/config/ThirdProductConfig.java | 2 +- .../java/com/hai/service/BsConfigService.java | 5 ++ .../service/BsPushScheduleTaskService.java | 62 +++++++++++++++++++ .../hai/service/impl/BsConfigServiceImpl.java | 51 +++++++++++++++ .../impl/BsPushScheduleTaskServiceImpl.java | 35 +++++++++++ 5 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 hai-service/src/main/java/com/hai/service/BsPushScheduleTaskService.java create mode 100644 hai-service/src/main/java/com/hai/service/impl/BsPushScheduleTaskServiceImpl.java 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/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; + } +}