Commit 866e8058 authored by zhkwei's avatar zhkwei

Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql

parents 415f578e 246af24e
......@@ -12,6 +12,32 @@ public class SystemConfig {
@Value("${longi_api_gl_balance}")
private String longiApiGlBalance;
//tableau相关配置
@Value("${tableau_get_ticket}")
private String tableauGetTicket;
@Value("${tableau_unreturned_tax}")
private String tableauUnreturnedTax;
@Value("${tableau_tax_comparison}")
private String tableauTaxComparison;
@Value("${tableau_other_countries}")
private String tableauOtherCountries;
@Value("${tableau_cost_analysis}")
private String tableauCostAnalysis;
@Value("${tableau_profit_and_loss}")
private String tableauProfitAndLoss;
@Value("${tableau_other_domestic_data}")
private String tableauOtherDomesticData;
@Value("${tableau_doc_situation}")
private String tableauDocSituation;
@Value("${tableau_global_overview}")
private String tableauGlobalOverview;
@Value("${tableau_mexican_tax}")
private String tableauMexicanTax;
@Value("${tableau_australian_tax}")
private String tableauAustralianTax;
@Value("${tableau_brazilian_tax}")
private String tableauBrazilianTax;
public String getLongiApiBasicUser() {
return this.longiApiBasicUser;
}
......@@ -35,4 +61,100 @@ public class SystemConfig {
public void setLongiApiGlBalance(String longiApiGlBalance) {
this.longiApiGlBalance = longiApiGlBalance;
}
public String getTableauGetTicket() {
return this.tableauGetTicket;
}
public void setTableauGetTicket(String tableauGetTicket) {
this.tableauGetTicket = tableauGetTicket;
}
public String getTableauUnreturnedTax() {
return this.tableauUnreturnedTax;
}
public void setTableauUnreturnedTax(String tableauUnreturnedTax) {
this.tableauUnreturnedTax = tableauUnreturnedTax;
}
public String getTableauTaxComparison() {
return this.tableauTaxComparison;
}
public void setTableauTaxComparison(String tableauTaxComparison) {
this.tableauTaxComparison = tableauTaxComparison;
}
public String getTableauOtherCountries() {
return this.tableauOtherCountries;
}
public void setTableauOtherCountries(String tableauOtherCountries) {
this.tableauOtherCountries = tableauOtherCountries;
}
public String getTableauCostAnalysis() {
return this.tableauCostAnalysis;
}
public void setTableauCostAnalysis(String tableauCostAnalysis) {
this.tableauCostAnalysis = tableauCostAnalysis;
}
public String getTableauProfitAndLoss() {
return this.tableauProfitAndLoss;
}
public void setTableauProfitAndLoss(String tableauProfitAndLoss) {
this.tableauProfitAndLoss = tableauProfitAndLoss;
}
public String getTableauOtherDomesticData() {
return this.tableauOtherDomesticData;
}
public void setTableauOtherDomesticData(String tableauOtherDomesticData) {
this.tableauOtherDomesticData = tableauOtherDomesticData;
}
public String getTableauDocSituation() {
return this.tableauDocSituation;
}
public void setTableauDocSituation(String tableauDocSituation) {
this.tableauDocSituation = tableauDocSituation;
}
public String getTableauGlobalOverview() {
return this.tableauGlobalOverview;
}
public void setTableauGlobalOverview(String tableauGlobalOverview) {
this.tableauGlobalOverview = tableauGlobalOverview;
}
public String getTableauMexicanTax() {
return this.tableauMexicanTax;
}
public void setTableauMexicanTax(String tableauMexicanTax) {
this.tableauMexicanTax = tableauMexicanTax;
}
public String getTableauAustralianTax() {
return this.tableauAustralianTax;
}
public void setTableauAustralianTax(String tableauAustralianTax) {
this.tableauAustralianTax = tableauAustralianTax;
}
public String getTableauBrazilianTax() {
return this.tableauBrazilianTax;
}
public void setTableauBrazilianTax(String tableauBrazilianTax) {
this.tableauBrazilianTax = tableauBrazilianTax;
}
}
package pwc.taxtech.atms.controller;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
......@@ -8,22 +9,20 @@ import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dao.CitJournalEntryAdjustMapper;
import pwc.taxtech.atms.dao.CitTbamMapper;
import pwc.taxtech.atms.dao.OperationLogEntryLogMapper;
import pwc.taxtech.atms.dpo.CitTbamDto;
import pwc.taxtech.atms.dto.CitTbamDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.entity.CitJournalEntryAdjust;
import pwc.taxtech.atms.entity.CitTbam;
import pwc.taxtech.atms.entity.OperationLogEntryLog;
import pwc.taxtech.atms.entity.OperationLogEntryLogExample;
import pwc.taxtech.atms.service.impl.DistributedIdService;
import pwc.taxtech.atms.vat.dao.JournalEntryMapper;
import pwc.taxtech.atms.vat.dao.PeriodFormulaBlockMapper;
import pwc.taxtech.atms.vat.entity.CellComment;
import pwc.taxtech.atms.vat.entity.PeriodCellComment;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import pwc.taxtech.atms.vat.service.impl.CellCommentServiceImpl;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@RestController
......@@ -40,6 +39,7 @@ public class CellCommentController {
}
return cellCommentService.getCellComments(cellDataId, projectId);
}
@Autowired
private CitTbamMapper citTbamMapper;
@Autowired
......@@ -49,26 +49,34 @@ public class CellCommentController {
private JdbcTemplate jdbcTemplate;
//通过sql获取展示表格展示数据
@RequestMapping(value = "getCellInformation")
public OperationResultDto getCellInformation(String sql){
@RequestMapping(value = "getCellInformation")
public OperationResultDto getCellInformation(String sql) {
OperationResultDto operationResultDto = new OperationResultDto();
int from = sql.indexOf("from");
sql = sql.substring(from);
operationResultDto.setData(citTbamMapper.selectBySql(sql));
List<CitTbam> citTbams = citTbamMapper.selectBySql(sql);
List<CitTbamDto> citTbamDtos = new ArrayList<>();
for (CitTbam citTbam : citTbams) {
CitTbamDto citTbamDto = new CitTbamDto();
BeanUtils.copyProperties(citTbam, citTbamDto);
citTbamDtos.add(citTbamDto);
}
operationResultDto.setData(citTbamDtos);
operationResultDto.setResultMsg("success");
return operationResultDto;
return operationResultDto;
}
//加载分录表格数据
@RequestMapping("loadEntryListDataList")
public OperationResultDto loadEntryListDataList(String code){
public OperationResultDto loadEntryListDataList(String code) {
OperationResultDto operationResultDto = new OperationResultDto();
CitJournalEntryAdjust citJournalEntryAdjust = new CitJournalEntryAdjust();
citJournalEntryAdjust.setSubjectCode(code);
List<CitJournalEntryAdjust> journalMerge = citJournalEntryAdjustMapper.getJournalMerge(citJournalEntryAdjust);
operationResultDto.setData(journalMerge);
operationResultDto.setResultMsg("success");
return operationResultDto;
return operationResultDto;
}
@Autowired
......@@ -78,21 +86,25 @@ public class CellCommentController {
private OperationLogEntryLogMapper operationLogEntryLogMapper;
@Autowired
private DistributedIdService distributedIdService;
//更新调整后金额
@RequestMapping("updateAdjust")
public OperationResultDto updateAdjust(@RequestBody CitTbam[] citTbams){
@RequestMapping(value = "updateAdjust", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto updateAdjust(@RequestBody List<CitTbamDto> citTbams) {
OperationResultDto operationResultDto = new OperationResultDto();
CitTbam citTbam = new CitTbam();
for(CitTbam citTbam1 : citTbams){
citTbam.setId(citTbam1.getId());
citTbamMapper.updateByPrimaryKey(citTbam);
for (CitTbamDto citTbamDto : citTbams) {
BeanUtils.copyProperties(citTbamDto, citTbam);
citTbam.setId(citTbam.getId());
citTbam.setAdjustAccount(citTbam.getAdjustAccount());
citTbamMapper.updateByPrimaryKeySelective(citTbam);
}
operationResultDto.setResultMsg("success");
return operationResultDto;
}
@RequestMapping("selectEntryLog")
public OperationResultDto selectEntryLog(String code){
public OperationResultDto selectEntryLog(String code) {
OperationResultDto operationResultDto = new OperationResultDto();
OperationLogEntryLogExample operationLogEntryLogExample = new OperationLogEntryLogExample();
OperationLogEntryLogExample.Criteria criteria = operationLogEntryLogExample.createCriteria();
......@@ -105,8 +117,8 @@ public class CellCommentController {
* 添加日志
*/
@RequestMapping("addLog")
public OperationResultDto addLog(@RequestBody OperationLogEntryLog[] operationLogEntryLogs ){
for(OperationLogEntryLog operationLogEntryLog : operationLogEntryLogs){
public OperationResultDto addLog(@RequestBody List<OperationLogEntryLog> operationLogEntryLogs) {
for (OperationLogEntryLog operationLogEntryLog : operationLogEntryLogs) {
operationLogEntryLogMapper.insert(operationLogEntryLog);
}
OperationResultDto<Object> objectOperationResultDto = new OperationResultDto<>();
......
package pwc.taxtech.atms.controller;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.service.impl.TableauService;
import javax.annotation.Resource;
@RestController
@RequestMapping("/api/v1/tableau")
public class TableauController extends BaseController {
@Resource
private TableauService tableauService;
@ResponseBody
@GetMapping("unreturnedTax")
public ApiResultDto getUnreturnedTax() {
return ApiResultDto.success(tableauService.getUnreturnedTax().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("taxComparison")
public ApiResultDto getTaxComparison() {
return ApiResultDto.success(tableauService.getTaxComparison().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("otherCountries")
public ApiResultDto getOtherCountries() {
return ApiResultDto.success(tableauService.getOtherCountries().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("costAnalysis")
public ApiResultDto getCostAnalysis() {
return ApiResultDto.success(tableauService.getCostAnalysis().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("profitAndLoss")
public ApiResultDto getProfitAndLoss() {
return ApiResultDto.success(tableauService.getProfitAndLoss().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("otherDomesticData")
public ApiResultDto getOtherDomesticData() {
return ApiResultDto.success(tableauService.getOtherDomesticData().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("docSituation")
public ApiResultDto getDocSituation() {
return ApiResultDto.success(tableauService.getDocSituation().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("globalOverview")
public ApiResultDto getGlobalOverview() {
return ApiResultDto.success(tableauService.getGlobalOverview().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("mexicanTax")
public ApiResultDto getMexicanTax() {
return ApiResultDto.success(tableauService.getMexicanTax().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("australianTax")
public ApiResultDto getAustralianTax() {
return ApiResultDto.success(tableauService.getAustralianTax().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("brazilianTax")
public ApiResultDto getBrazilianTax() {
return ApiResultDto.success(tableauService.getBrazilianTax().orElse(StringUtils.EMPTY));
}
}
This diff is collapsed.
package pwc.taxtech.atms.service.impl;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.config.SystemConfig;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.Optional;
@Service
public class TableauService extends BaseService {
@Resource
private SystemConfig systemConfig;
/**
* 获取ticket
*
* @param username 用户名
* @return Optional<String>
*/
public Optional<String> getTicket(String username) {
CloseableHttpClient httpClient = null;
try {
String ticketUrl = String.format(systemConfig.getTableauGetTicket(), username);
httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(ticketUrl);
HttpResponse httpResponse = httpClient.execute(httpPost);
String response = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8");
return StringUtils.equals(response, "-1") ? Optional.empty() : Optional.of(response);
} catch (Exception e) {
logger.error("getTicket error.", e);
} finally {
if (null != httpClient) {
try {
httpClient.close();
} catch (IOException e) {
logger.error("close httpClient error.", e);
}
}
}
return Optional.empty();
}
public Optional<String> getUnreturnedTax() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauUnreturnedTax(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getTaxComparison() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauTaxComparison(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getOtherCountries() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauOtherCountries(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getCostAnalysis() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauCostAnalysis(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getProfitAndLoss() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauProfitAndLoss(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getOtherDomesticData() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauOtherDomesticData(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getDocSituation() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauDocSituation(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getGlobalOverview() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauGlobalOverview(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getMexicanTax() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauMexicanTax(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getAustralianTax() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauAustralianTax(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getBrazilianTax() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauBrazilianTax(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
}
......@@ -22,14 +22,16 @@ import pwc.taxtech.atms.vat.entity.FileUpload;
import pwc.taxtech.atms.vat.entity.ReportFileUpload;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.*;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
......@@ -360,12 +362,19 @@ public class TaxDocumentServiceImpl {
}
//文件名称(带后缀)
String fileName = StringUtils.isBlank(taxDocument.getFileOriginalName()) ? "未知文件(请修改后缀名).xlsx" : taxDocument.getFileOriginalName();
//设置输出流信息
try {
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("单个下载文件名编码时出现错误.", e);
}
//获取需要下载的文件流
InputStream is = null;
BufferedInputStream in = null;
byte[] buffer = new byte[1024];
int len;
ServletOutputStream out = null;
OutputStream out = null;
try {
URL httpurl = new URL(URLDecoder.decode(urlPath, "UTF-8"));
HttpURLConnection httpConn = (HttpURLConnection) httpurl.openConnection();
......
......@@ -23,6 +23,7 @@ import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
......@@ -151,7 +152,7 @@ public class FormulaAgent {
public static String buildSql(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) {
public static String buildSql(String tableName, String getField, String filter, String filterValue, Integer period, Integer year, FormulaContext formulaContext) {
/*
if (split[0].indexOf(">=") != -1) {
......@@ -179,8 +180,13 @@ public class FormulaAgent {
}
public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, String year, boolean bool, boolean getSql) throws Exception {
public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, Integer year, boolean bool, boolean getSql) throws Exception {
String sql = "";
//统一判断年度
Calendar cal = Calendar.getInstance();
int currentYear = cal.get(Calendar.YEAR);
year = currentYear + year;
if(getSql){
tableName = tableName.toLowerCase();
sql = "select * from " + tableName + " where 1=1 and " + filter + filterValue;
......@@ -188,7 +194,6 @@ public class FormulaAgent {
}else{
sql = "select sum(" + getField + ") as " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue;
}
String _p = insertZero(formulaContext.getPeriod() - Math.abs(period));
String _period = insertZero(formulaContext.getPeriod());
String per = insertZero((formulaContext.getPeriod() - 1));
......@@ -224,15 +229,15 @@ public class FormulaAgent {
@Autowired
JdbcTemplate jdbcTemplate;
/*
public static void main(String[] args) {
FormulaAgent formulaAgent = new FormulaAgent();
FormulaContext formulaContext = new FormulaContext();
formulaContext.setPeriod(3);
formulaAgent.getTableDataByName("CIT_TBAM", "ending_balance", "attribute", "= '销售费用-财产损耗、盘亏及毁损损失'", 0, "2018", formulaContext);
}*/
formulaAgent.getTableDataByName("CIT_TBAM", "ending_balance", "attribute", "= '销售费用-财产损耗、盘亏及毁损损失'", 0, 0, null);
}
public BigDecimal getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) {
public BigDecimal getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, Integer year, FormulaContext formulaContext) {
Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext));
......
......@@ -147,7 +147,6 @@ public class ReportGeneratorImpl {
List<PeriodFormulaBlock> periodFormulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample2);
//TODO:如果formula 为 ND(100) +ND(22) ,需要使用正则表达式拆分出自定义公式,然后根据自定义公式取formulablock 的数据进行替换
//原始版本正则表达式,update by zhikai.z.wei at 20190319 19:00
// String regex = "[A-Z]*\\([\\-A-Za-z0-9\\\"\\,\\.\\:\\u4e00-\\u9fa5\\%]*\\)";
String regex = "[A-Z]*\\([^(^)]*\\)";
Pattern p = Pattern.compile(regex);
......
......@@ -57,7 +57,7 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
Integer argsLength;
String getField;
Integer period;
String year;
Integer year;
@Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
......@@ -75,8 +75,8 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
getField = resolverString(args, ec, 1);
filter= resolverString(args, ec, 2);
filterValue= resolverString(args, ec, 3);
period = resolverInteger(args, ec, 4);//会计期间
year = resolverString(args, ec, 5);//会计年度
year = resolverInteger(args, ec, 4);//会计年度
period = Integer.parseInt(resolverString(args, ec, 5));//会计期间
cellValue = agent.getTableDataByName(tableName, getField, filter, filterValue, period, year, formulaContext);
return new NumberEval(cellValue.doubleValue());
} catch (EvaluationException e) {
......
......@@ -57,4 +57,18 @@ api_white_list=${api_white_list}
org_sync_url=${org_sync_url}
org_sync_token=${org_sync_token}
ebs_call_url=${ebs_call_url}
\ No newline at end of file
ebs_call_url=${ebs_call_url}
#tableau config
tableau_get_ticket=${tableau_get_ticket}
tableau_unreturned_tax=${tableau_unreturned_tax}
tableau_tax_comparison=${tableau_tax_comparison}
tableau_other_countries=${tableau_other_countries}
tableau_cost_analysis=${tableau_cost_analysis}
tableau_profit_and_loss=${tableau_profit_and_loss}
tableau_other_domestic_data=${tableau_other_domestic_data}
tableau_doc_situation=${tableau_doc_situation}
tableau_global_overview=${tableau_global_overview}
tableau_mexican_tax=${tableau_mexican_tax}
tableau_australian_tax=${tableau_australian_tax}
tableau_brazilian_tax=${tableau_brazilian_tax}
\ No newline at end of file
......@@ -45,7 +45,7 @@ file_upload_query_url=http://47.94.233.173:11006/resource/erp_tax_system
#didi-config
#ϵַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
#���ϵ�ַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
check_ticket=false
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
......@@ -56,3 +56,17 @@ org_sync_url=http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token=174af08f
ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts
#tableau config
tableau_get_ticket=http://47.94.233.173:16010/trusted?username=%s
tableau_unreturned_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_tax_comparison=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet14?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_countries=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_cost_analysis=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet19?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_profit_and_loss=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet26?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_domestic_data=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet32?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_doc_situation=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_global_overview=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_mexican_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -48,7 +48,7 @@ env_type=pub
file_upload_post_url=http://100.69.238.155:8000/resource/erp_tax_system
file_upload_query_url=http://100.69.238.155:8001/resource/erp_tax_system
#ϵַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
#���ϵ�ַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
check_ticket=true
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
......@@ -59,3 +59,17 @@ org_sync_url=http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token=174af08f
ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts
#tableau config
tableau_get_ticket=http://47.94.233.173:16010/trusted?username=%s
tableau_unreturned_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_tax_comparison=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet14?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_countries=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_cost_analysis=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet19?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_profit_and_loss=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet26?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_domestic_data=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet32?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_doc_situation=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_global_overview=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_mexican_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -43,7 +43,7 @@ env_type=dev
file_upload_post_url=http://47.94.233.173:11005/resource/erp_tax_system
file_upload_query_url=http://47.94.233.173:11006/resource/erp_tax_system
#ϵַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
#���ϵ�ַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
check_ticket=false
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
......@@ -54,3 +54,17 @@ org_sync_url=http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token=174af08f
ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts
#tableau config
tableau_get_ticket=http://47.94.233.173:16010/trusted?username=%s
tableau_unreturned_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_tax_comparison=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet14?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_countries=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_cost_analysis=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet19?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_profit_and_loss=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet26?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_domestic_data=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet32?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_doc_situation=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_global_overview=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_mexican_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.dpo.CitTbamDto;
import pwc.taxtech.atms.entity.CitTbam;
import pwc.taxtech.atms.entity.CitTbamExample;
......@@ -115,5 +114,5 @@ public interface CitTbamMapper extends MyMapper {
*/
int insertBatch(List<CitTbam> citTbamList);
List<CitTbamDto> selectBySql(@Param("sql") String sql);
List<CitTbam> selectBySql(@Param("sql") String sql);
}
\ No newline at end of file
package pwc.taxtech.atms.dpo;
import pwc.taxtech.atms.entity.CitTbam;
/**
* @ClassName CitTbamDto
* Description TODO
* @Author pwc kevin
* @Date 3/15/2019 3:46 PM
* Version 1.0
**/
public class CitTbamDto extends CitTbam {
}
......@@ -22,6 +22,7 @@ public class CitTbam extends BaseEntity implements Serializable {
*
* @mbg.generated
*/
private Long id;
/**
......
......@@ -431,6 +431,9 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="adjustAccount != null">
adjust_account = #{adjustAccount,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......
......@@ -82,7 +82,7 @@
SELECT 1 FROM DUAL;
</insert>
<select id="selectBySql" parameterType="java.lang.String" resultType="pwc.taxtech.atms.dpo.CitTbamDto">
<select id="selectBySql" parameterType="java.lang.String" resultType="pwc.taxtech.atms.entity.CitTbam">
select
id as id,
attribute attribute,
......@@ -91,7 +91,8 @@
debit_amount as debitAmount ,
credit_amount as creditAmount,
beginning_balance as beginningBalance,
IFNULL(adjust_account, ending_balance) as endingBalance
adjust_account as adjustAccount,
ending_balance as endingBalance
<if test="sql != null and sql != '' ">
${sql}
</if>
......
......@@ -1700,5 +1700,175 @@ var analysisModule = angular.module('app.analysis', ['ui.grid', 'ui.router','ui.
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'australianTax',
url: "/analysis/australianTax",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<australian-tax></australian-tax>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'brazilianTax',
url: "/analysis/brazilianTax",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<brazilian-tax></brazilian-tax>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'costAnalysis',
url: "/analysis/costAnalysis",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<cost-analysis></cost-analysis>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'docSituation',
url: "/analysis/docSituation",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<doc-situation></doc-situation>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'globalOverview',
url: "/analysis/globalOverview",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<global-overview></global-overview>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'mexicanTax',
url: "/analysis/mexicanTax",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<mexican-tax></mexican-tax>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'otherDomesticData',
url: "/analysis/otherDomesticData",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<other-domestic-data></other-domestic-data>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'otherCountries',
url: "/analysis/otherCountries",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<other-countries></other-countries>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'profitAndLoss',
url: "/analysis/profitAndLoss",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<profit-and-loss></profit-and-loss>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'taxComparison',
url: "/analysis/taxComparison",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<tax-comparison></tax-comparison>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
}]);
\ No newline at end of file
......@@ -84,6 +84,7 @@
"OrganizationParent":"Holding Entity",
"OrganizationLevelType":"Entity Level",
"OrganizationLevelTypeRequired":"Entity Level Required",
"CreateDocFileType":"Create Document File Type",
"ChangeProjectTips":"Only Change/Delete unused service",
"ExistsProjectCannotDisable":"Cannot disable user because of project exists",
......
......@@ -109,6 +109,7 @@
"DocumentTypeSets": "税务档案类型设置",
"Explain": "说明",
"RequiredFields": "必填字段",
"CreateDocFileType":"新建文档类型",
"State": "状态",
"PCompany": "所属机构",
"Enable": "启用",
......
......@@ -16,6 +16,7 @@
SweetAlert.warning("没有数据可以下载");
return;
}
$scope.dataGridUpdate(data);
})
......@@ -23,6 +24,7 @@
$scope.dataGridUpdate = function (_data) {
$scope.localData = _data.items;
$scope.queryStatusType($scope.localData);
$scope.pagingOptions = {
totalItems: $scope.localData.length, //总数据
};
......@@ -86,6 +88,7 @@
allowHeaderFiltering: true,
cellTemplate: function (container, options) {
try {
$scope.queryStatusType(options.data);
var style = options.data.status == 1 ? '' : 'style="color:#999"';
if (options.data.id) {
$('<span ' + style + '>').text(options.data.id).appendTo(container);
......@@ -103,6 +106,7 @@
allowHeaderFiltering: true,
cellTemplate: function (container, options) {
try {
$scope.queryStatusType(options.data);
var style = options.data.status == 1 ? '' : 'style="color:#999"';
if (options.data.fileAttr) {
$('<span ' + style + '>').text(options.data.fileAttr).appendTo(container);
......@@ -120,6 +124,7 @@
allowHeaderFiltering: true,
cellTemplate: function (container, options) {
try {
$scope.queryStatusType(options.data);
var style = options.data.status == 1 ? '' : 'style="color:#999"';
if (options.data.fileType) {
$('<span ' + style + '>').text(options.data.fileType).appendTo(container);
......@@ -137,6 +142,7 @@
allowHeaderFiltering: true,
cellTemplate: function (container, options) {
try {
$scope.queryStatusType(options.data);
var style = options.data.status == 1 ? '' : 'style="color:#999"';
if (options.data.description) {
$('<span ' + style + '>').text(options.data.description).appendTo(container);
......@@ -155,6 +161,7 @@
allowHeaderFiltering: true,
cellTemplate: function (container, options) {
try {
$scope.queryStatusType(options.data);
var style = options.data.status == 1 ? '' : 'style="color:#999"';
if (options.data.requiredField) {
$('<span '+style+'>').text(options.data.requiredField.join(",")).appendTo(container);
......@@ -173,6 +180,7 @@
allowHeaderFiltering: true,
cellTemplate: function (container, options) {
try {
$scope.queryStatusType(options.data);
var style = options.data.status == 1 ? '' : 'style="color:#999"';
if (options.data.creator) {
$('<span ' + style + '>').text(options.data.creator).appendTo(container);
......@@ -191,6 +199,7 @@
cellTemplate: function (container, options) {
try {
$scope.queryStatusType(options.data);
var style = options.data.status == 1 ? '' : 'style="color:#999"';
if (options.data.updateTime) {
$('<span '+style+'>').text($filter('date')(options.data.updateTime, 'yyyy-MM-dd')).appendTo(container);
......@@ -208,6 +217,7 @@
allowHeaderFiltering: true,
cellTemplate: function (container, options) {
try {
$scope.queryStatusType(options.data);
if (options.data.status == 1) {
options.data.status = $translate.instant('Enabled');
$('<span>').text(options.data.status).appendTo(container);
......@@ -251,10 +261,12 @@
$scope.localData.forEach(function (item) {
if (item.id == rowId) {
$scope.editModel = angular.copy(item);
if($scope.editModel.status != 1 || $scope.editModel.status != 0){
// 特殊处理状态值,1 = “已启用”, 0 = “已禁用”
$scope.editModel.status = item.status == $translate.instant("Enabled") ? 1 : 0;
}
// if($scope.editModel.status != 1 || $scope.editModel.status != 0){
// // 特殊处理状态值,1 = “已启用”, 0 = “已禁用”
// $scope.editModel.status = item.status == $translate.instant("Enabled") ? 1 : 0;
// }
$scope.queryStatusType($scope.editModel);
}
});
}
......@@ -286,6 +298,7 @@
if(uploadModel.status === undefined
|| uploadModel.status === null) uploadModel.status = 1;
$scope.queryStatusType(uploadModel);
docManageService.addFileType(uploadModel).then(function (data) {
if (data == true) {
SweetAlert.success($translate.instant('SaveSuccess'));
......@@ -299,6 +312,7 @@
var editDocFileType = function () {
var uploadModel = angular.copy($scope.editModel);
$scope.queryStatusType(uploadModel);
docManageService.editFileType(uploadModel).then(function (data) {
if (data == true) {
SweetAlert.success($translate.instant('SaveSuccess'));
......@@ -316,19 +330,19 @@
};
$scope.editModel = {
"id": 0,//主键id
"fileAttr": "",//档案属性 手写
"id": null,//主键id
"fileAttr": null,//档案属性 手写
"fileTypeId": null,//暂无作用 因档案类型手写
"fileType": "",//档案类型
"fileType": null,//档案类型
"requiredField": [],//必填字段对应id(先写死) 对应关系以前端为主导
"requiredFieldJson": "",//后台转换使用
"description": "",//说明
"creatorId": 1,//创建人id
"creator": "",//创建人名字
"createTime": "2019-02-27T17:53:58.000+08:00",//创建时间
"requiredFieldJson": null,//后台转换使用
"description": null,//说明
"creatorId": null,//创建人id
"creator": null,//创建人名字
"createTime": null,//创建时间
"updateTime": null,//更新时间
"status": 0,//'状态(0代表停用,1代表启用)'
"remarks": ""//备注
"status": null,//'状态(0代表停用,1代表启用)'
"remarks": null//备注
};
$scope.editRequiredFieldsMap = {
1: "文件生效日期",
......@@ -344,6 +358,24 @@
$scope.editModel.requiredFieldJson = JSON.stringify(values);
}
// 在入口和出口都对数据的status字段进行过滤
$scope.queryStatusType = function(model){
if(Object.prototype.toString.call(model) === "[object Array]"){
model.forEach(function(item){
if(item.status === $translate.instant('Enabled')){
item.status = 1;
}else if(item.status === $translate.instant('Disabled')){
item.status = 0;
}
})
}else{
if(model.status === $translate.instant('Enabled')){
model.status = 1;
}else if(model.status === $translate.instant('Disabled')){
model.status = 0;
}
}
}
//----------------------taxation----basic-end-------------------------------
;(function initialize() {
......
analysisModule.controller('AustralianTaxController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/australianTax', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('australianTax', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/australian-tax/australian-tax.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'AustralianTaxController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
analysisModule.controller('BrazilianTaxController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/brazilianTax', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('brazilianTax', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/brazilian-tax/brazilian-tax.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'BrazilianTaxController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
analysisModule.controller('CostAnalysisController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/costAnalysis', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('costAnalysis', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/cost-analysis/cost-analysis.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'CostAnalysisController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
analysisModule.controller('DocSituationController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/docSituation', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('docSituation', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/doc-situation/doc-situation.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'DocSituationController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
analysisModule.controller('GlobalOverviewController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/globalOverview', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('globalOverview', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/global-overview/global-overview.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'GlobalOverviewController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
analysisModule.controller('MexicanTaxController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/mexicanTax', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('mexicanTax', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/mexican-tax/mexican-tax.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'MexicanTaxController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
analysisModule.controller('OtherCountriesController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/otherCountries', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('otherCountries', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/other-countries/other-countries.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'OtherCountriesController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
analysisModule.controller('OtherDomesticDataController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/otherDomesticData', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('otherDomesticData', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/other-domestic-data/other-domestic-data.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'OtherDomesticDataController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
analysisModule.controller('ProfitAndLossController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/profitAndLoss', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('profitAndLoss', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/profit-and-loss/profit-and-loss.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'ProfitAndLossController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
analysisModule.controller('TaxComparisonController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/taxComparison', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('taxComparison', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/tax-comparison/tax-comparison.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'TaxComparisonController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
analysisModule.controller('UnreturnedTaxController', ['$scope','$filter', '$log', '$translate', '$timeout',
function ($scope,$filter, $log, $translate, $timeout) {
analysisModule.controller('UnreturnedTaxController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
var placeholderDiv = document.getElementById('vizContainer');
var url = 'http://10.158.230.16:8890/trusted/b4TGi86ySyuKfWyvE8vnww==:Rel9fneoVyJ58IukJ5ve-_k1/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no';
var options = {
hideTabs: true,
width: "90%",
height: "500px",
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
$scope.viz = new tableau.Viz(placeholderDiv, url, options);
$http.get('/tableau/unreturnedTax', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
......
<!--<script type='text/javascript' src='http://10.158.230.16:8890/javascripts/api/tableau-2.min.js'></script>-->
<div class='tableauPlaceholder' style='width: 1920px; height: 848px;'>
<!--<object class='tableauViz' width='1920' height='848' style='display:none;'>-->
<!--<param name='host_url' value='http%3A%2F%2F10.158.230.16%3A8890%2F'/>-->
<!--<param name='embed_code_version' value='3'/>-->
<!--<param name='site_root' value=''/>-->
<!--<param name='name' value='Didi_Tax_20190307&#47;sheet8'/>-->
<!--<param name='tabs' value='no'/>-->
<!--<param name='toolbar' value='yes'/>-->
<!--<param name='showAppBanner' value='false'/>-->
<!--<param name='filter' value='iframeSizedToWindow=true'/>-->
<!--<param name="ticket" value="g2-zt7USSSmP7mPfZU2P1Q==:kZimvabueyV0_38cviKedMKz"/>-->
<!--</object>-->
<div id="vizContainer" style="display: flex; justify-content: center"></div>
</div>
<!--<iframe src="http://10.158.230.16:8890/trusted/JS6C48CESm6veO9zZqFLHw==:0dKT6t0QE0OeVhKYRQ7k471k/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no"-->
<!--width="800" height="600"></iframe>-->
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
......@@ -10,7 +10,11 @@
},
controller: 'UnreturnedTaxController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
......
......@@ -619,11 +619,9 @@ debugger;
else if (_.isNumber(newVal) && !isNaN(newVal)) {
newVal = newVal.toFixed(4);
}
if(x.keyinData){
sheet.setValue(x.rowIndex, x.columnIndex, x.keyinData);
}
var oldVal = x.value;
oldVal = PWC.tryParseStringToNum(oldVal);
if (_.isBoolean(oldVal)) {
......
......@@ -1216,7 +1216,6 @@
// 更新spreadjs计算所需datasource信息
$scope.updateCellByManualChange = function (manualData) {
debugger;
var cellData = _.find($scope.reportData, function (x) {
return x.cellTemplateID == manualData.cellTemplateId
|| x.cellID === manualData.cellId;
......@@ -1330,8 +1329,8 @@
$scope.manualDataSources.push({item1: manualData.cellTemplateId, item2: manualData});
}
// 刷新spreadsheet,获取操作数据源后最新的计算结果,并拿来与当前所有单元格value比较,得到value修改前后的值对比
var updatedCells = $scope.reportApi.refreshReport();
loadCellData(getActualPeriod());
var updatedCells = $scope.reportApi.refreshReport();
};
$scope.updateCellBySourceDetailDelete = function (dataSource, detailId, opType) {
......
......@@ -14,6 +14,7 @@
//关闭数据源弹出框
var hidePanel = function () {
$scope.selectedDataSourceTabIndex = 1;
$scope.tabType = 1;
......@@ -228,14 +229,13 @@
}
$scope.hidePanel();
vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, status, null, null);
if ($scope.detail.cellType == enums.formulaDataSourceType.CIT_TBAM) {//
[$scope.detail.entryIndex].adjustBack
if ($scope.detail.cellType == enums.formulaDataSourceType.CIT_TBAM) {
var updateAdjustDto = [];
$scope.detail.dataGridSourceBind.forEach(function (e, index) {
if (e.adjustBack != undefined && e.adjustBack != null) {
updateAdjustDto.push({
id: e.id,
adjustAccount: e.adjustBack
"id": e.id,
"adjustAccount": Number(e.adjustBack)
});
}
});
......@@ -245,9 +245,8 @@
});
}
}).error(function (error) {
if (error) {
if (error)
alert("调整金额数据更新失败");
}
});
}
};
......@@ -641,7 +640,7 @@
};
//弹框表格右下角合计值
var getConclusionVal = function () {
var getConclusionVal = function (type) {
var precition = 2;
//如果数值是份数类型,则精度为0,否则为2
if ($scope.detail.dataType === 5) {
......@@ -710,7 +709,7 @@
}, 0);
$("#dataGridFooterSummary").html($translate.instant('Conclusion')
+ '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(precition));
} else if ($scope.selectedTabIndex === enums.formulaDataSourceType.CIT_TBAM) {
} else if ($scope.selectedTabIndex === enums.formulaDataSourceType.CIT_TBAM && type == true) {
calculateSum(null);
}
else { // For 报表数据源 and BSPL数据源
......@@ -1526,7 +1525,7 @@
alignment: 'left'
},
{
dataField: 'adjustBack',
dataField: 'adjustAccount',
caption: $translate.instant('BackAdjustAmount'),
alignment: 'left'
}
......@@ -1540,7 +1539,6 @@
$scope.$watch('relObj.checkRadio', function (n, o) {
if ($scope.detail.entryIndex != undefined) {
$scope.detail.dataGridSourceBind[$scope.detail.entryIndex].adjustBack = n;
$scope.detail.dataGridSourceBind[$scope.detail.entryIndex].isBack = true;
calculateSum(n);
}
});
......@@ -1567,11 +1565,9 @@
} else {
for (var i = 0, j = $scope.detail.dataGridSourceBind.length; i < j; i++) {
s = $scope.detail.dataGridSourceBind[i].adjustAccount;
if (s == null && $scope.detail.dataGridSourceBind[$scope.detail.entryIndex].isBack == undefined) {
evalVal += $scope.detail.dataGridSourceBind[$scope.detail.entryIndex].endingBalance;
} else if (s != null && $scope.detail.dataGridSourceBind[$scope.detail.entryIndex].isBack == undefined) {
evalVal += s;
} else {
if(s == null){
evalVal += $scope.detail.dataGridSourceBind[i].endingBalance;
}else{
evalVal += s;
}
}
......@@ -2295,14 +2291,14 @@
});
$scope.dataGridColumns = getDataGridColumns();
getConclusionVal();
getConclusionVal(false);
}, 500);
});
var getBlowGridData = function (data) {
cellCommentService.getCellInformation(data).success(function (res) {
if (res.resultMsg) {
$scope.detail.dataGridSourceBind = res.data;
calculateSum(null);
getConclusionVal(true);
}
}).error(function (error) {
});
......
......@@ -18,7 +18,7 @@ webservices.factory('cellCommentService', ['$http', 'apiConfig', function ($http
return $http.get('/CellComment/loadEntryListDataList?code=' + code, apiConfig.createVat());
},
updateAdjust : function (data) {
return $http.post('/CellComment/updateAdjust', data, apiConfig.createVat());
return $http.post('/CellComment/updateAdjust', JSON.stringify(data), apiConfig.createVat({contentType: 'application/json;charset=UTF-8'}));
},
selectEntryLog : function (code) {
return $http.get('/CellComment/selectEntryLog?code=' + code, apiConfig.createVat());
......
......@@ -485,6 +485,28 @@ taxDocumentManageModule.controller('taxDocumentListController',
$scope.fileTypeOptions = $scope.sortByFirstCode(Object.keys(data));
$scope.fileAttrOptions = $scope.sortByFirstCode(Object.values(data));
// 过滤去重
var temp = $scope.fileTypeOptions;
$scope.fileTypeOptions = (function(){
var result = [];
temp.forEach(function(typeItem){
if(result.indexOf(typeItem) === -1){
result.push(typeItem);
}
});
return result;
})();
temp = $scope.fileAttrOptions;
$scope.fileAttrOptions = (function(){
var result = [];
temp.forEach(function(attrItem){
if(result.indexOf(attrItem) === -1){
result.push(attrItem);
}
});
return result;
})();
}
});
......@@ -1245,8 +1267,10 @@ taxDocumentManageModule.directive('watchGroup', function () {
$scope.autoMatchAttrAndType = function (fileName, fieldModel) {
fileName = fileName ? fileName : "";
var fieldsAttrs = fileName.split("_");
fieldModel.fileName = fieldsAttrs[0];
fieldModel.fileType = fieldsAttrs[1];
if(fieldsAttrs.length){
fieldModel.companyName = fieldsAttrs[0];
fieldModel.fileType = fieldsAttrs[1];
}
// 根据Type来匹配Attr;
Object.keys($scope.typeAndAttrMap).forEach(function (key) {
......@@ -1437,4 +1461,129 @@ taxDocumentManageModule.directive('downLoadModule', function () {
};
}]
}
});
taxDocumentManageModule.directive('exportPlugin',function(){
return{
restrict:"EA",
controller:['$scope','SweetAlert','$translate',function($scope,SweetAlert,$translate){
$scope.exportOrgList = function ()
{
var exportData = {
"type" : "orgList",
"jsonData" : JSON.stringify($scope.DataGridSource)
};
orgService.downloadOrgListData(exportData).success(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
}
exportToExcel(data, status, headers, 'taxDocument.xls');
}).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
};
//下载服务器上的xls文件
var exportToExcel = function (data, status, headers, defaultFileName) {
$('#busy-indicator-container').show();
var defer = $q.defer();
var octetStreamMime = 'application/vnd.ms-excel';
var success = false;
// Get the headers
headers = headers();
// Get the filename from the x-filename header or default to "download.bin"
var filename = decodeURI(headers['x-file-name']) + defaultFileName;
// Determine the content type from the header or default to "application/octet-stream"
var contentType = headers['content-type'] || octetStreamMime;
try {
// Try using msSaveBlob if supported
//console.log("Trying saveBlob method ...");
var blob = new Blob([data], { type: contentType });
if (navigator.msSaveBlob)
navigator.msSaveBlob(blob, filename);
else {
// Try using other saveBlob implementations, if available
var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
if (saveBlob === undefined) throw "Not supported";
saveBlob(blob, filename);
}
//console.log("saveBlob succeeded");
success = true;
} catch (ex) {
$log.debug("saveBlob method failed with the following exception:");
$log.debug(ex);
}
if (!success) {
// Get the blob url creator
var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
if (urlCreator) {
// Try to use a download link
var link = document.createElement('a');
if ('download' in link) {
// Try to simulate a click
try {
// Prepare a blob URL
//console.log("Trying download link method with simulated click ...");
var blobdownload = new Blob([data], { type: contentType });
var urldownload = urlCreator.createObjectURL(blobdownload);
link.setAttribute('href', urldownload);
// Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
link.setAttribute("download", filename);
// Simulate clicking the download link
var event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
link.dispatchEvent(event);
//console.log("Download link method with simulated click succeeded");
success = true;
} catch (ex) {
$log.debug("Download link method with simulated click failed with the following exception:");
$log.debug(ex);
$q.reject();
}
}
if (!success) {
// Fallback to window.location method
try {
// Prepare a blob URL
// Use application/octet-stream when using window.location to force download
//console.log("Trying download link method with window.location ...");
var blobsuccess = new Blob([data], { type: octetStreamMime });
var urlsuccess = urlCreator.createObjectURL(blobsuccess);
window.location = urlsuccess;
//console.log("Download link method with window.location succeeded");
success = true;
} catch (ex) {
//console.log("Download link method with window.location failed with the following exception:");
$log.debug(ex);
$q.reject();
}
}
}
}
if (!success) {
// Fallback to window.open method
$log.debug("No methods worked for saving the arraybuffer, using last resort window.open");
window.open(httpPath, '_blank', '');
}
//Delete the file
// deleteFile(encodeURI(filename));
defer.resolve('success');
$('#busy-indicator-container').hide();
return defer.promise;
};
}]
}
});
\ No newline at end of file
......@@ -498,7 +498,7 @@
<span translate="EntityIndex"></span>
</div>
<div class="TDL-query-val">
<input type="number" class="form-control radius3"
<input type="text" class="form-control radius3"
ng-model="queryFieldModel.physicalIndexNumber"/>
</div>
</div>
......@@ -818,7 +818,7 @@
</label>
<div class="col-sm-11" style="width:61.67%">
<input class="form-control"
type="number"
type="text"
placeholder="{{'PleaseType' | translate}}"
ng-required="isRequired('EntityIndex')"
ng-model="editFieldModel.physicalIndexNumber"
......@@ -1055,7 +1055,7 @@
</label>
<div class="col-sm-11" style="width:61.67%">
<input class="form-control"
type="number"
type="text"
placeholder="{{'PleaseType' | translate}}"
ng-model="editFieldItem.physicalIndexNumber"
ng-required="isRequired('EntityIndex')"
......@@ -1180,7 +1180,7 @@
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="closeImgPop()">×</span>
<div class="modal-title">{{curImgName}}</div>
</div>
<div class="modal-body" style="text-align: center;">
<div class="modal-body" style="text-align: center;overflow: auto;">
<img src="{{curImgSrc}}" alt="please try again">
</div>
</div>
......
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