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
package pwc.taxtech.atms;
import pwc.taxtech.atms.dpo.UserDto;
import java.util.HashMap;
import java.util.Map;
public class AppCachePool {
private static Map<String, UserDto> CACHED_USERS = null;
private static Object _locker = new Object();
static {
CACHED_USERS = new HashMap<>();
}
public static UserDto getCachedUser(String name) {
String userName = name.toLowerCase();
synchronized (_locker) {
if (!CACHED_USERS.containsKey(userName)) {
UserDto dto = new UserDto();//TODO:should fixed to load from db (neo)
dto.setUserName("cach_test");
dto.setId("1");
CACHED_USERS.put(userName,dto);
}
return CACHED_USERS.get(userName);
}
}
}
package pwc.taxtech.atms;
import pwc.taxtech.atms.dpo.UserDto;
import java.util.HashMap;
import java.util.Map;
public class AppCachePool {
private static Map<String, UserDto> CACHED_USERS = null;
private static Object _locker = new Object();
static {
CACHED_USERS = new HashMap<>();
}
public static UserDto getCachedUser(String name) {
String userName = name.toLowerCase();
synchronized (_locker) {
if (!CACHED_USERS.containsKey(userName)) {
UserDto dto = new UserDto();//TODO:should fixed to load from db (neo)
dto.setUserName("cach_test");
dto.setId("1");
CACHED_USERS.put(userName,dto);
}
return CACHED_USERS.get(userName);
}
}
}
package pwc.taxtech.atms.common;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@Component
public class ResponseMessageBuilder {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
public HttpServletResponse getDownloadTmpResponseMessage(HttpServletResponse response, OutputStream outputStream, String fileName) throws Exception {
fileName = fileName + DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS").format(LocalDateTime.now()) + ".xlsx";
response.setContentType("application/octet-stream;charset=UTF-8");
response.setHeader("Access-Control-Expose-Headers", "x-file-name");
response.addHeader("Content-Disposition", "attachment; filename=" + fileName);
try (OutputStream responseOutputStream = response.getOutputStream()) {
response.setHeader("x-file-name", URLEncoder.encode(fileName, "UTF-8"));
ByteArrayOutputStream byteArrayOutputStream = (ByteArrayOutputStream) outputStream;
responseOutputStream.write(byteArrayOutputStream.toByteArray());
} catch (Exception e) {
logger.error("Error write data to response output stream");
e.printStackTrace();
throw new Exception(e.getMessage());
}
return response;
}
}
package pwc.taxtech.atms.common;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@Component
public class ResponseMessageBuilder {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
public HttpServletResponse getDownloadTmpResponseMessage(HttpServletResponse response, OutputStream outputStream, String fileName) throws Exception {
fileName = fileName + DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS").format(LocalDateTime.now()) + ".xlsx";
response.setContentType("application/octet-stream;charset=UTF-8");
response.setHeader("Access-Control-Expose-Headers", "x-file-name");
response.addHeader("Content-Disposition", "attachment; filename=" + fileName);
try (OutputStream responseOutputStream = response.getOutputStream()) {
response.setHeader("x-file-name", URLEncoder.encode(fileName, "UTF-8"));
ByteArrayOutputStream byteArrayOutputStream = (ByteArrayOutputStream) outputStream;
responseOutputStream.write(byteArrayOutputStream.toByteArray());
} catch (Exception e) {
logger.error("Error write data to response output stream");
e.printStackTrace();
throw new Exception(e.getMessage());
}
return response;
}
}
......@@ -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 {
......
package pwc.taxtech.atms.dto.ebsdto;
public class EbsCallBackDto {
private Long taskId;
private String taskStatus;
private String taskDesc;
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public String getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}
public String getTaskDesc() {
return taskDesc;
}
public void setTaskDesc(String taskDesc) {
this.taskDesc = taskDesc;
}
}
package pwc.taxtech.atms.dto.ebsdto;
public class EbsCallBackDto {
private Long taskId;
private String taskStatus;
private String taskDesc;
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public String getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}
public String getTaskDesc() {
return taskDesc;
}
public void setTaskDesc(String taskDesc) {
this.taskDesc = taskDesc;
}
}
package pwc.taxtech.atms.dto.ebsdto;
import java.math.BigDecimal;
public class OrganizationAccountingRateQueryDto {
private String date;
/**
* Database Column Remarks:
* 期间yyyy-MM-dd
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.period
*
* @mbg.generated
*/
private String period;
/**
* Database Column Remarks:
* 来源
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.source
*
* @mbg.generated
*/
private String source;
/**
* Database Column Remarks:
* 汇率类型
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.convertion_type
*
* @mbg.generated
*/
private String convertionType;
/**
* Database Column Remarks:
* 货币自
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.currency_from
*
* @mbg.generated
*/
private String currencyFrom;
/**
* Database Column Remarks:
* 货币至
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.currency_to
*
* @mbg.generated
*/
private String currencyTo;
/**
* 汇率
*/
private BigDecimal rate;
/**
* 失效日期
*/
private String invalidDate;
/**
* 同步用于标记不同分页的数据,避免重复删除
*/
private String taskId;
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getPeriod() {
return period;
}
public void setPeriod(String period) {
this.period = period;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getConvertionType() {
return convertionType;
}
public void setConvertionType(String convertionType) {
this.convertionType = convertionType;
}
public String getCurrencyFrom() {
return currencyFrom;
}
public void setCurrencyFrom(String currencyFrom) {
this.currencyFrom = currencyFrom;
}
public String getCurrencyTo() {
return currencyTo;
}
public void setCurrencyTo(String currencyTo) {
this.currencyTo = currencyTo;
}
public BigDecimal getRate() {
return rate;
}
public void setRate(BigDecimal rate) {
this.rate = rate;
}
public String getInvalidDate() {
return invalidDate;
}
public void setInvalidDate(String invalidDate) {
this.invalidDate = invalidDate;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
@Override
public String toString() {
return "OrganizationAccountingRateQueryDto{" +
"date='" + date + '\'' +
", period='" + period + '\'' +
", source='" + source + '\'' +
", convertionType='" + convertionType + '\'' +
", currencyFrom='" + currencyFrom + '\'' +
", currencyTo='" + currencyTo + '\'' +
", rate=" + rate +
", invalidDate='" + invalidDate + '\'' +
", taskId='" + taskId + '\'' +
'}';
}
package pwc.taxtech.atms.dto.ebsdto;
import java.math.BigDecimal;
public class OrganizationAccountingRateQueryDto {
private String date;
/**
* Database Column Remarks:
* 期间yyyy-MM-dd
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.period
*
* @mbg.generated
*/
private String period;
/**
* Database Column Remarks:
* 来源
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.source
*
* @mbg.generated
*/
private String source;
/**
* Database Column Remarks:
* 汇率类型
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.convertion_type
*
* @mbg.generated
*/
private String convertionType;
/**
* Database Column Remarks:
* 货币自
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.currency_from
*
* @mbg.generated
*/
private String currencyFrom;
/**
* Database Column Remarks:
* 货币至
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.currency_to
*
* @mbg.generated
*/
private String currencyTo;
/**
* 汇率
*/
private BigDecimal rate;
/**
* 失效日期
*/
private String invalidDate;
/**
* 同步用于标记不同分页的数据,避免重复删除
*/
private String taskId;
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getPeriod() {
return period;
}
public void setPeriod(String period) {
this.period = period;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getConvertionType() {
return convertionType;
}
public void setConvertionType(String convertionType) {
this.convertionType = convertionType;
}
public String getCurrencyFrom() {
return currencyFrom;
}
public void setCurrencyFrom(String currencyFrom) {
this.currencyFrom = currencyFrom;
}
public String getCurrencyTo() {
return currencyTo;
}
public void setCurrencyTo(String currencyTo) {
this.currencyTo = currencyTo;
}
public BigDecimal getRate() {
return rate;
}
public void setRate(BigDecimal rate) {
this.rate = rate;
}
public String getInvalidDate() {
return invalidDate;
}
public void setInvalidDate(String invalidDate) {
this.invalidDate = invalidDate;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
@Override
public String toString() {
return "OrganizationAccountingRateQueryDto{" +
"date='" + date + '\'' +
", period='" + period + '\'' +
", source='" + source + '\'' +
", convertionType='" + convertionType + '\'' +
", currencyFrom='" + currencyFrom + '\'' +
", currencyTo='" + currencyTo + '\'' +
", rate=" + rate +
", invalidDate='" + invalidDate + '\'' +
", taskId='" + taskId + '\'' +
'}';
}
}
\ No newline at end of file
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class CashFlowParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class CashFlowParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
}
......@@ -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("必填字段没有填写");
}
}
......
package pwc.taxtech.atms.service.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
public class JxlsUtils {
public String formatDate(Date date, String pattern) {
if (null == date)
return "";
SimpleDateFormat sdf = new SimpleDateFormat(pattern, Locale.US);
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
try {
return sdf.format(date);
} catch (Exception e) {
return "<Invalid date pattern:" + pattern + ">";
}
}
}
package pwc.taxtech.atms.service.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
public class JxlsUtils {
public String formatDate(Date date, String pattern) {
if (null == date)
return "";
SimpleDateFormat sdf = new SimpleDateFormat(pattern, Locale.US);
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
try {
return sdf.format(date);
} catch (Exception e) {
return "<Invalid date pattern:" + pattern + ">";
}
}
}
......@@ -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);
......@@ -151,11 +162,11 @@ public abstract class CommonIT {
@Autowired
protected CellTemplateConfigMapper cellTemplateConfigMapper;
@Autowired
protected TaxPayerReportRuleMapper taxPayerReportRuleMapper;
protected TaxPayerReportRuleMapper taxPayerReportRuleMapper;
@Autowired
protected TaxRuleSettingOrganizationMapper taxRuleSettingOrganizationMapper;
protected TaxRuleSettingOrganizationMapper taxRuleSettingOrganizationMapper;
@Autowired
protected TaxRuleSettingMapper taxRuleSettingMapper;
protected TaxRuleSettingMapper taxRuleSettingMapper;
@Autowired
protected PeriodTemplateMapper periodTemplateMapper;
@Autowired
......@@ -326,6 +337,4 @@ public abstract class CommonIT {
MenuExample example = new MenuExample();
menuMapper.deleteByExample(example);
}
}
\ No newline at end of file
......@@ -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;
}
......
......@@ -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')
});
......
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