# Conflicts:
#	ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcCyController.java
#	ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcSslxController.java
main
dongdingding 1 year ago
commit eca422bb3e

@ -1,14 +1,20 @@
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.TcAqyh;
import com.ruoyi.tcZz.domain.TcBzhan;
import com.ruoyi.tcZz.domain.TcCy;
import com.ruoyi.tcZz.domain.TcWljg;
import com.ruoyi.tcZz.service.ITcCyService;
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;
@ -54,7 +60,20 @@ public class TcCyController extends BaseController {
@ApiOperation(value = "新增词云")
@PostMapping
public AjaxResult add(@RequestBody TcCy tcCy) {
return toAjax(tcCyService.insertTcCy(tcCy));
//根据area_id + cy_name判断如果已存在则调修改
TcCy newtcCy = new TcCy();
newtcCy.setAreaId(tcCy.getAreaId());
newtcCy.setCyName(tcCy.getCyName());
List<TcCy> list = tcCyService.selectTcCyList(newtcCy);
if (!list.isEmpty()) {
for (TcCy a : list) {
tcCy.setId(a.getId());
tcCyService.updateTcCy(tcCy);
}
} else {
tcCyService.insertTcCy(tcCy);
}
return AjaxResult.success();
}
/**

@ -65,7 +65,19 @@ public class TcJbsjndfltjController extends BaseController {
@ApiOperation("新增举报事件年度分类统计")
@PostMapping
public AjaxResult add(@RequestBody TcJbsjndfltj tcJbsjndfltj) {
return toAjax(tcJbsjndfltjService.insertTcJbsjndfltj(tcJbsjndfltj));
//根据type判断如果已存在则调修改
TcJbsjndfltj newtcJbsjndfltj = new TcJbsjndfltj();
newtcJbsjndfltj.setType(tcJbsjndfltj.getType());
List<TcJbsjndfltj> list = tcJbsjndfltjService.selectTcJbsjndfltjList(newtcJbsjndfltj);
if (!list.isEmpty()) {
for (TcJbsjndfltj a : list) {
tcJbsjndfltj.setId(a.getId());
tcJbsjndfltjService.updateTcJbsjndfltj(tcJbsjndfltj);
}
} else {
tcJbsjndfltjService.insertTcJbsjndfltj(tcJbsjndfltj);
}
return AjaxResult.success();
}
/**

@ -1,14 +1,20 @@
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.TcAqyh;
import com.ruoyi.tcZz.domain.TcSjlytj;
import com.ruoyi.tcZz.domain.TcSslx;
import com.ruoyi.tcZz.service.ITcSslxService;
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;
@ -65,7 +71,18 @@ public class TcSslxController extends BaseController {
@ApiOperation(value = "新增涉事类型")
@PostMapping
public AjaxResult add(@RequestBody TcSslx tcSslx) {
return toAjax(tcSslxService.insertTcSslx(tcSslx));
TcSslx newtcSslx=new TcSslx();
newtcSslx.setName(tcSslx.getName());
List<TcSslx> list = tcSslxService.selectTcSslxList(newtcSslx);
if (!list.isEmpty()){
for (TcSslx a :list) {
tcSslx.setId(a.getId());
tcSslxService.updateTcSslx(tcSslx);
}
}else {
tcSslxService.insertTcSslx(tcSslx);
}
return AjaxResult.success();
}
/**
@ -87,6 +104,7 @@ public class TcSslxController extends BaseController {
}
/**
*
*/
@ -109,13 +127,14 @@ public class TcSslxController extends BaseController {
@ApiOperation("批量启用禁用")
@GetMapping("/isStatus")
public AjaxResult isStatus(@RequestParam("isStatus") Integer isStatus, @RequestParam("ids") List<String> ids) {
tcSslxService.updateByisStatus(isStatus, ids);
tcSslxService.updateByisStatus(isStatus,ids);
return AjaxResult.success();
}
@ApiOperation("通用下载excel模板")
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
public void importTemplate(HttpServletResponse response)
{
ExcelUtil<TcSslx> util = new ExcelUtil<TcSslx>(TcSslx.class);
util.importTemplateExcel(response, " 涉事类型");
}

@ -100,7 +100,18 @@ public class TcAqyhServiceImpl implements ITcAqyhService
StringBuilder successMsg = new StringBuilder();
if (!tcAqyhList.isEmpty()) {
for (TcAqyh tcAqyh : tcAqyhList) {
tcAqyhMapper.insertTcAqyh(tcAqyh);
TcAqyh newtcAqyh=new TcAqyh();
newtcAqyh.setYhName(tcAqyh.getYhName());
List<TcAqyh> list = tcAqyhMapper.selectTcAqyhList(newtcAqyh);
if (!list.isEmpty()){
for (TcAqyh a :list) {
tcAqyh.setId(a.getId());
tcAqyhMapper.updateTcAqyh(tcAqyh);
}
}else {
tcAqyhMapper.insertTcAqyh(tcAqyh);
}
}
successMsg.append("导入成功");
}

@ -1,97 +1,90 @@
package com.ruoyi.tcZz.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcZz.domain.TcWljg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tcZz.mapper.TcCyMapper;
import com.ruoyi.tcZz.domain.TcCy;
import com.ruoyi.tcZz.mapper.TcCyMapper;
import com.ruoyi.tcZz.service.ITcCyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
*
* @author ruoyi
* @date 2023-10-13
*/
@Service
public class TcCyServiceImpl implements ITcCyService
{
public class TcCyServiceImpl implements ITcCyService {
@Autowired
private TcCyMapper tcCyMapper;
/**
*
*
*
* @param id
* @return
*/
@Override
public TcCy selectTcCyById(Long id)
{
public TcCy selectTcCyById(Long id) {
return tcCyMapper.selectTcCyById(id);
}
/**
*
*
*
* @param tcCy
* @return
*/
@Override
public List<TcCy> selectTcCyList(TcCy tcCy)
{
public List<TcCy> selectTcCyList(TcCy tcCy) {
return tcCyMapper.selectTcCyList(tcCy);
}
/**
*
*
*
* @param tcCy
* @return
*/
@Override
public int insertTcCy(TcCy tcCy)
{
public int insertTcCy(TcCy tcCy) {
tcCy.setCreateTime(DateUtils.getNowDate());
return tcCyMapper.insertTcCy(tcCy);
}
/**
*
*
*
* @param tcCy
* @return
*/
@Override
public int updateTcCy(TcCy tcCy)
{
public int updateTcCy(TcCy tcCy) {
tcCy.setUpdateTime(DateUtils.getNowDate());
return tcCyMapper.updateTcCy(tcCy);
}
/**
*
*
*
* @param ids
* @return
*/
@Override
public int deleteTcCyByIds(Long[] ids)
{
public int deleteTcCyByIds(Long[] ids) {
return tcCyMapper.deleteTcCyByIds(ids);
}
/**
*
*
*
* @param id
* @return
*/
@Override
public int deleteTcCyById(Long id)
{
public int deleteTcCyById(Long id) {
return tcCyMapper.deleteTcCyById(id);
}
@ -100,15 +93,28 @@ public class TcCyServiceImpl implements ITcCyService
StringBuilder successMsg = new StringBuilder();
if (!tcCyList.isEmpty()) {
for (TcCy tcCy : tcCyList) {
tcCyMapper.insertTcCy(tcCy);
//根据area_id + cy_name判断如果已存在则调修改
TcCy newtcCy = new TcCy();
newtcCy.setAreaId(tcCy.getAreaId());
newtcCy.setCyName(tcCy.getCyName());
List<TcCy> list = tcCyMapper.selectTcCyList(newtcCy);
if (!list.isEmpty()) {
for (TcCy a : list) {
tcCy.setId(a.getId());
tcCyMapper.updateTcCy(tcCy);
}
} else {
tcCyMapper.insertTcCy(tcCy);
}
}
successMsg.append("导入成功");
}
return successMsg.toString();
}
@Override
public void updateByisStatus(Integer isStatus,List<String> ids) {
tcCyMapper.updateByisStatus(isStatus,ids);
public void updateByisStatus(Integer isStatus, List<String> ids) {
tcCyMapper.updateByisStatus(isStatus, ids);
}
}

@ -100,7 +100,17 @@ public class TcFbqkServiceImpl implements ITcFbqkService
StringBuilder successMsg = new StringBuilder();
if (!tcFbqkList.isEmpty()) {
for (TcFbqk tcFbqk : tcFbqkList) {
tcFbqkMapper.insertTcFbqk(tcFbqk);
TcFbqk newtcFbqk=new TcFbqk();
newtcFbqk.setCityName(tcFbqk.getCityName());
List<TcFbqk> list = tcFbqkMapper.selectTcFbqkList(newtcFbqk);
if (!list.isEmpty()){
for (TcFbqk a :list) {
tcFbqk.setId(a.getId());
tcFbqkMapper.updateTcFbqk(tcFbqk);
}
}else {
tcFbqkMapper.insertTcFbqk(tcFbqk);
}
}
successMsg.append("导入成功");
}

@ -93,7 +93,18 @@ public class TcJbsjndfltjServiceImpl implements ITcJbsjndfltjService {
StringBuilder successMsg = new StringBuilder();
if (!tcJbsjndfltjList.isEmpty()) {
for (TcJbsjndfltj tcJbsjndfltj : tcJbsjndfltjList) {
tcJbsjndfltjMapper.insertTcJbsjndfltj(tcJbsjndfltj);
//根据type判断如果已存在则调修改
TcJbsjndfltj newtcJbsjndfltj = new TcJbsjndfltj();
newtcJbsjndfltj.setType(tcJbsjndfltj.getType());
List<TcJbsjndfltj> list = tcJbsjndfltjMapper.selectTcJbsjndfltjList(newtcJbsjndfltj);
if (!list.isEmpty()) {
for (TcJbsjndfltj a : list) {
tcJbsjndfltj.setId(a.getId());
tcJbsjndfltjMapper.updateTcJbsjndfltj(tcJbsjndfltj);
}
} else {
tcJbsjndfltjMapper.insertTcJbsjndfltj(tcJbsjndfltj);
}
}
successMsg.append("导入成功");
}

@ -1,97 +1,90 @@
package com.ruoyi.tcZz.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcZz.domain.TcAqg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tcZz.mapper.TcMtlxMapper;
import com.ruoyi.tcZz.domain.TcMtlx;
import com.ruoyi.tcZz.mapper.TcMtlxMapper;
import com.ruoyi.tcZz.service.ITcMtlxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
*
* @author ruoyi
* @date 2023-10-12
*/
@Service
public class TcMtlxServiceImpl implements ITcMtlxService
{
public class TcMtlxServiceImpl implements ITcMtlxService {
@Autowired
private TcMtlxMapper tcMtlxMapper;
/**
*
*
*
* @param id
* @return
*/
@Override
public TcMtlx selectTcMtlxById(Long id)
{
public TcMtlx selectTcMtlxById(Long id) {
return tcMtlxMapper.selectTcMtlxById(id);
}
/**
*
*
*
* @param tcMtlx
* @return
*/
@Override
public List<TcMtlx> selectTcMtlxList(TcMtlx tcMtlx)
{
public List<TcMtlx> selectTcMtlxList(TcMtlx tcMtlx) {
return tcMtlxMapper.selectTcMtlxList(tcMtlx);
}
/**
*
*
*
* @param tcMtlx
* @return
*/
@Override
public int insertTcMtlx(TcMtlx tcMtlx)
{
public int insertTcMtlx(TcMtlx tcMtlx) {
tcMtlx.setCreateTime(DateUtils.getNowDate());
return tcMtlxMapper.insertTcMtlx(tcMtlx);
}
/**
*
*
*
* @param tcMtlx
* @return
*/
@Override
public int updateTcMtlx(TcMtlx tcMtlx)
{
public int updateTcMtlx(TcMtlx tcMtlx) {
tcMtlx.setUpdateTime(DateUtils.getNowDate());
return tcMtlxMapper.updateTcMtlx(tcMtlx);
}
/**
*
*
*
* @param ids
* @return
*/
@Override
public int deleteTcMtlxByIds(Long[] ids)
{
public int deleteTcMtlxByIds(Long[] ids) {
return tcMtlxMapper.deleteTcMtlxByIds(ids);
}
/**
*
*
*
* @param id
* @return
*/
@Override
public int deleteTcMtlxById(Long id)
{
public int deleteTcMtlxById(Long id) {
return tcMtlxMapper.deleteTcMtlxById(id);
}
@ -100,7 +93,17 @@ public class TcMtlxServiceImpl implements ITcMtlxService
StringBuilder successMsg = new StringBuilder();
if (!tcMtlxList.isEmpty()) {
for (TcMtlx tcMtlx : tcMtlxList) {
tcMtlxMapper.insertTcMtlx(tcMtlx);
TcMtlx newtcMtlx = new TcMtlx();
newtcMtlx.setName(tcMtlx.getName());
List<TcMtlx> list = tcMtlxMapper.selectTcMtlxList(newtcMtlx);
if (!list.isEmpty()) {
for (TcMtlx a : list) {
tcMtlx.setId(a.getId());
tcMtlxMapper.updateTcMtlx(tcMtlx);
}
} else {
tcMtlxMapper.insertTcMtlx(tcMtlx);
}
}
successMsg.append("导入成功");
}
@ -109,7 +112,7 @@ public class TcMtlxServiceImpl implements ITcMtlxService
}
@Override
public void updateByisStatus(Integer isStatus,List<String> ids) {
tcMtlxMapper.updateByisStatus(isStatus,ids);
public void updateByisStatus(Integer isStatus, List<String> ids) {
tcMtlxMapper.updateByisStatus(isStatus, ids);
}
}

@ -100,7 +100,17 @@ public class TcSgjipTop5ServiceImpl implements ITcSgjipTop5Service
StringBuilder successMsg = new StringBuilder();
if (!tcSgjipTop5List.isEmpty()) {
for (TcSgjipTop5 tcSgjipTop5 : tcSgjipTop5List) {
tcSgjipTop5Mapper.insertTcSgjipTop5(tcSgjipTop5);
TcSgjipTop5 newtcSgjipTop5=new TcSgjipTop5();
newtcSgjipTop5.setSAttackIp(tcSgjipTop5.getSAttackIp());
List<TcSgjipTop5> list = tcSgjipTop5Mapper.selectTcSgjipTop5List(newtcSgjipTop5);
if (!list.isEmpty()){
for (TcSgjipTop5 a :list) {
tcSgjipTop5.setId(a.getId());
tcSgjipTop5Mapper.updateTcSgjipTop5(tcSgjipTop5);
}
}else {
tcSgjipTop5Mapper.insertTcSgjipTop5(tcSgjipTop5);
}
}
successMsg.append("导入成功");
}

@ -100,7 +100,17 @@ public class TcSslxServiceImpl implements ITcSslxService
StringBuilder successMsg = new StringBuilder();
if (!tcSslxList.isEmpty()) {
for (TcSslx tcSslx : tcSslxList) {
tcSslxMapper.insertTcSslx(tcSslx);
TcSslx newtcSslx=new TcSslx();
newtcSslx.setName(tcSslx.getName());
List<TcSslx> list = tcSslxMapper.selectTcSslxList(newtcSslx);
if (!list.isEmpty()){
for (TcSslx a :list) {
tcSslx.setId(a.getId());
tcSslxMapper.updateTcSslx(tcSslx);
}
}else {
tcSslxMapper.insertTcSslx(tcSslx);
}
}
successMsg.append("导入成功");
}

@ -1,97 +1,90 @@
package com.ruoyi.tcZz.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcZz.domain.TcAqg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tcZz.mapper.TcTbwcMapper;
import com.ruoyi.tcZz.domain.TcTbwc;
import com.ruoyi.tcZz.mapper.TcTbwcMapper;
import com.ruoyi.tcZz.service.ITcTbwcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
*
* @author ruoyi
* @date 2023-10-12
*/
@Service
public class TcTbwcServiceImpl implements ITcTbwcService
{
public class TcTbwcServiceImpl implements ITcTbwcService {
@Autowired
private TcTbwcMapper tcTbwcMapper;
/**
*
*
*
* @param id
* @return
*/
@Override
public TcTbwc selectTcTbwcById(Long id)
{
public TcTbwc selectTcTbwcById(Long id) {
return tcTbwcMapper.selectTcTbwcById(id);
}
/**
*
*
*
* @param tcTbwc
* @return
*/
@Override
public List<TcTbwc> selectTcTbwcList(TcTbwc tcTbwc)
{
public List<TcTbwc> selectTcTbwcList(TcTbwc tcTbwc) {
return tcTbwcMapper.selectTcTbwcList(tcTbwc);
}
/**
*
*
*
* @param tcTbwc
* @return
*/
@Override
public int insertTcTbwc(TcTbwc tcTbwc)
{
public int insertTcTbwc(TcTbwc tcTbwc) {
tcTbwc.setCreateTime(DateUtils.getNowDate());
return tcTbwcMapper.insertTcTbwc(tcTbwc);
}
/**
*
*
*
* @param tcTbwc
* @return
*/
@Override
public int updateTcTbwc(TcTbwc tcTbwc)
{
public int updateTcTbwc(TcTbwc tcTbwc) {
tcTbwc.setUpdateTime(DateUtils.getNowDate());
return tcTbwcMapper.updateTcTbwc(tcTbwc);
}
/**
*
*
*
* @param ids
* @return
*/
@Override
public int deleteTcTbwcByIds(Long[] ids)
{
public int deleteTcTbwcByIds(Long[] ids) {
return tcTbwcMapper.deleteTcTbwcByIds(ids);
}
/**
*
*
*
* @param id
* @return
*/
@Override
public int deleteTcTbwcById(Long id)
{
public int deleteTcTbwcById(Long id) {
return tcTbwcMapper.deleteTcTbwcById(id);
}
@ -101,7 +94,19 @@ public class TcTbwcServiceImpl implements ITcTbwcService
StringBuilder successMsg = new StringBuilder();
if (!tcTbwcList.isEmpty()) {
for (TcTbwc tcTbwc : tcTbwcList) {
tcTbwcMapper.insertTcTbwc(tcTbwc);
//根据year + Time_name判断如果已存在则调修改
TcTbwc newtcTbwc = new TcTbwc();
newtcTbwc.setYear(tcTbwc.getYear());
newtcTbwc.setTimeName(tcTbwc.getTimeName());
List<TcTbwc> list = tcTbwcMapper.selectTcTbwcList(newtcTbwc);
if (!list.isEmpty()) {
for (TcTbwc a : list) {
tcTbwc.setId(a.getId());
tcTbwcMapper.updateTcTbwc(tcTbwc);
}
} else {
tcTbwcMapper.insertTcTbwc(tcTbwc);
}
}
successMsg.append("导入成功");
}
@ -109,7 +114,7 @@ public class TcTbwcServiceImpl implements ITcTbwcService
}
@Override
public void updateByisStatus(Integer isStatus,List<String> ids) {
tcTbwcMapper.updateByisStatus(isStatus,ids);
public void updateByisStatus(Integer isStatus, List<String> ids) {
tcTbwcMapper.updateByisStatus(isStatus, ids);
}
}

@ -100,7 +100,18 @@ public class TcWpyrwwclServiceImpl implements ITcWpyrwwclService
StringBuilder successMsg = new StringBuilder();
if (!tTcWpyrwwclList.isEmpty()) {
for (TcWpyrwwcl tcWpyrwwcl : tTcWpyrwwclList) {
tcWpyrwwclMapper.insertTcWpyrwwcl(tcWpyrwwcl);
//根据unit判断如果已存在则调修改
TcWpyrwwcl newtcWpyrwwcl=new TcWpyrwwcl();
newtcWpyrwwcl.setUnit(tcWpyrwwcl.getUnit());
List<TcWpyrwwcl> list = tcWpyrwwclMapper.selectTcWpyrwwclList(newtcWpyrwwcl);
if (!list.isEmpty()){
for (TcWpyrwwcl a :list) {
tcWpyrwwcl.setId(a.getId());
tcWpyrwwclMapper.updateTcWpyrwwcl(tcWpyrwwcl);
}
}else {
tcWpyrwwclMapper.insertTcWpyrwwcl(tcWpyrwwcl);
}
}
successMsg.append("导入成功");
}

Loading…
Cancel
Save