同步odoo的其他四个
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
da9898d95c
commit
aefa5f47f9
@ -0,0 +1,66 @@
|
||||
package com.ruoyi.quartz.task.odoo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.enums.TableRelationTypeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuxiangyong
|
||||
* @create 2023-07-23 18:18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("accountMoveLineJob")
|
||||
public class AccountMoveLineJob extends OdooAbstrackob {
|
||||
|
||||
@Override
|
||||
protected String buildUniqueKey(JSONObject body) {
|
||||
return body.getString("id");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getQueryModelName() {
|
||||
return "account.move.line";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List getQueryConditionList() {
|
||||
return Arrays.asList(Arrays.asList(
|
||||
Arrays.asList("parent_state", "=", "posted"),
|
||||
Arrays.asList("account_id", "=", 1018)
|
||||
// asList("Date", ">", 2022-01-01)
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, List<String>> getQueryFieldMap() {
|
||||
return new HashMap() {{
|
||||
put("fields", Arrays.asList("id","partner_id.name", "date", "product_id.default_code"
|
||||
, "quantity", "unit_price", "company_id.display_name","product_id.categ_id.name"));
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, Object> buildLarkBodyMap(JSONObject date) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id",date.getString("id"));
|
||||
map.put("partner_id.name",date.getString("partner_id.name"));
|
||||
map.put("date",date.getString("date"));
|
||||
map.put("product_id.default_code",date.getString("product_id.default_code"));
|
||||
map.put("quantity",date.getString("quantity"));
|
||||
map.put("unit_price",date.getString("unit_price"));
|
||||
map.put("company_id.display_name",date.getString("company_id.display_name"));
|
||||
map.put("product_id,categ_id.name",date.getString("product_id.categ_id.name"));
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TableRelationTypeEnum syncLarkType() {
|
||||
return TableRelationTypeEnum.SYNC_ODOO_ACCOUNT_MOVE_LINE;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.ruoyi.quartz.task.odoo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.enums.TableRelationTypeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuxiangyong
|
||||
* @create 2023-07-23 18:18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("productPackingJob")
|
||||
public class ProductPackingJob extends OdooAbstrackob {
|
||||
|
||||
@Override
|
||||
protected String buildUniqueKey(JSONObject body) {
|
||||
return body.getString("id");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getQueryModelName() {
|
||||
return "product.packaging";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List getQueryConditionList() {
|
||||
return Arrays.asList(
|
||||
Arrays.asList(
|
||||
Arrays.asList("active", "=", true)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, List<String>> getQueryFieldMap() {
|
||||
return new HashMap() {{
|
||||
put("fields", Arrays.asList("id", "name", "qty"));
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, Object> buildLarkBodyMap(JSONObject date) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id",date.getString("id"));
|
||||
map.put("name",date.getString("name"));
|
||||
map.put("qty",date.getString("qty"));
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TableRelationTypeEnum syncLarkType() {
|
||||
return TableRelationTypeEnum.SYNC_ODOO_PRODUCT_PACKING;
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.ruoyi.quartz.task.odoo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.enums.TableRelationTypeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuxiangyong
|
||||
* @create 2023-07-23 18:18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("productShukikuJob")
|
||||
public class ProductShukikuJob extends OdooAbstrackob {
|
||||
|
||||
@Override
|
||||
protected String buildUniqueKey(JSONObject body) {
|
||||
return body.getString("id");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getQueryModelName() {
|
||||
return "product.product.shukiku";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List getQueryConditionList() {
|
||||
return Arrays.asList(
|
||||
Arrays.asList(
|
||||
Arrays.asList("active", "=", true)
|
||||
),
|
||||
Arrays.asList(
|
||||
Arrays.asList("x_company_id.name","ilike","Shukiku Thailand")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, List<String>> getQueryFieldMap() {
|
||||
return new HashMap() {{
|
||||
put("fields", Arrays.asList("id","default_code", "name", "description_purchase"
|
||||
, "qty_available", "incoming_qty","cost","categ_id.name", "packaging_ids"));
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, Object> buildLarkBodyMap(JSONObject date) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id",date.getString("id"));
|
||||
map.put("default_code",date.getString("default_code"));
|
||||
map.put("name",date.getString("name"));
|
||||
map.put("description_purchase",date.getString("description_purchase"));
|
||||
map.put("qty_available",date.getString("qty_available"));
|
||||
map.put("incoming_qty",date.getString("incoming_qty"));
|
||||
map.put("cost",date.getString("cost"));
|
||||
map.put("categ_id.name",date.getString("categ_id.name"));
|
||||
map.put("packaging_ids",date.getString("packaging_ids"));
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TableRelationTypeEnum syncLarkType() {
|
||||
return TableRelationTypeEnum.SYNC_ODOO_PRODUCT_SHUKIKU;
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.quartz.task.odoo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.enums.TableRelationTypeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuxiangyong
|
||||
* @create 2023-07-23 18:18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("stockQuantJob")
|
||||
public class StockQuantJob extends OdooAbstrackob {
|
||||
|
||||
@Override
|
||||
protected String buildUniqueKey(JSONObject body) {
|
||||
return body.getString("default_code");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getQueryModelName() {
|
||||
return "stock_quant";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List getQueryConditionList() {
|
||||
return Arrays.asList(
|
||||
Arrays.asList(
|
||||
Arrays.asList("active", "=", true)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, List<String>> getQueryFieldMap() {
|
||||
return new HashMap() {{
|
||||
put("fields", Arrays.asList("default code", "FOFO stock", "incoming", "forsince stock"));
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, Object> buildLarkBodyMap(JSONObject date) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("default code",date.getString("default code"));
|
||||
map.put("FOFO stock",date.getString("FOFO stock"));
|
||||
map.put("incoming",date.getString("incoming"));
|
||||
map.put("forsince stock",date.getString("forsince stock"));
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TableRelationTypeEnum syncLarkType() {
|
||||
return TableRelationTypeEnum.SYNC_ODOO_STOCK_QUANT;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue