diff --git a/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/service/impl/UrkSendServiceImpl.java b/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/service/impl/UrkSendServiceImpl.java index 185c6b5..4cc433b 100644 --- a/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/service/impl/UrkSendServiceImpl.java +++ b/bonus-modules/bonus-bmw/src/main/java/com/bonus/bmw/service/impl/UrkSendServiceImpl.java @@ -17,6 +17,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -87,7 +88,7 @@ public class UrkSendServiceImpl implements UrkSendService { //等待执行 taskVo.setTransStatus(TaskStatusEnum.WAIT.ordinal()); //分页查询 - sendUserToDevice(userId,proId,supId,teamId,1,taskVo); + sendUserToDevice(userId,proId,supId,teamId,1,0,taskVo); }catch (Exception e){ log.error(e.toString(),e); throw new Exception("人员下发失败"); @@ -118,7 +119,7 @@ public class UrkSendServiceImpl implements UrkSendService { //等待执行 taskVo.setTransStatus(TaskStatusEnum.WAIT.ordinal()); //分页查询 - sendUserToDevice(userId,proId,supId,teamId,1,taskVo); + sendUserToDevice(userId,proId,supId,teamId,1,0,taskVo); }catch (Exception e){ log.error(e.toString(),e); throw new Exception("人员出场失败"); @@ -162,7 +163,7 @@ public class UrkSendServiceImpl implements UrkSendService { //等待执行 taskVo.setTransStatus(TaskStatusEnum.WAIT.ordinal()); //分页查询 - sendUserToDeviceList(value,key,1,taskVo); + sendUserToDeviceList(value,key,1,0,taskVo); }); }catch (Exception e){ log.error(e.toString(),e); @@ -200,23 +201,34 @@ public class UrkSendServiceImpl implements UrkSendService { - public void sendUserToDeviceList(List userId,String key,int pageNum, BmwKqCmdTaskVo taskVo){ - List list; + public void sendUserToDeviceList(List userId,String key,int pageNum, int type,BmwKqCmdTaskVo taskVo){ + List list ; PageHelper.startPage(pageNum, PAGE_SIZE); String proId=key.split("-")[0]; String teamId=key.split("-")[2]; String supId=key.split("-")[1]; + if(type==1){ + list=mapper.getDeviceVoByProId(Integer.parseInt(proId),Integer.parseInt(teamId),Integer.parseInt(supId)); + }else if(type==2){ + list=mapper.getDeviceVoByProId(Integer.parseInt(proId),Integer.parseInt(teamId),0); + }else if(type==3){ + list=mapper.getDeviceVoByProId(Integer.parseInt(proId), 0, 0); + }else{ + type=1; + //多次查询 人员-分包-工程的考勤机进行下发 + list=mapper.getDeviceVoByProId(Integer.parseInt(proId),Integer.parseInt(teamId),Integer.parseInt(supId)); + if(StringUtils.isEmpty(list)){ + type=2; + PageHelper.startPage(pageNum, PAGE_SIZE); + list=mapper.getDeviceVoByProId(Integer.parseInt(proId),Integer.parseInt(teamId),0); + } + if(StringUtils.isEmpty(list)) { + type=3; + PageHelper.startPage(pageNum, PAGE_SIZE); + list=mapper.getDeviceVoByProId(Integer.parseInt(proId), 0, 0); + } + } - //多次查询 人员-分包-工程的考勤机进行下发 - list=mapper.getDeviceVoByProId(Integer.parseInt(proId),Integer.parseInt(teamId),Integer.parseInt(supId)); - if(StringUtils.isEmpty(list)){ - PageHelper.startPage(pageNum, PAGE_SIZE); - mapper.getDeviceVoByProId(Integer.parseInt(proId),Integer.parseInt(teamId),0); - } - if(StringUtils.isEmpty(list)){ - PageHelper.startPage(pageNum, PAGE_SIZE); - mapper.getDeviceVoByProId(Integer.parseInt(proId),0,0); - } PageInfo pageInfo =new PageInfo(list); //分页查询+ if (!list.isEmpty()){ @@ -235,7 +247,7 @@ public class UrkSendServiceImpl implements UrkSendService { int pageTotal=pageInfo.getPages(); if(pageSize list; PageHelper.startPage(pageNum,PAGE_SIZE); - //查询考勤机 - List list=mapper.getDeviceVoByProId(proId,supId,teamId); - if(StringUtils.isEmpty(list)){ - PageHelper.startPage(pageNum,PAGE_SIZE); + if(type==1){ + list=mapper.getDeviceVoByProId(proId,supId,teamId); + }else if(type==2){ list=mapper.getDeviceVoByProId(proId,supId,0); - } - if(StringUtils.isEmpty(list)){ - PageHelper.startPage(pageNum,PAGE_SIZE); + }else if(type==3){ list=mapper.getDeviceVoByProId(proId,0,0); + }else{ + //查询考勤机 + type=1; + list=mapper.getDeviceVoByProId(proId,supId,teamId); + if(StringUtils.isEmpty(list)){ + type=2; + PageHelper.startPage(pageNum,PAGE_SIZE); + list=mapper.getDeviceVoByProId(proId,supId,0); + } + if(StringUtils.isEmpty(list)){ + type=3; + PageHelper.startPage(pageNum,PAGE_SIZE); + list=mapper.getDeviceVoByProId(proId,0,0); + } } PageInfo pageInfo =new PageInfo(list); //分页查询+ @@ -335,7 +358,7 @@ public class UrkSendServiceImpl implements UrkSendService { int pageTotal=pageInfo.getPages(); if(pageSize