Commit 46cc61a9 authored by kevin's avatar kevin

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

parents 4682980b 40a16a73
...@@ -15,6 +15,7 @@ import pwc.taxtech.atms.entity.OperationLogFileType; ...@@ -15,6 +15,7 @@ import pwc.taxtech.atms.entity.OperationLogFileType;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 查询 * 查询
...@@ -99,7 +100,7 @@ public class FileTypesServiceImpl { ...@@ -99,7 +100,7 @@ public class FileTypesServiceImpl {
criteria.andFileTypeEqualTo(fileTypes.getFileType()); criteria.andFileTypeEqualTo(fileTypes.getFileType());
} }
List<FileTypes> results = fileTypesMapper.selectByExample(example); List<FileTypes> results = fileTypesMapper.selectByExample(example);
if (results.size() > 0) { if (results.size() > 0 && !results.stream().map(e->e.getId()).collect(Collectors.toList()).contains(fileTypes.getId())) {
throw new RuntimeException("filetype已存在: " + fileTypes.getFileType()); throw new RuntimeException("filetype已存在: " + fileTypes.getFileType());
} }
} }
...@@ -129,7 +130,6 @@ public class FileTypesServiceImpl { ...@@ -129,7 +130,6 @@ public class FileTypesServiceImpl {
@Transactional @Transactional
public boolean editFilesType(FileTypes fileTypes) { public boolean editFilesType(FileTypes fileTypes) {
try {
//检测添加类型是否已存在,存在则返回false先(后期改进为多异常) //检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
checkFileType(fileTypes); checkFileType(fileTypes);
//对必填字段进行转换成json对象 //对必填字段进行转换成json对象
...@@ -151,10 +151,6 @@ public class FileTypesServiceImpl { ...@@ -151,10 +151,6 @@ public class FileTypesServiceImpl {
} else { } else {
return false; return false;
} }
} catch (Exception e) {
log.error("FileTypesServiceImpl editFilesType error : " + e.getMessage());
return false;
}
} }
/** /**
......
...@@ -237,7 +237,8 @@ grunt.initConfig({ ...@@ -237,7 +237,8 @@ grunt.initConfig({
"Scripts/viewer/viewer.js", "Scripts/viewer/viewer.js",
"Scripts/xlsx/shim.min.js", "Scripts/xlsx/shim.min.js",
"Scripts/xlsx/xlsx.full.min.js", "Scripts/xlsx/xlsx.full.min.js",
"Scripts/position-calculator/position-calculator.min.js" "Scripts/position-calculator/position-calculator.min.js",
"Scripts/bootstrp-confirm/bootstrap-confirm.js"
], ],
dest: '<%= pkg.bundleTemp %>/util.js' dest: '<%= pkg.bundleTemp %>/util.js'
}, },
......
(function ($) {
window.Ewin = function () {
var html = '<div id="[Id]" class="modal fade" role="dialog" aria-labelledby="modalLabel">' +
'<div class="modal-dialog modal-sm">' +
'<div class="modal-content">' +
'<div class="modal-header">' +
'<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>' +
'<h4 class="modal-title" id="modalLabel">[Title]</h4>' +
'</div>' +
'<div class="modal-body">' +
'<p>[Message]</p>' +
'</div>' +
'<div class="modal-footer">' +
'<button type="button" class="btn btn-default cancel" data-dismiss="modal">[BtnCancel]</button>' +
'<button type="button" class="btn btn-primary ok" data-dismiss="modal">[BtnOk]</button>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
var dialogdHtml = '<div id="[Id]" class="modal fade" role="dialog" aria-labelledby="modalLabel">' +
'<div class="modal-dialog">' +
'<div class="modal-content">' +
'<div class="modal-header">' +
'<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>' +
'<h4 class="modal-title" id="modalLabel">[Title]</h4>' +
'</div>' +
'<div class="modal-body">' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
var reg = new RegExp("\\[([^\\[\\]]*?)\\]", 'igm');
var generateId = function () {
var date = new Date();
return 'mdl' + date.valueOf();
}
var init = function (options) {
options = $.extend({}, {
title: "操作提示",
message: "提示内容",
btnok: "确定",
btncl: "取消",
width: 200,
auto: false
}, options || {});
var modalId = generateId();
var content = html.replace(reg, function (node, key) {
return {
Id: modalId,
Title: options.title,
Message: options.message,
BtnOk: options.btnok,
BtnCancel: options.btncl
}[key];
});
$('body').append(content);
$('#' + modalId).modal({
width: options.width,
backdrop: 'static'
});
$('#' + modalId).on('hide.bs.modal', function (e) {
$('body').find('#' + modalId).remove();
});
return modalId;
}
return {
alert: function (options) {
if (typeof options == 'string') {
options = {
message: options
};
}
var id = init(options);
var modal = $('#' + id);
modal.find('.ok').removeClass('btn-success').addClass('btn-primary');
modal.find('.cancel').hide();
return {
id: id,
on: function (callback) {
if (callback && callback instanceof Function) {
modal.find('.ok').click(function () { callback(true); });
}
},
hide: function (callback) {
if (callback && callback instanceof Function) {
modal.on('hide.bs.modal', function (e) {
callback(e);
});
}
}
};
},
confirm: function (options) {
var id = init(options);
var modal = $('#' + id);
modal.find('.ok').removeClass('btn-primary').addClass('btn-success');
modal.find('.cancel').show();
return {
id: id,
on: function (callback) {
if (callback && callback instanceof Function) {
modal.find('.ok').click(function () { callback(true); });
modal.find('.cancel').click(function () { callback(false); });
}
},
hide: function (callback) {
if (callback && callback instanceof Function) {
modal.on('hide.bs.modal', function (e) {
callback(e);
});
}
}
};
},
dialog: function (options) {
options = $.extend({}, {
title: 'title',
url: '',
width: 800,
height: 550,
onReady: function () { },
onShown: function (e) { }
}, options || {});
var modalId = generateId();
var content = dialogdHtml.replace(reg, function (node, key) {
return {
Id: modalId,
Title: options.title
}[key];
});
$('body').append(content);
var target = $('#' + modalId);
target.find('.modal-body').load(options.url);
if (options.onReady())
options.onReady.call(target);
target.modal();
target.on('shown.bs.modal', function (e) {
if (options.onReady(e))
options.onReady.call(target, e);
});
target.on('hide.bs.modal', function (e) {
$('body').find(target).remove();
});
}
}
}();
})(jQuery);
\ No newline at end of file
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
}; };
$scope.dataGridUpdate = function (_data) { $scope.dataGridUpdate = function (_data) {
$scope.localData = _data.items; $scope.localData = _data.items;
$scope.queryStatusType($scope.localData); $scope.queryStatusType($scope.localData);
$scope.pagingOptions = { $scope.pagingOptions = {
totalItems: $scope.localData.length, //总数据 totalItems: $scope.localData.length, //总数据
...@@ -328,6 +327,9 @@ ...@@ -328,6 +327,9 @@
} else { } else {
SweetAlert.warning($translate.instant('SaveFail')); SweetAlert.warning($translate.instant('SaveFail'));
} }
if(data.code==-1){
SweetAlert.warning($translate.instant(data.message));
}
}); });
$('#editPopDialog').modal('hide'); $('#editPopDialog').modal('hide');
}; };
......
...@@ -2159,6 +2159,7 @@ ...@@ -2159,6 +2159,7 @@
}; };
// 取消编辑机构其他信息 // 取消编辑机构其他信息
// TODO 将这个方法添加到切换功能里
$scope.updateOrgExtraCancel = function () { $scope.updateOrgExtraCancel = function () {
$scope.selectCompanyExtra = $scope.comExtraOldData; $scope.selectCompanyExtra = $scope.comExtraOldData;
$scope.editOrgExtraModel = $scope.editOldData; $scope.editOrgExtraModel = $scope.editOldData;
...@@ -2397,6 +2398,8 @@ ...@@ -2397,6 +2398,8 @@
// 选中机构 // 选中机构
$scope.selectOrganization = function (branch) { $scope.selectOrganization = function (branch) {
var org = branch.data; var org = branch.data;
$scope.output = "You selected: " + org.id; $scope.output = "You selected: " + org.id;
...@@ -2446,6 +2449,8 @@ ...@@ -2446,6 +2449,8 @@
loadUserRoleList(org.id); loadUserRoleList(org.id);
generalSelectCompanyText(); generalSelectCompanyText();
cancelWebChange(); cancelWebChange();
$scope.updateOrgExtraCancel()
}); });
......
...@@ -19,7 +19,7 @@ frameworkModule.controller('appUsrOperateLogController', ...@@ -19,7 +19,7 @@ frameworkModule.controller('appUsrOperateLogController',
} }
}); });
} }
if($scope.thisModuleId.length===0){ if($("body[ng-controller='AppController']").length==1 && $scope.thisModuleId.length===0){
SweetAlert.warning($translate.instant("NeedChecked")); SweetAlert.warning($translate.instant("NeedChecked"));
return; return;
} }
......
...@@ -478,16 +478,18 @@ ...@@ -478,16 +478,18 @@
<span translate="CorporationName"></span> <span translate="CorporationName"></span>
</div> </div>
<div class="TDL-query-val"> <div class="TDL-query-val">
<select ng-model="queryFieldModel.companyName" class="form-control radius3" <div dx-select-box="queryOrgOptions"></div>
title="{{queryFieldModel.companyName}}" required
ng-change="matchCompanyId(queryFieldModel,companyNameOptionsMap)" <!--<select ng-model="queryFieldModel.companyName" class="form-control radius3"-->
placeholder="{{'PleaseSelected' | translate}}"> <!--title="{{queryFieldModel.companyName}}" required-->
<option value=""></option> <!--ng-change="matchCompanyId(queryFieldModel,companyNameOptionsMap)"-->
<option ng-repeat="(key,companyName) in companyNameOptionsMap" <!--placeholder="{{'PleaseSelected' | translate}}">-->
ng-slected="queryFieldModel.companyName == companyName" <!--<option value=""></option>-->
value="{{companyName}}">{{companyName}} <!--<option ng-repeat="(key,companyName) in companyNameOptionsMap"-->
</option> <!--ng-slected="queryFieldModel.companyName == companyName"-->
</select> <!--value="{{companyName}}">{{companyName}}-->
<!--</option>-->
<!--</select>-->
</div> </div>
</div> </div>
<div class="TDL-query-block"> <div class="TDL-query-block">
...@@ -744,16 +746,18 @@ ...@@ -744,16 +746,18 @@
{{'CorporationName' | translate}} {{'CorporationName' | translate}}
</label> </label>
<div class="col-sm-11" style="width:61.67%" id="companyNameOptionsMap"> <div class="col-sm-11" style="width:61.67%" id="companyNameOptionsMap">
<select ng-model="editFieldModel.companyName" class="form-control" <div dx-select-box="editOrgOptions"></div>
title="{{editFieldModel.companyName}}" required
ng-change="matchCompanyId(editFieldModel,companyNameOptionsMap)" <!--<select ng-model="editFieldModel.companyName" class="form-control"-->
placeholder="{{'PleaseSelected' | translate}}"> <!--title="{{editFieldModel.companyName}}" required-->
<option value=""></option> <!--ng-change="matchCompanyId(editFieldModel,companyNameOptionsMap)"-->
<option ng-repeat="(key,companyName) in companyNameOptionsMap" <!--placeholder="{{'PleaseSelected' | translate}}">-->
ng-selected="(editFieldModel.companyName == companyName)" <!--<option value=""></option>-->
value="{{companyName}}">{{companyName}} <!--<option ng-repeat="(key,companyName) in companyNameOptionsMap"-->
</option> <!--ng-selected="(editFieldModel.companyName == companyName)"-->
</select> <!--value="{{companyName}}">{{companyName}}-->
<!--</option>-->
<!--</select>-->
</div> </div>
</div> </div>
<div class="col-sm-6 form-group"> <div class="col-sm-6 form-group">
...@@ -986,17 +990,19 @@ ...@@ -986,17 +990,19 @@
{{'CorporationName' | translate}} {{'CorporationName' | translate}}
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<select ng-model="editFieldItem.companyName" class="form-control" <div dx-select-box="editFieldItemOrgOptions"></div>
title="{{editFieldItem.companyName}}"
ng-class="{'upload-fail-mark':!editFieldItem.companyName}" <!--<select ng-model="editFieldItem.companyName" class="form-control"-->
ng-change="matchCompanyId(editFieldItem,companyNameOptionsMap)" <!--title="{{editFieldItem.companyName}}"-->
placeholder="{{'PleaseSelected' | translate}}"> <!--ng-class="{'upload-fail-mark':!editFieldItem.companyName}"-->
<option value=""></option> <!--ng-change="matchCompanyId(editFieldItem,companyNameOptionsMap)"-->
<option ng-repeat="(key,companyName) in companyNameOptionsMap" <!--placeholder="{{'PleaseSelected' | translate}}">-->
ng-selected="(editFieldItem.companyName == companyName)" <!--<option value=""></option>-->
value="{{companyName}}">{{companyName}} <!--<option ng-repeat="(key,companyName) in companyNameOptionsMap"-->
</option> <!--ng-selected="(editFieldItem.companyName == companyName)"-->
</select> <!--value="{{companyName}}">{{companyName}}-->
<!--</option>-->
<!--</select>-->
</div> </div>
</div> </div>
<div class="col-sm-6 form-group"> <div class="col-sm-6 form-group">
...@@ -1398,28 +1404,13 @@ ...@@ -1398,28 +1404,13 @@
</div> </div>
</div>--> </div>-->
<div class="modal fade" id="filePreviewPop" file-preview tabindex="-1" role="dialog" aria-labelledby="myModal"
data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width:80%;" role="document">
<div class="modal-content">
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideFilePreviewPop()">×</span>
<div class="modal-title">{{currentSheetName}}</div>
</div>
<div class="modal-body">
<div class="dx-viewport demo-container" id="preview_dataGrid">
</div>
</div>
<div class="TDL-pdf-layout-dialog" id="filePreviewPop" file-preview >
<div class="wrapper TDL-pdf-preview-pop" id="excetlContainer">
</div> </div>
<button class="TDL-pdf-preview-pop-close-btn" ng-click="hideFilePreviewPop()">×</button>
<button class="TDL-pdf-paging-btn TDL-pdf-paging-btn-prev" ng-click="prevPaging_xls()" title="上一页">&lt;
</button>
<button class="TDL-pdf-paging-btn TDL-pdf-paging-btn-next" ng-click="nextPaging_xls()" title="下一页">&gt;
</button>
</div> </div>
</div>
<div class="modal fade" id="uploadResultPop" tabindex="-1" role="dialog" aria-labelledby="myModal" <div class="modal fade" id="uploadResultPop" tabindex="-1" role="dialog" aria-labelledby="myModal"
data-backdrop="static" data-keyboard="false"> data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width:60%;max-width:960px" role="document"> <div class="modal-dialog" style="width:60%;max-width:960px" role="document">
......
...@@ -165,6 +165,33 @@ taxDocumentManageModule.factory('taxDocumentListService', ...@@ -165,6 +165,33 @@ taxDocumentManageModule.factory('taxDocumentListService',
xhr.send(JSON.stringify(params)); xhr.send(JSON.stringify(params));
return defer.promise; return defer.promise;
},
viewExcelBySpread:function (url) {
var deferred = $q.defer();
var promise = deferred.promise;
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true); // 也可以使用POST方式,根据接口
xhr.responseType = "blob"; // 返回类型blob
// 定义请求完成的处理函数,请求前也可以增加加载框/禁用下载按钮逻辑
xhr.onload = function () {
// 请求完成
if (this.status === 200) {
// 返回200
var blob = this.response;
var excelIo = new GC.Spread.Excel.IO();
excelIo.open(blob, function (json) {
deferred.resolve(json);
}, function (e) {
// console.error(e.errorMessage);
//alert(e.errorMessage);
deferred.reject(e.errorMessage);
}, {});
}
};
// 发送ajax请求
xhr.send();
return promise;
} }
}; };
}]); }]);
\ No newline at end of file
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