Merge remote-tracking branch 'origin/main'

main
wanglei 2 years ago
commit 34366bd711

@ -1,25 +1,21 @@
package com.ruoyi.szxc.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.szxc.domain.SzxcVoteResult;
import com.ruoyi.szxc.service.ISzxcVoteResultService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Controller
@ -46,6 +42,21 @@ public class SzxcVoteResultController extends BaseController
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('szxc:voteresut:count')")
@GetMapping("/count")
public Map<String,Object> ResultCount(SzxcVoteResult szxcVoteResult)
{
startPage();
List<SzxcVoteResult> list = szxcVoteResultService.selectSzxcVoteResultList(szxcVoteResult);
Map<String,Object> result = new HashMap<String,Object>();
result.put("data",getDataTable(list));
result.put("result",szxcVoteResultService.selectSzxcVoteResultByDiscussId(szxcVoteResult.getYsId()));
return result;
}
/**
*
*/

@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* szxc_gy_apply
*
* @author hs
* @date 2024-03-20
* @date 2024-04-07
*/
public class SzxcGyApply extends BaseEntity
{
@ -18,14 +18,14 @@ public class SzxcGyApply extends BaseEntity
/** id */
private Long id;
/** 居民id */
@Excel(name = "居民id")
private Long jmId;
/** 公益id */
@Excel(name = "公益id")
private Long gyId;
/** 居民id */
@Excel(name = "居民id")
private Long jmId;
/** 身份证号 */
@Excel(name = "身份证号")
private String cardId;
@ -34,6 +34,10 @@ public class SzxcGyApply extends BaseEntity
@Excel(name = "报名人")
private String name;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 创建者ID */
@Excel(name = "创建者ID")
private Long userId;
@ -47,23 +51,23 @@ public class SzxcGyApply extends BaseEntity
{
return id;
}
public void setJmId(Long jmId)
public void setGyId(Long gyId)
{
this.jmId = jmId;
this.gyId = gyId;
}
public Long getJmId()
public Long getGyId()
{
return jmId;
return gyId;
}
public void setGyId(Long gyId)
public void setJmId(Long jmId)
{
this.gyId = gyId;
this.jmId = jmId;
}
public Long getGyId()
public Long getJmId()
{
return gyId;
return jmId;
}
public void setCardId(String cardId)
{
@ -83,6 +87,15 @@ public class SzxcGyApply extends BaseEntity
{
return name;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setUserId(Long userId)
{
this.userId = userId;
@ -97,10 +110,11 @@ public class SzxcGyApply extends BaseEntity
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("jmId", getJmId())
.append("gyId", getGyId())
.append("jmId", getJmId())
.append("cardId", getCardId())
.append("name", getName())
.append("phone", getPhone())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())

@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* szxc_vote_result
*
* @author hs
* @date 2024-03-20
* @date 2024-04-07
*/
public class SzxcVoteResult extends BaseEntity
{
@ -18,6 +18,10 @@ public class SzxcVoteResult extends BaseEntity
/** id */
private Long id;
/** 议事id */
@Excel(name = "议事id")
private Long ysId;
/** 居民id */
@Excel(name = "居民id")
private Long jmId;
@ -30,9 +34,9 @@ public class SzxcVoteResult extends BaseEntity
@Excel(name = "投票人")
private String voteName;
/** 议事id */
@Excel(name = "议事id")
private Long ysId;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 同意、反对、弃权 */
@Excel(name = "同意、反对、弃权")
@ -55,6 +59,15 @@ public class SzxcVoteResult extends BaseEntity
{
return id;
}
public void setYsId(Long ysId)
{
this.ysId = ysId;
}
public Long getYsId()
{
return ysId;
}
public void setJmId(Long jmId)
{
this.jmId = jmId;
@ -82,14 +95,14 @@ public class SzxcVoteResult extends BaseEntity
{
return voteName;
}
public void setYsId(Long ysId)
public void setPhone(String phone)
{
this.ysId = ysId;
this.phone = phone;
}
public Long getYsId()
public String getPhone()
{
return ysId;
return phone;
}
public void setVote(String vote)
{
@ -123,10 +136,11 @@ public class SzxcVoteResult extends BaseEntity
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("ysId", getYsId())
.append("jmId", getJmId())
.append("cardId", getCardId())
.append("voteName", getVoteName())
.append("ysId", getYsId())
.append("phone", getPhone())
.append("vote", getVote())
.append("opinion", getOpinion())
.append("createBy", getCreateBy())

@ -0,0 +1,48 @@
package com.ruoyi.szxc.domain;
public class YsResult {
/** 议事id */
private Long ysId;
/** 同意票数 */
private Integer tyCount;
/** 反对票数 */
private Integer fdCount;
/** 弃权票数 */
private Integer qqCount;
public Long getYsId() {
return ysId;
}
public void setYsId(Long ysId) {
this.ysId = ysId;
}
public Integer getTyCount() {
return tyCount;
}
public void setTyCount(Integer tyCount) {
this.tyCount = tyCount;
}
public Integer getFdCount() {
return fdCount;
}
public void setFdCount(Integer fdCount) {
this.fdCount = fdCount;
}
public Integer getQqCount() {
return qqCount;
}
public void setQqCount(Integer qqCount) {
this.qqCount = qqCount;
}
}

@ -1,7 +1,9 @@
package com.ruoyi.szxc.mapper;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcVoteResult;
import com.ruoyi.szxc.domain.YsResult;
import java.util.List;
/**
* Mapper
@ -58,4 +60,6 @@ public interface SzxcVoteResultMapper
* @return
*/
public int deleteSzxcVoteResultByIds(Long[] ids);
YsResult selectSzxcVoteResultByDiscussId(Long ysId);
}

@ -1,7 +1,9 @@
package com.ruoyi.szxc.service;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcVoteResult;
import com.ruoyi.szxc.domain.YsResult;
import java.util.List;
/**
* Service
@ -58,4 +60,6 @@ public interface ISzxcVoteResultService
* @return
*/
public int deleteSzxcVoteResultById(Long id);
YsResult selectSzxcVoteResultByDiscussId(Long ysId);
}

@ -1,12 +1,14 @@
package com.ruoyi.szxc.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.szxc.mapper.SzxcVoteResultMapper;
import com.ruoyi.szxc.domain.SzxcVoteResult;
import com.ruoyi.szxc.domain.YsResult;
import com.ruoyi.szxc.mapper.SzxcVoteResultMapper;
import com.ruoyi.szxc.service.ISzxcVoteResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
@ -93,4 +95,9 @@ public class SzxcVoteResultServiceImpl implements ISzxcVoteResultService
{
return szxcVoteResultMapper.deleteSzxcVoteResultById(id);
}
@Override
public YsResult selectSzxcVoteResultByDiscussId(Long ysId) {
return szxcVoteResultMapper.selectSzxcVoteResultByDiscussId(ysId);
}
}

@ -6,10 +6,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="SzxcGyApply" id="SzxcGyApplyResult">
<result property="id" column="id" />
<result property="jmId" column="jm_id" />
<result property="gyId" column="gy_id" />
<result property="jmId" column="jm_id" />
<result property="cardId" column="card_id" />
<result property="name" column="name" />
<result property="phone" column="phone" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@ -18,16 +19,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectSzxcGyApplyVo">
select id, jm_id, gy_id, card_id, name, create_by, create_time, update_by, update_time, user_id from szxc_gy_apply
select id, gy_id, jm_id, card_id, name, phone, create_by, create_time, update_by, update_time, user_id from szxc_gy_apply
</sql>
<select id="selectSzxcGyApplyList" parameterType="SzxcGyApply" resultMap="SzxcGyApplyResult">
<include refid="selectSzxcGyApplyVo"/>
<where>
<if test="jmId != null "> and jm_id = #{jmId}</if>
<if test="gyId != null "> and gy_id = #{gyId}</if>
<if test="jmId != null "> and jm_id = #{jmId}</if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="userId != null "> and user_id = #{userId}</if>
</where>
</select>
@ -40,10 +42,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertSzxcGyApply" parameterType="SzxcGyApply" useGeneratedKeys="true" keyProperty="id">
insert into szxc_gy_apply
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jmId != null">jm_id,</if>
<if test="gyId != null">gy_id,</if>
<if test="jmId != null">jm_id,</if>
<if test="cardId != null">card_id,</if>
<if test="name != null and name != ''">name,</if>
<if test="phone != null">phone,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
@ -51,10 +54,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null">user_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jmId != null">#{jmId},</if>
<if test="gyId != null">#{gyId},</if>
<if test="jmId != null">#{jmId},</if>
<if test="cardId != null">#{cardId},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="phone != null">#{phone},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
@ -66,10 +70,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateSzxcGyApply" parameterType="SzxcGyApply">
update szxc_gy_apply
<trim prefix="SET" suffixOverrides=",">
<if test="jmId != null">jm_id = #{jmId},</if>
<if test="gyId != null">gy_id = #{gyId},</if>
<if test="jmId != null">jm_id = #{jmId},</if>
<if test="cardId != null">card_id = #{cardId},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>

@ -6,10 +6,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="SzxcVoteResult" id="SzxcVoteResultResult">
<result property="id" column="id" />
<result property="ysId" column="ys_id" />
<result property="jmId" column="jm_id" />
<result property="cardId" column="card_id" />
<result property="voteName" column="vote_name" />
<result property="ysId" column="ys_id" />
<result property="phone" column="phone" />
<result property="vote" column="vote" />
<result property="opinion" column="opinion" />
<result property="createBy" column="create_by" />
@ -18,18 +19,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="userId" column="user_id" />
</resultMap>
<resultMap type="YsResult" id="YsResult">
<result property="ysId" column="ys_id" />
<result property="tyCount" column="ty" />
<result property="fdCount" column="fd" />
<result property="qqCount" column="qq" />
</resultMap>
<sql id="selectSzxcVoteResultVo">
select id, jm_id, card_id, vote_name, ys_id, vote, opinion, create_by, create_time, update_by, update_time, user_id from szxc_vote_result
</sql>
<sql id="selectSzxcVoteResultVo">
select id, ys_id, jm_id, card_id, vote_name, phone, vote, opinion, create_by, create_time, update_by, update_time, user_id from szxc_vote_result
</sql>
<select id="selectSzxcVoteResultList" parameterType="SzxcVoteResult" resultMap="SzxcVoteResultResult">
<include refid="selectSzxcVoteResultVo"/>
<where>
<if test="ysId != null "> and ys_id = #{ysId}</if>
<if test="jmId != null "> and jm_id = #{jmId}</if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="voteName != null and voteName != ''"> and vote_name like concat('%', #{voteName}, '%')</if>
<if test="ysId != null "> and ys_id = #{ysId}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="vote != null and vote != ''"> and vote = #{vote}</if>
<if test="opinion != null and opinion != ''"> and opinion = #{opinion}</if>
<if test="userId != null "> and user_id = #{userId}</if>
@ -41,62 +53,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<insert id="insertSzxcVoteResult" parameterType="SzxcVoteResult" useGeneratedKeys="true" keyProperty="id">
insert into szxc_vote_result
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jmId != null">jm_id,</if>
<if test="cardId != null">card_id,</if>
<if test="voteName != null and voteName != ''">vote_name,</if>
<if test="ysId != null">ys_id,</if>
<if test="vote != null">vote,</if>
<if test="opinion != null">opinion,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="userId != null">user_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jmId != null">#{jmId},</if>
<if test="cardId != null">#{cardId},</if>
<if test="voteName != null and voteName != ''">#{voteName},</if>
<if test="ysId != null">#{ysId},</if>
<if test="vote != null">#{vote},</if>
<if test="opinion != null">#{opinion},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="userId != null">#{userId},</if>
</trim>
</insert>
<!--通过议事id获取投票情况-->
<select id="selectSzxcVoteResultByDiscussId" parameterType="Long" resultMap="YsResult">
SELECT ys_Id, COUNT(vote = "0" or null) ty,COUNT(vote = "1" or null) fd,COUNT(vote = "2" or null) qq
FROM `szxc_vote_result`
<where>
<if test="ysId != null "> ys_id = #{ysId}</if>
</where>
</select>
<update id="updateSzxcVoteResult" parameterType="SzxcVoteResult">
update szxc_vote_result
<trim prefix="SET" suffixOverrides=",">
<if test="jmId != null">jm_id = #{jmId},</if>
<if test="cardId != null">card_id = #{cardId},</if>
<if test="voteName != null and voteName != ''">vote_name = #{voteName},</if>
<if test="ysId != null">ys_id = #{ysId},</if>
<if test="vote != null">vote = #{vote},</if>
<if test="opinion != null">opinion = #{opinion},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="userId != null">user_id = #{userId},</if>
</trim>
where id = #{id}
</update>
<sql id="selectSzxcVoteResultVo">
select id, ys_id, jm_id, card_id, vote_name, phone, vote, opinion, create_by, create_time, update_by, update_time, user_id from szxc_vote_result
</sql>
<delete id="deleteSzxcVoteResultById" parameterType="Long">
delete from szxc_vote_result where id = #{id}
</delete>
<select id="selectSzxcVoteResultList" parameterType="SzxcVoteResult" resultMap="SzxcVoteResultResult">
<include refid="selectSzxcVoteResultVo"/>
<where>
<if test="ysId != null "> and ys_id = #{ysId}</if>
<if test="jmId != null "> and jm_id = #{jmId}</if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="voteName != null and voteName != ''"> and vote_name like concat('%', #{voteName}, '%')</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="vote != null and vote != ''"> and vote = #{vote}</if>
<if test="opinion != null and opinion != ''"> and opinion = #{opinion}</if>
<if test="userId != null "> and user_id = #{userId}</if>
</where>
</select>
<delete id="deleteSzxcVoteResultByIds" parameterType="String">
delete from szxc_vote_result where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectSzxcVoteResultById" parameterType="Long" resultMap="SzxcVoteResultResult">
<include refid="selectSzxcVoteResultVo"/>
where id = #{id}
</select>
</mapper>

@ -1,18 +1,18 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="居民id" prop="jmId">
<el-form-item label="公益id" prop="gyId">
<el-input
v-model="queryParams.jmId"
placeholder="请输入居民id"
v-model="queryParams.gyId"
placeholder="请输入公益id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="公益id" prop="gyId">
<el-form-item label="居民id" prop="jmId">
<el-input
v-model="queryParams.gyId"
placeholder="请输入公益id"
v-model="queryParams.jmId"
placeholder="请输入居民id"
clearable
@keyup.enter.native="handleQuery"
/>
@ -33,6 +33,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="userId">
<el-input
v-model="queryParams.userId"
@ -96,10 +104,11 @@
<el-table v-loading="loading" :data="applyList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="居民id" align="center" prop="jmId" />
<el-table-column label="公益id" align="center" prop="gyId" />
<el-table-column label="居民id" align="center" prop="jmId" />
<el-table-column label="身份证号" align="center" prop="cardId" />
<el-table-column label="报名人" align="center" prop="name" />
<el-table-column label="手机号" align="center" prop="phone" />
<el-table-column label="创建者ID" align="center" prop="userId" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -132,18 +141,21 @@
<!-- 添加或修改公益报名情况对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="居民id" prop="jmId">
<el-input v-model="form.jmId" placeholder="请输入居民id" />
</el-form-item>
<el-form-item label="公益id" prop="gyId">
<el-input v-model="form.gyId" placeholder="请输入公益id" />
</el-form-item>
<el-form-item label="居民id" prop="jmId">
<el-input v-model="form.jmId" placeholder="请输入居民id" />
</el-form-item>
<el-form-item label="身份证号" prop="cardId">
<el-input v-model="form.cardId" placeholder="请输入身份证号" />
</el-form-item>
<el-form-item label="报名人" prop="name">
<el-input v-model="form.name" placeholder="请输入报名人" />
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入手机号" />
</el-form-item>
<el-form-item label="创建者ID" prop="userId">
<el-input v-model="form.userId" placeholder="请输入创建者ID" />
</el-form-item>
@ -185,10 +197,11 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
jmId: null,
gyId: null,
jmId: null,
cardId: null,
name: null,
phone: null,
userId: null
},
//
@ -223,10 +236,11 @@ export default {
reset() {
this.form = {
id: null,
jmId: null,
gyId: null,
jmId: null,
cardId: null,
name: null,
phone: null,
createBy: null,
createTime: null,
updateBy: null,

Loading…
Cancel
Save