Commit 1e994fc1 authored by neo's avatar neo

[DEV] add comfire for munal datasrource for re gen report

parent 0aedfa54
......@@ -30,15 +30,17 @@ public class ReportController {
public OperationResultDto updateConfig(@PathVariable String projectId,
@PathVariable Boolean ifDeleteManualDataSource,
@PathVariable Integer period,
@RequestParam String generator) {
return reportService.updateConfig(projectId, period, ifDeleteManualDataSource, generator,true);
@RequestParam String generator,
@RequestParam Boolean mergeManual) {
return reportService.updateConfig(projectId, period, ifDeleteManualDataSource, generator, mergeManual);
// OperationResultDto operationResultDto = new OperationResultDto();
// operationResultDto.setResult(true);
// return operationResultDto;
}
@RequestMapping(value = "generateByTotal/{projectId}/{ifDeleteManualDataSource}/{period}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto generateAllData(@PathVariable String projectId, @PathVariable Boolean ifDeleteManualDataSource, @PathVariable Integer period, @RequestParam Optional<String> generator) {
public OperationResultDto generateAllData(@PathVariable String projectId, @PathVariable Boolean ifDeleteManualDataSource,
@PathVariable Integer period, @RequestParam Optional<String> generator) {
return reportService.generateData(projectId, EnumServiceType.VAT, ifDeleteManualDataSource, period, null, generator);
}
......@@ -124,4 +126,9 @@ public class ReportController {
public OperationResultDto<String> getDataSourceDetailList(@PathVariable Long dataSourceId) {
return reportService.getDataSourceDetailList(dataSourceId);
}
@RequestMapping(value = "hasManualDataSource/{projectId}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public Boolean hasManualDataSource(@PathVariable String projectId, @PathVariable Integer period) {
return reportService.hasManualDataSource(projectId,period);
}
}
\ No newline at end of file
......@@ -1216,4 +1216,8 @@ public class ReportServiceImpl {
return "";
}
}
public Boolean hasManualDataSource(String projectId, Integer period) {
return periodReportMapper.hasManualDataSource(projectId, period) > 0;
}
}
......@@ -3,6 +3,7 @@ package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.PeriodReport;
......@@ -105,4 +106,16 @@ public interface PeriodReportMapper extends MyVatMapper {
* @mbg.generated
*/
int updateByPrimaryKey(PeriodReport record);
@Select("" +
"SELECT " +
" tCOUNT( 1 ) " +
"FROM " +
" tPERIOD_DATA_SOURCE pds " +
"WHERE " +
" tpds.PROJECT_ID = #{projectId} " +
" tAND pds.TYPE = 10 " +
" tAND pds.PERIOD = #{period}" +
"")
int hasManualDataSource(@Param("projectId") String projectId, @Param("period") Integer period);
}
\ No newline at end of file
......@@ -42,14 +42,14 @@
// citUpdateConfig: function (projectId, period?)
// citGetTemplate: function (projectId, period?)
updateConfig: function (projectId, ifDeleteManualDataSource, period, generator) {
return $http.post('/Report/updateConfig/' + projectId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true}));
updateConfig: function (projectId, ifDeleteManualDataSource, period, generator,isMergeManualDataSource) {
return $http.post('/Report/updateConfig/' + projectId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator+ '&mergeManual='+isMergeManualDataSource, {}, apiConfig.createVat({ignoreLoadingBar: true}));
},
generate: function (projectId, templateId, ifDeleteManualDataSource, period, generator) {
return $http.post('/Report/generate/' + projectId + '/' + templateId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true}));
},
generateAll: function (projectId, ifDeleteManualDataSource, period, generator) {
return $http.post('/Report/generateByTotal/' + projectId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true}));
return $http.post('/Report/generateByTotal/' + projectId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator , {}, apiConfig.createVat({ignoreLoadingBar: true}));
},
getReportData: function (reportId) {
return $http.get('/Report/reportData/' + reportId, apiConfig.createVat());
......@@ -178,7 +178,11 @@
},
getDataSourceDetailList: function (dataSourceId) {
return $http.get('/Report/getDataSourceDetailList/' + dataSourceId, apiConfig.createVat());
},
hasManualDataSource: function (projectId, period) {
return $http.get('/Report/hasManualDataSource/' + projectId+ '/' +period, apiConfig.createVat());
}
};
}]);
\ No newline at end of file
......@@ -11,6 +11,7 @@
var taskList = [];
var fixedRef = [];
$scope.period = vatSessionService.month;
$scope.isMergeManualDataSource = false;
$scope.moduleid = enums.vatModuleEnum.Import_CalculateData;
......@@ -118,7 +119,9 @@
//}, function () {
// taskError(_this);
//});
vatReportService.updateConfig(vatSessionService.project.id, true, vatSessionService.month).success(function (data) {
vatReportService.updateConfig(vatSessionService.project.id, true, vatSessionService.month,
vatSessionService.logUser.id ? vatSessionService.logUser.id : "",
$scope.isMergeManualDataSource ).success(function (data) {
var data = {result: true};
updateProgress(data, _this);
//vatReportService.getTemplateReferences(vatSessionService.month).then(function (refData) {
......@@ -240,7 +243,8 @@
});
};
function doStartCaculate() {
function doStartCaculate(isMergeManualDataSource) {
$scope.isMergeManualDataSource = isMergeManualDataSource;
$scope.readonly = true;
$scope.resolveRef.length = 0;
$scope.resolveRef.push({
......@@ -287,7 +291,31 @@
},
function (isConfirm) {
if (isConfirm) {
doStartCaculate();
vatReportService.hasManualDataSource(vatSessionService.project.id,vatSessionService.month).then(function (hasManual) {
if(hasManual){
swal({
title: "warning!",
text: "是否保留手工数据!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Yes'),
cancelButtonText: $translate.instant('No'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
doStartCaculate(true);
}else{
doStartCaculate(false);
}
});
}else{
doStartCaculate(false);
}
}
}
else {
swal.close();
......@@ -295,7 +323,7 @@
});
}
else {
doStartCaculate();
doStartCaculate(false);
}
};
......
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