|
@@ -10,6 +10,7 @@ import com.om.entity.vo.AppRepairQueryPageVO;
|
|
|
import com.om.entity.vo.DiagnosticReportVO;
|
|
|
import com.om.entity.vo.RepairCreateVO;
|
|
|
import com.om.exception.BadReqException;
|
|
|
+import com.om.exception.BizException;
|
|
|
import com.om.mapper.RepairMapper;
|
|
|
import com.om.service.*;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -55,6 +56,7 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public Result AppCreateReport(APPReportCreateDTO dto) {
|
|
|
+ Integer userId = UserContext.getUserId();
|
|
|
// 判断数据、
|
|
|
if (BeanUtil.isEmpty(dto)) {
|
|
|
throw new BadReqException("数据为空");
|
|
@@ -87,13 +89,17 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
|
|
|
|
|
}
|
|
|
electronicControlService.saveBatch(electronicControlList);
|
|
|
-
|
|
|
+ repair.setUserId(userId);
|
|
|
this.save(repair);
|
|
|
return Result.ok();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Result<AppRepairQueryPageVO> AppGetPageList(APPRepairQueryPageDTO dto) {
|
|
|
+ Integer userId = UserContext.getUserId();
|
|
|
+ if (userId==null){
|
|
|
+ throw new BizException("用户不存在");
|
|
|
+ }
|
|
|
//获取数据
|
|
|
Integer pageIndex = dto.getPageIndex();
|
|
|
Integer pageSize = dto.getPageSize();
|
|
@@ -101,6 +107,7 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
|
|
//分页查询
|
|
|
Page<Repair> page = this.lambdaQuery()
|
|
|
.orderByDesc(Repair::getCreateTime)
|
|
|
+ .eq(Repair::getUserId,userId)
|
|
|
.page(new Page<>(pageIndex, pageSize));
|
|
|
|
|
|
if (BeanUtil.isEmpty(page)) {
|