drew пре 6 година
родитељ
комит
e35790e9d0
1 измењених фајлова са 74 додато и 75 уклоњено
  1. 74 75
      src/main/java/com/thmodel/service/impl/VideoRecordServiceImpl.java

+ 74 - 75
src/main/java/com/thmodel/service/impl/VideoRecordServiceImpl.java

@@ -18,70 +18,70 @@ import com.thmodel.service.VideoRecordService;
 import com.thmodel.page.Page;
 import com.thmodel.result.ResultProcedure;
 
-public class VideoRecordServiceImpl implements VideoRecordService{
-	
-	private static VideoRecordDao videoRecordDao = new VideoRecordDaoImpl();
-	
-	private static ModelInfoDao modelInfoDao = new ModelInfoDaoImpl();
-	
-	private static SystemPayConstants systemPayConstants =  new SystemPayConstants();
-	
-	@Override
-	public int begVChat(int pk, int modelPk, String begDate, int hasAnswer) {
-		int result_pk = 0;
-		if(pk > 0 && modelPk >0){
-			result_pk = videoRecordDao.insertVideoRecord(pk, modelPk, begDate, hasAnswer);
-		}else {
-			result_pk = -1; 
-		}
-		return result_pk;
-	}
-	
-	@Override
-	public int ansVChat(int videoPk, int memberPk, int modelPk,
-			String begDate, int hasAnswer) {
-		int result_pk = 0;
-		if(memberPk > 0 && modelPk >0){
-			result_pk = videoRecordDao.insertVideoRecord(memberPk, modelPk, begDate, hasAnswer);
-		}else {
-			result_pk = -1; 
-		}
-		return result_pk;
-	}
-
-	@Override
-	public Page<List<Map<String, Object>>> getVideoRecordOrderList(int modelpk, int index, int size) {
-		if(modelpk > 0) {
-			return videoRecordDao.getVideoRecordByModelPk(modelpk, index, size);
-		} else {
-			return null;
-		}
-	}
-	
-	@Override
-	public Page<List<Map<String, Object>>> getMemberVideoRecordOrderList(int memberpk, int index, int size) {
-		if(memberpk > 0) {
-			return videoRecordDao.getVideoRecordByMemberpk(memberpk, index, size);
-		} else {
-			return null;
-		}
-	}
-	
-	@Override
-	public boolean endVChat(int videopk, String duration, double coin) {
-		boolean flag = false;
-		if(videopk > 0) {
-			VideoRecord videoRecord = videoRecordDao.findVideoRecordByPk(videopk);
-			if(videoRecord.getAccflag() != 9) {
-				
-				//修改视频订单信息
-				int rows = videoRecordDao.updateVideoRecordByPk(videopk, duration, coin+"", null, 1);
-				if(rows > 0) {
-					//订单提交成功
-					
-					ResultProcedure resultProcedure = systemPayConstants.procedure(SystemPayConstants.PROCEDURE_TABLENAME_VIDEORECORD, videopk);
-					System.out.println(resultProcedure.getResult());
-					System.out.println(resultProcedure.getMessage());
+public class VideoRecordServiceImpl implements VideoRecordService {
+
+    private static VideoRecordDao videoRecordDao = new VideoRecordDaoImpl();
+
+    private static ModelInfoDao modelInfoDao = new ModelInfoDaoImpl();
+
+    private static SystemPayConstants systemPayConstants = new SystemPayConstants();
+
+    @Override
+    public int begVChat(int pk, int modelPk, String begDate, int hasAnswer) {
+        int result_pk = 0;
+        if (pk > 0 && modelPk > 0) {
+            result_pk = videoRecordDao.insertVideoRecord(pk, modelPk, begDate, hasAnswer);
+        } else {
+            result_pk = -1;
+        }
+        return result_pk;
+    }
+
+    @Override
+    public int ansVChat(int videoPk, int memberPk, int modelPk,
+                        String begDate, int hasAnswer) {
+        int result_pk = 0;
+        if (memberPk > 0 && modelPk > 0) {
+            result_pk = videoRecordDao.insertVideoRecord(memberPk, modelPk, begDate, hasAnswer);
+        } else {
+            result_pk = -1;
+        }
+        return result_pk;
+    }
+
+    @Override
+    public Page<List<Map<String, Object>>> getVideoRecordOrderList(int modelpk, int index, int size) {
+        if (modelpk > 0) {
+            return videoRecordDao.getVideoRecordByModelPk(modelpk, index, size);
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public Page<List<Map<String, Object>>> getMemberVideoRecordOrderList(int memberpk, int index, int size) {
+        if (memberpk > 0) {
+            return videoRecordDao.getVideoRecordByMemberpk(memberpk, index, size);
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public boolean endVChat(int videopk, String duration, double coin) {
+        boolean flag = false;
+        if (videopk > 0) {
+            VideoRecord videoRecord = videoRecordDao.findVideoRecordByPk(videopk);
+            if (videoRecord.getAccflag() != 9) {
+
+                //修改视频订单信息
+                int rows = videoRecordDao.updateVideoRecordByPk(videopk, duration, coin + "", null, 1);
+                if (rows > 0) {
+                    //订单提交成功
+
+                    ResultProcedure resultProcedure = systemPayConstants.procedure(SystemPayConstants.PROCEDURE_TABLENAME_VIDEORECORD, videopk);
+                    System.out.println(resultProcedure.getResult());
+                    System.out.println(resultProcedure.getMessage());
 					/*
 					VideoRecord videoOrder = videoRecordDao.findVideoRecordByPk(videopk);
 					int payMemberpk = videoOrder.getMemberpk();
@@ -99,15 +99,14 @@ public class VideoRecordServiceImpl implements VideoRecordService{
 					AccountRecord ar2 = new AccountRecord(incomeMemberpk, AccountConstants.ACCOUNTRECORD_S_TYPE_3, 0, AccountConstants.ACCOUNTRECORD_A_TYPE_INCOME_CHAT, coin, null);
 					systemPayConstants.insertAccountRecord(ar2);
 					*/
-					flag = true;
-				}
-			}else {
-				System.out.println("已处理完毕");
-			}
-		}
-		return flag;
-	}
-
-	
-	
+                    flag = true;
+                }
+            } else {
+                System.out.println("已处理完毕");
+            }
+        }
+        return flag;
+    }
+
+
 }