# 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; package com.ruoyi.tcZz.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; 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.TcCy;
import com.ruoyi.tcZz.domain.TcWljg;
import com.ruoyi.tcZz.service.ITcCyService; import com.ruoyi.tcZz.service.ITcCyService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -54,7 +60,20 @@ public class TcCyController extends BaseController {
@ApiOperation(value = "新增词云") @ApiOperation(value = "新增词云")
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TcCy tcCy) { 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("新增举报事件年度分类统计") @ApiOperation("新增举报事件年度分类统计")
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TcJbsjndfltj tcJbsjndfltj) { 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; package com.ruoyi.tcZz.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; 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.domain.TcSslx;
import com.ruoyi.tcZz.service.ITcSslxService; import com.ruoyi.tcZz.service.ITcSslxService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -65,7 +71,18 @@ public class TcSslxController extends BaseController {
@ApiOperation(value = "新增涉事类型") @ApiOperation(value = "新增涉事类型")
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TcSslx tcSslx) { 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 {
} }
/** /**
* *
*/ */
@ -115,7 +133,8 @@ public class TcSslxController extends BaseController {
@ApiOperation("通用下载excel模板") @ApiOperation("通用下载excel模板")
@PostMapping("/importTemplate") @PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) { public void importTemplate(HttpServletResponse response)
{
ExcelUtil<TcSslx> util = new ExcelUtil<TcSslx>(TcSslx.class); ExcelUtil<TcSslx> util = new ExcelUtil<TcSslx>(TcSslx.class);
util.importTemplateExcel(response, " 涉事类型"); util.importTemplateExcel(response, " 涉事类型");
} }

@ -100,8 +100,19 @@ public class TcAqyhServiceImpl implements ITcAqyhService
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
if (!tcAqyhList.isEmpty()) { if (!tcAqyhList.isEmpty()) {
for (TcAqyh tcAqyh : tcAqyhList) { for (TcAqyh tcAqyh : tcAqyhList) {
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); tcAqyhMapper.insertTcAqyh(tcAqyh);
} }
}
successMsg.append("导入成功"); successMsg.append("导入成功");
} }

