Commit 525ff4e5 authored by chase's avatar chase

fix bug

parent 2aeee399
...@@ -37,7 +37,6 @@ public class TaxDocumentController { ...@@ -37,7 +37,6 @@ public class TaxDocumentController {
taxDocumentService.selectTaxDocumentList(taxDocumentDto); taxDocumentService.selectTaxDocumentList(taxDocumentDto);
PageInfo<TaxDocument> taxDocumentPageInfo = page.toPageInfo(); PageInfo<TaxDocument> taxDocumentPageInfo = page.toPageInfo();
List<TaxDocument> list = taxDocumentPageInfo.getList(); List<TaxDocument> list = taxDocumentPageInfo.getList();
return PageResultVo.getPageResultVo(taxDocumentPageInfo, list); return PageResultVo.getPageResultVo(taxDocumentPageInfo, list);
} }
...@@ -49,8 +48,8 @@ public class TaxDocumentController { ...@@ -49,8 +48,8 @@ public class TaxDocumentController {
@PostMapping("add") @PostMapping("add")
@ResponseBody @ResponseBody
public boolean addTaxDocument(@RequestBody TaxDocument taxDocument, public boolean addTaxDocument(TaxDocument taxDocument,
@RequestParam MultipartFile file) { @RequestParam("file") MultipartFile file) {
return taxDocumentService.addTaxDocumentList(file,taxDocument); return taxDocumentService.addTaxDocumentList(file,taxDocument);
} }
...@@ -72,7 +71,6 @@ public class TaxDocumentController { ...@@ -72,7 +71,6 @@ public class TaxDocumentController {
return taxDocumentService.editFilesType(taxDocument); return taxDocumentService.editFilesType(taxDocument);
} }
@RequestMapping("exportExcel") @RequestMapping("exportExcel")
@ResponseBody @ResponseBody
public void exportExcelFile(HttpServletResponse response, @RequestBody TaxDocumentDto taxDocumentDto) { public void exportExcelFile(HttpServletResponse response, @RequestBody TaxDocumentDto taxDocumentDto) {
...@@ -120,12 +118,12 @@ public class TaxDocumentController { ...@@ -120,12 +118,12 @@ public class TaxDocumentController {
/** /**
* 生成上传url * 生成上传url
* *
* @param picture * @param file
* @param modual * @param modual
* @return * @return
*/ */
private String getUploadUrl(MultipartFile picture, String modual) { private String getUploadUrl(MultipartFile file, String modual) {
String fileName = picture.getOriginalFilename(); String fileName = file.getOriginalFilename();
String pictureName = UUID.randomUUID().toString() + fileName.substring(fileName.lastIndexOf(".")); String pictureName = UUID.randomUUID().toString() + fileName.substring(fileName.lastIndexOf("."));
String dir = DateUtils.getStringDateShort(); String dir = DateUtils.getStringDateShort();
String typePath = ""; String typePath = "";
...@@ -141,7 +139,7 @@ public class TaxDocumentController { ...@@ -141,7 +139,7 @@ public class TaxDocumentController {
if (!basePath.exists()) { if (!basePath.exists()) {
basePath.mkdirs(); basePath.mkdirs();
} }
picture.transferTo(new File(fileSavePath + File.separator + typePath + File.separator + pictureName)); file.transferTo(new File(fileSavePath + File.separator + typePath + File.separator + pictureName));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -91,7 +91,7 @@ public class TaxDocumentServiceImpl { ...@@ -91,7 +91,7 @@ public class TaxDocumentServiceImpl {
} }
//档案名称 fileName //档案名称 fileName
if (StringUtils.isNotBlank(taxDocumentDto.getFileName())) { if (StringUtils.isNotBlank(taxDocumentDto.getFileName())) {
criteria.andFileNameLike(taxDocumentDto.getFileName()); criteria.andFileNameLike("%"+taxDocumentDto.getFileName()+"%");
} }
//业务线 businessLine //业务线 businessLine
if (StringUtils.isNotBlank(taxDocumentDto.getBusinessLine())) { if (StringUtils.isNotBlank(taxDocumentDto.getBusinessLine())) {
......
...@@ -231,7 +231,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -231,7 +231,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
$scope.isCreatePop = false; $scope.isCreatePop = false;
$scope.simpleUploadSubmit = editDocFileRecord; $scope.simpleUploadSubmit = editDocFileRecord;
$scope.localData.forEach(function (item) { $scope.localData.forEach(function (item) {
if (item.id === rowId) { if (item.id == rowId) {
$scope.editFieldModel = angular.copy(item); $scope.editFieldModel = angular.copy(item);
$scope.editFieldModel.ownTime = dateFormat(item.ownTime); $scope.editFieldModel.ownTime = dateFormat(item.ownTime);
$scope.editFieldModel.fileTime = dateFormat(item.fileTime); $scope.editFieldModel.fileTime = dateFormat(item.fileTime);
...@@ -285,7 +285,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -285,7 +285,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
$scope.uploader.uploadItem(0); $scope.uploader.uploadItem(0);
$scope.isCoverOperation = false; $scope.isCoverOperation = false;
$('#busy-indicator-container').show(); // $('#busy-indicator-container').show();
// addLogicAfterUploadFile($scope.editFieldModel,'simple'); // addLogicAfterUploadFile($scope.editFieldModel,'simple');
} else { } else {
SweetAlert.swal({ SweetAlert.swal({
...@@ -305,7 +305,7 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -305,7 +305,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
$scope.uploader.uploadItem(0); $scope.uploader.uploadItem(0);
// editDocFileRecord($scope.editFieldModel, 'simple'); // editDocFileRecord($scope.editFieldModel, 'simple');
$('#busy-indicator-container').show(); // $('#busy-indicator-container').show();
$scope.isCoverOperation = true; $scope.isCoverOperation = true;
} }
}) })
...@@ -530,27 +530,38 @@ taxDocumentManageModule.directive("multiDatePicker", function () { ...@@ -530,27 +530,38 @@ taxDocumentManageModule.directive("multiDatePicker", function () {
$('#period-picker1').rangePicker(setModel) $('#period-picker1').rangePicker(setModel)
.on('datePicker.done', function (e, result) { .on('datePicker.done', function (e, result) {
// $scope.queryFieldModel.AvailabilityDate // $scope.queryFieldModel.AvailabilityDate
$scope.queryFieldModel.fileBeginTime = result[0].reverse().join("-"); $scope.queryFieldModel.fileBeginTime = dateFormat(result[0].reverse());
$scope.queryFieldModel.fileEndTTime = result[1].reverse().join("-"); $scope.queryFieldModel.fileEndTTime = dateFormat(result[1].reverse());
}); });
$('#period-picker2').rangePicker(setModel) $('#period-picker2').rangePicker(setModel)
.on('datePicker.done', function (e, result) { .on('datePicker.done', function (e, result) {
// queryFieldModel.Duration // queryFieldModel.Duration
$scope.queryFieldModel.ownBeginTime = result[0].reverse().join("-"); $scope.queryFieldModel.ownBeginTime = dateFormat(result[0].reverse());
$scope.queryFieldModel.ownEndTime = result[1].reverse().join("-"); $scope.queryFieldModel.ownEndTime = dateFormat(result[1].reverse());
}); });
$('#period-picker3').rangePicker(setModel) $('#period-picker3').rangePicker(setModel)
.on('datePicker.done', function (e, result) { .on('datePicker.done', function (e, result) {
// queryFieldModel.DueDate // queryFieldModel.DueDate
$scope.queryFieldModel.effectiveBeginTime = result[0].reverse().join("-"); $scope.queryFieldModel.effectiveBeginTime = dateFormat(result[0].reverse());
$scope.queryFieldModel.effectiveEndTime = result[1].reverse().join("-"); $scope.queryFieldModel.effectiveEndTime = dateFormat(result[1].reverse());
}); });
$('#period-picker4').rangePicker(setModel) $('#period-picker4').rangePicker(setModel)
.on('datePicker.done', function (e, result) { .on('datePicker.done', function (e, result) {
// queryFieldModel.UploadDate // queryFieldModel.UploadDate
$scope.queryFieldModel.uploadBeginTime = result[0].reverse().join("-"); $scope.queryFieldModel.uploadBeginTime = dateFormat(result[0].reverse());
$scope.queryFieldModel.uploadEndTime = result[1].reverse().join("-"); $scope.queryFieldModel.uploadEndTime = dateFormat(result[1].reverse());
}); });
function dateFormat(dateArr){
var result = [];
dateArr.forEach(function(dateItem){
dateItem = dateItem + "";
dateItem = dateItem.length < 2 ? "0" + dateItem : dateItem;
result.push(dateItem);
});
//默认填充每月的1号
result.push("01");
return result.join("-");
}
}] }]
} }
...@@ -640,7 +651,11 @@ taxDocumentManageModule.directive('fileUploader',function () { ...@@ -640,7 +651,11 @@ taxDocumentManageModule.directive('fileUploader',function () {
$scope.uploader = new FileUploader({ $scope.uploader = new FileUploader({
url: apiInterceptor.webApiHostUrl + "/taxDoc/add", url: apiInterceptor.webApiHostUrl + "/taxDoc/add",
// autoUpload: true,//添加后,自动上传 // autoUpload: true,//添加后,自动上传
headers:{"Authorization":apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken()}, headers:{
'Access-Control-Allow-Origin': '*',
Authorization: apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken(),
withCredentials: true
},
removeAfterUpload:true, removeAfterUpload:true,
}); });
$scope.uploader.filters.push({//xls限制 $scope.uploader.filters.push({//xls限制
...@@ -666,7 +681,7 @@ taxDocumentManageModule.directive('fileUploader',function () { ...@@ -666,7 +681,7 @@ taxDocumentManageModule.directive('fileUploader',function () {
// $scope.uploader.clearQueue(); // $scope.uploader.clearQueue();
$scope.editFieldModel = {}; $scope.editFieldModel = {};
$('#busy-indicator-container').hide(); // $('#busy-indicator-container').hide();
}; };
// $scope.uploader.onCancelItem = function(fileItem, response, status, headers) { // $scope.uploader.onCancelItem = function(fileItem, response, status, headers) {
// console.info('onCancelItem', fileItem, response, status, headers); // console.info('onCancelItem', fileItem, response, status, headers);
...@@ -1073,4 +1088,70 @@ taxDocumentManageModule.directive('pdfPreview',function(){ ...@@ -1073,4 +1088,70 @@ taxDocumentManageModule.directive('pdfPreview',function(){
}] }]
} }
});
taxDocumentManageModule.directive('helpPop',function(){
return{
restrict:'EA',
controller:['$scope','taxDocumentListService','$translate','$compile',
function($scope,taxDocumentListService,$translate,$compile){
$scope.openHelpPop = function(){
$scope.help_loadData();
};
$scope.help_cacheData = {};
$scope.help_loadData = function () {
taxDocumentListService.getDocumentsAttrAndType({params:{}}).then(function (data) {
$scope.help_dataGridUpdate(data);
var dataGrid = $('<div dx-data-grid="help_dataGridOptions">');
$("#helpPopContainer").html("").append(dataGrid);
$compile(dataGrid)($scope);
$("#helpPopDialog").modal("show");
})
};
$scope.help_dataGridUpdate = function (_data) {
$scope.help_cacheData = _data.items;
$scope.help_dataGridOptions = {
bindingOptions: {
dataSource: 'help_cacheData',
},
paging: {
enable: true,
pageIndex: 0,
pageSize: 10
},
pager: {
allowedPageSizes: 5,
infoText: "当前 {0} / {1} ({2} )",
showInfo: true,
showNavigationButtons: true,
showPageSizeSelector: true,
visible: true
},
showBorders: true,
showRowLines: true,
columnAutoWidth: true,
allowColumnReordering: true,
columns: [
{
dataField: "fileAttr",
caption: $translate.instant('DocumentAttr'),
},
{
dataField: "fileType",
caption: $translate.instant('DocumentType'),
},
{
dataField: "description",
caption: $translate.instant('Description'),
},
],
};
};
}]
}
}); });
\ No newline at end of file
...@@ -27,6 +27,9 @@ taxDocumentManageModule.factory('taxDocumentListService', ...@@ -27,6 +27,9 @@ taxDocumentManageModule.factory('taxDocumentListService',
delFileRecordItems: function (params) { delFileRecordItems: function (params) {
return jqFetch.post(apiInterceptor.webApiHostUrl + '/taxDoc/batchDelete', params); return jqFetch.post(apiInterceptor.webApiHostUrl + '/taxDoc/batchDelete', params);
}, },
getDocumentsAttrAndType:function(params){
return jqFetch.post(apiInterceptor.webApiHostUrl + '/fileTypes/selectList', params);
},
getBinaryData: function (url) { getBinaryData: function (url) {
var defer = $q.defer(); var defer = $q.defer();
var oReq = new XMLHttpRequest(); var oReq = new XMLHttpRequest();
......
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