Commit c436857c by XiaHou

查询展览纪念馆

parent 6b26048a
......@@ -339,7 +339,7 @@ public class ApiOshServicesOrderController {
*/
@ApiOperation(" 支付2 上面支付app下调用参数未传递过来,为了不影响app重新复制一份解决")
@RequestMapping(value = "/wxPay2", method = RequestMethod.POST)
public JsonResult pay2(@ApiParam(value = "传入对象") @RequestBody OshServicesOrderVo vo, HttpServletRequest request, HttpServletResponse response) throws Exception {
public JsonResult pay2(@ApiParam(value = "传入对象") @RequestBody OshServicesOrderVo vo, HttpServletRequest request) throws Exception {
OshServicesOrderVo result = oshServicesOrderSerice.getViewByCode(vo);
String totalPrice = result.getTotalPrice() + "";
if ("0.0".equals(totalPrice)) {
......@@ -351,9 +351,10 @@ public class ApiOshServicesOrderController {
return JsonResult.success("支付请求成功", oshServicesOrderSerice.doUnifiedOrderForH5(vo.getCode(), vo.getPayType(), totalPrice));
} else if ("2".equals(vo.getPayChooseType())) {
return JsonResult.success("支付请求成功", oshServicesOrderSerice.doUnifiedOrderForJSAPI(vo.getCode(), totalPrice, vo.getOpenId()));
} else {
} else{
return JsonResult.success("支付请求成功", oshServicesOrderSerice.doUnifiedOrderForAppletJSAPI(vo.getCode(), totalPrice, vo.getOpenId()));
}
}
/**
......
......@@ -30,10 +30,15 @@ public class OshServicesOrderDTO implements Serializable {
private BigDecimal totalPrice;
@ApiModelProperty(value = "支付方式 0:微信 1:支付宝")
private String payWay;
@ApiModelProperty(value = "下单手机")
private String phone;
@ApiModelProperty(value = "下单人头像")
private String pic;
@ApiModelProperty(value = "订单item详情List")
private List<OshServicesOrderItemDTO> oshServicesOrderItemDTOList;
@ApiModelProperty(value = "订单完成图片视频对象List")
private List<OshServicesOrderVideoDTO> oshServicesOrderVideoDTOList;
@ApiModelProperty(value = "纪念次数")
private Long times;
......
package com.atlgroupasia.servicecenter.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author xh
* @Date 2021/7/24
* description:
*/
@Data
public class OshServicesOrderVideoDTO implements Serializable {
@ApiModelProperty(value = "主键id")
private Long id;
@ApiModelProperty(value = "订单编号")
private Long orderId;
@ApiModelProperty(value = "图片地址集合")
private String imageUrls;
@ApiModelProperty(value = "0:没看 1:已看")
private String isWatch;
@ApiModelProperty(value = "视频地址")
private String videoUrl;
@ApiModelProperty(value = "创建时间")
private Date createTime;
}
......@@ -3,6 +3,7 @@ package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.dto.OshServicesOrderDTO;
import com.atlgroupasia.servicecenter.dto.OshServicesOrderItemDTO;
import com.atlgroupasia.servicecenter.dto.OshServicesOrderVideoDTO;
import com.atlgroupasia.servicecenter.queryparam.QueryOrderRelationTimeParam;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderVo;
import org.apache.ibatis.annotations.Param;
......@@ -63,6 +64,14 @@ public interface OshServicesOrderMapper {
List<OshServicesOrderItemDTO> selectOrderItemListByOrderId(Long orderId);
/**
* 根据订单id 查询订单相关图片视频数据
*
* @param orderId
* @return
*/
List<OshServicesOrderVideoDTO> selectOrderVideoListByOrderId(Long orderId);
/**
* 查询支付订单次数
*
* @param queryOrderRelationTimeParam
......
......@@ -307,12 +307,12 @@ public class OshServicesOrderSerice {
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("下单失败");
}
throw new Exception("下单失败");
throw new Exception("未知异常");
}
public Map doUnifiedOrderForJSAPI(String code, String payPrice, String openId) throws Exception {
Map<String, String> response = new HashMap<>();
try {
WXOfficeConfigUtil config = new WXOfficeConfigUtil();
WXPay wxpay = new WXPay(config);
......@@ -327,7 +327,7 @@ public class OshServicesOrderSerice {
double price = Double.parseDouble(payPrice) * 100;
data.put("total_fee", new Double(price).intValue() + "");
//自己的服务器IP地址
data.put("spbill_create_ip", SPBILL_CREATE_IP);
data.put("spbill_create_ip",SPBILL_CREATE_IP);
//异步通知地址(请注意必须是外网)
//http://userapi.atlxm.com/api/services/order/wxPayBack
data.put("notify_url", NOTIFY_URL);
......@@ -335,7 +335,7 @@ public class OshServicesOrderSerice {
data.put("trade_type", TRADE_TYPE_JSAPI);
data.put("openid", openId);
log.info("JSAPI支付请求参数未---->" + data.toString());
Map<String, String> response = wxpay.unifiedOrder(data);
response = wxpay.unifiedOrder(data);
log.info("JSAPI参数返回结果 为---->" + response.toString());
if ("SUCCESS".equals(response.get("return_code"))) {//主要返回以下5个参数
Map<String, String> param = new HashMap<>();
......@@ -352,11 +352,11 @@ public class OshServicesOrderSerice {
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("下单失败");
}
throw new Exception("下单失败");
throw new Exception("下单失败:" + response.toString());
}
public Map doUnifiedOrderForAppletJSAPI(String code, String payPrice, String openId) throws Exception {
try {
WXAppletConfigUtil config = new WXAppletConfigUtil();
......@@ -396,9 +396,8 @@ public class OshServicesOrderSerice {
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("下单失败");
}
throw new Exception("下单失败");
throw new Exception("未知异常");
}
......@@ -420,7 +419,10 @@ public class OshServicesOrderSerice {
//记录下 pagehelper第一次分页查询的 返回得总条数 等信息
PageInfo<OshServicesOrderDTO> pageInfo = new PageInfo<>(oshServicesOrderDTOList);
oshServicesOrderDTOList = oshServicesOrderDTOList.stream().map(item -> {
//设置订单详情
item.setOshServicesOrderItemDTOList(this.oshServicesOrderMapper.selectOrderItemListByOrderId(item.getId()));
//设置图片 视频对象
item.setOshServicesOrderVideoDTOList(this.oshServicesOrderMapper.selectOrderVideoListByOrderId(item.getId()));
return item;
}).collect(Collectors.toList());
......
......@@ -24,7 +24,8 @@ public class WXOfficeConfigUtil implements WXPayConfig {
public static final String APP_SECRET = "4bbb492abc6c12756e4bcbb775ae5069";
public WXOfficeConfigUtil() throws Exception {
String certPath = "D:/myWindos/document/项目文档/安泰乐二开项目对接/apiclient_cert.p12";
//String certPath = "D:/myWindos/document/项目文档/安泰乐二开项目对接/apiclient_cert.p12";
String certPath = "/www/wwwroot/userapi.atlxm.com/apiclient_cert.p12";
File file = new File(certPath);
InputStream certStream = new FileInputStream(file);
this.certData = new byte[(int) file.length()];
......
......@@ -193,7 +193,8 @@
<select id="selectOrderListByTimeId" parameterType="com.atlgroupasia.servicecenter.queryparam.QueryOrderRelationTimeParam" resultType="com.atlgroupasia.servicecenter.dto.OshServicesOrderDTO">
select
a.id,a.create_time createTime,a.status,a.remark,a.total_price totalPrice,a.pay_way payWay,a.pic
a.id,a.create_time createTime,a.status,a.remark,a.total_price totalPrice,a.pay_way payWay,a.pic,
a.phone,a.nick_name nickName
from osh_services_order a
where a.relation_time_id =#{relationTimeId}
</select>
......@@ -205,6 +206,13 @@
where a.order_id = #{orderId}
</select>
<select id="selectOrderVideoListByOrderId" parameterType="java.lang.Long" resultType="com.atlgroupasia.servicecenter.dto.OshServicesOrderVideoDTO">
select
a.id,a.order_id orderId,a.image_urls imageUrls,a.is_watch isWatch,a.video_url videoUrl,a.create_time createTime
from osh_services_order_video a
where a.order_id = #{orderId}
</select>
<select id="selectPayOrderTimes" parameterType="com.atlgroupasia.servicecenter.queryparam.QueryOrderRelationTimeParam" resultType="java.lang.Long">
select IFNULL(count(*),0) from osh_services_order a
where a.pay_price is not null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment