Commit f9d54384 authored by data-赵 玉龙's avatar data-赵 玉龙

修改数据

parent 5da1e63e
......@@ -45,27 +45,25 @@ public class DifCheckOutAPP {
public static void main(String[] args) throws Exception {
try {
File file = new File("E:\\financial-system-data\\weichat\\baitiao");
File file = new File("E:\\financial-system-data\\yeepay\\baitiao");
File[] files = file.listFiles();
List<WXBill> bills = new ArrayList<>();
List<YeepayBill> bills = new ArrayList<>();
for (File f : files) {
List<WXBill> wxBills = BillParsers.parseBillFromInputStream(f, WXBill.class);
List<YeepayBill> wxBills = BillParsers.parseBillFromInputStream(f, YeepayBill.class);
bills.addAll(wxBills);
}
// List<WXBill> lostBills = bills.stream().filter(bill->{
// return lostOrder.contains(bill.getOrderId());
// }).collect(Collectors.toList());
}
// BigDecimal imcomes = new BigDecimal("0");
// BigDecimal poundages = new BigDecimal("0");
// for(YeepayBill bill:bills){
// BigDecimal imcome = bill.getIncome();
// BigDecimal poundage = bill.getPoundage();
// imcomes = imcomes.add(imcome);
// poundages = poundages.add(poundage);
// }
// System.out.println(imcomes);
// System.out.println(poundages);
//
// List<String> collect = lostBills.stream().map(WXBill::getSrcStr).collect(Collectors.toList());
// FileUtils.writeOutStrsToFile(collect,"E:\\work\\balance\\10\\微信丢失的.txt");
// BigDecimal totalRepay = bills.stream().map(YeepayBill::getIncome).reduce(BigDecimal.ZERO,BigDecimal::add);
// BigDecimal totalPoundage = bills.stream().map(YeepayBill::getPoundage).reduce(BigDecimal.ZERO,BigDecimal::add);
// System.out.println(totalRepay);
// System.out.println(totalPoundage);
getSpringContext().getBean(DifCheckOutHandler.class).checkDif(bills);
}catch (Exception e){
......
package cn.gq.financial.app;
import cn.gq.financial.app.handler.RepayHandler;
import cn.gq.financial.bills.AbstractBills;
import cn.gq.financial.bills.PayType;
import cn.gq.financial.bills.UMPayBills;
import cn.gq.financial.bills.WeichatBills;
import cn.gq.financial.model.bill.Bill;
import cn.gq.financial.model.bill.UMPayBill;
import cn.gq.financial.model.bill.WXBill;
import cn.gq.financial.model.bill.YeepayBill;
import cn.gq.financial.service.BaitiaoOfflineDetailService;
import cn.gq.financial.service.FinancialRepayDetailService;
import cn.gq.financial.utils.Constants;
import com.google.common.base.Joiner;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
public class OfflineRapay {
static final String CONFIG_LOCAL = "applicationContext.xml";
static final String ROOT_DIR = "E:\\financial-system-data\\";
private static final Logger LOGGER = LoggerFactory.getLogger(OfflineRapay.class);
/**
* Tip: 对帐单时 只需修改currentMonth和payType
* currentMonth 当前是几月就输入几 无须减1 后续代码里面已经处理
*/
static Integer currentMonth = 11;
static PayType payType = PayType.YeePay_Xjd;
static AbstractBills bill;
static String path = "";
static Class<? extends Bill> clazz = null;
private static ClassPathXmlApplicationContext context = null;
static {
path = Joiner.on(File.separator).join(ROOT_DIR, payType.path());
switch (payType.getChannelName()) {
case "微信":
bill = new WeichatBills(currentMonth, path);
clazz = WXBill.class;
break;
case "易宝":
clazz = YeepayBill.class;
break;
case "联动":
bill = new UMPayBills(currentMonth, path);
clazz = UMPayBill.class;
break;
}
// 拉取帐单前先清理目录
if (!"易宝".equals(payType.getChannelName())) {
if (Paths.get(path).toFile().exists()) {
try {
FileUtils.cleanDirectory(Paths.get(path).toFile());
} catch (IOException e) {
e.printStackTrace();
}
}
bill.pullBills(payType);
}
}
public static void main(String[] args) throws Exception {
try {
LOGGER.info("======开始处理[" + path + "]目录下面的还款账单======");
long begin = System.currentTimeMillis();
BaitiaoOfflineDetailService baitiaoOfflineDetailService = getSpringContext().getBean(BaitiaoOfflineDetailService.class);
baitiaoOfflineDetailService.getDetailByPayCenterRepayOrder(null);
LOGGER.info("总计耗时--->{}mm", (System.currentTimeMillis() - begin));
} catch (Exception ex) {
ex.printStackTrace();
} finally {
context.close();
}
}
public static ClassPathXmlApplicationContext getSpringContext() {
if (null == context) {
context = new ClassPathXmlApplicationContext(CONFIG_LOCAL);
}
return context;
}
}
......@@ -29,9 +29,9 @@ public class RepayFinancialAPP {
* Tip: 对帐单时 只需修改currentMonth和payType
* currentMonth 当前是几月就输入几 无须减1 后续代码里面已经处理
*/
static Integer currentMonth = 11;
static Integer currentMonth = 12;
static PayType payType = PayType.WeiChat_Xjd;
static PayType payType = PayType.YeePay_Xjd;
static AbstractBills bill;
......@@ -72,7 +72,7 @@ public class RepayFinancialAPP {
LOGGER.info("======开始处理[" + path + "]目录下面的还款账单======");
long begin = System.currentTimeMillis();
RepayHandler handler = getSpringContext().getBean(RepayHandler.class);
//按照参数,对账
//按照参数,对账 ++++++++++
handler.repayBillDetailHandler(path, clazz, payType.getChannelAccount(), currentMonth);
FinancialRepayDetailService repayDetailService = getSpringContext().getBean(FinancialRepayDetailService.class);
if (Constants.result.size() != 0) {
......
......@@ -45,7 +45,7 @@ public class DifCheckOutHandler {
wrong.addAll(checkOut(bills.subList((i * item_size), bills.size())));
}
}
FileUtils.writeOutStrsToFile(wrong,"E:\\work\\balance\\10\\微信-白条丢失的.txt");
FileUtils.writeOutStrsToFile(wrong,"E:\\financial-system-data\\yeepay\\baitiao\\易宝丢失的.txt");
}
private Collection<? extends String> checkOut(List<? extends Bill> bills) {
......@@ -68,7 +68,7 @@ public class DifCheckOutHandler {
}
}else {
// res.add("订单-->".concat(bill.getOrderId()).concat(" 详细丢失了,交易时间-->").concat(DateFormatUtils.ISO_DATE_FORMAT.format(bill.getTrandingDate())));
res.add(((WXBill) bill).getSrcStr());
res.add(((YeepayBill) bill).getSrcStr());
}
});
......
......@@ -194,6 +194,7 @@ public abstract class AbstractBills {
*/
private void initBillDates() {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR,2016);
calendar.set(Calendar.MONTH, currentMonth - 1);
int totalDays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
for (int i = 1; i <= totalDays; i++) {
......
......@@ -56,6 +56,9 @@ public class BaitiaoOfflineDetailService implements DetailService {
try {
OfflineOrderEntityExample orderExample = new OfflineOrderEntityExample();
orderExample.createCriteria().andIdEqualTo(Long.valueOf(entity.getMerchantOrderNo()));
// List<Long> list = new ArrayList<Long>();
//
// orderExample.createCriteria().andIdIn(list);
//.andIsActiveEqualTo(Boolean.FALSE);
OfflineOrderEntity offlineOrder = offlineOrderEntityMapper.selectByExample(orderExample).get(0);
......
......@@ -252,7 +252,7 @@ public class BaitiaoOnlineDetailService implements DetailService {
List<BaitiaoExpEntity> list = exportExcelMapper.baitiaoRepayExport(subList);
baitiaoExpEntities.addAll(list);
}
if (StringUtils.equals(BIZ_TYPE_BILL_BAITIAO, bizType)) {
if (StringUtils.equals(BIZ_TYPE_BILL_BAITIAO, bizType) && baitiaoOrderIds.size() >0) {
List<String> subList = payCenterOrders.subList(i * item_size, baitiaoOrderIds.size());
List<BaitiaoExpEntity> list = exportExcelMapper.baitiaoBillRepayExport(subList);
baitiaoExpEntities.addAll(list);
......
......@@ -12,7 +12,7 @@ public interface DetailService {
static String BIZ_TYPE_XYQB = "现金贷";
static String BIZ_TYPE_BAITIAO = "线上白条";
static String BIZ_TYPE_OFFLINE = "线下白条";
String BIZ_TYPE_BILL_BAITIAO = "帐单白条";
static String BIZ_TYPE_BILL_BAITIAO = "帐单白条";
public List<RepayDetailFinancial> getDetailByPayCenterRepayOrder(List<RepayOrderEntity> list);
}
......@@ -32,7 +32,7 @@ import cn.gq.financial.utils.HttpUtils;
public class XYQBDetailService implements DetailService {
private static final Logger LOGGER = LoggerFactory.getLogger(XYQBDetailService.class);
static final String url = "http://127.0.0.1:9004/ex/repayment/loan/detail";
static final String url = "http://localhost:9004/ex/repayment/loan/detail";
@Autowired
ExportExcelMapper exportExcelMapper;
......
......@@ -165,20 +165,21 @@ public class BillParsers {
if (contents == null || contents.length == 0) {
throw new IllegalArgumentException("Invalid contents: " + StringUtils.join(contents, ","));
}
yeepayBill.setTrandingDate(DateUtils.parseDate(contents[1], "yyyy-MM-dd HH:mm:ss.SSS"));
//yeepayBill.setTrandingDate(DateUtils.parseDate(contents[1], "yyyy-MM-dd HH:mm:ss.SSS"));
yeepayBill.setTrandingDate(DateUtils.parseDate(contents[1], "yyyy-MM-dd HH:mm:ss"));
yeepayBill.setAccountType(contents[2]);
yeepayBill.setBizType(contents[3]);
if (StringUtils.isNotBlank(contents[4])) {
yeepayBill.setOrderId(contents[4]);
}
if (StringUtils.isNotBlank(contents[5])) {
yeepayBill.setIncome(new BigDecimal(contents[5]));
yeepayBill.setIncome(new BigDecimal(contents[5].trim()));
}
if (StringUtils.isNotBlank(contents[6])) {
yeepayBill.setCost(new BigDecimal(contents[6]));
yeepayBill.setCost(new BigDecimal(contents[6].trim()));
}
if (StringUtils.isNotBlank(contents[7])) {
yeepayBill.setPoundage(new BigDecimal(contents[7]));
yeepayBill.setPoundage(new BigDecimal(contents[7].trim()));
}
return yeepayBill;
}
......
......@@ -11,11 +11,6 @@ xyqb.jdbc.username=xyqb_query
xyqb.jdbc.password=Uiwb@o^fR&nHOa5t
#local
local.jdbc.url=jdbc:mysql://127.0.0.1:3306/financial?useUnicode=true&characterEncoding=UTF8
local.jdbc.username=root
local.jdbc.password=root
#mall
mall.jdbc.url=jdbc:mysql://172.16.1.7:3306/mall?useUnicode=true&characterEncoding=UTF8
mall.jdbc.username=xyqb_query
......@@ -34,9 +29,9 @@ lkbadmin.jdbc.password=wj0msj8J8/v2Ee6Xl75ZDizrJBdEDOAQGlxTGKbRFng=
#localDB
local.repayment.jdbc.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8
local.repayment.jdbc.username=root
local.repayment.jdbc.password=root
local.repayment.jdbc.password=123456
#offlineBaitiao
offlineBaitiao.jdbc.url=jdbc:mysql://172.16.1.104:3306/offline?useUnicode=true&characterEncoding=UTF8
offlineBaitiao.jdbc.username=dataquery
offlineBaitiao.jdbc.password=querydata
\ No newline at end of file
offlineBaitiao.jdbc.url=jdbc:mysql://172.16.1.244:33312/offline?useUnicode=true&characterEncoding=UTF8
offlineBaitiao.jdbc.username=xyqb_query
offlineBaitiao.jdbc.password=Uiwb@o^fR&nHOa5t
\ No newline at end of file
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