张延森 5 年 前
コミット
c6b204fdab

+ 7
- 0
src/main/java/com.huiju.welcome/controller/TaCustomerController.java ファイルの表示

@@ -14,6 +14,7 @@ import com.huiju.welcome.utils.DateUtils;
14 14
 import com.huiju.welcome.utils.JWTUtils;
15 15
 import com.huiju.welcome.utils.StatusUtils;
16 16
 import com.huiju.welcome.utils.StringUtils;
17
+import io.swagger.models.auth.In;
17 18
 import org.apache.http.HttpStatus;
18 19
 import org.slf4j.Logger;
19 20
 import org.slf4j.LoggerFactory;
@@ -178,6 +179,12 @@ public class TaCustomerController extends BaseController {
178 179
             return ResponseBean.error("保存内容格式非法或者为空", HttpStatus.SC_BAD_REQUEST);
179 180
         }
180 181
 
182
+        // 是否2号岗修改
183
+        Boolean mainUsher = params.getBoolean("mainUsher");
184
+        if (null != mainUsher && mainUsher) {
185
+            iTaCustomerService.updateByMainUsher(id, params);
186
+        }
187
+
181 188
         TaCustomer taCustomer = JSONObject.parseObject(paramStr, TaCustomer.class);
182 189
         JSONArray follows = params.getJSONArray("follows");
183 190
 

+ 3
- 0
src/main/java/com.huiju.welcome/service/ITaCustomerService.java ファイルの表示

@@ -1,5 +1,6 @@
1 1
 package com.huiju.welcome.service;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
3 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import com.baomidou.mybatisplus.extension.service.IService;
5 6
 import com.huiju.welcome.model.*;
@@ -50,4 +51,6 @@ public interface ITaCustomerService extends IService<TaCustomer> {
50 51
 	IPage<TaCustomer> getAttributionList(int pageNumber, int pageSize);
51 52
     
52 53
     IPage<TaCustomer> getUnattributionList(int pageNumber, int pageSize);
54
+
55
+    boolean updateByMainUsher(Integer customerId, JSONObject params);
53 56
 }

+ 2
- 0
src/main/java/com.huiju.welcome/service/ITaVisitorAppointmentService.java ファイルの表示

@@ -32,4 +32,6 @@ public interface ITaVisitorAppointmentService extends IService<TaVisitorAppointm
32 32
     List<TaVisitorAppointment> getAppointmentsByPlateNumber(String plateNumber);
33 33
 
34 34
     IPage<TaVisitorAppointment> getMyAppointmentList(int pageNum, int pageSize, Integer personId, String nameOrPhone);
35
+
36
+    TaVisitorAppointment bindAppointmentsBy(Integer appointmentId, String platNumber);
35 37
 }

+ 20
- 0
src/main/java/com.huiju.welcome/service/impl/TaCustomerServiceImpl.java ファイルの表示

@@ -1,5 +1,6 @@
1 1
 package com.huiju.welcome.service.impl;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
3 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 5
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
5 6
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -461,6 +462,25 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
461 462
         return taCustomerMapper.getUnattributionList(page);
462 463
     }
463 464
 
465
+    @Override
466
+    public boolean updateByMainUsher(Integer customerId, JSONObject params) {
467
+        if (null == customerId || customerId == 0) {
468
+            return false;
469
+        }
470
+
471
+        TaCustomer customer = taCustomerMapper.selectById(customerId);
472
+        if (null == customer) {
473
+            return false;
474
+        }
475
+
476
+        customer.setPlateNumber(params.getString("plateNumber"));
477
+        customer.setCarModel(params.getString("carModel"));
478
+        customer.setCarColor(params.getString("carColor"));
479
+//        customer.setRe
480
+
481
+        return false;
482
+    }
483
+
464 484
     private TaCustomer newCustomerByPerson(TaPerson taPerson) throws Exception {
465 485
         TaCustomer taCustomer = new TaCustomer();
466 486
         taCustomer.setCustomerId(taPerson.getRealId());

+ 26
- 0
src/main/java/com.huiju.welcome/service/impl/TaVisitorAppointmentServiceImpl.java ファイルの表示

@@ -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();