Merge remote-tracking branch 'origin/develop' into develop

master
eason.qian 7 years ago
commit f1049e7cd9

@ -314,4 +314,5 @@ ALTER TABLE `sys_customer_relation`
ADD COLUMN `globalpay_openid` varchar(100) NULL AFTER `kanga_openid`;
ALTER TABLE act_app_list ADD banner_img VARCHAR(200) NULL COMMENT 'App首页banner图片';
ALTER TABLE act_app_list ADD banner_img VARCHAR(200) NULL COMMENT 'App首页banner图片';
alter table act_app_list MODIFY column is_show_window tinyint(1) DEFAULT 0 COMMENT 'app是否弹框'

@ -1,12 +1,11 @@
package au.com.royalpay.payment.manage.activities.app_index.beans;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import javax.xml.crypto.Data;
import java.text.ParseException;
import java.util.Date;
@ -18,47 +17,37 @@ public class AppActBean {
private String act_name;
private String act_url;
private String params_json;
private Boolean is_valid = true;
private boolean is_valid = true;
private String desc;
private String act_content;
private String show_type;
private Boolean is_show_window;
private boolean is_show_window;
private String act_img;
private String window_img;
private String active_date;
private String expire_date;
private String banner_img;
private String msg_start_date;
private String msg_end_date;
private String msg_interval;
public JSONObject toJsonParam(){
JSONObject params = new JSONObject();
if(StringUtils.isNotEmpty(act_name)){
params.put("act_name",act_name);
}
if(StringUtils.isNotEmpty(act_url)){
params.put("act_url",act_url);
}
if(StringUtils.isNotEmpty(params_json)){
params.put("params_json",params_json);
}
if(StringUtils.isNotEmpty(desc)){
params.put("desc",desc);
}
if(StringUtils.isNotEmpty(act_content)){
params.put("act_content",act_content);
}
if(StringUtils.isNotEmpty(show_type)){
params.put("show_type",show_type);
}
if(StringUtils.isNotEmpty(act_img)){
params.put("act_img",act_img);
}
if(StringUtils.isNotEmpty(window_img)){
params.put("window_img",window_img);
}
if(StringUtils.isNotEmpty(banner_img)){
params.put("banner_img",banner_img);
}
params.put("act_name",act_name);
params.put("act_url",act_url);
params.put("params_json",params_json);
params.put("desc",desc);
params.put("act_content",act_content);
params.put("show_type",show_type);
params.put("act_img",act_img);
params.put("window_img",window_img);
params.put("banner_img",banner_img);
params.put("msg_interval",msg_interval);
params.put("is_show_window",is_show_window);
params.put("is_valid",is_valid);
params.put("msg_start_date", msg_start_date);
params.put("msg_end_date", msg_end_date);
if (active_date != null) {
try {
Date fromDate = DateUtils.parseDate(active_date, DATE_PATTERNS);
@ -75,8 +64,22 @@ public class AppActBean {
throw new ParamInvalidException("expire_date", "error.payment.valid.invalid_date_format");
}
}
params.put("is_show_window",is_show_window);
params.put("is_valid",is_valid);
if (msg_start_date != null) {
try {
Date fromDate = DateUtils.parseDate(msg_start_date, DATE_PATTERNS);
params.put("msg_start_date", fromDate);
} catch (ParseException e) {
throw new ParamInvalidException("msg_start_date", "error.payment.valid.invalid_date_format");
}
}
if (msg_end_date != null) {
try {
Date fromDate = DateUtils.parseDate(msg_end_date, DATE_PATTERNS);
params.put("msg_end_date", fromDate);
} catch (ParseException e) {
throw new ParamInvalidException("msg_end_date", "error.payment.valid.invalid_date_format");
}
}
return params;
}
@ -183,4 +186,28 @@ public class AppActBean {
public void setBanner_img(String banner_img) {
this.banner_img = banner_img;
}
public String getMsg_start_date() {
return msg_start_date;
}
public void setMsg_start_date(String msg_start_date) {
this.msg_start_date = msg_start_date;
}
public String getMsg_end_date() {
return msg_end_date;
}
public void setMsg_end_date(String msg_end_date) {
this.msg_end_date = msg_end_date;
}
public String getMsg_interval() {
return msg_interval;
}
public void setMsg_interval(String msg_interval) {
this.msg_interval = msg_interval;
}
}

@ -20,4 +20,6 @@ public interface AppActService {
void updateAct(JSONObject manager,String act_id,AppActBean appActBean);
JSONObject getLatestWindowNotice();
void published(JSONObject manager,String act_id,boolean is_valid);
}

@ -67,4 +67,13 @@ public class AppActServiceImp implements AppActService {
actAppMapper.newAppAct(params);
return params;
}
@Override
public void published(JSONObject manager, String act_id, boolean is_valid) {
JSONObject params = new JSONObject();
params.put("act_id",act_id);
params.put("is_valid",is_valid);
params.put("update_time",new Date());
actAppMapper.updateAct(params);
}
}

@ -3,15 +3,21 @@ package au.com.royalpay.payment.manage.activities.app_index.web;
import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean;
import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean;
import au.com.royalpay.payment.manage.activities.app_index.core.AppActService;
import au.com.royalpay.payment.manage.activities.monsettledelay.beans.MonDelayBean;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/manager/app/act")
@ -31,7 +37,7 @@ public class AppActController {
return appActService.getActDetail(manager,act_id);
}
@ManagerMapping(value = "/new",method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER)
@ManagerMapping(method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER)
public JSONObject newAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AppActBean appActBean){
return appActService.newAppAct(manager,appActBean);
}
@ -39,4 +45,9 @@ public class AppActController {
public void updateAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id,@RequestBody AppActBean appActBean){
appActService.updateAct(manager,act_id,appActBean);
}
@ManagerMapping(value = "/published/{act_id}",method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER)
public void publishedAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id,@RequestBody boolean is_valid){
appActService.published(manager,act_id,is_valid);
}
}

