|
|
@@ -7,6 +7,7 @@ import com.github.microservice.components.data.base.util.PageEntityUtil;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.github.microservice.net.ResultMessage;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.zhongshu.card.client.model.base.IDsParam;
|
|
|
import com.zhongshu.card.client.model.base.OutNumberModel;
|
|
|
import com.zhongshu.card.client.model.projectAbout.orgFace.*;
|
|
|
import com.zhongshu.card.client.model.projectAbout.projectCommon.ProjectCommonConfigModel;
|
|
|
@@ -85,7 +86,7 @@ public class OrgUserFaceService extends SuperService {
|
|
|
public ResultContent saveFace(OrgUserFaceParam param) {
|
|
|
// 编辑 先删除
|
|
|
if (StringUtils.isNotEmpty(param.getId())) {
|
|
|
- ResultContent resultContent = deleteFace(param.getId());
|
|
|
+ ResultContent resultContent = deleteFace(param.getId(), false);
|
|
|
if (resultContent.isFailed()) {
|
|
|
return ResultContent.buildFail(resultContent.getMsg());
|
|
|
}
|
|
|
@@ -189,19 +190,43 @@ public class OrgUserFaceService extends SuperService {
|
|
|
return ResultContent.buildSuccess(toModel(orgUserFace));
|
|
|
}
|
|
|
|
|
|
- public ResultContent deleteFace(String id) {
|
|
|
+ /**
|
|
|
+ * 删除多个
|
|
|
+ *
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public ResultContent deleteFace(IDsParam param) {
|
|
|
+ if (ObjectUtils.isEmpty(param.getIds())) {
|
|
|
+ return ResultContent.buildFail("ids 不能为空");
|
|
|
+ }
|
|
|
+ OutNumberModel model = new OutNumberModel();
|
|
|
+ for (String id : param.getIds()) {
|
|
|
+ ResultContent _temp = deleteFace(id, true);
|
|
|
+ if (_temp.isSuccess()) {
|
|
|
+ model.addSuccess(id);
|
|
|
+ } else {
|
|
|
+ model.addFail(id, _temp.getMsg());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultContent.buildSuccess();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultContent deleteFace(String id, boolean isManager) {
|
|
|
OrgUserFace orgUserFace = orgUserFaceDao.findTopById(id);
|
|
|
if (orgUserFace == null) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, id));
|
|
|
}
|
|
|
- ResultContent<ProjectCommonConfigModel> content = projectCommonConfigService.getConfigInfoAndCheck(orgUserFace.getProjectOid());
|
|
|
- if (content.isFailed()) {
|
|
|
- return ResultContent.buildFail(content.getMsg());
|
|
|
- }
|
|
|
- ProjectCommonConfigModel configModel = content.getContent();
|
|
|
- Boolean isAllowUpdateFace = configModel.getIsAllowUpdateFace();
|
|
|
- if (isAllowUpdateFace == null || !isAllowUpdateFace) {
|
|
|
- return ResultContent.buildFail("系统不允许删除人脸信息");
|
|
|
+ if (!isManager) {
|
|
|
+ ResultContent<ProjectCommonConfigModel> content = projectCommonConfigService.getConfigInfoAndCheck(orgUserFace.getProjectOid());
|
|
|
+ if (content.isFailed()) {
|
|
|
+ return ResultContent.buildFail(content.getMsg());
|
|
|
+ }
|
|
|
+ ProjectCommonConfigModel configModel = content.getContent();
|
|
|
+ Boolean isAllowUpdateFace = configModel.getIsAllowUpdateFace();
|
|
|
+ if (isAllowUpdateFace == null || !isAllowUpdateFace) {
|
|
|
+ return ResultContent.buildFail("系统不允许删除人脸信息");
|
|
|
+ }
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(orgUserFace.getUpdateFaceFileId())) {
|
|
|
com.github.microservice.auth.client.content.ResultContent resultContent = userFaceService.delete(orgUserFace.getUserId(), orgUserFace.getUpdateFaceFileId());
|