Commit f09fa1dd authored by Ken you's avatar Ken you

add admin CIT excel import and resolve some bug----Ken

parent 94eb6b17
......@@ -156,4 +156,17 @@ public class TemplateGroupController {
return OperationResultDto.error(ErrorMessage.SystemError);
}
@RequestMapping(value = "withoutTemplate", method = RequestMethod.POST)
public @ResponseBody OperationResultDto withoutTemplate(@RequestBody TemplateGroupDto templateGroupDto) {
try {
templateGroupService.addTemplateGroupWithoutTemplate(templateGroupDto);
return OperationResultDto.success();
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("withoutTemplate error.", e);
}
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
......@@ -38,10 +38,8 @@ import pwc.taxtech.atms.entity.TemplateGroup;
import pwc.taxtech.atms.entity.TemplateGroupExample;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.vat.dao.PeriodDataSourceMapper;
import pwc.taxtech.atms.vat.entity.PeriodCellData;
import pwc.taxtech.atms.vat.entity.PeriodDataSource;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.math.BigDecimal;
......@@ -527,6 +525,28 @@ public class TemplateGroupServiceImpl extends AbstractService {
}
@Transactional
public void addTemplateGroupWithoutTemplate(TemplateGroupDto templateGroupDto) throws ServiceException {
List<TemplateGroup> groupList = templateGroupDao.getByGroupName(templateGroupDto.getName());
if (CollectionUtils.isNotEmpty(groupList)) {
throw new ServiceException(TemplateMessage.TemplateGroupNameExist);
}
try {
TemplateGroup templateGroup=new TemplateGroup();
CommonUtils.copyProperties(templateGroupDto,templateGroup);
Long newGroupId = distributedIdService.nextId();
Date now = new Date();
templateGroup.setId(newGroupId);
templateGroup.setCreateTime(now);
templateGroup.setUpdateTime(now);
templateGroup.setName(templateGroupDto.getName());
templateGroupMapper.insertSelective(templateGroup);
} catch (Exception e) {
logger.error("addTemplateGroupWithoutTemplate error.", e);
throw new ServiceException(ErrorMessage.SystemError);
}
}
private List<CellTemplateConfig> getByTemplateId(Long id) {
CellTemplateConfigExample example = new CellTemplateConfigExample();
CellTemplateConfigExample.Criteria criteria = example.createCriteria();
......
......@@ -21,8 +21,8 @@
<select id="getTemplateUniqDtosByTemplateAndTemplateGroup" parameterType="map" resultMap="TemplateUniqDto">
SELECT
P.id as ID,
p.code as Code,
p.name as Name,
P.code as Code,
P.name as Name,
P.report_type as ReportType,
Q.id AS TEMPLATE_GROUP_ID,
Q.name AS TEMPLATE_GROUP_NAME,
......
......@@ -120,18 +120,14 @@
defaultValue = find;
$scope.templateGroupId = find.id;
}
else {
$scope.curTemplateGroup = null;
}
}
dxControl.renderTemplateGroupDropDown(templateGroupData, defaultValue);
if (templateGroupData && templateGroupData.length > 0) {
loadReportType();
} else {
$('#dx-select-template-groups').dxDropDownBox('instance').option('dataSource', []);
$('#dx-select-template').dxDropDownBox('instance').option('dataSource', []);
}
loadReportType();
});
}
};
......@@ -147,39 +143,48 @@
}
};
if ($scope.curTemplateGroup && $scope.curTemplateGroup.id) {
if ($scope.curServiceTypeId === enums.serviceType.CIT) {
$scope.detailReportTypeList = angular.copy(defaultReportTypeOpt);
$scope.detailReportTypeList.dataSource = new DevExpress.data.ArrayStore({
data: citReportTypeList
});
$scope.detailReportTypeList.value = citReportTypeList[0].name;
$('#dx-select-report-type').dxSelectBox('instance').option($scope.detailReportTypeList);
$scope.reportType = citReportTypeList[0];
listTemplates();
} else if ($scope.curServiceTypeId === enums.serviceType.CF) {
$scope.detailReportTypeList = angular.copy(defaultReportTypeOpt);
$scope.detailReportTypeList.dataSource = new DevExpress.data.ArrayStore({
data: cfReportTypeList
});
$scope.detailReportTypeList.value = cfReportTypeList[1].name;
$('#dx-select-report-type').dxSelectBox('instance').option($scope.detailReportTypeList);
$scope.reportType = cfReportTypeList[1];
listTemplates();
} else if ($scope.curServiceTypeId === enums.serviceType.Others) {
$scope.detailReportTypeList = angular.copy(defaultReportTypeOpt);
$scope.detailReportTypeList.dataSource = new DevExpress.data.ArrayStore({
data: citReportTypeList
});
$scope.detailReportTypeList.value = citReportTypeList[0].name;
$('#dx-select-report-type').dxSelectBox('instance').option($scope.detailReportTypeList);
$scope.reportType = citReportTypeList[0];
listTemplates();
} else {
$('#dx-select-report-type').dxSelectBox('instance').option('dataSource', []);
$scope.reportType = null;
listTemplates();
}
if ($scope.curServiceTypeId === enums.serviceType.VAT) {
$scope.detailReportTypeList = angular.copy(defaultReportTypeOpt);
var ds = _.filter(citReportTypeList, function (item) { return item.value == 1 || item.value == 3 || item.value == 4 });
$scope.detailReportTypeList.dataSource = new DevExpress.data.ArrayStore({
data: ds
});
$scope.detailReportTypeList.value = citReportTypeList[0].name;
$('#dx-select-report-type').dxSelectBox('instance').option($scope.detailReportTypeList);
$scope.reportType = citReportTypeList[0];
listTemplates();
} else if ($scope.curServiceTypeId === enums.serviceType.CIT) {
$scope.detailReportTypeList = angular.copy(defaultReportTypeOpt);
$scope.detailReportTypeList.dataSource = new DevExpress.data.ArrayStore({
data: citReportTypeList
});
$scope.detailReportTypeList.value = citReportTypeList[0].name;
$('#dx-select-report-type').dxSelectBox('instance').option($scope.detailReportTypeList);
$scope.reportType = citReportTypeList[0];
listTemplates();
} else if ($scope.curServiceTypeId === enums.serviceType.CF) {
$scope.detailReportTypeList = angular.copy(defaultReportTypeOpt);
$scope.detailReportTypeList.dataSource = new DevExpress.data.ArrayStore({
data: cfReportTypeList
});
$scope.detailReportTypeList.value = cfReportTypeList[1].name;
$('#dx-select-report-type').dxSelectBox('instance').option($scope.detailReportTypeList);
$scope.reportType = cfReportTypeList[1];
listTemplates();
} else if ($scope.curServiceTypeId === enums.serviceType.Others) {
$scope.detailReportTypeList = angular.copy(defaultReportTypeOpt);
$scope.detailReportTypeList.dataSource = new DevExpress.data.ArrayStore({
data: citReportTypeList
});
$scope.detailReportTypeList.value = citReportTypeList[0].name;
$('#dx-select-report-type').dxSelectBox('instance').option($scope.detailReportTypeList);
$scope.reportType = citReportTypeList[0];
listTemplates();
} else {
$('#dx-select-report-type').dxSelectBox('instance').option('dataSource', []);
$scope.reportType = null;
listTemplates();
}
};
......@@ -315,31 +320,41 @@
//加载'报表'源数据
var listTemplates = function () {
templateGroupService.getTemplateList($scope.curTemplateGroup.id, $scope.reportType && $scope.reportType.value).success(function (templateData) {
templateData = _.filter(templateData, function (row) {
return row.isActiveAssociation;
});
if ($scope.curTemplateGroup && $scope.curTemplateGroup.id) {
templateGroupService.getTemplateList($scope.curTemplateGroup.id, $scope.reportType && $scope.reportType.value).success(function (templateData) {
var defaultValue = templateData[0];
if ($scope.currentTemplate && ($scope.currentTemplate.name || $scope.currentTemplate.id)) {
var find = _.find(templateData, function (row) {
return row.name === $scope.currentTemplate.name || row.id === $scope.currentTemplate;
templateData = _.filter(templateData, function (row) {
return row.isActiveAssociation;
});
if (find) {
defaultValue = find;
var defaultValue = templateData[0];
if ($scope.currentTemplate && ($scope.currentTemplate.name || $scope.currentTemplate.id)) {
var find = _.find(templateData, function (row) {
return row.name === $scope.currentTemplate.name || row.id === $scope.currentTemplate;
});
if (find) {
defaultValue = find;
}
else {
$scope.currentTemplate = null;
}
}
}
$scope.templates = templateData; //当前组下的所有模板数据
$scope.templates = templateData; //当前组下的所有模板数据
dxControl.renderTemplateDropDown(templateData, defaultValue);
//配置报表下拉框
if (templateData && templateData.length > 0) {
$scope.ToggleSaveAs = showSavebutton();
}
});
dxControl.renderTemplateDropDown(templateData, defaultValue);
//配置报表下拉框
if (templateData && templateData.length > 0) {
$scope.ToggleSaveAs = showSavebutton();
}
});
}
else {
$('#dx-select-template-groups').dxDropDownBox('instance').option('dataSource', []);
$scope.templates.length = 0;
$scope.currentTemplate = null;
}
};
//模板不是默认模板才可以编辑和保存
var showSavebutton = function () {
......
......@@ -28,15 +28,15 @@
<div class="templates-top">
<div class="form-group">
<span class="tab-content-select-lable" ng-show="curServiceTypeId !=='12'">{{'IndustryColon' | translate}}</span>
<div id="dx-select-industry" class="tab-content-select industry col-md-2" ng-show="curServiceTypeId !=='12'" dx-select-box="dataSourceIndustryList"
dx-item-alias="itemObj">
<div id="dx-select-industry" class="tab-content-select industry col-md-2" ng-show="curServiceTypeId !=='12'"
dx-select-box="dataSourceIndustryList" dx-item-alias="itemObj">
<div data-options="dxTemplate: { name: 'industryItem' }" class="dx-item-content dx-list-item-content" title="{{itemObj.name}}">
{{itemObj.name}}
</div>
</div>
<span class="tab-content-select-lable" translate="ReportType" ng-show="curServiceTypeId === '2'"></span>
<div class="tab-content-select reportType col-md-2" id="dx-select-pay-tax-type" ng-show="curServiceTypeId === '2'" dx-select-box="dataSourcePayTaxTypeList"
dx-item-alias="itemObj">
<span class="tab-content-select-lable" ng-show="curServiceTypeId === '2'">{{'Ratepayer' | translate}}:</span>
<div class="tab-content-select reportType col-md-2" id="dx-select-pay-tax-type" ng-show="curServiceTypeId === '2'"
dx-select-box="dataSourcePayTaxTypeList" dx-item-alias="itemObj">
<div data-options="dxTemplate: { name: 'filingTypeItem' }" class="dx-item-content dx-list-item-content" title="{{itemObj.name}}">
{{itemObj.name}}
</div>
......@@ -44,9 +44,9 @@
<span class="tab-content-select-lable">{{'SelectTemplateGroup' | translate}}</span>
<div class="tab-content-select selectTemplateGroup col-md-2" id="dx-select-template-groups">
</div>
<span class="tab-content-select-lable" translate="ReportType" ng-show="curServiceTypeId === '6' || curServiceTypeId === '11' || curServiceTypeId === '99'"></span>
<div class="tab-content-select reportType col-md-2" id="dx-select-report-type" ng-show="curServiceTypeId === '6' || curServiceTypeId === '11' || curServiceTypeId === '99'"
dx-select-box="detailReportTypeList" dx-item-alias="itemObj">
<span class="tab-content-select-lable" translate="ReportType" ng-show="curServiceTypeId === '2' ||curServiceTypeId === '6' || curServiceTypeId === '11' || curServiceTypeId === '99'"></span>
<div class="tab-content-select reportType col-md-2" id="dx-select-report-type" ng-show="curServiceTypeId === '2' ||curServiceTypeId === '6' || curServiceTypeId === '11' || curServiceTypeId === '99'"
dx-select-box="detailReportTypeList" dx-item-alias="itemObj">
<div data-options="dxTemplate: { name: 'reportTypeItem' }" class="dx-item-content dx-list-item-content" title="{{itemObj.name}}">
{{itemObj.name}}
</div>
......
......@@ -240,15 +240,15 @@
}
&.reportType {
width: 130px;
width: 120px;
}
&.selectTemplateGroup {
width: 200px;
width: 150px;
}
&.selectReport {
width: 200px;
width: 150px;
}
}
}
......
commonModule.directive('editTemplateModal', ['$log',
function ($log) {
'use strict';
$log.debug('editUserModal.ctor()...');
return {
restrict: 'E',
templateUrl: '/app/common/controls/edit-template-modal/edit-template-modal.html' + '?_=' + Math.random(),
replace: true,
controller: 'editTemplateModalController',
scope:
{
operateType:'=',
templateModel:'=?',
isUpdate:'=?',
onClosed: '&'
}
//,
//link: function (scope, element) {
// element.find('.selector-input').on('focus', function () {
// element.find('.org-tree-container').show();
// });
// $(document).on('click', function () {
// element.find('.org-tree-container').hide();
// }).on('click', '.org-tree-wrapper', function (e) {
// e.stopPropagation();
// });
//}
};
}
commonModule.directive('editTemplateModal', ['$log',
function ($log) {
'use strict';
$log.debug('editUserModal.ctor()...');
return {
restrict: 'E',
templateUrl: '/app/common/controls/edit-template-modal/edit-template-modal.html' + '?_=' + Math.random(),
replace: true,
controller: 'editTemplateModalController',
scope:
{
operateType:'=',
templateModel:'=?',
isUpdate:'=?',
onClosed: '&'
}
//,
//link: function (scope, element) {
// element.find('.selector-input').on('focus', function () {
// element.find('.org-tree-container').show();
// });
// $(document).on('click', function () {
// element.find('.org-tree-container').hide();
// }).on('click', '.org-tree-wrapper', function (e) {
// e.stopPropagation();
// });
//}
};
}
]);
\ No newline at end of file
@import "~/app-resources/css/admin-theme.less";
.edit-template-modal-wrapper {
.radio-wrapper {
margin-left: 0px;
}
.control-label {
width: 100px!important;
font-weight: normal;
padding-left: 15px!important;
padding-right: 0px!important;
text-align: left;
}
.normal-label {
font-weight: normal;
padding-left: 0px!important;
padding-right: 0px!important;
input[type="radio"] {
margin: 0px 0.5em 0px 0px;
}
}
.col-sm-5,
.col-sm-7,
col-sm-9 {
padding-left: 0px!important;
padding-right: 0px!important;
}
.upload-sheet-wrapper {
padding-left: 0;
padding-right: 32px;
}
}
.edit-template-name-wrapper {
.modal-content {
width: 400px!important;
}
.must-input {
color: red;
}
.control-label {
width: 100px !important;
font-weight: normal;
padding-left: 15px;
padding-right: 0px;
text-align: left;
}
.col-sm-8 {
padding-left: 0px;
padding-right: 0px;
}
}
.margin-find{
margin: -10px -10px 10px -10px;
}
.margin-sheet{
margin: -10px -10px 10px -20px;
}
.tree-view-list {
.dx-checkbox-container {
padding: 4px;
.dx-checkbox-icon {
height: 16px;
width: 16px;
}
.dx-checkbox-icon {
font-size: 14px;
}
}
.dx-checkbox-indeterminate .dx-checkbox-icon:before {
width: 14px;
height: 14px;
left: 0px;
top: 0px;
}
}
.search-box {
margin: 6px -10px -10px -10px;
@import "~/app-resources/css/admin-theme.less";
.edit-template-modal-wrapper {
.radio-wrapper {
margin-left: 0px;
}
.control-label {
width: 100px!important;
font-weight: normal;
padding-left: 15px!important;
padding-right: 0px!important;
text-align: left;
}
.normal-label {
font-weight: normal;
padding-left: 0px!important;
padding-right: 0px!important;
input[type="radio"] {
margin: 0px 0.5em 0px 0px;
}
}
.col-sm-5,
.col-sm-7,
col-sm-9 {
padding-left: 0px!important;
padding-right: 0px!important;
}
.upload-sheet-wrapper {
padding-left: 0;
padding-right: 32px;
}
.checkbox {
margin-left: 100px;
}
}
.edit-template-name-wrapper {
.modal-content {
width: 400px!important;
}
.must-input {
color: red;
}
.control-label {
width: 100px !important;
font-weight: normal;
padding-left: 15px;
padding-right: 0px;
text-align: left;
}
.col-sm-8 {
padding-left: 0px;
padding-right: 0px;
}
}
.margin-find{
margin: -10px -10px 10px -10px;
}
.margin-sheet{
margin: -10px -10px 10px -20px;
}
.tree-view-list {
.dx-checkbox-container {
padding: 4px;
.dx-checkbox-icon {
height: 16px;
width: 16px;
}
.dx-checkbox-icon {
font-size: 14px;
}
}
.dx-checkbox-indeterminate .dx-checkbox-icon:before {
width: 14px;
height: 14px;
left: 0px;
top: 0px;
}
}
.search-box {
margin: 6px -10px -10px -10px;
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ webservices.factory('templateGroupService', ['$http', 'apiConfig', 'httpCacheSer
return $http.post('/templateGroup/addTemplateGroup', templateGroup, apiConfig.create());
},
addTemplateGroupWithoutTemplate: function (templateGroup) {
return $http.post('/templateGroup/templateGroup/withoutTemplate', templateGroup, apiConfig.create());
return $http.post('/templateGroup/withoutTemplate', templateGroup, apiConfig.create());
},
getTemplateList: function (templateGroupID, reportType) {
return $http.get('/template/get?templateGroupID=' + templateGroupID + '&reportType=' + reportType, apiConfig.create());
......
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