Selaa lähdekoodia

feature 内容轮播

xiahan 4 kuukautta sitten
vanhempi
commit
6daa0baa7b

+ 1 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/dao/SwNotificationAnnouncementDao.java

@@ -14,6 +14,7 @@ import java.util.List;
 public interface SwNotificationAnnouncementDao extends BaseMapper<SwNotificationAnnouncementDo> {
     List<SwNotificationAnnouncementDo> selectListByDsKey(@Param("dsKeys") List<String> dsKey);
 
+    List<SwNotificationAnnouncementDo> selectShowData();
 }
 
 

+ 8 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/impl/AccountServiceImpl.java

@@ -3,6 +3,7 @@ package com.rongwei.zhsw.system.wechat.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.rongwe.zhsw.system.domain.SwBillManagementUnpaidDo;
+import com.rongwe.zhsw.system.domain.SwNotificationAnnouncementDo;
 import com.rongwe.zhsw.system.domain.SwUserManagementDo;
 import com.rongwe.zhsw.system.domain.SwUserWechatDo;
 import com.rongwe.zhsw.system.vo.AccountBindVo;
@@ -13,6 +14,7 @@ import com.rongwei.rwcommon.base.BaseDo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.base.exception.CustomException;
 import com.rongwei.rwcommon.utils.SecurityUtil;
+import com.rongwei.zhsw.system.dao.SwNotificationAnnouncementDao;
 import com.rongwei.zhsw.system.service.impl.SwBillManagementUnpaidServiceImpl;
 import com.rongwei.zhsw.system.service.impl.SwUserManagementServiceImpl;
 import com.rongwei.zhsw.system.service.impl.SwUserWechatServiceImpl;
