forked from I3-YF/i3plus-mes-pcn-yfai
工步开发
parent
ba951ff29f
commit
1401cd8734
@ -0,0 +1,18 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.api.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.ActorMessage;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentVariable;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentVariableCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface IMesEquipmentLogService {
|
||||||
|
|
||||||
|
void saveEquipmentLogToRedis(ActorMessage actorMessage);
|
||||||
|
|
||||||
|
|
||||||
|
void saveEquipmentLogDetails();
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.schedulejob;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesEquipmentLogService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.quartz.DisallowConcurrentExecution;
|
||||||
|
import org.quartz.Job;
|
||||||
|
import org.quartz.JobExecutionContext;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangjie
|
||||||
|
* @version 1.0
|
||||||
|
* @date 2021/2/2 16:44
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@DisallowConcurrentExecution
|
||||||
|
@ApiOperation("保存工艺参数job")
|
||||||
|
public class MesSaveVariableJob implements Job {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesEquipmentLogService mesEquipmentLogService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(JobExecutionContext jobExecutionContext) {
|
||||||
|
|
||||||
|
log.info("保存工艺参数job -- START ");
|
||||||
|
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
mesEquipmentLogService.saveEquipmentLogDetails();
|
||||||
|
|
||||||
|
long endTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
log.info("保存工艺参数job --- END --- 耗时: {} ms", endTime - startTime);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.actor;
|
||||||
|
|
||||||
|
import akka.actor.AbstractActor;
|
||||||
|
import akka.actor.UntypedAbstractActor;
|
||||||
|
import akka.japi.pf.ReceiveBuilder;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesEquipmentLogService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.ActorMessage;
|
||||||
|
import cn.estsh.i3plus.mes.pcn.actor.shipping.dispatch.FsmRouteDataService;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Scope;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Scope("prototype")
|
||||||
|
public class MesHandlerEquipLogActor extends AbstractActor {
|
||||||
|
//定义日志,很重要
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(MesHandlerEquipLogActor.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesEquipmentLogService mesEquipmentLogService;
|
||||||
|
/**
|
||||||
|
* <p>重写接收方法</p>
|
||||||
|
* @author hanchao 2018/4/16 21:31
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public Receive createReceive() {
|
||||||
|
|
||||||
|
return ReceiveBuilder.create().match(ActorMessage.class, o -> {
|
||||||
|
|
||||||
|
mesEquipmentLogService.saveEquipmentLogToRedis(o);
|
||||||
|
|
||||||
|
}).matchAny(o -> log.error("FiniteStateMachineActor--收到的意外的消息{}", o)).build();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class ActorMessage {
|
||||||
|
|
||||||
|
@ApiParam("用户名称")
|
||||||
|
private String userName;
|
||||||
|
@ApiParam("组织代码")
|
||||||
|
private String organizeCode;
|
||||||
|
@ApiParam("组织名称")
|
||||||
|
private String organizeName;
|
||||||
|
@ApiParam("工作中心代码")
|
||||||
|
private String workCenterCode;
|
||||||
|
@ApiParam("工作单元代码")
|
||||||
|
private String workCellCode;
|
||||||
|
|
||||||
|
private String areaCode;
|
||||||
|
|
||||||
|
private String craftCode;
|
||||||
|
|
||||||
|
private String processCode;
|
||||||
|
|
||||||
|
private String produceSnJson;
|
||||||
|
|
||||||
|
private String equipmentCode;
|
||||||
|
|
||||||
|
private Integer equipId;
|
||||||
|
}
|
Loading…
Reference in New Issue