dongdingding
dongdingding 1 year ago
parent 7a88f5649b
commit 9eac0b8bb8

@ -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<TcAqyh> 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();
}
/**

@ -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<TcFbqk> 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();
}
/**

@ -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<TcMap> 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();
}
/**

@ -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<TcMtlx> 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<String> 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<TcMtlx> util = new ExcelUtil<TcMtlx>(TcMtlx.class);
util.importTemplateExcel(response, " 媒体类型");
}

@ -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<TcTbwc> 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();
}
/**

@ -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<TcWpyrwwcl> 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();
}
/**

@ -48,4 +48,10 @@ public class TcZbxq extends BaseEntity
@Excel(name = "舆情状态")
@ApiModelProperty(value = "舆情状态")
private String yqState;
/** 文件路径 */
@Excel(name = "文件路径")
@ApiModelProperty(value = "文件路径")
private String fileUrl;
}

@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
area;
</select>
<select id="getScreenDept" resultType="com.ruoyi.tcZz.domain.reponse.ScreenDeptResponse">
select COUNT(*) AS count,dep_name as depName from tc_bmtb where isStatus =1 GROUP BY dep_name
select COUNT(*) AS count,dep_name as depName from tc_bmtb where isStatus =1 GROUP BY dep_name order by dep_name asc limit 4
</select>
<select id="getScreenReportMap" resultType="com.ruoyi.tcZz.domain.reponse.ScreenReportMapResponse">
SELECT COUNT(*) AS count,

@ -16,10 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="fileUrl" column="file_url" />
</resultMap>
<sql id="selectTcZbxqVo">
select id, area_id, isStatus, yq_title, dep_name, yq_state, create_by, create_time, update_by, update_time, remark from tc_zbxq
select id, area_id, isStatus, yq_title, dep_name, yq_state, file_url,create_by, create_time, update_by, update_time, remark from tc_zbxq
</sql>
<select id="selectTcZbxqList" parameterType="TcZbxq" resultMap="TcZbxqResult">
@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
<if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''"> and update_time between #{params.beginUpdateTime} and #{params.endUpdateTime}</if>
<if test="remark != null and remark != ''"> and remark = #{remark}</if>
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
</where>
order by create_time desc
</select>
@ -57,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="fileUrl != null">file_url,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="areaId != null">#{areaId},</if>
@ -69,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="fileUrl != null">#{fileUrl},</if>
</trim>
</insert>
@ -85,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="fileUrl != null">fileUrl = #{fileUrl},</if>
</trim>
where id = #{id}
</update>

Loading…
Cancel
Save