ソースを参照

后台web诊断报告接口

bmmx 1 年間 前
コミット
c8c458cc9f

+ 1 - 1
.idea/JavaSceneConfigState.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="SmartInputSourceJavaSceneConfigState">
-    <option name="customChineseScenes" value="{&quot;capsLockState&quot;:false,&quot;code&quot;:&quot;;ApiModelProperty(value);ApiOperation();debug(s);BadReqException(message)&quot;,&quot;enable&quot;:true,&quot;languageType&quot;:&quot;CHINESE&quot;,&quot;name&quot;:&quot;自定义中文切换&quot;,&quot;tip&quot;:&quot;&quot;}" />
+    <option name="customChineseScenes" value="{&quot;capsLockState&quot;:false,&quot;code&quot;:&quot;;ApiModelProperty(value);debug(s);Api(tags);ApiOperation();BadReqException(message);info(s)&quot;,&quot;enable&quot;:true,&quot;languageType&quot;:&quot;CHINESE&quot;,&quot;name&quot;:&quot;自定义中文切换&quot;,&quot;tip&quot;:&quot;&quot;}" />
   </component>
 </project>

+ 82 - 13
.idea/workspace.xml

@@ -4,17 +4,16 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="46b159bd-08ca-42f0-b80f-41d4944a8a29" name="Changes" comment="web维修厂管理接口">
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/entity/dto/UserQueryPageDTO.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/entity/vo/UserQueryPageVO.java" afterDir="false" />
+    <list default="true" id="46b159bd-08ca-42f0-b80f-41d4944a8a29" name="Changes" comment="添加用户id">
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/entity/dto/RepairDTO.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/JavaSceneConfigState.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/JavaSceneConfigState.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/controller/admin/AppUserController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/controller/admin/AppUserController.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/entity/po/User.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/entity/po/User.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/entity/vo/UserAddVO.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/entity/vo/UserAddVO.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/service/IUserService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/service/IUserService.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/service/impl/UserServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/service/impl/UserServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/config/CORSConfig.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/config/WebMvcConfiguration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/config/WebMvcConfiguration.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/controller/admin/RepairController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/controller/admin/RepairController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/controller/user/APPRepairController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/controller/user/APPRepairController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/service/IRepairService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/service/IRepairService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/service/impl/RepairServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/service/impl/RepairServiceImpl.java" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -57,6 +56,7 @@
   </component>
   <component name="PropertiesComponent">{
   &quot;keyToString&quot;: {
+    &quot;Maven.OperationSystem [package].executor&quot;: &quot;Run&quot;,
     &quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;,
     &quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;,
     &quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;,
@@ -91,8 +91,8 @@
       <recent name="B:\WorkSpace\PracticalRojects\OperationSystem\src\main\java\com\om" />
     </key>
     <key name="CopyClassDialog.RECENTS_KEY">
-      <recent name="com.om.entity.dto" />
       <recent name="com.om.entity.vo" />
+      <recent name="com.om.entity.dto" />
       <recent name="com.om.exception" />
       <recent name="com.om.utils" />
       <recent name="com.om.interceptor" />
@@ -172,7 +172,22 @@
       <workItem from="1707364400277" duration="8765000" />
       <workItem from="1707387945482" duration="394000" />
       <workItem from="1707388468820" duration="1399000" />
-      <workItem from="1707438514767" duration="8903000" />
+      <workItem from="1707438514767" duration="9268000" />
+      <workItem from="1707463634286" duration="815000" />
+      <workItem from="1707633333740" duration="1575000" />
+      <workItem from="1707653917092" duration="6642000" />
+      <workItem from="1707728510583" duration="2281000" />
+      <workItem from="1707872966811" duration="1909000" />
+      <workItem from="1707973008307" duration="685000" />
+      <workItem from="1707983591450" duration="123000" />
+      <workItem from="1707983760440" duration="6261000" />
+      <workItem from="1707998898939" duration="608000" />
+      <workItem from="1708051465700" duration="670000" />
+      <workItem from="1708070824510" duration="32000" />
+      <workItem from="1708224080726" duration="11870000" />
+      <workItem from="1708413994818" duration="314000" />
+      <workItem from="1708414851331" duration="16812000" />
+      <workItem from="1708492515944" duration="7612000" />
     </task>
     <task id="LOCAL-00001" summary="管理员登录">
       <option name="closed" value="true" />
@@ -230,7 +245,55 @@
       <option name="project" value="LOCAL" />
       <updated>1707379339505</updated>
     </task>
-    <option name="localTasksCounter" value="8" />
+    <task id="LOCAL-00008" summary="web客户端用户修改">
+      <option name="closed" value="true" />
+      <created>1707455662216</created>
+      <option name="number" value="00008" />
+      <option name="presentableId" value="LOCAL-00008" />
+      <option name="project" value="LOCAL" />
+      <updated>1707455662216</updated>
+    </task>
+    <task id="LOCAL-00009" summary="配置CORS">
+      <option name="closed" value="true" />
+      <created>1707633567265</created>
+      <option name="number" value="00009" />
+      <option name="presentableId" value="LOCAL-00009" />
+      <option name="project" value="LOCAL" />
+      <updated>1707633567265</updated>
+    </task>
+    <task id="LOCAL-00010" summary="客户端模块接口">
+      <option name="closed" value="true" />
+      <created>1707989375307</created>
+      <option name="number" value="00010" />
+      <option name="presentableId" value="LOCAL-00010" />
+      <option name="project" value="LOCAL" />
+      <updated>1707989375307</updated>
+    </task>
+    <task id="LOCAL-00011" summary="诊断报告模块mp生成代码,mapper对应4个表,service对应4个,而controller只有一个repair">
+      <option name="closed" value="true" />
+      <created>1708225769308</created>
+      <option name="number" value="00011" />
+      <option name="presentableId" value="LOCAL-00011" />
+      <option name="project" value="LOCAL" />
+      <updated>1708225769308</updated>
+    </task>
+    <task id="LOCAL-00012" summary="客户端诊断报告">
+      <option name="closed" value="true" />
+      <created>1708432545588</created>
+      <option name="number" value="00012" />
+      <option name="presentableId" value="LOCAL-00012" />
+      <option name="project" value="LOCAL" />
+      <updated>1708432545588</updated>
+    </task>
+    <task id="LOCAL-00013" summary="添加用户id">
+      <option name="closed" value="true" />
+      <created>1708432756419</created>
+      <option name="number" value="00013" />
+      <option name="presentableId" value="LOCAL-00013" />
+      <option name="project" value="LOCAL" />
+      <updated>1708432756419</updated>
+    </task>
+    <option name="localTasksCounter" value="14" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -242,7 +305,13 @@
     <MESSAGE value="管理员电话和邮箱修改" />
     <MESSAGE value="web品牌管理接口" />
     <MESSAGE value="web维修厂管理接口" />
-    <option name="LAST_COMMIT_MESSAGE" value="web维修厂管理接口" />
+    <MESSAGE value="web客户端用户修改" />
+    <MESSAGE value="配置CORS" />
+    <MESSAGE value="客户端模块接口" />
+    <MESSAGE value="诊断报告模块mp生成代码,mapper对应4个表,service对应4个,而controller只有一个repair" />
+    <MESSAGE value="客户端诊断报告" />
+    <MESSAGE value="添加用户id" />
+    <option name="LAST_COMMIT_MESSAGE" value="添加用户id" />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>

+ 0 - 20
src/main/java/com/om/config/CORSConfig.java

@@ -1,20 +0,0 @@
-package com.om.config;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@Configuration
-public class CORSConfig implements WebMvcConfigurer {
-    @Override
-    public void addCorsMappings(CorsRegistry registry) {
-        //允许所有的访问请求(访问路径)
-        registry.addMapping("/**").
-                //允许所有的请求方法访问该跨域资源服务器
-                        allowedMethods("*").
-                //允许所有的请求域名访问我们的跨域资源
-                        allowedOrigins("*").
-                //允许所有的请求header访问
-                        allowedHeaders("*");
-    }
-}

+ 14 - 1
src/main/java/com/om/config/WebMvcConfiguration.java

@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
 
 import org.springframework.context.annotation.Configuration;
 
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
@@ -59,7 +60,19 @@ public class WebMvcConfiguration extends WebMvcConfigurationSupport {
         registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
     }
 
-   
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        log.info("已开启CORS跨域");
+
+        //允许所有的访问请求(访问路径)
+        registry.addMapping("/**").
+                //允许所有的请求方法访问该跨域资源服务器
+                        allowedMethods("*").
+                //允许所有的请求域名访问我们的跨域资源
+                        allowedOrigins("*").
+                //允许所有的请求header访问
+                        allowedHeaders("*");
+    }
 
     }
 

