songjiaqing 5 gadi atpakaļ
vecāks
revīzija
44f840348a

+ 6 - 0
whepi-web/src/main/java/com/bofeng/dao/UptownUnitMapper.java

@@ -23,6 +23,12 @@ public interface UptownUnitMapper extends BaseMapper<UptownUnit> {
 
     List<UptownUnit> queryMenPaiList(@Param("uptownId") Long uptownId, @Param("ridgepole") Long ridgepole, @Param("unitId") Long unitId, @Param("reportDate") String reportDate);
 
+    List<UptownUnit> queryXiaoQuList2(@Param("uptownId") Long uptownId, @Param("ridgepole") Long ridgepole, @Param("unitId") Long unitId);
+
+    List<UptownUnit> queryYiBaoList2(@Param("uptownId") Long uptownId, @Param("ridgepole") Long ridgepole, @Param("unitId") Long unitId, @Param("reportDate") String reportDate);
+
+    List<UptownUnit> queryYiChangList2(@Param("uptownId") Long uptownId, @Param("ridgepole") Long ridgepole, @Param("unitId") Long unitId, @Param("reportDate") String reportDate);
+
     List<UptownUnit> queryXiaoQuList(@Param("uptownId") Long uptownId);
 
     List<UptownUnit> queryYiBaoList(@Param("uptownId") Long uptownId, @Param("reportDate") String reportDate);

+ 203 - 43
whepi-web/src/main/java/com/bofeng/service/RiBaoService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.toolkit.IdWorker;
 import com.bofeng.dao.*;
 import com.bofeng.entity.*;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -180,25 +181,58 @@ public class RiBaoService {
             obj.setGrenderStr("女");
         }
 
-        // if (obj.getFamilyStatus().intValue() == 0) {
-        //     obj.setFamilyStatusStr("正常");
-        // } else if (obj.getFamilyStatus().intValue() == 1) {
-        //     obj.setFamilyStatusStr("心血管疾病(服用ARB)");
-        // } else if (obj.getFamilyStatus().intValue() == 2) {
-        //     obj.setFamilyStatusStr("心血管疾病(未服用ARB)");
-        // } else if (obj.getFamilyStatus().intValue() == 3) {
-        //     obj.setFamilyStatusStr("呼吸系统病史");
-        // } else if (obj.getFamilyStatus().intValue() == 4) {
-        //     obj.setFamilyStatusStr("肿瘤病史");
-        // } else if (obj.getFamilyStatus().intValue() == 5) {
-        //     obj.setFamilyStatusStr("糖尿病史");
-        // } else if (obj.getFamilyStatus().intValue() == 6) {
-        //     obj.setFamilyStatusStr("服用过激素药物");
-        // } else if (obj.getFamilyStatus().intValue() == 7) {
-        //     obj.setFamilyStatusStr("妊娠期");
-        // } else if (obj.getFamilyStatus().intValue() == 8) {
-        //     obj.setFamilyStatusStr("其他");
-        // }
+        // 基本状态:1,0,1,0,0,0,1 (0表示未选中,1表示选中)
+        StringBuffer sb = new StringBuffer();
+        String fs = obj.getFamilyStatus();
+        if (StringUtils.isNoneBlank(fs)) {
+            String[] fsArray = fs.split(",");
+            if (fsArray != null && fsArray.length > 0) {
+                for (int i = 0; i < fsArray.length; i++) {
+                    if (0 == i) {
+                        if (Integer.valueOf(fsArray[i]) == 1) {
+                            sb.append("心血管疾病(服用ARB),");
+                        }
+                    }
+                    if (1 == i) {
+                        if (Integer.valueOf(fsArray[i]) == 1) {
+                            sb.append("心血管疾病(未服用ARB),");
+                        }
+                    }
+                    if (2 == i) {
+                        if (Integer.valueOf(fsArray[i]) == 1) {
+                            sb.append("呼吸系统病史,");
+                        }
+                    }
+                    if (3 == i) {
+                        if (Integer.valueOf(fsArray[i]) == 1) {
+                            sb.append("肿瘤病史,");
+                        }
+                    }
+                    if (4 == i) {
+                        if (Integer.valueOf(fsArray[i]) == 1) {
+                            sb.append("糖尿病史,");
+                        }
+                    }
+                    if (5 == i) {
+                        if (Integer.valueOf(fsArray[i]) == 1) {
+                            sb.append("服用过激素药物,");
+                        }
+                    }
+                    if (6 == i) {
+                        if (Integer.valueOf(fsArray[i]) == 1) {
+                            sb.append("妊娠期");
+                        }
+                    }
+                }
+
+                if (sb.toString().endsWith(",")) {
+                    obj.setFamilyStatusStr(sb.toString().substring(0, sb.toString().length() - 1));
+                } else {
+                    obj.setFamilyStatusStr(sb.toString());
+                }
+            }
+        }
+
 
         if (obj.getMedical().intValue() == 0) {
             obj.setMedicalStr("否");
@@ -301,25 +335,76 @@ public class RiBaoService {
                     obj.setGrenderStr("女");
                 }
 
-                // if (obj.getFamilyStatus().intValue() == 0) {
-                //     obj.setFamilyStatusStr("正常");
-                // } else if (obj.getFamilyStatus().intValue() == 1) {
-                //     obj.setFamilyStatusStr("心血管疾病(服用ARB)");
-                // } else if (obj.getFamilyStatus().intValue() == 2) {
-                //     obj.setFamilyStatusStr("心血管疾病(未服用ARB)");
-                // } else if (obj.getFamilyStatus().intValue() == 3) {
-                //     obj.setFamilyStatusStr("呼吸系统病史");
-                // } else if (obj.getFamilyStatus().intValue() == 4) {
-                //     obj.setFamilyStatusStr("肿瘤病史");
-                // } else if (obj.getFamilyStatus().intValue() == 5) {
-                //     obj.setFamilyStatusStr("糖尿病史");
-                // } else if (obj.getFamilyStatus().intValue() == 6) {
-                //     obj.setFamilyStatusStr("服用过激素药物");
-                // } else if (obj.getFamilyStatus().intValue() == 7) {
-                //     obj.setFamilyStatusStr("妊娠期");
-                // } else if (obj.getFamilyStatus().intValue() == 8) {
-                //     obj.setFamilyStatusStr("其他");
-                // }
+//                if (obj.getFamilyStatus().intValue() == 0) {
+//                    obj.setFamilyStatusStr("正常");
+//                } else if (obj.getFamilyStatus().intValue() == 1) {
+//                    obj.setFamilyStatusStr("心血管疾病(服用ARB)");
+//                } else if (obj.getFamilyStatus().intValue() == 2) {
+//                    obj.setFamilyStatusStr("心血管疾病(未服用ARB)");
+//                } else if (obj.getFamilyStatus().intValue() == 3) {
+//                    obj.setFamilyStatusStr("呼吸系统病史");
+//                } else if (obj.getFamilyStatus().intValue() == 4) {
+//                    obj.setFamilyStatusStr("肿瘤病史");
+//                } else if (obj.getFamilyStatus().intValue() == 5) {
+//                    obj.setFamilyStatusStr("糖尿病史");
+//                } else if (obj.getFamilyStatus().intValue() == 6) {
+//                    obj.setFamilyStatusStr("服用过激素药物");
+//                } else if (obj.getFamilyStatus().intValue() == 7) {
+//                    obj.setFamilyStatusStr("妊娠期");
+//                } else if (obj.getFamilyStatus().intValue() == 8) {
+//                    obj.setFamilyStatusStr("其他");
+//                }
+                // 基本状态:1,0,1,0,0,0,1 (0表示未选中,1表示选中)
+                StringBuffer sb = new StringBuffer();
+                String fs = obj.getFamilyStatus();
+                if (StringUtils.isNoneBlank(fs)) {
+                    String[] fsArray = fs.split(",");
+                    if (fsArray != null && fsArray.length > 0) {
+                        for (int i = 0; i < fsArray.length; i++) {
+                            if (0 == i) {
+                                if (Integer.valueOf(fsArray[i]) == 1) {
+                                    sb.append("心血管疾病(服用ARB),");
+                                }
+                            }
+                            if (1 == i) {
+                                if (Integer.valueOf(fsArray[i]) == 1) {
+                                    sb.append("心血管疾病(未服用ARB),");
+                                }
+                            }
+                            if (2 == i) {
+                                if (Integer.valueOf(fsArray[i]) == 1) {
+                                    sb.append("呼吸系统病史,");
+                                }
+                            }
+                            if (3 == i) {
+                                if (Integer.valueOf(fsArray[i]) == 1) {
+                                    sb.append("肿瘤病史,");
+                                }
+                            }
+                            if (4 == i) {
+                                if (Integer.valueOf(fsArray[i]) == 1) {
+                                    sb.append("糖尿病史,");
+                                }
+                            }
+                            if (5 == i) {
+                                if (Integer.valueOf(fsArray[i]) == 1) {
+                                    sb.append("服用过激素药物,");
+                                }
+                            }
+                            if (6 == i) {
+                                if (Integer.valueOf(fsArray[i]) == 1) {
+                                    sb.append("妊娠期");
+                                }
+                            }
+                        }
+
+                        if (sb.toString().endsWith(",")) {
+                            obj.setFamilyStatusStr(sb.toString().substring(0, sb.toString().length() - 1));
+                        } else {
+                            obj.setFamilyStatusStr(sb.toString());
+                        }
+                    }
+                }
 
                 if (obj.getMedical().intValue() == 0) {
                     obj.setMedicalStr("否");
@@ -587,12 +672,12 @@ public class RiBaoService {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         String todayStr = sdf.format(today);
 
-        Calendar calendar = Calendar.getInstance();
-        calendar.setTime(today);
-        calendar.add(Calendar.DATE, -2);
-        String yestodayStr = sdf.format(calendar.getTime());
+//        Calendar calendar = Calendar.getInstance();
+//        calendar.setTime(today);
+//        calendar.add(Calendar.DATE, -2);
+//        String yestodayStr = sdf.format(calendar.getTime());
 
-        List<UptownUnit> dongList = uptownUnitMapper.queryMenPaiList(uptownId, ridgepole, unitId, yestodayStr);
+        List<UptownUnit> dongList = uptownUnitMapper.queryMenPaiList(uptownId, ridgepole, unitId, todayStr);
         if (CollectionUtils.isNotEmpty(dongList)) {
             for (UptownUnit obj : dongList) {
                 if (obj.getMsStatus() != null && obj.getMsStatus().intValue() == 1) {
@@ -610,4 +695,79 @@ public class RiBaoService {
         }
         return dongList;
     }
+
+    public UptownUnit getRibaoYwh2(Long uptownId, Long ridgepole, Long unitId) {
+        DateTime dateTime = new DateTime();
+        UptownUnit uptownUnitVo = new UptownUnit();
+        uptownUnitVo.setUptownId(0L);
+        uptownUnitVo.setUptownName("");
+        uptownUnitVo.setReportDate(dateTime.toDate());
+        uptownUnitVo.setDoorplateNum(0);
+        uptownUnitVo.setYiBaoNum(0);
+        uptownUnitVo.setWeiBaoNum(0);
+        uptownUnitVo.setYiChangNum(0);
+        uptownUnitVo.setYiChangAddNum(0);
+        uptownUnitVo.setYiChangSubNum(0);
+
+//        List<UserRole> userRoles = userRoleMapper.getUserRoleYwhsByUserId(userId);
+//        Long ownerId = userRoles.get(0).getPropertyId();
+//        Owner owner = ownerMapper.selectById(ownerId);
+//        Uptown uptown = uptownMapper.selectById(owner.getUptownId());
+//        Long uptownId = uptown.getUptownId();
+
+        List<UptownUnit> dongList = uptownUnitMapper.queryDongList(uptownId);
+        if (CollectionUtils.isNotEmpty(dongList)) {
+
+            List<UptownUnit> xiaoQuList = uptownUnitMapper.queryXiaoQuList2(uptownId, ridgepole, unitId);
+            if (null == xiaoQuList) {
+                xiaoQuList = new ArrayList<UptownUnit>();
+            }
+            int doorplateNum = xiaoQuList.size();
+
+            Date today = new Date();
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            String todayStr = sdf.format(today);
+            List<UptownUnit> yiBaoList = uptownUnitMapper.queryYiBaoList2(uptownId, ridgepole, unitId, todayStr);
+            if (null == yiBaoList) {
+                yiBaoList = new ArrayList<UptownUnit>();
+            }
+            int yiBaoNum = yiBaoList.size();
+
+            List<UptownUnit> yiChangList = uptownUnitMapper.queryYiChangList2(uptownId, ridgepole, unitId, todayStr);
+            if (null == yiChangList) {
+                yiChangList = new ArrayList<UptownUnit>();
+            }
+            int yiChangNum = yiChangList.size();
+//            System.out.println("yiChangNum================>>" + yiChangNum);
+
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(today);
+            calendar.add(Calendar.DATE, -1);
+            String yestodayStr = sdf.format(calendar.getTime());
+            List<UptownUnit> yiChangYestodayList = uptownUnitMapper.queryYiChangList2(uptownId, ridgepole, unitId, yestodayStr);
+            if (null == yiChangList) {
+                yiChangYestodayList = new ArrayList<UptownUnit>();
+            }
+            int yiChangYestodayNum = yiChangYestodayList.size();
+//            System.out.println("yiChangYestodayNum================>>" + yiChangYestodayNum);
+
+            UptownUnit uptownUnitDb = dongList.get(0);
+            uptownUnitVo.setUptownId(uptownUnitDb.getUptownId());// 小区id
+            uptownUnitVo.setUptownName(uptownUnitDb.getUptownName());// 小区名称
+            uptownUnitVo.setReportDate(dateTime.toDate());// 日报日期
+            uptownUnitVo.setDoorplateNum(doorplateNum);// 户数
+
+            uptownUnitVo.setYiBaoNum(yiBaoNum);// 已报数
+            uptownUnitVo.setWeiBaoNum(doorplateNum - yiBaoNum);// 未报数
+            uptownUnitVo.setYiChangNum(yiChangNum);// 异常数
+            if (yiChangNum - yiChangYestodayNum > 0) {
+                uptownUnitVo.setYiChangAddNum(yiChangNum - yiChangYestodayNum);// 异常新增数
+            }
+            if (yiBaoNum > 0 && yiChangYestodayNum - yiChangNum > 0) {
+                uptownUnitVo.setYiChangSubNum(yiChangYestodayNum - yiChangNum);// 异常减少数
+            }
+        }
+
+        return uptownUnitVo;
+    }
 }

+ 19 - 259
whepi-web/src/main/java/com/bofeng/wx/controller/RiBaoYwhController.java

@@ -2,33 +2,17 @@ package com.bofeng.wx.controller;
 
 import com.bofeng.dao.RbMapper;
 import com.bofeng.dao.UptownMapper;
-import com.bofeng.entity.*;
-import com.bofeng.excel.ExcelUtils;
+import com.bofeng.entity.MsReport;
+import com.bofeng.entity.MsSuspected;
+import com.bofeng.entity.UptownUnit;
 import com.bofeng.service.*;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
 import com.yvan.Model;
-import com.yvan.ModelOps;
-import com.yvan.PageDb;
 import com.yvan.mvc.Pd;
-import com.yvan.platform.Conv;
-import com.yvan.platform.JsonWapper;
-import com.yvan.platform.YvanUtil;
-import com.yvan.springmvc.HttpParameterParser;
-import io.swagger.annotations.ApiOperation;
-import lombok.SneakyThrows;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
 
-import javax.servlet.http.HttpServletResponse;
 import java.util.List;
-import java.util.Map;
 
 @RestController
 public class RiBaoYwhController {
@@ -88,250 +72,26 @@ public class RiBaoYwhController {
         return Model.newSuccess(listSuspected);
     }
 
-
-    @GetMapping("/ywh/home.html")
-    public ModelAndView yeweihui(ModelMap model, @RequestParam(value = "userId") Long userId, @RequestParam(value = "show", required = false, defaultValue = "-") String show) {
-
-//        List<QzTask> taskList = qzTaskService.selectAll(1225321682867105793L);
-//        List<sysUptownUnit> rbList = rbService.selectAll(1225321682867105793L);
-        List<QzTask> taskList = qzTaskService.selectAll(userId);
-        List<sysUptownUnit> rbList = rbService.selectAll(userId);
-        model.put("taskList", YvanUtil.toJsonPretty(taskList));
-        model.put("rbList", YvanUtil.toJsonPretty(rbList));
-        model.put("user_id", "\"" + userId + "\"");
-        model.put("show", "\"" + show + "\"");
-
-        return new ModelAndView("/yeweihui/home.ftl", model);
-    }
-
-    @GetMapping("/ywh/qiuzhuDetail.html")
-    public ModelAndView qiuzhudetail(@Pd(name = "taskId") Long taskId, @Pd(name = "userId") Long userId, ModelMap model) throws JsonProcessingException {
-
-        QzTask task = qzTaskService.queryByTaskId(taskId);
-//        A业委会,B居委会,C物业,D志愿者
-        StringBuffer target = new StringBuffer();
-        if (task.getTaskTarget().equals("A")) {
-            target.append("业委会");
-        } else if (task.getTaskTarget().equals("B")) {
-            if (target.length() > 0) {
-                target.append("、居委会");
-            } else {
-                target.append("居委会");
-            }
-        } else if (task.getTaskTarget().equals("C")) {
-            if (target.length() > 0) {
-                target.append("、物业");
-            } else {
-                target.append("物业");
-            }
-        } else if (task.getTaskTarget().equals("D")) {
-            if (target.length() > 0) {
-                target.append("、志愿者");
-            } else {
-                target.append("志愿者");
-            }
-        }
-
-        task.setTaskTarget(target.toString());
-
-        model.put("taskJson", new JsonWapper(task));
-        model.put("task", task);
-        model.put("userId", "\"" + userId + "\"");
-
-        return new ModelAndView("/yeweihui/qiuzhuDetail.ftl", model);
-    }
-
-    @PostMapping("/ywh/qiuzhu/queryTasksByStatus.json")
-    public Model queryTasksByStatus(@Pd(name = "status") Integer status) {
-
-        List<QzTask> taskList = qzTaskService.queryQzTaskByStatus(status);
-
-        return Model.newSuccess(taskList);
-    }
-
-    @PostMapping("/ywh/qiuzhu/reply/add.json")
-    public ModelOps replyQiuzhuInsert(QzTaskReply qzTaskReply) {
-
-        Integer success = qzTaskReplyService.insertQzTaskReply(qzTaskReply);
-
-        if (success > 0) {
-            return ModelOps.newSuccess();
-        } else {
-            return ModelOps.newFail("操作失败");
-        }
-    }
-
-    @PostMapping("/ywh/qiuzhu/reply/querybytaskid.json")
-    public Model replyQiuzhuQueryByTaskId(@Pd(name = "taskId") Long taskId) {
-
-        List<QzTaskReply> reply = qzTaskReplyService.queryQzTaskReplyByTaskId(taskId);
-
-        return Model.newSuccess(reply);
-    }
-
-    @PostMapping("/ywh/qiuzhu/list.json")
-    public Model queryByHouseNumber(String houseNumber, @Pd(name = "status") Integer status) {
-
-        if (houseNumber.length() <= 0) {
-            return Model.newSuccess(qzTaskService.queryQzTaskByStatus(status));
-        }
-
-        List<QzTask> list = qzTaskService.queryByHouseNumber(houseNumber, status);
-
-        return Model.newSuccess(list);
-    }
-
-    @GetMapping("/ywh/ribao.html")
-    public ModelAndView yeweihuiRibao(ModelMap model) {
-
-//        List<QzTask> taskList = qzTaskService.selectAll();
-//
-//        model.put("taskList", YvanUtil.toJsonPretty(taskList));
-
-        return new ModelAndView("/yeweihui/ribao.ftl", model);
-    }
-
-    @GetMapping("/ywh/ribaoDy")
-    public Model<List<SysUptownHouse>> yeweihuiRibaoDy(Long str) {
-//        String[] split = str.split("&");
-        List<SysUptownHouse> rbList = rbService.selectXq(str);
-
-        return Model.newSuccess(rbList);
+    //查询业委会日报 根据queryMenPaiList获取日报id作为参数传递给此接口
+    @GetMapping("/ywh/getRibao")
+    public Model<MsReport> getRibao(@Pd(name = "reportId") Long reportId) {
+        MsReport msReport = riBaoService.getRibao(reportId);
+        return Model.newSuccess(msReport);
     }
 
-    @GetMapping("/ywh/ribaoXq.html")
-    public ModelAndView yeweihuiRibaoYcXq(ModelMap model) {
-        Map<String, Object> queryParam = Maps.newLinkedHashMap();
-        queryParam.put("userId", "12345677");
-        queryParam.put("statistics", "M");
-        return new ModelAndView("/yeweihui/ribaoXq.ftl", model);
-    }
-
-    @GetMapping("/ywh/ribaoDyYcXq")
-    public Model<List<MsSuspected>> yeweihuiRibaoYcXq(Long houseId) {
-        List<MsSuspected> rbList = rbService.selectYcXq(houseId);
-        return Model.newSuccess(rbList);
-    }
-
-    @GetMapping("/ywh/ribaohuiz.html")
-    public ModelAndView yeweihuiRibaohuiz(ModelMap model) {
-        return new ModelAndView("/yeweihui/ribaohuiz.ftl", model);
-    }
-
-    @GetMapping("/ywh/yeweihui/ribaohuiz")
-    public Model<Map<String, Object>> yeweihuiRibaohuiz(Long userCreate, String reportDate) {
-//        Long userCreate = 1225321682867105793L;
-
-        List<Uptown> uptowns = rbMapper.selectUptown(userCreate);
-
-        if (uptowns != null && uptowns.size() > 0) {
-            Long upId = uptowns.get(0).getUptownId();
-            Map<String, Integer> map1 = rbMapper.selecthuiz(upId, reportDate);
-            Map<String, Integer> map2 = rbMapper.selectyicahng(upId, reportDate);
-            Map<String, Integer> map3 = rbMapper.selecthuiz1(upId);
-
-            Map<String, Object> reMap = Maps.newHashMap();
-            reMap.put("uptownName", uptowns.get(0).getUptownName());
-            List<Integer> nums = Lists.newArrayList();
-            nums.add(Conv.NI(map3.get("houseCount")));
-            nums.add(Conv.NI(map1.get("reportCount")));
-            nums.add(Conv.NI(map2.get("yichangCount")));
-            nums.add(Conv.NI(map1.get("safetyNum")));
-            nums.add(Conv.NI(map1.get("suspectedNum")));
-            reMap.put("nums", nums);
-            return Model.newSuccess(reMap);
-        }
-        return Model.newFail("没有数据");
-
-    }
-
-    @ApiOperation("导出正常家庭上报明细")
-    @GetMapping("/ywh/yeweihui/exportRiBao")
-    @SneakyThrows
-    public void exportRiBao(@Pd(name = "uptownId") Long uptownId,
-                            @Pd(name = "date") String date,
-                            HttpServletResponse resp) {
-
-        Uptown uptown = uptownMapper.selectById(uptownId);
-        if (uptown != null && uptown.getUptownId() > 0) {
-            Long upId = uptown.getUptownId();
-            String fileName = uptown.getUptownName();
-            fileName += "上报信息-";
-            fileName += date;
-            List<ExcelRiBao> list = rbMapper.selectExcelRiBao(upId, date);
-            ExcelUtils.writeSheet(ExcelRiBao.class, list).export(resp, fileName);
-        }
-    }
-
-    @ApiOperation("导出凌云家庭上报明细")
-    @GetMapping("/ywh/lun/exportRiBao")
-    @SneakyThrows
-    public void lunExportRiBao(@Pd(name = "date") String date,
-                               HttpServletResponse resp) {
-
-        Uptown uptown = uptownMapper.selectById("1238790987234");
-        Long upId = uptown.getUptownId();
-        String fileName = uptown.getUptownName();
-        fileName += "上报信息-";
-        fileName += date;
-        List<ExcelRiBaoLY> list = rbMapper.selectExcelRiBaoLY(upId, date);
-        ExcelUtils.writeSheet(ExcelRiBaoLY.class, list).export(resp, fileName);
-
-    }
-
-    @ApiOperation("导出小区家庭上报明细")
-    @GetMapping("/ywh/yeweihui/EXR")
-    @SneakyThrows
-    public void exportRiBaoByXiaoQu(@Pd(name = "uptownId") Long uptownId,
-                                    @Pd(name = "date") String date,
-                                    HttpServletResponse resp) {
-        Uptown uptown = uptownMapper.selectById(uptownId);
-        if (uptown != null && uptown.getUptownId() > 0) {
-            Long upId = uptown.getUptownId();
-            String fileName = uptown.getUptownName();
-            fileName += "上报信息-";
-            fileName += date;
-            List<ExcelRiBaoPrivate> list = rbMapper.selectExcelRiBaoPrivate(upId, date);
-            ExcelUtils.writeSheet(ExcelRiBaoPrivate.class, list).export(resp, fileName);
-        }
-    }
-
-    @GetMapping("/ywh/tgPublish.html")
-    public ModelAndView tgPublish(@Pd(name = "userId") Long userId, ModelMap model) throws JsonProcessingException {
-        model.put("userId", "\"" + userId + "\"");
-
-        return new ModelAndView("/yeweihui/tgPublish.ftl", model);
-    }
-
-    @PostMapping("/ywh/tgPublish.json")
-    public Model tuangouPublish(JmTuangou jmTuangou) {
-
-        Integer success = jmTuangouService.tuangouPublish(jmTuangou);
-        if (success == 1) {
-            return Model.newSuccess("操作成功");
-        } else {
-            return Model.newFail("操作失败");
-        }
-    }
-
-    @PostMapping("/ywh/tuangou/list/query.json")
-    public Model queryTuangouListByTitle(@Pd(name = "userId") Long userId, @Pd(name = "title", required = false) String title) {
-
-        List<JmTuangou> list = jmTuangouService.queryTuangouListByTitle(userId, title);
-
-        return Model.newSuccess(list);
+    // 查询业委会日报关联的家人列表  根据queryMenPaiList获取日报id作为参数传递给此接口
+    @GetMapping("/ywh/queryRibaoDetailList")
+    public Model<List<MsSuspected>> queryRibaoDetailList(@Pd(name = "reportId") Long reportId) {
+        List<MsSuspected> listSuspected = riBaoService.queryRibaoDetailList(reportId);
+        return Model.newSuccess(listSuspected);
     }
 
-    @PostMapping("/ywh/tuangou/mylist/query.json")
-    public Model queryTuangouMyListByTitle(@Pd(name = "userId") Long userId, @Pd(name = "title", required = false) String title) {
-
-        List<JmTuangou> myList = jmTuangouService.queryTuangouMyListByTitle(userId, title);
-
-        return Model.newSuccess(myList);
+    // 查询业委会日报某一栋某一单元小区及统计数据
+    @GetMapping("/ywh/getRibaoYwh2")
+    public Model<UptownUnit> getRibaoYwh2(@Pd(name = "uptownId") Long uptownId,
+                                          @Pd(name = "ridgepole") Long ridgepole,
+                                          @Pd(name = "unitId") Long unitId) {
+        return Model.newSuccess(riBaoService.getRibaoYwh2(uptownId, ridgepole, unitId));
     }
 
-    @PostMapping("/ywh/getAllUptown")
-    public Model<List<Uptown>> getAllUptown(HttpParameterParser parser, PageDb pageDb) {
-        return Model.newSuccess(pageDb, uptownMapper.getUptowns(pageDb, parser.getMap()));
-    }
 }

+ 20 - 0
whepi-web/src/main/resources/mapper/UptownUnitMapper.xml

@@ -55,4 +55,24 @@
         where b.uptown_id=#{uptownId}
     </select>
 
+
+    <select id="queryXiaoQuList2" resultType="com.bofeng.entity.UptownUnit">
+        SELECT a.house_id, a.doorplate, a.unit_id,b.unit, b.ridgepole,b.uptown_id FROM `sys_uptown_house` a
+        inner JOIN `sys_uptown_unit` b  on a.unit_id=b.unit_id and b.uptown_id=#{uptownId} and b.ridgepole =#{ridgepole}
+        where  a.unit_id=#{unitId}
+    </select>
+
+    <select id="queryYiBaoList2" resultType="com.bofeng.entity.UptownUnit">
+        SELECT a.house_id, a.doorplate, a.unit_id,b.unit, b.ridgepole,b.uptown_id,c.report_date, c.ms_status FROM `sys_uptown_house` a
+        inner JOIN `sys_uptown_unit` b  on a.unit_id=b.unit_id and b.uptown_id=#{uptownId} and b.ridgepole =#{ridgepole}
+        inner JOIN `ms_report` c  on a.house_id=c.house_id  and c.report_date = #{reportDate}
+        where a.unit_id=#{unitId}
+    </select>
+
+    <select id="queryYiChangList2" resultType="com.bofeng.entity.UptownUnit">
+        SELECT a.house_id, a.doorplate, a.unit_id,b.unit, b.ridgepole,b.uptown_id,c.report_date, c.ms_status FROM `sys_uptown_house` a
+        inner JOIN `sys_uptown_unit` b  on a.unit_id=b.unit_id and b.uptown_id=#{uptownId} and b.ridgepole =#{ridgepole}
+        inner JOIN `ms_report` c  on a.house_id=c.house_id  and c.report_date = #{reportDate} and c.ms_status=2
+        where a.unit_id=#{unitId}
+    </select>
 </mapper>