package com.fgkj.services.Ld9;
|
|
import java.util.List;
|
|
import com.fgkj.dao.BaseDAO;
|
import com.fgkj.dao.BaseDAOFactory;
|
import com.fgkj.dao.impl.BattInfImpl;
|
import com.fgkj.dao.impl.Batt_rtdataDAOImpl;
|
import com.fgkj.dao.impl.Ld9.LD9_setparamImpl;
|
import com.fgkj.dao.impl.ram.Fbs9100_setparamImpl;
|
import com.fgkj.dto.BattInf;
|
import com.fgkj.dto.LD9_setparam;
|
import com.fgkj.dto.ServiceModel;
|
import com.fgkj.dto.ram.Fbs9100_setparam;
|
|
public class LD9_setparamService {
|
private BaseDAO dao;
|
private ServiceModel model;
|
|
public LD9_setparamService() {
|
super();
|
this.dao =BaseDAOFactory.getBaseDAO(BaseDAO.LD9_SETPARAM);
|
this.model = new ServiceModel();
|
}
|
|
//弹出框的确定操作
|
public ServiceModel update(Object obj) {
|
LD9_setparam ld9=(LD9_setparam) obj;
|
Boolean b=dao.update(obj);
|
if(b){
|
boolean bl=((LD9_setparamImpl)dao).sendCmdToLd9Dev(ld9.getNum(), ld9.getDev_id());
|
if(bl){
|
model.setCode(1);
|
model.setMsg("修改成功!");
|
}else{
|
model.setCode(0);
|
model.setMsg("设置ld9参数失败,请检查网络!");
|
}
|
}else{
|
model.setCode(0);
|
model.setMsg("修改失败!");
|
}
|
return model;
|
}
|
//根据机房编号和维护区查询放电机房的信息和放电参数
|
public ServiceModel serchByCondition(Object obj){
|
BattInf binf=(BattInf) obj;
|
int dev_id=(new BattInfImpl()).serchDev_id(binf);
|
boolean bl=((LD9_setparamImpl)dao).sendCmdToLd9Dev(binf.getNum(), dev_id);
|
List list=dao.serchByCondition(obj);
|
if(bl){
|
model.setCode(1);
|
model.setData(list);
|
model.setMsg("查询成功!");
|
|
}else{
|
model.setCode(0);
|
model.setData(list);
|
model.setMsg("查询失败!");
|
}
|
return model;
|
}
|
|
//右键查看参数和弹出框的刷新按钮
|
public ServiceModel serchbyDev_id(Object obj) {
|
LD9_setparam ld9=(LD9_setparam) obj;
|
boolean bl=((LD9_setparamImpl)dao).sendCmdToLd9Dev(ld9.getNum(), ld9.getDev_id());
|
List list=((LD9_setparamImpl)dao).serchbyDev_id(obj);
|
if(bl){
|
model.setCode(1);
|
model.setData(list);
|
model.setMsg("查询成功!");
|
|
}else{
|
model.setCode(0);
|
model.setData(list);
|
model.setMsg("设置9100参数失败,请检查网络!");
|
}
|
//System.out.println(model.getData());
|
return model;
|
}
|
|
|
//根据电池组id查询电池组内前五的内阻数据
|
public ServiceModel serchByThirdBatt(Object obj){
|
List list=(new Batt_rtdataDAOImpl()).serchByThirdBatt(obj);
|
if(list!=null&&list.size()>0){
|
model.setCode(1);
|
model.setData(list);
|
model.setMsg("查询成功!");
|
}else{
|
model.setCode(0);
|
model.setMsg("查询失败!");
|
}
|
return model;
|
}
|
}
|