xiahan преди 4 месеца
родител
ревизия
c2b1f45c81
променени са 36 файла, в които са добавени 851 реда и са изтрити 101 реда
  1. 25 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/config/ZHSWWebConfig.java
  2. 2 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/dao/CommonBusinessDao.java
  3. 22 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/dao/SwBusinesshallDao.java
  4. 23 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/dao/SwEnterpriseConfigInfoDao.java
  5. 1 1
      zhsw-common/src/main/java/com/rongwei/zhsw/system/dao/SwUserManagementDao.java
  6. 48 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/interceptor/WeChatTokenInterceptor.java
  7. 14 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/service/SwBusinesshallService.java
  8. 13 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/service/SwEnterpriseConfigInfoService.java
  9. 1 1
      zhsw-common/src/main/java/com/rongwei/zhsw/system/utils/SaveConstans.java
  10. 19 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/utils/WeChatUtils.java
  11. 2 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/AccountService.java
  12. 15 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/BillService.java
  13. 67 15
      zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/impl/AccountServiceImpl.java
  14. 113 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/impl/BillServiceImpl.java
  15. 71 15
      zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/impl/WeChatLoginServiceImpl.java
  16. 8 1
      zhsw-common/src/main/resources/mybatis/zhsw/CommonBusinessDao.xml
  17. 16 0
      zhsw-common/src/main/resources/mybatis/zhsw/SwBusinesshallDao.xml
  18. 17 0
      zhsw-common/src/main/resources/mybatis/zhsw/SwEnterpriseConfigInfoDao.xml
  19. 13 4
      zhsw-common/src/main/resources/mybatis/zhsw/SwUserManagementDao.xml
  20. 45 46
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/domain/SwBillManagementPaidDo.java
  21. 56 0
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/domain/SwBusinesshallDo.java
  22. 97 0
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/domain/SwEnterpriseConfigInfoDo.java
  23. 0 5
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/domain/SwUserManagementDo.java
  24. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/domain/SwUserWechatDo.java
  25. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/AccountBindVo.java
  26. 18 0
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/BillListSearchVo.java
  27. 53 0
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/BillListVo.java
  28. 1 0
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/CurrentWechatVo.java
  29. 2 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/OwnerVo.java
  30. 14 0
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/SwUserManagementVo.java
  31. 23 0
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/WeChatHomePageVo.java
  32. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/WeChatLoginReturnVo.java
  33. 8 0
      zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/WeChatPickerVo.java
  34. 10 7
      zhsw-server/src/main/java/com/rongwei/zhsw/system/controller/weChat/AccountController.java
  35. 29 0
      zhsw-server/src/main/java/com/rongwei/zhsw/system/controller/weChat/BillController.java
  36. 2 2
      zhsw-server/src/main/resources/bootstrap-dev.yml

+ 25 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/config/ZHSWWebConfig.java

@@ -0,0 +1,25 @@
+package com.rongwei.zhsw.system.config;
+import com.rongwei.zhsw.system.interceptor.WeChatTokenInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * WebConfig class
+ *
+ * @author XH
+ * @date 2025/03/13
+ */
+@Configuration
+public class ZHSWWebConfig implements WebMvcConfigurer {
+
+    @Autowired
+    private WeChatTokenInterceptor tokenInterceptor;
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(tokenInterceptor)
+                .addPathPatterns("/wechat/**"); // 拦截;
+    }
+}

+ 2 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/dao/CommonBusinessDao.java

@@ -14,5 +14,7 @@ public interface CommonBusinessDao {
 
     List<TenantDo> getById(@Param("id") String id);
 
+    List<TenantDo> getByDsKey(@Param("dsKey") String dsKey);
+
     List<OwnerVo> getOwnerInfoByDsId(@Param("dsId") String dsKey);
 }

+ 22 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/dao/SwBusinesshallDao.java

@@ -0,0 +1,22 @@
+package com.rongwei.zhsw.system.dao;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwe.zhsw.system.domain.SwBusinesshallDo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+* @author libai
+* @description 针对表【sw_business_hall_info_copy(营业厅信息)】的数据库操作Mapper
+* @createDate 2025-03-14 10:52:22
+* @Entity generator.domain.SwBusinessHallInfoCopy
+*/
+public interface SwBusinesshallDao extends BaseMapper<SwBusinesshallDo> {
+    List<SwBusinesshallDo> selectListByDsKey(@Param("dsKeys") List<String> dsKey);
+}
+
+
+
+

+ 23 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/dao/SwEnterpriseConfigInfoDao.java

@@ -0,0 +1,23 @@
+package com.rongwei.zhsw.system.dao;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwe.zhsw.system.domain.SwBusinesshallDo;
+import com.rongwe.zhsw.system.domain.SwEnterpriseConfigInfoDo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+* @author libai
+* @description 针对表【sw_enterprise_config_info(企业配置信息)】的数据库操作Mapper
+* @createDate 2025-03-14 10:52:22
+* @Entity generator.domain.SwEnterpriseConfigInfo
+*/
+public interface SwEnterpriseConfigInfoDao extends BaseMapper<SwEnterpriseConfigInfoDo> {
+    List<SwEnterpriseConfigInfoDo> selectListByDsKey(@Param("dsKeys") List<String> dsKey);
+}
+
+
+
+

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

@@ -24,7 +24,7 @@ public interface SwUserManagementDao extends BaseMapper<SwUserManagementDo> {
 
     List<SwUserManagementVo> getUserByDsKey(@Param("para") Map<String, List<String>> map, @Param("openId") String openId);
 
-    SwUserManagementDo getDataByAccountAndDsKey(@Param("account") String account,@Param("deKey")String deKey);
+    SwUserManagementVo getDataByAccountAndDsKey(@Param("account") String account,@Param("deKey")String deKey);
 
     void updateDefaultAccount(@Param("dsKeys") List<String> dsKey,@Param("openId") String openId);
 }

+ 48 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/interceptor/WeChatTokenInterceptor.java