@@ -48,6 +50,8 @@ public class AccountServiceImpl implements AccountService {
     private WeChatLoginServiceImpl weChatLoginService;
     @Autowired
     private SwBillManagementUnpaidServiceImpl swBillManagementUnpaidService;
+    @Autowired
+    private SwNotificationAnnouncementDao swNotificationAnnouncementDao;
 
     @Override
     public R bind(AccountBindVo accountBindVo) {
@@ -139,6 +143,8 @@ public class AccountServiceImpl implements AccountService {
         BeanUtils.copyProperties(list.get(0), weChatHomePageVo);
         weChatHomePageVo.setWaterConsumption(outstandingBills.stream().map(SwBillManagementUnpaidDo::getCurrentwateruse).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
         weChatHomePageVo.setDuFees(outstandingBills.stream().map(SwBillManagementUnpaidDo::getActualdue).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
+        List<SwNotificationAnnouncementDo> swNotificationAnnouncementDos = swNotificationAnnouncementDao.selectShowData();
+        weChatHomePageVo.setSwNotificationAnnouncementDos(swNotificationAnnouncementDos);
         return R.ok(weChatHomePageVo);
     }
 
@@ -158,9 +164,9 @@ public class AccountServiceImpl implements AccountService {
         }
         String currentWeChatOpenId = WeChatUtils.getCurrentWeChatOpenId();
         // 删除绑定关系
-        swUserManagementService.getBaseMapper().unbindAccount(dsKey, currentWeChatOpenId,account );
+        swUserManagementService.getBaseMapper().unbindAccount(dsKey, currentWeChatOpenId, account);
         // 默认不刷新直接返回
-        if(!accountUnbindVo.getRefresh()){
+        if (!accountUnbindVo.getRefresh()) {
             return R.ok();
         }
         List<String> otherDsKeys = accountUnbindVo.getOtherDsKeys();

+ 4 - 4
zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/impl/WeChatLoginServiceImpl.java

@@ -104,7 +104,7 @@ public class WeChatLoginServiceImpl implements WeChatLoginService {
         // 获取水站基本配置
         List<SwEnterpriseConfigInfoDo> swEnterpriseConfigInfoDos = swEnterpriseConfigInfoService.getBaseMapper().selectListByDsKey(dsKeys);
         // 当前水站的通知公告
-        List<SwNotificationAnnouncementDo> swNotificationAnnouncementDos = swNotificationAnnouncementDao.selectListByDsKey(dsKeys);
+        // List<SwNotificationAnnouncementDo> swNotificationAnnouncementDos = swNotificationAnnouncementDao.selectListByDsKey(dsKeys);
 
         // 缓存当前用户可以读取到的水站信息
         List<WeChatPickerVo> waterCompanys = tenantDos.stream()
@@ -121,9 +121,9 @@ public class WeChatLoginServiceImpl implements WeChatLoginService {
                             .filter(sw->data.getDskey().equals(sw.getRoption()))
                             .sorted(Comparator.comparing(SwBusinesshallDo::getOrdernumber))
                             .collect(Collectors.toList()));
-                    weChatPickerVo.setNotifications(swNotificationAnnouncementDos.stream()
-                            .filter(sw->data.getDskey().equals(sw.getRoption()))
-                            .collect(Collectors.toList()));
+                    // weChatPickerVo.setNotifications(swNotificationAnnouncementDos.stream()
+                    //         .filter(sw->data.getDskey().equals(sw.getRoption()))
+                    //         .collect(Collectors.toList()));
                     return weChatPickerVo;
                 }).collect(Collectors.toList());
         login.setWaterCompany(waterCompanys);

+ 20 - 2
zhsw-common/src/main/resources/mybatis/zhsw/SwNotificationAnnouncementDao.xml

@@ -9,8 +9,26 @@
         CREATEUSERID,MODIFYDATE,MODIFYUSERID,CREATEUSERNAME,MODIFYUSERNAME,
         NOTICETYPE,NOTICETITLE,NOTICECONTENT,NOTICEIMAGE,NOTICELINK,
         NOTICEDEADLINE,NOTICESTATUS,NOTIFYPERSON,NOTIFYTARGET,NOTIFYPERSONID,
-        HOMEPAGESLIDER,PUBLISHTIME
+        HOMEPAGESLIDER,PUBLISHTIME,SCROLLINGCONTENT
     </sql>
+    <select id="selectShowData" resultType="com.rongwe.zhsw.system.domain.SwNotificationAnnouncementDo">
+        select
+        ID,TENANTID, ROPTION,DELETED,REMARK,CREATEDATE,
+        CREATEUSERID,MODIFYDATE,MODIFYUSERID,CREATEUSERNAME,MODIFYUSERNAME,
+        NOTICETYPE,NOTICETITLE,NOTICECONTENT,NOTICEIMAGE,NOTICELINK,
+        NOTICEDEADLINE,NOTICESTATUS,NOTIFYPERSON,NOTIFYTARGET,NOTIFYPERSONID,
+        HOMEPAGESLIDER,PUBLISHTIME,SCROLLINGCONTENT
+        from sw_notification_announcement
+        <where>
+            DELETED='0'
+            AND NOTICESTATUS='2'
+            and (NOTICEDEADLINE IS NULL
+            OR CURDATE()  <![CDATA[ < ]]> DATE(NOTICEDEADLINE)
+            )
+        </where>
+        ORDER BY
+        NOTICETYPE DESC ,PUBLISHTIME DESC
+    </select>
     <select id="selectListByDsKey" resultType="com.rongwe.zhsw.system.domain.SwNotificationAnnouncementDo">
         select * from
         <foreach collection="dsKeys" item="dsKey" open="(" close=") a" separator="union all">
@@ -19,7 +37,7 @@
             CREATEUSERID,MODIFYDATE,MODIFYUSERID,CREATEUSERNAME,MODIFYUSERNAME,
             NOTICETYPE,NOTICETITLE,NOTICECONTENT,NOTICEIMAGE,NOTICELINK,
             NOTICEDEADLINE,NOTICESTATUS,NOTIFYPERSON,NOTIFYTARGET,NOTIFYPERSONID,
-            HOMEPAGESLIDER,PUBLISHTIME
+            HOMEPAGESLIDER,PUBLISHTIME,SCROLLINGCONTENT
             from ${dsKey}.sw_notification_announcement
             <where>
                 DELETED='0'

+ 4 - 0
zhsw-entity/src/main/java/com/rongwe/zhsw/system/domain/SwNotificationAnnouncementDo.java

@@ -89,4 +89,8 @@ public class SwNotificationAnnouncementDo extends BaseDo {
      * 发布时间
      */
     private Date publishtime;
+    /**
+     * 滚动内容
+     */
+    private String scrollingcontent;
 }

+ 3 - 0
zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/WeChatHomePageVo.java

@@ -1,6 +1,7 @@
 package com.rongwe.zhsw.system.vo;
 
 import com.rongwe.zhsw.system.domain.SwBillManagementUnpaidDo;
+import com.rongwe.zhsw.system.domain.SwNotificationAnnouncementDo;
 import com.rongwe.zhsw.system.domain.SwUserManagementDo;
 import lombok.Data;
 
@@ -20,4 +21,6 @@ public class WeChatHomePageVo extends SwUserManagementDo {
     private BigDecimal duFees;
     //用水量
     private BigDecimal waterConsumption;
+
+    private List<SwNotificationAnnouncementDo> swNotificationAnnouncementDos;
 }