yuhaitao14 6 роки тому
батько
коміт
7a79d0cb68

+ 14 - 1
shop/src/main/java/com/zskk/shop/controller/api/ApiController.java

@@ -11,9 +11,11 @@ package com.zskk.shop.controller.api;
 import java.text.SimpleDateFormat;
 import java.util.List;
 
+import javax.websocket.server.PathParam;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
-import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
@@ -24,6 +26,7 @@ import com.zskk.shop.controller.bean.PageBean;
 import com.zskk.shop.dao.entry.BuyOrderItem;
 import com.zskk.shop.exception.ErrorConstant;
 import com.zskk.shop.service.BuyOrderService;
+import com.zskk.shop.service.TJCenterService;
 
 @RequestMapping("/api")
 @Controller
@@ -32,6 +35,9 @@ public class ApiController {
 	@Autowired
 	private BuyOrderService buyOrderService;
 	
+	@Autowired
+	private TJCenterService tJCenterService;
+	
 	@RequestMapping("/refund")
 	@ResponseBody
 	public ControllerResult refund(@RequestParam("id") Long id){
@@ -99,4 +105,11 @@ public class ApiController {
 		
 		return new ControllerResult(pageBean);
 	}
+	
+	@RequestMapping("rjreport/{id}")
+	@ResponseBody
+	public String rjreport(@PathVariable("id") String id){
+		String htmlContent = tJCenterService.getTjReport(id);
+		return htmlContent;
+	}
 }

+ 10 - 0
shop/src/main/java/com/zskk/shop/service/TJCenterService.java

@@ -61,6 +61,16 @@ public class TJCenterService {
 			throw new ZSKKException(ErrorConstant.SERVER_ERROR);
 		}
 	}
+	
+	public String getTjReport(String id){
+		String url = tjcenter + "/public/shop/shop/getOrderTotalResult";
+		Map<String, Object> data = new HashMap<>();
+		data.put("id", id);
+		data.put("outer_key", "tj");
+		
+		String content = this.doPost(url, data);
+		return content;
+	}
 
 	/**
 	 * 获取详细

+ 2 - 2
shop/src/main/resource/templates/query_reportv2.html

@@ -55,8 +55,8 @@
                             	<a th:if="${order.status eq 5}" href="#" class="btn-blue y" >报告生成中</a>
                             	<a th:if="${order.status eq 7}" href="#" class="btn-blue y" >报告生成中</a>
                             	
-                            	<a th:if="${order.status eq 2}" th:attr="href='http://kunlun.pacsonline.cn/public/api.php/shop/reportDetails?id=' + ${order.id}" class="btn-blue y" target="_blank" >查看报告</a>
-                            	<a th:if="${order.status eq 6}" th:attr="href='http://kunlun.pacsonline.cn/public/api.php/shop/reportDetails?id=' + ${order.id}" class="btn-blue y" target="_blank" >查看报告</a>
+                            	<a th:if="${order.status eq 2}" th:attr="href='/api/rjreport/' + ${order.id}" class="btn-blue y" target="_blank" >查看报告</a>
+                            	<a th:if="${order.status eq 6}" th:attr="href='/api/rjreport/' + ${order.id}" class="btn-blue y" target="_blank" >查看报告</a>
                             </td>
                         </tr>
                     </tbody>