| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionUserDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_equipment.annotation.CurrentUser; |
| | | import com.panzhihua.service_equipment.model.dos.UnionReport; |
| | | import com.panzhihua.service_equipment.service.UnionReportService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody UnionReportDto unionReportDto) { |
| | | return unionReportService.add(unionReportDto); |
| | | public R add(@RequestBody UnionReportDto unionReportDto, @CurrentUser UnionUserDto unionUserDto) { |
| | | if (unionReportDto.getIsApplets().equals(1)) { |
| | | log.info("小程序进入无需验证"); |
| | | return unionReportService.add(unionReportDto); |
| | | } else { |
| | | log.info("h5或者后台进入"); |
| | | if (unionUserDto != null) { |
| | | unionReportDto.setCreateUnionUserId(unionUserDto.getId()); |
| | | return unionReportService.add(unionReportDto); |
| | | } else { |
| | | return R.fail("请重新登录"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | * @return 动态结果 |
| | | */ |
| | | @PostMapping("/query") |
| | | public R<IPage<UnionReport>> query(@RequestBody UnionReportDto unionReportDto) { |
| | | return unionReportService.query(unionReportDto); |
| | | public R<IPage<UnionReport>> query(@RequestBody UnionReportDto unionReportDto, @CurrentUser UnionUserDto |
| | | unionUserDto) { |
| | | if (unionReportDto.getIsApplets().equals(1)) { |
| | | log.info("小程序进入无需验证"); |
| | | return unionReportService.query(unionReportDto); |
| | | } else { |
| | | log.info("h5或者后台进入"); |
| | | if (unionUserDto != null) { |
| | | unionReportDto.setCreateUnionUserId(unionUserDto.getId()); |
| | | return unionReportService.query(unionReportDto); |
| | | } else { |
| | | return R.fail("请重新登录"); |
| | | } |
| | | } |
| | | } |
| | | } |