审核订单取消申请接口修改
parent
5a84ed48ec
commit
4c8f0b6822
|
|
@ -16,6 +16,7 @@ import com.jfinal.log.Log;
|
|||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.IAtom;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.SQLException;
|
||||
|
|
@ -334,6 +335,8 @@ public class SyncTaskService {
|
|||
}
|
||||
}
|
||||
|
||||
list = listFilter(tablename,list);
|
||||
|
||||
int[] ret = Db.batchSave(tablename, list, list.size());
|
||||
|
||||
if (ret.length != list.size()) {
|
||||
|
|
@ -568,6 +571,59 @@ public class SyncTaskService {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// 过滤新增数据
|
||||
private List<Record> listFilter(String tablename, List<Record> list) {
|
||||
|
||||
List<Record> removeList = new ArrayList<>();
|
||||
if ("order_temp".equals(tablename)){
|
||||
// sn
|
||||
for (Record o : list) {
|
||||
String sn = o.getStr("sn");
|
||||
Record first = Db.findFirst("select * from " + tablename + " where sn = ?", sn);
|
||||
if (o.toJson().equals(first.toJson())){
|
||||
removeList.add(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("ticket_log".equals(tablename)){
|
||||
// id
|
||||
for (Record o : list) {
|
||||
String id = o.getStr("id");
|
||||
Record first = Db.findFirst("select * from " + tablename + " where sn = ?", id);
|
||||
if (o.toJson().equals(first.toJson())){
|
||||
removeList.add(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("action_cmd_log".equals(tablename)){
|
||||
// id
|
||||
for (Record o : list) {
|
||||
String id = o.getStr("id");
|
||||
Record first = Db.findFirst("select * from " + tablename + " where sn = ?", id);
|
||||
if (o.toJson().equals(first.toJson())){
|
||||
removeList.add(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("transport".equals(tablename)){
|
||||
// id
|
||||
for (Record o : list) {
|
||||
String id = o.getStr("id");
|
||||
Record first = Db.findFirst("select * from " + tablename + " where sn = ?", id);
|
||||
if (o.toJson().equals(first.toJson())){
|
||||
removeList.add(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(removeList)){
|
||||
list.removeAll(removeList);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将收到的 auth_license 转发到其他砂站
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue