| | |
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | data.put("title", goods.getTitle());
|
| | | if (goods.getImgList() == null)
|
| | | goods.setImgList(new ArrayList<>());
|
| | | goods.getImgList().add(0, goods.getPictUrl());
|
| | | goods.getImgList().add(0, TbImgUtil.getTBSizeImg(goods.getPictUrl(), 300));
|
| | | data.put("imgs", goods.getImgList());
|
| | | data.put("quanPrice", afterCouponPrice);
|
| | | data.put("zkPrice", goods.getZkPrice());
|
| | |
| | | |
| | | int updateByPrimaryKey(AppVersionInfo record); |
| | | |
| | | /** |
| | | * 根据平台和最小版本获取版本列表 |
| | | * |
| | | * @param platform |
| | | * @param minVersionCode |
| | | * @return |
| | | */ |
| | | List<AppVersionInfo> listByPlatformAndMinVersionCode(@Param("platform") String platform, |
| | | @Param("minVersionCode") int minVersionCode); |
| | | |
| | | /** |
| | | * 根据平台和最大版本号获取版本列表 |
| | | * |
| | | * @param platform |
| | | * @param minVersionCode |
| | | * @return |
| | | */ |
| | | List<AppVersionInfo> listByPlatformAndMaxVersionCode(@Param("platform") String platform, |
| | | @Param("maxVersionCode") int maxVersionCode); |
| | | |
| | | } |
| | |
| | | <result column="avcm_updatetime" property="updateTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">avcm_id,avcm_platform,avcm_version,avcm_version_code,avcm_createtime,avcm_updatetime</sql> |
| | | <sql id="Base_Column_List">avcm_id,avcm_platform,avcm_version,avcm_version_code,avcm_createtime,avcm_updatetime |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | |
| | | and avcm_version_code=#{versionCode} |
| | | </select> |
| | | |
| | | |
| | | <select id="listByPlatformAndMinVersionCode" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_app_version_code_map where avcm_platform = |
| | | #{platform} |
| | | and avcm_version_code>=#{minVersionCode} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listByPlatformAndMaxVersionCode" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_app_version_code_map where avcm_platform = |
| | | #{platform} |
| | | and #{maxVersionCode}> avcm_version_code |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_app_version_code_map where avcm_id = #{id,jdbcType=BIGINT}</delete> |
| | | yeshi_ec_app_version_code_map where avcm_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.AppVersionInfo" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_app_version_code_map |
| | | (avcm_id,avcm_platform,avcm_version,avcm_version_code,avcm_createtime,avcm_updatetime) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{platform,jdbcType=VARCHAR},#{version,jdbcType=VARCHAR},#{versionCode,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | (#{id,jdbcType=BIGINT},#{platform,jdbcType=VARCHAR},#{version,jdbcType=VARCHAR},#{versionCode,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.AppVersionInfo" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_app_version_code_map |
| | |
| | | #{version,jdbcType=VARCHAR},avcm_version_code = |
| | | #{versionCode,jdbcType=INTEGER},avcm_createtime = |
| | | #{createTime,jdbcType=TIMESTAMP},avcm_updatetime = |
| | | #{updateTime,jdbcType=TIMESTAMP} where avcm_id = #{id,jdbcType=BIGINT}</update> |
| | | #{updateTime,jdbcType=TIMESTAMP} where avcm_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.AppVersionInfo"> |
| | | update yeshi_ec_app_version_code_map |
| | | <set> |
| | |
| | |
|
| | | @Override
|
| | | public void pushBaiChuanUrl(Long uid, String title, String content, String url) throws PushException {
|
| | | iosPushService.pushBaiChuanUrl(uid, title, content, url);
|
| | | // iosPushService.pushBaiChuanUrl(uid, title, content, url);
|
| | | xmPushService.pushBaiChuanUrl(uid, title, content, url);
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.impl.push;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.AppVersionInfoMapper;
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountMessage;
|
| | | import com.yeshi.fanli.entity.system.SystemZnx;
|
| | | import com.yeshi.fanli.entity.xinge.MessageInfo;
|
| | |
| | |
|
| | | @Service
|
| | | public class XMPushServiceImpl implements XMPushService {
|
| | |
|
| | | @Resource
|
| | | private AppVersionInfoMapper appVersionInfoMapper;
|
| | |
|
| | | @Override
|
| | | public void pushGoods(Long uid, Long auctionId, String title, String content) throws PushException {
|
| | |
| | | JSONObject json = new JSONObject();
|
| | | json.put("url", weexUrl);
|
| | | json.put("type", "weex");
|
| | | // 设置可推送版本,1.4.8以后的版本可推送
|
| | | json.put("app_version", getVersionByMinVersionCode(31));
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setTitle(title);
|
| | | info.setContent(content);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private String getVersionByMinVersionCode(int versionCode) {
|
| | | List<AppVersionInfo> list = appVersionInfoMapper
|
| | | .listByPlatformAndMinVersionCode(AppVersionInfo.PLATFORM_ANDROID, versionCode);
|
| | | String versions = "";
|
| | | if (list != null)
|
| | | for (AppVersionInfo appVersion : list) {
|
| | | versions += appVersion.getVersion() + ",";
|
| | |
|
| | | }
|
| | | if (versions.endsWith(","))
|
| | | versions = versions.substring(0, versions.length() - 1);
|
| | |
|
| | | return versions;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void pushBaiChuanUrl(Long uid, String title, String content, String url) throws PushException {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("url", url);
|
| | | json.put("type", "baichuan");
|
| | | // 设置可推送版本,1.4.8以后的版本可推送
|
| | | json.put("app_version", getVersionByMinVersionCode(31));
|
| | |
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setTitle(title);
|
| | | info.setContent(content);
|
| | |
| | | info.setAlias(uid + "");
|
| | | PushUtils.singlePushXiaoMi(info, json, pushRecord);
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | }
|