|
@@ -12,7 +12,6 @@ import org.springframework.ui.ModelMap;
|
|
|
|
|
|
|
|
import com.uas.platform.b2b.dao.CommonDao;
|
|
import com.uas.platform.b2b.dao.CommonDao;
|
|
|
import com.uas.platform.b2b.dao.UserBaseInfoDao;
|
|
import com.uas.platform.b2b.dao.UserBaseInfoDao;
|
|
|
-import com.uas.platform.b2b.mobile.dao.OutPlanDao;
|
|
|
|
|
import com.uas.platform.b2b.mobile.dao.OutPlanDetailDao;
|
|
import com.uas.platform.b2b.mobile.dao.OutPlanDetailDao;
|
|
|
import com.uas.platform.b2b.mobile.dao.UserCenterDao;
|
|
import com.uas.platform.b2b.mobile.dao.UserCenterDao;
|
|
|
import com.uas.platform.b2b.mobile.dao.VisitRecordDao;
|
|
import com.uas.platform.b2b.mobile.dao.VisitRecordDao;
|
|
@@ -33,9 +32,6 @@ public class WorkScheduleServiceImpl implements WorkScheduleService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private UserCenterDao userCenterDao;
|
|
private UserCenterDao userCenterDao;
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private OutPlanDao outPlanDao;
|
|
|
|
|
-
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private UserBaseInfoDao userBaseInfoDao;
|
|
private UserBaseInfoDao userBaseInfoDao;
|
|
|
|
|
|
|
@@ -46,7 +42,7 @@ public class WorkScheduleServiceImpl implements WorkScheduleService {
|
|
|
private CommonDao commonDao;
|
|
private CommonDao commonDao;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- private OutPlanDetailDao OutPlanDetailDao;
|
|
|
|
|
|
|
+ private OutPlanDetailDao outPlanDetailDao;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public ModelMap getWorkSchedule(Long emcode, Long enuu, String date) {
|
|
public ModelMap getWorkSchedule(Long emcode, Long enuu, String date) {
|
|
@@ -56,8 +52,14 @@ public class WorkScheduleServiceImpl implements WorkScheduleService {
|
|
|
WorkSchedule workSchedule = new WorkSchedule();
|
|
WorkSchedule workSchedule = new WorkSchedule();
|
|
|
String sql = "select o.op_id mp_id, o.op_recorder mp_recorder, o.op_recordercode recordercode, o.op_code mp_code, "
|
|
String sql = "select o.op_id mp_id, o.op_recorder mp_recorder, o.op_recordercode recordercode, o.op_code mp_code, "
|
|
|
+ "o.op_address mp_address, o.op_visittime mp_visittime, o.op_enuu enuu, o.op_recorddate mp_recorddate, "
|
|
+ "o.op_address mp_address, o.op_visittime mp_visittime, o.op_enuu enuu, o.op_recorddate mp_recorddate, "
|
|
|
- + "o.op_arrivedate mp_arrivedate from mobile$outplan o where op_enuu = " + enuu
|
|
|
|
|
- + " and op_recordercode = " + emcode + " and to_char(op_visittime,'yyyymm') = '" + date + "'";
|
|
|
|
|
|
|
+ + "o.op_arrivedate mp_arrivedate from mobile$outplan o where exists (select d.opd_id mpd_id, d.opd_code pd_code, "
|
|
|
|
|
+ + "d.opd_recordercode mpd_recordercode, d.opd_recorder mpd_recorder, d.opd_address mpd_address, d.opd_kind mpd_kind, "
|
|
|
|
|
+ + "d.opd_detno mpd_detno, d.opd_remark mpd_remark, d.opd_location mpd_location, d.opd_enuu enuu, d.opd_arrivedate mpd_arrivedate, "
|
|
|
|
|
+ + "d.opd_actdate mpd_actdate, d.opd_outdate mpd_outdate, d.opd_recorddate mpd_recorddate, d.opd_status mpd_status, d.opd_statuscode mpd_statuscode, "
|
|
|
|
|
+ + "d.opd_distance mpd_distance, d.opd_longitude mpd_longitude, d.opd_latitude mpd_latitude, d.opd_company mpd_company, d.opd_firsttime mpd_firsttime, "
|
|
|
|
|
+ + "d.opd_lasttime mpd_lasttime from mobile$outplandetail d where d.opd_opid = o.op_id and o.op_enuu = "
|
|
|
|
|
+ + enuu + " and o.op_recordercode = " + emcode + " and to_char(d.opd_arrivedate,'yyyymm') = '" + date
|
|
|
|
|
+ + "')";
|
|
|
List<OutPlan> meOutPlans = commonDao.query(sql, OutPlan.class);
|
|
List<OutPlan> meOutPlans = commonDao.query(sql, OutPlan.class);
|
|
|
List<OutPlanInfo> planInfos = new ArrayList<OutPlanInfo>();
|
|
List<OutPlanInfo> planInfos = new ArrayList<OutPlanInfo>();
|
|
|
if (!CollectionUtils.isEmpty(meOutPlans)) {
|
|
if (!CollectionUtils.isEmpty(meOutPlans)) {
|
|
@@ -66,7 +68,7 @@ public class WorkScheduleServiceImpl implements WorkScheduleService {
|
|
|
info.setMp_recorder(ou.getMp_recorder());
|
|
info.setMp_recorder(ou.getMp_recorder());
|
|
|
info.setMp_code(ou.getMp_code());
|
|
info.setMp_code(ou.getMp_code());
|
|
|
info.setMp_recordercode(ou.getRecorderCode());
|
|
info.setMp_recordercode(ou.getRecorderCode());
|
|
|
- List<OutPlanDetail> details = OutPlanDetailDao.findByOutPlan(ou);
|
|
|
|
|
|
|
+ List<OutPlanDetail> details = outPlanDetailDao.findByOutPlan(ou);
|
|
|
if (!CollectionUtils.isEmpty(details)) {
|
|
if (!CollectionUtils.isEmpty(details)) {
|
|
|
for (OutPlanDetail detail : details) {
|
|
for (OutPlanDetail detail : details) {
|
|
|
info.setMpd_distance(detail.getMpd_distance());
|
|
info.setMpd_distance(detail.getMpd_distance());
|
|
@@ -89,7 +91,7 @@ public class WorkScheduleServiceImpl implements WorkScheduleService {
|
|
|
+ "t.ta_doman doman, t.ta_domancode domancode, t.ta_startdate startdate, t.ta_enddate enddate, t.ta_status status, "
|
|
+ "t.ta_doman doman, t.ta_domancode domancode, t.ta_startdate startdate, t.ta_enddate enddate, t.ta_status status, "
|
|
|
+ "t.ta_statuscode statuscode, t.ta_recorddate recorddate, t.ta_uu uu, t.ta_taskname taskname from office$task t where "
|
|
+ "t.ta_statuscode statuscode, t.ta_recorddate recorddate, t.ta_uu uu, t.ta_taskname taskname from office$task t where "
|
|
|
+ "ta_uu = " + enuu + " and ta_recordercode = " + emcode
|
|
+ "ta_uu = " + enuu + " and ta_recordercode = " + emcode
|
|
|
- + " and to_char(ta_recorddate,'yyyymm') = '" + date + "'";
|
|
|
|
|
|
|
+ + " and to_char(ta_startdate,'yyyymm') = '" + date + "'";
|
|
|
List<OfficeTask> task = commonDao.query(taskSql, OfficeTask.class);
|
|
List<OfficeTask> task = commonDao.query(taskSql, OfficeTask.class);
|
|
|
List<VisitRecord> records = getRecordsInOneMonth(emcode, enuu, date);
|
|
List<VisitRecord> records = getRecordsInOneMonth(emcode, enuu, date);
|
|
|
workSchedule.setTask(task);
|
|
workSchedule.setTask(task);
|
|
@@ -98,7 +100,16 @@ public class WorkScheduleServiceImpl implements WorkScheduleService {
|
|
|
map.put("me", workSchedule);
|
|
map.put("me", workSchedule);
|
|
|
if (user.getIsAdmin().equals(Constant.YES)) {// 管理员,获取下属任务等
|
|
if (user.getIsAdmin().equals(Constant.YES)) {// 管理员,获取下属任务等
|
|
|
WorkSchedule workSchedules = new WorkSchedule();
|
|
WorkSchedule workSchedules = new WorkSchedule();
|
|
|
- List<OutPlan> outPlans = outPlanDao.findByEnuu(enuu);
|
|
|
|
|
|
|
+ String outsql = "select o.op_id mp_id, o.op_recorder mp_recorder, o.op_recordercode recordercode, o.op_code mp_code, "
|
|
|
|
|
+ + "o.op_address mp_address, o.op_visittime mp_visittime, o.op_enuu enuu, o.op_recorddate mp_recorddate, "
|
|
|
|
|
+ + "o.op_arrivedate mp_arrivedate from mobile$outplan o where exists (select d.opd_id mpd_id, d.opd_code pd_code, "
|
|
|
|
|
+ + "d.opd_recordercode mpd_recordercode, d.opd_recorder mpd_recorder, d.opd_address mpd_address, d.opd_kind mpd_kind, "
|
|
|
|
|
+ + "d.opd_detno mpd_detno, d.opd_remark mpd_remark, d.opd_location mpd_location, d.opd_enuu enuu, d.opd_arrivedate mpd_arrivedate, "
|
|
|
|
|
+ + "d.opd_actdate mpd_actdate, d.opd_outdate mpd_outdate, d.opd_recorddate mpd_recorddate, d.opd_status mpd_status, d.opd_statuscode mpd_statuscode, "
|
|
|
|
|
+ + "d.opd_distance mpd_distance, d.opd_longitude mpd_longitude, d.opd_latitude mpd_latitude, d.opd_company mpd_company, d.opd_firsttime mpd_firsttime, "
|
|
|
|
|
+ + "d.opd_lasttime mpd_lasttime from mobile$outplandetail d where d.opd_opid = o.op_id and o.op_enuu = "
|
|
|
|
|
+ + enuu + " and to_char(d.opd_arrivedate,'yyyymm') = '" + date + "')";
|
|
|
|
|
+ List<OutPlan> outPlans = commonDao.query(outsql, OutPlan.class);
|
|
|
List<OutPlanInfo> othOutPlans = new ArrayList<OutPlanInfo>();
|
|
List<OutPlanInfo> othOutPlans = new ArrayList<OutPlanInfo>();
|
|
|
if (!CollectionUtils.isEmpty(outPlans)) {
|
|
if (!CollectionUtils.isEmpty(outPlans)) {
|
|
|
for (OutPlan plan : outPlans) {
|
|
for (OutPlan plan : outPlans) {
|
|
@@ -107,8 +118,9 @@ public class WorkScheduleServiceImpl implements WorkScheduleService {
|
|
|
info.setMp_recorder(plan.getMp_recorder());
|
|
info.setMp_recorder(plan.getMp_recorder());
|
|
|
info.setMp_code(plan.getMp_code());
|
|
info.setMp_code(plan.getMp_code());
|
|
|
info.setMp_recordercode(plan.getRecorderCode());
|
|
info.setMp_recordercode(plan.getRecorderCode());
|
|
|
- if (!CollectionUtils.isEmpty(plan.getOutPlanDetails())) {
|
|
|
|
|
- for (OutPlanDetail detail : plan.getOutPlanDetails()) {
|
|
|
|
|
|
|
+ List<OutPlanDetail> outplandetails = outPlanDetailDao.findByOutPlan(plan);
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(outplandetails)) {
|
|
|
|
|
+ for (OutPlanDetail detail : outplandetails) {
|
|
|
info.setMpd_distance(detail.getMpd_distance());
|
|
info.setMpd_distance(detail.getMpd_distance());
|
|
|
info.setMpd_address(detail.getMpd_address());
|
|
info.setMpd_address(detail.getMpd_address());
|
|
|
info.setMpd_actdate(detail.getMpd_actdate());
|
|
info.setMpd_actdate(detail.getMpd_actdate());
|
|
@@ -134,8 +146,10 @@ public class WorkScheduleServiceImpl implements WorkScheduleService {
|
|
|
List<OfficeTask> othTasks = new ArrayList<OfficeTask>();
|
|
List<OfficeTask> othTasks = new ArrayList<OfficeTask>();
|
|
|
if (!CollectionUtils.isEmpty(tasks)) {
|
|
if (!CollectionUtils.isEmpty(tasks)) {
|
|
|
for (OfficeTask ta : tasks) {
|
|
for (OfficeTask ta : tasks) {
|
|
|
- if (!ta.getDomancode().equals(emcode)) {
|
|
|
|
|
- othTasks.add(ta);
|
|
|
|
|
|
|
+ if (ta.getDomancode() != null) {
|
|
|
|
|
+ if (!ta.getDomancode().equals(emcode)) {
|
|
|
|
|
+ othTasks.add(ta);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|