| | |
| | | |
| | | import com.ycl.system.Result; |
| | | import com.ycl.system.domain.group.Add; |
| | | import constant.TableNameConstants; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | import com.ycl.platform.service.DynamicColumnService; |
| | | import com.ycl.platform.domain.form.DynamicColumnForm; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import static constant.TableNameConstants.COLUMN_NAME_VIDEO; |
| | | |
| | | /** |
| | | * 动态列 前端控制器 |
| | |
| | | return dynamicColumnService.addByTableName(tableName,form); |
| | | } |
| | | |
| | | private final static String COLUMN_NAME_VIDEO = "uy_record_meta_d_sum"; |
| | | private final static String COLUMN_NAME_POINT = ""; |
| | | |
| | | |
| | | @PutMapping("/updateByTableName") |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result updateByTableName(@RequestParam @NotNull(message = "路径名不能为空")String pathName, @RequestBody @NotEmpty(message = "数据为空,无法保存") List<DynamicColumnForm> columnList){ |
| | | String tableName = getTableNameByPathNane(pathName); |
| | | if ("".equals(tableName)){ |
| | | return null; |
| | | } |
| | | return dynamicColumnService.updateByTableName(tableName,columnList); |
| | | } |
| | | |
| | | private String getTableNameByPathNane(String pathName) { |
| | | String tableName = ""; |
| | | if ("录像可用率".equals(pathName)){ |
| | | tableName = COLUMN_NAME_VIDEO; |
| | | }else if("点位在线率".equals(pathName)){ |
| | | tableName = COLUMN_NAME_POINT; |
| | | tableName = TableNameConstants.COLUMN_NAME_VIDEO; |
| | | }else if("车辆点位在线率".equals(pathName)){ |
| | | tableName = TableNameConstants.COLUMN_NAME_CAR_POINT; |
| | | }else if("人脸点位在线率".equals(pathName)){ |
| | | tableName = TableNameConstants.COLUMN_NAME_FACE_POINT; |
| | | }else if("视频点位在线率".equals(pathName)){ |
| | | tableName = TableNameConstants.COLUMN_NAME_VIDEO_POINT; |
| | | } |
| | | return tableName; |
| | | } |