Commit d4cf5f97 authored by gary's avatar gary

Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql

parents 72475254 b75d1cec
......@@ -31,7 +31,7 @@ public class CitImportExcelController {
@RequestMapping(value = "/citImportExcel", method = RequestMethod.POST)
public @ResponseBody
OperationResultDto citImportExcel(@RequestParam MultipartFile file, @RequestParam String orgIds,
OperationResultDto citImportExcel(@RequestParam MultipartFile file, @RequestParam(required = false) String orgIds,
@RequestParam String periodDate,
@RequestParam Integer importType,
@RequestParam Integer importFileType){
......
......@@ -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);
}
}
......@@ -25,6 +25,7 @@ import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class CitImportExcelServiceImpl extends BaseService {
......@@ -537,7 +538,7 @@ public class CitImportExcelServiceImpl extends BaseService {
List<CitDataImportLog> citDataImportLogList = new ArrayList<>();
// Integer period = CitCommonUtil.getPeriod();
String companyName = CitCommonUtil.getValue(sheet.getRow(5).getCell(1)).toString();
List<Organization> organizations = getOrganizationByName(companyName);
List<Organization> organizations = getOrganizationByName(companyName).stream().filter(r->r.getCode()!=null&&!("".equals(r.getCode()))).collect(Collectors.toList());
String companyCode = "";
String orgId = "";
String taxPayerId = "";
......@@ -547,6 +548,7 @@ public class CitImportExcelServiceImpl extends BaseService {
if(!orgList.contains(orgId)){
saveResult.setResult(false);
saveResult.setData(false);
saveResult.setResultMsg(ErrorMessageCN.DoNotSelectCompany);
return saveResult;
}
......@@ -556,6 +558,7 @@ public class CitImportExcelServiceImpl extends BaseService {
}else{
saveResult.setResult(false);
saveResult.setData(false);
saveResult.setResultMsg(ErrorMessageCN.NoCompanyError);
return saveResult;
}
......@@ -592,7 +595,6 @@ public class CitImportExcelServiceImpl extends BaseService {
citDataImportLogList.add(citDataImportLogError);
continue;
}
System.out.println(cellValue);
citBSPrcAdjust.setBegBal(new BigDecimal(cellValue.toString().replace(",","")));
......@@ -888,7 +890,7 @@ public class CitImportExcelServiceImpl extends BaseService {
citDataImportLogList.add(citDataImportLogError);
continue;
}
String companyCode = cellValueCode.toString();
String companyCode = cellValueCode.toString().replace(".0","");
//根据code(主体)获取机构相关信息
List<Organization> organizations = getOrganizationByCode(companyCode);
String companyName = "";
......@@ -969,7 +971,9 @@ public class CitImportExcelServiceImpl extends BaseService {
citSalaryAdvanceMapper.deleteByExample(example);
updateImportLog(EnumCitImportType.SalaryAdvance.getCode());
}
if(citSalaryAdvanceList.size()>0){
int insertBatchNum = citSalaryAdvanceMapper.insertBatch(citSalaryAdvanceList);
}
//循环遍历成功导入的数据,组装日志记录实体并放入集合
for (Map.Entry<String, Integer> entry : companySuccessMap.entrySet()) {
......
......@@ -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();
......
......@@ -106,5 +106,5 @@ public interface CitSalaryAdvanceMapper extends MyMapper {
*/
int updateByPrimaryKey(CitSalaryAdvance record);
int insertBatch(List<CitSalaryAdvance> citSalaryAdvanceList);
int insertBatch(List<CitSalaryAdvance> list);
}
\ No newline at end of file
......@@ -49,7 +49,7 @@
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.createBy != null">#{item.createdBy,jdbcType=VARCHAR},</when>
<when test="item.createBy != null">#{item.createBy,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
......
......@@ -49,7 +49,7 @@
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.createBy != null">#{item.createdBy,jdbcType=VARCHAR},</when>
<when test="item.createBy != null">#{item.createBy,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
......
......@@ -29,8 +29,8 @@
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.poNo != null">#{item.poNo,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
<when test="item.poNo != null">#{item.poNo,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.poSubjectCode != null">#{item.poSubjectCode,jdbcType=VARCHAR},</when>
......
......@@ -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', []);
}
});
}
};
......@@ -147,8 +143,18 @@
}
};
if ($scope.curTemplateGroup && $scope.curTemplateGroup.id) {
if ($scope.curServiceTypeId === enums.serviceType.CIT) {
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
......@@ -180,7 +186,6 @@
$scope.reportType = null;
listTemplates();
}
}
};
var loadIndustry = function () {
......@@ -315,6 +320,7 @@
//加载'报表'源数据
var listTemplates = function () {
if ($scope.curTemplateGroup && $scope.curTemplateGroup.id) {
templateGroupService.getTemplateList($scope.curTemplateGroup.id, $scope.reportType && $scope.reportType.value).success(function (templateData) {
templateData = _.filter(templateData, function (row) {
......@@ -330,6 +336,9 @@
if (find) {
defaultValue = find;
}
else {
$scope.currentTemplate = null;
}
}
$scope.templates = templateData; //当前组下的所有模板数据
......@@ -340,6 +349,12 @@
$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,8 +44,8 @@
<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'"
<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}}
......
......@@ -240,15 +240,15 @@
}
&.reportType {
width: 130px;
width: 120px;
}
&.selectTemplateGroup {
width: 200px;
width: 150px;
}
&.selectReport {
width: 200px;
width: 150px;
}
}
}
......
......@@ -189,6 +189,7 @@ controller('editTemplateModalController', ['$scope', '$log', '$translate', '$loc
// text: thisConstant.allSheets,
showClearButton: false,
noDataText: '',
dropDownOptions: { maxHeight: '310px' },
dataSource: thisData.sheetNameObjList,
contentTemplate: function(e) {
var value = e.component.option("value"),
......@@ -231,7 +232,6 @@ controller('editTemplateModalController', ['$scope', '$log', '$translate', '$loc
save: function(modalInstance) {
if (!$scope.editModel || !$scope.editModel.file) {
SweetAlert.warning(thisData.pleaseSelectFile);
return;
}
......@@ -267,6 +267,7 @@ controller('editTemplateModalController', ['$scope', '$log', '$translate', '$loc
allowManual: $("#allowManual").is(":checked"),
filename: $scope.editModel.file.name,
tempFileName: tempFileName,
defaultInput: $scope.editModel.defaultInput,
reportType: $scope.editModel.reportType
},
file: $scope.editModel.file,
......@@ -333,6 +334,7 @@ controller('editTemplateModalController', ['$scope', '$log', '$translate', '$loc
// body...
if (!thisData.selectTemplateCodeList || thisData.selectTemplateCodeList.length === 0) {
SweetAlert.warning(thisConstant.pleaseSelectTemplate);
return;
}
var model = {
......@@ -480,6 +482,7 @@ controller('editTemplateModalController', ['$scope', '$log', '$translate', '$loc
// text: thisConstant.allSheets,
showClearButton: false,
noDataText: '',
dropDownOptions: { maxHeight: '310px' },
dataSource: thisData.allTemplateList,
contentTemplate: function(e) {
var value = e.component.option("value"),
......
......@@ -2,20 +2,20 @@
<!-- 采用导入报表模板的方式 -->
<script type="text/ng-template" id="editTemplateModal.html">
<div class="modal-header">
<div class="modal-title">添加报表<span class="close" ng-click="cancel()" aria-hidden="true">×</span></div>
<div class="modal-title">{{'AddReport' | translate}}<span class="close" ng-click="cancel()" aria-hidden="true">×</span></div>
</div>
<div class="modal-body">
<form class="form-horizontal" id="editTemplateControlForm">
<div class="form-group radio-wrapper">
<label class="col-sm-4 normal-label">
<input type="radio" ng-model="editModel.addExists" ng-value="true"><span>添加现有报表</span>
<input type="radio" ng-model="editModel.addExists" ng-value="true"><span>{{'AddExistingReport' | translate}}</span>
</label>
<label class="col-sm-4 normal-label">
<input type="radio" ng-model="editModel.addExists" ng-value="false"><span>上传新报表</span>
<input type="radio" ng-model="editModel.addExists" ng-value="false"><span>{{'UploadNewReport' | translate}}</span>
</label>
</div>
<div class="form-group" ng-show="!editModel.addExists">
<label for="fileName" class="col-sm-3 control-label">报表底稿:</label>
<label for="fileName" class="col-sm-3 control-label">{{'TemplateFile' | translate}}: </label>
<div class="col-sm-5">
<input class="form-control" type="text" name="fileName" ng-model="editModel.file.name" readonly placeholder="">
</input>
......@@ -25,25 +25,25 @@
</div>
</div>
<div class="form-group" ng-show="!editModel.addExists">
<label for="telCode" class="col-sm-3 control-label">选择报表:</label>
<label for="telCode" class="col-sm-3 control-label">{{'SelectReportTemplate' | translate}}: </label>
<div class="col-sm-8 upload-sheet-wrapper">
<div id={{::editModel.sheetSelectDxID}}></div>
</div>
</div>
<div class="form-group radio-wrapper" ng-show="!editModel.addExists">
<label for="telCode" class="col-sm-4 normal-label">
<input type="radio" id="allowManual"><span>允许手工录入</span>
</label>
</div>
<div class="form-group" ng-show="editModel.addExists">
<label for="telCode" class="col-sm-3 control-label">选择报表:</label>
<label for="telCode" class="col-sm-3 control-label">{{'SelectReportTemplate' | translate}}: </label>
<div class="col-sm-9">
<div id={{::editModel.findSheetDxDropID}}></div>
</div>
</div>
<div class="form-group" ng-show="!editModel.addExists">
<div class="col-sm-9 normal-label checkbox">
<label>
<input type="checkbox" ng-model="editModel.defaultInput" ng-true-value="1" ng-false-value="0"> {{'AllowKeyInByDefault' | translate}}
</label>
</div>
</div>
</form>
</div>
<div class="modal-footer" style="padding-left: 22px;text-align: left;">
......@@ -54,12 +54,12 @@
<!-- 添加现有报表 -->
<script type="text/ng-template" id="addExistTemplateModal.html">
<div class="modal-header">
<div class="modal-title">添加现有报表</div>
<div class="modal-title">{{'AddExistingReport' | translate}}</div>
</div>
<div class="modal-body">
<form class="form-horizontal" id="editTemplateControlForm">
<div class="form-group">
<label for="telCode" class="col-sm-3 control-label">选择报表:</label>
<label for="telCode" class="col-sm-3 control-label">{{'SelectReportTemplate' | translate}}: </label>
<div class="col-sm-7">
<div id={{::editModel.findSheetDxDropID}}></div>
</div>
......@@ -74,7 +74,7 @@
<!-- 编辑报表名称 -->
<script type="text/ng-template" id="deleteTemplateModal.html">
<div class="modal-header">
<div class="modal-title">删除报表</div>
<div class="modal-title">{{'DeleteReport' | translate}}</div>
</div>
<div class="modal-body">
<form class="form-horizontal" id="deleteTemplateControlForm">
......@@ -90,12 +90,12 @@
<!-- 编辑报表名称 -->
<script type="text/ng-template" id="editTemplateNameModal.html">
<div class="modal-header">
<div class="modal-title">编辑报表</div>
<div class="modal-title">{{'EditReport' | translate}}</div>
</div>
<div class="modal-body">
<form class="form-horizontal" id="editTemplateNameModal">
<div class="form-group">
<label for="name" class="col-sm-3 control-label"><span class="must-input">*</span>报表底稿:</label>
<label for="name" class="col-sm-3 control-label"><span class="must-input">*</span>{{'TemplateFile' | translate}}: </label>
<div class="col-sm-8">
<input class="form-control" type="text" name="name" ng-model="editModel.name" />
</div>
......
......@@ -35,6 +35,10 @@
padding-left: 0;
padding-right: 32px;
}
.checkbox {
margin-left: 100px;
}
}
.edit-template-name-wrapper {
......
......@@ -170,16 +170,22 @@
}).then(function (resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
} else {
if (resp.message && resp.message.length > 0) {
SweetAlert.warning($translate.instant(resp.message));
} else {
SweetAlert.error($translate.instant('ImportFailed'));
}
if (resp.resultMsg && resp.resultMsg.length > 0) {
SweetAlert.warning($translate.instant(resp.resultMsg));
} else {
SweetAlert.error($translate.instant('ImportFailed'));
}
logDto.UpdateState = $translate.instant('ImportFail');
vatOperationLogService.addOperationLog(logDto);
}
......@@ -395,7 +401,7 @@
ele1.datepicker("setDate", $scope.selectedDate);
};
$scope.initCompanyList = function () {
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
......@@ -494,6 +500,7 @@
$scope.setGridStyle = setGridStyle;
getUserPermission();
initCompanyList();
loadImportInfoDataGrid();
initDatePicker();
......
......@@ -162,7 +162,7 @@
}).then(function(resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
......
......@@ -161,7 +161,7 @@
}).then(function(resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
......
......@@ -170,7 +170,7 @@
}).then(function(resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
......
......@@ -171,7 +171,7 @@
}).then(function(resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
......
......@@ -173,7 +173,7 @@
}).then(function(resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
......
......@@ -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