|
@@ -208,7 +208,7 @@ public class MsReportService {
|
|
|
//上一天的上报记录.3天内
|
|
|
List<MsSuspected> listSuspected1 = msSuspectedMapper.selectNext3Suspected(userCreate);
|
|
|
if (listSuspected1 != null && listSuspected1.size() == 1) {
|
|
|
- if (listSuspected1.get(0).getTodayLocal() != 0 && msSuspected.getTodayLocal() != 0) {
|
|
|
+ if (listSuspected1.get(0).getTodayLocal() != null && msSuspected.getTodayLocal() != null && msSuspected.getIsTrip() != null && listSuspected1.get(0).getTodayLocal() != 0 && msSuspected.getTodayLocal() != 0) {
|
|
|
if (listSuspected1.get(0).getTodayLocalOther() != msSuspected.getTodayLocalOther() && listSuspected1.get(0).getTodayLocal() != msSuspected.getTodayLocal() && msSuspected.getIsTrip() == 0) {
|
|
|
return 4;
|
|
|
}
|
|
@@ -230,6 +230,32 @@ public class MsReportService {
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+ //ly修改上报
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
+ public Integer addReportLy(Long reportId, Long suspectedId, Long userCreate) {
|
|
|
+ //如果是凌云,判断出行是否填写异常
|
|
|
+ MsTrip msTrip = msTripMapper.selectById(suspectedId);
|
|
|
+ if (msTrip != null) {
|
|
|
+ //上一天的上报记录.3天内
|
|
|
+ List<MsSuspected> listSuspected1 = msSuspectedMapper.selectNext3Suspected(userCreate);
|
|
|
+ if (listSuspected1 != null && listSuspected1.size() == 1) {
|
|
|
+ if (listSuspected1.get(0).getTodayLocal() != null && msTrip.getTodayLocal() != null && msTrip.getIsTrip() != null && listSuspected1.get(0).getTodayLocal() != 0 && msTrip.getTodayLocal() != 0) {
|
|
|
+ if (listSuspected1.get(0).getTodayLocalOther() != msTrip.getTodayLocalOther() && listSuspected1.get(0).getTodayLocal() != msTrip.getTodayLocal() && msTrip.getIsTrip() == 0) {
|
|
|
+ return 4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ MsReport msReport = msReportMapper.selectById(reportId);
|
|
|
+ if (msReport != null) {
|
|
|
+ msReport.setReportStatus(1);
|
|
|
+ msReport.setUserUpdate(userCreate);
|
|
|
+ msReport.setTimeUpdate(DateTime.now());
|
|
|
+ msReportMapper.updateById(msReport);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
//通过昨天数据更新今天数据
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public void getNowByYesterday(Long userCreate) {
|
|
@@ -511,7 +537,7 @@ public class MsReportService {
|
|
|
//添加行程
|
|
|
MsTrip msTrip = new MsTrip();
|
|
|
msTrip.setTripId(msSuspected1.getSuspectedId());
|
|
|
- msTrip.setIsTrip(msSuspected.getIsTrip());
|
|
|
+ msTrip.setIsTrip(0);
|
|
|
msTrip.setTodayLocal(msSuspected.getTodayLocal());
|
|
|
msTrip.setTodayLocalOther(msSuspected.getTodayLocalOther());
|
|
|
msTrip.setWorkLocal(msSuspected.getWorkLocal());
|
|
@@ -519,27 +545,26 @@ public class MsReportService {
|
|
|
msTripMapper.insert(msTrip);
|
|
|
|
|
|
//添加出行详细
|
|
|
- List<MsTripDet> listTripDet = msSuspectedMapper.selectTripSuspected(msSuspected.getSuspectedId());
|
|
|
- if (listTripDet != null && listTripDet.size() > 0) {
|
|
|
- for (MsTripDet msTripDet : listTripDet) {
|
|
|
- MsTripDet msTripDet1 = new MsTripDet();
|
|
|
- msTripDet1.setTripDetId(IdWorker.getId());
|
|
|
- msTripDet1.setTripId(msSuspected1.getSuspectedId());
|
|
|
- msTripDet1.setSort(msTripDet.getSort());
|
|
|
- msTripDet1.setStartLocal(msTripDet.getStartLocal());
|
|
|
- msTripDet1.setStartLocalOther(msTripDet.getStartLocalOther());
|
|
|
- msTripDet1.setEndLocal(msTripDet.getEndLocal());
|
|
|
- msTripDet1.setEndLocalOther(msTripDet.getEndLocalOther());
|
|
|
- msTripDet1.setTripType(msTripDet.getTripType());
|
|
|
- msTripDet1.setTripTypeDesp(msTripDet.getTripTypeDesp());
|
|
|
- msTripDet1.setTimeCreate(DateTime.now());
|
|
|
- msTripDet1.setUserCreate(userCreate);
|
|
|
- msTripDet1.setTimeUpdate(DateTime.now());
|
|
|
- msTripDet1.setUserUpdate(userCreate);
|
|
|
- msTripDetMapper.insert(msTripDet1);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ // List<MsTripDet> listTripDet = msSuspectedMapper.selectTripSuspected(msSuspected.getSuspectedId());
|
|
|
+ // if (listTripDet != null && listTripDet.size() > 0) {
|
|
|
+ // for (MsTripDet msTripDet : listTripDet) {
|
|
|
+ // MsTripDet msTripDet1 = new MsTripDet();
|
|
|
+ // msTripDet1.setTripDetId(IdWorker.getId());
|
|
|
+ // msTripDet1.setTripId(msSuspected1.getSuspectedId());
|
|
|
+ // msTripDet1.setSort(msTripDet.getSort());
|
|
|
+ // msTripDet1.setStartLocal(msTripDet.getStartLocal());
|
|
|
+ // msTripDet1.setStartLocalOther(msTripDet.getStartLocalOther());
|
|
|
+ // msTripDet1.setEndLocal(msTripDet.getEndLocal());
|
|
|
+ // msTripDet1.setEndLocalOther(msTripDet.getEndLocalOther());
|
|
|
+ // msTripDet1.setTripType(msTripDet.getTripType());
|
|
|
+ // msTripDet1.setTripTypeDesp(msTripDet.getTripTypeDesp());
|
|
|
+ // msTripDet1.setTimeCreate(DateTime.now());
|
|
|
+ // msTripDet1.setUserCreate(userCreate);
|
|
|
+ // msTripDet1.setTimeUpdate(DateTime.now());
|
|
|
+ // msTripDet1.setUserUpdate(userCreate);
|
|
|
+ // msTripDetMapper.insert(msTripDet1);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
}
|