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);
}
@ -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);
}
@ -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'";
@ -398,6 +400,8 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
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);
@ -501,8 +506,9 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @DescrptionERP
*/
@Override
public int syncProjectInfoFromErp(int startRow) throws Exception {
String maxErpModifyDate = mesProjectInfoMapper.selectMaxErpModifyDate();
public int syncProjectInfoFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception {
String maxErpModifyDate = StringUtils.isEmpty(erpSyncInfoVo.getMaxErpModifyDate())?
mesProjectInfoMapper.selectMaxErpModifyDate(): erpSyncInfoVo.getMaxErpModifyDate();
return syncProjectInfoFromErp(startRow, maxErpModifyDate);
}
@ -619,8 +625,9 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @DescrptionERP
*/
@Override
public int syncPurchaseOrderFromErp(int startRow) throws Exception {
String maxErpModifyDate = mesPurchaseOrderMapper.selectMaxErpModifyDate();
public int syncPurchaseOrderFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception {
String maxErpModifyDate = StringUtils.isEmpty(erpSyncInfoVo.getMaxErpModifyDate())?
mesPurchaseOrderMapper.selectMaxErpModifyDate():erpSyncInfoVo.getMaxErpModifyDate();
return syncPurchaseOrderFromErp(startRow, maxErpModifyDate);
}
@ -804,9 +811,6 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
}
public static int syncMaterialInfoFromErpTest(int startRow) throws Exception {
K3CloudApi api = new K3CloudApi();
String FDocumentStatus = "C";

@ -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