// 异步通过订单获得订单明细,用于商品价格修改
@RequestMapping(value = "/storemanager/store/order/getdetail/price", method = RequestMethod.GET)
public void getdetail(@RequestParam Long orderId, HttpServletResponse response) {
response.setCharacterEncoding("UTF-8");
log.debug("save credit valuation");
OrderInfo orderInfo = orderInfoService.find(orderId);
Set<OrderDetail> orderDetails = orderInfo.getOrderDetails();
if(orderDetails!=null && orderDetails.size()>0){
for(OrderDetail od : orderDetails){
String productName = od.getProductName();
log.debug("productName before : " + productName);
/*try {
productName = new String(productName.getBytes("iso8859-1"),"UTF-8");
log.debug("productName after : " + productName);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}*/
od.setProductName(productName);
}
}
String outStr = new JSONSerializer().serialize(orderDetails);
log.debug("outStr is : " + outStr);
PrintWriter pw = null;
try {
pw = response.getWriter();
pw.write(outStr);
} catch (IOException e) {
e.printStackTrace();
}finally{
pw.close();
}
}
ajax 乱码
最新推荐文章于 2023-11-15 16:23:01 发布