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 {
}
@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----------------------------------");
}
}
......@@ -37,6 +37,13 @@ public class InputInvoiceImportController {
private IdentityServiceImpl identityService;
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)
public @ResponseBody
PageInfo<InputInvoice> getInputInvoiceTreeViewData(@RequestBody InputInvoicePreviewQueryParam paras,
......
......@@ -52,6 +52,12 @@ public class OutputInvoiceController {
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)
public void downloadInvoiceQueryData(@RequestBody QueryOutputDto paras, @RequestHeader("from") String projectId, HttpServletResponse response) {
response.setContentType("application/vnd.ms-excel;charset=utf-8");
......
......@@ -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() {
......
......@@ -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) {
......
......@@ -73,7 +73,7 @@ public class OutputInvoiceServiceImpl {
@Autowired
private OutputInvoiceDetailMapper outputInvoiceDetailMapper;
public PageInfo<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto, String projectId) {
public List<OutputInvoice> queryOutputInvoiceAllList(QueryOutputDto queryDto, String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
......@@ -89,9 +89,6 @@ public class OutputInvoiceServiceImpl {
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()))
.andFPZTNotEqualTo("1");
}
PageHelper.startPage(queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize());
List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample);
DecimalFormat df = new DecimalFormat("#,###.00");
invoices.stream().forEach(x -> {
......@@ -99,7 +96,11 @@ public class OutputInvoiceServiceImpl {
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;
}
......
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
......@@ -654,6 +654,8 @@ public class ReportServiceImpl {
dataSourceDto.setDataSourceType(CellDataSourceType.InputInvoice.getCode());
} else if (a.getType().equals(FormulaDataSourceType.Voucher.getCode())) {
dataSourceDto.setDataSourceType(CellDataSourceType.Voucher.getCode());
} else if(a.getType().equals(FormulaDataSourceType.OutputInvoice.getCode())){
dataSourceDto.setDataSourceType(CellDataSourceType.OutputInvoice.getCode());
} else {
dataSourceDto.setDataSourceType(0);
}
......@@ -692,6 +694,13 @@ public class ReportServiceImpl {
if (z.getItem2().getItems() != null && !z.getItem2().getItems().isEmpty() && z.getItem2().getItems().get(0).contains("tag")) {
z.getItem2().getItems().forEach(m -> {
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);
});
} else
......
......@@ -14,10 +14,7 @@ import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.entity.AccountMapping;
import pwc.taxtech.atms.entity.AccountMappingExample;
import pwc.taxtech.atms.entity.EnterpriseAccountSetOrg;
import pwc.taxtech.atms.entity.EnterpriseAccountSetOrgExample;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.entity.GlBalance;
import pwc.taxtech.atms.vat.entity.GlBalanceExample;
......@@ -70,7 +67,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
double result = 0;
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),
FormulaDataSourceDetailType.FormulaDataSourceDto,
......@@ -80,7 +77,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
return new NumberEval(result);
} 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),
FormulaDataSourceDetailType.FormulaDataSourceDto,
new BigDecimal(result), period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
......@@ -95,10 +92,17 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
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.Criteria c1 = glBalanceExample.createCriteria().andSegment3EqualTo(code).andPeriodNameEqualTo(periodName(period, year));
GlBalanceExample.Criteria c2 = glBalanceExample.createCriteria().andSegment4EqualTo(code).andPeriodNameEqualTo(periodName(period, year));
GlBalanceExample.Criteria c1 = glBalanceExample.createCriteria().andSegment3EqualTo(code)
.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);
List<GlBalance> list = SpringContextUtil.glBalanceMapper.selectByExample(glBalanceExample);
if(CollectionUtils.isEmpty(list)){
......
......@@ -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();
}
......
......@@ -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
......@@ -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;
}
}
......@@ -41,11 +41,11 @@
<label class="cell-info-subject-label">{{'ColumnName' | translate}}:</label>
{{detail.cellInfo.column}}
</div>
<div class="cell-info-subject">
<!--<div class="cell-info-subject">
<label class="cell-info-subject-label">{{'Formula' | translate}}</label>
<formula-translator formula-list="formulaList" key-value-list="keyValueList" include-optional="false"
account-data-source="accountDataSource" formula-exp="detail.config.formula"></formula-translator>
</div>
</div>-->
<div class="cell-info-subject">
<label class="cell-info-subject-label">{{'SourceOrFormula' | translate}}:</label>
{{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',
'loginContext', 'enums', 'vatCommonService', 'vatWorkflowService', 'projectService', '$uibModal', '$cookies', 'Upload', 'vatImportService','vatApproveService',
function ($scope, $rootScope, $log, $translate, $timeout, $q, $compile, $state, $stateParams, apiInterceptor, vatExportService, SweetAlert, BSPLService,
......@@ -972,7 +972,7 @@
delete x.cellValue;
});
reportData.data.cellData.reportName = node.name;
// reportData.data.cellData.reportName = node.name;
reportData.data.cellData.orderIndex = node.orderIndex;
reportData.data.cellData.templateId = node.id;
exportReportData.push(reportData.data.cellData);
......@@ -2538,7 +2538,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{
......@@ -2568,17 +2570,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){
......
......@@ -5,6 +5,25 @@
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) {
return $http.post('/outputInvoiceImport/queryOutputInvoiceList', {
PageInfo: param.pageInfo,
......@@ -49,22 +68,41 @@
queryInputInvoiceList: function (param) {
return $http.post('/inputInvoiceImport/inputInvoicePreviewList', {
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());
return $http.post('/inputInvoiceImport/inputInvoicePreviewList', {
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());
},
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) {
......
......@@ -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);
......
......@@ -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数据
var loadIncomeInvoiceItemDataFromDB = function (pageIndex) {
initIncomeInvoiceItemPagination();
......@@ -96,16 +117,6 @@
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) {
if (data) {
......@@ -113,13 +124,12 @@
var index = 1;
data.list.forEach(function (v) {
v.index = index++;
v.amount = PWC.round(v.amount, 2);
v.taxAmount = PWC.round(v.taxAmount, 2);
v.amount = PWC.round(parseFloat(v.hjje.replace(/,/g, "")), 2);
v.taxAmount = PWC.round(parseFloat(v.hjse.replace(/,/g, "")), 2);
});
$scope.gridOptions.data = data.list;
$scope.queryIncomeInvoiceItemResult.pageInfo = data;
computeIncomeInvoiceItemPage();
countTotal();
}
});
};
......@@ -636,6 +646,7 @@
//初始化查询条件-期间范围
$scope.queryParams.periodStart = vatSessionService.month;
$scope.queryParams.periodEnd = vatSessionService.month;
countTotal();
loadIncomeInvoiceItemDataFromDB(1);
})();
......
......@@ -68,6 +68,23 @@
$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数据
var loadOutputInvoiceDataFromDB = function (pageIndex) {
initOutputInvoicePagination();
......@@ -81,24 +98,15 @@
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) {
if (data) {
var index = 1;
data.list.forEach(function (v) {
v.index = index++;
v.amount = PWC.round(v.amount, 2);
v.taxAmount = PWC.round(v.taxAmount, 2);
v.amount = PWC.round(parseFloat(v.hjje.replace(/,/g, "")), 2);
v.taxAmount = PWC.round(parseFloat(v.hjse.replace(/,/g, "")), 2);
});
$scope.gridOptions.data = data.list;
$scope.queryOutputInvoiceResult.pageInfo = data;
......@@ -381,7 +389,7 @@
var criteria = JSON.stringify($scope.queryParams);
if (browserService.isIE() || browserService.isEdge())
criteria = encodeURIComponent(criteria);
countTotal();
loadOutputInvoiceDataFromDB(1);
$('.filter-button').popover("hide");
};
......@@ -407,6 +415,7 @@
$scope.criteriaList = [];
$scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth;
countTotal();
loadOutputInvoiceDataFromDB(1);
$('.filter-button').popover("hide");
};
......@@ -598,7 +607,7 @@
endMonth = result[1][0];
$scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth;
countTotal();
loadOutputInvoiceDataFromDB(1);
});
......@@ -651,6 +660,7 @@
$scope.showPopover = showPopover;
initPeriods();
initOutputInvoicePagination();
countTotal();
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