Commit 07b735d8 authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents 74b9352c d4f36128
...@@ -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];
......
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;
} }
......
...@@ -1610,11 +1610,15 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1610,11 +1610,15 @@ taxDocumentManageModule.directive('tempModule', function () {
} }
}); });
taxDocumentListService.getCompanyNameOptions().then(function (data) { taxDocumentListService.getCompanyNameOptions().then(function(res){
// console.log(data); if (res && 0 === res.code) {
if (data) { angular.forEach(res.data, function (item) {
$scope.companyNameOptionsMap = data; $scope.companyNameOptionsMap[item.id]=item.name;
});
} else {
SweetAlert.error($translate.instant('RevenueGetOrgError'));
} }
}); });
}; };
$scope.loadSelectMap(); $scope.loadSelectMap();
......
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