|
|
@@ -77,7 +77,7 @@ import static com.inspur.common.utils.PageUtils.startPage;
|
|
|
|
|
|
/**
|
|
|
* 党员会议Service业务层处理
|
|
|
- *
|
|
|
+ *
|
|
|
* @author inspur
|
|
|
* @date 2022-09-21
|
|
|
*/
|
|
|
@@ -127,6 +127,9 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
@Autowired
|
|
|
private PartyFaceRecognitionMapper partyFaceRecognitionMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PartyMeetingImageMapper partyMeetingImageMapper;
|
|
|
+
|
|
|
|
|
|
@Value("${netty.idUrl}")
|
|
|
private String nettyIdUrl;
|
|
|
@@ -146,7 +149,7 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
|
|
|
/**
|
|
|
* 查询党员会议
|
|
|
- *
|
|
|
+ *
|
|
|
* @param id 党员会议主键
|
|
|
* @return 党员会议
|
|
|
*/
|
|
|
@@ -189,7 +192,6 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
}
|
|
|
String fileList = fileListSb.toString();
|
|
|
rsp.setFileList(fileList.substring(0, fileList.length() - 1));
|
|
|
- rsp.setFollowList(followFiles);
|
|
|
}
|
|
|
// 学习材料
|
|
|
List<String> materialOptions = new ArrayList<>();
|
|
|
@@ -197,6 +199,22 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
materialOptions = Arrays.asList(rsp.getMaterials().split(","));
|
|
|
rsp.setMaterialOptions(materialOptions);
|
|
|
}
|
|
|
+ // 将学习资料和文件合并
|
|
|
+ if (!CollectionUtils.isEmpty(followFiles)) {
|
|
|
+ for (String materialOption : materialOptions) {
|
|
|
+ PartyMeetingFollow followFile = new PartyMeetingFollow();
|
|
|
+ followFile.setFileName(materialOption);
|
|
|
+ followFile.setFileUrl(materialOption);
|
|
|
+ followFile.setFileType(2);
|
|
|
+ followFiles.add(followFile);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ rsp.setFollowList(followFiles);
|
|
|
+ // 查询会议图片带时间
|
|
|
+ PartyMeetingImage imageParam = new PartyMeetingImage();
|
|
|
+ imageParam.setMeetingId(id);
|
|
|
+ List<PartyMeetingImage> imageList = partyMeetingImageMapper.selectPartyMeetingImageList(imageParam);
|
|
|
+ rsp.setImageList(imageList);
|
|
|
return rsp;
|
|
|
}
|
|
|
|
|
|
@@ -264,7 +282,7 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
|
|
|
/**
|
|
|
* 查询党员会议列表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param partyMeetingInfo 党员会议
|
|
|
* @return 党员会议
|
|
|
*/
|
|
|
@@ -393,7 +411,7 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
|
|
|
/**
|
|
|
* 新增党员会议
|
|
|
- *
|
|
|
+ *
|
|
|
* @param partyMeetingInfo 党员会议
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@@ -436,6 +454,19 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
}
|
|
|
|
|
|
int rsp = partyMeetingInfoMapper.insertPartyMeetingInfo(partyMeetingInfo);
|
|
|
+
|
|
|
+ // 保存图片信息
|
|
|
+ if (StringUtils.isNotEmpty(partyMeetingInfo.getPicsPath())) {
|
|
|
+ String[] imgUrls = partyMeetingInfo.getPicsPath().split(",");
|
|
|
+ for (String imgUrl : imgUrls) {
|
|
|
+ PartyMeetingImage meetingImg = new PartyMeetingImage();
|
|
|
+ meetingImg.setMeetingId(partyMeetingInfo.getId());
|
|
|
+ meetingImg.setPicPath(imgUrl);
|
|
|
+ meetingImg.setCreateTime(DateUtils.getNowDate());
|
|
|
+ partyMeetingImageMapper.insertPartyMeetingImage(meetingImg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 推送至灯塔
|
|
|
// dengTaSyncService.meetingPush(partyMeetingInfo,"add");
|
|
|
|
|
|
@@ -595,7 +626,7 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
|
|
|
/**
|
|
|
* 修改党员会议
|
|
|
- *
|
|
|
+ *
|
|
|
* @param partyMeetingInfo 党员会议
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@@ -642,6 +673,18 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
insertMeetingFollow(addFile,partyMeetingInfo.getId());
|
|
|
}
|
|
|
}
|
|
|
+ // 会议图片 删除之前 全部更新
|
|
|
+ partyMeetingImageMapper.deletePartyMeetingImageByMeetingId(partyMeetingInfo.getId());
|
|
|
+ if (!StringUtils.isEmpty(partyMeetingInfo.getPicsPath())) {
|
|
|
+ String[] imgUrls = partyMeetingInfo.getPicsPath().split(",");
|
|
|
+ for (String imgUrl : imgUrls) {
|
|
|
+ PartyMeetingImage meetingImg = new PartyMeetingImage();
|
|
|
+ meetingImg.setMeetingId(partyMeetingInfo.getId());
|
|
|
+ meetingImg.setPicPath(imgUrl);
|
|
|
+ meetingImg.setCreateTime(DateUtils.getNowDate());
|
|
|
+ partyMeetingImageMapper.insertPartyMeetingImage(meetingImg);
|
|
|
+ }
|
|
|
+ }
|
|
|
return partyMeetingInfoMapper.updatePartyMeetingInfo(partyMeetingInfo);
|
|
|
}
|
|
|
|
|
|
@@ -686,7 +729,7 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
|
|
|
/**
|
|
|
* 批量删除党员会议
|
|
|
- *
|
|
|
+ *
|
|
|
* @param ids 需要删除的党员会议主键
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@@ -703,7 +746,7 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
|
|
|
/**
|
|
|
* 删除党员会议信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param id 党员会议主键
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@@ -1051,6 +1094,10 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
PartyFaceRecognition recognitionResult = recognizeFace2AI(meetingId,file);
|
|
|
if (recognitionResult.getOpStatus() != 1 || com.inspur.common.utils.StringUtils.isEmpty(recognitionResult.getRspCode())
|
|
|
|| !String.valueOf(HttpStatus.HTTP_OK).equalsIgnoreCase(recognitionResult.getRspCode())) {
|
|
|
+ log.info("recognizeFace result error, rpsCode: {}",recognitionResult.getRspCode());
|
|
|
+ // 更新本次会议的签到人数
|
|
|
+ recognitionResult.setNewAddNum(0);
|
|
|
+ partyFaceRecognitionMapper.updatePartyFaceRecognition(recognitionResult);
|
|
|
return AjaxResult.error("调用AI算法人脸识别失败");
|
|
|
}
|
|
|
|
|
|
@@ -1058,6 +1105,9 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
List<RecognizeFaceRspResult> resultList = recognizeFaceRsp.getResult();
|
|
|
if (CollectionUtils.isEmpty(resultList)) {
|
|
|
log.info("recognizeFace result is empty,meetingId:{}",meetingId);
|
|
|
+ // 更新本次会议的签到人数
|
|
|
+ recognitionResult.setNewAddNum(0);
|
|
|
+ partyFaceRecognitionMapper.updatePartyFaceRecognition(recognitionResult);
|
|
|
return AjaxResult.success("recognizeFace success,but result is empty");
|
|
|
}
|
|
|
// 找出所有的id_人名集合
|
|
|
@@ -1078,6 +1128,7 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ List<PartyAttendanceRecord> newAttendanceRecordList = new ArrayList<>();
|
|
|
// 对map进行遍历 更新签到结果
|
|
|
memberMap.keySet().stream().forEach(key -> {
|
|
|
String[] keyArr = key.split("_");
|
|
|
@@ -1087,10 +1138,20 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
if (similarity.compareTo(new BigDecimal(0.95)) < 0) {
|
|
|
log.info("人脸识别相似度小于0.95,memberId:{},meetingId:{}",memberId,meetingId);
|
|
|
}else {
|
|
|
- partyAttendanceRecordMapper.updateStatusByMeetingIdAndMemberId(meetingId,memberId,attendanceStatus);
|
|
|
+ // 正常识别到人
|
|
|
+ // 当前memberId是否已经签到过
|
|
|
+ PartyAttendanceRecord attendanceRecord = partyAttendanceRecordMapper.selectAttendanced(meetingId,memberId);
|
|
|
+ if (null == attendanceRecord) {
|
|
|
+ partyAttendanceRecordMapper.updateStatusByMeetingIdAndMemberId(meetingId, memberId, attendanceStatus);
|
|
|
+ newAttendanceRecordList.add(attendanceRecord);
|
|
|
+ } else {
|
|
|
+ log.info("memberId:{}已经签到过,meetingId:{}",memberId,meetingId);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+ // 更新本次会议的签到人数
|
|
|
+ recognitionResult.setNewAddNum(newAttendanceRecordList.size());
|
|
|
+ partyFaceRecognitionMapper.updatePartyFaceRecognition(recognitionResult);
|
|
|
return AjaxResult.success(memberMap);
|
|
|
}
|
|
|
|
|
|
@@ -1108,6 +1169,7 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
partyFaceRecognition.setMeetingId(meetingId);
|
|
|
partyFaceRecognition.setCreateTime(DateUtils.getNowDate());
|
|
|
partyFaceRecognition.setUserTableId(getUserTableId(FaceConstant.FACE_RECOGNITION_TABLE_NAME, userId, 0));
|
|
|
+ partyFaceRecognition.setNewAddNum(0);
|
|
|
partyFaceRecognitionMapper.insertPartyFaceRecognition(partyFaceRecognition);
|
|
|
// 调用算法服务
|
|
|
String rspCode = "";
|
|
|
@@ -1127,7 +1189,7 @@ public class PartyMeetingInfoServiceImpl implements IPartyMeetingInfoService
|
|
|
opStatus = 2;
|
|
|
log.info("recognizeFace error,file:{},rspMsg:{}",fileMap.get("url"),rspMsg);
|
|
|
}
|
|
|
- this.box(reqParam.toJSONString(),rspMsg);
|
|
|
+ // this.box(reqParam.toJSONString(),rspMsg);
|
|
|
}catch (Exception e) {
|
|
|
opStatus = 2;
|
|
|
rspMsg = e.getMessage();
|