yun-zuoyi
陈思洁 6 years ago
commit e33c7c2465

@ -0,0 +1,42 @@
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 :
* @Reference :
* @Author : silliter.yuan
* @CreateDate : 2019-05-10 17:16
* @Modify:
**/
@Data
@Entity
@Table(name="ANDON_ALARM_DETAIL_TYPE")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api("安灯子类型")
public class AndonAlarmDetailType extends BaseBean {
@Column(name = "ALARM_DETAIL_CODE")
@ApiParam(value = "安灯类型代码")
private String alarmDetailCode;
@Column(name = "ALARM_DETAIL_NAME")
@ApiParam(value = "安灯类型名称")
private String alarmDetailName;
@Column(name = "ALARM_CODE")
@ApiParam(value = "安灯类型代码")
private String alarmCode;
}

@ -51,4 +51,12 @@ public class AndonAlarmResponseCfg extends BaseBean {
@Column(name = "RP_LEVEL")
@ApiParam(value = "通知级别")
private String rpLevel;
@Column(name = "WORK_CENTER_CODE")
@ApiParam(value = "工作中心代码")
private String workCenterCode;
@Column(name = "WORK_CENTER_NAME_RDD")
@ApiParam(value = "工作中心名称")
private String workCenterNameRdd;
}

@ -22,7 +22,7 @@ import javax.persistence.Table;
**/
@Data
@Entity
@Table(name="ANDON_STOP_LINE_CFG", indexes = {
@Table(name="ANDON_HALT_CFG", indexes = {
@Index(columnList = "WORK_CENTER_CODE", name = "ANDON_INDEX_WORK_CENTER_CODE"),
@Index(columnList = "WORK_CELL_CODE", name = "ANDON_INDEX_WORK_CELL_CODE"),
@Index(columnList = "ORGANIZE_CODE", name = "ANDON_INDEX_ORGANIZE_CODE"),
@ -32,7 +32,7 @@ import javax.persistence.Table;
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api("安灯队列")
public class AndonStopLineConfig extends BaseBean {
public class AndonHaltCfg extends BaseBean {
@Column(name = "ALARM_CODE")
@ApiParam(value = "安灯类型")

@ -245,6 +245,10 @@ public class AndonManageQueue extends BaseBean {
private Double proportion;
@Transient
@ApiParam(value = "当前比例(累加)", example = "0")
private Double currentProportion;
@Transient
@ApiParam(value = "总次数(用于报表统计)", example = "0")
private Integer sumCount;
@ -252,6 +256,33 @@ public class AndonManageQueue extends BaseBean {
@ApiParam(value = "发送标志")
private String sendFlag;
/**
* 10=20=
*/
@Column(name = "DISPOSAL_TYPE")
@ApiParam(value = "处理类型")
private String disposalType;
@Column(name = "ALARM_DETAIL_CODE")
@ApiParam(value = "安灯子类型代码")
private String alarmDetailCode;
@Column(name = "EPM_CODE")
@ApiParam(value = "事件现象代码")
private String epmCode;
@Column(name = "EPM_NAME_RDD")
@ApiParam(value = "事件现象描述")
private String epmNameRdd;
@Column(name = "IMPORTANCE_CODE")
@ApiParam(value = "重要等级代码")
private String importanceCode;
@Column(name = "IMPORTANCE_NAME_RDD")
@ApiParam(value = "重要等级名称")
private String importanceNameRdd;
// 是否转呼
public Integer getIsShiftCall() {
return this.isShiftCall == null ? 0 : this.isShiftCall;

@ -225,6 +225,37 @@ public class AndonManageRecord extends BaseBean {
@ApiParam(value = "停机具体原因")
private String haltDesc;
@Column(name = "SEND_FLAG")
@ApiParam(value = "发送标志")
private String sendFlag;
/**
* 10=20=
*/
@Column(name = "DISPOSAL_TYPE")
@ApiParam(value = "处理类型")
private String disposalType;
@Column(name = "ALARM_DETAIL_CODE")
@ApiParam(value = "安灯子类型代码")
private String alarmDetailCode;
@Column(name = "EPM_CODE")
@ApiParam(value = "事件现象代码")
private String epmCode;
@Column(name = "EPM_NAME_RDD")
@ApiParam(value = "事件现象描述")
private String epmNameRdd;
@Column(name = "IMPORTANCE_CODE")
@ApiParam(value = "重要等级代码")
private String importanceCode;
@Column(name = "IMPORTANCE_NAME_RDD")
@ApiParam(value = "重要等级名称")
private String importanceNameRdd;
// 是否转呼
public Integer getIsShiftCall() {
return this.isShiftCall == null ? 0 : this.isShiftCall;

@ -0,0 +1,16 @@
package cn.estsh.i3plus.pojo.andon.repository;
import cn.estsh.i3plus.pojo.andon.bean.AndonAlarmDetailType;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import org.springframework.stereotype.Repository;
/**
* @Description : ANDON_
* @Reference :
* @Author : sililter.yuan
* @CreateDate : 2019-05-30 11:05
* @Modify:
**/
@Repository
public interface IAndonAlarmDetailTypeRepository extends BaseRepository<AndonAlarmDetailType, Long> {
}

@ -1,6 +1,6 @@
package cn.estsh.i3plus.pojo.andon.repository;
import cn.estsh.i3plus.pojo.andon.bean.AndonStopLineConfig;
import cn.estsh.i3plus.pojo.andon.bean.AndonHaltCfg;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import org.springframework.stereotype.Repository;
@ -12,5 +12,5 @@ import org.springframework.stereotype.Repository;
* @Modify:
**/
@Repository
public interface IAndonStopLineCfgRepository extends BaseRepository<AndonStopLineConfig, Long> {
public interface IAndonHaltCfgRepository extends BaseRepository<AndonHaltCfg, Long> {
}

@ -3,7 +3,6 @@ package cn.estsh.i3plus.pojo.andon.sqlpack;
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.AndonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import org.apache.commons.lang3.StringUtils;
@ -53,6 +52,7 @@ public class AndonHqlPack {
DdlPreparedPack.getStringEqualPack(andonPLC.getChannelName(), "channelName", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getTagName(), "tagName", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getTagAddress(), "tagAddress", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getTagBusinessType(), "tagBusinessType", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getTagType(), "tagType", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getAlarmCode(), "alarmCode", result);
DdlPreparedPack.getStringEqualPack(andonPLC.getGroupNo(), "groupNo", result);
@ -340,8 +340,9 @@ public class AndonHqlPack {
DdlPreparedPack.getStringEqualPack(responseCfg.getAlarmCode(), "alarmCode", result);
DdlPreparedPack.getStringEqualPack(responseCfg.getAndonStatus(), "andonStatus", result);
DdlPreparedPack.getNumNOEqualPack(String.valueOf(AndonEnumUtil.ALARM_PRIORITY.FIRST.getValue()),
"rpLevel", result);
DdlPreparedPack.getStringEqualPack(responseCfg.getRpLevel(), "rpLevel", result);
DdlPreparedPack.getStringEqualPack(responseCfg.getWorkCenterCode(), "workCenterCode", result);
DdlPreparedPack.getStringEqualPack(responseCfg.getRpObjectCode(), "rpObjectCode", result);
getStringBuilderPack(responseCfg, result);
@ -353,7 +354,7 @@ public class AndonHqlPack {
* @param stopLineConfig
* @return
*/
public static DdlPackBean packAndonStopLineCfg(AndonStopLineConfig stopLineConfig) {
public static DdlPackBean packAndonHaltCfg(AndonHaltCfg stopLineConfig) {
DdlPackBean result = new DdlPackBean();
DdlPreparedPack.getStringEqualPack(stopLineConfig.getAlarmCode(), "alarmCode", result);
@ -364,4 +365,20 @@ public class AndonHqlPack {
return result;
}
/**
*
* @param andonAlarmDetailType
* @return
*/
public static DdlPackBean packAndonAlarmDetailType(AndonAlarmDetailType andonAlarmDetailType) {
DdlPackBean result = new DdlPackBean();
DdlPreparedPack.getStringEqualPack(andonAlarmDetailType.getAlarmCode(), "alarmCode", result);
DdlPreparedPack.getStringEqualPack(andonAlarmDetailType.getAlarmDetailCode(), "alarmDetailCode", result);
getStringBuilderPack(andonAlarmDetailType, result);
return result;
}
}

@ -1,6 +1,7 @@
package cn.estsh.i3plus.pojo.base.enumutil;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.StringUtils;
/**
* @Description :
@ -57,7 +58,8 @@ public class AndonEnumUtil {
ALARM_FLAG("10","安灯呼叫标识"),
USER_CODE("20","用户工号"),
READ_FLAG("30", "安灯读取状态"),
STOP_FLAG("40", "停线状态");
STOP_FLAG("40", "停线状态"),
DETAIL_TYPE("50", "安灯子类型");
private String value;
private String description;
@ -214,6 +216,16 @@ public class AndonEnumUtil {
public String getDescription() {
return description;
}
public static String valueOfDescription(String val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (StringUtils.equalsIgnoreCase(values()[i].value, val)) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
@ -253,4 +265,31 @@ public class AndonEnumUtil {
return tmp;
}
}
/**
* 线
* 1-线0-线
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum STOP_LINE_FLAG{
STOP("1","停止产线"),
RESTART("0","启动产线");
private String value;
private String description;
STOP_LINE_FLAG(String value, String description) {
this.value = value;
this.description = description;
}
public String getValue() {
return value;
}
public String getDescription() {
return description;
}
}
}

@ -681,4 +681,33 @@ public class MesEnumUtil {
return tmp;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum COMMON_SN {
QUEUE_SN("QUEUE_SN", "队列条码");
private String code;
private String description;
int value;
COMMON_SN(String code, String description) {
this.code = code;
this.description = description;
}
public int getValue() {
return value;
}
public String getCode() {
return code;
}
public String getDescription() {
return description;
}
}
}

@ -1415,12 +1415,7 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
Query query = entityManager.createQuery(sb.toString());
setParameter(query,paramName,paramValue);
double sumResult = 0.0;
List<?> objList = query.getResultList();
if(objList.size() > 0){
sumResult = Double.parseDouble(objList.iterator().next().toString());
}
return sumResult;
return getNumberByResultList(query.getResultList());
}else{
throw new IllegalArgumentException("sum查询错误!paramName:" + paramName + ",paramValue:" + paramValue);
}
@ -1444,12 +1439,7 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
Query query = entityManager.createQuery(sb.toString());
setParameter(query,paramName,paramValue);
double sumResult = 0.0;
List<?> objList = query.getResultList();
if(objList.size() > 0){
sumResult = Double.parseDouble(objList.iterator().next().toString());
}
return sumResult;
return getNumberByResultList(query.getResultList());
}else{
throw new IllegalArgumentException("sum查询错误!paramName:" + paramName + ",paramValue:" + paramValue);
}
@ -1472,12 +1462,7 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
Query query = entityManager.createQuery(sb.toString());
setParameter(query,paramName,paramValue);
double sumResult = 0.0;
List<?> objList = query.getResultList();
if(objList.size() > 0){
sumResult = Double.parseDouble(objList.iterator().next().toString());
}
return sumResult;
return getNumberByResultList(query.getResultList());
}else{
throw new IllegalArgumentException("sum查询错误!paramName:" + paramName + ",paramValue:" + paramValue);
}
@ -1501,14 +1486,24 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
Query query = entityManager.createQuery(sb.toString());
setParameter(query,paramName,paramValue);
double sumResult = 0.0;
List<?> objList = query.getResultList();
if(objList.size() > 0){
sumResult = Double.parseDouble(objList.iterator().next().toString());
}
return sumResult;
return getNumberByResultList(query.getResultList());
}else{
throw new IllegalArgumentException("sum查询错误!paramName:" + paramName + ",paramValue:" + paramValue);
}
}
//从结果集中获取数字转换
public double getNumberByResultList(List objList){
double num = 0.0;
if(objList != null && objList.size() > 0){
if(objList.get(0) != null){
try {
num = Double.parseDouble(objList.get(0).toString());
}catch(NumberFormatException ne){
LOGGER.error("数字转换出错!",ne);
}
}
}
return num;
}
}

@ -45,7 +45,7 @@ public class BfElementPropertyVirtual extends BaseBean {
private Long dataObjectId;
@Column(name="PROPERTY_CODE")
@ApiParam(value ="类属性名称")
@ApiParam(value ="类属性代码")
private String propertyCode;
@Column(name="PROPERTY_NAME")

@ -156,7 +156,7 @@ public class SwebHqlPack {
DdlPreparedPack.getStringEqualPack(details.getOrderNo(), "orderNo", result);
DdlPreparedPack.getStringEqualPack(details.getVendorCode(), "vendorCode", result);
DdlPreparedPack.getNumEqualPack(details.getOrderType(), "orderType", result);
DdlPreparedPack.getNumEqualPack(SwebEnumUtil.ORDER_DETAILS_STATUS.CREATE.getValue(), "itemStatus", result);
// DdlPreparedPack.getNumEqualPack(SwebEnumUtil.ORDER_DETAILS_STATUS.CREATE.getValue(), "itemStatus", result);
return buildHql(details, result);
}

@ -170,10 +170,25 @@ public class WmsHqlPack {
/**
* 线
* @param wmsRoutingDetail
* @return
*/
public static DdlPackBean packHqlWmsRoutingDetail(WmsRoutingDetail wmsRoutingDetail) {
DdlPackBean result = new DdlPackBean();
DdlPreparedPack.getStringEqualPack(wmsRoutingDetail.getRoutingCode(), "routingCode", result);
getStringBuilderPack(wmsRoutingDetail, result);
return result;
}
/**
* 线
*
* @param routingCode
* @return
*/
@Deprecated
public static DdlPackBean packHqlWmsRoutingChildren(String routingCode) {
DdlPackBean result = new DdlPackBean();
@ -184,6 +199,19 @@ public class WmsHqlPack {
return result;
}
/**
* 线
* @param wmsRoutingAssign
* @return
*/
public static DdlPackBean packHqlWmsRoutingAssign(WmsRoutingAssign wmsRoutingAssign) {
DdlPackBean result = new DdlPackBean();
DdlPreparedPack.getStringEqualPack(wmsRoutingAssign.getRoutingCode(), "routingCode", result);
getStringBuilderPack(wmsRoutingAssign, result);
return result;
}
/**
* 线
@ -1555,7 +1583,7 @@ public class WmsHqlPack {
*/
public static DdlPackBean packEngineScriptPersistence(EngineScriptPersistence scriptPersistence) {
DdlPackBean packBean = new DdlPackBean();
DdlPreparedPack.getStringEqualPack(scriptPersistence.getScriptNo(), "scriptNo", packBean);
DdlPreparedPack.getStringLikerPack(scriptPersistence.getScriptNo(), "scriptNo", packBean);
DdlPreparedPack.getStringRightLikerPack(scriptPersistence.getScriptName(), "scriptName", packBean);
DdlPreparedPack.getNumEqualPack(scriptPersistence.getScriptType(), "scriptType", packBean);
DdlPreparedPack.getNumEqualPack(scriptPersistence.getLanguageType(), "languageType", packBean);

Loading…
Cancel
Save