修改字段信息
continuous-integration/drone/push Build is passing Details

沃森川job同步飞书
YXY 1 year ago
parent 64fb300442
commit 3657b919e4

@ -1,6 +1,7 @@
package com.ruoyi.quartz.task.CJT; package com.ruoyi.quartz.task.CJT;
import com.ruoyi.common.enums.AppType; import com.ruoyi.common.enums.AppType;
import com.ruoyi.common.enums.CjtAccountEnum;
import com.ruoyi.common.enums.TableFieldTypeEnum; import com.ruoyi.common.enums.TableFieldTypeEnum;
import com.ruoyi.common.enums.TableRelationTypeEnum; import com.ruoyi.common.enums.TableRelationTypeEnum;
import com.ruoyi.quartz.domain.CJTSyncTypeRelation; import com.ruoyi.quartz.domain.CJTSyncTypeRelation;
@ -56,38 +57,44 @@ public class ManufactureOrderSyncJob extends SyncAccountsJobAbstract{
"ManufactureOrder.VoucherDate", "ManufactureOrder.VoucherDate",
"ManufactureOrder.ManufactureOrderDetails.SourceVoucherCode", "ManufactureOrder.ManufactureOrderDetails.SourceVoucherCode",
"ManufactureOrder.Code", "ManufactureOrder.Code",
"ManufactureOrderDetails.pubuserdefnvc1",
"ManufactureOrder.CreatedTime", "ManufactureOrder.CreatedTime",
"ManufactureOrder.Department.Name", "ManufactureOrder.Department.Name",
"ManufactureOrder.Person.Code", "ManufactureOrder.Person.Name",
"ManufactureOrder.ManufactureOrderDetails.Inventory.Code", "ManufactureOrder.ManufactureOrderDetails.Inventory.Code",
"ManufactureOrder.ManufactureOrderDetails.Inventory.Name", "ManufactureOrder.ManufactureOrderDetails.Inventory.Name",
"ManufactureOrder.ManufactureOrderDetails.Inventory.Specification", "ManufactureOrder.ManufactureOrderDetails.Inventory.Specification",
"ManufactureOrder.ManufactureOrderDetails.Unit.Name", "ManufactureOrder.ManufactureOrderDetails.Unit.Name",
"ManufactureOrder.ManufactureOrderDetails.Quantity", "ManufactureOrder.ManufactureOrderDetails.Quantity",
"ManufactureOrder.Memo", "ManufactureOrder.ManufactureOrderDetails.pubuserdefnvc2",
"ManufactureOrder.Customer.Name", "ManufactureOrder.Customer.Name",
"ManufactureOrder.ManufactureOrderDetails.priuserdefnvc1"); "ManufactureOrder.ManufactureOrderDetails.priuserdefnvc1");
} }
@Override @Override
protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap() { protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap(String cjt) {
Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>(); Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>();
map.put("VoucherDate", new CJTSyncTypeRelation("单据日期")); map.put("VoucherDate", new CJTSyncTypeRelation("单据日期"));
map.put("manufactureorderdetails_sourcevouchercode",new CJTSyncTypeRelation("存货编码")); map.put("manufactureorderdetails_sourcevouchercode",new CJTSyncTypeRelation("存货编码"));
map.put("Code",new CJTSyncTypeRelation("单据编码")); map.put("Code",new CJTSyncTypeRelation("单据编码"));
map.put("pubuserdefnvc1",new CJTSyncTypeRelation("钢板面"));
map.put("CreatedTime",new CJTSyncTypeRelation("创建时间")); map.put("CreatedTime",new CJTSyncTypeRelation("创建时间"));
map.put("Department_Name",new CJTSyncTypeRelation("生产车间")); map.put("Department_Name",new CJTSyncTypeRelation("生产车间"));
map.put("person_code",new CJTSyncTypeRelation("负责人")); map.put("person_name",new CJTSyncTypeRelation("负责人"));
map.put("ManufactureOrderDetails_Inventory_Code",new CJTSyncTypeRelation("产品编码")); map.put("ManufactureOrderDetails_Inventory_Code",new CJTSyncTypeRelation("产品编码"));
map.put("ManufactureOrderDetails_Inventory_Name",new CJTSyncTypeRelation("产品")); map.put("ManufactureOrderDetails_Inventory_Name",new CJTSyncTypeRelation("产品"));
map.put("ManufactureOrderDetails_Inventory_Specification",new CJTSyncTypeRelation("规格型号")); map.put("ManufactureOrderDetails_Inventory_Specification",new CJTSyncTypeRelation("规格型号"));
map.put("ManufactureOrderDetails_Unit_Name",new CJTSyncTypeRelation("生产单位")); map.put("ManufactureOrderDetails_Unit_Name",new CJTSyncTypeRelation("生产单位"));
map.put("ManufactureOrderDetails_Quantity",new CJTSyncTypeRelation("数量", TableFieldTypeEnum.NUMBER)); map.put("ManufactureOrderDetails_Quantity",new CJTSyncTypeRelation("数量", TableFieldTypeEnum.NUMBER));
map.put("Memo",new CJTSyncTypeRelation("备注1")); map.put("manufactureorderdetails_pubuserdefnvc2",new CJTSyncTypeRelation("备注1"));
map.put("Customer_Name",new CJTSyncTypeRelation("客户")); map.put("Customer_Name",new CJTSyncTypeRelation("客户"));
CjtAccountEnum cjtAccountEnum = CjtAccountEnum.valueOf(cjt);
switch (cjtAccountEnum){
case ONE:
map.put("ManufactureOrderDetails_priuserdefnvc1",new CJTSyncTypeRelation("合并字段")); map.put("ManufactureOrderDetails_priuserdefnvc1",new CJTSyncTypeRelation("合并字段"));
break;
case TWO:
map.put("manufactureorderdetails_priuserdefnvc1",new CJTSyncTypeRelation("钢板面"));
break;
}
return map; return map;
} }

