Commit 89cee29d authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_oracle' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_oracle

parents 6044f0ef 3c5011e2
...@@ -65,9 +65,9 @@ public class ApprovalController { ...@@ -65,9 +65,9 @@ public class ApprovalController {
} }
@ResponseBody @ResponseBody
@RequestMapping(value = "/check/{taskId}",method = RequestMethod.PUT) @RequestMapping(value = "/check/{projectId}/{period}",method = RequestMethod.PUT)
public void check(@PathVariable String taskId, @RequestParam String decide, @RequestParam String comment) {//only for manager role public void check(@PathVariable String projectId,@PathVariable Integer period, @RequestParam String decide, @RequestParam String comment) {//only for manager role
approvalService.checkTask(taskId, decide,comment); approvalService.checkTask(projectId, period, decide,comment);
} }
@ResponseBody @ResponseBody
...@@ -151,29 +151,5 @@ public class ApprovalController { ...@@ -151,29 +151,5 @@ public class ApprovalController {
} }
private void mocoDisAggreAndOver() {
logger.debug("------------------------update db -----------------------------------");
logger.debug("dis aggre");
logger.debug("------------------------updage db-----------------------------------");
}
private void mocoAggreAndOver() {
logger.debug("------------------------update db-----------------------------------");
logger.debug("aggree");
logger.debug("------------------------update db-----------------------------------");
}
private void mocoHasCommittedAndOver() {
logger.debug("-------------------------update db----------------------------------");
logger.debug("has committed");
logger.debug("-------------------------update db----------------------------------");
}
private void mocoInsert(ApprovalDto dto) {
logger.debug("-------------------------insert db----------------------------------");
logger.debug("save approval {}", dto.toString());
logger.debug("-------------------------insert db----------------------------------");
}
} }
...@@ -37,6 +37,13 @@ public class InputInvoiceImportController { ...@@ -37,6 +37,13 @@ public class InputInvoiceImportController {
private IdentityServiceImpl identityService; private IdentityServiceImpl identityService;
private Logger logger = LoggerFactory.getLogger(InputInvoiceImportController.class); private Logger logger = LoggerFactory.getLogger(InputInvoiceImportController.class);
@RequestMapping(value = "inputInvoicePreviewAllList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
List<InputInvoice> getInputInvoiceTree(@RequestBody InputInvoicePreviewQueryParam paras,
@RequestHeader("from") String projectId) {
return inputInvoiceDataImportService.getInputInvoiceTree(paras, projectId);
}
@RequestMapping(value = "inputInvoicePreviewList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "inputInvoicePreviewList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody public @ResponseBody
PageInfo<InputInvoice> getInputInvoiceTreeViewData(@RequestBody InputInvoicePreviewQueryParam paras, PageInfo<InputInvoice> getInputInvoiceTreeViewData(@RequestBody InputInvoicePreviewQueryParam paras,
......
...@@ -52,6 +52,12 @@ public class OutputInvoiceController { ...@@ -52,6 +52,12 @@ public class OutputInvoiceController {
return outputInvoiceService.queryOutputInvoiceList(queryDto,projectId); return outputInvoiceService.queryOutputInvoiceList(queryDto,projectId);
} }
@RequestMapping(value = "queryOutputInvoiceAllList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public List<OutputInvoice> queryOutputInvoiceAllList(@RequestBody QueryOutputDto queryDto,
@RequestHeader("from") String projectId) {
return outputInvoiceService.queryOutputInvoiceAllList(queryDto,projectId);
}
@RequestMapping(value = "getExportOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getExportOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadInvoiceQueryData(@RequestBody QueryOutputDto paras, @RequestHeader("from") String projectId, HttpServletResponse response) { public void downloadInvoiceQueryData(@RequestBody QueryOutputDto paras, @RequestHeader("from") String projectId, HttpServletResponse response) {
response.setContentType("application/vnd.ms-excel;charset=utf-8"); response.setContentType("application/vnd.ms-excel;charset=utf-8");
......
...@@ -12,7 +12,7 @@ public class OrganizationShort { ...@@ -12,7 +12,7 @@ public class OrganizationShort {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getName() { public String getName() {
......
...@@ -15,7 +15,7 @@ public class DimensinTypeOrgDto { ...@@ -15,7 +15,7 @@ public class DimensinTypeOrgDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getName() { public String getName() {
......
...@@ -40,7 +40,7 @@ public class DimensionDto { ...@@ -40,7 +40,7 @@ public class DimensionDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getName() { public String getName() {
......
...@@ -24,7 +24,7 @@ public class DimensionValueDto { ...@@ -24,7 +24,7 @@ public class DimensionValueDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getName() { public String getName() {
......
...@@ -19,7 +19,7 @@ public class DimensionValueJoinDimensionDto { ...@@ -19,7 +19,7 @@ public class DimensionValueJoinDimensionDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getDimensionName() { public String getDimensionName() {
......
...@@ -50,7 +50,7 @@ public class UnionDimensionValueOrg { ...@@ -50,7 +50,7 @@ public class UnionDimensionValueOrg {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
} }
...@@ -13,7 +13,7 @@ public class OrgCountDto { ...@@ -13,7 +13,7 @@ public class OrgCountDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getName() { public String getName() {
......
...@@ -76,7 +76,7 @@ public class OrgGeneralInfoMiddleDto { ...@@ -76,7 +76,7 @@ public class OrgGeneralInfoMiddleDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getOrgName() { public String getOrgName() {
......
package pwc.taxtech.atms.dto.permission; package pwc.taxtech.atms.dto.permission;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List; import java.util.List;
public class OrganizationPermissionDto { public class OrganizationPermissionDto {
@JsonProperty("ID")
private String id; private String id;
private String name; private String name;
...@@ -17,7 +14,7 @@ public class OrganizationPermissionDto { ...@@ -17,7 +14,7 @@ public class OrganizationPermissionDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getName() { public String getName() {
......
package pwc.taxtech.atms.dto.permission; package pwc.taxtech.atms.dto.permission;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List; import java.util.List;
public class OrganizationPermissionKeyDto { public class OrganizationPermissionKeyDto {
@JsonProperty("ID")
private String id; private String id;
private String name; private String name;
...@@ -18,7 +14,7 @@ public class OrganizationPermissionKeyDto { ...@@ -18,7 +14,7 @@ public class OrganizationPermissionKeyDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getName() { public String getName() {
......
...@@ -39,7 +39,7 @@ public class PermissionDto { ...@@ -39,7 +39,7 @@ public class PermissionDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getName() { public String getName() {
......
...@@ -15,7 +15,7 @@ public class PermissionKeyDto { ...@@ -15,7 +15,7 @@ public class PermissionKeyDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getCode() { public String getCode() {
......
...@@ -25,7 +25,7 @@ public class UserPermissionDto { ...@@ -25,7 +25,7 @@ public class UserPermissionDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getUserName() { public String getUserName() {
......
...@@ -25,7 +25,7 @@ public class UserPermissionKeyDto { ...@@ -25,7 +25,7 @@ public class UserPermissionKeyDto {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getUserName() { public String getUserName() {
......
...@@ -30,7 +30,7 @@ public class DimensionUser { ...@@ -30,7 +30,7 @@ public class DimensionUser {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getDimensionId() { public String getDimensionId() {
......
...@@ -36,7 +36,7 @@ public class UserRoleDisplayInfo { ...@@ -36,7 +36,7 @@ public class UserRoleDisplayInfo {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getUserId() { public String getUserId() {
......
...@@ -28,7 +28,7 @@ public class UserRoleQuery { ...@@ -28,7 +28,7 @@ public class UserRoleQuery {
} }
public void setId(String id) { public void setId(String id) {
id = id; this.id = id;
} }
public String getUserId() { public String getUserId() {
......
...@@ -20,5 +20,6 @@ public class Exceptions { ...@@ -20,5 +20,6 @@ public class Exceptions {
public static final ApiException NOT_FOUND_EXCEPTION = new NotFoundException("not found resources"); public static final ApiException NOT_FOUND_EXCEPTION = new NotFoundException("not found resources");
public static final ApiException REPORT_IN_PROCESS_OR_AGREED_EXCEPTION = new PreconditionFailedException("report in approval or agreed result"); public static final ApiException REPORT_IN_PROCESS_OR_AGREED_EXCEPTION = new PreconditionFailedException("report in approval or agreed result");
public static final FormulaException PROJECT_NOT_FOUND = new FormulaException("project not found");; public static final FormulaException PROJECT_NOT_FOUND = new FormulaException("project not found");;
public static final FormulaException PSUM_CELL_TEMP_NULL = new FormulaException("cell template group is null or empty"); ; public static final FormulaException PSUM_CELL_TEMP_NULL = new FormulaException("cell template group is null or empty");
public static final ApiException NOT_FOUND_INSTANCE_EXCEPTION = new NotFoundException("not found instance");
} }
...@@ -55,9 +55,7 @@ public class ApprovalService { ...@@ -55,9 +55,7 @@ public class ApprovalService {
public List<ApprovalTaskInfo> getTask() { public List<ApprovalTaskInfo> getTask() {
String userId = authUserHelper.getCurrentUserId();//TODO query user role from sesstion or db return periodApproveMapper.queryApprovalList();
String assignee = ("66933E7B-DA75-4B2E-B7D6-AB65DCA20D50".equalsIgnoreCase(userId)) ? "manager" : "accountant";
return periodApproveMapper.queryApprovalList(assignee.equalsIgnoreCase("manager") ? null : userId);
} }
private void startInstance(ApprovalDto dto, PeriodApprove pa) { private void startInstance(ApprovalDto dto, PeriodApprove pa) {
...@@ -125,7 +123,10 @@ public class ApprovalService { ...@@ -125,7 +123,10 @@ public class ApprovalService {
@Transactional @Transactional
public void checkTask(String instanceId, String decide,String comment) { public void checkTask(String projectId,Integer period, String decide,String comment) {
PeriodApprove approve= periodApproveMapper.getInstanceIdByProjectIdAndPeriod(projectId,period);
MyAsserts.assertTrue(approve!=null&&approve.getStatus().equals("committed"),Exceptions.NOT_FOUND_INSTANCE_EXCEPTION);
String instanceId = approve.getInstanceId();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
PeriodApprove pa = new PeriodApprove(); PeriodApprove pa = new PeriodApprove();
switch (decide) { switch (decide) {
......
...@@ -73,7 +73,7 @@ public class OutputInvoiceServiceImpl { ...@@ -73,7 +73,7 @@ public class OutputInvoiceServiceImpl {
@Autowired @Autowired
private OutputInvoiceDetailMapper outputInvoiceDetailMapper; private OutputInvoiceDetailMapper outputInvoiceDetailMapper;
public PageInfo<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto, String projectId) { public List<OutputInvoice> queryOutputInvoiceAllList(QueryOutputDto queryDto, String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId); Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId()); Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
...@@ -89,9 +89,6 @@ public class OutputInvoiceServiceImpl { ...@@ -89,9 +89,6 @@ public class OutputInvoiceServiceImpl {
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd())) DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()))
.andFPZTNotEqualTo("1"); .andFPZTNotEqualTo("1");
} }
PageHelper.startPage(queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize());
List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample); List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample);
DecimalFormat df = new DecimalFormat("#,###.00"); DecimalFormat df = new DecimalFormat("#,###.00");
invoices.stream().forEach(x -> { invoices.stream().forEach(x -> {
...@@ -99,7 +96,11 @@ public class OutputInvoiceServiceImpl { ...@@ -99,7 +96,11 @@ public class OutputInvoiceServiceImpl {
x.setHJSE(df.format(new BigDecimal(x.getHJSE()))); x.setHJSE(df.format(new BigDecimal(x.getHJSE())));
} }
); );
PageInfo<OutputInvoice> pageInfo = new PageInfo<>(invoices); return invoices;
}
public PageInfo<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto, String projectId) {
PageInfo<OutputInvoice> pageInfo = new PageInfo<>(queryOutputInvoiceAllList(queryDto, projectId));
return pageInfo; return pageInfo;
} }
......
package pwc.taxtech.atms.vat.service.impl; package pwc.taxtech.atms.vat.service.impl;
import com.google.common.collect.Lists;
import jdk.nashorn.internal.runtime.options.Option;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
...@@ -16,20 +14,16 @@ import org.slf4j.Logger; ...@@ -16,20 +14,16 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.common.POIUtil; import pwc.taxtech.atms.common.POIUtil;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.CellDataSourceType; import pwc.taxtech.atms.constant.enums.CellDataSourceType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dao.ProjectMapper; import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dto.vatdto.CellCalcInfoDto; import pwc.taxtech.atms.dto.vatdto.CellCalcInfoDto;
import pwc.taxtech.atms.dto.vatdto.PeriodResources; import pwc.taxtech.atms.dto.vatdto.PeriodResources;
import pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.service.impl.DistributedIdService; import pwc.taxtech.atms.service.impl.DistributedIdService;
import pwc.taxtech.atms.service.impl.HttpFileService; import pwc.taxtech.atms.service.impl.HttpFileService;
import pwc.taxtech.atms.vat.dao.*; import pwc.taxtech.atms.vat.dao.*;
import pwc.taxtech.atms.vat.dpo.MergerManaualCellData;
import pwc.taxtech.atms.vat.dpo.PeriodCellTemplateConfigExtendDto; import pwc.taxtech.atms.vat.dpo.PeriodCellTemplateConfigExtendDto;
import pwc.taxtech.atms.vat.entity.*; import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.service.impl.report.functions.*; import pwc.taxtech.atms.vat.service.impl.report.functions.*;
...@@ -44,7 +38,6 @@ import java.util.regex.Pattern; ...@@ -44,7 +38,6 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static pwc.taxtech.atms.common.util.SpringContextUtil.reportMapper; import static pwc.taxtech.atms.common.util.SpringContextUtil.reportMapper;
import static pwc.taxtech.atms.constant.Constant.EMPTY;
import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*; import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*;
@Component @Component
...@@ -517,7 +510,7 @@ public class ReportGeneratorImpl { ...@@ -517,7 +510,7 @@ public class ReportGeneratorImpl {
*/ */
public void addFunctionsAndContext(Workbook workbook, String[] functions, FormulaContext formulaContext) { public void addFunctionsAndContext(Workbook workbook, String[] functions, FormulaContext formulaContext) {
FreeRefFunction[] functionImpls = {new SGSR(formulaContext), new FSJZ(formulaContext), new ND(formulaContext), FreeRefFunction[] functionImpls = {new SGSR(formulaContext), new FSJZ(formulaContext), new ND(formulaContext),
new BB(formulaContext), new XXFP(formulaContext), new GZSD(formulaContext), new ProjectContext(formulaContext) new BB(formulaContext), new XXFP(formulaContext), new GZSD(formulaContext), new PC(formulaContext)
, new JXFPMX(formulaContext), new JXFP(formulaContext), new PSUM(formulaContext), new DFFS(formulaContext), , new JXFPMX(formulaContext), new JXFP(formulaContext), new PSUM(formulaContext), new DFFS(formulaContext),
new JFFS(formulaContext), new WPSR(formulaContext)}; new JFFS(formulaContext), new WPSR(formulaContext)};
UDFFinder udfs = new DefaultUDFFinder(functions, functionImpls); UDFFinder udfs = new DefaultUDFFinder(functions, functionImpls);
......
...@@ -50,7 +50,7 @@ import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*; ...@@ -50,7 +50,7 @@ import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*;
public class ReportServiceImpl { public class ReportServiceImpl {
private final static Logger logger = LoggerFactory.getLogger(ReportServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(ReportServiceImpl.class);
private BlockingQueue<PeriodJob> queue = new LinkedBlockingQueue<>(); private BlockingQueue<PeriodJob> queue = new LinkedBlockingQueue<>();
private final static String[] functions = {"SGSR", "FSJZ", "ND", "BB", "XXFP", "GZSD", "ProjectContext", "JXFPMX", private final static String[] functions = {"SGSR", "FSJZ", "ND", "BB", "XXFP", "GZSD", "PC", "JXFPMX",
"JXFP", "PSUM", "DFFS", "JFFS", "WPSR"}; "JXFP", "PSUM", "DFFS", "JFFS", "WPSR"};
@Autowired @Autowired
...@@ -654,6 +654,8 @@ public class ReportServiceImpl { ...@@ -654,6 +654,8 @@ public class ReportServiceImpl {
dataSourceDto.setDataSourceType(CellDataSourceType.InputInvoice.getCode()); dataSourceDto.setDataSourceType(CellDataSourceType.InputInvoice.getCode());
} else if (a.getType().equals(FormulaDataSourceType.Voucher.getCode())) { } else if (a.getType().equals(FormulaDataSourceType.Voucher.getCode())) {
dataSourceDto.setDataSourceType(CellDataSourceType.Voucher.getCode()); dataSourceDto.setDataSourceType(CellDataSourceType.Voucher.getCode());
} else if(a.getType().equals(FormulaDataSourceType.OutputInvoice.getCode())){
dataSourceDto.setDataSourceType(CellDataSourceType.OutputInvoice.getCode());
} else { } else {
dataSourceDto.setDataSourceType(0); dataSourceDto.setDataSourceType(0);
} }
...@@ -692,6 +694,13 @@ public class ReportServiceImpl { ...@@ -692,6 +694,13 @@ public class ReportServiceImpl {
if (z.getItem2().getItems() != null && !z.getItem2().getItems().isEmpty() && z.getItem2().getItems().get(0).contains("tag")) { if (z.getItem2().getItems() != null && !z.getItem2().getItems().isEmpty() && z.getItem2().getItems().get(0).contains("tag")) {
z.getItem2().getItems().forEach(m -> { z.getItem2().getItems().forEach(m -> {
ReportCellDataSourceDto dto = JSON.parseObject(m, ReportCellDataSourceDto.class); ReportCellDataSourceDto dto = JSON.parseObject(m, ReportCellDataSourceDto.class);
PeriodTemplateExample periodTemplateExample1 = new PeriodTemplateExample();
periodTemplateExample1.createCriteria().andTemplateIdEqualTo(a.getReportTemplateId())
.andPeriodEqualTo(report.getPeriod());
Optional<PeriodTemplate> optional = periodTemplateMapper.selectByExample(periodTemplateExample1).stream().findFirst();
if(optional.isPresent()){
dto.setReportName(optional.get().getName());
}
dataSourceDtoList.add(dto); dataSourceDtoList.add(dto);
}); });
} else } else
......
...@@ -14,10 +14,7 @@ import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; ...@@ -14,10 +14,7 @@ import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto; import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto; import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.entity.AccountMapping; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.AccountMappingExample;
import pwc.taxtech.atms.entity.EnterpriseAccountSetOrg;
import pwc.taxtech.atms.entity.EnterpriseAccountSetOrgExample;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.entity.GlBalance; import pwc.taxtech.atms.vat.entity.GlBalance;
import pwc.taxtech.atms.vat.entity.GlBalanceExample; import pwc.taxtech.atms.vat.entity.GlBalanceExample;
...@@ -70,7 +67,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction { ...@@ -70,7 +67,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
double result = 0; double result = 0;
for(AccountMapping a : accountMappings){ for(AccountMapping a : accountMappings){
result += count(a.getEnterpriseAccountCode(), dataSource, period, year); result += count(a.getEnterpriseAccountCode(), dataSource, period, year, orgId);
} }
Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.FormulaDataSourceDto, FormulaDataSourceDetailType.FormulaDataSourceDto,
...@@ -80,7 +77,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction { ...@@ -80,7 +77,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
return new NumberEval(result); return new NumberEval(result);
} else if(type == 1){ } else if(type == 1){
double result = count(code, dataSource, period, year); double result = count(code, dataSource, period, year, orgId);
Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.FormulaDataSourceDto, FormulaDataSourceDetailType.FormulaDataSourceDto,
new BigDecimal(result), period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId()); new BigDecimal(result), period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
...@@ -95,10 +92,17 @@ public class DFFS extends FunctionBase implements FreeRefFunction { ...@@ -95,10 +92,17 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
return year + "-" + (period > 9 ? period : ("0" + period)); return year + "-" + (period > 9 ? period : ("0" + period));
} }
private double count(String code, List<ReportCellDataSourceDto> contain, int period, int year){ private double count(String code, List<ReportCellDataSourceDto> contain, int period, int year, String orgId){
Organization organization = SpringContextUtil.organizationMapper.selectByPrimaryKey(orgId);
GlBalanceExample glBalanceExample = new GlBalanceExample(); GlBalanceExample glBalanceExample = new GlBalanceExample();
GlBalanceExample.Criteria c1 = glBalanceExample.createCriteria().andSegment3EqualTo(code).andPeriodNameEqualTo(periodName(period, year)); GlBalanceExample.Criteria c1 = glBalanceExample.createCriteria().andSegment3EqualTo(code)
GlBalanceExample.Criteria c2 = glBalanceExample.createCriteria().andSegment4EqualTo(code).andPeriodNameEqualTo(periodName(period, year)); .andPeriodNameEqualTo(periodName(period, year));
GlBalanceExample.Criteria c2 = glBalanceExample.createCriteria().andSegment4EqualTo(code)
.andPeriodNameEqualTo(periodName(period, year));
if(organization != null){
c1.andSegment1EqualTo(organization.getClientCode());
c2.andSegment1EqualTo(organization.getClientCode());
}
glBalanceExample.or(c2); glBalanceExample.or(c2);
List<GlBalance> list = SpringContextUtil.glBalanceMapper.selectByExample(glBalanceExample); List<GlBalance> list = SpringContextUtil.glBalanceMapper.selectByExample(glBalanceExample);
if(CollectionUtils.isEmpty(list)){ if(CollectionUtils.isEmpty(list)){
......
...@@ -12,8 +12,8 @@ import pwc.taxtech.atms.vat.entity.PeriodReport; ...@@ -12,8 +12,8 @@ import pwc.taxtech.atms.vat.entity.PeriodReport;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
public class ProjectContext extends FunctionBase implements FreeRefFunction { public class PC extends FunctionBase implements FreeRefFunction {
public ProjectContext(FormulaContext formulaContext) { public PC(FormulaContext formulaContext) {
super(formulaContext); super(formulaContext);
} }
...@@ -56,13 +56,9 @@ public class ProjectContext extends FunctionBase implements FreeRefFunction { ...@@ -56,13 +56,9 @@ public class ProjectContext extends FunctionBase implements FreeRefFunction {
, formulaContext.getPeriod(), calendar.get(Calendar.DAY_OF_MONTH), formulaContext.getYear() , formulaContext.getPeriod(), calendar.get(Calendar.DAY_OF_MONTH), formulaContext.getYear()
, formulaContext.getPeriod(), calendar2.get(Calendar.DAY_OF_MONTH))); , formulaContext.getPeriod(), calendar2.get(Calendar.DAY_OF_MONTH)));
case "FillForm": case "FillForm":
PeriodReport report = SpringContextUtil.reportMapper.selectByPrimaryKey(formulaContext.getReportId()); Date updateDate = new Date();
if (report != null) { return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillForm, updateDate.getYear()
return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillForm, report.getUpdateTime().getYear() , updateDate.getMonth(), updateDate.getDay()));
, report.getUpdateTime().getMonth(), report.getUpdateTime().getDay()));
} else {
return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillFormStr, " ", " ", " "));
}
case "TaxPayerNo": case "TaxPayerNo":
String taxPayerNo = SpringContextUtil.organizationMapper.selectByPrimaryKey(formulaContext.getOrganizationId()).getTaxPayerNumber(); String taxPayerNo = SpringContextUtil.organizationMapper.selectByPrimaryKey(formulaContext.getOrganizationId()).getTaxPayerNumber();
if (StringUtils.isNotBlank(taxPayerNo) && taxPayerNo.length() - 1 >= parameterInt) { if (StringUtils.isNotBlank(taxPayerNo) && taxPayerNo.length() - 1 >= parameterInt) {
......
package pwc.taxtech.atms.vat.service.impl.report.functions; package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.poi.ss.formula.OperationEvaluationContext; import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.WorkbookEvaluator; import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.*; import org.apache.poi.ss.formula.eval.StringEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -13,10 +14,7 @@ import pwc.taxtech.atms.constant.enums.FormulaDataSourceType; ...@@ -13,10 +14,7 @@ import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto; import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto; import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.entity.PeriodDataSource;
import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -80,16 +78,16 @@ public class PSUM extends FunctionBase implements FreeRefFunction { ...@@ -80,16 +78,16 @@ public class PSUM extends FunctionBase implements FreeRefFunction {
dto.setName(DataSourceName.ReportDataSource); dto.setName(DataSourceName.ReportDataSource);
dto.setPeriod(formulaContext.getPeriod()); dto.setPeriod(formulaContext.getPeriod());
dto.setProjectId(formulaContext.getProjectId()); dto.setProjectId(formulaContext.getProjectId());
dto.setRowIndex(pCell.rowIndex-1); dto.setRowIndex(pCell.rowIndex - 1);
dto.setColumnIndex(pCell.columnIndex-1); dto.setColumnIndex(pCell.columnIndex - 1);
dto.setColumnName((pCell.columnIndex)+"列"); dto.setColumnName((pCell.columnIndex) + "列");
dto.setRowName((pCell.rowIndex)+"行"); dto.setRowName((pCell.rowIndex) + "行");
dto.setReportName(ec.getWorkbook().getSheetName(ec.getSheetIndex())); dto.setReportName(ec.getWorkbook().getSheetName(ec.getSheetIndex()));
dto.setType( FormulaDataSourceType.Report.getCode()); dto.setType(FormulaDataSourceType.Report.getCode());
dataSource.add(dto); dataSource.add(dto);
bigDecimal = bigDecimal.add(cellValue); bigDecimal = bigDecimal.add(cellValue);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -110,6 +110,7 @@ public interface PeriodApproveMapper extends MyVatMapper { ...@@ -110,6 +110,7 @@ public interface PeriodApproveMapper extends MyVatMapper {
@Select("<script>" + @Select("<script>" +
"SELECT " + "SELECT " +
" p.ORGANIZATION_ID AS organizationId, " +
" p.NAME AS projectName, " + " p.NAME AS projectName, " +
" pa.PROJECT_ID AS projectId, " + " pa.PROJECT_ID AS projectId, " +
" pa.PERIOD AS period, " + " pa.PERIOD AS period, " +
...@@ -128,11 +129,8 @@ public interface PeriodApproveMapper extends MyVatMapper { ...@@ -128,11 +129,8 @@ public interface PeriodApproveMapper extends MyVatMapper {
" INNER JOIN PROJECT p ON pa.PROJECT_ID = p.ID " + " INNER JOIN PROJECT p ON pa.PROJECT_ID = p.ID " +
" JOIN \"USER\" u1 ON pa.CREATE_BY = u1.id " + " JOIN \"USER\" u1 ON pa.CREATE_BY = u1.id " +
" LEFT JOIN \"USER\" u2 ON pa.APPROVAL_BY = u2.id " + " LEFT JOIN \"USER\" u2 ON pa.APPROVAL_BY = u2.id " +
"<where> 1=1 " +
" <if test=\"createId != null and createId !='' \">AND pa.CREATE_BY=#{createId}</if>" +
"</where>" +
"</script>") "</script>")
List<ApprovalTaskInfo> queryApprovalList(@Param("createId") String createId); List<ApprovalTaskInfo> queryApprovalList();
@Select("" + @Select("" +
"SELECT " + "SELECT " +
...@@ -143,4 +141,14 @@ public interface PeriodApproveMapper extends MyVatMapper { ...@@ -143,4 +141,14 @@ public interface PeriodApproveMapper extends MyVatMapper {
" ROWNUM = 1" + " ROWNUM = 1" +
"") "")
String getStatusByProjectIdAndPeriod(@Param("projectId") String projectId, @Param("period") Integer period); String getStatusByProjectIdAndPeriod(@Param("projectId") String projectId, @Param("period") Integer period);
@Select("" +
"SELECT " +
" INSTANCE_ID AS instanceId ,STATUS AS status " +
"FROM " +
" ( SELECT * FROM PERIOD_APPROVE WHERE PROJECT_ID = #{projectId} AND PERIOD = #{period} ORDER BY CREATE_TIME DESC ) " +
"WHERE " +
" ROWNUM = 1" +
"")
PeriodApprove getInstanceIdByProjectIdAndPeriod(@Param("projectId") String projectId, @Param("period") Integer period);
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.vat.dpo; ...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.vat.dpo;
import java.sql.Date; import java.sql.Date;
public class ApprovalTaskInfo { public class ApprovalTaskInfo {
private String organizationId;
private String projectName; private String projectName;
private String projectId; private String projectId;
private Integer period; private Integer period;
...@@ -120,4 +121,12 @@ public class ApprovalTaskInfo { ...@@ -120,4 +121,12 @@ public class ApprovalTaskInfo {
public void setTemplateIds(String templateIds) { public void setTemplateIds(String templateIds) {
this.templateIds = templateIds; this.templateIds = templateIds;
} }
public String getOrganizationId() {
return organizationId;
}
public void setOrganizationId(String organizationId) {
this.organizationId = organizationId;
}
} }
...@@ -41,11 +41,11 @@ ...@@ -41,11 +41,11 @@
<label class="cell-info-subject-label">{{'ColumnName' | translate}}:</label> <label class="cell-info-subject-label">{{'ColumnName' | translate}}:</label>
{{detail.cellInfo.column}} {{detail.cellInfo.column}}
</div> </div>
<div class="cell-info-subject"> <!--<div class="cell-info-subject">
<label class="cell-info-subject-label">{{'Formula' | translate}}</label> <label class="cell-info-subject-label">{{'Formula' | translate}}</label>
<formula-translator formula-list="formulaList" key-value-list="keyValueList" include-optional="false" <formula-translator formula-list="formulaList" key-value-list="keyValueList" include-optional="false"
account-data-source="accountDataSource" formula-exp="detail.config.formula"></formula-translator> account-data-source="accountDataSource" formula-exp="detail.config.formula"></formula-translator>
</div> </div>-->
<div class="cell-info-subject"> <div class="cell-info-subject">
<label class="cell-info-subject-label">{{'SourceOrFormula' | translate}}:</label> <label class="cell-info-subject-label">{{'SourceOrFormula' | translate}}:</label>
{{detail.cellInfo.description}} {{detail.cellInfo.description}}
......
commonModule.controller('VatReportViewController', ['$scope', '$rootScope', '$log', '$translate', '$timeout', '$q', '$compile', '$state', '$stateParams', commonModule.controller('VatReportViewController', ['$scope', '$rootScope', '$log', '$translate', '$timeout', '$q', '$compile', '$state', '$stateParams',
'apiInterceptor', 'vatExportService', 'SweetAlert', 'BSPLService', 'vatReportService', 'vatReportCacheService', 'vatSessionService', 'apiInterceptor', 'vatExportService', 'SweetAlert', 'BSPLService', 'vatReportService', 'vatReportCacheService', 'vatSessionService',
'loginContext', 'enums', 'vatCommonService', 'vatWorkflowService', 'projectService', '$uibModal', '$cookies', 'Upload', 'vatImportService','vatApproveService', 'loginContext', 'enums', 'vatCommonService', 'vatWorkflowService', 'projectService', '$uibModal', '$cookies', 'Upload', 'vatImportService','vatApproveService',
function ($scope, $rootScope, $log, $translate, $timeout, $q, $compile, $state, $stateParams, apiInterceptor, vatExportService, SweetAlert, BSPLService, function ($scope, $rootScope, $log, $translate, $timeout, $q, $compile, $state, $stateParams, apiInterceptor, vatExportService, SweetAlert, BSPLService,
...@@ -972,7 +972,7 @@ ...@@ -972,7 +972,7 @@
delete x.cellValue; delete x.cellValue;
}); });
reportData.data.cellData.reportName = node.name; // reportData.data.cellData.reportName = node.name;
reportData.data.cellData.orderIndex = node.orderIndex; reportData.data.cellData.orderIndex = node.orderIndex;
reportData.data.cellData.templateId = node.id; reportData.data.cellData.templateId = node.id;
exportReportData.push(reportData.data.cellData); exportReportData.push(reportData.data.cellData);
...@@ -2538,7 +2538,9 @@ ...@@ -2538,7 +2538,9 @@
}; };
$scope.commitApprove = function(){ $scope.commitApprove = function(){
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.month).success(function(result){ if(vatSessionService.month)
vatSessionService.project.period=vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){
if(result&&result=='committed'){ if(result&&result=='committed'){
SweetAlert.error('报表提审中或审核已通过!'); SweetAlert.error('报表提审中或审核已通过!');
}else{ }else{
...@@ -2568,17 +2570,30 @@ ...@@ -2568,17 +2570,30 @@
} }
$scope.doApprove = function(){ $scope.doApprove = function(){
$("#ApprovalComment").modal('show'); if(vatSessionService.month)
vatSessionService.project.period=vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){
if(result&&result=='committed'){
$("#ApprovalComment").modal('show')
}else{
SweetAlert.warning('当前报表未提审,请先提审!');
}
});
;
} }
$scope.rejectApproval =function(){ $scope.rejectApproval =function(){
vatApproveService.checkTask(vatSessionService.approvalInfo.instanceId,'disagreed',$scope.comment).success(function(){ if(vatSessionService.month)
vatSessionService.project.period=vatSessionService.month;
vatApproveService.checkTask(vatSessionService.project.id,vatSessionService.project.period,'disagreed',$scope.comment).success(function(){
$("#ApprovalComment").modal('hide'); $("#ApprovalComment").modal('hide');
}); });
} }
$scope.agreeApproval =function(){ $scope.agreeApproval =function(){
vatApproveService.checkTask(vatSessionService.approvalInfo.instanceId,'agreed',$scope.comment).success(function(){ if(vatSessionService.month)
vatSessionService.project.period=vatSessionService.month;
vatApproveService.checkTask(vatSessionService.project.id,vatSessionService.project.period,'agreed',$scope.comment).success(function(){
vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Completed vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Completed
, constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished); , constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished);
$("#ApprovalComment").modal('hide'); $("#ApprovalComment").modal('hide');
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
return $http.get('/approval/templateInfo/'+templateId, apiConfig.createVat()); return $http.get('/approval/templateInfo/'+templateId, apiConfig.createVat());
}, },
checkTask:function(taskId,decide,comment){ checkTask:function(projectId,period,decide,comment){
return $http.put('/approval/check/'+taskId+'?decide='+decide+'&comment='+comment, {}, apiConfig.createVat()); return $http.put('/approval/check/'+projectId+'/'+period+'?decide='+decide+'&comment='+comment, {}, apiConfig.createVat());
}, },
approvalStatus:function(projectId,period){ approvalStatus:function(projectId,period){
......
...@@ -5,6 +5,25 @@ ...@@ -5,6 +5,25 @@
return $http.get('url', apiConfig.createVat()); return $http.get('url', apiConfig.createVat());
}, },
queryOutputInvoiceAllList: function (param) {
return $http.post('/outputInvoiceImport/queryOutputInvoiceAllList', {
// PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
InvoiceType: param.invoiceType,
StartInvoiceDate: param.invoiceDateStart,
EndInvoiceDate: param.invoiceDateEnd,
ClassCode: param.classCode,
InvoiceNumber: param.invoiceNumber,
BuyerName: param.buyerName,
ProductName: param.productName,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
}, apiConfig.createVat());
},
queryOutputInvoiceList: function (param) { queryOutputInvoiceList: function (param) {
return $http.post('/outputInvoiceImport/queryOutputInvoiceList', { return $http.post('/outputInvoiceImport/queryOutputInvoiceList', {
PageInfo: param.pageInfo, PageInfo: param.pageInfo,
...@@ -49,22 +68,41 @@ ...@@ -49,22 +68,41 @@
queryInputInvoiceList: function (param) { queryInputInvoiceList: function (param) {
return $http.post('/inputInvoiceImport/inputInvoicePreviewList', { return $http.post('/inputInvoiceImport/inputInvoicePreviewList', {
PageInfo: param.pageInfo, PageInfo: param.pageInfo,
PeriodStart: param.periodStart, PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd, PeriodEnd: param.periodEnd,
CertificationDateStart: param.certificationDateStart, CertificationDateStart: param.certificationDateStart,
CertificationDateEnd: param.certificationDateEnd, CertificationDateEnd: param.certificationDateEnd,
InvoiceCode: param.invoiceCode, InvoiceCode: param.invoiceCode,
InvoiceNumber: param.invoiceNumber, InvoiceNumber: param.invoiceNumber,
SellerTaxNumber: param.sellerTaxNumber, SellerTaxNumber: param.sellerTaxNumber,
AmountStart: param.amountStart, AmountStart: param.amountStart,
AmountEnd: param.amountEnd, AmountEnd: param.amountEnd,
InvoiceType: param.invoiceType, InvoiceType: param.invoiceType,
TaxAmountStart: param.taxAmountStart, TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd, TaxAmountEnd: param.taxAmountEnd,
CertificationStatus: param.certificationStatus CertificationStatus: param.certificationStatus
}, apiConfig.createVat()); }, apiConfig.createVat());
},
queryInputInvoiceAllList: function (param) {
return $http.post('/inputInvoiceImport/inputInvoicePreviewAllList', {
// PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
CertificationDateStart: param.certificationDateStart,
CertificationDateEnd: param.certificationDateEnd,
InvoiceCode: param.invoiceCode,
InvoiceNumber: param.invoiceNumber,
SellerTaxNumber: param.sellerTaxNumber,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
InvoiceType: param.invoiceType,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
CertificationStatus: param.certificationStatus
}, apiConfig.createVat());
}, },
queryInputInvoiceItemList: function (inputInvoiceID) { queryInputInvoiceItemList: function (inputInvoiceID) {
......
...@@ -10,17 +10,9 @@ frameworkModule.controller('appSideBarController', ['$scope', '$log', 'menuServi ...@@ -10,17 +10,9 @@ frameworkModule.controller('appSideBarController', ['$scope', '$log', 'menuServi
$log.debug('appSideBarController.ctor()...'); $log.debug('appSideBarController.ctor()...');
userService.getUserPermission(loginContext.userName).success(function (data) { userService.getUserPermission(loginContext.userName).success(function (data) {
$timeout(function () { $timeout(function () {
menuService.getMenusForDisplay(1).success(function (menuData) { menuService.getMenusForDisplay(1).success(function (menuData) {
$scope.menuData = menuData; $scope.menuData = menuData;
$scope.menuData[2].subMenus[0].isVisible = true;
$scope.menuData[2].subMenus[1].isVisible = false;
$scope.menuData[2].subMenus[3].isVisible = false;
$scope.menuData[2].subMenus[4].isVisible = true;
$scope.menuData[2].subMenus[5].isVisible = true;
$window.location.href = '#/adminHomePage';
}); });
}, 500); }, 500);
......
...@@ -82,6 +82,27 @@ ...@@ -82,6 +82,27 @@
}; };
}; };
var countTotal = function(){
$scope.queryParams.pageInfo = {
totalCount: -1,
pageIndex: 1,
pageSize: -1,
totalPage: 0,
};
vatPreviewService.queryInputInvoiceAllList($scope.queryParams).success(function (data) {
if (data) {
var totalMoneyAmount = 0;
var totalTaxAmount = 0;
_.each(data, function (x) {
totalMoneyAmount = totalMoneyAmount + parseFloat(x.hjje.replace(/,/g, ""));
totalTaxAmount = totalTaxAmount + parseFloat(x.hjse.replace(/,/g, ""));
})
$scope.totalMoneyAmount = totalMoneyAmount.toLocaleString();
$scope.totalTaxAmount = totalTaxAmount.toLocaleString();
}
});
};
//从数据库中load数据 //从数据库中load数据
var loadIncomeInvoiceItemDataFromDB = function (pageIndex) { var loadIncomeInvoiceItemDataFromDB = function (pageIndex) {
initIncomeInvoiceItemPagination(); initIncomeInvoiceItemPagination();
...@@ -96,16 +117,6 @@ ...@@ -96,16 +117,6 @@
totalPage: 0, totalPage: 0,
}; };
var countTotal = function(){
var totalMoneyAmount = 0;
var totalTaxAmount = 0;
_.each($scope.gridOptions.data, function (x) {
totalMoneyAmount = totalMoneyAmount + parseFloat(x.hjje.replace(/,/g, ""));
totalTaxAmount = totalTaxAmount + parseFloat(x.hjse.replace(/,/g, ""));
})
$scope.totalMoneyAmount = totalMoneyAmount.toLocaleString();
$scope.totalTaxAmount = totalTaxAmount.toLocaleString();
}
vatPreviewService.queryInputInvoiceList($scope.queryParams).success(function (data) { vatPreviewService.queryInputInvoiceList($scope.queryParams).success(function (data) {
if (data) { if (data) {
...@@ -113,13 +124,12 @@ ...@@ -113,13 +124,12 @@
var index = 1; var index = 1;
data.list.forEach(function (v) { data.list.forEach(function (v) {
v.index = index++; v.index = index++;
v.amount = PWC.round(v.amount, 2); v.amount = PWC.round(parseFloat(v.hjje.replace(/,/g, "")), 2);
v.taxAmount = PWC.round(v.taxAmount, 2); v.taxAmount = PWC.round(parseFloat(v.hjse.replace(/,/g, "")), 2);
}); });
$scope.gridOptions.data = data.list; $scope.gridOptions.data = data.list;
$scope.queryIncomeInvoiceItemResult.pageInfo = data; $scope.queryIncomeInvoiceItemResult.pageInfo = data;
computeIncomeInvoiceItemPage(); computeIncomeInvoiceItemPage();
countTotal();
} }
}); });
}; };
...@@ -636,6 +646,7 @@ ...@@ -636,6 +646,7 @@
//初始化查询条件-期间范围 //初始化查询条件-期间范围
$scope.queryParams.periodStart = vatSessionService.month; $scope.queryParams.periodStart = vatSessionService.month;
$scope.queryParams.periodEnd = vatSessionService.month; $scope.queryParams.periodEnd = vatSessionService.month;
countTotal();
loadIncomeInvoiceItemDataFromDB(1); loadIncomeInvoiceItemDataFromDB(1);
})(); })();
......
...@@ -68,6 +68,23 @@ ...@@ -68,6 +68,23 @@
$scope.queryParams.periodEnd = vatSessionService.month; $scope.queryParams.periodEnd = vatSessionService.month;
}; };
var countTotal = function(){
var totalMoneyAmount = 0;
var totalTaxAmount = 0;
vatPreviewService.queryOutputInvoiceAllList($scope.queryParams).success(function (data) {
if (data) {
_.each(data, function (x) {
totalMoneyAmount += parseFloat(x.hjje.replace(/,/g, ""));
totalTaxAmount += parseFloat(x.hjse.replace(/,/g, ""));
})
}
$scope.totalMoneyAmount = totalMoneyAmount.toLocaleString();
$scope.totalTaxAmount = totalTaxAmount.toLocaleString();
}).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
}
//从数据库中load数据 //从数据库中load数据
var loadOutputInvoiceDataFromDB = function (pageIndex) { var loadOutputInvoiceDataFromDB = function (pageIndex) {
initOutputInvoicePagination(); initOutputInvoicePagination();
...@@ -81,24 +98,15 @@ ...@@ -81,24 +98,15 @@
totalPage: 0, totalPage: 0,
} }
var countTotal = function(){
var totalMoneyAmount = 0;
var totalTaxAmount = 0;
_.each($scope.gridOptions.data, function (x) {
totalMoneyAmount = totalMoneyAmount + parseFloat(x.hjje.replace(/,/g, ""));
totalTaxAmount = totalTaxAmount + parseFloat(x.hjse.replace(/,/g, ""));
})
$scope.totalMoneyAmount = totalMoneyAmount.toLocaleString();
$scope.totalTaxAmount = totalTaxAmount.toLocaleString();
}
vatPreviewService.queryOutputInvoiceList($scope.queryParams).success(function (data) { vatPreviewService.queryOutputInvoiceList($scope.queryParams).success(function (data) {
if (data) { if (data) {
var index = 1; var index = 1;
data.list.forEach(function (v) { data.list.forEach(function (v) {
v.index = index++; v.index = index++;
v.amount = PWC.round(v.amount, 2); v.amount = PWC.round(parseFloat(v.hjje.replace(/,/g, "")), 2);
v.taxAmount = PWC.round(v.taxAmount, 2); v.taxAmount = PWC.round(parseFloat(v.hjse.replace(/,/g, "")), 2);
}); });
$scope.gridOptions.data = data.list; $scope.gridOptions.data = data.list;
$scope.queryOutputInvoiceResult.pageInfo = data; $scope.queryOutputInvoiceResult.pageInfo = data;
...@@ -381,7 +389,7 @@ ...@@ -381,7 +389,7 @@
var criteria = JSON.stringify($scope.queryParams); var criteria = JSON.stringify($scope.queryParams);
if (browserService.isIE() || browserService.isEdge()) if (browserService.isIE() || browserService.isEdge())
criteria = encodeURIComponent(criteria); criteria = encodeURIComponent(criteria);
countTotal();
loadOutputInvoiceDataFromDB(1); loadOutputInvoiceDataFromDB(1);
$('.filter-button').popover("hide"); $('.filter-button').popover("hide");
}; };
...@@ -407,6 +415,7 @@ ...@@ -407,6 +415,7 @@
$scope.criteriaList = []; $scope.criteriaList = [];
$scope.queryParams.periodStart = startMonth; $scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth; $scope.queryParams.periodEnd = endMonth;
countTotal();
loadOutputInvoiceDataFromDB(1); loadOutputInvoiceDataFromDB(1);
$('.filter-button').popover("hide"); $('.filter-button').popover("hide");
}; };
...@@ -598,7 +607,7 @@ ...@@ -598,7 +607,7 @@
endMonth = result[1][0]; endMonth = result[1][0];
$scope.queryParams.periodStart = startMonth; $scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth; $scope.queryParams.periodEnd = endMonth;
countTotal();
loadOutputInvoiceDataFromDB(1); loadOutputInvoiceDataFromDB(1);
}); });
...@@ -651,6 +660,7 @@ ...@@ -651,6 +660,7 @@
$scope.showPopover = showPopover; $scope.showPopover = showPopover;
initPeriods(); initPeriods();
initOutputInvoicePagination(); initOutputInvoicePagination();
countTotal();
loadOutputInvoiceDataFromDB(1); loadOutputInvoiceDataFromDB(1);
})(); })();
} }
......
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