Commit f79eb50a authored by sherlock's avatar sherlock

Merge branches 'dev_oracle' and 'dev_oracle_sherlock' of…

Merge branches 'dev_oracle' and 'dev_oracle_sherlock' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_oracle_sherlock
parents 800db84b 47b2d550
package pwc.taxtech.atms.common.schedule;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.SchedulerException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import pwc.taxtech.atms.dao.EnterpriseAccountMapper;
import pwc.taxtech.atms.dao.EnterpriseAccountSetOrgMapper;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.UserMapper;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.service.impl.LgGlBalanceService;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;
public class LgGlBalanceJob extends QuartzJobBean {
......@@ -25,12 +24,10 @@ public class LgGlBalanceJob extends QuartzJobBean {
public static final String ORG_ID = "org_id";
public static final String PERIOD = "period";
@Autowired
private EnterpriseAccountMapper accountMapper;
@Autowired
private OrganizationMapper orgMapper;
@Autowired
private EnterpriseAccountSetOrgMapper setOrgMapper;
@Resource
private LgGlBalanceService lgGlBalanceService;
@Override
protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
......@@ -45,10 +42,15 @@ public class LgGlBalanceJob extends QuartzJobBean {
}
for (Organization organization : orgList) {
try {
SimpleDateFormat dateFormat = new SimpleDateFormat(Constant.DateFormat.YEAR_MONTH);
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.MONTH, -1);
period = StringUtils.isBlank(period) ? dateFormat.format(calendar.getTime()) : period;
lgGlBalanceService.queryGlBalance(organization, period);
} catch (Exception e) {
LOGGER.error("LgGlBalanceJob error. Organization: " + organization.getId(), e);
}
}
}
}
......@@ -65,9 +65,9 @@ public class ApprovalController {
}
@ResponseBody
@RequestMapping(value = "/check/{taskId}",method = RequestMethod.PUT)
public void check(@PathVariable String taskId, @RequestParam String decide, @RequestParam String comment) {//only for manager role
approvalService.checkTask(taskId, decide,comment);
@RequestMapping(value = "/check/{projectId}/{period}",method = RequestMethod.PUT)
public void check(@PathVariable String projectId,@PathVariable Integer period, @RequestParam String decide, @RequestParam String comment) {//only for manager role
approvalService.checkTask(projectId, period, decide,comment);
}
@ResponseBody
......@@ -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----------------------------------");
}
}
package pwc.taxtech.atms.controller;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.service.impl.ReportAnalysisService;
import javax.annotation.Resource;
import java.util.Collections;
@RestController
@RequestMapping("/api/v1/reportAnalysis")
public class ReportAnalysisController extends BaseController {
@Resource
private ReportAnalysisService reportAnalysisService;
@GetMapping("/burdenRateData/{projectId}")
public ApiResultDto getBurdenRateData(@PathVariable String projectId) {
if (StringUtils.isBlank(projectId)) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(reportAnalysisService.getBurdenRateData(projectId));
} catch (Exception e) {
logger.error("getBurdenRateData error.", e);
}
return ApiResultDto.fail();
}
@GetMapping("/dispersion/{projectId}")
public ApiResultDto dispersion(@PathVariable String projectId) {
if (StringUtils.isBlank(projectId)) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(reportAnalysisService.getDispersion(projectId));
} catch (Exception e) {
logger.error("getDispersion error.", e);
}
return ApiResultDto.fail();
}
@GetMapping("/incomeRate/{projectId}")
public ApiResultDto incomeRate(@PathVariable String projectId) {
if (StringUtils.isBlank(projectId)) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(reportAnalysisService.getIncomeRate(projectId));
} catch (Exception e) {
logger.error("incomeRate error.", e);
}
return ApiResultDto.fail();
}
@GetMapping("/incomeVolatility/{projectId}")
public ApiResultDto incomeVolatility(@PathVariable String projectId) {
if (StringUtils.isBlank(projectId)) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(reportAnalysisService.getIncomeVolatility(projectId));
} catch (Exception e) {
logger.error("incomeVolatility error.", e);
}
return ApiResultDto.fail();
}
@GetMapping("/vatIncomeRate/{projectId}/{period}")
public ApiResultDto getVatIncomeRate(@PathVariable String projectId, @PathVariable Integer period) {
if (StringUtils.isBlank(projectId)) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(reportAnalysisService.getVatIncomeRate(projectId, period));
} catch (Exception e) {
logger.error("getVatIncomeRate error.", e);
}
return ApiResultDto.fail();
}
@GetMapping("/vatIncomeLine/{projectId}")
public ApiResultDto getVatIncomeLine(@PathVariable String projectId) {
if (StringUtils.isBlank(projectId)) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(reportAnalysisService.getVatIncomeLine(projectId));
} catch (Exception e) {
logger.error("getVatIncomeLine error.", e);
}
return ApiResultDto.fail();
}
@GetMapping("/deduction/{projectId}")
public ApiResultDto getDeduction(@PathVariable String projectId) {
if (StringUtils.isBlank(projectId)) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(reportAnalysisService.getDeduction(projectId));
} catch (Exception e) {
logger.error("getDeduction error.", e);
}
return ApiResultDto.fail();
}
}
package pwc.taxtech.atms.dao;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.service.impl.BaseService;
import pwc.taxtech.atms.vat.dao.GlBalanceMapper;
import pwc.taxtech.atms.vat.entity.GlBalance;
import pwc.taxtech.atms.vat.entity.GlBalanceExample;
import javax.annotation.Resource;
import java.util.Optional;
@Service
public class GlBalanceDao extends BaseService {
@Resource
private GlBalanceMapper glBalanceMapper;
/**
* 查找科目
*
* @param code code
* @return GlBalance
*/
public Optional<GlBalance> get(String code, String orgId, String period) {
GlBalanceExample example = new GlBalanceExample();
example.createCriteria().andSegment3EqualTo(code).andSegment1EqualTo(orgId).andPeriodNameEqualTo(period);
Optional<GlBalance> optional = glBalanceMapper.selectByExample(example).stream().findFirst();
if (optional.isPresent()) {
return optional;
}
GlBalanceExample example2 = new GlBalanceExample();
example2.createCriteria().andSegment4EqualTo(code).andSegment1EqualTo(orgId).andPeriodNameEqualTo(period);
return glBalanceMapper.selectByExample(example2).stream().findFirst();
}
}
......@@ -12,7 +12,7 @@ public class OrganizationShort {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getName() {
......
......@@ -15,7 +15,7 @@ public class DimensinTypeOrgDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getName() {
......
......@@ -40,7 +40,7 @@ public class DimensionDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getName() {
......
......@@ -24,7 +24,7 @@ public class DimensionValueDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getName() {
......
......@@ -19,7 +19,7 @@ public class DimensionValueJoinDimensionDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getDimensionName() {
......
......@@ -50,7 +50,7 @@ public class UnionDimensionValueOrg {
}
public void setId(String id) {
id = id;
this.id = id;
}
}
......@@ -13,7 +13,7 @@ public class OrgCountDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getName() {
......
......@@ -76,7 +76,7 @@ public class OrgGeneralInfoMiddleDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getOrgName() {
......
package pwc.taxtech.atms.dto.permission;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
public class OrganizationPermissionDto {
@JsonProperty("ID")
private String id;
private String name;
......@@ -17,7 +14,7 @@ public class OrganizationPermissionDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getName() {
......
package pwc.taxtech.atms.dto.permission;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
public class OrganizationPermissionKeyDto {
@JsonProperty("ID")
private String id;
private String name;
......@@ -18,7 +14,7 @@ public class OrganizationPermissionKeyDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getName() {
......
......@@ -39,7 +39,7 @@ public class PermissionDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getName() {
......
......@@ -15,7 +15,7 @@ public class PermissionKeyDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getCode() {
......
......@@ -25,7 +25,7 @@ public class UserPermissionDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getUserName() {
......
......@@ -25,7 +25,7 @@ public class UserPermissionKeyDto {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getUserName() {
......
......@@ -30,7 +30,7 @@ public class DimensionUser {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getDimensionId() {
......
......@@ -36,7 +36,7 @@ public class UserRoleDisplayInfo {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getUserId() {
......
......@@ -28,7 +28,7 @@ public class UserRoleQuery {
}
public void setId(String id) {
id = id;
this.id = id;
}
public String getUserId() {
......
package pwc.taxtech.atms.dto.vatdto;
import java.math.BigDecimal;
import java.util.List;
public class BurdenRateDto {
private List<BigDecimal> vatAmount;
private List<BigDecimal> income;
private List<BigDecimal> rate;
public List<BigDecimal> getVatAmount() {
return this.vatAmount;
}
public void setVatAmount(List<BigDecimal> vatAmount) {
this.vatAmount = vatAmount;
}
public List<BigDecimal> getIncome() {
return this.income;
}
public void setIncome(List<BigDecimal> income) {
this.income = income;
}
public List<BigDecimal> getRate() {
return this.rate;
}
public void setRate(List<BigDecimal> rate) {
this.rate = rate;
}
}
......@@ -20,5 +20,6 @@ public class Exceptions {
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 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 {
public List<ApprovalTaskInfo> getTask() {
String userId = authUserHelper.getCurrentUserId();//TODO query user role from sesstion or db
String assignee = ("66933E7B-DA75-4B2E-B7D6-AB65DCA20D50".equalsIgnoreCase(userId)) ? "manager" : "accountant";
return periodApproveMapper.queryApprovalList(assignee.equalsIgnoreCase("manager") ? null : userId);
return periodApproveMapper.queryApprovalList();
}
private void startInstance(ApprovalDto dto, PeriodApprove pa) {
......@@ -125,7 +123,10 @@ public class ApprovalService {
@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<>();
PeriodApprove pa = new PeriodApprove();
switch (decide) {
......
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.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
......@@ -16,20 +14,16 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.common.POIUtil;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.CellDataSourceType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dto.vatdto.CellCalcInfoDto;
import pwc.taxtech.atms.dto.vatdto.PeriodResources;
import pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.service.impl.DistributedIdService;
import pwc.taxtech.atms.service.impl.HttpFileService;
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.entity.*;
import pwc.taxtech.atms.vat.service.impl.report.functions.*;
......@@ -44,7 +38,6 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
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.*;
@Component
......@@ -517,7 +510,7 @@ public class ReportGeneratorImpl {
*/
public void addFunctionsAndContext(Workbook workbook, String[] functions, FormulaContext 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 JFFS(formulaContext), new WPSR(formulaContext)};
UDFFinder udfs = new DefaultUDFFinder(functions, functionImpls);
......
......@@ -50,7 +50,7 @@ import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*;
public class ReportServiceImpl {
private final static Logger logger = LoggerFactory.getLogger(ReportServiceImpl.class);
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"};
@Autowired
......
......@@ -12,8 +12,8 @@ import pwc.taxtech.atms.vat.entity.PeriodReport;
import java.util.Calendar;
import java.util.Date;
public class ProjectContext extends FunctionBase implements FreeRefFunction {
public ProjectContext(FormulaContext formulaContext) {
public class PC extends FunctionBase implements FreeRefFunction {
public PC(FormulaContext formulaContext) {
super(formulaContext);
}
......@@ -56,13 +56,9 @@ public class ProjectContext extends FunctionBase implements FreeRefFunction {
, formulaContext.getPeriod(), calendar.get(Calendar.DAY_OF_MONTH), formulaContext.getYear()
, formulaContext.getPeriod(), calendar2.get(Calendar.DAY_OF_MONTH)));
case "FillForm":
PeriodReport report = SpringContextUtil.reportMapper.selectByPrimaryKey(formulaContext.getReportId());
if (report != null) {
return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillForm, report.getUpdateTime().getYear()
, report.getUpdateTime().getMonth(), report.getUpdateTime().getDay()));
} else {
return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillFormStr, " ", " ", " "));
}
Date updateDate = new Date();
return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillForm, updateDate.getYear()
, updateDate.getMonth(), updateDate.getDay()));
case "TaxPayerNo":
String taxPayerNo = SpringContextUtil.organizationMapper.selectByPrimaryKey(formulaContext.getOrganizationId()).getTaxPayerNumber();
if (StringUtils.isNotBlank(taxPayerNo) && taxPayerNo.length() - 1 >= parameterInt) {
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.WorkbookEvaluator;
import org.apache.poi.ss.formula.eval.*;
import org.apache.poi.ss.formula.eval.NumberEval;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -13,10 +14,7 @@ import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
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.util.ArrayList;
import java.util.List;
......@@ -80,16 +78,16 @@ public class PSUM extends FunctionBase implements FreeRefFunction {
dto.setName(DataSourceName.ReportDataSource);
dto.setPeriod(formulaContext.getPeriod());
dto.setProjectId(formulaContext.getProjectId());
dto.setRowIndex(pCell.rowIndex-1);
dto.setColumnIndex(pCell.columnIndex-1);
dto.setColumnName((pCell.columnIndex)+"列");
dto.setRowName((pCell.rowIndex)+"行");
dto.setRowIndex(pCell.rowIndex - 1);
dto.setColumnIndex(pCell.columnIndex - 1);
dto.setColumnName((pCell.columnIndex) + "列");
dto.setRowName((pCell.rowIndex) + "行");
dto.setReportName(ec.getWorkbook().getSheetName(ec.getSheetIndex()));
dto.setType( FormulaDataSourceType.Report.getCode());
dto.setType(FormulaDataSourceType.Report.getCode());
dataSource.add(dto);
bigDecimal = bigDecimal.add(cellValue);
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
......@@ -8,11 +9,15 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.DataSourceName;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.vat.dao.HlOutputInterfaceLineMapper;
import pwc.taxtech.atms.vat.dao.HlOutputOrderKpsqmxbMapper;
import pwc.taxtech.atms.vat.dao.HlOutputOrderKpsqzbMapper;
import pwc.taxtech.atms.invoice.HlOutputInterfaceLineMapper;
import pwc.taxtech.atms.invoice.HlOutputOrderKpsqmxbMapper;
import pwc.taxtech.atms.invoice.HlOutputOrderKpsqzbMapper;
import pwc.taxtech.atms.vat.entity.*;
import java.math.BigDecimal;
......@@ -39,11 +44,12 @@ public class WPSR extends FunctionBase implements FreeRefFunction {
}
Integer type = getIntParam(args[0], ec);
Integer rate = getIntParam(args[1], ec);
String rateStr = String.valueOf(rate / 100);
String rateStr = String.valueOf(rate.doubleValue() / 100);
if (null == type || null == rate) {
return ZERO_EVAL;
}
ValueEval result = ZERO_EVAL;
String formulaExpression = "WPSR(" + type + "," + rate + ")";
try {
int period = formulaContext.getPeriod();
int year = formulaContext.getYear();
......@@ -57,10 +63,28 @@ public class WPSR extends FunctionBase implements FreeRefFunction {
HlOutputInterfaceLineExample lineExample = new HlOutputInterfaceLineExample();
lineExample.createCriteria().andSjfyrqBetween(periodStart, periodEnd).andSfkpNotEqualTo("1")
.andEbsSrbjEqualTo("1").andYwstidEqualTo(organization.getCode()); //排除 状态1:已开票,即未开票和预开票
List<HlOutputInterfaceLine> lineList = interfaceLineMapper.selectByExample(lineExample); //todo 无订单业务
List<HlOutputInterfaceLine> lineList = interfaceLineMapper.selectByExample(lineExample);
BigDecimal tmp = BigDecimal.ZERO;
if (!CollectionUtils.isEmpty(lineList)) {
result = new StringEval(getSum(lineList, rateStr).toPlainString());
tmp = tmp.add(getSum(lineList, rateStr));
}
//无订单业务
HlOutputInterfaceLineExample lineExampleWdd = new HlOutputInterfaceLineExample();
lineExampleWdd.createCriteria().andSjfyrqBetween(periodStart, periodEnd).andContextEqualTo("ETMS")
.andEbsSrbjEqualTo("1").andYwstidEqualTo(organization.getCode()).andTaxrateEqualTo(rateStr);
HlOutputInterfaceLineExample.Criteria criteria2 = lineExampleWdd.createCriteria().andSjfyrqBetween(periodStart, periodEnd)
.andContextEqualTo("ETMS").andEbsSrbjEqualTo("1").andYwstidEqualTo(organization.getCode())
.andTaxrateEqualTo(rateStr.substring(1));// 兼容税率为.16 这种数据
lineExampleWdd.or(criteria2);
List<HlOutputInterfaceLine> lineListWdd = interfaceLineMapper.selectByExample(lineExampleWdd);
if (!CollectionUtils.isEmpty(lineListWdd)) {
List<String> idList = lineListWdd.stream().map(HlOutputInterfaceLine::getUuid).collect(Collectors.toList());
HlOutputOrderKpsqmxbExample mxbExample = new HlOutputOrderKpsqmxbExample();
mxbExample.createCriteria().andIdIn(idList);
tmp = tmp.add(kpsqmxbMapper.selectByExample(mxbExample).stream().map(o -> NumberUtils.createBigDecimal(o.getHjje())).
reduce(BigDecimal.ZERO, BigDecimal::add));
}
result = new StringEval(tmp.toPlainString());
} else if (2 == type) {
//跨月开票
HlOutputInterfaceLineExample lineExample = new HlOutputInterfaceLineExample();
......@@ -74,6 +98,27 @@ public class WPSR extends FunctionBase implements FreeRefFunction {
} catch (Exception e) {
logger.error("evaluate WPSR error.", e);
}
//todo data source 显示优化
try {
BigDecimal val = NumberUtils.createBigDecimal(((StringEval) result).getStringValue());
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
dto.setAmount(val);
dto.setName(DataSourceName.ReportDataSource);
dto.setPeriod(formulaContext.getPeriod());
dto.setProjectId(formulaContext.getProjectId());
// dto.setRowIndex(pCell.rowIndex-1);
// dto.setColumnIndex(pCell.columnIndex-1);
dto.setColumnName("");
dto.setRowName("");
dto.setReportName(ec.getWorkbook().getSheetName(ec.getSheetIndex()));
dto.setType(FormulaDataSourceType.Report.getCode());
Long dataSourceId = saveDataSource(ec, Lists.newArrayList(dto), FormulaDataSourceDetailType.InputInvoiceDataSourceDto, val, formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, val, dataSourceId,
formulaContext.getProjectId());
} catch (Exception e) {
logger.error("saveDataSource or saveFormulaBlock error.", e);
}
return result;
}
......
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<context-root>/</context-root>
<container-descriptor>
<prefer-application-packages>
<package-name>org.apache.commons.lang.*</package-name>
<package-name>antlr.*</package-name>
<package-name>javax.persistence.*</package-name>
<package-name>org.hibernate.*</package-name>
<package-name>org.apache.xerces.*</package-name>
<package-name>com.fasterxml.jackson.*</package-name>
</prefer-application-packages>
</container-descriptor>
</weblogic-web-app>
\ No newline at end of file
......@@ -204,7 +204,8 @@ public class DataInitTest extends CommonIT {
@Test
public void initOutput() throws Exception {
Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_销项主表_乐叶_201807.xlsx"));
// todo 导入前检查开票日期,给的文档日期经常不一样
Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_销项主表_绿能_201809.xlsx"));
Sheet sheet = workbook.getSheetAt(0);
for (int r = 1; r <= sheet.getLastRowNum(); r++) {
try {
......@@ -219,6 +220,7 @@ public class DataInitTest extends CommonIT {
outputInvoice.setFPQQLSH(sheet.getRow(r).getCell(1).getStringCellValue());
outputInvoice.setFPDM(sheet.getRow(r).getCell(2).getStringCellValue());
outputInvoice.setFPHM(sheet.getRow(r).getCell(3).getStringCellValue());
// outputInvoice.setKPRQ(sheet.getRow(r).getCell(4).getStringCellValue() + " 00:00:00");
outputInvoice.setKPRQ(sheet.getRow(r).getCell(4).getStringCellValue());
String s = "000" + sheet.getRow(r).getCell(5).getStringCellValue();
outputInvoice.setFPLXDM(s.substring(s.length() - 3, s.length()));
......@@ -236,6 +238,8 @@ public class DataInitTest extends CommonIT {
// outputInvoice.setHTBH(sheet.getRow(r).getCell(54).getStringCellValue());
OutputInvoiceExample example = new OutputInvoiceExample();
example.createCriteria().andFPDMEqualTo(outputInvoice.getFPDM()).andFPHMEqualTo(outputInvoice.getFPHM());
//有重复数据 先删除
outputInvoiceMapper.deleteByExample(example);
if (outputInvoiceMapper.selectByExample(example).size() > 0) {
outputInvoiceMapper.updateByExampleSelective(outputInvoice, example);
} else {
......
package pwc.taxtech.atms.vat.dao;
package pwc.taxtech.atms.invoice;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
......
package pwc.taxtech.atms.vat.dao;
package pwc.taxtech.atms.invoice;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
......
package pwc.taxtech.atms.vat.dao;
package pwc.taxtech.atms.invoice;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
......
......@@ -110,6 +110,7 @@ public interface PeriodApproveMapper extends MyVatMapper {
@Select("<script>" +
"SELECT " +
" p.ORGANIZATION_ID AS organizationId, " +
" p.NAME AS projectName, " +
" pa.PROJECT_ID AS projectId, " +
" pa.PERIOD AS period, " +
......@@ -128,11 +129,8 @@ public interface PeriodApproveMapper extends MyVatMapper {
" INNER JOIN PROJECT p ON pa.PROJECT_ID = p.ID " +
" JOIN \"USER\" u1 ON pa.CREATE_BY = u1.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>")
List<ApprovalTaskInfo> queryApprovalList(@Param("createId") String createId);
List<ApprovalTaskInfo> queryApprovalList();
@Select("" +
"SELECT " +
......@@ -143,4 +141,14 @@ public interface PeriodApproveMapper extends MyVatMapper {
" ROWNUM = 1" +
"")
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
......@@ -127,7 +127,9 @@ public interface PeriodReportMapper extends MyVatMapper {
" LEFT JOIN PERIOD_TEMPLATE pt ON r.TEMPLATE_ID = pt.TEMPLATE_ID " +
"WHERE " +
" r.PROJECT_ID = #{projectId} " +
" AND r.PERIOD = #{period} " +
" AND r.PERIOD = #{period}" +
" AND pt.PROJECT_ID = r.PROJECT_ID " +
" AND pt.PERIOD = r.PERIOD " +
"ORDER BY " +
" pt.ORDER_INDEX" +
"")
......
......@@ -3,6 +3,7 @@ package pwc.taxtech.atms.vat.dpo;
import java.sql.Date;
public class ApprovalTaskInfo {
private String organizationId;
private String projectName;
private String projectId;
private Integer period;
......@@ -120,4 +121,12 @@ public class ApprovalTaskInfo {
public void setTemplateIds(String templateIds) {
this.templateIds = templateIds;
}
public String getOrganizationId() {
return organizationId;
}
public void setOrganizationId(String organizationId) {
this.organizationId = organizationId;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.HlOutputInterfaceLineMapper">
<mapper namespace="pwc.taxtech.atms.invoice.HlOutputInterfaceLineMapper">
<resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.HlOutputInterfaceLine">
<!--
WARNING - @mbg.generated
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.HlOutputOrderKpsqmxbMapper">
<mapper namespace="pwc.taxtech.atms.invoice.HlOutputOrderKpsqmxbMapper">
<resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.HlOutputOrderKpsqmxb">
<!--
WARNING - @mbg.generated
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.HlOutputOrderKpsqzbMapper">
<mapper namespace="pwc.taxtech.atms.invoice.HlOutputOrderKpsqzbMapper">
<resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.HlOutputOrderKpsqzb">
<!--
WARNING - @mbg.generated
......
......@@ -48,27 +48,6 @@
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>DruidStatView</servlet-name>
<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
<init-param>
<param-name>resetEnable</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>loginUsername</param-name>
<param-value>druid</param-value>
</init-param>
<init-param>
<param-name>loginPassword</param-name>
<param-value>druid</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>DruidStatView</servlet-name>
<url-pattern>/druid/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
......
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<context-root>/</context-root>
<container-descriptor>
<prefer-application-packages>
<package-name>org.apache.commons.lang.*</package-name>
<package-name>antlr.*</package-name>
<package-name>javax.persistence.*</package-name>
<package-name>org.hibernate.*</package-name>
<package-name>org.apache.xerces.*</package-name>
<package-name>com.fasterxml.jackson.*</package-name>
</prefer-application-packages>
</container-descriptor>
</weblogic-web-app>
\ No newline at end of file
......@@ -2539,7 +2539,9 @@
};
$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'){
SweetAlert.error('报表提审中或审核已通过!');
}else{
......@@ -2569,17 +2571,30 @@
}
$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(){
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');
});
}
$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
, constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished);
$("#ApprovalComment").modal('hide');
......
......@@ -21,8 +21,8 @@
return $http.get('/approval/templateInfo/'+templateId, apiConfig.createVat());
},
checkTask:function(taskId,decide,comment){
return $http.put('/approval/check/'+taskId+'?decide='+decide+'&comment='+comment, {}, apiConfig.createVat());
checkTask:function(projectId,period,decide,comment){
return $http.put('/approval/check/'+projectId+'/'+period+'?decide='+decide+'&comment='+comment, {}, apiConfig.createVat());
},
approvalStatus:function(projectId,period){
......
......@@ -31,6 +31,7 @@
//*************************************************************************************************
$scope.randomCounter = 0;
$scope.allResults = [];
$scope.queryResults = [];
$scope.checkedOrgs = {};
$scope.orgList = [];
$scope.orderYear = true;
......@@ -125,17 +126,14 @@
return _.contains(_.values($scope.checkedOrgs), i.organizationName);
});
}
if ($scope.serviceTypeId) {
temp = _.filter(temp, function (i) {
return $scope.serviceTypeId == i.serviceTypeID;
});
}
if (vatSessionService.year) {
if ($scope.serviceTypeId === enums.serviceType.VAT) {
temp = _.filter(temp, function (i) {
if (i.startPeriod <= vatSessionService.month && i.endPeriod >= vatSessionService.month && i.year == vatSessionService.year) {
if (i.period == vatSessionService.month) {
return i;
}
});
}
else if ($scope.serviceTypeId === enums.serviceType.CIT) {
......@@ -164,28 +162,6 @@
var counter = 0;
var setWarningToTrue = false;
temp.forEach(function (project) {
setWarningToTrue = false;
project.finalStatus = setLayoutStatusTitle(project.projectStatusList);
project.periodDate = $scope.currentSelectedYear + "." + $scope.currentSelectedMonth;
var oneDemoData = _.find(demoData, function (one) { return one.id === project.id });
if (project.serviceTypeID === enums.serviceType.VAT) {
if (project.projectStatusList !== null && project.projectStatusList[vatSessionService.month] !== undefined && project.projectStatusList[vatSessionService.month] !== 10 && oneDemoData!==undefined) {
project.taxAmount = oneDemoData.taxAmount;
project.prepadidTaxAmount = oneDemoData.prepadidTaxAmount;
project.taxRate = oneDemoData.taxRate;
project.hasWarning = oneDemoData.hasWarning;
}
}
counter++;
});
$scope.queryResults = temp;
$scope.projectMsg = $translate.instant('ProjectResultMsg').formatObj({ "ProjectNum": $scope.queryResults.length });
......@@ -283,15 +259,6 @@
};
$scope.changeStartDate = function (e) {
if (e&&e.date) {
var tempYear = e.date.getFullYear();
var tempMonth = e.date.getMonth() + 1;
$scope.currentSelectedStartMonth = tempMonth;
$scope.currentSelectedStartYear = tempYear;
}
};
$scope.changeDate = function (e) {
if (e && e.date) {
var isDateUpdated = false;
......@@ -308,15 +275,15 @@
$scope.currentSelectedYear = tempYear;
if (isDateUpdated) {
//$scope.$apply(function () {
// $scope.conditionChange = !$scope.conditionChange;
//});
$timeout(function () {
$scope.conditionChange = !$scope.conditionChange;
});
}
if ($scope.serviceTypeId !== enums.serviceType.AssetsManage) {
$scope.query();
}
}
};
......@@ -577,8 +544,18 @@
var loadApprovalFromDB = function () {
vatApproveService.approvalTasks().success(function (data) {
if (data) {
data.forEach(function (p) {
if (PWC.isHavePermissionForOrg(p.organizationId, vatSessionService.userPermission))
{
$scope.allResults.push(p);
}
});
$scope.queryResults = _.clone($scope.allResults);
$scope.gridOptions = {
dataSource: data,
bindingOptions: {
"dataSource": "queryResults"
},
keyExpr: "instanceId",
showBorders: true,
columns: [
......@@ -597,7 +574,15 @@
}
}
},
{ caption: '审批意见', width: '15%', dataField: "approvalResult"},
{ caption: '审批意见', width: '15%',
calculateCellValue: function(data) {
if(data.approvalResult == 'undefined'){
return '';
}else{
return data.approvalResult;
}
}
},
{ caption: '提审时间', width: '7.5%', dataField: "createTime"},
{ caption: '审批时间', width: '7.5%', dataField: "approvalTime"}
],
......@@ -618,9 +603,11 @@
vatSessionService.project = result;
vatSessionService.project.projectName = approvalInfo.projectName;
vatSessionService.project.month = approvalInfo.period;
vatSessionService.project.templateGroupID = template.templateGroupId;
vatSessionService.month = approvalInfo.period;
vatSessionService.approvalInfo=approvalInfo;
$state.go('vat.generateReport.reportView', {
id: approvalInfo.reportIds.split(",")[0],
templateid: approvalInfo.templateIds.split(",")[0],
......
......@@ -10,17 +10,9 @@ frameworkModule.controller('appSideBarController', ['$scope', '$log', 'menuServi
$log.debug('appSideBarController.ctor()...');
userService.getUserPermission(loginContext.userName).success(function (data) {
$timeout(function () {
menuService.getMenusForDisplay(1).success(function (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);
......
......@@ -5,9 +5,9 @@
$log.debug('VatAnalysisMenuController.ctor()...');
$scope.menus = [
{ name: '.analyzeReport', text: "出口数据对比", icon: 'glyphicon glyphicon-flag', permission: constant.vatPermission.dataAnalysis.modelAnalysisCode, show: true },
{ name: 'analyzeOrganizeDashboard({id:"' + vatSessionService.project.organizationID + '"})', text: "进项税额差异分析", icon: 'glyphicon glyphicon-stats', permission: constant.vatPermission.dataAnalysis.dashboard.dashboardCode, show: true },
{ name: '.vatTaxDifference', text: $translate.instant('BookTaxDifference'), icon: 'glyphicon glyphicon-tree-conifer', show: true }
{ name: '.analyzeReport', text: "指标分析", icon: 'glyphicon glyphicon-stats', permission: constant.vatPermission.dataAnalysis.modelAnalysisCode, show: true },
// { name: 'analyzeOrganizeDashboard({id:"' + vatSessionService.project.organizationID + '"})', text: "进项税额差异分析", icon: 'glyphicon glyphicon-stats', permission: constant.vatPermission.dataAnalysis.dashboard.dashboardCode, show: true },
// { name: '.vatTaxDifference', text: $translate.instant('BookTaxDifference'), icon: 'glyphicon glyphicon-tree-conifer', show: true }
];
vatSessionService.querySummayDashboardModel = {
organizationID: vatSessionService.project.organizationID,
......
<div class="vat-model-analysis ">
<div class="col-lg-12 col-md-12" style="margin-top:20px;">
<div >
<table border="1" width="95%" style="margin: auto">
<thead>
<tr class="th">
<th>遇到一个问题1</th>
<th>遇到一个问题1</th>
</tr>
</thead>
<tbody>
<tr class="tb">
<td>遇到一个问题</td>
<td>遇到一个问题</td>
</tr>
</tbody>
</table>
<div class="col-lg-12 col-md-12" style="margin-top:20px;height: 100%;overflow:scroll">
<div class="row">
<div class="col-lg-5 col-md-5">
<div id="burdenRateDiv" name="p_chart"></div>
</div>
<div class="col-lg-5 col-md-5 col-md-offset-1 col-lg-offset-1">
<div id="discreteAnalysisDiv" name="p_chart"></div>
</div>
</div>
<div class="row">
<div class="col-lg-5 col-md-5">
<div id="incomeRateDiv" name="p_chart"></div>
</div>
<div class="col-lg-5 col-md-5 col-md-offset-1 col-lg-offset-1">
<div id="incomeVolatilityDiv" name="p_chart"></div>
</div>
</div>
<div class="row">
<div class="col-lg-5 col-md-5">
<div id="vatIncomeRateDiv" name="p_chart"></div>
</div>
<div class="col-lg-5 col-md-5 col-md-offset-1 col-lg-offset-1">
<div id="vatIncomeLineDiv" name="p_chart"></div>
</div>
</div>
<div class="row">
<div class="col-lg-5 col-md-5">
<div id="deductionDiv" name="p_chart"></div>
</div>
<div class="col-lg-5 col-md-5 col-md-offset-1 col-lg-offset-1">
<div id="" name="p_chart"></div>
</div>
</div>
</div>
<style>
.th>th{
.th > th {
text-align: center;
}
.tb>td{
.tb > td {
height: 30px;
text-align: center;
}
......
......@@ -12,50 +12,50 @@
$scope.element = $element;
// rangePicker 需要手动释放,否则经过多次操作后,页面中会存在多个 rangePicker 的 div
var rangePicker = null;
var initializePeriodRangePicker = function () {
//初始化期间选择控件
var input = $($scope.element).find(".right-container .menu .period-range input");
var monthList = [
$translate.instant('Month01'),
$translate.instant('Month02'),
$translate.instant('Month03'),
$translate.instant('Month04'),
$translate.instant('Month05'),
$translate.instant('Month06'),
$translate.instant('Month07'),
$translate.instant('Month08'),
$translate.instant('Month09'),
$translate.instant('Month10'),
$translate.instant('Month11'),
$translate.instant('Month12')
];
input = input.rangePicker({
minDate: [1, $scope.projectYear],
maxDate: [12, $scope.projectYear],
setDate: [
[1, $scope.projectYear],
[12, $scope.projectYear]
],
months: monthList,
ConfirmBtnText: $translate.instant('Confirm'),
CancelBtnText: $translate.instant('ButtonCancel')
});
input.on('datePicker.done', function (e, result) {
$scope.periodFrom = result[0][0];
$scope.periodTo = result[1][0];
});
rangePicker = $(input).data("_ranegPicker");
};
// var rangePicker = null;
//
// var initializePeriodRangePicker = function () {
// //初始化期间选择控件
// var input = $($scope.element).find(".right-container .menu .period-range input");
// var monthList = [
// $translate.instant('Month01'),
// $translate.instant('Month02'),
// $translate.instant('Month03'),
// $translate.instant('Month04'),
// $translate.instant('Month05'),
// $translate.instant('Month06'),
// $translate.instant('Month07'),
// $translate.instant('Month08'),
// $translate.instant('Month09'),
// $translate.instant('Month10'),
// $translate.instant('Month11'),
// $translate.instant('Month12')
// ];
// input = input.rangePicker({
// minDate: [1, $scope.projectYear],
// maxDate: [12, $scope.projectYear],
// setDate: [
// [1, $scope.projectYear],
// [12, $scope.projectYear]
// ],
// months: monthList,
// ConfirmBtnText: $translate.instant('Confirm'),
// CancelBtnText: $translate.instant('ButtonCancel')
// });
// input.on('datePicker.done', function (e, result) {
// $scope.periodFrom = result[0][0];
// $scope.periodTo = result[1][0];
// });
//
// rangePicker = $(input).data("_ranegPicker");
// };
(function () {
initializePeriodRangePicker();
// initializePeriodRangePicker();
$scope.$on("$destroy", function () {
rangePicker.destroy();
});
// $scope.$on("$destroy", function () {
// rangePicker.destroy();
// });
})();
}
};
......
......@@ -18,7 +18,7 @@
//房地产
//projectID = '0cf0945f-d41c-4df3-8235-ae693d5e724d';
$q.all([
templateGroupService.getGroupTemplateByGroupID(48372654336679936, projectID),
templateGroupService.getGroupTemplateByGroupID(vatSessionService.project.templateGroupID, projectID),
vatReportService.getFilterTemplate(vatSessionService.project.id, constant.serviceType.VAT, vatSessionService.month)
]).then(function (result) {
if (!_.isEmpty(result[0]) && !_.isEmpty(result[0].data) && !_.isEmpty(result[0].data.data)
......
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