liyuanyuan 1 год назад
Родитель
Сommit
31e7c8d5ca

+ 1 - 1
.gitignore

@@ -1,6 +1,6 @@
1 1
 logs/
2 2
 .idea/
3
-target/
3
+*/target/
4 4
 files/
5 5
 *.log
6 6
 *.iml

+ 22 - 0
zxdt-api/src/main/java/api/controller/online/MessageController.java

@@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
27 27
 import org.springframework.web.multipart.MultipartFile;
28 28
 
29 29
 import javax.annotation.Resource;
30
+
30 31
 import java.text.SimpleDateFormat;
31 32
 import java.util.*;
32 33
 import java.util.stream.Collectors;
@@ -91,6 +92,27 @@ public class MessageController extends BaseController {
91 92
         }
92 93
     }
93 94
 
95
+    @ApiOperation("删除通过khuser")
96
+    @Log(title = "删除聊天消息通过khuser",businessType = BusinessType.DELETE)
97
+    @DeleteMapping("/deletebykhuser/{khuser}")
98
+    public AjaxResult delete(@PathVariable String khuser)  {
99
+        LambdaQueryWrapper<Message> queryWrapper=new LambdaQueryWrapper<>();
100
+        queryWrapper.eq(Message::getKhUser,khuser);
101
+        boolean result = messageService.delete(queryWrapper);
102
+        if (result) {
103
+            return Success("成功");
104
+        } else {
105
+            return Error("删除失败");
106
+        }
107
+    }
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
94 116
     @ApiOperation("留言列表")
95 117
     @Log(title = "查询留言消息列表",businessType = BusinessType.QUERY)
96 118
     @GetMapping("/leavelist")

+ 1 - 0
zxdt-api/src/main/java/api/controller/online/QuickReplyController.java

