|
@@ -154,10 +154,10 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
|
|
item.setCrcCode("" + reverseParseHex(crcStr));
|
|
item.setCrcCode("" + reverseParseHex(crcStr));
|
|
//找寻上一条最新记录
|
|
//找寻上一条最新记录
|
|
MouldHistoryExample mExp = new MouldHistoryExample();
|
|
MouldHistoryExample mExp = new MouldHistoryExample();
|
|
- mExp.setOrderByClause("id desc");;
|
|
|
|
|
|
+ mExp.setOrderByClause("order by id desc limit 1");
|
|
mExp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo());
|
|
mExp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo());
|
|
// 存入数据库
|
|
// 存入数据库
|
|
- mouldHistoryMapper.selectByExample(example);
|
|
|
|
|
|
+ List<MouldHistory> newList = mouldHistoryMapper.selectByExample(mExp);
|
|
mouldHistoryMapper.insertSelective(item);
|
|
mouldHistoryMapper.insertSelective(item);
|
|
logger.info("添加数据完成了-----------》: " + item);
|
|
logger.info("添加数据完成了-----------》: " + item);
|
|
// 模具开合记录
|
|
// 模具开合记录
|
|
@@ -191,6 +191,7 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
|
|
}
|
|
}
|
|
// 统计该模盒的平均开合周期
|
|
// 统计该模盒的平均开合周期
|
|
MouldHistoryExample exp = new MouldHistoryExample();
|
|
MouldHistoryExample exp = new MouldHistoryExample();
|
|
|
|
+ exp.setOrderByClause("id");
|
|
exp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo()).andRunCntEqualTo(item.getRunCnt());
|
|
exp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo()).andRunCntEqualTo(item.getRunCnt());
|
|
// List<MouldHistoryTime> list = mouldHistoryTimeMapper.selectByEquipmentNoAndThanZero(item.getEquipmentNo());
|
|
// List<MouldHistoryTime> list = mouldHistoryTimeMapper.selectByEquipmentNoAndThanZero(item.getEquipmentNo());
|
|
List<MouldHistory> list = mouldHistoryMapper.selectByExample(exp);
|
|
List<MouldHistory> list = mouldHistoryMapper.selectByExample(exp);
|
|
@@ -198,7 +199,9 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
|
|
int totalTime = 0;
|
|
int totalTime = 0;
|
|
if(list.size()==1){
|
|
if(list.size()==1){
|
|
//证明盒子动了,找寻上一条记录
|
|
//证明盒子动了,找寻上一条记录
|
|
-
|
|
|
|
|
|
+ if(newList.size()>0){
|
|
|
|
+ newList.get(0).getIndate().getTime();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
for (MouldHistory t : list) {
|
|
for (MouldHistory t : list) {
|
|
//删选掉负值的数据
|
|
//删选掉负值的数据
|