diff --git a/src/db/modify.sql b/src/db/modify.sql index ad0031246..5c9e26a8b 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -236,4 +236,16 @@ alter table statistics_customer_order add column refund_orders int(10) DEFAULT N alter table statistics_customer_order add column refund_amount DECIMAL(20,2) DEFAULT NULL COMMENT '' AFTER `total`; ALTER TABLE `financial_bd_prize_log` - MODIFY COLUMN `manager_id` varchar(50) NOT NULL COMMENT 'bd user id' AFTER `record_id`; \ No newline at end of file + MODIFY COLUMN `manager_id` varchar(50) NOT NULL COMMENT 'bd user id' AFTER `record_id`; + + +CREATE TABLE `act_app_list` ( + `act_id` varchar(50) NOT NULL, + `act_name` varchar(100) NOT NULL COMMENT '活动名称', + `act_url` varchar(400) DEFAULT NULL COMMENT '活动链接', + `is_valid` tinyint(1) NOT NULL DEFAULT 1, + `parms_json` text DEFAULT NULL COMMENT '活动参数', + `create_time` datetime DEFAULT NULL, + `desc` varchar(400) DEFAULT NULL COMMENT '活动简介', + PRIMARY KEY (`act_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='app活动' \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/AppActService.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/AppActService.java new file mode 100644 index 000000000..6193c0712 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/AppActService.java @@ -0,0 +1,9 @@ +package au.com.royalpay.payment.manage.activities.app_index.core; + +import com.alibaba.fastjson.JSONObject; + +import java.util.List; + +public interface AppActService { + List listAppActs(); +} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java new file mode 100644 index 000000000..652f45e6c --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java @@ -0,0 +1,27 @@ +package au.com.royalpay.payment.manage.activities.app_index.core.impls; + +import au.com.royalpay.payment.manage.activities.app_index.core.AppActService; +import au.com.royalpay.payment.manage.mappers.act.ActAppMapper; +import au.com.royalpay.payment.tools.env.PlatformEnvironment; +import com.alibaba.fastjson.JSONObject; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class AppActServiceImp implements AppActService { + + @Resource + private ActAppMapper actAppMapper; + + @Override + public List listAppActs(){ + List list = actAppMapper.listActs(); + for (JSONObject act:list){ + String url = act.getString("act_url"); + act.put("act_url", PlatformEnvironment.getEnv().concatUrl(url)); + } + return actAppMapper.listActs(); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java index 971fad7cd..cd79f0aec 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java @@ -1,6 +1,7 @@ package au.com.royalpay.payment.manage.appclient.web; import au.com.royalpay.payment.core.exceptions.ParamInvalidException; +import au.com.royalpay.payment.manage.activities.app_index.core.AppActService; import au.com.royalpay.payment.manage.activities.monsettledelay.core.ActMonDelaySettleService; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; import au.com.royalpay.payment.manage.appclient.beans.AppQueryBean; @@ -52,6 +53,8 @@ public class RetailAppController { private BillService billService; @Resource private ActMonDelaySettleService actMonDelaySettleService; + @Resource + private AppActService appActService; @RequestMapping(value = "/token", method = RequestMethod.PUT) public void updateDevToken(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject token) { @@ -329,8 +332,8 @@ public class RetailAppController { @RequestMapping(value = "/act",method = RequestMethod.GET) - public JSONObject getIndexAct(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){ - return actMonDelaySettleService.getActNotice(device); + public List getIndexAct(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){ + return appActService.listAppActs(); } @RequestMapping(value = "/act/mondelay/desc", method = RequestMethod.GET) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.java new file mode 100644 index 000000000..c20d88b00 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.java @@ -0,0 +1,17 @@ +package au.com.royalpay.payment.manage.mappers.act; + +import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect; +import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; +import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; +import cn.yixblog.support.mybatis.autosql.annotations.SqlType; +import com.alibaba.fastjson.JSONObject; + +import java.util.List; + +@AutoMapper(tablename = "act_app_list", pkName = "act_id") +public interface ActAppMapper { + + @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "is_valid=1") + List listActs (); +}