Compare commits

...

2 Commits

Author SHA1 Message Date
zyq 15371d9cbf 添加犊牛出岛 2024-03-06 09:03:14 +08:00
zyq 498914c028 删除打印语句 2024-03-06 09:02:52 +08:00
4 changed files with 171 additions and 132 deletions

View File

@ -739,7 +739,6 @@ public class BaseCow {
}
sb.append(" where source_cow='"+sourceCow+"' and cow_no = '"+i.getString("cowName").trim().toUpperCase()+"'");
String sql = sb.toString();
EventLog.info("...繁育...修改...SQL..."+sql);
//修改
Db.update(sql);
}

View File

@ -135,8 +135,8 @@ public class MyTask implements Runnable{
Entry.synsData(otherArgs);
EventLog.info("......其他事件结束执行......");
EventLog.info("......离场牛只数据开始执行......");
EventLog.info("......屏蔽事件开始执行......");
Entry.editData(editArgs);
EventLog.info("......离场牛只数据结束执行......");
EventLog.info("......屏蔽事件结束执行......");
}
}

View File

@ -349,16 +349,10 @@ public class Entry {
String[] farmIds = args[1].split(",");
for(String farmId : farmIds){
EventLog.info("......["+args[2]+"]-["+args[3]+"]......");
EventLog.info("牛场["+farmId+"]判决开始...");
EventLog.info("......牛场["+farmId+"]判决开始......");
Edit.dealEdit(farmId,args[2],args[3]);
EventLog.info("牛场["+farmId+"]判决结束...");
EventLog.info("......牛场["+farmId+"]判决结束......");
EventLog.info("......["+args[2]+"]-["+args[3]+"]......");
EventLog.info("等待2秒后继续...");
try {
Thread.sleep(2000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}

View File

@ -1,7 +1,11 @@
package com.cyx.event;
import com.alibaba.fastjson2.JSONObject;
import com.cyx.log.EventLog;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import java.util.List;
/**
* @Author Created by cyx.zhang Administrator on 2023/9/4 9:44 周一
@ -23,10 +27,14 @@ public class Edit {
* 转场
*/
Turn(sourceCow,startDate,endDate);
/**
* 犊牛出岛
*/
DoOut(sourceCow,startDate,endDate);
}catch (Exception e){
EventLog.error("轮回异常...");
EventLog.error("......轮回异常......");
e.printStackTrace();
EventLog.info("等待5秒后继续...");
EventLog.info("......5秒后继续......");
try {
Thread.sleep(5000L);
} catch (InterruptedException E) {
@ -47,148 +55,148 @@ public class Edit {
*/
//修改牛只基础信息状态
int a = Db.update("update t_base_cow set del_flag = '1',is_out = '1' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...基础("+a+")");
EventLog.info("...判决淘汰...基础("+a+")");
//修改繁育主表状态
int b = Db.update("update t_breed_main set breed_code = '7',breed_status='3',del_flag = '1' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...繁育("+b+")");
EventLog.info("...判决淘汰...繁育("+b+")");
//修改转群转圈状态
int c = Db.update("update t_event_turn_group set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...转群("+c+")");
EventLog.info("...判决淘汰...转群("+c+")");
//修改参保状态
int d = Db.update("update t_event_insured set status = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...参保("+d+")");
EventLog.info("...判决淘汰...参保("+d+")");
/**
* 繁育
*/
//修改配种状态
int e = Db.update("update t_event_breed set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...配种...("+e+")");
EventLog.info("...判决淘汰...配种...("+e+")");
//修改初检状态
int f = Db.update("update t_event_first_inspect set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...初检...("+f+")");
EventLog.info("...判决淘汰...初检...("+f+")");
//修改复检状态
int g = Db.update("update t_event_gestation set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...复检...("+g+")");
EventLog.info("...判决淘汰...复检...("+g+")");
//修改干奶状态
int h = Db.update("update t_event_dried set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...干奶...("+h+")");
EventLog.info("...判决淘汰...干奶...("+h+")");
//修改围产状态
int i = Db.update("update t_event_peripartum set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...围产...("+i+")");
EventLog.info("...判决淘汰...围产...("+i+")");
//修改禁配状态
int j = Db.update("update t_event_no_mating set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...禁配...("+j+")");
EventLog.info("...判决淘汰...禁配...("+j+")");
//修改解禁状态
int k = Db.update("update t_event_unban set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...解禁...("+k+")");
EventLog.info("...判决淘汰...解禁...("+k+")");
//修改流产状态
int l = Db.update("update t_event_abortion set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...流产...("+l+")");
EventLog.info("...判决淘汰...流产...("+l+")");
//修改同期状态
int m = Db.update("update t_event_sync_record set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...同期...("+m+")");
EventLog.info("...判决淘汰...同期...("+m+")");
/**
* 产房
*/
//修改产犊状态
int n = Db.update("update t_event_calving set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...产犊...("+n+")");
EventLog.info("...判决淘汰...产犊...("+n+")");
//修改产犊母牛状态
int o = Db.update("update t_event_calfinfo set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...犊牛...("+o+")");
EventLog.info("...判决淘汰...犊牛...("+o+")");
//修改产后护理保健状态
int p = Db.update("update t_event_postpartum_care set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...产后护理...("+p+")");
EventLog.info("...判决淘汰...产后护理...("+p+")");
//修改产前60天状态
int q = Db.update("update t_event_prenatal_evaluation set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...产前60天...("+q+")");
EventLog.info("...判决淘汰...产前60天...("+q+")");
//修改产后21天状态
int r = Db.update("update t_event_postpartum_evaluation set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...产后21天...("+r+")");
EventLog.info("...判决淘汰...产后21天...("+r+")");
//修改初乳收集状态
int s = Db.update("update t_event_collect_milk set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...初乳收集...("+s+")");
EventLog.info("...判决淘汰...初乳收集...("+s+")");
//修改初乳灌服状态
int t = Db.update("update t_event_feed_milk set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...初乳灌服...("+t+")");
EventLog.info("...判决淘汰...初乳灌服...("+t+")");
/**
* 犊牛
*/
//修改去角状态
int u = Db.update("update t_event_exfoliator set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...去角...("+u+")");
EventLog.info("...判决淘汰...去角...("+u+")");
//修改断奶状态
int v = Db.update("update t_event_weaning set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...断奶...("+v+")");
EventLog.info("...判决淘汰...断奶...("+v+")");
//修改出岛状态
int w = Db.update("update t_event_out_isle set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...出岛...("+w+")");
EventLog.info("...判决淘汰...出岛...("+w+")");
/**
* 健康
*/
//修改盲乳状态
int x = Db.update("update t_event_register_blindmilk set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...盲乳...("+x+")");
EventLog.info("...判决淘汰...盲乳...("+x+")");
//修改修蹄状态
int y = Db.update("update t_event_register_hoof set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...修蹄...("+y+")");
EventLog.info("...判决淘汰...修蹄...("+y+")");
//修改免疫状态
int z = Db.update("update t_event_register_immune set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...免疫...("+z+")");
EventLog.info("...判决淘汰...免疫...("+z+")");
//修改细菌培养状态
int aa = Db.update("update t_event_germ_cultivate set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...细菌...("+aa+")");
EventLog.info("...判决淘汰...细菌...("+aa+")");
//修改驱虫状态
int bb = Db.update("update t_event_expel_insect set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...驱虫...("+bb+")");
EventLog.info("...判决淘汰...驱虫...("+bb+")");
//修改投喂状态
int cc = Db.update("update t_event_feed_magnet set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...投喂...("+cc+")");
EventLog.info("...判决淘汰...投喂...("+cc+")");
//修改亚临床酮病状态
int dd = Db.update("update t_event_ketosis set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...酮病...("+dd+")");
EventLog.info("...判决淘汰...酮病...("+dd+")");
//修改亚临床乳房炎状态
int ee = Db.update("update t_event_mastitis set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...乳房炎...("+ee+")");
EventLog.info("...判决淘汰...乳房炎...("+ee+")");
//修改产后牛身检测状态
int ff = Db.update("update t_event_cowcheck set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...产后牛身体检查...("+ff+")");
EventLog.info("...判决淘汰...产后牛身体检查...("+ff+")");
/**
* 评分
*/
//修改乳头评分状态
int gg = Db.update("update t_event_nipple_score set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...乳头...("+gg+")");
EventLog.info("...判决淘汰...乳头...("+gg+")");
//修改子宫评分状态
int hh = Db.update("update t_event_uterine_score set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...子宫...("+hh+")");
EventLog.info("...判决淘汰...子宫...("+hh+")");
/**
* 化验
*/
//修改隐乳检测状态
int ii = Db.update("update t_event_hide_milk set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...隐乳...("+ii+")");
EventLog.info("...判决淘汰...隐乳...("+ii+")");
//修改抗生素检测状态
int jj = Db.update("update t_event_antibiotic set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...抗生素...("+jj+")");
EventLog.info("...判决淘汰...抗生素...("+jj+")");
//修改血酮检测状
int kk = Db.update("update t_event_blood_ketone set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...血酮...("+kk+")");
EventLog.info("...判决淘汰...血酮...("+kk+")");
//修改尿液PH状态
int ll = Db.update("update t_event_urine_ph set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...尿液...("+ll+")");
EventLog.info("...判决淘汰...尿液...("+ll+")");
//修改免疫球蛋白状态
int mm = Db.update("update t_event_immunoglobulin set is_out = '淘汰' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...蛋白...("+mm+")");
EventLog.info("...判决淘汰...蛋白...("+mm+")");
//修改体况状态
int nn = Db.update("update t_event_body_score set is_out = '淘汰',del_flag = '1' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...体况...("+nn+")");
EventLog.info("...判决淘汰...体况...("+nn+")");
//修改体测状态
int oo = Db.update("update t_event_body_measure set is_out = '淘汰',del_flag = '1' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决淘汰...体测...("+oo+")");
EventLog.info("...判决淘汰...体测...("+oo+")");
//修改步态状态
int pp = Db.update("update t_event_gait_score set is_out = '淘汰',del_flag = '1' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '淘汰' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...步态...("+pp+")");
EventLog.info("...判决死亡...步态...("+pp+")");
EventLog.info("..........等待2秒..........");
try {
@ -210,148 +218,148 @@ public class Edit {
*/
//修改牛只基础信息状态
int a = Db.update("update t_base_cow set del_flag = '1',is_out = '1' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...基础("+a+")");
EventLog.info("...判决死亡...基础("+a+")");
//修改繁育主表状态
int b = Db.update("update t_breed_main set breed_code = '8',breed_status='3',del_flag = '1' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...繁育("+b+")");
EventLog.info("...判决死亡...繁育("+b+")");
//修改转群转圈状态
int c = Db.update("update t_event_turn_group set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...转群("+c+")");
EventLog.info("...判决死亡...转群("+c+")");
//修改参保状态
int d = Db.update("update t_event_insured set status = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...参保("+d+")");
EventLog.info("...判决死亡...参保("+d+")");
/**
* 繁育
*/
//修改配种状态
int e = Db.update("update t_event_breed set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...配种...("+e+")");
EventLog.info("...判决死亡...配种...("+e+")");
//修改初检状态
int f = Db.update("update t_event_first_inspect set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...初检...("+f+")");
EventLog.info("...判决死亡...初检...("+f+")");
//修改复检状态
int g = Db.update("update t_event_gestation set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...复检...("+g+")");
EventLog.info("...判决死亡...复检...("+g+")");
//修改干奶状态
int h = Db.update("update t_event_dried set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...干奶...("+h+")");
EventLog.info("...判决死亡...干奶...("+h+")");
//修改围产状态
int i = Db.update("update t_event_peripartum set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...围产...("+i+")");
EventLog.info("...判决死亡...围产...("+i+")");
//修改禁配状态
int j = Db.update("update t_event_no_mating set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...禁配...("+j+")");
EventLog.info("...判决死亡...禁配...("+j+")");
//修改解禁状态
int k = Db.update("update t_event_unban set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...解禁...("+k+")");
EventLog.info("...判决死亡...解禁...("+k+")");
//修改流产状态
int l = Db.update("update t_event_abortion set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...流产...("+l+")");
EventLog.info("...判决死亡...流产...("+l+")");
//修改同期状态
int m = Db.update("update t_event_sync_record set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...同期...("+m+")");
EventLog.info("...判决死亡...同期...("+m+")");
/**
* 产房
*/
//修改产犊状态
int n = Db.update("update t_event_calving set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...产犊...("+n+")");
EventLog.info("...判决死亡...产犊...("+n+")");
//修改产犊母牛状态
int o = Db.update("update t_event_calfinfo set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...犊牛...("+o+")");
EventLog.info("...判决死亡...犊牛...("+o+")");
//修改产后护理保健状态
int p = Db.update("update t_event_postpartum_care set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...产后护理...("+p+")");
EventLog.info("...判决死亡...产后护理...("+p+")");
//修改产前60天状态
int q = Db.update("update t_event_prenatal_evaluation set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...产前60天...("+q+")");
EventLog.info("...判决死亡...产前60天...("+q+")");
//修改产后21天状态
int r = Db.update("update t_event_postpartum_evaluation set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...产后21天...("+r+")");
EventLog.info("...判决死亡...产后21天...("+r+")");
//修改初乳收集状态
int s = Db.update("update t_event_collect_milk set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...初乳收集...("+s+")");
EventLog.info("...判决死亡...初乳收集...("+s+")");
//修改初乳灌服状态
int t = Db.update("update t_event_feed_milk set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...初乳灌服...("+t+")");
EventLog.info("...判决死亡...初乳灌服...("+t+")");
/**
* 犊牛
*/
//修改去角状态
int u = Db.update("update t_event_exfoliator set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...去角...("+u+")");
EventLog.info("...判决死亡...去角...("+u+")");
//修改断奶状态
int v = Db.update("update t_event_weaning set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...断奶...("+v+")");
EventLog.info("...判决死亡...断奶...("+v+")");
//修改出岛状态
int w = Db.update("update t_event_out_isle set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...出岛...("+w+")");
EventLog.info("...判决死亡...出岛...("+w+")");
/**
* 健康
*/
//修改盲乳状态
int x = Db.update("update t_event_register_blindmilk set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...盲乳...("+x+")");
EventLog.info("...判决死亡...盲乳...("+x+")");
//修改修蹄状态
int y = Db.update("update t_event_register_hoof set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...修蹄...("+y+")");
EventLog.info("...判决死亡...修蹄...("+y+")");
//修改免疫状态
int z = Db.update("update t_event_register_immune set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...免疫...("+z+")");
EventLog.info("...判决死亡...免疫...("+z+")");
//修改细菌培养状态
int aa = Db.update("update t_event_germ_cultivate set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...细菌...("+aa+")");
EventLog.info("...判决死亡...细菌...("+aa+")");
//修改驱虫状态
int bb = Db.update("update t_event_expel_insect set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...驱虫...("+bb+")");
EventLog.info("...判决死亡...驱虫...("+bb+")");
//修改投喂状态
int cc = Db.update("update t_event_feed_magnet set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...投喂...("+cc+")");
EventLog.info("...判决死亡...投喂...("+cc+")");
//修改亚临床酮病状态
int dd = Db.update("update t_event_ketosis set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...酮病...("+dd+")");
EventLog.info("...判决死亡...酮病...("+dd+")");
//修改亚临床乳房炎状态
int ee = Db.update("update t_event_mastitis set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...乳房炎...("+ee+")");
EventLog.info("...判决死亡...乳房炎...("+ee+")");
//修改产后牛身检测状态
int ff = Db.update("update t_event_cowcheck set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...产后牛身体检查...("+ff+")");
EventLog.info("...判决死亡...产后牛身体检查...("+ff+")");
/**
* 评分
*/
//修改乳头评分状态
int gg = Db.update("update t_event_nipple_score set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...乳头...("+gg+")");
EventLog.info("...判决死亡...乳头...("+gg+")");
//修改子宫评分状态
int hh = Db.update("update t_event_uterine_score set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...子宫...("+hh+")");
EventLog.info("...判决死亡...子宫...("+hh+")");
/**
* 化验
*/
//修改隐乳检测状态
int ii = Db.update("update t_event_hide_milk set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...隐乳...("+ii+")");
EventLog.info("...判决死亡...隐乳...("+ii+")");
//修改抗生素检测状态
int jj = Db.update("update t_event_antibiotic set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...抗生素...("+jj+")");
EventLog.info("...判决死亡...抗生素...("+jj+")");
//修改血酮检测状
int kk = Db.update("update t_event_blood_ketone set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...血酮...("+kk+")");
EventLog.info("...判决死亡...血酮...("+kk+")");
//修改尿液PH状态
int ll = Db.update("update t_event_urine_ph set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...尿液...("+ll+")");
EventLog.info("...判决死亡...尿液...("+ll+")");
//修改免疫球蛋白状态
int mm = Db.update("update t_event_immunoglobulin set is_out = '死亡' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...蛋白...("+mm+")");
EventLog.info("...判决死亡...蛋白...("+mm+")");
//修改体况状态
int nn = Db.update("update t_event_body_score set is_out = '死亡',del_flag = '1' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...体况...("+nn+")");
EventLog.info("...判决死亡...体况...("+nn+")");
//修改体测状态
int oo = Db.update("update t_event_body_measure set is_out = '死亡',del_flag = '1' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...体测...("+oo+")");
EventLog.info("...判决死亡...体测...("+oo+")");
//修改步态状态
int pp = Db.update("update t_event_gait_score set is_out = '死亡',del_flag = '1' where source_cow = '" + sourceCow + "' and cow_no in (select cow_no from t_event_out_group where source_cow='"+sourceCow+"' and out_type = '死亡' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d'))");
EventLog.info("判决死亡...步态...("+pp+")");
EventLog.info("...判决死亡...步态...("+pp+")");
EventLog.info("..........等待2秒..........");
try {
@ -368,75 +376,75 @@ public class Edit {
*/
public static void Turn(String sourceCow,String startDate,String endDate){
int a = Db.update("update t_event_turn_group set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_turn_group where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...转群[101]...("+a+")");
EventLog.info("...判决转场...转群[101]...("+a+")");
int b = Db.update("update t_event_weaning set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_weaning where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...断奶[102]...("+b+")");
EventLog.info("...判决转场...断奶[102]...("+b+")");
int c = Db.update("update t_event_out_isle set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_out_isle where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...出岛[102]...("+c+")");
EventLog.info("...判决转场...出岛[102]...("+c+")");
int d = Db.update("update t_event_nipple_score set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_nipple_score where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...乳头[107]...("+d+")");
EventLog.info("...判决转场...乳头[107]...("+d+")");
int e = Db.update("update t_event_calving set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_calving where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...产犊[201]...("+e+")");
EventLog.info("...判决转场...产犊[201]...("+e+")");
int f = Db.update("update t_event_first_inspect set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_first_inspect where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...初检[202]...("+f+")");
EventLog.info("...判决转场...初检[202]...("+f+")");
int g = Db.update("update t_event_gestation set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_gestation where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...复检[203]...("+g+")");
EventLog.info("...判决转场...复检[203]...("+g+")");
int h = Db.update("update t_event_dried set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_dried where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...配种[205]...("+h+")");
EventLog.info("...判决转场...配种[205]...("+h+")");
int i = Db.update("update t_event_peripartum set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_peripartum where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...围产[206]...("+i+")");
EventLog.info("...判决转场...围产[206]...("+i+")");
int j = Db.update("update t_event_abortion set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_abortion where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...流产[207]...("+j+")");
EventLog.info("...判决转场...流产[207]...("+j+")");
int k = Db.update("update t_event_no_mating set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_no_mating where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...禁配[208]...("+k+")");
EventLog.info("...判决转场...禁配[208]...("+k+")");
int l = Db.update("update t_event_unban set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_unban where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...解禁[208]...("+l+")");
EventLog.info("...判决转场...解禁[208]...("+l+")");
int m = Db.update("update t_event_dried set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_dried where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...干奶[209]...("+m+")");
EventLog.info("...判决转场...干奶[209]...("+m+")");
int n = Db.update("update t_event_calfinfo set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_calfinfo where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...犊牛[211]...("+n+")");
EventLog.info("...判决转场...犊牛[211]...("+n+")");
int o = Db.update("update t_event_germ_cultivate set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_germ_cultivate where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...细菌[411]...("+o+")");
EventLog.info("...判决转场...细菌[411]...("+o+")");
int p = Db.update("update t_event_register_blindmilk set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_register_blindmilk where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...盲乳[412]...("+p+")");
EventLog.info("...判决转场...盲乳[412]...("+p+")");
int q = Db.update("update t_event_register_hoof set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_register_hoof where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...修蹄[414]...("+q+")");
EventLog.info("...判决转场...修蹄[414]...("+q+")");
int r = Db.update("update t_event_register_immune set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_register_immune where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...免疫[417]...("+r+")");
EventLog.info("...判决转场...免疫[417]...("+r+")");
int s = Db.update("update t_event_hide_milk set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_hide_milk where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...隐乳[422]...("+s+")");
EventLog.info("...判决转场...隐乳[422]...("+s+")");
int t = Db.update("update t_event_postpartum_care set is_out='转场' where source_cow='"+sourceCow+"' and event_type='护理' and cow_no in(select a.cow_no from (select cow_no from t_event_postpartum_care where source_cow='"+sourceCow+"' and event_type='护理' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...护理[423]...("+t+")");
EventLog.info("...判决转场...护理[423]...("+t+")");
int u = Db.update("update t_event_antibiotic set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_antibiotic where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...抗生素[424]...("+u+")");
EventLog.info("...判决转场...抗生素[424]...("+u+")");
int v = Db.update("update t_event_ketosis set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_ketosis where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...亚临床酮病[425]...("+v+")");
EventLog.info("...判决转场...亚临床酮病[425]...("+v+")");
int w = Db.update("update t_event_mastitis set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_mastitis where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...亚临床乳房炎[426]...("+w+")");
EventLog.info("...判决转场...亚临床乳房炎[426]...("+w+")");
int x = Db.update("update t_event_blood_ketone set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_blood_ketone where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...血酮检测[504]...("+x+")");
EventLog.info("...判决转场...血酮检测[504]...("+x+")");
int y = Db.update("update t_event_feed_magnet set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_feed_magnet where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...投喂磁铁[505]...("+y+")");
EventLog.info("...判决转场...投喂磁铁[505]...("+y+")");
int z = Db.update("update t_event_postpartum_care set is_out='转场' where source_cow='"+sourceCow+"' and event_type='保健' and cow_no in(select a.cow_no from (select cow_no from t_event_postpartum_care where source_cow='"+sourceCow+"' and event_type='保健' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...保健[507]...("+z+")");
EventLog.info("...判决转场...保健[507]...("+z+")");
int aa = Db.update("update t_event_exfoliator set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_exfoliator where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...去角[510]...("+aa+")");
EventLog.info("...判决转场...去角[510]...("+aa+")");
int bb = Db.update("update t_event_immunoglobulin set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_immunoglobulin where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...免疫球蛋白[512]...("+bb+")");
EventLog.info("...判决转场...免疫球蛋白[512]...("+bb+")");
int cc = Db.update("update t_event_feed_milk set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_feed_milk where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...初乳灌服[513]...("+cc+")");
EventLog.info("...判决转场...初乳灌服[513]...("+cc+")");
int dd = Db.update("update t_event_urine_ph set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_urine_ph where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...尿液PH[514]...("+dd+")");
EventLog.info("...判决转场...尿液PH[514]...("+dd+")");
int ee = Db.update("update t_event_collect_milk set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_collect_milk where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...初乳收集[515]...("+ee+")");
EventLog.info("...判决转场...初乳收集[515]...("+ee+")");
int ff = Db.update("update t_event_uterine_score set is_out='转场' where source_cow='"+sourceCow+"' and cow_no in(select a.cow_no from (select cow_no from t_event_uterine_score where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...子宫评分[517]...("+ff+")");
EventLog.info("...判决转场...子宫评分[517]...("+ff+")");
int gg = Db.update("update t_event_body_score set is_out = '转场',del_flag = '1' where source_cow = '" + sourceCow + "' and cow_no in (select a.cow_no from (select cow_no from t_event_uterine_score where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...体况[105]...("+gg+")");
EventLog.info("...判决转场...体况[105]...("+gg+")");
int hh = Db.update("update t_event_body_measure set is_out = '转场',del_flag = '1' where source_cow = '" + sourceCow + "' and cow_no in (select a.cow_no from (select cow_no from t_event_uterine_score where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...体测[106]...("+hh+")");
EventLog.info("...判决转场...体测[106]...("+hh+")");
int ii = Db.update("update t_event_gait_score set is_out = '转场',del_flag = '1' where source_cow = '" + sourceCow + "' and cow_no in (select a.cow_no from (select cow_no from t_event_uterine_score where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d') and cow_no not in(select cow_no from t_base_cow where source_cow='"+sourceCow+"')) as a)");
EventLog.info("判决转场...步态[519]...("+ii+")");
EventLog.info("...判决转场...步态[519]...("+ii+")");
EventLog.info("..........等待2秒..........");
try {
@ -445,4 +453,42 @@ public class Edit {
E.printStackTrace();
}
}
/**
* 出岛
* @param sourceCow
* @param startDate
* @param endDate
*/
public static void DoOut(String sourceCow,String startDate,String endDate) {
List<Record> list = Db.find("select cow_no as cowNo,event_date as eventDate,out_type as outType,oper_name as operName,create_time as createTime from t_event_out_group where source_cow='"+sourceCow+"' and date_format(event_date,'%Y-%m-%d') between date_format('"+startDate+"','%Y-%m-%d') and date_format('"+endDate+"','%Y-%m-%d')");
if(list.size()>0){
for (Record record : list) {
Record record1 = Db.findFirst("select calve_number as num from t_calve_cowshed where source_cow='"+sourceCow+"' and cow_no='"+record.getStr("cowNo")+"' limit 1");
if(record1 != null){
JSONObject obj = new JSONObject();
obj.put("sourceCow",sourceCow);
obj.put("cowNo",record.getStr("cowNo"));
obj.put("calveNumber",record1.getStr("num"));
obj.put("dateOf",record.getStr("eventDate"));
obj.put("createBy",record.getStr("operName"));
obj.put("createDate",record.getStr("createTime"));
if("死亡".equals(record.getStr("outType"))){
obj.put("status","2");
}
if("淘汰".equals(record.getStr("outType"))){
obj.put("status","3");
}
obj.put("updateBy",record.getStr("operName"));
obj.put("updateDate",record.getStr("createTime"));
Record record2 = Db.findFirst("select * from t_calve_cowshed_history where source_cow='"+sourceCow+"' and cow_no='"+record.getStr("cowNo")+"' limit 1");
if(record2 == null){
Db.update("insert into t_calve_cowshed_history(source_cow,cow_no,calve_number,date_of,create_by,create_date,status,update_by,update_date) values ('"+sourceCow+"','"+obj.getString("cowNo")+"','"+obj.getString("calveNumber")+"','"+obj.getString("dateOf")+"',#{createBy},'"+obj.getString("createDate")+"','"+obj.getString("status")+"','"+obj.getString("updateBy")+"','"+obj.getString("updateDate")+"')");
}
Db.update("update t_calve_cowshed set cow_no='',update_by='"+record.getStr("operName")+"',update_date='"+record.getStr("createTime")+"' where source_cow='"+sourceCow+"' and cow_no='"+record.getStr("cowNo")+"'");
EventLog.info("...["+record.getStr("cowNo")+"]...岛号...["+record1.getStr("num")+"]...离场日期...["+obj.getString("dateOf")+"]...修改人..."+record.getStr("operName")+"...修改时间...["+record.getStr("createTime")+"]...出岛...");
}
}
}
}
}