月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-09-07 befdcdd0e9c89bc9be3a69fc3033c3cf7afd2ee2
src/main/java/com/moon/server/controller/data/PublishController.java
@@ -136,13 +136,13 @@
        switch (type) {
            case "DOM":
                return "type = 'DOM'";
                return "a.type = 'DOM'";
            case "DEM":
                return "type = 'DEM'";
                return "a.type = 'DEM'";
            case "Vector":
                return "type = 'Vector'";
                return "a.type = 'Vector'";
            case "Model":
                return "type = 'Model'";
                return "a.type = 'Model'";
            default:
                throw new Exception("数据类型不匹配");
        }
@@ -193,15 +193,19 @@
            if (StringHelper.isEmpty(entity.getType())) {
                return fail("发布类别为空", null);
            }
            if (!ShuJianService.TYPES.contains(entity.getType())) {
                return fail("发布类别不支持", null);
            }
            UserEntity ue = tokenService.getCurrentUser(req);
            if (null != ue) {
                entity.setUserId(ue.getId());
                entity.setDepcode(ue.getDepcode());
            }
            entity.setDefault();
            permsService.clearPermsCache();
            Integer rows = shuJianService.insertSjService(entity, req, res);
            Integer rows = shuJianService.insertSjService(entity);
            return success(rows);
        } catch (Exception ex) {
@@ -230,9 +234,10 @@
                entity.setUserId(ue.getId());
                entity.setDepcode(ue.getDepcode());
            }
            entity.setDefault();
            permsService.clearPermsCache();
            Integer rows = shuJianService.updateSjService(entity, req, res);
            Integer rows = shuJianService.updateSjService(entity);
            return success(rows);
        } catch (Exception ex) {
@@ -245,7 +250,7 @@
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "query", allowMultiple = true, example = "1")
    })
    @GetMapping(value = "/deletes")
    @GetMapping(value = "/deletesSjServices")
    public ResponseMsg<Integer> deletesSjServices(@RequestParam List<Integer> ids) {
        try {
            if (null == ids || ids.isEmpty()) {
@@ -260,4 +265,27 @@
            return fail(ex.getMessage(), -1);
        }
    }
    @SysLog()
    @ApiOperation(value = "更新一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "PublishEntity", paramType = "body")
    })
    @ResponseBody
    @PostMapping(value = "/update", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> update(@RequestBody PublishEntity entity, HttpServletRequest req) {
        try {
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue != null) {
                entity.setUpdateUser(ue.getId());
            }
            permsService.clearPermsCache();
            int count = publishService.update(entity);
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
        }
    }
}