From 33b4ed2bbf28ec16b66e552680f56a691a4e908d Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 13 三月 2019 12:32:00 +0800 Subject: [PATCH] 清除HongBaoMapper --- fanli/src/main/java/com/yeshi/fanli/controller/client/SystemClientController.java | 64 +++++++++++++++++++++++--------- 1 files changed, 46 insertions(+), 18 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/SystemClientController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/SystemClientController.java index 044e7b5..664e008 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/SystemClientController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/SystemClientController.java @@ -1,11 +1,14 @@ package com.yeshi.fanli.controller.client; import java.io.PrintWriter; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; +import java.util.Properties; import javax.annotation.Resource; +import org.apache.commons.beanutils.PropertyUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.yeshi.utils.JsonUtil; @@ -13,12 +16,14 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.yeshi.fanli.entity.accept.AcceptData; +import com.yeshi.fanli.entity.push.DeviceActive; import com.yeshi.fanli.entity.system.CustomerContent; import com.yeshi.fanli.entity.system.System; import com.yeshi.fanli.entity.system.SystemClientParams; import com.yeshi.fanli.service.inter.config.ConfigService; import com.yeshi.fanli.service.inter.config.SystemClientParamsService; import com.yeshi.fanli.service.inter.config.SystemService; +import com.yeshi.fanli.service.inter.push.DeviceActiveService; import com.yeshi.fanli.service.inter.push.IOSPushService; import com.yeshi.fanli.util.ThreadUtil; @@ -40,6 +45,9 @@ @Resource private ConfigService configService; + @Resource + private DeviceActiveService deviceActiveService; + @RequestMapping("getsystemclientparams") public void getSystemClientParams(AcceptData acceptData, PrintWriter out) { System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages()); @@ -48,7 +56,7 @@ return; } List<SystemClientParams> systemClientParamsList = systemClientParamsService - .getSystemClientParamsBySystemId(system.getId()); + .getSystemClientParamsBySystemId(system.getId(),Integer.parseInt(acceptData.getVersion())); if (systemClientParamsList == null || systemClientParamsList.size() == 0) { out.print(JsonUtil.loadFalseResult("鏆傛棤鏁版嵁")); return; @@ -57,13 +65,27 @@ // TODO 闇�瑕佹敼鎴愭暟鎹簱鎺у埗锛屾殏鏃跺啓鎴愯繖鏍� List<SystemClientParams> list = new ArrayList<>(); - list.addAll(systemClientParamsList); - for (SystemClientParams sp : list) { - if (sp.getKey().equalsIgnoreCase("iosonling") && "ios".equalsIgnoreCase(acceptData.getPlatform()) - && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) { - sp.setValue("1"); - break; + for (SystemClientParams sp : systemClientParamsList) { + SystemClientParams ssp = new SystemClientParams(); + try { + PropertyUtils.copyProperties(ssp, sp); + } catch (Exception e) { + } + + if (ssp.getKey().equalsIgnoreCase("iosonling") && "ios".equalsIgnoreCase(acceptData.getPlatform()) + && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) { + ssp.setValue("1"); + } else if (ssp.getKey().equalsIgnoreCase("home_weex_url")) { + if (("android".equalsIgnoreCase(acceptData.getPlatform()) + && Integer.parseInt(acceptData.getVersion()) < 36)) { + // 鑰佺増鏈瑆eex锛�1.5.1涔嬪墠鐨勶級 + ssp.setValue("http://ec-1255749512.file.myqcloud.com/resource/weex/flq_index_v2.js"); + } else if ("ios".equalsIgnoreCase(acceptData.getPlatform()) + && Integer.parseInt(acceptData.getVersion()) < 44) + ssp.setValue("http://ec-1255749512.file.myqcloud.com/resource/weex/flq_index_v2.js"); + } + list.add(ssp); } Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); @@ -71,17 +93,23 @@ data.put("count", list.size()); data.put("systemClientParamsList", gson.toJson(list)); out.print(JsonUtil.loadTrueResult(data)); -// ThreadUtil.run(new Runnable() { -// @Override -// public void run() { -// try { -// if ("ios".equalsIgnoreCase(acceptData.getPlatform())) -// iosPushService.addDeviceToken(null, Integer.parseInt(acceptData.getVersion()), null, -// acceptData.getDevice()); -// } catch (Exception e) { -// } -// } -// }); + ThreadUtil.run(new Runnable() { + @Override + public void run() { + try { + // 瀹夊崜骞冲彴娣诲姞璁惧娲昏穬璁板綍 + if ("android".equalsIgnoreCase(acceptData.getPlatform())) { + DeviceActive da = new DeviceActive(); + da.setDevice(acceptData.getDevice()); + da.setPlatform(DeviceActive.PLATFORM_ANDROID); + da.setVersionCode(Integer.parseInt(acceptData.getVersion())); + deviceActiveService.addDeviceActive(da); + } + + } catch (Exception e) { + } + } + }); return; } -- Gitblit v1.8.0