|
@@ -13,42 +13,42 @@ import java.util.Locale;
|
|
|
/**
|
|
/**
|
|
|
* 获取已经发布任务
|
|
* 获取已经发布任务
|
|
|
* Created by ljy on 2018/3/20.
|
|
* Created by ljy on 2018/3/20.
|
|
|
- *
|
|
|
|
|
|
|
+ * <p>
|
|
|
* CREATE TABLE `release_task` (
|
|
* CREATE TABLE `release_task` (
|
|
|
- * `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
|
- * `task_id` int(7) DEFAULT NULL COMMENT '任务id',
|
|
|
|
|
- * `release_num` int(7) DEFAULT NULL COMMENT '发布数量',
|
|
|
|
|
- * `last_num` int(7) DEFAULT NULL COMMENT '剩余数量',
|
|
|
|
|
- * `create_time` bigint(20) DEFAULT NULL COMMENT '创建时间',
|
|
|
|
|
- * `update_time` bigint(20) DEFAULT NULL COMMENT '更新时间',
|
|
|
|
|
- * `online_time` bigint(20) DEFAULT NULL COMMENT '上线时间',
|
|
|
|
|
- * `deadline` bigint(20) DEFAULT NULL COMMENT '截止时间',
|
|
|
|
|
- * `remarks` varchar(100) DEFAULT NULL COMMENT '备注',
|
|
|
|
|
- * `bonus` decimal(10,2) DEFAULT NULL COMMENT '任务奖金',
|
|
|
|
|
- * `status` int(3) DEFAULT NULL COMMENT '1手动上线 2自动上线 3手动下线 4自动下线 5等待上线',
|
|
|
|
|
- * `name` varchar(120) DEFAULT NULL COMMENT '任务名称(默认为task的任务名称)',
|
|
|
|
|
- * `online_type` int(3) DEFAULT '1' COMMENT '1添加马上上线 2定时上线',
|
|
|
|
|
- * `duration` bigint(20) DEFAULT NULL COMMENT '秒为单位(如果task的任务类型为时长任务时必须要)',
|
|
|
|
|
- * `is_hot` tinyint(4) DEFAULT '0' COMMENT '是否热门任务 0不是 1是',
|
|
|
|
|
- * `is_recommend` tinyint(4) DEFAULT '0' COMMENT '是否推荐任务 0不是 1是',
|
|
|
|
|
- * `order` int(11) DEFAULT NULL COMMENT '排序 越大越靠前',
|
|
|
|
|
- * `platform` tinyint(4) DEFAULT NULL COMMENT '平台 1andriod 2ios',
|
|
|
|
|
- * `cancel_duration` int(11) DEFAULT NULL COMMENT '自动取消时间段',
|
|
|
|
|
- * `demo_time` int(11) DEFAULT NULL COMMENT '试玩时长',
|
|
|
|
|
- * `is_succession` int(11) DEFAULT NULL COMMENT '是否为连续任务 0不是 1是',
|
|
|
|
|
- * `exclude` int(11) DEFAULT NULL COMMENT '是否为互斥任务: 0 否 1 是',
|
|
|
|
|
- * `consume_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '最低消费金额(游戏消费类型任务必填,达到最低消费才送相应比例的金额)',
|
|
|
|
|
- * `gift_ratio` int(11) NOT NULL DEFAULT '0' COMMENT '赠送比例(游戏消费类型任务必填,取值0到100)',
|
|
|
|
|
- * `cash_task` tinyint(4) DEFAULT '1' COMMENT '1:现金任务 2:福利任务',
|
|
|
|
|
- * `key_word` varchar(128) NOT NULL DEFAULT '' COMMENT 'ASO任务:关键词 其他任务为空',
|
|
|
|
|
- * `ranking` int(11) NOT NULL DEFAULT '0' COMMENT 'ASO任务:排名 其他任务为0',
|
|
|
|
|
- * `difficulty` int(11) DEFAULT '1' COMMENT '难度 从小到大 难度增大',
|
|
|
|
|
- * `cost_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '成本单价',
|
|
|
|
|
- * `profit_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '平台利润',
|
|
|
|
|
- * `vip_bonus` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '会员获得奖励',
|
|
|
|
|
- * PRIMARY KEY (`id`),
|
|
|
|
|
- * KEY `release_task_task_id_index` (`task_id`),
|
|
|
|
|
- * KEY `release_task_online_type_index` (`online_type`)
|
|
|
|
|
|
|
+ * `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
|
+ * `task_id` int(7) DEFAULT NULL COMMENT '任务id',
|
|
|
|
|
+ * `release_num` int(7) DEFAULT NULL COMMENT '发布数量',
|
|
|
|
|
+ * `last_num` int(7) DEFAULT NULL COMMENT '剩余数量',
|
|
|
|
|
+ * `create_time` bigint(20) DEFAULT NULL COMMENT '创建时间',
|
|
|
|
|
+ * `update_time` bigint(20) DEFAULT NULL COMMENT '更新时间',
|
|
|
|
|
+ * `online_time` bigint(20) DEFAULT NULL COMMENT '上线时间',
|
|
|
|
|
+ * `deadline` bigint(20) DEFAULT NULL COMMENT '截止时间',
|
|
|
|
|
+ * `remarks` varchar(100) DEFAULT NULL COMMENT '备注',
|
|
|
|
|
+ * `bonus` decimal(10,2) DEFAULT NULL COMMENT '任务奖金',
|
|
|
|
|
+ * `status` int(3) DEFAULT NULL COMMENT '1手动上线 2自动上线 3手动下线 4自动下线 5等待上线',
|
|
|
|
|
+ * `name` varchar(120) DEFAULT NULL COMMENT '任务名称(默认为task的任务名称)',
|
|
|
|
|
+ * `online_type` int(3) DEFAULT '1' COMMENT '1添加马上上线 2定时上线',
|
|
|
|
|
+ * `duration` bigint(20) DEFAULT NULL COMMENT '秒为单位(如果task的任务类型为时长任务时必须要)',
|
|
|
|
|
+ * `is_hot` tinyint(4) DEFAULT '0' COMMENT '是否热门任务 0不是 1是',
|
|
|
|
|
+ * `is_recommend` tinyint(4) DEFAULT '0' COMMENT '是否推荐任务 0不是 1是',
|
|
|
|
|
+ * `order` int(11) DEFAULT NULL COMMENT '排序 越大越靠前',
|
|
|
|
|
+ * `platform` tinyint(4) DEFAULT NULL COMMENT '平台 1andriod 2ios',
|
|
|
|
|
+ * `cancel_duration` int(11) DEFAULT NULL COMMENT '自动取消时间段',
|
|
|
|
|
+ * `demo_time` int(11) DEFAULT NULL COMMENT '试玩时长',
|
|
|
|
|
+ * `is_succession` int(11) DEFAULT NULL COMMENT '是否为连续任务 0不是 1是',
|
|
|
|
|
+ * `exclude` int(11) DEFAULT NULL COMMENT '是否为互斥任务: 0 否 1 是',
|
|
|
|
|
+ * `consume_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '最低消费金额(游戏消费类型任务必填,达到最低消费才送相应比例的金额)',
|
|
|
|
|
+ * `gift_ratio` int(11) NOT NULL DEFAULT '0' COMMENT '赠送比例(游戏消费类型任务必填,取值0到100)',
|
|
|
|
|
+ * `cash_task` tinyint(4) DEFAULT '1' COMMENT '1:现金任务 2:福利任务',
|
|
|
|
|
+ * `key_word` varchar(128) NOT NULL DEFAULT '' COMMENT 'ASO任务:关键词 其他任务为空',
|
|
|
|
|
+ * `ranking` int(11) NOT NULL DEFAULT '0' COMMENT 'ASO任务:排名 其他任务为0',
|
|
|
|
|
+ * `difficulty` int(11) DEFAULT '1' COMMENT '难度 从小到大 难度增大',
|
|
|
|
|
+ * `cost_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '成本单价',
|
|
|
|
|
+ * `profit_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '平台利润',
|
|
|
|
|
+ * `vip_bonus` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '会员获得奖励',
|
|
|
|
|
+ * PRIMARY KEY (`id`),
|
|
|
|
|
+ * KEY `release_task_task_id_index` (`task_id`),
|
|
|
|
|
+ * KEY `release_task_online_type_index` (`online_type`)
|
|
|
* ) ENGINE=InnoDB AUTO_INCREMENT=1589 DEFAULT CHARSET=utf8 COMMENT='发布任务';
|
|
* ) ENGINE=InnoDB AUTO_INCREMENT=1589 DEFAULT CHARSET=utf8 COMMENT='发布任务';
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
@@ -444,7 +444,7 @@ public class Release_task implements Serializable {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public String getFuliContent() {
|
|
public String getFuliContent() {
|
|
|
- return String.format(Locale.CHINA, "恭喜您已获得%s元奖励,需最低消费%d,可抵奖励%s。羊羊给的奖励,赶紧前往购买吧!", getBonusText(), consume_amount, NumberFormatUtils.retainMost2(gift_ratio * consume_amount / 100));
|
|
|
|
|
|
|
+ return String.format(Locale.CHINA, "恭喜您已获得%s元奖励,需最低消费%d,可抵奖励%s。羊羊给的奖励,赶紧前往购买吧!", getBonusText(), consume_amount, NumberFormatUtils.retainMost2(gift_ratio * consume_amount / 100));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -453,6 +453,7 @@ public class Release_task implements Serializable {
|
|
|
public boolean isAppointTask() {
|
|
public boolean isAppointTask() {
|
|
|
return is_appoint == 1;
|
|
return is_appoint == 1;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 要展示的定向内容
|
|
* 要展示的定向内容
|
|
|
*/
|
|
*/
|
|
@@ -464,6 +465,7 @@ public class Release_task implements Serializable {
|
|
|
* +5元
|
|
* +5元
|
|
|
* or
|
|
* or
|
|
|
* +5元(元宝)
|
|
* +5元(元宝)
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
public String getRewardMsg() {
|
|
public String getRewardMsg() {
|
|
@@ -471,11 +473,10 @@ public class Release_task implements Serializable {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//以下为福利相关方法
|
|
//以下为福利相关方法
|
|
|
|
|
|
|
|
|
|
|
|
|
-// `boon_content` varchar(255) NOT NULL DEFAULT '' COMMENT '福利内容',
|
|
|
|
|
|
|
+ // `boon_content` varchar(255) NOT NULL DEFAULT '' COMMENT '福利内容',
|
|
|
private String boon_content;
|
|
private String boon_content;
|
|
|
|
|
|
|
|
public void setBoon_content(String boon_content) {
|
|
public void setBoon_content(String boon_content) {
|
|
@@ -486,15 +487,51 @@ public class Release_task implements Serializable {
|
|
|
return boon_content;
|
|
return boon_content;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+//`difficulty` int(11) DEFAULT '1' COMMENT '难度 从小到大 难度增大 1:青铜、2:白银、3:黄金、4:铂金、5:钻石、6:至尊、7:王者'
|
|
|
|
|
+
|
|
|
|
|
+ private int difficulty;
|
|
|
|
|
+
|
|
|
|
|
+ public void setDifficulty(int difficulty) {
|
|
|
|
|
+ this.difficulty = difficulty;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public int getDifficulty() {
|
|
|
|
|
+ return difficulty;
|
|
|
|
|
+ }
|
|
|
|
|
+//`vip` int(11) NOT NULL DEFAULT '0' COMMENT '0:全部可接 1:vip专属',
|
|
|
|
|
+ private int vip;
|
|
|
|
|
+
|
|
|
|
|
+ public void setVip(int vip) {
|
|
|
|
|
+ this.vip = vip;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public int getVip() {
|
|
|
|
|
+ return vip;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取福利的展示内容
|
|
//获取福利的展示内容
|
|
|
public CharSequence getWelfareInfo() {
|
|
public CharSequence getWelfareInfo() {
|
|
|
- return String.format(Locale.CHINA, "内容:%s", boon_content);
|
|
|
|
|
|
|
+ return String.format(Locale.CHINA, "内容:%s", boon_content == null ? "" : boon_content);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//获取福利的价值
|
|
//获取福利的价值
|
|
|
public CharSequence getWelfareValue() {
|
|
public CharSequence getWelfareValue() {
|
|
|
return new SpannableSb().append("价值:").append(String.format(Locale.CHINA, "¥%s", bonus), "#FD2D54").getSsb();
|
|
return new SpannableSb().append("价值:").append(String.format(Locale.CHINA, "¥%s", bonus), "#FD2D54").getSsb();
|
|
|
}
|
|
}
|
|
|
|
|
+ //获取福利的价值
|
|
|
|
|
+ public CharSequence getRemainderTime() {
|
|
|
|
|
+ return new SpannableSb().append("剩余时间:").append(TimeUtil.getDurationText2(Long.valueOf(deadline) - System.currentTimeMillis() / 1000L)).getSsb();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //获取级别,其对应资源中的R.drawable.ic_welfare_level_1
|
|
|
|
|
+ public int getLevel() {
|
|
|
|
|
+ return Math.max(difficulty, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ public boolean isVipWelfare(){
|
|
|
|
|
+ return vip == 1;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|