@@ -0,0 +1,48 @@
+package com.rongwei.zhsw.system.interceptor;
+
+import com.rongwei.rwcommon.utils.Constants;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.HandlerInterceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * WeChatTokenInterceptor class
+ *
+ * @author XH
+ * @date 2025/03/13
+ */
+@Component
+public class WeChatTokenInterceptor implements  HandlerInterceptor {
+    public static final String WE_CHAT_SIGN="wc";
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+        // 从请求头或请求参数中获取token
+        String source = request.getHeader("source"); // 假设token在Authorization头中
+        String saasToken = request.getHeader("!SAAS_LOGIN_TOKEN_!"); // 假设token在Authorization头中
+        // 或者从请求参数中获取: String token = request.getParameter("token");
+        if(StringUtils.isBlank(source) || !WE_CHAT_SIGN.equals(source)){
+            request.removeAttribute(Constants.SAAS_LOGIN_TOKEN);
+        }
+        // 在这里添加token验证逻辑
+        if (StringUtils.isNotBlank(saasToken)) {
+            // 如果token无效或不存在,返回错误响应
+            request.setAttribute(Constants.SAAS_LOGIN_TOKEN, saasToken);
+        }else{
+            request.setAttribute(Constants.SAAS_LOGIN_TOKEN, "");
+        }
+        // 如果token有效,继续处理请求
+        return true;
+    }
+
+    // 这是一个假设的方法,用于验证token的有效性
+    private boolean isValidToken(String token) {
+        // 在这里添加你的token验证逻辑
+        // 例如,你可以查询数据库或调用外部服务来验证token
+        return "valid-token-example".equals(token); // 这是一个示例,你应该替换为实际的验证逻辑
+    }
+
+    // postHandle和afterCompletion
+}

+ 14 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/service/SwBusinesshallService.java

@@ -0,0 +1,14 @@
+package com.rongwei.zhsw.system.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwe.zhsw.system.domain.SwBusinesshallDo;
+
+/**
+* @author libai
+* @description 针对表【sw_business_hall_info_copy(营业厅信息)】的数据库操作Service
+* @createDate 2025-03-14 10:52:22
+*/
+public interface SwBusinesshallService extends IService<SwBusinesshallDo> {
+
+}

+ 13 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/service/SwEnterpriseConfigInfoService.java

@@ -0,0 +1,13 @@
+package com.rongwei.zhsw.system.service;
+
+import com.rongwe.zhsw.system.domain.SwEnterpriseConfigInfoDo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author libai
+* @description 针对表【sw_enterprise_config_info(企业配置信息)】的数据库操作Service
+* @createDate 2025-03-14 10:52:22
+*/
+public interface SwEnterpriseConfigInfoService extends IService<SwEnterpriseConfigInfoDo> {
+
+}

+ 1 - 1
zhsw-common/src/main/java/com/rongwei/zhsw/system/utils/SaveConstans.java

@@ -7,7 +7,7 @@ public class SaveConstans {
     /**
      * 用户默认的token缓存时长
      */
-    public static final Integer DEFAULT_OWNER_CACHE_SECONDS=700;
+    public static final Integer DEFAULT_OWNER_CACHE_SECONDS=7200;
 
     public static class billInfo {
 

+ 19 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/utils/WeChatUtils.java

@@ -3,8 +3,10 @@ package com.rongwei.zhsw.system.utils;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.rongwe.zhsw.system.vo.WeChatLoginReturnVo;
 import com.rongwei.commonservice.service.RedisService;
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.base.exception.CustomException;
 import com.rongwei.zhsw.system.config.WeChatLoginApiPara;
+import org.apache.commons.lang.StringUtils;
 import org.apache.http.HttpEntity;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -16,8 +18,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
 
 import javax.annotation.PostConstruct;
+import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
 
 import static com.rongwei.zhsw.system.utils.SaveConstans.REDIS_OWNER_KEY;
@@ -87,4 +92,18 @@ public class WeChatUtils {
         }
         // redisService.redisCatchInit(String.format(REDIS_OWNER_KEY,tenantDo.getDskey()), ownerInfoByDsId, 0);
     }
+
+    public static String getCurrentWeChatOpenId(){
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        String openId=null;
+        if (attributes != null) {
+            HttpServletRequest request = attributes.getRequest();
+            String token = request.getHeader("token");
+            if(StringUtils.isNotBlank(token)){
+                SysUserVo sysUserVo = (SysUserVo) redisService.getRedisCatchObj("token-" + token);
+                openId=sysUserVo.getId();
+            }
+        }
+        return openId;
+    }
 }

+ 2 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/AccountService.java

@@ -13,4 +13,6 @@ public interface AccountService {
     R bind(AccountBindVo accountBindVo);
 
     R changeDefaultAccount(AccountBindVo accountBindVo);
+
+    R info(String accountNumber);
 }

+ 15 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/BillService.java

@@ -0,0 +1,15 @@
+package com.rongwei.zhsw.system.wechat;
+
+import com.rongwe.zhsw.system.vo.BillListSearchVo;
+import com.rongwei.rwcommon.base.R;
+
+/**
+ * BillService class
+ *
+ * @author XH
+ * @date 2025/03/14
+ */
+public interface BillService {
+
+    R getBillList(BillListSearchVo billListSearchVo);
+}

+ 67 - 15
zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/impl/AccountServiceImpl.java

@@ -1,21 +1,29 @@
 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.SwUserManagementDo;
 import com.rongwe.zhsw.system.domain.SwUserWechatDo;
 import com.rongwe.zhsw.system.vo.AccountBindVo;
 import com.rongwe.zhsw.system.vo.SwUserManagementVo;
