init new
This commit is contained in:
@@ -0,0 +1,205 @@
|
||||
package com.point.strategy.oaDocking.service;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.point.strategy.docSimpleArrange.bean.DocOriginalEntity;
|
||||
import com.point.strategy.oaDocking.bean.DocOriginalOaEntity;
|
||||
import com.point.strategy.oaDocking.bean.DocSimpleArrangeOa;
|
||||
import com.point.strategy.oaDocking.mapper.DocSimpleOaMapper;
|
||||
import jxl.Cell;
|
||||
import jxl.Sheet;
|
||||
import jxl.Workbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
//文书简化
|
||||
@Service
|
||||
@Transactional
|
||||
public class DocSimpleOaService {
|
||||
// @Resource
|
||||
@Autowired
|
||||
public DocSimpleOaMapper docSimpleMapper;
|
||||
|
||||
public List getDocSimpleWithPage(DocSimpleArrangeOa docSimpleArrange) {
|
||||
PageHelper.startPage(docSimpleArrange.getPage(), docSimpleArrange.getLimit());
|
||||
List docSimpleArranges= docSimpleMapper.getDocSimpleWithPage(docSimpleArrange);
|
||||
return docSimpleArranges;
|
||||
}
|
||||
|
||||
public int saveDocSimple(DocSimpleArrangeOa docSimpleArrange) {
|
||||
return docSimpleMapper.saveDocSimple(docSimpleArrange);
|
||||
}
|
||||
|
||||
public int deleteDocSimple(String ids) {
|
||||
int num = 0;
|
||||
if(ids!=null && !"".equals(ids) && ids.length()>0){
|
||||
String id[] = ids.split(",");
|
||||
for(int i=0;i<id.length;i++){
|
||||
String index = id[i];
|
||||
Integer t = Integer.valueOf(index);
|
||||
int j = docSimpleMapper.deleteDocSimple(t);
|
||||
docSimpleMapper.deleteDocSimpleCascadeRecycle(t);
|
||||
if(j>0) {
|
||||
num = num + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public int updateDocSimple(DocSimpleArrangeOa docSimpleArrange) {
|
||||
return docSimpleMapper.updateDocSimple(docSimpleArrange);
|
||||
}
|
||||
|
||||
public DocOriginalOaEntity queryDocOriginalEntityById(Integer id){
|
||||
return docSimpleMapper.queryDocOriginalEntityById(id);
|
||||
}
|
||||
|
||||
//下载文件url写法http://localhost:8081/ureport/pdf?_u=file:rr.ureport.xml&name=du,name值在第三个参数map里面
|
||||
public List docSimplePdf(String dataSourceName,String dataSetName,Map paramMap) {
|
||||
DocSimpleArrangeOa docSimpleArrange = new DocSimpleArrangeOa();
|
||||
docSimpleArrange.setFondsNo((String)paramMap.get("fondsNo"));
|
||||
docSimpleArrange.setFondsNoCode((String)paramMap.get("fondsNoCode"));
|
||||
List docSimpleArranges= docSimpleMapper.getDocSimpleWithPage(docSimpleArrange);
|
||||
return docSimpleArranges;
|
||||
}
|
||||
|
||||
public int getDocOriginalEntityCount(Integer recId) {
|
||||
return docSimpleMapper.getDocOriginalEntityCount(recId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void saveDocOriginalEntity(DocOriginalOaEntity docOriginalEntity) {
|
||||
docSimpleMapper.saveDocOriginalEntity(docOriginalEntity);
|
||||
}
|
||||
|
||||
public void saveDocOriginalJnEntity(DocOriginalOaEntity docOriginalEntity) {
|
||||
docSimpleMapper.saveDocOriginalJnEntity(docOriginalEntity);
|
||||
}
|
||||
|
||||
|
||||
public List queryDocOriginalEntity(Integer recId) {
|
||||
return docSimpleMapper.queryDocOriginalEntity(recId);
|
||||
}
|
||||
|
||||
|
||||
public int updateDocOriginalEntity(String ids){
|
||||
int num = 0;
|
||||
if(ids!=null && !"".equals(ids) && ids.length()>0){
|
||||
String id[] = ids.split(",");
|
||||
for(int i=0;i<id.length;i++){
|
||||
String index = id[i];
|
||||
Integer t = Integer.valueOf(index);
|
||||
int j = docSimpleMapper.updateDocOriginalEntity(t);
|
||||
if(j>0) {
|
||||
num = num + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return num;
|
||||
|
||||
}
|
||||
|
||||
public List queryDocOriginalEntityRecycle(Integer recId) {
|
||||
return docSimpleMapper.queryDocOriginalEntityRecycle(recId);
|
||||
}
|
||||
|
||||
public void updateDocOriginalEntityRecycle(Integer id){
|
||||
docSimpleMapper.updateDocOriginalEntityRecycle(id);
|
||||
}
|
||||
|
||||
|
||||
public int deleteDocOriginalEntityRecycle(String ids) {
|
||||
int num = 0;
|
||||
if(ids!=null && !"".equals(ids) && ids.length()>0){
|
||||
String id[] = ids.split(",");
|
||||
for(int i=0;i<id.length;i++){
|
||||
String index = id[i];
|
||||
Integer t = Integer.valueOf(index);
|
||||
int j = docSimpleMapper.deleteDocOriginalEntityRecycle(t);
|
||||
if(j>0) {
|
||||
num = num + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public void saveBatchDocSimple(MultipartFile file)throws Exception {
|
||||
String tableName = "wsda_20190528111300933_temp_oa";
|
||||
String fieldName = "case_no," +
|
||||
" mlh," +
|
||||
" archive_no," +
|
||||
" note ," +
|
||||
" pigeonhole_date," +
|
||||
" archive_ctg_no," +
|
||||
" archive_ctg_no_code," +
|
||||
" retention," +
|
||||
" retention_code," +
|
||||
" filing_year," +
|
||||
" fonds_no," +
|
||||
" fonds_no_code," +
|
||||
" sbt_word," +
|
||||
" doc_no," +
|
||||
" dagdm," +
|
||||
" dagdm_code," +
|
||||
" created_date," +
|
||||
" object_quantity," +
|
||||
" security_class," +
|
||||
" security_class_code," +
|
||||
" quantity," +
|
||||
" piece_no," +
|
||||
" kzbs," +
|
||||
" kzbs_code," +
|
||||
" folder_location," +
|
||||
" damldm," +
|
||||
" damldm_code," +
|
||||
" maintitle," +
|
||||
" responsibleby," +
|
||||
" create_person," +
|
||||
" create_date," +
|
||||
" is_packeep," +
|
||||
" is_packeep_code," +
|
||||
" md5_code," +
|
||||
" md5_check_date," +
|
||||
" batch_id," +
|
||||
" batch_name," +
|
||||
" back_to_update_state," +
|
||||
" is_process," +
|
||||
" testtest_code," +
|
||||
" archive_file_num," +
|
||||
" departname," +
|
||||
" departname_code," +
|
||||
" lb," +
|
||||
" lb_code," +
|
||||
" lm," +
|
||||
" lm_code," +
|
||||
" archive_flag";
|
||||
InputStream in = file.getInputStream();
|
||||
Workbook boxExcel = Workbook.getWorkbook(in);
|
||||
Sheet boxSheet = boxExcel.getSheet(0);
|
||||
for (int i = 1; i < boxSheet.getRows(); i++) {
|
||||
StringBuffer valueNameBuffer = new StringBuffer();
|
||||
Map map = new HashMap();
|
||||
for (int j = 0; j <boxSheet.getColumns(); j++) {
|
||||
Cell boxCell = boxSheet.getCell(j, i);
|
||||
String val = boxCell.getContents();
|
||||
if("".equals(val))val=null;
|
||||
if(j==0)valueNameBuffer.append(val);
|
||||
else valueNameBuffer.append(","+val);
|
||||
}
|
||||
String valueName = valueNameBuffer.toString();
|
||||
map.put("tableName", tableName);
|
||||
map.put("fieldName", fieldName);
|
||||
map.put("valueName", valueName);
|
||||
docSimpleMapper.saveBatchDocSimple(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
package com.point.strategy.oaDocking.service;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.point.strategy.docTraditionArrange.docFile.bean.DocFileOriginalEntity;
|
||||
import com.point.strategy.oaDocking.bean.DocTraditionArrangeFileOa;
|
||||
import com.point.strategy.oaDocking.mapper.DocTraditionFileOaMapper;
|
||||
import jxl.Cell;
|
||||
import jxl.Sheet;
|
||||
import jxl.Workbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
//文书案卷
|
||||
@Service
|
||||
@Transactional
|
||||
public class DocTraditionFileOaService {
|
||||
@Autowired
|
||||
public DocTraditionFileOaMapper docTraditionFileMapper;
|
||||
|
||||
public List getDocFileWithPage(DocTraditionArrangeFileOa docTraditionArrangeFile) {
|
||||
PageHelper.startPage(docTraditionArrangeFile.getPage(), docTraditionArrangeFile.getLimit());
|
||||
List docFiles= docTraditionFileMapper.getDocFileWithPage(docTraditionArrangeFile);
|
||||
return docFiles;
|
||||
}
|
||||
|
||||
public int saveDocFile(DocTraditionArrangeFileOa docTraditionArrangeFile) {
|
||||
return docTraditionFileMapper.saveDocFile(docTraditionArrangeFile);
|
||||
}
|
||||
|
||||
public int deleteDocFile(String ids) {
|
||||
int num = 0;
|
||||
if(ids!=null && !"".equals(ids) && ids.length()>0){
|
||||
String id[] = ids.split(",");
|
||||
for(int i=0;i<id.length;i++){
|
||||
String index = id[i];
|
||||
Integer t = Integer.valueOf(index);
|
||||
int j = docTraditionFileMapper.deleteDocFile(t);
|
||||
// docTraditionFileMapper.deleteDocFileCascadeRecycle(t);
|
||||
if(j>0) {
|
||||
num = num + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public int updateDocFile(DocTraditionArrangeFileOa docTraditionArrangeFile) {
|
||||
return docTraditionFileMapper.updateDocFile(docTraditionArrangeFile);
|
||||
}
|
||||
|
||||
//下载文件url写法http://localhost:8081/ureport/pdf?_u=file:rr.ureport.xml&name=du,name值在第三个参数map里面
|
||||
public List docFilePdf(String dataSourceName,String dataSetName,Map paramMap) {
|
||||
DocTraditionArrangeFileOa docTraditionArrangeFile = new DocTraditionArrangeFileOa();
|
||||
docTraditionArrangeFile.setFondsNo((String)paramMap.get("fondsNo"));
|
||||
docTraditionArrangeFile.setFondsNoCode((String)paramMap.get("fondsNoCode"));
|
||||
List docFiles= docTraditionFileMapper.getDocFileWithPage(docTraditionArrangeFile);
|
||||
return docFiles;
|
||||
}
|
||||
|
||||
public int getDocFileOriginalEntityCount(Integer recId) {
|
||||
return docTraditionFileMapper.getDocFileOriginalEntityCount(recId);
|
||||
}
|
||||
|
||||
public void saveDocFileOriginalEntity(DocFileOriginalEntity docFileOriginalEntity) {
|
||||
docTraditionFileMapper.saveDocFileOriginalEntity(docFileOriginalEntity);
|
||||
}
|
||||
|
||||
public List queryDocFileOriginalEntity(Integer recId) {
|
||||
return docTraditionFileMapper.queryDocFileOriginalEntity(recId);
|
||||
}
|
||||
|
||||
|
||||
public void updateDocFileOriginalEntity(Integer id){
|
||||
docTraditionFileMapper.updateDocFileOriginalEntity(id);
|
||||
}
|
||||
|
||||
|
||||
public List queryDocFileOriginalEntityRecycle(Map<String,Object> map) {
|
||||
return docTraditionFileMapper.queryDocFileOriginalEntityRecycle(map);
|
||||
}
|
||||
|
||||
public List queryDocFileOriginalEntityRecycle(Integer recId) {
|
||||
return docTraditionFileMapper.queryDocFileOriginalEntityRecycle(recId);
|
||||
}
|
||||
|
||||
public void updateDocFileOriginalEntityRecycle(Integer id){
|
||||
docTraditionFileMapper.updateDocFileOriginalEntityRecycle(id);
|
||||
}
|
||||
|
||||
|
||||
public int deleteDocFileOriginalEntityRecycle(String ids) {
|
||||
int num = 0;
|
||||
if(ids!=null && !"".equals(ids) && ids.length()>0){
|
||||
String id[] = ids.split(",");
|
||||
for(int i=0;i<id.length;i++){
|
||||
String index = id[i];
|
||||
Integer t = Integer.valueOf(index);
|
||||
int j = docTraditionFileMapper.deleteDocFileOriginalEntityRecycle(t);
|
||||
if(j>0) {
|
||||
num = num + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public void saveBatchDocFiles(MultipartFile file)throws Exception {
|
||||
String tableName = "wsajml_20201104084106585_temp_oa";
|
||||
String fieldName = "folder_no," +
|
||||
"js," +
|
||||
"folder_location," +
|
||||
"maintitle," +
|
||||
"security_class," +
|
||||
"security_class_code," +
|
||||
"fonds_no," +
|
||||
"fonds_no_code," +
|
||||
"filing_year," +
|
||||
"retention," +
|
||||
"retention_code," +
|
||||
"archive_ctg_no," +
|
||||
"archive_ctg_no_code," +
|
||||
"year_folder_no," +
|
||||
"quantity," +
|
||||
"doc_start_time," +
|
||||
"doc_end_time," +
|
||||
"sbt_word," +
|
||||
"pigeonhole_date," +
|
||||
"note," +
|
||||
"mlh," +
|
||||
"sssq," +
|
||||
"sssq_code," +
|
||||
"dagdm," +
|
||||
"dagdm_code," +
|
||||
"zqbs," +
|
||||
"zqbs_code," +
|
||||
"kzbs," +
|
||||
"kzbs_code," +
|
||||
"damldm," +
|
||||
"damldm_code," +
|
||||
"create_person," +
|
||||
"create_date," +
|
||||
"archive_flag," +
|
||||
"is_packeep," +
|
||||
"is_packeep_code," +
|
||||
"md5_code," +
|
||||
"md5_check_date," +
|
||||
"batch_id," +
|
||||
"batch_name," +
|
||||
"back_to_update_state," +
|
||||
"is_process," +
|
||||
"archive_entity_status";
|
||||
InputStream in = file.getInputStream();
|
||||
Workbook boxExcel = Workbook.getWorkbook(in);
|
||||
Sheet boxSheet = boxExcel.getSheet(0);
|
||||
for (int i = 1; i < boxSheet.getRows(); i++) {
|
||||
StringBuffer valueNameBuffer = new StringBuffer();
|
||||
Map map = new HashMap();
|
||||
for (int j = 0; j <boxSheet.getColumns(); j++) {
|
||||
Cell boxCell = boxSheet.getCell(j, i);
|
||||
String val = boxCell.getContents();
|
||||
// if("".equals(val))val=null; SQL语句需要加上'(单引号)
|
||||
if(j==0)valueNameBuffer.append("'"+val+"'");
|
||||
else valueNameBuffer.append(",'"+val+"'");
|
||||
}
|
||||
String valueName = valueNameBuffer.toString();
|
||||
map.put("tableName", tableName);
|
||||
map.put("fieldName", fieldName);
|
||||
map.put("valueName", valueName);
|
||||
docTraditionFileMapper.saveBatchDocFiles(map);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新文书传统案卷原文文件
|
||||
* @param entity
|
||||
*/
|
||||
public void updateTempFile(DocFileOriginalEntity entity){
|
||||
docTraditionFileMapper.updateTempFile(entity);
|
||||
}
|
||||
//更新档案文件数量
|
||||
public void wsajmlTempCount(Integer id){
|
||||
docTraditionFileMapper.wsajmlTempCount(id);
|
||||
}
|
||||
//案卷-查询文件对象
|
||||
public DocFileOriginalEntity selectFileOneById(Integer id){
|
||||
return docTraditionFileMapper.selectFileOneById(id);
|
||||
}
|
||||
|
||||
//删除卷内文件
|
||||
public int deleteDocFileCascadeRecycle(Integer recid) {
|
||||
return docTraditionFileMapper.deleteDocFileCascadeRecycle(recid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
package com.point.strategy.oaDocking.service;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.point.strategy.common.AjaxJson;
|
||||
import com.point.strategy.docTraditionArrange.docVolume.bean.DocVolumeOriginalEntity;
|
||||
import com.point.strategy.oaDocking.bean.DocTraditionArrangeOaVolume;
|
||||
import com.point.strategy.oaDocking.bean.DocVolumeOriginalOaEntity;
|
||||
import com.point.strategy.oaDocking.mapper.DocTraditionVolumeOaMapper;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import jxl.Cell;
|
||||
import jxl.Sheet;
|
||||
import jxl.Workbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
//文书卷内
|
||||
@Service
|
||||
@Transactional
|
||||
public class DocTraditionVolumeOaService {
|
||||
@Autowired
|
||||
public DocTraditionVolumeOaMapper docTraditionVolumeMapper;
|
||||
|
||||
public List getDocVolumeWithPage(DocTraditionArrangeOaVolume docTraditionArrangeVolume) {
|
||||
PageHelper.startPage(docTraditionArrangeVolume.getPage(), docTraditionArrangeVolume.getLimit());
|
||||
List docVolumes= docTraditionVolumeMapper.getDocVolumeWithPage(docTraditionArrangeVolume);
|
||||
return docVolumes;
|
||||
}
|
||||
|
||||
public int saveDocVolume(DocTraditionArrangeOaVolume docTraditionArrangeVolume) {
|
||||
return docTraditionVolumeMapper.saveDocVolume(docTraditionArrangeVolume);
|
||||
}
|
||||
|
||||
public int deleteDocVolume(String ids) {
|
||||
int num = 0;
|
||||
if(ids!=null && !"".equals(ids) && ids.length()>0){
|
||||
String id[] = ids.split(",");
|
||||
for(int i=0;i<id.length;i++){
|
||||
String index = id[i];
|
||||
Integer t = Integer.valueOf(index);
|
||||
int j = docTraditionVolumeMapper.deleteDocVolume(t);
|
||||
docTraditionVolumeMapper.deleteDocVolumeCascadeRecycle(t);
|
||||
if(j>0) {
|
||||
num = num + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public int updateDocVolume(DocTraditionArrangeOaVolume docTraditionArrangeVolume) {
|
||||
return docTraditionVolumeMapper.updateDocVolume(docTraditionArrangeVolume);
|
||||
}
|
||||
|
||||
//下载文件url写法http://localhost:8081/ureport/pdf?_u=file:rr.ureport.xml&name=du,name值在第三个参数map里面
|
||||
public List docVolumePdf(String dataSourceName,String dataSetName,Map paramMap) {
|
||||
DocTraditionArrangeOaVolume docTraditionArrangeVolume = new DocTraditionArrangeOaVolume();
|
||||
docTraditionArrangeVolume.setFondsNo((String)paramMap.get("fondsNo"));
|
||||
docTraditionArrangeVolume.setFondsNoCode((String)paramMap.get("fondsNoCode"));
|
||||
List docVolumes= docTraditionVolumeMapper.getDocVolumeWithPage(docTraditionArrangeVolume);
|
||||
return docVolumes;
|
||||
}
|
||||
|
||||
public int getDocVolumeOriginalEntityCount(Integer recId) {
|
||||
return docTraditionVolumeMapper.getDocVolumeOriginalEntityCount(recId);
|
||||
}
|
||||
|
||||
public void saveDocVolumeOriginalEntity(DocVolumeOriginalOaEntity docVolumeOriginalEntity) {
|
||||
docTraditionVolumeMapper.saveDocVolumeOriginalEntity(docVolumeOriginalEntity);
|
||||
}
|
||||
|
||||
public List queryDocVolumeOriginalEntity(Integer recId) {
|
||||
return docTraditionVolumeMapper.queryDocVolumeOriginalEntity(recId);
|
||||
}
|
||||
|
||||
|
||||
public void updateDocVolumeOriginalEntity(Integer id){
|
||||
docTraditionVolumeMapper.updateDocVolumeOriginalEntity(id);
|
||||
}
|
||||
|
||||
public List queryDocVolumeOriginalEntityRecycle(Integer recId) {
|
||||
return docTraditionVolumeMapper.queryDocVolumeOriginalEntityRecycle(recId);
|
||||
}
|
||||
|
||||
public List queryDocVolumeOriginalEntityRecycle2(Map<String,Object> map) {
|
||||
return docTraditionVolumeMapper.queryDocVolumeOriginalEntityRecycle2(map);
|
||||
}
|
||||
|
||||
public void updateDocVolumeOriginalEntityRecycle(Integer id){
|
||||
docTraditionVolumeMapper.updateDocVolumeOriginalEntityRecycle(id);
|
||||
}
|
||||
|
||||
|
||||
public int deleteDocVolumeOriginalEntityRecycle(String ids) {
|
||||
int num = 0;
|
||||
if(ids!=null && !"".equals(ids) && ids.length()>0){
|
||||
String id[] = ids.split(",");
|
||||
for(int i=0;i<id.length;i++){
|
||||
String index = id[i];
|
||||
Integer t = Integer.valueOf(index);
|
||||
int j = docTraditionVolumeMapper.deleteDocVolumeOriginalEntityRecycle(t);
|
||||
if(j>0) {
|
||||
num = num + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public void saveBatchDocVolumes(MultipartFile file)throws Exception {
|
||||
String tableName = "wsjnml_20201104084119220_temp_oa";
|
||||
String fieldName = "archive_no," +
|
||||
"folder_no," +
|
||||
"maintitle," +
|
||||
"created_date," +
|
||||
"doc_no," +
|
||||
"security_class," +
|
||||
"security_class_code," +
|
||||
"fonds_no," +
|
||||
"fonds_no_code," +
|
||||
"filing_year," +
|
||||
"retention," +
|
||||
"retention_code," +
|
||||
"archive_ctg_no," +
|
||||
"archive_ctg_no_code," +
|
||||
"year_folder_no," +
|
||||
"page_no," +
|
||||
"piece_no," +
|
||||
"quantity," +
|
||||
"responsibleby," +
|
||||
"sbt_word," +
|
||||
"folder_location," +
|
||||
"pigeonhole_date," +
|
||||
"note," +
|
||||
"object_quantity," +
|
||||
"page_no_end," +
|
||||
"mlh," +
|
||||
"sssq," +
|
||||
"sssq_code," +
|
||||
"dagdm," +
|
||||
"dagdm_code," +
|
||||
"kzbs," +
|
||||
"kzbs_code," +
|
||||
"zqbs," +
|
||||
"zqbs_code," +
|
||||
"damldm," +
|
||||
"damldm_code," +
|
||||
"report_page," +
|
||||
"pid," +
|
||||
"create_person," +
|
||||
"create_date," +
|
||||
"archive_flag," +
|
||||
"is_packeep," +
|
||||
"is_packeep_code," +
|
||||
"md5_code," +
|
||||
"md5_check_date," +
|
||||
"batch_id," +
|
||||
"batch_name," +
|
||||
"back_to_update_state," +
|
||||
"is_process," +
|
||||
"archive_entity_status," +
|
||||
"archive_zjbs," +
|
||||
"temp_no";
|
||||
InputStream in = file.getInputStream();
|
||||
Workbook boxExcel = Workbook.getWorkbook(in);
|
||||
Sheet boxSheet = boxExcel.getSheet(0);
|
||||
for (int i = 1; i < boxSheet.getRows(); i++) {
|
||||
StringBuffer valueNameBuffer = new StringBuffer();
|
||||
Map map = new HashMap();
|
||||
for (int j = 0; j <boxSheet.getColumns(); j++) {
|
||||
Cell boxCell = boxSheet.getCell(j, i);
|
||||
String val = boxCell.getContents();
|
||||
// if("".equals(val))val=null; SQL语句需要加上'(单引号)
|
||||
if(j==0)valueNameBuffer.append("'"+val+"'");
|
||||
else valueNameBuffer.append(",'"+val+"'");
|
||||
}
|
||||
String valueName = valueNameBuffer.toString();
|
||||
map.put("tableName", tableName);
|
||||
map.put("fieldName", fieldName);
|
||||
map.put("valueName", valueName);
|
||||
docTraditionVolumeMapper.saveBatchDocVolumes(map);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新文书传统卷内原文文件
|
||||
* @param entity
|
||||
*/
|
||||
public void updateTempFile(DocVolumeOriginalEntity entity){
|
||||
docTraditionVolumeMapper.updateTempFile(entity);
|
||||
}
|
||||
|
||||
//卷内-更新档案文件数量
|
||||
public void wsjnmlTempCount(Integer id){
|
||||
docTraditionVolumeMapper.wsjnmlTempCount(id);
|
||||
}
|
||||
|
||||
//卷内-查询文件id
|
||||
public DocVolumeOriginalEntity selectFileOneById(Integer id){
|
||||
return docTraditionVolumeMapper.selectFileOneById(id);
|
||||
}
|
||||
|
||||
public int deleteDocVolumeCascadeRecycle(Integer recid) {
|
||||
return docTraditionVolumeMapper.deleteDocVolumeCascadeRecycle(recid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.point.strategy.oaDocking.service;
|
||||
|
||||
import com.point.strategy.common.Base64Utils;
|
||||
import com.point.strategy.common.SystemProperty;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.sql.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class YcjSystemIntegration {
|
||||
private static final Logger LOGGER = Logger.getLogger(YcjSystemIntegration.class.getName());
|
||||
|
||||
private static final String driver_dm = SystemProperty.getKeyValue("ycj.driverClassName", "application.properties");
|
||||
private static final String url = SystemProperty.getKeyValue("ycj.url", "application.properties");
|
||||
private static final String user = SystemProperty.getKeyValue("ycj.username", "application.properties");
|
||||
private static final String password = SystemProperty.getKeyValue("ycj.password", "application.properties");
|
||||
|
||||
// 获取数据库连接
|
||||
private static Connection getConnection() throws Exception {
|
||||
Class.forName(driver_dm);
|
||||
return DriverManager.getConnection(url, user, password);
|
||||
}
|
||||
|
||||
// 查询
|
||||
public static ResultSet executeQuery(String sql) throws Exception {
|
||||
Connection conn = null;
|
||||
Statement st = null;
|
||||
try {
|
||||
conn = getConnection();
|
||||
st = conn.createStatement();
|
||||
return st.executeQuery(sql);
|
||||
} catch (Exception e) {
|
||||
LOGGER.log(Level.SEVERE, "执行查询时出错: " + sql, e);
|
||||
closeResources(conn, st, null);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
// 修改
|
||||
public static int executeUpdate(String sql) throws Exception {
|
||||
Connection conn = null;
|
||||
Statement st = null;
|
||||
try {
|
||||
conn = getConnection();
|
||||
st = conn.createStatement();
|
||||
return st.executeUpdate(sql);
|
||||
} catch (Exception e) {
|
||||
LOGGER.log(Level.SEVERE, "执行更新时出错: " + sql, e);
|
||||
throw e;
|
||||
} finally {
|
||||
closeResources(conn, st, null);
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭资源
|
||||
public static void closeResources(Connection conn, Statement st, ResultSet rs) {
|
||||
try {
|
||||
if (rs != null) rs.close();
|
||||
if (st != null) st.close();
|
||||
if (conn != null) conn.close();
|
||||
} catch (Exception e) {
|
||||
LOGGER.log(Level.WARNING, "关闭资源时出错", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Connection conn = null;
|
||||
// Statement st = null;
|
||||
// ResultSet resultSet = null;
|
||||
// try {
|
||||
//
|
||||
// String imageBytes = Base64Utils.encode2("D:\\2\\222.pdf");
|
||||
// conn = getConnection();
|
||||
// String sql = "INSERT INTO fujian (fawen_index,fujian_id,sound_image) VALUES (?,?,?)";
|
||||
// PreparedStatement pstmt = conn.prepareStatement(sql);
|
||||
// pstmt.setInt(1, 1);
|
||||
// pstmt.setInt(2, 5);
|
||||
// pstmt.setString(3, imageBytes);
|
||||
// pstmt.executeUpdate();
|
||||
//
|
||||
// System.out.println("图像已成功转换为longblob并存储到数据库。");
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
|
||||
Connection conn = null;
|
||||
Statement st = null;
|
||||
ResultSet resultSet = null;
|
||||
try (FileInputStream fis = new FileInputStream(new File("D:\\2\\222.pdf"))) {
|
||||
|
||||
byte[] imageBytes = new byte[(int) new File("D:\\2\\222.pdf").length()];
|
||||
fis.read(imageBytes);
|
||||
conn = getConnection();
|
||||
String sql = "INSERT INTO fujian (fawen_index,fujian_id,sound_image) VALUES (?,?,?)";
|
||||
PreparedStatement pstmt = conn.prepareStatement(sql);
|
||||
pstmt.setInt(1, 1);
|
||||
pstmt.setInt(2, 3);
|
||||
pstmt.setBytes(3, imageBytes);
|
||||
pstmt.executeUpdate();
|
||||
|
||||
System.out.println("图像已成功转换为longblob并存储到数据库。");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user