Forráskód Böngészése

feature 校验手机号的问题

xiahan 4 hónapja
szülő
commit
53f2db04bc

+ 15 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/service/WaterWorksService.java

@@ -0,0 +1,15 @@
+package com.rongwei.zhsw.system.service;
+
+import com.rongwei.rwcommon.base.R;
+
+import java.util.Map;
+
+/**
+ * WaterWorksService class
+ *
+ * @author XH
+ * @date 2025/04/03
+ */
+public interface WaterWorksService {
+    R getList(Map<String,String> dsKey);
+}

+ 69 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/service/impl/WaterWorksServiceImpl.java

@@ -0,0 +1,69 @@
+package com.rongwei.zhsw.system.service.impl;
+
+import com.rongwe.zhsw.system.domain.SwBusinesshallDo;
+import com.rongwe.zhsw.system.domain.SwEnterpriseConfigInfoDo;
+import com.rongwe.zhsw.system.vo.WeChatPickerVo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommonentity.commonservers.domain.TenantDo;
+import com.rongwei.zhsw.system.dao.CommonBusinessDao;
+import com.rongwei.zhsw.system.dao.SwNotificationAnnouncementDao;
+import com.rongwei.zhsw.system.service.WaterWorksService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * WaterWorksServiceImpl class
+ *
+ * @author XH
+ * @date 2025/04/03
+ */
+@Service
+public class WaterWorksServiceImpl implements WaterWorksService {
+    private static final Logger log = LoggerFactory.getLogger(WaterWorksServiceImpl.class);
+    @Autowired
+    private SwBusinesshallServiceImpl swBusinesshallService;
+    @Autowired
+    private SwEnterpriseConfigInfoServiceImpl swEnterpriseConfigInfoService;
+    @Autowired
+    private SwNotificationAnnouncementDao swNotificationAnnouncementDao;
+    @Autowired
+    private CommonBusinessDao commonBusinessDao;
+
+    @Override
+    public R getList(Map<String,String> dsKey) {
+        // 设置水务公司数据字典
+        List<TenantDo> tenantDos = commonBusinessDao.getByDsKey(dsKey.getOrDefault("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());
+        return R.ok(waterCompanys);
+    }
+}

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

@@ -50,12 +50,7 @@ public class WeChatLoginServiceImpl implements WeChatLoginService {
     private SwUserManagementServiceImpl swUserManagementService;
     @Autowired
     private WeChatAboutApiPara autoWeChatAboutApiPara;
-    @Autowired
-    private SwBusinesshallServiceImpl swBusinesshallService;
-    @Autowired
-    private SwEnterpriseConfigInfoServiceImpl swEnterpriseConfigInfoService;
-    @Autowired
-    private SwNotificationAnnouncementDao swNotificationAnnouncementDao;
+
 
 
 
@@ -94,38 +89,6 @@ public class WeChatLoginServiceImpl implements WeChatLoginService {
         }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<SwNotificationAnnouncementDo> swNotificationAnnouncementDos = swNotificationAnnouncementDao.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()));
-                    // weChatPickerVo.setNotifications(swNotificationAnnouncementDos.stream()
-                    //         .filter(sw->data.getDskey().equals(sw.getRoption()))
-                    //         .collect(Collectors.toList()));
-                    return weChatPickerVo;
-                }).collect(Collectors.toList());
-        login.setWaterCompany(waterCompanys);
         return R.ok(login);
     }
 

+ 34 - 0
zhsw-server/src/main/java/com/rongwei/zhsw/system/controller/weChat/WaterWorksController.java

@@ -0,0 +1,34 @@
+package com.rongwei.zhsw.system.controller.weChat;
+
+import com.rongwe.zhsw.system.vo.WeChatRepairReportVo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.zhsw.system.service.WaterWorksService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+/**
+ * WaterWorksController class
+ *
+ * @author XH
+ * @date 2025/04/03
+ */
+@RestController
+@RequestMapping("/water")
+public class WaterWorksController {
+
+    private static final Logger log = LoggerFactory.getLogger(BillController.class);
+
+    @Autowired
+    private WaterWorksService waterWorksService;
+
+
+    @PostMapping("/list")
+    private R getlist(@RequestBody Map<String,String> dsKey) {
+        return waterWorksService.getList(dsKey);
+    }
+
+}