odoo修改同步字段
continuous-integration/drone/push Build is passing Details

沃森川job同步飞书
YXY 1 year ago
parent bb228f29b9
commit 8c26e8c179

@ -109,8 +109,8 @@ public abstract class OdooAbstrackob {
LarkTableRelation tableRelation = context.getTableRelation();
LarkTableRequest larkRequest = new LarkTableRequest(companyRelation.getAppId(), companyRelation.getSecret(), tableRelation.getToAppToken(), tableRelation.getToTableId());
//待创建关联关系
List<ErpLarkRelation> waitCreateRelation = new ArrayList<>();
do {
List<ErpLarkRelation> waitCreateRelation = new ArrayList<>();
dateList = getDate(context, pageMap, errorList);
List<JSONObject> midDateList = dateList.stream().map(r -> {
return (JSONObject)JSONObject.toJSON(r);
@ -121,15 +121,16 @@ public abstract class OdooAbstrackob {
sync(jsonObject, errorList, relationMap, larkRequest,waitCreateRelation);
}
}
if (CollectionUtils.isNotEmpty(waitCreateRelation)){
erpLarkRelationMapper.batchInsert(waitCreateRelation);
}
pageMap.put(PAGE_OFFSET_KEY,pageMap.get(PAGE_OFFSET_KEY) + PAGE_SIZE);
} while (dateList == null || (CollectionUtils.isNotEmpty(dateList) && dateList.size() == PAGE_SIZE));
if (!CollectionUtils.isEmpty(errorList)) {
String errorKey = String.join(",", errorList);
throw new RuntimeException(String.format("存在同步失败的记录 %s", errorKey));
}
if (CollectionUtils.isNotEmpty(waitCreateRelation)){
erpLarkRelationMapper.batchInsert(waitCreateRelation);
}
}
private void sync(JSONObject jsonObject, List<String> errorList

@ -50,7 +50,7 @@ public class ProductProductJob extends OdooAbstrackob {
// }};
return new HashMap() {{
put("fields", Arrays.asList("id","default_code", "name", "description_purchase"
, "qty_available", "incoming_qty", "packaging_ids", "total_cost", "categ_id"));
, "qty_available", "incoming_qty", "packaging_ids", "total_cost", "categ_id", "free_qty"));
}};
}
@ -66,6 +66,7 @@ public class ProductProductJob extends OdooAbstrackob {
map.put("packaging_ids",date.getString("packaging_ids"));
map.put("total_cost",date.getString("total_cost"));
map.put("categ_id",date.getString("categ_id"));
map.put("free_qty",date.getString("free_qty"));
return map;
}

Loading…
Cancel
Save