浏览代码

修改bug

suntianwu 3 年之前
父节点
当前提交
3b701eb147

+ 2 - 2
src/main/java/com/care/bms/controller/StationController.java

@@ -84,8 +84,8 @@ public class StationController {
         try {
             UserLogindConvertVO loginUser = WebPageUtils.getCurrentLoginedUser(request);
             vo.setOrgId(loginUser.getOrgId());
-            stationService.addStation(vo);
-            return  Result.success("新增成功!");
+            Long id = stationService.addStation(vo);
+            return  Result.success("新增成功!",id);
         }catch (BDException e) {
             log.error("新增服务站-出现异常",e);
             return Result.error(e.getMessage());

+ 2 - 1
src/main/java/com/care/bms/service/StationService.java

@@ -117,7 +117,7 @@ public class StationService {
         return datas;
     }
 
-    public void addStation(StationVO vo) throws Exception {
+    public Long addStation(StationVO vo) throws Exception {
         QueryWrapper<CareStation> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(CareStation::getName,vo.getName());
         int count = this.careStationService.count(queryWrapper);
@@ -134,6 +134,7 @@ public class StationService {
         if (!flag) {
             throw new BDException("新增服务站失败!");
         }
+        return careStation.getId();
     }
 
     private String getCode(){