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_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);
}
}
if (!notice.getBoolean("merchants_type")){
String sendClients = "";
List<JSONObject> clients = clientMapper.listValidClient();
clients.forEach(c -> {
String p = c+",";
sendClients.concat(p);
});
if (sendClients.length()>0){
sendClients.substring(0,sendClients.length()-1);
}
notice.put("send_clients",sendClients);
}
noticeManageMapper.createNotice(notice);
return notice;
}
@ -134,6 +136,21 @@ public class NoticeManageImpl implements NoticeManage {
notice.put("send_id", manager.getString("manager_id"));
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);
if (info.getStatus() != null && info.getSend_clients() != null) {
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,
Errors errors) {
HttpUtils.handleValidErrors(errors);
return noticeManage.addNotice(noticeInfo, manager);
return noticeManage.saveNotice(noticeInfo, manager);
}
@ManagerMapping(value = "/{noticeId}", method = RequestMethod.GET)
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) {
$scope.merchantTypes = angular.copy(merchantTypes);
$scope.saveNoticeResult = false;
$scope.notice = {};
$scope.today = new Date();

@ -16,13 +16,15 @@
<div class="panel panel-default">
<div class="panel-heading">
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})">
<i class="fa fa-edit"></i> Edit
</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 class="panel-body">
<div class="form-horizontal">

Loading…
Cancel
Save