diff --git a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/controller/SzxcVoteResultController.java b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/controller/SzxcVoteResultController.java index 143cefb..7f4c82c 100644 --- a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/controller/SzxcVoteResultController.java +++ b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/controller/SzxcVoteResultController.java @@ -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 ResultCount(SzxcVoteResult szxcVoteResult) + { + startPage(); + List list = szxcVoteResultService.selectSzxcVoteResultList(szxcVoteResult); + Map result = new HashMap(); + result.put("data",getDataTable(list)); + result.put("result",szxcVoteResultService.selectSzxcVoteResultByDiscussId(szxcVoteResult.getYsId())); + return result; + } + /** * 导出议事投票情况列表 */ diff --git a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/domain/SzxcGyApply.java b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/domain/SzxcGyApply.java index 31a3601..4ced04e 100644 --- a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/domain/SzxcGyApply.java +++ b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/domain/SzxcGyApply.java @@ -7,9 +7,9 @@ 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,61 +34,74 @@ public class SzxcGyApply extends BaseEntity @Excel(name = "报名人") private String name; + /** 手机号 */ + @Excel(name = "手机号") + private String phone; + /** 创建者ID */ @Excel(name = "创建者ID") private Long userId; - public void setId(Long id) + public void setId(Long id) { this.id = id; } - public Long getId() + public Long getId() { 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) + public void setCardId(String cardId) { this.cardId = cardId; } - public String getCardId() + public String getCardId() { return cardId; } - public void setName(String name) + public void setName(String name) { this.name = name; } - public String getName() + public String getName() { return name; } - public void setUserId(Long userId) + public void setPhone(String phone) + { + this.phone = phone; + } + + public String getPhone() + { + return phone; + } + public void setUserId(Long userId) { this.userId = userId; } - public Long getUserId() + public Long getUserId() { return userId; } @@ -96,16 +109,17 @@ public class SzxcGyApply extends BaseEntity @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("jmId", getJmId()) - .append("gyId", getGyId()) - .append("cardId", getCardId()) - .append("name", getName()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("userId", getUserId()) - .toString(); + .append("id", getId()) + .append("gyId", getGyId()) + .append("jmId", getJmId()) + .append("cardId", getCardId()) + .append("name", getName()) + .append("phone", getPhone()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("userId", getUserId()) + .toString(); } } diff --git a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/domain/SzxcVoteResult.java b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/domain/SzxcVoteResult.java index eb92e2b..f1149fa 100644 --- a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/domain/SzxcVoteResult.java +++ b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/domain/SzxcVoteResult.java @@ -7,9 +7,9 @@ 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 = "同意、反对、弃权") @@ -46,75 +50,84 @@ public class SzxcVoteResult extends BaseEntity @Excel(name = "创建者ID") private Long userId; - public void setId(Long id) + public void setId(Long id) { this.id = id; } - public Long getId() + public Long getId() { return id; } - public void setJmId(Long jmId) + public void setYsId(Long ysId) + { + this.ysId = ysId; + } + + public Long getYsId() + { + return ysId; + } + public void setJmId(Long jmId) { this.jmId = jmId; } - public Long getJmId() + public Long getJmId() { return jmId; } - public void setCardId(String cardId) + public void setCardId(String cardId) { this.cardId = cardId; } - public String getCardId() + public String getCardId() { return cardId; } - public void setVoteName(String voteName) + public void setVoteName(String voteName) { this.voteName = voteName; } - public String getVoteName() + public String getVoteName() { 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) + public void setVote(String vote) { this.vote = vote; } - public String getVote() + public String getVote() { return vote; } - public void setOpinion(String opinion) + public void setOpinion(String opinion) { this.opinion = opinion; } - public String getOpinion() + public String getOpinion() { return opinion; } - public void setUserId(Long userId) + public void setUserId(Long userId) { this.userId = userId; } - public Long getUserId() + public Long getUserId() { return userId; } @@ -122,18 +135,19 @@ public class SzxcVoteResult extends BaseEntity @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("jmId", getJmId()) - .append("cardId", getCardId()) - .append("voteName", getVoteName()) - .append("ysId", getYsId()) - .append("vote", getVote()) - .append("opinion", getOpinion()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("userId", getUserId()) - .toString(); + .append("id", getId()) + .append("ysId", getYsId()) + .append("jmId", getJmId()) + .append("cardId", getCardId()) + .append("voteName", getVoteName()) + .append("phone", getPhone()) + .append("vote", getVote()) + .append("opinion", getOpinion()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("userId", getUserId()) + .toString(); } } diff --git a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/domain/YsResult.java b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/domain/YsResult.java new file mode 100644 index 0000000..7725ecb --- /dev/null +++ b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/domain/YsResult.java @@ -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; + } +} diff --git a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/mapper/SzxcVoteResultMapper.java b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/mapper/SzxcVoteResultMapper.java index 3e064f7..4fe1173 100644 --- a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/mapper/SzxcVoteResultMapper.java +++ b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/mapper/SzxcVoteResultMapper.java @@ -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); } diff --git a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/service/ISzxcVoteResultService.java b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/service/ISzxcVoteResultService.java index a7c983c..b222ab0 100644 --- a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/service/ISzxcVoteResultService.java +++ b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/service/ISzxcVoteResultService.java @@ -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); } diff --git a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/service/impl/SzxcVoteResultServiceImpl.java b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/service/impl/SzxcVoteResultServiceImpl.java index 3f54b02..3ef2d51 100644 --- a/ruoyi-szxc/src/main/java/com/ruoyi/szxc/service/impl/SzxcVoteResultServiceImpl.java +++ b/ruoyi-szxc/src/main/java/com/ruoyi/szxc/service/impl/SzxcVoteResultServiceImpl.java @@ -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); + } } diff --git a/ruoyi-szxc/src/main/resources/mapper/szxc/SzxcGyApplyMapper.xml b/ruoyi-szxc/src/main/resources/mapper/szxc/SzxcGyApplyMapper.xml index f93ed19..86e6a51 100644 --- a/ruoyi-szxc/src/main/resources/mapper/szxc/SzxcGyApplyMapper.xml +++ b/ruoyi-szxc/src/main/resources/mapper/szxc/SzxcGyApplyMapper.xml @@ -1,15 +1,16 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - + + @@ -18,58 +19,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 - + - + insert into szxc_gy_apply - jm_id, gy_id, + jm_id, card_id, name, + phone, create_by, create_time, update_by, update_time, user_id, - + - #{jmId}, #{gyId}, + #{jmId}, #{cardId}, #{name}, + #{phone}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{userId}, - + update szxc_gy_apply - jm_id = #{jmId}, gy_id = #{gyId}, + jm_id = #{jmId}, card_id = #{cardId}, name = #{name}, + phone = #{phone}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, @@ -84,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from szxc_gy_apply where id in + delete from szxc_gy_apply where id in #{id} diff --git a/ruoyi-szxc/src/main/resources/mapper/szxc/SzxcVoteResultMapper.xml b/ruoyi-szxc/src/main/resources/mapper/szxc/SzxcVoteResultMapper.xml index 759a205..94bf9a7 100644 --- a/ruoyi-szxc/src/main/resources/mapper/szxc/SzxcVoteResultMapper.xml +++ b/ruoyi-szxc/src/main/resources/mapper/szxc/SzxcVoteResultMapper.xml @@ -3,13 +3,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + - + @@ -18,85 +19,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + 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 + + 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 + + - + - - - insert into szxc_vote_result - - jm_id, - card_id, - vote_name, - ys_id, - vote, - opinion, - create_by, - create_time, - update_by, - update_time, - user_id, - - - #{jmId}, - #{cardId}, - #{voteName}, - #{ysId}, - #{vote}, - #{opinion}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - #{userId}, - - - - update szxc_vote_result - - jm_id = #{jmId}, - card_id = #{cardId}, - vote_name = #{voteName}, - ys_id = #{ysId}, - vote = #{vote}, - opinion = #{opinion}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - user_id = #{userId}, - - where id = #{id} - + + + + + 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 + - - delete from szxc_vote_result where id = #{id} - + - - delete from szxc_vote_result where id in - - #{id} - - + \ No newline at end of file diff --git a/ruoyi-ui/src/views/szxc/apply/index.vue b/ruoyi-ui/src/views/szxc/apply/index.vue index 39c9609..281edcb 100644 --- a/ruoyi-ui/src/views/szxc/apply/index.vue +++ b/ruoyi-ui/src/views/szxc/apply/index.vue @@ -1,18 +1,18 @@