mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
Fix PbxHostRepository related class
This commit is contained in:
parent
57b376f3aa
commit
75f7ce79d4
@ -21,8 +21,9 @@ import com.chatopera.cc.model.Acl;
|
|||||||
import com.chatopera.cc.persistence.repository.AclRepository;
|
import com.chatopera.cc.persistence.repository.AclRepository;
|
||||||
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
||||||
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")
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class CallCenterAclController extends Handler {
|
public class CallCenterAclController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private PbxHostRepository pbxHostRes ;
|
private final PbxHostRepository pbxHostRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private AclRepository aclRes ;
|
private final AclRepository aclRes;
|
||||||
|
|
||||||
@RequestMapping(value = "/acl")
|
@RequestMapping(value = "/acl")
|
||||||
@Menu(type = "callcenter" , subtype = "callcenteracl" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "callcenteracl", admin = true)
|
||||||
public ModelAndView acl(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView acl(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
if(!StringUtils.isBlank(hostid)){
|
if (!StringUtils.isBlank(hostid)) {
|
||||||
map.addAttribute("pbxHost" , pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
map.addAttribute("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
map.addAttribute("aclList" , aclRes.findByHostidAndOrgi(hostid, super.getOrgi(request)));
|
map.addAttribute("aclList", aclRes.findByHostidAndOrgi(hostid, super.getOrgi(request)));
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/acl/index"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/acl/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/acl/add")
|
@RequestMapping(value = "/acl/add")
|
||||||
@Menu(type = "callcenter" , subtype = "acl" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "acl", admin = true)
|
||||||
public ModelAndView acladd(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView acladd(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/acl/add"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/acl/add"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/acl/save")
|
@RequestMapping(value = "/acl/save")
|
||||||
@Menu(type = "callcenter" , subtype = "acl" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "acl", admin = true)
|
||||||
public ModelAndView aclsave(ModelMap map , HttpServletRequest request , @Valid Acl acl) {
|
public ModelAndView aclsave(HttpServletRequest request, @Valid Acl acl) {
|
||||||
if(!StringUtils.isBlank(acl.getName())){
|
if (!StringUtils.isBlank(acl.getName())) {
|
||||||
int count = aclRes.countByNameAndOrgi(acl.getName(), super.getOrgi(request)) ;
|
int count = aclRes.countByNameAndOrgi(acl.getName(), super.getOrgi(request));
|
||||||
if(count == 0){
|
if (count == 0) {
|
||||||
acl.setOrgi(super.getOrgi(request));
|
acl.setOrgi(super.getOrgi(request));
|
||||||
acl.setCreater(super.getUser(request).getId());
|
acl.setCreater(super.getUser(request).getId());
|
||||||
aclRes.save(acl) ;
|
aclRes.save(acl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/acl.html?hostid="+acl.getHostid()));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/acl.html?hostid=" + acl.getHostid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/acl/edit")
|
@RequestMapping(value = "/acl/edit")
|
||||||
@Menu(type = "callcenter" , subtype = "acl" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "acl", admin = true)
|
||||||
public ModelAndView acledit(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView acledit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
||||||
map.addAttribute("acl" , aclRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("acl", aclRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/acl/edit"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/acl/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/acl/update")
|
@RequestMapping(value = "/acl/update")
|
||||||
@Menu(type = "callcenter" , subtype = "acl" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "acl", admin = true)
|
||||||
public ModelAndView pbxhostupdate(ModelMap map , HttpServletRequest request , @Valid Acl acl) {
|
public ModelAndView pbxhostupdate(HttpServletRequest request, @Valid Acl acl) {
|
||||||
if(!StringUtils.isBlank(acl.getId())){
|
if (!StringUtils.isBlank(acl.getId())) {
|
||||||
Acl oldAcl = aclRes.findByIdAndOrgi(acl.getId(), super.getOrgi(request)) ;
|
Acl oldAcl = aclRes.findByIdAndOrgi(acl.getId(), super.getOrgi(request));
|
||||||
if(oldAcl!=null){
|
if (oldAcl != null) {
|
||||||
oldAcl.setName(acl.getName());
|
oldAcl.setName(acl.getName());
|
||||||
oldAcl.setDefaultvalue(acl.getDefaultvalue());
|
oldAcl.setDefaultvalue(acl.getDefaultvalue());
|
||||||
oldAcl.setStrategy(acl.getStrategy());
|
oldAcl.setStrategy(acl.getStrategy());
|
||||||
aclRes.save(oldAcl);
|
aclRes.save(oldAcl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/acl.html?hostid="+acl.getHostid()));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/acl.html?hostid=" + acl.getHostid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/acl/delete")
|
@RequestMapping(value = "/acl/delete")
|
||||||
@Menu(type = "callcenter" , subtype = "acl" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "acl", admin = true)
|
||||||
public ModelAndView acldelete(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView acldelete(@Valid String id, @Valid String hostid) {
|
||||||
if(!StringUtils.isBlank(id)){
|
if (!StringUtils.isBlank(id)) {
|
||||||
aclRes.delete(id);
|
aclRes.deleteById(id);
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/acl.html?hostid="+hostid));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/acl.html?hostid=" + hostid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,9 @@ import com.chatopera.cc.model.PbxHost;
|
|||||||
import com.chatopera.cc.persistence.interfaces.CallCenterInterface;
|
import com.chatopera.cc.persistence.interfaces.CallCenterInterface;
|
||||||
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
||||||
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;
|
||||||
@ -36,19 +37,21 @@ import java.util.List;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/admin/callcenter")
|
@RequestMapping("/admin/callcenter")
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class CallCenterController extends Handler {
|
public class CallCenterController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private PbxHostRepository pbxHostRes;
|
private final PbxHostRepository pbxHostRes;
|
||||||
|
|
||||||
@RequestMapping(value = "/index")
|
@RequestMapping(value = "/index")
|
||||||
@Menu(type = "callcenter", subtype = "callcenter", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "callcenter", admin = true)
|
||||||
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String msg) {
|
public ModelAndView index(ModelMap map, HttpServletRequest request) {
|
||||||
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
||||||
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
||||||
CallCenterInterface callCenterImpl = (CallCenterInterface) MainContext.getContext().getBean("callcenter");
|
CallCenterInterface callCenterImpl = (CallCenterInterface) MainContext.getContext().getBean("callcenter");
|
||||||
|
|
||||||
for (PbxHost pbxHost : pbxHostList) {
|
for (PbxHost pbxHost : pbxHostList) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
if (callCenterImpl != null) {
|
if (callCenterImpl != null) {
|
||||||
pbxHost.setConnected(callCenterImpl.connected(pbxHost.getId()));
|
pbxHost.setConnected(callCenterImpl.connected(pbxHost.getId()));
|
||||||
}
|
}
|
||||||
@ -59,13 +62,14 @@ public class CallCenterController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/pbxhost")
|
@RequestMapping(value = "/pbxhost")
|
||||||
@Menu(type = "callcenter", subtype = "pbxhost", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "pbxhost", admin = true)
|
||||||
public ModelAndView pbxhost(ModelMap map, HttpServletRequest request) {
|
public ModelAndView pbxhost(ModelMap map, HttpServletRequest request) {
|
||||||
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
||||||
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
||||||
CallCenterInterface callCenterImpl = (CallCenterInterface) MainContext.getContext().getBean("callcenter");
|
CallCenterInterface callCenterImpl = (CallCenterInterface) MainContext.getContext().getBean("callcenter");
|
||||||
|
|
||||||
for (PbxHost pbxHost : pbxHostList) {
|
for (PbxHost pbxHost : pbxHostList) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
if (callCenterImpl != null) {
|
if (callCenterImpl != null) {
|
||||||
pbxHost.setConnected(callCenterImpl.connected(pbxHost.getId()));
|
pbxHost.setConnected(callCenterImpl.connected(pbxHost.getId()));
|
||||||
}
|
}
|
||||||
@ -76,14 +80,14 @@ public class CallCenterController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/pbxhost/add")
|
@RequestMapping(value = "/pbxhost/add")
|
||||||
@Menu(type = "callcenter", subtype = "pbxhost", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "pbxhost", admin = true)
|
||||||
public ModelAndView pbxhostadd(ModelMap map, HttpServletRequest request) {
|
public ModelAndView pbxhostadd() {
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/pbxhost/add"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/pbxhost/add"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/pbxhost/save")
|
@RequestMapping(value = "/pbxhost/save")
|
||||||
@Menu(type = "callcenter", subtype = "pbxhost", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "pbxhost", admin = true)
|
||||||
public ModelAndView pbxhostsave(ModelMap map, HttpServletRequest request, @Valid PbxHost pbxHost) {
|
public ModelAndView pbxhostsave(HttpServletRequest request, @Valid PbxHost pbxHost) {
|
||||||
ModelAndView view = request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/pbxhost.html"));
|
ModelAndView view = request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/pbxhost.html"));
|
||||||
String msg = null;
|
String msg = null;
|
||||||
if (!StringUtils.isBlank(pbxHost.getName())) {
|
if (!StringUtils.isBlank(pbxHost.getName())) {
|
||||||
@ -95,6 +99,7 @@ public class CallCenterController extends Handler {
|
|||||||
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
||||||
CallCenterInterface callCenterImpl = (CallCenterInterface) MainContext.getContext().getBean(
|
CallCenterInterface callCenterImpl = (CallCenterInterface) MainContext.getContext().getBean(
|
||||||
"callcenter");
|
"callcenter");
|
||||||
|
//noinspection ConstantConditions
|
||||||
if (callCenterImpl != null) {
|
if (callCenterImpl != null) {
|
||||||
try {
|
try {
|
||||||
callCenterImpl.init(pbxHost);
|
callCenterImpl.init(pbxHost);
|
||||||
@ -114,15 +119,15 @@ public class CallCenterController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/pbxhost/edit")
|
@RequestMapping(value = "/pbxhost/edit")
|
||||||
@Menu(type = "callcenter", subtype = "pbxhost", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "pbxhost", admin = true)
|
||||||
public ModelAndView pbxhostedit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView pbxhostedit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
map.addAttribute("pbxHost", pbxHostRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("pbxHost", pbxHostRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/pbxhost/edit"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/pbxhost/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/pbxhost/update")
|
@RequestMapping(value = "/pbxhost/update")
|
||||||
@Menu(type = "callcenter", subtype = "pbxhost", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "pbxhost", admin = true)
|
||||||
public ModelAndView pbxhostupdate(ModelMap map, HttpServletRequest request, @Valid PbxHost pbxHost) {
|
public ModelAndView pbxhostupdate(HttpServletRequest request, @Valid PbxHost pbxHost) {
|
||||||
ModelAndView view = request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/pbxhost.html"));
|
ModelAndView view = request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/pbxhost.html"));
|
||||||
String msg = null;
|
String msg = null;
|
||||||
if (!StringUtils.isBlank(pbxHost.getId())) {
|
if (!StringUtils.isBlank(pbxHost.getId())) {
|
||||||
@ -138,6 +143,7 @@ public class CallCenterController extends Handler {
|
|||||||
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
||||||
CallCenterInterface callCenterImpl = (CallCenterInterface) MainContext.getContext().getBean(
|
CallCenterInterface callCenterImpl = (CallCenterInterface) MainContext.getContext().getBean(
|
||||||
"callcenter");
|
"callcenter");
|
||||||
|
//noinspection ConstantConditions
|
||||||
if (callCenterImpl != null) {
|
if (callCenterImpl != null) {
|
||||||
try {
|
try {
|
||||||
callCenterImpl.init(destHost);
|
callCenterImpl.init(destHost);
|
||||||
@ -156,13 +162,14 @@ public class CallCenterController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/pbxhost/delete")
|
@RequestMapping(value = "/pbxhost/delete")
|
||||||
@Menu(type = "callcenter", subtype = "pbxhost", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "pbxhost", admin = true)
|
||||||
public ModelAndView mediadelete(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView mediadelete(@Valid String id) {
|
||||||
if (!StringUtils.isBlank(id)) {
|
if (!StringUtils.isBlank(id)) {
|
||||||
pbxHostRes.delete(id);
|
pbxHostRes.deleteById(id);
|
||||||
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) {
|
||||||
CallCenterInterface callCenterImpl = (CallCenterInterface) MainContext.getContext().getBean(
|
CallCenterInterface callCenterImpl = (CallCenterInterface) MainContext.getContext().getBean(
|
||||||
"callcenter");
|
"callcenter");
|
||||||
|
//noinspection ConstantConditions
|
||||||
if (callCenterImpl != null) {
|
if (callCenterImpl != null) {
|
||||||
callCenterImpl.remove(id);
|
callCenterImpl.remove(id);
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,9 @@ import com.chatopera.cc.persistence.repository.*;
|
|||||||
import com.chatopera.cc.proxy.CallcenterOutboundProxy;
|
import com.chatopera.cc.proxy.CallcenterOutboundProxy;
|
||||||
import com.chatopera.cc.util.Menu;
|
import com.chatopera.cc.util.Menu;
|
||||||
import com.chatopera.cc.util.freeswitch.model.CallCenterAgent;
|
import com.chatopera.cc.util.freeswitch.model.CallCenterAgent;
|
||||||
|
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;
|
||||||
@ -39,39 +40,40 @@ import java.util.List;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/admin/callcenter")
|
@RequestMapping("/admin/callcenter")
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class CallCenterExtentionController extends Handler {
|
public class CallCenterExtentionController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private PbxHostRepository pbxHostRes;
|
private final PbxHostRepository pbxHostRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private ExtentionRepository extentionRes;
|
private final ExtentionRepository extentionRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private SipTrunkRepository sipTrunkRes;
|
private final SipTrunkRepository sipTrunkRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private MediaRepository mediaRes;
|
private final MediaRepository mediaRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private ServiceAiRepository serviceAiRes;
|
private final ServiceAiRepository serviceAiRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private ProductRepository productRes;
|
private final ProductRepository productRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private QueSurveyProcessRepository queSurveyProcessRes;
|
private final QueSurveyProcessRepository queSurveyProcessRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private Cache cache;
|
private final Cache cache;
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = "/extention")
|
@RequestMapping(value = "/extention")
|
||||||
@Menu(type = "callcenter", subtype = "callcenterresource", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "callcenterresource", admin = true)
|
||||||
public ModelAndView extention(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
public ModelAndView extention(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
||||||
map.addAttribute("pbxHostList", pbxHostList);
|
map.addAttribute("pbxHostList", pbxHostList);
|
||||||
PbxHost pbxHost = null;
|
PbxHost pbxHost;
|
||||||
if (pbxHostList.size() > 0) {
|
if (pbxHostList.size() > 0) {
|
||||||
map.addAttribute("pbxHost", pbxHost = getPbxHost(pbxHostList, hostid));
|
map.addAttribute("pbxHost", pbxHost = getPbxHost(pbxHostList, hostid));
|
||||||
map.addAttribute("extentionList", extentionRes.findByHostidAndOrgi(pbxHost.getId(), super.getOrgi(request)));
|
map.addAttribute("extentionList", extentionRes.findByHostidAndOrgi(pbxHost.getId(), super.getOrgi(request)));
|
||||||
@ -93,7 +95,7 @@ public class CallCenterExtentionController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/extention/add")
|
@RequestMapping(value = "/extention/add")
|
||||||
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "extention", admin = true)
|
||||||
public ModelAndView extentionadd(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
public ModelAndView extentionadd(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
|
|
||||||
@ -104,11 +106,10 @@ public class CallCenterExtentionController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/extention/save")
|
@RequestMapping(value = "/extention/save")
|
||||||
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "extention", admin = true)
|
||||||
public ModelAndView extentionsave(ModelMap map, HttpServletRequest request, @Valid Extention extention) {
|
public ModelAndView extentionsave(HttpServletRequest request, @Valid Extention extention) {
|
||||||
if (StringUtils.isNotBlank(extention.getExtention()) && StringUtils.isNotBlank(extention.getPassword())) {
|
if (StringUtils.isNotBlank(extention.getExtention()) && StringUtils.isNotBlank(extention.getPassword())) {
|
||||||
String[] extstr = extention.getExtention().split("[,, ]");
|
String[] extstr = extention.getExtention().split("[,, ]");
|
||||||
int extnum = 0;
|
|
||||||
for (String ext : extstr) {
|
for (String ext : extstr) {
|
||||||
if (ext.matches("[\\d]{3,8}")) { //分机号码最少3位数字
|
if (ext.matches("[\\d]{3,8}")) { //分机号码最少3位数字
|
||||||
createNewExtention(ext, super.getUser(request), extention.getHostid(), extention.getPassword(), super.getOrgi(request), extention);
|
createNewExtention(ext, super.getUser(request), extention.getHostid(), extention.getPassword(), super.getOrgi(request), extention);
|
||||||
@ -118,7 +119,7 @@ public class CallCenterExtentionController extends Handler {
|
|||||||
int start = Integer.parseInt(ph[0]);
|
int start = Integer.parseInt(ph[0]);
|
||||||
int end = Integer.parseInt(ph[1]);
|
int end = Integer.parseInt(ph[1]);
|
||||||
|
|
||||||
for (int i = start; i <= end && extnum < 100; i++) { //最大一次批量生产的 分机号不超过100个
|
for (int i = start; i <= end; i++) { //最大一次批量生产的 分机号不超过100个
|
||||||
createNewExtention(String.valueOf(i), super.getUser(request), extention.getHostid(), extention.getPassword(), super.getOrgi(request), extention);
|
createNewExtention(String.valueOf(i), super.getUser(request), extention.getHostid(), extention.getPassword(), super.getOrgi(request), extention);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,7 +129,7 @@ public class CallCenterExtentionController extends Handler {
|
|||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/extention.html?hostid=" + extention.getHostid()));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/extention.html?hostid=" + extention.getHostid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Extention createNewExtention(String num, User user, String hostid, String password, String orgi, Extention src) {
|
private void createNewExtention(String num, User user, String hostid, String password, String orgi, Extention src) {
|
||||||
Extention extno = new Extention();
|
Extention extno = new Extention();
|
||||||
extno.setExtention(num);
|
extno.setExtention(num);
|
||||||
extno.setOrgi(orgi);
|
extno.setOrgi(orgi);
|
||||||
@ -148,11 +149,10 @@ public class CallCenterExtentionController extends Handler {
|
|||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
extentionRes.save(extno);
|
extentionRes.save(extno);
|
||||||
}
|
}
|
||||||
return extno;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/extention/edit")
|
@RequestMapping(value = "/extention/edit")
|
||||||
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "extention", admin = true)
|
||||||
public ModelAndView extentionedit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
public ModelAndView extentionedit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
||||||
map.addAttribute("extention", extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("extention", extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
@ -163,8 +163,8 @@ public class CallCenterExtentionController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/extention/update")
|
@RequestMapping(value = "/extention/update")
|
||||||
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "extention", admin = true)
|
||||||
public ModelAndView extentionupdate(ModelMap map, HttpServletRequest request, @Valid Extention extention) {
|
public ModelAndView extentionupdate(HttpServletRequest request, @Valid Extention extention) {
|
||||||
if (StringUtils.isNotBlank(extention.getId())) {
|
if (StringUtils.isNotBlank(extention.getId())) {
|
||||||
Extention ext = extentionRes.findByIdAndOrgi(extention.getId(), super.getOrgi(request));
|
Extention ext = extentionRes.findByIdAndOrgi(extention.getId(), super.getOrgi(request));
|
||||||
if (ext != null) {
|
if (ext != null) {
|
||||||
@ -198,7 +198,7 @@ public class CallCenterExtentionController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/extention/ivr")
|
@RequestMapping(value = "/extention/ivr")
|
||||||
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "extention", admin = true)
|
||||||
public ModelAndView ivr(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
public ModelAndView ivr(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
||||||
map.addAttribute("extention", extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("extention", extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
@ -213,8 +213,8 @@ public class CallCenterExtentionController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/extention/ivr/update")
|
@RequestMapping(value = "/extention/ivr/update")
|
||||||
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "extention", admin = true)
|
||||||
public ModelAndView ivrupdate(ModelMap map, HttpServletRequest request, @Valid Extention extention) {
|
public ModelAndView ivrupdate(HttpServletRequest request, @Valid Extention extention) {
|
||||||
if (StringUtils.isNotBlank(extention.getId())) {
|
if (StringUtils.isNotBlank(extention.getId())) {
|
||||||
Extention ext = extentionRes.findByIdAndOrgi(extention.getId(), super.getOrgi(request));
|
Extention ext = extentionRes.findByIdAndOrgi(extention.getId(), super.getOrgi(request));
|
||||||
if (ext != null) {
|
if (ext != null) {
|
||||||
@ -238,10 +238,10 @@ public class CallCenterExtentionController extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/extention/delete")
|
@RequestMapping(value = "/extention/delete")
|
||||||
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "extention", admin = true)
|
||||||
public ModelAndView extentiondelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
public ModelAndView extentiondelete(@Valid String id, @Valid String hostid) {
|
||||||
if (StringUtils.isNotBlank(id)) {
|
if (StringUtils.isNotBlank(id)) {
|
||||||
extentionRes.delete(id);
|
extentionRes.deleteById(id);
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/extention.html?hostid=" + hostid));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/extention.html?hostid=" + hostid));
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,9 @@ import com.chatopera.cc.persistence.repository.ExtentionRepository;
|
|||||||
import com.chatopera.cc.persistence.repository.IvrMenuRepository;
|
import com.chatopera.cc.persistence.repository.IvrMenuRepository;
|
||||||
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
||||||
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;
|
||||||
@ -34,73 +35,74 @@ import javax.validation.Valid;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/admin/callcenter")
|
@RequestMapping("/admin/callcenter")
|
||||||
public class CallCenterIvrController extends Handler{
|
@RequiredArgsConstructor
|
||||||
|
public class CallCenterIvrController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private PbxHostRepository pbxHostRes ;
|
private final PbxHostRepository pbxHostRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private ExtentionRepository extentionRes ;
|
private final ExtentionRepository extentionRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private IvrMenuRepository ivrMenuRes;
|
private final IvrMenuRepository ivrMenuRes;
|
||||||
|
|
||||||
@RequestMapping(value = "/ivr")
|
@RequestMapping(value = "/ivr")
|
||||||
@Menu(type = "callcenter" , subtype = "callcenterivr" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "callcenterivr", admin = true)
|
||||||
public ModelAndView ivr(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView ivr(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
if(!StringUtils.isBlank(hostid)){
|
if (!StringUtils.isBlank(hostid)) {
|
||||||
map.addAttribute("pbxHost" , pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
map.addAttribute("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
map.addAttribute("ivrList" , extentionRes.findByExtypeAndOrgi("ivr", super.getOrgi(request)));
|
map.addAttribute("ivrList", extentionRes.findByExtypeAndOrgi("ivr", super.getOrgi(request)));
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/ivr/index"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/ivr/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/ivr/edit")
|
@RequestMapping(value = "/ivr/edit")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", admin = true)
|
||||||
public ModelAndView extentionedit(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView extentionedit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
||||||
map.addAttribute("extention" , extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("extention", extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/ivr/edit"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/ivr/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/ivr/update")
|
@RequestMapping(value = "/ivr/update")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", admin = true)
|
||||||
public ModelAndView extentionupdate(ModelMap map , HttpServletRequest request , @Valid Extention extention) {
|
public ModelAndView extentionupdate(HttpServletRequest request, @Valid Extention extention) {
|
||||||
if(!StringUtils.isBlank(extention.getId())){
|
if (!StringUtils.isBlank(extention.getId())) {
|
||||||
Extention ext = extentionRes.findByIdAndOrgi(extention.getId(), super.getOrgi(request)) ;
|
Extention ext = extentionRes.findByIdAndOrgi(extention.getId(), super.getOrgi(request));
|
||||||
ext.setExtention(extention.getExtention());
|
ext.setExtention(extention.getExtention());
|
||||||
ext.setDescription(extention.getDescription());
|
ext.setDescription(extention.getDescription());
|
||||||
extentionRes.save(ext) ;
|
extentionRes.save(ext);
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/ivr.html?hostid="+extention.getHostid()));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/ivr.html?hostid=" + extention.getHostid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = "/ivr/delete")
|
@RequestMapping(value = "/ivr/delete")
|
||||||
@Menu(type = "callcenter" , subtype = "ivr" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "ivr", access = false, admin = true)
|
||||||
public ModelAndView extentiondelete(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView extentiondelete(@Valid String id, @Valid String hostid) {
|
||||||
if(!StringUtils.isBlank(id)){
|
if (!StringUtils.isBlank(id)) {
|
||||||
extentionRes.delete(id);
|
extentionRes.deleteById(id);
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/ivr.html?hostid="+hostid));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/ivr.html?hostid=" + hostid));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/ivr/design")
|
@RequestMapping(value = "/ivr/design")
|
||||||
@Menu(type = "callcenter" , subtype = "callcenterivr" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "callcenterivr", admin = true)
|
||||||
public ModelAndView design(ModelMap map , HttpServletRequest request , @Valid String hostid , @Valid String id) {
|
public ModelAndView design(ModelMap map, HttpServletRequest request, @Valid String hostid, @Valid String id) {
|
||||||
if(!StringUtils.isBlank(hostid)){
|
if (!StringUtils.isBlank(hostid)) {
|
||||||
map.addAttribute("extention" , extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("extention", extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
map.addAttribute("ivrMenuList" , ivrMenuRes.findByExtentionidAndHostidAndOrgi(id, hostid, super.getOrgi(request)));
|
map.addAttribute("ivrMenuList", ivrMenuRes.findByExtentionidAndHostidAndOrgi(id, hostid, super.getOrgi(request)));
|
||||||
map.addAttribute("pbxHost" , pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
map.addAttribute("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/ivr/design"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/ivr/design"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/ivr/menu/add")
|
@RequestMapping(value = "/ivr/menu/add")
|
||||||
@Menu(type = "callcenter" , subtype = "callcenterivr" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "callcenterivr", admin = true)
|
||||||
public ModelAndView ivrmenuadd(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid , @Valid String parentid) {
|
public ModelAndView ivrmenuadd(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
||||||
map.addAttribute("extention" , extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("extention", extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/ivr/menuadd"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/ivr/menuadd"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,10 @@ import com.chatopera.cc.model.Media;
|
|||||||
import com.chatopera.cc.persistence.repository.MediaRepository;
|
import com.chatopera.cc.persistence.repository.MediaRepository;
|
||||||
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
||||||
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.beans.factory.annotation.Value;
|
||||||
|
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.util.FileCopyUtils;
|
import org.springframework.util.FileCopyUtils;
|
||||||
@ -37,47 +38,50 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/admin/callcenter")
|
@RequestMapping("/admin/callcenter")
|
||||||
public class CallCenterMediaController extends Handler{
|
@RequiredArgsConstructor
|
||||||
|
public class CallCenterMediaController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private PbxHostRepository pbxHostRes ;
|
private final PbxHostRepository pbxHostRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private MediaRepository mediaRes ;
|
private final MediaRepository mediaRes;
|
||||||
|
|
||||||
@Value("${web.upload-path}")
|
@Value("${web.upload-path}")
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
@RequestMapping(value = "/media")
|
@RequestMapping(value = "/media")
|
||||||
@Menu(type = "callcenter" , subtype = "callcentermedia" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "callcentermedia", access = false, admin = true)
|
||||||
public ModelAndView media(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView media(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
if(!StringUtils.isBlank(hostid)){
|
if (!StringUtils.isBlank(hostid)) {
|
||||||
map.addAttribute("pbxHost" , pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
map.addAttribute("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
map.addAttribute("mediaList" , mediaRes.findByHostidAndOrgi(hostid, super.getOrgi(request)));
|
map.addAttribute("mediaList", mediaRes.findByHostidAndOrgi(hostid, super.getOrgi(request)));
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/media/index"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/media/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/media/add")
|
@RequestMapping(value = "/media/add")
|
||||||
@Menu(type = "callcenter" , subtype = "media" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "media", access = false, admin = true)
|
||||||
public ModelAndView mediaadd(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView mediaadd(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/media/add"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/media/add"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/media/save")
|
@RequestMapping(value = "/media/save")
|
||||||
@Menu(type = "callcenter" , subtype = "media" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "media", access = false, admin = true)
|
||||||
public ModelAndView mediasave(ModelMap map , HttpServletRequest request , @RequestParam(value = "mediafile", required = false) MultipartFile mediafile) throws IOException {
|
public ModelAndView mediasave(HttpServletRequest request, @RequestParam(value = "mediafile", required = false) MultipartFile mediafile) throws IOException {
|
||||||
Media media = new Media();
|
Media media = new Media();
|
||||||
media.setName(request.getParameter("name"));
|
media.setName(request.getParameter("name"));
|
||||||
media.setHostid(request.getParameter("hostid"));
|
media.setHostid(request.getParameter("hostid"));
|
||||||
if(!StringUtils.isBlank(media.getName())){
|
if (!StringUtils.isBlank(media.getName())) {
|
||||||
int count = mediaRes.countByNameAndOrgi(media.getName(), super.getOrgi(request)) ;
|
int count = mediaRes.countByNameAndOrgi(media.getName(), super.getOrgi(request));
|
||||||
if(count == 0){
|
if (count == 0) {
|
||||||
String fileName = "media/"+ MainUtils.getUUID()+mediafile.getOriginalFilename().substring(mediafile.getOriginalFilename().lastIndexOf(".")) ;
|
String fileName = "media/" + MainUtils.getUUID() + Objects.requireNonNull(mediafile.getOriginalFilename())
|
||||||
|
.substring(mediafile.getOriginalFilename().lastIndexOf("."));
|
||||||
|
|
||||||
media.setOrgi(super.getOrgi(request));
|
media.setOrgi(super.getOrgi(request));
|
||||||
media.setCreater(super.getUser(request).getId());
|
media.setCreater(super.getUser(request).getId());
|
||||||
@ -85,74 +89,78 @@ public class CallCenterMediaController extends Handler{
|
|||||||
media.setContent(mediafile.getContentType());
|
media.setContent(mediafile.getContentType());
|
||||||
media.setFilename(fileName);
|
media.setFilename(fileName);
|
||||||
|
|
||||||
if(mediafile!=null && mediafile.getOriginalFilename().lastIndexOf(".") > 0){
|
if (mediafile.getOriginalFilename().lastIndexOf(".") > 0) {
|
||||||
File logoDir = new File(path , "media");
|
File logoDir = new File(path, "media");
|
||||||
if(!logoDir.exists()){
|
if (!logoDir.exists()) {
|
||||||
logoDir.mkdirs() ;
|
//noinspection ResultOfMethodCallIgnored
|
||||||
|
logoDir.mkdirs();
|
||||||
}
|
}
|
||||||
FileCopyUtils.copy(mediafile.getBytes(), new File(path , fileName));
|
FileCopyUtils.copy(mediafile.getBytes(), new File(path, fileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
mediaRes.save(media) ;
|
mediaRes.save(media);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/media.html?hostid="+media.getHostid()));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/media.html?hostid=" + media.getHostid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/media/edit")
|
@RequestMapping(value = "/media/edit")
|
||||||
@Menu(type = "callcenter" , subtype = "media" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "media", access = false, admin = true)
|
||||||
public ModelAndView mediaedit(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView mediaedit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
||||||
map.addAttribute("media" , mediaRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("media", mediaRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/media/edit"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/media/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/media/update")
|
@RequestMapping(value = "/media/update")
|
||||||
@Menu(type = "callcenter" , subtype = "media" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "media", access = false, admin = true)
|
||||||
public ModelAndView pbxhostupdate(ModelMap map , HttpServletRequest request , @RequestParam(value = "mediafile", required = false) MultipartFile mediafile) throws IOException {
|
public ModelAndView pbxhostupdate(HttpServletRequest request, @RequestParam(value = "mediafile", required = false) MultipartFile mediafile) throws IOException {
|
||||||
Media media = new Media();
|
Media media = new Media();
|
||||||
media.setName(request.getParameter("name"));
|
media.setName(request.getParameter("name"));
|
||||||
media.setHostid(request.getParameter("hostid"));
|
media.setHostid(request.getParameter("hostid"));
|
||||||
media.setId(request.getParameter("id"));
|
media.setId(request.getParameter("id"));
|
||||||
if(!StringUtils.isBlank(media.getId())){
|
if (!StringUtils.isBlank(media.getId())) {
|
||||||
Media oldMedia = mediaRes.findByIdAndOrgi(media.getId(), super.getOrgi(request)) ;
|
Media oldMedia = mediaRes.findByIdAndOrgi(media.getId(), super.getOrgi(request));
|
||||||
if(oldMedia!=null){
|
if (oldMedia != null) {
|
||||||
if(mediafile!=null && mediafile.getSize() > 0){
|
if (mediafile != null && mediafile.getSize() > 0) {
|
||||||
File wavFile = new File(path , oldMedia.getFilename());
|
File wavFile = new File(path, oldMedia.getFilename());
|
||||||
if(!wavFile.exists()){
|
if (!wavFile.exists()) {
|
||||||
wavFile.deleteOnExit();
|
wavFile.deleteOnExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
String fileName = "media/"+ MainUtils.getUUID()+mediafile.getOriginalFilename().substring(mediafile.getOriginalFilename().lastIndexOf(".")) ;
|
String fileName = "media/" + MainUtils.getUUID() + Objects.requireNonNull(mediafile.getOriginalFilename())
|
||||||
|
.substring(mediafile.getOriginalFilename().lastIndexOf("."));
|
||||||
oldMedia.setFilename(fileName);
|
oldMedia.setFilename(fileName);
|
||||||
|
|
||||||
if(mediafile!=null && mediafile.getOriginalFilename().lastIndexOf(".") > 0){
|
if (mediafile.getOriginalFilename().lastIndexOf(".") > 0) {
|
||||||
File mediaDir = new File(path , "media");
|
File mediaDir = new File(path, "media");
|
||||||
if(!mediaDir.exists()){
|
if (!mediaDir.exists()) {
|
||||||
mediaDir.mkdirs() ;
|
//noinspection ResultOfMethodCallIgnored
|
||||||
|
mediaDir.mkdirs();
|
||||||
}
|
}
|
||||||
FileCopyUtils.copy(mediafile.getBytes(), new File(path , fileName));
|
FileCopyUtils.copy(mediafile.getBytes(), new File(path, fileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
oldMedia.setName(media.getName());
|
oldMedia.setName(media.getName());
|
||||||
mediaRes.save(oldMedia);
|
mediaRes.save(oldMedia);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/media.html?hostid="+media.getHostid()));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/media.html?hostid=" + media.getHostid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/media/delete")
|
@RequestMapping(value = "/media/delete")
|
||||||
@Menu(type = "callcenter" , subtype = "media" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "media", access = false, admin = true)
|
||||||
public ModelAndView mediadelete(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView mediadelete(@Valid String id, @Valid String hostid) {
|
||||||
if(!StringUtils.isBlank(id)){
|
if (!StringUtils.isBlank(id)) {
|
||||||
mediaRes.delete(id);
|
mediaRes.deleteById(id);
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/media.html?hostid="+hostid));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/media.html?hostid=" + hostid));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/play")
|
@RequestMapping(value = "/play")
|
||||||
@Menu(type = "callcenter" , subtype = "play" , access = false)
|
@Menu(type = "callcenter", subtype = "play", access = false)
|
||||||
public ModelAndView play(ModelMap map , HttpServletRequest request ,@Valid final String id ,@Valid final String hostid) {
|
public ModelAndView play(ModelMap map, HttpServletRequest request, @Valid final String id) {
|
||||||
map.addAttribute("media", mediaRes.findByIdAndOrgi(id, super.getOrgi(request))) ;
|
map.addAttribute("media", mediaRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/media/play"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/media/play"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,9 @@ import com.chatopera.cc.persistence.repository.ExtentionRepository;
|
|||||||
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
||||||
import com.chatopera.cc.persistence.repository.ServiceAiRepository;
|
import com.chatopera.cc.persistence.repository.ServiceAiRepository;
|
||||||
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;
|
||||||
@ -38,16 +39,17 @@ import java.util.List;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/admin/callcenter")
|
@RequestMapping("/admin/callcenter")
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class CallCenterResourceController extends Handler {
|
public class CallCenterResourceController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private PbxHostRepository pbxHostRes;
|
private final PbxHostRepository pbxHostRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private ExtentionRepository extentionRes;
|
private final ExtentionRepository extentionRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private ServiceAiRepository serviceAiRes;
|
private final ServiceAiRepository serviceAiRes;
|
||||||
|
|
||||||
@RequestMapping(value = "/resource")
|
@RequestMapping(value = "/resource")
|
||||||
@Menu(type = "callcenter", subtype = "callcenter", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "callcenter", access = false, admin = true)
|
||||||
@ -57,7 +59,7 @@ public class CallCenterResourceController extends Handler {
|
|||||||
|
|
||||||
map.put("serviceAiList", serviceAiRes.findByOrgi(super.getOrgi(request)));
|
map.put("serviceAiList", serviceAiRes.findByOrgi(super.getOrgi(request)));
|
||||||
|
|
||||||
PbxHost pbxHost = null;
|
PbxHost pbxHost;
|
||||||
if (pbxHostList.size() > 0) {
|
if (pbxHostList.size() > 0) {
|
||||||
map.addAttribute("pbxHost", pbxHost = getPbxHost(pbxHostList, hostid));
|
map.addAttribute("pbxHost", pbxHost = getPbxHost(pbxHostList, hostid));
|
||||||
map.addAttribute("extentionList",
|
map.addAttribute("extentionList",
|
||||||
@ -71,7 +73,7 @@ public class CallCenterResourceController extends Handler {
|
|||||||
public ModelAndView config(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
public ModelAndView config(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
||||||
map.addAttribute("pbxHostList", pbxHostList);
|
map.addAttribute("pbxHostList", pbxHostList);
|
||||||
PbxHost pbxHost = null;
|
PbxHost pbxHost;
|
||||||
if (pbxHostList.size() > 0) {
|
if (pbxHostList.size() > 0) {
|
||||||
map.addAttribute("pbxHost", pbxHost = getPbxHost(pbxHostList, hostid));
|
map.addAttribute("pbxHost", pbxHost = getPbxHost(pbxHostList, hostid));
|
||||||
map.addAttribute("extentionList",
|
map.addAttribute("extentionList",
|
||||||
@ -82,7 +84,7 @@ public class CallCenterResourceController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping(value = "/resource/save")
|
@RequestMapping(value = "/resource/save")
|
||||||
@Menu(type = "callcenter", subtype = "callcenter", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "callcenter", access = false, admin = true)
|
||||||
public ModelAndView save(ModelMap map, HttpServletRequest request, @Valid PbxHost pbxHost) throws Exception {
|
public ModelAndView save(HttpServletRequest request, @Valid PbxHost pbxHost) throws Exception {
|
||||||
PbxHost tempPbxHost = pbxHostRes.findByIdAndOrgi(pbxHost.getId(), super.getOrgi(request));
|
PbxHost tempPbxHost = pbxHostRes.findByIdAndOrgi(pbxHost.getId(), super.getOrgi(request));
|
||||||
if (tempPbxHost != null) {
|
if (tempPbxHost != null) {
|
||||||
pbxHost.setCreater(tempPbxHost.getCreater());
|
pbxHost.setCreater(tempPbxHost.getCreater());
|
||||||
@ -108,7 +110,7 @@ public class CallCenterResourceController extends Handler {
|
|||||||
public ModelAndView resourcepbx(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
public ModelAndView resourcepbx(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
||||||
map.addAttribute("pbxHostList", pbxHostList);
|
map.addAttribute("pbxHostList", pbxHostList);
|
||||||
PbxHost pbxHost = null;
|
PbxHost pbxHost;
|
||||||
if (pbxHostList.size() > 0) {
|
if (pbxHostList.size() > 0) {
|
||||||
map.addAttribute("pbxHost", pbxHost = getPbxHost(pbxHostList, hostid));
|
map.addAttribute("pbxHost", pbxHost = getPbxHost(pbxHostList, hostid));
|
||||||
map.addAttribute("extentionList",
|
map.addAttribute("extentionList",
|
||||||
|
@ -22,8 +22,9 @@ import com.chatopera.cc.model.RouterRules;
|
|||||||
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
||||||
import com.chatopera.cc.persistence.repository.RouterRulesRepository;
|
import com.chatopera.cc.persistence.repository.RouterRulesRepository;
|
||||||
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;
|
||||||
@ -35,63 +36,63 @@ import java.util.List;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/admin/callcenter")
|
@RequestMapping("/admin/callcenter")
|
||||||
public class CallCenterRouterController extends Handler{
|
@RequiredArgsConstructor
|
||||||
|
public class CallCenterRouterController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private PbxHostRepository pbxHostRes ;
|
private final PbxHostRepository pbxHostRes;
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Autowired
|
private final RouterRulesRepository routerRulesRes;
|
||||||
private RouterRulesRepository routerRulesRes ;
|
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = "/router")
|
@RequestMapping(value = "/router")
|
||||||
@Menu(type = "callcenter" , subtype = "callcenterresource" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "callcenterresource", access = false, admin = true)
|
||||||
public ModelAndView skill(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView skill(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request)) ;
|
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
||||||
map.addAttribute("pbxHostList" , pbxHostList);
|
map.addAttribute("pbxHostList", pbxHostList);
|
||||||
if(pbxHostList.size() > 0){
|
if (pbxHostList.size() > 0) {
|
||||||
map.addAttribute("pbxHost" , pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
map.addAttribute("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
map.addAttribute("routerRulesList" , routerRulesRes.findByHostidAndOrgi(hostid, super.getOrgi(request)));
|
map.addAttribute("routerRulesList", routerRulesRes.findByHostidAndOrgi(hostid, super.getOrgi(request)));
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/peer/index"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/peer/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/router/add")
|
@RequestMapping(value = "/router/add")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView extentionadd(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView extentionadd(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/peer/add"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/peer/add"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/router/save")
|
@RequestMapping(value = "/router/save")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView extentionsave(ModelMap map , HttpServletRequest request , @Valid RouterRules router) {
|
public ModelAndView extentionsave(HttpServletRequest request, @Valid RouterRules router) {
|
||||||
if(!StringUtils.isBlank(router.getName())){
|
if (!StringUtils.isBlank(router.getName())) {
|
||||||
int count = routerRulesRes.countByNameAndOrgi(router.getName(), super.getOrgi(request)) ;
|
int count = routerRulesRes.countByNameAndOrgi(router.getName(), super.getOrgi(request));
|
||||||
if(count == 0){
|
if (count == 0) {
|
||||||
router.setOrgi(super.getOrgi(request));
|
router.setOrgi(super.getOrgi(request));
|
||||||
router.setCreater(super.getUser(request).getId());
|
router.setCreater(super.getUser(request).getId());
|
||||||
routerRulesRes.save(router) ;
|
routerRulesRes.save(router);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/peer.html?hostid="+router.getHostid()));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/peer.html?hostid=" + router.getHostid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/router/edit")
|
@RequestMapping(value = "/router/edit")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView routeredit(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView routeredit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
||||||
map.addAttribute("routerRules" , routerRulesRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("routerRules", routerRulesRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/peer/edit"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/peer/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/router/update")
|
@RequestMapping(value = "/router/update")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView pbxhostupdate(ModelMap map , HttpServletRequest request , @Valid RouterRules router) {
|
public ModelAndView pbxhostupdate(HttpServletRequest request, @Valid RouterRules router) {
|
||||||
if(!StringUtils.isBlank(router.getId())){
|
if (!StringUtils.isBlank(router.getId())) {
|
||||||
RouterRules oldRouter = routerRulesRes.findByIdAndOrgi(router.getId(), super.getOrgi(request)) ;
|
RouterRules oldRouter = routerRulesRes.findByIdAndOrgi(router.getId(), super.getOrgi(request));
|
||||||
if(oldRouter!=null){
|
if (oldRouter != null) {
|
||||||
oldRouter.setName(router.getName());
|
oldRouter.setName(router.getName());
|
||||||
oldRouter.setField(router.getField());
|
oldRouter.setField(router.getField());
|
||||||
oldRouter.setRegex(router.getRegex());
|
oldRouter.setRegex(router.getRegex());
|
||||||
@ -100,36 +101,36 @@ public class CallCenterRouterController extends Handler{
|
|||||||
routerRulesRes.save(oldRouter);
|
routerRulesRes.save(oldRouter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/peer.html?hostid="+router.getHostid()));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/peer.html?hostid=" + router.getHostid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/router/code")
|
@RequestMapping(value = "/router/code")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView routercode(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView routercode(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
||||||
map.addAttribute("routerRules" , routerRulesRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("routerRules", routerRulesRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/peer/code"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/peer/code"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/router/code/update")
|
@RequestMapping(value = "/router/code/update")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView routercodeupdate(ModelMap map , HttpServletRequest request , @Valid RouterRules router) {
|
public ModelAndView routercodeupdate(HttpServletRequest request, @Valid RouterRules router) {
|
||||||
if(!StringUtils.isBlank(router.getId())){
|
if (!StringUtils.isBlank(router.getId())) {
|
||||||
RouterRules oldRouter = routerRulesRes.findByIdAndOrgi(router.getId(), super.getOrgi(request)) ;
|
RouterRules oldRouter = routerRulesRes.findByIdAndOrgi(router.getId(), super.getOrgi(request));
|
||||||
if(!StringUtils.isBlank(router.getRoutercontent())){
|
if (!StringUtils.isBlank(router.getRoutercontent())) {
|
||||||
oldRouter.setRoutercontent(router.getRoutercontent());
|
oldRouter.setRoutercontent(router.getRoutercontent());
|
||||||
routerRulesRes.save(oldRouter);
|
routerRulesRes.save(oldRouter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/peer.html?hostid="+router.getHostid()));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/peer.html?hostid=" + router.getHostid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/router/delete")
|
@RequestMapping(value = "/router/delete")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView extentiondelete(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView extentiondelete(@Valid String id, @Valid String hostid) {
|
||||||
if(!StringUtils.isBlank(id)){
|
if (!StringUtils.isBlank(id)) {
|
||||||
routerRulesRes.delete(id);
|
routerRulesRes.deleteById(id);
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/peer.html?hostid="+hostid));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/peer.html?hostid=" + hostid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,9 @@ import com.chatopera.cc.model.SipTrunk;
|
|||||||
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
||||||
import com.chatopera.cc.persistence.repository.SipTrunkRepository;
|
import com.chatopera.cc.persistence.repository.SipTrunkRepository;
|
||||||
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;
|
||||||
@ -34,16 +35,17 @@ import javax.validation.Valid;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/admin/callcenter")
|
@RequestMapping("/admin/callcenter")
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class CallCenterSipTrunkController extends Handler {
|
public class CallCenterSipTrunkController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private PbxHostRepository pbxHostRes;
|
private final PbxHostRepository pbxHostRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private SipTrunkRepository sipTrunkRes;
|
private final SipTrunkRepository sipTrunkRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private Cache cache;
|
private final Cache cache;
|
||||||
|
|
||||||
@RequestMapping(value = "/siptrunk")
|
@RequestMapping(value = "/siptrunk")
|
||||||
@Menu(type = "callcenter", subtype = "callcenterresource", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "callcenterresource", access = false, admin = true)
|
||||||
@ -64,7 +66,7 @@ public class CallCenterSipTrunkController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping(value = "/siptrunk/save")
|
@RequestMapping(value = "/siptrunk/save")
|
||||||
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView extentionsave(ModelMap map, HttpServletRequest request, @Valid SipTrunk siptrunk) {
|
public ModelAndView extentionsave(HttpServletRequest request, @Valid SipTrunk siptrunk) {
|
||||||
if (!StringUtils.isBlank(siptrunk.getName())) {
|
if (!StringUtils.isBlank(siptrunk.getName())) {
|
||||||
int count = sipTrunkRes.countByNameAndOrgi(siptrunk.getName(), super.getOrgi(request));
|
int count = sipTrunkRes.countByNameAndOrgi(siptrunk.getName(), super.getOrgi(request));
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
@ -88,7 +90,7 @@ public class CallCenterSipTrunkController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping(value = "/siptrunk/update")
|
@RequestMapping(value = "/siptrunk/update")
|
||||||
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView pbxhostupdate(ModelMap map, HttpServletRequest request, @Valid SipTrunk siptrunk) {
|
public ModelAndView pbxhostupdate(HttpServletRequest request, @Valid SipTrunk siptrunk) {
|
||||||
if (!StringUtils.isBlank(siptrunk.getId())) {
|
if (!StringUtils.isBlank(siptrunk.getId())) {
|
||||||
SipTrunk oldSipTrunk = sipTrunkRes.findByIdAndOrgi(siptrunk.getId(), super.getOrgi(request));
|
SipTrunk oldSipTrunk = sipTrunkRes.findByIdAndOrgi(siptrunk.getId(), super.getOrgi(request));
|
||||||
if (oldSipTrunk != null) {
|
if (oldSipTrunk != null) {
|
||||||
@ -129,7 +131,7 @@ public class CallCenterSipTrunkController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping(value = "/siptrunk/code/update")
|
@RequestMapping(value = "/siptrunk/code/update")
|
||||||
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView siptrunkcodeupdate(ModelMap map, HttpServletRequest request, @Valid SipTrunk siptrunk) {
|
public ModelAndView siptrunkcodeupdate(HttpServletRequest request, @Valid SipTrunk siptrunk) {
|
||||||
if (!StringUtils.isBlank(siptrunk.getId())) {
|
if (!StringUtils.isBlank(siptrunk.getId())) {
|
||||||
SipTrunk oldSipTrunk = sipTrunkRes.findByIdAndOrgi(siptrunk.getId(), super.getOrgi(request));
|
SipTrunk oldSipTrunk = sipTrunkRes.findByIdAndOrgi(siptrunk.getId(), super.getOrgi(request));
|
||||||
if (!StringUtils.isBlank(siptrunk.getSipcontent())) {
|
if (!StringUtils.isBlank(siptrunk.getSipcontent())) {
|
||||||
@ -143,9 +145,9 @@ public class CallCenterSipTrunkController extends Handler {
|
|||||||
|
|
||||||
@RequestMapping(value = "/siptrunk/delete")
|
@RequestMapping(value = "/siptrunk/delete")
|
||||||
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView extentiondelete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
public ModelAndView extentiondelete(@Valid String id, @Valid String hostid) {
|
||||||
if (!StringUtils.isBlank(id)) {
|
if (!StringUtils.isBlank(id)) {
|
||||||
sipTrunkRes.delete(id);
|
sipTrunkRes.deleteById(id);
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/siptrunk.html?hostid=" + hostid));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/siptrunk.html?hostid=" + hostid));
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,8 @@ import com.chatopera.cc.persistence.repository.ExtentionRepository;
|
|||||||
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
import com.chatopera.cc.persistence.repository.PbxHostRepository;
|
||||||
import com.chatopera.cc.persistence.repository.SkillExtentionRepository;
|
import com.chatopera.cc.persistence.repository.SkillExtentionRepository;
|
||||||
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.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;
|
||||||
@ -40,128 +40,130 @@ import java.util.List;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/admin/callcenter")
|
@RequestMapping("/admin/callcenter")
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class CallCenterSkillController extends Handler {
|
public class CallCenterSkillController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@org.springframework.lang.NonNull
|
||||||
private PbxHostRepository pbxHostRes ;
|
private final PbxHostRepository pbxHostRes;
|
||||||
|
|
||||||
@Autowired
|
@org.springframework.lang.NonNull
|
||||||
private ExtentionRepository extentionRes;
|
private final ExtentionRepository extentionRes;
|
||||||
|
|
||||||
@Autowired
|
@org.springframework.lang.NonNull
|
||||||
private CallCenterSkillRepository skillRes ;
|
private final CallCenterSkillRepository skillRes;
|
||||||
|
|
||||||
@Autowired
|
@org.springframework.lang.NonNull
|
||||||
private SkillExtentionRepository skillExtentionRes;
|
private final SkillExtentionRepository skillExtentionRes;
|
||||||
|
|
||||||
@RequestMapping(value = "/skill")
|
@RequestMapping(value = "/skill")
|
||||||
@Menu(type = "callcenter" , subtype = "callcenterresource" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "callcenterresource", access = false, admin = true)
|
||||||
public ModelAndView skill(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView skill(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request)) ;
|
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request));
|
||||||
map.addAttribute("pbxHostList" , pbxHostList);
|
map.addAttribute("pbxHostList", pbxHostList);
|
||||||
PbxHost pbxHost = null ;
|
PbxHost pbxHost;
|
||||||
if(pbxHostList.size() > 0){
|
if (pbxHostList.size() > 0) {
|
||||||
map.addAttribute("pbxHost" , pbxHost = getPbxHost(pbxHostList, hostid));
|
map.addAttribute("pbxHost", pbxHost = getPbxHost(pbxHostList, hostid));
|
||||||
map.addAttribute("skillGroups" , skillRes.findByHostidAndOrgi(pbxHost.getId() , super.getOrgi(request)));
|
map.addAttribute("skillGroups", skillRes.findByHostidAndOrgi(pbxHost.getId(), super.getOrgi(request)));
|
||||||
map.addAttribute("skillExtentionList" , skillExtentionRes.findByHostidAndOrgi(hostid, super.getOrgi(request)));
|
map.addAttribute("skillExtentionList", skillExtentionRes.findByHostidAndOrgi(hostid, super.getOrgi(request)));
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/skill/index"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/skill/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private PbxHost getPbxHost(List<PbxHost> pbxHostList ,String hostid){
|
private PbxHost getPbxHost(List<PbxHost> pbxHostList, String hostid) {
|
||||||
PbxHost pbxHost = pbxHostList.get(0) ;
|
PbxHost pbxHost = pbxHostList.get(0);
|
||||||
if(!StringUtils.isBlank(hostid)){
|
if (!StringUtils.isBlank(hostid)) {
|
||||||
for(PbxHost pbx : pbxHostList){
|
for (PbxHost pbx : pbxHostList) {
|
||||||
if(pbx.getId().equals(hostid)){
|
if (pbx.getId().equals(hostid)) {
|
||||||
pbxHost = pbx; break ;
|
pbxHost = pbx;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pbxHost ;
|
return pbxHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/skill/add")
|
@RequestMapping(value = "/skill/add")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView extentionadd(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView extentionadd(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/skill/add"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/skill/add"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/skill/save")
|
@RequestMapping(value = "/skill/save")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView extentionsave(ModelMap map , HttpServletRequest request , @Valid CallCenterSkill skill) {
|
public ModelAndView extentionsave(HttpServletRequest request, @Valid CallCenterSkill skill) {
|
||||||
if(!StringUtils.isBlank(skill.getSkill())){
|
if (!StringUtils.isBlank(skill.getSkill())) {
|
||||||
int count = skillRes.countBySkillAndOrgi(skill.getSkill(), super.getOrgi(request)) ;
|
int count = skillRes.countBySkillAndOrgi(skill.getSkill(), super.getOrgi(request));
|
||||||
if(count == 0){
|
if (count == 0) {
|
||||||
skill.setOrgi(super.getOrgi(request));
|
skill.setOrgi(super.getOrgi(request));
|
||||||
skill.setCreater(super.getUser(request).getId());
|
skill.setCreater(super.getUser(request).getId());
|
||||||
skillRes.save(skill) ;
|
skillRes.save(skill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/skill.html?hostid="+skill.getHostid()));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/skill.html?hostid=" + skill.getHostid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/skill/edit")
|
@RequestMapping(value = "/skill/edit")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView extentionedit(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView extentionedit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String hostid) {
|
||||||
map.addAttribute("extention" , extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
map.addAttribute("extention", extentionRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/skill/edit"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/skill/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/skill/update")
|
@RequestMapping(value = "/skill/update")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView pbxhostupdate(ModelMap map , HttpServletRequest request , @Valid Extention extention) {
|
public ModelAndView pbxhostupdate(HttpServletRequest request, @Valid Extention extention) {
|
||||||
if(!StringUtils.isBlank(extention.getId())){
|
if (!StringUtils.isBlank(extention.getId())) {
|
||||||
Extention ext = extentionRes.findByIdAndOrgi(extention.getId(), super.getOrgi(request)) ;
|
Extention ext = extentionRes.findByIdAndOrgi(extention.getId(), super.getOrgi(request));
|
||||||
if(ext!=null && !StringUtils.isBlank(ext.getExtention()) && ext.getExtention().matches("[\\d]{3,8}")){
|
if (ext != null && !StringUtils.isBlank(ext.getExtention()) && ext.getExtention().matches("[\\d]{3,8}")) {
|
||||||
ext.setExtention(extention.getExtention());
|
ext.setExtention(extention.getExtention());
|
||||||
if(!StringUtils.isBlank(extention.getPassword())){
|
if (!StringUtils.isBlank(extention.getPassword())) {
|
||||||
ext.setPassword(extention.getPassword());
|
ext.setPassword(extention.getPassword());
|
||||||
}
|
}
|
||||||
ext.setUpdatetime(new Date());
|
ext.setUpdatetime(new Date());
|
||||||
extentionRes.save(ext) ;
|
extentionRes.save(ext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/skill.html?hostid="+extention.getHostid()));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/skill.html?hostid=" + extention.getHostid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/skill/delete")
|
@RequestMapping(value = "/skill/delete")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView extentiondelete(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView extentiondelete(@Valid String id, @Valid String hostid) {
|
||||||
if(!StringUtils.isBlank(id)){
|
if (!StringUtils.isBlank(id)) {
|
||||||
extentionRes.delete(id);
|
extentionRes.deleteById(id);
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/skill.html?hostid="+hostid));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/skill.html?hostid=" + hostid));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/skill/imp")
|
@RequestMapping(value = "/skill/imp")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView skillimp(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
public ModelAndView skillimp(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
if(!StringUtils.isBlank(hostid)){
|
if (!StringUtils.isBlank(hostid)) {
|
||||||
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("pbxHost", pbxHostRes.findByIdAndOrgi(hostid, super.getOrgi(request)));
|
||||||
map.put("extentionList", extentionRes.findByHostidAndOrgi(hostid, super.getOrgi(request))) ;
|
map.put("extentionList", extentionRes.findByHostidAndOrgi(hostid, super.getOrgi(request)));
|
||||||
map.addAttribute("skillGroups" , skillRes.findByHostidAndOrgi(hostid , super.getOrgi(request)));
|
map.addAttribute("skillGroups", skillRes.findByHostidAndOrgi(hostid, super.getOrgi(request)));
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/skill/imp"));
|
return request(super.createRequestPageTempletResponse("/admin/callcenter/skill/imp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/skill/extention/delete")
|
@RequestMapping(value = "/skill/extention/delete")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView skillextentiondelete(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String hostid) {
|
public ModelAndView skillextentiondelete(@Valid String id, @Valid String hostid) {
|
||||||
if(!StringUtils.isBlank(id)){
|
if (!StringUtils.isBlank(id)) {
|
||||||
skillExtentionRes.delete(id);
|
skillExtentionRes.deleteById(id);
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/skill.html?hostid="+hostid));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/skill.html?hostid=" + hostid));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/skill/extention/save")
|
@RequestMapping(value = "/skill/extention/save")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false , admin = true)
|
@Menu(type = "callcenter", subtype = "extention", access = false, admin = true)
|
||||||
public ModelAndView skillextentionsave(ModelMap map , HttpServletRequest request , @Valid SkillExtention skillExtention, @Valid String hostid , @Valid String[] exts) {
|
public ModelAndView skillextentionsave(HttpServletRequest request, @Valid SkillExtention skillExtention, @Valid String hostid, @Valid String[] exts) {
|
||||||
if(exts!=null && exts.length > 0){
|
if (exts != null && exts.length > 0) {
|
||||||
List<SkillExtention> skillExtentionList = skillExtentionRes.findByHostidAndOrgi(hostid, super.getOrgi(request)) ;
|
List<SkillExtention> skillExtentionList = skillExtentionRes.findByHostidAndOrgi(hostid, super.getOrgi(request));
|
||||||
for(String ext :exts){
|
for (String ext : exts) {
|
||||||
SkillExtention skillExt = new SkillExtention() ;
|
SkillExtention skillExt = new SkillExtention();
|
||||||
skillExt.setOrgi(super.getOrgi(request));
|
skillExt.setOrgi(super.getOrgi(request));
|
||||||
skillExt.setCreater(super.getUser(request).getId());
|
skillExt.setCreater(super.getUser(request).getId());
|
||||||
skillExt.setCreatetime(new Date());
|
skillExt.setCreatetime(new Date());
|
||||||
@ -170,17 +172,18 @@ public class CallCenterSkillController extends Handler {
|
|||||||
skillExt.setSkillid(skillExtention.getSkillid());
|
skillExt.setSkillid(skillExtention.getSkillid());
|
||||||
skillExt.setUpdatetime(new Date());
|
skillExt.setUpdatetime(new Date());
|
||||||
boolean ingroup = false;
|
boolean ingroup = false;
|
||||||
for(SkillExtention temp : skillExtentionList){
|
for (SkillExtention temp : skillExtentionList) {
|
||||||
if(temp.getSkillid().equals(skillExt.getSkillid()) && temp.getExtention().equals(skillExt.getExtention())){
|
if (temp.getSkillid().equals(skillExt.getSkillid()) && temp.getExtention().equals(skillExt.getExtention())) {
|
||||||
ingroup = true ;
|
ingroup = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(ingroup == false){
|
if (!ingroup) {
|
||||||
skillExtentionRes.save(skillExt) ;
|
skillExtentionRes.save(skillExt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/skill.html?hostid="+hostid));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/callcenter/skill.html?hostid=" + hostid));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,9 @@ import com.chatopera.cc.model.SystemConfig;
|
|||||||
import com.chatopera.cc.model.Template;
|
import com.chatopera.cc.model.Template;
|
||||||
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.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;
|
||||||
@ -40,121 +41,122 @@ import java.util.List;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/apps/callcenter")
|
@RequestMapping("/apps/callcenter")
|
||||||
public class ExtentionController extends Handler{
|
@RequiredArgsConstructor
|
||||||
|
public class ExtentionController extends Handler {
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private PbxHostRepository pbxHostRes ;
|
private final PbxHostRepository pbxHostRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private ExtentionRepository extentionRes;
|
private final ExtentionRepository extentionRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private AclRepository aclRes;
|
private final AclRepository aclRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private RouterRulesRepository routerRes;
|
private final RouterRulesRepository routerRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private SkillExtentionRepository skillExtentionRes ;
|
private final SkillExtentionRepository skillExtentionRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private CallCenterSkillRepository skillRes ;
|
private final CallCenterSkillRepository skillRes;
|
||||||
|
|
||||||
@Autowired
|
@NonNull
|
||||||
private SipTrunkRepository sipTrunkRes ;
|
private final SipTrunkRepository sipTrunkRes;
|
||||||
|
|
||||||
@RequestMapping(value = "/extention")
|
@RequestMapping(value = "/extention")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = true)
|
@Menu(type = "callcenter", subtype = "extention", access = true)
|
||||||
public ModelAndView index(ModelMap map , HttpServletRequest request , @Valid String hostname , @Valid String key_value) {
|
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String hostname) {
|
||||||
ModelAndView view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/extention/index")) ;
|
ModelAndView view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/extention/index"));
|
||||||
List<PbxHost> pbxHostList = pbxHostRes.findByHostnameOrIpaddr(hostname, hostname) ;
|
List<PbxHost> pbxHostList = pbxHostRes.findByHostnameOrIpaddr(hostname, hostname);
|
||||||
PbxHost pbxHost = null ;
|
PbxHost pbxHost;
|
||||||
SystemConfig systemConfig = MainUtils.getSystemConfig() ;
|
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||||
if(pbxHostList!=null && pbxHostList.size() > 0){
|
if (pbxHostList != null && pbxHostList.size() > 0) {
|
||||||
pbxHost = pbxHostList.get(0) ;
|
pbxHost = pbxHostList.get(0);
|
||||||
map.addAttribute("pbxHost" , pbxHost);
|
map.addAttribute("pbxHost", pbxHost);
|
||||||
map.addAttribute("skillGroups" , skillRes.findByHostidAndOrgi(pbxHost.getId() , super.getOrgi(request)));
|
map.addAttribute("skillGroups", skillRes.findByHostidAndOrgi(pbxHost.getId(), super.getOrgi(request)));
|
||||||
map.addAttribute("extentionList" , extentionRes.findByHostidAndOrgi(pbxHost.getId() , super.getOrgi(request)));
|
map.addAttribute("extentionList", extentionRes.findByHostidAndOrgi(pbxHost.getId(), super.getOrgi(request)));
|
||||||
}
|
}
|
||||||
if(systemConfig!=null && systemConfig.isCallcenter()){
|
if (systemConfig != null && systemConfig.isCallcenter()) {
|
||||||
if(!StringUtils.isBlank(systemConfig.getCc_extention())){
|
if (!StringUtils.isBlank(systemConfig.getCc_extention())) {
|
||||||
Template template = MainUtils.getTemplate(systemConfig.getCc_extention()) ;
|
Template template = MainUtils.getTemplate(systemConfig.getCc_extention());
|
||||||
if(template!=null){
|
if (template != null) {
|
||||||
map.addAttribute("template" , template);
|
map.addAttribute("template", template);
|
||||||
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/template")) ;
|
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/template"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return view ;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/configuration")
|
@RequestMapping(value = "/configuration")
|
||||||
@Menu(type = "callcenter" , subtype = "configuration" , access = true)
|
@Menu(type = "callcenter", subtype = "configuration", access = true)
|
||||||
public ModelAndView configuration(ModelMap map , HttpServletRequest request , @Valid String hostname , @Valid String key_value , @Valid String profile) {
|
public ModelAndView configuration(ModelMap map, HttpServletRequest request, @Valid String hostname, @Valid String key_value) {
|
||||||
|
|
||||||
List<PbxHost> pbxHostList = pbxHostRes.findByHostnameOrIpaddr(hostname, hostname) ;
|
List<PbxHost> pbxHostList = pbxHostRes.findByHostnameOrIpaddr(hostname, hostname);
|
||||||
PbxHost pbxHost = null ;
|
PbxHost pbxHost;
|
||||||
SystemConfig systemConfig = MainUtils.getSystemConfig() ;
|
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||||
if(pbxHostList!=null && pbxHostList.size() > 0){
|
if (pbxHostList != null && pbxHostList.size() > 0) {
|
||||||
pbxHost = pbxHostList.get(0) ;
|
pbxHost = pbxHostList.get(0);
|
||||||
map.addAttribute("pbxHost" , pbxHost);
|
map.addAttribute("pbxHost", pbxHost);
|
||||||
map.addAttribute("skillGroups" , skillRes.findByHostidAndOrgi(pbxHost.getId() , super.getOrgi(request)));
|
map.addAttribute("skillGroups", skillRes.findByHostidAndOrgi(pbxHost.getId(), super.getOrgi(request)));
|
||||||
map.addAttribute("skillExtentionList" , skillExtentionRes.findByHostidAndOrgi(pbxHost.getId() , super.getOrgi(request)));
|
map.addAttribute("skillExtentionList", skillExtentionRes.findByHostidAndOrgi(pbxHost.getId(), super.getOrgi(request)));
|
||||||
map.addAttribute("extentionList" , extentionRes.findByHostidAndOrgi(pbxHost.getId() , super.getOrgi(request)));
|
map.addAttribute("extentionList", extentionRes.findByHostidAndOrgi(pbxHost.getId(), super.getOrgi(request)));
|
||||||
map.addAttribute("aclList" , aclRes.findByHostidAndOrgi(pbxHost.getId() , super.getOrgi(request)));
|
map.addAttribute("aclList", aclRes.findByHostidAndOrgi(pbxHost.getId(), super.getOrgi(request)));
|
||||||
map.addAttribute("sipTrunkList" , sipTrunkRes.findByHostidAndOrgi(pbxHost.getId() , super.getOrgi(request)));
|
map.addAttribute("sipTrunkList", sipTrunkRes.findByHostidAndOrgi(pbxHost.getId(), super.getOrgi(request)));
|
||||||
}
|
}
|
||||||
Template template = null ;
|
Template template = null;
|
||||||
ModelAndView view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/notfound"));
|
ModelAndView view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/notfound"));
|
||||||
if(key_value!=null && key_value.equals("callcenter.conf")){
|
if (key_value != null && key_value.equals("callcenter.conf")) {
|
||||||
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/configure/callcenter"));
|
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/configure/callcenter"));
|
||||||
if(systemConfig!=null && systemConfig.isCallcenter()){
|
if (systemConfig != null && systemConfig.isCallcenter()) {
|
||||||
if(!StringUtils.isBlank(systemConfig.getCc_quene())){
|
if (!StringUtils.isBlank(systemConfig.getCc_quene())) {
|
||||||
template = MainUtils.getTemplate(systemConfig.getCc_quene()) ;
|
template = MainUtils.getTemplate(systemConfig.getCc_quene());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(key_value!=null && key_value.equals("acl.conf")){
|
} else if (key_value != null && key_value.equals("acl.conf")) {
|
||||||
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/configure/acl"));
|
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/configure/acl"));
|
||||||
if(systemConfig!=null && systemConfig.isCallcenter()){
|
if (systemConfig != null && systemConfig.isCallcenter()) {
|
||||||
if(!StringUtils.isBlank(systemConfig.getCc_acl())){
|
if (!StringUtils.isBlank(systemConfig.getCc_acl())) {
|
||||||
template = MainUtils.getTemplate(systemConfig.getCc_acl()) ;
|
template = MainUtils.getTemplate(systemConfig.getCc_acl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(key_value!=null && key_value.equals("ivr.conf")){
|
} else if (key_value != null && key_value.equals("ivr.conf")) {
|
||||||
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/configure/ivr"));
|
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/configure/ivr"));
|
||||||
if(systemConfig!=null && systemConfig.isCallcenter()){
|
if (systemConfig != null && systemConfig.isCallcenter()) {
|
||||||
if(!StringUtils.isBlank(systemConfig.getCc_ivr())){
|
if (!StringUtils.isBlank(systemConfig.getCc_ivr())) {
|
||||||
template = MainUtils.getTemplate(systemConfig.getCc_ivr()) ;
|
template = MainUtils.getTemplate(systemConfig.getCc_ivr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(template!=null){
|
if (template != null) {
|
||||||
map.addAttribute("template" , template);
|
map.addAttribute("template", template);
|
||||||
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/template")) ;
|
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/template"));
|
||||||
}
|
}
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/dialplan")
|
@RequestMapping(value = "/dialplan")
|
||||||
@Menu(type = "callcenter" , subtype = "dialplan" , access = true)
|
@Menu(type = "callcenter", subtype = "dialplan", access = true)
|
||||||
public ModelAndView dialplan(ModelMap map , HttpServletRequest request , @Valid String hostname , @Valid String key_value) {
|
public ModelAndView dialplan(ModelMap map, HttpServletRequest request, @Valid String hostname) {
|
||||||
ModelAndView view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/dialplan/index"));
|
ModelAndView view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/dialplan/index"));
|
||||||
List<PbxHost> pbxHostList = pbxHostRes.findByHostnameOrIpaddr(hostname, hostname) ;
|
List<PbxHost> pbxHostList = pbxHostRes.findByHostnameOrIpaddr(hostname, hostname);
|
||||||
PbxHost pbxHost = null ;
|
PbxHost pbxHost;
|
||||||
SystemConfig systemConfig = MainUtils.getSystemConfig() ;
|
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||||
Template template = null ;
|
Template template = null;
|
||||||
if(pbxHostList!=null && pbxHostList.size() > 0){
|
if (pbxHostList != null && pbxHostList.size() > 0) {
|
||||||
pbxHost = pbxHostList.get(0) ;
|
pbxHost = pbxHostList.get(0);
|
||||||
map.addAttribute("pbxHost" , pbxHost);
|
map.addAttribute("pbxHost", pbxHost);
|
||||||
map.addAttribute("routerList" , routerRes.findByHostidAndOrgi(pbxHost.getId() , super.getOrgi(request)));
|
map.addAttribute("routerList", routerRes.findByHostidAndOrgi(pbxHost.getId(), super.getOrgi(request)));
|
||||||
}
|
}
|
||||||
if(systemConfig!=null && systemConfig.isCallcenter()){
|
if (systemConfig != null && systemConfig.isCallcenter()) {
|
||||||
if(!StringUtils.isBlank(systemConfig.getCc_siptrunk())){
|
if (!StringUtils.isBlank(systemConfig.getCc_siptrunk())) {
|
||||||
template = MainUtils.getTemplate(systemConfig.getCc_router()) ;
|
template = MainUtils.getTemplate(systemConfig.getCc_router());
|
||||||
}
|
}
|
||||||
if(template!=null){
|
if (template != null) {
|
||||||
map.addAttribute("template" , template);
|
map.addAttribute("template", template);
|
||||||
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/template")) ;
|
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/template"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,27 +164,24 @@ public class ExtentionController extends Handler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/extention/detail")
|
@RequestMapping(value = "/extention/detail")
|
||||||
@Menu(type = "callcenter" , subtype = "extention" , access = false)
|
@Menu(type = "callcenter", subtype = "extention")
|
||||||
public ModelAndView detail(ModelMap map , HttpServletRequest request , HttpServletResponse response ,@Valid String extno) {
|
public ModelAndView detail(ModelMap map, HttpServletRequest request, HttpServletResponse response, @Valid String extno) {
|
||||||
List<Extention> extentionList = extentionRes.findByExtentionAndOrgi(extno, super.getOrgi(request)) ;
|
List<Extention> extentionList = extentionRes.findByExtentionAndOrgi(extno, super.getOrgi(request));
|
||||||
if(extentionList!=null && extentionList.size() == 1){
|
if (extentionList != null && extentionList.size() == 1) {
|
||||||
Extention extention = extentionList.get(0) ;
|
Extention extention = extentionList.get(0);
|
||||||
if(!StringUtils.isBlank(extention.getHostid())) {
|
if (!StringUtils.isBlank(extention.getHostid())) {
|
||||||
PbxHost pbxHost = pbxHostRes.findById(extention.getHostid()) ;
|
pbxHostRes.findById(extention.getHostid()).ifPresent(it -> map.addAttribute("pbxhost", it));
|
||||||
if(pbxHost!=null) {
|
|
||||||
map.addAttribute("pbxhost" , pbxHost);
|
|
||||||
}
|
}
|
||||||
}
|
map.addAttribute("extention", extention);
|
||||||
map.addAttribute("extention" , extention);
|
|
||||||
}
|
}
|
||||||
response.setContentType("Content-type: text/json; charset=utf-8");
|
response.setContentType("Content-type: text/json; charset=utf-8");
|
||||||
return request(super.createRequestPageTempletResponse("/apps/business/callcenter/extention/detail"));
|
return request(super.createRequestPageTempletResponse("/apps/business/callcenter/extention/detail"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/ivr")
|
@RequestMapping(value = "/ivr")
|
||||||
@Menu(type = "callcenter" , subtype = "ivr" , access = false)
|
@Menu(type = "callcenter", subtype = "ivr")
|
||||||
public ModelAndView ivr(ModelMap map , HttpServletRequest request , HttpServletResponse response ,@Valid String hostid) {
|
public ModelAndView ivr(ModelMap map, HttpServletRequest request, @Valid String hostid) {
|
||||||
map.addAttribute("ivrList" , extentionRes.findByHostidAndExtypeAndOrgi(hostid, MainContext.ExtentionType.BUSINESS.toString() , super.getOrgi(request)));
|
map.addAttribute("ivrList", extentionRes.findByHostidAndExtypeAndOrgi(hostid, MainContext.ExtentionType.BUSINESS.toString(), super.getOrgi(request)));
|
||||||
return request(super.createRequestPageTempletResponse("/apps/business/callcenter/extention/ivr"));
|
return request(super.createRequestPageTempletResponse("/apps/business/callcenter/extention/ivr"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,10 +24,13 @@ import java.util.List;
|
|||||||
public interface PbxHostRepository extends JpaRepository<PbxHost, String> {
|
public interface PbxHostRepository extends JpaRepository<PbxHost, String> {
|
||||||
|
|
||||||
PbxHost findByIdAndOrgi(String id, String orgi);
|
PbxHost findByIdAndOrgi(String id, String orgi);
|
||||||
PbxHost findById(String id);
|
|
||||||
|
// PbxHost findById(String id);
|
||||||
|
|
||||||
List<PbxHost> findByOrgi(String orgi);
|
List<PbxHost> findByOrgi(String orgi);
|
||||||
|
|
||||||
List<PbxHost> findByHostnameOrIpaddr(String hostname, String ip);
|
List<PbxHost> findByHostnameOrIpaddr(String hostname, String ip);
|
||||||
|
|
||||||
int countByHostnameAndOrgi(String hostname, String orgi) ;
|
int countByHostnameAndOrgi(String hostname, String orgi);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user