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 { ...@@ -30,15 +30,17 @@ public class ReportController {
public OperationResultDto updateConfig(@PathVariable String projectId, public OperationResultDto updateConfig(@PathVariable String projectId,
@PathVariable Boolean ifDeleteManualDataSource, @PathVariable Boolean ifDeleteManualDataSource,
@PathVariable Integer period, @PathVariable Integer period,
@RequestParam String generator) { @RequestParam String generator,
return reportService.updateConfig(projectId, period, ifDeleteManualDataSource, generator,true); @RequestParam Boolean mergeManual) {
return reportService.updateConfig(projectId, period, ifDeleteManualDataSource, generator, mergeManual);
// OperationResultDto operationResultDto = new OperationResultDto(); // OperationResultDto operationResultDto = new OperationResultDto();
// operationResultDto.setResult(true); // operationResultDto.setResult(true);
// return operationResultDto; // return operationResultDto;
} }
@RequestMapping(value = "generateByTotal/{projectId}/{ifDeleteManualDataSource}/{period}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @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); return reportService.generateData(projectId, EnumServiceType.VAT, ifDeleteManualDataSource, period, null, generator);
} }
...@@ -124,4 +126,9 @@ public class ReportController { ...@@ -124,4 +126,9 @@ public class ReportController {
public OperationResultDto<String> getDataSourceDetailList(@PathVariable Long dataSourceId) { public OperationResultDto<String> getDataSourceDetailList(@PathVariable Long dataSourceId) {
return reportService.getDataSourceDetailList(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 { ...@@ -1216,4 +1216,8 @@ public class ReportServiceImpl {
return ""; return "";
} }
} }
public Boolean hasManualDataSource(String projectId, Integer period) {
return periodReportMapper.hasManualDataSource(projectId, period) > 0;
}
} }
...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.vat.dao; ...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.vat.dao;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper; import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.PeriodReport; import pwc.taxtech.atms.vat.entity.PeriodReport;
...@@ -105,4 +106,16 @@ public interface PeriodReportMapper extends MyVatMapper { ...@@ -105,4 +106,16 @@ public interface PeriodReportMapper extends MyVatMapper {
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(PeriodReport record); 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 @@ ...@@ -42,14 +42,14 @@
// citUpdateConfig: function (projectId, period?) // citUpdateConfig: function (projectId, period?)
// citGetTemplate: function (projectId, period?) // citGetTemplate: function (projectId, period?)
updateConfig: function (projectId, ifDeleteManualDataSource, period, generator) { updateConfig: function (projectId, ifDeleteManualDataSource, period, generator,isMergeManualDataSource) {
return $http.post('/Report/updateConfig/' + projectId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true})); return $http.post('/Report/updateConfig/' + projectId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator+ '&mergeManual='+isMergeManualDataSource, {}, apiConfig.createVat({ignoreLoadingBar: true}));
}, },
generate: function (projectId, templateId, ifDeleteManualDataSource, period, generator) { generate: function (projectId, templateId, ifDeleteManualDataSource, period, generator) {
return $http.post('/Report/generate/' + projectId + '/' + templateId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true})); return $http.post('/Report/generate/' + projectId + '/' + templateId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true}));
}, },
generateAll: function (projectId, ifDeleteManualDataSource, period, generator) { 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) { getReportData: function (reportId) {
return $http.get('/Report/reportData/' + reportId, apiConfig.createVat()); return $http.get('/Report/reportData/' + reportId, apiConfig.createVat());
...@@ -178,7 +178,11 @@ ...@@ -178,7 +178,11 @@
}, },
getDataSourceDetailList: function (dataSourceId) { getDataSourceDetailList: function (dataSourceId) {
return $http.get('/Report/getDataSourceDetailList/' + dataSourceId, apiConfig.createVat()); 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 @@ ...@@ -11,6 +11,7 @@
var taskList = []; var taskList = [];
var fixedRef = []; var fixedRef = [];
$scope.period = vatSessionService.month; $scope.period = vatSessionService.month;
$scope.isMergeManualDataSource = false;
$scope.moduleid = enums.vatModuleEnum.Import_CalculateData; $scope.moduleid = enums.vatModuleEnum.Import_CalculateData;
...@@ -118,7 +119,9 @@ ...@@ -118,7 +119,9 @@
//}, function () { //}, function () {
// taskError(_this); // 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}; var data = {result: true};
updateProgress(data, _this); updateProgress(data, _this);
//vatReportService.getTemplateReferences(vatSessionService.month).then(function (refData) { //vatReportService.getTemplateReferences(vatSessionService.month).then(function (refData) {
...@@ -240,7 +243,8 @@ ...@@ -240,7 +243,8 @@
}); });
}; };
function doStartCaculate() { function doStartCaculate(isMergeManualDataSource) {
$scope.isMergeManualDataSource = isMergeManualDataSource;
$scope.readonly = true; $scope.readonly = true;
$scope.resolveRef.length = 0; $scope.resolveRef.length = 0;
$scope.resolveRef.push({ $scope.resolveRef.push({
...@@ -287,7 +291,31 @@ ...@@ -287,7 +291,31 @@
}, },
function (isConfirm) { function (isConfirm) {
if (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 { else {
swal.close(); swal.close();
...@@ -295,7 +323,7 @@ ...@@ -295,7 +323,7 @@
}); });
} }
else { 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