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; package pwc.taxtech.atms;
import pwc.taxtech.atms.dpo.UserDto; import pwc.taxtech.atms.dpo.UserDto;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class AppCachePool { public class AppCachePool {
private static Map<String, UserDto> CACHED_USERS = null; private static Map<String, UserDto> CACHED_USERS = null;
private static Object _locker = new Object(); private static Object _locker = new Object();
static { static {
CACHED_USERS = new HashMap<>(); CACHED_USERS = new HashMap<>();
} }
public static UserDto getCachedUser(String name) { public static UserDto getCachedUser(String name) {
String userName = name.toLowerCase(); String userName = name.toLowerCase();
synchronized (_locker) { synchronized (_locker) {
if (!CACHED_USERS.containsKey(userName)) { if (!CACHED_USERS.containsKey(userName)) {
UserDto dto = new UserDto();//TODO:should fixed to load from db (neo) UserDto dto = new UserDto();//TODO:should fixed to load from db (neo)
dto.setUserName("cach_test"); dto.setUserName("cach_test");
dto.setId("1"); dto.setId("1");
CACHED_USERS.put(userName,dto); CACHED_USERS.put(userName,dto);
} }
return CACHED_USERS.get(userName); return CACHED_USERS.get(userName);
} }
} }
} }
package pwc.taxtech.atms.common; package pwc.taxtech.atms.common;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
@Component @Component
public class ResponseMessageBuilder { public class ResponseMessageBuilder {
private final Logger logger = LoggerFactory.getLogger(this.getClass()); private final Logger logger = LoggerFactory.getLogger(this.getClass());
public HttpServletResponse getDownloadTmpResponseMessage(HttpServletResponse response, OutputStream outputStream, String fileName) throws Exception { public HttpServletResponse getDownloadTmpResponseMessage(HttpServletResponse response, OutputStream outputStream, String fileName) throws Exception {
fileName = fileName + DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS").format(LocalDateTime.now()) + ".xlsx"; fileName = fileName + DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS").format(LocalDateTime.now()) + ".xlsx";
response.setContentType("application/octet-stream;charset=UTF-8"); response.setContentType("application/octet-stream;charset=UTF-8");
response.setHeader("Access-Control-Expose-Headers", "x-file-name"); response.setHeader("Access-Control-Expose-Headers", "x-file-name");
response.addHeader("Content-Disposition", "attachment; filename=" + fileName); response.addHeader("Content-Disposition", "attachment; filename=" + fileName);
try (OutputStream responseOutputStream = response.getOutputStream()) { try (OutputStream responseOutputStream = response.getOutputStream()) {
response.setHeader("x-file-name", URLEncoder.encode(fileName, "UTF-8")); response.setHeader("x-file-name", URLEncoder.encode(fileName, "UTF-8"));
ByteArrayOutputStream byteArrayOutputStream = (ByteArrayOutputStream) outputStream; ByteArrayOutputStream byteArrayOutputStream = (ByteArrayOutputStream) outputStream;
responseOutputStream.write(byteArrayOutputStream.toByteArray()); responseOutputStream.write(byteArrayOutputStream.toByteArray());
} catch (Exception e) { } catch (Exception e) {
logger.error("Error write data to response output stream"); logger.error("Error write data to response output stream");
e.printStackTrace(); e.printStackTrace();
throw new Exception(e.getMessage()); throw new Exception(e.getMessage());
} }
return response; return response;
} }
} }
package pwc.taxtech.atms.dto.ebsdto; package pwc.taxtech.atms.dto.ebsdto;
public class EbsCallBackDto { public class EbsCallBackDto {
private Long taskId; private Long taskId;
private String taskStatus; private String taskStatus;
private String taskDesc; private String taskDesc;
public Long getTaskId() { public Long getTaskId() {
return taskId; return taskId;
} }
public void setTaskId(Long taskId) { public void setTaskId(Long taskId) {
this.taskId = taskId; this.taskId = taskId;
} }
public String getTaskStatus() { public String getTaskStatus() {
return taskStatus; return taskStatus;
} }
public void setTaskStatus(String taskStatus) { public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus; this.taskStatus = taskStatus;
} }
public String getTaskDesc() { public String getTaskDesc() {
return taskDesc; return taskDesc;
} }
public void setTaskDesc(String taskDesc) { public void setTaskDesc(String taskDesc) {
this.taskDesc = taskDesc; this.taskDesc = taskDesc;
} }
} }
package pwc.taxtech.atms.dto.ebsdto; package pwc.taxtech.atms.dto.ebsdto;
import java.math.BigDecimal; import java.math.BigDecimal;
public class OrganizationAccountingRateQueryDto { public class OrganizationAccountingRateQueryDto {
private String date; private String date;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 期间yyyy-MM-dd * 期间yyyy-MM-dd
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.period * This field corresponds to the database column organization_accounting_rate.period
* *
* @mbg.generated * @mbg.generated
*/ */
private String period; private String period;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 来源 * 来源
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.source * This field corresponds to the database column organization_accounting_rate.source
* *
* @mbg.generated * @mbg.generated
*/ */
private String source; private String source;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 汇率类型 * 汇率类型
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.convertion_type * This field corresponds to the database column organization_accounting_rate.convertion_type
* *
* @mbg.generated * @mbg.generated
*/ */
private String convertionType; private String convertionType;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 货币自 * 货币自
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.currency_from * This field corresponds to the database column organization_accounting_rate.currency_from
* *
* @mbg.generated * @mbg.generated
*/ */
private String currencyFrom; private String currencyFrom;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 货币至 * 货币至
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.currency_to * This field corresponds to the database column organization_accounting_rate.currency_to
* *
* @mbg.generated * @mbg.generated
*/ */
private String currencyTo; private String currencyTo;
/** /**
* 汇率 * 汇率
*/ */
private BigDecimal rate; private BigDecimal rate;
/** /**
* 失效日期 * 失效日期
*/ */
private String invalidDate; private String invalidDate;
/** /**
* 同步用于标记不同分页的数据,避免重复删除 * 同步用于标记不同分页的数据,避免重复删除
*/ */
private String taskId; private String taskId;
public String getDate() { public String getDate() {
return date; return date;
} }
public void setDate(String date) { public void setDate(String date) {
this.date = date; this.date = date;
} }
public String getPeriod() { public String getPeriod() {
return period; return period;
} }
public void setPeriod(String period) { public void setPeriod(String period) {
this.period = period; this.period = period;
} }
public String getSource() { public String getSource() {
return source; return source;
} }
public void setSource(String source) { public void setSource(String source) {
this.source = source; this.source = source;
} }
public String getConvertionType() { public String getConvertionType() {
return convertionType; return convertionType;
} }
public void setConvertionType(String convertionType) { public void setConvertionType(String convertionType) {
this.convertionType = convertionType; this.convertionType = convertionType;
} }
public String getCurrencyFrom() { public String getCurrencyFrom() {
return currencyFrom; return currencyFrom;
} }
public void setCurrencyFrom(String currencyFrom) { public void setCurrencyFrom(String currencyFrom) {
this.currencyFrom = currencyFrom; this.currencyFrom = currencyFrom;
} }
public String getCurrencyTo() { public String getCurrencyTo() {
return currencyTo; return currencyTo;
} }
public void setCurrencyTo(String currencyTo) { public void setCurrencyTo(String currencyTo) {
this.currencyTo = currencyTo; this.currencyTo = currencyTo;
} }
public BigDecimal getRate() { public BigDecimal getRate() {
return rate; return rate;
} }
public void setRate(BigDecimal rate) { public void setRate(BigDecimal rate) {
this.rate = rate; this.rate = rate;
} }
public String getInvalidDate() { public String getInvalidDate() {
return invalidDate; return invalidDate;
} }
public void setInvalidDate(String invalidDate) { public void setInvalidDate(String invalidDate) {
this.invalidDate = invalidDate; this.invalidDate = invalidDate;
} }
public String getTaskId() { public String getTaskId() {
return taskId; return taskId;
} }
public void setTaskId(String taskId) { public void setTaskId(String taskId) {
this.taskId = taskId; this.taskId = taskId;
} }
@Override @Override
public String toString() { public String toString() {
return "OrganizationAccountingRateQueryDto{" + return "OrganizationAccountingRateQueryDto{" +
"date='" + date + '\'' + "date='" + date + '\'' +
", period='" + period + '\'' + ", period='" + period + '\'' +
", source='" + source + '\'' + ", source='" + source + '\'' +
", convertionType='" + convertionType + '\'' + ", convertionType='" + convertionType + '\'' +
", currencyFrom='" + currencyFrom + '\'' + ", currencyFrom='" + currencyFrom + '\'' +
", currencyTo='" + currencyTo + '\'' + ", currencyTo='" + currencyTo + '\'' +
", rate=" + rate + ", rate=" + rate +
", invalidDate='" + invalidDate + '\'' + ", invalidDate='" + invalidDate + '\'' +
", taskId='" + taskId + '\'' + ", taskId='" + taskId + '\'' +
'}'; '}';
} }
} }
\ No newline at end of file
package pwc.taxtech.atms.dto.vatdto; package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto; import pwc.taxtech.atms.dpo.PagingDto;
public class CashFlowParam { public class CashFlowParam {
private PagingDto pageInfo; private PagingDto pageInfo;
private String orgId; private String orgId;
private Integer periodStart; private Integer periodStart;
private Integer periodEnd; private Integer periodEnd;
public PagingDto getPageInfo() { public PagingDto getPageInfo() {
return pageInfo; return pageInfo;
} }
public void setPageInfo(PagingDto pageInfo) { public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo; this.pageInfo = pageInfo;
} }
public String getOrgId() { public String getOrgId() {
return orgId; return orgId;
} }
public void setOrgId(String orgId) { public void setOrgId(String orgId) {
this.orgId = orgId; this.orgId = orgId;
} }
public Integer getPeriodStart() { public Integer getPeriodStart() {
return periodStart; return periodStart;
} }
public void setPeriodStart(Integer periodStart) { public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart; this.periodStart = periodStart;
} }
public Integer getPeriodEnd() { public Integer getPeriodEnd() {
return periodEnd; return periodEnd;
} }
public void setPeriodEnd(Integer periodEnd) { public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd; this.periodEnd = periodEnd;
} }
} }
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
import java.util.TimeZone; import java.util.TimeZone;
public class JxlsUtils { public class JxlsUtils {
public String formatDate(Date date, String pattern) { public String formatDate(Date date, String pattern) {
if (null == date) if (null == date)
return ""; return "";
SimpleDateFormat sdf = new SimpleDateFormat(pattern, Locale.US); SimpleDateFormat sdf = new SimpleDateFormat(pattern, Locale.US);
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
try { try {
return sdf.format(date); return sdf.format(date);
} catch (Exception e) { } catch (Exception e) {
return "<Invalid date pattern:" + pattern + ">"; return "<Invalid date pattern:" + pattern + ">";
} }
} }
} }
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import org.activiti.engine.RuntimeService; import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService; import org.activiti.engine.TaskService;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import pwc.taxtech.atms.CommonIT; import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.dto.approval.ApprovalDto; import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.vat.service.impl.ApprovalService; import pwc.taxtech.atms.vat.service.impl.ApprovalService;
public class BpmTest extends CommonIT { public class BpmTest extends CommonIT {
private static final Logger logger = LoggerFactory.getLogger(BpmTest.class); private static final Logger logger = LoggerFactory.getLogger(BpmTest.class);
@Autowired @Autowired
RuntimeService runtimeService; RuntimeService runtimeService;
@Autowired @Autowired
TaskService taskService; TaskService taskService;
@Autowired @Autowired
ApprovalService approvalService; ApprovalService approvalService;
@Test @Test
public void testStart(){ public void testStart(){
ApprovalDto dto=new ApprovalDto(); ApprovalDto dto=new ApprovalDto();
dto.setProjectId("220c976c-f527-4abe-ad4a-3c2f863854c8"); dto.setProjectId("220c976c-f527-4abe-ad4a-3c2f863854c8");
dto.setPeriodDate("2019.2"); dto.setPeriodDate("2019.2");
approvalService.startInstanceAndAssignee(dto); 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_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_TAX_BP);
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"agreed","aaa", Constant.ROLE_COMPLIANCE_IA); // approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"agreed","aaa", Constant.ROLE_COMPLIANCE_IA);
} }
@Test @Test
public void testApproval(){ public void testApproval(){
ApprovalDto dto=new ApprovalDto(); ApprovalDto dto=new ApprovalDto();
dto.setProjectId("220c976c-f527-4abe-ad4a-3c2f863854c8"); dto.setProjectId("220c976c-f527-4abe-ad4a-3c2f863854c8");
dto.setPeriodDate("2019.2"); dto.setPeriodDate("2019.2");
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"disagreed","aaa", Constant.ROLE_COMPLIANCE_IA); // 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; package pwc.taxtech.atms.vat.dpo;
import pwc.taxtech.atms.dpo.PagingDto; import pwc.taxtech.atms.dpo.PagingDto;
public class CashFlowCondition { public class CashFlowCondition {
private PagingDto pageInfo; private PagingDto pageInfo;
private String orgId; private String orgId;
private Integer periodStart; private Integer periodStart;
private Integer periodEnd; private Integer periodEnd;
public PagingDto getPageInfo() { public PagingDto getPageInfo() {
return pageInfo; return pageInfo;
} }
public void setPageInfo(PagingDto pageInfo) { public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo; this.pageInfo = pageInfo;
} }
public String getOrgId() { public String getOrgId() {
return orgId; return orgId;
} }
public void setOrgId(String orgId) { public void setOrgId(String orgId) {
this.orgId = orgId; this.orgId = orgId;
} }
public Integer getPeriodStart() { public Integer getPeriodStart() {
return periodStart; return periodStart;
} }
public void setPeriodStart(Integer periodStart) { public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart; this.periodStart = periodStart;
} }
public Integer getPeriodEnd() { public Integer getPeriodEnd() {
return periodEnd; return periodEnd;
} }
public void setPeriodEnd(Integer periodEnd) { public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd; this.periodEnd = periodEnd;
} }
} }
File mode changed from 100755 to 100644
<div id="cit-analysis-menu"> <div id="cit-analysis-menu">
<div class="vat-analysis-menu"> <div class="vat-analysis-menu">
<perfect-scrollbar class="scroller" wheel-propagation="true" wheel-speed="1" min-scrollbar-length="20"> <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}}"> <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}}"> <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> <i class="{{::menu.icon}}" style="display: block;padding-bottom: 10px;" aria-hidden="true"></i>
<span>{{::menu.text}}</span> <span>{{::menu.text}}</span>
</a> </a>
</div> </div>
</perfect-scrollbar> </perfect-scrollbar>
</div> </div>
<div class="vat-analysis-content" ui-view></div> <div class="vat-analysis-content" ui-view></div>
</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