Merge remote-tracking branch 'origin/div' into div-1
| | |
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.help.AppPageNotification;
|
| | | import com.yeshi.fanli.service.inter.help.AppPageNotificationService;
|
| | | import com.yeshi.fanli.service.manger.AppUpdateManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | |
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/v1/help")
|
| | |
| | |
|
| | | @Resource
|
| | | private AppPageNotificationService appPageNotificationService;
|
| | |
|
| | | @Resource
|
| | | private AppUpdateManager appUpdateManager;
|
| | |
|
| | | /**
|
| | | * 获取app页面的通知
|
| | |
| | |
|
| | | String platform = acceptData.getPlatform();
|
| | | String version = acceptData.getVersion();
|
| | | |
| | | AppPageNotification ap = appPageNotificationService.getValidNotificationByTypeCache(type,platform, Integer.parseInt(version));
|
| | |
|
| | | AppPageNotification ap = appPageNotificationService.getValidNotificationByTypeCache(type, platform,
|
| | | Integer.parseInt(version));
|
| | | if ("home".equalsIgnoreCase(type) && VersionUtil.smallerThan_1_5_1(platform, version) && ap != null) {
|
| | | AppPageNotification no = new AppPageNotification();
|
| | | no.setContentUrl("");
|
| | |
| | | no.setType(ap.getType());
|
| | | no.setUpdateTime(ap.getUpdateTime());
|
| | | no.setCanClose(false);
|
| | | no.setContent(String.format("尊敬的用户,为更加准确高效的为你返利、省钱,请升级到%s最新版本",Constant.getAppName(platform, version)));
|
| | | no.setContent(String.format("尊敬的用户,为更加准确高效的为你返利、省钱,请升级到%s最新版本", Constant.getAppName(platform, version)));
|
| | | Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
| | | out.print(JsonUtil.loadTrueResult(gson.toJson(no)));
|
| | | return;
|
| | |
| | |
|
| | | @RequestMapping(value = "updateApp")
|
| | | public void updateApp(AcceptData acceptData, PrintWriter out) {
|
| | | Map<String, String> params = new HashMap<>();
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) {// android更新
|
| | | // acceptData.setVersion("10");
|
| | | params.put("method", "update");
|
| | | params.put("Platform", "Android");
|
| | | params.put("Version", acceptData.getVersion());
|
| | | params.put("device ", acceptData.getDevice());
|
| | | params.put("time", System.currentTimeMillis() + "");
|
| | | params.put("Package", acceptData.getPackages());
|
| | | params.put("device", acceptData.getDevice());
|
| | | params.put("platform", "Android");
|
| | | params.put("key", "a3f390d88e4c41f2747bfa2f1b5f87db");
|
| | | params.put("versionCode", acceptData.getVersion() + "");
|
| | | } else {// IOS更新
|
| | | params.put("method", "update");
|
| | | params.put("Platform", "IOS");
|
| | | params.put("Version", acceptData.getVersion());
|
| | | params.put("device ", acceptData.getDevice());
|
| | | params.put("time", System.currentTimeMillis() + "");
|
| | | params.put("Package", acceptData.getPackages());
|
| | | params.put("device", acceptData.getDevice());
|
| | | params.put("platform", "IOS");
|
| | | params.put("key", "32bb90e8976aab5298d5da10fe66f21d");
|
| | | params.put("versionCode", acceptData.getVersion() + "");
|
| | | }
|
| | | String url = "http://update.yeshitv.com:8090/update/update";
|
| | | String result = HttpUtil.post(url, params, null);
|
| | | String result = appUpdateManager.getUpdateInfoCache(acceptData);
|
| | | try {
|
| | | out.print(new String(result.getBytes("ISO-8859-1"), "UTF-8"));
|
| | | } catch (UnsupportedEncodingException e) {
|
| | |
| | | else if (imgInfo.getType() == ImgEnum.activity) |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getActivityPic())) { |
| | | list.add(imgInfo.getActivityPic()); |
| | | }else if(!StringUtil.isNullOrEmpty(imgInfo.getUrl())){ |
| | | list.add(imgInfo.getUrl()); |
| | | } |
| | | } |
| | | } |
| | |
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import jxl.write.DateTime;
|
| | |
|
| | | /**
|
| | | * 邀请订单补贴
|
| | | *
|
| | |
| | | private Date getTime;
|
| | | @Column(name = "os_level")
|
| | | private Integer level;// 直接/间接
|
| | | @Column(name = "os_valid_time")
|
| | | private Date validTime;
|
| | | @Column(name = "os_invalid_time")
|
| | | private Date inValidTime;
|
| | |
|
| | | public Date getInValidTime() {
|
| | | return inValidTime;
|
| | | }
|
| | |
|
| | | public void setInValidTime(Date inValidTime) {
|
| | | this.inValidTime = inValidTime;
|
| | | }
|
| | |
|
| | | public Date getValidTime() {
|
| | | return validTime;
|
| | | }
|
| | |
|
| | | public void setValidTime(Date validTime) {
|
| | | this.validTime = validTime;
|
| | | }
|
| | |
|
| | | public Integer getLevel() {
|
| | | return level;
|
| | |
| | | @Column(name = "otr_level")
|
| | | private Integer level;// 直接/间接补贴
|
| | |
|
| | | @Column(name = "otr_valid_time")
|
| | | private Date validTime;
|
| | | |
| | | @Column(name = "otr_invalid_time")
|
| | | private Date inValidTime;
|
| | | |
| | | |
| | | public Date getValidTime() {
|
| | | return validTime;
|
| | | }
|
| | |
|
| | | public void setValidTime(Date validTime) {
|
| | | this.validTime = validTime;
|
| | | }
|
| | |
|
| | | public Date getInValidTime() {
|
| | | return inValidTime;
|
| | | }
|
| | |
|
| | | public void setInValidTime(Date inValidTime) {
|
| | | this.inValidTime = inValidTime;
|
| | | }
|
| | |
|
| | | public Integer getLevel() {
|
| | | return level;
|
| | | }
|
| | |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="os_get_time" property="getTime" jdbcType="TIMESTAMP" /> |
| | | <result column="os_level" property="level" jdbcType="INTEGER" /> |
| | | <result column="os_valid_time" property="validTime" jdbcType="TIMESTAMP" /> |
| | | <result column="os_invalid_time" property="inValidTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">os_id,os_uid,os_money,os_order_no,os_source_type,os_state,os_create_time,os_update_time,os_original_money,os_pre_get_time,os_get_time,os_level |
| | | <sql id="Base_Column_List">os_id,os_uid,os_money,os_order_no,os_source_type,os_state,os_create_time,os_update_time,os_original_money,os_pre_get_time,os_get_time,os_level,os_valid_time,os_invalid_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.InviteOrderSubsidy" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_invite_order_subsidy |
| | | (os_id,os_uid,os_money,os_order_no,os_source_type,os_state,os_create_time,os_update_time,os_original_money,os_pre_get_time,os_get_time,os_level) |
| | | (os_id,os_uid,os_money,os_order_no,os_source_type,os_state,os_create_time,os_update_time,os_original_money,os_pre_get_time,os_get_time,os_level,os_valid_time,os_invalid_time) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{originalMoney,jdbcType=DECIMAL},#{preGetTime,jdbcType=TIMESTAMP},#{getTime,jdbcType=TIMESTAMP},#{level,jdbcType=INTEGER}) |
| | | (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{originalMoney,jdbcType=DECIMAL},#{preGetTime,jdbcType=TIMESTAMP},#{getTime,jdbcType=TIMESTAMP},#{level,jdbcType=INTEGER},#{validTime,jdbcType=TIMESTAMP},#{inValidTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.InviteOrderSubsidy" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="preGetTime != null">os_pre_get_time,</if> |
| | | <if test="getTime != null">os_get_time,</if> |
| | | <if test="level != null">os_level,</if> |
| | | <if test="validTime != null">os_valid_time,</if> |
| | | <if test="inValidTime != null">os_invalid_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="preGetTime != null">#{preGetTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="getTime != null">#{getTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="level != null">#{level,jdbcType=INTEGER}</if> |
| | | <if test="validTime != null">#{validTime,jdbcType=TIMESTAMP}</if> |
| | | <if test="inValidTime != null">#{inValidTime,jdbcType=TIMESTAMP}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.InviteOrderSubsidy">update |
| | |
| | | =#{originalMoney,jdbcType=DECIMAL} ,os_pre_get_time |
| | | =#{preGetTime,jdbcType=TIMESTAMP} ,os_get_time |
| | | =#{getTime,jdbcType=TIMESTAMP} ,os_level =#{level,jdbcType=INTEGER} |
| | | where os_id = #{id,jdbcType=BIGINT}</update> |
| | | ,os_valid_time =#{validTime,jdbcType=TIMESTAMP} ,os_invalid_time |
| | | =#{inValidTime,jdbcType=TIMESTAMP} where os_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.InviteOrderSubsidy"> |
| | | update yeshi_ec_invite_order_subsidy |
| | | <set> |
| | |
| | | <if test="preGetTime !=null">os_pre_get_time =#{preGetTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="getTime !=null">os_get_time =#{getTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="level !=null">os_level =#{level,jdbcType=INTEGER},</if> |
| | | <if test="validTime !=null">os_valid_time =#{validTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="inValidTime !=null">os_invalid_time =#{inValidTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where os_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="otr_get_time" property="getTime" jdbcType="TIMESTAMP" /> |
| | | <result column="otr_level" property="level" jdbcType="INTEGER" /> |
| | | <result column="otr_valid_time" property="validTime" jdbcType="TIMESTAMP" /> |
| | | <result column="otr_invalid_time" property="inValidTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <association property="subsidy" |
| | | javaType="com.yeshi.fanli.entity.order.InviteOrderSubsidy" column="otr_subsidy_id"> |
| | | <id column="otr_subsidy_id" property="id" /> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">otr_id,otr_uid,otr_money,otr_order_no,otr_source_type,otr_state,otr_create_time,otr_update_time,otr_original_money,otr_subsidy_id,otr_pre_get_time,otr_get_time,otr_level |
| | | <sql id="Base_Column_List">otr_id,otr_uid,otr_money,otr_order_no,otr_source_type,otr_state,otr_create_time,otr_update_time,otr_original_money,otr_subsidy_id,otr_pre_get_time,otr_get_time,otr_level,otr_valid_time,otr_invalid_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.OrderTeamReward" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_order_team_reward |
| | | (otr_id,otr_uid,otr_money,otr_order_no,otr_source_type,otr_state,otr_create_time,otr_update_time,otr_original_money,otr_subsidy_id,otr_pre_get_time,otr_get_time,otr_level) |
| | | (otr_id,otr_uid,otr_money,otr_order_no,otr_source_type,otr_state,otr_create_time,otr_update_time,otr_original_money,otr_subsidy_id,otr_pre_get_time,otr_get_time,otr_level,otr_valid_time,otr_invalid_time) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{originalMoney,jdbcType=DECIMAL},#{subsidy.id,jdbcType=BIGINT},#{preGetTime,jdbcType=TIMESTAMP},#{getTime,jdbcType=TIMESTAMP},#{level,jdbcType=INTEGER}) |
| | | (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{originalMoney,jdbcType=DECIMAL},#{subsidy.id,jdbcType=BIGINT},#{preGetTime,jdbcType=TIMESTAMP},#{getTime,jdbcType=TIMESTAMP},#{level,jdbcType=INTEGER},#{validTime,jdbcType=TIMESTAMP},#{inValidTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.OrderTeamReward" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="preGetTime != null">otr_pre_get_time,</if> |
| | | <if test="getTime != null">otr_get_time,</if> |
| | | <if test="level != null">otr_level,</if> |
| | | <if test="validTime != null">otr_valid_time,</if> |
| | | <if test="inValidTime != null">otr_invalid_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="preGetTime != null">#{preGetTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="getTime != null">#{getTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="level != null">#{level,jdbcType=INTEGER},</if> |
| | | <if test="validTime != null">#{validTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="inValidTime != null">#{inValidTime,jdbcType=TIMESTAMP}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.OrderTeamReward">update |
| | |
| | | =#{subsidy.id,jdbcType=BIGINT} ,otr_pre_get_time |
| | | =#{preGetTime,jdbcType=TIMESTAMP} ,otr_get_time |
| | | =#{getTime,jdbcType=TIMESTAMP} ,otr_level =#{level,jdbcType=INTEGER} |
| | | where otr_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | ,otr_valid_time =#{validTime,jdbcType=TIMESTAMP} ,otr_invalid_time |
| | | =#{inValidTime,jdbcType=TIMESTAMP} where otr_id = |
| | | #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.OrderTeamReward"> |
| | | update yeshi_ec_order_team_reward |
| | | <set> |
| | |
| | | <if test="subsidy !=null">otr_subsidy_id =#{subsidy.id,jdbcType=BIGINT},</if> |
| | | <if test="preGetTime !=null">otr_pre_get_time =#{preGetTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="getTime !=null">otr_get_time =#{getTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="id !=null">otr_id =#{id,jdbcType=BIGINT},</if> |
| | | <if test="level !=null">otr_level =#{level,jdbcType=INTEGER},</if> |
| | | <if test="validTime !=null">otr_valid_time =#{validTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="inValidTime !=null">otr_invalid_time =#{inValidTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where otr_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <select id="getByOrderNoAndType" resultMap="BaseResultMap">SELECT * FROM |
| | | yeshi_ec_order_team_reward WHERE otr_uid = #{uid} AND otr_order_no = |
| | | #{orderNo} AND otr_source_type = #{type} LIMIT 1 |
| | | </select> |
| | | #{orderNo} AND otr_source_type = #{type} LIMIT 1</select> |
| | | <select id="getByOrderNoAndTypeForUpdate" resultMap="BaseResultMap">SELECT * |
| | | FROM yeshi_ec_order_team_reward WHERE otr_uid = #{uid} AND |
| | | otr_order_no = #{orderNo} AND otr_source_type = #{type} for update |
| | | </select> |
| | | <select id="countByOrderNoAndType" resultType="java.lang.Long">SELECT count(*) |
| | | FROM yeshi_ec_order_team_reward WHERE otr_order_no = #{orderNo} AND |
| | | otr_source_type = #{type} |
| | | </select> |
| | | otr_source_type = #{type}</select> |
| | | <select id="selectBySubsidyIdAndUidForUpdate" resultMap="BaseResultMap">SELECT * |
| | | FROM yeshi_ec_order_team_reward WHERE otr_subsidy_id = #{subsidyId} |
| | | AND otr_uid = #{uid} for update |
| | | </select> |
| | | AND otr_uid = #{uid} for update</select> |
| | | <select id="listBySubsidyId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long">SELECT * FROM yeshi_ec_order_team_reward WHERE |
| | | otr_subsidy_id = #{0} |
| | | </select> |
| | | |
| | | otr_subsidy_id = #{0}</select> |
| | | <select id="listCanSettleByUid" resultMap="BaseResultMap">SELECT * FROM |
| | | yeshi_ec_order_team_reward WHERE |
| | | otr_uid |
| | | =#{uid} AND otr_state=1 AND |
| | | NOW()>otr_pre_get_time |
| | | limit |
| | | #{start},#{count} |
| | | </select> |
| | | |
| | | yeshi_ec_order_team_reward WHERE otr_uid =#{uid} AND otr_state=1 AND |
| | | NOW()>otr_pre_get_time limit #{start},#{count}</select> |
| | | <select id="countCanSettle" resultType="java.lang.Long" |
| | | parameterType="java.lang.Long">SELECT count(*) FROM yeshi_ec_order_team_reward |
| | | WHERE |
| | | otr_uid =#{uid} AND otr_state=1 AND NOW()>otr_pre_get_time |
| | | </select> |
| | | |
| | | |
| | | <select id="listCanSettleUid" resultType="java.lang.Long"> |
| | | SELECT t.`otr_uid` FROM |
| | | yeshi_ec_order_team_reward t WHERE t.`otr_state`=1 |
| | | AND #{time} > |
| | | parameterType="java.lang.Long">SELECT count(*) FROM yeshi_ec_order_team_reward WHERE |
| | | otr_uid =#{uid} AND otr_state=1 AND NOW()>otr_pre_get_time</select> |
| | | <select id="listCanSettleUid" resultType="java.lang.Long">SELECT t.`otr_uid` FROM |
| | | yeshi_ec_order_team_reward t WHERE t.`otr_state`=1 AND #{time} > |
| | | t.`otr_pre_get_time` GROUP BY t.`otr_uid` LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | <select id="countCanSettleUid" resultType="java.lang.Long" |
| | | parameterType="java.util.Date"> |
| | | SELECT COUNT(*) FROM |
| | | ( |
| | | SELECT t.otr_uid FROM |
| | | parameterType="java.util.Date">SELECT COUNT(*) FROM ( SELECT t.otr_uid FROM |
| | | yeshi_ec_order_team_reward t WHERE t.otr_state=1 AND |
| | | #{0}>t.otr_pre_get_time GROUP BY t.otr_uid) a |
| | | </select> |
| | | |
| | | |
| | | |
| | | #{0}>t.otr_pre_get_time GROUP BY t.otr_uid) a</select> |
| | | </mapper> |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // 上传文件替换 |
| | | if (fileRequest != null) { |
| | | for (int i = 0; i < 9; i++) { |
| | |
| | | } |
| | | |
| | | /* |
| | | * // 无券不能自动 生成评论 CouponInfoVO couponInfo1 = goodsDetailVO.getCouponInfo(); if |
| | | * (couponInfo1 == null) { addComment = false; } |
| | | * // 无券不能自动 生成评论 CouponInfoVO couponInfo1 = |
| | | * goodsDetailVO.getCouponInfo(); if (couponInfo1 == null) { addComment |
| | | * = false; } |
| | | */ |
| | | |
| | | String commentText = ""; |
| | |
| | | commentText = template.replace("[链接]", jumpLink); |
| | | } |
| | | |
| | | // commentText = commentText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getZkPrice())+""); |
| | | // if (!goodsDetailVO.isHasCoupon()) { |
| | | // commentText = commentText.replace("领券抢购", "抢购"); |
| | | // commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | // } else { |
| | | // commentText = commentText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getCouponPrice())+""); |
| | | // } |
| | | // |
| | | // commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", |
| | | // "\r\n"); |
| | | // commentText = commentText.replace("[原价]", |
| | | // MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getZkPrice())+""); |
| | | // if (!goodsDetailVO.isHasCoupon()) { |
| | | // commentText = commentText.replace("领券抢购", "抢购"); |
| | | // commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | // } else { |
| | | // commentText = commentText.replace("[券后价]", |
| | | // MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getCouponPrice())+""); |
| | | // } |
| | | // |
| | | // commentText = commentText.replace("\r\n\r\n", |
| | | // "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", |
| | | // "\r\n"); |
| | | |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | | commentInfo.setId(UUID.randomUUID().toString().replace("-", "")); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // 上传文件替换 |
| | | if (fileRequest != null) { |
| | | for (int i = 0; i < 9; i++) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | int totalImg = 0; |
| | | for (String pic : listpic) { |
| | | ImgInfo imgInfo0 = new ImgInfo(); |
| | |
| | | return goodsEvaluateDao.count(key, state, dynamicType); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void addRanDomShareCount() { |
| | | // 发圈 |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(0, Integer.MAX_VALUE, 1); |
| | | if (list != null) { |
| | | for (GoodsEvaluate goodsEvaluate: list) { |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | Integer shareNum = goodsEvaluate.getShareNum(); |
| | | if (shareNum == null) { |
| | | shareNum = 0; |
| | |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | |
| | | |
| | | // 素材 |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(0, Integer.MAX_VALUE, 2); |
| | | if (list != null) { |
| | | for (GoodsEvaluate goodsEvaluate: list) { |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | Integer shareNum = goodsEvaluate.getShareNum(); |
| | | if (shareNum == null) { |
| | | shareNum = 0; |
| | |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Cacheable(value = "dynamicCache", key = "'queryValidEvaluateCache-'+#start") |
| | | public List<GoodsEvaluate> queryValidEvaluateCache(int start, int count) { |
| | |
| | | public void run() { |
| | | // 更新信息 |
| | | updateGoodInfo(list); |
| | | |
| | | |
| | | // 删除已过期 |
| | | removeOverdue(); |
| | | } |
| | |
| | | if (goods != null) { |
| | | String content = commentInfoNew.getContent(); |
| | | if (!StringUtil.isNullOrEmpty(content)) { |
| | | content = content.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice())+""); |
| | | content = content.replace("[原价]", |
| | | MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + ""); |
| | | if (goods.isHasCoupon()) { |
| | | content = content.replace("[券后价]",MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice())+""); |
| | | content = content.replace("[券后价]", |
| | | MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()) + ""); |
| | | } else { |
| | | singleCoupn = false; |
| | | content = content.replace("领券抢购", "抢购"); |
| | | content = content.replace("【券后价】[券后价]元", ""); |
| | | } |
| | | content = content.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | // 替换淘宝官方活动 |
| | | List<String> activityIdList = convertLinkManager.getTaoBaoOfficialActivityId(content); |
| | | for (String st : activityIdList) |
| | | content = content.replace(st, ""); |
| | | |
| | | commentInfoNew.setContent(content); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (typeEnum != null && typeEnum == EvaluateEnum.activity) { |
| | | // 替换淘宝官方活动 |
| | | String content = commentInfoNew.getContent(); |
| | | List<String> activityIdList = convertLinkManager.getTaoBaoOfficialActivityId(content); |
| | | for (String st : activityIdList) |
| | | content = content.replace(st, ""); |
| | | commentInfoNew.setContent(content); |
| | | } |
| | | |
| | | CommentInfoEnum typeComment = commentInfoNew.getTypeEnum(); |
| | | if (typeComment != null && typeComment == CommentInfoEnum.goodsCoupon) { |
| | | GoodsDetailVO goods = evaluateNew.getGoods(); |
| | |
| | | @Override |
| | | public void run() { |
| | | updateGoodInfo(listOBJ); |
| | | |
| | | |
| | | // 删除已过期 |
| | | removeOverdue(); |
| | | } |
| | |
| | | |
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(1L, goodsVO.getGoodsId(), "0"); |
| | | |
| | | // TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(Constant.LINK_TOKEN_VERIFY_UID, goodsVO.getGoodsId(), null); |
| | | // TaoBaoLink taoBaoLink = |
| | | // shareGoodsService.getTaoBaoLinkForShare(Constant.LINK_TOKEN_VERIFY_UID, |
| | | // goodsVO.getGoodsId(), null); |
| | | String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); |
| | | String commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); |
| | | |
| | |
| | | String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); |
| | | String commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(token)); |
| | | |
| | | commentText = commentText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goodsVO.getZkPrice())+""); |
| | | commentText = commentText.replace("[原价]", |
| | | MoneyBigDecimalUtil.getWithNoZera(goodsVO.getZkPrice()) + ""); |
| | | if (!goodsVO.isHasCoupon()) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | } else { |
| | | commentText = commentText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goodsVO.getCouponPrice())+""); |
| | | commentText = commentText.replace("[券后价]", |
| | | MoneyBigDecimalUtil.getWithNoZera(goodsVO.getCouponPrice()) + ""); |
| | | } |
| | | commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n") |
| | | .replace("\r\n\r\n", "\r\n"); |
| | |
| | | if (!StringUtil.isNullOrEmpty(evaluateText)) { |
| | | text2 += evaluateText; |
| | | } |
| | | |
| | | |
| | | String dtitle = daTaoKe.getDtitle(); |
| | | if (!StringUtil.isNullOrEmpty(dtitle)) { |
| | | text2 = text2 + dtitle +"\n"; |
| | | text2 = text2 + dtitle + "\n"; |
| | | } else if (!StringUtil.isNullOrEmpty(evaluateText)) { |
| | | text2 += "\n"; |
| | | } |
| | | text2 += "先领【"+ couponAmount +"元优惠券】下单"; |
| | | |
| | | text2 += "先领【" + couponAmount + "元优惠券】下单"; |
| | | |
| | | CommentInfo commentInfo2 = new CommentInfo(); |
| | | commentInfo2.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | commentInfo2.setContent(text2); |
| | | commentInfo2.setTypeEnum(CommentInfoEnum.goodsCoupon); |
| | | commentInfo2.setType(""); |
| | | |
| | | |
| | | |
| | | List<CommentInfo> commentsNew = new ArrayList<>(); |
| | | commentsNew.add(commentInfo); |
| | | commentsNew.add(commentInfo2); |
| | | goodsEvaluate.setComments(commentsNew); |
| | | |
| | | |
| | | goodsEvaluate.setGoods(goodsVO); |
| | | } |
| | | imgList.add(imgInfo); |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateTaoBaoGoods(TaoBaoGoodsBrief goods) { |
| | | try { |
| | | if (goods == null) { |
| | | return; |
| | | } |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_TAOBAO, goods.getAuctionId()); |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_TAOBAO, |
| | | goods.getAuctionId()); |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateJDGoods(JDGoods jdGoods) { |
| | | if (jdGoods == null) { |
| | |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO); |
| | | |
| | | |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updatePDDGoods(PDDGoodsDetail pddGoods) { |
| | | if (pddGoods == null) { |
| | |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | |
| | | |
| | | private void updateGoods(List<GoodsEvaluate> listExist, GoodsDetailVO goodsNew) { |
| | | long goodsId = goodsNew.getGoodsId(); |
| | | int goodsType = goodsNew.getGoodsType(); |
| | | for (GoodsEvaluate goodsEvaluate: listExist) { |
| | | for (GoodsEvaluate goodsEvaluate : listExist) { |
| | | GoodsDetailVO goodsDetailVO = goodsEvaluate.getGoods(); |
| | | if (goodsDetailVO != null && goodsDetailVO.getGoodsId() != null |
| | | && goodsDetailVO.getGoodsId() == goodsId && goodsDetailVO.getGoodsType() == goodsType) { |
| | | if (goodsDetailVO != null && goodsDetailVO.getGoodsId() != null && goodsDetailVO.getGoodsId() == goodsId |
| | | && goodsDetailVO.getGoodsType() == goodsType) { |
| | | goodsEvaluate.setGoods(goodsNew); |
| | | } |
| | | |
| | | |
| | | // 更新商品信息 |
| | | List<ImgInfo> imgList = goodsEvaluate.getImgList(); |
| | | if (imgList == null || imgList.size() == 0) { |
| | |
| | | |
| | | for (ImgInfo imgInfo : imgList) { |
| | | SimpleGoods simpleGoods = imgInfo.getGoods(); |
| | | if (simpleGoods == null || simpleGoods.getGoodsId() != goodsId |
| | | if (simpleGoods == null || simpleGoods.getGoodsId() != goodsId |
| | | || goodsType != simpleGoods.getGoodsType()) { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | simpleGoods.setState(0); |
| | | simpleGoods.setPrice(goodsNew.getCouponPrice()); |
| | | CouponInfoVO couponInfo = goodsNew.getCouponInfo(); |
| | |
| | | simpleGoods.setPrice(goodsNew.getCouponPrice()); |
| | | simpleGoods.setAmount(couponInfo.getAmount()); |
| | | } |
| | | |
| | | |
| | | imgInfo.setGoods(simpleGoods); |
| | | imgInfo.setGoodsVO(goodsNew); |
| | | } |
| | | |
| | | |
| | | goodsEvaluate.setImgList(imgList); |
| | | goodsEvaluate.setUpdateTime(new Date()); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | | } |
| | | |
| | | |
| | | private void removeOverdue() { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryOverdue(); |
| | | if (list == null || list.size() == 0) { |
| | |
| | | long nm = 1000 * 60;// 一分钟的毫秒数 |
| | | long nh = 1000 * 60 * 60;// 一小时的毫秒数 |
| | | long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数 |
| | | |
| | | |
| | | long time = java.lang.System.currentTimeMillis(); |
| | | for (GoodsEvaluate goodsEvaluate: list) { |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | long diff = time - goodsEvaluate.getEndTime().getTime(); |
| | | long min = diff % nd % nh / nm; |
| | | |
| | | long min = diff % nd % nh / nm; |
| | | |
| | | // 过期超过10分钟就删除 |
| | | if (min > 10) { |
| | | goodsEvaluateDao.remove(goodsEvaluate); |
| | |
| | | InviteOrderSubsidy update = new InviteOrderSubsidy(subsidy.getId());
|
| | | update.setState(InviteOrderSubsidy.STATE_INVALID);
|
| | | update.setUpdateTime(new Date());
|
| | | update.setInValidTime(new Date());
|
| | | inviteOrderSubsidyMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
| | | InviteOrderSubsidy update = new InviteOrderSubsidy(subsidy.getId());
|
| | | update.setState(InviteOrderSubsidy.STATE_VALID);
|
| | | update.setUpdateTime(new Date());
|
| | | update.setValidTime(new Date());
|
| | | inviteOrderSubsidyMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
| | | InviteOrderSubsidy update = new InviteOrderSubsidy(subsidy.getId());
|
| | | update.setState(InviteOrderSubsidy.STATE_INVALID);
|
| | | update.setUpdateTime(new Date());
|
| | | update.setInValidTime(new Date());
|
| | | inviteOrderSubsidyMapper.updateByPrimaryKeySelective(update);
|
| | | orderTeamRewardService.invalidByOrderIdAndSourceType(subsidy.getId());
|
| | | }
|
| | |
| | | InviteOrderSubsidy update = new InviteOrderSubsidy(subsidy.getId());
|
| | | update.setState(InviteOrderSubsidy.STATE_VALID);
|
| | | update.setUpdateTime(new Date());
|
| | | update.setValidTime(new Date());
|
| | | update.setPreGetTime(preGetTime);
|
| | | inviteOrderSubsidyMapper.updateByPrimaryKeySelective(update);
|
| | | orderTeamRewardService.validByOrderIdAndSourceType(subsidy.getId(), preGetTime);
|
| | |
| | | OrderTeamReward update = new OrderTeamReward(subsidy.getId());
|
| | | update.setState(OrderTeamReward.STATE_INVALID);
|
| | | update.setUpdateTime(new Date());
|
| | |
|
| | | update.setInValidTime(new Date());
|
| | | orderTeamRewardMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
| | | update.setState(OrderTeamReward.STATE_VALID);
|
| | | update.setUpdateTime(new Date());
|
| | | update.setPreGetTime(preGetTime);
|
| | | update.setValidTime(new Date());
|
| | | orderTeamRewardMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.manger;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | |
|
| | | @Component
|
| | | public class AppUpdateManager {
|
| | |
|
| | | public String getUpdateInfo(AcceptData acceptData) {
|
| | | Map<String, String> params = new HashMap<>();
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) {// android更新
|
| | | params.put("method", "update");
|
| | | params.put("Platform", "Android");
|
| | | params.put("Version", acceptData.getVersion());
|
| | | params.put("device ", acceptData.getDevice());
|
| | | params.put("time", System.currentTimeMillis() + "");
|
| | | params.put("Package", acceptData.getPackages());
|
| | | params.put("device", acceptData.getDevice());
|
| | | params.put("platform", "Android");
|
| | | params.put("key", "a3f390d88e4c41f2747bfa2f1b5f87db");
|
| | | params.put("versionCode", acceptData.getVersion() + "");
|
| | | } else {// IOS更新
|
| | | params.put("method", "update");
|
| | | params.put("Platform", "IOS");
|
| | | params.put("Version", acceptData.getVersion());
|
| | | params.put("device ", acceptData.getDevice());
|
| | | params.put("time", System.currentTimeMillis() + "");
|
| | | params.put("Package", acceptData.getPackages());
|
| | | params.put("device", acceptData.getDevice());
|
| | | params.put("platform", "IOS");
|
| | | params.put("key", "32bb90e8976aab5298d5da10fe66f21d");
|
| | | params.put("versionCode", acceptData.getVersion() + "");
|
| | | }
|
| | | String url = "http://update.yeshitv.com:8090/update/update";
|
| | | String result = HttpUtil.post(url, params, null);
|
| | | return result;
|
| | | }
|
| | |
|
| | | @Cacheable(value = "config", key = "#acceptData.platform+'-'+#acceptData.version")
|
| | | public String getUpdateInfoCache(AcceptData acceptData) {
|
| | | return getUpdateInfo(acceptData);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.manger.goods;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | | import java.util.regex.Matcher;
|
| | | import java.util.regex.Pattern;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | return newText;
|
| | | }
|
| | |
|
| | | // 获取淘宝官方活动ID内容
|
| | | public List<String> getTaoBaoOfficialActivityId(String text) {
|
| | |
|
| | | // {淘宝活动:13123123}
|
| | | String regex = "(\\{\u6dd8\u5b9d\u6d3b\u52a8\\:){1}+[0-9]{5,20}\\}{1}";
|
| | | Pattern pattern = Pattern.compile(regex);
|
| | | Matcher m = pattern.matcher(text);
|
| | | List<String> urlList = new ArrayList<>();
|
| | | while (m.find()) {
|
| | | urlList.add(m.group());
|
| | | }
|
| | |
|
| | | return urlList;
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | *
|
| | | * @Title: convertTBLinkFromText @Description: 转链文本中的淘口令 @param text @param
|
| | |
| | |
|
| | | StringBuilder builder = new StringBuilder(text);
|
| | | String newText = builder.toString();
|
| | |
|
| | | // 解析淘口令
|
| | | List<String> tokenList = TaoBaoUtil.getTokenListFromTextWithKuoHao(newText);
|
| | | if (tokenList != null && tokenList.size() > 0) {
|
| | |
|
| | |
| | | newText = newText.replace(token, tokenMap.get(token));
|
| | | }
|
| | | }
|
| | |
|
| | | // 解析淘宝官方活动ID
|
| | | List<String> list = getTaoBaoOfficialActivityId(newText);
|
| | | if (list.size() > 0) {
|
| | | String relationId = null;
|
| | | if (share) {
|
| | | relationId = userExtraTaoBaoInfoService.getRelationIdByUid(uid);
|
| | | if (StringUtil.isNullOrEmpty(relationId))
|
| | | throw new Exception("淘宝未授权");
|
| | | }
|
| | | for (String st : list) {
|
| | | String activityid = st.replace("{淘宝活动:", "").replace("}", "");
|
| | | if (!StringUtil.isNullOrEmpty(activityid)) {
|
| | | String adzoneId = TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3];
|
| | | String link = TaoKeApiUtil.officialActivityConvert(adzoneId, activityid, relationId);
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "淘宝官方活动", link);
|
| | | newText = newText.replace(st, TaoBaoUtil.filterTaoToken(token));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return newText;
|
| | | }
|
| | |
|