+import com.rongwe.zhsw.system.vo.WeChatHomePageVo;
+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.service.impl.SwBillManagementUnpaidServiceImpl;
 import com.rongwei.zhsw.system.service.impl.SwUserManagementServiceImpl;
 import com.rongwei.zhsw.system.service.impl.SwUserWechatServiceImpl;
 import com.rongwei.zhsw.system.utils.WeChatUtils;
 import com.rongwei.zhsw.system.wechat.AccountService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -36,6 +44,8 @@ public class AccountServiceImpl implements AccountService {
     private OwnerServiceImpl ownerService;
     @Autowired
     private WeChatLoginServiceImpl weChatLoginService;
+    @Autowired
+    private SwBillManagementUnpaidServiceImpl swBillManagementUnpaidService;
 
     @Override
     public R bind(AccountBindVo accountBindVo) {
@@ -43,46 +53,88 @@ public class AccountServiceImpl implements AccountService {
         // 当前用户所需要绑定的水站信息
         String bindWaterCompany = accountBindVo.getBindWaterCompany();
         WeChatUtils.checkWater(bindWaterCompany);
-        SwUserManagementDo swUserManagementDo = swUserManagementService.getBaseMapper().getDataByAccountAndDsKey(accountBindVo.getAccountNum(), bindWaterCompany);
-
-        if (!swUserManagementDo.getUsername().equals(accountBindVo.getAccountName())) {
+        SwUserManagementVo swUserManagementVo = swUserManagementService.getBaseMapper().getDataByAccountAndDsKey(accountBindVo.getAccountNum(), bindWaterCompany);
+        if(swUserManagementVo==null){
+            log.error("户号不存在:{}",accountBindVo.getAccountNum());
+            throw new CustomException("户号不存在!");
+        }
+        if (!swUserManagementVo.getUsername().equals(accountBindVo.getAccountName())) {
             log.error("户名错误");
             throw new CustomException("户名错误!");
         }
+        String openId=WeChatUtils.getCurrentWeChatOpenId();
+        if(swUserManagementVo.getWechatSign().contains(openId)){
+            log.error("当前户号已绑定");
+            throw new CustomException("户号已绑定!");
+        }
+
         // 创建关联关系
         SwUserWechatDo swUserWechat = new SwUserWechatDo();
         swUserWechat.setId(SecurityUtil.getUUID());
 
         swUserWechat.setDefaultaccount(accountBindVo.getDefaultAccount());
-        swUserWechat.setGroup(accountBindVo.getGroupType());
-        swUserWechat.setPhone(accountBindVo.getPhone());
-        swUserWechat.setUserno(swUserManagementDo.getUsernumber());
-        swUserWechat.setUsername(swUserManagementDo.getUsername());
-        swUserWechat.setWechatsign(accountBindVo.getOpenId());
-        swUserWechat.setUserid(swUserManagementDo.getId());
+        swUserWechat.setGroupname(accountBindVo.getGroupType());
+        // swUserWechat.setPhone(accountBindVo.getPhone());
+        swUserWechat.setUserno(swUserManagementVo.getUsernumber());
+        swUserWechat.setUsername(swUserManagementVo.getUsername());
+        swUserWechat.setWechatsign(openId);
+        swUserWechat.setUserid(swUserManagementVo.getId());
         swUserWechat.setCreatedate(new Date());
         swUserWechat.setModifydate(new Date());
-        swUserWechat.setCreateuserid(accountBindVo.getOpenId());
-        swUserWechat.setCreateusername(accountBindVo.getOpenId());
-        swUserWechat.setModifyuserid(accountBindVo.getOpenId());
-        swUserWechat.setModifyusername(accountBindVo.getOpenId());
+        swUserWechat.setCreateuserid(openId);
+        swUserWechat.setCreateusername(openId);
+        swUserWechat.setModifyuserid(openId);
+        swUserWechat.setModifyusername(openId);
         swUserWechatService.save(swUserWechat);
         // 如果是默认账户的 将其余租户的默认关系变为否
         List<String> otherDsKey = accountBindVo.getOtherDsKey();
         otherDsKey.remove(accountBindVo.getBindWaterCompany());
         if(swUserWechat.getDefaultaccount()  && !otherDsKey.isEmpty()){
-            swUserManagementService.getBaseMapper().updateDefaultAccount(otherDsKey,accountBindVo.getOpenId());
+            swUserManagementService.getBaseMapper().updateDefaultAccount(otherDsKey,openId);
         }
         // 更新缓存中的 业主信息
         otherDsKey.add(accountBindVo.getBindWaterCompany());
         ownerService.refreshByTenant(otherDsKey);
         // 返回当前微信号所绑定的所有户号信息
-        List<SwUserManagementVo> allOwnerByOpenId = weChatLoginService.getAllOwnerByOpenId(accountBindVo.getOpenId(), otherDsKey);
+        List<SwUserManagementVo> allOwnerByOpenId = weChatLoginService.getAllOwnerByOpenId(openId, otherDsKey);
+        // 修改用户的绑定关系
+        swUserManagementService.update(new LambdaUpdateWrapper<SwUserManagementDo>()
+                .eq(SwUserManagementDo::getId, swUserManagementVo.getId())
+                .set(SwUserManagementDo::getWechatbindstatus,1));
         return R.ok(allOwnerByOpenId);
     }
 
+    /**
+     * 切换默认账户
+     * @param accountBindVo
+     * @return
+     */
     @Override
     public R changeDefaultAccount(AccountBindVo accountBindVo) {
         return null;
     }
+
+    /**
+     * 获取当前账户的信息
+     * @param accountNumber
+     * @return
+     */
+    @Override
+    public R info(String accountNumber) {
+        List<SwUserManagementDo> list = swUserManagementService.list(new LambdaQueryWrapper<SwUserManagementDo>()
+                .eq(BaseDo::getDeleted, "0")
+                .eq(SwUserManagementDo::getUsernumber, accountNumber));
+        if(list.isEmpty()){
+            throw new CustomException("当前户号不存在,请联系水务公司");
+        }
+        // 获取所有待缴费账单
+        List<SwBillManagementUnpaidDo> outstandingBills = swBillManagementUnpaidService.list(new LambdaQueryWrapper<SwBillManagementUnpaidDo>()
+                .eq(SwBillManagementUnpaidDo::getDeleted, 0)
+                .eq(SwBillManagementUnpaidDo::getUsernumber, accountNumber));
+        WeChatHomePageVo weChatHomePageVo = new WeChatHomePageVo();
+        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));
+        return R.ok(weChatHomePageVo);
+    }
 }

+ 113 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/impl/BillServiceImpl.java

