| 
					
				 | 
			
			
				@@ -156,6 +156,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             notifyMap.put("channelType", channelType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             notifyMap.put("orderNo", ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             studentPaymentOrderService.updateOrder(notifyMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            notifyMap.put("orderNo", orderNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return notifyMap; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -218,12 +219,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 "联系人:" + studentRepair.getEmployeePhone() + "(" + studentRepair.getEmployeePhone() + ")\n\r" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 "地址:" + studentRepair.getEmployeeAddress() ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(studentRepair.getSendType().equals(0)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SMS_REPAIR_UNSEND_COMPLETED, map, null, 0, "1", "STUDENT", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    student.getUsername(), studentRepair.getEmployeeName(), studentRepair.getEmployeePhone(), studentRepair.getEmployeeAddress()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SMS_REPAIR_SEND_COMPLETED, map, null, 0, "1", "STUDENT", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    student.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(studentRepair.getSendType().equals(1)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             imContent = student.getUsername() + "学员您好,您的乐器已保养维修完毕,快递已寄出,请注意查收。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sysMessageService.sendPrivateMessage(student.getId().toString(), imContent); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -256,6 +252,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         studentDao.lockUser(studentRepair.getStudentId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         BigDecimal amount = studentRepair.getAmount(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String orderNo = idGeneratorService.generatorId("payment") + ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        studentRepair.setIsUseBalancePayment(repairInfo.getIsUseBalancePayment()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         studentRepair.setTransNo(orderNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         studentRepair.setRepairStatus(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         studentRepair.setPayStatus(1); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -285,8 +282,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         studentPaymentOrderService.insert(studentPaymentOrder); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         studentPaymentOrder.setVersion(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (repairInfo.getIsUseBalancePayment() && amount.compareTo(BigDecimal.ZERO) > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(repairInfo.getStudentId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (studentRepair.getIsUseBalancePayment() && amount.compareTo(BigDecimal.ZERO) > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(studentRepair.getStudentId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (userCashAccount == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 throw new BizException("用户账户找不到"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -295,7 +292,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 amount = amount.subtract(balance); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 studentPaymentOrder.setActualAmount(amount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 studentPaymentOrder.setBalancePaymentAmount(balance); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                sysUserCashAccountService.updateBalance(repairInfo.getStudentId(), balance.negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐器维修"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sysUserCashAccountService.updateBalance(studentRepair.getStudentId(), balance.negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐器维修"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         studentPaymentOrderService.update(studentPaymentOrder); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -308,6 +305,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             notifyMap.put("channelType", channelType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             notifyMap.put("orderNo", ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             studentPaymentOrderService.updateOrder(notifyMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            notifyMap.put("orderNo", orderNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return notifyMap; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -354,9 +352,9 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Boolean orderCallback(StudentPaymentOrder studentPaymentOrder) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        Date noDate = new Date(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Date nowDate = new Date(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //更新订单信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        studentPaymentOrder.setUpdateTime(noDate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        studentPaymentOrder.setUpdateTime(nowDate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         int updateCount = studentPaymentOrderService.update(studentPaymentOrder); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (updateCount <= 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new BizException("订单更新失败"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -372,14 +370,13 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (studentPaymentOrder.getStatus() == DealStatusEnum.SUCCESS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             repairInfo.setPayStatus(2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            repairInfo.setUpdateTime(noDate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            repairInfo.setUpdateTime(nowDate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (this.update(repairInfo) <= 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 throw new BizException("维修单更新失败"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //插入交易明细 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             BigDecimal amount = studentPaymentOrder.getActualAmount(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Date nowDate = new Date(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             SysUserCashAccount cashAccount = sysUserCashAccountService.get(userId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //充值 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             SysUserCashAccountDetail rechargeDetail = new SysUserCashAccountDetail(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -417,16 +414,10 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             String imContent = sysUser.getUsername() + "学员您好,您的乐器维修已受理,我们会尽快完成保养维修"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(repairInfo.getType().equals(0)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SMS_REPAIR_OFFLINE_PAYMENT_SUCCESS, map, null, 0, "1", "STUDENT", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        sysUser.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(repairInfo.getType().equals(1)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 imContent = sysUser.getUsername() + "学员您好,请尽快寄送乐器至维修点,我们会尽快完成保养维修\n\r" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         "联系人:" + repairInfo.getEmployeePhone() + "(" + repairInfo.getEmployeePhone() + ")\n\r" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         "地址:" + repairInfo.getEmployeeAddress() + ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SMS_REPAIR_ONLINE_PAYMENT_SUCCESS, map, null, 0, "1", "STUDENT", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        sysUser.getUsername(), repairInfo.getEmployeeName(), repairInfo.getEmployeePhone(), repairInfo.getEmployeeAddress()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             sysMessageService.sendPrivateMessage(sysUser.getId().toString(), imContent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return true; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -434,7 +425,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             repairInfo.setPayStatus(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            repairInfo.setUpdateTime(noDate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            repairInfo.setUpdateTime(nowDate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (this.update(repairInfo) <= 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 throw new BizException("维修单更新失败"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 |