活动管理增加字段

master
yuan 7 years ago
parent dd90c988fb
commit c6ba497390

@ -28,37 +28,27 @@ public class AppActBean {
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 +65,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 +187,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;
}
}

@ -65,6 +65,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/new', $scope.actDetail).then(function (resp) {
commonDialog.alert({title: 'Success', content: '新增成功', type: 'success'});
$state.go('^.detail',{act_id:resp.data.act_id},{reload:true});
@ -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