update 使@Translation注解生效

This commit is contained in:
liao
2023-09-27 15:11:57 +08:00
parent 7f11a9810f
commit 05764fb163
3 changed files with 16 additions and 2 deletions
@@ -108,6 +108,7 @@ public class LawsNewsFeed implements Serializable {
@ApiModelProperty(value = "推送范围")
@TableField(exist = false)
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "name_work_no")
private String pushRange;
@ApiModelProperty(value = "是否可以编辑和删除")
@@ -11,7 +11,9 @@ import com.jero.modules.laws.standard.entity.LawsPushRange;
import com.jero.modules.laws.standard.mapper.LawsNewsFeedMapper;
import com.jero.modules.laws.standard.service.ILawsNewsFeedService;
import com.jero.modules.laws.standard.service.ILawsPushRangeService;
import com.jero.modules.system.entity.SysUser;
import com.spire.ms.System.Collections.ArrayList;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -218,6 +220,16 @@ public class LawsNewsFeedServiceImpl extends ServiceImpl<LawsNewsFeedMapper, Law
lawsNewsFeed.setReadCount(lawsNewsFeed.getReadCount() + 1);
updateById(lawsNewsFeed);
}
// 如果是指定用户推送
if (1 == lawsNewsFeed.getPushRangeFlag()) {
LambdaQueryWrapper<LawsPushRange> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(LawsPushRange::getUniqueRelationFlag, id);
List<LawsPushRange> pushRangeList = lawsPushRangeService.list(queryWrapper);
if (CollectionUtils.isNotEmpty(pushRangeList)) {
List<String> userIdList = pushRangeList.stream().map(LawsPushRange::getUserId).collect(Collectors.toList());
lawsNewsFeed.setPushRange(StringUtils.join(userIdList, ","));
}
}
return lawsNewsFeed;
}
}