diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/AndonEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/AndonEnumUtil.java index 6b6c9ad..431a96d 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/AndonEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/AndonEnumUtil.java @@ -456,6 +456,50 @@ public class AndonEnumUtil { return tmp; } } + /** + * 安灯操作动作来源 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum ALARM_OPERATION_SOURCE{ + PHYSICAL("10","物理操作"), + SOFT("20","软件操作"); + + private String value; + private String description; + + ALARM_OPERATION_SOURCE(String value, String description) { + this.value = value; + this.description = description; + } + + public String getValue() { + return value; + } + + 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; + } + + public static String descriptionOfValue(String val) { + String tmp = ""; + for (int i = 0; i < values().length; i++) { + if (StringUtils.equalsIgnoreCase(values()[i].description, val)) { + tmp = values()[i].value; + } + } + return tmp; + } + } /** * 安灯来源 diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/dao/BaseRepository.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/dao/BaseRepository.java index 3af7891..5fdefdd 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/dao/BaseRepository.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/dao/BaseRepository.java @@ -215,7 +215,7 @@ public interface BaseRepository extends JpaReposito List findByProperty(String propertyName, Object value); - List> findByWasProperty(String[] propertyNames, Object[] values); + List findByProperty(String[] propertyNames, Object[] values); diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/daoimpl/BaseRepositoryImpl.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/daoimpl/BaseRepositoryImpl.java index 7a0e832..936d73e 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/daoimpl/BaseRepositoryImpl.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/daoimpl/BaseRepositoryImpl.java @@ -411,44 +411,11 @@ public class BaseRepositoryImpl extends SimpleJpaRep } return query.setFirstResult(offset).setMaxResults(pageSize).getResultList(); } - @Override public List findByProperty(String propertyName, Object value) { String queryString = "from " + persistentClass.getSimpleName() + " as model where model." + propertyName + "= :" + propertyName; return entityManager.createQuery(queryString).setParameter(propertyName, value).getResultList(); } - - @Override - public List> findByWasProperty(String[] propertyNames, Object[] values) { - if (propertyNames.length != values.length) { - throw new IllegalArgumentException("参数名的数量和参数值不匹配!propertyNames:" + propertyNames.length + ",values:" + values.length); - } - StringBuffer queryString = new StringBuffer(); - queryString.append(" SELECT \n" + - " a.sn_status AS snStatus,\n" + - " a.wh_no AS whNo,\n" + - " a.locate_no AS locateNo,\n" + - " a.part_no AS partNo,\n" + - " a.part_name_rdd AS partNameRdd,\n" + - " a.lot_no AS lotNo,\n" + - " CAST(IFNULL(SUM(a.qty), 0) AS DOUBLE) AS qty \n" + - "FROM\n" + - " `wms_stock_sn` a "); - int size = propertyNames.length; - if (size > 0) { - queryString.append("where 1=1 and a.sn_status in ('"+ WmsEnumUtil.STOCK_SN_STATUS.PRE_INSTOCK.getValue()+"', '"+WmsEnumUtil.STOCK_SN_STATUS.INSTOCKED.getValue()+"','"+WmsEnumUtil.STOCK_SN_STATUS.PICKED.getValue()+"','"+WmsEnumUtil.STOCK_SN_STATUS.QUALITY_CONTROL.getValue()+"') "); - } - - for (int i = 0; i < size; i++) { - if (values[i] != null) { - queryString.append(" and a." + StringCastUtils.upperCharToUnderLine(propertyNames[i]) + "= '" + values[i]+"'"); - } - } - queryString.append(" group by a.lot_no,a.date_code"); - return entityManager.createNativeQuery(queryString.toString()).unwrap(SQLQuery.class).setResultTransformer( - Transformers.ALIAS_TO_ENTITY_MAP).getResultList(); - } - @Override public List findByProperty(String[] propertyNames, Object[] values) { if(propertyNames.length != values.length){ @@ -1583,6 +1550,4 @@ public class BaseRepositoryImpl extends SimpleJpaRep } return num; } - - } diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/util/StringCastUtils.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/util/StringCastUtils.java index 2a53a11..7a87e78 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/util/StringCastUtils.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/util/StringCastUtils.java @@ -7,30 +7,21 @@ import java.util.regex.Pattern; * 字符串转大写换成下滑线加小写 */ public class StringCastUtils { - public static String upperCharToUnderLine(String param) { - Pattern p= Pattern.compile("[A-Z]"); - if(param==null ||param.equals("")){ - return ""; - } - StringBuilder builder=new StringBuilder(param); - Matcher mc=p.matcher(param); - int i=0; - while (mc.find()) { - System.out.println(builder.toString()); - System.out.println("mc.start():" + mc.start() + ", i: " + i); - System.out.println("mc.end():" + mc.start() + ", i: " + i); - builder.replace(mc.start()+i, mc.end()+i, "_"+mc.group().toLowerCase()); - i++; + Pattern p= Pattern.compile("[A-Z]"); + if(param==null ||param.equals("")){ + return ""; + } + StringBuilder builder=new StringBuilder(param); + Matcher mc=p.matcher(param); + int i=0; + while (mc.find()) { + builder.replace(mc.start()+i, mc.end()+i, "_"+mc.group().toLowerCase()); + i++; } if('_' == builder.charAt(0)){ builder.deleteCharAt(0); } - System.out.println(builder.toString()); return builder.toString(); } - -// public static void main(String[] args) { -// upperCharToUnderLine("snStatus"); -// } } diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquipmentModel.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquipmentModel.java index 85c2f18..cfe4f4d 100644 --- a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquipmentModel.java +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquipmentModel.java @@ -31,8 +31,8 @@ public class MesEquipmentModel implements Serializable { @ApiParam(value ="设备工位关联ID") private Long wcId; - @ApiParam(value ="设备代码&工位") - private String equipmentCodeAndworkCellCode; + @ApiParam(value ="设备&工位") + private String equipmentNameAndworkCellName; public MesEquipmentModel() { @@ -49,22 +49,13 @@ public class MesEquipmentModel implements Serializable { this.areaCode = areaCode; } - public MesEquipmentModel(Long wcId, Long id, String equipmentCode, String equipmentName, Integer status, String workCenterCode, String workCellCode) { - this.wcId = wcId; - this.id = id; - this.equipmentCode = equipmentCode; - this.equipmentName = equipmentName; - this.status = status; - this.workCenterCode = workCenterCode; - this.workCellCode = workCellCode; - } - - public MesEquipmentModel(Long id, String equipmentCodeAndworkCellCode, String equipmentCode, String equipmentName, Integer status, String workCenterCode, String workCellCode) { + public MesEquipmentModel(Long id, String equipmentNameAndworkCellName, String equipmentCode, String equipmentName, Integer status, String areaCode, String workCenterCode, String workCellCode) { this.id = id; - this.equipmentCodeAndworkCellCode = equipmentCodeAndworkCellCode; + this.equipmentNameAndworkCellName = equipmentNameAndworkCellName; this.equipmentCode = equipmentCode; this.equipmentName = equipmentName; this.status = status; + this.areaCode = areaCode; this.workCenterCode = workCenterCode; this.workCellCode = workCellCode; diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/iotio/WmsCSOrderDetailsModel.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/iotio/WmsCSOrderDetailsModel.java index 6e2b61d..56e9dab 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/iotio/WmsCSOrderDetailsModel.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/iotio/WmsCSOrderDetailsModel.java @@ -1,79 +1,42 @@ package cn.estsh.i3plus.pojo.wms.bean.iotio; +import io.swagger.annotations.ApiParam; import lombok.Data; import java.io.Serializable; @Data public class WmsCSOrderDetailsModel implements Serializable { - - - /****** - * - * 工厂代码 - */ + @ApiParam("工厂代码") public String organizeCode; - - /****** - * - * 库位编码 - */ + @ApiParam("库位编码") public String locateNo; - /****** - * - * 订单编码 - */ + @ApiParam("订单编号") public String orderNo; - - /****** - * - * 物料代码 - */ + @ApiParam("物料代码") public String partNo; - /****** - * - * 物料名称 - */ + @ApiParam("物料名称") public String partNameRdd; - /****** - * - * 冻结数量 - */ + @ApiParam("冻结数量") public String qty; - /****** - * - * 实盘数量 - */ + @ApiParam("实盘数量") public String factQty; - /****** - * - * 条码 - */ + @ApiParam("条码编号") public String sn; - - /****** - * - * 仓库编码 - */ + @ApiParam("仓库编码") public String whNo; - /****** - * - * 区域编码 - */ + @ApiParam("区域编码") public String zoneNo; - /****** - * - * 状态 - */ + @ApiParam("状态") public String wmStatus; }