处理导入的错误数据
parent
7b4a49ef61
commit
46e58c548d
|
|
@ -28,9 +28,10 @@ import java.text.ParseException;
|
|||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 数据调整
|
||||
*
|
||||
* @author 李赛
|
||||
* @date 2022-09-28 0:30
|
||||
* @deprecated 数据调整
|
||||
*/
|
||||
public class Main {
|
||||
public class DOrder {
|
||||
|
|
@ -70,6 +71,7 @@ public class Main {
|
|||
|
||||
List<DOrder> orders = m.imp();
|
||||
|
||||
System.out.println("orders : " + orders.size());
|
||||
|
||||
// List<OrderTemp> orders = OrderTemp.dao.find("select * from order_temp where customer_id = 172 and state = 5 and create_time >= '2022-03-04' and create_time < '2022-04-25'");
|
||||
//
|
||||
|
|
@ -81,7 +83,12 @@ public class Main {
|
|||
for (int i = 0; i < orders.size(); i++) {
|
||||
System.out.println("处理 " + i);
|
||||
DOrder o = orders.get(i);
|
||||
if (!m.pass(o, now)) {
|
||||
|
||||
// if (!m.pass(o, now)) {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if (!m.updateErrorData(o, now)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -149,6 +156,11 @@ public class Main {
|
|||
String 申请人 = ExcelUtils.convertCellValueToString(row.getCell(8));
|
||||
String 审批人 = ExcelUtils.convertCellValueToString(row.getCell(9));
|
||||
|
||||
if (!StrKit.notBlank(发票代码, 发票编号)) {
|
||||
System.out.println("发票代码错误 " + 客户 + ", " + j);
|
||||
return null;
|
||||
}
|
||||
|
||||
String[] 起止 = 起止时间.split("至");
|
||||
Date stm = DateTimeUtil.sdfhms.get().parse(起止[0] + " 00:00:00");
|
||||
Date etm = DateTimeUtil.sdfhms.get().parse(起止[1] + " 23:59:59");
|
||||
|
|
@ -187,7 +199,9 @@ public class Main {
|
|||
}
|
||||
|
||||
for (OrderTemp o : orders) {
|
||||
out.add(new DOrder(o, 发票代码, 发票编号, 申请人, 审批人));
|
||||
if (StrKit.isBlank(o.getInvoiceNumber())) {
|
||||
out.add(new DOrder(o, 发票代码, 发票编号, 申请人, 审批人));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -268,4 +282,13 @@ public class Main {
|
|||
|
||||
return model.save() && receive.update() && invoiceLog.update() && order.update() && SyncTaskService.me.save(synctask, model.getSupermarketId());
|
||||
}
|
||||
|
||||
public boolean updateErrorData(DOrder o, Date now) {
|
||||
SyncTask synctask = new SyncTask();
|
||||
OrderTemp order = o.orderTemp;
|
||||
order.setInvoiceNumber(o.invoiceNumber);
|
||||
synctask.addUpdateData(order);
|
||||
|
||||
return order.update() && SyncTaskService.me.save(synctask, order.getSupermarketId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue