| Line 2... |
Line 2... |
| 2 |
|
2 |
|
| 3 |
import com.google.gson.Gson;
|
3 |
import com.google.gson.Gson;
|
| 4 |
import com.google.gson.reflect.TypeToken;
|
4 |
import com.google.gson.reflect.TypeToken;
|
| 5 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
5 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 6 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
6 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| - |
|
7 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 7 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
8 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 8 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
9 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 9 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
10 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 10 |
import com.spice.profitmandi.dao.entity.logistics.PublicHolidays;
|
11 |
import com.spice.profitmandi.dao.entity.logistics.PublicHolidays;
|
| 11 |
import com.spice.profitmandi.dao.entity.user.*;
|
12 |
import com.spice.profitmandi.dao.entity.user.*;
|
| Line 414... |
Line 415... |
| 414 |
row.setTaskId(fofoStoreId);
|
415 |
row.setTaskId(fofoStoreId);
|
| 415 |
row.setTaskDate(taskDate);
|
416 |
row.setTaskDate(taskDate);
|
| 416 |
row.setTaskName(newTaskName);
|
417 |
row.setTaskName(newTaskName);
|
| 417 |
row.setTaskDescription(description);
|
418 |
row.setTaskDescription(description);
|
| 418 |
row.setTaskType("franchisee-visit");
|
419 |
row.setTaskType("franchisee-visit");
|
| 419 |
row.setMarkType("PENDING");
|
420 |
row.setMarkType(ProfitMandiConstants.MARK_TYPE.PENDING);
|
| 420 |
row.setAddress("");
|
421 |
row.setAddress("");
|
| 421 |
row.setVisitLocation(visitLocation);
|
422 |
row.setVisitLocation(visitLocation);
|
| 422 |
row.setCheckInLatLng("0.0000,0.0000");
|
423 |
row.setCheckInLatLng("0.0000,0.0000");
|
| 423 |
row.setCheckOutLatLng("0.0000,0.0000");
|
424 |
row.setCheckOutLatLng("0.0000,0.0000");
|
| 424 |
row.setCheckInTime(java.time.LocalTime.MIDNIGHT);
|
425 |
row.setCheckInTime(java.time.LocalTime.MIDNIGHT);
|
| Line 570... |
Line 571... |
| 570 |
if (d == null) return responseSender.badRequest("Deferred record not found");
|
571 |
if (d == null) return responseSender.badRequest("Deferred record not found");
|
| 571 |
|
572 |
|
| 572 |
LocalDateTime now = LocalDateTime.now();
|
573 |
LocalDateTime now = LocalDateTime.now();
|
| 573 |
|
574 |
|
| 574 |
if ("cancel".equalsIgnoreCase(action)) {
|
575 |
if ("cancel".equalsIgnoreCase(action)) {
|
| 575 |
d.setStatus("CANCELLED");
|
576 |
d.setStatus(String.valueOf(ProfitMandiConstants.MARK_TYPE.CANCELLED));
|
| 576 |
d.setActionBy(me.getId());
|
577 |
d.setActionBy(me.getId());
|
| 577 |
d.setUpdatedTimestamp(now);
|
578 |
d.setUpdatedTimestamp(now);
|
| 578 |
beatDeferredVisitRepository.persist(d);
|
579 |
beatDeferredVisitRepository.persist(d);
|
| 579 |
Map<String, Object> ok = new HashMap<>();
|
580 |
Map<String, Object> ok = new HashMap<>();
|
| 580 |
ok.put("status", true);
|
581 |
ok.put("status", true);
|
| Line 631... |
Line 632... |
| 631 |
row.setTaskId(d.getFofoId());
|
632 |
row.setTaskId(d.getFofoId());
|
| 632 |
row.setTaskDate(toDate);
|
633 |
row.setTaskDate(toDate);
|
| 633 |
row.setTaskName(taskName);
|
634 |
row.setTaskName(taskName);
|
| 634 |
row.setTaskDescription("Rescheduled from " + d.getDeferredDate());
|
635 |
row.setTaskDescription("Rescheduled from " + d.getDeferredDate());
|
| 635 |
row.setTaskType(d.getTaskType() != null ? d.getTaskType() : "franchisee-visit");
|
636 |
row.setTaskType(d.getTaskType() != null ? d.getTaskType() : "franchisee-visit");
|
| 636 |
row.setMarkType("PENDING");
|
637 |
row.setMarkType(String.valueOf(ProfitMandiConstants.MARK_TYPE.PENDING));
|
| 637 |
row.setAddress("");
|
638 |
row.setAddress("");
|
| 638 |
row.setVisitLocation(visitLocation);
|
639 |
row.setVisitLocation(visitLocation);
|
| 639 |
row.setCheckInLatLng("0.0000,0.0000");
|
640 |
row.setCheckInLatLng("0.0000,0.0000");
|
| 640 |
row.setCheckOutLatLng("0.0000,0.0000");
|
641 |
row.setCheckOutLatLng("0.0000,0.0000");
|
| 641 |
row.setCheckInTime(java.time.LocalTime.MIDNIGHT);
|
642 |
row.setCheckInTime(java.time.LocalTime.MIDNIGHT);
|
| Line 649... |
Line 650... |
| 649 |
row.setStatus(false);
|
650 |
row.setStatus(false);
|
| 650 |
row.setCreatedTimestamp(now);
|
651 |
row.setCreatedTimestamp(now);
|
| 651 |
row.setUpdatedTimestamp(now);
|
652 |
row.setUpdatedTimestamp(now);
|
| 652 |
locationTrackingRepositoryAuto.persist(row);
|
653 |
locationTrackingRepositoryAuto.persist(row);
|
| 653 |
|
654 |
|
| 654 |
d.setStatus("RESCHEDULED");
|
655 |
d.setStatus(String.valueOf(ProfitMandiConstants.MARK_TYPE.RESCHEDULED));
|
| 655 |
d.setRescheduledToDate(toDate);
|
656 |
d.setRescheduledToDate(toDate);
|
| 656 |
d.setActionBy(me.getId());
|
657 |
d.setActionBy(me.getId());
|
| 657 |
d.setUpdatedTimestamp(now);
|
658 |
d.setUpdatedTimestamp(now);
|
| 658 |
beatDeferredVisitRepository.persist(d);
|
659 |
beatDeferredVisitRepository.persist(d);
|
| 659 |
|
660 |
|
| Line 747... |
Line 748... |
| 747 |
br.setActive(true);
|
748 |
br.setActive(true);
|
| 748 |
beatRouteRepository.persist(br);
|
749 |
beatRouteRepository.persist(br);
|
| 749 |
}
|
750 |
}
|
| 750 |
}
|
751 |
}
|
| 751 |
|
752 |
|
| 752 |
d.setStatus("RESCHEDULED");
|
753 |
d.setStatus(String.valueOf(ProfitMandiConstants.MARK_TYPE.RESCHEDULED));
|
| 753 |
d.setRescheduledToDate(date);
|
754 |
d.setRescheduledToDate(date);
|
| 754 |
d.setActionBy(me.getId());
|
755 |
d.setActionBy(me.getId());
|
| 755 |
d.setUpdatedTimestamp(now);
|
756 |
d.setUpdatedTimestamp(now);
|
| 756 |
beatDeferredVisitRepository.persist(d);
|
757 |
beatDeferredVisitRepository.persist(d);
|
| 757 |
|
758 |
|