Commit 88083787 authored by Memorydoc's avatar Memorydoc

#

parent 722c1c60
This diff is collapsed.
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;
}
}
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;
}
}
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 + ">";
}
}
}
package pwc.taxtech.atms.service.impl;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.vat.service.impl.ApprovalService;
public class BpmTest extends CommonIT {
private static final Logger logger = LoggerFactory.getLogger(BpmTest.class);
@Autowired
RuntimeService runtimeService;
@Autowired
TaskService taskService;
@Autowired
ApprovalService approvalService;
@Test
public void testStart(){
ApprovalDto dto=new ApprovalDto();
dto.setProjectId("220c976c-f527-4abe-ad4a-3c2f863854c8");
dto.setPeriodDate("2019.2");
approvalService.startInstanceAndAssignee(dto);
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"agreed","aaa", Constant.ROLE_COMPLIANCE_CHIEF);
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"agreed","aaa", Constant.ROLE_TAX_BP);
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"agreed","aaa", Constant.ROLE_COMPLIANCE_IA);
}
@Test
public void testApproval(){
ApprovalDto dto=new ApprovalDto();
dto.setProjectId("220c976c-f527-4abe-ad4a-3c2f863854c8");
dto.setPeriodDate("2019.2");
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"disagreed","aaa", Constant.ROLE_COMPLIANCE_IA);
}
package pwc.taxtech.atms.service.impl;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.vat.service.impl.ApprovalService;
public class BpmTest extends CommonIT {
private static final Logger logger = LoggerFactory.getLogger(BpmTest.class);
@Autowired
RuntimeService runtimeService;
@Autowired
TaskService taskService;
@Autowired
ApprovalService approvalService;
@Test
public void testStart(){
ApprovalDto dto=new ApprovalDto();
dto.setProjectId("220c976c-f527-4abe-ad4a-3c2f863854c8");
dto.setPeriodDate("2019.2");
approvalService.startInstanceAndAssignee(dto);
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"agreed","aaa", Constant.ROLE_COMPLIANCE_CHIEF);
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"agreed","aaa", Constant.ROLE_TAX_BP);
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"agreed","aaa", Constant.ROLE_COMPLIANCE_IA);
}
@Test
public void testApproval(){
ApprovalDto dto=new ApprovalDto();
dto.setProjectId("220c976c-f527-4abe-ad4a-3c2f863854c8");
dto.setPeriodDate("2019.2");
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"disagreed","aaa", Constant.ROLE_COMPLIANCE_IA);
}
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dpo;
import pwc.taxtech.atms.dpo.PagingDto;
public class CashFlowCondition {
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.vat.dpo;
import pwc.taxtech.atms.dpo.PagingDto;
public class CashFlowCondition {
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;
}
}
File mode changed from 100755 to 100644
<div id="cit-analysis-menu">
<div class="vat-analysis-menu">
<perfect-scrollbar class="scroller" wheel-propagation="true" wheel-speed="1" min-scrollbar-length="20">
<div class="li" ng-repeat="menu in ::menus" atms-permission permission-control-type="ngIf" permission-code="{{::menu.permission}}">
<a ng-click="analyzeMenuEvent(this);" ui-sref-active="active" ui-sref="{{::menu.name}}">
<i class="{{::menu.icon}}" style="display: block;padding-bottom: 10px;" aria-hidden="true"></i>
<span>{{::menu.text}}</span>
</a>
</div>
</perfect-scrollbar>
</div>
<div class="vat-analysis-content" ui-view></div>
</div>
<div id="cit-analysis-menu">
<div class="vat-analysis-menu">
<perfect-scrollbar class="scroller" wheel-propagation="true" wheel-speed="1" min-scrollbar-length="20">
<div class="li" ng-repeat="menu in ::menus" atms-permission permission-control-type="ngIf" permission-code="{{::menu.permission}}">
<a ng-click="analyzeMenuEvent(this);" ui-sref-active="active" ui-sref="{{::menu.name}}">
<i class="{{::menu.icon}}" style="display: block;padding-bottom: 10px;" aria-hidden="true"></i>
<span>{{::menu.text}}</span>
</a>
</div>
</perfect-scrollbar>
</div>
<div class="vat-analysis-content" ui-view></div>
</div>
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