+ 39 - 2
src/main/java/com/om/controller/admin/RepairController.java

@@ -1,9 +1,14 @@
 package com.om.controller.admin;
 
 
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.om.entity.dto.RepairDTO;
+import com.om.service.IRepairService;
+import com.om.utils.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
 
-import org.springframework.web.bind.annotation.RestController;
+import javax.annotation.Resource;
 
 /**
  * <p>
@@ -15,7 +20,39 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequestMapping("/web/diagnosis/report")
+@Api(tags = "诊断报告模块接口")
 public class RepairController {
 
+    @Resource
+    IRepairService repairService;
+
+    @PostMapping("/create")
+    @ApiOperation("创建诊断报告")
+    Result create(@RequestBody RepairDTO repairDTO){
+
+        return repairService.create(repairDTO);
+    }
+
+    @PostMapping("/delete")
+    @ApiOperation("删除诊断报告")
+    Result delete (@RequestBody Integer id){
+
+        return repairService.delete(id);
+    }
+    @PostMapping("/getById")
+    @ApiOperation("获取指定指定报告")
+    Result  getById(@RequestBody Integer reportId){
+
+        return repairService.getByIds(reportId);
+    }
+
+    @PostMapping("/getPageList")
+    @ApiOperation("获取报告分页集合")
+    Result  getPageList(@RequestBody RepairDTO repairDTO){
+
+        return repairService.getPageList(repairDTO);
+    }
+
+
 
 }

+ 3 - 3
src/main/java/com/om/controller/user/APPRepairController.java

@@ -31,21 +31,21 @@ public class APPRepairController {
     @PostMapping("/create")
     @ApiOperation("创建诊断报告")
     public Result createReport(@RequestBody APPReportCreateDTO dto){
-        return repairService.createReport(dto);
+        return repairService.AppCreateReport(dto);
     }
 
 
     @PostMapping("/getPageList")
     @ApiOperation("获取诊断报告列表")
     public Result<AppRepairQueryPageVO> getPageList(@RequestBody APPRepairQueryPageDTO dto){
-        return repairService.getPageList(dto);
+        return repairService.AppGetPageList(dto);
     }
 
 
     @PostMapping("/delete")
     @ApiOperation("获取诊断报告列表")
     public Result delete(@RequestParam Integer id){
-        return repairService.delete(id);
+        return repairService.AppDelete(id);
     }
 
 }

+ 15 - 0
src/main/java/com/om/entity/dto/ElectronicControls.java

@@ -0,0 +1,15 @@
+package com.om.entity.dto;
+
+import com.om.entity.po.EcuInfo;
+import com.om.entity.po.FaultCode;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+public class ElectronicControls {
+
+    EcuInfo ecuInfo;
+    String electronicControlName;
+    FaultCode faultCode;
+}

+ 61 - 0
src/main/java/com/om/entity/dto/RepairDTO.java

@@ -0,0 +1,61 @@
+package com.om.entity.dto;
+
+import com.om.entity.po.Distributor;
+import com.om.entity.po.EcuInfo;
+import com.om.entity.po.FaultCode;
+import com.om.entity.po.Repair;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+
+@Data
+@NoArgsConstructor
+public class RepairDTO  {
+    private String abnormalSystemTitle;
+    private String address;
+    private String addressTitle;
+    private String carInfoTitle;
+    private String company;
+    private String companyTitle;
+    private LocalDateTime createTime;
+    private String createTimeStr;
+    private String diagnosticDetailsTitle;
+    private String diagnosticPath;
+    private String diagnosticReportTitle;
+    private String disclaimer;
+    private Integer electronicControlCount;
+
+    private ElectronicControls electronicControls;
+
+    private Integer faultCodeCount;
+    private String faultCodeTitle;
+    private String fileName;
+    private String mainTitle;
+    private String mileage;
+    private String mileageTitle;
+    private String modeYear;
+    private String modeYearTitle;
+    private String normalSystemTitle;
+    private Integer pageIndex;
+    private Integer pageSize;
+
+    private ReportTitleDto reportTitleDto;
+    private Integer sequence;
+    private String sn;
+    private String snTitle;
+    private Integer state;
+    private String telephone;
+    private String telephoneTitle;
+    private String title;
+    private LocalDateTime updateTime;
+    private String versionInfoTitle;
+    private String vin;
+    private String vinTitle;
+
+
+
+
+
+
+}

+ 24 - 0
src/main/java/com/om/entity/dto/ReportTitleDto.java

@@ -0,0 +1,24 @@
+package com.om.entity.dto;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+public class ReportTitleDto {
+
+    private String abnormalSystemTitle;
+    private String addressTitle;
+    private String carInfoTitle;
+    private String companyTitle;
+    private String diagnosticDetailsTitle;
+    private String diagnosticeReportTitle;
+    private String faultCodeTitle;
+    private String mainTitle;
+    private String modelYearTitle;
+    private String snTitle;
+    private String telephoneTitle;
+    private String versionInfoTitle;
+    private String vinTitle;
+
+}

+ 37 - 0
src/main/java/com/om/entity/vo/RepairCreateVO.java

@@ -0,0 +1,37 @@
+package com.om.entity.vo;
+
+import com.om.entity.dto.ElectronicControls;
+import com.om.entity.po.ElectronicControl;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+
+@Data
+@NoArgsConstructor
+public class RepairCreateVO {
+
+    private String address;
+    private String company;
+    private LocalDateTime createTime;
+    private LocalDateTime createTimeStr;
+    private String diagnosticPath;
+    private String disclaimer;
+    private Integer electronicControlCount;
+    private ElectronicControls electronicControls;
+    private Integer faultCodeCount;
+    private String fileName;
+    private Integer id;
+    private String mileage;
+    private String modelYear;
+    private Integer repairId;
+    private Integer reportId;
+    private Integer sequence;
+    private String sn;
+    private Integer state;
+    private String telephone;
+    private String title;
+    private LocalDateTime updateTime;
+    private String vin;
+
+}

+ 17 - 2
src/main/java/com/om/service/IRepairService.java

@@ -2,6 +2,7 @@ package com.om.service;
 
 import com.om.entity.dto.APPRepairQueryPageDTO;
 import com.om.entity.dto.APPReportCreateDTO;
+import com.om.entity.dto.RepairDTO;
 import com.om.entity.po.Repair;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.om.entity.vo.AppRepairQueryPageVO;
@@ -17,9 +18,23 @@ import com.om.utils.Result;
  */
 public interface IRepairService extends IService<Repair> {
 
-    Result createReport(APPReportCreateDTO dto);
+    Result AppCreateReport(APPReportCreateDTO dto);
 
-    Result<AppRepairQueryPageVO> getPageList(APPRepairQueryPageDTO dto);
+    Result<AppRepairQueryPageVO> AppGetPageList(APPRepairQueryPageDTO dto);
+
+    Result AppDelete(Integer id);
+
+
+
+
+    Result create(RepairDTO repairDTO);
 
     Result delete(Integer id);
+
+    Result getByIds(Integer reportId);
+
+    Result getPageList(RepairDTO repairDTO);
+
+
+
 }

