|
|
@@ -12,6 +12,7 @@ import com.zhongshu.card.server.core.util.BeanUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.kafka.common.protocol.types.Field;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -43,15 +44,18 @@ public class OrgUserFaceService extends SuperService {
|
|
|
* @return
|
|
|
*/
|
|
|
public ResultContent saveFace(OrgUserFaceParam param) {
|
|
|
- String oid = param.getOid();
|
|
|
- if (StringUtils.isEmpty(oid)) {
|
|
|
+ String projectOid = param.getProjectOid();
|
|
|
+ if (StringUtils.isEmpty(projectOid)) {
|
|
|
+ projectOid = getCurrentProjectOid();
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(projectOid)) {
|
|
|
return ResultContent.buildFail("oid不能为空");
|
|
|
}
|
|
|
String userId = param.getUserId();
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
userId = getCurrentUserId();
|
|
|
}
|
|
|
- OrgUserFace orgUserFace = orgUserFaceDao.findTopByUserIdAndProjectOid(userId, oid);
|
|
|
+ OrgUserFace orgUserFace = orgUserFaceDao.findTopByUserIdAndProjectOid(userId, projectOid);
|
|
|
if (ObjectUtils.isEmpty(orgUserFace)) {
|
|
|
orgUserFace = new OrgUserFace();
|
|
|
initEntity(orgUserFace);
|
|
|
@@ -59,7 +63,7 @@ public class OrgUserFaceService extends SuperService {
|
|
|
initUpdateEntity(orgUserFace);
|
|
|
}
|
|
|
BeanUtils.copyProperties(param, orgUserFace);
|
|
|
- orgUserFace.setProjectOid(oid);
|
|
|
+ orgUserFace.setProjectOid(projectOid);
|
|
|
orgUserFaceDao.save(orgUserFace);
|
|
|
|
|
|
// 通知人脸信息发送变化
|
|
|
@@ -77,11 +81,17 @@ public class OrgUserFaceService extends SuperService {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- public ResultContent<OrgUserFaceModel> getUserFaceModel(String userId, String oid) {
|
|
|
+ public ResultContent<OrgUserFaceModel> getUserFaceModel(String userId, String projectOid) {
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
userId = getCurrentUserId();
|
|
|
}
|
|
|
- OrgUserFace entity = getUserFace(userId, oid);
|
|
|
+ if (StringUtils.isEmpty(projectOid)) {
|
|
|
+ projectOid = getCurrentProjectOid();
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(projectOid)) {
|
|
|
+ return ResultContent.buildFail("projectOid为空");
|
|
|
+ }
|
|
|
+ OrgUserFace entity = getUserFace(userId, projectOid);
|
|
|
return ResultContent.buildSuccess(toModel(entity));
|
|
|
}
|
|
|
|