|
@@ -55,6 +55,7 @@ import com.jeesite.modules.mes.req.MesProductQmReq;
|
|
|
import com.jeesite.modules.mes.req.MesSearchDateReq;
|
|
import com.jeesite.modules.mes.req.MesSearchDateReq;
|
|
|
import com.jeesite.modules.mes.resp.BindMaterialResp;
|
|
import com.jeesite.modules.mes.resp.BindMaterialResp;
|
|
|
import com.jeesite.modules.mes.resp.CommonResp;
|
|
import com.jeesite.modules.mes.resp.CommonResp;
|
|
|
|
|
+import com.jeesite.modules.mes.resp.MesShiftDataResp;
|
|
|
import com.jeesite.modules.mes.resp.ParamsResp;
|
|
import com.jeesite.modules.mes.resp.ParamsResp;
|
|
|
import com.jeesite.modules.mes.service.*;
|
|
import com.jeesite.modules.mes.service.*;
|
|
|
import com.jeesite.modules.mes.util.CommonUitl;
|
|
import com.jeesite.modules.mes.util.CommonUitl;
|
|
@@ -1380,20 +1381,150 @@ public class MesProductRecordController extends BaseController {
|
|
|
if(mesLineProcess1.getRepeat().equals("1") && (ret.equals(bs+"OK") || ret.equals(bs+"NG"))){ // 可重复工作
|
|
if(mesLineProcess1.getRepeat().equals("1") && (ret.equals(bs+"OK") || ret.equals(bs+"NG"))){ // 可重复工作
|
|
|
ret = "RSUD";
|
|
ret = "RSUD";
|
|
|
}
|
|
}
|
|
|
- //判断是否属于可做三次气密检测的工位 mes_qm_maxNumber次数 mes_qm_oprnos工位
|
|
|
|
|
- String qmOprnos = Global.getConfig("mes_qm_oprnos");
|
|
|
|
|
- if(!StringUtils.isEmpty(qmOprnos) && qmOprnos.contains(CommonUitl.formatOprno(oldOprno))){
|
|
|
|
|
- int qmMaxNumber =new Integer(Global.getConfig("mes_qm_maxNumber")) ;
|
|
|
|
|
- if(qmMaxNumber > 0){
|
|
|
|
|
- MesProductQm mesProductQm = new MesProductQm();
|
|
|
|
|
- mesProductQm.setComponentNum(sn);
|
|
|
|
|
- mesProductQm.setOprno(oldOprno);
|
|
|
|
|
-
|
|
|
|
|
- mesProductQm.setProductCate(lineSn);
|
|
|
|
|
- List<MesProductQm> list = mesProductQmService.findList(mesProductQm);//----
|
|
|
|
|
-//判断列表长度
|
|
|
|
|
- if(list.size() >= qmMaxNumber){
|
|
|
|
|
- ret = bs+lxres;
|
|
|
|
|
|
|
+// //判断是否属于可做三次气密检测的工位 mes_qm_maxNumber次数 mes_qm_oprnos工位
|
|
|
|
|
+// String qmOprnos = Global.getConfig("mes_qm_oprnos");
|
|
|
|
|
+// if(!StringUtils.isEmpty(qmOprnos) && qmOprnos.contains(CommonUitl.formatOprno(oldOprno))){
|
|
|
|
|
+// int qmMaxNumber =new Integer(Global.getConfig("mes_qm_maxNumber")) ;
|
|
|
|
|
+// if(qmMaxNumber > 0){
|
|
|
|
|
+// MesProductQm mesProductQm = new MesProductQm();
|
|
|
|
|
+// mesProductQm.setComponentNum(sn);
|
|
|
|
|
+// mesProductQm.setOprno(oldOprno);
|
|
|
|
|
+//
|
|
|
|
|
+// mesProductQm.setProductCate(lineSn);
|
|
|
|
|
+// List<MesProductQm> list = mesProductQmService.findList(mesProductQm);//----
|
|
|
|
|
+// //判断列表长度
|
|
|
|
|
+// if(list.size() >= qmMaxNumber){
|
|
|
|
|
+// ret = bs+lxres;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+ String oprno1 = CommonUitl.formatOprno(oprno);
|
|
|
|
|
+ MesShiftDataResp mesShiftDataResp = mesShiftService.getCurShift();
|
|
|
|
|
+
|
|
|
|
|
+ // 气密工位
|
|
|
|
|
+ String qmoprnos = Global.getConfig("mes.qm.oprnos");
|
|
|
|
|
+ if(!StringUtils.isEmpty(qmoprnos) && qmoprnos.contains(oprno1)){
|
|
|
|
|
+ String Fchech = Global.getConfig("mes.qm.check");
|
|
|
|
|
+ if (Fchech.equals("1")){
|
|
|
|
|
+ // 首件点检
|
|
|
|
|
+ String NpqmOprnos = Global.getConfig("mes.qm.nocheck");
|
|
|
|
|
+ if(!StringUtils.isEmpty(NpqmOprnos) && NpqmOprnos.contains(oprno)){
|
|
|
|
|
+
|
|
|
|
|
+ }else{
|
|
|
|
|
+
|
|
|
|
|
+ String oks = "";
|
|
|
|
|
+ String ngs = "";
|
|
|
|
|
+ if(oprno1.equals("OP350") && lineSn.equals("XT")){ // 半成品气密
|
|
|
|
|
+ oks = Global.getConfig("mes.xt.OP350.ok");
|
|
|
|
|
+ ngs = Global.getConfig("mes.xt.OP350.ng");
|
|
|
|
|
+ }else if(oprno1.equals("OP450") && lineSn.equals("XT")){ //总成
|
|
|
|
|
+ oks = Global.getConfig("mes.xt.OP450.ok");
|
|
|
|
|
+ ngs = Global.getConfig("mes.xt.OP450.ng");
|
|
|
|
|
+ }
|
|
|
|
|
+ logger.info("qmok:"+oks);
|
|
|
|
|
+ logger.info("qmng:"+ngs);
|
|
|
|
|
+ if(StringUtils.isEmpty(oks) && StringUtils.isEmpty(ngs)){
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ Boolean oksret = true;
|
|
|
|
|
+ Boolean ngsret = true;
|
|
|
|
|
+
|
|
|
|
|
+ DateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
|
|
+ Date stdate =null;
|
|
|
|
|
+ Date etdate =null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ stdate = dateFormat2.parse(mesShiftDataResp.getStart());
|
|
|
|
|
+ etdate = dateFormat2.parse(mesShiftDataResp.getEnd());
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(!StringUtils.isEmpty(oks)){
|
|
|
|
|
+ String[] oksarr = oks.split(",",-1);
|
|
|
|
|
+ for(String ok : oksarr){
|
|
|
|
|
+ if(StringUtils.isEmpty(ok)){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(sn.equals(ok)){
|
|
|
|
|
+ return "RSUD";
|
|
|
|
|
+ }
|
|
|
|
|
+ MesProductQm mesProductQm = new MesProductQm();
|
|
|
|
|
+ mesProductQm.setOprno(oprno);
|
|
|
|
|
+ mesProductQm.setComponentNum(ok);
|
|
|
|
|
+ mesProductQm.setProductCate(lineSn);
|
|
|
|
|
+ mesProductQm.setTestTime_gte(stdate);
|
|
|
|
|
+ mesProductQm.setTestTime_lte(etdate);
|
|
|
|
|
+ mesProductQm.setTestResult("OK");
|
|
|
|
|
+ mesProductQm.getSqlMap().getOrder().setOrderBy("a.test_date desc");
|
|
|
|
|
+ MesProductQm mesProductQm1 = mesProductQmService.findInfo(mesProductQm);
|
|
|
|
|
+ if(com.jeesite.common.lang.ObjectUtils.isEmpty(mesProductQm1)){
|
|
|
|
|
+ oksret = false;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ logger.info("qmok2:"+oks);
|
|
|
|
|
+ if(!StringUtils.isEmpty(ngs)){
|
|
|
|
|
+ String[] ngsarr = ngs.split(",",-1);
|
|
|
|
|
+ for(String ng : ngsarr){
|
|
|
|
|
+ if(StringUtils.isEmpty(ng)){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(sn.equals(ng)){
|
|
|
|
|
+ return "RSUD";
|
|
|
|
|
+ }
|
|
|
|
|
+ MesProductQm mesProductQm = new MesProductQm();
|
|
|
|
|
+ mesProductQm.setOprno(oprno);
|
|
|
|
|
+ mesProductQm.setComponentNum(ng);
|
|
|
|
|
+ mesProductQm.setProductCate(lineSn);
|
|
|
|
|
+ mesProductQm.setTestTime_gte(stdate);
|
|
|
|
|
+ mesProductQm.setTestTime_lte(etdate);
|
|
|
|
|
+ mesProductQm.getSqlMap().getWhere().and("a.oprno",QueryType.NE,"OK");
|
|
|
|
|
+ mesProductQm.getSqlMap().getOrder().setOrderBy("a.test_date desc");
|
|
|
|
|
+ MesProductQm mesProductQm1 = mesProductQmService.findInfo(mesProductQm);
|
|
|
|
|
+ if(com.jeesite.common.lang.ObjectUtils.isEmpty(mesProductQm1)){
|
|
|
|
|
+ ngsret = false;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!oksret || !ngsret){
|
|
|
|
|
+ return "RSDJ";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ ret= "RSUD";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ String check = Global.getConfig("mes.qm.ng.time");
|
|
|
|
|
+ if(check.equals("1")){
|
|
|
|
|
+ // 检查是否超过15分钟
|
|
|
|
|
+ String checkret = Global.getConfig("mes.qm.nong.time");
|
|
|
|
|
+ if (!StringUtils.isEmpty(checkret) && qmoprnos.contains(checkret)){
|
|
|
|
|
+
|
|
|
|
|
+ }else {
|
|
|
|
|
+ MesProductQm mpr2 = new MesProductQm();
|
|
|
|
|
+ mpr2.setComponentNum(sn);
|
|
|
|
|
+ mpr2.getSqlMap().getWhere().and("a.oprno",QueryType.RIGHT_LIKE,oprno);
|
|
|
|
|
+ mpr2.getSqlMap().getOrder().setOrderBy("a.test_time desc");
|
|
|
|
|
+ MesProductQm mprinfo = mesProductQmService.findInfo(mpr2);
|
|
|
|
|
+ if(!ObjectUtils.isEmpty(mprinfo)){
|
|
|
|
|
+ // 计算两个日期之间相差的分钟数
|
|
|
|
|
+ Date curDate = new Date();
|
|
|
|
|
+ Date date2 = mprinfo.getTestTime();
|
|
|
|
|
+ long minutesBetween = Math.abs(ChronoUnit.MINUTES.between(curDate.toInstant(), date2.toInstant()));
|
|
|
|
|
+ logger.info("minutesBetween:"+ minutesBetween);
|
|
|
|
|
+ if(minutesBetween < 15){ // 未超过15分钟
|
|
|
|
|
+ return "RSQM";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|