|
@@ -10,6 +10,7 @@ import com.huiju.welcome.model.TaVisitorAppointment;
|
10
|
10
|
import com.huiju.welcome.service.ITaVisitorAppointmentService;
|
11
|
11
|
import com.huiju.welcome.utils.DateUtils;
|
12
|
12
|
import com.huiju.welcome.utils.StatusUtils;
|
|
13
|
+import com.huiju.welcome.utils.StringUtils;
|
13
|
14
|
import org.apache.http.HttpStatus;
|
14
|
15
|
import org.springframework.beans.factory.annotation.Autowired;
|
15
|
16
|
import org.springframework.stereotype.Service;
|
|
@@ -73,6 +74,31 @@ public class TaVisitorAppointmentServiceImpl extends ServiceImpl<TaVisitorAppoin
|
73
|
74
|
return result;
|
74
|
75
|
}
|
75
|
76
|
|
|
77
|
+ @Override
|
|
78
|
+ public TaVisitorAppointment bindAppointmentsBy(Integer appointmentId, String platNumber) {
|
|
79
|
+ TaVisitorAppointment appointment = null;
|
|
80
|
+
|
|
81
|
+ if (null != appointmentId && appointmentId > 0) {
|
|
82
|
+ appointment = taVisitorAppointmentMapper.selectById(appointmentId);
|
|
83
|
+ }
|
|
84
|
+
|
|
85
|
+ if (appointment == null && !StringUtils.isEmpty(platNumber)) {
|
|
86
|
+ QueryWrapper<TaVisitorAppointment> query = new QueryWrapper<>();
|
|
87
|
+ query.eq("plat_number", platNumber);
|
|
88
|
+ query.gt("status", StatusUtils.Delete);
|
|
89
|
+ query.lt("status", StatusUtils.BizDone);
|
|
90
|
+ query.last(" order by IFNULL(visit_date, create_date) asc limit 1");
|
|
91
|
+ appointment = taVisitorAppointmentMapper.selectOne(query);
|
|
92
|
+ }
|
|
93
|
+
|
|
94
|
+ if (null != appointment) {
|
|
95
|
+ appointment.setStatus(StatusUtils.BizDone);
|
|
96
|
+ taVisitorAppointmentMapper.updateById(appointment);
|
|
97
|
+ }
|
|
98
|
+
|
|
99
|
+ return appointment;
|
|
100
|
+ }
|
|
101
|
+
|
76
|
102
|
@Override
|
77
|
103
|
public ResponseBean visitorAppointmentList(IPage pg, String platNumber, String personName,String phone) {
|
78
|
104
|
ResponseBean responseBean= new ResponseBean();
|