mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
Remove access = false
This commit is contained in:
parent
4f4616ccba
commit
540a480cd1
@ -39,20 +39,20 @@ public class CallCenterBlackController extends Handler{
|
||||
private BlackListRepository blackRes ;
|
||||
|
||||
@RequestMapping(value = "/black")
|
||||
@Menu(type = "callcenter" , subtype = "callcenterblack" , access = false , admin = true)
|
||||
@Menu(type = "callcenter", subtype = "callcenterblack", admin = true)
|
||||
public ModelAndView black(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
||||
map.addAttribute("blackList" , blackRes.findByOrgi(super.getOrgi(request)));
|
||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/black/index"));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/black/add")
|
||||
@Menu(type = "callcenter" , subtype = "black" , access = false , admin = true)
|
||||
@Menu(type = "callcenter", subtype = "black", admin = true)
|
||||
public ModelAndView blackadd(ModelMap map , HttpServletRequest request , @Valid String hostid) {
|
||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/black/add"));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/black/save")
|
||||
@Menu(type = "callcenter" , subtype = "black" , access = false , admin = true)
|
||||
@Menu(type = "callcenter", subtype = "black", admin = true)
|
||||
public ModelAndView blacksave(ModelMap map , HttpServletRequest request , @Valid String phones) {
|
||||
if(!StringUtils.isBlank(phones)){
|
||||
String[] ps = phones.split("[ ,,\t\n]") ;
|
||||
@ -74,14 +74,14 @@ public class CallCenterBlackController extends Handler{
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/black/edit")
|
||||
@Menu(type = "callcenter" , subtype = "black" , access = false , admin = true)
|
||||
@Menu(type = "callcenter", subtype = "black", admin = true)
|
||||
public ModelAndView blackedit(ModelMap map , HttpServletRequest request , @Valid String id) {
|
||||
map.addAttribute("black" , blackRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/black/edit"));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/black/update")
|
||||
@Menu(type = "callcenter" , subtype = "black" , access = false , admin = true)
|
||||
@Menu(type = "callcenter", subtype = "black", admin = true)
|
||||
public ModelAndView pbxhostupdate(ModelMap map , HttpServletRequest request , @Valid BlackEntity black) {
|
||||
if(!StringUtils.isBlank(black.getId())){
|
||||
BlackEntity oldBlack = blackRes.findByIdAndOrgi(black.getId(), super.getOrgi(request)) ;
|
||||
@ -96,7 +96,7 @@ public class CallCenterBlackController extends Handler{
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/black/delete")
|
||||
@Menu(type = "callcenter" , subtype = "black" , access = false , admin = true)
|
||||
@Menu(type = "callcenter", subtype = "black", admin = true)
|
||||
public ModelAndView blackdelete(ModelMap map , HttpServletRequest request , @Valid String id) {
|
||||
if(!StringUtils.isBlank(id)){
|
||||
blackRes.delete(id);
|
||||
|
@ -158,7 +158,7 @@ public class CallCenterMediaController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/play")
|
||||
@Menu(type = "callcenter", subtype = "play", access = false)
|
||||
@Menu(type = "callcenter", subtype = "play")
|
||||
public ModelAndView play(ModelMap map, HttpServletRequest request, @Valid final String id) {
|
||||
map.addAttribute("media", mediaRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||
return request(super.createRequestPageTempletResponse("/admin/callcenter/media/play"));
|
||||
|
@ -58,31 +58,30 @@ public class TemplateController extends Handler {
|
||||
private final Cache cache;
|
||||
|
||||
@RequestMapping("/index")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
public ModelAndView index(ModelMap map, HttpServletRequest request) {
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public ModelAndView index(ModelMap map) {
|
||||
map.addAttribute("sysDicList", Dict.getInstance().getDic(Constants.CSKEFU_SYSTEM_DIC));
|
||||
return request(super.createAdminTempletResponse("/admin/system/template/index"));
|
||||
}
|
||||
|
||||
@RequestMapping("/expall")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
public void expall(ModelMap map, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public void expall(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
List<Template> templateList = templateRes.findByOrgi(super.getOrgi(request));
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Template-Export-" + new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".data");
|
||||
response.getOutputStream().write(MainUtils.toBytes(templateList));
|
||||
return;
|
||||
}
|
||||
|
||||
@RequestMapping("/imp")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
public ModelAndView imp(ModelMap map, HttpServletRequest request) {
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public ModelAndView imp() {
|
||||
return request(super.createRequestPageTempletResponse("/admin/system/template/imp"));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@RequestMapping("/impsave")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
public ModelAndView impsave(ModelMap map, HttpServletRequest request, @RequestParam(value = "dataFile", required = false) MultipartFile dataFile) throws Exception {
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public ModelAndView impsave(@RequestParam(value = "dataFile", required = false) MultipartFile dataFile) throws Exception {
|
||||
if (dataFile != null && dataFile.getSize() > 0) {
|
||||
List<Template> templateList = (List<Template>) MainUtils.toObject(dataFile.getBytes());
|
||||
if (templateList != null && templateList.size() > 0) {
|
||||
@ -96,7 +95,7 @@ public class TemplateController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/list")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public ModelAndView list(ModelMap map, HttpServletRequest request, @Valid String type) {
|
||||
map.addAttribute("sysDic", dicRes.findById(type));
|
||||
map.addAttribute("templateList", templateRes.findByTemplettypeAndOrgi(type, super.getOrgi(request)));
|
||||
@ -104,14 +103,14 @@ public class TemplateController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/add")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
public ModelAndView add(ModelMap map, HttpServletRequest request, @Valid String type) {
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public ModelAndView add(ModelMap map, @Valid String type) {
|
||||
map.addAttribute("sysDic", dicRes.findById(type));
|
||||
return request(super.createRequestPageTempletResponse("/admin/system/template/add"));
|
||||
}
|
||||
|
||||
@RequestMapping("/save")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public ModelAndView save(HttpServletRequest request, @Valid Template template) {
|
||||
template.setOrgi(super.getOrgi(request));
|
||||
template.setCreatetime(new Date());
|
||||
@ -127,7 +126,7 @@ public class TemplateController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/edit")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String type) {
|
||||
map.addAttribute("sysDic", dicRes.findById(type));
|
||||
map.addAttribute("template", templateRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||
@ -135,7 +134,7 @@ public class TemplateController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/update")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public ModelAndView update(HttpServletRequest request, @Valid Template template) {
|
||||
Template oldTemplate = templateRes.findByIdAndOrgi(template.getId(), super.getOrgi(request));
|
||||
if (oldTemplate != null) {
|
||||
@ -157,7 +156,7 @@ public class TemplateController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/code")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public ModelAndView code(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String type) {
|
||||
map.addAttribute("sysDic", dicRes.findById(type));
|
||||
map.addAttribute("template", templateRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
||||
@ -165,7 +164,7 @@ public class TemplateController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/codesave")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public ModelAndView codesave(HttpServletRequest request, @Valid Template template) {
|
||||
Template oldTemplate = templateRes.findByIdAndOrgi(template.getId(), super.getOrgi(request));
|
||||
if (oldTemplate != null) {
|
||||
@ -179,7 +178,7 @@ public class TemplateController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/delete")
|
||||
@Menu(type = "admin", subtype = "template", access = false, admin = true)
|
||||
@Menu(type = "admin", subtype = "template", admin = true)
|
||||
public ModelAndView delete(HttpServletRequest request, @Valid Template template) {
|
||||
templateRes.delete(template);
|
||||
cache.deleteSystembyIdAndOrgi(template.getId(), super.getOrgi(request));
|
||||
|
@ -60,7 +60,7 @@ public class AgentQualityController extends Handler {
|
||||
private Cache cache;
|
||||
|
||||
@RequestMapping(value = "/index")
|
||||
@Menu(type = "agent", subtype = "quality", access = false)
|
||||
@Menu(type = "agent", subtype = "quality")
|
||||
public ModelAndView index(ModelMap map, HttpServletRequest request) {
|
||||
map.addAttribute("sessionConfig", acdPolicyService.initSessionConfig(super.getOrgi(request)));
|
||||
map.addAttribute("qualityList", qualityRes.findByQualitytypeAndOrgi(MainContext.QualityType.CHAT.toString(), super.getOrgi(request)));
|
||||
@ -70,7 +70,7 @@ public class AgentQualityController extends Handler {
|
||||
|
||||
|
||||
@RequestMapping(value = "/save")
|
||||
@Menu(type = "agent", subtype = "quality", access = false)
|
||||
@Menu(type = "agent", subtype = "quality")
|
||||
public ModelAndView save(ModelMap map, HttpServletRequest request, @Valid QualityRequest qualityArray) {
|
||||
String orgi = super.getOrgi(request);
|
||||
|
||||
|
@ -50,133 +50,129 @@ import java.util.Date;
|
||||
public class KbsController extends Handler {
|
||||
|
||||
@Autowired
|
||||
private TagRepository tagRes ;
|
||||
private TagRepository tagRes;
|
||||
|
||||
@Autowired
|
||||
private KbsTypeRepository kbsTypeRes ;
|
||||
private KbsTypeRepository kbsTypeRes;
|
||||
|
||||
@Autowired
|
||||
private KbsTopicRepository kbsTopicRes ;
|
||||
private KbsTopicRepository kbsTopicRes;
|
||||
|
||||
@Autowired
|
||||
private AttachmentRepository attachementRes;
|
||||
|
||||
@Value("${web.upload-path}")
|
||||
private String path;
|
||||
private String path;
|
||||
|
||||
@RequestMapping({"/index"})
|
||||
@Menu(type="apps", subtype="kbs")
|
||||
public ModelAndView index(ModelMap map , HttpServletRequest request){
|
||||
@Menu(type = "apps", subtype = "kbs")
|
||||
public ModelAndView index(ModelMap map, HttpServletRequest request) {
|
||||
return request(super.createAppsTempletResponse("/apps/business/kbs/index"));
|
||||
}
|
||||
|
||||
@RequestMapping({"/list"})
|
||||
@Menu(type="apps", subtype="kbs")
|
||||
public ModelAndView list(ModelMap map , HttpServletRequest request){
|
||||
map.addAttribute("kbsTypeResList", kbsTypeRes.findByOrgi(super.getOrgi(request))) ;
|
||||
@Menu(type = "apps", subtype = "kbs")
|
||||
public ModelAndView list(ModelMap map, HttpServletRequest request) {
|
||||
map.addAttribute("kbsTypeResList", kbsTypeRes.findByOrgi(super.getOrgi(request)));
|
||||
return request(super.createAppsTempletResponse("/apps/business/kbs/list"));
|
||||
}
|
||||
|
||||
@RequestMapping({"/list/type"})
|
||||
@Menu(type="apps", subtype="kbs")
|
||||
public ModelAndView listtype(ModelMap map , HttpServletRequest request,@Valid String typeid){
|
||||
if(!StringUtils.isBlank(typeid) && !typeid.equals("0")){
|
||||
map.addAttribute("kbsType", kbsTypeRes.findByIdAndOrgi(typeid, super.getOrgi(request))) ;
|
||||
@Menu(type = "apps", subtype = "kbs")
|
||||
public ModelAndView listtype(ModelMap map, HttpServletRequest request, @Valid String typeid) {
|
||||
if (!StringUtils.isBlank(typeid) && !typeid.equals("0")) {
|
||||
map.addAttribute("kbsType", kbsTypeRes.findByIdAndOrgi(typeid, super.getOrgi(request)));
|
||||
}
|
||||
return request(super.createRequestPageTempletResponse("/apps/business/kbs/typelist"));
|
||||
}
|
||||
|
||||
@RequestMapping({"/addtype"})
|
||||
@Menu(type="apps", subtype="kbs")
|
||||
public ModelAndView addtype(ModelMap map , HttpServletRequest request ){
|
||||
map.addAttribute("kbsTypeResList", kbsTypeRes.findByOrgi(super.getOrgi(request))) ;
|
||||
@Menu(type = "apps", subtype = "kbs")
|
||||
public ModelAndView addtype(ModelMap map, HttpServletRequest request) {
|
||||
map.addAttribute("kbsTypeResList", kbsTypeRes.findByOrgi(super.getOrgi(request)));
|
||||
return request(super.createRequestPageTempletResponse("/apps/business/kbs/addtype"));
|
||||
}
|
||||
|
||||
@RequestMapping("/type/save")
|
||||
@Menu(type = "apps" , subtype = "kbs")
|
||||
public ModelAndView typesave(HttpServletRequest request ,@Valid KbsType kbsType) {
|
||||
int count = kbsTypeRes.countByOrgiAndNameAndParentid(super.getOrgi(request), kbsType.getName(), kbsType.getParentid()) ;
|
||||
if(count == 0){
|
||||
kbsType.setOrgi(super.getOrgi(request));
|
||||
kbsType.setCreater(super.getUser(request).getId());
|
||||
kbsType.setCreatetime(new Date());
|
||||
kbsTypeRes.save(kbsType) ;
|
||||
}
|
||||
return request(super.createRequestPageTempletResponse("redirect:/apps/kbs/list.html"));
|
||||
}
|
||||
@RequestMapping("/type/save")
|
||||
@Menu(type = "apps", subtype = "kbs")
|
||||
public ModelAndView typesave(HttpServletRequest request, @Valid KbsType kbsType) {
|
||||
int count = kbsTypeRes.countByOrgiAndNameAndParentid(super.getOrgi(request), kbsType.getName(), kbsType.getParentid());
|
||||
if (count == 0) {
|
||||
kbsType.setOrgi(super.getOrgi(request));
|
||||
kbsType.setCreater(super.getUser(request).getId());
|
||||
kbsType.setCreatetime(new Date());
|
||||
kbsTypeRes.save(kbsType);
|
||||
}
|
||||
return request(super.createRequestPageTempletResponse("redirect:/apps/kbs/list.html"));
|
||||
}
|
||||
|
||||
@RequestMapping({"/add"})
|
||||
@Menu(type="apps", subtype="kbs")
|
||||
public ModelAndView add(ModelMap map , HttpServletRequest request ,@Valid String typeid){
|
||||
map.addAttribute("kbsTypeResList", kbsTypeRes.findByOrgi(super.getOrgi(request))) ;
|
||||
map.addAttribute("tags", tagRes.findByOrgiAndTagtype(super.getOrgi(request) , MainContext.ModelType.KBS.toString())) ;
|
||||
if(!StringUtils.isBlank(typeid) && !typeid.equals("0")){
|
||||
map.addAttribute("kbsType", kbsTypeRes.findByIdAndOrgi(typeid, super.getOrgi(request))) ;
|
||||
@RequestMapping({"/add"})
|
||||
@Menu(type = "apps", subtype = "kbs")
|
||||
public ModelAndView add(ModelMap map, HttpServletRequest request, @Valid String typeid) {
|
||||
map.addAttribute("kbsTypeResList", kbsTypeRes.findByOrgi(super.getOrgi(request)));
|
||||
map.addAttribute("tags", tagRes.findByOrgiAndTagtype(super.getOrgi(request), MainContext.ModelType.KBS.toString()));
|
||||
if (!StringUtils.isBlank(typeid) && !typeid.equals("0")) {
|
||||
map.addAttribute("kbsType", kbsTypeRes.findByIdAndOrgi(typeid, super.getOrgi(request)));
|
||||
}
|
||||
return request(super.createRequestPageTempletResponse("/apps/business/kbs/add"));
|
||||
}
|
||||
|
||||
@RequestMapping("/save")
|
||||
@Menu(type = "topic" , subtype = "save" , access = false)
|
||||
public ModelAndView save(HttpServletRequest request ,
|
||||
final @Valid KbsTopic topic ,
|
||||
@RequestMapping("/save")
|
||||
@Menu(type = "topic", subtype = "save")
|
||||
public ModelAndView save(HttpServletRequest request,
|
||||
final @Valid KbsTopic topic,
|
||||
@RequestParam(value = "files", required = false) MultipartFile[] files) throws IOException {
|
||||
ModelAndView view = request(super.createRequestPageTempletResponse("redirect:/apps/kbs/index.html"));
|
||||
topic.setOrgi(super.getOrgi(request));
|
||||
topic.setCreater(super.getUser(request).getId());
|
||||
topic.setUsername(super.getUser(request).getUsername());
|
||||
ModelAndView view = request(super.createRequestPageTempletResponse("redirect:/apps/kbs/index.html"));
|
||||
topic.setOrgi(super.getOrgi(request));
|
||||
topic.setCreater(super.getUser(request).getId());
|
||||
topic.setUsername(super.getUser(request).getUsername());
|
||||
|
||||
processAttachmentFile(files, topic, request, topic.getId(), topic.getId());
|
||||
processAttachmentFile(files, topic, request, topic.getId(), topic.getId());
|
||||
|
||||
KbsType workOrderType = kbsTypeRes.findByIdAndOrgi(topic.getTptype(), super.getOrgi(request)) ;
|
||||
// 知识处理流程,如果知识分类需要审批,则触发知识流程
|
||||
if(workOrderType.isApproval()){
|
||||
topic.setApproval(false);
|
||||
}else{
|
||||
topic.setApproval(true);
|
||||
}
|
||||
kbsTopicRes.save(topic) ;
|
||||
return view;
|
||||
}
|
||||
KbsType workOrderType = kbsTypeRes.findByIdAndOrgi(topic.getTptype(), super.getOrgi(request));
|
||||
// 知识处理流程,如果知识分类需要审批,则触发知识流程
|
||||
topic.setApproval(!workOrderType.isApproval());
|
||||
kbsTopicRes.save(topic);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
private void processAttachmentFile(MultipartFile[] files , KbsTopic topic, HttpServletRequest request , String dataid , String modelid) throws IOException{
|
||||
if(files!=null && files.length > 0){
|
||||
topic.setAttachment(""); //序列化 附件文件,方便显示,避免多一次查询 附件的操作
|
||||
//保存附件
|
||||
for(MultipartFile file : files){
|
||||
if(file.getSize() > 0){ //文件尺寸 限制 ?在 启动 配置中 设置 的最大值,其他地方不做限制
|
||||
String fileid = MainUtils.md5(file.getBytes()) ; //使用 文件的 MD5作为 ID,避免重复上传大文件
|
||||
if(!StringUtils.isBlank(fileid)){
|
||||
AttachmentFile attachmentFile = new AttachmentFile() ;
|
||||
attachmentFile.setCreater(super.getUser(request).getId());
|
||||
attachmentFile.setOrgi(super.getOrgi(request));
|
||||
attachmentFile.setDataid(dataid);
|
||||
attachmentFile.setModelid(modelid);
|
||||
attachmentFile.setModel(MainContext.ModelType.WORKORDERS.toString());
|
||||
attachmentFile.setFilelength((int) file.getSize());
|
||||
if(file.getContentType()!=null && file.getContentType().length() > 255){
|
||||
attachmentFile.setFiletype(file.getContentType().substring(0 , 255));
|
||||
}else{
|
||||
attachmentFile.setFiletype(file.getContentType());
|
||||
}
|
||||
if(file.getOriginalFilename()!=null && file.getOriginalFilename().length() > 255){
|
||||
attachmentFile.setTitle(file.getOriginalFilename().substring(0 , 255));
|
||||
}else{
|
||||
attachmentFile.setTitle(file.getOriginalFilename());
|
||||
}
|
||||
if(!StringUtils.isBlank(attachmentFile.getFiletype()) && attachmentFile.getFiletype().indexOf("image") >= 0){
|
||||
attachmentFile.setImage(true);
|
||||
}
|
||||
attachmentFile.setFileid(fileid);
|
||||
attachementRes.save(attachmentFile) ;
|
||||
FileUtils.writeByteArrayToFile(new File(path , "app/kbs/"+fileid), file.getBytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
private void processAttachmentFile(MultipartFile[] files, KbsTopic topic, HttpServletRequest request, String dataid, String modelid) throws IOException {
|
||||
if (files != null && files.length > 0) {
|
||||
topic.setAttachment(""); //序列化 附件文件,方便显示,避免多一次查询 附件的操作
|
||||
//保存附件
|
||||
for (MultipartFile file : files) {
|
||||
if (file.getSize() > 0) { //文件尺寸 限制 ?在 启动 配置中 设置 的最大值,其他地方不做限制
|
||||
String fileid = MainUtils.md5(file.getBytes()); //使用 文件的 MD5作为 ID,避免重复上传大文件
|
||||
if (!StringUtils.isBlank(fileid)) {
|
||||
AttachmentFile attachmentFile = new AttachmentFile();
|
||||
attachmentFile.setCreater(super.getUser(request).getId());
|
||||
attachmentFile.setOrgi(super.getOrgi(request));
|
||||
attachmentFile.setDataid(dataid);
|
||||
attachmentFile.setModelid(modelid);
|
||||
attachmentFile.setModel(MainContext.ModelType.WORKORDERS.toString());
|
||||
attachmentFile.setFilelength((int) file.getSize());
|
||||
if (file.getContentType() != null && file.getContentType().length() > 255) {
|
||||
attachmentFile.setFiletype(file.getContentType().substring(0, 255));
|
||||
} else {
|
||||
attachmentFile.setFiletype(file.getContentType());
|
||||
}
|
||||
if (file.getOriginalFilename() != null && file.getOriginalFilename().length() > 255) {
|
||||
attachmentFile.setTitle(file.getOriginalFilename().substring(0, 255));
|
||||
} else {
|
||||
attachmentFile.setTitle(file.getOriginalFilename());
|
||||
}
|
||||
if (!StringUtils.isBlank(attachmentFile.getFiletype()) && attachmentFile.getFiletype().indexOf("image") >= 0) {
|
||||
attachmentFile.setImage(true);
|
||||
}
|
||||
attachmentFile.setFileid(fileid);
|
||||
attachementRes.save(attachmentFile);
|
||||
FileUtils.writeByteArrayToFile(new File(path, "app/kbs/" + fileid), file.getBytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ public class AgentSummaryController extends Handler {
|
||||
* 按条件查询
|
||||
*/
|
||||
@RequestMapping(value = "/index")
|
||||
@Menu(type = "agent", subtype = "agentsummary", access = false)
|
||||
@Menu(type = "agent", subtype = "agentsummary")
|
||||
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid final String begin, @Valid final String end) {
|
||||
final String orgi = super.getOrgi(request);
|
||||
Page<AgentServiceSummary> page = serviceSummaryRes.findAll((Specification<AgentServiceSummary>) (root, query, cb) -> {
|
||||
@ -105,7 +105,7 @@ public class AgentSummaryController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/process")
|
||||
@Menu(type = "agent", subtype = "agentsummary", access = false)
|
||||
@Menu(type = "agent", subtype = "agentsummary")
|
||||
public ModelAndView process(ModelMap map, HttpServletRequest request, @Valid final String id) {
|
||||
AgentServiceSummary summary = serviceSummaryRes.findByIdAndOrgi(id, super.getOrgi(request));
|
||||
map.addAttribute("summary", summary);
|
||||
@ -123,7 +123,7 @@ public class AgentSummaryController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/save")
|
||||
@Menu(type = "agent", subtype = "agentsummary", access = false)
|
||||
@Menu(type = "agent", subtype = "agentsummary")
|
||||
public ModelAndView save(HttpServletRequest request, @Valid final AgentServiceSummary summary) {
|
||||
AgentServiceSummary oldSummary = serviceSummaryRes.findByIdAndOrgi(summary.getId(), super.getOrgi(request));
|
||||
if (oldSummary != null) {
|
||||
@ -138,7 +138,7 @@ public class AgentSummaryController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/expids")
|
||||
@Menu(type = "agent", subtype = "agentsummary", access = false)
|
||||
@Menu(type = "agent", subtype = "agentsummary")
|
||||
public void expids(HttpServletResponse response, @Valid String[] ids) throws IOException {
|
||||
if (ids != null && ids.length > 0) {
|
||||
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findAllById(Arrays.asList(ids));
|
||||
@ -156,7 +156,7 @@ public class AgentSummaryController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/expall")
|
||||
@Menu(type = "agent", subtype = "agentsummary", access = false)
|
||||
@Menu(type = "agent", subtype = "agentsummary")
|
||||
public void expall(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findByChannelNotAndOrgi(
|
||||
MainContext.ChannelType.PHONE.toString(), super.getOrgi(request), PageRequest.of(0, 10000));
|
||||
@ -174,7 +174,7 @@ public class AgentSummaryController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/expsearch")
|
||||
@Menu(type = "agent", subtype = "agentsummary", access = false)
|
||||
@Menu(type = "agent", subtype = "agentsummary")
|
||||
public void expall(HttpServletRequest request, HttpServletResponse response, @Valid final String begin, @Valid final String end) throws IOException {
|
||||
final String orgi = super.getOrgi(request);
|
||||
Page<AgentServiceSummary> page = serviceSummaryRes.findAll((Specification<AgentServiceSummary>) (root, query, cb) -> {
|
||||
|
@ -73,7 +73,7 @@ public class ProcessedSummaryController extends Handler {
|
||||
* 按条件查询
|
||||
*/
|
||||
@RequestMapping(value = "/index")
|
||||
@Menu(type = "agent", subtype = "processed", access = false)
|
||||
@Menu(type = "agent", subtype = "processed")
|
||||
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid final String ani, @Valid final String called, @Valid final String begin, @Valid final String end) {
|
||||
final String orgi = super.getOrgi(request);
|
||||
Page<AgentServiceSummary> page = serviceSummaryRes.findAll((Specification<AgentServiceSummary>) (root, query, cb) -> {
|
||||
@ -113,7 +113,7 @@ public class ProcessedSummaryController extends Handler {
|
||||
|
||||
|
||||
@RequestMapping(value = "/process")
|
||||
@Menu(type = "agent", subtype = "processed", access = false)
|
||||
@Menu(type = "agent", subtype = "processed")
|
||||
public ModelAndView process(ModelMap map, HttpServletRequest request, @Valid final String id) {
|
||||
AgentServiceSummary summary = serviceSummaryRes.findByIdAndOrgi(id, super.getOrgi(request));
|
||||
map.addAttribute("summary", summary);
|
||||
@ -131,7 +131,7 @@ public class ProcessedSummaryController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/save")
|
||||
@Menu(type = "agent", subtype = "processed", access = false)
|
||||
@Menu(type = "agent", subtype = "processed")
|
||||
public ModelAndView save(HttpServletRequest request, @Valid final AgentServiceSummary summary) {
|
||||
AgentServiceSummary oldSummary = serviceSummaryRes.findByIdAndOrgi(summary.getId(), super.getOrgi(request));
|
||||
if (oldSummary != null) {
|
||||
@ -146,7 +146,7 @@ public class ProcessedSummaryController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/expids")
|
||||
@Menu(type = "agent", subtype = "processed", access = false)
|
||||
@Menu(type = "agent", subtype = "processed")
|
||||
public void expids(HttpServletResponse response, @Valid String[] ids) throws IOException {
|
||||
if (ids != null && ids.length > 0) {
|
||||
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findAllById(Arrays.asList(ids));
|
||||
@ -165,7 +165,7 @@ public class ProcessedSummaryController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/expall")
|
||||
@Menu(type = "agent", subtype = "processed", access = false)
|
||||
@Menu(type = "agent", subtype = "processed")
|
||||
public void expall(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
Iterable<AgentServiceSummary> statusEventList = serviceSummaryRes.findByChannelNotAndOrgi(
|
||||
MainContext.ChannelType.PHONE.toString(), super.getOrgi(request), PageRequest.of(0, 10000));
|
||||
@ -183,7 +183,7 @@ public class ProcessedSummaryController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/expsearch")
|
||||
@Menu(type = "agent", subtype = "processed", access = false)
|
||||
@Menu(type = "agent", subtype = "processed")
|
||||
public void expall(HttpServletRequest request, HttpServletResponse response, @Valid final String ani, @Valid final String called, @Valid final String begin, @Valid final String end) throws IOException {
|
||||
final String orgi = super.getOrgi(request);
|
||||
Page<AgentServiceSummary> page = serviceSummaryRes.findAll((Specification<AgentServiceSummary>) (root, query, cb) -> {
|
||||
|
@ -63,7 +63,7 @@ public class MediaController extends Handler {
|
||||
@Autowired
|
||||
private JpaBlobHelper jpaBlobHelper;
|
||||
|
||||
private String TEMPLATE_DATA_PATH = "WEB-INF/data/templates/";
|
||||
private final String TEMPLATE_DATA_PATH = "WEB-INF/data/templates/";
|
||||
|
||||
@Autowired
|
||||
private AttachmentRepository attachementRes;
|
||||
@ -117,7 +117,7 @@ public class MediaController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/image/upload")
|
||||
@Menu(type = "resouce", subtype = "imageupload", access = false)
|
||||
@Menu(type = "resouce", subtype = "imageupload")
|
||||
public ModelAndView upload(ModelMap map,
|
||||
HttpServletRequest request,
|
||||
@RequestParam(value = "imgFile", required = false) MultipartFile multipart) throws IOException {
|
||||
@ -145,7 +145,7 @@ public class MediaController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/file")
|
||||
@Menu(type = "resouce", subtype = "file", access = false)
|
||||
@Menu(type = "resouce", subtype = "file")
|
||||
public void file(HttpServletResponse response, HttpServletRequest request, @Valid String id) throws IOException, SQLException {
|
||||
if (StringUtils.isNotBlank(id)) {
|
||||
AttachmentFile attachmentFile = attachementRes.findByIdAndOrgi(id, super.getOrgi(request));
|
||||
@ -165,7 +165,7 @@ public class MediaController extends Handler {
|
||||
}
|
||||
|
||||
@RequestMapping("/template")
|
||||
@Menu(type = "resouce", subtype = "template", access = false)
|
||||
@Menu(type = "resouce", subtype = "template")
|
||||
public void template(HttpServletResponse response, HttpServletRequest request, @Valid String filename) throws IOException {
|
||||
if (StringUtils.isNotBlank(filename)) {
|
||||
InputStream is = MediaController.class.getClassLoader().getResourceAsStream(TEMPLATE_DATA_PATH + filename);
|
||||
|
Loading…
x
Reference in New Issue
Block a user