Merge branch 'test'

yun-zuoyi
crish 6 years ago
commit 672438f2c0

@ -456,6 +456,50 @@ public class AndonEnumUtil {
return tmp; 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;
}
}
/** /**
* *

@ -215,7 +215,7 @@ public interface BaseRepository <T, ID extends Serializable> extends JpaReposito
List<T> findByProperty(String propertyName, Object value); List<T> findByProperty(String propertyName, Object value);
List<Map<String,Object>> findByWasProperty(String[] propertyNames, Object[] values);
List<T> findByProperty(String[] propertyNames, Object[] values); List<T> findByProperty(String[] propertyNames, Object[] values);

@ -411,44 +411,11 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
} }
return query.setFirstResult(offset).setMaxResults(pageSize).getResultList(); return query.setFirstResult(offset).setMaxResults(pageSize).getResultList();
} }
@Override @Override
public List<T> findByProperty(String propertyName, Object value) { public List<T> findByProperty(String propertyName, Object value) {
String queryString = "from " + persistentClass.getSimpleName() + " as model where model." + propertyName + "= :" + propertyName; String queryString = "from " + persistentClass.getSimpleName() + " as model where model." + propertyName + "= :" + propertyName;
return entityManager.createQuery(queryString).setParameter(propertyName, value).getResultList(); return entityManager.createQuery(queryString).setParameter(propertyName, value).getResultList();
} }
@Override
public List<Map<String,Object>> 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 @Override
public List<T> findByProperty(String[] propertyNames, Object[] values) { public List<T> findByProperty(String[] propertyNames, Object[] values) {
if(propertyNames.length != values.length){ if(propertyNames.length != values.length){
@ -1583,6 +1550,4 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
} }
return num; return num;
} }
} }

@ -7,30 +7,21 @@ import java.util.regex.Pattern;
* 线 * 线
*/ */
public class StringCastUtils { public class StringCastUtils {
public static String upperCharToUnderLine(String param) { public static String upperCharToUnderLine(String param) {
Pattern p= Pattern.compile("[A-Z]"); Pattern p= Pattern.compile("[A-Z]");
if(param==null ||param.equals("")){ if(param==null ||param.equals("")){
return ""; return "";
} }
StringBuilder builder=new StringBuilder(param); StringBuilder builder=new StringBuilder(param);
Matcher mc=p.matcher(param); Matcher mc=p.matcher(param);
int i=0; int i=0;
while (mc.find()) { while (mc.find()) {
System.out.println(builder.toString()); builder.replace(mc.start()+i, mc.end()+i, "_"+mc.group().toLowerCase());
System.out.println("mc.start():" + mc.start() + ", i: " + i); i++;
System.out.println("mc.end():" + mc.start() + ", i: " + i);
builder.replace(mc.start()+i, mc.end()+i, "_"+mc.group().toLowerCase());
i++;
} }
if('_' == builder.charAt(0)){ if('_' == builder.charAt(0)){
builder.deleteCharAt(0); builder.deleteCharAt(0);
} }
System.out.println(builder.toString());
return builder.toString(); return builder.toString();
} }
// public static void main(String[] args) {
// upperCharToUnderLine("snStatus");
// }
} }

@ -31,8 +31,8 @@ public class MesEquipmentModel implements Serializable {
@ApiParam(value ="设备工位关联ID") @ApiParam(value ="设备工位关联ID")
private Long wcId; private Long wcId;
@ApiParam(value ="设备代码&工位") @ApiParam(value ="设备&工位")
private String equipmentCodeAndworkCellCode; private String equipmentNameAndworkCellName;
public MesEquipmentModel() { public MesEquipmentModel() {
@ -49,22 +49,13 @@ public class MesEquipmentModel implements Serializable {
this.areaCode = areaCode; this.areaCode = areaCode;
} }
public MesEquipmentModel(Long wcId, Long id, 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.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) {
this.id = id; this.id = id;
this.equipmentCodeAndworkCellCode = equipmentCodeAndworkCellCode; this.equipmentNameAndworkCellName = equipmentNameAndworkCellName;
this.equipmentCode = equipmentCode; this.equipmentCode = equipmentCode;
this.equipmentName = equipmentName; this.equipmentName = equipmentName;
this.status = status; this.status = status;
this.areaCode = areaCode;
this.workCenterCode = workCenterCode; this.workCenterCode = workCenterCode;
this.workCellCode = workCellCode; this.workCellCode = workCellCode;

@ -1,79 +1,42 @@
package cn.estsh.i3plus.pojo.wms.bean.iotio; package cn.estsh.i3plus.pojo.wms.bean.iotio;
import io.swagger.annotations.ApiParam;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@Data @Data
public class WmsCSOrderDetailsModel implements Serializable { public class WmsCSOrderDetailsModel implements Serializable {
@ApiParam("工厂代码")
/******
*
*
*/
public String organizeCode; public String organizeCode;
@ApiParam("库位编码")
/******
*
*
*/
public String locateNo; public String locateNo;
/****** @ApiParam("订单编号")
*
*
*/
public String orderNo; public String orderNo;
@ApiParam("物料代码")
/******
*
*
*/
public String partNo; public String partNo;
/****** @ApiParam("物料名称")
*
*
*/
public String partNameRdd; public String partNameRdd;
/****** @ApiParam("冻结数量")
*
*
*/
public String qty; public String qty;
/****** @ApiParam("实盘数量")
*
*
*/
public String factQty; public String factQty;
/****** @ApiParam("条码编号")
*
*
*/
public String sn; public String sn;
@ApiParam("仓库编码")
/******
*
*
*/
public String whNo; public String whNo;
/****** @ApiParam("区域编码")
*
*
*/
public String zoneNo; public String zoneNo;
/****** @ApiParam("状态")
*
*
*/
public String wmStatus; public String wmStatus;
} }

Loading…
Cancel
Save