@ -124,13 +124,10 @@
if(operation_pause){
return;
}
var u = navigator.userAgent;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if(is_weixin()){
return;
} else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
appCmd('{\"type\":\"cmd_join_mondelay\"');
window.webkit.messageHandlers.appCmd.postMessage({type:'cmd_join_mondelay'});
} else if (/(Android)/i.test(navigator.userAgent)) {
android.appCmd('{\"type\":\"cmd_join_mondelay\"}');
} else {
@ -141,18 +138,16 @@
if(operation_pause){
return;
}
var u = navigator.userAgent;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if(is_weixin()){
return;
} else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
appCmd('{\"type\":\"cmd_cancel_mondelay\"');
window.webkit.messageHandlers.appCmd.postMessage({type:'cmd_cancel_mondelay'});
} else if (/(Android)/i.test(navigator.userAgent)) {
android.appCmd('{\"type\":\"cmd_cancel_mondelay\"}');
} else {
}
});
})
</script>

@ -36,7 +36,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.act = {};
$scope.act.act_id = act.act_id;
$scope.act.is_valid = !act.is_valid;
$http.put('/manager/app/act/' + $scope.act.act_id, $scope.act).then(function (resp) {
$http.put('/manager/app/act/published/'+$scope.act.act_id, $scope.act.is_valid).then(function (resp) {
commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'});
$scope.loadActAppList(1);
}, function (resp) {
@ -65,7 +65,13 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
if ($scope.actDetail.expire_date) {
$scope.actDetail.expire_date = $filter('date')($scope.actDetail.expire_date, 'yyyy-MM-dd');
}
$http.put('/manager/app/act/new', $scope.actDetail).then(function (resp) {
if ($scope.actDetail.msg_start_date) {
$scope.actDetail.msg_start_date = $filter('date')($scope.actDetail.msg_start_date, 'yyyy-MM-dd');
}
if ($scope.actDetail.msg_end_date) {
$scope.actDetail.msg_end_date = $filter('date')($scope.actDetail.msg_end_date, 'yyyy-MM-dd');
}
$http.put('/manager/app/act', $scope.actDetail).then(function (resp) {
commonDialog.alert({title: 'Success', content: '新增成功', type: 'success'});
$state.go('^.detail',{act_id:resp.data.act_id},{reload:true});
}, function (resp) {
@ -78,6 +84,12 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.ctrl = {dateInput: false};
$scope.actDetail.active_date = new Date($scope.actDetail.active_date);
$scope.actDetail.expire_date = new Date($scope.actDetail.expire_date);
if($scope.actDetail.msg_start_date){
$scope.actDetail.msg_start_date = new Date($scope.actDetail.msg_start_date);
}
if($scope.actDetail.msg_end_date){
$scope.actDetail.msg_end_date = new Date($scope.actDetail.msg_end_date);
}
$scope.submit = function () {
if ($scope.actDetail.active_date) {
$scope.actDetail.active_date = $filter('date')($scope.actDetail.active_date, 'yyyy-MM-dd');
@ -85,6 +97,12 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
if ($scope.actDetail.expire_date) {
$scope.actDetail.expire_date = $filter('date')($scope.actDetail.expire_date, 'yyyy-MM-dd');
}
if ($scope.actDetail.msg_start_date) {
$scope.actDetail.msg_start_date = $filter('date')($scope.actDetail.msg_start_date, 'yyyy-MM-dd');
}
if ($scope.actDetail.msg_end_date) {
$scope.actDetail.msg_end_date = $filter('date')($scope.actDetail.msg_end_date, 'yyyy-MM-dd');
}
$http.put('/manager/app/act/' + $scope.actDetail.act_id, $scope.actDetail).then(function (resp) {
commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'});
$state.reload();

@ -3,9 +3,9 @@
<h1>APP_ACTIVITY</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-sitemap"></i> 网站管理
<i class="fa fa-sitemap" ui-sref="appAct"> 活动管理</i>
</li>
<li class="active">Category - APP_ACTIVITY</li>
<li class="active">活动详情</li>
</ol>
</section>
<div class="content">
@ -44,8 +44,7 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-2"
for="actDetail.act_name">Activity Time*</label>
<label class="control-label col-xs-4 col-sm-2">Activity Time*</label>
<div class="col-xs-8 col-sm-4">
<div style="display: inline-block" ng-class="{'has-error':appActForm.active_date.$invalid && appActForm.active_date.$dirty}">
<input class="form-control" id="date-from-input"
@ -108,6 +107,36 @@
ng-model="actDetail.banner_img">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-2">Msg Date</label>
<div class="col-xs-8 col-sm-4">
<div style="display: inline-block">
<input class="form-control" id="date-from-input2"
ng-model="actDetail.msg_start_date"
uib-datepicker-popup size="10" placeholder="Start Date"
is-open="dateStart.open" ng-click="dateStart.open=true"
name="msg_start_date">
</div>
~
<div style="display: inline-block">
<input class="form-control" id="date-to-input2" ng-model="actDetail.msg_end_date"
uib-datepicker-popup size="10" placeholder="End Date"
is-open="dateEnd.open" ng-click="dateEnd.open=true"
name="msg_end_date">
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-2" for="actDetail.act_img">Msg Interval</label>
<div class="col-xs-8 col-sm-4">
<div class="input-group">
<input type="number" class="form-control" id="actDetail.msg_interval"
ng-model="actDetail.msg_interval" aria-describedby="interval_h">
<span class="input-group-addon" id="interval_h">H</span>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-2">Show

@ -3,9 +3,9 @@
<h1>APP_ACTIVITY</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-sitemap"></i> 网站管理
<i class="fa fa-sitemap">活动管理</i>
</li>
<li class="active">Category - APP_ACTIVITY</li>
<li class="active">APP_ACTIVITY</li>
</ol>
</section>
@ -49,8 +49,8 @@
<tr ng-repeat="act in app_acts">
<td ng-bind="act.act_name"></td>
<td ng-bind="act.create_time"></td>
<td ng-bind="act.active_date"></td>
<td ng-bind="act.expire_date"></td>
<td ng-bind="act.active_date | limitTo:10""></td>
<td ng-bind="act.expire_date | limitTo:10""></td>
<td>
<span ng-click="publishedOrIsValid(act)">
<i class="text-success fa fa-check" ng-if="act.is_valid"></i>

Loading…
Cancel
Save