mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
Fix BlackListRepository related class
This commit is contained in:
parent
7d882fdd82
commit
33a12a8be9
@ -20,30 +20,30 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.chatopera.cc.basic.Constants;
|
import com.chatopera.cc.basic.Constants;
|
||||||
import com.chatopera.cc.cache.Cache;
|
import com.chatopera.cc.cache.Cache;
|
||||||
import com.chatopera.cc.persistence.repository.BlackListRepository;
|
import com.chatopera.cc.persistence.repository.BlackListRepository;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.jms.annotation.JmsListener;
|
import org.springframework.jms.annotation.JmsListener;
|
||||||
|
import org.springframework.lang.NonNull;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 访客黑名单
|
* 访客黑名单
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class BlackListEventSubscription {
|
public class BlackListEventSubscription {
|
||||||
private final static Logger logger = LoggerFactory.getLogger(BlackListEventSubscription.class);
|
private final static Logger logger = LoggerFactory.getLogger(BlackListEventSubscription.class);
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private Cache cache;
|
private final Cache cache;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private BlackListRepository blackListRes;
|
private final BlackListRepository blackListRes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉黑访客到达拉黑时间后,从黑名单中移除
|
* 拉黑访客到达拉黑时间后,从黑名单中移除
|
||||||
*
|
|
||||||
* @param payload
|
|
||||||
*/
|
*/
|
||||||
@JmsListener(destination = Constants.WEBIM_SOCKETIO_ONLINE_USER_BLACKLIST, containerFactory = "jmsListenerContainerQueue")
|
@JmsListener(destination = Constants.WEBIM_SOCKETIO_ONLINE_USER_BLACKLIST, containerFactory = "jmsListenerContainerQueue")
|
||||||
public void onMessage(final String payload) {
|
public void onMessage(final String payload) {
|
||||||
|
@ -32,6 +32,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.context.ApplicationListener;
|
import org.springframework.context.ApplicationListener;
|
||||||
import org.springframework.context.event.ContextRefreshedEvent;
|
import org.springframework.context.event.ContextRefreshedEvent;
|
||||||
|
import org.springframework.lang.NonNull;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@ -40,7 +41,7 @@ public class AppCtxRefreshEventListener implements ApplicationListener<ContextRe
|
|||||||
private static final Logger logger = LoggerFactory.getLogger(AppCtxRefreshEventListener.class);
|
private static final Logger logger = LoggerFactory.getLogger(AppCtxRefreshEventListener.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
public void onApplicationEvent(@NonNull ContextRefreshedEvent event) {
|
||||||
if (MainContext.getContext() == null) {
|
if (MainContext.getContext() == null) {
|
||||||
logger.info("[onApplicationEvent] set main context and initialize the Cache System.");
|
logger.info("[onApplicationEvent] set main context and initialize the Cache System.");
|
||||||
MainContext.setApplicationContext(event.getApplicationContext());
|
MainContext.setApplicationContext(event.getApplicationContext());
|
||||||
@ -52,10 +53,10 @@ public class AppCtxRefreshEventListener implements ApplicationListener<ContextRe
|
|||||||
|
|
||||||
if (!StringUtils.equalsIgnoreCase(cacheSetupStrategy, Constants.cache_setup_strategy_skip)) {
|
if (!StringUtils.equalsIgnoreCase(cacheSetupStrategy, Constants.cache_setup_strategy_skip)) {
|
||||||
|
|
||||||
/**************************
|
//**************************
|
||||||
* 加载系统到缓存
|
//* 加载系统到缓存
|
||||||
* 加载系统词典大约只需要5s左右
|
//* 加载系统词典大约只需要5s左右
|
||||||
**************************/
|
//**************************
|
||||||
|
|
||||||
// 首先将之前缓存清空,此处使用系统的默认租户信息
|
// 首先将之前缓存清空,此处使用系统的默认租户信息
|
||||||
cache.eraseSysDicByOrgi(MainContext.SYSTEM_ORGI);
|
cache.eraseSysDicByOrgi(MainContext.SYSTEM_ORGI);
|
||||||
@ -79,7 +80,7 @@ public class AppCtxRefreshEventListener implements ApplicationListener<ContextRe
|
|||||||
parents.contains(dic.getDicid())) {
|
parents.contains(dic.getDicid())) {
|
||||||
// 不是根词典,并且包含在一个根词典内
|
// 不是根词典,并且包含在一个根词典内
|
||||||
if (!rootDictItems.containsKey(dic.getDicid())) {
|
if (!rootDictItems.containsKey(dic.getDicid())) {
|
||||||
rootDictItems.put(dic.getDicid(), new ArrayList<SysDic>());
|
rootDictItems.put(dic.getDicid(), new ArrayList<>());
|
||||||
}
|
}
|
||||||
rootDictItems.get(dic.getDicid()).add(dic);
|
rootDictItems.get(dic.getDicid()).add(dic);
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,9 @@ import com.chatopera.cc.controller.Handler;
|
|||||||
import com.chatopera.cc.model.BlackEntity;
|
import com.chatopera.cc.model.BlackEntity;
|
||||||
import com.chatopera.cc.persistence.repository.BlackListRepository;
|
import com.chatopera.cc.persistence.repository.BlackListRepository;
|
||||||
import com.chatopera.cc.util.Menu;
|
import com.chatopera.cc.util.Menu;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.lang.NonNull;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@ -33,74 +34,75 @@ import javax.validation.Valid;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/admin/callcenter")
|
@RequestMapping("/admin/callcenter")
|
||||||
public class CallCenterBlackController extends Handler{
|
@RequiredArgsConstructor
|
||||||
|
public class CallCenterBlackController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private BlackListRepository blackRes ;
|
private final BlackListRepository blackRes;
|
||||||
|
|
||||||
@RequestMapping(value = "/black")
|
@RequestMapping(value = "/black")
|
||||||
@Menu(type = "callcenter", subtype = "callcenterblack", admin = true)
|
@Menu(type = "callcenter", subtype = "callcenterblack", admin = true)
|
||||||
public ModelAndView black(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView black(ModelMap map, HttpServletRequest request) {
|
||||||
map.addAttribute("blackList" , blackRes.findByOrgi(super.getOrgi(request)));
|
map.addAttribute("blackList", blackRes.findByOrgi(super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/black/index"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/black/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/black/add")
|
@RequestMapping(value = "/black/add")
|
||||||
@Menu(type = "callcenter", subtype = "black", admin = true)
|
@Menu(type = "callcenter", subtype = "black", admin = true)
|
||||||
public ModelAndView blackadd(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView blackadd() {
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/black/add"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/black/add"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/black/save")
|
@RequestMapping(value = "/black/save")
|
||||||
@Menu(type = "callcenter", subtype = "black", admin = true)
|
@Menu(type = "callcenter", subtype = "black", admin = true)
|
||||||
public ModelAndView blacksave(ModelMap map , HttpServletRequest request , @Valid String phones) {
|
public ModelAndView blacksave(HttpServletRequest request, @Valid String phones) {
|
||||||
if(!StringUtils.isBlank(phones)){
|
if (!StringUtils.isBlank(phones)) {
|
||||||
String[] ps = phones.split("[ ,,\t\n]") ;
|
String[] ps = phones.split("[ ,,\t\n]");
|
||||||
for(String ph : ps){
|
for (String ph : ps) {
|
||||||
if(ph.length() >= 3){
|
if (ph.length() >= 3) {
|
||||||
int count = blackRes.countByPhoneAndOrgi(ph.trim(), super.getOrgi(request)) ;
|
int count = blackRes.countByPhoneAndOrgi(ph.trim(), super.getOrgi(request));
|
||||||
if(count == 0){
|
if (count == 0) {
|
||||||
BlackEntity be = new BlackEntity();
|
BlackEntity be = new BlackEntity();
|
||||||
be.setPhone(ph.trim());
|
be.setPhone(ph.trim());
|
||||||
be.setChannel(MainContext.ChannelType.PHONE.toString());
|
be.setChannel(MainContext.ChannelType.PHONE.toString());
|
||||||
be.setOrgi(super.getOrgi(request));
|
be.setOrgi(super.getOrgi(request));
|
||||||
be.setCreater(super.getUser(request).getId());
|
be.setCreater(super.getUser(request).getId());
|
||||||
blackRes.save(be) ;
|
blackRes.save(be);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/black.html"));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/black.html"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/black/edit")
|
@RequestMapping(value = "/black/edit")
|
||||||
@Menu(type = "callcenter", subtype = "black", admin = true)
|
@Menu(type = "callcenter", subtype = "black", admin = true)
|
||||||
public ModelAndView blackedit(ModelMap map , HttpServletRequest request , @Valid String id) {
|
public ModelAndView blackedit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
map.addAttribute("black" , blackRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("black", blackRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/black/edit"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/black/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/black/update")
|
@RequestMapping(value = "/black/update")
|
||||||
@Menu(type = "callcenter", subtype = "black", admin = true)
|
@Menu(type = "callcenter", subtype = "black", admin = true)
|
||||||
public ModelAndView pbxhostupdate(ModelMap map , HttpServletRequest request , @Valid BlackEntity black) {
|
public ModelAndView pbxhostupdate(HttpServletRequest request, @Valid BlackEntity black) {
|
||||||
if(!StringUtils.isBlank(black.getId())){
|
if (!StringUtils.isBlank(black.getId())) {
|
||||||
BlackEntity oldBlack = blackRes.findByIdAndOrgi(black.getId(), super.getOrgi(request)) ;
|
BlackEntity oldBlack = blackRes.findByIdAndOrgi(black.getId(), super.getOrgi(request));
|
||||||
if(oldBlack!=null){
|
if (oldBlack != null) {
|
||||||
oldBlack.setPhone(black.getPhone());
|
oldBlack.setPhone(black.getPhone());
|
||||||
oldBlack.setChannel(MainContext.ChannelType.PHONE.toString());
|
oldBlack.setChannel(MainContext.ChannelType.PHONE.toString());
|
||||||
oldBlack.setOrgi(super.getOrgi(request));
|
oldBlack.setOrgi(super.getOrgi(request));
|
||||||
blackRes.save(oldBlack);
|
blackRes.save(oldBlack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/black.html"));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/black.html"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/black/delete")
|
@RequestMapping(value = "/black/delete")
|
||||||
@Menu(type = "callcenter", subtype = "black", admin = true)
|
@Menu(type = "callcenter", subtype = "black", admin = true)
|
||||||
public ModelAndView blackdelete(ModelMap map , HttpServletRequest request , @Valid String id) {
|
public ModelAndView blackdelete(@Valid String id) {
|
||||||
if(!StringUtils.isBlank(id)){
|
if (!StringUtils.isBlank(id)) {
|
||||||
blackRes.delete(id);
|
blackRes.deleteById(id);
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/black.html"));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/black.html"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,11 @@ import com.chatopera.cc.controller.Handler;
|
|||||||
import com.chatopera.cc.model.*;
|
import com.chatopera.cc.model.*;
|
||||||
import com.chatopera.cc.persistence.repository.*;
|
import com.chatopera.cc.persistence.repository.*;
|
||||||
import com.chatopera.cc.util.Menu;
|
import com.chatopera.cc.util.Menu;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
|
import org.springframework.lang.NonNull;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@ -45,31 +45,29 @@ import java.util.List;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/setting")
|
@RequestMapping("/setting")
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class AgentSettingsController extends Handler {
|
public class AgentSettingsController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private ACDPolicyService acdPolicyService;
|
private final ACDPolicyService acdPolicyService;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private SessionConfigRepository sessionConfigRes;
|
private final SessionConfigRepository sessionConfigRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private TagRepository tagRes;
|
private final TagRepository tagRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private BlackListRepository blackListRes;
|
private final BlackListRepository blackListRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private AdTypeRepository adTypeRes;
|
private final AdTypeRepository adTypeRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private TemplateRepository templateRes;
|
private final TemplateRepository templateRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private Cache cache;
|
private final Cache cache;
|
||||||
|
|
||||||
@Value("${web.upload-path}")
|
|
||||||
private String path;
|
|
||||||
|
|
||||||
@RequestMapping("/agent/index")
|
@RequestMapping("/agent/index")
|
||||||
@Menu(type = "setting", subtype = "sessionconfig", admin = false)
|
@Menu(type = "setting", subtype = "sessionconfig", admin = false)
|
||||||
@ -136,7 +134,7 @@ public class AgentSettingsController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping("/blacklist/delete")
|
@RequestMapping("/blacklist/delete")
|
||||||
@Menu(type = "setting", subtype = "tag", admin = false)
|
@Menu(type = "setting", subtype = "tag", admin = false)
|
||||||
public ModelAndView blacklistdelete(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView blacklistdelete(HttpServletRequest request, @Valid String id) {
|
||||||
if (!StringUtils.isBlank(id)) {
|
if (!StringUtils.isBlank(id)) {
|
||||||
BlackEntity tempBlackEntity = blackListRes.findByIdAndOrgi(id, super.getOrgi(request));
|
BlackEntity tempBlackEntity = blackListRes.findByIdAndOrgi(id, super.getOrgi(request));
|
||||||
if (tempBlackEntity != null) {
|
if (tempBlackEntity != null) {
|
||||||
@ -174,22 +172,22 @@ public class AgentSettingsController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping("/tag/add")
|
@RequestMapping("/tag/add")
|
||||||
@Menu(type = "setting", subtype = "tag", admin = false)
|
@Menu(type = "setting", subtype = "tag", admin = false)
|
||||||
public ModelAndView tagadd(ModelMap map, HttpServletRequest request, @Valid String tagtype) {
|
public ModelAndView tagadd(ModelMap map, @Valid String tagtype) {
|
||||||
map.addAttribute("tagtype", tagtype);
|
map.addAttribute("tagtype", tagtype);
|
||||||
return request(super.createRequestPageTempletResponse("/apps/setting/agent/tagadd"));
|
return request(super.createRequestPageTempletResponse("/apps/setting/agent/tagadd"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/tag/edit")
|
@RequestMapping("/tag/edit")
|
||||||
@Menu(type = "setting", subtype = "tag", admin = false)
|
@Menu(type = "setting", subtype = "tag", admin = false)
|
||||||
public ModelAndView tagedit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String tagtype) {
|
public ModelAndView tagedit(ModelMap map, @Valid String id, @Valid String tagtype) {
|
||||||
map.put("tag", tagRes.findOne(id));
|
map.put("tag", tagRes.findById(id).orElse(null));
|
||||||
map.addAttribute("tagtype", tagtype);
|
map.addAttribute("tagtype", tagtype);
|
||||||
return request(super.createRequestPageTempletResponse("/apps/setting/agent/tagedit"));
|
return request(super.createRequestPageTempletResponse("/apps/setting/agent/tagedit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/tag/update")
|
@RequestMapping("/tag/update")
|
||||||
@Menu(type = "setting", subtype = "tag", admin = false)
|
@Menu(type = "setting", subtype = "tag", admin = false)
|
||||||
public ModelAndView tagupdate(ModelMap map, HttpServletRequest request, @Valid Tag tag, @Valid String tagtype) {
|
public ModelAndView tagupdate(HttpServletRequest request, @Valid Tag tag, @Valid String tagtype) {
|
||||||
Tag temptag = tagRes.findByOrgiAndTag(super.getOrgi(request), tag.getTag());
|
Tag temptag = tagRes.findByOrgiAndTag(super.getOrgi(request), tag.getTag());
|
||||||
if (temptag == null || tag.getId().equals(temptag.getId())) {
|
if (temptag == null || tag.getId().equals(temptag.getId())) {
|
||||||
tag.setOrgi(super.getOrgi(request));
|
tag.setOrgi(super.getOrgi(request));
|
||||||
@ -201,7 +199,7 @@ public class AgentSettingsController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping("/tag/save")
|
@RequestMapping("/tag/save")
|
||||||
@Menu(type = "setting", subtype = "tag", admin = false)
|
@Menu(type = "setting", subtype = "tag", admin = false)
|
||||||
public ModelAndView tagsave(ModelMap map, HttpServletRequest request, @Valid Tag tag, @Valid String tagtype) {
|
public ModelAndView tagsave(HttpServletRequest request, @Valid Tag tag, @Valid String tagtype) {
|
||||||
if (tagRes.findByOrgiAndTag(super.getOrgi(request), tag.getTag()) == null) {
|
if (tagRes.findByOrgiAndTag(super.getOrgi(request), tag.getTag()) == null) {
|
||||||
tag.setOrgi(super.getOrgi(request));
|
tag.setOrgi(super.getOrgi(request));
|
||||||
tag.setCreater(super.getUser(request).getId());
|
tag.setCreater(super.getUser(request).getId());
|
||||||
@ -212,15 +210,15 @@ public class AgentSettingsController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping("/tag/delete")
|
@RequestMapping("/tag/delete")
|
||||||
@Menu(type = "setting", subtype = "tag", admin = false)
|
@Menu(type = "setting", subtype = "tag", admin = false)
|
||||||
public ModelAndView tagdelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String tagtype) {
|
public ModelAndView tagdelete(@Valid String id, @Valid String tagtype) {
|
||||||
tagRes.delete(id);
|
tagRes.deleteById(id);
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/setting/tag.html?code=" + tagtype));
|
return request(super.createRequestPageTempletResponse("redirect:/setting/tag.html?code=" + tagtype));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/acd")
|
@RequestMapping("/acd")
|
||||||
@Menu(type = "setting", subtype = "acd", admin = false)
|
@Menu(type = "setting", subtype = "acd", admin = false)
|
||||||
public ModelAndView acd(ModelMap map, HttpServletRequest request) {
|
public ModelAndView acd(ModelMap map) {
|
||||||
map.put("tagTypeList", Dict.getInstance().getDic("com.dic.tag.type"));
|
map.put("tagTypeList", Dict.getInstance().getDic("com.dic.tag.type"));
|
||||||
return request(super.createAppsTempletResponse("/apps/setting/agent/acd"));
|
return request(super.createAppsTempletResponse("/apps/setting/agent/acd"));
|
||||||
}
|
}
|
||||||
@ -256,14 +254,14 @@ public class AgentSettingsController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping("/adv/add")
|
@RequestMapping("/adv/add")
|
||||||
@Menu(type = "setting", subtype = "adv", admin = false)
|
@Menu(type = "setting", subtype = "adv", admin = false)
|
||||||
public ModelAndView advadd(ModelMap map, HttpServletRequest request, @Valid String adpos) {
|
public ModelAndView advadd(ModelMap map, @Valid String adpos) {
|
||||||
map.addAttribute("adpos", adpos);
|
map.addAttribute("adpos", adpos);
|
||||||
return request(super.createRequestPageTempletResponse("/apps/setting/agent/adadd"));
|
return request(super.createRequestPageTempletResponse("/apps/setting/agent/adadd"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/adv/save")
|
@RequestMapping("/adv/save")
|
||||||
@Menu(type = "setting", subtype = "adv", admin = false)
|
@Menu(type = "setting", subtype = "adv", admin = false)
|
||||||
public ModelAndView advsave(ModelMap map, HttpServletRequest request, @Valid AdType adv, @Valid String advtype, @RequestParam(value = "imgfile", required = false) MultipartFile imgfile) throws IOException {
|
public ModelAndView advsave(HttpServletRequest request, @Valid AdType adv, @RequestParam(value = "imgfile", required = false) MultipartFile imgfile) throws IOException {
|
||||||
adv.setOrgi(super.getOrgi(request));
|
adv.setOrgi(super.getOrgi(request));
|
||||||
adv.setCreater(super.getUser(request).getId());
|
adv.setCreater(super.getUser(request).getId());
|
||||||
if (StringUtils.isNotBlank(adv.getContent())) {
|
if (StringUtils.isNotBlank(adv.getContent())) {
|
||||||
@ -290,7 +288,7 @@ public class AgentSettingsController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping("/adv/update")
|
@RequestMapping("/adv/update")
|
||||||
@Menu(type = "setting", subtype = "adv", admin = false)
|
@Menu(type = "setting", subtype = "adv", admin = false)
|
||||||
public ModelAndView advupdate(ModelMap map, HttpServletRequest request, @Valid AdType ad, @Valid String adpos, @RequestParam(value = "imgfile", required = false) MultipartFile imgfile) throws IOException {
|
public ModelAndView advupdate(HttpServletRequest request, @Valid AdType ad, @Valid String adpos, @RequestParam(value = "imgfile", required = false) MultipartFile imgfile) throws IOException {
|
||||||
AdType tempad = adTypeRes.findByIdAndOrgi(ad.getId(), super.getOrgi(request));
|
AdType tempad = adTypeRes.findByIdAndOrgi(ad.getId(), super.getOrgi(request));
|
||||||
if (tempad != null) {
|
if (tempad != null) {
|
||||||
ad.setOrgi(super.getOrgi(request));
|
ad.setOrgi(super.getOrgi(request));
|
||||||
@ -312,8 +310,8 @@ public class AgentSettingsController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping("/adv/delete")
|
@RequestMapping("/adv/delete")
|
||||||
@Menu(type = "setting", subtype = "adv", admin = false)
|
@Menu(type = "setting", subtype = "adv", admin = false)
|
||||||
public ModelAndView advdelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String adpos) {
|
public ModelAndView advdelete(HttpServletRequest request, @Valid String id, @Valid String adpos) {
|
||||||
adTypeRes.delete(id);
|
adTypeRes.deleteById(id);
|
||||||
MainUtils.initAdv(super.getOrgi(request));
|
MainUtils.initAdv(super.getOrgi(request));
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/setting/adv.html?adpos=" + adpos));
|
return request(super.createRequestPageTempletResponse("redirect:/setting/adv.html?adpos=" + adpos));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user