@@ -0,0 +1,113 @@
+package com.rongwei.zhsw.system.wechat.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.rongwe.zhsw.system.domain.SwBillManagementPaidDo;
+import com.rongwe.zhsw.system.domain.SwBillManagementUnpaidDo;
+import com.rongwe.zhsw.system.vo.BillListSearchVo;
+import com.rongwe.zhsw.system.vo.BillListVo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.zhsw.system.service.impl.SwBillManagementPaidServiceImpl;
+import com.rongwei.zhsw.system.service.impl.SwBillManagementUnpaidServiceImpl;
+import com.rongwei.zhsw.system.service.impl.SwUserManagementServiceImpl;
+import com.rongwei.zhsw.system.wechat.BillService;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * BillServiceImpl class
+ *
+ * @author XH
+ * @date 2025/03/14
+ */
+@Service
+public class BillServiceImpl implements BillService {
+    private static final Logger log = LoggerFactory.getLogger(BillServiceImpl.class);
+    @Autowired
+    private SwBillManagementUnpaidServiceImpl swBillManagementUnpaidService;
+    @Autowired
+    private SwUserManagementServiceImpl swUserManagementService;
+    @Autowired
+    private SwBillManagementPaidServiceImpl swBillManagementPaidService;
+
+    /**
+     * 获取当前账户对应的未缴和已缴账单
+     *
+     * @param billListSearchVo
+     * @return
+     */
+    @Override
+    public R getBillList(BillListSearchVo billListSearchVo) {
+        // 户号
+        String accountNum = billListSearchVo.getAccountNum();
+        if (StringUtils.isBlank(accountNum)) {
+
+        }
+        // 年份
+        int year = billListSearchVo.getYear();
+        // 未缴账单
+        List<SwBillManagementUnpaidDo> unpaidRecordList = swBillManagementUnpaidService.list(new LambdaQueryWrapper<SwBillManagementUnpaidDo>()
+                .eq(SwBillManagementUnpaidDo::getDeleted, 0)
+                .eq(SwBillManagementUnpaidDo::getUsernumber, accountNum)
+                .eq(SwBillManagementUnpaidDo::getYear, year)
+                .orderByDesc(SwBillManagementUnpaidDo::getYear)
+                .orderByDesc(SwBillManagementUnpaidDo::getMonth));
+        // 已缴账单
+        List<SwBillManagementPaidDo> paidRecordList = swBillManagementPaidService.list(new LambdaQueryWrapper<SwBillManagementPaidDo>()
+                .eq(SwBillManagementPaidDo::getDeleted, 0)
+                .eq(SwBillManagementPaidDo::getUsernumber, accountNum)
+                .eq(SwBillManagementPaidDo::getYear, year)
+                .orderByDesc(SwBillManagementPaidDo::getYear)
+                .orderByDesc(SwBillManagementPaidDo::getMonth));
+
+        List<BillListVo> returnList = new ArrayList<>();
+
+        unpaidRecordList.forEach(unpaidRecord -> {
+            BillListVo billListVo = new BillListVo();
+            billListVo.setBillNumber(unpaidRecord.getBillnumber());
+            billListVo.setBillDate(unpaidRecord.getThismeterreadingdate());
+            billListVo.setAmount(unpaidRecord.getActualdue());
+            billListVo.setUsage(unpaidRecord.getCurrentwateruse());
+            BigDecimal start = unpaidRecord.getLastmeterreading().stripTrailingZeros();
+            BigDecimal end = unpaidRecord.getThismeterreading().stripTrailingZeros();
+            billListVo.setMeterReading(start+ "-" +end);
+            billListVo.setPaymentTime(null);
+            billListVo.setIsPaid(false);
+            billListVo.setCurrentDate(unpaidRecord.getThismeterreadingdate());
+            billListVo.setCurrentReading(unpaidRecord.getThismeterreading());
+            billListVo.setLastDate(unpaidRecord.getLastmeterreadingdate());
+            billListVo.setLastReading(unpaidRecord.getLastmeterreading());
+            billListVo.setTotalAmount(unpaidRecord.getOughttohavepaid());
+            billListVo.setDiscount(unpaidRecord.getFeewaiver());
+            billListVo.setLateFee(unpaidRecord.getLatefees());
+            returnList.add(billListVo);
+        });
+        paidRecordList.forEach(paidRecord -> {
+            BillListVo billListVo = new BillListVo();
+            billListVo.setBillNumber(paidRecord.getBillnumber());
+            billListVo.setBillDate(paidRecord.getThismeterreadingdate());
+            billListVo.setAmount(paidRecord.getActualdue());
+            billListVo.setUsage(paidRecord.getCurrentwateruse());
+            BigDecimal start = paidRecord.getLastmeterreading().stripTrailingZeros();
+            BigDecimal end = paidRecord.getThismeterreading().stripTrailingZeros();
+            billListVo.setMeterReading(start+ "-" +end);
+            billListVo.setPaymentTime(paidRecord.getPaymentdate());
+            billListVo.setIsPaid(true);
+            billListVo.setCurrentDate(paidRecord.getThismeterreadingdate());
+            billListVo.setCurrentReading(paidRecord.getThismeterreading());
+            billListVo.setLastDate(paidRecord.getLastmeterreadingdate());
+            billListVo.setLastReading(paidRecord.getLastmeterreading());
+            billListVo.setTotalAmount(paidRecord.getOughttohavepaid());
+            billListVo.setDiscount(paidRecord.getFeewaiver());
+            billListVo.setLateFee(paidRecord.getLatefees());
+            returnList.add(billListVo);
+        });
+        return R.ok(returnList);
+    }
+}

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

@@ -1,17 +1,20 @@
 package com.rongwei.zhsw.system.wechat.impl;
 
-import com.rongwe.zhsw.system.vo.OwnerVo;
-import com.rongwe.zhsw.system.vo.SwUserManagementVo;
-import com.rongwe.zhsw.system.vo.WeChatLoginReturnVo;
-import com.rongwe.zhsw.system.vo.WeChatLoginVo;
+import com.google.common.base.Strings;
+import com.rongwe.zhsw.system.domain.SwBusinesshallDo;
+import com.rongwe.zhsw.system.domain.SwEnterpriseConfigInfoDo;
+import com.rongwe.zhsw.system.vo.*;
 import com.rongwei.commonservice.service.RedisService;
 import com.rongwei.rwadmincommon.system.vo.JwtAuthenticationRequest;
 import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.base.exception.CustomException;
 import com.rongwei.rwcommonentity.commonservers.domain.TenantDo;
+import com.rongwei.zhsw.system.config.WeChatLoginApiPara;
 import com.rongwei.zhsw.system.dao.CommonBusinessDao;
 import com.rongwei.zhsw.system.fegin.LoginAuth;
+import com.rongwei.zhsw.system.service.impl.SwBusinesshallServiceImpl;
+import com.rongwei.zhsw.system.service.impl.SwEnterpriseConfigInfoServiceImpl;
 import com.rongwei.zhsw.system.service.impl.SwUserManagementServiceImpl;
 import com.rongwei.zhsw.system.utils.WeChatUtils;
 import com.rongwei.zhsw.system.wechat.WeChatLoginService;
