Commit 9d2c06f1 authored by chase's avatar chase

merge 档案管理

parent 31d2d014
...@@ -65,6 +65,18 @@ public class FileTypesController { ...@@ -65,6 +65,18 @@ public class FileTypesController {
return result; return result;
} }
/**
* 查询档案属性和档案类型给前端下拉选择框(可用)
* @return
*/
@PostMapping("/query4SelectionBoxEnable")
@ResponseBody
public Map<String,String> query4SelectionBoxEnable(){
List<FileTypes> fileTypes = fileTypesService.query4SelectionBoxEnable();
Map<String,String> result = fileTypes.stream().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
return result;
}
/** /**
* 添加档案文件类型 * 添加档案文件类型
* @param fileTypes * @param fileTypes
......
...@@ -62,8 +62,9 @@ public class TaxDocumentController { ...@@ -62,8 +62,9 @@ public class TaxDocumentController {
@PostMapping("add") @PostMapping("add")
@ResponseBody @ResponseBody
public boolean addTaxDocument(TaxDocument taxDocument, public boolean addTaxDocument(@RequestParam(value = "file") MultipartFile file,
@RequestParam("file") MultipartFile file) { @RequestParam(required = false) String modual,
TaxDocument taxDocument) {
return taxDocumentService.addTaxDocumentList(file,taxDocument); return taxDocumentService.addTaxDocumentList(file,taxDocument);
} }
...@@ -82,7 +83,7 @@ public class TaxDocumentController { ...@@ -82,7 +83,7 @@ public class TaxDocumentController {
@PostMapping("edit") @PostMapping("edit")
@ResponseBody @ResponseBody
public boolean editTaxDocument(TaxDocument taxDocument, public boolean editTaxDocument(TaxDocument taxDocument,
@RequestParam("file") MultipartFile file, @RequestParam(value = "file",required = false) MultipartFile file,
@RequestParam(required = false) String modual) { @RequestParam(required = false) String modual) {
//TODO 判断file是否为null 为null则不做上传和设置新url地址值 若不为null 则上传文件并设置文件url地址值 //TODO 判断file是否为null 为null则不做上传和设置新url地址值 若不为null 则上传文件并设置文件url地址值
if(file!=null&&!file.isEmpty()){ if(file!=null&&!file.isEmpty()){
......
...@@ -160,4 +160,7 @@ public class FileTypesServiceImpl { ...@@ -160,4 +160,7 @@ public class FileTypesServiceImpl {
fileTypes.setRequiredFieldJson(requiredFieldJson); fileTypes.setRequiredFieldJson(requiredFieldJson);
} }
} }
public List<FileTypes> query4SelectionBoxEnable() {
return fileTypesMapper.query4SelectionBoxEnable();
}
} }
...@@ -108,4 +108,6 @@ public interface FileTypesMapper extends MyMapper { ...@@ -108,4 +108,6 @@ public interface FileTypesMapper extends MyMapper {
int updateByPrimaryKey(FileTypes record); int updateByPrimaryKey(FileTypes record);
List<FileTypes> query4SelectionBox(); List<FileTypes> query4SelectionBox();
List<FileTypes> query4SelectionBoxEnable();
} }
\ No newline at end of file
...@@ -405,4 +405,12 @@ ...@@ -405,4 +405,12 @@
FROM file_types FROM file_types
ORDER BY file_attr ORDER BY file_attr
</select> </select>
<select id="query4SelectionBoxEnable" resultMap="BaseResultMap">
SELECT
id,file_attr, file_type
FROM file_types
WHERE status = 1
ORDER BY file_attr
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
</div> </div>
<!--描述--> <!--描述-->
<div class="form-group"> <div class="form-group">
<label for="Description" class="col-sm-3 control-label"> <label for="Description" class="col-sm-3 control-label edit-panel-left-part">
<span translate="DescriptionWithOutColon"></span> <span translate="DescriptionWithOutColon"></span>
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
</div> </div>
<!--备注--> <!--备注-->
<div class="form-group"> <div class="form-group">
<label for="Remarks" class="col-sm-3 control-label" translate="Remarks"></label> <label for="Remarks" class="col-sm-3 control-label edit-panel-left-part" translate="Remarks"></label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<input class="form-control" id="Remarks" <input class="form-control" id="Remarks"
ng-model="editModel.remarks" ng-model="editModel.remarks"
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
<!--状态--> <!--状态-->
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"> <label class="col-sm-3 control-label edit-panel-left-part">
<span translate="State"></span> <span translate="State"></span>
</label> </label>
<div class="col-sm-11" style="width:61.67%" > <div class="col-sm-11" style="width:61.67%" >
...@@ -182,10 +182,19 @@ ...@@ -182,10 +182,19 @@
</div> </div>
<div class="modal-footer"> <!--<div class="modal-footer">
<button type="submit" class="btn btn-primary" translate="Confirm" <button type="submit" class="btn btn-primary" translate="Confirm"
></button><!--ng-disabled="newDocFileTypeForm.roleName.$invalid || newDocFileTypeForm.service_id.$invalid"--> ></button>&lt;!&ndash;ng-disabled="newDocFileTypeForm.roleName.$invalid || newDocFileTypeForm.service_id.$invalid"&ndash;&gt;
<button type="button" class="btn btn-third" data-dismiss="modal" ng-click="cancelDocFileType()" translate="Cancel"></button> <button type="button" class="btn btn-third" data-dismiss="modal" ng-click="cancelDocFileType()" translate="Cancel"></button>
</div>-->
<div>
<center>
<button type="submit" class="btn btn-primary" translate="Confirm"
></button>
<!--ng-disabled="newDocFileTypeForm.roleName.$invalid || newDocFileTypeForm.service_id.$invalid"-->
<button type="button" class="btn btn-third" data-dismiss="modal"
ng-click="cancelDocFileType()" translate="Cancel"></button>
</center>
</div> </div>
</form> </form>
</div> </div>
......
...@@ -1052,10 +1052,25 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -1052,10 +1052,25 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
params.fileTime = $scope.getQueryDate(params.fileTime, "-"); params.fileTime = $scope.getQueryDate(params.fileTime, "-");
params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "-"); params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "-");
_taxDocumentListService.verifyDuplicate(params).then(function (data) { _taxDocumentListService.verifyDuplicate(params).then(function (data) {
if (data == true) { //data.id===null|| data.id===undefined,代表可以直接上传,否则属于覆盖行为
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/add"; if (data.id===null|| data.id===undefined) {
_fileItem.url = "http://etms.longi-silicon.com:8180//api/v1/taxDoc/add";
} else { } else {
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/edit"; //覆盖行为-需上传参数
for (var name in data) {
if((data[name]==null) || (name=='createTime'|| name=='updateTime' || name=='fileName'
|| name=='fileAttr' || name=='fileType'|| name=='fileTypeId' || name=='companyName'|| name=='companyId'
|| name=='taxType' || name=='ownTime' || name=='effectiveTime'|| name=='fileTime')){
continue;
}
if(name=='uploadTime'|| name=='fileTime'|| name=='effectiveTime'){
data[name] = $scope.getQueryDate(data[name], "/")
}
var cover_fields={};
cover_fields[name] = data[name];
fileItem.formData.push(cover_fields);
}
_fileItem.url = "http://etms.longi-silicon.com:8180//api/v1/taxDoc/edit";
} }
_multiUploader.uploadItem(_i); _multiUploader.uploadItem(_i);
}); });
...@@ -1601,6 +1616,8 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1601,6 +1616,8 @@ taxDocumentManageModule.directive('tempModule', function () {
$scope.typeAndAttrMap = {}; $scope.typeAndAttrMap = {};
$scope.fileTypeOptions = []; $scope.fileTypeOptions = [];
$scope.fileAttrOptions = []; $scope.fileAttrOptions = [];
$scope.fileTypeEnableOptions = [];
$scope.fileAttrEnableOptions = [];
$scope.curFileTypeOptions = []; $scope.curFileTypeOptions = [];
$scope.companyNameOptionsMap = {}; $scope.companyNameOptionsMap = {};
$scope.loadSelectMap = function () { $scope.loadSelectMap = function () {
...@@ -1641,18 +1658,61 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1641,18 +1658,61 @@ taxDocumentManageModule.directive('tempModule', function () {
} }
}); });
taxDocumentListService.getCompanyNameOptions().then(function(res){ taxDocumentListService.getCompanyNameOptions().then(function (data) {
if (res && 0 === res.code) { // console.log(data);
angular.forEach(res.data, function (item) { if (data) {
$scope.companyNameOptionsMap[item.id]=item.name; $scope.companyNameOptionsMap = data;
}
}); });
} else { };
SweetAlert.error($translate.instant('RevenueGetOrgError')); //加载可用的档案属性
$scope.loadSelectEnableMap = function () {
taxDocumentListService.getFileInfoEnableOptions().then(function (data) {
// console.log(data);
if (data) {
$scope.typeAndAttrMap = data;
// 抽取每个元素的头一个字串,用于排序;
// $scope.fileTypeEnableOptions = $scope.sortByFirstCode(Object.keys(data));
// $scope.fileAttrEnableOptions = $scope.sortByFirstCode(Object.values(data));
$scope.fileTypeEnableOptions = Object.keys(data);
$scope.fileAttrEnableOptions = Object.values(data);
// 过滤去重
var temp = $scope.fileTypeEnableOptions;
$scope.fileTypeEnableOptions = (function(){
var result = [];
temp.forEach(function(typeItem){
if(result.indexOf(typeItem) === -1){
result.push(typeItem);
}
});
return result;
})();
$scope.fileTypeEnableOptions.sort();
temp = $scope.fileAttrEnableOptions;
$scope.fileAttrEnableOptions = (function(){
var result = [];
temp.forEach(function(attrItem){
if(result.indexOf(attrItem) === -1){
result.push(attrItem);
}
});
return result;
})();
$scope.fileAttrEnableOptions.sort();
} }
}); });
taxDocumentListService.getCompanyNameOptions().then(function (data) {
// console.log(data);
if (data) {
$scope.companyNameOptionsMap = data;
}
});
}; };
$scope.loadSelectMap(); $scope.loadSelectMap();
$scope.loadSelectEnableMap();
$scope.businessLineOptions = []; $scope.businessLineOptions = [];
$scope.loadBusinessList = function(){ $scope.loadBusinessList = function(){
taxDocumentListService.getBusinessList().then(function(resData){ taxDocumentListService.getBusinessList().then(function(resData){
...@@ -1800,6 +1860,7 @@ taxDocumentManageModule.directive('tempModule', function () { ...@@ -1800,6 +1860,7 @@ taxDocumentManageModule.directive('tempModule', function () {
} }
return result; return result;
}; };
$scope.queryFileUploadData = function(key,curItemValue){ $scope.queryFileUploadData = function(key,curItemValue){
var fields = {}; var fields = {};
if (/ownTime/.test(key)) { if (/ownTime/.test(key)) {
......
...@@ -704,7 +704,7 @@ ...@@ -704,7 +704,7 @@
ng-change="syncFileType(editFieldModel.fileAttr)" ng-change="syncFileType(editFieldModel.fileAttr)"
class="form-control" class="form-control"
required placeholder="{{'PleaseSelected' | translate}}"> required placeholder="{{'PleaseSelected' | translate}}">
<option ng-repeat="fileAttr in fileAttrOptions track by $index" <option ng-repeat="fileAttr in fileAttrEnableOptions track by $index"
ng-selected="(editFieldModel.fileAttr == fileAttr)" ng-selected="(editFieldModel.fileAttr == fileAttr)"
value="{{fileAttr}}">{{fileAttr}} value="{{fileAttr}}">{{fileAttr}}
</option> </option>
......
...@@ -66,6 +66,9 @@ taxDocumentManageModule.factory('taxDocumentListService', ...@@ -66,6 +66,9 @@ taxDocumentManageModule.factory('taxDocumentListService',
getFileInfoOptions:function(params){ getFileInfoOptions:function(params){
return jqFetch.post(apiInterceptor.webApiHostUrl + '/fileTypes/query4SelectionBox', params); return jqFetch.post(apiInterceptor.webApiHostUrl + '/fileTypes/query4SelectionBox', params);
}, },
getFileInfoEnableOptions:function(params){
return jqFetch.post(apiInterceptor.webApiHostUrl + '/fileTypes/query4SelectionBoxEnable', params);
},
getCompanyNameOptions:function(params){ getCompanyNameOptions:function(params){
return jqFetch.get(apiInterceptor.webApiHostUrl + '/org/getMyOrgList', params); return jqFetch.get(apiInterceptor.webApiHostUrl + '/org/getMyOrgList', params);
}, },
......
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