Commit 0e53c287 authored by chase's avatar chase

merge 档案管理

parent 22730fee
......@@ -61,7 +61,7 @@ public class FileTypesController {
@ResponseBody
public Map<String,String> query4SelectionBox(){
List<FileTypes> fileTypes = fileTypesService.query4SelectionBox();
Map<String,String> result = fileTypes.stream().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
Map<String,String> result = fileTypes.stream().distinct().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
return result;
}
......@@ -73,7 +73,7 @@ public class FileTypesController {
@ResponseBody
public Map<String,String> query4SelectionBoxEnable(){
List<FileTypes> fileTypes = fileTypesService.query4SelectionBoxEnable();
Map<String,String> result = fileTypes.stream().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
Map<String,String> result = fileTypes.stream().distinct().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
return result;
}
......
......@@ -2,6 +2,7 @@ package pwc.taxtech.atms.service.impl;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -45,6 +46,7 @@ public class FileTypesServiceImpl {
/**
* 查询档案属性和档案类型给前端下拉选择框
*
* @return
*/
public List<FileTypes> query4SelectionBox() {
......@@ -54,6 +56,8 @@ public class FileTypesServiceImpl {
@Transactional
public boolean addFileTypesList(FileTypes fileTypes) {
try {
//检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
checkFileType(fileTypes);
//对必填字段进行转换成json对象
requiredFieldFormatToJson(fileTypes);
//设置当前时间 当前创建人信息
......@@ -77,11 +81,29 @@ public class FileTypesServiceImpl {
return false;
}
} catch (Exception e) {
// log.error("FileTypesServiceImpl addFileTypesList error : " + e.getMessage());
log.error("FileTypesServiceImpl addFileTypesList error : " + e.getMessage());
return false;
}
}
/**
* //检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
*
* @param fileTypes
* @return
*/
private void checkFileType(FileTypes fileTypes) {
FileTypesExample example = new FileTypesExample();
FileTypesExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(fileTypes.getFileType())) {
criteria.andFileTypeEqualTo(fileTypes.getFileType());
}
List<FileTypes> results = fileTypesMapper.selectByExample(example);
if (results.size() > 0) {
throw new RuntimeException("filetype已存在: " + fileTypes.getFileType());
}
}
@Transactional
public boolean deleteFileTypes(Long id) {
try {
......@@ -100,7 +122,7 @@ public class FileTypesServiceImpl {
return false;
}
} catch (Exception e) {
// log.error("FileTypesServiceImpl deleteFileTypes error : " + e.getMessage());
log.error("FileTypesServiceImpl deleteFileTypes error : " + e.getMessage());
return false;
}
}
......@@ -108,6 +130,8 @@ public class FileTypesServiceImpl {
@Transactional
public boolean editFilesType(FileTypes fileTypes) {
try {
//检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
checkFileType(fileTypes);
//对必填字段进行转换成json对象
requiredFieldFormatToJson(fileTypes);
fileTypes.setUpdateTime(new Date());
......@@ -128,7 +152,7 @@ public class FileTypesServiceImpl {
return false;
}
} catch (Exception e) {
// log.error("FileTypesServiceImpl editFilesType error : " + e.getMessage());
log.error("FileTypesServiceImpl editFilesType error : " + e.getMessage());
return false;
}
}
......@@ -160,6 +184,7 @@ public class FileTypesServiceImpl {
fileTypes.setRequiredFieldJson(requiredFieldJson);
}
}
public List<FileTypes> query4SelectionBoxEnable() {
return fileTypesMapper.query4SelectionBoxEnable();
}
......
......@@ -275,6 +275,20 @@ taxDocumentManageModule.controller('taxDocumentListController',
},
],
onCellClick: function (e) {
//单元格点击— e.columnIndex=0 排除复选框列
if(e.columnIndex>0 && e.data){
$("input[name='dataGridCheckBox']").each(function (index, item) {
if((item.dataset) && (item.dataset.id==e.data.id)){
if(item.checked){
item.checked=false;
}else{
item.checked=true;
}
}
});
}
}
};
$scope.getTableHeight=function(){
var row_height=$("table").find("tr").height();
......@@ -952,7 +966,12 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
if($scope.multiUploadErrorItems.length
|| $scope.uploadResultSuccessList.length)
$("#uploadResultPop").modal("show");
$scope.FileItem.isSuccess=true;//文件上传成功标识
//是否都上传成功
if($scope.multiUploadErrorItems.length>0){
$scope.FileItem.isSuccess=false;
}else{
$scope.FileItem.isSuccess=true;
}
$('#busy-indicator-container').hide();
$scope.loadMainData();
......
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