@ -1,13 +1,13 @@
package com.ruoyi.tcZz.service.impl; package com.ruoyi.tcZz.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils; 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.domain.TcCy;
import com.ruoyi.tcZz.mapper.TcCyMapper;
import com.ruoyi.tcZz.service.ITcCyService; import com.ruoyi.tcZz.service.ITcCyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* Service * Service
@ -16,8 +16,7 @@ import com.ruoyi.tcZz.service.ITcCyService;
* @date 2023-10-13 * @date 2023-10-13
*/ */
@Service @Service
public class TcCyServiceImpl implements ITcCyService public class TcCyServiceImpl implements ITcCyService {
{
@Autowired @Autowired
private TcCyMapper tcCyMapper; private TcCyMapper tcCyMapper;
@ -28,8 +27,7 @@ public class TcCyServiceImpl implements ITcCyService
* @return * @return
*/ */
@Override @Override
public TcCy selectTcCyById(Long id) public TcCy selectTcCyById(Long id) {
{
return tcCyMapper.selectTcCyById(id); return tcCyMapper.selectTcCyById(id);
} }
@ -40,8 +38,7 @@ public class TcCyServiceImpl implements ITcCyService
* @return * @return
*/ */
@Override @Override
public List<TcCy> selectTcCyList(TcCy tcCy) public List<TcCy> selectTcCyList(TcCy tcCy) {
{
return tcCyMapper.selectTcCyList(tcCy); return tcCyMapper.selectTcCyList(tcCy);
} }
@ -52,8 +49,7 @@ public class TcCyServiceImpl implements ITcCyService
* @return * @return
*/ */
@Override @Override
public int insertTcCy(TcCy tcCy) public int insertTcCy(TcCy tcCy) {
{
tcCy.setCreateTime(DateUtils.getNowDate()); tcCy.setCreateTime(DateUtils.getNowDate());
return tcCyMapper.insertTcCy(tcCy); return tcCyMapper.insertTcCy(tcCy);
} }
@ -65,8 +61,7 @@ public class TcCyServiceImpl implements ITcCyService
* @return * @return
*/ */
@Override @Override
public int updateTcCy(TcCy tcCy) public int updateTcCy(TcCy tcCy) {
{
tcCy.setUpdateTime(DateUtils.getNowDate()); tcCy.setUpdateTime(DateUtils.getNowDate());
return tcCyMapper.updateTcCy(tcCy); return tcCyMapper.updateTcCy(tcCy);
} }
@ -78,8 +73,7 @@ public class TcCyServiceImpl implements ITcCyService
* @return * @return
*/ */
@Override @Override
public int deleteTcCyByIds(Long[] ids) public int deleteTcCyByIds(Long[] ids) {
{
return tcCyMapper.deleteTcCyByIds(ids); return tcCyMapper.deleteTcCyByIds(ids);
} }
@ -90,8 +84,7 @@ public class TcCyServiceImpl implements ITcCyService
* @return * @return
*/ */
@Override @Override
public int deleteTcCyById(Long id) public int deleteTcCyById(Long id) {
{
return tcCyMapper.deleteTcCyById(id); return tcCyMapper.deleteTcCyById(id);
} }
@ -100,13 +93,26 @@ public class TcCyServiceImpl implements ITcCyService
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
if (!tcCyList.isEmpty()) { if (!tcCyList.isEmpty()) {
for (TcCy tcCy : tcCyList) { for (TcCy tcCy : tcCyList) {
//根据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); tcCyMapper.insertTcCy(tcCy);
} }
}
successMsg.append("导入成功"); successMsg.append("导入成功");
} }
return successMsg.toString(); return successMsg.toString();
} }
@Override @Override
public void updateByisStatus(Integer isStatus, List<String> ids) { public void updateByisStatus(Integer isStatus, List<String> ids) {
tcCyMapper.updateByisStatus(isStatus, ids); tcCyMapper.updateByisStatus(isStatus, ids);

@ -100,8 +100,18 @@ public class TcFbqkServiceImpl implements ITcFbqkService
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
if (!tcFbqkList.isEmpty()) { if (!tcFbqkList.isEmpty()) {
for (TcFbqk tcFbqk : tcFbqkList) { for (TcFbqk tcFbqk : tcFbqkList) {
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); tcFbqkMapper.insertTcFbqk(tcFbqk);
} }
}
successMsg.append("导入成功"); successMsg.append("导入成功");
} }

@ -93,8 +93,19 @@ public class TcJbsjndfltjServiceImpl implements ITcJbsjndfltjService {
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
if (!tcJbsjndfltjList.isEmpty()) { if (!tcJbsjndfltjList.isEmpty()) {
for (TcJbsjndfltj tcJbsjndfltj : tcJbsjndfltjList) { for (TcJbsjndfltj tcJbsjndfltj : tcJbsjndfltjList) {
//根据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); tcJbsjndfltjMapper.insertTcJbsjndfltj(tcJbsjndfltj);
} }
}
successMsg.append("导入成功"); successMsg.append("导入成功");
} }

