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

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

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

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

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

@ -44,8 +44,9 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @Description:ERP * @Description:ERP
*/ */
@Override @Override
public int syncSupplierInfoFromErp(int startRow) throws Exception { public int syncSupplierInfoFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception {
String maxErpModifyDate = mesBaseSupplierInfoMapper.selectMaxErpModifyDate(); String maxErpModifyDate = StringUtils.isEmpty(erpSyncInfoVo.getMaxErpModifyDate()) ?
mesBaseSupplierInfoMapper.selectMaxErpModifyDate() : erpSyncInfoVo.getMaxErpModifyDate();
return syncSupplierInfoFromErp(startRow, maxErpModifyDate); return syncSupplierInfoFromErp(startRow, maxErpModifyDate);
} }
@ -326,8 +327,9 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @DescrptionERP * @DescrptionERP
*/ */
@Override @Override
public int syncSaleOrderFromErp(int startRow) throws Exception { public int syncSaleOrderFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception {
String maxErpModifyDate = mesSaleOrderMapper.selectMaxErpModifyDate(); String maxErpModifyDate = StringUtils.isEmpty(erpSyncInfoVo.getMaxErpModifyDate())?
mesSaleOrderMapper.selectMaxErpModifyDate():erpSyncInfoVo.getMaxErpModifyDate();
return syncSaleOrderFromErp(startRow, maxErpModifyDate); return syncSaleOrderFromErp(startRow, maxErpModifyDate);
} }
@ -351,7 +353,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
JSONObject queryJson = new JSONObject(); JSONObject queryJson = new JSONObject();
String formId = "SAL_SaleOrder"; 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"; "FQty,FCreateDate,FModifyDate,FMinPlanDeliveryDate,FAuxPropId,FStockId,FOwnerId,FSaleDeptId,FPrice,FStockOrgId,F_TOND_Base";
// //
// String filterString = "FNumber='98010102'"; // String filterString = "FNumber='98010102'";
@ -398,6 +400,8 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
String approveDate = resultObject.getString("FApproveDate"); String approveDate = resultObject.getString("FApproveDate");
//订单明细id //订单明细id
Long fentyrId = resultObject.getLong("FSaleOrderEntry.FEntryID"); Long fentyrId = resultObject.getLong("FSaleOrderEntry.FEntryID");
//订单明细规格
String materialModel = resultObject.getString("FSaleOrderEntry.FMaterialModel");
//ERP物料id //ERP物料id
Long fmaterialId = resultObject.getLong("FMaterialId"); Long fmaterialId = resultObject.getLong("FMaterialId");
//物料编码 //物料编码
@ -430,6 +434,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
mesSaleOrder.setErpId(erpId); mesSaleOrder.setErpId(erpId);
mesSaleOrder.setSaleorderCode(saleOrderCode); mesSaleOrder.setSaleorderCode(saleOrderCode);
mesSaleOrder.setFentryId(fentyrId); mesSaleOrder.setFentryId(fentyrId);
mesSaleOrder.setMaterialModel(materialModel);
mesSaleOrder.setDocumentStatus(documentStatus); mesSaleOrder.setDocumentStatus(documentStatus);
//erp物料id //erp物料id
mesSaleOrder.setMaterialId(fmaterialId); mesSaleOrder.setMaterialId(fmaterialId);
@ -501,8 +506,9 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @DescrptionERP * @DescrptionERP
*/ */
@Override @Override
public int syncProjectInfoFromErp(int startRow) throws Exception { public int syncProjectInfoFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception {
String maxErpModifyDate = mesProjectInfoMapper.selectMaxErpModifyDate(); String maxErpModifyDate = StringUtils.isEmpty(erpSyncInfoVo.getMaxErpModifyDate())?
mesProjectInfoMapper.selectMaxErpModifyDate(): erpSyncInfoVo.getMaxErpModifyDate();
return syncProjectInfoFromErp(startRow, maxErpModifyDate); return syncProjectInfoFromErp(startRow, maxErpModifyDate);
} }
@ -619,8 +625,9 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @DescrptionERP * @DescrptionERP
*/ */
@Override @Override
public int syncPurchaseOrderFromErp(int startRow) throws Exception { public int syncPurchaseOrderFromErp(int startRow, ErpSyncInfoVo erpSyncInfoVo) throws Exception {
String maxErpModifyDate = mesPurchaseOrderMapper.selectMaxErpModifyDate(); String maxErpModifyDate = StringUtils.isEmpty(erpSyncInfoVo.getMaxErpModifyDate())?
mesPurchaseOrderMapper.selectMaxErpModifyDate():erpSyncInfoVo.getMaxErpModifyDate();
return syncPurchaseOrderFromErp(startRow, maxErpModifyDate); return syncPurchaseOrderFromErp(startRow, maxErpModifyDate);
} }
@ -804,9 +811,6 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
} }
public static int syncMaterialInfoFromErpTest(int startRow) throws Exception { public static int syncMaterialInfoFromErpTest(int startRow) throws Exception {
K3CloudApi api = new K3CloudApi(); K3CloudApi api = new K3CloudApi();
String FDocumentStatus = "C"; String FDocumentStatus = "C";

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

@ -68,9 +68,11 @@ public class RyTask
System.out.println("++创建保养工单++getDmsMaintInstance"); System.out.println("++创建保养工单++getDmsMaintInstance");
remoteDmsService.getDmsBillsMaintInstance(SecurityConstants.INNER,planMaintCode); 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"); System.out.println("++同步ERP中物料供应商++ErpSupplierInfo");
remoteJindieService.syncSupplierInfoFromErp(SecurityConstants.INNER); remoteJindieService.syncSupplierInfoFromErp(erpSyncInfoVo,SecurityConstants.INNER);
} }
public void syncMaterialInfoFromErp(String maxErpModifyDate){ public void syncMaterialInfoFromErp(String maxErpModifyDate){
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo(); ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
@ -79,19 +81,25 @@ public class RyTask
remoteJindieService.syncMaterialInfoFromErp(erpSyncInfoVo,SecurityConstants.INNER); 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"); 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"); 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"); System.out.println("++同步ERP中采购订单信息++ErpPurchaseOrder");
remoteJindieService.syncPurchaseOrderFromErp(SecurityConstants.INNER); remoteJindieService.syncPurchaseOrderFromErp(erpSyncInfoVo,SecurityConstants.INNER);
} }
} }

Loading…
Cancel
Save