yun-zuoyi
yiming.gu 6 years ago
commit 494fc4aa70

@ -39,4 +39,8 @@ public class AndonAlarmCause extends BaseBean {
@Column(name = "PARENT_AC_CODE")
@ApiParam(value = "父阶原因代码")
private String parentAcCode;
@Column(name = "ALARM_CODE")
@ApiParam(value = "安灯类型")
private String alarmCode;
}

@ -39,4 +39,8 @@ public class AndonEventCause extends BaseBean {
@Column(name = "PARENT_EC_CODE")
@ApiParam(value = "父阶原因代码")
private String parentEcCode;
@Column(name = "ALARM_CODE")
@ApiParam(value = "安灯类型")
private String alarmCode;
}

@ -0,0 +1,46 @@
package cn.estsh.i3plus.pojo.andon.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Description : ANDON_
* @Reference :
* @Author : hansen.ke
* @CreateDate : 2019-05-13 17:16
* @Modify:
**/
@Data
@Entity
@Table(name="ANDON_EVENT_METHOD")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api("ANDON_事件处理方法")
public class AndonEventMethod extends BaseBean {
@Column(name = "EM_CODE")
@ApiParam(value = "事件方法代码")
private String emCode;
@Column(name = "EM_NAME")
@ApiParam(value = "事件方法描述")
private String emName;
@Column(name = "PARENT_EM_CODE")
@ApiParam(value = "父阶方法代码")
private String parentEmCode;
@Column(name = "ALARM_CODE")
@ApiParam(value = "安灯类型")
private String alarmCode;
}

@ -71,4 +71,16 @@ public class AndonPLC extends BaseBean {
@Column(name = "GROUP_NO")
@ApiParam(value = "分组号")
private String groupNo;
@Column(name = "ALARM_CODE")
@ApiParam(value = "安灯类型代码")
private String alarmCode;
@Column(name = "TAG_BUSINESS_TYPE")
@ApiParam(value = "标签业务类型")
private String tagBusinessType;
@Column(name = "IS_ALARM_STATUS")
@ApiParam(value = "是否按灯状态", example = "1")
private Integer isAlarmStatus;
}