@@ -21,9 +24,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import static com.rongwei.zhsw.system.utils.SaveConstans.DEFAULT_OWNER_CACHE_SECONDS;
@@ -47,18 +48,32 @@ public class WeChatLoginServiceImpl implements WeChatLoginService {
     private CommonBusinessDao commonBusinessDao;
     @Autowired
     private SwUserManagementServiceImpl swUserManagementService;
+    @Autowired
+    private WeChatLoginApiPara autoWeChatLoginApiPara;
+    @Autowired
+    private SwBusinesshallServiceImpl swBusinesshallService;
+    @Autowired
+    private SwEnterpriseConfigInfoServiceImpl swEnterpriseConfigInfoService;
+
+
+
+
     @Override
     public R wechatLogin(WeChatLoginVo weChatLoginVo) {
         log.info("微信用户登录");
         WeChatLoginReturnVo login = WeChatUtils.getWeChatOpenId(weChatLoginVo.getWxCode());
-        if (login == null) {
+        if (login == null || 0 != login.getErrcode()) {
+            log.error("登录异常:{}", login);
             throw new CustomException("微信登录异常!请联系水务公司");
         }
+        // 当前用户的数据来源
+        String dsKey = weChatLoginVo.getDsKey();
         String openId = login.getOpenid();
-        List<SwUserManagementVo>  userByDsKey= getAllOwnerByOpenId(openId,null);
+        List dsKeyList=StringUtils.isNotBlank(dsKey)? Collections.singletonList(dsKey) :null;
+        List<SwUserManagementVo> userByDsKey = getAllOwnerByOpenId(openId, dsKeyList);
         login.setSwUserManagementVos(userByDsKey);
         // 生成token
-        JwtAuthenticationRequest jwtAuthenticationRequest = new JwtAuthenticationRequest(openId, login.getUnionid(), "wechat");
+        JwtAuthenticationRequest jwtAuthenticationRequest = new JwtAuthenticationRequest(openId, login.getSession_key(), "wechat");
         jwtAuthenticationRequest.setExpire(DEFAULT_OWNER_CACHE_SECONDS);
         Map<String, Object> tokenmap = loginAuth.getTokenInfo(jwtAuthenticationRequest);
         String token = (String) tokenmap.get("token");
@@ -66,25 +81,58 @@ public class WeChatLoginServiceImpl implements WeChatLoginService {
         SysUserVo sysUserVo = new SysUserVo();
         sysUserVo.setId(openId);
         sysUserVo.setName(openId);
+
         TenantDo tenantDo = new TenantDo();
-        if (userByDsKey != null) {
+        if (userByDsKey != null && !userByDsKey.isEmpty()) {
             tenantDo.setDskey(userByDsKey.get(0).getDsKey());
         }
         sysUserVo.setTenantDo(tenantDo);
-        redisService.redisCatchInit("token-" + token, sysUserVo, DEFAULT_OWNER_CACHE_SECONDS);
+        if(autoWeChatLoginApiPara.isNeverExpires()){
+            redisService.redisCatchInit("token-" + token, sysUserVo, -1);
+        }else {
+            redisService.redisCatchInit("token-" + token, sysUserVo, DEFAULT_OWNER_CACHE_SECONDS);
+        }
+
+        // 设置水务公司数据字典
+        List<TenantDo> tenantDos = commonBusinessDao.getByDsKey(dsKey);
+        List<String> dsKeys = tenantDos.stream().filter(data -> !"incontrol".equals(data.getDskey())).map(TenantDo::getDskey).collect(Collectors.toList());
+        // 获取营业厅信息
+        List<SwBusinesshallDo> swBusinesshallDos = swBusinesshallService.getBaseMapper().selectListByDsKey(dsKeys);
+        // 获取水站基本配置
+        List<SwEnterpriseConfigInfoDo> swEnterpriseConfigInfoDos = swEnterpriseConfigInfoService.getBaseMapper().selectListByDsKey(dsKeys);
+        // 缓存当前用户可以读取到的水站信息
+        List<WeChatPickerVo> waterCompanys = tenantDos.stream()
+                .filter(data -> !"incontrol".equals(data.getDskey()))
+                .map(data -> {
+                    WeChatPickerVo weChatPickerVo = new WeChatPickerVo();
+                    weChatPickerVo.setId(data.getDskey());
+                    weChatPickerVo.setName(data.getTenantname());
+                    weChatPickerVo.setSwCompanyInfo(swEnterpriseConfigInfoDos.stream()
+                            .filter(info->data.getDskey().equals(info.getRoption()))
+                            .findFirst()
+                            .orElse(null));
+                    weChatPickerVo.setBusinessPoint(swBusinesshallDos.stream()
+                            .filter(sw->data.getDskey().equals(sw.getRoption()))
+                            .sorted(Comparator.comparing(SwBusinesshallDo::getOrdernumber))
+                            .collect(Collectors.toList()));
+                    return weChatPickerVo;
+                }).collect(Collectors.toList());
+        login.setWaterCompany(waterCompanys);
         return R.ok(login);
     }
 
     /**
      * 获取当前用户的所有户号信息
+     *
      * @param openId
      * @param dsKeyList
      * @return
      */
-    public List<SwUserManagementVo> getAllOwnerByOpenId(String openId,List<String> dsKeyList) {
-        if(dsKeyList==null || dsKeyList.isEmpty()){
+    // 获取系统中的所有户号信息
+    public List<SwUserManagementVo> getAllOwnerByOpenId(String openId, List<String> dsKeyList) {
+        if (dsKeyList == null || dsKeyList.isEmpty()) {
             List<TenantDo> tenantDos = commonBusinessDao.getById("");
-            dsKeyList =tenantDos.stream().map(TenantDo::getDskey).collect(Collectors.toList());
+            dsKeyList = tenantDos.stream().map(TenantDo::getDskey).collect(Collectors.toList());
         }
         // 获取当前用户所绑定的所有用户信息
         Map<String, List<String>> dsANdOwnerIdMap = new HashMap<String, List<String>>();
@@ -116,4 +164,12 @@ public class WeChatLoginServiceImpl implements WeChatLoginService {
         // redisService.redisCatchInit(openId, sysUserVo, DEFAULT_OWNER_CACHE_SECONDS);
         return userByDsKey;
     }
+
+    public static void main(String[] args) {
+        String address = "江苏省苏州市昆山市花桥镇同城浦江大厦4号楼701";
+        if (!Strings.isNullOrEmpty(address)) {
+            address = StringUtils.left(address, address.length() - 11).concat(StringUtils.removeStart(StringUtils.leftPad(StringUtils.right(address, address.length() - 11), StringUtils.length(address), "*"), "***"));
+        }
+        System.out.println(address);
+    }
 }

+ 8 - 1
zhsw-common/src/main/resources/mybatis/zhsw/CommonBusinessDao.xml

@@ -18,9 +18,16 @@
             AND ID = #{id}
         </if>
     </select>
+    <select id="getByDsKey" resultType="com.rongwei.rwcommonentity.commonservers.domain.TenantDo">
+        select * from incontrol.sys_tenant where DELETED='0'
+        <if test="dsKey != null and dsKey != ''">
+            AND DSKEY = #{dsKey}
+        </if>
+    </select>
     <select id="getOwnerInfoByDsId" resultType="com.rongwe.zhsw.system.vo.OwnerVo">
-        select swm.ID as id ,suw.WECHATSIGN as weChatSign,#{dsId}as dsKey,swm.STATUS as status
+        select swm.ID as id ,suw.WECHATSIGN as weChatSign,#{dsId}as dsKey,swm.STATUS as status,ifnull(suw.DEFAULTACCOUNT,0) as defaultAccount
         from ${dsId}.sw_user_management swm
+            left join ${dsId}.sw_user_wechat suw on suw.USERID=swm.ID and suw.DELETED='0'
             where swm.DELETED='0'
     </select>
 </mapper>

+ 16 - 0
zhsw-common/src/main/resources/mybatis/zhsw/SwBusinesshallDao.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.rongwei.zhsw.system.dao.SwBusinesshallDao">
+
+    <select id="selectListByDsKey" resultType="com.rongwe.zhsw.system.domain.SwBusinesshallDo">
+        select * from
+        <foreach collection="dsKeys" item="dsKey" open="(" close=") a" separator="union all">
+            select `ID`, `TENANTID`, #{dsKey} as  `ROPTION`, `DELETED`, `REMARK`, `CREATEDATE`, `CREATEUSERID`, `MODIFYDATE`,
+            `MODIFYUSERID`, `CREATEUSERNAME`, `MODIFYUSERNAME`, `ENTID`, `ADDRESS`, `CONTACTPHONE`, `WORKTIME`,
+            `ORDERNUMBER`
+            from ${dsKey}.sw_businesshall where DELETED='0'
+        </foreach>
+    </select>
+</mapper>

+ 17 - 0
zhsw-common/src/main/resources/mybatis/zhsw/SwEnterpriseConfigInfoDao.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.rongwei.zhsw.system.dao.SwEnterpriseConfigInfoDao">
+
+    <select id="selectListByDsKey" resultType="com.rongwe.zhsw.system.domain.SwEnterpriseConfigInfoDo">
+        select * from
+        <foreach collection="dsKeys" item="dsKey" open="(" close=") a" separator="union all">
+            select `ID`, `TENANTID`, #{dsKey} as  `ROPTION`, `DELETED`, `REMARK`, `CREATEDATE`, `CREATEUSERID`,
+            `MODIFYDATE`, `MODIFYUSERID`, `CREATEUSERNAME`, `MODIFYUSERNAME`, `ENTERPRISENO`, `ENTERPRISENAME`,
+            `ADDRESS`, `CONTACTPERSON`, `CONTACTPHONE`, `OVERDUENOTICEIMAGE`, `WINDOWPAYMENTMETHOD`,
+            `SUPPORTONLINEINVOICE`, `STATUS`, `UCC`, `ENTRYDATE`, `MERCHANTID`, `MERCHANTNAME`
+            from ${dsKey}.sw_enterprise_config_info where DELETED='0'
+        </foreach>
+    </select>
+</mapper>

+ 13 - 4
zhsw-common/src/main/resources/mybatis/zhsw/SwUserManagementDao.xml

@@ -28,11 +28,20 @@
         </foreach>
         order by defaultAccount
     </select>
-    <select id="getDataByAccountAndDsKey" resultType="com.rongwe.zhsw.system.domain.SwUserManagementDo">
-        select * from ${deKey}.sw_user_management
+    <select id="getDataByAccountAndDsKey" resultType="com.rongwe.zhsw.system.vo.SwUserManagementVo">
+        select *,   cast((
+        SELECT
+        ifnull(GROUP_CONCAT(b.WECHATSIGN),"")
+        FROM
+        ${deKey}.sw_user_wechat b
+        WHERE
+        b.USERID = a.ID
+        AND b.DELETED = '0'
+        GROUP BY
+        b.USERID) as char )as  wechatSign   from ${deKey}.sw_user_management a
         <where>
-            DELETED='0'
-            and USERNUMBER =#{account}
+            a.DELETED='0'
+            and a.USERNUMBER =#{account}
         </where>
     </select>
     <update id="updateDefaultAccount">

+ 45 - 46
zhsw-entity/src/main/java/com/rongwe/zhsw/system/domain/SwBillManagementPaidDo.java

@@ -21,158 +21,158 @@ import java.util.Date;
 @TableName("sw_bill_management_paid")
 public class SwBillManagementPaidDo implements Serializable {
     private static final long serialVersionUID = -12565293614671354L;
-/**
+    /**
      * 主键
      */
     private String id;
-/**
+    /**
      * 租户ID
      */
     private String tenantid;
-/**
+    /**
      * 扩展json格式配置
      */
     private String roption;
-/**
+    /**
      * 是否删除Y/N
      */
     private String deleted;
-/**
+    /**
      * 备注
      */
     private String remark;
-/**
+    /**
      * 创建时间
      */
     private Date createdate;
-/**
+    /**
      * 创建用户ID
      */
     private String createuserid;
-/**
+    /**
      * 修改日期
      */
     private Date modifydate;
-/**
+    /**
      * 修改用户ID
      */
     private String modifyuserid;
-/**
+    /**
      * 创建人
      */
     private String createusername;
-/**
+    /**
      * 修改人
      */
     private String modifyusername;
-/**
+    /**
      * 账单编号
      */
     private String billnumber;
-/**
+    /**
      * 年
      */
     private Integer year;
-/**
+    /**
      * 月
      */
     private Integer month;
-/**
+    /**
      * 小区/村落/街道名称
      */
     private String villagename;
-/**
+    /**
      * 户号
      */
     private String usernumber;
-/**
+    /**
      * 户名
      */
     private String username;
-/**
+    /**
      * 用户类别
      */
     private String usertype;
-/**
+    /**
      * 详细地址
      */
     private String address;
-/**
+    /**
      * 单价(元)
      */
     private BigDecimal unitprice;
-/**
+    /**
      * 当期用水(t)
      */
     private BigDecimal currentwateruse;
-/**
+    /**
      * 减免用水(t)
      */
     private BigDecimal reducedwateruse;
-/**
+    /**
      * 减免费用
-(元)
+     * (元)
      */
     private BigDecimal feewaiver;
-/**
+    /**
      * 原应缴
-(元)
+     * (元)
      */
     private BigDecimal oughttohavepaid;
-/**
+    /**
      * 用水类型
      */
     private String watertype;
-/**
+    /**
      * 实际应缴
-(元)
+     * (元)
      */
     private BigDecimal actualdue;
-/**
+    /**
      * 上次抄表日期
      */
     private Date lastmeterreadingdate;
-/**
+    /**
      * 上次抄表数(t)
      */
     private BigDecimal lastmeterreading;
-/**
+    /**
      * 本次抄表日期
      */
     private Date thismeterreadingdate;
-/**
+    /**
      * 本次抄表数(t)
      */
     private BigDecimal thismeterreading;
-/**
+    /**
      * 状态(预收,未缴,实缴,退款)
      */
     private String status;
-/**
+    /**
      * 缴费记录ID
      */
     private String paymentrecordid;
-/**
+    /**
      * 开票状态
      */
     private String invoicestatus;
-/**
+    /**
      * 票据状态
      */
     private String billstatus;
-/**
+    /**
      * 发票附件
      */
     private String invoicefiles;
-/**
+    /**
      * 滞纳金
      */
     private BigDecimal latefees;
-/**
+    /**
      * 退款金额
      */
     private BigDecimal refundamount;
-/**
+    /**
      * 余额划扣金额
      */
     private BigDecimal balancedebitamount;
@@ -180,10 +180,9 @@ public class SwBillManagementPaidDo implements Serializable {
      * 抄表修正状态
      */
     private String meterreadingcorrectionstatus;
-
-
-
-
-
+    /**
+     * 缴费日期
+     */
+    private Date paymentdate;
 }
 

+ 56 - 0
zhsw-entity/src/main/java/com/rongwe/zhsw/system/domain/SwBusinesshallDo.java

@@ -0,0 +1,56 @@
+package com.rongwe.zhsw.system.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.rongwei.rwcommon.base.BaseDo;
+import lombok.Data;
+
+/**
+ * 营业厅信息
+ * @TableName sw_business_hall_info_copy
+ */
+@TableName(value ="sw_businesshall")
+@Data
+public class SwBusinesshallDo extends BaseDo {
+    /**
+     * 主键
+     */
+    @TableId
+    private String id;
+
+    /**
+     * 租户ID
+     */
+    private String tenantid;
+
+    /**
+     * 扩展json格式配置
+     */
+    private String roption;
+
+    /**
+     * 企业ID
+     */
+    private String entid;
+
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 联系电话
+     */
+    private String contactphone;
+
+    /**
+     * 上班时间
+     */
+    private String worktime;
+
+    /**
+     * 序号
+     */
+    private int ordernumber;
+}

+ 97 - 0
zhsw-entity/src/main/java/com/rongwe/zhsw/system/domain/SwEnterpriseConfigInfoDo.java

@@ -0,0 +1,97 @@
+package com.rongwe.zhsw.system.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+
+import com.rongwei.rwcommon.base.BaseDo;
+import lombok.Data;
+
+/**
+ * 企业配置信息
+ * @TableName sw_enterprise_config_info
+ */
+@TableName(value ="sw_enterprise_config_info")
+@Data
+public class SwEnterpriseConfigInfoDo extends BaseDo {
+    /**
+     * 主键
+     */
+    @TableId
+    private String id;
+
+    /**
+     * 租户ID
+     */
+    private String tenantid;
+
+    /**
+     * 扩展json格式配置
+     */
+    private String roption;
+
+    /**
+     * 企业编号
+     */
+    private String enterpriseno;
+
+    /**
+     * 企业名称
+     */
+    private String enterprisename;
+
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 联系人
+     */
+    private String contactperson;
+
+    /**
+     * 联系电话
+     */
+    private String contactphone;
+
+    /**
+     * 催缴通知单图片
+     */
+    private String overduenoticeimage;
+
+    /**
+     * 窗口收费方式
+     */
+    private String windowpaymentmethod;
+
+    /**
+     * 是否支持线上开票
+     */
+    private String supportonlineinvoice;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 社会统一信用代码
+     */
+    private String ucc;
+
+    /**
+     * 入驻日期
+     */
+    private Date entrydate;
+
+    /**
+     * 商户ID
+     */
+    private String merchantid;
+
+    /**
+     * 商户名称
+     */
+    private String merchantname;
+}

+ 0 - 5
zhsw-entity/src/main/java/com/rongwe/zhsw/system/domain/SwUserManagementDo.java

@@ -105,9 +105,4 @@ public class SwUserManagementDo extends BaseDo {
      * 最后一次抄表读数
      */
     private BigDecimal lastmeterreading;
-
-    /**
-     * 微信标识
-     */
-    private String wechatsign;
 }

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/system/domain/SwUserWechatDo.java

@@ -61,5 +61,5 @@ public class SwUserWechatDo  extends BaseDo {
     /**
      * 当前户主所属的分组(,逗号分隔)
      */
-    private String group;
+    private String groupname;
 }

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/AccountBindVo.java

@@ -12,7 +12,7 @@ import java.util.List;
  * @date 2025/03/11
  */
 @Data
-public class AccountBindVo  extends CurrentWechatVo{
+public class AccountBindVo {
     // 绑定的水站
     private String bindWaterCompany;
     // 户号

+ 18 - 0
zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/BillListSearchVo.java

@@ -0,0 +1,18 @@
+package com.rongwe.zhsw.system.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * BillListSearchVo class
+ *
+ * @author XH
+ * @date 2025/03/14
+ */
+@Data
+public class BillListSearchVo {
+    private String accountNum;
+    // 账单年份
+    private int year= new Date().getYear();
+}

+ 53 - 0
zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/BillListVo.java

@@ -0,0 +1,53 @@
+package com.rongwe.zhsw.system.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * BillListVo class
+ *
+ * @author XH
+ * @date 2025/03/14
+ */
+@Data
+public class BillListVo {
+    // 账单编号
+    private String billNumber;
+    // 账单日期
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date billDate;
+    // 应缴金额   -> 应缴
+    private BigDecimal amount;
+    // 用水量
+    private BigDecimal usage;
+    // 起码-止码
+    private String meterReading;
+    // 缴费日期 '2025/01/31 14:39',
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonInclude(JsonInclude.Include.NON_NULL)
+    private Date paymentTime;
+    // 是否已缴费
+    private Boolean isPaid;
+    //  抄表日期
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonInclude(JsonInclude.Include.NON_NULL)
+    private Date currentDate;
+    // 本次抄表数
+    private BigDecimal currentReading;
+    // 上次抄表日期
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonInclude(JsonInclude.Include.NON_NULL)
+    private Date lastDate;
+    // 上次抄表数
+    private BigDecimal lastReading;
+    //  总费用 -》原应缴
+    private BigDecimal totalAmount;
+    // 减免费用
+    private BigDecimal discount;
+    //  滞纳金,
+    private BigDecimal lateFee;
+}

+ 1 - 0
zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/CurrentWechatVo.java

@@ -9,6 +9,7 @@ import lombok.Data;
  * @date 2025/03/11
  */
 @Data
+@Deprecated
 public class CurrentWechatVo {
     // 当前登录人的openId
     private String openId;

+ 2 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/OwnerVo.java

@@ -13,6 +13,7 @@ public class OwnerVo {
     // 用户ID
     private String id;
     private String dsKey;
-    private String weChatSign;
+    private String weChatSign="";
     private String status;
+    private Boolean defaultAccount;
 }

+ 14 - 0
zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/SwUserManagementVo.java

@@ -2,6 +2,11 @@ package com.rongwe.zhsw.system.vo;
 
 import com.rongwe.zhsw.system.domain.SwUserManagementDo;
 import lombok.Data;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * SwUserManagementVo class
@@ -11,6 +16,15 @@ import lombok.Data;
  */
 @Data
 public class SwUserManagementVo  extends SwUserManagementDo {
+    // 对应的库信息
     private String dsKey;
+    // 是否默认账户
     private String defaultAccount;
+    private List<String> wechatSign =new ArrayList<>();
+
+    public void setWechatSign(String wechatSign) {
+        if(StringUtils.isNotBlank(wechatSign)){
+            this.wechatSign = Arrays.asList(wechatSign.split(","));
+        }
+    }
 }

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

@@ -0,0 +1,23 @@
+package com.rongwe.zhsw.system.vo;
+
+import com.rongwe.zhsw.system.domain.SwBillManagementUnpaidDo;
+import com.rongwe.zhsw.system.domain.SwUserManagementDo;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * WeChatHomePageVo class
+ *
+ * @author XH
+ * @date 2025/03/14
+ */
+@Data
+public class WeChatHomePageVo extends SwUserManagementDo {
+    // 应缴费用
+    private BigDecimal duFees;
+    //用水量
+    private BigDecimal waterConsumption;
+}

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/WeChatLoginReturnVo.java

@@ -36,7 +36,7 @@ public class WeChatLoginReturnVo {
      * -1	system error	系统繁忙,此时请开发者稍候再试
      *
      */
-    private String errcode;
+    private int errcode;
 
     /**
      * 水务公司数据字典

+ 8 - 0
zhsw-entity/src/main/java/com/rongwe/zhsw/system/vo/WeChatPickerVo.java

@@ -1,7 +1,11 @@
 package com.rongwe.zhsw.system.vo;
 
+import com.rongwe.zhsw.system.domain.SwBusinesshallDo;
+import com.rongwe.zhsw.system.domain.SwEnterpriseConfigInfoDo;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  * WeChatPickerVo class
  *
@@ -12,4 +16,8 @@ import lombok.Data;
 public class WeChatPickerVo {
     private String id;
     private String name;
+    // 水务公司基本配置信息
+    private SwEnterpriseConfigInfoDo swCompanyInfo;
+    // 水务公司营业站点信息
+    private List<SwBusinesshallDo> businessPoint;
 }

+ 10 - 7
zhsw-server/src/main/java/com/rongwei/zhsw/system/controller/weChat/AccountController.java

@@ -2,14 +2,12 @@ package com.rongwei.zhsw.system.controller.weChat;
 
 import com.rongwe.zhsw.system.vo.AccountBindVo;
 import com.rongwei.rwcommon.base.R;
+import com.rongwei.zhsw.system.service.impl.SwBillManagementUnpaidServiceImpl;
 import com.rongwei.zhsw.system.wechat.impl.AccountServiceImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * AccountController class
@@ -18,14 +16,12 @@ import org.springframework.web.bind.annotation.RestController;
  * @date 2025/03/11
  */
 @RestController
-@RequestMapping("/account")
+@RequestMapping("/wechat/account")
 public class AccountController {
     private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
 
     @Autowired
     private AccountServiceImpl accountService;
-
-
     /**
      * Core+ 通过账号密码登录和校验方法
      *
@@ -43,4 +39,11 @@ public class AccountController {
     }
 
 
+    @GetMapping("/info/{accountNumber}")
+    private R info(@PathVariable("accountNumber") String accountNumber) {
+        return accountService.info(accountNumber);
+    }
+
+
+
 }

+ 29 - 0
zhsw-server/src/main/java/com/rongwei/zhsw/system/controller/weChat/BillController.java

@@ -0,0 +1,29 @@
+package com.rongwei.zhsw.system.controller.weChat;
+
+import com.rongwe.zhsw.system.vo.BillListSearchVo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.zhsw.system.wechat.BillService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * BillController class
+ *
+ * @author XH
+ * @date 2025/03/14
+ */
+@RestController
+@RequestMapping("/wechat/bill")
+public class BillController {
+    private static final Logger log = LoggerFactory.getLogger(BillController.class);
+
+    @Autowired
+    private BillService billService;
+
+    @PostMapping("/list")
+    private R info(@RequestBody BillListSearchVo billListSearchVo) {
+        return billService.getBillList(billListSearchVo);
+    }
+}

+ 2 - 2
zhsw-server/src/main/resources/bootstrap-dev.yml

@@ -4,9 +4,9 @@ spring:
       config:
         file-extension: yaml
         server-addr: 127.0.0.1:8848
-        namespace: cd047569-9470-4dfb-8663-b113d01cd30f
+        namespace: 9caed6dc-3784-4d73-bd4c-a8e8153bc358
         ext-config[0]:
           data-id: common-config.yaml
       discovery:
         server-addr: 127.0.0.1:8848
-        namespace: cd047569-9470-4dfb-8663-b113d01cd30f
+        namespace: 9caed6dc-3784-4d73-bd4c-a8e8153bc358