eason.qian 7 years ago
parent e99dbd910a
commit ca1c61d666

@ -100,18 +100,20 @@ public class NoticeManageImpl implements NoticeManage {
notice.put("create_time", date); notice.put("create_time", date);
notice.put("create_id", manager.getString("manager_id")); notice.put("create_id", manager.getString("manager_id"));
notice.put("create_name", manager.getString("display_name")); notice.put("create_name", manager.getString("display_name"));
if (!notice.getBoolean("merchants_type")){
noticeManageMapper.createNotice(notice); String sendClients = "";
if (noticeInfo.getStatus() != null && noticeInfo.getStatus().equals("1")) { List<JSONObject> clients = clientMapper.listValidClient();
List<JSONObject> clients = clientMapper.listClients(); clients.forEach(c -> {
if (!clients.isEmpty()) { String p = c+",";
for (JSONObject client : clients) { sendClients.concat(p);
client.put("create_time", date); });
client.put("notice_id", notice.getString("notice_id")); if (sendClients.length()>0){
noticePartnerMapper.save(client); sendClients.substring(0,sendClients.length()-1);
}
} }
notice.put("send_clients",sendClients);
} }
noticeManageMapper.createNotice(notice);
return notice; return notice;
} }
@ -134,6 +136,21 @@ public class NoticeManageImpl implements NoticeManage {
notice.put("send_id", manager.getString("manager_id")); notice.put("send_id", manager.getString("manager_id"));
notice.put("send_name", manager.getString("display_name")); notice.put("send_name", manager.getString("display_name"));
} }
if (!notice.getBoolean("merchants_type")){
StringBuilder sendClients = new StringBuilder();
List<JSONObject> clients = clientMapper.listValidClient();
clients.forEach(c -> {
if (c.getInteger("parent_client_id")==null || c.getInteger("parent_client_id")!=9){
String p = c.getString("client_moniker")+",";
sendClients.append(p);
}
});
if (sendClients.length()>0){
notice.put("send_clients",sendClients.substring(0,sendClients.length()-1));
}
}
noticeManageMapper.updateNotice(notice); noticeManageMapper.updateNotice(notice);
if (info.getStatus() != null && info.getSend_clients() != null) { if (info.getStatus() != null && info.getSend_clients() != null) {
if (info.getStatus().equals("1") && noticeInfo.getString("status").equals("0") && !info.getSend_clients().isEmpty()) { if (info.getStatus().equals("1") && noticeInfo.getString("status").equals("0") && !info.getSend_clients().isEmpty()) {

@ -34,7 +34,7 @@ public class NoticeManageController {
public JSONObject addNotice(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid NoticeInfo noticeInfo, public JSONObject addNotice(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid NoticeInfo noticeInfo,
Errors errors) { Errors errors) {
HttpUtils.handleValidErrors(errors); HttpUtils.handleValidErrors(errors);
return noticeManage.addNotice(noticeInfo, manager); return noticeManage.saveNotice(noticeInfo, manager);
} }
@ManagerMapping(value = "/{noticeId}", method = RequestMethod.GET) @ManagerMapping(value = "/{noticeId}", method = RequestMethod.GET)
public JSONObject getNoticeById(@PathVariable String noticeId) { public JSONObject getNoticeById(@PathVariable String noticeId) {

@ -87,6 +87,7 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
} }
}]); }]);
app.controller('addNoticeCtrl', ['$scope', '$http', '$filter', '$state', 'commonDialog', function ($scope, $http, $filter, $state, commonDialog) { app.controller('addNoticeCtrl', ['$scope', '$http', '$filter', '$state', 'commonDialog', function ($scope, $http, $filter, $state, commonDialog) {
$scope.merchantTypes = angular.copy(merchantTypes);
$scope.saveNoticeResult = false; $scope.saveNoticeResult = false;
$scope.notice = {}; $scope.notice = {};
$scope.today = new Date(); $scope.today = new Date();

@ -16,13 +16,15 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
Notice Information Notice Information
<a role="button" class="pull-right" ng-if="notice.status==0" <a role="button" class="pull-right" ng-if="notice.status==0" ng-click="sendNotice(notice)">
<i class="fa fa-envelope-o"></i> Send
</a>
<a role="button" class="pull-right" style="margin-right:10px" ng-if="notice.status==0"
ui-sref="notice.edit({notice_id:notice.notice_id})"> ui-sref="notice.edit({notice_id:notice.notice_id})">
<i class="fa fa-edit"></i> Edit <i class="fa fa-edit"></i> Edit
</a> </a>
<a role="button" class="pull-right" ng-if="notice.status==0" ng-click="sendNotice(notice)">
<i class="fa fa-edit"></i> Send
</a>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="form-horizontal"> <div class="form-horizontal">

Loading…
Cancel
Save