|
|
@ -1,11 +1,13 @@ |
|
|
package com.qhclh.ytzh.work.productiondailyw; |
|
|
package com.qhclh.ytzh.work.productiondailyw; |
|
|
|
|
|
|
|
|
|
|
|
import android.content.DialogInterface; |
|
|
import android.content.Intent; |
|
|
import android.content.Intent; |
|
|
import android.support.design.widget.TabLayout; |
|
|
import android.support.design.widget.TabLayout; |
|
|
import android.support.v4.app.Fragment; |
|
|
import android.support.v4.app.Fragment; |
|
|
import android.support.v4.app.FragmentManager; |
|
|
import android.support.v4.app.FragmentManager; |
|
|
import android.support.v4.app.FragmentPagerAdapter; |
|
|
import android.support.v4.app.FragmentPagerAdapter; |
|
|
import android.support.v4.view.ViewPager; |
|
|
import android.support.v4.view.ViewPager; |
|
|
|
|
|
import android.support.v7.app.AlertDialog; |
|
|
import android.support.v7.widget.Toolbar; |
|
|
import android.support.v7.widget.Toolbar; |
|
|
import android.view.Menu; |
|
|
import android.view.Menu; |
|
|
import android.view.MenuItem; |
|
|
import android.view.MenuItem; |
|
|
@ -88,12 +90,162 @@ public class WriteDActivity extends BaseActivity implements CalendarDialogFragme |
|
|
@Override |
|
|
@Override |
|
|
protected void onResume() { |
|
|
protected void onResume() { |
|
|
super.onResume(); |
|
|
super.onResume(); |
|
|
tv_toolbar_title.setText(DateTimeUtil.getYMD2(new Date(System.currentTimeMillis()-1000*60*60*24))); |
|
|
|
|
|
try { |
|
|
|
|
|
LoadOrCreateEditingDayProduct(new SimpleDateFormat("yyyy-MM-dd").parse(DateTimeUtil.getYMD(new Date(System.currentTimeMillis()-1000*60*60*24)))); |
|
|
|
|
|
} catch (ParseException e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ViewOnClickTask LoadOrCreateEditingDayProductTask = new ViewOnClickTask(this, "加载中...") { |
|
|
|
|
|
@Override |
|
|
|
|
|
protected void successUI() { |
|
|
|
|
|
if (rpcObj != null) { |
|
|
|
|
|
list.clear(); |
|
|
|
|
|
tijiaoList.clear(); |
|
|
|
|
|
mTitleList.clear(); |
|
|
|
|
|
mFragmentList.clear(); |
|
|
|
|
|
DataSupport.deleteAll(WriteBean.class); |
|
|
|
|
|
detailsList = rpcObj.getManyList("Details"); |
|
|
|
|
|
for (int i = 0; i < detailsList.size(); i++) { |
|
|
|
|
|
if (detailsList.get(i).getLong("House_ID") != null) { |
|
|
|
|
|
houseid = detailsList.get(i).getLong("House_ID") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
houseid = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getString("House_Name") != null) { |
|
|
|
|
|
housename = detailsList.get(i).getString("House_Name"); |
|
|
|
|
|
} else { |
|
|
|
|
|
housename = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("Days") != null) { |
|
|
|
|
|
days = detailsList.get(i).getInt("Days") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
days = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("DieNumber") != null) { |
|
|
|
|
|
dienumber = detailsList.get(i).getInt("DieNumber") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
dienumber = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("Obsolete") != null) { |
|
|
|
|
|
obs = detailsList.get(i).getInt("Obsolete") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
obs = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("WaterIntake") != null) { |
|
|
|
|
|
water = detailsList.get(i).getDecimal("WaterIntake") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
water = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("Weight") != null) { |
|
|
|
|
|
weight = detailsList.get(i).getDecimal("Weight") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
weight = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("MinTemperature") != null) { |
|
|
|
|
|
zuidiwendu = detailsList.get(i).getDecimal("MinTemperature") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidiwendu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getDecimal("MaxTemperature") != null) { |
|
|
|
|
|
zuigaowendu = detailsList.get(i).getDecimal("MaxTemperature") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuigaowendu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getDecimal("MinHumidity") != null) { |
|
|
|
|
|
zuidishidu = detailsList.get(i).getDecimal("MinHumidity") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidishidu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("MaxHumidity") != null) { |
|
|
|
|
|
zuigaoshidu = detailsList.get(i).getDecimal("MaxHumidity") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuigaoshidu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("NightMinAirQuantity") != null) { |
|
|
|
|
|
zuixiaotongfeng = detailsList.get(i).getString("NightMinAirQuantity"); |
|
|
|
|
|
} else { |
|
|
|
|
|
zuixiaotongfeng = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("DayMaxAirQuantity") != null) { |
|
|
|
|
|
zuidatongfeng = detailsList.get(i).getString("DayMaxAirQuantity"); |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidatongfeng = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("NegativePressure") != null) { |
|
|
|
|
|
fuya = detailsList.get(i).getString("NegativePressure") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
fuya = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WriteBean writebean = new WriteBean(); |
|
|
|
|
|
writebean.setHouseid(Long.parseLong(houseid)); |
|
|
|
|
|
writebean.setHousename(housename); |
|
|
|
|
|
writebean.setSiwang(dienumber); |
|
|
|
|
|
writebean.setTaotai(obs); |
|
|
|
|
|
writebean.setYinshuiliang(water); |
|
|
|
|
|
writebean.setTizhong(weight); |
|
|
|
|
|
writebean.setZuidiwendu(zuidiwendu); |
|
|
|
|
|
writebean.setZuigaowendu(zuigaowendu); |
|
|
|
|
|
writebean.setZuidishidu(zuidishidu); |
|
|
|
|
|
writebean.setZuigaoshidu(zuigaoshidu); |
|
|
|
|
|
writebean.setZuixiaotongfeng(zuixiaotongfeng); |
|
|
|
|
|
writebean.setZuidatongfeng(zuidatongfeng); |
|
|
|
|
|
writebean.setFuya(fuya); |
|
|
|
|
|
list.add(writebean); |
|
|
|
|
|
|
|
|
|
|
|
WriteBean writeBeandb = new WriteBean(); |
|
|
|
|
|
writeBeandb.setHouseid(Long.parseLong(houseid)); |
|
|
|
|
|
writeBeandb.setHousename(housename); |
|
|
|
|
|
writeBeandb.setSiwang(dienumber); |
|
|
|
|
|
writeBeandb.setTaotai(obs); |
|
|
|
|
|
writeBeandb.setYinshuiliang(water); |
|
|
|
|
|
writeBeandb.setTizhong(weight); |
|
|
|
|
|
writeBeandb.setZuidiwendu(zuidiwendu); |
|
|
|
|
|
writeBeandb.setZuigaowendu(zuigaowendu); |
|
|
|
|
|
writeBeandb.setZuidishidu(zuidishidu); |
|
|
|
|
|
writeBeandb.setZuigaoshidu(zuigaoshidu); |
|
|
|
|
|
writeBeandb.setZuixiaotongfeng(zuixiaotongfeng); |
|
|
|
|
|
writeBeandb.setZuidatongfeng(zuidatongfeng); |
|
|
|
|
|
writeBeandb.setFuya(fuya); |
|
|
|
|
|
writeBeandb.save(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
writeBeanList = DataSupport.findAll(WriteBean.class); |
|
|
|
|
|
|
|
|
|
|
|
initTabLayout(); |
|
|
|
|
|
initViewPager(); |
|
|
|
|
|
tv_toolbar_title.setText(DateTimeUtil.getYMD2(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24))); |
|
|
|
|
|
} else if (rpcObj == null) { |
|
|
|
|
|
new AlertDialog.Builder(WriteDActivity.this) |
|
|
|
|
|
.setTitle("提示") |
|
|
|
|
|
.setMessage("是否新建日志") |
|
|
|
|
|
.setPositiveButton("确定", new DialogInterface.OnClickListener() { |
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) { |
|
|
|
|
|
try { |
|
|
|
|
|
LoadOrCreateEditingDayProduct(new SimpleDateFormat("yyyy-MM-dd").parse(DateTimeUtil.getYMD(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24))), true); |
|
|
|
|
|
tv_toolbar_title.setText(DateTimeUtil.getYMD2(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24))); |
|
|
|
|
|
} catch (ParseException e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).show(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Object call() throws Exception { |
|
|
|
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.LoadOrCreateEditingDayProduct, new SimpleDateFormat("yyyy-MM-dd").parse(DateTimeUtil.getYMD(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24))), false); |
|
|
|
|
|
rpcObj = result.getRpcObject(RpcUrl.LoadOrCreateEditingDayProduct_fanhui); |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
LoadOrCreateEditingDayProductTask.execute(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static RpcObject rpcObj; |
|
|
public static RpcObject rpcObj; |
|
|
@ -114,138 +266,141 @@ public class WriteDActivity extends BaseActivity implements CalendarDialogFragme |
|
|
private String zuidatongfeng; |
|
|
private String zuidatongfeng; |
|
|
private String fuya; |
|
|
private String fuya; |
|
|
|
|
|
|
|
|
private void LoadOrCreateEditingDayProduct(final Date time) { |
|
|
|
|
|
|
|
|
private void LoadOrCreateEditingDayProduct(final Date time, final boolean b) { |
|
|
ViewOnClickTask LoadOrCreateEditingDayProductTask = new ViewOnClickTask(this, "加载中...") { |
|
|
ViewOnClickTask LoadOrCreateEditingDayProductTask = new ViewOnClickTask(this, "加载中...") { |
|
|
@Override |
|
|
@Override |
|
|
protected void successUI() { |
|
|
protected void successUI() { |
|
|
list.clear(); |
|
|
|
|
|
tijiaoList.clear(); |
|
|
|
|
|
mTitleList.clear(); |
|
|
|
|
|
mFragmentList.clear(); |
|
|
|
|
|
DataSupport.deleteAll(WriteBean.class); |
|
|
|
|
|
detailsList = rpcObj.getManyList("Details"); |
|
|
|
|
|
for (int i = 0; i < detailsList.size(); i++) { |
|
|
|
|
|
if (detailsList.get(i).getLong("House_ID") != null) { |
|
|
|
|
|
houseid = detailsList.get(i).getLong("House_ID") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
houseid = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getString("House_Name") != null) { |
|
|
|
|
|
housename = detailsList.get(i).getString("House_Name"); |
|
|
|
|
|
} else { |
|
|
|
|
|
housename = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("Days") != null) { |
|
|
|
|
|
days = detailsList.get(i).getInt("Days") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
days = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("DieNumber") != null) { |
|
|
|
|
|
dienumber = detailsList.get(i).getInt("DieNumber") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
dienumber = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("Obsolete") != null) { |
|
|
|
|
|
obs = detailsList.get(i).getInt("Obsolete") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
obs = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("WaterIntake") != null) { |
|
|
|
|
|
water = detailsList.get(i).getDecimal("WaterIntake") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
water = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (rpcObj != null) { |
|
|
|
|
|
list.clear(); |
|
|
|
|
|
tijiaoList.clear(); |
|
|
|
|
|
mTitleList.clear(); |
|
|
|
|
|
mFragmentList.clear(); |
|
|
|
|
|
DataSupport.deleteAll(WriteBean.class); |
|
|
|
|
|
detailsList = rpcObj.getManyList("Details"); |
|
|
|
|
|
for (int i = 0; i < detailsList.size(); i++) { |
|
|
|
|
|
if (detailsList.get(i).getLong("House_ID") != null) { |
|
|
|
|
|
houseid = detailsList.get(i).getLong("House_ID") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
houseid = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getString("House_Name") != null) { |
|
|
|
|
|
housename = detailsList.get(i).getString("House_Name"); |
|
|
|
|
|
} else { |
|
|
|
|
|
housename = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("Days") != null) { |
|
|
|
|
|
days = detailsList.get(i).getInt("Days") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
days = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("DieNumber") != null) { |
|
|
|
|
|
dienumber = detailsList.get(i).getInt("DieNumber") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
dienumber = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("Obsolete") != null) { |
|
|
|
|
|
obs = detailsList.get(i).getInt("Obsolete") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
obs = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("WaterIntake") != null) { |
|
|
|
|
|
water = detailsList.get(i).getDecimal("WaterIntake") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
water = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("Weight") != null) { |
|
|
|
|
|
weight = detailsList.get(i).getDecimal("Weight") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
weight = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("MinTemperature") != null) { |
|
|
|
|
|
zuidiwendu = detailsList.get(i).getDecimal("MinTemperature") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidiwendu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getDecimal("MaxTemperature") != null) { |
|
|
|
|
|
zuigaowendu = detailsList.get(i).getDecimal("MaxTemperature") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuigaowendu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getDecimal("MinHumidity") != null) { |
|
|
|
|
|
zuidishidu = detailsList.get(i).getDecimal("MinHumidity") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidishidu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("MaxHumidity") != null) { |
|
|
|
|
|
zuigaoshidu = detailsList.get(i).getDecimal("MaxHumidity") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuigaoshidu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("NightMinAirQuantity") != null) { |
|
|
|
|
|
zuixiaotongfeng = detailsList.get(i).getString("NightMinAirQuantity"); |
|
|
|
|
|
} else { |
|
|
|
|
|
zuixiaotongfeng = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("DayMaxAirQuantity") != null) { |
|
|
|
|
|
zuidatongfeng = detailsList.get(i).getString("DayMaxAirQuantity"); |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidatongfeng = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("NegativePressure") != null) { |
|
|
|
|
|
fuya = detailsList.get(i).getString("NegativePressure") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
fuya = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WriteBean writebean = new WriteBean(); |
|
|
|
|
|
writebean.setHouseid(Long.parseLong(houseid)); |
|
|
|
|
|
writebean.setHousename(housename); |
|
|
|
|
|
writebean.setSiwang(dienumber); |
|
|
|
|
|
writebean.setTaotai(obs); |
|
|
|
|
|
writebean.setYinshuiliang(water); |
|
|
|
|
|
writebean.setTizhong(weight); |
|
|
|
|
|
writebean.setZuidiwendu(zuidiwendu); |
|
|
|
|
|
writebean.setZuigaowendu(zuigaowendu); |
|
|
|
|
|
writebean.setZuidishidu(zuidishidu); |
|
|
|
|
|
writebean.setZuigaoshidu(zuigaoshidu); |
|
|
|
|
|
writebean.setZuixiaotongfeng(zuixiaotongfeng); |
|
|
|
|
|
writebean.setZuidatongfeng(zuidatongfeng); |
|
|
|
|
|
writebean.setFuya(fuya); |
|
|
|
|
|
list.add(writebean); |
|
|
|
|
|
|
|
|
|
|
|
WriteBean writeBeandb = new WriteBean(); |
|
|
|
|
|
writeBeandb.setHouseid(Long.parseLong(houseid)); |
|
|
|
|
|
writeBeandb.setHousename(housename); |
|
|
|
|
|
writeBeandb.setSiwang(dienumber); |
|
|
|
|
|
writeBeandb.setTaotai(obs); |
|
|
|
|
|
writeBeandb.setYinshuiliang(water); |
|
|
|
|
|
writeBeandb.setTizhong(weight); |
|
|
|
|
|
writeBeandb.setZuidiwendu(zuidiwendu); |
|
|
|
|
|
writeBeandb.setZuigaowendu(zuigaowendu); |
|
|
|
|
|
writeBeandb.setZuidishidu(zuidishidu); |
|
|
|
|
|
writeBeandb.setZuigaoshidu(zuigaoshidu); |
|
|
|
|
|
writeBeandb.setZuixiaotongfeng(zuixiaotongfeng); |
|
|
|
|
|
writeBeandb.setZuidatongfeng(zuidatongfeng); |
|
|
|
|
|
writeBeandb.setFuya(fuya); |
|
|
|
|
|
writeBeandb.save(); |
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("Weight") != null) { |
|
|
|
|
|
weight = detailsList.get(i).getDecimal("Weight") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
weight = ""; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
writeBeanList = DataSupport.findAll(WriteBean.class); |
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("MinTemperature") != null) { |
|
|
|
|
|
zuidiwendu = detailsList.get(i).getDecimal("MinTemperature") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidiwendu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getDecimal("MaxTemperature") != null) { |
|
|
|
|
|
zuigaowendu = detailsList.get(i).getDecimal("MaxTemperature") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuigaowendu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getDecimal("MinHumidity") != null) { |
|
|
|
|
|
zuidishidu = detailsList.get(i).getDecimal("MinHumidity") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidishidu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("MaxHumidity") != null) { |
|
|
|
|
|
zuigaoshidu = detailsList.get(i).getDecimal("MaxHumidity") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuigaoshidu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("NightMinAirQuantity") != null) { |
|
|
|
|
|
zuixiaotongfeng = detailsList.get(i).getString("NightMinAirQuantity"); |
|
|
|
|
|
} else { |
|
|
|
|
|
zuixiaotongfeng = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("DayMaxAirQuantity") != null) { |
|
|
|
|
|
zuidatongfeng = detailsList.get(i).getString("DayMaxAirQuantity"); |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidatongfeng = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("NegativePressure") != null) { |
|
|
|
|
|
fuya = detailsList.get(i).getString("NegativePressure") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
fuya = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WriteBean writebean = new WriteBean(); |
|
|
|
|
|
writebean.setHouseid(Long.parseLong(houseid)); |
|
|
|
|
|
writebean.setHousename(housename); |
|
|
|
|
|
writebean.setSiwang(dienumber); |
|
|
|
|
|
writebean.setTaotai(obs); |
|
|
|
|
|
writebean.setYinshuiliang(water); |
|
|
|
|
|
writebean.setTizhong(weight); |
|
|
|
|
|
writebean.setZuidiwendu(zuidiwendu); |
|
|
|
|
|
writebean.setZuigaowendu(zuigaowendu); |
|
|
|
|
|
writebean.setZuidishidu(zuidishidu); |
|
|
|
|
|
writebean.setZuigaoshidu(zuigaoshidu); |
|
|
|
|
|
writebean.setZuixiaotongfeng(zuixiaotongfeng); |
|
|
|
|
|
writebean.setZuidatongfeng(zuidatongfeng); |
|
|
|
|
|
writebean.setFuya(fuya); |
|
|
|
|
|
list.add(writebean); |
|
|
|
|
|
|
|
|
|
|
|
WriteBean writeBeandb = new WriteBean(); |
|
|
|
|
|
writeBeandb.setHouseid(Long.parseLong(houseid)); |
|
|
|
|
|
writeBeandb.setHousename(housename); |
|
|
|
|
|
writeBeandb.setSiwang(dienumber); |
|
|
|
|
|
writeBeandb.setTaotai(obs); |
|
|
|
|
|
writeBeandb.setYinshuiliang(water); |
|
|
|
|
|
writeBeandb.setTizhong(weight); |
|
|
|
|
|
writeBeandb.setZuidiwendu(zuidiwendu); |
|
|
|
|
|
writeBeandb.setZuigaowendu(zuigaowendu); |
|
|
|
|
|
writeBeandb.setZuidishidu(zuidishidu); |
|
|
|
|
|
writeBeandb.setZuigaoshidu(zuigaoshidu); |
|
|
|
|
|
writeBeandb.setZuixiaotongfeng(zuixiaotongfeng); |
|
|
|
|
|
writeBeandb.setZuidatongfeng(zuidatongfeng); |
|
|
|
|
|
writeBeandb.setFuya(fuya); |
|
|
|
|
|
writeBeandb.save(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initTabLayout(); |
|
|
|
|
|
initViewPager(); |
|
|
} |
|
|
} |
|
|
writeBeanList = DataSupport.findAll(WriteBean.class); |
|
|
|
|
|
initTabLayout(); |
|
|
|
|
|
initViewPager(); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Object call() throws Exception { |
|
|
public Object call() throws Exception { |
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.LoadOrCreateEditingDayProduct, time); |
|
|
|
|
|
|
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.LoadOrCreateEditingDayProduct, time, b); |
|
|
rpcObj = result.getRpcObject(RpcUrl.LoadOrCreateEditingDayProduct_fanhui); |
|
|
rpcObj = result.getRpcObject(RpcUrl.LoadOrCreateEditingDayProduct_fanhui); |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
@ -274,7 +429,6 @@ public class WriteDActivity extends BaseActivity implements CalendarDialogFragme |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initTabLayout() { |
|
|
private void initTabLayout() { |
|
|
|
|
|
|
|
|
for (int i = 0; i < writeBeanList.size(); i++) { |
|
|
for (int i = 0; i < writeBeanList.size(); i++) { |
|
|
@ -297,9 +451,159 @@ public class WriteDActivity extends BaseActivity implements CalendarDialogFragme |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void onStartCalendarClick(Date date) { |
|
|
|
|
|
LoadOrCreateEditingDayProduct(date); |
|
|
|
|
|
tv_toolbar_title.setText(DateTimeUtil.getYMD2(date)); |
|
|
|
|
|
|
|
|
public void onStartCalendarClick(final Date date) { |
|
|
|
|
|
ViewOnClickTask LoadOrCreateEditingDayProductTask = new ViewOnClickTask(this, "加载中...") { |
|
|
|
|
|
@Override |
|
|
|
|
|
protected void successUI() { |
|
|
|
|
|
if (rpcObj != null) { |
|
|
|
|
|
list.clear(); |
|
|
|
|
|
tijiaoList.clear(); |
|
|
|
|
|
mTitleList.clear(); |
|
|
|
|
|
mFragmentList.clear(); |
|
|
|
|
|
DataSupport.deleteAll(WriteBean.class); |
|
|
|
|
|
detailsList = rpcObj.getManyList("Details"); |
|
|
|
|
|
for (int i = 0; i < detailsList.size(); i++) { |
|
|
|
|
|
if (detailsList.get(i).getLong("House_ID") != null) { |
|
|
|
|
|
houseid = detailsList.get(i).getLong("House_ID") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
houseid = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getString("House_Name") != null) { |
|
|
|
|
|
housename = detailsList.get(i).getString("House_Name"); |
|
|
|
|
|
} else { |
|
|
|
|
|
housename = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("Days") != null) { |
|
|
|
|
|
days = detailsList.get(i).getInt("Days") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
days = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("DieNumber") != null) { |
|
|
|
|
|
dienumber = detailsList.get(i).getInt("DieNumber") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
dienumber = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("Obsolete") != null) { |
|
|
|
|
|
obs = detailsList.get(i).getInt("Obsolete") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
obs = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("WaterIntake") != null) { |
|
|
|
|
|
water = detailsList.get(i).getDecimal("WaterIntake") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
water = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("Weight") != null) { |
|
|
|
|
|
weight = detailsList.get(i).getDecimal("Weight") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
weight = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("MinTemperature") != null) { |
|
|
|
|
|
zuidiwendu = detailsList.get(i).getDecimal("MinTemperature") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidiwendu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getDecimal("MaxTemperature") != null) { |
|
|
|
|
|
zuigaowendu = detailsList.get(i).getDecimal("MaxTemperature") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuigaowendu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getDecimal("MinHumidity") != null) { |
|
|
|
|
|
zuidishidu = detailsList.get(i).getDecimal("MinHumidity") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidishidu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("MaxHumidity") != null) { |
|
|
|
|
|
zuigaoshidu = detailsList.get(i).getDecimal("MaxHumidity") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
zuigaoshidu = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("NightMinAirQuantity") != null) { |
|
|
|
|
|
zuixiaotongfeng = detailsList.get(i).getString("NightMinAirQuantity"); |
|
|
|
|
|
} else { |
|
|
|
|
|
zuixiaotongfeng = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("DayMaxAirQuantity") != null) { |
|
|
|
|
|
zuidatongfeng = detailsList.get(i).getString("DayMaxAirQuantity"); |
|
|
|
|
|
} else { |
|
|
|
|
|
zuidatongfeng = ""; |
|
|
|
|
|
} |
|
|
|
|
|
if (detailsList.get(i).getString("NegativePressure") != null) { |
|
|
|
|
|
fuya = detailsList.get(i).getString("NegativePressure") + ""; |
|
|
|
|
|
} else { |
|
|
|
|
|
fuya = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WriteBean writebean = new WriteBean(); |
|
|
|
|
|
writebean.setHouseid(Long.parseLong(houseid)); |
|
|
|
|
|
writebean.setHousename(housename); |
|
|
|
|
|
writebean.setSiwang(dienumber); |
|
|
|
|
|
writebean.setTaotai(obs); |
|
|
|
|
|
writebean.setYinshuiliang(water); |
|
|
|
|
|
writebean.setTizhong(weight); |
|
|
|
|
|
writebean.setZuidiwendu(zuidiwendu); |
|
|
|
|
|
writebean.setZuigaowendu(zuigaowendu); |
|
|
|
|
|
writebean.setZuidishidu(zuidishidu); |
|
|
|
|
|
writebean.setZuigaoshidu(zuigaoshidu); |
|
|
|
|
|
writebean.setZuixiaotongfeng(zuixiaotongfeng); |
|
|
|
|
|
writebean.setZuidatongfeng(zuidatongfeng); |
|
|
|
|
|
writebean.setFuya(fuya); |
|
|
|
|
|
list.add(writebean); |
|
|
|
|
|
|
|
|
|
|
|
WriteBean writeBeandb = new WriteBean(); |
|
|
|
|
|
writeBeandb.setHouseid(Long.parseLong(houseid)); |
|
|
|
|
|
writeBeandb.setHousename(housename); |
|
|
|
|
|
writeBeandb.setSiwang(dienumber); |
|
|
|
|
|
writeBeandb.setTaotai(obs); |
|
|
|
|
|
writeBeandb.setYinshuiliang(water); |
|
|
|
|
|
writeBeandb.setTizhong(weight); |
|
|
|
|
|
writeBeandb.setZuidiwendu(zuidiwendu); |
|
|
|
|
|
writeBeandb.setZuigaowendu(zuigaowendu); |
|
|
|
|
|
writeBeandb.setZuidishidu(zuidishidu); |
|
|
|
|
|
writeBeandb.setZuigaoshidu(zuigaoshidu); |
|
|
|
|
|
writeBeandb.setZuixiaotongfeng(zuixiaotongfeng); |
|
|
|
|
|
writeBeandb.setZuidatongfeng(zuidatongfeng); |
|
|
|
|
|
writeBeandb.setFuya(fuya); |
|
|
|
|
|
writeBeandb.save(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
writeBeanList = DataSupport.findAll(WriteBean.class); |
|
|
|
|
|
|
|
|
|
|
|
initTabLayout(); |
|
|
|
|
|
initViewPager(); |
|
|
|
|
|
tv_toolbar_title.setText(DateTimeUtil.getYMD2(date)); |
|
|
|
|
|
} else if (rpcObj == null) { |
|
|
|
|
|
new AlertDialog.Builder(WriteDActivity.this) |
|
|
|
|
|
.setTitle("提示") |
|
|
|
|
|
.setMessage("是否新建日志") |
|
|
|
|
|
.setPositiveButton("确定", new DialogInterface.OnClickListener() { |
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) { |
|
|
|
|
|
LoadOrCreateEditingDayProduct(date, true); |
|
|
|
|
|
tv_toolbar_title.setText(DateTimeUtil.getYMD2(date)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).show(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Object call() throws Exception { |
|
|
|
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.LoadOrCreateEditingDayProduct, date, false); |
|
|
|
|
|
rpcObj = result.getRpcObject(RpcUrl.LoadOrCreateEditingDayProduct_fanhui); |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
LoadOrCreateEditingDayProductTask.execute(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
|