Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -126,7 +126,7 @@
|
||||
from
|
||||
sys_role r inner join enterprise_user_role e on r.role_id = e.role_id
|
||||
where
|
||||
e.user_id = #{userId} and r.deleted = 0
|
||||
e.user_id = #{userId} and r.deleted = 0 and e.deleted = 0
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public interface ContentService {
|
||||
* 更新动态信息
|
||||
* @param dto
|
||||
*/
|
||||
void updateContent(ContentUpdateDto dto);
|
||||
void updateContent(ContentUpdateDto dto) throws ApiException;
|
||||
|
||||
/**
|
||||
* 查询动态列表
|
||||
|
||||
@@ -63,7 +63,12 @@ public class ContentServiceImpl implements ContentService {
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public void updateContent(ContentUpdateDto dto) {
|
||||
public void updateContent(ContentUpdateDto dto) throws ApiException {
|
||||
//增加不允许重复标题的逻辑
|
||||
Boolean isDuplicated = contentInfoMapper.whetherTitleDuplicated(dto.getContentTitle());
|
||||
if (isDuplicated) {
|
||||
throw new ApiException(ErrorCodeEnum.CONTENT_DUPLICATED);
|
||||
}
|
||||
HyContentInfoDO hyContentInfoDO = new HyContentInfoDO();
|
||||
BeanUtil.copyProperties(dto, hyContentInfoDO);
|
||||
hyContentInfoDO.setId(Long.parseLong(dto.getContentId()));
|
||||
|
||||
@@ -199,6 +199,8 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
||||
List<EnterpriseUserRoleDO> enterpriseUserRole = EnterpriseUserRoleDO.convertSyncDO(role.getRoleId(), new ArrayList<>(Arrays.asList(userDetail.getUserId())));
|
||||
enterpriseUserRoleDAO.batchInsertOrUpdate(enterpriseUserRole);
|
||||
enterpriseUserRoleDAO.deleteUserInRole(userDetail.getUserId(), DataSourceEnum.SYNC, role.getRoleId());
|
||||
}else{
|
||||
enterpriseUserRoleDAO.deleteUserRole(userDetail.getUserId());
|
||||
}
|
||||
EnterpriseUserDO enterpriseUser = EnterpriseUserDTO.transUserDtoToDo(userDetail, regionPathMap, leaderDeptMap);
|
||||
enterpriseUserDAO.batchInsertOrUpdate(new ArrayList<>(Arrays.asList(enterpriseUser)));
|
||||
|
||||
@@ -295,7 +295,7 @@ public class FlowServiceImpl implements FlowService {
|
||||
SkrRelshipProve skrRelshipProve= BeanUtil.fillBeanWithMap(data, new SkrRelshipProve(), false);
|
||||
relshipProves.add(skrRelshipProve);
|
||||
} catch (Exception e) {
|
||||
log.info("调用MDM接口出错{}", e.getMessage());
|
||||
log.info("调用MDM接口出错 url{}, fileUrl{}, e{}", url, fileUrl, e);
|
||||
throw new ApiException(e.getMessage());
|
||||
} finally {
|
||||
outputStream.close();
|
||||
@@ -319,7 +319,7 @@ public class FlowServiceImpl implements FlowService {
|
||||
return JSONObject.toJSONString(responseEntity.getBody().getData());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("调用MDM接口出错{}", e);
|
||||
log.info("调用MDM接口出错 url{}, e{}", url, e);
|
||||
throw new ApiException(e.getMessage());
|
||||
}
|
||||
return null;
|
||||
@@ -340,7 +340,7 @@ public class FlowServiceImpl implements FlowService {
|
||||
return accessTokenDTO.getAccessToken();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("调用MDM接口出错{}", e);
|
||||
log.info("获取MDM Token 出错 url:\t{}, e:\t{}", url, e);
|
||||
throw new ApiException(e.getMessage());
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ContentController {
|
||||
|
||||
@PostMapping("/modify")
|
||||
@ApiOperation("修改动态")
|
||||
public ResponseResult updateContent(@RequestBody ContentUpdateDto dto) {
|
||||
public ResponseResult updateContent(@RequestBody ContentUpdateDto dto) throws ApiException {
|
||||
contentService.updateContent(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user