修改人脸下发及逻辑
This commit is contained in:
parent
0045746422
commit
5d89392c8f
|
|
@ -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<Integer> userId,String key,int pageNum, BmwKqCmdTaskVo taskVo){
|
||||
List<BmwDeviceVo> list;
|
||||
public void sendUserToDeviceList(List<Integer> userId,String key,int pageNum, int type,BmwKqCmdTaskVo taskVo){
|
||||
List<BmwDeviceVo> 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<BmwDeviceVo> pageInfo =new PageInfo<BmwDeviceVo>(list);
|
||||
//分页查询+
|
||||
if (!list.isEmpty()){
|
||||
|
|
@ -235,7 +247,7 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
int pageTotal=pageInfo.getPages();
|
||||
if(pageSize<pageTotal){
|
||||
pageNum++;
|
||||
sendUserToDeviceList(userId,proId,pageNum,taskVo);
|
||||
sendUserToDeviceList(userId,proId,pageNum,type,taskVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -301,18 +313,29 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
* @param pageNum
|
||||
* @param taskVo
|
||||
*/
|
||||
public void sendUserToDevice(int userId,int proId,int supId,int teamId,int pageNum, BmwKqCmdTaskVo taskVo){
|
||||
|
||||
public void sendUserToDevice(int userId,int proId,int supId,int teamId,int pageNum, int type,BmwKqCmdTaskVo taskVo){
|
||||
List<BmwDeviceVo> list;
|
||||
PageHelper.startPage(pageNum,PAGE_SIZE);
|
||||
//查询考勤机
|
||||
List<BmwDeviceVo> 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<BmwDeviceVo> pageInfo =new PageInfo<BmwDeviceVo>(list);
|
||||
//分页查询+
|
||||
|
|
@ -335,7 +358,7 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
int pageTotal=pageInfo.getPages();
|
||||
if(pageSize<pageTotal){
|
||||
pageNum++;
|
||||
sendUserToDevice(userId,proId,supId,teamId,pageNum,taskVo);
|
||||
sendUserToDevice(userId,proId,supId,teamId,pageNum,type,taskVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue