Commit d4f36128 authored by chase's avatar chase

merge 档案管理

parent db69dda1
......@@ -94,15 +94,15 @@ public class TaxDocumentController {
headers.put("CompanyName", "公司名称");
headers.put("TaxType", "税种");
headers.put("FileTime", "文件生效日期");
headers.put("EffectiveTime", "有效日期");
headers.put("Creator", "创建人");
headers.put("CreateTime", "创建时间");
headers.put("UploadTime", "上传日期");
headers.put("OwnTime", "所属期间");
headers.put("EffectiveTime", "到期日");
headers.put("AuditStatus", "审批状态");
headers.put("PhysicalIndexNumber", "实物索引号");
headers.put("StorageArea", "实物存放地点");
headers.put("Keeper", "保管人");
headers.put("UploadTime", "上传日期");
headers.put("Creator", "创建人");
headers.put("Remark", "档案备注");
headers.put("FilePositionUrl", "文件存储的位置");
headers.put("OwnTime", "所属期间");
List<TaxDocument> TaxDocument = taxDocumentService.selectTaxDocumentList(taxDocumentDto);
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + new String("taxDocument.xlsx".getBytes("GB2312"), "ISO-8859-1"));
......
......@@ -20,8 +20,8 @@ public class CurrentPeriodBo {
public static CurrentPeriodBo getPeriod(int parameterPeriod, int periodContent) {
int yearOffset = 0;
if (parameterPeriod == -99) {
return new CurrentPeriodBo(parameterPeriod);
if (parameterPeriod == 99) {
return new CurrentPeriodBo(periodContent);
} else if (parameterPeriod <= -1) {
Integer period = parameterPeriod + periodContent;
while (period <= 0) {
......
......@@ -474,8 +474,10 @@ public class TaxDocumentServiceImpl {
throw new RuntimeException("传入参数错误:空参数数组");
}
criteria.andIdIn(ids);
//查询出根据条件过滤后需要下载的附件数据信息
List<TaxDocument> taxDocuments = taxDocumentMapper.selectByExample(example);
//新建一个空集合,记录下载的名字,并用于判断是否重名,重名则修改名字为(n)
List<String> fileNameList = new ArrayList<>();
for (TaxDocument item : taxDocuments) {
//文件url
String urlPath = item.getFilePositionUrl();
......@@ -483,10 +485,23 @@ public class TaxDocumentServiceImpl {
if (StringUtils.isBlank(urlPath)) {
throw new RuntimeException("文件url为空,id为:" + item.getId());
}
//文件名称(带后缀) 文件名前+7位uuid截取码以防文件名相同
String fileName = StringUtils.isBlank(item.getFileName())
? "未知文件(请修改后缀名).xlsx"
: item.getFileName();
//检查文件名是否有重复
int fileNameRepeatTimes = 0;
if (fileNameList.size()>0){
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;
BufferedInputStream in = null;
byte[] buffer = new byte[1024];
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.WorkbookEvaluator;
import org.apache.poi.ss.formula.eval.*;
import org.apache.poi.ss.formula.eval.NumberEval;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -18,7 +19,6 @@ import pwc.taxtech.atms.exception.FormulaException;
import pwc.taxtech.atms.vat.entity.PeriodCellData;
import pwc.taxtech.atms.vat.entity.PeriodDataSource;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
......@@ -76,14 +76,14 @@ public class BB extends FunctionBase implements FreeRefFunction {
nullCellDto.fixedWithGroup(cellTemplateData);
// todo: fix datasource name by templateList(neo)
if (curPeriod.getCurPeriod() == -99) {
if (bo.getPeriod().intValue() == 99) {
dataSource.clear();
BigDecimal returnEval = defaultBigDecimal;
if (formulaContext.getPeriod() <= 1) {
return defaultBigDecimal;
}
for (int p = 1; p < formulaContext.getPeriod(); p++) {
//如果是当年取到当期截至,往年取12期
for (int p = 1; p < (curPeriod.getCurYear()==formulaContext.getYear()?formulaContext.getPeriod():12); p++) {
try {
returnEval = returnEval.add(bb(new BBParasBo(bo, p, curPeriod.getCurYear()), ec, dataSource, bo));
} catch (Exception e) {
......@@ -94,7 +94,8 @@ public class BB extends FunctionBase implements FreeRefFunction {
}
return returnEval;
} else if (bo.getPeriod().intValue() == 0) {
}
if (bo.getPeriod().intValue() == 0 && bo.getYear().intValue() == 0) {
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
cellValue = getCellValue(index, ec, formulaContext, agent, bo.getRowIndex() - 1, bo.getColumnIndex() - 1,
Long.parseLong(cellTemplateData.getCellTemplateId()));
......
......@@ -11,7 +11,6 @@ import java.lang.annotation.Target;
/**
* The <code>ExcelCell</code><br>
* 数值型的栏位只能使用Double
* @see {@link pwc.taxtech.atms.thirdparty.sargeraswang.util.ExcelUtil.ExcelUtil#exportExcel}
* @author sargeras.wang
* @version 1.0, Created at 2013年9月14日
* @version 1.1, Updated at 2013年10月20日 ,添加了专用于验证的子注解:Valid
......@@ -83,5 +82,14 @@ public @interface ExcelCell {
* @return le
*/
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 {
*
* @mbg.generated
*/
@ExcelCell(index=9)
@ExcelCell(index=9,isStatus = "0:停用,1:启用")
private String status;
/**
......
......@@ -140,7 +140,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=9)
@ExcelCell(index=10)
private Date effectiveTime;
/**
......@@ -152,7 +152,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=17)
@ExcelCell(index=9)
private Integer ownTime;
/**
......@@ -173,7 +173,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=10)
@ExcelCell(index=16)
private String creator;
/**
......@@ -183,7 +183,6 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=11)
private Date createTime;
/**
......@@ -204,7 +203,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=12)
@ExcelCell(index=15)
private Date uploadTime;
/**
......@@ -249,6 +248,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=12)
private String physicalIndexNumber;
/**
......@@ -260,7 +260,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=15)
@ExcelCell(index=17)
private String remark;
/**
......@@ -283,7 +283,6 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=16)
private String filePositionUrl;
/**
......@@ -317,6 +316,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=11,isStatus = "0:未审核,1:审核通过,-1:审核不通过")
private Integer auditStatus;
/**
......
......@@ -8,6 +8,7 @@ frameworkModule.controller('appUsrOperateLogController',
// thisTitle:"@",
// thisParams:"=",
$scope.localData = null;
$scope.loadMainData = function () {
$scope.thisModuleId = $scope.thisModuleId ? $scope.thisModuleId : [];
var config = {
......@@ -23,7 +24,17 @@ frameworkModule.controller('appUsrOperateLogController',
$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"
// createTime: "2019-01-28T11:38:31.000+08:00"
// id: "1"
......@@ -88,6 +99,19 @@ frameworkModule.controller('appUsrOperateLogController',
dataField: "id",
caption: $translate.instant('LogIndex'),
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",
......@@ -173,8 +197,19 @@ frameworkModule.directive('usrLogExportPlugin',function(){
function($scope,SweetAlert,$translate,usrOperateLogService,$q,$log){
$scope.exportTableData = function ()
{
usrOperateLogService[$scope.thisModuleName + "Export"]().then(function (data, status, headers) {
var checkedItems = $(".log-export-checked-item");
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){
SweetAlert.warning("没有数据可以下载");
return;
......
......@@ -10,6 +10,12 @@
.log-export-btn:hover{
background: #E6E6E6;
}
/*事件样式,只发生在事件触发期间,用important影响不大*/
td.log-export-checked-item{
background: #337ab7 !important;
color: #fff !important;
}
</style>
<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">
......@@ -30,7 +36,7 @@
<!--</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()">
<i class="fa fa-file-excel-o"></i>
......
......@@ -12,22 +12,22 @@ frameworkModule.factory('usrOperateLogService',
docManageListLog: function (params) {
return jqFetch.post(apiInterceptor.webApiHostUrl + '/operLogTaxDoc/selectListForLog', params);
},
docManageListLogExport:function(){
docManageListLogExport:function(params){
$('#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();
return exportFn(apiInterceptor.webApiHostUrl + '/operLogFileTypes/exportExcel');
return exportFn(apiInterceptor.webApiHostUrl + '/operLogFileTypes/exportExcel',params);
// http://etms.longi-silicon.com:8180//api/v1/operLogFileTypes/exportExcel
}
};
function exportFn(url) {
function exportFn(url,params) {
var defer = $q.defer();
var xhr = new XMLHttpRequest();
......@@ -41,7 +41,7 @@ frameworkModule.factory('usrOperateLogService',
xhr.setRequestHeader("Authorization", apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken());
xhr.setRequestHeader("Content-Type", 'application/json;charset=UTF-8');
xhr.responseType = "arraybuffer";
xhr.send();
xhr.send(JSON.stringify(params));
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