@ -1,13 +1,13 @@
package com.ruoyi.tcZz.service.impl; package com.ruoyi.tcZz.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils; 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.domain.TcMtlx;
import com.ruoyi.tcZz.mapper.TcMtlxMapper;
import com.ruoyi.tcZz.service.ITcMtlxService; import com.ruoyi.tcZz.service.ITcMtlxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* Service * Service
@ -16,8 +16,7 @@ import com.ruoyi.tcZz.service.ITcMtlxService;
* @date 2023-10-12 * @date 2023-10-12
*/ */
@Service @Service
public class TcMtlxServiceImpl implements ITcMtlxService public class TcMtlxServiceImpl implements ITcMtlxService {
{
@Autowired @Autowired
private TcMtlxMapper tcMtlxMapper; private TcMtlxMapper tcMtlxMapper;
@ -28,8 +27,7 @@ public class TcMtlxServiceImpl implements ITcMtlxService
* @return * @return
*/ */
@Override @Override
public TcMtlx selectTcMtlxById(Long id) public TcMtlx selectTcMtlxById(Long id) {
{
return tcMtlxMapper.selectTcMtlxById(id); return tcMtlxMapper.selectTcMtlxById(id);
} }
@ -40,8 +38,7 @@ public class TcMtlxServiceImpl implements ITcMtlxService
* @return * @return
*/ */
@Override @Override
public List<TcMtlx> selectTcMtlxList(TcMtlx tcMtlx) public List<TcMtlx> selectTcMtlxList(TcMtlx tcMtlx) {
{
return tcMtlxMapper.selectTcMtlxList(tcMtlx); return tcMtlxMapper.selectTcMtlxList(tcMtlx);
} }
@ -52,8 +49,7 @@ public class TcMtlxServiceImpl implements ITcMtlxService
* @return * @return
*/ */
@Override @Override
public int insertTcMtlx(TcMtlx tcMtlx) public int insertTcMtlx(TcMtlx tcMtlx) {
{
tcMtlx.setCreateTime(DateUtils.getNowDate()); tcMtlx.setCreateTime(DateUtils.getNowDate());
return tcMtlxMapper.insertTcMtlx(tcMtlx); return tcMtlxMapper.insertTcMtlx(tcMtlx);
} }
@ -65,8 +61,7 @@ public class TcMtlxServiceImpl implements ITcMtlxService
* @return * @return
*/ */
@Override @Override
public int updateTcMtlx(TcMtlx tcMtlx) public int updateTcMtlx(TcMtlx tcMtlx) {
{
tcMtlx.setUpdateTime(DateUtils.getNowDate()); tcMtlx.setUpdateTime(DateUtils.getNowDate());
return tcMtlxMapper.updateTcMtlx(tcMtlx); return tcMtlxMapper.updateTcMtlx(tcMtlx);
} }
@ -78,8 +73,7 @@ public class TcMtlxServiceImpl implements ITcMtlxService
* @return * @return
*/ */
@Override @Override
public int deleteTcMtlxByIds(Long[] ids) public int deleteTcMtlxByIds(Long[] ids) {
{
return tcMtlxMapper.deleteTcMtlxByIds(ids); return tcMtlxMapper.deleteTcMtlxByIds(ids);
} }
@ -90,8 +84,7 @@ public class TcMtlxServiceImpl implements ITcMtlxService
* @return * @return
*/ */
@Override @Override
public int deleteTcMtlxById(Long id) public int deleteTcMtlxById(Long id) {
{
return tcMtlxMapper.deleteTcMtlxById(id); return tcMtlxMapper.deleteTcMtlxById(id);
} }
@ -100,8 +93,18 @@ public class TcMtlxServiceImpl implements ITcMtlxService
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
if (!tcMtlxList.isEmpty()) { if (!tcMtlxList.isEmpty()) {
for (TcMtlx tcMtlx : tcMtlxList) { for (TcMtlx tcMtlx : tcMtlxList) {
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); tcMtlxMapper.insertTcMtlx(tcMtlx);
} }
}
successMsg.append("导入成功"); successMsg.append("导入成功");
} }

@ -100,8 +100,18 @@ public class TcSgjipTop5ServiceImpl implements ITcSgjipTop5Service
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
if (!tcSgjipTop5List.isEmpty()) { if (!tcSgjipTop5List.isEmpty()) {
for (TcSgjipTop5 tcSgjipTop5 : tcSgjipTop5List) { for (TcSgjipTop5 tcSgjipTop5 : tcSgjipTop5List) {
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); tcSgjipTop5Mapper.insertTcSgjipTop5(tcSgjipTop5);
} }
}
successMsg.append("导入成功"); successMsg.append("导入成功");
} }

@ -100,8 +100,18 @@ public class TcSslxServiceImpl implements ITcSslxService
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
if (!tcSslxList.isEmpty()) { if (!tcSslxList.isEmpty()) {
for (TcSslx tcSslx : tcSslxList) { for (TcSslx tcSslx : tcSslxList) {
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); tcSslxMapper.insertTcSslx(tcSslx);
} }
}
successMsg.append("导入成功"); successMsg.append("导入成功");
} }