@ -70,7 +70,7 @@ public class PurchaseArrivalOpenSyncJob extends SyncAccountsJobAbstract{
} }
@Override @Override
protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap() { protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap(String cjt) {
Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>(); Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>();
map.put("PurchaseOrderCode",new CJTSyncTypeRelation("采购订单号")); map.put("PurchaseOrderCode",new CJTSyncTypeRelation("采购订单号"));
map.put("Details_Inventory_Code",new CJTSyncTypeRelation("存货编码")); map.put("Details_Inventory_Code",new CJTSyncTypeRelation("存货编码"));

@ -66,7 +66,7 @@ public class PurchaseOrderSyncJob extends SyncAccountsJobAbstract{
} }
@Override @Override
protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap() { protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap(String cjt) {
Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>(); Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>();
map.put("voucherdate",new CJTSyncTypeRelation("单据日期")); map.put("voucherdate",new CJTSyncTypeRelation("单据日期"));
map.put("code",new CJTSyncTypeRelation("单据编号")); map.put("code",new CJTSyncTypeRelation("单据编号"));

@ -76,7 +76,7 @@ public class SaleDeliverySyncJob extends SyncAccountsJobAbstract {
} }
@Override @Override
protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap() { protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap(String cjt) {
Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>(); Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>();
map.put("code", new CJTSyncTypeRelation("单据编号")); map.put("code", new CJTSyncTypeRelation("单据编号"));
map.put("Customer_ID", new CJTSyncTypeRelation("客户")); map.put("Customer_ID", new CJTSyncTypeRelation("客户"));

@ -76,7 +76,7 @@ public class SaleDispatchSyncJob extends SyncAccountsJobAbstract{
} }
@Override @Override
protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap() { protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap(String cjt) {
Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>(); Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>();
map.put("rdrecorddetails_sourcevouchercode",new CJTSyncTypeRelation("来源单号")); map.put("rdrecorddetails_sourcevouchercode",new CJTSyncTypeRelation("来源单号"));
map.put("VoucherDate",new CJTSyncTypeRelation("单据日期")); map.put("VoucherDate",new CJTSyncTypeRelation("单据日期"));

@ -70,12 +70,12 @@ public class SaleOrderSyncJob extends SyncAccountsJobAbstract{
"SaleOrder.SaleOrderDetails.executedQuantity", "SaleOrder.SaleOrderDetails.executedQuantity",
"SaleOrder.SaleOrderDetails.pubuserdefnvc1", "SaleOrder.SaleOrderDetails.pubuserdefnvc1",
"SaleOrder.SaleOrderDetails.DetailMemo", "SaleOrder.SaleOrderDetails.DetailMemo",
"SaleOrder.memo", "SaleOrder.SaleOrderDetails.pubuserdefnvc2",
"SaleOrder.SaleOrderDetails.origDiscountAmount"); "SaleOrder.SaleOrderDetails.origDiscountAmount");
} }
@Override @Override
protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap() { protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap(String cjt) {
Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>(); Map<String, CJTSyncTypeRelation> map = new CaseInsensitiveMap<>();
map.put("voucherdate",new CJTSyncTypeRelation("单据日期")); map.put("voucherdate",new CJTSyncTypeRelation("单据日期"));
map.put("code",new CJTSyncTypeRelation("编号")); map.put("code",new CJTSyncTypeRelation("编号"));
@ -91,7 +91,15 @@ public class SaleOrderSyncJob extends SyncAccountsJobAbstract{
map.put("SaleOrderDetails_executedQuantity",new CJTSyncTypeRelation("累计执行数量", TableFieldTypeEnum.NUMBER)); map.put("SaleOrderDetails_executedQuantity",new CJTSyncTypeRelation("累计执行数量", TableFieldTypeEnum.NUMBER));
map.put("SaleOrderDetails_pubuserdefnvc1",new CJTSyncTypeRelation("钢板面")); map.put("SaleOrderDetails_pubuserdefnvc1",new CJTSyncTypeRelation("钢板面"));
map.put("SaleOrderDetails_DetailMemo",new CJTSyncTypeRelation("明细备注")); map.put("SaleOrderDetails_DetailMemo",new CJTSyncTypeRelation("明细备注"));
CjtAccountEnum cjtAccountEnum = CjtAccountEnum.valueOf(cjt);
switch (cjtAccountEnum){
case ONE:
map.put("memo",new CJTSyncTypeRelation("备注1")); map.put("memo",new CJTSyncTypeRelation("备注1"));
break;
case TWO:
map.put("saleorderdetails_pubuserdefnvc2",new CJTSyncTypeRelation("备注1"));
break;
}
map.put("SaleOrderDetails_origDiscountAmount",new CJTSyncTypeRelation("金额", TableFieldTypeEnum.NUMBER)); map.put("SaleOrderDetails_origDiscountAmount",new CJTSyncTypeRelation("金额", TableFieldTypeEnum.NUMBER));
return map; return map;
} }

@ -192,7 +192,7 @@ public abstract class SyncAccountsJobAbstract {
/** /**
* *
*/ */
protected abstract Map<String,CJTSyncTypeRelation> getQueryFieldsMap(); protected abstract Map<String,CJTSyncTypeRelation> getQueryFieldsMap(String cjt);
/** /**
* *
@ -340,7 +340,7 @@ public abstract class SyncAccountsJobAbstract {
protected List<String> syncLarkBatch(List<String> keyList,List<List<String>> rows,Map<String, String> existKeyMap,LarkTableRequest addRecordRequest,String cjt){ protected List<String> syncLarkBatch(List<String> keyList,List<List<String>> rows,Map<String, String> existKeyMap,LarkTableRequest addRecordRequest,String cjt){
List<ErpLarkRelation> relationList = new ArrayList<>(); List<ErpLarkRelation> relationList = new ArrayList<>();
//查询字段与飞书字段的对应关系 //查询字段与飞书字段的对应关系
Map<String, CJTSyncTypeRelation> queryFieldsMap = getQueryFieldsMap(); Map<String, CJTSyncTypeRelation> queryFieldsMap = getQueryFieldsMap(cjt);
//组成唯一键的集合 //组成唯一键的集合
List<String> uniqueFields = getUniqueFields(cjt); List<String> uniqueFields = getUniqueFields(cjt);
//错误唯一键 //错误唯一键

Loading…
Cancel
Save