feat:修改文件展示传输

dev
wangxy 4 months ago
parent 5a39ce00aa
commit 3738ff2610

@ -1,69 +1,69 @@
/* */ package com.archive.project.dacx.archivesearch.controller
package com.archive.project.dacx.archivesearch.controller
;
/* */
/* */ import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.page.PageDomain;
/* */ import com.archive.framework.web.page.TableDataInfo;
/* */ import com.archive.framework.web.page.TableSupport;
/* */ import com.archive.project.dacx.archivesearch.service.IArchiveSearchService;
/* */ import com.archive.project.system.dict.service.IDictTypeService;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ 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({"/dacx/archivesearch"})
/* */ public class ArchiveSearchController
/* */ extends BaseController
/* */ {
/* 32 */ private String prefix = "dacx/archivesearch";
/* */
/* */
/* */ @Autowired
/* */ private IArchiveSearchService archivesearchService;
/* */
/* */ @Autowired
/* */ private IDictTypeService dictTypeService;
/* */
/* */
/* */ @RequiresPermissions({"dacx:archivesearch:view"})
/* */ @GetMapping
/* */ public String archivesearch(ModelMap mmap) {
/* 45 */ return this.prefix + "/archivesearch";
/* */ }
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"dacx:archivesearch:list"})
/* */ @PostMapping({"/list/{ft}/{py}/{qw}"})
/* */ @ResponseBody
/* */ public TableDataInfo list(String keyword, @PathVariable("ft") String ft, @PathVariable("py") String py, @PathVariable("qw") String qw) throws Exception {
/* 55 */ PageDomain pageDomain = TableSupport.buildPageRequest();
/* 56 */ Integer pageNum = pageDomain.getPageNum();
/* 57 */ Integer pageSize = pageDomain.getPageSize();
/* 58 */ String orderBy = pageDomain.getOrderBy();
/* 59 */ String orderByColumn = pageDomain.getOrderByColumn();
/* 60 */ Map<String, Object> map = this.archivesearchService.selectArchiveList(pageNum, pageSize, orderBy, orderByColumn, keyword, ft, py, qw);
/* 61 */ TableDataInfo tableDataInfo = new TableDataInfo((List)map.get("list"), ((Integer)map.get("count")).intValue());
/* 62 */ return tableDataInfo;
/* */ }
/* */ }
import com.archive.framework.web.controller.BaseController;
import com.archive.framework.web.page.PageDomain;
import com.archive.framework.web.page.TableDataInfo;
import com.archive.framework.web.page.TableSupport;
import com.archive.project.dacx.archivesearch.service.IArchiveSearchService;
import com.archive.project.system.dict.service.IDictTypeService;
import java.util.List;
import java.util.Map;
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({"/dacx/archivesearch"})
public class ArchiveSearchController
extends BaseController
{
private String prefix = "dacx/archivesearch";
@Autowired
private IArchiveSearchService archivesearchService;
@Autowired
private IDictTypeService dictTypeService;
@RequiresPermissions({"dacx:archivesearch:view"})
@GetMapping
public String archivesearch(ModelMap mmap) {
return this.prefix + "/archivesearch";
}
@RequiresPermissions({"dacx:archivesearch:list"})
@PostMapping({"/list/{ft}/{py}/{qw}"})
@ResponseBody
public TableDataInfo list(String keyword, @PathVariable("ft") String ft, @PathVariable("py") String py, @PathVariable("qw") String qw) throws Exception {
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
String orderBy = pageDomain.getOrderBy();
String orderByColumn = pageDomain.getOrderByColumn();
Map<String, Object> map = this.archivesearchService.selectArchiveList(pageNum, pageSize, orderBy, orderByColumn, keyword, ft, py, qw);
TableDataInfo tableDataInfo = new TableDataInfo((List)map.get("list"), ((Integer)map.get("count")).intValue());
return tableDataInfo;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dacx\archivesearch\controller\ArchiveSearchController.class

@ -1,160 +1,160 @@
/* */ package com.archive.project.dacx.archivesearch.service.impl;
/* */
/* */ import com.archive.common.archiveUtil.AnsjTextUtil;
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.project.common.service.IExecuteSqlService;
/* */ import com.archive.project.dacx.archivesearch.service.IArchiveSearchService;
/* */ import com.archive.project.dasz.archivetype.mapper.ArchiveTypeMapper;
/* */ import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper;
/* */ import java.util.ArrayList;
/* */ import java.util.HashMap;
/* */ import java.util.LinkedHashMap;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service
/* */ public class ArchiveSearchServiceImpl
/* */ implements IArchiveSearchService
/* */ {
/* */ @Autowired
/* */ private ArchiveTypeMapper archiveTypeMapper;
/* */ @Autowired
/* */ private PhysicalTableMapper physicalTableMapper;
/* */ @Autowired
/* */ private IExecuteSqlService executeSqlService;
/* */ @Override
/* */ public Map<String, Object> selectArchiveList(Integer pageNum, Integer pageSize, String orderBy, String orderByColumn, String keyword, String ft, String py, String qw) {
/* 51 */ Map<String, Object> resultMap = new HashMap<>();
/* 52 */ List<LinkedHashMap<String, Object>> resultList = new ArrayList<>();
/* 53 */ Integer count = Integer.valueOf(0);
/* 54 */ Integer beginNum = Integer.valueOf((pageNum.intValue() - 1) * pageSize.intValue());
/* 55 */ String sql = "";
/* 56 */ String condition = "";
/* */
/* 58 */ if (keyword.equals("0")) {
/* 59 */ keyword = "";
/* */ }
/* */
/* 62 */ if (!keyword.equals("")) {
/* 63 */ String[] sttrs = keyword.split(" ");
/* 64 */ for (int i = 0; i < sttrs.length; i++) {
/* */
/* 66 */ String nlpfcResult = AnsjTextUtil.nlpfc(sttrs[i]);
/* 67 */ String[] words = nlpfcResult.split(",");
/* 68 */ for (int j = 0; j < words.length; j++) {
/* 69 */ condition = condition + " rowContext like '%" + words[i] + "%' OR";
/* 70 */ if (ft.equals("true"))
/* */ {
/* 72 */ condition = condition + " fantiContext like '%" + words[i] + "%' OR";
/* */ }
/* 74 */ if (py.equals("true"))
/* */ {
/* 76 */ condition = condition + " pinyinContext like '%" + words[i] + "%' OR";
/* */ }
/* 78 */ if (qw.equals("true"))
/* */ {
/* 80 */ condition = condition + " fileContext like '%" + words[i] + "%' OR";
/* */ }
/* */ }
/* */ }
/* */ }
/* */
/* 86 */ if (condition.trim().equals("")) {
/* 87 */ condition = " 1=1";
/* */ } else {
/* 89 */ condition = condition.substring(0, condition.lastIndexOf("OR"));
/* */ }
/* 91 */ sql = "select archiveId,tableId,archiveTypeId,archiveTypeCode,archiveType,qzh,qzmc,yearCode,bgqx,tm,zrz,rq,dh,archiveTypeName from t_ar_total where " + condition + " limit " + beginNum + " , " + pageSize;
/* 92 */ if (StringUtils.isNotEmpty(orderBy) && StringUtils.isNotEmpty(orderByColumn)) {
/* 93 */ sql = sql + " order by " + orderByColumn + orderBy;
/* */ }
/* 95 */ resultList = this.executeSqlService.queryList(sql);
/* 96 */ String countSql = "select COUNT(*) from t_ar_total where " + condition;
/* 97 */ count = this.executeSqlService.jdbcTemplateQueryCount(countSql);
/* */
/* */
/* 100 */ if (resultList.size() > 0 && !keyword.equals("")) {
/* 101 */ for (int i = 0; i < resultList.size(); i++) {
/* 102 */ String qzh = (((LinkedHashMap)resultList.get(i)).get("qzh") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("qzh").toString();
/* 103 */ String qzmc = (((LinkedHashMap)resultList.get(i)).get("qzmc") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("qzmc").toString();
/* 104 */ String yearCode = (((LinkedHashMap)resultList.get(i)).get("yearCode") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("yearCode").toString();
/* 105 */ String tm = (((LinkedHashMap)resultList.get(i)).get("tm") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("tm").toString();
/* 106 */ String zrz = (((LinkedHashMap)resultList.get(i)).get("zrz") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("zrz").toString();
/* 107 */ String rq = (((LinkedHashMap)resultList.get(i)).get("rq") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("rq").toString();
/* 108 */ String dh = (((LinkedHashMap)resultList.get(i)).get("dh") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("dh").toString();
/* 109 */ String archiveTypeName = (((LinkedHashMap)resultList.get(i)).get("archiveTypeName") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("archiveTypeName").toString();
/* */
/* 111 */ tm = getRedValueByKeyWord(tm, keyword);
/* 112 */ (resultList.get(i)).put("tm", tm);
/* 113 */ zrz = getRedValueByKeyWord(zrz, keyword);
/* 114 */ (resultList.get(i)).put("zrz", zrz);
/* 115 */ dh = getRedValueByKeyWord(dh, keyword);
/* 116 */ (resultList.get(i)).put("dh", dh);
/* 117 */ yearCode = getRedValueByKeyWord(yearCode, keyword);
/* 118 */ (resultList.get(i)).put("yearCode", yearCode);
/* 119 */ qzh = getRedValueByKeyWord(qzh, keyword);
/* 120 */ (resultList.get(i)).put("qzh", qzh);
/* 121 */ archiveTypeName = getRedValueByKeyWord(archiveTypeName, keyword);
/* 122 */ (resultList.get(i)).put("archiveTypeName", archiveTypeName);
/* 123 */ rq = getRedValueByKeyWord(rq, keyword);
/* 124 */ (resultList.get(i)).put("rq", rq);
/* 125 */ qzmc = getRedValueByKeyWord(qzmc, keyword);
/* 126 */ (resultList.get(i)).put("qzmc", qzmc);
/* */ }
/* */ }
/* 129 */ resultMap.put("list", resultList);
/* 130 */ resultMap.put("count", count);
/* 131 */ return resultMap;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public String getRedValueByKeyWord(String value, String keyword) {
/* 142 */ if (value != null && !value.equals("")) {
/* 143 */ String[] sttrs = keyword.split(" ");
/* 144 */ for (int i = 0; i < sttrs.length; i++) {
/* */
/* 146 */ String nlpfcResult = AnsjTextUtil.nlpfc(sttrs[i]);
/* 147 */ String[] words = nlpfcResult.split(",");
/* 148 */ for (int j = 0; j < words.length; j++) {
/* 149 */ if (value.contains(words[i])) {
/* 150 */ value = value.replaceAll(words[i], "<font color='red'>" + words[i] + "</font>");
/* */ }
/* */ }
/* */ }
/* */ }
/* 155 */ return value;
/* */ }
/* */ }
package com.archive.project.dacx.archivesearch.service.impl;
import com.archive.common.archiveUtil.AnsjTextUtil;
import com.archive.common.utils.StringUtils;
import com.archive.project.common.service.IExecuteSqlService;
import com.archive.project.dacx.archivesearch.service.IArchiveSearchService;
import com.archive.project.dasz.archivetype.mapper.ArchiveTypeMapper;
import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ArchiveSearchServiceImpl
implements IArchiveSearchService
{
@Autowired
private ArchiveTypeMapper archiveTypeMapper;
@Autowired
private PhysicalTableMapper physicalTableMapper;
@Autowired
private IExecuteSqlService executeSqlService;
@Override
public Map<String, Object> selectArchiveList(Integer pageNum, Integer pageSize, String orderBy, String orderByColumn, String keyword, String ft, String py, String qw) {
Map<String, Object> resultMap = new HashMap<>();
List<LinkedHashMap<String, Object>> resultList = new ArrayList<>();
Integer count = Integer.valueOf(0);
Integer beginNum = Integer.valueOf((pageNum.intValue() - 1) * pageSize.intValue());
String sql = "";
String condition = "";
if (keyword.equals("0")) {
keyword = "";
}
if (!keyword.equals("")) {
String[] sttrs = keyword.split(" ");
for (int i = 0; i < sttrs.length; i++) {
String nlpfcResult = AnsjTextUtil.nlpfc(sttrs[i]);
String[] words = nlpfcResult.split(",");
for (int j = 0; j < words.length; j++) {
condition = condition + " rowContext like '%" + words[i] + "%' OR";
if (ft.equals("true"))
{
condition = condition + " fantiContext like '%" + words[i] + "%' OR";
}
if (py.equals("true"))
{
condition = condition + " pinyinContext like '%" + words[i] + "%' OR";
}
if (qw.equals("true"))
{
condition = condition + " fileContext like '%" + words[i] + "%' OR";
}
}
}
}
if (condition.trim().equals("")) {
condition = " 1=1";
} else {
condition = condition.substring(0, condition.lastIndexOf("OR"));
}
sql = "select archiveId,tableId,archiveTypeId,archiveTypeCode,archiveType,qzh,qzmc,yearCode,bgqx,tm,zrz,rq,dh,archiveTypeName from t_ar_total where " + condition + " limit " + beginNum + " , " + pageSize;
if (StringUtils.isNotEmpty(orderBy) && StringUtils.isNotEmpty(orderByColumn)) {
sql = sql + " order by " + orderByColumn + orderBy;
}
resultList = this.executeSqlService.queryList(sql);
String countSql = "select COUNT(*) from t_ar_total where " + condition;
count = this.executeSqlService.jdbcTemplateQueryCount(countSql);
if (resultList.size() > 0 && !keyword.equals("")) {
for (int i = 0; i < resultList.size(); i++) {
String qzh = (((LinkedHashMap)resultList.get(i)).get("qzh") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("qzh").toString();
String qzmc = (((LinkedHashMap)resultList.get(i)).get("qzmc") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("qzmc").toString();
String yearCode = (((LinkedHashMap)resultList.get(i)).get("yearCode") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("yearCode").toString();
String tm = (((LinkedHashMap)resultList.get(i)).get("tm") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("tm").toString();
String zrz = (((LinkedHashMap)resultList.get(i)).get("zrz") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("zrz").toString();
String rq = (((LinkedHashMap)resultList.get(i)).get("rq") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("rq").toString();
String dh = (((LinkedHashMap)resultList.get(i)).get("dh") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("dh").toString();
String archiveTypeName = (((LinkedHashMap)resultList.get(i)).get("archiveTypeName") == null) ? "" : ((LinkedHashMap)resultList.get(i)).get("archiveTypeName").toString();
tm = getRedValueByKeyWord(tm, keyword);
(resultList.get(i)).put("tm", tm);
zrz = getRedValueByKeyWord(zrz, keyword);
(resultList.get(i)).put("zrz", zrz);
dh = getRedValueByKeyWord(dh, keyword);
(resultList.get(i)).put("dh", dh);
yearCode = getRedValueByKeyWord(yearCode, keyword);
(resultList.get(i)).put("yearCode", yearCode);
qzh = getRedValueByKeyWord(qzh, keyword);
(resultList.get(i)).put("qzh", qzh);
archiveTypeName = getRedValueByKeyWord(archiveTypeName, keyword);
(resultList.get(i)).put("archiveTypeName", archiveTypeName);
rq = getRedValueByKeyWord(rq, keyword);
(resultList.get(i)).put("rq", rq);
qzmc = getRedValueByKeyWord(qzmc, keyword);
(resultList.get(i)).put("qzmc", qzmc);
}
}
resultMap.put("list", resultList);
resultMap.put("count", count);
return resultMap;
}
public String getRedValueByKeyWord(String value, String keyword) {
if (value != null && !value.equals("")) {
String[] sttrs = keyword.split(" ");
for (int i = 0; i < sttrs.length; i++) {
String nlpfcResult = AnsjTextUtil.nlpfc(sttrs[i]);
String[] words = nlpfcResult.split(",");
for (int j = 0; j < words.length; j++) {
if (value.contains(words[i])) {
value = value.replaceAll(words[i], "<font color='red'>" + words[i] + "</font>");
}
}
}
}
return value;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dacx\archivesearch\service\impl\ArchiveSearchServiceImpl.class

@ -1,316 +1,316 @@
/* */ package com.archive.project.dasz.archivetype.controller
package com.archive.project.dasz.archivetype.controller
;
/* */
/* */ import com.archive.common.exception.BusinessException;
/* */ import com.archive.framework.aspectj.lang.annotation.Log;
/* */ import com.archive.framework.aspectj.lang.enums.BusinessType;
/* */ import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.framework.web.page.PageDomain;
/* */ import com.archive.framework.web.page.TableDataInfo;
/* */ import com.archive.framework.web.page.TableSupport;
/* */ import com.archive.project.dasz.archivetype.domain.ArchiveTableColumn;
/* */ import com.archive.project.dasz.archivetype.domain.ArchiveType;
/* */ import com.archive.project.dasz.archivetype.service.IArchiveListService;
/* */ import com.archive.project.dasz.archivetype.service.IArchiveTypeService;
/* */ import com.archive.project.system.dict.service.IDictDataService;
/* */ import java.io.File;
/* */ import java.io.FileOutputStream;
/* */ import java.io.IOException;
/* */ import java.io.OutputStream;
/* */ import java.util.ArrayList;
/* */ import java.util.LinkedHashMap;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ import javax.servlet.http.HttpServletResponse;
/* */ import org.apache.poi.ss.usermodel.Cell;
/* */ import org.apache.poi.ss.usermodel.CellStyle;
/* */ import org.apache.poi.ss.usermodel.Font;
/* */ import org.apache.poi.ss.usermodel.HorizontalAlignment;
/* */ import org.apache.poi.ss.usermodel.Row;
/* */ import org.apache.poi.ss.usermodel.Sheet;
/* */ import org.apache.poi.ss.usermodel.Workbook;
/* */ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller;
/* */ 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.RequestParam;
/* */ import org.springframework.web.bind.annotation.ResponseBody;
/* */ import ucar.httpservices.HTTPSession;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller
/* */ @RequestMapping({"/dasz/archivelist"})
/* */ public class ArchiveListController
/* */ extends BaseController
/* */ {
/* */ @Autowired
/* */ private IArchiveListService archiveListService;
/* */ @Autowired
/* */ private IArchiveTypeService archiveTypeService;
/* */ @Autowired
/* */ private IDictDataService dictDataService;
/* 63 */ private String prefix = "dasz/archivelist";
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/getColumns/{id}/{code}"})
/* */ @ResponseBody
/* */ public AjaxResult getColumns(@PathVariable("id") String id, @PathVariable("code") String code) {
/* 79 */ return AjaxResult.success(this.archiveListService.getColumns(id, code));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/getOrderColumns/{id}/{code}"})
/* */ @ResponseBody
/* */ public AjaxResult getOrderColumns(@PathVariable("id") String id, @PathVariable("code") String code) {
/* 92 */ return AjaxResult.success(this.archiveListService.getOrderColumns(id, code));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @PostMapping({"/list/{id}/{code}/{ownerid}/{isRecycle}/{status}"})
/* */ @ResponseBody
/* */ public TableDataInfo list(@PathVariable("id") String id, @PathVariable("code") String code, @PathVariable("ownerid") String ownerid, @RequestParam Map<String, Object> formData, @PathVariable("isRecycle") String isRecycle, @PathVariable("status") String status) {
/* 111 */ PageDomain pageDomain = TableSupport.buildPageRequest();
/* 112 */ Integer pageNum = pageDomain.getPageNum();
/* 113 */ Integer pageSize = pageDomain.getPageSize();
/* 114 */ String orderBy = pageDomain.getOrderBy();
/* 115 */ String orderByColumn = pageDomain.getOrderByColumn();
/* 116 */ Map<String, Object> map = this.archiveListService.selectArchiveList(id, code, ownerid, pageNum, pageSize, orderBy, orderByColumn, formData, isRecycle, status);
/* 117 */ TableDataInfo tableDataInfo = new TableDataInfo((List)map.get("list"), ((Integer)map.get("count")).intValue());
/* 118 */ return tableDataInfo;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/columnDataFormat/{dictType}/{dictValue}"})
/* */ @ResponseBody
/* */ public String columnDataFormat(@PathVariable("dictType") String dictType, @PathVariable("dictValue") String dictValue) {
/* 135 */ return this.dictDataService.selectDictLabel(dictType, dictValue);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/getSearchHtml/{id}/{code}"})
/* */ @ResponseBody
/* */ public AjaxResult getSearchHtml(@PathVariable("id") String id, @PathVariable("code") String code) {
/* 152 */ return AjaxResult.success(this.archiveListService.getSearchHtml(id, code));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"dasz:archivelist:export"})
/* */ @Log(title = "接收管理导出", businessType = BusinessType.EXPORT)
/* */ @PostMapping({"/export/{id}/{code}/{ownerid}/{isRecycle}/{status}"})
/* */ @ResponseBody
/* */ public AjaxResult export(HttpServletResponse response, @PathVariable("id") String id, @PathVariable("code") String code, @PathVariable("ownerid") String ownerid, @PathVariable("isRecycle") String isRecycle, @RequestParam Map<String, Object> formData, @PathVariable("status") String status) throws Exception {
/* 165 */ Map<String, Object> map = this.archiveListService.selectArchiveList(id, code, ownerid, Integer.valueOf(1), Integer.valueOf(99999999), "", "", formData, isRecycle, status);
/* 166 */ List<LinkedHashMap<String, Object>> list = (List<LinkedHashMap<String, Object>>)map.get("list");
/* */
/* */
/* 169 */ List<ArchiveTableColumn> headsList = this.archiveListService.getColumns(id, code);
/* 170 */ String[] arr = new String[headsList.size() - 1];
/* 171 */ for (int i = 0; i < headsList.size(); i++) {
/* 172 */ if (i != 0)
/* */ {
/* 174 */ arr[i - 1] = ((ArchiveTableColumn)headsList.get(i)).getTitle();
/* */ }
/* */ }
/* 177 */ ArchiveType archiveType = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(id)));
/* */
/* 179 */ List<List> listAll = new ArrayList<>();
/* 180 */ for (int j = 0; j < list.size(); j++) {
/* 181 */ List<String> list1 = new ArrayList();
/* 182 */ for (int k = 0; k < headsList.size(); k++) {
/* 183 */ if (k > 0) {
/* 184 */ String value = (((LinkedHashMap)list.get(j)).get(((ArchiveTableColumn)headsList.get(k)).getField()) == null) ? "" : ((LinkedHashMap)list.get(j)).get(((ArchiveTableColumn)headsList.get(k)).getField()).toString();
/* 185 */ list1.add(value);
/* */ }
/* */ }
/* 188 */ listAll.add(list1);
/* */ }
/* 190 */ Workbook wb = writeToExcelByList(archiveType.getArchiveName(), arr, listAll);
/* */
/* 192 */ String fileName = archiveType.getArchiveName() + ".xlsx";
/* 193 */ return exportExcel(wb, fileName);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public AjaxResult exportExcel(Workbook wb, String filename) {
/* 204 */ OutputStream out = null;
/* */
/* */ try {
/* 207 */ out = new FileOutputStream(getAbsoluteFile(filename));
/* 208 */ wb.write(out);
/* 209 */ return AjaxResult.success(filename);
/* */ }
/* 211 */ catch (Exception e) {
/* */
/* 213 */ HTTPSession.log.error("导出Excel异常{}", e.getMessage());
/* 214 */ throw new BusinessException("导出Excel失败请联系网站管理员");
/* */ }
/* */ finally {
/* */
/* 218 */ if (wb != null) {
/* */
/* */ try {
/* */
/* 222 */ wb.close();
/* */ }
/* 224 */ catch (IOException e1) {
/* */
/* 226 */ e1.printStackTrace();
/* */ }
/* */ }
/* 229 */ if (out != null) {
/* */
/* */ try {
/* */
/* 233 */ out.close();
/* */ }
/* 235 */ catch (IOException e1) {
/* */
/* 237 */ e1.printStackTrace();
/* */ }
/* */ }
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public String getAbsoluteFile(String filename) {
/* 251 */ String downloadPath = ArchiveConfig.getInstance().getDownloadPath() + filename;
/* 252 */ File desc = new File(downloadPath);
/* 253 */ if (!desc.getParentFile().exists())
/* */ {
/* 255 */ desc.getParentFile().mkdirs();
/* */ }
/* 257 */ return downloadPath;
/* */ }
/* */
/* */
/* */
/* */ public static Workbook writeToExcelByList(String name, String[] array, List<List> list) {
/* 263 */ XSSFWorkbook xSSFWorkbook = new XSSFWorkbook();
/* */
/* 265 */ CellStyle titleStyle = xSSFWorkbook.createCellStyle();
/* */
/* 267 */ titleStyle.setAlignment(HorizontalAlignment.LEFT);
/* */
/* 269 */ Font titleFont = xSSFWorkbook.createFont();
/* */
/* 271 */ titleFont.setFontHeightInPoints((short)12);
/* */
/* 273 */ titleFont.setFontName("黑体");
/* 274 */ titleStyle.setFont(titleFont);
/* */
/* 276 */ Sheet sheet = xSSFWorkbook.createSheet(name);
/* */
/* 278 */ sheet.autoSizeColumn(0);
/* */
/* 280 */ Row row = sheet.createRow(0);
/* 281 */ for (int i = 0; i < array.length; i++) {
/* 282 */ Cell cell = row.createCell(i);
/* 283 */ cell.setCellValue(array[i]);
/* 284 */ cell.setCellStyle(titleStyle);
/* */ }
/* */
/* 287 */ CellStyle dataStyle = xSSFWorkbook.createCellStyle();
/* */
/* 289 */ dataStyle.setAlignment(HorizontalAlignment.CENTER);
/* */
/* */ try {
/* 292 */ int index = 1;
/* 293 */ for (List<List> value : list) {
/* */
/* 295 */ row = sheet.createRow(index);
/* 296 */ index++;
/* 297 */ List<List> data = value;
/* 298 */ for (int j = 0; j < data.size(); j++) {
/* 299 */ Cell cell = row.createCell(j);
/* */
/* 301 */ cell.setCellValue(data.get(j).toString());
/* */
/* 303 */ cell.setCellStyle(dataStyle);
/* */ }
/* */ }
/* 306 */ } catch (Exception e) {
/* 307 */ e.printStackTrace();
/* */ }
/* 309 */ return (Workbook)xSSFWorkbook;
/* */ }
/* */ }
import com.archive.common.exception.BusinessException;
import com.archive.framework.aspectj.lang.annotation.Log;
import com.archive.framework.aspectj.lang.enums.BusinessType;
import com.archive.framework.config.ArchiveConfig;
import com.archive.framework.web.controller.BaseController;
import com.archive.framework.web.domain.AjaxResult;
import com.archive.framework.web.page.PageDomain;
import com.archive.framework.web.page.TableDataInfo;
import com.archive.framework.web.page.TableSupport;
import com.archive.project.dasz.archivetype.domain.ArchiveTableColumn;
import com.archive.project.dasz.archivetype.domain.ArchiveType;
import com.archive.project.dasz.archivetype.service.IArchiveListService;
import com.archive.project.dasz.archivetype.service.IArchiveTypeService;
import com.archive.project.system.dict.service.IDictDataService;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import ucar.httpservices.HTTPSession;
@Controller
@RequestMapping({"/dasz/archivelist"})
public class ArchiveListController
extends BaseController
{
@Autowired
private IArchiveListService archiveListService;
@Autowired
private IArchiveTypeService archiveTypeService;
@Autowired
private IDictDataService dictDataService;
private String prefix = "dasz/archivelist";
@GetMapping({"/getColumns/{id}/{code}"})
@ResponseBody
public AjaxResult getColumns(@PathVariable("id") String id, @PathVariable("code") String code) {
return AjaxResult.success(this.archiveListService.getColumns(id, code));
}
@GetMapping({"/getOrderColumns/{id}/{code}"})
@ResponseBody
public AjaxResult getOrderColumns(@PathVariable("id") String id, @PathVariable("code") String code) {
return AjaxResult.success(this.archiveListService.getOrderColumns(id, code));
}
@PostMapping({"/list/{id}/{code}/{ownerid}/{isRecycle}/{status}"})
@ResponseBody
public TableDataInfo list(@PathVariable("id") String id, @PathVariable("code") String code, @PathVariable("ownerid") String ownerid, @RequestParam Map<String, Object> formData, @PathVariable("isRecycle") String isRecycle, @PathVariable("status") String status) {
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
String orderBy = pageDomain.getOrderBy();
String orderByColumn = pageDomain.getOrderByColumn();
Map<String, Object> map = this.archiveListService.selectArchiveList(id, code, ownerid, pageNum, pageSize, orderBy, orderByColumn, formData, isRecycle, status);
TableDataInfo tableDataInfo = new TableDataInfo((List)map.get("list"), ((Integer)map.get("count")).intValue());
return tableDataInfo;
}
@GetMapping({"/columnDataFormat/{dictType}/{dictValue}"})
@ResponseBody
public String columnDataFormat(@PathVariable("dictType") String dictType, @PathVariable("dictValue") String dictValue) {
return this.dictDataService.selectDictLabel(dictType, dictValue);
}
@GetMapping({"/getSearchHtml/{id}/{code}"})
@ResponseBody
public AjaxResult getSearchHtml(@PathVariable("id") String id, @PathVariable("code") String code) {
return AjaxResult.success(this.archiveListService.getSearchHtml(id, code));
}
@RequiresPermissions({"dasz:archivelist:export"})
@Log(title = "接收管理导出", businessType = BusinessType.EXPORT)
@PostMapping({"/export/{id}/{code}/{ownerid}/{isRecycle}/{status}"})
@ResponseBody
public AjaxResult export(HttpServletResponse response, @PathVariable("id") String id, @PathVariable("code") String code, @PathVariable("ownerid") String ownerid, @PathVariable("isRecycle") String isRecycle, @RequestParam Map<String, Object> formData, @PathVariable("status") String status) throws Exception {
Map<String, Object> map = this.archiveListService.selectArchiveList(id, code, ownerid, Integer.valueOf(1), Integer.valueOf(99999999), "", "", formData, isRecycle, status);
List<LinkedHashMap<String, Object>> list = (List<LinkedHashMap<String, Object>>)map.get("list");
List<ArchiveTableColumn> headsList = this.archiveListService.getColumns(id, code);
String[] arr = new String[headsList.size() - 1];
for (int i = 0; i < headsList.size(); i++) {
if (i != 0)
{
arr[i - 1] = ((ArchiveTableColumn)headsList.get(i)).getTitle();
}
}
ArchiveType archiveType = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(id)));
List<List> listAll = new ArrayList<>();
for (int j = 0; j < list.size(); j++) {
List<String> list1 = new ArrayList();
for (int k = 0; k < headsList.size(); k++) {
if (k > 0) {
String value = (((LinkedHashMap)list.get(j)).get(((ArchiveTableColumn)headsList.get(k)).getField()) == null) ? "" : ((LinkedHashMap)list.get(j)).get(((ArchiveTableColumn)headsList.get(k)).getField()).toString();
list1.add(value);
}
}
listAll.add(list1);
}
Workbook wb = writeToExcelByList(archiveType.getArchiveName(), arr, listAll);
String fileName = archiveType.getArchiveName() + ".xlsx";
return exportExcel(wb, fileName);
}
public AjaxResult exportExcel(Workbook wb, String filename) {
OutputStream out = null;
try {
out = new FileOutputStream(getAbsoluteFile(filename));
wb.write(out);
return AjaxResult.success(filename);
}
catch (Exception e) {
HTTPSession.log.error("导出Excel异常{}", e.getMessage());
throw new BusinessException("导出Excel失败请联系网站管理员");
}
finally {
if (wb != null) {
try {
wb.close();
}
catch (IOException e1) {
e1.printStackTrace();
}
}
if (out != null) {
try {
out.close();
}
catch (IOException e1) {
e1.printStackTrace();
}
}
}
}
public String getAbsoluteFile(String filename) {
String downloadPath = ArchiveConfig.getInstance().getDownloadPath() + filename;
File desc = new File(downloadPath);
if (!desc.getParentFile().exists())
{
desc.getParentFile().mkdirs();
}
return downloadPath;
}
public static Workbook writeToExcelByList(String name, String[] array, List<List> list) {
XSSFWorkbook xSSFWorkbook = new XSSFWorkbook();
CellStyle titleStyle = xSSFWorkbook.createCellStyle();
titleStyle.setAlignment(HorizontalAlignment.LEFT);
Font titleFont = xSSFWorkbook.createFont();
titleFont.setFontHeightInPoints((short)12);
titleFont.setFontName("黑体");
titleStyle.setFont(titleFont);
Sheet sheet = xSSFWorkbook.createSheet(name);
sheet.autoSizeColumn(0);
Row row = sheet.createRow(0);
for (int i = 0; i < array.length; i++) {
Cell cell = row.createCell(i);
cell.setCellValue(array[i]);
cell.setCellStyle(titleStyle);
}
CellStyle dataStyle = xSSFWorkbook.createCellStyle();
dataStyle.setAlignment(HorizontalAlignment.CENTER);
try {
int index = 1;
for (List<List> value : list) {
row = sheet.createRow(index);
index++;
List<List> data = value;
for (int j = 0; j < data.size(); j++) {
Cell cell = row.createCell(j);
cell.setCellValue(data.get(j).toString());
cell.setCellStyle(dataStyle);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return (Workbook)xSSFWorkbook;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dasz\archivetype\controller\ArchiveListController.class

@ -1,235 +1,235 @@
/* */ package com.archive.project.dasz.archivetype.controller
package com.archive.project.dasz.archivetype.controller
;
/* */
/* */ import com.archive.common.utils.poi.ExcelUtil;
/* */ import com.archive.framework.aspectj.lang.annotation.Log;
/* */ import com.archive.framework.aspectj.lang.enums.BusinessType;
/* */ 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.ArchiveCollationTree;
/* */ import com.archive.project.dasz.archivetype.domain.ArchiveType;
/* */ import com.archive.project.dasz.archivetype.domain.ArchiveTypeManageTree;
/* */ import com.archive.project.dasz.archivetype.service.IArchiveTypeService;
/* */ import com.archive.project.dasz.physicaltable.domain.PhysicalTable;
/* */ import com.archive.project.dasz.physicaltable.service.IPhysicalTableService;
/* */ import com.archive.project.system.dict.domain.DictType;
/* */ import com.archive.project.system.dict.service.IDictTypeService;
/* */ 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({"/dasz/archivetype"})
/* */ public class ArchiveTypeController
/* */ extends BaseController
/* */ {
/* 42 */ private String prefix = "dasz/archivetype";
/* */
/* */ @Autowired
/* */ private IArchiveTypeService archiveTypeService;
/* */
/* */ @Autowired
/* */ private IDictTypeService dictTypeService;
/* */
/* */ @Autowired
/* */ private IPhysicalTableService physicalTableService;
/* */
/* */
/* */ @RequiresPermissions({"dasz:archivetype:view"})
/* */ @GetMapping
/* */ public String ArchiveType(ModelMap mmap) {
/* 57 */ DictType dictType = new DictType();
/* 58 */ dictType.setLabel("column_bind");
/* 59 */ List<DictType> list = this.dictTypeService.selectDictTypeList(dictType);
/* 60 */ mmap.put("dictList", list);
/* 61 */ return this.prefix + "/archivetype";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"dasz:archivetype:list"})
/* */ @PostMapping({"/list"})
/* */ @ResponseBody
/* */ public TableDataInfo list(ArchiveType archiveType) {
/* 72 */ startPage();
/* 73 */ List<ArchiveType> list = this.archiveTypeService.selectArchiveTypeList(archiveType);
/* 74 */ return getDataTable(list);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"dasz:archivetype:export"})
/* */ @Log(title = "档案类型", businessType = BusinessType.EXPORT)
/* */ @PostMapping({"/export"})
/* */ @ResponseBody
/* */ public AjaxResult export(ArchiveType archiveType) {
/* 86 */ List<ArchiveType> list = this.archiveTypeService.selectArchiveTypeList(archiveType);
/* 87 */ ExcelUtil<ArchiveType> util = new ExcelUtil(ArchiveType.class);
/* 88 */ return util.exportExcel(list, "archiveType");
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/add"})
/* */ public String add() {
/* 97 */ return this.prefix + "/add";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"dasz:archivetype:add"})
/* */ @Log(title = "档案类型", businessType = BusinessType.INSERT)
/* */ @PostMapping({"/add"})
/* */ @ResponseBody
/* */ public AjaxResult addSave(ArchiveType archiveType) {
/* */ try {
/* 110 */ ArchiveType ArchiveTypeTemp = new ArchiveType();
/* 111 */ ArchiveTypeTemp.setArhciveCode(archiveType.getArhciveCode());
/* 112 */ List<ArchiveType> ArchiveTypeList = this.archiveTypeService.selectArchiveTypeList(ArchiveTypeTemp);
/* 113 */ if (ArchiveTypeList != null && ArchiveTypeList.size() > 0) {
/* 114 */ return error("该档案类型已存在!");
/* */ }
/* 116 */ this.archiveTypeService.insertArchiveType(archiveType);
/* 117 */ return toAjax(true);
/* */ }
/* 119 */ catch (Exception e) {
/* 120 */ e.printStackTrace();
/* 121 */ return toAjax(false);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/edit/{id}"})
/* */ public String edit(@PathVariable("id") Long id, ModelMap mmap) {
/* 131 */ ArchiveType ArchiveType = this.archiveTypeService.selectArchiveTypeById(id);
/* 132 */ mmap.put("archiveType", ArchiveType);
/* 133 */ return this.prefix + "/edit";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"dasz:archivetype:edit"})
/* */ @Log(title = "档案类型", businessType = BusinessType.UPDATE)
/* */ @PostMapping({"/edit"})
/* */ @ResponseBody
/* */ public AjaxResult editSave(ArchiveType archiveType) {
/* 145 */ return toAjax(this.archiveTypeService.updateArchiveType(archiveType));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"dasz:archivetype:remove"})
/* */ @Log(title = "档案类型", businessType = BusinessType.DELETE)
/* */ @PostMapping({"/remove"})
/* */ @ResponseBody
/* */ public AjaxResult remove(String ids) {
/* */ try {
/* 158 */ boolean isNotEmpty = this.archiveTypeService.checkArchiveTypeIsHaveData(ids);
/* 159 */ if (isNotEmpty) {
/* 160 */ return error("该档案类型下存在数据,不能删除!");
/* */ }
/* 162 */ this.archiveTypeService.deleteArchiveType(ids);
/* 163 */ return success();
/* */ }
/* 165 */ catch (Exception e) {
/* 166 */ e.printStackTrace();
/* 167 */ return error();
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/archiveCollationTreeData"})
/* */ @ResponseBody
/* */ public List<ArchiveCollationTree> archiveCollationTreeData() {
/* 178 */ List<ArchiveCollationTree> ztrees = this.archiveTypeService.archiveCollationTreeData();
/* 179 */ return ztrees;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/archiveTypeManageTreeData"})
/* */ @ResponseBody
/* */ public List<ArchiveTypeManageTree> ArchiveTypeManageTreeData() {
/* 189 */ List<ArchiveTypeManageTree> ztrees = this.archiveTypeService.ArchiveTypeManageTreeData();
/* 190 */ return ztrees;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"dasz:archivetype:formbuild"})
/* */ @GetMapping({"/formBuild/{tableId}"})
/* */ public String formBuild(@PathVariable("tableId") Long tableId, ModelMap mmap) {
/* 201 */ PhysicalTable physicalTable = this.physicalTableService.selectPhysicalTableById(tableId);
/* 202 */ String tableForm = physicalTable.getTableForm();
/* 203 */ mmap.put("tableId", tableId);
/* 204 */ mmap.put("tableForm", tableForm);
/* 205 */ return this.prefix + "/formbuild";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/baseForm/{tableId}"})
/* */ @ResponseBody
/* */ public String baseForm(@PathVariable("tableId") Long tableId) {
/* 216 */ return this.archiveTypeService.appendBaseForm(tableId);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/tableForm/{tableId}"})
/* */ @ResponseBody
/* */ public String tableForm(@PathVariable("tableId") Long tableId) {
/* 227 */ PhysicalTable physicalTable = this.physicalTableService.selectPhysicalTableById(tableId);
/* 228 */ return physicalTable.getTableFormDiv();
/* */ }
/* */ }
import com.archive.common.utils.poi.ExcelUtil;
import com.archive.framework.aspectj.lang.annotation.Log;
import com.archive.framework.aspectj.lang.enums.BusinessType;
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.ArchiveCollationTree;
import com.archive.project.dasz.archivetype.domain.ArchiveType;
import com.archive.project.dasz.archivetype.domain.ArchiveTypeManageTree;
import com.archive.project.dasz.archivetype.service.IArchiveTypeService;
import com.archive.project.dasz.physicaltable.domain.PhysicalTable;
import com.archive.project.dasz.physicaltable.service.IPhysicalTableService;
import com.archive.project.system.dict.domain.DictType;
import com.archive.project.system.dict.service.IDictTypeService;
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({"/dasz/archivetype"})
public class ArchiveTypeController
extends BaseController
{
private String prefix = "dasz/archivetype";
@Autowired
private IArchiveTypeService archiveTypeService;
@Autowired
private IDictTypeService dictTypeService;
@Autowired
private IPhysicalTableService physicalTableService;
@RequiresPermissions({"dasz:archivetype:view"})
@GetMapping
public String ArchiveType(ModelMap mmap) {
DictType dictType = new DictType();
dictType.setLabel("column_bind");
List<DictType> list = this.dictTypeService.selectDictTypeList(dictType);
mmap.put("dictList", list);
return this.prefix + "/archivetype";
}
@RequiresPermissions({"dasz:archivetype:list"})
@PostMapping({"/list"})
@ResponseBody
public TableDataInfo list(ArchiveType archiveType) {
startPage();
List<ArchiveType> list = this.archiveTypeService.selectArchiveTypeList(archiveType);
return getDataTable(list);
}
@RequiresPermissions({"dasz:archivetype:export"})
@Log(title = "档案类型", businessType = BusinessType.EXPORT)
@PostMapping({"/export"})
@ResponseBody
public AjaxResult export(ArchiveType archiveType) {
List<ArchiveType> list = this.archiveTypeService.selectArchiveTypeList(archiveType);
ExcelUtil<ArchiveType> util = new ExcelUtil(ArchiveType.class);
return util.exportExcel(list, "archiveType");
}
@GetMapping({"/add"})
public String add() {
return this.prefix + "/add";
}
@RequiresPermissions({"dasz:archivetype:add"})
@Log(title = "档案类型", businessType = BusinessType.INSERT)
@PostMapping({"/add"})
@ResponseBody
public AjaxResult addSave(ArchiveType archiveType) {
try {
ArchiveType ArchiveTypeTemp = new ArchiveType();
ArchiveTypeTemp.setArhciveCode(archiveType.getArhciveCode());
List<ArchiveType> ArchiveTypeList = this.archiveTypeService.selectArchiveTypeList(ArchiveTypeTemp);
if (ArchiveTypeList != null && ArchiveTypeList.size() > 0) {
return error("该档案类型已存在!");
}
this.archiveTypeService.insertArchiveType(archiveType);
return toAjax(true);
}
catch (Exception e) {
e.printStackTrace();
return toAjax(false);
}
}
@GetMapping({"/edit/{id}"})
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
ArchiveType ArchiveType = this.archiveTypeService.selectArchiveTypeById(id);
mmap.put("archiveType", ArchiveType);
return this.prefix + "/edit";
}
@RequiresPermissions({"dasz:archivetype:edit"})
@Log(title = "档案类型", businessType = BusinessType.UPDATE)
@PostMapping({"/edit"})
@ResponseBody
public AjaxResult editSave(ArchiveType archiveType) {
return toAjax(this.archiveTypeService.updateArchiveType(archiveType));
}
@RequiresPermissions({"dasz:archivetype:remove"})
@Log(title = "档案类型", businessType = BusinessType.DELETE)
@PostMapping({"/remove"})
@ResponseBody
public AjaxResult remove(String ids) {
try {
boolean isNotEmpty = this.archiveTypeService.checkArchiveTypeIsHaveData(ids);
if (isNotEmpty) {
return error("该档案类型下存在数据,不能删除!");
}
this.archiveTypeService.deleteArchiveType(ids);
return success();
}
catch (Exception e) {
e.printStackTrace();
return error();
}
}
@GetMapping({"/archiveCollationTreeData"})
@ResponseBody
public List<ArchiveCollationTree> archiveCollationTreeData() {
List<ArchiveCollationTree> ztrees = this.archiveTypeService.archiveCollationTreeData();
return ztrees;
}
@GetMapping({"/archiveTypeManageTreeData"})
@ResponseBody
public List<ArchiveTypeManageTree> ArchiveTypeManageTreeData() {
List<ArchiveTypeManageTree> ztrees = this.archiveTypeService.ArchiveTypeManageTreeData();
return ztrees;
}
@RequiresPermissions({"dasz:archivetype:formbuild"})
@GetMapping({"/formBuild/{tableId}"})
public String formBuild(@PathVariable("tableId") Long tableId, ModelMap mmap) {
PhysicalTable physicalTable = this.physicalTableService.selectPhysicalTableById(tableId);
String tableForm = physicalTable.getTableForm();
mmap.put("tableId", tableId);
mmap.put("tableForm", tableForm);
return this.prefix + "/formbuild";
}
@GetMapping({"/baseForm/{tableId}"})
@ResponseBody
public String baseForm(@PathVariable("tableId") Long tableId) {
return this.archiveTypeService.appendBaseForm(tableId);
}
@GetMapping({"/tableForm/{tableId}"})
@ResponseBody
public String tableForm(@PathVariable("tableId") Long tableId) {
PhysicalTable physicalTable = this.physicalTableService.selectPhysicalTableById(tableId);
return physicalTable.getTableFormDiv();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dasz\archivetype\controller\ArchiveTypeController.class

@ -1,73 +1,73 @@
/* */ package com.archive.project.dasz.archivetype.domain
package com.archive.project.dasz.archivetype.domain
;
/* */
/* */ import com.archive.framework.web.domain.BaseEntity;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class ArchiveTableColumn
/* */ extends BaseEntity
/* */ {
/* */ private static final long serialVersionUID = 1L;
/* */ private boolean checkbox = false;
/* 19 */ private String field = "";
/* */
/* */
/* 22 */ private String title = "";
/* */
/* */
/* */ private boolean visible = false;
/* */
/* */
/* 28 */ private String codeType = "";
/* */
/* 30 */ private int width = 50;
/* */
/* */ public boolean isCheckbox() {
/* 33 */ return this.checkbox;
/* */ }
/* */ public void setCheckbox(boolean checkbox) {
/* 36 */ this.checkbox = checkbox;
/* */ }
/* */ public String getField() {
/* 39 */ return this.field;
/* */ }
/* */ public void setField(String field) {
/* 42 */ this.field = field;
/* */ }
/* */ public String getTitle() {
/* 45 */ return this.title;
/* */ }
/* */ public void setTitle(String title) {
/* 48 */ this.title = title;
/* */ }
/* */ public boolean isVisible() {
/* 51 */ return this.visible;
/* */ }
/* */ public void setVisible(boolean visible) {
/* 54 */ this.visible = visible;
/* */ }
/* */ public String getCodeType() {
/* 57 */ return this.codeType;
/* */ }
/* */ public void setCodeType(String codeType) {
/* 60 */ this.codeType = codeType;
/* */ }
/* */ public int getWidth() {
/* 63 */ return this.width;
/* */ }
/* */ public void setWidth(int width) {
/* 66 */ this.width = width;
/* */ }
/* */ }
import com.archive.framework.web.domain.BaseEntity;
public class ArchiveTableColumn
extends BaseEntity
{
private static final long serialVersionUID = 1L;
private boolean checkbox = false;
private String field = "";
private String title = "";
private boolean visible = false;
private String codeType = "";
private int width = 50;
public boolean isCheckbox() {
return this.checkbox;
}
public void setCheckbox(boolean checkbox) {
this.checkbox = checkbox;
}
public String getField() {
return this.field;
}
public void setField(String field) {
this.field = field;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public boolean isVisible() {
return this.visible;
}
public void setVisible(boolean visible) {
this.visible = visible;
}
public String getCodeType() {
return this.codeType;
}
public void setCodeType(String codeType) {
this.codeType = codeType;
}
public int getWidth() {
return this.width;
}
public void setWidth(int width) {
this.width = width;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dasz\archivetype\domain\ArchiveTableColumn.class

@ -1,124 +1,124 @@
/* */ package com.archive.project.dasz.archivetype.domain
package com.archive.project.dasz.archivetype.domain
;
/* */
/* */ import com.archive.framework.aspectj.lang.annotation.Excel;
/* */ import com.archive.framework.web.domain.BaseEntity;
/* */ import org.apache.commons.lang3.builder.ToStringBuilder;
/* */ import org.apache.commons.lang3.builder.ToStringStyle;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class ArchiveType
/* */ extends BaseEntity
/* */ {
/* */ private static final long serialVersionUID = 1L;
/* */ private Long id;
/* */ @Excel(name = "档案类型名称")
/* */ private String archiveName;
/* */ @Excel(name = "基础类型")
/* */ private Long archiveType;
/* */ @Excel(name = "档案类型")
/* */ private String type;
/* */ @Excel(name = "备注")
/* */ private String bz;
/* */ @Excel(name = "档案类型编码")
/* */ private String arhciveCode;
/* */ private String showorder;
/* */
/* */ public void setId(Long id) {
/* 46 */ this.id = id;
/* */ }
/* */
/* */
/* */ public Long getId() {
/* 51 */ return this.id;
/* */ }
/* */
/* */ public void setArchiveName(String archiveName) {
/* 55 */ this.archiveName = archiveName;
/* */ }
/* */
/* */
/* */ public String getArchiveName() {
/* 60 */ return this.archiveName;
/* */ }
/* */
/* */ public void setArchiveType(Long archiveType) {
/* 64 */ this.archiveType = archiveType;
/* */ }
/* */
/* */
/* */ public Long getArchiveType() {
/* 69 */ return this.archiveType;
/* */ }
/* */
/* */ public void setType(String type) {
/* 73 */ this.type = type;
/* */ }
/* */
/* */
/* */ public String getType() {
/* 78 */ return this.type;
/* */ }
/* */
/* */ public void setBz(String bz) {
/* 82 */ this.bz = bz;
/* */ }
/* */
/* */
/* */ public String getBz() {
/* 87 */ return this.bz;
/* */ }
/* */
/* */ public void setArhciveCode(String arhciveCode) {
/* 91 */ this.arhciveCode = arhciveCode;
/* */ }
/* */
/* */
/* */ public String getArhciveCode() {
/* 96 */ return this.arhciveCode;
/* */ }
/* */
/* */ public void setShoworder(String showorder) {
/* 100 */ this.showorder = showorder;
/* */ }
/* */
/* */
/* */ public String getShoworder() {
/* 105 */ return this.showorder;
/* */ }
/* */
/* */
/* */ public String toString() {
/* 110 */ return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
/* 111 */ .append("id", getId())
/* 112 */ .append("archiveName", getArchiveName())
/* 113 */ .append("archiveType", getArchiveType())
/* 114 */ .append("type", getType())
/* 115 */ .append("bz", getBz())
/* 116 */ .append("arhciveCode", getArhciveCode())
/* 117 */ .append("order", getShoworder())
/* 118 */ .toString();
/* */ }
/* */ }
import com.archive.framework.aspectj.lang.annotation.Excel;
import com.archive.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class ArchiveType
extends BaseEntity
{
private static final long serialVersionUID = 1L;
private Long id;
@Excel(name = "档案类型名称")
private String archiveName;
@Excel(name = "基础类型")
private Long archiveType;
@Excel(name = "档案类型")
private String type;
@Excel(name = "备注")
private String bz;
@Excel(name = "档案类型编码")
private String arhciveCode;
private String showorder;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return this.id;
}
public void setArchiveName(String archiveName) {
this.archiveName = archiveName;
}
public String getArchiveName() {
return this.archiveName;
}
public void setArchiveType(Long archiveType) {
this.archiveType = archiveType;
}
public Long getArchiveType() {
return this.archiveType;
}
public void setType(String type) {
this.type = type;
}
public String getType() {
return this.type;
}
public void setBz(String bz) {
this.bz = bz;
}
public String getBz() {
return this.bz;
}
public void setArhciveCode(String arhciveCode) {
this.arhciveCode = arhciveCode;
}
public String getArhciveCode() {
return this.arhciveCode;
}
public void setShoworder(String showorder) {
this.showorder = showorder;
}
public String getShoworder() {
return this.showorder;
}
public String toString() {
return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
.append("id", getId())
.append("archiveName", getArchiveName())
.append("archiveType", getArchiveType())
.append("type", getType())
.append("bz", getBz())
.append("arhciveCode", getArhciveCode())
.append("order", getShoworder())
.toString();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dasz\archivetype\domain\ArchiveType.class

@ -1,120 +1,120 @@
/* */ package com.archive.project.dasz.archivetype.domain
package com.archive.project.dasz.archivetype.domain
;
/* */
/* */ import java.io.Serializable;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class ArchiveTypeManageTree
/* */ implements Serializable
/* */ {
/* */ private static final long serialVersionUID = 1L;
/* */ private String id;
/* */ private String pId;
/* */ private String name;
/* */ private String title;
/* */ private String nodeType;
/* */ private String archiveTypeId;
/* */ private boolean checked = false;
/* */ private boolean open = false;
/* */ private boolean nocheck = false;
/* */
/* */ public String getId() {
/* 45 */ return this.id;
/* */ }
/* */
/* */ public void setId(String id) {
/* 49 */ this.id = id;
/* */ }
/* */
/* */ public String getpId() {
/* 53 */ return this.pId;
/* */ }
/* */
/* */ public void setpId(String pId) {
/* 57 */ this.pId = pId;
/* */ }
/* */
/* */ public String getName() {
/* 61 */ return this.name;
/* */ }
/* */
/* */ public void setName(String name) {
/* 65 */ this.name = name;
/* */ }
/* */
/* */ public String getTitle() {
/* 69 */ return this.title;
/* */ }
/* */
/* */ public void setTitle(String title) {
/* 73 */ this.title = title;
/* */ }
/* */
/* */ public String getNodeType() {
/* 77 */ return this.nodeType;
/* */ }
/* */
/* */ public void setNodeType(String nodeType) {
/* 81 */ this.nodeType = nodeType;
/* */ }
/* */
/* */ public boolean isChecked() {
/* 85 */ return this.checked;
/* */ }
/* */
/* */ public void setChecked(boolean checked) {
/* 89 */ this.checked = checked;
/* */ }
/* */
/* */ public boolean isOpen() {
/* 93 */ return this.open;
/* */ }
/* */
/* */ public void setOpen(boolean open) {
/* 97 */ this.open = open;
/* */ }
/* */
/* */ public boolean isNocheck() {
/* 101 */ return this.nocheck;
/* */ }
/* */
/* */ public void setNocheck(boolean nocheck) {
/* 105 */ this.nocheck = nocheck;
/* */ }
/* */
/* */ public String getArchiveTypeId() {
/* 109 */ return this.archiveTypeId;
/* */ }
/* */
/* */ public void setArchiveTypeId(String archiveTypeId) {
/* 113 */ this.archiveTypeId = archiveTypeId;
/* */ }
/* */ }
import java.io.Serializable;
public class ArchiveTypeManageTree
implements Serializable
{
private static final long serialVersionUID = 1L;
private String id;
private String pId;
private String name;
private String title;
private String nodeType;
private String archiveTypeId;
private boolean checked = false;
private boolean open = false;
private boolean nocheck = false;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getpId() {
return this.pId;
}
public void setpId(String pId) {
this.pId = pId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public String getNodeType() {
return this.nodeType;
}
public void setNodeType(String nodeType) {
this.nodeType = nodeType;
}
public boolean isChecked() {
return this.checked;
}
public void setChecked(boolean checked) {
this.checked = checked;
}
public boolean isOpen() {
return this.open;
}
public void setOpen(boolean open) {
this.open = open;
}
public boolean isNocheck() {
return this.nocheck;
}
public void setNocheck(boolean nocheck) {
this.nocheck = nocheck;
}
public String getArchiveTypeId() {
return this.archiveTypeId;
}
public void setArchiveTypeId(String archiveTypeId) {
this.archiveTypeId = archiveTypeId;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dasz\archivetype\domain\ArchiveTypeManageTree.class

@ -1,424 +1,424 @@
/* */ package com.archive.project.dasz.archivetype.service.impl
package com.archive.project.dasz.archivetype.service.impl
;
/* */
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.project.common.service.IExecuteSqlService;
/* */ import com.archive.project.dasz.archivetype.domain.ArchiveTableColumn;
/* */ import com.archive.project.dasz.archivetype.service.IArchiveListService;
/* */ import com.archive.project.dasz.gridcolumns.domain.TXtpzGridColumns;
/* */ import com.archive.project.dasz.gridcolumns.service.ITXtpzGridColumnsService;
/* */ import com.archive.project.dasz.physicaltable.domain.PhysicalTable;
/* */ import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper;
/* */ import com.archive.project.dasz.physicaltablecolumn.domain.PhysicalTableColumn;
/* */ import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper;
/* */ import com.archive.project.system.dict.domain.DictData;
/* */ import com.archive.project.system.dict.mapper.DictDataMapper;
/* */ import java.util.ArrayList;
/* */ import java.util.HashMap;
/* */ import java.util.LinkedHashMap;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ import java.util.Set;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service
/* */ public class ArchiveListServiceImpl
/* */ implements IArchiveListService
/* */ {
/* */ @Autowired
/* */ private PhysicalTableMapper physicalTableMapper;
/* */ @Autowired
/* */ private PhysicalTableColumnMapper physicalTableColumnMapper;
/* */ @Autowired
/* */ private IExecuteSqlService executeSqlService;
/* */ @Autowired
/* */ private ITXtpzGridColumnsService itXtpzGridColumnsService;
/* */ @Autowired
/* */ private DictDataMapper dictDataMapper;
/* */ @Autowired
/* */ private ArchiveConfig archiveConfig;
/* */
/* */ public List<ArchiveTableColumn> getColumns(String id, String code) {
/* 58 */ List<ArchiveTableColumn> resultList = new ArrayList<>();
/* */
/* */
/* 61 */ PhysicalTable physicalTable = new PhysicalTable();
/* 62 */ physicalTable.setArchivetypeid(id);
/* 63 */ physicalTable.setTableCode(code);
/* 64 */ List<PhysicalTable> tablesList = this.physicalTableMapper.selectPhysicalTableList(physicalTable);
/* */
/* 66 */ if (tablesList != null && tablesList.size() > 0) {
/* 67 */ physicalTable = tablesList.get(0);
/* 68 */ PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn();
/* 69 */ physicalTableColumn.setTableId(physicalTable.getId());
/* 70 */ physicalTableColumn.setLbx(Long.valueOf(1L));
/* 71 */ List<PhysicalTableColumn> columnsList = new ArrayList<>();
/* 72 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 73 */ columnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn);
/* */ }
/* 75 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 76 */ columnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn);
/* */ }
/* */
/* 79 */ if (columnsList != null && columnsList.size() > 0) {
/* */
/* 81 */ ArchiveTableColumn columnOne = new ArchiveTableColumn();
/* 82 */ columnOne.setCheckbox(true);
/* 83 */ resultList.add(columnOne);
/* */
/* */
/* 86 */ ArchiveTableColumn columnTwo = new ArchiveTableColumn();
/* 87 */ columnTwo.setField("id");
/* 88 */ columnTwo.setTitle("");
/* 89 */ columnTwo.setVisible(false);
/* 90 */ resultList.add(columnTwo);
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 104 */ TXtpzGridColumns tXtpzGridColumns = new TXtpzGridColumns();
/* 105 */ tXtpzGridColumns.setTableId(physicalTable.getId());
/* 106 */ List<TXtpzGridColumns> tglist = this.itXtpzGridColumnsService.selectTXtpzGridColumnsList(tXtpzGridColumns);
/* 107 */ for (TXtpzGridColumns tableColumn : tglist) {
/* 108 */ ArchiveTableColumn column = new ArchiveTableColumn();
/* */
/* 110 */ if (StringUtils.isEmpty(tableColumn.getBy1())) {
/* 111 */ column.setField(tableColumn.getColumnname());
/* 112 */ column.setTitle(tableColumn.getShowname());
/* 113 */ column.setWidth(Integer.parseInt(String.valueOf(tableColumn.getWidth())));
/* */ } else {
/* 115 */ column.setField(tableColumn.getColumnname());
/* 116 */ column.setTitle(tableColumn.getShowname());
/* 117 */ column.setCodeType(tableColumn.getBy1());
/* 118 */ column.setWidth(Integer.parseInt(String.valueOf(tableColumn.getWidth())));
/* */ }
/* 120 */ resultList.add(column);
/* */ }
/* */ }
/* */ }
/* 124 */ return resultList;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public Map<String, String> getOrderColumns(String id, String code) {
/* 134 */ Map<String, String> map = new HashMap<>();
/* 135 */ String orderColumns = "";
/* 136 */ String orderType = "asc";
/* */
/* 138 */ PhysicalTable physicalTable = new PhysicalTable();
/* 139 */ physicalTable.setArchivetypeid(id);
/* 140 */ physicalTable.setTableCode(code);
/* 141 */ List<PhysicalTable> tablesList = this.physicalTableMapper.selectPhysicalTableList(physicalTable);
/* */
/* 143 */ if (tablesList != null && tablesList.size() > 0) {
/* 144 */ physicalTable = tablesList.get(0);
/* 145 */ PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn();
/* 146 */ physicalTableColumn.setTableId(physicalTable.getId());
/* 147 */ physicalTableColumn.setPxx(Long.valueOf(1L));
/* 148 */ List<PhysicalTableColumn> columnsList = new ArrayList<>();
/* 149 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 150 */ columnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn);
/* */ }
/* 152 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 153 */ columnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn);
/* */ }
/* */
/* 156 */ if (columnsList != null && columnsList.size() > 0) {
/* 157 */ for (PhysicalTableColumn tableColumn : columnsList) {
/* */
/* */
/* 160 */ if (tableColumn.getBz() != null && tableColumn.getBz().contains("倒序")) {
/* 161 */ orderType = "desc";
/* */ }
/* 163 */ orderColumns = orderColumns + "," + tableColumn.getColumnCode() + " " + orderType;
/* */ }
/* */ }
/* */ }
/* 167 */ if (orderColumns.length() > 0) {
/* 168 */ orderColumns = orderColumns.substring(1, orderColumns.length());
/* */ }
/* 170 */ map.put("orderColumns", orderColumns);
/* 171 */ map.put("orderType", orderType);
/* 172 */ return map;
/* */ }
/* */
/* */
/* */ public Map<String, Object> selectArchiveList(String id, String code, String ownerid, Integer pageNum, Integer pageSize, String orderBy, String orderByColumn, Map<String, Object> formData, String isRecycle, String status) {
/* 177 */ Map<String, Object> resultMap = new HashMap<>();
/* 178 */ List<LinkedHashMap<String, Object>> resultList = new ArrayList<>();
/* 179 */ Integer count = Integer.valueOf(0);
/* 180 */ Integer beginNum = Integer.valueOf((pageNum.intValue() - 1) * pageSize.intValue());
/* */
/* */
/* 183 */ PhysicalTable physicalTable = new PhysicalTable();
/* 184 */ physicalTable.setArchivetypeid(id);
/* 185 */ physicalTable.setTableCode(code);
/* 186 */ List<PhysicalTable> tablesList = this.physicalTableMapper.selectPhysicalTableList(physicalTable);
/* */
/* 188 */ if (tablesList != null && tablesList.size() > 0) {
/* 189 */ physicalTable = tablesList.get(0);
/* */
/* */
/* 192 */ String condition = "";
/* */
/* 194 */ if (!"folder".equals(code) && StringUtils.isNotEmpty(ownerid) && !"ALL".equals(ownerid) && !"0".equals(ownerid) && !"ownerid".equals(ownerid)) {
/* 195 */ condition = condition + "ownerid in (" + ownerid + ") ";
/* */ }
/* 197 */ PhysicalTableColumn physicalTableColumn1 = new PhysicalTableColumn();
/* 198 */ physicalTableColumn1.setTableId(physicalTable.getId());
/* 199 */ List<PhysicalTableColumn> columnsList1 = new ArrayList<>();
/* 200 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 201 */ columnsList1 = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn1);
/* */ }
/* 203 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 204 */ columnsList1 = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn1);
/* */ }
/* */
/* 207 */ if (columnsList1 != null && columnsList1.size() > 0) {
/* 208 */ Set<String> keySet = formData.keySet();
/* 209 */ for (String key : keySet) {
/* 210 */ String value = String.valueOf(formData.get(key));
/* 211 */ for (PhysicalTableColumn tableColumn : columnsList1) {
/* 212 */ String field = tableColumn.getColumnCode();
/* 213 */ if ((key.equals(field) || key.replaceAll("_Qazwsx13579!", "").equals(field) || key.replaceAll("_Qazwsx24680!", "").equals(field)) &&
/* 214 */ !"pageNum".equals(key) && !"pageSize".equals(key) && !"isAsc".equals(key) && StringUtils.isNotEmpty(value)) {
/* 215 */ Long jsfs = tableColumn.getJsfs();
/* */
/* 217 */ if (jsfs.longValue() == 0L) {
/* 218 */ condition = condition + "and " + field + " like '%" + value + "%' ";
/* */ continue;
/* */ }
/* 221 */ if (jsfs.longValue() == 1L) {
/* 222 */ condition = condition + "and " + field + " = '" + value + "' ";
/* */ continue;
/* */ }
/* 225 */ if (jsfs.longValue() == 2L) {
/* 226 */ condition = condition + "and " + field + " > '" + value + "' ";
/* */ continue;
/* */ }
/* 229 */ if (jsfs.longValue() == 3L) {
/* 230 */ condition = condition + "and " + field + " < '" + value + "' ";
/* */ continue;
/* */ }
/* 233 */ if (jsfs.longValue() == 4L) {
/* 234 */ condition = condition + "and " + field + " >= '" + value + "' ";
/* */ continue;
/* */ }
/* 237 */ if (jsfs.longValue() == 5L) {
/* 238 */ condition = condition + "and " + field + " <= '" + value + "' ";
/* */ continue;
/* */ }
/* 241 */ if (jsfs.longValue() == 6L) {
/* 242 */ if (key.replaceAll("_Qazwsx13579!", "").equals(field)) {
/* 243 */ condition = condition + "and " + field + " >= '" + value + "' ";
/* */ }
/* 245 */ if (key.replaceAll("_Qazwsx24680!", "").equals(field)) {
/* 246 */ condition = condition + "and " + field + " <= '" + value + "' ";
/* */ }
/* */ continue;
/* */ }
/* 250 */ condition = condition + "and " + field + " like '%" + value + "%' ";
/* */ }
/* */ }
/* */
/* */
/* 255 */ if ("ids".equals(key)) {
/* 256 */ condition = condition + "and id in (" + value + ")";
/* */ }
/* */ }
/* */ }
/* */
/* 261 */ if (condition.startsWith("and")) {
/* 262 */ condition = condition.substring(3);
/* */ }
/* */
/* 265 */ if (isRecycle.equals("true")) {
/* 266 */ if (condition.length() > 0) {
/* 267 */ condition = " where is_delete = '1' and " + condition;
/* */ } else {
/* 269 */ condition = " where is_delete = '1' ";
/* */ }
/* */
/* 272 */ } else if (condition.length() > 0) {
/* 273 */ condition = " is_delete = '0' and " + condition;
/* */ } else {
/* 275 */ condition = " is_delete = '0' ";
/* */ }
/* */
/* */
/* */
/* 280 */ if (status != null && !status.equals("") && !status.equals("0")) {
/* 281 */ if (condition.length() > 0) {
/* 282 */ condition = " where status = '" + status + "' and " + condition;
/* */ } else {
/* 284 */ condition = " where status = '" + status + "' ";
/* */ }
/* */ }
/* */
/* */
/* */
/* 290 */ PhysicalTableColumn physicalTableColumn2 = new PhysicalTableColumn();
/* 291 */ physicalTableColumn2.setTableId(physicalTable.getId());
/* 292 */ physicalTableColumn2.setLbx(Long.valueOf(1L));
/* 293 */ List<PhysicalTableColumn> columnsList2 = new ArrayList<>();
/* 294 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 295 */ columnsList2 = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn2);
/* */ }
/* 297 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 298 */ columnsList2 = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn2);
/* */ }
/* */
/* 301 */ if (columnsList2 != null && columnsList2.size() > 0) {
/* 302 */ String sql = "select id,";
/* 303 */ for (PhysicalTableColumn tableColumn : columnsList2) {
/* 304 */ sql = sql + tableColumn.getColumnCode() + ",";
/* */ }
/* 306 */ sql = sql.substring(0, sql.lastIndexOf(","));
/* 307 */ sql = sql + " from " + physicalTable.getTablename() + condition;
/* 308 */ if (StringUtils.isNotEmpty(orderByColumn))
/* */ {
/* 310 */ sql = sql + " order by " + orderByColumn;
/* */ }
/* 312 */ sql = sql + " limit " + beginNum + " , " + pageSize;
/* 313 */ resultList = this.executeSqlService.queryList(sql);
/* */
/* 315 */ String countSql = "SELECT COUNT(*) FROM " + physicalTable.getTablename() + condition;
/* 316 */ count = this.executeSqlService.jdbcTemplateQueryCount(countSql);
/* */ }
/* */ }
/* 319 */ resultMap.put("list", resultList);
/* 320 */ resultMap.put("count", count);
/* 321 */ return resultMap;
/* */ }
/* */
/* */
/* */ public String getSearchHtml(String id, String code) {
/* 326 */ String html = "";
/* 327 */ PhysicalTable physicalTable = new PhysicalTable();
/* 328 */ physicalTable.setArchivetypeid(id);
/* 329 */ physicalTable.setTableCode(code);
/* 330 */ List<PhysicalTable> physicalTableList = this.physicalTableMapper.selectPhysicalTableList(physicalTable);
/* 331 */ if (physicalTableList != null && physicalTableList.size() > 0) {
/* 332 */ Long tableId = ((PhysicalTable)physicalTableList.get(0)).getId();
/* 333 */ PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn();
/* 334 */ physicalTableColumn.setTableId(tableId);
/* 335 */ physicalTableColumn.setJsx(Long.valueOf(1L));
/* 336 */ List<PhysicalTableColumn> tableColumnsList = new ArrayList<>();
/* 337 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 338 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn);
/* */ }
/* 340 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 341 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn);
/* */ }
/* 343 */ if (tableColumnsList != null && tableColumnsList.size() > 0) {
/* 344 */ StringBuffer sb = new StringBuffer();
/* 345 */ sb.append("<div class='col-sm-12 search-collapse'>");
/* 346 */ sb.append("<form id='archive-search-form'>");
/* 347 */ sb.append("<div class='select-list'>");
/* 348 */ sb.append("<ul>");
/* 349 */ for (int i = 0; i < tableColumnsList.size(); i++) {
/* 350 */ PhysicalTableColumn tableColumns = tableColumnsList.get(i);
/* 351 */ String columnName = tableColumns.getColumnName();
/* 352 */ String columnCode = tableColumns.getColumnCode();
/* 353 */ String columnCodeType = tableColumns.getColumnCodetype();
/* 354 */ Long jsfs = tableColumns.getJsfs();
/* */
/* 356 */ if (StringUtils.isEmpty(columnCodeType)) {
/* 357 */ if (jsfs.longValue() == 6L) {
/* 358 */ sb.append("<li class='select-time'>");
/* 359 */ sb.append("<label>" + columnName + "</label><input type='text' class='time-input' name='" + columnCode + "_Qazwsx13579!'/>");
/* 360 */ sb.append("<span>-</span>");
/* 361 */ sb.append("<input class='time-input' type='text' name='" + columnCode + "_Qazwsx24680!'/>");
/* 362 */ sb.append("</li>");
/* */ } else {
/* 364 */ sb.append("<li>");
/* 365 */ sb.append("<label>" + columnName + "</label><input type='text' name='" + columnCode + "'/>");
/* 366 */ sb.append("</li>");
/* */ }
/* */
/* */ } else {
/* */
/* 371 */ DictData dictData = new DictData();
/* 372 */ dictData.setDictType(columnCodeType);
/* 373 */ List<DictData> dictDataList = this.dictDataMapper.selectDictDataList(dictData);
/* 374 */ if (jsfs.longValue() == 6L) {
/* 375 */ sb.append("<li class='select-time'>");
/* 376 */ sb.append("<label>" + columnName + "</label><select class='time-input' name='" + columnCode + "_Qazwsx13579!'>");
/* 377 */ sb.append("<option value=''>所有</option>"); int j;
/* 378 */ for (j = 0; j < dictDataList.size(); j++) {
/* 379 */ DictData dictDataTemp = dictDataList.get(j);
/* 380 */ sb.append("<option value='" + dictDataTemp.getDictValue() + "'>" + dictDataTemp.getDictLabel() + "</option>");
/* */ }
/* 382 */ sb.append("</select>");
/* 383 */ sb.append("<span>-</span>");
/* 384 */ sb.append("<select class='time-input' name='" + columnCode + "_Qazwsx24680!'>");
/* 385 */ sb.append("<option value=''>所有</option>");
/* 386 */ for (j = 0; j < dictDataList.size(); j++) {
/* 387 */ DictData dictDataTemp = dictDataList.get(j);
/* 388 */ sb.append("<option value='" + dictDataTemp.getDictValue() + "'>" + dictDataTemp.getDictLabel() + "</option>");
/* */ }
/* 390 */ sb.append("</select>");
/* 391 */ sb.append("</li>");
/* */ } else {
/* 393 */ sb.append("<li>");
/* 394 */ sb.append("<label>" + columnName + "</label><select name='" + columnCode + "'>");
/* 395 */ sb.append("<option value=''>所有</option>");
/* 396 */ for (int j = 0; j < dictDataList.size(); j++) {
/* 397 */ DictData dictDataTemp = dictDataList.get(j);
/* 398 */ sb.append("<option value='" + dictDataTemp.getDictValue() + "'>" + dictDataTemp.getDictLabel() + "</option>");
/* */ }
/* 400 */ sb.append("</select>");
/* 401 */ sb.append("</li>");
/* */ }
/* */ }
/* */ }
/* */
/* 406 */ sb.append("<li>");
/* 407 */ sb.append("<a class='btn btn-primary btn-rounded btn-sm' onclick='archiveSearch()'><i class='fa fa-search'></i>&nbsp;搜索</a>");
/* 408 */ sb.append("<a class='btn btn-warning btn-rounded btn-sm' onclick='$.form.reset()'><i class='fa fa-refresh'></i>&nbsp;重置</a>");
/* 409 */ sb.append("</li>");
/* */
/* 411 */ sb.append("</ul>");
/* 412 */ sb.append("</div>");
/* 413 */ sb.append("</form>");
/* 414 */ sb.append("</div>");
/* 415 */ html = sb.toString();
/* */ }
/* */ }
/* 418 */ return html;
/* */ }
/* */ }
import com.archive.common.utils.StringUtils;
import com.archive.framework.config.ArchiveConfig;
import com.archive.project.common.service.IExecuteSqlService;
import com.archive.project.dasz.archivetype.domain.ArchiveTableColumn;
import com.archive.project.dasz.archivetype.service.IArchiveListService;
import com.archive.project.dasz.gridcolumns.domain.TXtpzGridColumns;
import com.archive.project.dasz.gridcolumns.service.ITXtpzGridColumnsService;
import com.archive.project.dasz.physicaltable.domain.PhysicalTable;
import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper;
import com.archive.project.dasz.physicaltablecolumn.domain.PhysicalTableColumn;
import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper;
import com.archive.project.system.dict.domain.DictData;
import com.archive.project.system.dict.mapper.DictDataMapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ArchiveListServiceImpl
implements IArchiveListService
{
@Autowired
private PhysicalTableMapper physicalTableMapper;
@Autowired
private PhysicalTableColumnMapper physicalTableColumnMapper;
@Autowired
private IExecuteSqlService executeSqlService;
@Autowired
private ITXtpzGridColumnsService itXtpzGridColumnsService;
@Autowired
private DictDataMapper dictDataMapper;
@Autowired
private ArchiveConfig archiveConfig;
public List<ArchiveTableColumn> getColumns(String id, String code) {
List<ArchiveTableColumn> resultList = new ArrayList<>();
PhysicalTable physicalTable = new PhysicalTable();
physicalTable.setArchivetypeid(id);
physicalTable.setTableCode(code);
List<PhysicalTable> tablesList = this.physicalTableMapper.selectPhysicalTableList(physicalTable);
if (tablesList != null && tablesList.size() > 0) {
physicalTable = tablesList.get(0);
PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn();
physicalTableColumn.setTableId(physicalTable.getId());
physicalTableColumn.setLbx(Long.valueOf(1L));
List<PhysicalTableColumn> columnsList = new ArrayList<>();
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
columnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
columnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn);
}
if (columnsList != null && columnsList.size() > 0) {
ArchiveTableColumn columnOne = new ArchiveTableColumn();
columnOne.setCheckbox(true);
resultList.add(columnOne);
ArchiveTableColumn columnTwo = new ArchiveTableColumn();
columnTwo.setField("id");
columnTwo.setTitle("");
columnTwo.setVisible(false);
resultList.add(columnTwo);
TXtpzGridColumns tXtpzGridColumns = new TXtpzGridColumns();
tXtpzGridColumns.setTableId(physicalTable.getId());
List<TXtpzGridColumns> tglist = this.itXtpzGridColumnsService.selectTXtpzGridColumnsList(tXtpzGridColumns);
for (TXtpzGridColumns tableColumn : tglist) {
ArchiveTableColumn column = new ArchiveTableColumn();
if (StringUtils.isEmpty(tableColumn.getBy1())) {
column.setField(tableColumn.getColumnname());
column.setTitle(tableColumn.getShowname());
column.setWidth(Integer.parseInt(String.valueOf(tableColumn.getWidth())));
} else {
column.setField(tableColumn.getColumnname());
column.setTitle(tableColumn.getShowname());
column.setCodeType(tableColumn.getBy1());
column.setWidth(Integer.parseInt(String.valueOf(tableColumn.getWidth())));
}
resultList.add(column);
}
}
}
return resultList;
}
public Map<String, String> getOrderColumns(String id, String code) {
Map<String, String> map = new HashMap<>();
String orderColumns = "";
String orderType = "asc";
PhysicalTable physicalTable = new PhysicalTable();
physicalTable.setArchivetypeid(id);
physicalTable.setTableCode(code);
List<PhysicalTable> tablesList = this.physicalTableMapper.selectPhysicalTableList(physicalTable);
if (tablesList != null && tablesList.size() > 0) {
physicalTable = tablesList.get(0);
PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn();
physicalTableColumn.setTableId(physicalTable.getId());
physicalTableColumn.setPxx(Long.valueOf(1L));
List<PhysicalTableColumn> columnsList = new ArrayList<>();
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
columnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
columnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn);
}
if (columnsList != null && columnsList.size() > 0) {
for (PhysicalTableColumn tableColumn : columnsList) {
if (tableColumn.getBz() != null && tableColumn.getBz().contains("倒序")) {
orderType = "desc";
}
orderColumns = orderColumns + "," + tableColumn.getColumnCode() + " " + orderType;
}
}
}
if (orderColumns.length() > 0) {
orderColumns = orderColumns.substring(1, orderColumns.length());
}
map.put("orderColumns", orderColumns);
map.put("orderType", orderType);
return map;
}
public Map<String, Object> selectArchiveList(String id, String code, String ownerid, Integer pageNum, Integer pageSize, String orderBy, String orderByColumn, Map<String, Object> formData, String isRecycle, String status) {
Map<String, Object> resultMap = new HashMap<>();
List<LinkedHashMap<String, Object>> resultList = new ArrayList<>();
Integer count = Integer.valueOf(0);
Integer beginNum = Integer.valueOf((pageNum.intValue() - 1) * pageSize.intValue());
PhysicalTable physicalTable = new PhysicalTable();
physicalTable.setArchivetypeid(id);
physicalTable.setTableCode(code);
List<PhysicalTable> tablesList = this.physicalTableMapper.selectPhysicalTableList(physicalTable);
if (tablesList != null && tablesList.size() > 0) {
physicalTable = tablesList.get(0);
String condition = "";
if (!"folder".equals(code) && StringUtils.isNotEmpty(ownerid) && !"ALL".equals(ownerid) && !"0".equals(ownerid) && !"ownerid".equals(ownerid)) {
condition = condition + "ownerid in (" + ownerid + ") ";
}
PhysicalTableColumn physicalTableColumn1 = new PhysicalTableColumn();
physicalTableColumn1.setTableId(physicalTable.getId());
List<PhysicalTableColumn> columnsList1 = new ArrayList<>();
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
columnsList1 = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn1);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
columnsList1 = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn1);
}
if (columnsList1 != null && columnsList1.size() > 0) {
Set<String> keySet = formData.keySet();
for (String key : keySet) {
String value = String.valueOf(formData.get(key));
for (PhysicalTableColumn tableColumn : columnsList1) {
String field = tableColumn.getColumnCode();
if ((key.equals(field) || key.replaceAll("_Qazwsx13579!", "").equals(field) || key.replaceAll("_Qazwsx24680!", "").equals(field)) &&
!"pageNum".equals(key) && !"pageSize".equals(key) && !"isAsc".equals(key) && StringUtils.isNotEmpty(value)) {
Long jsfs = tableColumn.getJsfs();
if (jsfs.longValue() == 0L) {
condition = condition + "and " + field + " like '%" + value + "%' ";
continue;
}
if (jsfs.longValue() == 1L) {
condition = condition + "and " + field + " = '" + value + "' ";
continue;
}
if (jsfs.longValue() == 2L) {
condition = condition + "and " + field + " > '" + value + "' ";
continue;
}
if (jsfs.longValue() == 3L) {
condition = condition + "and " + field + " < '" + value + "' ";
continue;
}
if (jsfs.longValue() == 4L) {
condition = condition + "and " + field + " >= '" + value + "' ";
continue;
}
if (jsfs.longValue() == 5L) {
condition = condition + "and " + field + " <= '" + value + "' ";
continue;
}
if (jsfs.longValue() == 6L) {
if (key.replaceAll("_Qazwsx13579!", "").equals(field)) {
condition = condition + "and " + field + " >= '" + value + "' ";
}
if (key.replaceAll("_Qazwsx24680!", "").equals(field)) {
condition = condition + "and " + field + " <= '" + value + "' ";
}
continue;
}
condition = condition + "and " + field + " like '%" + value + "%' ";
}
}
if ("ids".equals(key)) {
condition = condition + "and id in (" + value + ")";
}
}
}
if (condition.startsWith("and")) {
condition = condition.substring(3);
}
if (isRecycle.equals("true")) {
if (condition.length() > 0) {
condition = " where is_delete = '1' and " + condition;
} else {
condition = " where is_delete = '1' ";
}
} else if (condition.length() > 0) {
condition = " is_delete = '0' and " + condition;
} else {
condition = " is_delete = '0' ";
}
if (status != null && !status.equals("") && !status.equals("0")) {
if (condition.length() > 0) {
condition = " where status = '" + status + "' and " + condition;
} else {
condition = " where status = '" + status + "' ";
}
}
PhysicalTableColumn physicalTableColumn2 = new PhysicalTableColumn();
physicalTableColumn2.setTableId(physicalTable.getId());
physicalTableColumn2.setLbx(Long.valueOf(1L));
List<PhysicalTableColumn> columnsList2 = new ArrayList<>();
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
columnsList2 = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn2);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
columnsList2 = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn2);
}
if (columnsList2 != null && columnsList2.size() > 0) {
String sql = "select id,";
for (PhysicalTableColumn tableColumn : columnsList2) {
sql = sql + tableColumn.getColumnCode() + ",";
}
sql = sql.substring(0, sql.lastIndexOf(","));
sql = sql + " from " + physicalTable.getTablename() + condition;
if (StringUtils.isNotEmpty(orderByColumn))
{
sql = sql + " order by " + orderByColumn;
}
sql = sql + " limit " + beginNum + " , " + pageSize;
resultList = this.executeSqlService.queryList(sql);
String countSql = "SELECT COUNT(*) FROM " + physicalTable.getTablename() + condition;
count = this.executeSqlService.jdbcTemplateQueryCount(countSql);
}
}
resultMap.put("list", resultList);
resultMap.put("count", count);
return resultMap;
}
public String getSearchHtml(String id, String code) {
String html = "";
PhysicalTable physicalTable = new PhysicalTable();
physicalTable.setArchivetypeid(id);
physicalTable.setTableCode(code);
List<PhysicalTable> physicalTableList = this.physicalTableMapper.selectPhysicalTableList(physicalTable);
if (physicalTableList != null && physicalTableList.size() > 0) {
Long tableId = ((PhysicalTable)physicalTableList.get(0)).getId();
PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn();
physicalTableColumn.setTableId(tableId);
physicalTableColumn.setJsx(Long.valueOf(1L));
List<PhysicalTableColumn> tableColumnsList = new ArrayList<>();
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn);
}
if (tableColumnsList != null && tableColumnsList.size() > 0) {
StringBuffer sb = new StringBuffer();
sb.append("<div class='col-sm-12 search-collapse'>");
sb.append("<form id='archive-search-form'>");
sb.append("<div class='select-list'>");
sb.append("<ul>");
for (int i = 0; i < tableColumnsList.size(); i++) {
PhysicalTableColumn tableColumns = tableColumnsList.get(i);
String columnName = tableColumns.getColumnName();
String columnCode = tableColumns.getColumnCode();
String columnCodeType = tableColumns.getColumnCodetype();
Long jsfs = tableColumns.getJsfs();
if (StringUtils.isEmpty(columnCodeType)) {
if (jsfs.longValue() == 6L) {
sb.append("<li class='select-time'>");
sb.append("<label>" + columnName + "</label><input type='text' class='time-input' name='" + columnCode + "_Qazwsx13579!'/>");
sb.append("<span>-</span>");
sb.append("<input class='time-input' type='text' name='" + columnCode + "_Qazwsx24680!'/>");
sb.append("</li>");
} else {
sb.append("<li>");
sb.append("<label>" + columnName + "</label><input type='text' name='" + columnCode + "'/>");
sb.append("</li>");
}
} else {
DictData dictData = new DictData();
dictData.setDictType(columnCodeType);
List<DictData> dictDataList = this.dictDataMapper.selectDictDataList(dictData);
if (jsfs.longValue() == 6L) {
sb.append("<li class='select-time'>");
sb.append("<label>" + columnName + "</label><select class='time-input' name='" + columnCode + "_Qazwsx13579!'>");
sb.append("<option value=''>所有</option>"); int j;
for (j = 0; j < dictDataList.size(); j++) {
DictData dictDataTemp = dictDataList.get(j);
sb.append("<option value='" + dictDataTemp.getDictValue() + "'>" + dictDataTemp.getDictLabel() + "</option>");
}
sb.append("</select>");
sb.append("<span>-</span>");
sb.append("<select class='time-input' name='" + columnCode + "_Qazwsx24680!'>");
sb.append("<option value=''>所有</option>");
for (j = 0; j < dictDataList.size(); j++) {
DictData dictDataTemp = dictDataList.get(j);
sb.append("<option value='" + dictDataTemp.getDictValue() + "'>" + dictDataTemp.getDictLabel() + "</option>");
}
sb.append("</select>");
sb.append("</li>");
} else {
sb.append("<li>");
sb.append("<label>" + columnName + "</label><select name='" + columnCode + "'>");
sb.append("<option value=''>所有</option>");
for (int j = 0; j < dictDataList.size(); j++) {
DictData dictDataTemp = dictDataList.get(j);
sb.append("<option value='" + dictDataTemp.getDictValue() + "'>" + dictDataTemp.getDictLabel() + "</option>");
}
sb.append("</select>");
sb.append("</li>");
}
}
}
sb.append("<li>");
sb.append("<a class='btn btn-primary btn-rounded btn-sm' onclick='archiveSearch()'><i class='fa fa-search'></i>&nbsp;搜索</a>");
sb.append("<a class='btn btn-warning btn-rounded btn-sm' onclick='$.form.reset()'><i class='fa fa-refresh'></i>&nbsp;重置</a>");
sb.append("</li>");
sb.append("</ul>");
sb.append("</div>");
sb.append("</form>");
sb.append("</div>");
html = sb.toString();
}
}
return html;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dasz\archivetype\service\impl\ArchiveListServiceImpl.class

Loading…
Cancel
Save