Browse Source

xielianghe

lange 5 years ago
parent
commit
125876e498

+ 1 - 0
whepi-web/src/main/java/com/bofeng/dao/MsReportMapper.java

@@ -21,6 +21,7 @@ import java.util.List;
 public interface MsReportMapper extends BaseMapper<MsReport> {
 
     List<MsReport> selectByReportDate(@Param("reportDate") String reportDate, @Param("userCreate") Long userCreate);
+    List<MsReport> selectByReportDateStatus(@Param("reportDate") String reportDate, @Param("userCreate") Long userCreate);
 
     @Select("select * from ms_report where report_date<curdate()  and user_create=#{userCreate} ORDER BY report_date desc LIMIT 1")
     List<MsReport> getNowByYesterdayDate(@Param("userCreate") Long userCreate);

+ 28 - 0
whepi-web/src/main/java/com/bofeng/service/MsReportService.java

@@ -95,6 +95,34 @@ public class MsReportService {
         return listSuspected;
     }
 
+    //获取日历前一天数据
+    public List<MsSuspected> getByReportReportDateStatus(String reportDate, Long userCreate) {
+        List<MsReport> listReport = msReportMapper.selectByReportDateStatus(reportDate, userCreate);
+        List<MsSuspected> listSuspected = null;
+        if (listReport != null && listReport.size() > 0) {
+            listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
+            if (listSuspected != null && listSuspected.size() > 0) {
+                String tripDet;
+                for (MsSuspected msSuspected : listSuspected) {
+                    tripDet = "";
+                    //出行详细
+                    List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(msSuspected.getSuspectedId());
+                    if (listDet != null && listDet.size() > 0) {
+                        for (MsTripDet msTripDet : listDet) {
+                            tripDet += "出发地:" + getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
+                            tripDet += "目的地:" + getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
+                            tripDet += "出行方式:" + getTripType(msTripDet.getTripType()) + ",";
+                            tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
+                        }
+                        msSuspected.setTripDet(tripDet.substring(0, tripDet.length() - 1));
+                    }
+                }
+
+            }
+        }
+        return listSuspected;
+    }
+
     public String getLocalOther(Integer local, String localOther) {
         String localDet = "";
         if (local == 1) {

+ 2 - 2
whepi-web/src/main/java/com/bofeng/wx/controller/MsReportController.java

@@ -121,7 +121,7 @@ public class MsReportController {
             return Model.newSuccess(list);
             //获取用户最新的记录
         else {
-           // return Model.newSuccess(msSuspectedService.selectNextSuspected(userCreate));
+            // return Model.newSuccess(msSuspectedService.selectNextSuspected(userCreate));
             return null;
         }
     }
@@ -150,7 +150,7 @@ public class MsReportController {
     //根据日期获取家人
     @GetMapping("/home/home/queryRibaoReportDate")
     public Model<List<MsSuspected>> queryRibaoReportDate(@Pd(name = "reportDate") String reportDate, @Pd(name = "userCreate") Long userCreate) {
-        return Model.newSuccess(msReportService.getByReportReportDate(reportDate, userCreate));
+        return Model.newSuccess(msReportService.getByReportReportDateStatus(reportDate, userCreate));
     }
 
     //通过昨天数据更新今天数据

+ 4 - 0
whepi-web/src/main/resources/mapper/MsReport.xml

@@ -5,4 +5,8 @@
         select * from ms_report where report_date = #{reportDate} and  user_create = #{userCreate}
         order by report_date desc
     </select>
+    <select id="selectByReportDateStatus" resultType="com.bofeng.entity.MsReport">
+        select * from ms_report where report_date = #{reportDate} and  user_create = #{userCreate} and report_status=1
+        order by report_date desc
+    </select>
 </mapper>