Commit f9d7fce0 authored by zhkwei's avatar zhkwei

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_wzk

parents 18602f5c b8a9447a
......@@ -3,6 +3,8 @@ package pwc.taxtech.atms.common.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import java.util.Map;
@Configuration
public class SystemConfig {
@Value("${longi_api_basic_user}")
......@@ -40,6 +42,9 @@ public class SystemConfig {
@Value("${tableau_dashboard}")
private String tableauDashboard;
@Value("#{${id.generator.mapping}}")
private Map<String, String> idGeneratorMap;
public String getLongiApiBasicUser() {
return this.longiApiBasicUser;
}
......@@ -167,4 +172,12 @@ public class SystemConfig {
public void setTableauDashboard(String tableauDashboard) {
this.tableauDashboard = tableauDashboard;
}
public Map<String, String> getIdGeneratorMap() {
return this.idGeneratorMap;
}
public void setIdGeneratorMap(Map<String, String> idGeneratorMap) {
this.idGeneratorMap = idGeneratorMap;
}
}
package pwc.taxtech.atms.common.schedule;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;
import pwc.taxtech.atms.service.impl.TaxEamilServiceImpl;
/**
* @version 1.0
* @program: atms
* @description: 分享模块定时任务
* @author: Kevin
* @create: 2019-04-26 12:16
**/
public class ShareJob extends QuartzJobBean {
@Autowired
private TaxEamilServiceImpl taxEamilService;
@Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
taxEamilService.jobEmail();
}
}
package pwc.taxtech.atms.common.util;
import java.math.BigDecimal;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.UnknownHostException;
import java.util.Enumeration;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -39,4 +43,46 @@ public class CommonUtil {
public static BigDecimal BigDecimal2Fix(BigDecimal bigDecimal){
return bigDecimal.setScale(2, BigDecimal.ROUND_DOWN);
}
/**
* 获取本机IP
* @return IP
* @throws UnknownHostException ex
*/
public static InetAddress getLocalHostLANAddress() throws UnknownHostException {
try {
InetAddress candidateAddress = null;
// 遍历所有的网络接口
for (Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); ifaces.hasMoreElements(); ) {
NetworkInterface iface = (NetworkInterface) ifaces.nextElement();
// 在所有的接口下再遍历IP
for (Enumeration inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements(); ) {
InetAddress inetAddr = (InetAddress) inetAddrs.nextElement();
if (!inetAddr.isLoopbackAddress()) {// 排除loopback类型地址
if (inetAddr.isSiteLocalAddress()) {
// 如果是site-local地址
return inetAddr;
} else if (candidateAddress == null) {
// site-local类型的地址未被发现,先记录候选地址
candidateAddress = inetAddr;
}
}
}
}
if (candidateAddress != null) {
return candidateAddress;
}
// 如果没有发现 non-loopback地址.只能用最次选的方案
InetAddress jdkSuppliedAddress = InetAddress.getLocalHost();
if (jdkSuppliedAddress == null) {
throw new UnknownHostException("The JDK InetAddress.getLocalHost() method unexpectedly returned null.");
}
return jdkSuppliedAddress;
} catch (Exception e) {
UnknownHostException unknownHostException = new UnknownHostException(
"Failed to determine LAN address: " + e);
unknownHostException.initCause(e);
throw unknownHostException;
}
}
}
package pwc.taxtech.atms.common.util;
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.Mac;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.security.MessageDigest;
import java.security.SecureRandom;
public class EncryptUtil {
public static final String MD5 = "MD5";
public static final String SHA1 = "SHA1";
public static final String HmacMD5 = "HmacMD5";
public static final String HmacSHA1 = "HmacSHA1";
public static final String DES = "DES";
public static final String AES = "AES";
/**编码格式;默认使用uft-8*/
public static String charset = "utf-8";
/**DES*/
public static int keysizeDES = 0;
/**AES*/
public static int keysizeAES = 128;
public static EncryptUtil me;
private EncryptUtil(){
//单例
}
//双重锁
public static EncryptUtil getInstance(){
if (me==null) {
synchronized (EncryptUtil.class) {
if(me == null){
me = new EncryptUtil();
}
}
}
return me;
}
/**
* 使用MessageDigest进行单向加密(无密码)
* @param res 被加密的文本
* @param algorithm 加密算法名称
* @return
*/
private static String messageDigest(String res,String algorithm){
try {
MessageDigest md = MessageDigest.getInstance(algorithm);
byte[] resBytes = charset==null?res.getBytes():res.getBytes(charset);
return base64(md.digest(resBytes));
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 使用KeyGenerator进行单向/双向加密(可设密码)
* @param res 被加密的原文
* @param algorithm 加密使用的算法名称
* @param key 加密使用的秘钥
* @return
*/
private static String keyGeneratorMac(String res,String algorithm,String key){
try {
SecretKey sk = null;
if (key==null) {
KeyGenerator kg = KeyGenerator.getInstance(algorithm);
sk = kg.generateKey();
}else {
byte[] keyBytes = charset==null?key.getBytes():key.getBytes(charset);
sk = new SecretKeySpec(keyBytes, algorithm);
}
Mac mac = Mac.getInstance(algorithm);
mac.init(sk);
byte[] result = mac.doFinal(res.getBytes());
return base64(result);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 使用KeyGenerator双向加密,DES/AES,注意这里转化为字符串的时候是将2进制转为16进制格式的字符串,不是直接转,因为会出错
* @param res 加密的原文
* @param algorithm 加密使用的算法名称
* @param key 加密的秘钥
* @param keysize
* @param isEncode
* @return
*/
private static String keyGeneratorES(String res,String algorithm,String key,int keysize,boolean isEncode){
try {
KeyGenerator kg = KeyGenerator.getInstance(algorithm);
if (keysize == 0) {
byte[] keyBytes = charset==null?key.getBytes():key.getBytes(charset);
kg.init(new SecureRandom(keyBytes));
}else if (key==null) {
kg.init(keysize);
}else {
byte[] keyBytes = charset==null?key.getBytes():key.getBytes(charset);
kg.init(keysize, new SecureRandom(keyBytes));
}
SecretKey sk = kg.generateKey();
SecretKeySpec sks = new SecretKeySpec(sk.getEncoded(), algorithm);
Cipher cipher = Cipher.getInstance(algorithm);
if (isEncode) {
cipher.init(Cipher.ENCRYPT_MODE, sks);
byte[] resBytes = charset==null?res.getBytes():res.getBytes(charset);
return parseByte2HexStr(cipher.doFinal(resBytes));
}else {
cipher.init(Cipher.DECRYPT_MODE, sks);
return new String(cipher.doFinal(parseHexStr2Byte(res)));
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private static String base64(byte[] res){
return Base64.encode(res);
}
/**将二进制转换成16进制 */
public static String parseByte2HexStr(byte buf[]) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < buf.length; i++) {
String hex = Integer.toHexString(buf[i] & 0xFF);
if (hex.length() == 1) {
hex = '0' + hex;
}
sb.append(hex.toUpperCase());
}
return sb.toString();
}
/**将16进制转换为二进制*/
public static byte[] parseHexStr2Byte(String hexStr) {
if (hexStr.length() < 1)
return null;
byte[] result = new byte[hexStr.length()/2];
for (int i = 0;i< hexStr.length()/2; i++) {
int high = Integer.parseInt(hexStr.substring(i*2, i*2+1), 16);
int low = Integer.parseInt(hexStr.substring(i*2+1, i*2+2), 16);
result[i] = (byte) (high * 16 + low);
}
return result;
}
/**
* md5加密算法进行加密(不可逆)
* @param res 需要加密的原文
* @return
*/
public static String MD5(String res) {
return messageDigest(res, MD5);
}
/**
* md5加密算法进行加密(不可逆)
* @param res 需要加密的原文
* @param key 秘钥
* @return
*/
public static String MD5(String res, String key) {
return keyGeneratorMac(res, HmacMD5, key);
}
/**
* 使用SHA1加密算法进行加密(不可逆)
* @param res 需要加密的原文
* @return
*/
public static String SHA1(String res) {
return messageDigest(res, SHA1);
}
/**
* 使用SHA1加密算法进行加密(不可逆)
* @param res 需要加密的原文
* @param key 秘钥
* @return
*/
public static String SHA1(String res, String key) {
return keyGeneratorMac(res, HmacSHA1, key);
}
/**
* 使用DES加密算法进行加密(可逆)
* @param res 需要加密的原文
* @param key 秘钥
* @return
*/
public String DESencode(String res, String key) {
return keyGeneratorES(res, DES, key, keysizeDES, true);
}
/**
* 对使用DES加密算法的密文进行解密(可逆)
* @param res 需要解密的密文
* @param key 秘钥
* @return
*/
public static String DESdecode(String res, String key) {
return keyGeneratorES(res, DES, key, keysizeDES, false);
}
/**
* 生成密钥
* 自动生成base64 编码后的AES128位密钥
*
* @throws //NoSuchAlgorithmException
* @throws //UnsupportedEncodingException
*/
public static String getAESKey() throws Exception {
KeyGenerator kg = KeyGenerator.getInstance("AES");
kg.init(128);//要生成多少位,只需要修改这里即可128, 192或256
SecretKey sk = kg.generateKey();
byte[] b = sk.getEncoded();
return parseByte2HexStr(b);
}
/**
* 使用AES加密算法经行加密(可逆)
* @param res 需要加密的密文
* @param key 秘钥
* @return
*/
public static String AESencode(String res, String key) {
return keyGeneratorES(res, AES, key, keysizeAES, true);
}
/**
* 对使用AES加密算法的密文进行解密
* @param res 需要解密的密文
* @param key 秘钥
* @return
*/
public static String AESdecode(String res, String key) {
return keyGeneratorES(res, AES, key, keysizeAES, false);
}
/**
* 使用异或进行加密
* @param res 需要加密的密文
* @param key 秘钥
* @return
*/
public static String XORencode(String res, String key) {
byte[] bs = res.getBytes();
for (int i = 0; i < bs.length; i++) {
bs[i] = (byte) ((bs[i]) ^ key.hashCode());
}
return parseByte2HexStr(bs);
}
/**
* 使用异或进行解密
* @param res 需要解密的密文
* @param key 秘钥
* @return
*/
public static String XORdecode(String res, String key) {
byte[] bs = parseHexStr2Byte(res);
for (int i = 0; i < bs.length; i++) {
bs[i] = (byte) ((bs[i]) ^ key.hashCode());
}
return new String(bs);
}
/**
* 直接使用异或(第一调用加密,第二次调用解密)
* @param res 密文
* @param key 秘钥
* @return
*/
public static int XOR(int res, String key) {
return res ^ key.hashCode();
}
/**
* 使用Base64进行加密
* @param res 密文
* @return
*/
public static String Base64Encode(String res) {
return Base64.encode(res.getBytes());
}
/**
* 使用Base64进行解密
* @param res
* @return
*/
public static String Base64Decode(String res) {
return new String(Base64.decode(res));
}
}
\ No newline at end of file
......@@ -8,7 +8,6 @@ import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.invoice.InputInvoiceMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceDetailMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceMapper;
import pwc.taxtech.atms.service.impl.DidiFileUploadService;
import pwc.taxtech.atms.service.impl.DistributedIdService;
import pwc.taxtech.atms.vat.dao.*;
......@@ -76,7 +75,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public static CitBalanceSheetPrcAdjustMapper citBalanceSheetPrcAdjustMapper;
public static CitProfitPrcAdjustMapper citProfitPrcAdjustMapper;
public static BalanceSheetMapper balanceSheetMapper;
public static DidiFileUploadService didiFileUploadService;
public static Map map = new HashMap<String, Object>();
/**
......@@ -151,7 +150,6 @@ public class SpringContextUtil implements ApplicationContextAware {
certifiedInvoicesListMapper = webApplicationContext.getBean(CertifiedInvoicesListMapper.class);
trialBalanceMappingMapper = webApplicationContext.getBean(TrialBalanceMappingMapper.class);
revenueConfigMapper = webApplicationContext.getBean(RevenueConfigMapper.class);
didiFileUploadService = webApplicationContext.getBean(DidiFileUploadService.class);
/* map.put("balance_sheet", balanceMapper);
map.put("profit_loss_statement",profitLossStatementMapper);
map.put("cash_flow", cashFlowMapper);
......
......@@ -26,8 +26,7 @@ public class ProjectStatusManageController {
public OperationResultDto<ProjectStatusManageDto> setProjectStatus(@PathVariable("projectId") String projectId,
@PathVariable("periodId") Integer periodId,
@PathVariable("status") Integer status) {
return projectStatusManageService.setProjectStatus(projectId, periodId, status,
identityService.getIdentityUser().getId());
return projectStatusManageService.setProjectStatus(projectId, periodId, status, identityService.getIdentityUser().getId());
}
......
package pwc.taxtech.atms.security;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.jsonwebtoken.impl.DefaultClaims;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -9,6 +11,8 @@ import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter;
import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.util.HttpUtil;
import pwc.taxtech.atms.dto.AtmsTokenDto;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
......
package pwc.taxtech.atms.service.impl;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import pwc.taxtech.atms.common.config.SystemConfig;
import pwc.taxtech.atms.common.util.CommonUtil;
import pwc.taxtech.atms.common.util.SnowFlake;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Map;
@Component
public class DistributedIdService {
private static final Logger logger = LoggerFactory.getLogger(DistributedIdService.class);
@Value("${distributed_id_datacenter}")
private Integer dataCenterId;
@Value("${distributed_id_machine}")
private Integer machineId;
private static final int DEFAULT_MACHINE_ID = 1;
@Resource
private SystemConfig systemConfig;
private SnowFlake snowFlake;
@PostConstruct
public void init() {
snowFlake = new SnowFlake(dataCenterId, machineId);
public void init() throws Exception {
String ip = CommonUtil.getLocalHostLANAddress().getHostAddress();
for (Map.Entry<String, String> entry : systemConfig.getIdGeneratorMap().entrySet()) {
if (StringUtils.trim(entry.getValue()).equals(ip)) {
snowFlake = new SnowFlake(dataCenterId, Integer.valueOf(entry.getKey()));
logger.info("初始化 dataCenterId: {} machineId: {}", dataCenterId, Integer.valueOf(entry.getKey()));
break;
}
}
if (null == snowFlake) {
snowFlake = new SnowFlake(dataCenterId, DEFAULT_MACHINE_ID);
logger.info("初始化 dataCenterId: {} machineId: {}", dataCenterId, DEFAULT_MACHINE_ID);
}
}
/**
......
package pwc.taxtech.atms.service.impl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.util.JavaEmailUtil;
import pwc.taxtech.atms.dao.TaxEmailMapper;
import pwc.taxtech.atms.entity.TaxEmail;
import pwc.taxtech.atms.entity.TaxEmailExample;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @version 1.0
* @program: atms
* @description:
* @author: Kevin
* @create: 2019-04-26 12:28
**/
@Service
public class TaxEamilServiceImpl {
private Logger logger = LoggerFactory.getLogger(TaxEamilServiceImpl.class);
@Autowired
private TaxEmailMapper taxEmailMapper;
@Autowired
private JavaEmailUtil javaEmailUtil;
@Autowired
protected DistributedIdService idService;
public void jobEmail() {
try {
List<Map<String, Object>> emails = javaEmailUtil.getEmails(true);
emails.forEach(e -> {
TaxEmail taxEmail = new TaxEmail();
taxEmail.setCreateBy((String) e.get("from_person"));
taxEmail.setCreatetime((Date) e.get("sendDate"));
taxEmail.setId(String.valueOf(idService.nextId()));
if(e.get("type") != null && e.get("type").equals("1")){
taxEmail.setContent((String)e.get("content"));
taxEmail.setType(1);
}else{
taxEmail.setType(0);
taxEmail.setUrl((String)e.get("url"));
}
taxEmail.setAttachUrl((String) e.get("attachUrl"));
taxEmail.setTitle((String) e.get("subject"));
taxEmail.setHashkey(String.valueOf((((String) e.get("attachUrl") + (String) e.get("subject")).hashCode())));
if(judgeHashKey(taxEmail.getHashkey()))
taxEmailMapper.insertSelective(taxEmail);
});
} catch (Exception e) {
e.printStackTrace();
logger.warn("获取邮件失败");
}
}
public boolean judgeHashKey(String hashKey){
TaxEmailExample example = new TaxEmailExample();
example.createCriteria().andHashkeyEqualTo(hashKey);
List<TaxEmail> taxEmails = taxEmailMapper.selectByExample(example);
if(taxEmails.size() != 0)
return false;
return true;
}
}
......@@ -44,7 +44,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static org.apache.poi.ss.usermodel.Cell.CELL_TYPE_FORMULA;
import static pwc.taxtech.atms.common.util.SpringContextUtil.reportMapper;
import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*;
......@@ -574,8 +573,27 @@ public class ReportGeneratorImpl {
List<AnalysisSalesValueDto> dataList = periodCellDataMapper.selectReportData(a.getTemplateId(),a.getProjectId(),a.getPeriod());
for(AnalysisSalesValueDto cellData:dataList){
Sheet sheet = tWorkbook.getSheetAt(0);
try{
BigDecimal amount = new BigDecimal(cellData.getData());
BigDecimal manualAmount = new BigDecimal("0");
if(StringUtils.isNotBlank(cellData.getKeyinData())){
manualAmount = new BigDecimal(cellData.getKeyinData());
}else if(StringUtils.isNotBlank(cellData.getManualAmount())){
manualAmount = new BigDecimal(cellData.getManualAmount());
}
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(amount.add(manualAmount).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
}catch (NumberFormatException e){
//判断是否有手工数据源有得话以手工数据源为主
if(StringUtils.isNotBlank(cellData.getKeyinData())){
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(cellData.getKeyinData());
}else if(StringUtils.isNotBlank(cellData.getManualAmount())){
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(cellData.getManualAmount());
}else{
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(cellData.getData());
}
}
}
POIUtil.cloneSheetAndStyle(tWorkbook.getSheetAt(0), workbook.createSheet(a.getCode()),workbook);
});
......@@ -642,8 +660,26 @@ public class ReportGeneratorImpl {
Cell cell = sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex());
sheet.getRow(cellData.getRowIndex()).removeCell(cell);
sheet.getRow(cellData.getRowIndex()).createCell(cellData.getColumnIndex());
try{
BigDecimal amount = new BigDecimal(cellData.getData());
BigDecimal manualAmount = new BigDecimal("0");
if(StringUtils.isNotBlank(cellData.getKeyinData())){
manualAmount = new BigDecimal(cellData.getKeyinData());
}else if(StringUtils.isNotBlank(cellData.getManualAmount())){
manualAmount = new BigDecimal(cellData.getManualAmount());
}
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(amount.add(manualAmount).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
}catch (NumberFormatException e){
//判断是否有手工数据源有得话以手工数据源为主
if(StringUtils.isNotBlank(cellData.getKeyinData())){
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(cellData.getKeyinData());
}else if(StringUtils.isNotBlank(cellData.getManualAmount())){
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(cellData.getManualAmount());
}else{
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(cellData.getData());
}
}
}
POIUtil.cloneSheetAndStyle(tWorkbook.getSheetAt(0), workbook.createSheet(a.getCode()),workbook);
});
......
......@@ -2047,9 +2047,9 @@ public class ReportServiceImpl extends BaseService {
cellData.setId(distributedIdService.nextId());
cellData.setReportId(data.getReportId());
cellData.setCellTemplateId(Long.parseLong(data.getCellTemplateId()));
cellData.setData(data.getAmount() == null ? null : data.getAmount().toString());
cellData.setData("0.0");
cellData.setKeyinData(data.getKeyinData());
cellData.setFormulaExp(data.getAmount() == null ? "0.0" : data.getAmount().toString());
cellData.setFormulaExp(data.getKeyinData() == null ? "0.0" : data.getKeyinData());
cellData.setCreateBy("admin");
cellData.setCreateTime(new Date());
cellData.setUpdateBy("admin");
......
......@@ -39,7 +39,6 @@
<ref bean="lgApiJobTrigger"/>
<ref bean="orgSyncJobTrigger"/>
<ref bean="analysisJobTrigger"/>
<ref bean="shareJobTrigger"/>
</list>
</property>
<property name="jobDetails">
......@@ -47,7 +46,6 @@
<ref bean="lgGlBalanceJob"/>
<ref bean="orgSyncJob"/>
<ref bean="analysisJob"/>
<ref bean="shareJob"/>
</list>
</property>
<property name="taskExecutor" ref="executor"/>
......@@ -93,15 +91,6 @@
<property name="requestsRecovery" value="false"/>
<property name="description" value="分析模块"/>
</bean>
<!--shareJob-->
<bean name="shareJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass" value="pwc.taxtech.atms.common.schedule.ShareJob"/>
<property name="durability" value="true"/>
<property name="requestsRecovery" value="false"/>
<property name="description" value="分享模块"/>
</bean>
<!-- 每天凌晨一点执行一次-->
<bean id="analysisJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="analysisJob"/>
......@@ -109,12 +98,5 @@
</bean>
<!-- shareJob 任务执行设定-->
<bean id="shareJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="shareJob"/>
<property name="cronExpression" value="59 * * * * ? *"/>
</bean>
<!-- 分布式事务配置 end -->
</beans>
\ No newline at end of file
......@@ -21,13 +21,6 @@ jwt.powerToken=${jwt.powerToken}
jwt.expireSecond=${jwt.expireSecond}
jwt.refreshSecond=${jwt.refreshSecond}
#email config
email.host=${email.host}
email.store.protocol=${email.store.protocol}
email.address=${email.address}
email.password=${email.password}
email.aesKey=${email.aesKey}
#File Server Config
file.server.url=${file.server.url}
file.server.upload=${file.server.upload}
......@@ -38,6 +31,7 @@ max_file_length=${max_file_length}
#Distributed ID Generate
distributed_id_datacenter=${distributed_id_datacenter}
distributed_id_machine=${distributed_id_machine}
id.generator.mapping=${id.generator.mapping}
api.url=${api.url}
......
......@@ -21,20 +21,13 @@ jwt.refreshSecond=600
file.server.url=http://10.158.230.144:1886
file.server.upload=/api/v1/upload
#email config
email.host=pop3.163.com
email.store.protocol=pop3
email.address=17615195790@163.com
email.password=7C4858868DDFAAFBFCE08C57997427A3
email.aesKey=47CA9CA045075A721E16B111536BD3C5
#upload
max_file_length=104857600
#Distributed ID Generate
distributed_id_datacenter=1
distributed_id_machine=1
id.generator.mapping={1:"127.0.0.1", 2:"10.158.230.16", 3:"10.158.141.14"}
api.url=http://dts.erp.didichuxing.com:8180
......
......@@ -26,19 +26,13 @@ jwt.refreshSecond=600
file.server.url=http://dts.erp.didichuxing.com:9001
file.server.upload=/api/v1/upload
#email config
email.host=pop3.163.com
email.store.protocol=pop3
email.address=17615195790@163.com
email.password=7C4858868DDFAAFBFCE08C57997427A3
email.aesKey=47CA9CA045075A721E16B111536BD3C5
#upload
max_file_length=104857600
#Distributed ID Generate
distributed_id_datacenter=10
distributed_id_machine=15
id.generator.mapping={1:"10.89.181.18", 2:"10.89.182.17"}
api.url=http://dts.erp.didichuxing.com:8180
......
......@@ -21,18 +21,13 @@ jwt.refreshSecond=600
file.server.url=http://10.158.230.144:1886
file.server.upload=/api/v1/upload
#email config
email.host=pop3.163.com
email.store.protocol=pop3
email.address=17615195790@163.com
email.password=7C4858868DDFAAFBFCE08C57997427A3
email.aesKey=47CA9CA045075A721E16B111536BD3C5
#upload
max_file_length=104857600
#Distributed ID Generate
distributed_id_datacenter=10
distributed_id_machine=10
id.generator.mapping={1:"10.158.230.16", 2:"10.158.230.16"}
api.url=http://dts.erp.didichuxing.com
......
......@@ -22,14 +22,6 @@ jwt.powerToken=xxxx
jwt.expireSecond=180000
jwt.refreshSecond=600
#email config
email.host=pop3.163.com
email.store.protocol=pop3
email.address=17615195790@163.com
email.password=7C4858868DDFAAFBFCE08C57997427A3
email.aesKey=47CA9CA045075A721E16B111536BD3C5
#File Server Config
file.server.url=http://dts.erp.didichuxing.com:9001
file.server.upload=/api/v1/upload
......@@ -40,6 +32,7 @@ max_file_length=104857600
#Distributed ID Generate
distributed_id_datacenter=10
distributed_id_machine=16
id.generator.mapping={1:"172.20.2.218", 2:"172.20.2.218"}
api.url=http://dts-test.erp.didichuxing.com
......@@ -59,8 +52,8 @@ file_upload_query_url=http://10.88.128.214:8001/resource/erp_tax_system
#���ϵ�ַ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
app_key=983258e7fd04d7fa0534735f7b1c33f3
app_id=2425
app_key=71799b6ab7049a5d456f6124d23fc373
cookie.maxAgeSeconds=18000
org_sync_url=http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token=174af08f
......
package pwc.taxtech.atms.service.impl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.PropertySource;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.transaction.annotation.Transactional;
/**
* @version 1.0
* @program: atms
* @description:
* @author: Kevin
* @create: 2019-04-26 15:15
**/
@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
@PropertySource("classpath:/conf/conf_profile_dev.properties")
public class ShareTest {
private static final Logger logger = LoggerFactory.getLogger(DataInitTest.class);
@Autowired
private TaxEamilServiceImpl taxEamilService;
@Test
public void jobEmail(){
taxEamilService.jobEmail();
}
}
......@@ -41,13 +41,26 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyMapper"/>
</javaClientGenerator>
<table tableName="data_import_log" domainObjectName="DataImportLog">
<table tableName="wf_record" domainObjectName="WfRecord">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="period" javaType="java.lang.Integer" jdbcType="TINYINT"/>
<columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT"/>
<columnOverride column="tms_period_month" javaType="java.lang.Integer" jdbcType="TINYINT"/>
<columnOverride column="period_month" javaType="java.lang.Integer" jdbcType="TINYINT"/>
<columnOverride column="status" javaType="java.lang.Integer" jdbcType="TINYINT"/>
</table>
<table tableName="wf_record_detail" domainObjectName="WfRecordDetail">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="status" javaType="java.lang.Integer" jdbcType="TINYINT"/>
</table>
<!-- <table tableName="data_import_log" domainObjectName="DataImportLog">-->
<!-- <property name="useActualColumnNames" value="false"/>-->
<!-- <property name="ignoreQualifiersAtRuntime" value="true"/>-->
<!-- <columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT"/>-->
<!-- <columnOverride column="tms_period_month" javaType="java.lang.Integer" jdbcType="TINYINT"/>-->
<!-- <columnOverride column="period_month" javaType="java.lang.Integer" jdbcType="TINYINT"/>-->
<!-- </table>-->
<!--<table tableName="analysis_expected_tax_return" domainObjectName="AnalysisExpectedTaxReturn">-->
<!--<property name="useActualColumnNames" value="false"/>-->
......
package pwc.taxtech.atms.dao;
import java.util.List;
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.entity.PwcTaxLog;
import pwc.taxtech.atms.entity.PwcTaxLogExample;
@Mapper
public interface PwcTaxLogMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
long countByExample(PwcTaxLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
int deleteByExample(PwcTaxLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
int insert(PwcTaxLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
int insertSelective(PwcTaxLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
List<PwcTaxLog> selectByExampleWithBLOBsWithRowbounds(PwcTaxLogExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
List<PwcTaxLog> selectByExampleWithBLOBs(PwcTaxLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
List<PwcTaxLog> selectByExampleWithRowbounds(PwcTaxLogExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
List<PwcTaxLog> selectByExample(PwcTaxLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
PwcTaxLog selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") PwcTaxLog record, @Param("example") PwcTaxLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") PwcTaxLog record, @Param("example") PwcTaxLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
int updateByExample(@Param("record") PwcTaxLog record, @Param("example") PwcTaxLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(PwcTaxLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(PwcTaxLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
int updateByPrimaryKey(PwcTaxLog record);
}
\ No newline at end of file
package pwc.taxtech.atms.dao;
import java.util.List;
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.entity.TaxEmail;
import pwc.taxtech.atms.entity.TaxEmailExample;
@Mapper
public interface TaxEmailMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
long countByExample(TaxEmailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
int deleteByExample(TaxEmailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
int insert(TaxEmail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
int insertSelective(TaxEmail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
List<TaxEmail> selectByExampleWithBLOBsWithRowbounds(TaxEmailExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
List<TaxEmail> selectByExampleWithBLOBs(TaxEmailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
List<TaxEmail> selectByExampleWithRowbounds(TaxEmailExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
List<TaxEmail> selectByExample(TaxEmailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
TaxEmail selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") TaxEmail record, @Param("example") TaxEmailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") TaxEmail record, @Param("example") TaxEmailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
int updateByExample(@Param("record") TaxEmail record, @Param("example") TaxEmailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(TaxEmail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(TaxEmail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table tax_email
*
* @mbg.generated
*/
int updateByPrimaryKey(TaxEmail record);
}
\ No newline at end of file
......@@ -9,10 +9,30 @@ public class AnalysisSalesValueDto {
private String data;
private String manualAmount;
private String keyinData;
private Integer rowIndex;
private Integer columnIndex;
public String getManualAmount() {
return manualAmount;
}
public void setManualAmount(String manualAmount) {
this.manualAmount = manualAmount;
}
public String getKeyinData() {
return keyinData;
}
public void setKeyinData(String keyinData) {
this.keyinData = keyinData;
}
public String getData() {
return data;
}
......
package pwc.taxtech.atms.entity;
import java.io.Serializable;
import java.util.Date;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table pwc_tax_log
*
* @mbg.generated do_not_delete_during_merge
*/
public class PwcTaxLog extends BaseEntity implements Serializable {
/**
* Database Column Remarks:
* token
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column pwc_tax_log.id
*
* @mbg.generated
*/
private String id;
/**
* Database Column Remarks:
* 标题名称和url合并生成的hash值
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column pwc_tax_log.email_id
*
* @mbg.generated
*/
private String emailId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column pwc_tax_log.createTime
*
* @mbg.generated
*/
private Date createtime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column pwc_tax_log.del_flag
*
* @mbg.generated
*/
private Integer delFlag;
/**
* Database Column Remarks:
* 日志类型
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column pwc_tax_log.type
*
* @mbg.generated
*/
private Integer type;
/**
* Database Column Remarks:
* 内容
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column pwc_tax_log.user_id
*
* @mbg.generated
*/
private String userId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column pwc_tax_log.id
*
* @return the value of pwc_tax_log.id
*
* @mbg.generated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column pwc_tax_log.id
*
* @param id the value for pwc_tax_log.id
*
* @mbg.generated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column pwc_tax_log.email_id
*
* @return the value of pwc_tax_log.email_id
*
* @mbg.generated
*/
public String getEmailId() {
return emailId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column pwc_tax_log.email_id
*
* @param emailId the value for pwc_tax_log.email_id
*
* @mbg.generated
*/
public void setEmailId(String emailId) {
this.emailId = emailId == null ? null : emailId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column pwc_tax_log.createTime
*
* @return the value of pwc_tax_log.createTime
*
* @mbg.generated
*/
public Date getCreatetime() {
return createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column pwc_tax_log.createTime
*
* @param createtime the value for pwc_tax_log.createTime
*
* @mbg.generated
*/
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column pwc_tax_log.del_flag
*
* @return the value of pwc_tax_log.del_flag
*
* @mbg.generated
*/
public Integer getDelFlag() {
return delFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column pwc_tax_log.del_flag
*
* @param delFlag the value for pwc_tax_log.del_flag
*
* @mbg.generated
*/
public void setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column pwc_tax_log.type
*
* @return the value of pwc_tax_log.type
*
* @mbg.generated
*/
public Integer getType() {
return type;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column pwc_tax_log.type
*
* @param type the value for pwc_tax_log.type
*
* @mbg.generated
*/
public void setType(Integer type) {
this.type = type;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column pwc_tax_log.user_id
*
* @return the value of pwc_tax_log.user_id
*
* @mbg.generated
*/
public String getUserId() {
return userId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column pwc_tax_log.user_id
*
* @param userId the value for pwc_tax_log.user_id
*
* @mbg.generated
*/
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_tax_log
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", emailId=").append(emailId);
sb.append(", createtime=").append(createtime);
sb.append(", delFlag=").append(delFlag);
sb.append(", type=").append(type);
sb.append(", userId=").append(userId);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
......@@ -113,14 +113,9 @@
<select id = "selectReportData" resultType="pwc.taxtech.atms.dpo.AnalysisSalesValueDto">
select cell_template.row_index as rowIndex,
cell_template.column_index as columnIndex,
case
when (LOCATE('-', cell_data.data) > 0) then
cell_data.data
else
CONVERT(cell_data.data, decimal(18, 2)) +
CONVERT(if(data_source.amount is null, 0, data_source.amount), decimal(18, 2))
end as data
cell_data.data as data,
data_source.amount as manualAmount,
data_source.keyin_data as keyinData
from period_cell_data cell_data
left join period_cell_template cell_template
on cell_data.cell_template_id = cell_template.cell_template_id
......
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