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

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

@ -14,11 +14,12 @@ import java.util.Map;
/** /**
* *
*
* @author yuxiangyong * @author yuxiangyong
* @create 2023-07-17 21:21 * @create 2023-07-17 21:21
*/ */
@Component("manufactureOrderJob") @Component("manufactureOrderJob")
public class ManufactureOrderSyncJob extends SyncAccountsJobAbstract{ public class ManufactureOrderSyncJob extends SyncAccountsJobAbstract {
private static final String urlPath = "/tplus/api/v2/ManufactureOrderOpenApi/FindVoucherList"; private static final String urlPath = "/tplus/api/v2/ManufactureOrderOpenApi/FindVoucherList";
@ -34,8 +35,8 @@ public class ManufactureOrderSyncJob extends SyncAccountsJobAbstract{
} }
@Override @Override
public void executeSync(String cjt,String queryFromTime,String queryToTime) { public void executeSync(String cjt, String queryFromTime, String queryToTime) {
super.executeSync(cjt,queryFromTime,queryToTime); super.executeSync(cjt, queryFromTime, queryToTime);
} }
@Override @Override
@ -67,32 +68,33 @@ public class ManufactureOrderSyncJob extends SyncAccountsJobAbstract{
"ManufactureOrder.ManufactureOrderDetails.Quantity", "ManufactureOrder.ManufactureOrderDetails.Quantity",
"ManufactureOrder.ManufactureOrderDetails.pubuserdefnvc2", "ManufactureOrder.ManufactureOrderDetails.pubuserdefnvc2",
"ManufactureOrder.Customer.Name", "ManufactureOrder.Customer.Name",
"ManufactureOrder.ManufactureOrderDetails.priuserdefnvc1"); "ManufactureOrder.ManufactureOrderDetails.priuserdefnvc1",
"ManufactureOrder.ManufactureOrderDetails.pubuserdefnvc1");
} }
@Override @Override
protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap(String cjt) { 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("CreatedTime",new CJTSyncTypeRelation("创建时间")); map.put("CreatedTime", new CJTSyncTypeRelation("创建时间"));
map.put("Department_Name",new CJTSyncTypeRelation("生产车间")); map.put("Department_Name", new CJTSyncTypeRelation("生产车间"));
map.put("person_name",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("manufactureorderdetails_pubuserdefnvc2",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); map.put("ManufactureOrderDetails_priuserdefnvc1", new CJTSyncTypeRelation("合并字段"));
switch (cjtAccountEnum){ CjtAccountEnum cjtAccountEnum = CjtAccountEnum.getByCode(cjt);
switch (cjtAccountEnum) {
case ONE: case ONE:
map.put("ManufactureOrderDetails_priuserdefnvc1",new CJTSyncTypeRelation("合并字段"));
break; break;
case TWO: case TWO:
map.put("manufactureorderdetails_priuserdefnvc1",new CJTSyncTypeRelation("钢板面")); map.put("ManufactureOrderDetails_pubuserdefnvc1", new CJTSyncTypeRelation("钢板面"));
break; break;
} }
return map; return map;

@ -58,16 +58,16 @@ public class SaleDeliverySyncJob extends SyncAccountsJobAbstract {
protected List<String> getQueryFields() { protected List<String> getQueryFields() {
return Arrays.asList( return Arrays.asList(
"SaleDelivery.Code", "SaleDelivery.Code",
"SaleDelivery.Customer.ID", "SaleDelivery.Customer.Name",
"SaleDelivery.BusinessType.Name", "SaleDelivery.BusinessType.Name",
"SaleDelivery.CreatedTime", "SaleDelivery.CreatedTime",
"SaleDelivery.auditeddate", "SaleDelivery.auditeddate",
"SaleDelivery.VoucherDate", "SaleDelivery.VoucherDate",
"SaleDelivery.SaleOrderCode", "SaleDelivery.SaleDeliveryDetails.SaleOrderCode",
"SaleDelivery.SaleDeliveryDetails.Inventory.Code", "SaleDelivery.SaleDeliveryDetails.Inventory.Code",
"SaleDelivery.SaleDeliveryDetails.Inventory.Name", "SaleDelivery.SaleDeliveryDetails.Inventory.Name",
"SaleDelivery.SaleDeliveryDetails.Inventory.Specification", "SaleDelivery.SaleDeliveryDetails.Inventory.Specification",
"SaleDelivery.pubuserdefnvc1", "SaleDelivery.SaleDeliveryDetails.pubuserdefnvc1",
"SaleDelivery.SaleDeliveryDetails.Unit.Name", "SaleDelivery.SaleDeliveryDetails.Unit.Name",
"SaleDelivery.SaleDeliveryDetails.Quantity", "SaleDelivery.SaleDeliveryDetails.Quantity",
"SaleDelivery.SaleDeliveryDetails.OrigDiscountAmount", "SaleDelivery.SaleDeliveryDetails.OrigDiscountAmount",
@ -79,16 +79,16 @@ public class SaleDeliverySyncJob extends SyncAccountsJobAbstract {
protected Map<String, CJTSyncTypeRelation> getQueryFieldsMap(String cjt) { 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_name", new CJTSyncTypeRelation("客户"));
map.put("BusinessType_Name", new CJTSyncTypeRelation("业务类型")); map.put("BusinessType_Name", new CJTSyncTypeRelation("业务类型"));
map.put("CreatedTime", new CJTSyncTypeRelation("创建时间", TableFieldTypeEnum.DATE, DateUtils.YYYY_MM_DD_HH_MM_SS)); map.put("CreatedTime", new CJTSyncTypeRelation("创建时间", TableFieldTypeEnum.DATE, DateUtils.YYYY_MM_DD_HH_MM_SS));
map.put("auditeddate", new CJTSyncTypeRelation("审核时间")); map.put("auditeddate", new CJTSyncTypeRelation("审核时间"));
map.put("voucherdate", new CJTSyncTypeRelation("单据日期")); map.put("voucherdate", new CJTSyncTypeRelation("单据日期"));
map.put("saleordercode", new CJTSyncTypeRelation("销售订单号")); map.put("saledeliverydetails_saleordercode", new CJTSyncTypeRelation("销售订单号"));
map.put("SaleDeliveryDetails_Inventory_Code", new CJTSyncTypeRelation("存货编码")); map.put("SaleDeliveryDetails_Inventory_Code", new CJTSyncTypeRelation("存货编码"));
map.put("SaleDeliveryDetails_Inventory_Name", new CJTSyncTypeRelation("存货")); map.put("SaleDeliveryDetails_Inventory_Name", new CJTSyncTypeRelation("存货"));
map.put("SaleDeliveryDetails_Inventory_Specification", new CJTSyncTypeRelation("规格型号")); map.put("SaleDeliveryDetails_Inventory_Specification", new CJTSyncTypeRelation("规格型号"));
map.put("pubuserdefnvc1", new CJTSyncTypeRelation("钢板面")); map.put("saledeliverydetails_pubuserdefnvc1", new CJTSyncTypeRelation("钢板面"));
map.put("SaleDeliveryDetails_Unit_Name", new CJTSyncTypeRelation("销售单位")); map.put("SaleDeliveryDetails_Unit_Name", new CJTSyncTypeRelation("销售单位"));
map.put("SaleDeliveryDetails_Quantity", new CJTSyncTypeRelation("数量", TableFieldTypeEnum.NUMBER)); map.put("SaleDeliveryDetails_Quantity", new CJTSyncTypeRelation("数量", TableFieldTypeEnum.NUMBER));
map.put("SaleDeliveryDetails_OrigDiscountAmount", new CJTSyncTypeRelation("金额", TableFieldTypeEnum.NUMBER)); map.put("SaleDeliveryDetails_OrigDiscountAmount", new CJTSyncTypeRelation("金额", TableFieldTypeEnum.NUMBER));

@ -59,7 +59,7 @@ public class SaleOrderSyncJob extends SyncAccountsJobAbstract{
"SaleOrder.voucherdate", "SaleOrder.voucherdate",
"SaleOrder.code", "SaleOrder.code",
"SaleOrder.createdtime", "SaleOrder.createdtime",
"SaleOrder.idcustomer", "SaleOrder.Customer.Name",
"SaleOrder.auditeddate", "SaleOrder.auditeddate",
"SaleOrder.voucherState.Name", "SaleOrder.voucherState.Name",
"SaleOrder.SaleOrderDetails.Inventory.Code", "SaleOrder.SaleOrderDetails.Inventory.Code",
@ -70,6 +70,7 @@ 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.pubuserdefnvc2",
"SaleOrder.SaleOrderDetails.origDiscountAmount"); "SaleOrder.SaleOrderDetails.origDiscountAmount");
} }
@ -80,7 +81,7 @@ public class SaleOrderSyncJob extends SyncAccountsJobAbstract{
map.put("voucherdate",new CJTSyncTypeRelation("单据日期")); map.put("voucherdate",new CJTSyncTypeRelation("单据日期"));
map.put("code",new CJTSyncTypeRelation("编号")); map.put("code",new CJTSyncTypeRelation("编号"));
map.put("createdtime",new CJTSyncTypeRelation("生单时间",TableFieldTypeEnum.DATE, DateUtils.YYYY_MM_DD_HH_MM_SS)); map.put("createdtime",new CJTSyncTypeRelation("生单时间",TableFieldTypeEnum.DATE, DateUtils.YYYY_MM_DD_HH_MM_SS));
map.put("idcustomer",new CJTSyncTypeRelation("客户id")); map.put("customer_name",new CJTSyncTypeRelation("客户"));
map.put("auditeddate",new CJTSyncTypeRelation("审核日期")); map.put("auditeddate",new CJTSyncTypeRelation("审核日期"));
map.put("voucherstate_name",new CJTSyncTypeRelation("单据状态")); map.put("voucherstate_name",new CJTSyncTypeRelation("单据状态"));
map.put("SaleOrderDetails_Inventory_Code",new CJTSyncTypeRelation("存货编码")); map.put("SaleOrderDetails_Inventory_Code",new CJTSyncTypeRelation("存货编码"));
@ -91,7 +92,7 @@ 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); CjtAccountEnum cjtAccountEnum = CjtAccountEnum.getByCode(cjt);
switch (cjtAccountEnum){ switch (cjtAccountEnum){
case ONE: case ONE:
map.put("memo",new CJTSyncTypeRelation("备注1")); map.put("memo",new CJTSyncTypeRelation("备注1"));

@ -352,6 +352,9 @@ public abstract class SyncAccountsJobAbstract {
List<String> uniqueKeyList = new ArrayList<>(); List<String> uniqueKeyList = new ArrayList<>();
for (int i = 0; i < row.size(); i++) { for (int i = 0; i < row.size(); i++) {
CJTSyncTypeRelation cjtSyncTypeRelation = queryFieldsMap.get(keyList.get(i)); CJTSyncTypeRelation cjtSyncTypeRelation = queryFieldsMap.get(keyList.get(i));
if (cjtSyncTypeRelation == null){
continue;
}
String larkLabel = cjtSyncTypeRelation.getLarkFileName(); String larkLabel = cjtSyncTypeRelation.getLarkFileName();
String value = row.get(i); String value = row.get(i);
if (uniqueFields.contains(keyList.get(i))){ if (uniqueFields.contains(keyList.get(i))){

Loading…
Cancel
Save