|
@@ -135,7 +135,7 @@ public class ProdWarningTimer {
|
|
|
if (ObjectUtil.isNotEmpty(prodProductionThreshold)){
|
|
|
checkAndWarn(prodProductionThreshold.getMinBychl(), prodProduction.getBychl(),farmId, 1, "保育成活率小于阈值!");
|
|
|
checkAndWarn(prodProductionThreshold.getMinCfchl(), prodProduction.getCfchl(),farmId, 1, "产房成活率小于阈值!");
|
|
|
- checkAndWarn(prodProductionThreshold.getMinFccts(), prodProduction.getFccts(),farmId, 1, "非生产天数小于阈值!");
|
|
|
+ checkAndWarn2(prodProductionThreshold.getMinFccts(), prodProduction.getFccts(),farmId, 1, "非生产天数大于阈值!");
|
|
|
checkAndWarn(prodProductionThreshold.getMinFzchl(), prodProduction.getFzchl(),farmId, 1, "肥猪成活率小于阈值!");
|
|
|
checkAndWarn(prodProductionThreshold.getMinMrwll(), prodProduction.getMrwll(),farmId, 1, "每日喂料量小于阈值!");
|
|
|
checkAndWarn(prodProductionThreshold.getMinPjwchzs(), prodProduction.getPjwchzs(),farmId, 1, "平均窝产活仔数小于阈值!");
|
|
@@ -167,4 +167,17 @@ public class ProdWarningTimer {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void checkAndWarn2(String threshold, String actualValue,Integer farmId, int warningType, String warningContent) {
|
|
|
+ if (ObjectUtil.isNotEmpty(threshold) && ObjectUtil.isNotEmpty(actualValue)) {
|
|
|
+ if (Double.valueOf(actualValue).compareTo(Double.valueOf(threshold)) > 0) {
|
|
|
+ ProdWarningInfo prodWarningInfo = new ProdWarningInfo();
|
|
|
+ prodWarningInfo.setDate(LocalDateTime.now());
|
|
|
+ prodWarningInfo.setFarmId(farmId);
|
|
|
+ prodWarningInfo.setWarningContent(warningContent);
|
|
|
+ prodWarningInfo.setWarningType(warningType);
|
|
|
+ prodWarningInfoMapper.insert(prodWarningInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|