Forráskód Böngészése

物料数据异常继续走

zhangy 2 éve
szülő
commit
9a58152274

+ 14 - 8
src/main/java/com/steerinfo/ems/trmworkprocmaterialvalue/service/impl/TRmWorkprocMaterialValueServiceImpl.java

@@ -1113,14 +1113,20 @@ public class TRmWorkprocMaterialValueServiceImpl extends BaseServiceImpl<TRmWork
 		List<TRmWorkprocMaterialValue> trmlist= tRmWorkprocMaterialValueMapper.getMaterialValue(params);
 		for(TRmWorkprocMaterialValue trmWorkprocMaterialValue: trmlist)
 		{
-			trmWorkprocMaterialValue.setTimegranid("DAY");
-			trmWorkprocMaterialValue.setCorrectvalue(trmWorkprocMaterialValue.getApportvalue().subtract(trmWorkprocMaterialValue.getActualvalue()));
-			trmWorkprocMaterialValue.setBz("计算值是湿基;最终值是干基");
-			trmWorkprocMaterialValue.setUserid("系统");
-			trmWorkprocMaterialValue.setUpdatetime(DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
-			if(tRmWorkprocMaterialValueMapper.updateByPrimaryKeySelective(trmWorkprocMaterialValue)==0){
-				tRmWorkprocMaterialValueMapper.insertSelective(trmWorkprocMaterialValue);
-			};
+			try{
+				trmWorkprocMaterialValue.setTimegranid("DAY");
+				trmWorkprocMaterialValue.setCorrectvalue(trmWorkprocMaterialValue.getApportvalue().subtract(trmWorkprocMaterialValue.getActualvalue()));
+				trmWorkprocMaterialValue.setBz("计算值是湿基;最终值是干基");
+				trmWorkprocMaterialValue.setUserid("系统");
+				trmWorkprocMaterialValue.setUpdatetime(DateUtils.dateStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
+				if(tRmWorkprocMaterialValueMapper.updateByPrimaryKeySelective(trmWorkprocMaterialValue)==0){
+					tRmWorkprocMaterialValueMapper.insertSelective(trmWorkprocMaterialValue);
+				};
+			}catch (Exception e){
+				//捕获异常。异常之后继续执行
+				e.printStackTrace();
+			}
+
 		}
 	}