@@ -44,6 +44,7 @@ public class QuickReplyController extends BaseController {
44 44
         qw.eq(input.getCreateTime() != null , QuickReply::getCreateTime, input.getCreateTime());
45 45
         qw.like(!StringHelper.isEmpty(input.getDelBy()), QuickReply::getDelBy, input.getDelBy());
46 46
         qw.eq(input.getDelTime() != null , QuickReply::getDelTime, input.getDelTime());
47
+        qw.orderByDesc(QuickReply::getQuickreplyId);
47 48
         Page<QuickReply> page = GetPage(pageInput);
48 49
         if (page != null) {
49 50
             IPage<QuickReply> iPage = quickreplyService.getListPage(page, qw);

+ 1 - 0
zxdt-api/src/main/java/api/controller/system/UserController.java

@@ -3,6 +3,7 @@ package api.controller.system;
3 3
 import api.entity.database.call.CallLog;
4 4
 import api.entity.database.sf.SfPlanSeats;
5 5
 import api.entity.database.system.*;
6
+import api.entity.input.system.CustomerInput;
6 7
 import api.entity.view.call.CallLogView;
7 8
 import api.entity.view.order.WorkOrderBaseView;
8 9
 import api.entity.view.system.CustomerView;

+ 337 - 0
zxdt-api/src/main/java/api/controller/system/WxRelatedController.java

@@ -0,0 +1,337 @@
1
+package api.controller.system;
2
+
3
+import api.controller.BaseController;
4
+import api.entity.database.system.User;
5
+import api.entity.input.system.CustomerInput;
6
+import api.entity.input.system.OrderInput;
7
+import api.model.AjaxResult;
8
+import api.service.system.IUserService;
9
+import api.util.annotation.Anonymous;
10
+import api.util.annotation.Log;
11
+import api.util.enums.BusinessType;
12
+import api.util.helper.HttpHelper;
13
+import api.util.helper.SecretHelper;
14
+import api.util.helper.SpringHelper;
15
+import api.util.helper.StringHelper;
16
+import com.alibaba.fastjson2.JSON;
17
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
18
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
19
+import io.swagger.annotations.Api;
20
+import io.swagger.annotations.ApiOperation;
21
+import org.springframework.beans.factory.annotation.Autowired;
22
+import org.springframework.web.bind.annotation.*;
23
+
24
+import javax.servlet.http.HttpServletRequest;
25
+import java.util.*;
26
+
27
+@Api(value = "微信和工单相关的", tags = "微信和工单相关的")
28
+@RestController
29
+@RequestMapping("/system/wxrelated")
30
+public class WxRelatedController extends BaseController {
31
+    @Autowired
32
+    private IUserService userService;
33
+    @ApiOperation("外部新增用户")
34
+    @Log(title = "外部新增用户", businessType = BusinessType.INSERT)
35
+    @PostMapping("/externaladd")
36
+    @Anonymous
37
+    public AjaxResult externaladd(@RequestBody User user,HttpServletRequest request) {
38
+
39
+
40
+        String uuid= request.getHeader("uuid");
41
+        String pass= request.getHeader("pass");
42
+
43
+       String md5str= SecretHelper.MD5("huawuxitong%@"+uuid);
44
+        if(!md5str.equals(pass)){
45
+            return Error("验证失败");
46
+        }
47
+
48
+         if (!userService.checkUserNameUnique(user)) {
49
+            return Error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
50
+        }
51
+        if (StringHelper.isEmpty(user.getPassword()))
52
+            return Error("请输入密码");
53
+        if (StringHelper.isEmpty(user.getUserName()))
54
+            return Error("请输入姓名");
55
+        if (StringHelper.isEmpty(user.getNickName()))
56
+            return Error("请输入工号");
57
+        user.setStatus("0");
58
+        user.setDelFlag("0");
59
+        user.setPassword(user.getPassword());
60
+        user.setCreateBy(user.getCreateBy());
61
+        user.setCreateTime(new Date());
62
+
63
+        boolean result = userService.insert(user);
64
+        if (result) {
65
+            return Success("新增成功");
66
+        } else {
67
+            return Error("新增失败");
68
+        }
69
+    }
70
+    @ApiOperation("外部新增用户list")
71
+    @Log(title = "外部新增用户list", businessType = BusinessType.INSERT)
72
+    @PostMapping("/externaladduserlist")
73
+    @Anonymous
74
+    public AjaxResult externaladduserlist(@RequestBody List<User> userlist,HttpServletRequest request) {
75
+
76
+
77
+        String uuid= request.getHeader("uuid");
78
+        String pass= request.getHeader("pass");
79
+
80
+        String md5str= SecretHelper.MD5("huawuxitong%@"+uuid);
81
+        if(!md5str.equals(pass)){
82
+            return Error("验证失败");
83
+        }
84
+
85
+        Integer res=0;
86
+        for (User user : userlist){
87
+            if (!userService.checkUserNameExternalUnique(user)) {
88
+                continue;
89
+            }
90
+            if (StringHelper.isEmpty(user.getPassword()))
91
+                continue;
92
+            if (StringHelper.isEmpty(user.getUserName()))
93
+                continue;
94
+            if (StringHelper.isEmpty(user.getNickName()))
95
+                continue;
96
+            user.setStatus("0");
97
+            user.setDelFlag("0");
98
+            user.setPassword(user.getPassword());
99
+            user.setCreateBy(user.getCreateBy());
100
+            user.setCreateTime(new Date());
101
+
102
+            boolean result = userService.insert(user);
103
+            if(result){
104
+                res=res+1;
105
+            }
106
+
107
+
108
+        }
109
+        return Success("同步成功");
110
+
111
+
112
+    }
113
+
114
+    @ApiOperation("外部删除用户")
115
+    @Log(title = "外部删除用户", businessType = BusinessType.INSERT)
116
+    @PostMapping("/externaldelete")
117
+    @Anonymous
118
+    public AjaxResult externaldelete(@RequestBody User user,HttpServletRequest request) {
119
+
120
+
121
+        String uuid= request.getHeader("uuid");
122
+        String pass= request.getHeader("pass");
123
+
124
+        String md5str= SecretHelper.MD5("huawuxitong%@"+uuid);
125
+        if(!md5str.equals(pass)){
126
+            return Error("验证失败");
127
+        }
128
+        LambdaUpdateWrapper<User> uw = new LambdaUpdateWrapper<>();
129
+        uw.set(User::getDelFlag, "2").eq(User::getExternalId, user.getExternalId());
130
+        boolean result = userService.updateBatch(uw);
131
+        if (result) {
132
+            return Success("删除成功");
133
+        } else {
134
+            return Error("删除失败");
135
+        }
136
+    }
137
+
138
+
139
+    @ApiOperation("外部接口修改系统用户user")
140
+    @Log(title = "外部接口修改系统用户user", businessType = BusinessType.UPDATE)
141
+    @PostMapping("/externaledit")
142
+    @Anonymous
143
+    public AjaxResult externaledit(@RequestBody User user,HttpServletRequest request) {
144
+        String uuid= request.getHeader("uuid");
145
+        String pass= request.getHeader("pass");
146
+
147
+        String md5str= SecretHelper.MD5("huawuxitong%@"+uuid);
148
+        if(!md5str.equals(pass)){
149
+            return Error("验证失败");
150
+        }
151
+
152
+
153
+
154
+
155
+
156
+        LambdaUpdateWrapper<User> usermodel=new LambdaUpdateWrapper<>();
157
+        usermodel.eq(User::getExternalId,user.getExternalId());
158
+
159
+       if(! userService.exists(usermodel))
160
+       {
161
+           //不存在这个就去添加
162
+
163
+
164
+           user.setStatus("0");
165
+           user.setDelFlag("0");
166
+           user.setPassword(user.getPassword());
167
+           user.setCreateBy(user.getCreateBy());
168
+           user.setCreateTime(new Date());
169
+           userService.insert(user);
170
+          return Success("添加成功");
171
+       }
172
+
173
+
174
+
175
+
176
+        if(!StringHelper.isEmpty(user.getPassword())){
177
+            usermodel.set(User::getPassword,user.getPassword());
178
+        }
179
+        if(!StringHelper.isEmpty(user.getUserName())) {
180
+
181
+            LambdaQueryWrapper<User> qw=new LambdaQueryWrapper<>();
182
+            qw.eq(User::getUserName, user.getUserName());
183
+            qw.ne(User::getExternalId,user.getExternalId());
184
+
185
+            if(! userService.exists(qw)){
186
+                usermodel.set(User::getUserName, user.getUserName());
187
+            }
188
+        }
189
+        boolean result = userService.updateBatch(usermodel);
190
+        if (result) {
191
+            return Success("修改成功");
192
+        } else {
193
+            return Error("修改失败");
194
+        }
195
+    }
196
+
197
+//以下是调用vs的
198
+
199
+
200
+    @ApiOperation("调用外部接口获取市民信息通过微信id")
201
+    @Log(title = "调用外部接口获取市民信息通过微信id", businessType = BusinessType.UPDATE)
202
+    @GetMapping("/getcusdata")
203
+    @Anonymous
204
+    public AjaxResult getcusdata(String wxid) {
205
+
206
+        String  huawuURL= SpringHelper.getRequiredProperty("huawuURL");
207
+        String param="wxid="+wxid;
208
+        String datares= HttpHelper.sendGet(huawuURL+"Customer/GetCusDatabyWx",param);
209
+        return  Success("外部接口获取市民信息通过微信id成功",datares);
210
+
211
+    }
212
+
213
+    @ApiOperation("调用外部接口编辑话务系统的市民信息")
214
+    @Log(title = "调用外部接口编辑话务系统的市民信息", businessType = BusinessType.UPDATE)
215
+    @GetMapping("/editcus")
216
+    @Anonymous
217
+    public AjaxResult editcus(CustomerInput input) {
218
+        String  huawuURL= SpringHelper.getRequiredProperty("huawuURL");
219
+
220
+//        String  huawuURL= SpringHelper.getRequiredProperty("huawuURL");
221
+//        String param="F_CustomerId=132668&F_CustomerEName=wxnamenew&F_CustomerName=瑟吉欧";
222
+//        String datares= HttpHelper.sendPost(huawuURL+"Customer/AddOrEditCusDataByWx",param);
223
+
224
+//        input.setF_CustomerId(13266L);
225
+//        input.setF_CustomerEName("wxnamenew");
226
+//        input.setF_CustomerName("瑟吉欧");
227
+        String datares= HttpHelper.sendJson(huawuURL+"Customer/AddOrEditCusDataByWx", JSON.toJSONString(input));
228
+
229
+        return  Success("外部接口编辑市民信息成功",datares);
230
+
231
+    }
232
+    @ApiOperation("调用外部接口通过wxid获取市民的历史工单信息")
233
+    @Log(title = "调用外部接口通过wxid获取市民的历史工单信息", businessType = BusinessType.UPDATE)
234
+    @GetMapping("/gethistoryorders")
235
+    @Anonymous
236
+    public AjaxResult gethistoryorders(String wxid) {
237
+
238
+        String  huawuURL= SpringHelper.getRequiredProperty("huawuURL");
239
+        String param="wxid="+wxid;
240
+        String datares= HttpHelper.sendGet(huawuURL+"Order/getOrderDataByWx",param);
241
+        return  Success("外部接口获取市民信息通过微信id成功",datares);
242
+
243
+    }
244
+
245
+
246
+    @ApiOperation("调用外部接口添加工单")
247
+    @Log(title = "调用外部接口通过wxid获取市民的历史工单信息", businessType = BusinessType.UPDATE)
248
+    @PostMapping("/addorder")
249
+    @Anonymous
250
+    public AjaxResult addorder(@RequestBody Map<String,Object> map) {
251
+        String  huawuURL=  SpringHelper.getRequiredProperty("huawuURL");
252
+        String datares= HttpHelper.sendJson(huawuURL+"WXInterFace/workOrderAddData",JSON.toJSONString(map));//
253
+        if(Objects.equals(datares, "True")){
254
+            return  Success("添加工单成功",datares);
255
+        }
256
+        else {
257
+            return Error("添加失败");
258
+        }
259
+
260
+    }
261
+
262
+
263
+    @ApiOperation("调用外部接口添加工单")
264
+    @Log(title = "调用外部接口通过wxid获取市民的历史工单信息", businessType = BusinessType.UPDATE)
265
+    @GetMapping("/addcuss")
266
+    @Anonymous
267
+    public AjaxResult addcuss() {
268
+        String  huawuURL= SpringHelper.getRequiredProperty("huawuURL");
269
+        CustomerInput in=new CustomerInput();
270
+        in.setF_CustomerId(0L);
271
+        in.setF_CustomerEName("534354354dsjkdljsklfd");
272
+
273
+        String param="wxid="+in.getF_CustomerEName();
274
+        String datares= HttpHelper.sendGet(huawuURL+"Customer/AddCusDataByWx",param);
275
+        return Success(datares);
276
+    }
277
+
278
+    @ApiOperation("调用外部接口获取字典下拉框,nld,clfs")
279
+    @Log(title = "调用外部接口获取字典下拉框", businessType = BusinessType.UPDATE)
280
+    @GetMapping("/getnld")
281
+    @Anonymous
282
+    public AjaxResult getnld(String diccodetype) {
283
+
284
+        String  huawuURL= SpringHelper.getRequiredProperty("huawuURL");
285
+        String param="dicCodeType="+diccodetype;
286
+        String datares= HttpHelper.sendGet(huawuURL+"WXInterFace/GetDicList",param);
287
+        return  Success("获取字段成功",datares);
288
+
289
+    }
290
+
291
+    @ApiOperation("获取机许线的车站")
292
+    @Log(title = "获取机许线的车站", businessType = BusinessType.UPDATE)
293
+    @GetMapping("/getstation")
294
+    @Anonymous
295
+    public AjaxResult getstation() {
296
+
297
+        String  huawuURL= SpringHelper.getRequiredProperty("huawuURL");
298
+
299
+        String datares= HttpHelper.sendGet(huawuURL+"WXInterFace/GetDicSelectStation");
300
+        return  Success("获取机许线的车站",datares);
301
+
302
+    }
303
+    @ApiOperation("获取业务类型")
304
+    @Log(title = "获取业务类型", businessType = BusinessType.UPDATE)
305
+    @GetMapping("/gettypelist")
306
+    @Anonymous
307
+    public AjaxResult gettypelist() {
308
+
309
+        String  huawuURL= SpringHelper.getRequiredProperty("huawuURL");
310
+
311
+        String datares= HttpHelper.sendGet(huawuURL+"WXInterFace/GetWorkOrderTypeModelList");
312
+        return  Success("获取业务类型",datares);
313
+
314
+    }
315
+    @ApiOperation("获取转单部门")
316
+    @Log(title = "获取转单部门", businessType = BusinessType.UPDATE)
317
+    @GetMapping("/getdeptuserlist")
318
+    @Anonymous
319
+    public AjaxResult getdeptuserlist() {
320
+
321
+        String  huawuURL= SpringHelper.getRequiredProperty("huawuURL");
322
+        String datares= HttpHelper.sendGet(huawuURL+"WXInterFace/GetDepartmentAndUserJsonModelTrun");
323
+        return  Success("获取转单部门",datares);
324
+    }
325
+    @ApiOperation("获取标签")
326
+    @Log(title = "获取标签", businessType = BusinessType.UPDATE)
327
+    @GetMapping("/gettaglist")
328
+    @Anonymous
329
+    public AjaxResult gettaglist() {
330
+
331
+        String  huawuURL= SpringHelper.getRequiredProperty("huawuURL");
332
+        String datares= HttpHelper.sendGet(huawuURL+"WXInterFace/GetTagList");
333
+        return  Success("获取标签",datares);
334
+    }
335
+
336
+
337
+}

+ 4 - 0
zxdt-api/src/main/resources/application-dev.yml

@@ -76,4 +76,8 @@ spring:
76 76
 
77 77
 startover: 192.168.1.15
78 78
 
79
+huawuURL: http://192.168.8.10:9908/
80
+
81
+huawuURL22:  http://localhost:41969/
82
+
79 83
 

+ 2 - 1
zxdt-api/src/main/resources/application-production.yml

@@ -75,4 +75,5 @@ spring:
75 75
     username:
76 76
     password:
77 77
 
78
-startover: 192.168.1.15
78
+startover: 192.168.1.15
79
+huawuURL: http://10.160.153.117/

+ 2 - 2
zxdt-api/src/main/resources/application.yml

@@ -3,8 +3,8 @@ spring:
3 3
     date-format: yyyy-MM-dd HH:mm:ss
4 4
     time-zone: GMT+8
5 5
   profiles:
6
-    #active: production
7
-    active: dev
6
+     active: production
7
+    #active: dev
8 8
   servlet:
9 9
     multipart:
10 10
       max-file-size: 20MB #单个文件最大为20M

+ 10 - 2
zxdt-entity/src/main/java/api/entity/database/system/User.java

@@ -32,11 +32,19 @@ public class User {
32 32
      */
33 33
     @ApiModelProperty("部门ID")
34 34
     private Long deptId;
35
+
36
+    @ApiModelProperty("用户账号,工号")
37
+    private String userName;
38
+
39
+    @ApiModelProperty("话务的userID")
40
+    private Long externalId;
41
+
42
+
35 43
     /**
36 44
      * 用户账号
37 45
      */
38
-    @ApiModelProperty("用户账号,工号")
39
-    private String userName;
46
+    @ApiModelProperty("用户部门name")
47
+    private String deptName;
40 48
     /**
41 49
      * 用户昵称
42 50
      */

+ 89 - 0
zxdt-entity/src/main/java/api/entity/input/system/CustomerInput.java

@@ -0,0 +1,89 @@
1
+package api.entity.input.system;
2
+
3
+import api.entity.database.system.User;
4
+import lombok.Data;
5
+
6
+import java.util.Set;
7
+
8
+/**
9
+ * 话务系统的市民信息
10
+ * 
11
+ * @author jiayi
12
+ */
13
+@Data
14
+public class CustomerInput
15
+{
16
+
17
+
18
+
19
+    /**
20
+     * 用户ID
21
+     */
22
+    private Long F_CustomerId;
23
+
24
+    /**
25
+     * 性别
26
+     */
27
+    private String F_CustomerPym;
28
+
29
+    /**
30
+     * 姓名
31
+     */
32
+    private String F_CustomerName;
33
+
34
+    /**
35
+     * 微信号
36
+     */
37
+    private String F_CustomerEName;
38
+
39
+    /**
40
+     * 微博号
41
+     */
42
+    private String F_PostCode;
43
+
44
+    /**
45
+     * 年龄段
46
+     */
47
+    private String F_CustomerCode;
48
+
49
+    /**
50
+     * 归属地
51
+     */
52
+    private String F_CustomerLayer;
53
+
54
+    /**
55
+     * 来电电话
56
+     */
57
+    private String F_Telephone;
58
+
59
+    /**
60
+     * 回复电话
61
+     */
62
+    private String F_Mobile;
63
+
64
+    //常进站
65
+    private  Long  F_DeviceCount;
66
+    //常进站
67
+    private String  F_Fax;
68
+
69
+
70
+    //常出站
71
+    private  Long  F_AfterSaleNameID;
72
+    //常出站
73
+    private String  F_Email;
74
+    //事发站点
75
+    private  Long  F_ProductLineID;
76
+
77
+    //事发站点
78
+    private String  F_Website;
79
+    /// 客户属性编码1、语音 2、微信 ,3,微博  客户来源
80
+    private String  F_Kind;
81
+    /// 最近联络方式 客户属性1、语音 2、留言 ,3,微信、,4、微博、
82
+    private String  F_CustomerNature;
83
+    //  客户等级编码1 、2、 3、
84
+    private String  F_ScaleResume;
85
+    //  客户等级1、一般客户 2、特别关注 3、黑名单
86
+    private String      F_CustomerClass;
87
+    // 创建人
88
+    public Long F_CreateBy;
89
+}

+ 91 - 0
zxdt-entity/src/main/java/api/entity/input/system/OrderInput.java

@@ -0,0 +1,91 @@
1
+package api.entity.input.system;
2
+
3
+import lombok.Data;
4
+
5
+import java.util.Date;
6
+
7
+@Data
8
+public class OrderInput {
9
+
10
+    private Integer  F_CUSTOMERID;
11
+    private Integer F_WORKORDERID;
12
+
13
+    private String F_WORKORDERFROM;
14
+    private String F_CUSTOMERNAME;
15
+    private String   F_RETURNVISITPROBLEM;
16
+
17
+
18
+
19
+
20
+    private Integer F_REPAIRLEVEL;//": "41",  业务类型id  T_Wo_WorkOrderType表的id
21
+
22
+
23
+    private Integer  F_WORKORDERLEVELID;// 事发车站id
24
+    private String  F_WORKORDERNAME;  //事发车站名称
25
+    private String F_CONTENT;//": "商易行APP二维码故障这是内容。",
26
+    private Integer     F_WORKORDERTYPEID;  // 处理方式  1转单 3客服处理
27
+    private Date F_REQUESTSERVICETIME ;// 要求处理部门的【回复】时间
28
+    private String  F_RETURNVISITCONTENT;// 回复内容
29
+
30
+
31
+
32
+
33
+    /// 客户电话
34
+    /// </summary>
35
+    private String F_CUSTOMERTELEPHONE;
36
+    /// 0未处理 1处理中  2已办结(结束) 3待回访 4待定责 5已定责,已处理
37
+    /// 新加的:8待处理撤回审批中(转办)  9 待定责撤回审批中(客服处理和转办)   10 已处理撤回审批中(客服处理)
38
+    /// </summary>
39
+    private Integer F_WORKORDERSTATEID;
40
+    /// <summary>
41
+    /// 工单状态名称
42
+    /// </summary>
43
+    private String  F_REPAIRREQUEST;
44
+
45
+    /// <summary>
46
+    /// 处理方式名称
47
+    /// </summary>
48
+    private String F_INSTALLADDRESS;
49
+
50
+
51
+    /// <summary>
52
+    /// 业务类型名称 :选的最小类的名称 例如:投诉安检工作人员
53
+    /// </summary>
54
+    private String F_ADSLACCOUNT ;
55
+    /// <summary>
56
+    /// 业务类别 20210715 -- 3 投诉 6 咨询 14 建议 18表扬 19挂失
57
+    /// </summary>
58
+    private Integer  F_FILEFLAG;
59
+    /// <summary>
60
+    ///业务类别名称 :咨询 投诉 表扬 建议 挂失
61
+    /// </summary>
62
+    private String F_HOUSING;
63
+
64
+    /// <summary>
65
+    /// 对接受理部门
66
+    /// </summary>
67
+    private String F_DEPTCODE;
68
+
69
+    /// <summary>
70
+    /// 受理人员姓名
71
+    /// </summary>
72
+    private String F_USERNAME;
73
+
74
+    /// <summary>
75
+    /// 计划回访时间
76
+    /// </summary>
77
+    private Date F_RETURNVISITTIME;
78
+
79
+    /// <summary>
80
+    /// 是否回访 0 不回访 1 回访
81
+    /// </summary>
82
+    private Integer  F_RETURNVISITFLAG;
83
+
84
+
85
+
86
+    private Integer  F_REPAIRMANID;
87
+
88
+    //创建人的话务系统里的userid
89
+    private Integer  F_CREATEBY;
90
+    private CustomerInput CustomerBaseModel ;
91
+}

+ 1 - 1
zxdt-service/src/main/java/api/service/system/IUserService.java

@@ -35,7 +35,7 @@ public interface IUserService extends IBaseService<User> {
35 35
      * @return 用户信息集合信息
36 36
      */
37 37
     public List<User> selectUnallocatedList(User user);
38
-
38
+    boolean checkUserNameExternalUnique(User user ) ;
39 39
     /**
40 40
      * 校验用户名称是否唯一
41 41
      *

+ 12 - 0
zxdt-service/src/main/java/api/service/system/impl/UserServiceImpl.java

@@ -24,6 +24,7 @@ import java.util.ArrayList;
24 24
 import java.util.Arrays;
25 25
 import java.util.List;
26 26
 import java.util.regex.Pattern;
27
+import java.util.stream.Collectors;
27 28
 
28 29
 /**
29 30
  * @author Administrator
@@ -107,6 +108,17 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
107 108
         }
108 109
         return true;
109 110
     }
111
+    @Override
112
+    public boolean checkUserNameExternalUnique(User user ) {
113
+        LambdaQueryWrapper<User> qw = new LambdaQueryWrapper<>();
114
+        qw.eq(User::getUserName, user.getUserName()).eq(User::getDelFlag, "0");
115
+        List<User> userList =this.getList(qw);
116
+        if (!StringHelper.isNull(userList) && userList.stream().count()>0) {
117
+
118
+            return false;
119
+        }
120
+        return true;
121
+    }
110 122
 
111 123
     /**
112 124
      * 校验用户昵称是否唯一

+ 20 - 0
zxdt-service/src/main/java/api/service/websocket/WebSocket.java

@@ -4,6 +4,7 @@ import api.entity.database.online.AutoReply;
4 4
 import api.entity.database.online.Message;
5 5
 import api.entity.database.system.Customer;
6 6
 import api.entity.input.online.MessageInput;
7
+import api.entity.input.system.CustomerInput;
7 8
 import api.entity.view.online.MessageView;
8 9
 import api.service.online.IAutoReplyService;
9 10
 import api.service.online.IMessageService;
@@ -645,6 +646,10 @@ public class WebSocket {
645 646
         if (!customers.containsKey(sendUser)) {
646 647
             customers.put(sendUser, 2);
647 648
             addCustomer(sendUser, 2, null);
649
+            log.info("添加customwe"+sendUser);
650
+
651
+
652
+
648 653
         }
649 654
 
650 655
         String kf = khkfs.get(sendUser);
@@ -833,6 +838,21 @@ public class WebSocket {
833 838
             customer.setFIsdelete(0L);
834 839
             webSocket.customerService.insert(customer);
835 840
         }
841
+        // 调用vs的接口
842
+        try{
843
+            String  huawuURL= SpringHelper.getRequiredProperty("huawuURL");
844
+            log.info("huawuURL---"+huawuURL);
845
+
846
+
847
+            String param="wxid="+userCode;
848
+            String datares= HttpHelper.sendGet(huawuURL+"Customer/AddCusDataByWx",param);
849
+
850
+            log.info("datares---"+datares);
851
+        }catch(Exception e) {
852
+            log.info(e.toString());
853
+        }
854
+
855
+
836 856
     }
837 857
 
838 858
     //客服置忙

+ 124 - 5
zxdt-util/src/main/java/api/util/helper/HttpHelper.java

@@ -1,16 +1,24 @@
1 1
 package api.util.helper;
2 2
 
3
+import com.alibaba.fastjson2.JSONObject;
3 4
 import lombok.extern.slf4j.Slf4j;
5
+import org.apache.http.HttpResponse;
6
+import org.apache.http.client.HttpClient;
7
+import org.apache.http.client.methods.HttpPost;
8
+import org.apache.http.entity.StringEntity;
9
+import org.apache.http.impl.client.HttpClients;
10
+import org.apache.http.util.EntityUtils;
11
+import org.bouncycastle.jcajce.provider.digest.MD5;
4 12
 import org.springframework.stereotype.Component;
5 13
 
6 14
 import javax.net.ssl.*;
7 15
 import java.io.*;
8
-import java.net.ConnectException;
9
-import java.net.SocketTimeoutException;
10
-import java.net.URL;
11
-import java.net.URLConnection;
16
+import java.net.*;
12 17
 import java.nio.charset.StandardCharsets;
13 18
 import java.security.cert.X509Certificate;
19
+import java.util.HashMap;
20
+import java.util.Map;
21
+import java.util.UUID;
14 22
 
15 23
 @Component
16 24
 @Slf4j
@@ -52,10 +60,17 @@ public class HttpHelper {
52 60
         BufferedReader in = null;
53 61
         try
54 62
         {
55
-            String urlNameString = StringHelper.isEmpty(param) ? url + "?" + param : url;
63
+            String urlNameString = !StringHelper.isEmpty(param) ? url + "?" + param : url;
56 64
             log.info("sendGet - {}", urlNameString);
57 65
             URL realUrl = new URL(urlNameString);
58 66
             URLConnection connection = realUrl.openConnection();
67
+             Map<String,String> map=new HashMap<>();
68
+             UUID uuid=UUID.randomUUID();
69
+             map.put("uuid", uuid.toString() );
70
+             map.put("pass",SecretHelper.MD5("liaotianxitong%@"+uuid.toString()));
71
+          for (Map.Entry<String,String> entry: map.entrySet()){
72
+              connection.setRequestProperty(entry.getKey(),entry.getValue());
73
+          }
59 74
             connection.setRequestProperty("accept", "*/*");
60 75
             connection.setRequestProperty("connection", "Keep-Alive");
61 76
             connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
@@ -118,6 +133,14 @@ public class HttpHelper {
118 133
             log.info("sendPost - {}", url);
119 134
             URL realUrl = new URL(url);
120 135
             URLConnection conn = realUrl.openConnection();
136
+            Map<String,String> map=new HashMap<>();
137
+            UUID uuid=UUID.randomUUID();
138
+            map.put("uuid", uuid.toString() );
139
+            map.put("pass",SecretHelper.MD5("liaotianxitong%@"+uuid.toString()));
140
+            for (Map.Entry<String,String> entry: map.entrySet()){
141
+                conn.setRequestProperty(entry.getKey(),entry.getValue());
142
+            }
143
+
121 144
             conn.setRequestProperty("accept", "*/*");
122 145
             conn.setRequestProperty("connection", "Keep-Alive");
123 146
             conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
@@ -228,6 +251,102 @@ public class HttpHelper {
228 251
         return result.toString();
229 252
     }
230 253
 
254
+    public  static String sendJson(String url,String json) {
255
+
256
+        try{
257
+        HttpClient httpClient = HttpClients.createDefault(); // 创建HTTP POST请求
258
+        HttpPost httpPost = new HttpPost(url);
259
+
260
+            Map<String,String> map=new HashMap<>();
261
+            UUID uuid=UUID.randomUUID();
262
+            map.put("uuid", uuid.toString() );
263
+            map.put("pass",SecretHelper.MD5("liaotianxitong%@"+uuid.toString()));
264
+            for (Map.Entry<String,String> entry: map.entrySet()){
265
+                httpPost.addHeader(entry.getKey(),entry.getValue());
266
+            }
267
+
268
+
269
+
270
+
271
+            // 设置HTTP POST请求的实体(JSON参数)
272
+        StringEntity entity = new StringEntity( json,"UTF-8");
273
+        entity.setContentType("application/json");
274
+
275
+        httpPost.setEntity(entity);
276
+
277
+
278
+
279
+
280
+        // 执行HTTP POST请求
281
+        HttpResponse response = httpClient.execute(httpPost);
282
+
283
+        // 打印响应状态
284
+        System.out.println("Response Code : " + response.getStatusLine().getStatusCode());
285
+
286
+        // 读取服务器响应内容
287
+        String responseBody = EntityUtils.toString(response.getEntity());
288
+        System.out.println("Response Body : " + responseBody);
289
+        return responseBody;
290
+
291
+    }catch (Exception e) {
292
+        e.printStackTrace();
293
+    }
294
+        return  "";
295
+    }
296
+
297
+    public  static  String sendJsonPost(String url, String jsonData){
298
+        PrintWriter out=null;
299
+        BufferedReader in =null;
300
+        StringBuilder result=new StringBuilder();
301
+        try {
302
+            URL realurl = new URL(url);
303
+            URLConnection con = realurl.openConnection();
304
+            HttpURLConnection conn = (HttpURLConnection) con;
305
+            conn.setRequestMethod("POST");
306
+            conn.setConnectTimeout(5 * 1000);
307
+            conn.setRequestProperty("accept", "*/*");
308
+            conn.setRequestProperty("connection", "Keep-Alive");
309
+            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible;MSIE 6.0; Windows NT 5.1;SV1)");
310
+            conn.setRequestProperty("Content-Type",
311
+                    "application/json"); // 设置内容类型
312
+// 发送POST请求必须设置如下两行 conn.setDoOutput(true); conn.setDoInput(true);
313
+            conn.setUseCaches(false);
314
+// 获舰URLConnection对象对应的输出流
315
+            out = new PrintWriter(new OutputStreamWriter(
316
+                    conn.getOutputStream(), "utf-8"));
317
+            out.write(jsonData);
318
+            out.flush();
319
+            in = new BufferedReader(
320
+                    new InputStreamReader(conn.getInputStream()));
321
+            String line;
322
+            while ((line = in.readLine()) != null) {
323
+                result.append(line);
324
+
325
+            }
326
+            byte[] bresult = result.toString().getBytes();
327
+            result = new StringBuilder(new String(bresult, "utf-8"));
328
+
329
+        }  catch (MalformedURLException e) {
330
+            throw new RuntimeException(e);
331
+        } catch (IOException e) {
332
+            throw new RuntimeException(e);
333
+        }
334
+finally {
335
+            try {
336
+                if(out!=null){
337
+                    out.close();
338
+                }if(in!=null){
339
+                    in.close();
340
+                }
341
+
342
+            }
343
+            catch (IOException ex){
344
+                ex.printStackTrace();
345
+            }
346
+        }
347
+        return result.toString();
348
+
349
+    }
231 350
     private static class TrustAnyTrustManager implements X509TrustManager
232 351
     {
233 352
         @Override