+ 119 - 7
src/main/java/com/om/service/impl/RepairServiceImpl.java

@@ -2,19 +2,19 @@ package com.om.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.om.entity.dto.*;
 import com.om.entity.po.*;
 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.mapper.RepairMapper;
-import com.om.service.IEcuInfoService;
-import com.om.service.IElectronicControlService;
-import com.om.service.IFaultCodeService;
-import com.om.service.IRepairService;
+import com.om.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.om.utils.Result;
+import com.om.utils.UserContext;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -23,6 +23,7 @@ import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Random;
 import java.util.stream.Collectors;
 
 /**
@@ -45,9 +46,15 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
     @Resource
     private IElectronicControlService electronicControlService;
 
+    @Resource
+    RepairMapper repairMapper;
+
+    @Resource
+    IUserService userService;
+
     @Override
     @Transactional
-    public Result createReport(APPReportCreateDTO dto) {
+    public Result AppCreateReport(APPReportCreateDTO dto) {
         // 判断数据、
         if (BeanUtil.isEmpty(dto)) {
             throw new BadReqException("数据为空");
@@ -73,6 +80,7 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
             for (FaultCode faultCode : faultCodes1) {
                 faultCode.setElectronicControlId(electronicControl.getId());
             }
+            
             repair.setElectronicControlId(electronicControl.getId());
             ecuInfoService.saveBatch(ecuInfos);
             faultCodeService.saveBatch(faultCodes1);
@@ -85,7 +93,7 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
     }
 
     @Override
-    public Result<AppRepairQueryPageVO> getPageList(APPRepairQueryPageDTO dto) {
+    public Result<AppRepairQueryPageVO> AppGetPageList(APPRepairQueryPageDTO dto) {
         //获取数据
         Integer pageIndex = dto.getPageIndex();
         Integer pageSize = dto.getPageSize();
@@ -135,7 +143,7 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
 
     @Override
     @Transactional
-    public Result delete(Integer id) {
+    public Result AppDelete(Integer id) {
         //根据id查询
         Repair repair = this.getById(id);
         if (BeanUtil.isEmpty(repair)) {
@@ -152,6 +160,7 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
         List<EcuInfo> ecuInfos = ecuInfoService.lambdaQuery()
                 .eq(EcuInfo::getElectronicControlId, electronicControlId)
                 .list();
+
         List<Integer> ecuIds = ecuInfos.stream().map(c -> c.getId()).collect(Collectors.toList());
         faultCodeService.removeByIds(faultCodeIds);
         ecuInfoService.removeByIds(ecuIds);
@@ -160,5 +169,108 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
         this.removeById(id);
         return Result.ok();
     }
+
+
+
+
+
+
+    @Override
+    public Result create(RepairDTO repairDTO) {
+
+        Repair repair = new Repair();
+        int eleId = new Random(100000000).nextInt();
+        repair.setElectronicControlId(eleId);
+        BeanUtil.copyProperties(repairDTO,repair);
+        boolean repairBoolean = this.save(repair);
+
+        ElectronicControl ele = new ElectronicControl();
+        ele.setId(eleId);
+        ele.setElectronicControlName(repairDTO.getElectronicControls().getElectronicControlName());
+        BeanUtil.copyProperties(repairDTO.getReportTitleDto(),ele);
+        boolean eleBoolean = electronicControlService.save(ele);
+
+        EcuInfo ecuInfo = new EcuInfo();
+        BeanUtil.copyProperties(repairDTO.getElectronicControls().getEcuInfo(),ecuInfo);
+        ecuInfo.setElectronicControlId(eleId);
+        boolean ecuBoolean = ecuInfoService.save(ecuInfo);
+
+        FaultCode faultCode = new FaultCode();
+        BeanUtil.copyProperties(repairDTO.getElectronicControls().getFaultCode(),faultCode);
+        faultCode.setElectronicControlId(eleId);
+        boolean fauBoolean = faultCodeService.save(faultCode);
+
+        //此处需要做一个事务回滚
+        //如果四个有一个添加失败,则进行事务回滚
+
+        //如果没有,则证明成功
+        Integer userId = UserContext.getUserId();
+        User user = userService.getById(userId);
+        RepairCreateVO createVO = new RepairCreateVO();
+        BeanUtil.copyProperties(user,createVO);
+
+
+        //这里需要做个返回
+        //出现问题,所指的地址分别是啥
+        return Result.ok();
+
+
+    }
+
+    @Override
+    public Result delete(Integer id) {
+        Repair repair = this.getById(id);
+        if (repair == null){
+            throw new BadReqException("删除错误");
+        }
+        this.removeById(id);
+        Integer eleId = repair.getElectronicControlId();
+        electronicControlService.removeById(id);
+
+        QueryWrapper<EcuInfo> ecuQueryWrapper = new QueryWrapper<EcuInfo>();
+        QueryWrapper<FaultCode> fauQueryWrapper = new QueryWrapper<FaultCode>();
+        ecuQueryWrapper.lambda().eq(EcuInfo::getElectronicControlId,eleId);
+        fauQueryWrapper.lambda().eq(FaultCode::getElectronicControlId,eleId);
+        removeById(id);
+        ecuInfoService.remove(ecuQueryWrapper);
+        faultCodeService.remove(fauQueryWrapper);
+
+
+        return Result.ok();
+    }
+
+    @Override
+    public Result getByIds(Integer reportId) {
+        Repair repair = this.getById(reportId);
+        if (repair == null){
+            throw new BadReqException("查询错误");
+        }
+        Integer eleId = repair.getElectronicControlId();
+        ElectronicControl ele = electronicControlService.getById(eleId);
+        QueryWrapper<EcuInfo> ecuQueryWrapper = new QueryWrapper<>();
+        QueryWrapper<FaultCode> fauQueryWrapper = new QueryWrapper<>();
+        ecuQueryWrapper.lambda().eq(EcuInfo::getElectronicControlId,eleId);
+        fauQueryWrapper.lambda().eq(FaultCode::getElectronicControlId,eleId);
+        EcuInfo ecu = ecuInfoService.getOne(ecuQueryWrapper);
+        FaultCode faultCode = faultCodeService.getOne(fauQueryWrapper);
+
+        RepairCreateVO repairCreateVO = new RepairCreateVO();
+        BeanUtil.copyProperties(repair,repairCreateVO);
+        BeanUtil.copyProperties(ecu,repairCreateVO.getElectronicControls().getEcuInfo());
+        BeanUtil.copyProperties(faultCode,repairCreateVO.getElectronicControls().getFaultCode());
+        repairCreateVO.getElectronicControls().setElectronicControlName(ele.getElectronicControlName());
+        return Result.ok(repairCreateVO);
+    }
+
+    @Override
+    public Result getPageList(RepairDTO repairDTO) {
+        Integer userId = UserContext.getUserId();
+        User user = userService.getById(userId);
+        QueryWrapper<Repair> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(Repair::getUserId,userId);
+        List<Repair> repairs = repairMapper.selectList(queryWrapper);
+
+        return Result.ok(repairs);
+    }
 }