@ -1,13 +1,13 @@
package com.ruoyi.tcZz.service.impl; package com.ruoyi.tcZz.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils; 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.domain.TcTbwc;
import com.ruoyi.tcZz.mapper.TcTbwcMapper;
import com.ruoyi.tcZz.service.ITcTbwcService; import com.ruoyi.tcZz.service.ITcTbwcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* Service * Service
@ -16,8 +16,7 @@ import com.ruoyi.tcZz.service.ITcTbwcService;
* @date 2023-10-12 * @date 2023-10-12
*/ */
@Service @Service
public class TcTbwcServiceImpl implements ITcTbwcService public class TcTbwcServiceImpl implements ITcTbwcService {
{
@Autowired @Autowired
private TcTbwcMapper tcTbwcMapper; private TcTbwcMapper tcTbwcMapper;
@ -28,8 +27,7 @@ public class TcTbwcServiceImpl implements ITcTbwcService
* @return * @return
*/ */
@Override @Override
public TcTbwc selectTcTbwcById(Long id) public TcTbwc selectTcTbwcById(Long id) {
{
return tcTbwcMapper.selectTcTbwcById(id); return tcTbwcMapper.selectTcTbwcById(id);
} }
@ -40,8 +38,7 @@ public class TcTbwcServiceImpl implements ITcTbwcService
* @return * @return
*/ */
@Override @Override
public List<TcTbwc> selectTcTbwcList(TcTbwc tcTbwc) public List<TcTbwc> selectTcTbwcList(TcTbwc tcTbwc) {
{
return tcTbwcMapper.selectTcTbwcList(tcTbwc); return tcTbwcMapper.selectTcTbwcList(tcTbwc);
} }
@ -52,8 +49,7 @@ public class TcTbwcServiceImpl implements ITcTbwcService
* @return * @return
*/ */
@Override @Override
public int insertTcTbwc(TcTbwc tcTbwc) public int insertTcTbwc(TcTbwc tcTbwc) {
{
tcTbwc.setCreateTime(DateUtils.getNowDate()); tcTbwc.setCreateTime(DateUtils.getNowDate());
return tcTbwcMapper.insertTcTbwc(tcTbwc); return tcTbwcMapper.insertTcTbwc(tcTbwc);
} }
@ -65,8 +61,7 @@ public class TcTbwcServiceImpl implements ITcTbwcService
* @return * @return
*/ */
@Override @Override
public int updateTcTbwc(TcTbwc tcTbwc) public int updateTcTbwc(TcTbwc tcTbwc) {
{
tcTbwc.setUpdateTime(DateUtils.getNowDate()); tcTbwc.setUpdateTime(DateUtils.getNowDate());
return tcTbwcMapper.updateTcTbwc(tcTbwc); return tcTbwcMapper.updateTcTbwc(tcTbwc);
} }
@ -78,8 +73,7 @@ public class TcTbwcServiceImpl implements ITcTbwcService
* @return * @return
*/ */
@Override @Override
public int deleteTcTbwcByIds(Long[] ids) public int deleteTcTbwcByIds(Long[] ids) {
{
return tcTbwcMapper.deleteTcTbwcByIds(ids); return tcTbwcMapper.deleteTcTbwcByIds(ids);
} }
@ -90,8 +84,7 @@ public class TcTbwcServiceImpl implements ITcTbwcService
* @return * @return
*/ */
@Override @Override
public int deleteTcTbwcById(Long id) public int deleteTcTbwcById(Long id) {
{
return tcTbwcMapper.deleteTcTbwcById(id); return tcTbwcMapper.deleteTcTbwcById(id);
} }
@ -101,8 +94,20 @@ public class TcTbwcServiceImpl implements ITcTbwcService
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
if (!tcTbwcList.isEmpty()) { if (!tcTbwcList.isEmpty()) {
for (TcTbwc tcTbwc : tcTbwcList) { for (TcTbwc tcTbwc : tcTbwcList) {
//根据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); tcTbwcMapper.insertTcTbwc(tcTbwc);
} }
}
successMsg.append("导入成功"); successMsg.append("导入成功");
} }
return successMsg.toString(); return successMsg.toString();

@ -100,8 +100,19 @@ public class TcWpyrwwclServiceImpl implements ITcWpyrwwclService
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
if (!tTcWpyrwwclList.isEmpty()) { if (!tTcWpyrwwclList.isEmpty()) {
for (TcWpyrwwcl tcWpyrwwcl : tTcWpyrwwclList) { for (TcWpyrwwcl tcWpyrwwcl : tTcWpyrwwclList) {
//根据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); tcWpyrwwclMapper.insertTcWpyrwwcl(tcWpyrwwcl);
} }
}
successMsg.append("导入成功"); successMsg.append("导入成功");
} }
return successMsg.toString(); return successMsg.toString();

Loading…
Cancel
Save