Commit a6ba18c1 authored by eddie.woo's avatar eddie.woo

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

parents 8579fb7b 4020adf1
......@@ -14,8 +14,8 @@ atms-api/~
/bin/
/atms-api/src/main/resources/conf/conf_profile_dev_local.properties
atms-api/pom.xml
/atms-api/pom.xml
atms-web/src/main/webapp/package-lock.json
......
File mode changed from 100755 to 100644
......@@ -35,4 +35,8 @@ public class CommonUtil {
}
return flag;
}
public static BigDecimal BigDecimal2Fix(BigDecimal bigDecimal){
return bigDecimal.setScale(2, BigDecimal.ROUND_DOWN);
}
}
......@@ -88,4 +88,7 @@ public class StringUtil {
//ARE_YOU_DOU_BI_YELLOWCONG
System.out.println(camel2Underline(camel));
}*/
}
......@@ -115,8 +115,8 @@ public class TaxDocumentController {
*/
@PostMapping("/previewPDF")
@ResponseBody
public void previewPDF(@RequestBody TaxDocumentDto taxDocumentDto) {
taxDocumentService.previewPDF(taxDocumentDto.getPath());
public String previewPDF(HttpServletResponse response ,@RequestBody TaxDocumentDto taxDocumentDto) {
return taxDocumentService.previewPDF2(response,taxDocumentDto.getPath());
/*InputStream is = null;
ByteArrayOutputStream os = null;
try {
......
......@@ -286,9 +286,9 @@ public class CitImportExcelServiceImpl extends BaseService {
}
citJournal.setAttribute3(CitCommonUtil.getValue(rowData.getCell(38)).toString());
citJournal.setAttribute4(CitCommonUtil.getValue(rowData.getCell(39)).toString());
citJournal.setAttribute5(CitCommonUtil.getValue(rowData.getCell(40)).toString());
citJournal.setAttribute6(CitCommonUtil.getValue(rowData.getCell(41)).toString());
citJournal.setAttribute7(CitCommonUtil.getValue(rowData.getCell(42)).toString());
citJournal.setAttribute5(CitCommonUtil.getValue(rowData.getCell(40)).toString().replace(".0",""));
citJournal.setAttribute6(CitCommonUtil.getValue(rowData.getCell(41)).toString().replace(".0",""));
citJournal.setAttribute7(CitCommonUtil.getValue(rowData.getCell(42)).toString().replace(".0",""));
citJournal.setAttribute8(CitCommonUtil.getValue(rowData.getCell(43)).toString());
citJournal.setAttribute9(CitCommonUtil.getValue(rowData.getCell(44)).toString());
citJournal.setAttribute10(CitCommonUtil.getValue(rowData.getCell(45)).toString());
......
......@@ -175,9 +175,11 @@ public class FileTypesServiceImpl {
* @param fileTypes
*/
private void requiredFieldFormatToJson(FileTypes fileTypes) {
if (fileTypes.getRequiredField().size() > 0) {
if (null != fileTypes.getRequiredField() && fileTypes.getRequiredField().size() > 0) {
String requiredFieldJson = JSONObject.toJSONString(fileTypes.getRequiredField());
fileTypes.setRequiredFieldJson(requiredFieldJson);
}else{
throw new RuntimeException("必填字段没有填写");
}
}
......
......@@ -432,10 +432,11 @@ public class TaxDocumentServiceImpl {
}
}
public void previewPDF(String path) {
public void previewPDF(HttpServletResponse response ,String path) {
String imageType = "PNG";
OutputStream sos = null;
try {
sos = response.getOutputStream();
PDFToImg(sos, path, getPDFNum(path), imageType);
} catch (IOException e) {
log.error("PDF转换图片异常: " + e.getMessage());
......@@ -1217,4 +1218,45 @@ public class TaxDocumentServiceImpl {
}
return is;
}
public String previewPDF2(HttpServletResponse response , String path) {
InputStream is = null;
ByteArrayOutputStream os = null;
String dUrlData;
//pdf源路径
byte[] buff = new byte[1024];
int len;
try {
is = getInputStreamByUrl(path);
os = new ByteArrayOutputStream();
while ((len = is.read(buff)) != -1) {
os.write(buff, 0, len);
}
os.flush();
os.toByteArray();
dUrlData = Base64.getEncoder().encodeToString(os.toByteArray());
} catch (IOException e) {
log.error(e.getMessage());
throw new RuntimeException("pdf转换错误");
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
log.error(e.getMessage());
throw new RuntimeException("pdf转换错误");
}
}
if (os != null) {
try {
os.close();
} catch (IOException e) {
log.error(e.getMessage());
throw new RuntimeException("pdf转换错误");
}
}
}
return dUrlData;
}
}
......@@ -3,7 +3,15 @@ package pwc.taxtech.atms;
import java.io.InputStreamReader;
import java.io.Reader;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.common.collect.Lists;
import org.apache.ibatis.jdbc.ScriptRunner;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.runner.RunWith;
......@@ -11,6 +19,8 @@ import org.nutz.lang.Lang;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
......@@ -40,7 +50,8 @@ import pwc.taxtech.atms.vat.dao.PeriodTemplateMapper;
@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:applicationContext.xml" })
@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
@PropertySource("classpath:/conf/conf.properties")
public abstract class CommonIT {
private static final Logger logger = LoggerFactory.getLogger(CommonIT.class);
......@@ -326,6 +337,4 @@ public abstract class CommonIT {
MenuExample example = new MenuExample();
menuMapper.deleteByExample(example);
}
}
\ No newline at end of file
......@@ -5,14 +5,17 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.common.util.DataBaseTableUtil;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.OrganizationExample;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
/**
* @Auther: Gary J Li
......@@ -27,75 +30,82 @@ public class AnalysisTest extends CommonIT {
private AnalysisJobServiceImpl analysisJobService;
@Test
public void analysisExpectedTax(){
public void analysisExpectedTax() {
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s预期返还税数据",period));
analysisJobService.analysisExpectedTax(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%s预期返还税数据", period));
analysisJobService.analysisExpectedTax(orgs, period, EnumTbImportType.CoverImport.getCode());
}
@Test
public void analysisFee(){
public void analysisFee() {
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s费用数据",period));
analysisJobService.analysisFee(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%s费用数据", period));
analysisJobService.analysisFee(orgs, period, EnumTbImportType.CoverImport.getCode());
}
@Test
public void analysisFileManagement(){
public void analysisFileManagement() {
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
// e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s文档管理数据",period));
analysisJobService.analysisFileManagement(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%s文档管理数据", period));
analysisJobService.analysisFileManagement(orgs, period, EnumTbImportType.CoverImport.getCode());
}
@Test
public void analysisMaster(){
public void analysisMaster() {
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s机构数据",period));
analysisJobService.analysisMaster(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%s机构数据", period));
analysisJobService.analysisMaster(orgs, period, EnumTbImportType.CoverImport.getCode());
}
@Test
public void analysisSales(){
public void analysisSales() {
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s申报表数据",period));
analysisJobService.analysisSales(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%s申报表数据", period));
analysisJobService.analysisSales(orgs, period, EnumTbImportType.CoverImport.getCode());
}
@Test
public void analysisTax(){
public void analysisTax() {
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s返还后税数据",period));
analysisJobService.analysisTax(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%s返还后税数据", period));
analysisJobService.analysisTax(orgs, period, EnumTbImportType.CoverImport.getCode());
}
@Test
public void analysisTaxReturnEnd(){
public void analysisTaxReturnEnd() {
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s返还后税数据",period));
analysisJobService.analysisTaxReturnEnd(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%s返还后税数据", period));
analysisJobService.analysisTaxReturnEnd(orgs, period, EnumTbImportType.CoverImport.getCode());
}
/* @Autowired
private EbsApiServiceImpl ebsApiService;
@Test
private void ebsTest(){
ebsApiService.queryRemoteServerThenUpdateCF();
}*/
}
......@@ -418,7 +418,7 @@
attribute16,
created_by, created_date, late_updated_by,
late_updated_date, create_time, update_time,is_select
from cit_journal_entry_adjust where period like #{record.period}
from cit_journal_entry_adjust where period like CONCAT('%' ,#{record.period},'%')
<if test="orgList != null and orgList.size > 0">
AND organization_id in
<foreach item="item" index="index" collection="orgList" open="(" separator="," close=")">
......@@ -450,7 +450,7 @@
accounted_dr, accounted_cr, entered_dr, entered_cr, cf_item, attribute1, attribute2, attribute3, attribute4, attribute5,
attribute6, attribute7, attribute8, attribute9, attribute10, attribute11, attribute12, attribute13, attribute14, attribute15,
attribute16, created_by, created_date, late_updated_by, late_updated_date, create_time, update_time, is_select
from journal_entry where tms_period like #{record.period}
from journal_entry where tms_period like CONCAT('%' ,#{record.period},'%')
<if test="orgList != null and orgList.size > 0">
AND organization_id in
<foreach item="item" index="index" collection="orgList" open="(" separator="," close=")">
......
File mode changed from 100755 to 100644
......@@ -116,6 +116,10 @@ public class IndexController {
try {
logger.info("jumpto=" + jumpto + "code=" + code);
String ticketStr = getTicket(code);
Cookie ddTicket = new Cookie("ddTicket", URLEncoder.encode(ticketStr, "UTF-8"));
ddTicket.setPath("/");
ddTicket.setMaxAge(18000);
response.addCookie(ddTicket);
response.sendRedirect(jumpto + "?code=" + code + "&ticketStr=" + ticketStr);
} catch (Exception e) {
logger.error("ddSSOCallback error", e);
......@@ -212,7 +216,7 @@ public class IndexController {
public String getCookie( HttpServletRequest request,
HttpServletResponse response) {
orangeHeapService.getDDTicketByCookie();
orangeHeapService.getDDTicketByCookie(request);
return null;
}
......
......@@ -4,8 +4,6 @@ package pwc.taxtech.atms.web.controller;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
......@@ -14,7 +12,7 @@ import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.web.service.OrangeHeapService;
import javax.annotation.Resource;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("/OrangeHeap")
......@@ -36,94 +34,94 @@ public class OrangeHeapController {
@ResponseBody
@GetMapping("getTableauTaxCategoryUnreturnedTax")
public ApiResultDto getTableauTaxCategoryUnreturnedTax() {
public ApiResultDto getTableauTaxCategoryUnreturnedTax(HttpServletRequest request) {
logger.info("进入税种未返还税金分析=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
return ApiResultDto.success(tableauService.getTableauTaxCategoryUnreturnedTax().orElse(StringUtils.EMPTY));
return ApiResultDto.success(tableauService.getTableauTaxCategoryUnreturnedTax(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauDistrictUnreturnedTax")
public ApiResultDto getTableauDistrictUnreturnedTax() {
public ApiResultDto getTableauDistrictUnreturnedTax(HttpServletRequest request) {
logger.info("地区未返还税金分析=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
return ApiResultDto.success(tableauService.getTableauDistrictUnreturnedTax().orElse(StringUtils.EMPTY));
return ApiResultDto.success(tableauService.getTableauDistrictUnreturnedTax(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauUnreturnedAndReturnedTax")
public ApiResultDto getTableauUnreturnedAndReturnedTax() {
return ApiResultDto.success(tableauService.getTableauUnreturnedAndReturnedTax().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauUnreturnedAndReturnedTax(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauUnreturnedAndReturnedTax(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauCostAnalysis")
public ApiResultDto getTableauCostAnalysis() {
return ApiResultDto.success(tableauService.getTableauCostAnalysis().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauCostAnalysis(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauCostAnalysis(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauDistrictProfitAndLoss")
public ApiResultDto getTableauDistrictProfitAndLoss() {
return ApiResultDto.success(tableauService.getTableauDistrictProfitAndLoss().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauDistrictProfitAndLoss(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauDistrictProfitAndLoss(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauCompanyProfitAndLoss")
public ApiResultDto getTableauCompanyProfitAndLoss() {
return ApiResultDto.success(tableauService.getTableauCompanyProfitAndLoss().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauCompanyProfitAndLoss(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauCompanyProfitAndLoss(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauDriverAndEmployee")
public ApiResultDto getTableauDriverAndEmployee() {
return ApiResultDto.success(tableauService.getTableauDriverAndEmployee().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauDriverAndEmployee(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauDriverAndEmployee(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauGmvAndSubsidy")
public ApiResultDto getTableauGmvAndSubsidy() {
return ApiResultDto.success(tableauService.getTableauGmvAndSubsidy().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauGmvAndSubsidy(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauGmvAndSubsidy(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauFileArrangement")
public ApiResultDto getTableauFileArrangement() {
return ApiResultDto.success(tableauService.getTableauFileArrangement().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauFileArrangement(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauFileArrangement(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauGlobalOverview")
public ApiResultDto getTableauGlobalOverview() {
return ApiResultDto.success(tableauService.getTableauGlobalOverview().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauGlobalOverview(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauGlobalOverview(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauGlobalBusiness")
public ApiResultDto getTableauGlobalBusiness() {
return ApiResultDto.success(tableauService.getTableauGlobalBusiness().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauGlobalBusiness(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauGlobalBusiness(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauMexicanTax")
public ApiResultDto getTableauMexicanTax() {
return ApiResultDto.success(tableauService.getTableauMexicanTax().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauMexicanTax(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauMexicanTax(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauAustralianTax")
public ApiResultDto getTableauAustralianTax() {
return ApiResultDto.success(tableauService.getTableauAustralianTax().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauAustralianTax(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauAustralianTax(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauBrazilianTax")
public ApiResultDto getTableauBrazilianTax() {
return ApiResultDto.success(tableauService.getTableauBrazilianTax().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauBrazilianTax(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauBrazilianTax(request).orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauOtherTaxAnalysis")
public ApiResultDto getTableauOtherTaxAnalysis() {
return ApiResultDto.success(tableauService.getTableauOtherTaxAnalysis().orElse(StringUtils.EMPTY));
public ApiResultDto getTableauOtherTaxAnalysis(HttpServletRequest request) {
return ApiResultDto.success(tableauService.getTableauOtherTaxAnalysis(request).orElse(StringUtils.EMPTY));
}
}
......@@ -363,7 +363,9 @@ var app = angular.module('app', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.tpls',
systemId: '2500',
//当前用户ID
userId: loginContext.localName,
textStyle: 'rgba(0,0,0,0.15)',
textStyle: 'rgba(0,0,0,0.05)',
imgHeightDis: 230,
imgWidthDis: 230,
containerEl: document.querySelector('body')
});
......
......@@ -1121,7 +1121,7 @@
});
};
var loadCellData = function (period, orgId) {
var loadCellData = function (period) {
//period = Number(period);
if ($scope.templateId !== undefined) {
//todo: according to templateId and period get reportId
......@@ -2841,11 +2841,9 @@
}
var _date = tempYear.toString() + tempMonth;
_date = Number(_date);
if ($scope.relation.orgId != null) {
$scope.relation.period = _date;
loadCellData(_date, $scope.relation.orgId);//默认当前月
}
}
};
var initDatePicker = function () {
......@@ -3089,7 +3087,7 @@
$scope.relation.lockCell($scope.spread);
//关闭弹出层
$('#busy-indicator-container').hide();
spreadTODb();
}, function (e) {
alert(e.errorMessage);
if (e.errorCode === 2/*noPassword*/ || e.errorCode === 3 /*invalidPassword*/) {
......@@ -3144,7 +3142,7 @@
sheet.setValue(42, 2, $scope._ebitResult.sixAddtax);
sheet.setValue(43, 2, $scope._ebitResult.klzcjsz);
}
setTimeout(function(){spreadTODb();}, 1000)
}
$scope.singleExport = function () {
......
This diff is collapsed.
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