细化日志,修复节假日配置ui bug

master
yixian 5 years ago
parent 5dcad78f53
commit 4607536ed1

@ -151,16 +151,11 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
@Resource
private ClientDeviceMapper clientDeviceMapper;
private static final int MAX_TRACK_DAYS = 31;
@Value("${app.settlement.email-to}")
private String settlementEmailTo;
@Value("${app.settlement.email-cc}")
private String settlementEmailCC;
@Value("${app.redis.settle.check-code.prefix}")
private String reidsCheckCodeKey;
private final String[] open_ids = {"o32MzuEeb5ZT_DJQYbzZf6VCu1HQ", "o32MzuIsa3OBOkvC9pL90h9pgHPg", "o32MzuCpqGQJTlvTK7VQ7m_LVXiQ"};
private ApplicationEventPublisher publisher;
// private final String[] open_ids = { "o32MzuO4s8c7iFOVxnxejkbhMoEc" };
@Override
public List<JSONObject> listValidatedDays(Date month) {
@ -1394,8 +1389,6 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
JSONObject result = new JSONObject();
try {
String title = (PlatformEnvironment.getEnv().isDebug() ? "[TEST]" : "") + "Royalpay Settlement File " + DateFormatUtils.format(date, "yyyyMMdd");
JSONObject model = new JSONObject();
model.put("date", DateFormatUtils.format(date, "dd-MM-yyyy"));
String fileName1 = "Merchant_Settlement_Info_xlsx_" + DateFormatUtils.format(date, "yyyyMMdd");
List<JSONObject> attachList = new ArrayList<>();
JSONObject attach1 = new JSONObject();
@ -1440,8 +1433,6 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
ctx.setVariable("totalAmount", total.setScale(2, RoundingMode.DOWN).toPlainString());
final String content = thymeleaf.process("mail/settlement_mail", ctx);
// 测试用地址
// String mailId = mailService.sendEmail(title, "164851225@qq.com", "1029811920@qq.com", content,
// attachList);
JSONObject config = sysConfigManager.getSysConfig();
String mailId = mailService.sendEmail(title, config.getString("settle_mail_to"), config.getString("settle_mail_cc"), content, attachList);

@ -147,6 +147,7 @@ public class TradeSecureServiceHanyinImpl implements TradeSecureService {
});
}
@Override
public void sendSecurePayInvoiceFile(String begin, String end) {
List<JSONObject> scpayMchs = clientAnalysisMapper.listSecurePayMchs();
@ -168,6 +169,7 @@ public class TradeSecureServiceHanyinImpl implements TradeSecureService {
});
}
private void sendSftpFile(String dateStr, String fileName, byte[] data) {
Session session = null;
ChannelSftp command = null;
@ -179,12 +181,13 @@ public class TradeSecureServiceHanyinImpl implements TradeSecureService {
try {
command.mkdir(StringUtils.substring(dateStr, 0, 6));
} catch (SftpException e) {
logger.error(e.getMessage());
logger.error("failed to create dir:{}---{}", fileName, e.getMessage(), e);
}
try {
command.put(new ByteArrayInputStream(data), StringUtils.substring(dateStr, 0, 6) + "/" + fileName);
logger.info("文件发送成功!");
} catch (SftpException ignore) {
logger.info("File send success!{}", fileName);
} catch (SftpException e) {
logger.error("failed to upload file:{}", fileName, e);
}
} catch (IOException | JSchException e) {
throw new ChannelNetworkException("Send Settlement file failed", e);

@ -593,6 +593,7 @@ public class TradeLogServiceImpl implements TradeLogService {
result.put("analysis", analysis);
return result;
}
private JSONObject listPartnerTransFlowByExportPdfSecurePay(TradeLogQuery query, JSONObject client, String[] channels) throws Exception {
int clientId = client.getIntValue("client_id");
String timezone = client.getString("timezone");
@ -853,15 +854,13 @@ public class TradeLogServiceImpl implements TradeLogService {
outs.write(bytes, 0, bytes.length);
outs.flush();
renderer.finishPDF();
}
catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public byte[] exportTransFlowForSecurePay(TradeLogQuery query, JSONObject client) throws Exception {
JSONObject transFlow = listPartnerTransFlowByExportPdfSecurePay(query, client, new String[]{"Wechat", "Alipay", "AlipayOnline"});
@ -919,9 +918,7 @@ public class TradeLogServiceImpl implements TradeLogService {
os.close();
return bytes;
}
catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
return null;
@ -2088,8 +2085,8 @@ public class TradeLogServiceImpl implements TradeLogService {
@Override
public byte[] exportPDFSettlement(TradeLogQuery query, JSONObject client) {
logger.info("exporting settlement pdf for {}", client.getString("client_moniker"));
String begin = query.getDatefrom() == null ? "" : query.getDatefrom();
String end = query.getDateto() == null ? "" : query.getDateto();
String timezone = client.getString("timezone");
JSONObject params = query.toParams(timezone);
if (params.get("client_ids") == null) {
@ -2127,8 +2124,7 @@ public class TradeLogServiceImpl implements TradeLogService {
item.put("gateway", item.getInteger("gateway") == null ? "-" : TradeType.fromGatewayNumber(item.getIntValue("gateway")).getTradeType());
item.put("rate", item.getBigDecimal("rate") == null ? "-" : item.getBigDecimal("rate").stripTrailingZeros().toPlainString() + "%");
});
}
if (clientOrderList.size() <= 0) {
} else {
JSONObject mockJson = new JSONObject();
mockJson.put("order_id", "-");
mockJson.put("client_order_id", "-");
@ -2156,7 +2152,7 @@ public class TradeLogServiceImpl implements TradeLogService {
ctx.setVariable("orgInfo", orgInfo);
ctx.setVariable("parmerters", parmerters);
ctx.setVariable("settlementLogDetailList", settlementLogDetailList);
System.out.println("=====>reports/securepay_settlement.html:");
logger.info("=====>reports/securepay_settlement.html:");
ByteArrayOutputStream os = new ByteArrayOutputStream();
final String html = thymeleaf.process("reports/securepay_settlement.html", ctx);
@ -2174,7 +2170,7 @@ public class TradeLogServiceImpl implements TradeLogService {
// return JasperRunManager.runReportToPdf(securepay_settlement_flow.getInputStream(), parmerters, jrDataSource);
return bytes;
} catch (Exception e) {
throw new ServerErrorException(e);
throw new ServerErrorException("Failed to export settlement report pdf for " + client.getString("client_moniker"), e);
}
}

@ -444,7 +444,7 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
scope.$close({operation: 'modify', holiday: scope.holiday})
}
scope.deleteHoliday = function () {
scope.$close({operation: 'delete', holiday: scope.holiday.holiday.replace('/', '-')})
scope.$close({operation: 'delete', holiday: scope.holiday.holiday.replaceAll(/\//g, '-')})
}
}],
resolve: {

@ -28,8 +28,8 @@ public class AESTest {
@Test
public void decode() {
String mailPwdEncrypted = "Vr5rSY1PsttfWVGuoq8zxQ==";
String decodeKey = "Vr5rSY1PsttfWVGuoq8zxQ==";
String mailPwdEncrypted = "pLkLTFw8Xf3aa6US7USSwOQ2v/q+m7HTTFhk39l4BWI=";
String decodeKey = "EPrfsM2JE69ZPR7BhXn34g==";
Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(decodeKey));
String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8);
System.out.println(mailPwd);

Loading…
Cancel
Save