|
|
|
@ -1,7 +1,10 @@
|
|
|
|
|
package com.hw.job.task;
|
|
|
|
|
|
|
|
|
|
import com.hw.common.core.constant.SecurityConstants;
|
|
|
|
|
import com.hw.common.core.domain.R;
|
|
|
|
|
import com.hw.common.core.exception.ServiceException;
|
|
|
|
|
import com.hw.common.core.utils.DateUtils;
|
|
|
|
|
import com.hw.common.core.web.domain.AjaxResult;
|
|
|
|
|
import com.hw.dms.api.RemoteDmsService;
|
|
|
|
|
import com.hw.ems.api.RemoteEmsService;
|
|
|
|
|
import com.hw.jindie.api.RemoteJindieService;
|
|
|
|
@ -22,8 +25,7 @@ import java.util.Date;
|
|
|
|
|
* @author ruoyi
|
|
|
|
|
*/
|
|
|
|
|
@Component("ryTask")
|
|
|
|
|
public class RyTask
|
|
|
|
|
{
|
|
|
|
|
public class RyTask {
|
|
|
|
|
@Autowired
|
|
|
|
|
private RemoteEmsService remoteEmsService;
|
|
|
|
|
@Autowired
|
|
|
|
@ -37,20 +39,18 @@ public class RyTask
|
|
|
|
|
@Autowired
|
|
|
|
|
private RemoteSysCommonService remoteSysCommonService;
|
|
|
|
|
|
|
|
|
|
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
|
|
|
|
|
{
|
|
|
|
|
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
|
|
|
|
|
System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ryParams(String params)
|
|
|
|
|
{
|
|
|
|
|
public void ryParams(String params) {
|
|
|
|
|
System.out.println("执行有参方法:" + params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ryNoParams()
|
|
|
|
|
{
|
|
|
|
|
public void ryNoParams() {
|
|
|
|
|
System.out.println("执行无参方法");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void deviceOfflineTimingTask() {
|
|
|
|
|
System.out.println("++设备离线告警+开始++deviceOfflineTimingTask+++++");
|
|
|
|
|
remoteEmsService.deviceOfflineTimingTask(SecurityConstants.INNER);
|
|
|
|
@ -71,18 +71,22 @@ public class RyTask
|
|
|
|
|
remoteEmsService.getDnbInstantByJob(SecurityConstants.INNER);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getDmsRepairInstance(String planRepairId) {
|
|
|
|
|
System.out.println("++创建检修工单++getDmsRepairInstance");
|
|
|
|
|
remoteDmsService.getDmsRepairInstance(SecurityConstants.INNER, planRepairId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getDmsBillsInstance(String dmsBillsInstanceId) {
|
|
|
|
|
System.out.println("++创建巡检工单++getDmsRepairInstance");
|
|
|
|
|
remoteDmsService.getDmsBillsInstance(SecurityConstants.INNER, dmsBillsInstanceId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getDmsBillsLube(String planLubeCode) {
|
|
|
|
|
System.out.println("++创建润滑工单++getDmsLubeInstance");
|
|
|
|
|
remoteDmsService.getDmsBillsLube(SecurityConstants.INNER, planLubeCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getDmsBillsMaint(String planMaintCode) {
|
|
|
|
|
System.out.println("++创建保养工单++getDmsMaintInstance");
|
|
|
|
|
remoteDmsService.getDmsBillsMaintInstance(SecurityConstants.INNER, planMaintCode);
|
|
|
|
@ -92,75 +96,114 @@ public class RyTask
|
|
|
|
|
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
|
|
|
|
|
erpSyncInfoVo.setMaxErpModifyDate(maxErpModifyDate);
|
|
|
|
|
System.out.println("++同步ERP中物料供应商++ErpSupplierInfo");
|
|
|
|
|
remoteJindieService.syncUnitInfoFromErp(erpSyncInfoVo,SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR = remoteJindieService.syncUnitInfoFromErp(erpSyncInfoVo, SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void syncSupplierInfoFromErp(String maxErpModifyDate) {
|
|
|
|
|
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
|
|
|
|
|
erpSyncInfoVo.setMaxErpModifyDate(maxErpModifyDate);
|
|
|
|
|
System.out.println("++同步ERP中物料供应商++ErpSupplierInfo");
|
|
|
|
|
remoteJindieService.syncSupplierInfoFromErp(erpSyncInfoVo,SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR = remoteJindieService.syncSupplierInfoFromErp(erpSyncInfoVo, SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void syncMaterialInfoFromErp(String maxErpModifyDate) {
|
|
|
|
|
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
|
|
|
|
|
erpSyncInfoVo.setMaxErpModifyDate(maxErpModifyDate);
|
|
|
|
|
System.out.println("++同步ERP中物料信息++ErpMesMaterialInfo");
|
|
|
|
|
remoteJindieService.syncMaterialInfoFromErp(erpSyncInfoVo,SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR = remoteJindieService.syncMaterialInfoFromErp(erpSyncInfoVo, SecurityConstants.INNER);
|
|
|
|
|
System.out.println("r"+resultR.getCode()+"=="+resultR.getData()+"--"+resultR.getMsg());
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void syncProjectInfoFromErp(String maxErpModifyDate) {
|
|
|
|
|
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
|
|
|
|
|
erpSyncInfoVo.setMaxErpModifyDate(maxErpModifyDate);
|
|
|
|
|
System.out.println("++同步ERP中项目信息++ErpProjectInfo");
|
|
|
|
|
remoteJindieService.syncProjectInfoFromErp(erpSyncInfoVo,SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR = remoteJindieService.syncProjectInfoFromErp(erpSyncInfoVo, SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void syncSaleOrderFromErp(String maxErpModifyDate) {
|
|
|
|
|
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
|
|
|
|
|
erpSyncInfoVo.setMaxErpModifyDate(maxErpModifyDate);
|
|
|
|
|
System.out.println("++同步ERP中销售订单信息++ErpSaleOrder");
|
|
|
|
|
remoteJindieService.syncSaleOrderFromErp(erpSyncInfoVo,SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR =remoteJindieService.syncSaleOrderFromErp(erpSyncInfoVo, SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void syncPurchaseOrderFromErp(String maxErpModifyDate) {
|
|
|
|
|
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
|
|
|
|
|
erpSyncInfoVo.setMaxErpModifyDate(maxErpModifyDate);
|
|
|
|
|
System.out.println("++同步ERP中采购订单信息++syncPurchaseOrderFromErp");
|
|
|
|
|
remoteJindieService.syncPurchaseOrderFromErp(erpSyncInfoVo,SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR =remoteJindieService.syncPurchaseOrderFromErp(erpSyncInfoVo, SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void syncPurchaseReceiveBillFromErp(String maxErpModifyDate) {
|
|
|
|
|
ErpSyncInfoVo erpSyncInfoVo = new ErpSyncInfoVo();
|
|
|
|
|
erpSyncInfoVo.setMaxErpModifyDate(maxErpModifyDate);
|
|
|
|
|
System.out.println("++同步ERP中收料通知单信息++syncPurchaseReceiveBillFromErp");
|
|
|
|
|
remoteJindieService.syncPurchaseReceiveBillFromErp(erpSyncInfoVo,SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR =remoteJindieService.syncPurchaseReceiveBillFromErp(erpSyncInfoVo, SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void syncInventoryInformationToERP() {
|
|
|
|
|
System.out.println(new Date() + "++定时同步原材料入库信息给ERP++syncInventoryInformationToERP");
|
|
|
|
|
remoteWmsService.synchronizeInventoryInformationToERP(SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR = remoteWmsService.synchronizeInventoryInformationToERP(SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void syncRawMaterialDeliveryInformationToERP() {
|
|
|
|
|
System.out.println(new Date() + "++定时同步原材料出库信息给ERP++syncRawMaterialDeliveryInformationToERP");
|
|
|
|
|
remoteWmsService.synchronizeRawMaterialDeliveryInformationToERP(SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR = remoteWmsService.synchronizeRawMaterialDeliveryInformationToERP(SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void synchronizeRawReturnInformationToERP() {
|
|
|
|
|
System.out.println(new Date() + "++定时同步原材料退库信息给ERP++syncRawMaterialDeliveryInformationToERP");
|
|
|
|
|
remoteWmsService.synchronizeRawReturnInformationToERP(SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR = remoteWmsService.synchronizeRawReturnInformationToERP(SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void synchronizeProductInstockInformationToERP(Integer days) {
|
|
|
|
|
System.out.println(new Date() + "++定时同步成品入库信息给ERP++synchronizeProductInstockInformationToERP");
|
|
|
|
|
remoteWmsService.synchronizeProductInstockInformationToERP(days, SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR =remoteWmsService.synchronizeProductInstockInformationToERP(days, SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void synchronizeProductOutstockInformationToERP(Integer days) {
|
|
|
|
|
System.out.println(new Date() + "++定时同步成品出库信息给ERP++synchronizeProductOutstockInformationToERP");
|
|
|
|
|
remoteWmsService.synchronizeProductOutstockInformationToERP(days, SecurityConstants.INNER);
|
|
|
|
|
R<AjaxResult> resultR = remoteWmsService.synchronizeProductOutstockInformationToERP(days, SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getDmsAlarmNotificationScheduledTask() {
|
|
|
|
@ -171,6 +214,7 @@ public class RyTask
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 物料自动出库
|
|
|
|
|
*
|
|
|
|
|
* @param dateStr
|
|
|
|
|
*/
|
|
|
|
|
public void autoOutstock(String dateStr) {
|
|
|
|
|