修改人脸下发及逻辑
This commit is contained in:
parent
4230781a4e
commit
397766e40a
|
|
@ -32,6 +32,11 @@ public class PmAttDevice {
|
|||
*/
|
||||
private Integer proId;
|
||||
|
||||
|
||||
private Integer subId;
|
||||
|
||||
private Integer teamId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
@ -73,4 +78,5 @@ public class PmAttDevice {
|
|||
* 在线状态
|
||||
*/
|
||||
private String onLine;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@ public class BmwKqCmdTaskVo {
|
|||
* 工程id
|
||||
*/
|
||||
private String proId;
|
||||
|
||||
private String supId;
|
||||
|
||||
private String teamId;
|
||||
/**
|
||||
* 更新事件
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public interface UrkSendMapper {
|
|||
* @param proId
|
||||
* @return
|
||||
*/
|
||||
List<String> getOnSiteUser(@Param("proId") int proId);
|
||||
List<String> getOnSiteUser(@Param("proId") int proId,@Param("subId") int subId,@Param("teamId") int teamId);
|
||||
|
||||
/**
|
||||
* 批量插入 任务人员管理表
|
||||
|
|
@ -71,7 +71,7 @@ public interface UrkSendMapper {
|
|||
* @param proId
|
||||
* @return
|
||||
*/
|
||||
List<BmwDeviceVo> getDeviceVoByProId(@Param("proId") int proId);
|
||||
List<BmwDeviceVo> getDeviceVoByProId(@Param("proId") int proId,@Param("supId") int supId,@Param("teamId") int teamId);
|
||||
|
||||
/**
|
||||
* 查询工程是否史上海工程
|
||||
|
|
|
|||
|
|
@ -7,13 +7,15 @@ import java.util.List;
|
|||
* 考情急业务接口层
|
||||
*/
|
||||
public interface UrkSendService {
|
||||
/**
|
||||
*新增考勤机、考勤机绑定工程时
|
||||
* @param deviceCode
|
||||
* @param proId
|
||||
* @return
|
||||
*/
|
||||
void getUserSendToDev(String deviceCode,int proId) throws Exception;
|
||||
/**
|
||||
* 新增考勤机、考勤机绑定工程时
|
||||
* @param deviceCode
|
||||
* @param subId
|
||||
* @param teamId
|
||||
* @param proId
|
||||
* @throws Exception
|
||||
*/
|
||||
void getUserSendToDev(String deviceCode,int subId,int teamId,int proId) throws Exception;
|
||||
|
||||
/**
|
||||
* 人员入场 及人员修改时触发
|
||||
|
|
@ -21,27 +23,27 @@ public interface UrkSendService {
|
|||
* @param proId
|
||||
* @param update
|
||||
*/
|
||||
void sendUserToDevice(int userId,int proId,String update) throws Exception;
|
||||
void sendUserToDevice(int userId,int proId,int supId,int teamId,String update) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除当前考勤机的全部人员
|
||||
* @param userId
|
||||
* @param proId
|
||||
*/
|
||||
void delUserByDevice(int userId, int proId) throws Exception;
|
||||
void delUserByDevice(int userId, int proId,int supId,int teamId) throws Exception;
|
||||
|
||||
/**
|
||||
* 人员批量出场时候触发
|
||||
* @param userId
|
||||
* @param proId
|
||||
*/
|
||||
void delUserByDeviceList(List<Integer> userId , List<Integer> proId) throws Exception;
|
||||
void delUserByDeviceList(List<Integer> userId , List<Integer> proId,List<Integer> supId,List<Integer> teamId) throws Exception;
|
||||
|
||||
/**
|
||||
* 考勤机解绑时触发,删除时触发
|
||||
* @param deviceCode
|
||||
* @param proId
|
||||
*/
|
||||
void delDevByProId(String deviceCode, int proId) throws Exception;
|
||||
void delDevByProId(String deviceCode, int proId,int supId,int teamId) throws Exception;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ public class AppServiceImpl implements AppService {
|
|||
int i = mapper.updateFileMsg(record.getPhotoIds(), Constants.FILE_UPLOAD_WORKER, record.getId());
|
||||
log.error("app更新人员人脸图片信息成功条数:{}", i);
|
||||
//下发人脸到考勤机
|
||||
urkSendService.sendUserToDevice(record.getId(), record.getProId(), "0");
|
||||
urkSendService.sendUserToDevice(record.getId(), record.getProId(), record.getSubId(), record.getTeamId(),"0");
|
||||
//下发人脸到人脸库
|
||||
FaceRecognitionBean faceRecognitionBean = new FaceRecognitionBean();
|
||||
faceRecognitionBean.setUniqueKey(record.getIdNumber());
|
||||
|
|
@ -193,10 +193,10 @@ public class AppServiceImpl implements AppService {
|
|||
//下发人脸到考勤机
|
||||
if(record.getEinStatus() == 1){
|
||||
//没换工程换人脸
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(),"1");
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(), record.getSubId(), record.getTeamId(), "1");
|
||||
}else{
|
||||
//换工程换人脸
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(),"0");
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(), record.getSubId(), record.getTeamId(),"0");
|
||||
}
|
||||
//下发人脸到人脸库
|
||||
FaceRecognitionBean faceRecognitionBean = new FaceRecognitionBean();
|
||||
|
|
@ -214,7 +214,7 @@ public class AppServiceImpl implements AppService {
|
|||
//重新入场 再入场,清除最新标识
|
||||
pmWorkerMapper.updateEinRecordLast(record.getId());
|
||||
//换工程没换人脸
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(),"0");
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(), record.getSubId(), record.getTeamId(),"0");
|
||||
addWorkerEinData(record);
|
||||
}
|
||||
return AjaxResult.success(sb.append(",基础数据更新成功").toString());
|
||||
|
|
@ -243,7 +243,7 @@ public class AppServiceImpl implements AppService {
|
|||
}
|
||||
int k = pmWorkerExitMapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile,record.getExitWay());
|
||||
if(k==1){
|
||||
urkSendService.delUserByDevice(record.getWorkerId(),record.getProId());
|
||||
urkSendService.delUserByDevice(record.getWorkerId(),record.getProId(),record.getSubId(), record.getTeamId());
|
||||
//删除app人脸
|
||||
// delAppFace(record.getWorkerId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,19 @@ public class PmAttDeviceServiceImpl implements PmAttDeviceService {
|
|||
pmAttDevice.setUpdateUser(SecurityUtils.getLoginUser().getUsername());
|
||||
pmAttDevice.setUpdateTime(new Date());
|
||||
//新增考勤机触发
|
||||
uakSendService.getUserSendToDev(pmAttDevice.getDeviceCode(),pmAttDevice.getProId()==null?-1:pmAttDevice.getProId());
|
||||
int proId=0;
|
||||
int subId=0;
|
||||
int teamId=0;
|
||||
if(pmAttDevice.getProId()!=null){
|
||||
proId=pmAttDevice.getProId();
|
||||
}
|
||||
if(pmAttDevice.getSubId()!=null){
|
||||
subId=pmAttDevice.getSubId();
|
||||
}
|
||||
if(pmAttDevice.getTeamId()!=null){
|
||||
teamId=pmAttDevice.getTeamId();
|
||||
}
|
||||
uakSendService.getUserSendToDev(pmAttDevice.getDeviceCode(),proId,subId,teamId);
|
||||
return pmAttDeviceMapper.addPmAttDevice(pmAttDevice);
|
||||
}
|
||||
|
||||
|
|
@ -70,6 +82,18 @@ public class PmAttDeviceServiceImpl implements PmAttDeviceService {
|
|||
public int updatePmAttDevice(PmAttDevice pmAttDevice) throws Exception {
|
||||
pmAttDevice.setUpdateUser(SecurityUtils.getLoginUser().getUsername());
|
||||
pmAttDevice.setUpdateTime(new Date());
|
||||
int proId=0;
|
||||
int subId=0;
|
||||
int teamId=0;
|
||||
if(pmAttDevice.getProId()!=null){
|
||||
proId=pmAttDevice.getProId();
|
||||
}
|
||||
if(pmAttDevice.getSubId()!=null){
|
||||
subId=pmAttDevice.getSubId();
|
||||
}
|
||||
if(pmAttDevice.getTeamId()!=null){
|
||||
teamId=pmAttDevice.getTeamId();
|
||||
}
|
||||
//解绑的时候在历史表插入一条数据
|
||||
if (StringUtils.isNull(pmAttDevice.getProId())){
|
||||
PmAttDevice pmAttDeviceOld = pmAttDeviceMapper.getPmAttDeviceByCoode(pmAttDevice);
|
||||
|
|
@ -79,10 +103,10 @@ public class PmAttDeviceServiceImpl implements PmAttDeviceService {
|
|||
pmAttDeviceOld.setCreateTime(new Date());
|
||||
pmAttDeviceMapper.addPmAttDeviceHis(pmAttDeviceOld);
|
||||
//考勤机解绑
|
||||
uakSendService.delDevByProId(pmAttDevice.getDeviceCode(),pmAttDeviceOld.getProId()==null?-1:pmAttDeviceOld.getProId());
|
||||
uakSendService.delDevByProId(pmAttDevice.getDeviceCode(),proId,subId,teamId);
|
||||
}else {
|
||||
//新增考勤机触发
|
||||
uakSendService.getUserSendToDev(pmAttDevice.getDeviceCode(),pmAttDevice.getProId()==null?-1:pmAttDevice.getProId());
|
||||
uakSendService.getUserSendToDev(pmAttDevice.getDeviceCode(),proId,subId,teamId);
|
||||
}
|
||||
return pmAttDeviceMapper.updatePmAttDevice(pmAttDevice);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
int k = mapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile,record.getExitWay());
|
||||
if(k==1){
|
||||
try {
|
||||
urkSendService.delUserByDevice(record.getWorkerId(),record.getProId());
|
||||
urkSendService.delUserByDevice(record.getWorkerId(),record.getProId(),record.getSubId(),record.getTeamId());
|
||||
} catch (Exception e) {
|
||||
log.error("人员下发考勤机失败:",e);
|
||||
sb.append("人员下发考勤机失败--");
|
||||
|
|
@ -112,6 +112,8 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
int failCount = 0;
|
||||
List<Integer> userId = new ArrayList<>();
|
||||
List<Integer> proId = new ArrayList<>();
|
||||
List<Integer> supId = new ArrayList<>();
|
||||
List<Integer> teamId = new ArrayList<>();
|
||||
for (PmWorkerDto bean : list) {
|
||||
//查询合同工资卡是否齐全
|
||||
List<MapBeanVo> listData = mapper.getContractIdAndWageCard(bean.getWorkerId());
|
||||
|
|
@ -127,6 +129,8 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
if (k == 1) {
|
||||
userId.add(bean.getWorkerId());
|
||||
proId.add(bean.getProId());
|
||||
supId.add(bean.getSubId());
|
||||
teamId.add(bean.getTeamId());
|
||||
}
|
||||
count += k;
|
||||
}else {
|
||||
|
|
@ -136,7 +140,7 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
if(count>0){
|
||||
//批量操作考勤机
|
||||
try {
|
||||
urkSendService.delUserByDeviceList(userId,proId);
|
||||
urkSendService.delUserByDeviceList(userId,proId,supId,teamId);
|
||||
} catch (Exception e) {
|
||||
log.error("人员下发考勤机失败:",e);
|
||||
sb.append("人员下发考勤机失败--");
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
|||
addWorkerEinData(record,fileMsg);
|
||||
//下发人脸到考勤机
|
||||
try {
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(),"0");
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(), record.getSubId(), record.getTeamId(),"0");
|
||||
} catch (Exception e) {
|
||||
log.error("人员下发考勤机失败:",e);
|
||||
sb.append("人员下发考勤机失败--");
|
||||
|
|
@ -270,10 +270,10 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
|||
try {
|
||||
if(record.getEinStatus() == 1){
|
||||
//没换工程换人脸
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(),"1");
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(),record.getSubId(), record.getTeamId(),"1");
|
||||
}else{
|
||||
//换工程换人脸
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(),"0");
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(),record.getSubId(), record.getTeamId(),"0");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("人员下发考勤机失败:",e);
|
||||
|
|
@ -293,7 +293,7 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
|||
mapper.updateEinRecordLast(record.getId());
|
||||
//换工程没换人脸
|
||||
try {
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(),"0");
|
||||
urkSendService.sendUserToDevice(record.getId(),record.getProId(),record.getSubId(), record.getTeamId(),"0");
|
||||
} catch (Exception e) {
|
||||
log.error("人员下发考勤机失败:",e);
|
||||
sb.append("人员下发考勤机失败--");
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void getUserSendToDev(String deviceCode,int proId) throws Exception {
|
||||
public void getUserSendToDev(String deviceCode,int subId,int teamId,int proId) throws Exception {
|
||||
try{
|
||||
String createTime= DateUtils.getTime();
|
||||
BmwKqCmdTaskVo taskVo=new BmwKqCmdTaskVo();
|
||||
|
|
@ -52,7 +52,7 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
//等待执行
|
||||
taskVo.setTransStatus(TaskStatusEnum.WAIT.ordinal());
|
||||
//分页查询
|
||||
getUserSendToDev(proId,1,taskVo);
|
||||
getUserSendToDev(proId,subId, teamId,1,taskVo);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
throw new Exception("人员下发失败");
|
||||
|
|
@ -69,7 +69,7 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
* @param proId
|
||||
*/
|
||||
@Override
|
||||
public void sendUserToDevice(int userId,int proId,String update) throws Exception {
|
||||
public void sendUserToDevice(int userId,int proId,int supId,int teamId, String update) throws Exception {
|
||||
try{
|
||||
String createTime= DateUtils.getTime();
|
||||
BmwKqCmdTaskVo taskVo=new BmwKqCmdTaskVo();
|
||||
|
|
@ -87,7 +87,7 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
//等待执行
|
||||
taskVo.setTransStatus(TaskStatusEnum.WAIT.ordinal());
|
||||
//分页查询
|
||||
sendUserToDevice(userId,proId,1,taskVo);
|
||||
sendUserToDevice(userId,proId,supId,teamId,1,taskVo);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
throw new Exception("人员下发失败");
|
||||
|
|
@ -103,7 +103,7 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
* @param proId
|
||||
*/
|
||||
@Override
|
||||
public void delUserByDevice(int userId, int proId) throws Exception {
|
||||
public void delUserByDevice(int userId, int proId,int supId,int teamId) throws Exception {
|
||||
try{
|
||||
List<Integer> userList=new ArrayList<>();
|
||||
String createTime= DateUtils.getTime();
|
||||
|
|
@ -118,7 +118,7 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
//等待执行
|
||||
taskVo.setTransStatus(TaskStatusEnum.WAIT.ordinal());
|
||||
//分页查询
|
||||
sendUserToDevice(userId,proId,1,taskVo);
|
||||
sendUserToDevice(userId,proId,supId,teamId,1,taskVo);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
throw new Exception("人员出场失败");
|
||||
|
|
@ -131,19 +131,23 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
* @param proId
|
||||
*/
|
||||
@Override
|
||||
public void delUserByDeviceList(List<Integer> userId ,List<Integer> proId) throws Exception {
|
||||
public void delUserByDeviceList(List<Integer> userId ,List<Integer> proId,List<Integer> supIds,List<Integer> teamIds) throws Exception {
|
||||
try{
|
||||
Map<Integer,List<Integer>> map= Maps.newHashMap();
|
||||
Map<String,List<Integer>> map= Maps.newHashMap();
|
||||
//按照工程给人员分组
|
||||
for (int i = 0; i < proId.size(); i++) {
|
||||
List<Integer> list=map.get(proId.get(i));
|
||||
String pro=proId.get(i).toString();
|
||||
String sup=supIds.get(i).toString();
|
||||
String teamId=teamIds.get(i).toString();
|
||||
String key=pro+"-"+sup+"-"+teamId;
|
||||
List<Integer> list=map.get(key);
|
||||
if(StringUtils.isEmpty(list)){
|
||||
list=new ArrayList<>();
|
||||
list.add(userId.get(i));
|
||||
map.put(proId.get(i),list);
|
||||
map.put(key,list);
|
||||
}else{
|
||||
list.add(userId.get(i));
|
||||
map.replace(proId.get(i),list);
|
||||
map.replace(key,list);
|
||||
}
|
||||
}
|
||||
//循环
|
||||
|
|
@ -173,12 +177,14 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
* @param proId
|
||||
*/
|
||||
@Override
|
||||
public void delDevByProId(String deviceCode, int proId) throws Exception {
|
||||
public void delDevByProId(String deviceCode, int proId,int supId,int teamId) throws Exception {
|
||||
try{
|
||||
String createTime= DateUtils.getTime();
|
||||
BmwKqCmdTaskVo taskVo=new BmwKqCmdTaskVo();
|
||||
taskVo.setDeviceCode(deviceCode);
|
||||
taskVo.setProId(String.valueOf(proId));
|
||||
taskVo.setSupId(String.valueOf(supId));
|
||||
taskVo.setTeamId(String.valueOf(teamId));
|
||||
taskVo.setCreateTime(createTime);
|
||||
taskVo.setCmdCode("DELETE_USER");
|
||||
//等待执行
|
||||
|
|
@ -194,17 +200,22 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
public void sendUserToDeviceList(List<Integer> userId,int proId,int pageNum, BmwKqCmdTaskVo taskVo){
|
||||
Integer isSh=mapper.getProType(proId);
|
||||
public void sendUserToDeviceList(List<Integer> userId,String key,int pageNum, BmwKqCmdTaskVo taskVo){
|
||||
List<BmwDeviceVo> list;
|
||||
PageHelper.startPage(pageNum, PAGE_SIZE);
|
||||
//是上海的工程
|
||||
if(isSh!=null && isSh==1){
|
||||
list=mapper.getDeviceVoByProBySh();
|
||||
}else{
|
||||
list=mapper.getDeviceVoByProId(proId);
|
||||
String proId=key.split("-")[0];
|
||||
String teamId=key.split("-")[2];
|
||||
String supId=key.split("-")[1];
|
||||
|
||||
//多次查询 人员-分包-工程的考勤机进行下发
|
||||
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);
|
||||
//分页查询+
|
||||
|
|
@ -232,6 +243,7 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
public void delDevUserList(String deviceCode, int pageNum, BmwKqCmdTaskVo taskVo){
|
||||
//要获取考勤机当前的全部用户数据
|
||||
PageHelper.startPage(pageNum, PAGE_SIZE);
|
||||
//查询对应人员i想你洗
|
||||
List<String> list=mapper.getDevUserId(deviceCode);
|
||||
PageInfo<String> pageInfo =new PageInfo<String>(list);
|
||||
//分页查询+
|
||||
|
|
@ -259,15 +271,10 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
* @param pageNum
|
||||
* @param taskVo
|
||||
*/
|
||||
public void getUserSendToDev(int proId,int pageNum, BmwKqCmdTaskVo taskVo) {
|
||||
List<String> list;
|
||||
Integer isSh=mapper.getProType(proId);
|
||||
public void getUserSendToDev(int proId,int subId,int teamId,int pageNum, BmwKqCmdTaskVo taskVo) {
|
||||
PageHelper.startPage(pageNum, PAGE_SIZE);
|
||||
if(isSh!=null && isSh==1){
|
||||
list=mapper.getOnSiteUserBySh();
|
||||
}else{
|
||||
list=mapper.getOnSiteUser(proId);
|
||||
}
|
||||
//依据工程班组分包 查询在场人员
|
||||
List<String> list=mapper.getOnSiteUser(proId,subId,teamId);
|
||||
PageInfo<String> pageInfo =new PageInfo<String>(list);
|
||||
//分页查询全部在场用户
|
||||
if (!list.isEmpty()){
|
||||
|
|
@ -282,7 +289,7 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
int pageTotal=pageInfo.getPages();
|
||||
if(pageSize<pageTotal){
|
||||
pageNum++;
|
||||
getUserSendToDev(proId,pageNum,taskVo);
|
||||
getUserSendToDev(proId,subId,teamId,pageNum,taskVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -294,15 +301,18 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
* @param pageNum
|
||||
* @param taskVo
|
||||
*/
|
||||
public void sendUserToDevice(int userId,int proId,int pageNum, BmwKqCmdTaskVo taskVo){
|
||||
Integer isSh=mapper.getProType(proId);
|
||||
List<BmwDeviceVo> list;
|
||||
PageHelper.startPage(pageNum, PAGE_SIZE);
|
||||
//是上海的工程
|
||||
if(isSh!=null && isSh==1){
|
||||
list=mapper.getDeviceVoByProBySh();
|
||||
}else{
|
||||
list=mapper.getDeviceVoByProId(proId);
|
||||
public void sendUserToDevice(int userId,int proId,int supId,int teamId,int pageNum, BmwKqCmdTaskVo taskVo){
|
||||
|
||||
PageHelper.startPage(pageNum,PAGE_SIZE);
|
||||
//查询考勤机
|
||||
List<BmwDeviceVo> list=mapper.getDeviceVoByProId(proId,supId,teamId);
|
||||
if(StringUtils.isEmpty(list)){
|
||||
PageHelper.startPage(pageNum,PAGE_SIZE);
|
||||
list=mapper.getDeviceVoByProId(proId,supId,0);
|
||||
}
|
||||
if(StringUtils.isEmpty(list)){
|
||||
PageHelper.startPage(pageNum,PAGE_SIZE);
|
||||
list=mapper.getDeviceVoByProId(proId,0,0);
|
||||
}
|
||||
PageInfo<BmwDeviceVo> pageInfo =new PageInfo<BmwDeviceVo>(list);
|
||||
//分页查询+
|
||||
|
|
@ -325,7 +335,7 @@ public class UrkSendServiceImpl implements UrkSendService {
|
|||
int pageTotal=pageInfo.getPages();
|
||||
if(pageSize<pageTotal){
|
||||
pageNum++;
|
||||
sendUserToDevice(userId,proId,pageNum,taskVo);
|
||||
sendUserToDevice(userId,proId,supId,teamId,pageNum,taskVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,12 +83,24 @@
|
|||
dev_model devModel,on_line onLine
|
||||
from pm_att_device
|
||||
where pro_id=#{proId} and is_active=1
|
||||
<if test='supId!=null and supId!=0 AND supId!="0"'>
|
||||
and sub_id=#{supId}
|
||||
</if>
|
||||
<if test='teamId!=null and teamId!=0 AND teamId!="0"'>
|
||||
and team_id=#{teamId}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="getOnSiteUser" resultType="java.lang.String">
|
||||
select worker_id
|
||||
from bm_worker_ein_msg
|
||||
where pro_id=#{proId}
|
||||
|
||||
where pro_id=#{proId} and is_active=1
|
||||
<if test='supId!=null and supId!=0 AND supId!="0"'>
|
||||
and sub_id=#{supId}
|
||||
</if>
|
||||
<if test='teamId!=null and teamId!=0 AND teamId!="0"'>
|
||||
and team_id=#{teamId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getProType" resultType="java.lang.Integer">
|
||||
select is_shanghai
|
||||
|
|
@ -112,8 +124,8 @@
|
|||
<!--删除数据-->
|
||||
<select id="getDevUserId" resultType="java.lang.String">
|
||||
select user_id
|
||||
from kq_dev_user_id
|
||||
WHERE dev_code=#{deviceCode}
|
||||
from kq_dev_user_id
|
||||
WHERE dev_code=#{deviceCode}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
//package com.bonus.urk.controller;
|
||||
//
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.hibernate.validator.constraints.CodePointLength;
|
||||
//import org.springframework.stereotype.Controller;
|
||||
//import org.springframework.web.bind.annotation.GetMapping;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//@Slf4j
|
||||
//@RestController
|
||||
//@RequestMapping("test")
|
||||
//public class TestController {
|
||||
//
|
||||
// @GetMapping("/test")
|
||||
// public String getTest(){
|
||||
// System.err.println("55");
|
||||
// return "欢迎来到我的王国,启用负载!!!!";
|
||||
// }
|
||||
//}
|
||||
|
|
@ -68,7 +68,7 @@ public class UserFaceHandle {
|
|||
String proId=service.getDevPorId(devCode);
|
||||
if(StringUtils.isNotEmpty(proId)){
|
||||
//验证用户是否入场
|
||||
BmWorkerEinUserVo vo=service.getOnUserInfo(userId);
|
||||
BmWorkerEinUserVo vo=service.getOnUserInfo(userId,proId);
|
||||
if(vo==null){
|
||||
vo=new BmWorkerEinUserVo();
|
||||
vo.setAttPhoto(bast64);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public interface UserFaceHandleMapper {
|
|||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
BmWorkerEinUserVo getOnUserInfo(@Param("userId") String userId);
|
||||
BmWorkerEinUserVo getOnUserInfo(@Param("userId") String userId,@Param("proId")String proId);
|
||||
|
||||
/**
|
||||
* 新增人员考勤数据
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ public class UserFaceHandleService {
|
|||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public BmWorkerEinUserVo getOnUserInfo(String userId) {
|
||||
public BmWorkerEinUserVo getOnUserInfo(String userId,String proId) {
|
||||
try{
|
||||
BmWorkerEinUserVo vo=mapper.getOnUserInfo(userId);
|
||||
BmWorkerEinUserVo vo=mapper.getOnUserInfo(userId,proId);
|
||||
if(vo!=null && StringUtils.isNotEmpty(vo.getUserId())){
|
||||
return vo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@
|
|||
bwem.team_name teamName,bwem.team_id teamId,pw.id_number idNumber,
|
||||
bwem.sub_id subId,bwem.sub_name subName,bwem.post_id postId,bwem.contract_id,bwc.day_rate dailyWage
|
||||
from bm_worker_ein_msg bwem
|
||||
left join pm_worker pw on pw.id=bwem.worker_id
|
||||
LEFT JOIN bm_worker_contract bwc on bwc.worker_id=bwem.worker_id and bwc.is_active=1
|
||||
where bwem.worker_id=#{userId}
|
||||
left join pm_worker pw on pw.id=bwem.worker_id
|
||||
LEFT JOIN bm_worker_contract bwc on bwc.worker_id=bwem.worker_id and bwc.is_active=1
|
||||
where bwem.worker_id=#{userId} and bwem.pro_id=#{proId}
|
||||
</select>
|
||||
<select id="getTodayIsExit" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue