|
@@ -10,6 +10,7 @@ import com.community.huiju.model.*;
|
10
|
10
|
import com.community.huiju.service.ITaUserService;
|
11
|
11
|
import com.community.huiju.service.ImageServiceI;
|
12
|
12
|
import com.community.huiju.service.SocialServiceI;
|
|
13
|
+import com.community.huiju.vo.TpTicketVO;
|
13
|
14
|
import com.github.pagehelper.Page;
|
14
|
15
|
import com.github.pagehelper.PageHelper;
|
15
|
16
|
import com.google.common.collect.Maps;
|
|
@@ -106,6 +107,12 @@ public class SocialServiceImpl implements SocialServiceI {
|
106
|
107
|
@Autowired
|
107
|
108
|
private ITaUserService iTaUserService;
|
108
|
109
|
|
|
110
|
+ @Autowired
|
|
111
|
+ private TpUserMapper tpUserMapperr;
|
|
112
|
+
|
|
113
|
+ @Autowired
|
|
114
|
+ private TpTicketRecordCommentMapper tpTicketRecordCommentMapper;
|
|
115
|
+
|
109
|
116
|
@Override
|
110
|
117
|
@Transactional
|
111
|
118
|
public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId, Integer userId) {
|
|
@@ -775,7 +782,6 @@ public class SocialServiceImpl implements SocialServiceI {
|
775
|
782
|
return response;
|
776
|
783
|
}
|
777
|
784
|
|
778
|
|
-
|
779
|
785
|
@Override
|
780
|
786
|
public void accessTicket(Integer communityId, TpTicket tpTicket, String ticketId, Integer userId) {
|
781
|
787
|
//修改工单内容和评分
|
|
@@ -1009,4 +1015,488 @@ public class SocialServiceImpl implements SocialServiceI {
|
1009
|
1015
|
responseBean.addSuccess(replies);
|
1010
|
1016
|
return responseBean;
|
1011
|
1017
|
}
|
1012
|
|
-}
|
|
1018
|
+
|
|
1019
|
+ @Override
|
|
1020
|
+ public ResponseBean tpTransactionManageList(String loginName, Integer status, Integer pageNum, Integer pageSize,String transactionTitle,Integer communityId) {
|
|
1021
|
+ ResponseBean responseBean= new ResponseBean();
|
|
1022
|
+ // 拿到当前用户在物业端的信息
|
|
1023
|
+ TpUser tpUser= tpUserMapperr.selectLoginName(loginName,communityId);
|
|
1024
|
+ if( null == tpUser ){
|
|
1025
|
+ responseBean.addError("号码在物业端不存在");
|
|
1026
|
+ return responseBean;
|
|
1027
|
+ }
|
|
1028
|
+ // 查出当前小区小下的所有帖子
|
|
1029
|
+ Map<String, Object> parameter = Maps.newHashMap();
|
|
1030
|
+ Page<TpTransaction> pageList = PageHelper.startPage(pageNum, pageSize);
|
|
1031
|
+ List<TpTransaction> tpTransactionManageList= tpTransactionMapper.tpTransactionManageList(tpUser.getCommunityId(),status,transactionTitle);
|
|
1032
|
+
|
|
1033
|
+ for (TpTransaction tpTransaction:tpTransactionManageList){
|
|
1034
|
+ // 统计举报整数
|
|
1035
|
+ int transactionReplyCount= tpTransactionReportMapper.selectCount(tpTransaction.getId(),tpTransaction.getCommunityId());
|
|
1036
|
+ tpTransaction.setTransactionReplyCount(transactionReplyCount);
|
|
1037
|
+ // 统计举报列表
|
|
1038
|
+ List<TpTransactionReport> transactionReplyList= tpTransactionReportMapper.transactionReplyList(tpTransaction.getId(),tpTransaction.getCommunityId());
|
|
1039
|
+ tpTransaction.setTpTransactionReport(transactionReplyList);
|
|
1040
|
+ // 发帖人身份
|
|
1041
|
+ if (tpTransaction.getUuidType().equals("app")) {
|
|
1042
|
+ TaUser taUser = taUserMapper.selectByPrimaryKey(taUserVerifyMapper.selectByPrimaryKey(tpTransaction.getUuid()).getUserId());
|
|
1043
|
+ tpTransaction.setTelephone(taUser.getLoginName());
|
|
1044
|
+ TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(taUserVerifyMapper.selectByPrimaryKey(tpTransaction.getUuid()).getRoleId());
|
|
1045
|
+ tpTransaction.setRoleId(taSysRole.getId());
|
|
1046
|
+ tpTransaction.setRoleName(taSysRole.getRoleName());
|
|
1047
|
+ }
|
|
1048
|
+ if (tpTransaction.getUuidType().equals("prop")) {
|
|
1049
|
+ TpUser user = tpUserMapper.selectByPrimaryKey(tpTransaction.getUuid());
|
|
1050
|
+ tpTransaction.setTelephone(user.getLoginName());
|
|
1051
|
+ tpTransaction.setRoleName("物业");
|
|
1052
|
+ }
|
|
1053
|
+
|
|
1054
|
+ }
|
|
1055
|
+ parameter.put("list", tpTransactionManageList);
|
|
1056
|
+ parameter.put("total", pageList.getTotal());
|
|
1057
|
+ responseBean.addSuccess(parameter);
|
|
1058
|
+ return responseBean;
|
|
1059
|
+ }
|
|
1060
|
+
|
|
1061
|
+ @Override
|
|
1062
|
+ public ResponseBean transactionsDelete(String paramets) {
|
|
1063
|
+ ResponseBean response = new ResponseBean();
|
|
1064
|
+ JSONObject parseObject = JSONObject.parseObject(paramets);
|
|
1065
|
+ // 根据电话号码查出物业端信息
|
|
1066
|
+ String loginName = parseObject.getString("loginName");
|
|
1067
|
+ Integer communityId = parseObject.getInteger("communityId");
|
|
1068
|
+ TpUser tpUser= tpUserMapper.selectLoginName(loginName,communityId);
|
|
1069
|
+
|
|
1070
|
+ JSONArray tpTransactionIdId = parseObject.getJSONArray("id");
|
|
1071
|
+ Integer[] tpTransactionIdArray = tpTransactionIdId.toArray(new Integer[]{});
|
|
1072
|
+ for (Integer id : tpTransactionIdArray) {
|
|
1073
|
+ TpTransaction tpTransaction = new TpTransaction();
|
|
1074
|
+ tpTransaction.setId(id);
|
|
1075
|
+ tpTransaction.setStatus("0");
|
|
1076
|
+ tpTransaction.setUpdateDate(new Date());
|
|
1077
|
+ tpTransaction.setUpdateUser(tpUser.getId());
|
|
1078
|
+ tpTransactionMapper.updateByPrimaryKeySelective(tpTransaction);
|
|
1079
|
+ }
|
|
1080
|
+ response.addSuccess("成功");
|
|
1081
|
+ return response;
|
|
1082
|
+ }
|
|
1083
|
+
|
|
1084
|
+ @Override
|
|
1085
|
+ public ResponseBean tpTransactionReportDelete(String paramets) {
|
|
1086
|
+ ResponseBean response = new ResponseBean();
|
|
1087
|
+ JSONObject parseObject = JSONObject.parseObject(paramets);
|
|
1088
|
+ // 根据电话号码查出物业端信息
|
|
1089
|
+ Integer communityId = parseObject.getInteger("communityId");
|
|
1090
|
+ String loginName = parseObject.getString("loginName");
|
|
1091
|
+ TpUser tpUser = tpUserMapper.selectLoginName(loginName,communityId);
|
|
1092
|
+
|
|
1093
|
+ JSONArray tpTransactionIdId = parseObject.getJSONArray("id");
|
|
1094
|
+ Integer[] tpTransactionReportArray = tpTransactionIdId.toArray(new Integer[]{});
|
|
1095
|
+ for (Integer TpTransactionReport:tpTransactionReportArray){
|
|
1096
|
+ tpTransactionReportMapper.deleteTransactionReport(TpTransactionReport,tpUser.getCommunityId());
|
|
1097
|
+ }
|
|
1098
|
+ response.addSuccess("成功");
|
|
1099
|
+ return response;
|
|
1100
|
+ }
|
|
1101
|
+
|
|
1102
|
+ @Override
|
|
1103
|
+ public ResponseBean transactionsAdd(String paramets) {
|
|
1104
|
+ JSONObject object= JSONObject.parseObject(paramets);
|
|
1105
|
+ Integer communityId = object.getInteger("communityId");
|
|
1106
|
+ String loginName = object.getString("loginName");
|
|
1107
|
+ TpUser tpUser= tpUserMapper.selectLoginName(loginName,Integer.valueOf(communityId));
|
|
1108
|
+
|
|
1109
|
+ Integer id = tpUser.getId();
|
|
1110
|
+ ResponseBean response = new ResponseBean();
|
|
1111
|
+
|
|
1112
|
+ JSONObject jsonobject = JSONObject.parseObject(paramets);
|
|
1113
|
+
|
|
1114
|
+ TpTransaction tpTransaction = JSONObject.parseObject(paramets, TpTransaction.class);
|
|
1115
|
+ tpTransaction.setCommunityId(communityId);
|
|
1116
|
+ tpTransaction.setUuid(id);
|
|
1117
|
+ tpTransaction.setUuidType("prop");
|
|
1118
|
+ tpTransaction.setUuidName(tpUser.getUserName());
|
|
1119
|
+ tpTransaction.setCreateDate(new Date());
|
|
1120
|
+ tpTransaction.setCreateUser(id);
|
|
1121
|
+ tpTransaction.setViewCount(0);
|
|
1122
|
+ tpTransaction.setIsReported("0");
|
|
1123
|
+ tpTransaction.setReleaseIdentity("1");
|
|
1124
|
+ tpTransactionMapper.insertSelective(tpTransaction);
|
|
1125
|
+ JSONArray contentImg = jsonobject.getJSONArray("contentImg");
|
|
1126
|
+
|
|
1127
|
+ String[] contentImgArray = contentImg.toArray(new String[]{});
|
|
1128
|
+ if (tpTransaction.getTransactionTitle() == null) {
|
|
1129
|
+ response.addError("标题不能为空");
|
|
1130
|
+ return response;
|
|
1131
|
+ }
|
|
1132
|
+ if (null == tpTransaction.getTransactionContent() && null == contentImg) {
|
|
1133
|
+ response.addError("内容和图片必须填一个");
|
|
1134
|
+ return response;
|
|
1135
|
+ }
|
|
1136
|
+ for (String img : contentImgArray) {
|
|
1137
|
+ TdImages tdImages = new TdImages();
|
|
1138
|
+ tdImages.setImageUrl(img);
|
|
1139
|
+ tdImages.setType("transaction");
|
|
1140
|
+ tdImages.setUuid(tpTransaction.getId());
|
|
1141
|
+ tdImages.setCreateTime(new Date());
|
|
1142
|
+ tdImages.setCreateUser(id);
|
|
1143
|
+ tdImagesMapper.insert(tdImages);
|
|
1144
|
+ }
|
|
1145
|
+ return response;
|
|
1146
|
+ }
|
|
1147
|
+
|
|
1148
|
+ @Override
|
|
1149
|
+ public ResponseBean transactionsRead(String paramets) {
|
|
1150
|
+ ResponseBean response = new ResponseBean();
|
|
1151
|
+ JSONObject parseObject = JSONObject.parseObject(paramets);
|
|
1152
|
+ // 根据电话号码查出物业端信息
|
|
1153
|
+ String loginName = parseObject.getString("loginName");
|
|
1154
|
+ Integer communityId = parseObject.getInteger("communityId");
|
|
1155
|
+ TpUser tpUser = tpUserMapper.selectLoginName(loginName, communityId);
|
|
1156
|
+
|
|
1157
|
+ JSONArray tpTransactionIdId = parseObject.getJSONArray("id");
|
|
1158
|
+ Integer[] tpTransactionIdArray = tpTransactionIdId.toArray(new Integer[]{});
|
|
1159
|
+ for (Integer id : tpTransactionIdArray) {
|
|
1160
|
+ TpTransaction tpTransaction = new TpTransaction();
|
|
1161
|
+ tpTransaction.setId(id);
|
|
1162
|
+ tpTransaction.setReadStatus("1");
|
|
1163
|
+ tpTransaction.setUpdateDate(new Date());
|
|
1164
|
+ tpTransaction.setUpdateUser(tpUser.getId());
|
|
1165
|
+ tpTransactionMapper.updateByPrimaryKeySelective(tpTransaction);
|
|
1166
|
+ }
|
|
1167
|
+ response.addSuccess("成功");
|
|
1168
|
+ return response;
|
|
1169
|
+ }
|
|
1170
|
+
|
|
1171
|
+ @Override
|
|
1172
|
+ public ResponseBean tpTicketManageList(String loginName, Integer status, Integer pageNum, Integer pageSize, Integer communityId) {
|
|
1173
|
+ ResponseBean response = new ResponseBean<>();
|
|
1174
|
+
|
|
1175
|
+ TpUser tpUser = tpUserMapperr.selectLoginName(loginName, communityId);
|
|
1176
|
+ Page<TpTransaction> pageList = PageHelper.startPage(pageNum, pageSize);
|
|
1177
|
+ List<TpTicket> tpTicketList = tpTicketMapper.ticketList(status, tpUser.getCommunityId());
|
|
1178
|
+ HashMap map = new HashMap<>();
|
|
1179
|
+ map.put("list", tpTicketList);
|
|
1180
|
+ map.put("total", pageList.getTotal());
|
|
1181
|
+ response.addSuccess(map);
|
|
1182
|
+ return response;
|
|
1183
|
+ }
|
|
1184
|
+
|
|
1185
|
+ @Override
|
|
1186
|
+ public ResponseBean tpTicketManageDetails(Integer tickedID,Integer communityId,String loginName) {
|
|
1187
|
+ // 获取物业端的用户信息
|
|
1188
|
+ TpUser tpUser= tpUserMapper.selectLoginName(loginName,communityId);
|
|
1189
|
+ ResponseBean response = new ResponseBean();
|
|
1190
|
+ TpTicketVO ticketVO = tpTicketMapper.ticketDetails(tickedID);
|
|
1191
|
+ // 从taUserVerify里面获取userID
|
|
1192
|
+ TaUserVerify taUserVerify = taUserVerifyMapper.selectByPrimaryKey(ticketVO.getCreateUser());
|
|
1193
|
+ TaUser taUser = taUserMapper.selectByPrimaryKey(taUserVerify.getUserId());
|
|
1194
|
+ /*发起人*/
|
|
1195
|
+ ticketVO.setCreateUserNmae(taUser.getUserName());
|
|
1196
|
+ /*发起人手机号码*/
|
|
1197
|
+ ticketVO.setLoginName(taUser.getLoginName());
|
|
1198
|
+ /*查询当前受理人*/
|
|
1199
|
+ ticketVO.setTpUserNmae(tpUserMapper.selectByIdUserName(ticketVO.getTpUserId()));
|
|
1200
|
+ /*查询所有物业的人员,并排除自身*/
|
|
1201
|
+ ticketVO.setTpUsersList(tpUserMapper.getUser(tpUser.getId(), communityId));
|
|
1202
|
+ /*本人*/
|
|
1203
|
+ ticketVO.setCurrentUserName(tpUser.getId()+"");
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+ /*查询工单类容的图片*/
|
|
1207
|
+ List<TdImages> tdImages = tdImagesMapper.selectImages(tickedID,Constant.SERVICE);
|
|
1208
|
+ List<String> contentImg = new ArrayList<String>();
|
|
1209
|
+ for (TdImages images : tdImages) {
|
|
1210
|
+ contentImg.add(images.getImageUrl());
|
|
1211
|
+ }
|
|
1212
|
+ ticketVO.setContentImageUrl(contentImg);
|
|
1213
|
+
|
|
1214
|
+ /*工单状态*/
|
|
1215
|
+ List<TpTicketRecord> ticketRecordList = tpTicketRecordMapper.selectListTicketStatus(tickedID);
|
|
1216
|
+ ticketVO.setRecordList(ticketRecordList);
|
|
1217
|
+
|
|
1218
|
+ for (TpTicketRecord ticketRecord : ticketRecordList) {
|
|
1219
|
+ /*对话详情*/
|
|
1220
|
+ List<TpTicketRecordComment> tpTicketRecordCommentList = tpTicketRecordCommentMapper.selectList(tickedID,ticketRecord.getId());
|
|
1221
|
+ ticketRecord.setStatusContent(tpTicketRecordCommentList);
|
|
1222
|
+ /* 遍历当前对话信息组装图片*/
|
|
1223
|
+ for (TpTicketRecordComment tpTicketRecordComment : tpTicketRecordCommentList) {
|
|
1224
|
+ /*注意reply用于标记工单回复类的图片*/
|
|
1225
|
+ List<TdImages> ticketRecordCommentImages = tdImagesMapper.selectImages(tpTicketRecordComment.getId(),"reply");
|
|
1226
|
+ tpTicketRecordComment.setImgURL(ticketRecordCommentImages);
|
|
1227
|
+ }
|
|
1228
|
+ }
|
|
1229
|
+ /*根据状态得到相应的步骤名称*/
|
|
1230
|
+ for (TpTicketRecord tpTicketRecord : ticketRecordList) {
|
|
1231
|
+ String statusName = tpTicketRecordMapper.statusName(tpTicketRecord.getStatus());
|
|
1232
|
+ tpTicketRecord.setStatusName(statusName);
|
|
1233
|
+ }
|
|
1234
|
+ response.addSuccess(ticketVO);
|
|
1235
|
+ return response;
|
|
1236
|
+ }
|
|
1237
|
+
|
|
1238
|
+ @Override
|
|
1239
|
+ public ResponseBean tpTicketManageReply(String parameter) {
|
|
1240
|
+ ResponseBean response=new ResponseBean();
|
|
1241
|
+ JSONObject object= JSONObject.parseObject(parameter);
|
|
1242
|
+ String loginName = object.getString("loginName");
|
|
1243
|
+ Integer communityId = object.getInteger("communityId");
|
|
1244
|
+ /*查询在物业端的信息*/
|
|
1245
|
+ TpUser tpUser= tpUserMapper.selectLoginName(loginName,communityId);
|
|
1246
|
+
|
|
1247
|
+ String content = object.getString("content");
|
|
1248
|
+ Integer ticketId = object.getInteger("ticketId");
|
|
1249
|
+ Integer status = object.getInteger("status");
|
|
1250
|
+
|
|
1251
|
+ /*根据工单Id和状态查出工单记录ID*/
|
|
1252
|
+ TpTicket tpTicket= tpTicketMapper.selectByPrimaryKey(ticketId);
|
|
1253
|
+ TpTicketRecord ticketRecord= tpTicketRecordMapper.selectTpTicketRecord(ticketId, Integer.valueOf(tpTicket.getStatus()));
|
|
1254
|
+ TpTicketRecordComment tpTicketRecordComment= new TpTicketRecordComment();
|
|
1255
|
+ tpTicketRecordComment.setCommunityId(communityId);
|
|
1256
|
+ tpTicketRecordComment.setContent(content);
|
|
1257
|
+ tpTicketRecordComment.setTicketId(ticketId);
|
|
1258
|
+ tpTicketRecordComment.setTicketRecordId(ticketRecord.getId());
|
|
1259
|
+ tpTicketRecordComment.setUuid(tpUser.getId());
|
|
1260
|
+ tpTicketRecordComment.setUserType("0");
|
|
1261
|
+ tpTicketRecordComment.setUserName(tpUser.getUserName());
|
|
1262
|
+ tpTicketRecordComment.setCreateDate(new Date());
|
|
1263
|
+ tpTicketRecordCommentMapper.insert(tpTicketRecordComment);
|
|
1264
|
+ JSONArray contentImg = object.getJSONArray("imageUrl");
|
|
1265
|
+ if (null!=contentImg){
|
|
1266
|
+ String[] contentImgArray = contentImg.toArray(new String[]{});
|
|
1267
|
+
|
|
1268
|
+ for (String img : contentImgArray) {
|
|
1269
|
+ TdImages tdImages = new TdImages();
|
|
1270
|
+ tdImages.setImageUrl(img);
|
|
1271
|
+ /*注意reply用于标记工单回复类的图片*/
|
|
1272
|
+ tdImages.setType("reply");
|
|
1273
|
+ tdImages.setUuid(tpTicketRecordComment.getId());
|
|
1274
|
+ tdImages.setCreateTime(new Date());
|
|
1275
|
+ tdImages.setCreateUser(tpUser.getId());
|
|
1276
|
+ tdImagesMapper.insert(tdImages);
|
|
1277
|
+ }
|
|
1278
|
+ }
|
|
1279
|
+ //1.5维护工单对话推送到app消息
|
|
1280
|
+ TpMessage message = new TpMessage();
|
|
1281
|
+ message.setCommunityId(communityId);
|
|
1282
|
+ message.setMessageType(tpTicket.getType());
|
|
1283
|
+ message.setTicketId(tpTicket.getId());
|
|
1284
|
+ message.setAdviceType("1");
|
|
1285
|
+ message.setUuid(tpTicket.getCreateUser());
|
|
1286
|
+ message.setModelType("1");
|
|
1287
|
+ message.setUuidType("1");
|
|
1288
|
+ message.setSource("2");
|
|
1289
|
+ message.setMessageContent("物业回复您:"+content);
|
|
1290
|
+ message.setStatus("1");
|
|
1291
|
+ message.setReadStatus("0");
|
|
1292
|
+ message.setCreateUser(tpTicket.getCreateUser());
|
|
1293
|
+ message.setCreateDate(new Date());
|
|
1294
|
+ message.setTicketId(ticketId);
|
|
1295
|
+ response.addSuccess("成功");
|
|
1296
|
+ tpMessageMapper.insert(message);
|
|
1297
|
+ return response;
|
|
1298
|
+ }
|
|
1299
|
+
|
|
1300
|
+ @Override
|
|
1301
|
+ public ResponseBean ticketManageRecord(String parameter) {
|
|
1302
|
+ ResponseBean response=new ResponseBean();
|
|
1303
|
+ JSONObject object= JSONObject.parseObject(parameter);
|
|
1304
|
+ String loginName = object.getString("loginName");
|
|
1305
|
+ Integer communityId = object.getInteger("communityId");
|
|
1306
|
+ Integer ticketId = object.getInteger("ticketId");
|
|
1307
|
+ /*当前处理人ID */
|
|
1308
|
+ String status = object.getString("status");
|
|
1309
|
+ Integer userID = object.getInteger("id");
|
|
1310
|
+ /*查询在物业端的信息*/
|
|
1311
|
+ TpUser tpUser= tpUserMapper.selectLoginName(loginName,communityId);
|
|
1312
|
+
|
|
1313
|
+ /**注意,这是受理人信息,不是当前用户信息*/
|
|
1314
|
+ TpUser userName= tpUserMapper.selectByPrimaryKey(userID);
|
|
1315
|
+ TpTicket tpTicket= new TpTicket();
|
|
1316
|
+ tpTicket.setId(ticketId);
|
|
1317
|
+ tpTicket.setStatus("3");
|
|
1318
|
+ tpTicket.setTpUserId(userID);
|
|
1319
|
+ tpTicket.setUpdateDate(new Date());
|
|
1320
|
+ tpTicketMapper.updateByPrimaryKeySelective(tpTicket);
|
|
1321
|
+
|
|
1322
|
+ TpTicketRecord tpTicketRecord= new TpTicketRecord();
|
|
1323
|
+ tpTicketRecord.setCommunityId(communityId);
|
|
1324
|
+ tpTicketRecord.setTicketId(ticketId);
|
|
1325
|
+ tpTicketRecord.setContent("您的联系单已经分配给物业处理人员" + userName.getUserName()+",联系方式:" + userName.getLoginName());
|
|
1326
|
+ tpTicketRecord.setStatus("3");
|
|
1327
|
+ tpTicketRecord.setCreateUser(tpUser.getId());
|
|
1328
|
+ tpTicketRecord.setCreateDate(new Date());
|
|
1329
|
+ tpTicketRecordMapper.insert(tpTicketRecord);
|
|
1330
|
+
|
|
1331
|
+ //待办模板
|
|
1332
|
+ TpTicket ticket = tpTicketMapper.getTicketTpUserId(ticketId,communityId);
|
|
1333
|
+ TpMessage message = new TpMessage();
|
|
1334
|
+ message.setCommunityId(communityId);
|
|
1335
|
+ message.setMessageType(ticket.getType());
|
|
1336
|
+ message.setTicketId(ticket.getId());
|
|
1337
|
+ message.setAdviceType("4");
|
|
1338
|
+ message.setUuid(userID);
|
|
1339
|
+ message.setModelType("2");
|
|
1340
|
+ message.setUuidType("2");
|
|
1341
|
+ message.setSource("2");
|
|
1342
|
+ message.setMessageContent("工单“" + ticket.getTicketTitle() + "”已被分配给您,点击查看并处理");
|
|
1343
|
+ message.setStatus("1");
|
|
1344
|
+ message.setReadStatus("0");
|
|
1345
|
+ message.setCreateUser(tpUser.getId());
|
|
1346
|
+ message.setCreateDate(new Date());
|
|
1347
|
+ message.setTicketId(ticketId);
|
|
1348
|
+ tpMessageMapper.insert(message);
|
|
1349
|
+ //如果分配给本人维护消息模板
|
|
1350
|
+ if (null!=userID&userID.equals(tpUser.getId())){
|
|
1351
|
+ message.setModelType("1");
|
|
1352
|
+ tpMessageMapper.insert(message);
|
|
1353
|
+ }
|
|
1354
|
+ //分配成功后推送app
|
|
1355
|
+ message.setUuidType("1");
|
|
1356
|
+ message.setUuid(ticket.getCreateUser());
|
|
1357
|
+ message.setMessageContent("工单“" + ticket.getTicketTitle() + "”已被分配给:"+userName.getUserName());
|
|
1358
|
+ message.setAdviceType("1");
|
|
1359
|
+ tpMessageMapper.insert(message);
|
|
1360
|
+ response.addSuccess("成功");
|
|
1361
|
+ return response;
|
|
1362
|
+ }
|
|
1363
|
+
|
|
1364
|
+ @Override
|
|
1365
|
+ public ResponseBean updateTicketStatus(String parameter) {
|
|
1366
|
+ /*拒绝处理仅在待分配的情况下修改,由前台控制拒绝处理的按钮是否显示*/
|
|
1367
|
+ ResponseBean response = new ResponseBean();
|
|
1368
|
+ JSONObject object = JSONObject.parseObject(parameter);
|
|
1369
|
+ String loginName = object.getString("loginName");
|
|
1370
|
+ Integer communityId = object.getInteger("communityId");
|
|
1371
|
+ /**查询当前app用户在物业端的信息**/
|
|
1372
|
+ TpUser tpUser = tpUserMapper.selectLoginName(loginName,communityId);
|
|
1373
|
+
|
|
1374
|
+ Integer ticketId = object.getInteger("ticketId");
|
|
1375
|
+ String textContent = object.getString("textContent");
|
|
1376
|
+ TpTicket tpTicket = new TpTicket();
|
|
1377
|
+ tpTicket.setId(ticketId);
|
|
1378
|
+ tpTicket.setStatus("1");
|
|
1379
|
+ tpTicket.setUpdateUser(tpUser.getId());
|
|
1380
|
+ tpTicket.setUpdateDate(new Date());
|
|
1381
|
+ tpTicketMapper.updateByPrimaryKeySelective(tpTicket);
|
|
1382
|
+ /*查询当前处理人的名字*/
|
|
1383
|
+
|
|
1384
|
+ TpTicketRecord tpTicketRecord = new TpTicketRecord();
|
|
1385
|
+ tpTicketRecord.setTicketId(ticketId);
|
|
1386
|
+ tpTicketRecord.setContent("您的报修被物业人员" + tpUser.getUserName() + "拒绝接受理,原因:" + textContent + ",有问题可以联系" + tpUser.getUserName() + ":联系方式:" + tpUser.getLoginName());
|
|
1387
|
+ tpTicketRecord.setCommunityId(communityId);
|
|
1388
|
+ tpTicketRecord.setStatus("1");
|
|
1389
|
+ tpTicketRecord.setCreateUser(tpUser.getId());
|
|
1390
|
+ tpTicketRecord.setCreateDate(new Date());
|
|
1391
|
+ tpTicketRecordMapper.insert(tpTicketRecord);
|
|
1392
|
+ /*把内容添加到对话中*/
|
|
1393
|
+ TpTicketRecordComment ticketRecordComment = new TpTicketRecordComment();
|
|
1394
|
+ ticketRecordComment.setCommunityId(communityId);
|
|
1395
|
+ ticketRecordComment.setTicketId(ticketId);
|
|
1396
|
+ ticketRecordComment.setTicketRecordId(tpTicketRecord.getId());
|
|
1397
|
+ ticketRecordComment.setUuid(tpUser.getId());
|
|
1398
|
+ ticketRecordComment.setUserType("0");
|
|
1399
|
+ ticketRecordComment.setContent("拒绝受理,原因——" + textContent);
|
|
1400
|
+ ticketRecordComment.setUserName(tpUser.getUserName());
|
|
1401
|
+ ticketRecordComment.setCreateDate(new Date());
|
|
1402
|
+ tpTicketRecordCommentMapper.insert(ticketRecordComment);
|
|
1403
|
+
|
|
1404
|
+ //维护1.5版本
|
|
1405
|
+ TpMessage message = new TpMessage();
|
|
1406
|
+ TpTicket ticket = tpTicketMapper.getTicketTpUserId(ticketId,communityId);
|
|
1407
|
+ message.setCommunityId(communityId);
|
|
1408
|
+ message.setMessageType(ticket.getType());
|
|
1409
|
+ message.setTicketId(ticket.getId());
|
|
1410
|
+ message.setAdviceType("1");
|
|
1411
|
+ message.setUuid(ticket.getCreateUser());
|
|
1412
|
+ message.setModelType("1");
|
|
1413
|
+ message.setUuidType("1");
|
|
1414
|
+ message.setSource("2");
|
|
1415
|
+ message.setMessageContent("您的工单“" + ticket.getTicketTitle() + "”已被拒绝受理");
|
|
1416
|
+ message.setStatus("1");
|
|
1417
|
+ message.setReadStatus("0");
|
|
1418
|
+ message.setCreateUser(tpUser.getId());
|
|
1419
|
+ message.setCreateDate(new Date());
|
|
1420
|
+ message.setTicketId(ticketId);
|
|
1421
|
+ tpMessageMapper.insert(message);
|
|
1422
|
+ response.addSuccess("成功");
|
|
1423
|
+ return response;
|
|
1424
|
+ }
|
|
1425
|
+
|
|
1426
|
+ @Override
|
|
1427
|
+ public ResponseBean updateTicket(String parameter) {
|
|
1428
|
+ ResponseBean response=new ResponseBean();
|
|
1429
|
+ JSONObject object= JSONObject.parseObject(parameter);
|
|
1430
|
+ String loginName = object.getString("loginName");
|
|
1431
|
+ Integer communityId = object.getInteger("communityId");
|
|
1432
|
+ /**查询当前app用户在物业端的信息**/
|
|
1433
|
+ TpUser tpUser = tpUserMapper.selectLoginName(loginName,communityId);
|
|
1434
|
+
|
|
1435
|
+ String content = object.getString("content");
|
|
1436
|
+ Integer ticketId = object.getInteger("ticketId");
|
|
1437
|
+ TpTicket tpTicket= new TpTicket();
|
|
1438
|
+ tpTicket.setId(ticketId);
|
|
1439
|
+ tpTicket.setStatus("4");
|
|
1440
|
+ tpTicket.setUpdateDate(new Date());
|
|
1441
|
+ tpTicketMapper.updateByPrimaryKeySelective(tpTicket);
|
|
1442
|
+ /**维护工单处理表**/
|
|
1443
|
+ TpTicketRecord tpTicketRecord = new TpTicketRecord();
|
|
1444
|
+ tpTicketRecord.setCommunityId(communityId);
|
|
1445
|
+ tpTicketRecord.setTicketId(ticketId);
|
|
1446
|
+ TpTicket tpTicketUserID= tpTicketMapper.selectByPrimaryKey(ticketId);
|
|
1447
|
+ tpTicketRecord.setContent("物业工作人员"+tpUser.getUserName()+"已经处理结束,如果没有问题请给好评,联系方式:"+tpUser.getLoginName());
|
|
1448
|
+ tpTicketRecord.setStatus("4");
|
|
1449
|
+ tpTicketRecord.setCreateUser(tpUser.getId());
|
|
1450
|
+ tpTicketRecord.setCreateDate(new Date());
|
|
1451
|
+ tpTicketRecordMapper.insert(tpTicketRecord);
|
|
1452
|
+ /*维护对话*/
|
|
1453
|
+ TpTicketRecordComment tpTicketRecordComment= new TpTicketRecordComment();
|
|
1454
|
+ tpTicketRecordComment.setCommunityId(communityId);
|
|
1455
|
+ tpTicketRecordComment.setTicketId(ticketId);
|
|
1456
|
+ tpTicketRecordComment.setTicketRecordId(tpTicketRecord.getId());
|
|
1457
|
+ tpTicketRecordComment.setUuid(tpUser.getId());
|
|
1458
|
+ tpTicketRecordComment.setUserType("0");
|
|
1459
|
+ tpTicketRecordComment.setContent("处理结果如下____"+content);
|
|
1460
|
+ tpTicketRecordComment.setUserName(tpUser.getUserName());
|
|
1461
|
+ tpTicketRecordComment.setCreateDate(new Date());
|
|
1462
|
+ tpTicketRecordCommentMapper.insert(tpTicketRecordComment);
|
|
1463
|
+ /* 传入图片*/
|
|
1464
|
+ JSONArray contentImg = object.getJSONArray("imageUrl");
|
|
1465
|
+ if (null!=contentImg){
|
|
1466
|
+ String[] contentImgArray = contentImg.toArray(new String[]{});
|
|
1467
|
+ for (String img : contentImgArray) {
|
|
1468
|
+ TdImages tdImages = new TdImages();
|
|
1469
|
+ tdImages.setImageUrl(img);
|
|
1470
|
+ /*注意reply用于标记工单回复类的图片*/
|
|
1471
|
+ tdImages.setType(Constant.REPLY);
|
|
1472
|
+ tdImages.setUuid(tpTicketRecordComment.getId());
|
|
1473
|
+ tdImages.setCreateTime(new Date());
|
|
1474
|
+ tdImages.setCreateUser(tpUser.getId());
|
|
1475
|
+ tdImagesMapper.insert(tdImages);
|
|
1476
|
+ }
|
|
1477
|
+ }
|
|
1478
|
+ //分配成功后这只messgae消息表status为无效
|
|
1479
|
+ tpMessageMapper.updateTickMessageStatus(ticketId);
|
|
1480
|
+
|
|
1481
|
+ // 处理完成后推送app
|
|
1482
|
+ TpTicket ticket = tpTicketMapper.getTicketTpUserId(ticketId,tpUser.getCommunityId());
|
|
1483
|
+ TpMessage message= new TpMessage();
|
|
1484
|
+ message.setCommunityId(tpUser.getCommunityId());
|
|
1485
|
+ message.setMessageType(ticket.getType());
|
|
1486
|
+ message.setTicketId(ticket.getId());
|
|
1487
|
+ message.setAdviceType("1");
|
|
1488
|
+ message.setUuid(ticket.getCreateUser());
|
|
1489
|
+ message.setModelType("1");
|
|
1490
|
+ message.setUuidType("1");
|
|
1491
|
+ message.setSource("2");
|
|
1492
|
+ message.setMessageContent("您的工单“" + ticket.getTicketTitle() + "”已处理完成,请查看详情");
|
|
1493
|
+ message.setStatus("1");
|
|
1494
|
+ message.setReadStatus("0");
|
|
1495
|
+ message.setCreateUser(tpUser.getId());
|
|
1496
|
+ message.setCreateDate(new Date());
|
|
1497
|
+ message.setTicketId(ticketId);
|
|
1498
|
+ tpMessageMapper.insert(message);
|
|
1499
|
+ response.addSuccess("成功");
|
|
1500
|
+ return response;
|
|
1501
|
+ }
|
|
1502
|
+}
|