From 9eac0b8bb82ade0e81f1e47d43f15869f82246ac Mon Sep 17 00:00:00 2001 From: dongdingding <207595406@qq.com> Date: Tue, 31 Oct 2023 13:38:45 +0800 Subject: [PATCH] bug fix --- .../tcZz/controller/TcAqyhController.java | 15 +++++++++++- .../tcZz/controller/TcFbqkController.java | 15 +++++++++++- .../tcZz/controller/TcMapController.java | 15 +++++++++++- .../tcZz/controller/TcMtlxController.java | 24 ++++++++++++------- .../tcZz/controller/TcTbwcController.java | 17 ++++++++++++- .../tcZz/controller/TcWpyrwwclController.java | 16 ++++++++++++- .../java/com/ruoyi/tcZz/domain/TcZbxq.java | 6 +++++ .../mapper/tcZz/netManage/ScreenMapper.xml | 2 +- .../mapper/tcZz/netWorkYq/TcZbxqMapper.xml | 7 +++++- 9 files changed, 102 insertions(+), 15 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcAqyhController.java b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcAqyhController.java index 85d3a0f7..19fd891b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcAqyhController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcAqyhController.java @@ -4,6 +4,7 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import com.ruoyi.tcZz.domain.TcAqg; +import com.ruoyi.tcZz.domain.TcFbqk; import com.ruoyi.tcZz.domain.TcXtjc; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -75,7 +76,19 @@ public class TcAqyhController extends BaseController @PostMapping public AjaxResult add(@RequestBody TcAqyh tcAqyh) { - return toAjax(tcAqyhService.insertTcAqyh(tcAqyh)); + //根据Yh_name判断如果已存在,则调修改 + TcAqyh newtcAqyh=new TcAqyh(); + newtcAqyh.setYhName(tcAqyh.getYhName()); + List list = tcAqyhService.selectTcAqyhList(newtcAqyh); + if (!list.isEmpty()){ + for (TcAqyh a :list) { + tcAqyh.setId(a.getId()); + tcAqyhService.updateTcAqyh(tcAqyh); + } + }else { + tcAqyhService.insertTcAqyh(tcAqyh); + } + return AjaxResult.success(); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcFbqkController.java b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcFbqkController.java index cd9f410b..f05b4685 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcFbqkController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcFbqkController.java @@ -4,6 +4,7 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import com.ruoyi.tcZz.domain.TcFb; +import com.ruoyi.tcZz.domain.TcSgjipTop5; import com.ruoyi.tcZz.domain.TcWljg; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -75,7 +76,19 @@ public class TcFbqkController extends BaseController @PostMapping public AjaxResult add(@RequestBody TcFbqk tcFbqk) { - return toAjax(tcFbqkService.insertTcFbqk(tcFbqk)); + //根据City_name判断如果已存在,则调修改 + TcFbqk newtcFbqk=new TcFbqk(); + newtcFbqk.setCityName(tcFbqk.getCityName()); + List list = tcFbqkService.selectTcFbqkList(newtcFbqk); + if (!list.isEmpty()){ + for (TcFbqk a :list) { + tcFbqk.setId(a.getId()); + tcFbqkService.updateTcFbqk(tcFbqk); + } + }else { + tcFbqkService.insertTcFbqk(tcFbqk); + } + return AjaxResult.success(); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcMapController.java b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcMapController.java index ef9f0d1c..2f5345fa 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcMapController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcMapController.java @@ -9,6 +9,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.tcZz.domain.TcAqg; import com.ruoyi.tcZz.domain.TcJgdw; import com.ruoyi.tcZz.domain.TcMap; +import com.ruoyi.tcZz.domain.TcTbwc; import com.ruoyi.tcZz.service.ITcMapService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -70,7 +71,19 @@ public class TcMapController extends BaseController { @ApiOperation(value = "新增地图统计") @PostMapping public AjaxResult add(@RequestBody TcMap tcMap) { - return toAjax(tcMapService.insertTcMap(tcMap)); + //根据Name判断如果已存在,则调修改 + TcMap newtcMap=new TcMap(); + newtcMap.setName(tcMap.getName()); + List list = tcMapService.selectTcMapList(newtcMap); + if (!list.isEmpty()){ + for (TcMap a :list) { + tcMap.setId(a.getId()); + tcMapService.updateTcMap(tcMap); + } + }else { + tcMapService.insertTcMap(tcMap); + } + return AjaxResult.success(); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcMtlxController.java b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcMtlxController.java index 430658aa..4cf1bea0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcMtlxController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcMtlxController.java @@ -1,19 +1,15 @@ package com.ruoyi.tcZz.controller; -import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.tcZz.domain.TcAqg; import com.ruoyi.tcZz.domain.TcMap; import com.ruoyi.tcZz.domain.TcMtlx; import com.ruoyi.tcZz.service.ITcMtlxService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -70,7 +66,20 @@ public class TcMtlxController extends BaseController { @ApiOperation(value = "新增媒体类型") @PostMapping public AjaxResult add(@RequestBody TcMtlx tcMtlx) { - return toAjax(tcMtlxService.insertTcMtlx(tcMtlx)); + + //根据Name判断如果已存在,则调修改 + TcMtlx newtcMtlx=new TcMtlx(); + newtcMtlx.setName(tcMtlx.getName()); + List list = tcMtlxService.selectTcMtlxList(newtcMtlx); + if (!list.isEmpty()){ + for (TcMtlx a :list) { + tcMtlx.setId(a.getId()); + tcMtlxService.updateTcMtlx(tcMtlx); + } + }else { + tcMtlxService.insertTcMtlx(tcMtlx); + } + return AjaxResult.success(); } /** @@ -114,14 +123,13 @@ public class TcMtlxController extends BaseController { @ApiOperation("批量启用禁用") @GetMapping("/isStatus") public AjaxResult isStatus(@RequestParam("isStatus") Integer isStatus, @RequestParam("ids") List ids) { - tcMtlxService.updateByisStatus(isStatus,ids); + tcMtlxService.updateByisStatus(isStatus, ids); return AjaxResult.success(); } @ApiOperation("通用下载excel模板") @PostMapping("/importTemplate") - public void importTemplate(HttpServletResponse response) - { + public void importTemplate(HttpServletResponse response) { ExcelUtil util = new ExcelUtil(TcMtlx.class); util.importTemplateExcel(response, " 媒体类型"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcTbwcController.java b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcTbwcController.java index aa03c0ca..109390df 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcTbwcController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcTbwcController.java @@ -7,6 +7,7 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.tcZz.domain.TcAqg; +import com.ruoyi.tcZz.domain.TcAqyh; import com.ruoyi.tcZz.domain.TcTbcz; import com.ruoyi.tcZz.domain.TcTbwc; import com.ruoyi.tcZz.service.ITcTbwcService; @@ -70,7 +71,21 @@ public class TcTbwcController extends BaseController { @ApiOperation(value = "新增通报完成情况") @PostMapping public AjaxResult add(@RequestBody TcTbwc tcTbwc) { - return toAjax(tcTbwcService.insertTcTbwc(tcTbwc)); + //根据year + Time_name判断如果已存在,则调修改 + TcTbwc newtcTbwc=new TcTbwc(); + newtcTbwc.setYear(tcTbwc.getYear()); + newtcTbwc.setTimeName(tcTbwc.getTimeName()); + List list = tcTbwcService.selectTcTbwcList(newtcTbwc); + if (!list.isEmpty()){ + for (TcTbwc a :list) { + tcTbwc.setId(a.getId()); + tcTbwcService.updateTcTbwc(tcTbwc); + } + }else { + tcTbwcService.insertTcTbwc(tcTbwc); + } + + return AjaxResult.success(); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcWpyrwwclController.java b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcWpyrwwclController.java index 85f1b85a..f84bdb74 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcWpyrwwclController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcWpyrwwclController.java @@ -3,6 +3,7 @@ package com.ruoyi.tcZz.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.ruoyi.tcZz.domain.TcMtlx; import com.ruoyi.tcZz.domain.TcWljgtj; import com.ruoyi.tcZz.domain.TcWpy; import io.swagger.annotations.Api; @@ -70,7 +71,20 @@ public class TcWpyrwwclController extends BaseController { @ApiOperation(value = "新增网评员任务完成率") @PostMapping public AjaxResult add(@RequestBody TcWpyrwwcl tcWpyrwwcl) { - return toAjax(tcWpyrwwclService.insertTcWpyrwwcl(tcWpyrwwcl)); + + //根据unit判断如果已存在,则调修改 + TcWpyrwwcl newtcWpyrwwcl=new TcWpyrwwcl(); + newtcWpyrwwcl.setUnit(tcWpyrwwcl.getUnit()); + List list = tcWpyrwwclService.selectTcWpyrwwclList(newtcWpyrwwcl); + if (!list.isEmpty()){ + for (TcWpyrwwcl a :list) { + tcWpyrwwcl.setId(a.getId()); + tcWpyrwwclService.updateTcWpyrwwcl(tcWpyrwwcl); + } + }else { + tcWpyrwwclService.insertTcWpyrwwcl(tcWpyrwwcl); + } + return AjaxResult.success(); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/domain/TcZbxq.java b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/domain/TcZbxq.java index f9b893f9..d2e77509 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/domain/TcZbxq.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/domain/TcZbxq.java @@ -48,4 +48,10 @@ public class TcZbxq extends BaseEntity @Excel(name = "舆情状态") @ApiModelProperty(value = "舆情状态") private String yqState; + + /** 文件路径 */ + @Excel(name = "文件路径") + @ApiModelProperty(value = "文件路径") + private String fileUrl; + } diff --git a/ruoyi-admin/src/main/resources/mapper/tcZz/netManage/ScreenMapper.xml b/ruoyi-admin/src/main/resources/mapper/tcZz/netManage/ScreenMapper.xml index 26b2c509..fc3ecf7a 100644 --- a/ruoyi-admin/src/main/resources/mapper/tcZz/netManage/ScreenMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/tcZz/netManage/ScreenMapper.xml @@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" area; @@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and update_by = #{updateBy} and update_time between #{params.beginUpdateTime} and #{params.endUpdateTime} and remark = #{remark} + and file_url = #{fileUrl} order by create_time desc @@ -57,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by, update_time, remark, + file_url, #{areaId}, @@ -69,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateBy}, #{updateTime}, #{remark}, + #{fileUrl}, @@ -85,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = #{updateTime}, remark = #{remark}, + fileUrl = #{fileUrl}, where id = #{id}