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();
......
......@@ -354,6 +354,21 @@
box-shadow: 0 0 12px #9e9e9e;
animation: showSweetAlert 0.3s;
}
/*页脚固定100px*/
.wrapper{
min-height: calc(100vh - 100px);
}
.page-footer{
height: 100px;
}
/* id="uploadResultPop"*/
.modal-dialog-stage{
color:#9999BB;
}
.modal-dialog-erroritems{
background-color: #F3F3F3;
color:#C53232;
}
</style>
<div class="menu-header TDL-header">
<div class="TDL-query-bar" ng-init="MoreFields = false">
......@@ -366,8 +381,9 @@
<select ng-model="queryFieldModel.fileAttr"
class="form-control radius3"
placeholder="{{'PleaseSelected' | translate}}">
<option ng-repeat="fileAttr in fileAttrOptions track by $index"
value="{{fileAttr}}">{{fileAttr}}
<option value=""></option>
<option ng-repeat="fileAttr in fileAttrOptions track by $index"
value="{{fileAttr}}">{{fileAttr}}
</option>
</select>
<!--<input type="text" class="form-control radius3"-->
......@@ -382,6 +398,7 @@
<select ng-model="queryFieldModel.fileType"
class="form-control radius3"
placeholder="{{'PleaseSelected' | translate}}">
<option value=""></option>
<option ng-repeat="fileType in fileTypeOptions track by $index" value="{{fileType}}">
{{fileType}}
</option>
......@@ -447,6 +464,7 @@
<select ng-model="queryFieldModel.businessLine"
class="form-control radius3"
placeholder="{{'PleaseSelected' | translate}}">
<option value=""></option>
<option ng-repeat="businessLine in businessLineOptions track by $index" value="{{businessLine.name}}">
{{businessLine.name}}
</option>
......@@ -464,7 +482,7 @@
title="{{queryFieldModel.companyName}}" required
ng-change="matchCompanyId(queryFieldModel,companyNameOptionsMap)"
placeholder="{{'PleaseSelected' | translate}}">
<option value=""></option>
<option ng-repeat="(key,companyName) in companyNameOptionsMap"
ng-slected="queryFieldModel.companyName == companyName"
value="{{companyName}}">{{companyName}}
......@@ -501,6 +519,7 @@
<select ng-model="queryFieldModel.taxType"
class="form-control radius3">
<option value=""></option>
<option ng-repeat="taxType in taxTypeSelects track by $index"
ng-selected="(queryFieldModel.taxType == taxType)"
value="{{taxType}}">{{taxType}}
......@@ -546,6 +565,7 @@
<select ng-model="queryFieldModel.auditStatus"
class="form-control radius3">
<option value=""></option>
<option ng-repeat="(code,val) in auditSelectsMap track by $index"
ng-selected="(queryFieldModel.auditStatus == code || queryFieldModel.auditStatus == val)"
value="{{code}}">{{val}}
......@@ -704,6 +724,7 @@
ng-change="syncFileType(editFieldModel.fileAttr)"
class="form-control"
required placeholder="{{'PleaseSelected' | translate}}">
<option value=""></option>
<option ng-repeat="fileAttr in fileAttrEnableOptions track by $index"
ng-selected="(editFieldModel.fileAttr == fileAttr)"
value="{{fileAttr}}">{{fileAttr}}
......@@ -727,6 +748,7 @@
title="{{editFieldModel.companyName}}" required
ng-change="matchCompanyId(editFieldModel,companyNameOptionsMap)"
placeholder="{{'PleaseSelected' | translate}}">
<option value=""></option>
<option ng-repeat="(key,companyName) in companyNameOptionsMap"
ng-selected="(editFieldModel.companyName == companyName)"
value="{{companyName}}">{{companyName}}
......@@ -745,6 +767,7 @@
class="form-control"
ng-change="syncRequiredFields(editFieldModel)"
required placeholder="{{'PleaseSelected' | translate}}">
<option value=""></option>
<option ng-repeat="fileType in curFileTypeOptions track by $index"
ng-selected="(editFieldModel.fileType == fileType)"
value="{{fileType}}">{{fileType}}
......@@ -767,6 +790,7 @@
class="form-control"
ng-required="isRequired('TaxType')"
placeholder="{{'PleaseSelected' | translate}}">
<option value=""></option>
<option ng-repeat="taxType in taxTypeSelects track by $index"
ng-selected="(editFieldModel.taxType == taxType)"
value="{{taxType}}">{{taxType}}
......@@ -943,6 +967,7 @@
ng-class="{'upload-fail-mark':!editFieldItem.fileAttr}"
ng-change="syncFileType(editFieldItem.fileAttr)"
class="form-control" placeholder="{{'PleaseSelected' | translate}}">
<option value=""></option>
<option ng-repeat="fileAttr in fileAttrOptions track by $index"
ng-selected="(editFieldItem.fileAttr == fileAttr)"
value="{{fileAttr}}">{{fileAttr}}
......@@ -966,7 +991,7 @@
ng-class="{'upload-fail-mark':!editFieldItem.companyName}"
ng-change="matchCompanyId(editFieldItem,companyNameOptionsMap)"
placeholder="{{'PleaseSelected' | translate}}">
<option value=""></option>
<option ng-repeat="(key,companyName) in companyNameOptionsMap"
ng-selected="(editFieldItem.companyName == companyName)"
value="{{companyName}}">{{companyName}}
......@@ -986,6 +1011,7 @@
class="form-control"
ng-class="{'upload-fail-mark':!editFieldItem.fileType}"
placeholder="{{'PleaseSelected' | translate}}">
<option value=""></option>
<option ng-repeat="fileType in curFileTypeOptions track by $index"
ng-selected="(editFieldItem.fileType == fileType)"
value="{{fileType}}">{{fileType}}
......@@ -1004,6 +1030,7 @@
ng-required="isRequired('TaxType')"
ng-class="{'upload-fail-mark':isRequired('TaxType') && !editFieldItem.taxType}"
placeholder="{{'PleaseSelected' | translate}}">
<option value=""></option>
<option ng-repeat="taxType in taxTypeSelects track by $index"
ng-selected="(editFieldItem.taxType == taxType)"
value="{{taxType}}">{{taxType}}
......@@ -1401,14 +1428,15 @@
<div class="modal-title" translate="Tips"></div>
</div>
<div class="modal-body">
<p ng-if="uploadResultSuccessList.length">{{uploadResultSuccessList.length}}{{'UploadSuccessCount'|translate}}</p>
<ul>
<p class="modal-dialog-stage" ng-if="uploadResultSuccessList.length">{{uploadResultSuccessList.length}}{{'UploadSuccessCount'|translate}}</p>
<ul >
<li ng-repeat="item in uploadResultSuccessList">
<span>{{item.fileName}}</span>
</li>
</ul>
<p class="text-danger" ng-if="multiUploadErrorItems.length">{{multiUploadErrorItems.length}}{{'UploadFailCount'|translate}}</p>
<ul class="text-danger">
<br ng-if="uploadResultSuccessList.length">
<p class="modal-dialog-stage" ng-if="multiUploadErrorItems.length">{{multiUploadErrorItems.length}}{{'UploadFailCount'|translate}}</p>
<ul class="modal-dialog-erroritems">
<li ng-repeat="item in multiUploadErrorItems">
<span>{{item.fileName}}</span>
</li>
......@@ -1416,7 +1444,7 @@
</div>
<div class="modal-footer">
<button class="btn btn-primary" translate="Confirm" ng-click="confirmUploadResult()"></button>
<!--<button type="button" class="btn btn-third" data-dismiss="modal" translate="Cancel"></button>-->
<button type="button" class="btn btn-third" ng-if="multiUploadErrorItems.length" data-dismiss="modal" translate="Cancel"></button>
</div>
</div>
</div>
......
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