mirror of
https://github.com/chatopera/cosin.git
synced 2025-07-24 08:31:45 +08:00
#373 add new organ rule
This commit is contained in:
parent
84ec251e31
commit
fee95c1e32
@ -37,10 +37,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 程序猿DD
|
* @author 程序猿DD
|
||||||
@ -83,11 +80,16 @@ public class OrganController extends Handler {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UserProxy userProxy;
|
private UserProxy userProxy;
|
||||||
|
|
||||||
|
private Collection<Organ> getOwnOragans(HttpServletRequest request) {
|
||||||
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
|
return organProxy.findAllOrganByParentAndOrgi(currentOrgan, super.getOrgi()).values();
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping("/index")
|
@RequestMapping("/index")
|
||||||
@Menu(type = "admin", subtype = "organ")
|
@Menu(type = "admin", subtype = "organ")
|
||||||
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String organ, @Valid String msg) {
|
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String organ, @Valid String msg) {
|
||||||
List<Organ> organList = organRepository.findByOrgi(super.getOrgi());
|
List<Organ> organList = organRepository.findByOrgi(super.getOrgi());
|
||||||
map.addAttribute("organList", organList);
|
map.addAttribute("organList", getOwnOragans(request));
|
||||||
if (organList.size() > 0) {
|
if (organList.size() > 0) {
|
||||||
Organ organData = null;
|
Organ organData = null;
|
||||||
if (!StringUtils.isBlank(organ) && !"null".equals(organ)) {
|
if (!StringUtils.isBlank(organ) && !"null".equals(organ)) {
|
||||||
@ -98,7 +100,7 @@ public class OrganController extends Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
map.addAttribute("organData", organData = organList.get(0));
|
map.addAttribute("organData", organData = super.getOrgan(request));
|
||||||
}
|
}
|
||||||
if (organData != null) {
|
if (organData != null) {
|
||||||
map.addAttribute(
|
map.addAttribute(
|
||||||
@ -125,7 +127,7 @@ public class OrganController extends Handler {
|
|||||||
map.addAttribute("area", areaRepository.findByIdAndOrgi(area, super.getOrgi()));
|
map.addAttribute("area", areaRepository.findByIdAndOrgi(area, super.getOrgi()));
|
||||||
}
|
}
|
||||||
|
|
||||||
map.addAttribute("organList", organRepository.findByOrgi(super.getOrgi()));
|
map.addAttribute("organList", getOwnOragans(request));
|
||||||
|
|
||||||
return request(super.createRequestPageTempletResponse("/admin/organ/add"));
|
return request(super.createRequestPageTempletResponse("/admin/organ/add"));
|
||||||
}
|
}
|
||||||
@ -159,8 +161,8 @@ public class OrganController extends Handler {
|
|||||||
@RequestMapping("/seluser")
|
@RequestMapping("/seluser")
|
||||||
@Menu(type = "admin", subtype = "seluser", admin = true)
|
@Menu(type = "admin", subtype = "seluser", admin = true)
|
||||||
public ModelAndView seluser(ModelMap map, HttpServletRequest request, @Valid String organ) {
|
public ModelAndView seluser(ModelMap map, HttpServletRequest request, @Valid String organ) {
|
||||||
map.addAttribute(
|
Map<String, Organ> organs = organProxy.findAllOrganByParentAndOrgi(super.getOrgan(request), super.getOrgi(request));
|
||||||
"userList", userRepository.findByOrgiAndDatastatus(super.getOrgi(), false));
|
map.addAttribute("userList", userProxy.findUserInOrgans(organs.keySet()));
|
||||||
Organ organData = organRepository.findByIdAndOrgi(organ, super.getOrgi());
|
Organ organData = organRepository.findByIdAndOrgi(organ, super.getOrgi());
|
||||||
map.addAttribute("userOrganList", userProxy
|
map.addAttribute("userOrganList", userProxy
|
||||||
.findByOrganAndOrgiAndDatastatus(organ, super.getOrgi(), false));
|
.findByOrganAndOrgiAndDatastatus(organ, super.getOrgi(), false));
|
||||||
@ -249,7 +251,12 @@ public class OrganController extends Handler {
|
|||||||
) {
|
) {
|
||||||
logger.info("[userroledelete] user id {}, organ {}", id, organ);
|
logger.info("[userroledelete] user id {}, organ {}", id, organ);
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
|
List<OrganUser> organUsers = organUserRes.findByUserid(id);
|
||||||
|
if (organUsers.size() > 1) {
|
||||||
organUserRes.deleteOrganUserByUseridAndOrgan(id, organ);
|
organUserRes.deleteOrganUserByUseridAndOrgan(id, organ);
|
||||||
|
} else {
|
||||||
|
return request(super.createRequestPageTempletResponse("redirect:/admin/organ/index.html?organ=" + organ + "&msg=not_allow_remove_user"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/organ/index.html?organ=" + organ));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/organ/index.html?organ=" + organ));
|
||||||
}
|
}
|
||||||
@ -258,10 +265,11 @@ public class OrganController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "organ")
|
@Menu(type = "admin", subtype = "organ")
|
||||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
ModelAndView view = request(super.createRequestPageTempletResponse("/admin/organ/edit"));
|
ModelAndView view = request(super.createRequestPageTempletResponse("/admin/organ/edit"));
|
||||||
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
map.addAttribute("areaList", areaRepository.findByOrgi(super.getOrgi()));
|
map.addAttribute("areaList", areaRepository.findByOrgi(super.getOrgi()));
|
||||||
view.addObject("organData", organRepository.findByIdAndOrgi(id, super.getOrgi()));
|
view.addObject("organData", organRepository.findByIdAndOrgi(id, super.getOrgi()));
|
||||||
|
view.addObject("isRootOrgan", id.equals(currentOrgan.getId()));
|
||||||
map.addAttribute("organList", organRepository.findByOrgi(super.getOrgi()));
|
map.addAttribute("organList", getOwnOragans(request));
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@ import com.chatopera.cc.basic.MainContext;
|
|||||||
import com.chatopera.cc.controller.Handler;
|
import com.chatopera.cc.controller.Handler;
|
||||||
import com.chatopera.cc.model.*;
|
import com.chatopera.cc.model.*;
|
||||||
import com.chatopera.cc.persistence.repository.*;
|
import com.chatopera.cc.persistence.repository.*;
|
||||||
|
import com.chatopera.cc.proxy.OrganProxy;
|
||||||
|
import com.chatopera.cc.proxy.UserProxy;
|
||||||
import com.chatopera.cc.util.Menu;
|
import com.chatopera.cc.util.Menu;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -36,6 +38,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/admin/role")
|
@RequestMapping("/admin/role")
|
||||||
@ -58,10 +61,18 @@ public class RoleController extends Handler {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SysDicRepository sysDicRes;
|
private SysDicRepository sysDicRes;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
OrganProxy organProxy;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
UserProxy userProxy;
|
||||||
|
|
||||||
@RequestMapping("/index")
|
@RequestMapping("/index")
|
||||||
@Menu(type = "admin", subtype = "role")
|
@Menu(type = "admin", subtype = "role")
|
||||||
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String role, @Valid String msg) {
|
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String role, @Valid String msg) {
|
||||||
List<Role> roleList = roleRepository.findByOrgi(super.getOrgi());
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
|
|
||||||
|
List<Role> roleList = roleRepository.findByOrgiAndOrgan(super.getOrgi(),currentOrgan.getId());
|
||||||
map.addAttribute("roleList", roleList);
|
map.addAttribute("roleList", roleList);
|
||||||
map.addAttribute("msg", msg);
|
map.addAttribute("msg", msg);
|
||||||
if (roleList.size() > 0) {
|
if (roleList.size() > 0) {
|
||||||
@ -92,6 +103,7 @@ public class RoleController extends Handler {
|
|||||||
@RequestMapping("/save")
|
@RequestMapping("/save")
|
||||||
@Menu(type = "admin", subtype = "role")
|
@Menu(type = "admin", subtype = "role")
|
||||||
public ModelAndView save(HttpServletRequest request, @Valid Role role) {
|
public ModelAndView save(HttpServletRequest request, @Valid Role role) {
|
||||||
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
Role tempRole = roleRepository.findByNameAndOrgi(role.getName(), super.getOrgi());
|
Role tempRole = roleRepository.findByNameAndOrgi(role.getName(), super.getOrgi());
|
||||||
String msg = "admin_role_save_success";
|
String msg = "admin_role_save_success";
|
||||||
if (tempRole != null) {
|
if (tempRole != null) {
|
||||||
@ -101,6 +113,7 @@ public class RoleController extends Handler {
|
|||||||
role.setCreater(super.getUser(request).getId());
|
role.setCreater(super.getUser(request).getId());
|
||||||
role.setCreatetime(new Date());
|
role.setCreatetime(new Date());
|
||||||
role.setUpdatetime(new Date());
|
role.setUpdatetime(new Date());
|
||||||
|
role.setOrgan(currentOrgan.getId());
|
||||||
roleRepository.save(role);
|
roleRepository.save(role);
|
||||||
}
|
}
|
||||||
return request(super.createRequestPageTempletResponse("redirect:/admin/role/index.html?msg=" + msg));
|
return request(super.createRequestPageTempletResponse("redirect:/admin/role/index.html?msg=" + msg));
|
||||||
@ -109,14 +122,14 @@ public class RoleController extends Handler {
|
|||||||
@RequestMapping("/seluser")
|
@RequestMapping("/seluser")
|
||||||
@Menu(type = "admin", subtype = "seluser", admin = true)
|
@Menu(type = "admin", subtype = "seluser", admin = true)
|
||||||
public ModelAndView seluser(ModelMap map, HttpServletRequest request, @Valid String role) {
|
public ModelAndView seluser(ModelMap map, HttpServletRequest request, @Valid String role) {
|
||||||
map.addAttribute("userList", userRepository.findByOrgiAndDatastatus(super.getOrgi(), false));
|
Map<String, Organ> organs = organProxy.findAllOrganByParentAndOrgi(super.getOrgan(request), super.getOrgi(request));
|
||||||
|
map.addAttribute("userList", userProxy.findUserInOrgans(organs.keySet()));
|
||||||
Role roleData = roleRepository.findByIdAndOrgi(role, super.getOrgi());
|
Role roleData = roleRepository.findByIdAndOrgi(role, super.getOrgi());
|
||||||
map.addAttribute("userRoleList", userRoleRes.findByOrgiAndRole(super.getOrgi(), roleData));
|
map.addAttribute("userRoleList", userRoleRes.findByOrgiAndRole(super.getOrgi(), roleData));
|
||||||
map.addAttribute("role", roleData);
|
map.addAttribute("role", roleData);
|
||||||
return request(super.createRequestPageTempletResponse("/admin/role/seluser"));
|
return request(super.createRequestPageTempletResponse("/admin/role/seluser"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/saveuser")
|
@RequestMapping("/saveuser")
|
||||||
@Menu(type = "admin", subtype = "saveuser", admin = true)
|
@Menu(type = "admin", subtype = "saveuser", admin = true)
|
||||||
public ModelAndView saveuser(HttpServletRequest request, @Valid String[] users, @Valid String role) {
|
public ModelAndView saveuser(HttpServletRequest request, @Valid String[] users, @Valid String role) {
|
||||||
|
@ -79,7 +79,7 @@ public class UsersController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "user")
|
@Menu(type = "admin", subtype = "user")
|
||||||
public ModelAndView index(ModelMap map, HttpServletRequest request) throws IOException {
|
public ModelAndView index(ModelMap map, HttpServletRequest request) throws IOException {
|
||||||
User logined = super.getUser(request);
|
User logined = super.getUser(request);
|
||||||
if (!logined.isSuperadmin()) {
|
|
||||||
Map<String, Organ> organs = organProxy.findAllOrganByParentAndOrgi(super.getOrgan(request), super.getOrgi(request));
|
Map<String, Organ> organs = organProxy.findAllOrganByParentAndOrgi(super.getOrgan(request), super.getOrgi(request));
|
||||||
map.addAttribute("userList", userProxy.findUserInOrgans(organs.keySet(), new PageRequest(
|
map.addAttribute("userList", userProxy.findUserInOrgans(organs.keySet(), new PageRequest(
|
||||||
super.getP(request),
|
super.getP(request),
|
||||||
@ -87,29 +87,21 @@ public class UsersController extends Handler {
|
|||||||
Sort.Direction.ASC,
|
Sort.Direction.ASC,
|
||||||
"createtime"
|
"createtime"
|
||||||
)));
|
)));
|
||||||
} else {
|
|
||||||
map.addAttribute(
|
|
||||||
"userList",
|
|
||||||
userRepository.findByDatastatusAndOrgiAndSuperadminNot(
|
|
||||||
false,
|
|
||||||
super.getOrgi(),
|
|
||||||
true,
|
|
||||||
new PageRequest(
|
|
||||||
super.getP(request),
|
|
||||||
super.getPs(request),
|
|
||||||
Sort.Direction.ASC,
|
|
||||||
"createtime"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return request(super.createAdminTempletResponse("/admin/user/index"));
|
return request(super.createAdminTempletResponse("/admin/user/index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/add")
|
@RequestMapping("/add")
|
||||||
@Menu(type = "admin", subtype = "user")
|
@Menu(type = "admin", subtype = "user")
|
||||||
public ModelAndView add(ModelMap map, HttpServletRequest request) {
|
public ModelAndView add(ModelMap map, HttpServletRequest request) {
|
||||||
return request(super.createRequestPageTempletResponse("/admin/user/add"));
|
ModelAndView view = request(super.createRequestPageTempletResponse("/admin/user/add"));
|
||||||
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
|
Map<String, Organ> organs = organProxy.findAllOrganByParentAndOrgi(currentOrgan, super.getOrgi(request));
|
||||||
|
map.addAttribute("currentOrgan", currentOrgan);
|
||||||
|
map.addAttribute("organList", organs.values());
|
||||||
|
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/edit")
|
@RequestMapping("/edit")
|
||||||
|
@ -64,13 +64,9 @@ public class SNSAccountIMController extends Handler {
|
|||||||
@RequestMapping("/index")
|
@RequestMapping("/index")
|
||||||
@Menu(type = "admin", subtype = "im", access = false, admin = true)
|
@Menu(type = "admin", subtype = "im", access = false, admin = true)
|
||||||
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String execute, @RequestParam(name = "status", required = false) String status) {
|
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String execute, @RequestParam(name = "status", required = false) String status) {
|
||||||
User logined = super.getUser(request);
|
|
||||||
if (logined.isSuperadmin()) {
|
|
||||||
map.addAttribute("snsAccountList", snsAccountRes.findBySnstypeAndOrgi(MainContext.ChannelType.WEBIM.toString(), super.getOrgi(request), new PageRequest(super.getP(request), super.getPs(request))));
|
|
||||||
} else {
|
|
||||||
Map<String, Organ> organs = organProxy.findAllOrganByParentAndOrgi(super.getOrgan(request), super.getOrgi(request));
|
Map<String, Organ> organs = organProxy.findAllOrganByParentAndOrgi(super.getOrgan(request), super.getOrgi(request));
|
||||||
map.addAttribute("snsAccountList", snsAccountRes.findBySnstypeAndOrgiAndOrgan(MainContext.ChannelType.WEBIM.toString(), super.getOrgi(request), organs.keySet(), new PageRequest(super.getP(request), super.getPs(request))));
|
map.addAttribute("snsAccountList", snsAccountRes.findBySnstypeAndOrgiAndOrgan(MainContext.ChannelType.WEBIM.toString(), super.getOrgi(request), organs.keySet(), new PageRequest(super.getP(request), super.getPs(request))));
|
||||||
}
|
|
||||||
map.addAttribute("status", status);
|
map.addAttribute("status", status);
|
||||||
List<Secret> secretConfig = secRes.findByOrgi(super.getOrgi(request));
|
List<Secret> secretConfig = secRes.findByOrgi(super.getOrgi(request));
|
||||||
if (secretConfig != null && secretConfig.size() > 0) {
|
if (secretConfig != null && secretConfig.size() > 0) {
|
||||||
@ -92,6 +88,7 @@ public class SNSAccountIMController extends Handler {
|
|||||||
@Menu(type = "admin", subtype = "weixin")
|
@Menu(type = "admin", subtype = "weixin")
|
||||||
public ModelAndView save(HttpServletRequest request,
|
public ModelAndView save(HttpServletRequest request,
|
||||||
@Valid SNSAccount snsAccount) throws NoSuchAlgorithmException {
|
@Valid SNSAccount snsAccount) throws NoSuchAlgorithmException {
|
||||||
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
String status = "new_webim_fail";
|
String status = "new_webim_fail";
|
||||||
if (StringUtils.isNotBlank(snsAccount.getBaseURL())) {
|
if (StringUtils.isNotBlank(snsAccount.getBaseURL())) {
|
||||||
snsAccount.setSnsid(Base62.encode(snsAccount.getBaseURL()).toLowerCase());
|
snsAccount.setSnsid(Base62.encode(snsAccount.getBaseURL()).toLowerCase());
|
||||||
@ -103,6 +100,7 @@ public class SNSAccountIMController extends Handler {
|
|||||||
snsAccount.setCreatetime(new Date());
|
snsAccount.setCreatetime(new Date());
|
||||||
User curr = super.getUser(request);
|
User curr = super.getUser(request);
|
||||||
snsAccount.setCreater(curr.getId());
|
snsAccount.setCreater(curr.getId());
|
||||||
|
snsAccount.setOrgan(currentOrgan.getId());
|
||||||
|
|
||||||
snsAccountRes.save(snsAccount);
|
snsAccountRes.save(snsAccount);
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import com.chatopera.cc.cache.Cache;
|
|||||||
import com.chatopera.cc.controller.Handler;
|
import com.chatopera.cc.controller.Handler;
|
||||||
import com.chatopera.cc.controller.api.request.RestUtils;
|
import com.chatopera.cc.controller.api.request.RestUtils;
|
||||||
import com.chatopera.cc.model.*;
|
import com.chatopera.cc.model.*;
|
||||||
|
import com.chatopera.cc.persistence.repository.OrganRepository;
|
||||||
import com.chatopera.cc.persistence.repository.OrganUserRepository;
|
import com.chatopera.cc.persistence.repository.OrganUserRepository;
|
||||||
import com.chatopera.cc.persistence.repository.UserRepository;
|
import com.chatopera.cc.persistence.repository.UserRepository;
|
||||||
import com.chatopera.cc.persistence.repository.UserRoleRepository;
|
import com.chatopera.cc.persistence.repository.UserRoleRepository;
|
||||||
@ -72,6 +73,9 @@ public class ApiUserController extends Handler {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OrganUserRepository organUserRes;
|
private OrganUserRepository organUserRes;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrganRepository organRes;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserRoleRepository userRoleRes;
|
private UserRoleRepository userRoleRes;
|
||||||
|
|
||||||
@ -156,11 +160,17 @@ public class ApiUserController extends Handler {
|
|||||||
*/
|
*/
|
||||||
private JsonObject create(final HttpServletRequest request, final JsonObject payload) {
|
private JsonObject create(final HttpServletRequest request, final JsonObject payload) {
|
||||||
logger.info("[create] payload {}", payload.toString());
|
logger.info("[create] payload {}", payload.toString());
|
||||||
|
String parent = payload.get("parent").getAsString();
|
||||||
|
Organ parentOrgan = super.getOrgan(request);
|
||||||
|
if (StringUtils.isNotEmpty(parent)) {
|
||||||
|
parentOrgan = organRes.getOne(parent);
|
||||||
|
}
|
||||||
|
|
||||||
// 创建新用户时,阻止传入ID
|
// 创建新用户时,阻止传入ID
|
||||||
payload.remove("id");
|
payload.remove("id");
|
||||||
// 从payload中创建User
|
// 从payload中创建User
|
||||||
User user = userProxy.parseUserFromJson(payload);
|
User user = userProxy.parseUserFromJson(payload);
|
||||||
JsonObject resp = userProxy.createNewUser(user);
|
JsonObject resp = userProxy.createNewUser(user, parentOrgan);
|
||||||
logger.info("[create] response {}", resp.toString());
|
logger.info("[create] response {}", resp.toString());
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "/apps/cca")
|
@RequestMapping(value = "/apps/cca")
|
||||||
@ -197,7 +198,7 @@ public class AgentAuditController extends Handler {
|
|||||||
List<Organ> skills = organRes.findByOrgiAndSkill(orgi, true);
|
List<Organ> skills = organRes.findByOrgiAndSkill(orgi, true);
|
||||||
List<User> agents = userRes.findByOrgiAndAgentAndDatastatusAndIdIsNot(orgi, true, false, logined.getId());
|
List<User> agents = userRes.findByOrgiAndAgentAndDatastatusAndIdIsNot(orgi, true, false, logined.getId());
|
||||||
|
|
||||||
view.addObject("skillGroups", skills);
|
view.addObject("skillGroups", skills.stream().filter(s -> organs.containsKey(s.getId())).collect(Collectors.toList()));
|
||||||
view.addObject("agentList", agents);
|
view.addObject("agentList", agents);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
|
@ -24,29 +24,32 @@ import java.util.Date;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = "uk_role")
|
@Table(name = "uk_role")
|
||||||
@org.hibernate.annotations.Proxy(lazy = false)
|
@org.hibernate.annotations.Proxy(lazy = false)
|
||||||
public class Role implements java.io.Serializable{
|
public class Role implements java.io.Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 1115593425069549681L;
|
private static final long serialVersionUID = 1115593425069549681L;
|
||||||
|
|
||||||
private String id ;
|
private String id;
|
||||||
private String name ;
|
private String name;
|
||||||
private String code ;
|
private String code;
|
||||||
private Date createtime ;
|
private Date createtime;
|
||||||
private String creater;
|
private String creater;
|
||||||
private String username ;
|
private String username;
|
||||||
private Date updatetime ;
|
private Date updatetime;
|
||||||
private String orgi ;
|
private String orgi;
|
||||||
private String orgid ;
|
private String orgid;
|
||||||
|
private String organ;
|
||||||
|
|
||||||
|
|
||||||
public Role(){}
|
public Role() {
|
||||||
|
|
||||||
public Role(String id){
|
|
||||||
this.id = id ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Role(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(length = 32)
|
@Column(length = 32)
|
||||||
@GeneratedValue(generator = "system-uuid")
|
@GeneratedValue(generator = "system-uuid")
|
||||||
@ -54,48 +57,63 @@ public class Role implements java.io.Serializable{
|
|||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
public void setId(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(String code) {
|
public void setCode(String code) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCreater() {
|
public String getCreater() {
|
||||||
return creater;
|
return creater;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreater(String creater) {
|
public void setCreater(String creater) {
|
||||||
this.creater = creater;
|
this.creater = creater;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
return username;
|
return username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsername(String username) {
|
public void setUsername(String username) {
|
||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOrgi() {
|
public String getOrgi() {
|
||||||
return orgi;
|
return orgi;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrgi(String orgi) {
|
public void setOrgi(String orgi) {
|
||||||
this.orgi = orgi;
|
this.orgi = orgi;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getCreatetime() {
|
public Date getCreatetime() {
|
||||||
return createtime;
|
return createtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreatetime(Date createtime) {
|
public void setCreatetime(Date createtime) {
|
||||||
this.createtime = createtime;
|
this.createtime = createtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getUpdatetime() {
|
public Date getUpdatetime() {
|
||||||
return updatetime;
|
return updatetime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUpdatetime(Date updatetime) {
|
public void setUpdatetime(Date updatetime) {
|
||||||
this.updatetime = updatetime;
|
this.updatetime = updatetime;
|
||||||
}
|
}
|
||||||
@ -107,4 +125,12 @@ public class Role implements java.io.Serializable{
|
|||||||
public void setOrgid(String orgid) {
|
public void setOrgid(String orgid) {
|
||||||
this.orgid = orgid;
|
this.orgid = orgid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOrgan() {
|
||||||
|
return organ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgan(String organ) {
|
||||||
|
this.organ = organ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,12 +22,13 @@ import org.springframework.data.jpa.repository.JpaRepository;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface RoleRepository
|
public interface RoleRepository
|
||||||
extends JpaRepository<Role, String>
|
extends JpaRepository<Role, String> {
|
||||||
{
|
|
||||||
Role findByIdAndOrgi(String paramString, String orgi);
|
Role findByIdAndOrgi(String paramString, String orgi);
|
||||||
|
|
||||||
List<Role> findByOrgi(String orgi);
|
List<Role> findByOrgi(String orgi);
|
||||||
|
|
||||||
|
List<Role> findByOrgiAndOrgan(String orgi, String organ);
|
||||||
|
|
||||||
List<Role> findByOrgi(String orgi, String orgid);
|
List<Role> findByOrgi(String orgi, String orgid);
|
||||||
|
|
||||||
Role findByNameAndOrgi(String paramString, String orgi);
|
Role findByNameAndOrgi(String paramString, String orgi);
|
||||||
|
@ -49,8 +49,8 @@ public interface SNSAccountRepository
|
|||||||
|
|
||||||
Page<SNSAccount> findBySnstypeAndOrgi(String paramString, String orgi, Pageable page);
|
Page<SNSAccount> findBySnstypeAndOrgi(String paramString, String orgi, Pageable page);
|
||||||
|
|
||||||
@Query(value = "select s.* from `uk_snsaccount` s left join `uk_consult_invite` ci on ci.`snsaccountid`=s.`snsid` WHERE s.snstype = ?1 AND s.orgi = ?2 and ci.`consult_skill_fixed_id` in (?3) ORDER BY ?#{#pageable}",
|
@Query(value = "select s.* from `uk_snsaccount` s WHERE s.snstype = ?1 AND s.orgi = ?2 and s.`organ` in (?3) ORDER BY ?#{#pageable}",
|
||||||
countQuery = "select count(1) from `uk_snsaccount` s left join `uk_consult_invite` ci on ci.`snsaccountid`=s.`snsid` WHERE s.snstype = ?1 AND s.orgi = ?2 and ci.`consult_skill_fixed_id` in (?3)", nativeQuery = true)
|
countQuery = "select count(1) from `uk_snsaccount` s WHERE s.snstype = ?1 AND s.orgi = ?2 and s.`organ` in (?3)", nativeQuery = true)
|
||||||
Page<SNSAccount> findBySnstypeAndOrgiAndOrgan(String paramString, String orgi, Collection<String> organ, Pageable page);
|
Page<SNSAccount> findBySnstypeAndOrgiAndOrgan(String paramString, String orgi, Collection<String> organ, Pageable page);
|
||||||
|
|
||||||
@Query(value = "SELECT * FROM uk_snsaccount WHERE snstype = ?1 AND snsid = ?2 AND orgi = ?3 LIMIT 1", nativeQuery = true)
|
@Query(value = "SELECT * FROM uk_snsaccount WHERE snstype = ?1 AND snsid = ?2 AND orgi = ?3 LIMIT 1", nativeQuery = true)
|
||||||
|
@ -59,6 +59,10 @@ public class UserProxy {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ExtensionRepository extensionRes;
|
private ExtensionRepository extensionRes;
|
||||||
|
|
||||||
|
public JsonObject createNewUser(final User user) {
|
||||||
|
return this.createNewUser(user, null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建新用户
|
* 创建新用户
|
||||||
* 支持多租户
|
* 支持多租户
|
||||||
@ -67,7 +71,7 @@ public class UserProxy {
|
|||||||
* @param organ
|
* @param organ
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public JsonObject createNewUser(final User user) {
|
public JsonObject createNewUser(final User user, Organ organ) {
|
||||||
JsonObject result = new JsonObject();
|
JsonObject result = new JsonObject();
|
||||||
String msg = validUser(user);
|
String msg = validUser(user);
|
||||||
if (StringUtils.equalsIgnoreCase(msg, "new_user_success")) {
|
if (StringUtils.equalsIgnoreCase(msg, "new_user_success")) {
|
||||||
@ -80,6 +84,14 @@ public class UserProxy {
|
|||||||
user.setPassword(MainUtils.md5(user.getPassword()));
|
user.setPassword(MainUtils.md5(user.getPassword()));
|
||||||
}
|
}
|
||||||
userRes.save(user);
|
userRes.save(user);
|
||||||
|
|
||||||
|
if(organ!=null) {
|
||||||
|
OrganUser ou = new OrganUser();
|
||||||
|
ou.setUserid(user.getId());
|
||||||
|
ou.setOrgan(organ.getId());
|
||||||
|
organUserRes.save(ou);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// 新账号未通过验证,返回创建失败信息msg
|
// 新账号未通过验证,返回创建失败信息msg
|
||||||
result.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC);
|
result.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC);
|
||||||
|
@ -391,11 +391,11 @@ var Proxy = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(answer) {
|
if(answer) {
|
||||||
var li = ' <li class="ukefu-agentservice-list" onclick="chooseAnswer(\'' + answer.content + '\')">\n' +
|
var li = ' <li class="ukefu-agentservice-list chooseAnswer" data-title="'+answer.content+'">\n' +
|
||||||
' <div class="nowrap" title="' + result.data[j].post + '">问题:' + result.data[j].post + '</div>\n' +
|
' <div class="nowrap" title="' + result.data[j].post + '">问题:' + result.data[j].post + '</div>\n' +
|
||||||
' <div style="color: #333">\n' +
|
' <div style="color: #333">\n' +
|
||||||
' <p class="nowrap" title="' + answer.content + '" style="float: left ">答案:' + answer.content + '</p>\n' +
|
' <p class="nowrap" title="' + answer.content + '" style="float: left ">答案:' + answer.content + '</p>\n' +
|
||||||
' <button style="float: right" class="layui-btn layui-btn-mini" onclick="chooseAnswer(\'' + answer.content + '\')">选择</button>\n' +
|
' <button style="float: right" class="layui-btn layui-btn-mini chooseAnswer" data-title="'+answer.content+'">选择</button>\n' +
|
||||||
' </div>\n' +
|
' </div>\n' +
|
||||||
' </li>'
|
' </li>'
|
||||||
type == "agent" ? $("#quickReplyBox").append(li) : $("#ccaQuickReplyBox").append(li);
|
type == "agent" ? $("#quickReplyBox").append(li) : $("#ccaQuickReplyBox").append(li);
|
||||||
@ -431,6 +431,8 @@ var Proxy = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
endAgentUserService:function(data){
|
endAgentUserService:function(data){
|
||||||
if($('#tip_message_'+data.userid).length >0){
|
if($('#tip_message_'+data.userid).length >0){
|
||||||
if(data.channel){
|
if(data.channel){
|
||||||
|
@ -77,6 +77,16 @@
|
|||||||
<dd <#if subtype?? && subtype == 'metadata'>class="layui-this"</#if>>
|
<dd <#if subtype?? && subtype == 'metadata'>class="layui-this"</#if>>
|
||||||
<a href="/admin/metadata/index.html">元数据</a>
|
<a href="/admin/metadata/index.html">元数据</a>
|
||||||
</dd>
|
</dd>
|
||||||
|
<#if models?seq_contains("chatbot")>
|
||||||
|
<#if user?? &&( user.roleAuthMap["A09"]?? || user.admin) >
|
||||||
|
<dd>
|
||||||
|
<a data-title="智能机器人" href="javascript:void(0)" onclick="openChatbot()" data-href="/apps/chatbot/index.html" class="iframe_btn" data-id="chatbotIntegrationWin" data-type="tabAdd">
|
||||||
|
智能机器人
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
|
||||||
<dd <#if subtype?? && subtype == 'template'>class="layui-this"</#if>>
|
<dd <#if subtype?? && subtype == 'template'>class="layui-this"</#if>>
|
||||||
<a href="/admin/template/index.html">系统模板</a>
|
<a href="/admin/template/index.html">系统模板</a>
|
||||||
</dd>
|
</dd>
|
||||||
@ -91,3 +101,9 @@
|
|||||||
</li>
|
</li>
|
||||||
</#if>
|
</#if>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function openChatbot(){
|
||||||
|
window.parent.active.tabAdd($(".iframe_btn").data('href') , $(".iframe_btn").data('title'), $(".iframe_btn").data('id'));
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
@ -125,10 +125,10 @@ layui.use('form', function(){
|
|||||||
|
|
||||||
|
|
||||||
var zNodes =[
|
var zNodes =[
|
||||||
{ id:'0', pId:'00', name:"组织机构", open:true , organ : true, type : "organ"}
|
// { id:'0', pId:'00', name:"组织机构", open:true , organ : true, type : "organ"}
|
||||||
<#if organList??>
|
<#if organList??>
|
||||||
<#list organList as organ>
|
<#list organList as organ>
|
||||||
,{ id:'${organ.id!''}', pId:'${organ.parent!'0'}', name:"${organ.name!''}", open:true , organ : true , type : "organ", icon:"/images/dept.png" }
|
{ id:'${organ.id!''}', pId:'${organ.parent!'0'}', name:"${organ.name!''}", open:true , organ : true , type : "organ", icon:"/images/dept.png" },
|
||||||
</#list>
|
</#list>
|
||||||
</#if>
|
</#if>
|
||||||
];
|
];
|
||||||
|
@ -2,17 +2,18 @@
|
|||||||
<form class="layui-form uk-form" action="/admin/organ/update.html">
|
<form class="layui-form uk-form" action="/admin/organ/update.html">
|
||||||
<input type="hidden" name="id" value="${organData.id!''}">
|
<input type="hidden" name="id" value="${organData.id!''}">
|
||||||
<input type="hidden" name="area" id="area" value="${organData.area!''}">
|
<input type="hidden" name="area" id="area" value="${organData.area!''}">
|
||||||
|
<input type="hidden" id="parent" name="parent" value="<#if organData??>${organData.parent}<#else>0</#if>">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">部门:</label>
|
<label class="layui-form-label">部门:</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="text" name="name" lay-verify="requiredOrgiName" value="${organData.name!''}" placeholder="请输入部门名称" autocomplete="off" class="layui-input">
|
<input type="text" name="name" lay-verify="requiredOrgiName" value="${organData.name!''}" placeholder="请输入部门名称" autocomplete="off" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<#if isRootOrgan!=true>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<div class="layui-inline">
|
<div class="layui-inline">
|
||||||
<label class="layui-form-label">上级机构:</label>
|
<label class="layui-form-label">上级机构:</label>
|
||||||
<div class="layui-input-inline" style="position: relative;">
|
<div class="layui-input-inline" style="position: relative;">
|
||||||
<input type="hidden" id="parent" name="parent" value="<#if organData??>${organData.parent}<#else>0</#if>">
|
|
||||||
<input type="text" name="parentname" id="parentname" required value="<#if organData??>${organData.name}<#else>组织机构</#if>" lay-verify="requiredTwo" autocomplete="off" readOnly="readonly" onClick="showMenu();"
|
<input type="text" name="parentname" id="parentname" required value="<#if organData??>${organData.name}<#else>组织机构</#if>" lay-verify="requiredTwo" autocomplete="off" readOnly="readonly" onClick="showMenu();"
|
||||||
class="layui-input">
|
class="layui-input">
|
||||||
<i class="layui-icon" style="position: absolute;right: 3px;top: 6px;font-size: 25px;${systemConfig.color!'color:#0096C4;'}" onClick="showMenu()"></i>
|
<i class="layui-icon" style="position: absolute;right: 3px;top: 6px;font-size: 25px;${systemConfig.color!'color:#0096C4;'}" onClick="showMenu()"></i>
|
||||||
@ -22,6 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</#if>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">启用技能组:</label>
|
<label class="layui-form-label">启用技能组:</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
@ -133,10 +135,10 @@ layui.use('form', function(){
|
|||||||
|
|
||||||
|
|
||||||
var zNodes =[
|
var zNodes =[
|
||||||
{ id:'0', pId:'00', name:"组织机构", open:true , organ : true, type : "organ"}
|
// { id:'0', pId:'00', name:"组织机构", open:true , organ : true, type : "organ"}
|
||||||
<#if organList??>
|
<#if organList??>
|
||||||
<#list organList as organ>
|
<#list organList as organ>
|
||||||
,{ id:'${organ.id!''}', pId:'${organ.parent!'0'}', name:"${organ.name!''}", open:true , organ : true , type : "organ", icon:"/images/dept.png" }
|
{ id:'${organ.id!''}', pId:'${organ.parent!'0'}', name:"${organ.name!''}", open:true , organ : true , type : "organ", icon:"/images/dept.png" },
|
||||||
</#list>
|
</#list>
|
||||||
</#if>
|
</#if>
|
||||||
];
|
];
|
||||||
@ -145,7 +147,9 @@ layui.use('form', function(){
|
|||||||
<#if organData??>
|
<#if organData??>
|
||||||
var node = ztree.getNodeByParam('id', '${organData.parent!''}');//获取id为1的点
|
var node = ztree.getNodeByParam('id', '${organData.parent!''}');//获取id为1的点
|
||||||
ztree.selectNode(node);//选择点
|
ztree.selectNode(node);//选择点
|
||||||
|
if(node){
|
||||||
$("#parentname").attr("value", node.name);
|
$("#parentname").attr("value", node.name);
|
||||||
|
}
|
||||||
<#if organData.area??>
|
<#if organData.area??>
|
||||||
<#list organData.area?split(",") as area>
|
<#list organData.area?split(",") as area>
|
||||||
var areanode_${area_index} = ztree.getNodeByParam('id', '${area}');//获取id为1的点
|
var areanode_${area_index} = ztree.getNodeByParam('id', '${area}');//获取id为1的点
|
||||||
|
@ -117,10 +117,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var zNodes =[
|
var zNodes =[
|
||||||
{ id:'0', pId:'00', name:"组织机构", open:true , topic : false}
|
// { id:'0', pId:'00', name:"组织机构", open:true , topic : false}
|
||||||
<#if organList??>
|
<#if organList??>
|
||||||
<#list organList as organ>
|
<#list organList as organ>
|
||||||
,{ id:'${organ.id!''}', pId:'${organ.parent!'0'}', name:"${organ.name!''}", open:true , topic : true , <#if organ.area?? && organ.area != "">icon:"/images/area.png" <#else>icon:"/images/dept.png"</#if> }
|
{ id:'${organ.id!''}', pId:'${organ.parent!'0'}', name:"${organ.name!''}", open:true , topic : true , <#if organ.area?? && organ.area != "">icon:"/images/area.png" <#else>icon:"/images/dept.png"</#if> },
|
||||||
</#list>
|
</#list>
|
||||||
</#if>
|
</#if>
|
||||||
];
|
];
|
||||||
@ -153,6 +153,8 @@
|
|||||||
layer.msg('新建组织成功',{icon: 1, time: 1500})
|
layer.msg('新建组织成功',{icon: 1, time: 1500})
|
||||||
<#elseif msg?? && msg == 'admin_organ_update_not_standard'>
|
<#elseif msg?? && msg == 'admin_organ_update_not_standard'>
|
||||||
layer.msg('修改无法完成,上级机构选择错误',{icon: 2, time: 1500})
|
layer.msg('修改无法完成,上级机构选择错误',{icon: 2, time: 1500})
|
||||||
|
<#elseif msg?? && msg == 'not_allow_remove_user'>
|
||||||
|
layer.msg('用户只有一个组织,不允许移除',{icon: 2, time: 1500})
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,6 +35,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label">组织机构:</label>
|
||||||
|
<div class="layui-input-inline" style="position: relative;">
|
||||||
|
<input type="hidden" id="parent" name="parent" value="<#if currentOrgan??>${currentOrgan.id}<#else>0</#if>">
|
||||||
|
<input type="text" name="parentname" id="parentname" required value="<#if currentOrgan??>${currentOrgan.name}<#else>组织机构</#if>" lay-verify="requiredTwo" autocomplete="off" readOnly="readonly" onClick="showMenu();"
|
||||||
|
class="layui-input">
|
||||||
|
<i class="layui-icon" style="position: absolute;right: 3px;top: 6px;font-size: 25px;${systemConfig.color!'color:#0096C4;'}" onClick="showMenu()"></i>
|
||||||
|
<div id="menuContent" style="display:none; position: absolute;z-index:10000;width: 218px;" class="ukefu-ztree">
|
||||||
|
<ul id="organTree" class="ztree" style="width:208px;"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">管理员:</label>
|
<label class="layui-form-label">管理员:</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
@ -269,3 +284,109 @@ layui.use('form', function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<SCRIPT type="text/javascript">
|
||||||
|
var setting = {
|
||||||
|
data: {
|
||||||
|
simpleData: {
|
||||||
|
enable: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
callback: {
|
||||||
|
onClick: onClick,
|
||||||
|
beforeClick: beforeClick
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function beforeClick(treeId, treeNode) {
|
||||||
|
var zTree = $.fn.zTree.getZTreeObj("organTree")
|
||||||
|
nodes = zTree.getSelectedNodes();
|
||||||
|
var allow = true , lastnode ;
|
||||||
|
for (var i=0, l=nodes.length; i<l; i++) {
|
||||||
|
lastnode = nodes[i].type ;
|
||||||
|
if(nodes[i].organ && (nodes.length >= 1 && (event.ctrlKey || event.shiftKey))){
|
||||||
|
allow = false ; break ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(lastnode != treeNode.type && (event.ctrlKey || event.shiftKey)){
|
||||||
|
allow = false ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (allow == false) {
|
||||||
|
top.layer.alert("组织机构不能点选多个上级机构,也不能同时选择地区和机构", {icon: 3});
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onClick(e, treeId, treeNode) {
|
||||||
|
var zTree = $.fn.zTree.getZTreeObj("organTree"),
|
||||||
|
nodes = zTree.getSelectedNodes(),
|
||||||
|
v = "" , value = "";
|
||||||
|
nodes.sort(function compare(a,b){return a.id-b.id;});
|
||||||
|
for (var i=0, l=nodes.length; i<l; i++) {
|
||||||
|
v += nodes[i].name + ",";
|
||||||
|
if(value != ""){
|
||||||
|
value = value + "," ;
|
||||||
|
}
|
||||||
|
value = nodes[i].id ;
|
||||||
|
}
|
||||||
|
if (v.length > 0 ) v = v.substring(0, v.length-1);
|
||||||
|
if(treeNode.type == "area"){
|
||||||
|
$("#parentname").attr("value", v);
|
||||||
|
$("#parent").attr("value", "0");
|
||||||
|
$("#area").attr("value", value);
|
||||||
|
}else{
|
||||||
|
$("#parentname").attr("value", v);
|
||||||
|
$("#parent").attr("value", value);
|
||||||
|
$("#area").attr("value", "");
|
||||||
|
}
|
||||||
|
if (!event.ctrlKey && !event.shiftKey) {
|
||||||
|
hideMenu() ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var zNodes =[
|
||||||
|
// { id:'0', pId:'00', name:"组织机构", open:true , organ : true, type : "organ"}
|
||||||
|
<#if organList??>
|
||||||
|
<#list organList as organ>
|
||||||
|
{ id:'${organ.id!''}', pId:'${organ.parent!'0'}', name:"${organ.name!''}", open:true , organ : true , type : "organ", icon:"/images/dept.png" },
|
||||||
|
</#list>
|
||||||
|
</#if>
|
||||||
|
];
|
||||||
|
$(document).ready(function(){
|
||||||
|
var ztree = $.fn.zTree.init($("#organTree"), setting, zNodes);
|
||||||
|
<#if organData??>
|
||||||
|
var node = ztree.getNodeByParam('id', '${organData.parent!''}');//获取id为1的点
|
||||||
|
ztree.selectNode(node);//选择点
|
||||||
|
if(node){
|
||||||
|
$("#parentname").attr("value", node.name);
|
||||||
|
}
|
||||||
|
<#if organData.area??>
|
||||||
|
<#list organData.area?split(",") as area>
|
||||||
|
var areanode_${area_index} = ztree.getNodeByParam('id', '${area}');//获取id为1的点
|
||||||
|
ztree.selectNode(areanode_${area_index} , true );//选择点
|
||||||
|
</#list>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
</#if>
|
||||||
|
});
|
||||||
|
function showMenu() {
|
||||||
|
$("#menuContent").css({left:"0px", top:"38px"}).show();
|
||||||
|
|
||||||
|
$("body").bind("mousedown", onBodyDown);
|
||||||
|
}
|
||||||
|
function hideMenu() {
|
||||||
|
$("#menuContent").hide();
|
||||||
|
$("body").unbind("mousedown", onBodyDown);
|
||||||
|
}
|
||||||
|
function onBodyDown(event) {
|
||||||
|
if (!(event.target.id == "menuBtn" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
|
||||||
|
hideMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</SCRIPT>
|
||||||
|
@ -199,11 +199,11 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(answer){
|
if(answer){
|
||||||
var li = ' <li class="ukefu-agentservice-list" onclick="chooseAnswer(\''+answer.content+'\')">\n' +
|
var li = ' <li class="ukefu-agentservice-list chooseAnswer" data-title="'+answer.content+'">\n' +
|
||||||
' <div class="nowrap" title="'+result.data[j].post+'">问题:'+result.data[j].post+'</div>\n' +
|
' <div class="nowrap" title="'+result.data[j].post+'">问题:'+result.data[j].post+'</div>\n' +
|
||||||
' <div style="color: #333">\n' +
|
' <div style="color: #333">\n' +
|
||||||
' <p class="nowrap" title="'+answer.content+'" style="float: left ">答案:'+answer.content+'</p>\n' +
|
' <p class="nowrap" title="'+answer.content+'" style="float: left ">答案:'+answer.content+'</p>\n' +
|
||||||
' <button style="float: right" class="layui-btn layui-btn-mini" onclick="chooseAnswer(\''+answer.content+'\')">选择</button>\n' +
|
' <button style="float: right" class="layui-btn layui-btn-mini chooseAnswer" data-title="'+answer.content+'">选择</button>\n' +
|
||||||
' </div>\n' +
|
' </div>\n' +
|
||||||
' </li>'
|
' </li>'
|
||||||
$("#quickReplyAgentBox").append(li);
|
$("#quickReplyAgentBox").append(li);
|
||||||
@ -609,10 +609,9 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura
|
|||||||
showOrHide('none');
|
showOrHide('none');
|
||||||
};
|
};
|
||||||
|
|
||||||
function chooseAnswer(data){
|
// function chooseAnswer(data){
|
||||||
editor.html(data)
|
// editor.html(data)
|
||||||
}
|
// }
|
||||||
|
|
||||||
function showOrHide(data){
|
function showOrHide(data){
|
||||||
$("#agentAnswer").css("display",data)
|
$("#agentAnswer").css("display",data)
|
||||||
}
|
}
|
||||||
@ -651,11 +650,11 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(answer) {
|
if(answer) {
|
||||||
var li = ' <li class="ukefu-agentservice-list" onclick="chooseAnswer(\'' + answer.content + '\')">\n' +
|
var li = ' <li class="ukefu-agentservice-list chooseAnswer" data-title="'+answer.content+'">\n' +
|
||||||
' <div class="nowrap" title="' + result.data[j].post + '">问题:' + result.data[j].post + '</div>\n' +
|
' <div class="nowrap" title="' + result.data[j].post + '">问题:' + result.data[j].post + '</div>\n' +
|
||||||
' <div style="color: #333">\n' +
|
' <div style="color: #333">\n' +
|
||||||
' <p class="nowrap" title="' + answer.content + '" style="float: left ">答案:' + answer.content + '</p>\n' +
|
' <p class="nowrap" title="' + answer.content + '" style="float: left ">答案:' + answer.content + '</p>\n' +
|
||||||
' <button style="float: right" class="layui-btn layui-btn-mini" onclick="chooseAnswer(\'' + answer.content + '\')">选择</button>\n' +
|
' <button style="float: right" class="layui-btn layui-btn-mini chooseAnswer" data-title="'+answer.content+'">选择</button>\n' +
|
||||||
' </div>\n' +
|
' </div>\n' +
|
||||||
' </li>'
|
' </li>'
|
||||||
$("#quickReplyBox").append(li);
|
$("#quickReplyBox").append(li);
|
||||||
@ -752,6 +751,7 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura
|
|||||||
$("#searchlabel").removeClass('selected')
|
$("#searchlabel").removeClass('selected')
|
||||||
$("#all").addClass('selected')
|
$("#all").addClass('selected')
|
||||||
})
|
})
|
||||||
|
|
||||||
//点击标注
|
//点击标注
|
||||||
$('#searchlabel').click(function () {
|
$('#searchlabel').click(function () {
|
||||||
searchSwitch = !searchSwitch;
|
searchSwitch = !searchSwitch;
|
||||||
@ -817,5 +817,13 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#quickReplyAgentBox').on('click','.chooseAnswer', function(){
|
||||||
|
editor.html($(this).data('title'))
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#quickReplyBox').on('click','.chooseAnswer', function(){
|
||||||
|
editor.html($(this).data('title'))
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -182,11 +182,11 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(answer) {
|
if(answer) {
|
||||||
var li = ' <li class="ukefu-agentservice-list" onclick="chooseAnswer(\'' + answer.content + '\')">\n' +
|
var li = ' <li class="ukefu-agentservice-list chooseAnswer" data-title="'+answer.content+'">\n' +
|
||||||
' <div class="nowrap" title="' + result.data[j].post + '">问题:' + result.data[j].post + '</div>\n' +
|
' <div class="nowrap" title="' + result.data[j].post + '">问题:' + result.data[j].post + '</div>\n' +
|
||||||
' <div style="color: #333">\n' +
|
' <div style="color: #333">\n' +
|
||||||
' <p class="nowrap" title="' + answer.content + '" style="float: left ">答案:' + answer.content + '</p>\n' +
|
' <p class="nowrap" title="' + answer.content + '" style="float: left ">答案:' + answer.content + '</p>\n' +
|
||||||
' <button style="float: right" class="layui-btn layui-btn-mini" onclick="chooseAnswer(\'' + answer.content + '\')">选择</button>\n' +
|
' <button style="float: right" class="layui-btn layui-btn-mini chooseAnswer" data-title="'+answer.content+'">选择</button>\n' +
|
||||||
' </div>\n' +
|
' </div>\n' +
|
||||||
' </li>'
|
' </li>'
|
||||||
$("#ccaQuickReplyAgentBox").append(li);
|
$("#ccaQuickReplyAgentBox").append(li);
|
||||||
@ -634,11 +634,11 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(answer) {
|
if(answer) {
|
||||||
var li = ' <li class="ukefu-agentservice-list" onclick="chooseAnswer(\'' + answer.content + '\')">\n' +
|
var li = ' <li class="ukefu-agentservice-list chooseAnswer" data-title="'+answer.content+'">\n' +
|
||||||
' <div class="nowrap" title="' + result.data[j].post + '">问题:' + result.data[j].post + '</div>\n' +
|
' <div class="nowrap" title="' + result.data[j].post + '">问题:' + result.data[j].post + '</div>\n' +
|
||||||
' <div style="color: #333">\n' +
|
' <div style="color: #333">\n' +
|
||||||
' <p class="nowrap" title="' + answer.content + '" style="float: left ">答案:' + answer.content + '</p>\n' +
|
' <p class="nowrap" title="' + answer.content + '" style="float: left ">答案:' + answer.content + '</p>\n' +
|
||||||
' <button style="float: right" class="layui-btn layui-btn-mini" onclick="chooseAnswer(\'' + answer.content + '\')">选择</button>\n' +
|
' <button style="float: right" class="layui-btn layui-btn-mini chooseAnswer" data-title="'+answer.content+'">选择</button>\n' +
|
||||||
' </div>\n' +
|
' </div>\n' +
|
||||||
' </li>'
|
' </li>'
|
||||||
$("#ccaQuickReplyBox").append(li);
|
$("#ccaQuickReplyBox").append(li);
|
||||||
@ -800,6 +800,12 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura
|
|||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
$('#ccaQuickReplyAgentBox').on('click','.chooseAnswer', function(){
|
||||||
|
editor.html($(this).data('title'))
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#ccaQuickReplyBox').on('click','.chooseAnswer', function(){
|
||||||
|
editor.html($(this).data('title'))
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -349,16 +349,6 @@
|
|||||||
<!-- </#if>-->
|
<!-- </#if>-->
|
||||||
<!-- </#if>-->
|
<!-- </#if>-->
|
||||||
|
|
||||||
<#if models?seq_contains("chatbot")>
|
|
||||||
<#if user?? &&( user.roleAuthMap["A09"]?? || user.admin) >
|
|
||||||
<dd class="ukefu-left-menu" data-tooltip="智能机器人">
|
|
||||||
<a href="javascript:void(0)" data-title="智能机器人" onclick="return false;" data-href="/apps/chatbot/index.html" class="iframe_btn" data-id="chatbotIntegrationWin" data-type="tabAdd">
|
|
||||||
<i class="csfont" style="position: relative;"></i>
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</#if>
|
|
||||||
</#if>
|
|
||||||
|
|
||||||
<#if models?seq_contains("sample")>
|
<#if models?seq_contains("sample")>
|
||||||
<dd class="ukefu-left-menu" data-tooltip="插件示例">
|
<dd class="ukefu-left-menu" data-tooltip="插件示例">
|
||||||
<a href="javascript:void(0)" data-title="插件示例" onclick="return false;" data-href="/apps/sample/index.html" class="iframe_btn" data-id="samplePluginWin" data-type="tabAdd">
|
<a href="javascript:void(0)" data-title="插件示例" onclick="return false;" data-href="/apps/sample/index.html" class="iframe_btn" data-id="samplePluginWin" data-type="tabAdd">
|
||||||
|
@ -3183,6 +3183,7 @@ CREATE TABLE `uk_role` (
|
|||||||
`ORGI` varchar(32) DEFAULT NULL COMMENT '租户ID',
|
`ORGI` varchar(32) DEFAULT NULL COMMENT '租户ID',
|
||||||
`ORGID` varchar(32) DEFAULT NULL COMMENT '企业ID',
|
`ORGID` varchar(32) DEFAULT NULL COMMENT '企业ID',
|
||||||
`USERNAME` varchar(50) DEFAULT NULL COMMENT '用户名',
|
`USERNAME` varchar(50) DEFAULT NULL COMMENT '用户名',
|
||||||
|
`ORGAN` varchar(32) DEFAULT NULL COMMENT '部门',
|
||||||
PRIMARY KEY (`ID`) USING BTREE
|
PRIMARY KEY (`ID`) USING BTREE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='角色表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='角色表';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user