Commit f89cb5ba authored by frank.xa.zhang's avatar frank.xa.zhang

fixed code issues and add datasource for invoice and voucher

parent 244ad198
......@@ -11,6 +11,7 @@ import pwc.taxtech.atms.vat.entity.Report;
import pwc.taxtech.atms.vat.entity.VatEnterpriseAccount;
import pwc.taxtech.atms.vat.service.ReportService;
import javax.print.attribute.standard.Media;
import java.util.List;
@RestController
......@@ -73,13 +74,18 @@ public class ReportController {
return reportService.getStdAccountByIndustry(industryID);
}
@RequestMapping(value = "getCellAccountRange/{reportTemplateId}/{period}/{rowIndex}/{columnIndex}",method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<List<VatEnterpriseAccountResultDto>> getCellAccountRange(@PathVariable Long reportTemplateId, @PathVariable Integer period, @PathVariable int rowIndex, @PathVariable int columnIndex){
return reportService.getCellAccountRange(reportTemplateId,period,rowIndex,columnIndex);
@RequestMapping(value = "getCellAccountRange/{reportTemplateId}/{period}/{rowIndex}/{columnIndex}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<List<VatEnterpriseAccountResultDto>> getCellAccountRange(@PathVariable Long reportTemplateId, @PathVariable Integer period, @PathVariable int rowIndex, @PathVariable int columnIndex) {
return reportService.getCellAccountRange(reportTemplateId, period, rowIndex, columnIndex);
}
@RequestMapping(value = "addCellManualData",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto addCellManualDataSource(@RequestBody ManualDataSourceDto data){
@RequestMapping(value = "addCellManualData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto addCellManualDataSource(@RequestBody ManualDataSourceDto data) {
return reportService.addCellManualDataSource(data);
}
@RequestMapping(value = "addDataSource", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<String> addDataSource(@RequestBody DataSourceDto datasource) {
return reportService.addDataSource(datasource);
}
}
\ No newline at end of file
......@@ -71,7 +71,12 @@ public final class CellConfigTranslater {
}
}
Optional<CellTemplateConfig> invoiceItem = configList.stream().filter(x -> x.getDataSourceType().equals(CellDataSourceType.OutputInvoice.getCode()) || x.getDataSourceType().equals(CellDataSourceType.InputInvoice.getCode()) || x.getDataSourceType().equals(CellDataSourceType.CustomInvoice.getCode())).findFirst();
Optional<CellTemplateConfig> invoiceItem = configList
.stream()
.filter(x -> x.getDataSourceType().equals(CellDataSourceType.OutputInvoice.getCode())
|| x.getDataSourceType().equals(CellDataSourceType.InputInvoice.getCode())
|| x.getDataSourceType().equals(CellDataSourceType.CustomInvoice.getCode()))
.findFirst();
if (invoiceItem.isPresent()) {
cellTemplateConfigDto.setHasInvoice(true);
cellTemplateConfigDto.setInvoiceType(invoiceItem.get().getInvoiceType());
......
package pwc.taxtech.atms.service.impl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.util.SnowFlake;
import javax.annotation.PostConstruct;
@Service
@Component
public class DistributedIDService extends BaseService {
@Value("${distributed_id_datacenter}")
private Integer dataCenterId;
......
......@@ -131,6 +131,8 @@ public interface DataSourceMapper extends MyVatMapper {
void clearReportWithPeriod(Integer period);
void clearDataWithPeriod(@Param("exceptReportTemplateIDs") String exceptReportTemplateIDs,@Param("period")Integer period);
List<DataSourceExtendDto> getFormulaDataSource(Long reportID);
List<DataSourceExtendDto> getManualDataSource(Long cellDataID);
......
......@@ -35,4 +35,6 @@ public interface ReportService {
* @return 添加结果
*/
OperationResultDto addCellManualDataSource(ManualDataSourceDto data);
OperationResultDto<String> addDataSource(DataSourceDto datasource);
}
......@@ -526,6 +526,19 @@
<delete id="clearReportWithPeriod">
DELETE FROM report WHERE period=#{period,jdbcType=INTEGER};
</delete>
<delete id="clearDataWithPeriod">
DELETE FROM period_formula_block WHERE period=#{period,jdbcType=INTEGER};
DELETE FROM period_tax_rule_setting WHERE period=#{period,jdbcType=INTEGER};
DELETE FROM period_cell_template WHERE period=#{period,jdbcType=INTEGER} and report_template_id not in (${exceptReportTemplateIDs});
DELETE FROM period_cell_template_config WHERE period=#{period,jdbcType=INTEGER} and report_template_id not in (${exceptReportTemplateIDs});
DELETE FROM period_template WHERE period=#{period,jdbcType=INTEGER} and template_id not in (${exceptReportTemplateIDs});
DELETE FROM period_tax_payer_report_rule WHERE period=#{period,jdbcType=INTEGER};
DELETE d FROM data_source_detail d JOIN data_source f ON d.data_source_id = f.id WHERE f.period = #{period,jdbcType=INTEGER};
DELETE d FROM cell_data_source d JOIN data_source f ON d.data_source_id = f.id WHERE f.period = #{period,jdbcType=INTEGER};
DELETE d FROM data_source d WHERE d.period = #{period,jdbcType=INTEGER};
DELETE c FROM cell_data c join report r on c.report_id=r.id where r.period = #{period,jdbcType=INTEGER};
DELETE FROM report WHERE period=#{period,jdbcType=INTEGER};
</delete>
<resultMap id="DataSourceExtendDtoMap" type="pwc.taxtech.atms.dto.vatdto.DataSourceExtendDto">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="type" jdbcType="INTEGER" property="type"/>
......@@ -591,12 +604,14 @@
<association property="cellData" javaType="pwc.taxtech.atms.vat.entity.CellData">
<id column="cell_data_id" jdbcType="BIGINT" property="id"/>
<result column="cell_data_data" property="data" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result column="cell_data_template_id" property="cellTemplateId" javaType="java.lang.Long" jdbcType="BIGINT"/>
<result column="cell_data_template_id" property="cellTemplateId" javaType="java.lang.Long"
jdbcType="BIGINT"/>
<result column="cell_data_report_id" property="reportId" javaType="java.lang.Long" jdbcType="BIGINT"/>
</association>
<association property="cellDataSource" javaType="pwc.taxtech.atms.vat.entity.CellDataSource">
<id column="cell_data_source_id" jdbcType="BIGINT" property="id"/>
<result column="cell_data_source_operation_type" property="operationType" javaType="java.lang.Integer" jdbcType="INTEGER"/>
<result column="cell_data_source_operation_type" property="operationType" javaType="java.lang.Integer"
jdbcType="INTEGER"/>
</association>
</resultMap>
<select id="getManualDataSource2" parameterType="java.lang.Long" resultMap="dataSourceCellDataDto">
......
......@@ -24479,12 +24479,12 @@
* @param {string} repeatName The left hand side of the repeat expression, indicating
* the name for each item in the array.
* @param {!Function} repeatListExpression A compiled expression based on the right hand side
* of the repeat expression. Points to the array to repeat over.
* @param {string|undefined} extraName The optional extra repeatName.
*/
VirtualRepeatController.prototype.link_ =
function (container, transclude, repeatName, repeatListExpression, extraName) {
this.container = container;
* of the repeat expression. Points to the array to repeat over.
this.transclude = transclude;
this.repeatName = repeatName;
this.rawRepeatListExpression = repeatListExpression;
......@@ -186,7 +186,7 @@
tick-property="ticked" button-label="key" item-label="key" max-labels="1" helper-elements="all none"
translation="langSetting" is-disabled="!hasEditPermission || !ToggleSaveAs || !editModel.hasInvoice"
on-item-click="refreshCategorySelect(data)" class="invoice-category-select"></span>
<span isteven-multi-select ng-hide="!(!editModel.chosenInvoiceOption.rateOptions || editModel.chosenInvoiceOption.rateOptions.length === 0)"
<span isteven-multi-select ng-if="!(!editModel.chosenInvoiceOption.rateOptions || editModel.chosenInvoiceOption.rateOptions.length === 0)"
input-model="editModel.chosenInvoiceOption.rateOptions" output-model="selectedRateOptions" tick-property="ticked"
button-label="key" item-label="key" max-labels="2" helper-elements="all none" translation="langSetting"
is-disabled="!hasEditPermission || !ToggleSaveAs || !editModel.hasInvoice" on-item-click="refreshTaxRateSelect(data)"
......
......@@ -252,13 +252,11 @@ var cacheModule = angular.module('app.cache', ['app.common'])
//Common Bind Module Method
var bindModule = function (thisModule, controllerProvider, compileProvider, filterProvider, provide) {
thisModule.controller = controllerProvider.register;
thisModule.directive = compileProvider.directive;
thisModule.filter = filterProvider.register;
thisModule.factory = provide.factory;
thisModule.service = provide.service;
return thisModule;
};
......@@ -835,7 +833,6 @@ var systemConfigurationModule = angular.module('app.systemConfiguration', ['ngMe
sticky: true
});
$stateProvider.state({
name: 'modelConfiguration',
url: '/modelconfiguration',
......@@ -960,7 +957,6 @@ var adminHomePageModule = angular.module('app.adminHomePage', ["isteven-multi-se
deepStateRedirect: true,
sticky: true
});
}]);
......@@ -972,11 +968,9 @@ var noPermissionPageModule = angular.module('app.noPermissionPage', ["isteven-mu
function ($controllerProvider, $compileProvider, $filterProvider, $provide, scriptDependencyProvider, $stateProvider, $urlRouterProvider) {
'use strict';
// this is required to add controller/directive/filter/service after angular bootstrap
bindModule(noPermissionPageModule, $controllerProvider, $compileProvider, $filterProvider, $provide);
$stateProvider.state({
name: 'noPermissionPage',
url: '/noPermissionPage',
......
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