erp:
1、同步销售订单信息增加销售规格的同步
2、同步销售订单、同步供应商信息、同步采购订单信息、同步项目信息增加maxErpModifyDate参数
master
xs 4 months ago
parent 8fbeeb1bd5
commit 9281bfd6a6

@ -21,7 +21,7 @@ public interface RemoteJindieService {
/** 同步供应商*/
@PostMapping("/jindie/syncSupplierInfoFromErp")
R<Integer> syncSupplierInfoFromErp(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
R<Integer> syncSupplierInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/** 同步物料*/
@PostMapping("/jindie/syncMaterialInfoFromErp")
@ -29,14 +29,14 @@ public interface RemoteJindieService {
/** 同步项目信息*/
@PostMapping("/jindie/syncProjectInfoFromErp")
R<Integer> syncProjectInfoFromErp(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
R<Integer> syncProjectInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/** 同步销售订单*/
@PostMapping("/jindie/syncSaleOrderFromErp")
R<Integer> syncSaleOrderFromErp(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
R<Integer> syncSaleOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/** 同步采购订单*/
@PostMapping("/jindie/syncPurchaseOrderFromErp")
R<Integer> syncPurchaseOrderFromErp(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
R<Integer> syncPurchaseOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

@ -16,7 +16,7 @@ public class RemoteJindieFallbackFactory implements FallbackFactory<RemoteJindie
public RemoteJindieService create(Throwable throwable) {
return new RemoteJindieService() {
@Override
public R<Integer> syncSupplierInfoFromErp(String source) {
public R<Integer> syncSupplierInfoFromErp(ErpSyncInfoVo erpSyncInfoVo,String source) {
return R.fail("同步供应商信息失败:" + throwable.getMessage());
}
@ -26,17 +26,17 @@ public class RemoteJindieFallbackFactory implements FallbackFactory<RemoteJindie
}
@Override
public R<Integer> syncProjectInfoFromErp(String source) {
public R<Integer> syncProjectInfoFromErp(ErpSyncInfoVo erpSyncInfoVo,String source) {
return R.fail("同步项目信息失败:" + throwable.getMessage());
}
@Override
public R<Integer> syncSaleOrderFromErp(String source) {
public R<Integer> syncSaleOrderFromErp(ErpSyncInfoVo erpSyncInfoVo,String source) {
return R.fail("同步销售订单信息失败:" + throwable.getMessage());
}
@Override
public R<Integer> syncPurchaseOrderFromErp(String source) {
public R<Integer> syncPurchaseOrderFromErp(ErpSyncInfoVo erpSyncInfoVo,String source) {
return R.fail("同步采购订单信息失败:" + throwable.getMessage());
}
};

@ -38,9 +38,9 @@ public class KingdeeErpSyncController {
@PostMapping("/syncSupplierInfoFromErp")
@Log(title = "ERP供应商信息", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult syncSupplierInfoFromErp() {
public AjaxResult syncSupplierInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0));
return AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0, erpSyncInfoVo));
} catch (Exception e) {
logger.error("同步供应商信息错误:" + e.getMessage());
return AjaxResult.error();
@ -70,9 +70,9 @@ public class KingdeeErpSyncController {
@PostMapping("/syncProjectInfoFromErp")
@Log(title = "ERP项目信息", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult syncProjectInfoFromErp() {
public AjaxResult syncProjectInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0));
return AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0, erpSyncInfoVo));
} catch (Exception e) {
logger.error("同步项目信息错误:" + e.getMessage());
return AjaxResult.error();
@ -85,9 +85,9 @@ public class KingdeeErpSyncController {
@PostMapping("/syncSaleOrderFromErp")
@Log(title = "ERP销售订单", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult syncSaleOrderFromErp() {
public AjaxResult syncSaleOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0));
return AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0, erpSyncInfoVo));
} catch (Exception e) {
logger.error("同步销售订单信息错误:" + e.getMessage());
return AjaxResult.error();
@ -101,9 +101,9 @@ public class KingdeeErpSyncController {
@PostMapping("/syncPurchaseOrderFromErp")
@Log(title = "ERP采购订单", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult syncPurchaseOrderFromErp() {
public AjaxResult syncPurchaseOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0));
return AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0, erpSyncInfoVo));
} catch (Exception e) {
logger.error("同步采购订单信息错误:" + e.getMessage());
return AjaxResult.error();

@ -113,6 +113,9 @@ public class MesSaleOrder extends BaseEntity {
@Excel(name = "是否已下达计划", readConverterExp = "1=-是0-否")
private String isRelease;
/**规格型号*/
private String materialModel;
/**
* ;FApproveDate
*/
@ -352,6 +355,14 @@ public class MesSaleOrder extends BaseEntity {
return isRelease;
}
public String getMaterialModel() {
return materialModel;
}
public void setMaterialModel(String materialModel) {
this.materialModel = materialModel;
}
public void setApproveDate(Date approveDate) {
this.approveDate = approveDate;
}

@ -4,9 +4,9 @@ import com.hw.jindie.api.domain.vo.ErpSyncInfoVo;
public interface IKingdeeErpSyncService {
public int syncSupplierInfoFromErp(int startRow) throws Exception;
public int syncSupplierInfoFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception;
public int syncMaterialInfoFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception;
public int syncProjectInfoFromErp(int startRow) throws Exception;
public int syncSaleOrderFromErp(int startRow) throws Exception;
public int syncPurchaseOrderFromErp(int startRow) throws Exception;
public int syncProjectInfoFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception;
public int syncSaleOrderFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception;
public int syncPurchaseOrderFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception;
}

@ -44,8 +44,9 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @Description:ERP
*/
@Override
public int syncSupplierInfoFromErp(int startRow) throws Exception {
String maxErpModifyDate = mesBaseSupplierInfoMapper.selectMaxErpModifyDate();
public int syncSupplierInfoFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception {
String maxErpModifyDate = StringUtils.isEmpty(erpSyncInfoVo.getMaxErpModifyDate()) ?
mesBaseSupplierInfoMapper.selectMaxErpModifyDate() : erpSyncInfoVo.getMaxErpModifyDate();
return syncSupplierInfoFromErp(startRow, maxErpModifyDate);
}
@ -162,7 +163,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
}
}
System.out.println("size:"+resultArray.size());
System.out.println("size:" + resultArray.size());
//如果返回的数组的数量等于分页数量,则继续获取下一页数据
if (resultArray.size() == limit) {
// System.out.println(startRow);
@ -184,7 +185,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
@Override
public int syncMaterialInfoFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception {
String maxErpModifyDate = StringUtils.isEmpty(erpSyncInfoVo.getMaxErpModifyDate())
?mesBaseMaterialInfoMapper.selectMaxErpModifyDate():erpSyncInfoVo.getMaxErpModifyDate();
? mesBaseMaterialInfoMapper.selectMaxErpModifyDate() : erpSyncInfoVo.getMaxErpModifyDate();
return syncMaterialInfoFromErp(startRow, maxErpModifyDate);
}
@ -306,7 +307,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
}
}
System.out.println("size:"+resultArray.size());
System.out.println("size:" + resultArray.size());
/**分页递归获取所有物料信息*/
if (resultArray.size() == limit) {
// System.out.println(startRow);
@ -326,8 +327,9 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @DescrptionERP
*/
@Override
public int syncSaleOrderFromErp(int startRow) throws Exception {
String maxErpModifyDate = mesSaleOrderMapper.selectMaxErpModifyDate();
public int syncSaleOrderFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception {
String maxErpModifyDate = StringUtils.isEmpty(erpSyncInfoVo.getMaxErpModifyDate())?
mesSaleOrderMapper.selectMaxErpModifyDate():erpSyncInfoVo.getMaxErpModifyDate();
return syncSaleOrderFromErp(startRow, maxErpModifyDate);
}
@ -335,7 +337,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @throws Exception
* @DescrptionERP
*/
public int syncSaleOrderFromErp(int startRow,String maxErpModifyDate) throws Exception {
public int syncSaleOrderFromErp(int startRow, String maxErpModifyDate) throws Exception {
K3CloudApi api = new K3CloudApi();
// String FDocumentStatus = "C";
// String json = "{\n" +
@ -351,7 +353,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
JSONObject queryJson = new JSONObject();
String formId = "SAL_SaleOrder";
String fieldKeys = "FID,FBillNo,FApproveDate,FSaleOrderEntry_FEntryID,FMaterialId,FMaterialId.FNumber,FMaterialName,FDocumentStatus," +
String fieldKeys = "FID,FBillNo,FApproveDate,FSaleOrderEntry_FEntryID,FSaleOrderEntry_FMaterialModel,FMaterialId,FMaterialId.FNumber,FMaterialName,FDocumentStatus," +
"FQty,FCreateDate,FModifyDate,FMinPlanDeliveryDate,FAuxPropId,FStockId,FOwnerId,FSaleDeptId,FPrice,FStockOrgId,F_TOND_Base";
//
// String filterString = "FNumber='98010102'";
@ -391,13 +393,15 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
JSONObject resultObject = (JSONObject) resultArray.get(i);
MesSaleOrder mesSaleOrder = new MesSaleOrder();
//erp主键
Long erpId = resultObject.getLong("FID");
Long erpId = resultObject.getLong("FID");
//销售订单编号id
String saleOrderCode = resultObject.getString("FBillNo");
//审核日期
String approveDate = resultObject.getString("FApproveDate");
//订单明细id
Long fentyrId = resultObject.getLong("FSaleOrderEntry.FEntryID");
//订单明细规格
String materialModel = resultObject.getString("FSaleOrderEntry.FMaterialModel");
//ERP物料id
Long fmaterialId = resultObject.getLong("FMaterialId");
//物料编码
@ -430,6 +434,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
mesSaleOrder.setErpId(erpId);
mesSaleOrder.setSaleorderCode(saleOrderCode);
mesSaleOrder.setFentryId(fentyrId);
mesSaleOrder.setMaterialModel(materialModel);
mesSaleOrder.setDocumentStatus(documentStatus);
//erp物料id
mesSaleOrder.setMaterialId(fmaterialId);
@ -480,13 +485,13 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
}
}
System.out.println("size:"+resultArray.size());
System.out.println("size:" + resultArray.size());
/**分页递归获取所有物料信息*/
if (resultArray.size() == limit) {
// System.out.println(startRow);
//通过递归同步所有物料信息,测试先不用
int i = syncSaleOrderFromErp(startRow + resultArray.size(),maxErpModifyDate);
int i = syncSaleOrderFromErp(startRow + resultArray.size(), maxErpModifyDate);
// return i;
return 1;
} else {
@ -501,16 +506,17 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @DescrptionERP
*/
@Override
public int syncProjectInfoFromErp(int startRow) throws Exception {
String maxErpModifyDate = mesProjectInfoMapper.selectMaxErpModifyDate();
return syncProjectInfoFromErp(startRow,maxErpModifyDate);
public int syncProjectInfoFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception {
String maxErpModifyDate = StringUtils.isEmpty(erpSyncInfoVo.getMaxErpModifyDate())?
mesProjectInfoMapper.selectMaxErpModifyDate(): erpSyncInfoVo.getMaxErpModifyDate();
return syncProjectInfoFromErp(startRow, maxErpModifyDate);
}
/**
* @throws Exception
* @DescrptionERP
*/
public int syncProjectInfoFromErp(int startRow,String maxErpModifyDate) throws Exception {
public int syncProjectInfoFromErp(int startRow, String maxErpModifyDate) throws Exception {
K3CloudApi api = new K3CloudApi();
// String FDocumentStatus = "C";
@ -600,12 +606,12 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
}
}
System.out.println("size:"+resultArray.size());
System.out.println("size:" + resultArray.size());
/**分页递归获取所有物料信息*/
if (resultArray.size() == limit) {
// System.out.println(startRow);
//通过递归同步所有物料信息,测试先不用
int i = syncProjectInfoFromErp(startRow + resultArray.size(),maxErpModifyDate);
int i = syncProjectInfoFromErp(startRow + resultArray.size(), maxErpModifyDate);
// return i;
return 1;
} else {
@ -619,16 +625,17 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @DescrptionERP
*/
@Override
public int syncPurchaseOrderFromErp(int startRow) throws Exception {
String maxErpModifyDate = mesPurchaseOrderMapper.selectMaxErpModifyDate();
return syncPurchaseOrderFromErp(startRow,maxErpModifyDate);
public int syncPurchaseOrderFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception {
String maxErpModifyDate = StringUtils.isEmpty(erpSyncInfoVo.getMaxErpModifyDate())?
mesPurchaseOrderMapper.selectMaxErpModifyDate():erpSyncInfoVo.getMaxErpModifyDate();
return syncPurchaseOrderFromErp(startRow, maxErpModifyDate);
}
/**
* @throws Exception
* @DescrptionERP
*/
public int syncPurchaseOrderFromErp(int startRow,String maxErpModifyDate) throws Exception {
public int syncPurchaseOrderFromErp(int startRow, String maxErpModifyDate) throws Exception {
K3CloudApi api = new K3CloudApi();
// String FDocumentStatus = "C";
JSONObject queryJson = new JSONObject();
@ -681,7 +688,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
//订单明细id
Long fentryId = resultObject.getLong("FPOOrderEntry.FEntryID");
//erp物料ID
Long fmaterialId = resultObject.getLong("FMaterialId");
Long fmaterialId = resultObject.getLong("FMaterialId");
//物料编码
String materialCode = resultObject.getString("FMaterialId.FNumber");
//物料名称
@ -772,12 +779,12 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
}
}
System.out.println("size:"+resultArray.size());
System.out.println("size:" + resultArray.size());
/**分页递归获取所有物料信息*/
if (resultArray.size() == limit) {
// System.out.println(startRow);
//通过递归同步所有物料信息,测试先不用
int i = syncPurchaseOrderFromErp(startRow + resultArray.size(),maxErpModifyDate);
int i = syncPurchaseOrderFromErp(startRow + resultArray.size(), maxErpModifyDate);
// return i;
return 1;
} else {
@ -788,7 +795,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
public static void main(String[] args) throws Exception {
KingdeeErpSyncServiceImpl k = new KingdeeErpSyncServiceImpl();
k.syncProjectInfoFromErp(0,"");
k.syncProjectInfoFromErp(0, "");
// int i = syncSupplierInfoFromErp(0);
// syncMaterialInfoFromErpTest(0);
// syncSaleOrderFromErp();
@ -804,9 +811,6 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
}
public static int syncMaterialInfoFromErpTest(int startRow) throws Exception {
K3CloudApi api = new K3CloudApi();
String FDocumentStatus = "C";
@ -829,8 +833,8 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
queryJson.put("SubSystemId", "");
//条件查询
String filterString = "FNumber ='01010001'";
queryJson.put("FilterString", filterString);
String filterString = "FNumber ='01010001'";
queryJson.put("FilterString", filterString);
System.out.println(queryJson.toString());
@ -846,7 +850,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
System.out.println("物料单据查询接口: " + result);
return 1;
return 1;
}
}

@ -21,6 +21,7 @@
<result property="completeAmount" column="complete_amount"/>
<result property="releaseQty" column="release_qty"/>
<result property="isRelease" column="is_release"/>
<result property="materialModel" column="material_model"/>
<result property="approveDate" column="approve_date"/>
<result property="erpModifyDate" column="erp_modify_date"/>
<result property="planDeliveryDate" column="plan_delivery_date"/>
@ -54,6 +55,7 @@
material_id,
material_code,
material_name,
material_model,
matkl,
order_amount,
complete_amount,
@ -136,6 +138,7 @@
<if test="materialId != null">material_id,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="materialModel != null">material_model,</if>
<if test="matkl != null">matkl,</if>
<if test="orderAmount != null">order_amount,</if>
<if test="completeAmount != null">complete_amount,</if>
@ -171,6 +174,7 @@
<if test="materialId != null">#{materialId},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialModel != null">#{materialModel},</if>
<if test="matkl != null">#{matkl},</if>
<if test="orderAmount != null">#{orderAmount},</if>
<if test="completeAmount != null">#{completeAmount},</if>
@ -210,6 +214,7 @@
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialModel != null">material_model = #{materialModel},</if>
<if test="matkl != null">matkl = #{matkl},</if>
<if test="orderAmount != null">order_amount = #{orderAmount},</if>
<if test="completeAmount != null">complete_amount = #{completeAmount},</if>

@ -68,9 +68,11 @@ public class RyTask
System.out.println("++创建保养工单++getDmsMaintInstance");
remoteDmsService.getDmsBillsMaintInstance(SecurityConstants.INNER,planMaintCode);
}
public void syncSupplierInfoFromErp(){
public void syncSupplierInfoFromErp(String maxErpModifyDate){
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
erpSyncInfoVo.setMaxErpModifyDate(maxErpModifyDate);
System.out.println("++同步ERP中物料供应商++ErpSupplierInfo");
remoteJindieService.syncSupplierInfoFromErp(SecurityConstants.INNER);
remoteJindieService.syncSupplierInfoFromErp(erpSyncInfoVo,SecurityConstants.INNER);
}
public void syncMaterialInfoFromErp(String maxErpModifyDate){
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
@ -79,19 +81,25 @@ public class RyTask
remoteJindieService.syncMaterialInfoFromErp(erpSyncInfoVo,SecurityConstants.INNER);
}
public void syncProjectInfoFromErp(){
public void syncProjectInfoFromErp(String maxErpModifyDate){
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
erpSyncInfoVo.setMaxErpModifyDate(maxErpModifyDate);
System.out.println("++同步ERP中项目信息++ErpProjectInfo");
remoteJindieService.syncProjectInfoFromErp(SecurityConstants.INNER);
remoteJindieService.syncProjectInfoFromErp(erpSyncInfoVo,SecurityConstants.INNER);
}
public void syncSaleOrderFromErp(){
public void syncSaleOrderFromErp(String maxErpModifyDate){
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
erpSyncInfoVo.setMaxErpModifyDate(maxErpModifyDate);
System.out.println("++同步ERP中销售订单信息++ErpSaleOrder");
remoteJindieService.syncSaleOrderFromErp(SecurityConstants.INNER);
remoteJindieService.syncSaleOrderFromErp(erpSyncInfoVo,SecurityConstants.INNER);
}
public void syncPurchaseOrderFromErp(){
public void syncPurchaseOrderFromErp(String maxErpModifyDate){
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
erpSyncInfoVo.setMaxErpModifyDate(maxErpModifyDate);
System.out.println("++同步ERP中采购订单信息++ErpPurchaseOrder");
remoteJindieService.syncPurchaseOrderFromErp(SecurityConstants.INNER);
remoteJindieService.syncPurchaseOrderFromErp(erpSyncInfoVo,SecurityConstants.INNER);
}
}

Loading…
Cancel
Save