| | |
| | | result = tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | | //设置电池组充电电流阈值
|
| | | public String update_charge() {
|
| | | BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class);
|
| | | ServiceModel model = service.update_charge(binf);
|
| | | result = tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | | //删除电池组
|
| | | public String delete() {
|
| | | List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
|
| | |
| | | boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, null);
|
| | | return bl;
|
| | | }
|
| | | |
| | | //设置电池组充电电流阈值
|
| | | public boolean update_charge(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql = "update db_battinf.tb_battinf set charge_curr_max=? where BattGroupId=?";
|
| | | boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, new Object[]{binf.getCharge_curr_max(),binf.getBattGroupId()});
|
| | | return bl;
|
| | | }
|
| | | //删除电池组(多个)
|
| | | public boolean del(Object obj) {
|
| | | List<BattInf> list=(List<BattInf>) obj;
|
| | |
| | | //System.out.println(model);
|
| | | return model;
|
| | | }
|
| | | |
| | | //设置电池组充电电流阈值
|
| | | public ServiceModel update_charge(Object obj){
|
| | | boolean bl=((BattInfImpl)dao).update_charge(obj);
|
| | | if(bl){ |
| | | model.setCode(1);
|
| | | model.setMsg("修改成功!");
|
| | | }else{
|
| | | model.setCode(0);
|
| | | model.setMsg("修改失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | | //删除电池组
|
| | | public ServiceModel delete(Object obj) {
|
| | | Boolean bl=dao.del(obj);
|