审核订单取消申请接口修改

dev
徐杰盟 2024-04-16 17:39:31 +08:00
parent 5a84ed48ec
commit 4c8f0b6822
1 changed files with 56 additions and 0 deletions

View File

@ -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
*