Commit d4f36128 authored by chase's avatar chase

merge 档案管理

parent db69dda1
...@@ -94,15 +94,15 @@ public class TaxDocumentController { ...@@ -94,15 +94,15 @@ public class TaxDocumentController {
headers.put("CompanyName", "公司名称"); headers.put("CompanyName", "公司名称");
headers.put("TaxType", "税种"); headers.put("TaxType", "税种");
headers.put("FileTime", "文件生效日期"); headers.put("FileTime", "文件生效日期");
headers.put("EffectiveTime", "有效日期"); headers.put("OwnTime", "所属期间");
headers.put("Creator", "创建人"); headers.put("EffectiveTime", "到期日");
headers.put("CreateTime", "创建时间"); headers.put("AuditStatus", "审批状态");
headers.put("UploadTime", "上传日期"); headers.put("PhysicalIndexNumber", "实物索引号");
headers.put("StorageArea", "实物存放地点"); headers.put("StorageArea", "实物存放地点");
headers.put("Keeper", "保管人"); headers.put("Keeper", "保管人");
headers.put("UploadTime", "上传日期");
headers.put("Creator", "创建人");
headers.put("Remark", "档案备注"); headers.put("Remark", "档案备注");
headers.put("FilePositionUrl", "文件存储的位置");
headers.put("OwnTime", "所属期间");
List<TaxDocument> TaxDocument = taxDocumentService.selectTaxDocumentList(taxDocumentDto); List<TaxDocument> TaxDocument = taxDocumentService.selectTaxDocumentList(taxDocumentDto);
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + new String("taxDocument.xlsx".getBytes("GB2312"), "ISO-8859-1")); response.setHeader("Content-Disposition", "attachment;fileName=" + new String("taxDocument.xlsx".getBytes("GB2312"), "ISO-8859-1"));
......
...@@ -20,8 +20,8 @@ public class CurrentPeriodBo { ...@@ -20,8 +20,8 @@ public class CurrentPeriodBo {
public static CurrentPeriodBo getPeriod(int parameterPeriod, int periodContent) { public static CurrentPeriodBo getPeriod(int parameterPeriod, int periodContent) {
int yearOffset = 0; int yearOffset = 0;
if (parameterPeriod == -99) { if (parameterPeriod == 99) {
return new CurrentPeriodBo(parameterPeriod); return new CurrentPeriodBo(periodContent);
} else if (parameterPeriod <= -1) { } else if (parameterPeriod <= -1) {
Integer period = parameterPeriod + periodContent; Integer period = parameterPeriod + periodContent;
while (period <= 0) { while (period <= 0) {
......
...@@ -474,8 +474,10 @@ public class TaxDocumentServiceImpl { ...@@ -474,8 +474,10 @@ public class TaxDocumentServiceImpl {
throw new RuntimeException("传入参数错误:空参数数组"); throw new RuntimeException("传入参数错误:空参数数组");
} }
criteria.andIdIn(ids); criteria.andIdIn(ids);
//查询出根据条件过滤后需要下载的附件数据信息
List<TaxDocument> taxDocuments = taxDocumentMapper.selectByExample(example); List<TaxDocument> taxDocuments = taxDocumentMapper.selectByExample(example);
//新建一个空集合,记录下载的名字,并用于判断是否重名,重名则修改名字为(n)
List<String> fileNameList = new ArrayList<>();
for (TaxDocument item : taxDocuments) { for (TaxDocument item : taxDocuments) {
//文件url //文件url
String urlPath = item.getFilePositionUrl(); String urlPath = item.getFilePositionUrl();
...@@ -483,10 +485,23 @@ public class TaxDocumentServiceImpl { ...@@ -483,10 +485,23 @@ public class TaxDocumentServiceImpl {
if (StringUtils.isBlank(urlPath)) { if (StringUtils.isBlank(urlPath)) {
throw new RuntimeException("文件url为空,id为:" + item.getId()); throw new RuntimeException("文件url为空,id为:" + item.getId());
} }
//文件名称(带后缀) 文件名前+7位uuid截取码以防文件名相同 //检查文件名是否有重复
String fileName = StringUtils.isBlank(item.getFileName()) int fileNameRepeatTimes = 0;
? "未知文件(请修改后缀名).xlsx" if (fileNameList.size()>0){
: item.getFileName(); fileNameRepeatTimes = Collections.frequency(fileNameList, item.getFileName());
}
String fileName;
if (fileNameRepeatTimes > 0) {
fileName = StringUtils.isBlank(item.getFileName())
? "未知文件(请修改后缀名).xlsx"
: "(" + fileNameRepeatTimes + ")" + item.getFileName();
} else {
//文件名称(带后缀
fileName = StringUtils.isBlank(item.getFileName())
? "未知文件(请修改后缀名).xlsx"
: item.getFileName();
}
fileNameList.add(item.getFileName());
InputStream is = null; InputStream is = null;
BufferedInputStream in = null; BufferedInputStream in = null;
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
......
...@@ -22,6 +22,7 @@ import java.text.MessageFormat; ...@@ -22,6 +22,7 @@ import java.text.MessageFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* The <code>ExcelUtil</code> 与 {@link ExcelCell}搭配使用 * The <code>ExcelUtil</code> 与 {@link ExcelCell}搭配使用
...@@ -57,27 +58,27 @@ public class ExcelUtil { ...@@ -57,27 +58,27 @@ public class ExcelUtil {
* 获取cell类型的文字描述 * 获取cell类型的文字描述
* *
* @param cellType <pre> * @param cellType <pre>
* CellType.BLANK * CellType.BLANK
* CellType.BOOLEAN * CellType.BOOLEAN
* CellType.ERROR * CellType.ERROR
* CellType.FORMULA * CellType.FORMULA
* CellType.NUMERIC * CellType.NUMERIC
* CellType.STRING * CellType.STRING
* </pre> * </pre>
* @return * @return
*/ */
private static String getCellTypeByInt(CellType cellType) { private static String getCellTypeByInt(CellType cellType) {
if(cellType == CellType.BLANK) if (cellType == CellType.BLANK)
return "Null type"; return "Null type";
else if(cellType == CellType.BOOLEAN) else if (cellType == CellType.BOOLEAN)
return "Boolean type"; return "Boolean type";
else if(cellType == CellType.ERROR) else if (cellType == CellType.ERROR)
return "Error type"; return "Error type";
else if(cellType == CellType.FORMULA) else if (cellType == CellType.FORMULA)
return "Formula type"; return "Formula type";
else if(cellType == CellType.NUMERIC) else if (cellType == CellType.NUMERIC)
return "Numeric type"; return "Numeric type";
else if(cellType == CellType.STRING) else if (cellType == CellType.STRING)
return "String type"; return "String type";
else else
return "Unknown type"; return "Unknown type";
...@@ -96,13 +97,13 @@ public class ExcelUtil { ...@@ -96,13 +97,13 @@ public class ExcelUtil {
return null; return null;
} }
CellType cellType = cell.getCellTypeEnum(); CellType cellType = cell.getCellTypeEnum();
if(cellType == CellType.BLANK) if (cellType == CellType.BLANK)
return null; return null;
else if(cellType == CellType.BOOLEAN) else if (cellType == CellType.BOOLEAN)
return cell.getBooleanCellValue(); return cell.getBooleanCellValue();
else if(cellType == CellType.ERROR) else if (cellType == CellType.ERROR)
return cell.getErrorCellValue(); return cell.getErrorCellValue();
else if(cellType == CellType.FORMULA) { else if (cellType == CellType.FORMULA) {
try { try {
if (HSSFDateUtil.isCellDateFormatted(cell)) { if (HSSFDateUtil.isCellDateFormatted(cell)) {
return cell.getDateCellValue(); return cell.getDateCellValue();
...@@ -112,15 +113,13 @@ public class ExcelUtil { ...@@ -112,15 +113,13 @@ public class ExcelUtil {
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
return cell.getRichStringCellValue(); return cell.getRichStringCellValue();
} }
} } else if (cellType == CellType.NUMERIC) {
else if(cellType == CellType.NUMERIC){
if (DateUtil.isCellDateFormatted(cell)) { if (DateUtil.isCellDateFormatted(cell)) {
return cell.getDateCellValue(); return cell.getDateCellValue();
} else { } else {
return cell.getNumericCellValue(); return cell.getNumericCellValue();
} }
} } else if (cellType == CellType.STRING)
else if(cellType == CellType.STRING)
return cell.getStringCellValue(); return cell.getStringCellValue();
else else
return null; return null;
...@@ -136,7 +135,7 @@ public class ExcelUtil { ...@@ -136,7 +135,7 @@ public class ExcelUtil {
* javabean属性的数据类型有基本数据类型及String,Date,String[],Double[] * javabean属性的数据类型有基本数据类型及String,Date,String[],Double[]
* @param out 与输出设备关联的流对象,可以将EXCEL文档导出到本地文件或者网络中 * @param out 与输出设备关联的流对象,可以将EXCEL文档导出到本地文件或者网络中
*/ */
public static <T> void exportExcel(Map<String,String> headers, Collection<T> dataset, OutputStream out) { public static <T> void exportExcel(Map<String, String> headers, Collection<T> dataset, OutputStream out) {
exportExcel(headers, dataset, out, null); exportExcel(headers, dataset, out, null);
} }
...@@ -152,7 +151,7 @@ public class ExcelUtil { ...@@ -152,7 +151,7 @@ public class ExcelUtil {
* @param pattern 如果有时间数据,设定输出格式。默认为"yyy-MM-dd" * @param pattern 如果有时间数据,设定输出格式。默认为"yyy-MM-dd"
*/ */
@SuppressWarnings("resource") @SuppressWarnings("resource")
public static <T> void exportExcel(Map<String,String> headers, Collection<T> dataset, OutputStream out, public static <T> void exportExcel(Map<String, String> headers, Collection<T> dataset, OutputStream out,
String pattern) { String pattern) {
// 声明一个工作薄 // 声明一个工作薄
HSSFWorkbook workbook = new HSSFWorkbook(); HSSFWorkbook workbook = new HSSFWorkbook();
...@@ -249,10 +248,10 @@ public class ExcelUtil { ...@@ -249,10 +248,10 @@ public class ExcelUtil {
* @param dataset 数据集合 * @param dataset 数据集合
* @param pattern 日期格式 * @param pattern 日期格式
*/ */
private static <T> void write2Sheet(HSSFSheet sheet, Map<String,String> headers, Collection<T> dataset, private static <T> void write2Sheet(HSSFSheet sheet, Map<String, String> headers, Collection<T> dataset,
String pattern) { String pattern) {
//时间格式默认"yyyy-MM-dd" //时间格式默认"yyyy-MM-dd"
if (StringUtils.isEmpty(pattern)){ if (StringUtils.isEmpty(pattern)) {
pattern = "yyyy-MM-dd"; pattern = "yyyy-MM-dd";
} }
// 产生表格标题行 // 产生表格标题行
...@@ -260,8 +259,8 @@ public class ExcelUtil { ...@@ -260,8 +259,8 @@ public class ExcelUtil {
// 标题行转中文 // 标题行转中文
Iterator<Map.Entry<String, String>> it1 = headers.entrySet().iterator(); Iterator<Map.Entry<String, String>> it1 = headers.entrySet().iterator();
String key = StringUtils.EMPTY; //存放临时键变量 String key = StringUtils.EMPTY; //存放临时键变量
int c= 0; //标题列数 int c = 0; //标题列数
while (it1.hasNext()){ while (it1.hasNext()) {
key = it1.next().getKey(); key = it1.next().getKey();
if (headers.containsKey(key)) { if (headers.containsKey(key)) {
HSSFCell cell = row.createCell(c); HSSFCell cell = row.createCell(c);
...@@ -285,7 +284,7 @@ public class ExcelUtil { ...@@ -285,7 +284,7 @@ public class ExcelUtil {
int cellNum = 0; int cellNum = 0;
//遍历列名 //遍历列名
Iterator<String> it2 = headers.keySet().iterator(); Iterator<String> it2 = headers.keySet().iterator();
while (it2.hasNext()){ while (it2.hasNext()) {
key = it2.next(); key = it2.next();
if (!headers.containsKey(key)) { if (!headers.containsKey(key)) {
LG.error("Map 中 不存在 key [" + key + "]"); LG.error("Map 中 不存在 key [" + key + "]");
...@@ -293,8 +292,8 @@ public class ExcelUtil { ...@@ -293,8 +292,8 @@ public class ExcelUtil {
} }
Object value = map.get(key); Object value = map.get(key);
HSSFCell cell = row.createCell(cellNum); HSSFCell cell = row.createCell(cellNum);
//TODO
cellNum = setCellValue(cell,value,pattern,cellNum,null,row); cellNum = setCellValue(cell, value, pattern, cellNum, null, row);
cellNum++; cellNum++;
} }
...@@ -307,7 +306,7 @@ public class ExcelUtil { ...@@ -307,7 +306,7 @@ public class ExcelUtil {
field.setAccessible(true); field.setAccessible(true);
Object value = field.get(t); Object value = field.get(t);
cellNum = setCellValue(cell,value,pattern,cellNum,field,row); cellNum = setCellValue(cell, value, pattern, cellNum, field, row);
cellNum++; cellNum++;
} }
...@@ -322,12 +321,24 @@ public class ExcelUtil { ...@@ -322,12 +321,24 @@ public class ExcelUtil {
} }
} }
private static int setCellValue(HSSFCell cell,Object value,String pattern,int cellNum,Field field,HSSFRow row){ private static int setCellValue(HSSFCell cell, Object value, String pattern, int cellNum, Field field, HSSFRow row) {
String textValue = null; String textValue = null;
if (value instanceof Integer) { if (value instanceof Integer) {
int intValue = (Integer) value; int intValue = (Integer) value;
cell.setCellValue(intValue); //判断int类型上是否有注解ExcelCell注解的isStatus属性
} else if(value instanceof BigDecimal){ ExcelCell anno = field.getAnnotation(ExcelCell.class);
String status = anno.isStatus();
if (anno != null && StringUtils.isNotBlank(status)) {
//把属性中设置的值分割
List<String> statusList = Arrays.asList(status.split(","));
//获取:前的前缀进行对比
String s = statusList.stream().filter(e -> e.substring(0, e.indexOf(":")).equals(value.toString())).collect(Collectors.toList()).get(0);
//设置:后的后缀值进cell表格中
cell.setCellValue(s.substring(s.indexOf(":") + 1));
} else {
cell.setCellValue(intValue);
}
} else if (value instanceof BigDecimal) {
textValue = DECIMAL_FORMAT.format(value); textValue = DECIMAL_FORMAT.format(value);
} else if (value instanceof Float) { } else if (value instanceof Float) {
float fValue = (Float) value; float fValue = (Float) value;
...@@ -372,13 +383,27 @@ public class ExcelUtil { ...@@ -372,13 +383,27 @@ public class ExcelUtil {
} else { } else {
// 其它数据类型都当作字符串简单处理 // 其它数据类型都当作字符串简单处理
String empty = StringUtils.EMPTY; String empty = StringUtils.EMPTY;
if(field != null) { if (field != null) {
ExcelCell anno = field.getAnnotation(ExcelCell.class); ExcelCell anno = field.getAnnotation(ExcelCell.class);
if (anno != null) { if (anno != null) {
empty = anno.defaultValue(); empty = anno.defaultValue();
} }
//判断字段是否有注解ExcelCell注解的isStatus属性
String status = anno.isStatus();
if (anno != null && StringUtils.isNotBlank(status)) {
//把属性中设置的值分割
List<String> statusList = Arrays.asList(status.split(","));
//获取:前的前缀进行对比
List<String> lists = statusList.stream().filter(e -> e.substring(0, e.indexOf(":")).equals(value)).collect(Collectors.toList());
String s = lists.size() > 0 ? lists.get(0) : "";
//设置:后的后缀值进cell表格中
textValue = s == null ? empty : s.substring(s.indexOf(":") + 1);
} else {
textValue = value == null ? empty : value.toString();
}
} else {
textValue = value == null ? empty : value.toString();
} }
textValue = value == null ? empty : value.toString();
} }
if (textValue != null) { if (textValue != null) {
HSSFRichTextString richString = new HSSFRichTextString(textValue); HSSFRichTextString richString = new HSSFRichTextString(textValue);
...@@ -390,11 +415,10 @@ public class ExcelUtil { ...@@ -390,11 +415,10 @@ public class ExcelUtil {
/** /**
* 把Excel的数据封装成voList * 把Excel的数据封装成voList
* *
* @param clazz vo的Class * @param clazz vo的Class
* @param inputStream excel输入流 * @param pattern 如果有时间数据,设定输入格式。默认为"yyy-MM-dd"
* @param pattern 如果有时间数据,设定输入格式。默认为"yyy-MM-dd" * @param logs 错误log集合
* @param logs 错误log集合 * @param arrayCount 如果vo中有数组类型,那就按照index顺序,把数组应该有几个值写上.
* @param arrayCount 如果vo中有数组类型,那就按照index顺序,把数组应该有几个值写上.
* @return voList * @return voList
* @throws RuntimeException * @throws RuntimeException
*/ */
...@@ -410,14 +434,13 @@ public class ExcelUtil { ...@@ -410,14 +434,13 @@ public class ExcelUtil {
}*/ }*/
List<T> list = new ArrayList<>(); List<T> list = new ArrayList<>();
Sheet sheet; Sheet sheet;
if(null == sheetName || sheetName.isEmpty()) { if (null == sheetName || sheetName.isEmpty()) {
sheet = workBook.getSheetAt(0); sheet = workBook.getSheetAt(0);
} } else {
else {
sheet = workBook.getSheet(sheetName); sheet = workBook.getSheet(sheetName);
} }
if(sheet == null) { if (sheet == null) {
return null; return null;
} }
...@@ -558,7 +581,6 @@ public class ExcelUtil { ...@@ -558,7 +581,6 @@ public class ExcelUtil {
/** /**
* 读取Excel的Header行, 并封装成Map<String, int) * 读取Excel的Header行, 并封装成Map<String, int)
* *
* @param inputStream excel输入流
* @param sheetName sheet名, 如默认只有一个sheet, 传入null * @param sheetName sheet名, 如默认只有一个sheet, 传入null
* @return Header Map, Key - 字段名, Value - index * @return Header Map, Key - 字段名, Value - index
* @throws RuntimeException * @throws RuntimeException
...@@ -574,17 +596,16 @@ public class ExcelUtil { ...@@ -574,17 +596,16 @@ public class ExcelUtil {
}*/ }*/
Sheet sheet; Sheet sheet;
if(null == sheetName || sheetName.isEmpty()) { if (null == sheetName || sheetName.isEmpty()) {
sheet = workBook.getSheetAt(0); sheet = workBook.getSheetAt(0);
} } else {
else {
sheet = workBook.getSheet(sheetName); sheet = workBook.getSheet(sheetName);
} }
if(sheet == null) { if (sheet == null) {
return null; return null;
} }
if(sheet.getFirstRowNum()<0) { if (sheet.getFirstRowNum() < 0) {
return titleMap; return titleMap;
} }
Row headerRow = sheet.getRow(sheet.getFirstRowNum()); Row headerRow = sheet.getRow(sheet.getFirstRowNum());
......
package pwc.taxtech.atms.vat.service.impl.report.functions; package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.poi.ss.formula.OperationEvaluationContext; import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.WorkbookEvaluator; import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.*; import org.apache.poi.ss.formula.eval.StringEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -18,7 +19,6 @@ import pwc.taxtech.atms.exception.FormulaException; ...@@ -18,7 +19,6 @@ import pwc.taxtech.atms.exception.FormulaException;
import pwc.taxtech.atms.vat.entity.PeriodCellData; import pwc.taxtech.atms.vat.entity.PeriodCellData;
import pwc.taxtech.atms.vat.entity.PeriodDataSource; import pwc.taxtech.atms.vat.entity.PeriodDataSource;
import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -76,14 +76,14 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -76,14 +76,14 @@ public class BB extends FunctionBase implements FreeRefFunction {
nullCellDto.fixedWithGroup(cellTemplateData); nullCellDto.fixedWithGroup(cellTemplateData);
// todo: fix datasource name by templateList(neo) // todo: fix datasource name by templateList(neo)
if (curPeriod.getCurPeriod() == -99) { if (bo.getPeriod().intValue() == 99) {
dataSource.clear(); dataSource.clear();
BigDecimal returnEval = defaultBigDecimal; BigDecimal returnEval = defaultBigDecimal;
if (formulaContext.getPeriod() <= 1) { if (formulaContext.getPeriod() <= 1) {
return defaultBigDecimal; return defaultBigDecimal;
} }
//如果是当年取到当期截至,往年取12期
for (int p = 1; p < formulaContext.getPeriod(); p++) { for (int p = 1; p < (curPeriod.getCurYear()==formulaContext.getYear()?formulaContext.getPeriod():12); p++) {
try { try {
returnEval = returnEval.add(bb(new BBParasBo(bo, p, curPeriod.getCurYear()), ec, dataSource, bo)); returnEval = returnEval.add(bb(new BBParasBo(bo, p, curPeriod.getCurYear()), ec, dataSource, bo));
} catch (Exception e) { } catch (Exception e) {
...@@ -94,7 +94,8 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -94,7 +94,8 @@ public class BB extends FunctionBase implements FreeRefFunction {
} }
return returnEval; return returnEval;
} else if (bo.getPeriod().intValue() == 0) { }
if (bo.getPeriod().intValue() == 0 && bo.getYear().intValue() == 0) {
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode()); int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
cellValue = getCellValue(index, ec, formulaContext, agent, bo.getRowIndex() - 1, bo.getColumnIndex() - 1, cellValue = getCellValue(index, ec, formulaContext, agent, bo.getRowIndex() - 1, bo.getColumnIndex() - 1,
Long.parseLong(cellTemplateData.getCellTemplateId())); Long.parseLong(cellTemplateData.getCellTemplateId()));
......
...@@ -11,7 +11,6 @@ import java.lang.annotation.Target; ...@@ -11,7 +11,6 @@ import java.lang.annotation.Target;
/** /**
* The <code>ExcelCell</code><br> * The <code>ExcelCell</code><br>
* 数值型的栏位只能使用Double * 数值型的栏位只能使用Double
* @see {@link pwc.taxtech.atms.thirdparty.sargeraswang.util.ExcelUtil.ExcelUtil#exportExcel}
* @author sargeras.wang * @author sargeras.wang
* @version 1.0, Created at 2013年9月14日 * @version 1.0, Created at 2013年9月14日
* @version 1.1, Updated at 2013年10月20日 ,添加了专用于验证的子注解:Valid * @version 1.1, Updated at 2013年10月20日 ,添加了专用于验证的子注解:Valid
...@@ -83,5 +82,14 @@ public @interface ExcelCell { ...@@ -83,5 +82,14 @@ public @interface ExcelCell {
* @return le * @return le
*/ */
double le() default Double.NaN; double le() default Double.NaN;
} }
/**
* 如果有状态 或 int类型转换为String
* 可通过此注解转换为String
* 格式: 中间用逗号 , 隔开
* 例 0:待审核,1:审核通过,-1:已拒绝
* @return
*/
String isStatus() default StringUtils.EMPTY;
} }
...@@ -147,7 +147,7 @@ public class FileTypes implements Serializable { ...@@ -147,7 +147,7 @@ public class FileTypes implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@ExcelCell(index=9) @ExcelCell(index=9,isStatus = "0:停用,1:启用")
private String status; private String status;
/** /**
......
...@@ -140,7 +140,7 @@ public class TaxDocument implements Serializable { ...@@ -140,7 +140,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@ExcelCell(index=9) @ExcelCell(index=10)
private Date effectiveTime; private Date effectiveTime;
/** /**
...@@ -152,7 +152,7 @@ public class TaxDocument implements Serializable { ...@@ -152,7 +152,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@ExcelCell(index=17) @ExcelCell(index=9)
private Integer ownTime; private Integer ownTime;
/** /**
...@@ -173,7 +173,7 @@ public class TaxDocument implements Serializable { ...@@ -173,7 +173,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@ExcelCell(index=10) @ExcelCell(index=16)
private String creator; private String creator;
/** /**
...@@ -183,7 +183,6 @@ public class TaxDocument implements Serializable { ...@@ -183,7 +183,6 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@ExcelCell(index=11)
private Date createTime; private Date createTime;
/** /**
...@@ -204,7 +203,7 @@ public class TaxDocument implements Serializable { ...@@ -204,7 +203,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@ExcelCell(index=12) @ExcelCell(index=15)
private Date uploadTime; private Date uploadTime;
/** /**
...@@ -249,6 +248,7 @@ public class TaxDocument implements Serializable { ...@@ -249,6 +248,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@ExcelCell(index=12)
private String physicalIndexNumber; private String physicalIndexNumber;
/** /**
...@@ -260,7 +260,7 @@ public class TaxDocument implements Serializable { ...@@ -260,7 +260,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@ExcelCell(index=15) @ExcelCell(index=17)
private String remark; private String remark;
/** /**
...@@ -283,7 +283,6 @@ public class TaxDocument implements Serializable { ...@@ -283,7 +283,6 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@ExcelCell(index=16)
private String filePositionUrl; private String filePositionUrl;
/** /**
...@@ -317,6 +316,7 @@ public class TaxDocument implements Serializable { ...@@ -317,6 +316,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
@ExcelCell(index=11,isStatus = "0:未审核,1:审核通过,-1:审核不通过")
private Integer auditStatus; private Integer auditStatus;
/** /**
......
...@@ -8,6 +8,7 @@ frameworkModule.controller('appUsrOperateLogController', ...@@ -8,6 +8,7 @@ frameworkModule.controller('appUsrOperateLogController',
// thisTitle:"@", // thisTitle:"@",
// thisParams:"=", // thisParams:"=",
$scope.localData = null; $scope.localData = null;
$scope.loadMainData = function () { $scope.loadMainData = function () {
$scope.thisModuleId = $scope.thisModuleId ? $scope.thisModuleId : []; $scope.thisModuleId = $scope.thisModuleId ? $scope.thisModuleId : [];
var config = { var config = {
...@@ -23,7 +24,17 @@ frameworkModule.controller('appUsrOperateLogController', ...@@ -23,7 +24,17 @@ frameworkModule.controller('appUsrOperateLogController',
$scope.dataGridUpdate(data); $scope.dataGridUpdate(data);
}) })
}; };
// $scope.sniffHelpPopRadio = function(){
// taxDocumentListService.getDocumentsAttrAndType({params: {}}).then(function (data) {
// $scope.FileAttrAndTypeCache = data.items;
// //根据文件属性来匹配出 文件类型下拉列表
// $scope.syncFileType($scope.editFieldModel.fileAttr);
// $scope.editFieldModel.fileType = checkedItem.getAttribute("data-fileType");
// $scope.syncRequiredFields($scope.editFieldModel);
// });
//
// $("#helpPopDialog").modal("hide");
// };
// comment: "767" // comment: "767"
// createTime: "2019-01-28T11:38:31.000+08:00" // createTime: "2019-01-28T11:38:31.000+08:00"
// id: "1" // id: "1"
...@@ -88,6 +99,19 @@ frameworkModule.controller('appUsrOperateLogController', ...@@ -88,6 +99,19 @@ frameworkModule.controller('appUsrOperateLogController',
dataField: "id", dataField: "id",
caption: $translate.instant('LogIndex'), caption: $translate.instant('LogIndex'),
allowHeaderFiltering: true, allowHeaderFiltering: true,
cellTemplate: function (container, options) {
var target = $('<span data-name="logCheckedItem" type="checkbox" ' +
'data-id="' + options.data.id + '" ' +
'>' + options.data.id + '</span>');
container.append(target);
var table = $("#appUsrLogTable").find("table");
$(table).off("click").on("click",function(e){
var target = $(e.target);
if(target.parents("tr").length)
target.parents("tr").find("td").toggleClass('log-export-checked-item');
})
}
}, },
{ {
dataField: "createTime", dataField: "createTime",
...@@ -173,8 +197,19 @@ frameworkModule.directive('usrLogExportPlugin',function(){ ...@@ -173,8 +197,19 @@ frameworkModule.directive('usrLogExportPlugin',function(){
function($scope,SweetAlert,$translate,usrOperateLogService,$q,$log){ function($scope,SweetAlert,$translate,usrOperateLogService,$q,$log){
$scope.exportTableData = function () $scope.exportTableData = function ()
{ {
var checkedItems = $(".log-export-checked-item");
usrOperateLogService[$scope.thisModuleName + "Export"]().then(function (data, status, headers) { var ids = [];
if(checkedItems.length)
checkedItems.find("span[data-name='logCheckedItem']")
.each(function(index,checkedItem){
var idLike = checkedItem.getAttribute('data-id');
if(idLike || idLike == 0){
ids.push(idLike);
}
});
usrOperateLogService[$scope.thisModuleName + "Export"]({
"ids":ids
}).then(function (data, status, headers) {
if(status===204){ if(status===204){
SweetAlert.warning("没有数据可以下载"); SweetAlert.warning("没有数据可以下载");
return; return;
......
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
.log-export-btn:hover{ .log-export-btn:hover{
background: #E6E6E6; background: #E6E6E6;
} }
/*事件样式,只发生在事件触发期间,用important影响不大*/
td.log-export-checked-item{
background: #337ab7 !important;
color: #fff !important;
}
</style> </style>
<button class="btn btn-not-important" ng-click="openUsrOperateLogPop()"><i class="material-icons">description</i><span translate="log">日志</span></button> <button class="btn btn-not-important" ng-click="openUsrOperateLogPop()"><i class="material-icons">description</i><span translate="log">日志</span></button>
<script type="text/html" id="usrOperateLogPopContainer"> <script type="text/html" id="usrOperateLogPopContainer">
...@@ -30,7 +36,7 @@ ...@@ -30,7 +36,7 @@
<!--</div>--> <!--</div>-->
<!--<div ui-grid="operateLogGridOptions" ui-grid-selection style="width:1140px; height:510px;margin:0px;"></div>--> <!--<div ui-grid="operateLogGridOptions" ui-grid-selection style="width:1140px; height:510px;margin:0px;"></div>-->
<div class="dx-viewport demo-container"> <div class="dx-viewport demo-container" id="appUsrLogTable">
<button class="btn log-export-btn" ng-click="exportTableData()"> <button class="btn log-export-btn" ng-click="exportTableData()">
<i class="fa fa-file-excel-o"></i> <i class="fa fa-file-excel-o"></i>
......
...@@ -12,22 +12,22 @@ frameworkModule.factory('usrOperateLogService', ...@@ -12,22 +12,22 @@ frameworkModule.factory('usrOperateLogService',
docManageListLog: function (params) { docManageListLog: function (params) {
return jqFetch.post(apiInterceptor.webApiHostUrl + '/operLogTaxDoc/selectListForLog', params); return jqFetch.post(apiInterceptor.webApiHostUrl + '/operLogTaxDoc/selectListForLog', params);
}, },
docManageListLogExport:function(){ docManageListLogExport:function(params){
$('#busy-indicator-container').show(); $('#busy-indicator-container').show();
return exportFn(apiInterceptor.webApiHostUrl + '/operLogTaxDoc/exportExcel'); return exportFn(apiInterceptor.webApiHostUrl + '/operLogTaxDoc/exportExcel',params);
}, },
docManageTypeLogExport:function(){ docManageTypeLogExport:function(params){
$('#busy-indicator-container').show(); $('#busy-indicator-container').show();
return exportFn(apiInterceptor.webApiHostUrl + '/operLogFileTypes/exportExcel'); return exportFn(apiInterceptor.webApiHostUrl + '/operLogFileTypes/exportExcel',params);
// http://etms.longi-silicon.com:8180//api/v1/operLogFileTypes/exportExcel // http://etms.longi-silicon.com:8180//api/v1/operLogFileTypes/exportExcel
} }
}; };
function exportFn(url) { function exportFn(url,params) {
var defer = $q.defer(); var defer = $q.defer();
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
...@@ -41,7 +41,7 @@ frameworkModule.factory('usrOperateLogService', ...@@ -41,7 +41,7 @@ frameworkModule.factory('usrOperateLogService',
xhr.setRequestHeader("Authorization", apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken()); xhr.setRequestHeader("Authorization", apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken());
xhr.setRequestHeader("Content-Type", 'application/json;charset=UTF-8'); xhr.setRequestHeader("Content-Type", 'application/json;charset=UTF-8');
xhr.responseType = "arraybuffer"; xhr.responseType = "arraybuffer";
xhr.send(); xhr.send(JSON.stringify(params));
return defer.promise; return defer.promise;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment