songjiaqing 5 years ago
parent
commit
ba731d1840

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

@@ -15,4 +15,18 @@ public interface UptownUnitMapper extends BaseMapper<UptownUnit> {
 
 
     @Select("select * from sys_uptown_unit where status = 1 and uptown_id = #{uptownId}")
     @Select("select * from sys_uptown_unit where status = 1 and uptown_id = #{uptownId}")
     List<UptownUnit> getUptownUnitData(@Param("uptownId") Long uptownId);
     List<UptownUnit> getUptownUnitData(@Param("uptownId") Long uptownId);
+
+
+    List<UptownUnit> queryDongList(@Param("uptownId") Long uptownId);
+
+    List<UptownUnit> queryDanYuanList(@Param("uptownId") Long uptownId, @Param("ridgepole") Long ridgepole);
+
+    List<UptownUnit> queryMenPaiList(@Param("uptownId") Long uptownId, @Param("ridgepole") Long ridgepol, @Param("unitId") Long unitId);
+
+    List<UptownUnit> queryXiaoQuList(@Param("uptownId") Long uptownId);
+
+    List<UptownUnit> queryYiBaoList(@Param("uptownId") Long uptownId, @Param("reportDate") String reportDate);
+
+    List<UptownUnit> queryYiChangList(@Param("uptownId") Long uptownId, @Param("reportDate") String reportDate);
+
 }
 }

+ 8 - 0
whepi-web/src/main/java/com/bofeng/dao/UserRoleMapper.java

@@ -15,4 +15,12 @@ public interface UserRoleMapper extends BaseMapper<UserRole> {
 
 
     @Select("select * from sys_user_role where user_id = #{userId}")
     @Select("select * from sys_user_role where user_id = #{userId}")
     List<UserRole> getUserRoleByUserId(@Param("userId") Long userId);
     List<UserRole> getUserRoleByUserId(@Param("userId") Long userId);
+
+
+    @Select("select * from sys_user_role where user_id=#{userId} and role_id=2")
+    UserRole getUserRoleYwhByUserId(@Param("userId") Long userId);
+
+    @Select("select * from sys_user_role where user_id=#{userId} and role_id=2")
+    List<UserRole> getUserRoleYwhsByUserId(@Param("userId") Long userId);
+
 }
 }

+ 2 - 1
whepi-web/src/main/java/com/bofeng/entity/Owner.java

@@ -1,6 +1,7 @@
 package com.bofeng.entity;
 package com.bofeng.entity;
 
 
 import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
 import com.baomidou.mybatisplus.annotations.TableName;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
@@ -11,7 +12,7 @@ import org.joda.time.DateTime;
 @TableName("sys_owner")
 @TableName("sys_owner")
 public class Owner {
 public class Owner {
 
 
-    @TableField("owner_id")
+    @TableId("owner_id")
     private Long ownerId;
     private Long ownerId;
 
 
     @TableField("uptown_id")
     @TableField("uptown_id")

+ 28 - 1
whepi-web/src/main/java/com/bofeng/entity/UptownUnit.java

@@ -3,10 +3,13 @@ package com.bofeng.entity;
 import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
 import com.baomidou.mybatisplus.annotations.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 import org.joda.time.DateTime;
 import org.joda.time.DateTime;
 
 
+import java.util.Date;
+
 /**
 /**
  * 门牌信息表
  * 门牌信息表
  */
  */
@@ -19,7 +22,7 @@ public class UptownUnit {
     private Long unitId;
     private Long unitId;
 
 
     @TableField("uptown_id")
     @TableField("uptown_id")
-    private Long uptown_id;
+    private Long uptownId;
 
 
     @TableField("ridgepole")
     @TableField("ridgepole")
     private String ridgepole;
     private String ridgepole;
@@ -44,4 +47,28 @@ public class UptownUnit {
 
 
     @TableField(exist = false)
     @TableField(exist = false)
     private DateTime timeUpdate;
     private DateTime timeUpdate;
+
+    @TableField(exist = false)
+    private String uptownName;
+    @TableField(exist = false)
+    private Long houseId;
+    @TableField(exist = false)
+    private String doorplate;
+    @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date reportDate;
+    @TableField(exist = false)
+    private Integer doorplateNum;
+
+    @TableField(exist = false)
+    private Integer yiBaoNum;
+    @TableField(exist = false)
+    private Integer weiBaoNum;
+    @TableField(exist = false)
+    private Integer yiChangNum;
+    @TableField(exist = false)
+    private Integer yiChangAddNum;
+    @TableField(exist = false)
+    private Integer yiChangSubNum;
+
 }
 }

+ 98 - 16
whepi-web/src/main/java/com/bofeng/service/RiBaoService.java

@@ -2,14 +2,8 @@ package com.bofeng.service;
 
 
 
 
 import com.baomidou.mybatisplus.toolkit.IdWorker;
 import com.baomidou.mybatisplus.toolkit.IdWorker;
-import com.bofeng.dao.MsReportMapper;
-import com.bofeng.dao.MsSuspectedMapper;
-import com.bofeng.dao.UptownHouseMapper;
-import com.bofeng.dao.UptownUnitMapper;
-import com.bofeng.entity.MsReport;
-import com.bofeng.entity.MsSuspected;
-import com.bofeng.entity.UptownHouse;
-import com.bofeng.entity.UptownUnit;
+import com.bofeng.dao.*;
+import com.bofeng.entity.*;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.joda.time.DateTime;
 import org.joda.time.DateTime;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
@@ -44,6 +38,14 @@ public class RiBaoService {
     @Autowired
     @Autowired
     private UptownUnitMapper uptownUnitMapper;
     private UptownUnitMapper uptownUnitMapper;
 
 
+
+    @Autowired
+    private UserRoleMapper userRoleMapper;
+    @Autowired
+    private OwnerMapper ownerMapper;
+    @Autowired
+    private UptownMapper uptownMapper;
+
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public MsReport editRibao(Long reportId) {
     public MsReport editRibao(Long reportId) {
         DateTime dateTime = new DateTime();
         DateTime dateTime = new DateTime();
@@ -112,16 +114,13 @@ public class RiBaoService {
 
 
         //确诊
         //确诊
         trueNum = msReportMapper.selectSuspectedNum(reportId);
         trueNum = msReportMapper.selectSuspectedNum(reportId);
-
+        //疑似
+        isNoSuspected = msReportMapper.selectisNoSuspectedNum(reportId);
         //居家隔离
         //居家隔离
         singleNum = msReportMapper.selectSingleRoomNum(reportId);
         singleNum = msReportMapper.selectSingleRoomNum(reportId);
-
         //正常
         //正常
         isSuspected = msReportMapper.selectisSuspectedNum(reportId);
         isSuspected = msReportMapper.selectisSuspectedNum(reportId);
 
 
-        //疑似
-        isNoSuspected = msReportMapper.selectisNoSuspectedNum(reportId);
-
         //今日居家
         //今日居家
         List<MsSuspected> list = msSuspectedMapper.selectByReportId(reportId);
         List<MsSuspected> list = msSuspectedMapper.selectByReportId(reportId);
         if (list != null && list.size() > 0)
         if (list != null && list.size() > 0)
@@ -129,14 +128,16 @@ public class RiBaoService {
         MsReport msReport = msReportMapper.selectById(reportId);
         MsReport msReport = msReportMapper.selectById(reportId);
         if (msReport != null) {
         if (msReport != null) {
             msReport.setSureNum(trueNum);
             msReport.setSureNum(trueNum);
-            msReport.setSingleNum(singleNum);
             msReport.setSuspectedNum(isNoSuspected);
             msReport.setSuspectedNum(isNoSuspected);
             msReport.setNormalNum(isSuspected);
             msReport.setNormalNum(isSuspected);
+            msReport.setSingleNum(singleNum);
             msReport.setSafetyNum(isFamliy);
             msReport.setSafetyNum(isFamliy);
-            if (isNoSuspected > 0)
+            if (trueNum > 0 || isNoSuspected > 0 || singleNum > 0) {
                 msReport.setMsStatus(2);// 健康状态:1正常,2异常
                 msReport.setMsStatus(2);// 健康状态:1正常,2异常
-            else
+            } else {
                 msReport.setMsStatus(1);
                 msReport.setMsStatus(1);
+            }
+
             msReportMapper.updateById(msReport);
             msReportMapper.updateById(msReport);
         }
         }
     }
     }
@@ -492,5 +493,86 @@ public class RiBaoService {
 
 
         return reportId;
         return reportId;
     }
     }
+//-----------------------------------------------------------------
+
+
+    public UptownUnit getRibaoYwh(Long userId) {
+        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.queryXiaoQuList(uptownId);
+            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.queryYiBaoList(uptownId, todayStr);
+            if (null == yiBaoList) {
+                yiBaoList = new ArrayList<UptownUnit>();
+            }
+            int yiBaoNum = yiBaoList.size();
 
 
+            List<UptownUnit> yiChangList = uptownUnitMapper.queryYiChangList(uptownId, 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.queryYiChangList(uptownId, 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;
+    }
+
+    public List<UptownUnit> queryRibaoYwhDongList(Long uptownId) {
+        List<UptownUnit> dongList = uptownUnitMapper.queryDongList(uptownId);
+        return dongList;
+    }
 }
 }

+ 0 - 3
whepi-web/src/main/java/com/bofeng/wx/controller/RiBaoController.java

@@ -3,7 +3,6 @@ package com.bofeng.wx.controller;
 
 
 import com.bofeng.entity.MsReport;
 import com.bofeng.entity.MsReport;
 import com.bofeng.entity.MsSuspected;
 import com.bofeng.entity.MsSuspected;
-import com.bofeng.service.MsSuspectedService;
 import com.bofeng.service.RiBaoService;
 import com.bofeng.service.RiBaoService;
 import com.yvan.Model;
 import com.yvan.Model;
 import com.yvan.ModelOps;
 import com.yvan.ModelOps;
@@ -25,8 +24,6 @@ import java.util.List;
 public class RiBaoController {
 public class RiBaoController {
 
 
     @Autowired
     @Autowired
-    private MsSuspectedService msSuspectedService;
-    @Autowired
     private RiBaoService riBaoService;
     private RiBaoService riBaoService;
 
 
 
 

+ 320 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/RiBaoYwhController.java

@@ -0,0 +1,320 @@
+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.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 {
+
+    @Autowired
+    private QzTaskService qzTaskService;
+    @Autowired
+    private RbService rbService;
+
+    @Autowired
+    private QzTaskReplyService qzTaskReplyService;
+
+    @Autowired
+    private HomeService homeService;
+
+    @Autowired
+    private JmTuangouService jmTuangouService;
+
+    @Autowired
+    private UptownMapper uptownMapper;
+
+    @Autowired
+    private RbMapper rbMapper;
+
+
+    @Autowired
+    private RiBaoService riBaoService;
+
+    // 查询业委会日报小区及统计数据
+    @GetMapping("/ywh/getRibaoYwh")
+    public Model<UptownUnit> getRibaoYwh(@Pd(name = "userId") Long userId) {
+        return Model.newSuccess(riBaoService.getRibaoYwh(userId));
+    }
+
+
+    // 查询业委会日报小区对应栋列表
+    @GetMapping("/ywh/queryRibaoYwhDongList")
+    public Model<List<UptownUnit>> queryRibaoYwhDongList(@Pd(name = "uptownId") Long uptownId) {
+        List<UptownUnit> listSuspected = riBaoService.queryRibaoYwhDongList(uptownId);
+        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);
+    }
+
+    @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);
+    }
+
+    @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);
+    }
+
+    @PostMapping("/ywh/getAllUptown")
+    public Model<List<Uptown>> getAllUptown(HttpParameterParser parser, PageDb pageDb) {
+        return Model.newSuccess(pageDb, uptownMapper.getUptowns(pageDb, parser.getMap()));
+    }
+}

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

@@ -0,0 +1,55 @@
+<?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.bofeng.dao.UptownUnitMapper">
+    <select id="queryDongList" resultType="com.bofeng.entity.UptownUnit">
+        SELECT DISTINCT a.ridgepole, a.uptown_id, b.uptown_name FROM `sys_uptown_unit` a
+        LEFT JOIN sys_uptown b on a.uptown_id=b.uptown_id
+        <where>
+            <if test="uptownId!=null and uptownId!=''">
+                and a.uptown_id=#{uptownId}
+            </if>
+        </where>
+        order by ridgepole
+    </select>
+
+    <select id="queryDanYuanList" resultType="com.bofeng.entity.UptownUnit">
+        SELECT unit_id, uptown_id, ridgepole, unit FROM `sys_uptown_unit`
+        <where>
+            <if test="uptownId!=null and uptownId!=''">
+                and uptown_id=#{uptownId}
+            </if>
+            <if test="ridgepole!=null and ridgepole!=''">
+                and ridgepole=#{ridgepole}
+            </if>
+        </where>
+        order by unit_id
+    </select>
+
+    <select id="queryMenPaiList" 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.ridgepole=#{ridgepole} and b.unit_id=#{unitId}
+        where b.uptown_id=#{uptownId}
+        order by house_id
+    </select>
+
+    <select id="queryXiaoQuList" 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
+        where b.uptown_id=#{uptownId}
+    </select>
+
+    <select id="queryYiBaoList" 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
+        inner JOIN `ms_report` c  on a.house_id=c.house_id  and c.report_date = #{reportDate}
+        where b.uptown_id=#{uptownId}
+    </select>
+
+    <select id="queryYiChangList" 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
+        inner JOIN `ms_report` c  on a.house_id=c.house_id  and c.report_date = #{reportDate} and c.ms_status=2
+        where b.uptown_id=#{uptownId}
+    </select>
+
+</mapper>