You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
3.4 KiB

package com.archive.project.document.controller
;
import com.archive.common.archiveUtil.TableUtil;
import com.archive.framework.web.controller.BaseController;
import com.archive.framework.web.domain.AjaxResult;
import com.archive.framework.web.page.TableDataInfo;
import com.archive.project.dasz.archivetype.domain.ArchiveType;
import com.archive.project.dasz.archivetype.service.IArchiveTypeService;
import com.archive.project.dasz.physicaltable.service.IPhysicalTableService;
import com.archive.project.dasz.physicaltablecolumn.service.IPhysicalTableColumnService;
import com.archive.project.document.domain.Document;
import com.archive.project.document.service.IDocumentService;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping({"/document"})
public class DocumentController
extends BaseController
{
private String prefix = "document";
@Autowired
private IDocumentService documentService;
@Autowired
private IArchiveTypeService archiveTypeService;
@Autowired
private IPhysicalTableColumnService physicalTableColumnService;
@Autowired
private IPhysicalTableService physicalTableService;
@RequiresPermissions({"document"})
@GetMapping
public String document() {
return this.prefix + "/document";
}
@RequiresPermissions({"document:qwgl"})
@GetMapping({"/qwgl/{archiveId}/{type}/{id}"})
public String qwgl(@PathVariable("archiveId") long archiveId, @PathVariable("type") String type, @PathVariable("id") String id, ModelMap mmap) {
long tableId = TableUtil.getTableIdByArchiveTypeId(archiveId);
mmap.put("tableId", Long.valueOf(tableId));
mmap.put("fileId", id);
mmap.put("archiveTypeId", Long.valueOf(archiveId));
return this.prefix + "/document";
}
@RequiresPermissions({"document:list"})
@PostMapping({"/list"})
@ResponseBody
public TableDataInfo list(String ownerId, String tableId) {
startPage();
Document document = new Document();
document.setTableId(tableId);
document.setOwnerid(ownerId);
List<Document> list = this.documentService.selectDocumentList(document);
return getDataTable(list);
}
@PostMapping({"/delete"})
@ResponseBody
public AjaxResult delete(String id, String tableId) throws Exception {
boolean res = this.documentService.deleteDocument(id, tableId);
return AjaxResult.success(!res ? "false" : "true");
}
@PostMapping({"/getArchiveTypeByTableId"})
@ResponseBody
public AjaxResult getArchiveTypeByTableId(String tableId) {
ArchiveType archiveType = this.documentService.selectArchiveTypeByTableId(tableId);
return AjaxResult.success(archiveType);
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\document\controller\DocumentController.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/