Commit 462f5307 authored by chase's avatar chase

merge 档案管理

parent fbc42d8b
......@@ -15,6 +15,7 @@ import pwc.taxtech.atms.entity.OperationLogFileType;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 查询
......@@ -99,7 +100,7 @@ public class FileTypesServiceImpl {
criteria.andFileTypeEqualTo(fileTypes.getFileType());
}
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());
}
}
......@@ -129,30 +130,25 @@ public class FileTypesServiceImpl {
@Transactional
public boolean editFilesType(FileTypes fileTypes) {
try {
//检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
checkFileType(fileTypes);
//对必填字段进行转换成json对象
requiredFieldFormatToJson(fileTypes);
fileTypes.setUpdateTime(new Date());
int num = fileTypesMapper.updateByPrimaryKey(fileTypes);
if (num > 0) {
OperationLogFileType actionEntity = buildOperationLogFileType();
actionEntity.setOperationAction("更新");
actionEntity.setId(fileTypes.getId().toString());
//设置更新值
actionEntity.setUpdateState(fileTypes.toString());
boolean result = operationLogFileTypeService.addFileTypesList(actionEntity);
if (result) {
return true;
} else {
throw new RuntimeException("FileTypesServiceImpl editFilesType log error");
}
//检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
checkFileType(fileTypes);
//对必填字段进行转换成json对象
requiredFieldFormatToJson(fileTypes);
fileTypes.setUpdateTime(new Date());
int num = fileTypesMapper.updateByPrimaryKey(fileTypes);
if (num > 0) {
OperationLogFileType actionEntity = buildOperationLogFileType();
actionEntity.setOperationAction("更新");
actionEntity.setId(fileTypes.getId().toString());
//设置更新值
actionEntity.setUpdateState(fileTypes.toString());
boolean result = operationLogFileTypeService.addFileTypesList(actionEntity);
if (result) {
return true;
} else {
return false;
throw new RuntimeException("FileTypesServiceImpl editFilesType log error");
}
} catch (Exception e) {
log.error("FileTypesServiceImpl editFilesType error : " + e.getMessage());
} else {
return false;
}
}
......
......@@ -237,7 +237,8 @@ grunt.initConfig({
"Scripts/viewer/viewer.js",
"Scripts/xlsx/shim.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'
},
......
(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 @@
};
$scope.dataGridUpdate = function (_data) {
$scope.localData = _data.items;
$scope.queryStatusType($scope.localData);
$scope.pagingOptions = {
totalItems: $scope.localData.length, //总数据
......@@ -328,6 +327,9 @@
} else {
SweetAlert.warning($translate.instant('SaveFail'));
}
if(data.code==-1){
SweetAlert.warning($translate.instant(data.message));
}
});
$('#editPopDialog').modal('hide');
};
......
......@@ -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"));
return;
}
......
......@@ -354,20 +354,26 @@ taxDocumentManageModule.controller('taxDocumentListController',
}
};
$scope.changeFieldModel = function () {
$scope.changeFieldModel=function(){
//新建记录
items = $scope.editFieldModel;
var items=$scope.editFieldModel;
if (!PWC.isNullOrEmpty(items.fileTime) && !PWC.isNullOrEmpty(items.effectiveTime) &&
items.fileTime > items.effectiveTime) {
items.fileTime > items.effectiveTime)
{
SweetAlert.warning($translate.instant('FileTimeDateRangeError'));
}
};
$scope.changeFieldItem = function () {
//批量上传
items = $scope.editFieldItem;
if (!PWC.isNullOrEmpty(items.fileTime) && !PWC.isNullOrEmpty(items.effectiveTime) &&
items.fileTime > items.effectiveTime) {
SweetAlert.warning($translate.instant('FileTimeDateRangeError'));
if($scope.multiUploadErrorItems){
for (var i = 0; i < $scope.multiUploadErrorItems.length; i++) {
var modelItem = $scope.multiUploadErrorItems[i];
if (!PWC.isNullOrEmpty(modelItem.fileTime) && !PWC.isNullOrEmpty(modelItem.effectiveTime) &&
modelItem.fileTime > modelItem.effectiveTime) {
SweetAlert.warning($translate.instant("Document") + (i + 1) + "," +$translate.instant('FileTimeDateRangeError'));
break;
}
}
}
};
//弹出框
......
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