package com.fgkj.services;
|
|
import com.fgkj.dto.ServiceModel;
|
import com.fgkj.dto.Task_Batt_Test;
|
import com.fgkj.dto.User_task_change;
|
import com.fgkj.mapper.TestDaoFactory;
|
import com.fgkj.mapper.UtilityFactory;
|
import com.fgkj.mapper.impl.User_task_changeMapper;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
import javax.annotation.Resource;
|
@Service
|
public class User_task_changeService {
|
|
@Resource
|
private User_task_changeMapper mapper;
|
|
//4.1作业变更申请
|
public ServiceModel add(User_task_change obj) {
|
ServiceModel model = new ServiceModel();
|
Boolean bl=mapper.add(obj);
|
if(bl){
|
model.setCode(1);
|
model.setMsg("提交变更申请成功!");
|
}
|
else{
|
model.setMsg("提交变更申请失败!");
|
}
|
return model;
|
|
}
|
//4.5作业变更查询(审批)
|
public ServiceModel update(User_task_change obj) {
|
ServiceModel model = new ServiceModel();
|
Boolean bl=mapper.update(obj);
|
if(bl){
|
model.setCode(1);
|
model.setMsg("作业审批成功!");
|
}
|
else{
|
model.setMsg("作业审批失败!");
|
}
|
return model;
|
}
|
//4.5作业变更查询(删除记录)
|
public ServiceModel delete(User_task_change obj) {
|
ServiceModel model = new ServiceModel();
|
Boolean bl=mapper.del(obj);
|
if(bl){
|
model.setCode(1);
|
model.setMsg("删除记录成功!");
|
}
|
else{
|
model.setMsg("删除记录失败!");
|
}
|
return model;
|
}
|
//4.5作业变更查询
|
public ServiceModel serchByCondition(Task_Batt_Test obj) {
|
ServiceModel model = new ServiceModel();
|
List<Task_Batt_Test> list = mapper.serchByCondition(obj);
|
if (list != null && list.size() > 0) {
|
for (int i = 0; i < list.size(); i++) {
|
System.out.println("list = " + list.get(i));
|
/***
|
* {
|
* utask=null,
|
* utest=null,
|
* ulist=null,
|
* binf=BattInf{
|
* num=null,
|
* stationId='null',
|
* stationName='山西省-太原市-迎泽区-局机房119-局机房站-1',
|
* 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=1000001,
|
* battGroupNum=null,
|
* battGroupName='电池组1',
|
* 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=null,
|
* uchange=User_task_change[
|
* num=1,
|
* usr_id=1001,
|
* master_id=0,
|
* appoint_uid=1001,
|
* copy_uids=1001,
|
* change_type_id=0,
|
* task_type_id=0,
|
* task_rc_num=10580,
|
* BattgroupId=1000001,
|
* change_reason=有新的任务,
|
* old_executor_ids=1001,
|
* old_task_exe_time=ThuSep0800: 00: 00CST2016,
|
* new_executor_ids=0,
|
* new_task_exe_time=TueSep0600: 00: 00CST2016,
|
* change_ask_time=ThuSep0811: 32: 02CST2016,
|
* change_ask_time1=null,
|
* change_ask_time_limit=ThuSep0811: 32: 02CST2016,
|
* task_change_approve_time=SatOct2217: 13: 55CST2016,
|
* task_change_approve_time1=null,
|
* task_change_approve_res=1,
|
* remark=通过
|
* ],
|
* uinf=null,
|
* pageBean=null
|
* }
|
*/
|
String Uname = UtilityFactory.UidsToUnames(list.get(i).getUchange().getUsr_id().toString());//TODO 待完成
|
list.get(i).getBinf().setStationName2(Uname);
|
|
String Cname = UtilityFactory.UidsToUnames(list.get(i).getUchange().getCopy_uids());
|
list.get(i).getBinf().setStationName3(Cname);
|
|
String Aname = UtilityFactory.UidsToUnames(list.get(i).getUchange().getAppoint_uid().toString());
|
list.get(i).getBinf().setStationName4(Aname);
|
// System.out.println(Uname+" "+Cname+" "+Aname);
|
String task_type = TestDaoFactory.getTaskType(list.get(i).getUchange().getTask_type_id());
|
list.get(i).getBinf().setStationName5(task_type);
|
|
String change_type = TestDaoFactory.getChangeType(list.get(i).getUchange().getChange_type_id());
|
list.get(i).getBinf().setStationName6(change_type);
|
|
String Oname = UtilityFactory.UidsToUnames(list.get(i).getUchange().getOld_executor_ids());
|
list.get(i).getBinf().setStationName7(Oname);
|
|
String Nname = UtilityFactory.UidsToUnames(list.get(i).getUchange().getNew_executor_ids());
|
list.get(i).getBinf().setStationName8(Nname);
|
|
String approve_res = TestDaoFactory.getApprove_res(list.get(i).getUchange().getTask_change_approve_res());
|
list.get(i).getBinf().setStationName9(approve_res);
|
}
|
}
|
// for (Task_Batt_Test t : list) {
|
// System.out.println(t.getBinf());
|
// }
|
if (list != null && list.size() > 0) {
|
model.setCode(1);
|
model.setData(list);
|
}
|
// System.out.println(model);
|
return model;
|
}
|
|
|
public ServiceModel searchAll(){
|
ServiceModel model = new ServiceModel();
|
List list=mapper.searchAll();
|
// for (Object object : list) {
|
// System.out.println(object);
|
// }
|
//System.out.println(list);
|
if(list!=null && list.size()>0){
|
model.setCode(1);
|
model.setData(list);
|
}
|
// System.out.println(model);
|
return model;
|
}
|
|
}
|