@ -28,6 +28,11 @@ import javax.persistence.Table;
@Table(name="MES_SHIFT")
@Api("班次信息")
public class MesShift extends BaseBean {
@Column(name = "WORK_CENTER_CODE")
@ApiParam("工作中心")
private String workCenterCode;
@Column(name="SHIFT_CODE")
@ApiParam("班次代码")
private String shiftCode;
@ -43,4 +48,12 @@ public class MesShift extends BaseBean {
@Column(name="WORK_TIMES")
@ApiParam("作业时长")
private String workTimes;
public MesShift() {
}
public MesShift(String workCenterCode,String organizeCode) {
this.workCenterCode = workCenterCode;
this.organizeCode = organizeCode;
}
}

@ -12,5 +12,5 @@ import org.springframework.stereotype.Repository;
* @Modify:
**/
@Repository
public interface IAndonManagetQueueRepository extends BaseRepository<AndonManageQueue,Long> {
public interface IAndonManageQueueRepository extends BaseRepository<AndonManageQueue,Long> {
}

@ -12,5 +12,5 @@ import org.springframework.stereotype.Repository;
* @Modify:
**/
@Repository
public interface IAndonManagetRecordRepository extends BaseRepository<AndonManageRecord,Long> {
public interface IAndonManageRecordRepository extends BaseRepository<AndonManageRecord,Long> {
}

@ -1,7 +1,13 @@
package cn.estsh.i3plus.pojo.andon.sqlpack;
import cn.estsh.i3plus.pojo.andon.bean.MesWorkCell;
import cn.estsh.i3plus.pojo.andon.bean.MesWorkCenter;
import cn.estsh.i3plus.pojo.andon.bean.AndonPLC;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import org.apache.commons.lang3.StringUtils;
import cn.estsh.i3plus.pojo.andon.bean.*;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
@ -38,6 +44,29 @@ public class AndonHqlPack {
}
/**
* PLC
*
* @param andonPLC plc
* @return
*/
public static DdlPackBean packHqlAndonPLCInfo(AndonPLC andonPLC) {
DdlPackBean result = new DdlPackBean();
//查询参数封装
DdlPreparedPack.getStringEqualPack(andonPLC.getWorkCellCode(), "workCenterCode", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getWorkCellCode(), "workCellCode", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getNodeIP(), "nodeIP", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getChannelName(), "channelName", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getTagName(), "tagName", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getTagAddress(), "tagAddress", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getTagType(), "tagType", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getAlarmCode(), "alarmCode", result);
getStringBuilderPack(andonPLC, result);
return result;
}
/**
*
* @param mesWorkCenter
* @return
@ -63,4 +92,78 @@ public class AndonHqlPack {
return result;
}
/**
*
* @param mesEquipment
* @return
*/
public static DdlPackBean packHqlMesEquipment(MesEquipment mesEquipment){
DdlPackBean result = new DdlPackBean();
DdlPreparedPack.getStringEqualPack(mesEquipment.getWorkCenterCode(), "workCenterCode", result);
DdlPreparedPack.getStringEqualPack(mesEquipment.getWorkCellCode(), "workCellCode", result);
getStringBuilderPack(mesEquipment, result);
return result;
}
/**
*
* @param mesShift
* @return
*/
public static DdlPackBean packHqlMesShift(MesShift mesShift){
DdlPackBean result = new DdlPackBean();
DdlPreparedPack.getStringEqualPack(mesShift.getWorkCenterCode(), "workCenterCode", result);
getStringBuilderPack(mesShift, result);
return result;
}
/**
* ANDON
* @param andonAlarmCause
* @return
*/
public static DdlPackBean packHqlAndonAlarmCause(AndonAlarmCause andonAlarmCause){
DdlPackBean result = new DdlPackBean();
DdlPreparedPack.getStringEqualPack(andonAlarmCause.getAlarmCode(), "alarmCode", result);
getStringBuilderPack(andonAlarmCause, result);
return result;
}
/**
* ANDON
* @param andonEventCause
* @return
*/
public static DdlPackBean packHqlAndonEventCause(AndonEventCause andonEventCause){
DdlPackBean result = new DdlPackBean();
DdlPreparedPack.getStringEqualPack(andonEventCause.getAlarmCode(), "alarmCode", result);
getStringBuilderPack(andonEventCause, result);
return result;
}
/**
*
* @param andonManageQueue
* @return
*/
public static DdlPackBean packHqlAndonManageQueue(AndonManageQueue andonManageQueue){
DdlPackBean result = new DdlPackBean();
DdlPreparedPack.getStringEqualPack(andonManageQueue.getWorkCellCode(), "workCellCode", result);
DdlPreparedPack.getStringEqualPack(andonManageQueue.getWorkCenterCode(), "workCenterCode", result);
DdlPreparedPack.getStringEqualPack(andonManageQueue.getEquipmentCode(), "equipmentCode", result);
DdlPreparedPack.getStringEqualPack(andonManageQueue.getAlarmCode(), "alarmCode", result);
getStringBuilderPack(andonManageQueue, result);
return result;
}
}

@ -0,0 +1,150 @@
package cn.estsh.i3plus.pojo.base.enumutil;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* @Description :
* @Reference :
* @Author : silliter
* @CreateDate : 2019-05-13 15:53
* @Modify:
**/
public class AndonEnumUtil {
/**
*
* 10-20-
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum IS_ALARM_STATUS{
YES(10,"需要按灯"),
ON(20,"不需要按灯");
private int value;
private String description;
IS_ALARM_STATUS(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
*
* =10 =20 =30
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ALARM_BUSI_FLAG{
ALARM_FLAG("10","按灯状态"),
USER_CODE("20","工号"),
READ_FLAG("30", "读取状态");
private String value;
private String description;
ALARM_BUSI_FLAG(String value, String description) {
this.value = value;
this.description = description;
}
public String getValue() {
return value;
}
public String getDescription() {
return description;
}
}
/**
*
* 1-2-3-
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ALARM_FLAG{
CALL(1,"10","呼叫"),
SIGN(2,"20","签到"),
RESOLVE(3,"30","解决"),
CANCEL(4,"40", "撤销");
private int value;
private String code;
private String description;
ALARM_FLAG(int value,String code, String description) {
this.value = value;
this.code = code;
this.description = description;
}
public int getValue() {
return value;
}
public String getCode(){ return code; }
public String getDescription() {
return description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
*
* =10 =20 =3040-50-
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ANDON_ACTION_FLAG{
CALL_ACTION("10","呼叫动作"),
SIGN_ACTION("20","签到动作"),
CANCEL_ACTION("30", "撤销动作"),
RESOLVE_ACTION("40", "解决动作"),
SHIFG_CALL_ACTION("50", "转呼动作");
private String value;
private String description;
ANDON_ACTION_FLAG(String value, String description) {
this.value = value;
this.description = description;
}
public String getValue() {
return value;
}
public String getDescription() {
return description;
}
}
}

@ -0,0 +1,32 @@
package cn.estsh.i3plus.pojo.model.andon;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@Data
public class AndonOpcModel {
/**
* localhost
*/
@ApiParam("opcserver地址-ip")
private String host;
/**
* opcserver
*/
@ApiParam("opcserver名称")
private String serverProgId;
/**
* channel
*/
@ApiParam("第一层路径")
private String accessPath;
/**
* device.tag
*/
@ApiParam("剩余路径名称")
private String itemName;
}

@ -0,0 +1,30 @@
package cn.estsh.i3plus.pojo.model.andon;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@Data
public class AndonResultBean {
@ApiParam("是否成功")
private boolean success;
@ApiParam("处理信息")
private String msg;
@ApiParam("处理结果")
private String result;
public AndonResultBean(boolean success, String msg) {
super();
this.success = success;
this.msg = msg;
}
public AndonResultBean(boolean success, String msg, String result) {
super();
this.success = success;
this.msg = msg;
this.result = result;
}
}
Loading…
Cancel
Save