|
|
@@ -1,5 +1,6 @@
|
|
|
package com.jeesite.modules.mes.service;
|
|
|
|
|
|
+import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
|
|
|
import com.jeesite.common.collect.ListUtils;
|
|
|
@@ -66,7 +67,7 @@ public class MesProductCateService extends CrudService<MesProductCateDao, MesPro
|
|
|
List<MesTemplateItems> lists = mesTemplateItemsService.findListItems(mesProductCate2.getTemplateId());
|
|
|
return lists;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 查询分页数据
|
|
|
* @param mesProductCate 查询条件
|
|
|
@@ -77,7 +78,7 @@ public class MesProductCateService extends CrudService<MesProductCateDao, MesPro
|
|
|
public Page<MesProductCate> findPage(MesProductCate mesProductCate) {
|
|
|
return super.findPage(mesProductCate);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 查询列表数据
|
|
|
* @param mesProductCate
|
|
|
@@ -87,7 +88,7 @@ public class MesProductCateService extends CrudService<MesProductCateDao, MesPro
|
|
|
public List<MesProductCate> findList(MesProductCate mesProductCate) {
|
|
|
return super.findList(mesProductCate);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 保存数据(插入或更新)
|
|
|
* @param mesProductCate
|
|
|
@@ -97,7 +98,7 @@ public class MesProductCateService extends CrudService<MesProductCateDao, MesPro
|
|
|
public void save(MesProductCate mesProductCate) {
|
|
|
super.save(mesProductCate);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 更新状态
|
|
|
* @param mesProductCate
|
|
|
@@ -107,7 +108,7 @@ public class MesProductCateService extends CrudService<MesProductCateDao, MesPro
|
|
|
public void updateStatus(MesProductCate mesProductCate) {
|
|
|
super.updateStatus(mesProductCate);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除数据
|
|
|
* @param mesProductCate
|
|
|
@@ -140,8 +141,26 @@ public class MesProductCateService extends CrudService<MesProductCateDao, MesPro
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+// // 获取工件码类型
|
|
|
+// public MesProductCate getCateBySn(String sn){
|
|
|
+// MesProductCate mesProductModel = new MesProductCate();
|
|
|
+// mesProductModel.setStatus("0");
|
|
|
+// List<MesProductCate> lists = findList(mesProductModel);
|
|
|
+// if(ListUtils.isEmpty(lists)){
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+//
|
|
|
+// for(MesProductCate mesProductModel2 : lists){
|
|
|
+// Boolean ret = CommonUitl.checkSnByModel(sn,mesProductModel2.getSpec(),mesProductModel2.getSpecStart(),mesProductModel2.getLength());
|
|
|
+// if(ret){
|
|
|
+// return mesProductModel2;
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// return null;
|
|
|
+// }
|
|
|
// 获取工件码类型
|
|
|
- public MesProductCate getCateBySn(String sn){
|
|
|
+ public List<MesProductCate> getCateBySn(String sn){
|
|
|
MesProductCate mesProductModel = new MesProductCate();
|
|
|
mesProductModel.setStatus("0");
|
|
|
List<MesProductCate> lists = findList(mesProductModel);
|
|
|
@@ -149,15 +168,16 @@ public class MesProductCateService extends CrudService<MesProductCateDao, MesPro
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- for(MesProductCate mesProductModel2 : lists){
|
|
|
+ Iterator<MesProductCate> iterator = lists.iterator();
|
|
|
+ while(((Iterator<?>) iterator).hasNext()){
|
|
|
+ MesProductCate mesProductModel2 = iterator.next();
|
|
|
Boolean ret = CommonUitl.checkSnByModel(sn,mesProductModel2.getSpec(),mesProductModel2.getSpecStart(),mesProductModel2.getLength());
|
|
|
- if(ret){
|
|
|
- return mesProductModel2;
|
|
|
+ if(!ret){
|
|
|
+ iterator.remove();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return null;
|
|
|
+ return lists.isEmpty() ? null : lists;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-}
|
|
|
+}
|