|
|
|
@ -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,133 +39,174 @@ 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(){
|
|
|
|
|
|
|
|
|
|
public void deviceOfflineTimingTask() {
|
|
|
|
|
System.out.println("++设备离线告警+开始++deviceOfflineTimingTask+++++");
|
|
|
|
|
remoteEmsService.deviceOfflineTimingTask(SecurityConstants.INNER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void thresholdTimingTask(){
|
|
|
|
|
public void thresholdTimingTask() {
|
|
|
|
|
System.out.println("++计量设备阈值告警+开始++thresholdTimingTask+++++");
|
|
|
|
|
remoteEmsService.thresholdTimingTask(SecurityConstants.INNER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void dnthAlarmTask(){
|
|
|
|
|
public void dnthAlarmTask() {
|
|
|
|
|
System.out.println("++能源报警任务+开始++thresholdTimingTask+++++");
|
|
|
|
|
remoteEmsService.dnthAlarmTask(SecurityConstants.INNER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getDnbInstantByJob(){
|
|
|
|
|
public void getDnbInstantByJob() {
|
|
|
|
|
System.out.println("++电整点数据获取+开始++getDnbInstantByJob+++++");
|
|
|
|
|
remoteEmsService.getDnbInstantByJob(SecurityConstants.INNER);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public void getDmsRepairInstance(String planRepairId){
|
|
|
|
|
|
|
|
|
|
public void getDmsRepairInstance(String planRepairId) {
|
|
|
|
|
System.out.println("++创建检修工单++getDmsRepairInstance");
|
|
|
|
|
remoteDmsService.getDmsRepairInstance(SecurityConstants.INNER, planRepairId);
|
|
|
|
|
}
|
|
|
|
|
public void getDmsBillsInstance(String dmsBillsInstanceId){
|
|
|
|
|
|
|
|
|
|
public void getDmsBillsInstance(String dmsBillsInstanceId) {
|
|
|
|
|
System.out.println("++创建巡检工单++getDmsRepairInstance");
|
|
|
|
|
remoteDmsService.getDmsBillsInstance(SecurityConstants.INNER, dmsBillsInstanceId);
|
|
|
|
|
}
|
|
|
|
|
public void getDmsBillsLube(String planLubeCode){
|
|
|
|
|
|
|
|
|
|
public void getDmsBillsLube(String planLubeCode) {
|
|
|
|
|
System.out.println("++创建润滑工单++getDmsLubeInstance");
|
|
|
|
|
remoteDmsService.getDmsBillsLube(SecurityConstants.INNER, planLubeCode);
|
|
|
|
|
}
|
|
|
|
|
public void getDmsBillsMaint(String planMaintCode){
|
|
|
|
|
|
|
|
|
|
public void getDmsBillsMaint(String planMaintCode) {
|
|
|
|
|
System.out.println("++创建保养工单++getDmsMaintInstance");
|
|
|
|
|
remoteDmsService.getDmsBillsMaintInstance(SecurityConstants.INNER,planMaintCode);
|
|
|
|
|
remoteDmsService.getDmsBillsMaintInstance(SecurityConstants.INNER, planMaintCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void syncUnitInfoFromErp(String maxErpModifyDate){
|
|
|
|
|
public void syncUnitInfoFromErp(String maxErpModifyDate) {
|
|
|
|
|
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){
|
|
|
|
|
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){
|
|
|
|
|
|
|
|
|
|
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){
|
|
|
|
|
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){
|
|
|
|
|
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){
|
|
|
|
|
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){
|
|
|
|
|
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);
|
|
|
|
|
public void syncInventoryInformationToERP() {
|
|
|
|
|
System.out.println(new Date() + "++定时同步原材料入库信息给ERP++syncInventoryInformationToERP");
|
|
|
|
|
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);
|
|
|
|
|
public void syncRawMaterialDeliveryInformationToERP() {
|
|
|
|
|
System.out.println(new Date() + "++定时同步原材料出库信息给ERP++syncRawMaterialDeliveryInformationToERP");
|
|
|
|
|
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);
|
|
|
|
|
public void synchronizeRawReturnInformationToERP() {
|
|
|
|
|
System.out.println(new Date() + "++定时同步原材料退库信息给ERP++syncRawMaterialDeliveryInformationToERP");
|
|
|
|
|
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);
|
|
|
|
|
public void synchronizeProductInstockInformationToERP(Integer days) {
|
|
|
|
|
System.out.println(new Date() + "++定时同步成品入库信息给ERP++synchronizeProductInstockInformationToERP");
|
|
|
|
|
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);
|
|
|
|
|
public void synchronizeProductOutstockInformationToERP(Integer days) {
|
|
|
|
|
System.out.println(new Date() + "++定时同步成品出库信息给ERP++synchronizeProductOutstockInformationToERP");
|
|
|
|
|
R<AjaxResult> resultR = remoteWmsService.synchronizeProductOutstockInformationToERP(days, SecurityConstants.INNER);
|
|
|
|
|
if (resultR.getCode() == 500) {
|
|
|
|
|
throw new ServiceException("同步物料失败:"+resultR.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getDmsAlarmNotificationScheduledTask(){
|
|
|
|
|
public void getDmsAlarmNotificationScheduledTask() {
|
|
|
|
|
System.out.println("++设备报警通知定时任务++getDmsAlarmNotificationScheduledTask");
|
|
|
|
|
remoteDmsService.getDmsAlarmNotificationScheduledTask(SecurityConstants.INNER);
|
|
|
|
|
}
|
|
|
|
@ -171,20 +214,21 @@ public class RyTask
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 物料自动出库
|
|
|
|
|
*
|
|
|
|
|
* @param dateStr
|
|
|
|
|
*/
|
|
|
|
|
public void autoOutstock(String dateStr){
|
|
|
|
|
public void autoOutstock(String dateStr) {
|
|
|
|
|
if (StringUtils.isEmpty(dateStr)) {
|
|
|
|
|
dateStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, new Date());
|
|
|
|
|
}
|
|
|
|
|
remoteMesService.autoOutstockLastPurchaseOrders(dateStr,SecurityConstants.INNER);
|
|
|
|
|
remoteMesService.autoOutstockLastPurchaseOrders(dateStr, SecurityConstants.INNER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 定时根据完成的工单明细生成完成记录
|
|
|
|
|
*/
|
|
|
|
|
public void generateProduceStatisticsDetail(){
|
|
|
|
|
public void generateProduceStatisticsDetail() {
|
|
|
|
|
remoteMesService.generateProduceStatisticsDetail(SecurityConstants.INNER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -192,28 +236,28 @@ public class RyTask
|
|
|
|
|
/**
|
|
|
|
|
* 根据syspointrouter获取流程节点权限用户,发送邮件
|
|
|
|
|
*/
|
|
|
|
|
public void processActivityEmailNotify(){
|
|
|
|
|
public void processActivityEmailNotify() {
|
|
|
|
|
remoteSysCommonService.processActivityEmailNotify(SecurityConstants.INNER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 销售订单交货超时
|
|
|
|
|
*/
|
|
|
|
|
public void saleOrderOverTimeAlarm(){
|
|
|
|
|
public void saleOrderOverTimeAlarm() {
|
|
|
|
|
remoteMesService.saleOrderOverTimeAlarm(SecurityConstants.INNER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 采购订单交货超时
|
|
|
|
|
*/
|
|
|
|
|
public void purchaseOrderOverTimeAlarm(){
|
|
|
|
|
public void purchaseOrderOverTimeAlarm() {
|
|
|
|
|
remoteMesService.purchaseOrderOverTimeAlarm(SecurityConstants.INNER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 物料库存预警
|
|
|
|
|
*/
|
|
|
|
|
public void stockAlarm(){
|
|
|
|
|
public void stockAlarm() {
|
|
|
|
|
remoteMesService.stockAlarm(SecurityConstants.INNER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|