update maintCheck.byCondition
| | |
| | | import com.fgkj.mapper.impl.User_battmaint_checkMapper; |
| | | import com.fgkj.mapper.impl.User_battmaint_check_processMapper; |
| | | import com.fgkj.mapper.impl.User_infMapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | public ServiceModel serchByCondition(Task_Batt_Test tbt){ |
| | | System.out.println("tbt = " + tbt); |
| | | ServiceModel model=new ServiceModel(); |
| | | List<Task_Batt_Test> listsrc=mapper.serchByCondition(tbt); |
| | | int index=0; |
| | | List<Task_Batt_Test> list=new ArrayList(); |
| | | int i1 = (tbt.getPageBean().getPageCurr() - 1) * tbt.getPageBean().getPageSize(); |
| | | int i2 = tbt.getPageBean().getPageSize() * tbt.getPageBean().getPageCurr(); |
| | | System.out.println("i= " + i1+" ;i < " + i2 + "&& "+listsrc.size()); |
| | | for(int i = i1; i< i2 &&i<listsrc.size(); i++){ |
| | | // for(int i=(tbt.getPageBean().getPageCurr()-1)*tbt.getPageBean().getPageSize();i<tbt.getPageBean().getPageSize()*tbt.getPageBean().getPageCurr()&&i<list.size();i++){ |
| | | list.add(listsrc.get(i)); |
| | | System.out.println(i); |
| | | list.get(i).setPageBean(new PageBean()); |
| | | list.get(i).setBinf(listsrc.get(i).getBinf()); |
| | | list.get(i).setMcheck(listsrc.get(i).getMcheck()); |
| | | (list.get(index++)).getPageBean().setPageAll(listsrc.size()); |
| | | System.out.println("list.get(i) = " + list.get(i)); |
| | | } |
| | | //分页 |
| | | PageBean pageBean = tbt.getPageBean(); |
| | | PageHelper.startPage(pageBean.getPageNum(),pageBean.getPageSize(),true); |
| | | List<Task_Batt_Test> list=mapper.serchByCondition(tbt); |
| | | User_inf uinf=new User_inf(); |
| | | int usr_id=0;//责任人 |
| | | String usr_name=""; |
| | |
| | | int copy_id=0; |
| | | String copy_name=""; |
| | | String[] copy_names; |
| | | System.out.println("list = " + list.size()); |
| | | System.out.println(" list.size = " + list.size()); |
| | | for(int i=0;i<list.size();i++){ |
| | | /*** |
| | | * [ |
| | | * Task_Batt_Test{ |
| | | * utask=null, |
| | | * utest=null, |
| | | * ulist=null, |
| | | * binf=BattInf{ |
| | | * num=null, |
| | | * stationId='351000126', |
| | | * stationName='湖北省-武汉市-东西湖区-61850机房-2G-2G-2', |
| | | * stationName1='null', |
| | | * stationName2='null', |
| | | * stationName3='null', |
| | | * stationName4='null', |
| | | * stationName5='null', |
| | | * stationName6='null', |
| | | * stationName7='null', |
| | | * stationName8='null', |
| | | * stationName9='null', |
| | | * stationIp='null', |
| | | * fbsDeviceId=null, |
| | | * fbsDeviceIp='null', |
| | | * fbsDeviceIp_YM='null', |
| | | * fbsDeviceIp_WG='null', |
| | | * fbsDeviceIp_old='null', |
| | | * fbsDeviceIp_YM_old='null', |
| | | * fbsDeviceIp_WG_old='null', |
| | | * fbsDeviceName='null', |
| | | * groupIndexInFBSDevice=null, |
| | | * battModel='null', |
| | | * battGroupId=null, |
| | | * battGroupNum=null, |
| | | * battGroupName='null', |
| | | * battGroupName1='null', |
| | | * battGroupName2='null', |
| | | * battGroupName3='null', |
| | | * battGroupName4='null', |
| | | * battGroupName5='null', |
| | | * battGroupName6='null', |
| | | * floatVolLevel=null, |
| | | * offlineVolLevel=null, |
| | | * battFloatCurrent=null, |
| | | * deviceId='null', |
| | | * deviceName='null', |
| | | * monCount=null, |
| | | * monCapStd=null, |
| | | * monResStd=null, |
| | | * monSerStd=null, |
| | | * monTmpStd=null, |
| | | * monVolStd=null, |
| | | * monVolLowToAvg=null, |
| | | * monNum=null, |
| | | * battProducer='null', |
| | | * battProductDate=null, |
| | | * battProductDate1=null, |
| | | * battInUseDate=null, |
| | | * battInUseDate1=null, |
| | | * battGuarantDayCount=null, |
| | | * signalId='null', |
| | | * cInterFaceId=null, |
| | | * load_curr=null, |
| | | * disCurrMax=null, |
| | | * signalName='null', |
| | | * startNum=null, |
| | | * size=null, |
| | | * station_phone='null', |
| | | * install_user='null', |
| | | * station_install=null, |
| | | * stationId_ex='null', |
| | | * videoOrImage='null', |
| | | * vol_grade=null, |
| | | * manufacturers='null', |
| | | * assetequipment='null', |
| | | * deviceclasspath='null', |
| | | * deviceoperationdepartment='null', |
| | | * propertyRightUnit='null', |
| | | * propertyAttribute='null', |
| | | * factoryNumber='null', |
| | | * operationTeam='null', |
| | | * deviceIdentityCode='null', |
| | | * projectType='null', |
| | | * batteryApplicationType='null', |
| | | * singleRatedVoltage=null, |
| | | * remoteMonitor='null', |
| | | * batttIndependentPlaced='null', |
| | | * junChargeVoltageValue=null |
| | | * }, |
| | | * ucheck=null, |
| | | * mcheck=User_battmaint_check[ |
| | | * num=1, |
| | | * StationId=351000126, |
| | | * usr_id=1001, |
| | | * master_id=1002, |
| | | * appoint_uid=1001, |
| | | * copy_uids=1001, |
| | | * 1002, |
| | | * 1003, |
| | | * 1004, |
| | | * 1008, |
| | | * task_type_id=1, |
| | | * task_level=3, |
| | | * task_caption=, |
| | | * task_time_start=FriAug1200: 00: 00CST2016, |
| | | * task_time_end=FriAug1200: 00: 00CST2016, |
| | | * task_process=, |
| | | * task_done=0, |
| | | * task_done_time=MonNov2809: 50: 48CST2016, |
| | | * origin_usr_work_mark=10, |
| | | * origin_usr_work_mark1=null, |
| | | * task_done_confirm=0, |
| | | * master_audit=0, |
| | | * remark=null |
| | | * ], |
| | | * uchange=null, |
| | | * uinf=null, |
| | | * pageBean=PageBean{ |
| | | * pageSize=6, |
| | | * pageNum=null, |
| | | * totalSize=null, |
| | | * totalPages=null, |
| | | * data=null, |
| | | * pageCurr=1, |
| | | * pageAll=156 |
| | | * } |
| | | * } |
| | | * ] |
| | | * |
| | | */ |
| | | |
| | | BattInf binf=new BattInf(); |
| | | //电池组组数 |
| | | binf.setStationName(list.get(i).getMcheck().getRemark()); |
| | |
| | | binf.setStationName8(appoint_name); |
| | | //System.out.println(usr_name+" "+master_name+" "+appoint_name); |
| | | copy_ids=list.get(i).getMcheck().getCopy_uids(); |
| | | System.out.println("copy_ids = " + copy_ids); //TODO 测试rzg |
| | | System.out.println("copy_ids = " + copy_ids); //1001,1002,1003,1004,1008 |
| | | copy_names=copy_ids.split(","); |
| | | for(int j=0;j<copy_names.length;j++){ |
| | | copy_id=Integer.parseInt(copy_names[j]); |
| | |
| | | } |
| | | if(list!=null && list.size()>0){ |
| | | model.setCode(1); |
| | | model.setData(list); |
| | | PageInfo<Task_Batt_Test> pageInfo = new PageInfo<>(list); |
| | | model.setData(pageInfo); |
| | | } |
| | | List<Task_Batt_Test> listt=(List<Task_Batt_Test>)model.getData(); |
| | | // for (Task_Batt_Test t : listt) { |
| | | // System.out.println(t.getBinf().getStationName9()+" "+t.getMcheck().getCopy_uids()); |
| | | // } |
| | | |
| | | return model; |
| | | } |
| | | |