瀏覽代碼

投票修改

LIVE_YE 11 月之前
父節點
當前提交
a2e72fcd9c

+ 5 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/LoanApplicationServiceImpl.java

@@ -118,6 +118,11 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         if (shareholderFjs != null && shareholderFjs.size() > 0) {
             loanApplication.setShareholderFjList(shareholderFjs);
         }
+        //会议状态
+        loanApplication.setVotingResult(FOR);
+        if(redisCache.getCacheObject(loanApplication.getLoanApplicationNumber()+"tp")!=null){
+            loanApplication.setVotingResult(redisCache.getCacheObject(loanApplication.getLoanApplicationNumber()+"tp"));
+        }
         return loanApplication;
     }
 

+ 12 - 3
ruoyi-system/src/main/java/com/ruoyi/system/service/conference/impl/SysUserConferenceServiceImpl.java

@@ -133,6 +133,7 @@ public class SysUserConferenceServiceImpl implements ISysUserConferenceService {
         loanApplication.setReviewTime(sysUserConference.getConferenceTime());
         loanApplication.setReviewSchedule(FOR);
         loanApplicationMapper.updateLoanApplication(loanApplication);
+        redisCache.setCacheObject(sysUserConference.getLoanApplicationNumber()+"tp",FOR);
 
         //查询参会人员的字典值
         List<SysDictData> data = dictTypeService.selectDictDataByType("conference_role");
@@ -198,15 +199,20 @@ public class SysUserConferenceServiceImpl implements ISysUserConferenceService {
     @Transactional
     public AjaxResult vote(SysUserConference sysUserConference) {
         //将状态改为投票中
-        redisCache.setCacheObject(sysUserConference.getLoanApplicationNumber()+"tp","1");
+        redisCache.setCacheObject(sysUserConference.getLoanApplicationNumber()+"tp",ONE);
         SysUser user = SecurityUtils.getLoginUser().getUser();
         //查询所有人员的投票结果
         List<SysUserConference> sysUserConferences = sysUserConferenceMapper.selectSysUserConferenceList(sysUserConference);
         //如果投票人员不在参会人员中,投票失败
         Boolean bo = false;
+        //是否重复投票
+        Boolean bn = false;
         for (SysUserConference userConference : sysUserConferences) {
             if(user.getUserId().equals(userConference.getUserId())){
                 bo = true;
+                if(StringUtils.isNotEmpty(userConference.getVotingResult())){
+                    bn = true;
+                }
                 break;
             }
         }
@@ -214,6 +220,9 @@ public class SysUserConferenceServiceImpl implements ISysUserConferenceService {
         if(!bo){
             return AjaxResult.error("不是当前项目投票人员,投票失败");
         }
+        if(bn){
+            return AjaxResult.error("请勿重复投票");
+        }
 
         sysUserConference.setUserId(user.getUserId());
         sysUserConference.setUpdateTime(DateUtils.getNowDate());
@@ -245,10 +254,10 @@ public class SysUserConferenceServiceImpl implements ISysUserConferenceService {
         }
         //不一样
         if(bl){
-            redisCache.setCacheObject(sysUserConference.getLoanApplicationNumber()+"tp","3");
+            redisCache.setCacheObject(sysUserConference.getLoanApplicationNumber()+"tp",THR);
             return AjaxResult.success("成功,投票金额不同,请通知管理员重新发起投票");
         }
-        redisCache.setCacheObject(sysUserConference.getLoanApplicationNumber()+"tp","2");
+        redisCache.setCacheObject(sysUserConference.getLoanApplicationNumber()+"tp",TWO);
         if(bty>=2){
             //修改主表信息 未通过
             LoanApplication loanApplication = new LoanApplication();

+ 0 - 4
ruoyi-system/src/main/resources/mapper/system/SysUserConferenceMapper.xml

@@ -42,10 +42,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isConference != null  and isConference != ''"> and is_conference = #{isConference}</if>
             <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
             <if test="conferenceTime != null  and conferenceTime != ''"> and conference_time = #{conferenceTime}</if>
-            <if test="votingResult != null  and votingResult != ''"> and voting_result = #{votingResult}</if>
-            <if test="lineGuarantee != null  and lineGuarantee != ''"> and line_guarantee = #{lineGuarantee}</if>
-            <if test="guaranteePeriod != null  and guaranteePeriod != ''"> and guarantee_period = #{guaranteePeriod}</if>
-            <if test="argument != null  and argument != ''"> and argument = #{argument}</if>
         </where>
         order by create_time
     </select>