From 271ae63c20fcbe28d29c47f1881138ff6551a2a1 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 10 六月 2020 19:26:26 +0800
Subject: [PATCH] 唯品会订单bug修复,APP端佣金比例展示错误bug修复

---
 fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java |   57 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java b/fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java
index a92a750..2eddfeb 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java
@@ -47,6 +47,7 @@
 import com.yeshi.fanli.service.inter.config.ConfigService;
 import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
 import com.yeshi.fanli.service.inter.msg.MsgDeviceReadStateService;
+import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
 import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
 import com.yeshi.fanli.service.inter.push.PushService;
 import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
@@ -93,6 +94,9 @@
 
 	@Resource
 	private HongBaoManageService hongBaoManageService;
+
+	@Resource
+	private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
 
 	@Resource
 	private ActivityUserService activityUserService;
@@ -191,6 +195,19 @@
 		out.print("success");
 	}
 
+	/**
+	 * 鏀粯瀹濇敮浠樺洖璋�
+	 * @Title: alipay
+	 * @Description: 
+	 * @param out 
+	 * void 杩斿洖绫诲瀷
+	 * @throws
+	 */
+	@RequestMapping(value = "alipay")
+	public void alipay(PrintWriter out) {
+		out.print("success");
+	}
+
 	@RequestMapping(value = "banlishop/pay")
 	public void banLiShopPay(HttpServletRequest request, PrintWriter out) {
 
@@ -241,37 +258,19 @@
 		// return;
 		// }
 		String contentDecode = "";
-		if (request instanceof MultipartHttpServletRequest) {
-			MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
-			List<MultipartFile> files = multipartRequest.getFiles("file");
-			try {
-				InputStream input = files.get(0).getInputStream();
-				InputStreamReader reader = new InputStreamReader(input, "UTF-16LE");
-				int d = -1;
-				String st = "";
-				while ((d = reader.read()) != -1) {
-					st += ((char) d);
-				}
-				System.out.println(st);
-				contentDecode = st;
 
-				contentDecode = contentDecode.substring(contentDecode.indexOf("mtopjsonp1(") + "mtopjsonp1(".length(),
-						contentDecode.length()).trim();
-				if (contentDecode.endsWith(")"))
-					contentDecode = contentDecode.substring(0, contentDecode.length() - 1);
+		contentDecode = content.substring(content.indexOf("(") + 1, content.length()).trim();
+		if (contentDecode.endsWith(")"))
+			contentDecode = contentDecode.substring(0, contentDecode.length() - 1);
 
-				System.out.println(contentDecode);
-
-				reader.close();
-
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-		}
+		System.out.println(contentDecode);
 
 		JSONObject data = JSONObject.fromObject(contentDecode).optJSONObject("data");
 
 		JSONArray array = data.optJSONObject("recommend").optJSONArray("resultList");
+		
+		long startTime=System.currentTimeMillis();
+		
 		for (int i = array.size() - 1; i >= 0; i--) {
 			JSONObject item = array.optJSONObject(i);
 			String title = item.optString("itemName");
@@ -293,7 +292,7 @@
 			if (goodsBrief == null)
 				continue;
 			// 鍟嗗搧VO
-			ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate("android", "55");
+			ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55");
 			paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
 			GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, paramsDTO);
 
@@ -318,7 +317,7 @@
 				} else {
 					imgInfo.setType(ImgEnum.goods);
 					SimpleGoods simpleGoods = new SimpleGoods();
-					simpleGoods.setGoodsId(itemId);
+					simpleGoods.setGoodsId(itemId + "");
 					simpleGoods.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
 					simpleGoods.setState(CommonGoods.STATE_NORMAL);
 					CouponInfoVO couponInfo = goodsVO.getCouponInfo();
@@ -338,9 +337,11 @@
 
 			ActivityUser user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
 			try {
-				goodsEvaluateService.addGoodsEvaluate(itemId, imageList, user, doc, null, null);
+				goodsEvaluateService.addGoodsEvaluate(itemId + "", imageList, user, doc, null, new Date(startTime-1000*60*20L*i));
 			} catch (GoodsEvaluateException e) {
 				e.printStackTrace();
+			}catch(Exception e){
+				e.printStackTrace();
 			}
 		}
 

--
Gitblit v1.8.0