From 3738ff2610dc6301dc6af5ab9d23c6804bf4e46d Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Wed, 21 May 2025 08:51:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=BC=A0=E8=BE=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ArchiveSearchController.java | 128 +- .../impl/ArchiveSearchServiceImpl.java | 314 +-- .../impl/ArchiveImportBatchServiceImpl.java | 1738 ++++++++--------- .../controller/ArchiveListController.java | 622 +++--- .../controller/ArchiveTypeController.java | 460 ++--- .../domain/ArchiveTableColumn.java | 136 +- .../dasz/archivetype/domain/ArchiveType.java | 240 +-- .../domain/ArchiveTypeManageTree.java | 230 +-- .../service/impl/ArchiveListServiceImpl.java | 840 ++++---- .../service/impl/ArchiveTypeServiceImpl.java | 1012 +++++----- 10 files changed, 2860 insertions(+), 2860 deletions(-) diff --git a/src/main/java/com/archive/project/dacx/archivesearch/controller/ArchiveSearchController.java b/src/main/java/com/archive/project/dacx/archivesearch/controller/ArchiveSearchController.java index 5c7a80e..0f53cd7 100644 --- a/src/main/java/com/archive/project/dacx/archivesearch/controller/ArchiveSearchController.java +++ b/src/main/java/com/archive/project/dacx/archivesearch/controller/ArchiveSearchController.java @@ -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 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 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 diff --git a/src/main/java/com/archive/project/dacx/archivesearch/service/impl/ArchiveSearchServiceImpl.java b/src/main/java/com/archive/project/dacx/archivesearch/service/impl/ArchiveSearchServiceImpl.java index 66d6605..d5f0d46 100644 --- a/src/main/java/com/archive/project/dacx/archivesearch/service/impl/ArchiveSearchServiceImpl.java +++ b/src/main/java/com/archive/project/dacx/archivesearch/service/impl/ArchiveSearchServiceImpl.java @@ -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 selectArchiveList(Integer pageNum, Integer pageSize, String orderBy, String orderByColumn, String keyword, String ft, String py, String qw) { -/* 51 */ Map resultMap = new HashMap<>(); -/* 52 */ List> 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], "" + words[i] + ""); -/* */ } -/* */ } -/* */ } -/* */ } -/* 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 selectArchiveList(Integer pageNum, Integer pageSize, String orderBy, String orderByColumn, String keyword, String ft, String py, String qw) { + Map resultMap = new HashMap<>(); + List> 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], "" + words[i] + ""); + } + } + } + } + return value; + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dacx\archivesearch\service\impl\ArchiveSearchServiceImpl.class diff --git a/src/main/java/com/archive/project/dajs/archiveimportbatch/service/impl/ArchiveImportBatchServiceImpl.java b/src/main/java/com/archive/project/dajs/archiveimportbatch/service/impl/ArchiveImportBatchServiceImpl.java index 4b83f78..5542826 100644 --- a/src/main/java/com/archive/project/dajs/archiveimportbatch/service/impl/ArchiveImportBatchServiceImpl.java +++ b/src/main/java/com/archive/project/dajs/archiveimportbatch/service/impl/ArchiveImportBatchServiceImpl.java @@ -1,874 +1,874 @@ -/* */ package com.archive.project.dajs.archiveimportbatch.service.impl + package com.archive.project.dajs.archiveimportbatch.service.impl ; -/* */ -/* */ import com.archive.common.archiveUtil.ExcelUtilArchive; -/* */ import com.archive.common.archiveUtil.TableUtil; -/* */ import com.archive.common.archiveUtil.ZipUtil; -/* */ import com.archive.common.utils.DateUtils; -/* */ import com.archive.common.utils.security.ShiroUtils; -/* */ import com.archive.common.utils.text.Convert; -/* */ import com.archive.framework.config.ArchiveConfig; -/* */ import com.archive.project.common.service.IExecuteSqlService; -/* */ import com.archive.project.dajs.archiveimportbatch.domain.ArchiveImportBatch; -/* */ import com.archive.project.dajs.archiveimportbatch.mapper.ArchiveImportBatchMapper; -/* */ import com.archive.project.dajs.archiveimportbatch.service.IArchiveImportBatchService; -/* */ import com.archive.project.dasz.archivetype.domain.ArchiveType; -/* */ import com.archive.project.dasz.archivetype.service.IArchiveTypeService; -/* */ import com.archive.project.dasz.ccgl.service.ICcglService; -/* */ import com.archive.project.dasz.physicaltable.domain.PhysicalTable; -/* */ import com.archive.project.dasz.physicaltable.service.IPhysicalTableService; -/* */ import com.archive.project.dasz.physicaltablecolumn.domain.PhysicalTableColumn; -/* */ import com.archive.project.dasz.physicaltablecolumn.service.IPhysicalTableColumnService; -/* */ import com.archive.project.system.dict.utils.DictUtils; -/* */ import java.io.File; -/* */ import java.io.IOException; -/* */ import java.text.DateFormat; -/* */ import java.text.DecimalFormat; -/* */ import java.text.SimpleDateFormat; -/* */ import java.util.ArrayList; -/* */ import java.util.Date; -/* */ import java.util.HashMap; -/* */ import java.util.LinkedHashMap; -/* */ import java.util.List; -/* */ import java.util.Map; -/* */ import org.aspectj.util.FileUtil; -/* */ import org.springframework.beans.factory.annotation.Autowired; -/* */ import org.springframework.stereotype.Service; -/* */ import org.springframework.web.bind.annotation.RequestParam; -/* */ import org.springframework.web.multipart.MultipartFile; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Service -/* */ public class ArchiveImportBatchServiceImpl -/* */ implements IArchiveImportBatchService -/* */ { -/* */ @Autowired -/* */ private ArchiveImportBatchMapper archiveImportBatchMapper; -/* */ @Autowired -/* */ private IExecuteSqlService executeSqlService; -/* */ @Autowired -/* */ private IArchiveTypeService archiveTypeService; -/* */ @Autowired -/* */ private IPhysicalTableService physicalTableService; -/* */ @Autowired -/* */ private IPhysicalTableColumnService physicalTableColumnService; -/* */ @Autowired -/* */ private ICcglService ccglService; -/* */ -/* */ public ArchiveImportBatch selectArchiveImportBatchById(Long id) { -/* 74 */ return this.archiveImportBatchMapper.selectArchiveImportBatchById(id); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public List selectArchiveImportBatchList(ArchiveImportBatch archiveImportBatch) { -/* 86 */ return this.archiveImportBatchMapper.selectArchiveImportBatchList(archiveImportBatch); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public int insertArchiveImportBatch(ArchiveImportBatch archiveImportBatch) { -/* 98 */ archiveImportBatch.setCreateTime(DateUtils.getNowDate()); -/* 99 */ return this.archiveImportBatchMapper.insertArchiveImportBatch(archiveImportBatch); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public int updateArchiveImportBatch(ArchiveImportBatch archiveImportBatch) { -/* 111 */ return this.archiveImportBatchMapper.updateArchiveImportBatch(archiveImportBatch); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public int deleteArchiveImportBatchByIds(String ids) { -/* 123 */ return this.archiveImportBatchMapper.deleteArchiveImportBatchByIds(Convert.toStrArray(ids)); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public boolean deleteArchiveImportBatchAndDataByIds(String type, String ids) { -/* 136 */ boolean res = false; -/* */ try { -/* 138 */ String[] idss = Convert.toStrArray(ids); -/* 139 */ for (int i = 0; i < idss.length; i++) { -/* 140 */ String id = idss[i]; -/* 141 */ if (id != null && !id.equals("")) { -/* */ -/* 143 */ ArchiveImportBatch archiveImportBatch = this.archiveImportBatchMapper.selectArchiveImportBatchById(Long.valueOf(Long.parseLong(id))); -/* 144 */ long archiveTypeId = archiveImportBatch.getBatcharchivetypeid().longValue(); -/* 145 */ ArchiveType archiveType = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(archiveTypeId)); -/* 146 */ String datype = archiveType.getType(); -/* 147 */ String archiveCode = archiveType.getArhciveCode(); -/* 148 */ if (datype.equals("folder")) { -/* */ -/* 150 */ if (type.equals("mldr")) { -/* */ -/* 152 */ String deleteAjSql = "delete from t_ar_" + archiveCode + "_folder where batchNo='" + archiveImportBatch.getBatchno() + "'"; -/* 153 */ String deleteJnSql = "delete from t_ar_" + archiveCode + "_file where batchNo='" + archiveImportBatch.getBatchno() + "'"; -/* 154 */ this.executeSqlService.delete(deleteAjSql); -/* 155 */ this.executeSqlService.delete(deleteJnSql); -/* 156 */ } else if (type.equals("qwgj")) { -/* */ -/* 158 */ String JnSql = "select filepath from t_ar_" + archiveCode + "_document where batchNo='" + archiveImportBatch.getBatchno() + "'"; -/* 159 */ List> datalist = this.executeSqlService.queryList(JnSql); -/* 160 */ for (int k = 0; k < datalist.size(); k++) { -/* 161 */ String path = (((LinkedHashMap)datalist.get(k)).get("filepath") == null) ? "" : ((LinkedHashMap)datalist.get(k)).get("filepath").toString(); -/* 162 */ File fil = new File(path); -/* 163 */ if (fil.exists()) { -/* 164 */ fil.setWritable(true); -/* 165 */ fil.delete(); -/* */ } -/* */ } -/* 168 */ String deleteDocumentSql = "delete from t_ar_" + archiveCode + "_document where batchNo='" + archiveImportBatch.getBatchno() + "'"; -/* 169 */ this.executeSqlService.delete(deleteDocumentSql); -/* */ } -/* 171 */ } else if (datype.equals("file")) { -/* */ -/* 173 */ if (type.equals("mldr")) { -/* */ -/* 175 */ String deleteSql = "delete from t_ar_" + archiveCode + "_file where batchNo='" + archiveImportBatch.getBatchno() + "'"; -/* 176 */ this.executeSqlService.delete(deleteSql); -/* 177 */ } else if (type.equals("qwgj")) { -/* */ -/* 179 */ String fileSql = "select filepath from t_ar_" + archiveCode + "_document where batchNo='" + archiveImportBatch.getBatchno() + "'"; -/* 180 */ List> datalist = this.executeSqlService.queryList(fileSql); -/* 181 */ for (int k = 0; k < datalist.size(); k++) { -/* 182 */ String path = (((LinkedHashMap)datalist.get(k)).get("filepath") == null) ? "" : ((LinkedHashMap)datalist.get(k)).get("filepath").toString(); -/* 183 */ File fil = new File(path); -/* 184 */ if (fil.exists()) { -/* 185 */ fil.setWritable(true); -/* 186 */ fil.delete(); -/* */ } -/* */ } -/* 189 */ String deleteDocumentSql = "delete from t_ar_" + archiveCode + "_document where batchNo='" + archiveImportBatch.getBatchno() + "'"; -/* 190 */ this.executeSqlService.delete(deleteDocumentSql); -/* */ } -/* */ } -/* */ } -/* */ } -/* */ -/* */ -/* 197 */ this.archiveImportBatchMapper.deleteArchiveImportBatchByIds(Convert.toStrArray(ids)); -/* 198 */ res = true; -/* 199 */ } catch (Exception ex) { -/* 200 */ System.out.println("ERROR出现异常信息:" + ex.getMessage()); -/* */ } -/* 202 */ return res; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public int deleteArchiveImportBatchById(Long id) { -/* 215 */ return this.archiveImportBatchMapper.deleteArchiveImportBatchById(id); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public String[] excelImport(int sheetindex, String filepath, List> columnList, long batcharchivetypeid, String batchNo) { -/* 228 */ String ownerId = ""; -/* 229 */ String[] sttr = new String[3]; -/* 230 */ int successCount = 0; -/* 231 */ int failCount = 0; -/* 232 */ String messageContent = ""; -/* 233 */ long tableId = TableUtil.getTableIdByArchiveTypeId(batcharchivetypeid); -/* 234 */ String tableName = TableUtil.getTableName(Long.valueOf(tableId)); -/* 235 */ String[] excelColuns = ExcelUtilArchive.readExcelFirstRow(filepath, Integer.valueOf(sheetindex)); -/* 236 */ List> listdata = ExcelUtilArchive.readExcel(filepath, Integer.valueOf(sheetindex)); -/* 237 */ for (int i = 0; i < listdata.size(); i++) { -/* 238 */ Map map = listdata.get(i); -/* 239 */ String insertConlums = ""; -/* 240 */ String insertValuess = ""; -/* 241 */ for (int j = 0; j < columnList.size(); j++) { -/* 242 */ for (int k = 0; k < excelColuns.length; k++) { -/* 243 */ String excelColumn = (String)((Map)columnList.get(j)).get("excelColumn"); -/* 244 */ String archiveColumn = (String)((Map)columnList.get(j)).get("archiveColumn"); -/* 245 */ if (!archiveColumn.equals("") && !archiveColumn.equals("请选择") && -/* 246 */ excelColumn.equals(excelColuns[k])) { -/* 247 */ String value = map.get(excelColuns[k]); -/* 248 */ if (!value.equals("") && !value.trim().equals("") && !value.trim().equals("请选择")) { -/* */ -/* */ -/* 251 */ if (sheetindex == 1 && "档号".equals(excelColuns[k]) && -/* 252 */ value.indexOf("-") != -1) { -/* 253 */ String folderDh = value.substring(0, value.lastIndexOf("-")); -/* 254 */ String folderTableName = tableName.toLowerCase().replace("_file", "_folder"); -/* 255 */ String queryOwnerIdSql = "SELECT MAX(ID) FROM " + folderTableName + " WHERE DH = '" + folderDh + "'"; -/* 256 */ ownerId = this.executeSqlService.getSingle(queryOwnerIdSql); -/* */ } -/* */ -/* */ -/* */ -/* 261 */ insertConlums = insertConlums + "," + archiveColumn; -/* 262 */ insertValuess = insertValuess + ",'" + getCodeValue(tableId, archiveColumn, value) + "'"; -/* */ -/* */ -/* */ break; -/* */ } -/* */ } -/* */ } -/* */ } -/* */ -/* */ -/* 272 */ if (sheetindex == 1) { -/* 273 */ tableName = tableName.toLowerCase().replace("_folder", "_file"); -/* */ } -/* 275 */ if (ownerId != null && !ownerId.equals("")) { -/* 276 */ insertConlums = insertConlums + ", ownerid"; -/* 277 */ insertValuess = insertValuess + ",'" + ownerId + "'"; -/* */ } -/* 279 */ if (insertConlums.length() > 1) { -/* 280 */ insertConlums = insertConlums.substring(1, insertConlums.length()); -/* 281 */ insertValuess = insertValuess.substring(1, insertValuess.length()); -/* */ } -/* 283 */ String insertSql = "insert into " + tableName + "(" + insertConlums + ",is_delete,status,batchno) values(" + insertValuess + ",0,60,'" + batchNo + "')"; -/* 284 */ System.out.println(insertSql); -/* 285 */ if (this.executeSqlService.insert(insertSql)) { -/* 286 */ successCount++; -/* */ } else { -/* 288 */ if (sheetindex == 1) { -/* 289 */ messageContent = messageContent + " 案卷页第" + i + "行导入失败;"; -/* */ } else { -/* 291 */ messageContent = messageContent + " 文件页第" + i + "行导入失败;"; -/* */ } -/* 293 */ failCount++; -/* */ } -/* */ } -/* 296 */ if (messageContent.equals("")) { -/* 297 */ messageContent = "导入成功" + successCount + "条,无异常情况"; -/* */ } -/* 299 */ sttr[0] = "导入成功" + successCount + "条"; -/* 300 */ sttr[1] = "导入失败" + failCount + "条"; -/* 301 */ sttr[2] = messageContent; -/* 302 */ return sttr; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public List> getAllListToSelect(long archiveTypeId, String tableType) { -/* 314 */ List> columnsList = new ArrayList<>(); -/* 315 */ List lphycs = new ArrayList<>(); -/* 316 */ ArchiveType archivetypes = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(archiveTypeId)); -/* 317 */ String archiveCode = archivetypes.getArhciveCode(); -/* 318 */ String archiveType = archivetypes.getType(); -/* 319 */ String tableName = ""; -/* 320 */ tableName = "t_ar_" + archiveCode + "_" + tableType; -/* 321 */ if (!tableName.equals("")) { -/* 322 */ PhysicalTable pt = new PhysicalTable(); -/* 323 */ pt.setTablename(tableName.toLowerCase()); -/* 324 */ List pts = this.physicalTableService.selectPhysicalTableList(pt); -/* 325 */ if (pts.size() > 0 && pts.get(0) != null) { -/* 326 */ PhysicalTableColumn ptc = new PhysicalTableColumn(); -/* 327 */ ptc.setTableId(((PhysicalTable)pts.get(0)).getId()); -/* 328 */ lphycs = this.physicalTableColumnService.selectPhysicalTableColumnList(ptc); -/* */ -/* */ -/* 331 */ for (int i = 0; i < lphycs.size(); i++) { -/* 332 */ Map columsMap = new HashMap<>(); -/* 333 */ columsMap.put("value", ((PhysicalTableColumn)lphycs.get(i)).getColumnCode()); -/* 334 */ columsMap.put("text", ((PhysicalTableColumn)lphycs.get(i)).getColumnName()); -/* 335 */ columnsList.add(columsMap); -/* */ } -/* */ } -/* */ } -/* 339 */ return columnsList; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public Map insertDocByQwgj(String path, long archiveTypeId, String column, String batchNo) { -/* 350 */ Map map = new HashMap<>(); -/* 351 */ File file = new File(path); -/* 352 */ String fileName = file.getName().substring(0, file.getName().lastIndexOf('.')); -/* 353 */ String hz = file.getName().substring(file.getName().lastIndexOf('.') + 1); -/* 354 */ String fileSize = FormetFileSize(file.length()); -/* 355 */ DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -/* 356 */ ArchiveType archivetypes = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(archiveTypeId)); -/* 357 */ String archiveCode = archivetypes.getArhciveCode(); -/* 358 */ String tableName = "t_ar_" + archiveCode + "_file"; -/* 359 */ String tableId = TableUtil.getTableId(tableName); -/* 360 */ String docTableName = "t_ar_" + archiveCode + "_document"; -/* 361 */ String selectIdSql = "select id from " + tableName + " where " + column + "='" + fileName + "' and is_delete='0'"; -/* 362 */ System.out.println("全文挂接查找条目idsql:" + selectIdSql); -/* 363 */ List> idlist = this.executeSqlService.queryList(selectIdSql); -/* 364 */ if (idlist.size() > 0 && idlist.get(0) != null) { -/* 365 */ String archiveId = (((LinkedHashMap)idlist.get(0)).get("id") == null) ? "" : ((LinkedHashMap)idlist.get(0)).get("id").toString(); -/* */ -/* 367 */ String xdlj = this.ccglService.getCreateDocumentPathByFile(Long.parseLong(archiveId), Long.parseLong(tableId)); -/* 368 */ String filepath = ArchiveConfig.getInstance().getUploadPath() + "/DocumentFile" + xdlj; -/* 369 */ filepath = filepath.replaceAll("\\\\", "/"); -/* 370 */ File localFile = new File(filepath); -/* 371 */ if (!localFile.exists()) { -/* 372 */ localFile.mkdirs(); -/* */ } -/* 374 */ String mewpath = filepath + "/" + file.getName(); -/* */ try { -/* 376 */ FileUtil.copyFile(new File(path), new File(mewpath)); -/* 377 */ } catch (IOException e) { -/* 378 */ e.printStackTrace(); -/* */ } -/* */ -/* 381 */ String insertDocSql = "insert into " + docTableName + "(create_time,create_user,filename,filehz,filesize,filepath,ownerid,tableId,batcharchivetypeid,batchno) values('" + dateformat.format(new Date()) + "','" + ShiroUtils.getSysUser().getUserName() + "','" + fileName + "','" + hz + "','" + fileSize + "','" + mewpath + "','" + archiveId + "','" + tableId + "','" + archiveTypeId + "','" + batchNo + "')"; -/* 382 */ this.executeSqlService.insert(insertDocSql); -/* */ -/* 384 */ String updateSql = "update " + tableName + " set dqzws=dqzws+1 where id=" + archiveId; -/* 385 */ this.executeSqlService.update(updateSql); -/* 386 */ map.put("res", "1"); -/* 387 */ map.put("msg", "文件【" + fileName + "】挂接成功!"); -/* */ } else { -/* 389 */ map.put("res", "0"); -/* 390 */ map.put("msg", "文件【" + fileName + "】挂接失败,原因是没有找到对应条目!"); -/* */ } -/* 392 */ return map; -/* */ } -/* */ -/* 395 */ int folderId = 0; -/* 396 */ int fileId = 0; -/* 397 */ int documentId = 0; -/* 398 */ int infoId = 0; -/* 399 */ int successCount = 0; -/* 400 */ int failCount = 0; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public Map gsbUploadAndImport(MultipartFile[] files, long archiveTypeId, String column) { -/* 409 */ String resMessage = ""; -/* 410 */ String path = ""; -/* */ try { -/* 412 */ if (files != null) { -/* 413 */ for (int i = 0; i < files.length; i++) { -/* 414 */ String fileName = files[i].getOriginalFilename(); -/* 415 */ String filepath = ArchiveConfig.getInstance().getUploadPath() + "/gsbdr/temp"; -/* 416 */ File localFile = new File(filepath); -/* 417 */ if (!localFile.exists()) { -/* 418 */ localFile.mkdirs(); -/* */ } -/* 420 */ path = filepath + "/" + fileName; -/* 421 */ File server_file = new File(path); -/* 422 */ files[i].transferTo(server_file); -/* */ -/* */ -/* 425 */ String newfileName = server_file.getName().replace(".zip", ""); -/* 426 */ newfileName = newfileName.replace(".rar", ""); -/* */ -/* 428 */ ZipUtil.unZip(server_file, filepath); -/* */ -/* 430 */ System.out.println(filepath + "/" + newfileName); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 549 */ catch (Exception e) { -/* 550 */ resMessage = "格式包上传导入出现异常:" + e.getMessage(); -/* 551 */ e.printStackTrace(); -/* */ } -/* 553 */ Map resMap = new HashMap<>(); -/* 554 */ resMap.put("message", resMessage); -/* 555 */ resMap.put("path", path); -/* 556 */ resMap.put("sucess", String.valueOf(this.successCount)); -/* 557 */ resMap.put("fail", String.valueOf(this.failCount)); -/* 558 */ return resMap; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public Map mldrFileUploadAndImport(MultipartFile file, long archiveTypeId) { -/* 570 */ Map map = new HashMap<>(); -/* 571 */ List> columnsList = new ArrayList<>(); -/* */ -/* 573 */ if (file.isEmpty()) { -/* 574 */ return map; -/* */ } -/* 576 */ String fileName = file.getOriginalFilename(); -/* 577 */ String filepath = ArchiveConfig.getInstance().getUploadPath() + "/mldr/temp"; -/* 578 */ File localFile = new File(filepath); -/* 579 */ if (!localFile.exists()) { -/* 580 */ localFile.mkdirs(); -/* */ } -/* 582 */ String path = filepath + "/" + fileName; -/* */ try { -/* 584 */ File server_file = new File(path); -/* 585 */ file.transferTo(server_file); -/* */ } -/* 587 */ catch (Exception exception) {} -/* */ -/* */ -/* 590 */ map.put("filePath", path); -/* */ -/* 592 */ String[] excelColuns = ExcelUtilArchive.readExcelFirstRow(path, Integer.valueOf(0)); -/* 593 */ List lphycs = new ArrayList<>(); -/* 594 */ if (excelColuns != null) { -/* */ -/* 596 */ ArchiveType archivetypes = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(archiveTypeId)); -/* 597 */ String archiveCode = archivetypes.getArhciveCode(); -/* 598 */ String archiveType = archivetypes.getType(); -/* 599 */ String tableName = ""; -/* 600 */ if (archiveType.toLowerCase().equals("file")) { -/* 601 */ tableName = "t_ar_" + archiveCode + "_file"; -/* 602 */ } else if (archiveType.toLowerCase().equals("folder")) { -/* 603 */ tableName = "t_ar_" + archiveCode + "_folder"; -/* */ } -/* 605 */ if (!tableName.equals("")) { -/* 606 */ PhysicalTable pt = new PhysicalTable(); -/* 607 */ pt.setTablename(tableName.toLowerCase()); -/* 608 */ List pts = this.physicalTableService.selectPhysicalTableList(pt); -/* 609 */ if (pts.size() > 0 && pts.get(0) != null) { -/* 610 */ PhysicalTableColumn ptc = new PhysicalTableColumn(); -/* 611 */ ptc.setTableId(((PhysicalTable)pts.get(0)).getId()); -/* 612 */ lphycs = this.physicalTableColumnService.selectPhysicalTableColumnList(ptc); -/* */ -/* */ -/* 615 */ for (int j = 0; j < lphycs.size(); j++) { -/* 616 */ Map columsMap = new HashMap<>(); -/* 617 */ columsMap.put("value", ((PhysicalTableColumn)lphycs.get(j)).getColumnCode()); -/* 618 */ columsMap.put("text", ((PhysicalTableColumn)lphycs.get(j)).getColumnName()); -/* 619 */ columnsList.add(columsMap); -/* */ } -/* */ } else { -/* 622 */ map.put("status", "0"); -/* 623 */ map.put("msg", "获取档案表信息失败!"); -/* */ } -/* */ } else { -/* 626 */ map.put("status", "0"); -/* 627 */ map.put("msg", "获取档案表name失败!"); -/* */ } -/* */ -/* 630 */ List> allList = new ArrayList<>(); -/* 631 */ Map resMap = null; -/* 632 */ for (int i = 0; i < excelColuns.length; i++) { -/* 633 */ resMap = new HashMap<>(); -/* 634 */ resMap.put("excelColumn", excelColuns[i]); -/* */ -/* 636 */ String archiveColumn = "请选择"; -/* 637 */ for (int j = 0; j < lphycs.size(); j++) { -/* 638 */ String showName = ((PhysicalTableColumn)lphycs.get(j)).getColumnName(); -/* 639 */ if (showName.equals(excelColuns[i])) { -/* 640 */ archiveColumn = ((PhysicalTableColumn)lphycs.get(j)).getColumnCode(); -/* */ break; -/* */ } -/* */ } -/* 644 */ resMap.put("archiveColumn", archiveColumn); -/* 645 */ allList.add(resMap); -/* */ } -/* 647 */ map.put("data", allList); -/* 648 */ map.put("status", "1"); -/* 649 */ map.put("msg", "成功!"); -/* */ } else { -/* 651 */ map.put("status", "0"); -/* 652 */ map.put("msg", "excel获取表头失败!"); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* 660 */ map.put("columnsList", columnsList); -/* 661 */ return map; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public Map folderMldrUploadAndImport(@RequestParam("file") MultipartFile file, long archiveTypeId, String batchNo) { -/* 676 */ Map map = new HashMap<>(); -/* 677 */ List> allAJList = new ArrayList<>(); -/* 678 */ List> allJNList = new ArrayList<>(); -/* 679 */ List> AJcolumnsList = new ArrayList<>(); -/* 680 */ List> JNcolumnsList = new ArrayList<>(); -/* */ -/* 682 */ if (file.isEmpty()) { -/* 683 */ return map; -/* */ } -/* 685 */ String fileName = file.getOriginalFilename(); -/* 686 */ String filepath = ArchiveConfig.getInstance().getUploadPath() + "/mldr/temp"; -/* 687 */ File localFile = new File(filepath); -/* 688 */ if (!localFile.exists()) { -/* 689 */ localFile.mkdirs(); -/* */ } -/* 691 */ String path = filepath + "/" + fileName; -/* */ try { -/* 693 */ File server_file = new File(path); -/* 694 */ file.transferTo(server_file); -/* */ } -/* 696 */ catch (Exception exception) {} -/* */ -/* */ -/* 699 */ map.put("filePath", path); -/* */ -/* 701 */ int a = ExcelUtilArchive.getSheetCount(path); -/* 702 */ if (a < 2) { -/* 703 */ map.put("status", "0"); -/* 704 */ map.put("msg", "excel格式不对,请保证excel同时有案卷和卷内的sheet页!"); -/* */ } else { -/* 706 */ String[] AJexcelColuns = ExcelUtilArchive.readExcelFirstRow(path, Integer.valueOf(0)); -/* 707 */ String[] JNexcelColuns = ExcelUtilArchive.readExcelFirstRow(path, Integer.valueOf(1)); -/* 708 */ List lphycs = new ArrayList<>(); -/* 709 */ if (AJexcelColuns != null && JNexcelColuns != null) { -/* */ -/* 711 */ ArchiveType archivetypes = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(archiveTypeId)); -/* 712 */ String archiveCode = archivetypes.getArhciveCode(); -/* 713 */ String AJtableName = ""; -/* 714 */ String JNtableName = ""; -/* 715 */ AJtableName = "t_ar_" + archiveCode + "_folder"; -/* 716 */ JNtableName = "t_ar_" + archiveCode + "_file"; -/* */ -/* 718 */ if (!AJtableName.equals("")) { -/* 719 */ PhysicalTableColumn ptc = new PhysicalTableColumn(); -/* 720 */ ptc.setTableId(Long.valueOf(TableUtil.getTableId(AJtableName))); -/* 721 */ lphycs = this.physicalTableColumnService.selectPhysicalTableColumnList(ptc); -/* */ -/* */ -/* 724 */ for (int i = 0; i < lphycs.size(); i++) { -/* 725 */ Map columsMap = new HashMap<>(); -/* 726 */ columsMap.put("value", ((PhysicalTableColumn)lphycs.get(i)).getColumnCode()); -/* 727 */ columsMap.put("text", ((PhysicalTableColumn)lphycs.get(i)).getColumnName()); -/* 728 */ AJcolumnsList.add(columsMap); -/* */ } -/* */ -/* */ -/* 732 */ Map resMap = null; -/* 733 */ for (int j = 0; j < AJexcelColuns.length; j++) { -/* 734 */ resMap = new HashMap<>(); -/* 735 */ resMap.put("excelColumn", AJexcelColuns[j]); -/* */ -/* 737 */ String archiveColumn = "请选择"; -/* 738 */ for (int k = 0; k < lphycs.size(); k++) { -/* 739 */ String showName = ((PhysicalTableColumn)lphycs.get(k)).getColumnName(); -/* 740 */ if (showName.equals(AJexcelColuns[j])) { -/* 741 */ archiveColumn = ((PhysicalTableColumn)lphycs.get(k)).getColumnCode(); -/* */ break; -/* */ } -/* */ } -/* 745 */ resMap.put("archiveColumn", archiveColumn); -/* 746 */ allAJList.add(resMap); -/* */ } -/* 748 */ map.put("dataAJ", allAJList); -/* */ } -/* 750 */ if (!JNtableName.equals("")) { -/* 751 */ PhysicalTableColumn ptc = new PhysicalTableColumn(); -/* 752 */ ptc.setTableId(Long.valueOf(TableUtil.getTableId(JNtableName))); -/* 753 */ lphycs = this.physicalTableColumnService.selectPhysicalTableColumnList(ptc); -/* */ -/* */ -/* 756 */ for (int i = 0; i < lphycs.size(); i++) { -/* 757 */ Map columsMap = new HashMap<>(); -/* 758 */ columsMap.put("value", ((PhysicalTableColumn)lphycs.get(i)).getColumnCode()); -/* 759 */ columsMap.put("text", ((PhysicalTableColumn)lphycs.get(i)).getColumnName()); -/* 760 */ JNcolumnsList.add(columsMap); -/* */ } -/* */ -/* */ -/* 764 */ Map resMap = null; -/* 765 */ for (int j = 0; j < JNexcelColuns.length; j++) { -/* 766 */ resMap = new HashMap<>(); -/* 767 */ resMap.put("excelColumn", JNexcelColuns[j]); -/* */ -/* 769 */ String archiveColumn = "请选择"; -/* 770 */ for (int k = 0; k < lphycs.size(); k++) { -/* 771 */ String showName = ((PhysicalTableColumn)lphycs.get(k)).getColumnName(); -/* 772 */ if (showName.equals(JNexcelColuns[j])) { -/* 773 */ archiveColumn = ((PhysicalTableColumn)lphycs.get(k)).getColumnCode(); -/* */ break; -/* */ } -/* */ } -/* 777 */ resMap.put("archiveColumn", archiveColumn); -/* 778 */ allJNList.add(resMap); -/* */ } -/* 780 */ map.put("dataJN", allJNList); -/* */ } -/* */ -/* */ -/* 784 */ map.put("status", "1"); -/* 785 */ map.put("msg", "成功!"); -/* */ } else { -/* 787 */ map.put("status", "0"); -/* 788 */ map.put("msg", "excel获取表头失败!"); -/* */ } -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* 797 */ map.put("columnsAJList", AJcolumnsList); -/* 798 */ map.put("columnsJNList", JNcolumnsList); -/* 799 */ return map; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public int getTableNewId(long tableId) { -/* 809 */ int res = 0; -/* 810 */ String tableName = TableUtil.getTableName(Long.valueOf(tableId)); -/* 811 */ String sql = "select max(id)+1 ID from " + tableName; -/* 812 */ List> list = this.executeSqlService.queryList(sql); -/* 813 */ if (list != null && list.size() > 0 && list.get(0) != null) { -/* 814 */ res = Integer.parseInt((((LinkedHashMap)list.get(0)).get("ID") == null) ? "1" : ((LinkedHashMap)list.get(0)).get("ID").toString()); -/* */ } else { -/* 816 */ res = 1; -/* */ } -/* 818 */ return res; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public String getCodeValue(long tableId, String column, String value) { -/* 829 */ String res = value; -/* 830 */ PhysicalTableColumn ptc = new PhysicalTableColumn(); -/* 831 */ ptc.setTableId(Long.valueOf(tableId)); -/* 832 */ ptc.setColumnCode(column); -/* 833 */ List ptcList = this.physicalTableColumnService.selectPhysicalTableColumnList(ptc); -/* 834 */ if (ptcList != null && ptcList.size() > 0 && ptcList.get(0) != null) { -/* 835 */ ptc = ptcList.get(0); -/* 836 */ String codeType = ptc.getColumnCodetype(); -/* 837 */ if (!codeType.equals(codeType)) { -/* 838 */ String value1 = DictUtils.getDictValue(codeType, value); -/* */ -/* 840 */ if (value1 != null && !value1.equals("")) { -/* 841 */ res = value1; -/* */ } -/* */ } -/* */ } -/* */ -/* 846 */ return res; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public String FormetFileSize(long fileS) { -/* 856 */ DecimalFormat df = new DecimalFormat("#.00"); -/* 857 */ String fileSizeString = ""; -/* 858 */ if (fileS < 1024L) { -/* 859 */ fileSizeString = df.format(fileS) + "B"; -/* 860 */ } else if (fileS < 1048576L) { -/* 861 */ fileSizeString = df.format(fileS / 1024.0D) + "K"; -/* 862 */ } else if (fileS < 1073741824L) { -/* 863 */ fileSizeString = df.format(fileS / 1048576.0D) + "M"; -/* */ } else { -/* 865 */ fileSizeString = df.format(fileS / 1.073741824E9D) + "G"; -/* */ } -/* 867 */ return fileSizeString; -/* */ } -/* */ } + + import com.archive.common.archiveUtil.ExcelUtilArchive; + import com.archive.common.archiveUtil.TableUtil; + import com.archive.common.archiveUtil.ZipUtil; + import com.archive.common.utils.DateUtils; + import com.archive.common.utils.security.ShiroUtils; + import com.archive.common.utils.text.Convert; + import com.archive.framework.config.ArchiveConfig; + import com.archive.project.common.service.IExecuteSqlService; + import com.archive.project.dajs.archiveimportbatch.domain.ArchiveImportBatch; + import com.archive.project.dajs.archiveimportbatch.mapper.ArchiveImportBatchMapper; + import com.archive.project.dajs.archiveimportbatch.service.IArchiveImportBatchService; + import com.archive.project.dasz.archivetype.domain.ArchiveType; + import com.archive.project.dasz.archivetype.service.IArchiveTypeService; + import com.archive.project.dasz.ccgl.service.ICcglService; + import com.archive.project.dasz.physicaltable.domain.PhysicalTable; + import com.archive.project.dasz.physicaltable.service.IPhysicalTableService; + import com.archive.project.dasz.physicaltablecolumn.domain.PhysicalTableColumn; + import com.archive.project.dasz.physicaltablecolumn.service.IPhysicalTableColumnService; + import com.archive.project.system.dict.utils.DictUtils; + import java.io.File; + import java.io.IOException; + import java.text.DateFormat; + import java.text.DecimalFormat; + import java.text.SimpleDateFormat; + import java.util.ArrayList; + import java.util.Date; + import java.util.HashMap; + import java.util.LinkedHashMap; + import java.util.List; + import java.util.Map; + import org.aspectj.util.FileUtil; + import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.stereotype.Service; + import org.springframework.web.bind.annotation.RequestParam; + import org.springframework.web.multipart.MultipartFile; + + + + + + + + + + + + + + + + + + + @Service + public class ArchiveImportBatchServiceImpl + implements IArchiveImportBatchService + { + @Autowired + private ArchiveImportBatchMapper archiveImportBatchMapper; + @Autowired + private IExecuteSqlService executeSqlService; + @Autowired + private IArchiveTypeService archiveTypeService; + @Autowired + private IPhysicalTableService physicalTableService; + @Autowired + private IPhysicalTableColumnService physicalTableColumnService; + @Autowired + private ICcglService ccglService; + + public ArchiveImportBatch selectArchiveImportBatchById(Long id) { + return this.archiveImportBatchMapper.selectArchiveImportBatchById(id); + } + + + + + + + + + + public List selectArchiveImportBatchList(ArchiveImportBatch archiveImportBatch) { + return this.archiveImportBatchMapper.selectArchiveImportBatchList(archiveImportBatch); + } + + + + + + + + + + public int insertArchiveImportBatch(ArchiveImportBatch archiveImportBatch) { + archiveImportBatch.setCreateTime(DateUtils.getNowDate()); + return this.archiveImportBatchMapper.insertArchiveImportBatch(archiveImportBatch); + } + + + + + + + + + + public int updateArchiveImportBatch(ArchiveImportBatch archiveImportBatch) { + return this.archiveImportBatchMapper.updateArchiveImportBatch(archiveImportBatch); + } + + + + + + + + + + public int deleteArchiveImportBatchByIds(String ids) { + return this.archiveImportBatchMapper.deleteArchiveImportBatchByIds(Convert.toStrArray(ids)); + } + + + + + + + + + + + public boolean deleteArchiveImportBatchAndDataByIds(String type, String ids) { + boolean res = false; + try { + String[] idss = Convert.toStrArray(ids); + for (int i = 0; i < idss.length; i++) { + String id = idss[i]; + if (id != null && !id.equals("")) { + + ArchiveImportBatch archiveImportBatch = this.archiveImportBatchMapper.selectArchiveImportBatchById(Long.valueOf(Long.parseLong(id))); + long archiveTypeId = archiveImportBatch.getBatcharchivetypeid().longValue(); + ArchiveType archiveType = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(archiveTypeId)); + String datype = archiveType.getType(); + String archiveCode = archiveType.getArhciveCode(); + if (datype.equals("folder")) { + + if (type.equals("mldr")) { + + String deleteAjSql = "delete from t_ar_" + archiveCode + "_folder where batchNo='" + archiveImportBatch.getBatchno() + "'"; + String deleteJnSql = "delete from t_ar_" + archiveCode + "_file where batchNo='" + archiveImportBatch.getBatchno() + "'"; + this.executeSqlService.delete(deleteAjSql); + this.executeSqlService.delete(deleteJnSql); + } else if (type.equals("qwgj")) { + + String JnSql = "select filepath from t_ar_" + archiveCode + "_document where batchNo='" + archiveImportBatch.getBatchno() + "'"; + List> datalist = this.executeSqlService.queryList(JnSql); + for (int k = 0; k < datalist.size(); k++) { + String path = (((LinkedHashMap)datalist.get(k)).get("filepath") == null) ? "" : ((LinkedHashMap)datalist.get(k)).get("filepath").toString(); + File fil = new File(path); + if (fil.exists()) { + fil.setWritable(true); + fil.delete(); + } + } + String deleteDocumentSql = "delete from t_ar_" + archiveCode + "_document where batchNo='" + archiveImportBatch.getBatchno() + "'"; + this.executeSqlService.delete(deleteDocumentSql); + } + } else if (datype.equals("file")) { + + if (type.equals("mldr")) { + + String deleteSql = "delete from t_ar_" + archiveCode + "_file where batchNo='" + archiveImportBatch.getBatchno() + "'"; + this.executeSqlService.delete(deleteSql); + } else if (type.equals("qwgj")) { + + String fileSql = "select filepath from t_ar_" + archiveCode + "_document where batchNo='" + archiveImportBatch.getBatchno() + "'"; + List> datalist = this.executeSqlService.queryList(fileSql); + for (int k = 0; k < datalist.size(); k++) { + String path = (((LinkedHashMap)datalist.get(k)).get("filepath") == null) ? "" : ((LinkedHashMap)datalist.get(k)).get("filepath").toString(); + File fil = new File(path); + if (fil.exists()) { + fil.setWritable(true); + fil.delete(); + } + } + String deleteDocumentSql = "delete from t_ar_" + archiveCode + "_document where batchNo='" + archiveImportBatch.getBatchno() + "'"; + this.executeSqlService.delete(deleteDocumentSql); + } + } + } + } + + + this.archiveImportBatchMapper.deleteArchiveImportBatchByIds(Convert.toStrArray(ids)); + res = true; + } catch (Exception ex) { + System.out.println("ERROR出现异常信息:" + ex.getMessage()); + } + return res; + } + + + + + + + + + + + public int deleteArchiveImportBatchById(Long id) { + return this.archiveImportBatchMapper.deleteArchiveImportBatchById(id); + } + + + + + + + + + + + public String[] excelImport(int sheetindex, String filepath, List> columnList, long batcharchivetypeid, String batchNo) { + String ownerId = ""; + String[] sttr = new String[3]; + int successCount = 0; + int failCount = 0; + String messageContent = ""; + long tableId = TableUtil.getTableIdByArchiveTypeId(batcharchivetypeid); + String tableName = TableUtil.getTableName(Long.valueOf(tableId)); + String[] excelColuns = ExcelUtilArchive.readExcelFirstRow(filepath, Integer.valueOf(sheetindex)); + List> listdata = ExcelUtilArchive.readExcel(filepath, Integer.valueOf(sheetindex)); + for (int i = 0; i < listdata.size(); i++) { + Map map = listdata.get(i); + String insertConlums = ""; + String insertValuess = ""; + for (int j = 0; j < columnList.size(); j++) { + for (int k = 0; k < excelColuns.length; k++) { + String excelColumn = (String)((Map)columnList.get(j)).get("excelColumn"); + String archiveColumn = (String)((Map)columnList.get(j)).get("archiveColumn"); + if (!archiveColumn.equals("") && !archiveColumn.equals("请选择") && + excelColumn.equals(excelColuns[k])) { + String value = map.get(excelColuns[k]); + if (!value.equals("") && !value.trim().equals("") && !value.trim().equals("请选择")) { + + + if (sheetindex == 1 && "档号".equals(excelColuns[k]) && + value.indexOf("-") != -1) { + String folderDh = value.substring(0, value.lastIndexOf("-")); + String folderTableName = tableName.toLowerCase().replace("_file", "_folder"); + String queryOwnerIdSql = "SELECT MAX(ID) FROM " + folderTableName + " WHERE DH = '" + folderDh + "'"; + ownerId = this.executeSqlService.getSingle(queryOwnerIdSql); + } + + + + insertConlums = insertConlums + "," + archiveColumn; + insertValuess = insertValuess + ",'" + getCodeValue(tableId, archiveColumn, value) + "'"; + + + break; + } + } + } + } + + + if (sheetindex == 1) { + tableName = tableName.toLowerCase().replace("_folder", "_file"); + } + if (ownerId != null && !ownerId.equals("")) { + insertConlums = insertConlums + ", ownerid"; + insertValuess = insertValuess + ",'" + ownerId + "'"; + } + if (insertConlums.length() > 1) { + insertConlums = insertConlums.substring(1, insertConlums.length()); + insertValuess = insertValuess.substring(1, insertValuess.length()); + } + String insertSql = "insert into " + tableName + "(" + insertConlums + ",is_delete,status,batchno) values(" + insertValuess + ",0,60,'" + batchNo + "')"; + System.out.println(insertSql); + if (this.executeSqlService.insert(insertSql)) { + successCount++; + } else { + if (sheetindex == 1) { + messageContent = messageContent + " 案卷页第" + i + "行导入失败;"; + } else { + messageContent = messageContent + " 文件页第" + i + "行导入失败;"; + } + failCount++; + } + } + if (messageContent.equals("")) { + messageContent = "导入成功" + successCount + "条,无异常情况"; + } + sttr[0] = "导入成功" + successCount + "条"; + sttr[1] = "导入失败" + failCount + "条"; + sttr[2] = messageContent; + return sttr; + } + + + + + + + + + + public List> getAllListToSelect(long archiveTypeId, String tableType) { + List> columnsList = new ArrayList<>(); + List lphycs = new ArrayList<>(); + ArchiveType archivetypes = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(archiveTypeId)); + String archiveCode = archivetypes.getArhciveCode(); + String archiveType = archivetypes.getType(); + String tableName = ""; + tableName = "t_ar_" + archiveCode + "_" + tableType; + if (!tableName.equals("")) { + PhysicalTable pt = new PhysicalTable(); + pt.setTablename(tableName.toLowerCase()); + List pts = this.physicalTableService.selectPhysicalTableList(pt); + if (pts.size() > 0 && pts.get(0) != null) { + PhysicalTableColumn ptc = new PhysicalTableColumn(); + ptc.setTableId(((PhysicalTable)pts.get(0)).getId()); + lphycs = this.physicalTableColumnService.selectPhysicalTableColumnList(ptc); + + + for (int i = 0; i < lphycs.size(); i++) { + Map columsMap = new HashMap<>(); + columsMap.put("value", ((PhysicalTableColumn)lphycs.get(i)).getColumnCode()); + columsMap.put("text", ((PhysicalTableColumn)lphycs.get(i)).getColumnName()); + columnsList.add(columsMap); + } + } + } + return columnsList; + } + + + + + + + + + public Map insertDocByQwgj(String path, long archiveTypeId, String column, String batchNo) { + Map map = new HashMap<>(); + File file = new File(path); + String fileName = file.getName().substring(0, file.getName().lastIndexOf('.')); + String hz = file.getName().substring(file.getName().lastIndexOf('.') + 1); + String fileSize = FormetFileSize(file.length()); + DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + ArchiveType archivetypes = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(archiveTypeId)); + String archiveCode = archivetypes.getArhciveCode(); + String tableName = "t_ar_" + archiveCode + "_file"; + String tableId = TableUtil.getTableId(tableName); + String docTableName = "t_ar_" + archiveCode + "_document"; + String selectIdSql = "select id from " + tableName + " where " + column + "='" + fileName + "' and is_delete='0'"; + System.out.println("全文挂接查找条目idsql:" + selectIdSql); + List> idlist = this.executeSqlService.queryList(selectIdSql); + if (idlist.size() > 0 && idlist.get(0) != null) { + String archiveId = (((LinkedHashMap)idlist.get(0)).get("id") == null) ? "" : ((LinkedHashMap)idlist.get(0)).get("id").toString(); + + String xdlj = this.ccglService.getCreateDocumentPathByFile(Long.parseLong(archiveId), Long.parseLong(tableId)); + String filepath = ArchiveConfig.getInstance().getUploadPath() + "/DocumentFile" + xdlj; + filepath = filepath.replaceAll("\\\\", "/"); + File localFile = new File(filepath); + if (!localFile.exists()) { + localFile.mkdirs(); + } + String mewpath = filepath + "/" + file.getName(); + try { + FileUtil.copyFile(new File(path), new File(mewpath)); + } catch (IOException e) { + e.printStackTrace(); + } + + String insertDocSql = "insert into " + docTableName + "(create_time,create_user,filename,filehz,filesize,filepath,ownerid,tableId,batcharchivetypeid,batchno) values('" + dateformat.format(new Date()) + "','" + ShiroUtils.getSysUser().getUserName() + "','" + fileName + "','" + hz + "','" + fileSize + "','" + mewpath + "','" + archiveId + "','" + tableId + "','" + archiveTypeId + "','" + batchNo + "')"; + this.executeSqlService.insert(insertDocSql); + + String updateSql = "update " + tableName + " set dqzws=dqzws+1 where id=" + archiveId; + this.executeSqlService.update(updateSql); + map.put("res", "1"); + map.put("msg", "文件【" + fileName + "】挂接成功!"); + } else { + map.put("res", "0"); + map.put("msg", "文件【" + fileName + "】挂接失败,原因是没有找到对应条目!"); + } + return map; + } + + int folderId = 0; + int fileId = 0; + int documentId = 0; + int infoId = 0; + int successCount = 0; + int failCount = 0; + + + + + + + + public Map gsbUploadAndImport(MultipartFile[] files, long archiveTypeId, String column) { + String resMessage = ""; + String path = ""; + try { + if (files != null) { + for (int i = 0; i < files.length; i++) { + String fileName = files[i].getOriginalFilename(); + String filepath = ArchiveConfig.getInstance().getUploadPath() + "/gsbdr/temp"; + File localFile = new File(filepath); + if (!localFile.exists()) { + localFile.mkdirs(); + } + path = filepath + "/" + fileName; + File server_file = new File(path); + files[i].transferTo(server_file); + + + String newfileName = server_file.getName().replace(".zip", ""); + newfileName = newfileName.replace(".rar", ""); + + ZipUtil.unZip(server_file, filepath); + + System.out.println(filepath + "/" + newfileName); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + catch (Exception e) { + resMessage = "格式包上传导入出现异常:" + e.getMessage(); + e.printStackTrace(); + } + Map resMap = new HashMap<>(); + resMap.put("message", resMessage); + resMap.put("path", path); + resMap.put("sucess", String.valueOf(this.successCount)); + resMap.put("fail", String.valueOf(this.failCount)); + return resMap; + } + + + + + + + + + + public Map mldrFileUploadAndImport(MultipartFile file, long archiveTypeId) { + Map map = new HashMap<>(); + List> columnsList = new ArrayList<>(); + + if (file.isEmpty()) { + return map; + } + String fileName = file.getOriginalFilename(); + String filepath = ArchiveConfig.getInstance().getUploadPath() + "/mldr/temp"; + File localFile = new File(filepath); + if (!localFile.exists()) { + localFile.mkdirs(); + } + String path = filepath + "/" + fileName; + try { + File server_file = new File(path); + file.transferTo(server_file); + } + catch (Exception exception) {} + + + map.put("filePath", path); + + String[] excelColuns = ExcelUtilArchive.readExcelFirstRow(path, Integer.valueOf(0)); + List lphycs = new ArrayList<>(); + if (excelColuns != null) { + + ArchiveType archivetypes = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(archiveTypeId)); + String archiveCode = archivetypes.getArhciveCode(); + String archiveType = archivetypes.getType(); + String tableName = ""; + if (archiveType.toLowerCase().equals("file")) { + tableName = "t_ar_" + archiveCode + "_file"; + } else if (archiveType.toLowerCase().equals("folder")) { + tableName = "t_ar_" + archiveCode + "_folder"; + } + if (!tableName.equals("")) { + PhysicalTable pt = new PhysicalTable(); + pt.setTablename(tableName.toLowerCase()); + List pts = this.physicalTableService.selectPhysicalTableList(pt); + if (pts.size() > 0 && pts.get(0) != null) { + PhysicalTableColumn ptc = new PhysicalTableColumn(); + ptc.setTableId(((PhysicalTable)pts.get(0)).getId()); + lphycs = this.physicalTableColumnService.selectPhysicalTableColumnList(ptc); + + + for (int j = 0; j < lphycs.size(); j++) { + Map columsMap = new HashMap<>(); + columsMap.put("value", ((PhysicalTableColumn)lphycs.get(j)).getColumnCode()); + columsMap.put("text", ((PhysicalTableColumn)lphycs.get(j)).getColumnName()); + columnsList.add(columsMap); + } + } else { + map.put("status", "0"); + map.put("msg", "获取档案表信息失败!"); + } + } else { + map.put("status", "0"); + map.put("msg", "获取档案表name失败!"); + } + + List> allList = new ArrayList<>(); + Map resMap = null; + for (int i = 0; i < excelColuns.length; i++) { + resMap = new HashMap<>(); + resMap.put("excelColumn", excelColuns[i]); + + String archiveColumn = "请选择"; + for (int j = 0; j < lphycs.size(); j++) { + String showName = ((PhysicalTableColumn)lphycs.get(j)).getColumnName(); + if (showName.equals(excelColuns[i])) { + archiveColumn = ((PhysicalTableColumn)lphycs.get(j)).getColumnCode(); + break; + } + } + resMap.put("archiveColumn", archiveColumn); + allList.add(resMap); + } + map.put("data", allList); + map.put("status", "1"); + map.put("msg", "成功!"); + } else { + map.put("status", "0"); + map.put("msg", "excel获取表头失败!"); + } + + + + + + + map.put("columnsList", columnsList); + return map; + } + + + + + + + + + + + + + public Map folderMldrUploadAndImport(@RequestParam("file") MultipartFile file, long archiveTypeId, String batchNo) { + Map map = new HashMap<>(); + List> allAJList = new ArrayList<>(); + List> allJNList = new ArrayList<>(); + List> AJcolumnsList = new ArrayList<>(); + List> JNcolumnsList = new ArrayList<>(); + + if (file.isEmpty()) { + return map; + } + String fileName = file.getOriginalFilename(); + String filepath = ArchiveConfig.getInstance().getUploadPath() + "/mldr/temp"; + File localFile = new File(filepath); + if (!localFile.exists()) { + localFile.mkdirs(); + } + String path = filepath + "/" + fileName; + try { + File server_file = new File(path); + file.transferTo(server_file); + } + catch (Exception exception) {} + + + map.put("filePath", path); + + int a = ExcelUtilArchive.getSheetCount(path); + if (a < 2) { + map.put("status", "0"); + map.put("msg", "excel格式不对,请保证excel同时有案卷和卷内的sheet页!"); + } else { + String[] AJexcelColuns = ExcelUtilArchive.readExcelFirstRow(path, Integer.valueOf(0)); + String[] JNexcelColuns = ExcelUtilArchive.readExcelFirstRow(path, Integer.valueOf(1)); + List lphycs = new ArrayList<>(); + if (AJexcelColuns != null && JNexcelColuns != null) { + + ArchiveType archivetypes = this.archiveTypeService.selectArchiveTypeById(Long.valueOf(archiveTypeId)); + String archiveCode = archivetypes.getArhciveCode(); + String AJtableName = ""; + String JNtableName = ""; + AJtableName = "t_ar_" + archiveCode + "_folder"; + JNtableName = "t_ar_" + archiveCode + "_file"; + + if (!AJtableName.equals("")) { + PhysicalTableColumn ptc = new PhysicalTableColumn(); + ptc.setTableId(Long.valueOf(TableUtil.getTableId(AJtableName))); + lphycs = this.physicalTableColumnService.selectPhysicalTableColumnList(ptc); + + + for (int i = 0; i < lphycs.size(); i++) { + Map columsMap = new HashMap<>(); + columsMap.put("value", ((PhysicalTableColumn)lphycs.get(i)).getColumnCode()); + columsMap.put("text", ((PhysicalTableColumn)lphycs.get(i)).getColumnName()); + AJcolumnsList.add(columsMap); + } + + + Map resMap = null; + for (int j = 0; j < AJexcelColuns.length; j++) { + resMap = new HashMap<>(); + resMap.put("excelColumn", AJexcelColuns[j]); + + String archiveColumn = "请选择"; + for (int k = 0; k < lphycs.size(); k++) { + String showName = ((PhysicalTableColumn)lphycs.get(k)).getColumnName(); + if (showName.equals(AJexcelColuns[j])) { + archiveColumn = ((PhysicalTableColumn)lphycs.get(k)).getColumnCode(); + break; + } + } + resMap.put("archiveColumn", archiveColumn); + allAJList.add(resMap); + } + map.put("dataAJ", allAJList); + } + if (!JNtableName.equals("")) { + PhysicalTableColumn ptc = new PhysicalTableColumn(); + ptc.setTableId(Long.valueOf(TableUtil.getTableId(JNtableName))); + lphycs = this.physicalTableColumnService.selectPhysicalTableColumnList(ptc); + + + for (int i = 0; i < lphycs.size(); i++) { + Map columsMap = new HashMap<>(); + columsMap.put("value", ((PhysicalTableColumn)lphycs.get(i)).getColumnCode()); + columsMap.put("text", ((PhysicalTableColumn)lphycs.get(i)).getColumnName()); + JNcolumnsList.add(columsMap); + } + + + Map resMap = null; + for (int j = 0; j < JNexcelColuns.length; j++) { + resMap = new HashMap<>(); + resMap.put("excelColumn", JNexcelColuns[j]); + + String archiveColumn = "请选择"; + for (int k = 0; k < lphycs.size(); k++) { + String showName = ((PhysicalTableColumn)lphycs.get(k)).getColumnName(); + if (showName.equals(JNexcelColuns[j])) { + archiveColumn = ((PhysicalTableColumn)lphycs.get(k)).getColumnCode(); + break; + } + } + resMap.put("archiveColumn", archiveColumn); + allJNList.add(resMap); + } + map.put("dataJN", allJNList); + } + + + map.put("status", "1"); + map.put("msg", "成功!"); + } else { + map.put("status", "0"); + map.put("msg", "excel获取表头失败!"); + } + } + + + + + + + map.put("columnsAJList", AJcolumnsList); + map.put("columnsJNList", JNcolumnsList); + return map; + } + + + + + + + + public int getTableNewId(long tableId) { + int res = 0; + String tableName = TableUtil.getTableName(Long.valueOf(tableId)); + String sql = "select max(id)+1 ID from " + tableName; + List> list = this.executeSqlService.queryList(sql); + if (list != null && list.size() > 0 && list.get(0) != null) { + res = Integer.parseInt((((LinkedHashMap)list.get(0)).get("ID") == null) ? "1" : ((LinkedHashMap)list.get(0)).get("ID").toString()); + } else { + res = 1; + } + return res; + } + + + + + + + + + public String getCodeValue(long tableId, String column, String value) { + String res = value; + PhysicalTableColumn ptc = new PhysicalTableColumn(); + ptc.setTableId(Long.valueOf(tableId)); + ptc.setColumnCode(column); + List ptcList = this.physicalTableColumnService.selectPhysicalTableColumnList(ptc); + if (ptcList != null && ptcList.size() > 0 && ptcList.get(0) != null) { + ptc = ptcList.get(0); + String codeType = ptc.getColumnCodetype(); + if (!codeType.equals(codeType)) { + String value1 = DictUtils.getDictValue(codeType, value); + + if (value1 != null && !value1.equals("")) { + res = value1; + } + } + } + + return res; + } + + + + + + + + public String FormetFileSize(long fileS) { + DecimalFormat df = new DecimalFormat("#.00"); + String fileSizeString = ""; + if (fileS < 1024L) { + fileSizeString = df.format(fileS) + "B"; + } else if (fileS < 1048576L) { + fileSizeString = df.format(fileS / 1024.0D) + "K"; + } else if (fileS < 1073741824L) { + fileSizeString = df.format(fileS / 1048576.0D) + "M"; + } else { + fileSizeString = df.format(fileS / 1.073741824E9D) + "G"; + } + return fileSizeString; + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dajs\archiveimportbatch\service\impl\ArchiveImportBatchServiceImpl.class diff --git a/src/main/java/com/archive/project/dasz/archivetype/controller/ArchiveListController.java b/src/main/java/com/archive/project/dasz/archivetype/controller/ArchiveListController.java index abb021d..624f654 100644 --- a/src/main/java/com/archive/project/dasz/archivetype/controller/ArchiveListController.java +++ b/src/main/java/com/archive/project/dasz/archivetype/controller/ArchiveListController.java @@ -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 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 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 formData, @PathVariable("status") String status) throws Exception { -/* 165 */ Map map = this.archiveListService.selectArchiveList(id, code, ownerid, Integer.valueOf(1), Integer.valueOf(99999999), "", "", formData, isRecycle, status); -/* 166 */ List> list = (List>)map.get("list"); -/* */ -/* */ -/* 169 */ List 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 listAll = new ArrayList<>(); -/* 180 */ for (int j = 0; j < list.size(); j++) { -/* 181 */ List 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) { -/* 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 value : list) { -/* */ -/* 295 */ row = sheet.createRow(index); -/* 296 */ index++; -/* 297 */ 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 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 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 formData, @PathVariable("status") String status) throws Exception { + Map map = this.archiveListService.selectArchiveList(id, code, ownerid, Integer.valueOf(1), Integer.valueOf(99999999), "", "", formData, isRecycle, status); + List> list = (List>)map.get("list"); + + + List 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 listAll = new ArrayList<>(); + for (int j = 0; j < list.size(); j++) { + List 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) { + 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 value : list) { + + row = sheet.createRow(index); + index++; + 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 diff --git a/src/main/java/com/archive/project/dasz/archivetype/controller/ArchiveTypeController.java b/src/main/java/com/archive/project/dasz/archivetype/controller/ArchiveTypeController.java index 122559c..6f68bba 100644 --- a/src/main/java/com/archive/project/dasz/archivetype/controller/ArchiveTypeController.java +++ b/src/main/java/com/archive/project/dasz/archivetype/controller/ArchiveTypeController.java @@ -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 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 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 list = this.archiveTypeService.selectArchiveTypeList(archiveType); -/* 87 */ ExcelUtil 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 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 archiveCollationTreeData() { -/* 178 */ List ztrees = this.archiveTypeService.archiveCollationTreeData(); -/* 179 */ return ztrees; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @GetMapping({"/archiveTypeManageTreeData"}) -/* */ @ResponseBody -/* */ public List ArchiveTypeManageTreeData() { -/* 189 */ List 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 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 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 list = this.archiveTypeService.selectArchiveTypeList(archiveType); + ExcelUtil 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 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 archiveCollationTreeData() { + List ztrees = this.archiveTypeService.archiveCollationTreeData(); + return ztrees; + } + + + + + + @GetMapping({"/archiveTypeManageTreeData"}) + @ResponseBody + public List ArchiveTypeManageTreeData() { + List 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 diff --git a/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveTableColumn.java b/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveTableColumn.java index 66dff20..6011acc 100644 --- a/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveTableColumn.java +++ b/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveTableColumn.java @@ -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 diff --git a/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveType.java b/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveType.java index d16e9f0..a3400f5 100644 --- a/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveType.java +++ b/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveType.java @@ -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 diff --git a/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveTypeManageTree.java b/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveTypeManageTree.java index d47f5e9..b3a790d 100644 --- a/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveTypeManageTree.java +++ b/src/main/java/com/archive/project/dasz/archivetype/domain/ArchiveTypeManageTree.java @@ -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 diff --git a/src/main/java/com/archive/project/dasz/archivetype/service/impl/ArchiveListServiceImpl.java b/src/main/java/com/archive/project/dasz/archivetype/service/impl/ArchiveListServiceImpl.java index c24fb1d..88520d4 100644 --- a/src/main/java/com/archive/project/dasz/archivetype/service/impl/ArchiveListServiceImpl.java +++ b/src/main/java/com/archive/project/dasz/archivetype/service/impl/ArchiveListServiceImpl.java @@ -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 getColumns(String id, String code) { -/* 58 */ List resultList = new ArrayList<>(); -/* */ -/* */ -/* 61 */ PhysicalTable physicalTable = new PhysicalTable(); -/* 62 */ physicalTable.setArchivetypeid(id); -/* 63 */ physicalTable.setTableCode(code); -/* 64 */ List 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 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 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 getOrderColumns(String id, String code) { -/* 134 */ Map 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 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 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 selectArchiveList(String id, String code, String ownerid, Integer pageNum, Integer pageSize, String orderBy, String orderByColumn, Map formData, String isRecycle, String status) { -/* 177 */ Map resultMap = new HashMap<>(); -/* 178 */ List> 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 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 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 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 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 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 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("
"); -/* 346 */ sb.append("
"); -/* 347 */ sb.append("
"); -/* 348 */ sb.append("
    "); -/* 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("
  • "); -/* 359 */ sb.append(""); -/* 360 */ sb.append("-"); -/* 361 */ sb.append(""); -/* 362 */ sb.append("
  • "); -/* */ } else { -/* 364 */ sb.append("
  • "); -/* 365 */ sb.append(""); -/* 366 */ sb.append("
  • "); -/* */ } -/* */ -/* */ } else { -/* */ -/* 371 */ DictData dictData = new DictData(); -/* 372 */ dictData.setDictType(columnCodeType); -/* 373 */ List dictDataList = this.dictDataMapper.selectDictDataList(dictData); -/* 374 */ if (jsfs.longValue() == 6L) { -/* 375 */ sb.append("
  • "); -/* 376 */ sb.append(""); -/* 383 */ sb.append("-"); -/* 384 */ sb.append(""); -/* 391 */ sb.append("
  • "); -/* */ } else { -/* 393 */ sb.append("
  • "); -/* 394 */ sb.append(""); -/* 401 */ sb.append("
  • "); -/* */ } -/* */ } -/* */ } -/* */ -/* 406 */ sb.append("
  • "); -/* 407 */ sb.append(" 搜索"); -/* 408 */ sb.append(" 重置"); -/* 409 */ sb.append("
  • "); -/* */ -/* 411 */ sb.append("
"); -/* 412 */ sb.append("
"); -/* 413 */ sb.append("
"); -/* 414 */ sb.append("
"); -/* 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 getColumns(String id, String code) { + List resultList = new ArrayList<>(); + + + PhysicalTable physicalTable = new PhysicalTable(); + physicalTable.setArchivetypeid(id); + physicalTable.setTableCode(code); + List 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 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 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 getOrderColumns(String id, String code) { + Map map = new HashMap<>(); + String orderColumns = ""; + String orderType = "asc"; + + PhysicalTable physicalTable = new PhysicalTable(); + physicalTable.setArchivetypeid(id); + physicalTable.setTableCode(code); + List 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 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 selectArchiveList(String id, String code, String ownerid, Integer pageNum, Integer pageSize, String orderBy, String orderByColumn, Map formData, String isRecycle, String status) { + Map resultMap = new HashMap<>(); + List> 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 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 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 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 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 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 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("
"); + sb.append("
"); + sb.append("
"); + sb.append("
    "); + 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("
  • "); + sb.append(""); + sb.append("-"); + sb.append(""); + sb.append("
  • "); + } else { + sb.append("
  • "); + sb.append(""); + sb.append("
  • "); + } + + } else { + + DictData dictData = new DictData(); + dictData.setDictType(columnCodeType); + List dictDataList = this.dictDataMapper.selectDictDataList(dictData); + if (jsfs.longValue() == 6L) { + sb.append("
  • "); + sb.append(""); + sb.append("-"); + sb.append(""); + sb.append("
  • "); + } else { + sb.append("
  • "); + sb.append(""); + sb.append("
  • "); + } + } + } + + sb.append("
  • "); + sb.append(" 搜索"); + sb.append(" 重置"); + sb.append("
  • "); + + sb.append("
"); + sb.append("
"); + sb.append("
"); + sb.append("
"); + 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 diff --git a/src/main/java/com/archive/project/dasz/archivetype/service/impl/ArchiveTypeServiceImpl.java b/src/main/java/com/archive/project/dasz/archivetype/service/impl/ArchiveTypeServiceImpl.java index af63014..56828d7 100644 --- a/src/main/java/com/archive/project/dasz/archivetype/service/impl/ArchiveTypeServiceImpl.java +++ b/src/main/java/com/archive/project/dasz/archivetype/service/impl/ArchiveTypeServiceImpl.java @@ -1,511 +1,511 @@ -/* */ package com.archive.project.dasz.archivetype.service.impl + package com.archive.project.dasz.archivetype.service.impl ; -/* */ -/* */ import com.archive.common.archiveUtil.CreateTableAndInsertPhysicalTable; -/* */ import com.archive.common.utils.text.Convert; -/* */ import com.archive.framework.config.ArchiveConfig; -/* */ import com.archive.project.common.service.IExecuteSqlService; -/* */ 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.mapper.ArchiveTypeMapper; -/* */ import com.archive.project.dasz.archivetype.service.IArchiveTypeService; -/* */ 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.service.IDictTypeService; -/* */ import java.util.ArrayList; -/* */ import java.util.List; -/* */ import org.springframework.beans.factory.annotation.Autowired; -/* */ import org.springframework.stereotype.Service; -/* */ import org.springframework.transaction.annotation.Transactional; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Service -/* */ public class ArchiveTypeServiceImpl -/* */ implements IArchiveTypeService -/* */ { -/* */ @Autowired -/* */ private ArchiveTypeMapper archiveTypeMapper; -/* */ @Autowired -/* */ private PhysicalTableMapper physicalTableMapper; -/* */ @Autowired -/* */ private IExecuteSqlService executeSqlService; -/* */ @Autowired -/* */ private PhysicalTableColumnMapper physicalTableColumnMapper; -/* */ @Autowired -/* */ private IDictTypeService dictTypeService; -/* */ @Autowired -/* */ private ArchiveConfig archiveConfig; -/* */ -/* */ public ArchiveType selectArchiveTypeById(Long id) { -/* 63 */ return this.archiveTypeMapper.selectArchiveTypeById(id); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public List selectArchiveTypeList(ArchiveType archiveType) { -/* 76 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { -/* 77 */ return this.archiveTypeMapper.selectArchiveTypeList(archiveType); -/* */ } -/* 79 */ if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { -/* 80 */ return this.archiveTypeMapper.selectArchiveTypeListSqlite(archiveType); -/* */ } -/* 82 */ return this.archiveTypeMapper.selectArchiveTypeList(archiveType); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Transactional -/* */ public void insertArchiveType(ArchiveType archiveType) throws Exception { -/* 96 */ this.archiveTypeMapper.insertArchiveType(archiveType); -/* */ -/* 98 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { -/* 99 */ if (archiveType.getType().equals("folder")) { -/* 100 */ CreateTableAndInsertPhysicalTable.createFolderTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* */ } -/* 102 */ CreateTableAndInsertPhysicalTable.createFileTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* 103 */ CreateTableAndInsertPhysicalTable.createDocumentTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* 104 */ CreateTableAndInsertPhysicalTable.createInfoTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* */ } -/* 106 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { -/* 107 */ if (archiveType.getType().equals("folder")) { -/* 108 */ CreateTableAndInsertPhysicalTable.createFolderTableSqlite(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* */ } -/* 110 */ CreateTableAndInsertPhysicalTable.createFileTableSqlite(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* 111 */ CreateTableAndInsertPhysicalTable.createDocumentTableSqlite(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* 112 */ CreateTableAndInsertPhysicalTable.createInfoTableSqlite(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* */ } else { -/* 114 */ if (archiveType.getType().equals("folder")) { -/* 115 */ CreateTableAndInsertPhysicalTable.createFolderTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* */ } -/* 117 */ CreateTableAndInsertPhysicalTable.createFileTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* 118 */ CreateTableAndInsertPhysicalTable.createDocumentTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* 119 */ CreateTableAndInsertPhysicalTable.createInfoTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); -/* */ } -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public int updateArchiveType(ArchiveType archiveType) { -/* 133 */ return this.archiveTypeMapper.updateArchiveType(archiveType); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public int deleteArchiveTypeByIds(String ids) { -/* 145 */ return this.archiveTypeMapper.deleteArchiveTypeByIds(Convert.toStrArray(ids)); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public int deleteArchiveTypeById(Long id) { -/* 157 */ return this.archiveTypeMapper.deleteArchiveTypeById(id); -/* */ } -/* */ -/* */ -/* */ public List archiveCollationTreeData() { -/* 162 */ List list = this.archiveTypeMapper.selectArchiveTypeList(new ArchiveType()); -/* 163 */ List treeDatas = new ArrayList<>(); -/* 164 */ ArchiveCollationTree rootNode = new ArchiveCollationTree(); -/* 165 */ rootNode.setId(Long.valueOf(0L)); -/* 166 */ rootNode.setpId(Long.valueOf(0L)); -/* 167 */ rootNode.setName("档案类型"); -/* 168 */ rootNode.setTitle("档案类型"); -/* 169 */ treeDatas.add(rootNode); -/* 170 */ for (ArchiveType ArchiveType : list) { -/* 171 */ ArchiveCollationTree node = new ArchiveCollationTree(); -/* 172 */ node.setId(ArchiveType.getId()); -/* 173 */ node.setpId(Long.valueOf(0L)); -/* 174 */ node.setName(ArchiveType.getArchiveName()); -/* 175 */ node.setTitle(ArchiveType.getArchiveName()); -/* 176 */ node.setType(ArchiveType.getType()); -/* 177 */ node.setArchiveCode(ArchiveType.getArhciveCode()); -/* 178 */ treeDatas.add(node); -/* */ } -/* 180 */ return treeDatas; -/* */ } -/* */ -/* */ -/* */ -/* */ @Transactional -/* */ public void deleteArchiveType(String ids) throws Exception { -/* 187 */ PhysicalTable physicalTable = new PhysicalTable(); -/* 188 */ physicalTable.setArchivetypeid(ids); -/* 189 */ List physicalTableList = this.physicalTableMapper.selectPhysicalTableList(physicalTable); -/* 190 */ for (PhysicalTable physicaltable : physicalTableList) { -/* 191 */ String tableName = physicaltable.getTablename(); -/* 192 */ String str1 = "drop table " + tableName; -/* 193 */ this.executeSqlService.jdbcTemplateExecute(str1); -/* */ -/* 195 */ Long tableId = physicaltable.getId(); -/* 196 */ String delColumnSql = "delete from t_xtpz_physical_table_column where table_id = " + tableId; -/* 197 */ this.executeSqlService.delete(delColumnSql); -/* */ } -/* */ -/* */ -/* 201 */ String sql = "delete from t_xtpz_physical_table where archivetypeid = '" + ids + "'"; -/* 202 */ this.executeSqlService.delete(sql); -/* */ -/* */ -/* 205 */ Long id = Long.valueOf(Long.parseLong(ids)); -/* 206 */ this.archiveTypeMapper.deleteArchiveTypeById(id); -/* */ } -/* */ -/* */ -/* */ public boolean checkArchiveTypeIsHaveData(String ids) { -/* 211 */ PhysicalTable physicalTable = new PhysicalTable(); -/* 212 */ physicalTable.setArchivetypeid(ids); -/* 213 */ List physicalTableList = this.physicalTableMapper.selectPhysicalTableList(physicalTable); -/* 214 */ boolean flag = false; -/* 215 */ for (PhysicalTable physicaltable : physicalTableList) { -/* 216 */ String tableName = physicaltable.getTablename(); -/* 217 */ String sql = "select count(*) from " + tableName; -/* 218 */ String countStr = this.executeSqlService.getSingle(sql); -/* 219 */ int count = Integer.parseInt(countStr); -/* 220 */ if (count > 0) { -/* 221 */ flag = true; -/* */ break; -/* */ } -/* */ } -/* 225 */ return flag; -/* */ } -/* */ -/* */ -/* */ public List ArchiveTypeManageTreeData() { -/* 230 */ List list = new ArrayList<>(); -/* */ -/* 232 */ ArchiveTypeManageTree rootNode = new ArchiveTypeManageTree(); -/* 233 */ rootNode.setId("0root_node"); -/* 234 */ rootNode.setpId("0"); -/* 235 */ rootNode.setName("档案类型"); -/* 236 */ rootNode.setTitle("档案类型"); -/* 237 */ rootNode.setNodeType("root_node"); -/* 238 */ list.add(rootNode); -/* */ -/* */ -/* 241 */ List ArchiveType = this.archiveTypeMapper.selectArchiveTypeList(new ArchiveType()); -/* */ -/* 243 */ for (ArchiveType archivetype : ArchiveType) { -/* 244 */ ArchiveTypeManageTree typeNode = new ArchiveTypeManageTree(); -/* 245 */ typeNode.setId(archivetype.getId() + "type_node"); -/* 246 */ typeNode.setpId("0root_node"); -/* 247 */ typeNode.setName(archivetype.getArchiveName()); -/* 248 */ typeNode.setTitle(archivetype.getArchiveName()); -/* 249 */ typeNode.setNodeType("type_node"); -/* 250 */ typeNode.setArchiveTypeId(archivetype.getId() + ""); -/* 251 */ list.add(typeNode); -/* */ } -/* */ -/* */ -/* 255 */ List physicalTableList = this.physicalTableMapper.selectPhysicalTableList(new PhysicalTable()); -/* */ -/* 257 */ for (PhysicalTable physicalTable : physicalTableList) { -/* 258 */ ArchiveTypeManageTree tableNode = new ArchiveTypeManageTree(); -/* 259 */ String showName = ""; -/* 260 */ switch (physicalTable.getTableCode()) { -/* */ case "folder": -/* 262 */ showName = "案卷表"; -/* */ break; -/* */ case "file": -/* 265 */ showName = "文件表"; -/* */ break; -/* */ case "document": -/* 268 */ showName = "电子全文表"; -/* */ break; -/* */ case "info": -/* 271 */ showName = "过程信息表"; -/* */ break; -/* */ } -/* */ -/* */ -/* 276 */ tableNode.setId(physicalTable.getId() + "table_node"); -/* 277 */ tableNode.setpId(physicalTable.getArchivetypeid() + "type_node"); -/* 278 */ tableNode.setName(showName); -/* 279 */ tableNode.setTitle(showName); -/* 280 */ tableNode.setNodeType("table_node"); -/* 281 */ list.add(tableNode); -/* */ } -/* 283 */ return list; -/* */ } -/* */ -/* */ -/* */ public String appendBaseForm(Long tableId) { -/* 288 */ StringBuilder html = new StringBuilder(); -/* 289 */ PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn(); -/* 290 */ physicalTableColumn.setTableId(tableId); -/* 291 */ physicalTableColumn.setJmx(Long.valueOf(1L)); -/* 292 */ List tableColumnsList = new ArrayList<>(); -/* 293 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { -/* 294 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn); -/* */ } -/* 296 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { -/* 297 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn); -/* */ } -/* 299 */ for (int i = 0; i < tableColumnsList.size(); i++) { -/* 300 */ PhysicalTableColumn tableColumn = tableColumnsList.get(i); -/* 301 */ String showType = tableColumn.getShowType(); -/* 302 */ Long isBsx = tableColumn.getBsx(); -/* 303 */ String columnName = tableColumn.getColumnName(); -/* 304 */ String columnCode = tableColumn.getColumnCode(); -/* 305 */ String columnCodetype = tableColumn.getColumnCodetype(); -/* 306 */ String columnType = tableColumn.getColumnType(); -/* */ -/* 308 */ if ("textBox".equals(showType)) { -/* 309 */ if (isBsx.longValue() == 1L) { -/* 310 */ if ("C".equals(columnType)) { -/* 311 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* 318 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 328 */ else if ("C".equals(columnType)) { -/* 329 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 337 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 347 */ else if ("dateBox".equals(showType)) { -/* 348 */ if (isBsx.longValue() == 1L) { -/* 349 */ html.append("
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* */ -/* 359 */ html.append("
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 372 */ else if ("dateTimeBox".equals(showType)) { -/* 373 */ if (isBsx.longValue() == 1L) { -/* 374 */ html.append("
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* */ -/* 384 */ html.append("
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 397 */ else if ("comboBox".equals(showType)) { -/* 398 */ List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); -/* 399 */ if (isBsx.longValue() == 1L) { -/* 400 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\t\t\t\t"); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* 413 */ for (DictData dictData : dictDatas) { -/* 414 */ html.append("\r\n"); -/* */ } -/* */ -/* 417 */ html.append("\t\t\t\t
\r\n\t
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 423 */ else if ("multipleComboBox".equals(showType)) { -/* 424 */ List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); -/* 425 */ if (isBsx.longValue() == 1L) { -/* 426 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t"); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* 437 */ for (DictData dictData : dictDatas) { -/* 438 */ html.append("\r\n"); -/* */ } -/* */ -/* 441 */ html.append("\t\t\t\t
\r\n\t
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 447 */ else if ("textArea".equals(showType)) { -/* 448 */ if (isBsx.longValue() == 1L) { -/* 449 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* 456 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 467 */ else if (isBsx.longValue() == 1L) { -/* 468 */ if ("C".equals(columnType)) { -/* 469 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 477 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ } -/* 485 */ else if ("C".equals(columnType)) { -/* 486 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 494 */ html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); -/* */ } -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* 504 */ return html.toString(); -/* */ } -/* */ } + + import com.archive.common.archiveUtil.CreateTableAndInsertPhysicalTable; + import com.archive.common.utils.text.Convert; + import com.archive.framework.config.ArchiveConfig; + import com.archive.project.common.service.IExecuteSqlService; + 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.mapper.ArchiveTypeMapper; + import com.archive.project.dasz.archivetype.service.IArchiveTypeService; + 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.service.IDictTypeService; + import java.util.ArrayList; + import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.stereotype.Service; + import org.springframework.transaction.annotation.Transactional; + + + + + + + + + + + + + + + + + + + + + + + @Service + public class ArchiveTypeServiceImpl + implements IArchiveTypeService + { + @Autowired + private ArchiveTypeMapper archiveTypeMapper; + @Autowired + private PhysicalTableMapper physicalTableMapper; + @Autowired + private IExecuteSqlService executeSqlService; + @Autowired + private PhysicalTableColumnMapper physicalTableColumnMapper; + @Autowired + private IDictTypeService dictTypeService; + @Autowired + private ArchiveConfig archiveConfig; + + public ArchiveType selectArchiveTypeById(Long id) { + return this.archiveTypeMapper.selectArchiveTypeById(id); + } + + + + + + + + + + + public List selectArchiveTypeList(ArchiveType archiveType) { + if ("mysql".equals(this.archiveConfig.getDatabaseType())) { + return this.archiveTypeMapper.selectArchiveTypeList(archiveType); + } + if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { + return this.archiveTypeMapper.selectArchiveTypeListSqlite(archiveType); + } + return this.archiveTypeMapper.selectArchiveTypeList(archiveType); + } + + + + + + + + + + + @Transactional + public void insertArchiveType(ArchiveType archiveType) throws Exception { + this.archiveTypeMapper.insertArchiveType(archiveType); + + if ("mysql".equals(this.archiveConfig.getDatabaseType())) { + if (archiveType.getType().equals("folder")) { + CreateTableAndInsertPhysicalTable.createFolderTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + } + CreateTableAndInsertPhysicalTable.createFileTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + CreateTableAndInsertPhysicalTable.createDocumentTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + CreateTableAndInsertPhysicalTable.createInfoTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + } + else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { + if (archiveType.getType().equals("folder")) { + CreateTableAndInsertPhysicalTable.createFolderTableSqlite(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + } + CreateTableAndInsertPhysicalTable.createFileTableSqlite(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + CreateTableAndInsertPhysicalTable.createDocumentTableSqlite(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + CreateTableAndInsertPhysicalTable.createInfoTableSqlite(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + } else { + if (archiveType.getType().equals("folder")) { + CreateTableAndInsertPhysicalTable.createFolderTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + } + CreateTableAndInsertPhysicalTable.createFileTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + CreateTableAndInsertPhysicalTable.createDocumentTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + CreateTableAndInsertPhysicalTable.createInfoTable(archiveType.getArhciveCode(), archiveType.getArchiveName(), archiveType.getId().toString()); + } + } + + + + + + + + + + + public int updateArchiveType(ArchiveType archiveType) { + return this.archiveTypeMapper.updateArchiveType(archiveType); + } + + + + + + + + + + public int deleteArchiveTypeByIds(String ids) { + return this.archiveTypeMapper.deleteArchiveTypeByIds(Convert.toStrArray(ids)); + } + + + + + + + + + + public int deleteArchiveTypeById(Long id) { + return this.archiveTypeMapper.deleteArchiveTypeById(id); + } + + + public List archiveCollationTreeData() { + List list = this.archiveTypeMapper.selectArchiveTypeList(new ArchiveType()); + List treeDatas = new ArrayList<>(); + ArchiveCollationTree rootNode = new ArchiveCollationTree(); + rootNode.setId(Long.valueOf(0L)); + rootNode.setpId(Long.valueOf(0L)); + rootNode.setName("档案类型"); + rootNode.setTitle("档案类型"); + treeDatas.add(rootNode); + for (ArchiveType ArchiveType : list) { + ArchiveCollationTree node = new ArchiveCollationTree(); + node.setId(ArchiveType.getId()); + node.setpId(Long.valueOf(0L)); + node.setName(ArchiveType.getArchiveName()); + node.setTitle(ArchiveType.getArchiveName()); + node.setType(ArchiveType.getType()); + node.setArchiveCode(ArchiveType.getArhciveCode()); + treeDatas.add(node); + } + return treeDatas; + } + + + + @Transactional + public void deleteArchiveType(String ids) throws Exception { + PhysicalTable physicalTable = new PhysicalTable(); + physicalTable.setArchivetypeid(ids); + List physicalTableList = this.physicalTableMapper.selectPhysicalTableList(physicalTable); + for (PhysicalTable physicaltable : physicalTableList) { + String tableName = physicaltable.getTablename(); + String str1 = "drop table " + tableName; + this.executeSqlService.jdbcTemplateExecute(str1); + + Long tableId = physicaltable.getId(); + String delColumnSql = "delete from t_xtpz_physical_table_column where table_id = " + tableId; + this.executeSqlService.delete(delColumnSql); + } + + + String sql = "delete from t_xtpz_physical_table where archivetypeid = '" + ids + "'"; + this.executeSqlService.delete(sql); + + + Long id = Long.valueOf(Long.parseLong(ids)); + this.archiveTypeMapper.deleteArchiveTypeById(id); + } + + + public boolean checkArchiveTypeIsHaveData(String ids) { + PhysicalTable physicalTable = new PhysicalTable(); + physicalTable.setArchivetypeid(ids); + List physicalTableList = this.physicalTableMapper.selectPhysicalTableList(physicalTable); + boolean flag = false; + for (PhysicalTable physicaltable : physicalTableList) { + String tableName = physicaltable.getTablename(); + String sql = "select count(*) from " + tableName; + String countStr = this.executeSqlService.getSingle(sql); + int count = Integer.parseInt(countStr); + if (count > 0) { + flag = true; + break; + } + } + return flag; + } + + + public List ArchiveTypeManageTreeData() { + List list = new ArrayList<>(); + + ArchiveTypeManageTree rootNode = new ArchiveTypeManageTree(); + rootNode.setId("0root_node"); + rootNode.setpId("0"); + rootNode.setName("档案类型"); + rootNode.setTitle("档案类型"); + rootNode.setNodeType("root_node"); + list.add(rootNode); + + + List ArchiveType = this.archiveTypeMapper.selectArchiveTypeList(new ArchiveType()); + + for (ArchiveType archivetype : ArchiveType) { + ArchiveTypeManageTree typeNode = new ArchiveTypeManageTree(); + typeNode.setId(archivetype.getId() + "type_node"); + typeNode.setpId("0root_node"); + typeNode.setName(archivetype.getArchiveName()); + typeNode.setTitle(archivetype.getArchiveName()); + typeNode.setNodeType("type_node"); + typeNode.setArchiveTypeId(archivetype.getId() + ""); + list.add(typeNode); + } + + + List physicalTableList = this.physicalTableMapper.selectPhysicalTableList(new PhysicalTable()); + + for (PhysicalTable physicalTable : physicalTableList) { + ArchiveTypeManageTree tableNode = new ArchiveTypeManageTree(); + String showName = ""; + switch (physicalTable.getTableCode()) { + case "folder": + showName = "案卷表"; + break; + case "file": + showName = "文件表"; + break; + case "document": + showName = "电子全文表"; + break; + case "info": + showName = "过程信息表"; + break; + } + + + tableNode.setId(physicalTable.getId() + "table_node"); + tableNode.setpId(physicalTable.getArchivetypeid() + "type_node"); + tableNode.setName(showName); + tableNode.setTitle(showName); + tableNode.setNodeType("table_node"); + list.add(tableNode); + } + return list; + } + + + public String appendBaseForm(Long tableId) { + StringBuilder html = new StringBuilder(); + PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn(); + physicalTableColumn.setTableId(tableId); + physicalTableColumn.setJmx(Long.valueOf(1L)); + List 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); + } + for (int i = 0; i < tableColumnsList.size(); i++) { + PhysicalTableColumn tableColumn = tableColumnsList.get(i); + String showType = tableColumn.getShowType(); + Long isBsx = tableColumn.getBsx(); + String columnName = tableColumn.getColumnName(); + String columnCode = tableColumn.getColumnCode(); + String columnCodetype = tableColumn.getColumnCodetype(); + String columnType = tableColumn.getColumnType(); + + if ("textBox".equals(showType)) { + if (isBsx.longValue() == 1L) { + if ("C".equals(columnType)) { + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); + + + } + else { + + + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); + + + + } + + + + + } + else if ("C".equals(columnType)) { + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); + + + } + else { + + + + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); + + + + } + + + + + } + else if ("dateBox".equals(showType)) { + if (isBsx.longValue() == 1L) { + html.append("
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
"); + + + + } + else { + + + + + html.append("
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
"); + + + + + + } + + + + + + } + else if ("dateTimeBox".equals(showType)) { + if (isBsx.longValue() == 1L) { + html.append("
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
"); + + + + } + else { + + + + + html.append("
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
"); + + + + + + } + + + + + + } + else if ("comboBox".equals(showType)) { + List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); + if (isBsx.longValue() == 1L) { + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\t\t\t\t"); + } + + + + + + for (DictData dictData : dictDatas) { + html.append("\r\n"); + } + + html.append("\t\t\t\t
\r\n\t
"); + + + + + } + else if ("multipleComboBox".equals(showType)) { + List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); + if (isBsx.longValue() == 1L) { + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t"); + } + + + + + for (DictData dictData : dictDatas) { + html.append("\r\n"); + } + + html.append("\t\t\t\t
\r\n\t
"); + + + + + } + else if ("textArea".equals(showType)) { + if (isBsx.longValue() == 1L) { + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); + + + } + else { + + + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); + + + + + } + + + + + } + else if (isBsx.longValue() == 1L) { + if ("C".equals(columnType)) { + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); + + + } + else { + + + + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); + + + } + + + + } + else if ("C".equals(columnType)) { + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); + + + } + else { + + + + html.append("
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
"); + } + } + + + + + + + + return html.toString(); + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dasz\archivetype\service\impl\ArchiveTypeServiceImpl.class