|
|
@@ -1731,8 +1731,60 @@ public class RepairRecordController implements RepairRecordControllerAPI {
|
|
|
Date nowDate = new Date();
|
|
|
String dateHour = new SimpleDateFormat("HH:mm").format(new Date());
|
|
|
String dateNow = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
|
|
-
|
|
|
+ RepairUser repairUser = repairUserService.getById(rsor.getId());
|
|
|
try {
|
|
|
+ String userID = AesUtils.decrypt(userhead);
|
|
|
+ RepairAdmin operateData = repairAdminService.getRepairById(userID);
|
|
|
+ if (operateData == null) {
|
|
|
+ return CommonResult.fail("操作人信息不合法,无法进行回复!");
|
|
|
+ }
|
|
|
+ //操作人
|
|
|
+ Integer senderId = 0;//超级管理员用ID为0
|
|
|
+ if (!operateData.getIsSuper().equals(eIsSuper.Super.getValue())) {
|
|
|
+ RepairUser user = repairUserService.getRepairByCardNumber(operateData.getCardNumber());
|
|
|
+ if (user == null) {
|
|
|
+ return CommonResult.fail("管理端账号未与移动端账号绑定,无法进行审核!");
|
|
|
+ }
|
|
|
+ senderId = user.getId();
|
|
|
+ }
|
|
|
+ if(repairUser.getUserZzid()==4){
|
|
|
+ String strContent="派单线下";
|
|
|
+ //同意
|
|
|
+ rr.setMaintenanceState(eRecordStatu.Offline.getValue());
|
|
|
+ //将维修师傅也加进去
|
|
|
+ rr.setMaintenancerName(repairUser.getUserName());
|
|
|
+ rr.setMaintenancerPhone(repairUser.getUserPhone());
|
|
|
+ int updateRecord = repairRecordService.updateRepairRecord(rr);
|
|
|
+ if (updateRecord <= 0) {
|
|
|
+ System.out.println("派单线下失败,更新维修师傅失败");
|
|
|
+ throw new Exception("派单线下失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ RepairSystemMessages rsm = new RepairSystemMessages();
|
|
|
+ rsm.setIsRead(0);
|
|
|
+ rsm.setRecordId(rsor.getRecordId());
|
|
|
+ rsm.setRecipientId(rsor.getId());
|
|
|
+ rsm.setContent("派单线下!");
|
|
|
+ int insertRsm = repairSystemMessagesService.insertRepairSystemMessages(rsm);
|
|
|
+ if (insertRsm <= 0) {
|
|
|
+ System.out.println("派单线下失败,插入消息失败");
|
|
|
+ throw new Exception("派单线下失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加跟踪记录
|
|
|
+ RepairTrackRecord repairTrackRecord = new RepairTrackRecord();
|
|
|
+ repairTrackRecord.setRecordId(rr.getId());
|
|
|
+ repairTrackRecord.setContent(strContent);
|
|
|
+ repairTrackRecord.setMaintenanceState(rr.getMaintenanceState());
|
|
|
+ repairTrackRecord.setUserId(senderId);
|
|
|
+ repairTrackRecord.setUserZzstr("管理员");
|
|
|
+ int insertTrack = repairTrackRecordService.insertRepairTrackRecord(repairTrackRecord);
|
|
|
+ if (insertTrack <= 0) {
|
|
|
+ System.out.println("派单线下失败,插入跟踪记录失败");
|
|
|
+ throw new Exception("派单线下师傅失败!");
|
|
|
+ }
|
|
|
+ return CommonResult.ok("派单线下成功");
|
|
|
+ }
|
|
|
List<String> shifts = Arrays.asList(rsor.getShiftId().split(",")).stream().distinct().collect(Collectors.toList());
|
|
|
RepairDispatchRecord rdr = null;
|
|
|
//只获取不是值班 或下班后的排班数据
|
|
|
@@ -1832,21 +1884,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- String userID = AesUtils.decrypt(userhead);
|
|
|
- RepairAdmin operateData = repairAdminService.getRepairById(userID);
|
|
|
- if (operateData == null) {
|
|
|
- return CommonResult.fail("操作人信息不合法,无法进行回复!");
|
|
|
- }
|
|
|
|
|
|
- //操作人
|
|
|
- Integer senderId = 0;//超级管理员用ID为0
|
|
|
- if (!operateData.getIsSuper().equals(eIsSuper.Super.getValue())) {
|
|
|
- RepairUser user = repairUserService.getRepairByCardNumber(operateData.getCardNumber());
|
|
|
- if (user == null) {
|
|
|
- return CommonResult.fail("管理端账号未与移动端账号绑定,无法进行审核!");
|
|
|
- }
|
|
|
- senderId = user.getId();
|
|
|
- }
|
|
|
|
|
|
RepairSystemMessages rsm = new RepairSystemMessages();
|
|
|
rsm.setIsRead(0);
|
|
|
@@ -1857,7 +1895,6 @@ public class RepairRecordController implements RepairRecordControllerAPI {
|
|
|
if (insertRsm <= 0) {
|
|
|
throw new Exception("派单失败!");
|
|
|
}
|
|
|
-
|
|
|
//添加跟踪记录 派单不加跟踪记录
|
|
|
RepairTrackRecord rtr = new RepairTrackRecord();
|
|
|
rtr.setRecordId(rsor.getRecordId());
|