hfxc226 il y a 1 an
Parent
commit
7227835fc9

+ 14 - 0
platform-rest/src/main/java/com/platform/rest/controller/sb/SbInfoController.java

@@ -162,6 +162,20 @@ public class SbInfoController {
         return new R<>();
     }
 
+    /**
+     * 仅:修改设备电子地图位置
+     *
+     * @param sbInfoDTO 设备基础信息DTO
+     * @return R
+     */
+    @SysLog("修改设备电子地图位置")
+    @PutMapping("/position/{id}")
+    @PreAuthorize("@pms.hasPermission('sb-infos-edit')")
+    public R updatePosition(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody SbInfoDTO sbInfoDTO) {
+        sbInfoService.modPositionByDTO(sbInfoDTO);
+        return new R<>();
+    }
+
     /**
      * 更新设备状态:位置等其他信息
      *

+ 7 - 0
platform-service/src/main/java/com/platform/service/sb/SbInfoService.java

@@ -34,6 +34,13 @@ public interface SbInfoService extends IBaseService<SbInfo, SbInfoDTO> {
 
     List<SbInfoTypeReportVO2> getTypeReport(SbTypeDTO dto);
 
+    /**
+     * 更新设备电子地图位置
+     *
+     * @param model
+     */
+    void modPositionByDTO(SbInfoDTO model);
+
     /**
      * 根据主键更新属性不为null的值
      *

+ 9 - 0
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoServiceImpl.java

@@ -886,6 +886,15 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
         this.saveImageFile(model);
     }
 
+    @Override
+    public void modPositionByDTO(SbInfoDTO model) {
+        SbInfo sbInfo = new SbInfo();
+        sbInfo.setId(model.getId());
+        sbInfo.setZjm(model.getZjm());
+        sbInfo.setJbdh(model.getJbdh());
+        mapper.updateByPrimaryKeySelective(sbInfo);
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void updateStatus(SbInfoDTO model) {