| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 修改数据
|
| | | * 修改信息或签收状态
|
| | | *
|
| | | * @param newsInformationPolice 实体对象
|
| | | * @return 修改结果
|
| | | */
|
| | | @PutMapping
|
| | | public R update(@RequestBody NewsInformationPolice newsInformationPolice) {
|
| | | public R updateSignStatus(@RequestBody NewsInformationPolice newsInformationPolice) {
|
| | | if (newsInformationPolice.getId()==null){
|
| | | QueryWrapper<NewsInformationPolice> wrapper = new QueryWrapper<>();
|
| | | NewsInformationPolice one = newsInformationPoliceService.getOne(wrapper.eq("news_information_id", newsInformationPolice.getNewsInformationId()).eq("news_police_id", newsInformationPolice.getNewsPoliceId()));
|
| | | one.setIsSign(1);
|
| | | return success(this.newsInformationPoliceService.updateById(one));
|
| | | }
|
| | | return success(this.newsInformationPoliceService.updateById(newsInformationPolice));
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 删除数据
|
| | |
| | | public R delete(@RequestParam("idList") List<Long> idList) {
|
| | | return success(this.newsInformationPoliceService.removeByIds(idList));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 通过资讯id查询总数和已阅人数
|
| | | *
|
| | | * @param id 主键
|
| | | * @return 单条数据
|
| | | */
|
| | | @GetMapping("information/{id}")
|
| | | public R selectListByInformationId(@PathVariable Serializable id) {
|
| | | int sum = this.newsInformationPoliceService.count(new QueryWrapper<NewsInformationPolice>().eq("news_information_id", id));
|
| | | int sign = this.newsInformationPoliceService.count(new QueryWrapper<NewsInformationPolice>().eq("news_information_id", id).eq("is_sign",1));
|
| | | return success(sign+"/"+sum);
|
| | | }
|
| | |
|
| | | }
|
| | |
|