|
@@ -6,7 +6,9 @@ import com.bofeng.dao.MsReportMapper;
|
|
import com.bofeng.dao.MsSuspectedMapper;
|
|
import com.bofeng.dao.MsSuspectedMapper;
|
|
import com.bofeng.entity.MsReport;
|
|
import com.bofeng.entity.MsReport;
|
|
import com.bofeng.entity.MsSuspected;
|
|
import com.bofeng.entity.MsSuspected;
|
|
|
|
+import com.bofeng.entity.MsTripDet;
|
|
import com.bofeng.entity.UserOpen;
|
|
import com.bofeng.entity.UserOpen;
|
|
|
|
+import org.apache.commons.lang3.tuple.Triple;
|
|
import org.joda.time.DateTime;
|
|
import org.joda.time.DateTime;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -37,7 +39,27 @@ public class MsReportService {
|
|
private MsSuspectedService msSuspectedService;
|
|
private MsSuspectedService msSuspectedService;
|
|
|
|
|
|
public List<MsSuspected> getByReportId(Long reportId) {
|
|
public List<MsSuspected> getByReportId(Long reportId) {
|
|
- return msSuspectedMapper.selectByReportId(reportId);
|
|
|
|
|
|
+ List<MsSuspected> listSuspected = null;
|
|
|
|
+ listSuspected=msSuspectedMapper.selectByReportId(reportId);
|
|
|
|
+ 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.getEndLocalOther()) + ",";
|
|
|
|
+ tripDet += "目的地:" + getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
|
|
|
|
+ tripDet += "出行方式:" + getTripType(msTripDet.getTripType()) + ",";
|
|
|
|
+ tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
|
|
|
|
+ }
|
|
|
|
+ msSuspected.setTripDet(tripDet.substring(0, tripDet.length() - 1));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return listSuspected ;
|
|
}
|
|
}
|
|
|
|
|
|
public MsReport getByReport(Long reportId) {
|
|
public MsReport getByReport(Long reportId) {
|
|
@@ -46,15 +68,58 @@ public class MsReportService {
|
|
|
|
|
|
//获取前一天数据
|
|
//获取前一天数据
|
|
public List<MsSuspected> getByReportReportDate(String reportDate, Long userCreate) {
|
|
public List<MsSuspected> getByReportReportDate(String reportDate, Long userCreate) {
|
|
-
|
|
|
|
List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
|
|
List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
|
|
List<MsSuspected> listSuspected = null;
|
|
List<MsSuspected> listSuspected = null;
|
|
if (listReport != null && listReport.size() > 0) {
|
|
if (listReport != null && listReport.size() > 0) {
|
|
listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
|
|
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.getEndLocalOther()) + ",";
|
|
|
|
+ tripDet += "目的地:" + getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
|
|
|
|
+ tripDet += "出行方式:" + getTripType(msTripDet.getTripType()) + ",";
|
|
|
|
+ tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
|
|
|
|
+ }
|
|
|
|
+ msSuspected.setTripDet(tripDet.substring(0, tripDet.length() - 1));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return listSuspected;
|
|
return listSuspected;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public String getLocalOther(Integer local, String localOther) {
|
|
|
|
+ String localDet = "";
|
|
|
|
+ if (local == 1) {
|
|
|
|
+ localDet = "武汉";
|
|
|
|
+ } else if (local == 2)
|
|
|
|
+ localDet = "宜昌";
|
|
|
|
+ else if (local == 3)
|
|
|
|
+ localDet = "当阳";
|
|
|
|
+ else if (local == 4)
|
|
|
|
+ localDet = localOther;
|
|
|
|
+ return localDet;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getTripType(Integer tripType) {
|
|
|
|
+ String tripTypeDet = "";
|
|
|
|
+ if (tripType == 1) {
|
|
|
|
+ tripTypeDet = "长途汽车";
|
|
|
|
+ } else if (tripType == 2)
|
|
|
|
+ tripTypeDet = "火车";
|
|
|
|
+ else if (tripType == 3)
|
|
|
|
+ tripTypeDet = "飞机";
|
|
|
|
+ else if (tripType == 4)
|
|
|
|
+ tripTypeDet = "自驾";
|
|
|
|
+ return tripTypeDet;
|
|
|
|
+ }
|
|
|
|
+
|
|
//获取今天数据
|
|
//获取今天数据
|
|
public MsReport getReportByDateNow(Long userCreate) {
|
|
public MsReport getReportByDateNow(Long userCreate) {
|
|
//根据昨天的获取今天的
|
|
//根据昨天的获取今天的
|
|
@@ -292,7 +357,7 @@ public class MsReportService {
|
|
msReport1.setUserUpdate(count);
|
|
msReport1.setUserUpdate(count);
|
|
msReport1.setTimeUpdate(DateTime.now());
|
|
msReport1.setTimeUpdate(DateTime.now());
|
|
count += msReportMapper.insert(msReport1);
|
|
count += msReportMapper.insert(msReport1);
|
|
- if (count> 250) {
|
|
|
|
|
|
+ if (count > 250) {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|