lxw
2023-07-25 0ddd10c56858e56a0cac326c45dc2d9b56e176b6
updateName加属性关联就加stationIdEx,不关联就不传
2个文件已修改
21 ■■■■ 已修改文件
src/main/java/com/whyc/controller/StationInfController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/StationInfService.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/StationInfController.java
@@ -55,8 +55,8 @@
    public Response updateName(@RequestParam(required = false) String stationName, @RequestParam(required = false) String stationName1
            , @RequestParam(required = false) String stationName2, @RequestParam(required = false) String stationName3
            , @RequestParam(required = false) String stationName4, @RequestParam(required = false) String stationName5
            , @RequestParam String stationId) {
        return service.updateName(stationName, stationName1, stationName2, stationName3, stationName4, stationName5, stationId);
            , @RequestParam(required = false) String stationIdEx, @RequestParam String stationId) {
        return service.updateName(stationName, stationName1, stationName2, stationName3, stationName4, stationName5, stationIdEx, stationId);
    }
    @ApiOperation(value = "删除总站点")
src/main/java/com/whyc/service/StationInfService.java
@@ -128,28 +128,41 @@
    //编辑机房名
    @Transactional
    public Response updateName(String stationName, String stationName1, String stationName2, String stationName3, String stationName4, String stationName5, String stationId) {
    public Response updateName(String stationName, String stationName1, String stationName2, String stationName3, String stationName4, String stationName5
            , String stationIdEx, String stationId) {
        UpdateWrapper wrapper = new UpdateWrapper();
        wrapper.eq("stationId", stationId);
        UpdateWrapper sinfWrapper = new UpdateWrapper();
        sinfWrapper.eq("stationId", stationId);
        if (stationName != null && !stationName.isEmpty()) {
            wrapper.set("stationName", stationName);
            sinfWrapper.set("stationName", stationName);
        }
        if (stationName1 != null && !stationName1.isEmpty()) {
            wrapper.set("stationName1", stationName1);
            sinfWrapper.set("stationName1", stationName1);
        }
        if (stationName2 != null && !stationName2.isEmpty()) {
            wrapper.set("stationName2", stationName2);
            sinfWrapper.set("stationName2", stationName2);
        }
        if (stationName3 != null && !stationName3.isEmpty()) {
            wrapper.set("stationName3", stationName3);
            sinfWrapper.set("stationName3", stationName3);
        }
        if (stationName4 != null && !stationName4.isEmpty()) {
            wrapper.set("stationName4", stationName4);
            sinfWrapper.set("stationName4", stationName4);
        }
        if (stationName5 != null && !stationName5.isEmpty()) {
            wrapper.set("stationName5", stationName5);
            sinfWrapper.set("stationName5", stationName5);
        }
        int flag = mapper.update(null, wrapper);
        if (stationIdEx != null && !stationIdEx.isEmpty()) {
            int togetherFlag = mapper.getTogetherFlag(stationIdEx);
            sinfWrapper.set("together_flag", togetherFlag);
        }
        int flag = mapper.update(null, sinfWrapper);
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("stationId", stationId);
        List listB = binfMapper.selectList(queryWrapper);