eason.qian 7 years ago
parent 7f4f195fee
commit 08426e8a5a

@ -239,5 +239,5 @@ ALTER TABLE `financial_bd_prize_log`
MODIFY COLUMN `manager_id` varchar(50) NOT NULL COMMENT 'bd user id' AFTER `record_id`;
alter table sys_notice
add is_app_window tinyint default '0' null comment '是否需要APP弹框';
ALTER TABLE sys_notice ADD merchants_type TINYINT(1) DEFAULT 0 NOT NULL COMMENT '商户范围0全部商户 1自定义商户';
ALTER TABLE sys_notice ADD is_app_window TINYINT(1) DEFAULT 0 COMMENT '是否需要APP弹框';

@ -23,6 +23,7 @@ public class NoticeInfo {
private boolean is_tomail;
private boolean is_tomail_cc_stockholder;
private boolean is_to_app;
private boolean is_app_window;
private String notice_id;
public JSONObject toJson() {
@ -47,6 +48,9 @@ public class NoticeInfo {
res.put("is_tomail",is_tomail);
res.put("is_tomail_cc_stockholder",is_tomail_cc_stockholder);
res.put("is_to_app",is_to_app);
if (is_app_window){
res.put("is_app_window",is_app_window);
}
if (notice_id != null){
res.put("notice_id",notice_id);
}
@ -120,4 +124,12 @@ public class NoticeInfo {
public void setNotice_id(String notice_id) {
this.notice_id = notice_id;
}
public boolean isIs_app_window() {
return is_app_window;
}
public void setIs_app_window(boolean is_app_window) {
this.is_app_window = is_app_window;
}
}

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.notice.core;
import au.com.royalpay.payment.manage.notice.beans.NoticeInfo;
import au.com.royalpay.payment.manage.notice.beans.NoticeQuery;
import com.alibaba.fastjson.JSONObject;
import org.springframework.transaction.annotation.Transactional;
/**
* Created by yishuqian on 28/09/2016.
@ -12,6 +13,9 @@ public interface NoticeManage {
JSONObject addNotice(NoticeInfo noticeInfo, JSONObject manager);
@Transactional
JSONObject saveNotice(NoticeInfo noticeInfo, JSONObject manager);
JSONObject getNoticeById(String noticeId);
void updateNotice(JSONObject manager, String noticeId, NoticeInfo info) throws Exception;

@ -91,6 +91,29 @@ public class NoticeManageImpl implements NoticeManage {
return notice;
}
@Transactional
@Override
public JSONObject saveNotice(NoticeInfo noticeInfo, JSONObject manager) {
Date date = new Date();
JSONObject notice = noticeInfo.toJson();
notice.put("create_time", date);
notice.put("create_id", manager.getString("manager_id"));
notice.put("create_name", manager.getString("display_name"));
noticeManageMapper.createNotice(notice);
if (noticeInfo.getStatus() != null && noticeInfo.getStatus().equals("1")) {
List<JSONObject> clients = clientMapper.listClients();
if (!clients.isEmpty()) {
for (JSONObject client : clients) {
client.put("create_time", date);
client.put("notice_id", notice.getString("notice_id"));
noticePartnerMapper.save(client);
}
}
}
return notice;
}
@Override
public JSONObject getNoticeById(String noticeId) {
JSONObject notice = noticeManageMapper.getNoticeDetailById(noticeId);

@ -58,17 +58,24 @@
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':noticeForm.intro.$invalid && noticeForm.intro.$dirty}">
<label class="control-label col-sm-2" for="title-input">Intro</label>
<div class="col-sm-8">
<input class="form-control" ng-model="notice.title" type="textarea"
id="intro-input" name="intro" maxlength="400">
<div ng-messages="noticeForm.intro.$error"
ng-if="noticeForm.intro.$dirty">
<p class="small text-danger" ng-message="maxlength">Less Than 400
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':noticeForm.content.$invalid && noticeForm.content.$dirty}">
<label class="control-label col-sm-2"></label>
<div class="col-sm-8">
<ueditor ng-model="notice.content" ue-height="400"></ueditor>
<!--<textarea class="form-control" required ng-model="notice.content"-->
<!--name="content" id="desc-input"></textarea>-->
<!--<div ng-messages="noticeForm.content.$error"-->
<!--ng-if="noticeForm.content.$dirty">-->
<!--<p class="small text-danger" ng-message="required">Required Field</p>-->
<!--</div>-->
</div>
</div>
<div class="form-group">
@ -80,27 +87,33 @@
is-open="dateEnd.open" ng-click="dateEnd.open=true"
datepicker-options="{minDate:today}">
</div>
<div ng-if="notice.notice_id" class="col-sm-2" style="display: inline-block">
<input type="checkbox"
ng-model="notice.is_tomail"> Send Emails
</div>
<div ng-if="notice.notice_id && notice.is_tomail" class="col-sm-2" style="display: inline-block">
<input type="checkbox"
ng-model="notice.is_tomail_cc_stockholder"> CC to stockholders
</div>
<div ng-if="notice.notice_id" class="col-sm-2" style="display: inline-block">
<input type="checkbox"
ng-model="notice.is_to_app"> Send App
</div>
<!--<div ng-if="notice.notice_id" class="col-sm-2" style="display: inline-block">-->
<!--<input type="checkbox"-->
<!--ng-model="notice.is_tomail"> Send Emails-->
<!--</div>-->
<!--<div ng-if="notice.notice_id && notice.is_tomail" class="col-sm-2" style="display: inline-block">-->
<!--<input type="checkbox"-->
<!--ng-model="notice.is_tomail_cc_stockholder"> CC to stockholders-->
<!--</div>-->
<!--<div ng-if="notice.notice_id" class="col-sm-2" style="display: inline-block">-->
<!--<input type="checkbox"-->
<!--ng-model="notice.is_to_app"> Send App-->
<!--</div>-->
</div>
<div class="form-group" ng-if="notice.notice_id && notice.is_tomail||notice.notice_id && notice.is_to_app">
<label class="control-label col-sm-2" for="clients-input">Send Partners</label>
<div class="form-group">
<label class="control-label col-sm-2" for="merchants-type">Merchants</label>
<div class="col-sm-8" style="display: inline-block" ng-if="notice.status=='0'|| notice.status==null">
<textarea class="form-control col-sm-10" ng-model="notice.send_clients"
name="clients" id="clients-input"></textarea>
<a class="btn btn-success" role="button" ng-click="selectClients(notice)"><i
class="fa fa-search"></i></a>
<select class="form-control" ng-model="notice.merchants_type" id="merchants-type">
<option value="0">ALL</option>
<option value="1">Custom</option>
</select>
</div>
<div class="col-sm-8" style="display: inline-block" ng-if="notice.merchants==1">
<input class="form-control" ng-model="notice.send_clients" type="textarea"
id="send-clients-input" name="send_clients">
</div>
<p class="small text-danger">以PartnerCode1,PartnerCode2..的形式填写</p>
<div class="col-sm-8" ng-if="notice.status=='1'">
<p class="form-control-static" ng-bind="notice.send_clients"></p>
</div>
@ -110,9 +123,9 @@
</div>
<div class="btn-group margin-bottom margin-top">
<button class="btn btn-success" type="button" ng-click="save(noticeForm)">Save</button>
<button ng-if="notice.status=='0'|| notice.status==null" class="btn btn-danger" type="button"
ng-click="notice.status='1';save(noticeForm)">Send
</button>
<!--<button ng-if="notice.status=='0'|| notice.status==null" class="btn btn-danger" type="button"-->
<!--ng-click="notice.status='1';save(noticeForm)">Send-->
<!--</button>-->
</div>
</div>
</div>

@ -23,29 +23,68 @@
</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="col-sm-12">
<p class="form-control-static" ng-bind-html="notice.content"></p>
<div class="form-group">
<label class="control-label col-sm-2">Intro</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="notice.desc"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Intro</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind-html="notice.content"></p>
</div>
</div>
<div class="col-sm-12" ng-if="notice.send_time">
<label class="control-label col-sm-1">Send Time</label>
<div class="form-group" ng-if="notice.send_time">
<label class="control-label col-sm-2">Send Time</label>
<div class="col-sm-11">
<div class="col-sm-10">
<p class="form-control-static" ng-bind="notice.send_time|limitTo:10"></p>
</div>
</div>
<div class="col-sm-12" ng-if="notice.end_time">
<label class="control-label col-sm-1">Expiry Date</label>
<div class="col-sm-11">
<div class="form-group" ng-if="notice.end_time">
<label class="control-label col-sm-2">Expiry Date</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="notice.end_time|limitTo:10"></p>
</div>
</div>
<div class="form-group" ng-if="notice.merchant_type">
<label class="control-label col-sm-2">Merchants</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="notice.end_time|limitTo:10"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Send Channels</label>
<div class="col-sm-10">
<div class="col-sm-6">
<label class="control-label col-sm-2">Emails</label>
<div class="col-sm-10">
<input type="checkbox" disabled ng-model="notice.is_tomail" bs-switch>
</div>
</div>
<div class="col-sm-6">
<label class="control-label col-sm-2">App Notice</label>
<div class="col-sm-10">
<input type="checkbox" disabled ng-model="partner.is_to_app" bs-switch>
</div>
</div>
<div class="col-sm-6">
<label class="control-label col-sm-2">App Window</label>
<div class="col-sm-10">
<input type="checkbox" disabled ng-model="partner.is_app_window" bs-switch>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--end 商品基本资料-->
<div class="panel panel-default" ng-if="notice.status==1 && clients.length>0">
<div class="panel-heading">Reading Partners
<span style="font-size: smaller;color: grey">(send to {{total_clients}} partners and {{pagination.totalCount}} partners of them have read)</span></div>
<span style="font-size: smaller;color: grey">(send to {{total_clients}} partners and {{pagination.totalCount}} partners of them have read)</span>
</div>
<div class="panel-body">
<div class="box-body no-padding table-responsive">
<table class="table table-striped">
@ -80,7 +119,9 @@
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total
Pages:{{pagination.totalPages}}
</div>
</div>
</div>
</div>

Loading…
Cancel
Save