Browse Source

修改页面逻辑

master
xh-pan1 2 years ago
parent
commit
4f02723956
  1. 6
      cereshop-admin/src/main/resources/application-admin-dev.yml
  2. 10
      cereshop-admin/src/main/resources/application-admin-prod.yml
  3. 2
      cereshop-admin/src/main/resources/mybatis/mapper/order/CereShopOrderDAO.xml
  4. 30
      cereshop-admin/src/main/resources/mybatis/mapper/product/CereProductSkuDAO.xml
  5. 49
      cereshop-app/src/main/java/com/shop/cereshop/app/controller/extend/XsPayController.java
  6. 3
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/buyer/CereBuyerUserDAO.java
  7. 13
      cereshop-app/src/main/java/com/shop/cereshop/app/pay/xs/service/XsPayService.java
  8. 306
      cereshop-app/src/main/java/com/shop/cereshop/app/pay/xs/service/impl/XsPayServiceImpl.java
  9. 3
      cereshop-app/src/main/java/com/shop/cereshop/app/redis/listener/RedisListener.java
  10. 4
      cereshop-app/src/main/java/com/shop/cereshop/app/service/buyer/CereBuyerUserService.java
  11. 13
      cereshop-app/src/main/java/com/shop/cereshop/app/service/buyer/impl/CereBuyerUserServiceImpl.java
  12. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/service/extend/HuaxunService.java
  13. 19
      cereshop-app/src/main/java/com/shop/cereshop/app/service/extend/impl/HuaxunServiceImpl.java
  14. 9
      cereshop-app/src/main/java/com/shop/cereshop/app/service/order/impl/CereShopOrderServiceImpl.java
  15. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/service/order/placeOrderTemplate/LaunchPlaceOrder.java
  16. 3
      cereshop-app/src/main/java/com/shop/cereshop/app/service/order/placeOrderTemplate/NormalPlaceOrder.java
  17. 4
      cereshop-app/src/main/java/com/shop/cereshop/app/service/order/placeOrderTemplate/PlaceOrderTemplate.java
  18. 4
      cereshop-app/src/main/java/com/shop/cereshop/app/service/stock/CrossStockService.java
  19. 150
      cereshop-app/src/main/java/com/shop/cereshop/app/service/stock/impl/CrossStockServiceImpl.java
  20. 14
      cereshop-app/src/main/resources/application-app-dev.yml
  21. 4
      cereshop-app/src/main/resources/application-app-prod.yml
  22. 12
      cereshop-app/src/main/resources/application.yml
  23. 29
      cereshop-app/src/main/resources/mybatis/mapper/buyer/CereBuyerUserDAO.xml
  24. 25
      cereshop-app/src/main/resources/mybatis/mapper/order/CereOrderProductDAO.xml
  25. 8
      cereshop-app/src/main/resources/mybatis/mapper/order/CereShopOrderDAO.xml
  26. 67
      cereshop-business/src/main/java/com/shop/cereshop/business/controller/HuaxunController.java
  27. 111
      cereshop-business/src/main/java/com/shop/cereshop/business/controller/XsPayController.java
  28. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/buyer/CereBuyerUserDAO.java
  29. 4
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/order/CereOrderProductDAO.java
  30. 4
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/order/CereShopOrderDAO.java
  31. 6
      cereshop-business/src/main/java/com/shop/cereshop/business/param/product/SkuParam.java
  32. 227
      cereshop-business/src/main/java/com/shop/cereshop/business/pay/xs/service/impl/XsPayServiceImpl.java
  33. 5
      cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBuyerUserService.java
  34. 15
      cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBuyerUserServiceImpl.java
  35. 41
      cereshop-business/src/main/java/com/shop/cereshop/business/service/extend/HuaxunService.java
  36. 172
      cereshop-business/src/main/java/com/shop/cereshop/business/service/extend/impl/HuaxunServiceImpl.java
  37. 8
      cereshop-business/src/main/java/com/shop/cereshop/business/service/order/CereOrderDileverService.java
  38. 6
      cereshop-business/src/main/java/com/shop/cereshop/business/service/order/CereOrderProductService.java
  39. 54
      cereshop-business/src/main/java/com/shop/cereshop/business/service/order/impl/CereOrderDileverServiceImpl.java
  40. 15
      cereshop-business/src/main/java/com/shop/cereshop/business/service/order/impl/CereOrderProductServiceImpl.java
  41. 15
      cereshop-business/src/main/resources/application-business-dev.yml
  42. 6
      cereshop-business/src/main/resources/application-business-prod.yml
  43. 2
      cereshop-business/src/main/resources/application-business-test.yml
  44. 12
      cereshop-business/src/main/resources/application.yml
  45. 35
      cereshop-business/src/main/resources/mybatis/mapper/buyer/CereBuyerUserDAO.xml
  46. 10
      cereshop-business/src/main/resources/mybatis/mapper/order/CereOrderProductDAO.xml
  47. 10
      cereshop-business/src/main/resources/mybatis/mapper/order/CereShopOrderDAO.xml
  48. 32
      cereshop-business/src/main/resources/mybatis/mapper/product/CereProductSkuDAO.xml
  49. 70
      cereshop-commons/src/main/java/com/shop/cereshop/commons/config/XspayConfig.java
  50. 6
      cereshop-commons/src/main/java/com/shop/cereshop/commons/domain/order/CereOrderProduct.java
  51. 6
      cereshop-commons/src/main/java/com/shop/cereshop/commons/domain/product/CereProductSku.java

6
cereshop-admin/src/main/resources/application-admin-dev.yml

@ -63,7 +63,7 @@ spring:
max-idle: 400
min-idle: 0
#网站域名
domain: https://ceres.zkthink.com
domain: http://122.9.152.120
#阿里云短信
aliyun:
@ -97,8 +97,8 @@ miaoxinyun:
upload:
type: LOCAL # 当前支持 ALI LOCAL 两种
storage-path: /Users/yongzonghuang/Documents/uploadfile/file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/local/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
storage-path: /home/ceres/cereshop-file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/ceres-local-file/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
alioss:
file:

10
cereshop-admin/src/main/resources/application-admin-prod.yml

@ -20,9 +20,9 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
# url: jdbc:oracle:thin:@192.168.1.98:1521:orcl
# 本地环境
url: jdbc:mysql://localhost:3306/cereshop1.6?useUnicode=true&allowMultiQueries=true&serverTimezone=UTC&characterEncoding=UTF-8
url: jdbc:mysql://localhost:3306/cereshop?useUnicode=true&allowMultiQueries=true&serverTimezone=UTC&characterEncoding=UTF-8
username: root
password: 123456
password: chenmeiceres
druid:
driver-class-name: com.mysql.jdbc.Driver
# driver-class-name: oracle.jdbc.driver.OracleDriver
@ -53,7 +53,7 @@ spring:
redis:
host: 127.0.0.1
port: 6379
password:
password: chengmei
database: 0
timeout: 10000
jedis:
@ -97,8 +97,8 @@ miaoxinyun:
upload:
type: LOCAL # 当前支持 ALI LOCAL 两种
storage-path: /Users/yongzonghuang/Documents/uploadfile/file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/local/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
storage-path: /home/ceres/cereshop-file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/ceres-local-file/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
alioss:
file:

2
cereshop-admin/src/main/resources/mybatis/mapper/order/CereShopOrderDAO.xml

@ -610,7 +610,7 @@
select sku_id, sum(number) as sales_volume
from cere_shop_order a join cere_order_product b on b.order_id = a.order_id
and a.payment_state = 1 and b.sku_id in
<foreach collection="list" item="skuId" open="(" separator="," close=")">
<foreach collection="skuIdList" item="skuId" open="(" separator="," close=")">
#{skuId}
</foreach>
group by b.sku_id

30
cereshop-admin/src/main/resources/mybatis/mapper/product/CereProductSkuDAO.xml

@ -10,16 +10,18 @@
<result column="rate" jdbcType="DECIMAL" property="rate" />
<result column="storehouse_id" jdbcType="BIGINT" property="storehouseId" />
<result column="stock_number" jdbcType="INTEGER" property="stockNumber" />
<result column="is_cross" jdbcType="BIT" property="isCross" />
<result column="total" jdbcType="INTEGER" property="total" />
<result column="weight" jdbcType="DECIMAL" property="weight" />
<result column="sku_image" jdbcType="VARCHAR" property="skuImage" />
<result column="sku_code" jdbcType="VARCHAR" property="skuCode" />
<result column="style" jdbcType="BIT" property="style" />
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
sku_id, product_id,SKU, price, original_price, rate, storehouse_id, stock_number,total, weight,
sku_image, `style`, create_time, update_time
sku_id, product_id,SKU, price, original_price, rate, storehouse_id, stock_number, is_cross, total, weight,
sku_image, sku_code, `style`, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
@ -55,6 +57,9 @@
<if test="stockNumber != null">
stock_number,
</if>
<if test="isCross != null">
is_cross,
</if>
<if test="total != null">
total,
</if>
@ -64,6 +69,9 @@
<if test="skuImage != null and skuImage!=''">
sku_image,
</if>
<if test="skuCode != null and skuCode!=''">
sku_code,
</if>
<if test="style != null">
`style`,
</if>
@ -90,6 +98,9 @@
<if test="stockNumber != null">
#{stockNumber,jdbcType=INTEGER},
</if>
<if test="isCross != null">
#{isCross,jdbcType=BIT},
</if>
<if test="total != null">
#{total,jdbcType=INTEGER},
</if>
@ -99,6 +110,9 @@
<if test="skuImage != null and skuImage!=''">
#{skuImage,jdbcType=VARCHAR},
</if>
<if test="skuCode != null and skuCode!=''">
#{skuCode,jdbcType=VARCHAR},
</if>
<if test="style != null">
#{style,jdbcType=BIT},
</if>
@ -134,6 +148,9 @@
<if test="stockNumber != null">
stock_number = #{stockNumber,jdbcType=INTEGER},
</if>
<if test="isCross != null">
is_cross = #{isCross,jdbcType=INTEGER},
</if>
<if test="total != null">
total = #{total,jdbcType=INTEGER},
</if>
@ -143,6 +160,9 @@
<if test="skuImage != null and skuImage!=''">
sku_image = #{skuImage,jdbcType=VARCHAR},
</if>
<if test="skuCode != null and skuCode!=''">
sku_code = #{skuCode,jdbcType=VARCHAR},
</if>
<if test="style != null">
`style` = #{style,jdbcType=BIT},
</if>
@ -164,9 +184,11 @@
rate = #{rate,jdbcType=DECIMAL},
storehouse_id = #{storehouseId,jdbcType=BIGINT},
stock_number = #{stockNumber,jdbcType=INTEGER},
is_cross = #{isCross,jdbcType=BIT},
total = #{total,jdbcType=INTEGER},
weight = #{weight,jdbcType=DECIMAL},
sku_image = #{skuImage,jdbcType=VARCHAR},
sku_code = #{skuImage,jdbcType=VARCHAR},
`style` = #{style,jdbcType=BIT},
create_time = #{createTime,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=VARCHAR}
@ -180,8 +202,8 @@
<select id="findByProductId" parameterType="java.lang.Object" resultType="com.shop.cereshop.admin.page.product.Sku">
SELECT cps.product_id, cps.sku_id,
cps.price, cps.original_price, cps.rate, cps.storehouse_id, css.storehouse_name, cps.stock_number, cps.total,
cps.weight, cps.sku_image, cps.`style`, cps.SKU
cps.price, cps.original_price, cps.rate, cps.storehouse_id, css.storehouse_name, cps.stock_number, cps.is_cross, cps.total,
cps.weight, cps.sku_image, cps.`style`, cps.SKU, cps.sku_code
FROM cere_product_sku cps
LEFT JOIN cere_shop_storehouse css ON css.storehouse_id = cps.storehouse_id
where cps.product_id=#{productId}

49
cereshop-app/src/main/java/com/shop/cereshop/app/controller/extend/XsPayController.java

@ -1,10 +1,13 @@
package com.shop.cereshop.app.controller.extend;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.shop.cereshop.app.pay.xs.domain.XsCallBackRequestVo;
import com.shop.cereshop.app.pay.xs.service.XsPayService;
import com.shop.cereshop.app.service.extend.HuaxunService;
import com.shop.cereshop.app.service.order.CereShopOrderService;
import com.shop.cereshop.app.service.stock.CrossStockService;
import com.shop.cereshop.commons.config.XspayConfig;
import com.shop.cereshop.commons.constant.XsPayEnum;
import com.shop.cereshop.commons.utils.EmptyUtils;
@ -39,6 +42,9 @@ public class XsPayController {
@Autowired
private CereShopOrderService cereShopOrderService;
@Autowired
private CrossStockService crossStockService;
/**
* 支付通知回调
* @throws Exception
@ -55,12 +61,13 @@ public class XsPayController {
JSONObject content = xsCallBackRequestVo.getContent();
String merOrderId = content.getString("merOrderId");
String[] split = merOrderId.split("-");
String dealId = "";
if(!EmptyUtils.isEmpty(split)){
String orderFormId=split[0];
if(!EmptyUtils.isEmpty(orderFormId)){
//支付有礼
cereShopOrderService.payGift(orderFormId);
String dealId = content.getString("dealId");
dealId = content.getString("dealId");
//处理支付成功后的其他逻辑
cereShopOrderService.handleWxLog(orderFormId, dealId, merOrderId);
}
@ -68,12 +75,42 @@ public class XsPayController {
}
//TODO 如果不是跨境支付应该不调用改接口------pxh
if(StringUtils.equals(XspayConfig.DEFUALT_TRADE_TYPE, XsPayEnum.TRADE_TYPE_CROSS_BOARD_PAYMENT.getCode())){
String payRequestBodyJson = xsPayService.getPayRequestBodyJson(merOrderId, new BigDecimal(Integer.parseInt(content.getString("orderAmount")) * 1.0f / 100),
XsPayEnum.TRADE_TYPE_CROSS_BOARD_PAYMENT.getCode(), content.getString("payType"));
huaxunService.pushBaoguanRequest(payRequestBodyJson);
// String payRequestBodyJson = xsPayService.getPayRequestBodyJson(merOrderId, new BigDecimal(Integer.parseInt(content.getString("orderAmount")) * 1.0f / 100),
// XsPayEnum.TRADE_TYPE_CROSS_BOARD_PAYMENT.getCode(), content.getString("payType"));
// huaxunService.pushBaoguanRequest(payRequestBodyJson);
//
// String msgStr = new String(Base64.getDecoder().decode(msg));
// huaxunService.pushBaoguanRespone(msgStr);
//新生报关
xsPayService.requestBaoGuan(merOrderId, dealId);
//仓储报关
// crossStockService.ibOrder(merOrderId);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
String msgStr = new String(Base64.getDecoder().decode(msg));
huaxunService.pushBaoguanRespone(msgStr);
/**
* 支付通知回调
* @throws Exception
*/
@PostMapping("pay/baoguannotify")
public void payBaoGuanNotify(@RequestParam(name = "msg") String msg) throws Exception {
try {
XsCallBackRequestVo xsCallBackRequestVo = xsPayService.parseCallBackRequestVo(msg);
log.info(new Gson().toJson(xsCallBackRequestVo));
String resultCode = xsCallBackRequestVo.getContent().getString("resultCode");
//2成功 3失败
if(StringUtils.equals(resultCode, "2")){
log.info("新生支付回调成功");
//截取订单编号
JSONObject content = xsCallBackRequestVo.getContent();
if(content.containsKey("subOrderNo")) {
crossStockService.ibOrder(content.getString("subOrderNo"), content.getString("payTransactionNo"));
}else {
crossStockService.ibOrder(content.getString("merOrderId"), content.getString("payTransactionNo"));
}
}
} catch (Exception e) {

3
cereshop-app/src/main/java/com/shop/cereshop/app/dao/buyer/CereBuyerUserDAO.java

@ -13,6 +13,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface CereBuyerUserDAO extends BaseMapper<CereBuyerUser> {
int deleteByPrimaryKey(@Param("buyerUserId") Long buyerUserId);
@ -21,6 +23,7 @@ public interface CereBuyerUserDAO extends BaseMapper<CereBuyerUser> {
CereBuyerUser selectByPrimaryKey(Long buyerUserId);
List<CereBuyerUser> selectByPrimaryKeyList(List<Long> buyerUserIdList);
int updateByPrimaryKeySelective(CereBuyerUser record);

13
cereshop-app/src/main/java/com/shop/cereshop/app/pay/xs/service/XsPayService.java

@ -2,6 +2,7 @@ package com.shop.cereshop.app.pay.xs.service;
import com.shop.cereshop.app.pay.PayService;
import com.shop.cereshop.app.pay.xs.domain.XsCallBackRequestVo;
import com.shop.cereshop.commons.exception.CoBusinessException;
import java.math.BigDecimal;
@ -24,5 +25,15 @@ public interface XsPayService extends PayService {
* @return
* @throws Exception
*/
String getPayRequestBodyJson(String orderFormid, BigDecimal money, String tradeType, String payType) throws Exception;
String getPayRequestBodyJson(String orderFormid, String payerAccount, BigDecimal money, String tradeType, String payType) throws Exception;
/**
* 支付报关
* @param orderFormid
* @param dealId
* @return
* @throws CoBusinessException
* @throws Exception
*/
void requestBaoGuan(String orderFormid, String dealId) throws CoBusinessException, Exception;
}

306
cereshop-app/src/main/java/com/shop/cereshop/app/pay/xs/service/impl/XsPayServiceImpl.java

@ -6,8 +6,11 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.Feature;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.gson.Gson;
import com.shop.cereshop.app.dao.order.CereOrderProductDAO;
import com.shop.cereshop.app.dao.order.CereShopOrderDAO;
import com.shop.cereshop.app.dao.shop.CereShopCrossDetailDAO;
import com.shop.cereshop.app.pay.xs.domain.XsCallBackRequestVo;
import com.shop.cereshop.app.pay.xs.domain.XsRequestBo;
import com.shop.cereshop.app.pay.xs.service.XsPayService;
@ -20,6 +23,7 @@ import com.shop.cereshop.commons.domain.buyer.CereBuyerUser;
import com.shop.cereshop.commons.domain.order.CereOrderParent;
import com.shop.cereshop.commons.domain.order.CereOrderProduct;
import com.shop.cereshop.commons.domain.order.CereShopOrder;
import com.shop.cereshop.commons.domain.shop.CereShopCrossDetail;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.utils.EmptyUtils;
import com.shop.cereshop.commons.utils.StringUtils;
@ -48,13 +52,51 @@ public class XsPayServiceImpl implements XsPayService {
@Autowired
private CereOrderProductDAO cereOrderProductDAO;
@Autowired
private CereShopCrossDetailDAO cereShopCrossDetailDAO;
//支付申请服务代码 serCode
private static final String PAY_SER_CODE = "101005";
//退款申请服务代码 serCode
private static final String REFUND_SER_CODE = "101006";
private static final String BAOGUAN_SER_CODE = "101017";
@Override
public Map<String, String> gotoPay(String orderFormid, BigDecimal money, String openid, String ip, Integer type, Integer huabeiPeriod) throws CoBusinessException, Exception {
XsRequestBo xsRequestBo = getPayRequestBody(orderFormid, openid, money, XspayConfig.DEFUALT_TRADE_TYPE,
XsPayEnum.PAY_TYPE_JS.getCode());
//head+content做md5并根据加签方式加密
String msg = CommonUtils.getRequestMsg(xsRequestBo.getHead(),xsRequestBo.getContent());
log.info("请求地址:url="+XspayConfig.URL);
log.info("【" + PAY_SER_CODE + "】接口-请求报文:msg="+msg);
String respMsg = HttpUtils.httpPost(XspayConfig.URL,msg);
//若响应respMsg为空时联系新生工作人员此处因时收银台模式前端页面提交方式当时错误时错误信息会重定向到其他页面展示
log.info("【" + PAY_SER_CODE + "】接口-响应报文:" + respMsg);
if(StrUtil.isNotBlank(respMsg)){
try {
//解析响应报文并验签
CommonUtils.verifySignRespMsg(PAY_SER_CODE,respMsg);
LinkedHashMap<String,String> responseMap = JSONObject.parseObject(respMsg,new TypeReference<LinkedHashMap<String,String>>(){}, Feature.OrderedField );
String resMsg = responseMap.get("msg");
String responeMsg = new String(Base64.getDecoder().decode(resMsg));
JSONObject jsonObject = JSONObject.parseObject(responeMsg);
JSONObject payInfoObject = jsonObject.getJSONObject("content").getJSONObject("payInfo");
return JSONObject.parseObject(payInfoObject.toJSONString(),LinkedHashMap.class, Feature.OrderedField);
} catch (CoBusinessException e) {
throw e;
} catch (Exception e) {
//支付方式为B2CB2BH5成功响应时respMsg为html页面代码
if(respMsg.contains("toNativePayIndexForm")){
log.info("【" + PAY_SER_CODE + "】接口-响应报文-HTML代码无需验签");
}else{
e.printStackTrace();
}
throw new CoBusinessException("10000","获取支付二维码出错");
}
}
return null;
}
@ -69,7 +111,7 @@ public class XsPayServiceImpl implements XsPayService {
//构建请求参数
Map<String, String> headMap = CommonUtils.buildHeadMap(REFUND_SER_CODE);
Map<String, Object> contentMap = buildOrderRefundContentMap(outTradeNo, transactionId, total, XspayConfig.APP_NOTICE_URL);
Map<String, Object> contentMap = build06ContentMap(outTradeNo, transactionId, refund, XspayConfig.APP_NOTICE_URL);
//head+content做md5并根据加签方式加密
String msg = CommonUtils.getRequestMsg(headMap, contentMap);
log.info("【" + PAY_SER_CODE + "】接口-请求报文:msg="+msg);
@ -154,9 +196,10 @@ public class XsPayServiceImpl implements XsPayService {
//获取订单二维码
@Override
public String getOrderCollectionCode(String orderFormid, BigDecimal money, String ip, String tradeType) throws CoBusinessException, Exception {
XsRequestBo xsRequestBo = getPayRequestBody(orderFormid, money, tradeType, XsPayEnum.PAY_TYPE_QRCODE.getCode());
XsRequestBo xsRequestBo = getPayRequestBody(orderFormid, "", money, tradeType, XsPayEnum.PAY_TYPE_QRCODE.getCode());
//head+content做md5并根据加签方式加密
String msg = CommonUtils.getRequestMsg(xsRequestBo.getHead(),xsRequestBo.getContent());
log.info("请求地址:url="+XspayConfig.URL);
log.info("【" + PAY_SER_CODE + "】接口-请求报文:msg="+msg);
String respMsg = HttpUtils.httpPost(XspayConfig.URL,msg);
@ -190,14 +233,14 @@ public class XsPayServiceImpl implements XsPayService {
}
@Override
public String getPayRequestBodyJson(String outTradeNo, BigDecimal money, String tradeType, String payType) throws Exception {
XsRequestBo xsRequestBo = getPayRequestBody(outTradeNo, money, tradeType, payType);
public String getPayRequestBodyJson(String outTradeNo, String payerAccount,BigDecimal money, String tradeType, String payType) throws Exception {
XsRequestBo xsRequestBo = getPayRequestBody(outTradeNo, payerAccount, money, tradeType, payType);
//json字符串
String jsonString = JSONObject.toJSONString(xsRequestBo);
return jsonString;
}
public XsRequestBo getPayRequestBody(String orderFormId, BigDecimal money, String tradeType, String payType) throws CoBusinessException, Exception {
public XsRequestBo getPayRequestBody(String orderFormId, String payerAccount, BigDecimal money, String tradeType, String payType) throws CoBusinessException, Exception {
List<CereShopOrder> orderList = null;
String cereOrderFormId = orderFormId;
@ -220,14 +263,16 @@ public class XsPayServiceImpl implements XsPayService {
throw new CoBusinessException("10000","订单查找出错");
}
CereBuyerUser user = cereBuyerUserService.selectByBuyerUserId(orderList.get(0).getBuyerUserId());
log.info("orderList:" + new Gson().toJson(orderList));
List<CereOrderProduct> cereOrderProductList = cereOrderProductDAO.findByOrderIds(orderList.stream().map(CereShopOrder::getId).collect(Collectors.toList()));
CereBuyerUser user = cereBuyerUserService.selectByBuyerUserId(orderList.get(0).getBuyerUserId());
List<CereOrderProduct> cereOrderProductList = cereOrderProductDAO.findByOrderIds(orderList.stream().map(CereShopOrder::getOrderId).collect(Collectors.toList()));
log.info("cereOrderProductList:" + new Gson().toJson(cereOrderProductList));
//构建请求参数
Map<String, String> headMap = CommonUtils.buildHeadMap(PAY_SER_CODE);
Map<String, Object> contentMap = buildPayContentMap(orderFormId, user, orderList, cereOrderProductList,
Map<String, Object> contentMap = build05ContentMap(orderFormId, payerAccount, user, orderList, cereOrderProductList,
money, tradeType, payType, XspayConfig.APP_RETURN_URL,
XspayConfig.APP_NOTICE_URL);
@ -238,45 +283,41 @@ public class XsPayServiceImpl implements XsPayService {
}
/**
* 构建content请求参数
* 构建退款content请求参数
* @return
*/
private static Map<String,Object> buildOrderRefundContentMap(String orderFormid, String dealId, BigDecimal money, String noticeUrl){
private static Map<String,Object> build06ContentMap(String orderFormid, String dealId, BigDecimal money, String noticeUrl){
Map<String, Object> contentMap = new LinkedHashMap<>();
contentMap.put("merOrderId", System.currentTimeMillis()+"");
//oldMerOrderId 对应 101004101005接口中merOrderId
contentMap.put("oldMerOrderId", orderFormid);
//oldDealId 对应 101004101005接口响应参数中dealId
contentMap.put("oldDealId", dealId);
contentMap.put("amount", 1);//money.multiply(new BigDecimal(100)).intValue());
// contentMap.put("oldDealId", dealId);
contentMap.put("amount", money.multiply(new BigDecimal(100)).intValue());
contentMap.put("currency", "CNY");
contentMap.put("noticeUrl", noticeUrl);
return contentMap;
}
/**
* 构建content请求参数
* @return
*/
private static Map<String,Object> buildPayContentMap(String orderFormid, CereBuyerUser user, List<CereShopOrder> orderList,
List<CereOrderProduct> cereOrderProductList, BigDecimal money, String tradeType,
String payType, String returnUrl, String noticeUrl){
/**
* 构建支付content请求参数
* @return
*/
private static Map<String,Object> build05ContentMap(String orderFormid, String payerAccount, CereBuyerUser user, List<CereShopOrder> orderList,
List<CereOrderProduct> cereOrderProductList, BigDecimal money, String tradeType,
String payType, String returnUrl, String noticeUrl){
// 设置请求正文 contentMap有序顺序按照文档从上到下为空字段可不传该字段
Map<String, Object> contentMap = new LinkedHashMap<>();
//商户订单号
contentMap.put("merOrderId", orderFormid);
//商户名称 请根据实际情况替换
contentMap.put("displayName", "成美国际");
//TODO 商品名称
//商品名称 请根据实际情况替换
//商品名称 请根据实际情况替换--有子订单了这个商品名称就随便了吧
contentMap.put("goodsName", "商品名称");
//商品数量 请根据实际情况替换
contentMap.put("goodsCount", 1);
//商品类别 请根据实际情况替换
contentMap.put("goodsType", "01");
//订单金额单位分
contentMap.put("orderAmount", money.multiply(new BigDecimal(100)).intValue());
//订单币种 CNY:人民币
@ -288,7 +329,7 @@ public class XsPayServiceImpl implements XsPayService {
//机构代码
contentMap.put("orgCode", "WECHATPAY");
//payerAccount
// contentMap.put("payerAccount", "omCqSs9K_z2sgvgGeIzEi5gjyL6k");
contentMap.put("payerAccount", payerAccount);
//交易币种 CNY:人民币
contentMap.put("payCurrencyCode", "CNY");
//结算币种 CNY:人民币
@ -297,17 +338,16 @@ public class XsPayServiceImpl implements XsPayService {
contentMap.put("shareFlag", "0");
//分账订单信息 shangFlag=1时必填
JSONArray jsonArray = buildSubMerchantOrderDetails(orderList, cereOrderProductList);
contentMap.put("subMerchantOrderDetails", JSONArray.toJSONString(jsonArray));
if(jsonArray != null) {
contentMap.put("subMerchantOrderDetails", JSONArray.toJSONString(jsonArray));
}
//回调地址--支付成功后的前端回调地址先写死首页
contentMap.put("returnUrl", returnUrl);
//通知地址
contentMap.put("noticeUrl", noticeUrl);
//平台ID-平台型支付的时候使用
contentMap.put("platformId","");
//商户用户号 请根据实际情况选择填写 TODO 这个先写死但是应该要根据订单的支付人来传值
//商户用户号 请根据实际情况选择填写
contentMap.put("customerId", user.getBuyerUserId() + "");
//商户用户类型 请根据实际情况选择填写
contentMap.put("customerType", "1");
@ -317,24 +357,23 @@ public class XsPayServiceImpl implements XsPayService {
contentMap.put("customerIdNo", user.getIdCard());
//商户用户手机号 请根据实际情况选择填写
contentMap.put("customerTel", user.getPhone());
//以下信息在支付类型为快捷支付的时候必填
//商户用户银行卡号
contentMap.put("bankCardNo", "");
//商户用户银行卡类型
contentMap.put("bankCardType", "");
//有效期
contentMap.put("expireData", "");
//信用卡安全码
contentMap.put("cvn", "");
//备注
contentMap.put("remark", "");
//保留字段1
contentMap.put("reserve1", "");
// //商户用户银行卡号
// contentMap.put("bankCardNo", "");
// //商户用户银行卡类型
// contentMap.put("bankCardType", "");
// //有效期
// contentMap.put("expireData", "");
// //信用卡安全码
// contentMap.put("cvn", "");
// //备注
// contentMap.put("remark", "");
// //保留字段1
// contentMap.put("reserve1", "");
//保留字段2 若要指定使用某条公众号/小程序appid时可填写appid或对应备案号
contentMap.put("reserve2", "");
//预下单标识
contentMap.put("preOrderFlag", "");
contentMap.put("reserve2", XspayConfig.wxAppid);
// //预下单标识
// contentMap.put("preOrderFlag", "");
return contentMap;
}
@ -344,10 +383,13 @@ public class XsPayServiceImpl implements XsPayService {
*/
private static JSONArray buildSubMerchantOrderDetails(List<CereShopOrder> orderList,
List<CereOrderProduct> cereOrderProductList){
if(cereOrderProductList.isEmpty()){
return null;
}
JSONArray jsonArray = new JSONArray();
for (CereShopOrder cereShopOrder : orderList) {
JSONObject subOrder1 = new JSONObject();
subOrder1.put("subOrderId",cereShopOrder.getOrderId());
subOrder1.put("subOrderId",cereShopOrder.getOrderFormid());
subOrder1.put("subOrderAmount", cereShopOrder.getPrice());
List<CereOrderProduct> orderProductList = cereOrderProductList.stream().filter(item -> item.getOrderId().equals(cereShopOrder.getOrderId())).collect(Collectors.toList());
@ -361,7 +403,7 @@ public class XsPayServiceImpl implements XsPayService {
detail1.put("settleCurCode","CNY");
detailArray1.add(detail1);
}
jsonArray.add(subOrder1);
}
return jsonArray;
@ -404,80 +446,149 @@ public class XsPayServiceImpl implements XsPayService {
//推单接口
public String aaa(String orderFormid, BigDecimal money, String ip, String tradeType) throws CoBusinessException, Exception {
XsRequestBo xsRequestBo = getPayRequestBody(orderFormid, money, tradeType, XsPayEnum.PAY_TYPE_QRCODE.getCode());
@Override
public void requestBaoGuan(String orderFormid, String dealId) throws CoBusinessException, Exception {
List<CereShopOrder> orderList = null;
String cereOrderFormId = orderFormid;
String[] split = orderFormid.split("-");
if(!EmptyUtils.isEmpty(split)) {
cereOrderFormId = split[0];
}
log.info("orderFormid:" + orderFormid);
log.info("cereOrderFormId:" + cereOrderFormId);
//查询是否为父订单编号
CereOrderParent parent = cereShopOrderDAO.findByParentFormid(cereOrderFormId);
if (parent != null) {
//查询所有子订单数据
orderList = cereShopOrderDAO.findByParentId(parent.getParentId());
} else {
//子订单支付回调
orderList = cereShopOrderDAO.findByFormid(cereOrderFormId);
}
if(orderList.isEmpty()){
throw new CoBusinessException("10000","订单查找出错");
}
if(orderList.stream().noneMatch(item -> item.getIsCross() != null && item.getIsCross() == 1)){
return;
}
//只报关跨境订单
orderList = orderList.stream().filter(item -> item.getIsCross() != null && item.getIsCross() == 1).collect(Collectors.toList());
CereBuyerUser user = cereBuyerUserService.selectByBuyerUserId(orderList.get(0).getBuyerUserId());
List<CereOrderProduct> cereOrderProductList = cereOrderProductDAO.findByOrderIds(orderList.stream().map(CereShopOrder::getOrderId).collect(Collectors.toList()));
CereShopCrossDetail cereShopCrossDetail = cereShopCrossDetailDAO.selectOne(Wrappers.<CereShopCrossDetail>lambdaQuery()
.eq(CereShopCrossDetail::getShopId, orderList.get(0).getShopId()));
if(cereShopCrossDetail == null){
throw new CoBusinessException("10000","商家没有开通跨境电商服务,请联系商家");
}
Map<String, String> headMap = CommonUtils.buildHeadMap(BAOGUAN_SER_CODE);
Map<String, Object> contentMap = build17ContentMap(orderFormid, dealId, user, orderList, cereOrderProductList, cereShopCrossDetail);
//head+content做md5并根据加签方式加密
String msg = CommonUtils.getRequestMsg(xsRequestBo.getHead(),xsRequestBo.getContent());
log.info("【" + PAY_SER_CODE + "】接口-请求报文:msg="+msg);
String msg = CommonUtils.getRequestMsg(headMap, contentMap);
log.info("【" + BAOGUAN_SER_CODE + "】接口-请求报文:msg="+msg);
String respMsg = HttpUtils.httpPost(XspayConfig.URL,msg);
//若响应respMsg为空时联系新生工作人员此处因时收银台模式前端页面提交方式当时错误时错误信息会重定向到其他页面展示
log.info("【" + PAY_SER_CODE + "】接口-响应报文:" + respMsg);
log.info("【" + BAOGUAN_SER_CODE + "】接口-响应报文:" + respMsg);
if(StrUtil.isNotBlank(respMsg)){
try {
//解析响应报文并验签
CommonUtils.verifySignRespMsg(PAY_SER_CODE,respMsg);
LinkedHashMap<String,String> responseMap = JSONObject.parseObject(respMsg,new TypeReference<LinkedHashMap<String,String>>(){}, Feature.OrderedField );
String resMsg = responseMap.get("msg");
String responeMsg = new String(Base64.getDecoder().decode(resMsg));
JSONObject jsonObject = JSONObject.parseObject(responeMsg);
String qrCodeUrl = jsonObject.getJSONObject("content").getJSONObject("payInfo").getString("qrCodeUrl");
qrCodeUrl = new URIBuilder(qrCodeUrl).getQueryParams().get(0).getValue();
return qrCodeUrl;
CommonUtils.verifySignRespMsg(BAOGUAN_SER_CODE,respMsg);
// LinkedHashMap<String,String> responseMap = JSONObject.parseObject(respMsg,new TypeReference<LinkedHashMap<String,String>>(){}, Feature.OrderedField );
// String resMsg = responseMap.get("msg");
// String responeMsg = new String(Base64.getDecoder().decode(resMsg));
// JSONObject jsonObject = JSONObject.parseObject(responeMsg);
// String qrCodeUrl = jsonObject.getJSONObject("content").getJSONObject("payInfo").getString("qrCodeUrl");
// qrCodeUrl = new URIBuilder(qrCodeUrl).getQueryParams().get(0).getValue();
} catch (CoBusinessException e) {
throw e;
} catch (Exception e) {
//支付方式为B2CB2BH5成功响应时respMsg为html页面代码
if(respMsg.contains("toNativePayIndexForm")){
log.info("【" + PAY_SER_CODE + "】接口-响应报文-HTML代码无需验签");
log.info("【" + BAOGUAN_SER_CODE + "】接口-响应报文-HTML代码无需验签");
}else{
e.printStackTrace();
}
throw new CoBusinessException("10000","获取支付二维码出错");
throw new CoBusinessException("10000","支付单报关出错");
}
}
return null;
}
/**
* 构建content请求参数
* 构建报关content请求参数
* @return
*/
private static Map<String,Object> build17ContentMap(){
private Map<String,Object> build17ContentMap(String merOrderId, String dealId, CereBuyerUser user, List<CereShopOrder> orderList,
List<CereOrderProduct> cereOrderProductList, CereShopCrossDetail cereShopCrossDetail) throws CoBusinessException {
// 设置请求正文 contentMap有序顺序按照文档从上到下为空字段可不传该字段
Map<String, Object> contentMap = new LinkedHashMap<>();
contentMap.put("eportCode", "00");
//商户订单号(对应101004101005接口中merOrderId主订单推送时该订单号推送至海关)
contentMap.put("merOrderId", System.currentTimeMillis()+"");
contentMap.put("merOrderId", merOrderId);
//订单币种
contentMap.put("currencyCode", "CNY");
//电商平台备案号 备案号需登录新生商户后台配置
contentMap.put("eCompanyCode", "2102960L0U");
//电商平台备案名称 备案名称需登录新生商户后台配置
contentMap.put("eCompanyName", "大连小洋伞国际贸易有限公司");
//电商平台备案号 备案号需登录新生商户后台配置
// contentMap.put("eCompanyCode", "46016601J4");
// //电商平台备案名称 备案名称需登录新生商户后台配置
// contentMap.put("eCompanyName", "得壹(海南)科技有限公司");
//电商平台备案号 备案号需登录新生商户后台配置
if(StringUtils.isEmpty(XspayConfig.DEFAULT_COMPANY_CODE)){
contentMap.put("eCompanyCode", cereShopCrossDetail.getEbpcode());
}else {
contentMap.put("eCompanyCode", XspayConfig.DEFAULT_COMPANY_CODE);
}
if(StringUtils.isEmpty(XspayConfig.DEFAULT_COMPANY_NAME)){
contentMap.put("eCompanyName", cereShopCrossDetail.getEbpname());
}else {
//电商平台备案名称 备案名称需登录新生商户后台配置
contentMap.put("eCompanyName", XspayConfig.DEFAULT_COMPANY_NAME);
}
//海关关区代码
contentMap.put("customsCode", "5165");
// contentMap.put("customsCode", "6409");
//进口类型
contentMap.put("intype", "1");
//支付交易号 对应101004101005接口响应dealId字段
contentMap.put("payTransactionNo", "1022204040009067712");
contentMap.put("payTransactionNo", dealId);
//操作类型 1-新增
contentMap.put("actionType", "1");
//支付人姓名 支付人信息需与101004101005接口中付款人信息一致
contentMap.put("payerName", "廖文聪");
contentMap.put("payerName", user.getRealName());
//支付人证件类型 01-身份证
contentMap.put("payerType", "01");
//支付人证件号码 支付人信息需与101004101005接口中付款人信息一致
contentMap.put("payerId", "441324198806092351");
contentMap.put("payerId", user.getIdCard());
//支付人手机号
contentMap.put("payerPhoneNumber", "13413034683");
contentMap.put("payerPhoneNumber", user.getPhone());
log.info("orderList:" + new Gson().toJson(orderList));
log.info("cereOrderProductList:" + new Gson().toJson(cereOrderProductList));
//订单明细 拆单报关时使用该字段
JSONArray jsonArray = buildOrderDetails();
contentMap.put("orderDetails", JSONArray.toJSONString(jsonArray));
JSONArray jsonArray = build17OrderDetails(orderList, cereOrderProductList);
if(jsonArray != null) {
contentMap.put("orderDetails", JSONArray.toJSONString(jsonArray));
}
//通知地址
contentMap.put("noticeUrl", "http://lcoalhost:8080/gatewayTest/notify");
contentMap.put("noticeUrl", XspayConfig.APP_BAOGUAN_NOTICE_URL);
return contentMap;
}
@ -485,22 +596,33 @@ public class XsPayServiceImpl implements XsPayService {
* 构建子订单明细
* @return
*/
private static JSONArray buildOrderDetails(){
private static JSONArray build17OrderDetails(List<CereShopOrder> orderList, List<CereOrderProduct> cereOrderProductList){
if(cereOrderProductList.isEmpty()){
return null;
}
JSONArray jsonArray = new JSONArray();
//子订单1
JSONObject detail1 = new JSONObject();
detail1.put("subOrderNo",System.currentTimeMillis()+"");//商户子订单号(拆单报关时该订单号推送至海关)
detail1.put("payAmount",100);//单位为分与订单币种一致币种
detail1.put("goodsName","商品名称");//商品名称
detail1.put("goodsCount","1");//商品数量
jsonArray.add(detail1);
//子订单2
JSONObject detail2 = new JSONObject();
detail2.put("subOrderNo",System.currentTimeMillis()+"1");//商户子订单号(拆单报关时该订单号推送至海关)
detail2.put("payAmount",200);//单位为分与订单币种一致币种
detail2.put("goodsName","商品名称");//商品名称
detail2.put("goodsCount","1");//商品数量
jsonArray.add(detail2);
for (CereShopOrder cereShopOrder : orderList) {
JSONObject subOrder1 = new JSONObject();
subOrder1.put("subOrderNo",cereShopOrder.getOrderFormid());
subOrder1.put("payAmount", cereShopOrder.getPrice().multiply(new BigDecimal(100)).intValue());
List<CereOrderProduct> orderProductList = cereOrderProductList.stream().filter(item -> item.getOrderId().equals(cereShopOrder.getOrderId())).collect(Collectors.toList());
// JSONArray detailArray1 = new JSONArray();
// for (CereOrderProduct cereOrderProduct : orderProductList) {
// //子订单1 明细1
// JSONObject detail1 = new JSONObject();
//// detail1.put("shareDetailId","" + cereOrderProduct.getOrderId() + cereOrderProduct.getOrderProductId());
//// detail1.put("shareParId",cereShopOrder.getShopId() + "");
//// detail1.put("shareAmount",cereOrderProduct.getActualPrice());
//// detail1.put("settleCurCode","CNY");
// detail1.put("goodsName", cereOrderProduct.getProductName());
// detail1.put("goodsCount", cereOrderProduct.getNumber());
// detailArray1.add(detail1);
// }
subOrder1.put("goodsName", orderProductList.get(0).getProductName());
subOrder1.put("goodsCount", orderProductList.stream().map(CereOrderProduct::getNumber).reduce((x, y) -> x += y));
jsonArray.add(subOrder1);
}
return jsonArray;
}

3
cereshop-app/src/main/java/com/shop/cereshop/app/redis/listener/RedisListener.java

@ -251,6 +251,9 @@ public class RedisListener extends KeyExpirationEventMessageListener {
Long orderId=Long.parseLong(id);
//更新订单状态为已关闭
CereShopOrder order=cereShopOrderService.findById(orderId);
if(order == null){
return;
}
if (IntegerEnum.ORDER_STOP.getCode().equals(order.getState())) {
return;
}

4
cereshop-app/src/main/java/com/shop/cereshop/app/service/buyer/CereBuyerUserService.java

@ -19,12 +19,16 @@ import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.common.PageParam;
import com.shop.cereshop.commons.exception.CoBusinessException;
import java.util.List;
public interface CereBuyerUserService {
CereBuyerUser findByToken(String token);
CereBuyerUser selectByBuyerUserId(Long buyerUserId);
List<CereBuyerUser> selectByBuyerUserIdList(List<Long> buyerUserIdList);
BuyerUser wxLogin(LoginParam param) throws CoBusinessException;
BuyerUser alipayLogin(LoginParam param) throws CoBusinessException;

13
cereshop-app/src/main/java/com/shop/cereshop/app/service/buyer/impl/CereBuyerUserServiceImpl.java

@ -200,6 +200,19 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
}
@Override
public List<CereBuyerUser> selectByBuyerUserIdList(List<Long> buyerUserIdList) {
List<CereBuyerUser> cereBuyerUserList = cereBuyerUserDAO.selectByPrimaryKeyList(buyerUserIdList);
if(cereBuyerUserList != null){
for (CereBuyerUser cereBuyerUser : cereBuyerUserList) {
if (cereBuyerUser != null && cereBuyerUser.getWechatName() == null) {
cereBuyerUser.setWechatName(cereBuyerUser.getName());
}
}
}
return cereBuyerUserList;
}
@Override
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class})
public BuyerUser wxLogin(LoginParam param) throws CoBusinessException {
BuyerUser user=null;

2
cereshop-app/src/main/java/com/shop/cereshop/app/service/extend/HuaxunService.java

@ -37,7 +37,7 @@ public interface HuaxunService {
List<OrderListVo> queryOrder(HuaxunOrderRequestBo bo) throws UnsupportedEncodingException, CoBusinessException;
/**
* 消息接收
* 消息接收
* @param bo
* @return
*/

19
cereshop-app/src/main/java/com/shop/cereshop/app/service/extend/impl/HuaxunServiceImpl.java

@ -8,9 +8,11 @@ package com.shop.cereshop.app.service.extend.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.gson.Gson;
import com.shop.cereshop.app.dao.order.CereShopOrderDAO;
import com.shop.cereshop.app.service.buyer.CereBuyerUserService;
import com.shop.cereshop.app.service.extend.HuaxunService;
import com.shop.cereshop.app.service.order.CereOrderProductService;
import com.shop.cereshop.commons.config.HuaxunConfig;
import com.shop.cereshop.commons.domain.buyer.CereBuyerUser;
import com.shop.cereshop.commons.domain.express.HttpResult;
import com.shop.cereshop.commons.domain.huaxun.*;
import com.shop.cereshop.commons.domain.order.CereOrderProduct;
@ -47,6 +49,9 @@ public class HuaxunServiceImpl implements HuaxunService {
@Autowired
private CereOrderProductService cereOrderProductService;
@Autowired
private CereBuyerUserService cereBuyerUserService;
@Override
public boolean pushBaoguanRequest(String request){
HuaxunPayBaoGuanRequestBo bo = new HuaxunPayBaoGuanRequestBo();
@ -89,20 +94,26 @@ public class HuaxunServiceImpl implements HuaxunService {
LambdaQueryWrapper<CereShopOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CereShopOrder::getPaymentState, 1)
.eq(CereShopOrder::getState, 2)
.eq(CereShopOrder::getIsCross, 1)
.ge(CereShopOrder::getPaymentTime, bo.getPayStartTime())
.lt(CereShopOrder::getPaymentTime, bo.getPayEndTime());
List<CereShopOrder> shopOrderList = cereShopOrderDAO.selectList(wrapper);
if(shopOrderList != null && !shopOrderList.isEmpty()){
List<CereOrderProduct> opList = cereOrderProductService.findByOrderIds(shopOrderList.stream().map(CereShopOrder::getOrderId).collect(Collectors.toList()));
List<CereBuyerUser> buyerUserList = cereBuyerUserService.selectByBuyerUserIdList(shopOrderList.stream().map(CereShopOrder::getBuyerUserId).collect(Collectors.toList()));
orderListVos.addAll(shopOrderList.stream().map(shopOrder -> {
OrderListVo orderListVo = new OrderListVo();
orderListVo.setOrder_no(shopOrder.getOrderFormid());
orderListVo.setPay_amount(shopOrder.getOrderPrice().toPlainString());
orderListVo.setBuyer_name(shopOrder.getCustomerName());
//TODO 需要补充订购人的身份证号码------pxh
orderListVo.setBuyer_idcard("460004198911216054");
orderListVo.setBuyer_mobile(shopOrder.getCustomerPhone());
CereBuyerUser buyerUser = buyerUserList.stream().filter(item -> item.getBuyerUserId().equals(shopOrder.getBuyerUserId())).findFirst().orElse(null);
if(buyerUser != null){
orderListVo.setBuyer_name(buyerUser.getRealName());
orderListVo.setBuyer_idcard(buyerUser.getIdCard());
orderListVo.setBuyer_mobile(buyerUser.getPhone());
}else {
log.info("华讯查询订单:查询不到对应的购买人");
}
orderListVo.setConsignee_name(shopOrder.getReceiveName());
orderListVo.setConsignee_mobile(shopOrder.getReceivePhone());
orderListVo.setConsignee_address(shopOrder.getReceiveAdress() + shopOrder.getAddress());

9
cereshop-app/src/main/java/com/shop/cereshop/app/service/order/impl/CereShopOrderServiceImpl.java

@ -506,12 +506,15 @@ public class CereShopOrderServiceImpl implements CereShopOrderService {
shopIds = cereShopOrderDAO.findShopId(param.getOrderId());
}
System.out.println("支付订单号为:" + orderFormId);
int paymentMode = param.getPaymentMode();
//调用支付接口
PayService payService = PayFactory.getPayService(param.getPaymentMode());
if(PayConfig.paymentMode == IntegerEnum.ORDER_PAY_XS.getCode()){
paymentMode = IntegerEnum.ORDER_PAY_XS.getCode();
}
PayService payService = PayFactory.getPayService(paymentMode);
String openId = user.getWechatOpenId();
if (Arrays.asList(IntegerEnum.ORDER_PAY_ALI.getCode(),
IntegerEnum.ORDER_PAY_HUABEI.getCode()).contains(param.getPaymentMode())) {
if (Arrays.asList(IntegerEnum.ORDER_PAY_ALI.getCode(), IntegerEnum.ORDER_PAY_HUABEI.getCode()).contains(param.getPaymentMode())) {
openId = user.getAliUserId();
}

2
cereshop-app/src/main/java/com/shop/cereshop/app/service/order/placeOrderTemplate/LaunchPlaceOrder.java

@ -281,7 +281,7 @@ public class LaunchPlaceOrder extends PlaceOrderTemplate {
//插入订单数据
cereShopOrderDAO.insert(order);
//新增订单商品数据
addOrderProduct(skus, order.getOrderId(), shop.getShopId(), map, attributes);
addOrderProduct(skus, order.getOrderId(), shop.getShopId(), shop.getUniqueId(), map, attributes);
Long collageId = param.getCollageId();
if (EmptyUtils.isEmpty(param.getCollageId())) {
//生成拼单数据

3
cereshop-app/src/main/java/com/shop/cereshop/app/service/order/placeOrderTemplate/NormalPlaceOrder.java

@ -571,8 +571,9 @@ public class NormalPlaceOrder extends PlaceOrderTemplate {
order.setBuyerUserId(user.getBuyerUserId());
//插入订单数据
cereShopOrderDAO.insert(order);
log.info("addOrderProduct");
//新增订单商品数据
addOrderProduct(skus, order.getOrderId(), shop.getShopId(), map, attributes);
addOrderProduct(skus, order.getOrderId(), shop.getShopId(), shop.getUniqueId(), map, attributes);
//设置30分钟延时自动取消订单,并且释放库存
stringRedisService.set(StringEnum.ORDER_AUTOMATIC_CANCEL.getCode() + "-" + order.getOrderId(), 1, 30 * 60 * 1000);
//新增延时任务记录

4
cereshop-app/src/main/java/com/shop/cereshop/app/service/order/placeOrderTemplate/PlaceOrderTemplate.java

@ -730,11 +730,11 @@ public abstract class PlaceOrderTemplate {
* @param attributes
* @throws CoBusinessException
*/
protected void addOrderProduct(List<CartSku> skus, Long orderId, Long shopId,
protected void addOrderProduct(List<CartSku> skus, Long orderId, Long shopId,Long uniqueId,
Map<Long, CartSku> map, List<OrderProductAttribute> attributes) throws CoBusinessException {
if (!EmptyUtils.isEmpty(skus)) {
for (CartSku sku : skus) {
if (sku.getShopId().equals(shopId)) {
if (sku.getUniqueId().equals(uniqueId)) {
CereOrderProduct orderProduct = new CereOrderProduct();
BeanUtils.copyProperties(sku, orderProduct);

4
cereshop-app/src/main/java/com/shop/cereshop/app/service/stock/CrossStockService.java

@ -13,7 +13,7 @@ public interface CrossStockService {
/**
* 仓储推关
* @param orderFormId
* @param orderNo
*/
void ibOrder(String orderFormId) throws CoBusinessException;
void ibOrder(String orderNo, String payTransactionNo) throws CoBusinessException;
}

150
cereshop-app/src/main/java/com/shop/cereshop/app/service/stock/impl/CrossStockServiceImpl.java

@ -5,30 +5,31 @@
*/
package com.shop.cereshop.app.service.stock.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.shop.cereshop.app.dao.order.CereOrderProductDAO;
import com.shop.cereshop.app.dao.order.CereShopOrderDAO;
import com.shop.cereshop.app.dao.shop.CereShopCrossDetailDAO;
import com.shop.cereshop.app.dao.storehouse.CereShopStorehouseDAO;
import com.shop.cereshop.app.domain.stock.IbOrderItemRequestBo;
import com.shop.cereshop.app.domain.stock.NewIbOrderRequestBo;
import com.shop.cereshop.app.page.cart.CartSku;
import com.shop.cereshop.app.service.buyer.CereBuyerUserService;
import com.shop.cereshop.app.service.order.CereOrderProductService;
import com.shop.cereshop.app.service.stock.CrossStockService;
import com.shop.cereshop.commons.config.CrossStockConfig;
import com.shop.cereshop.commons.domain.buyer.CereBuyerUser;
import com.shop.cereshop.commons.domain.express.HttpResult;
import com.shop.cereshop.commons.domain.order.CereOrderParent;
import com.shop.cereshop.commons.domain.order.CereOrderProduct;
import com.shop.cereshop.commons.domain.order.CereShopOrder;
import com.shop.cereshop.commons.domain.shop.CereShopCrossDetail;
import com.shop.cereshop.commons.domain.storehouse.CereShopStorehouse;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.utils.EmptyUtils;
import com.shop.cereshop.commons.utils.HttpUtils;
import com.shop.cereshop.commons.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@ -58,56 +59,111 @@ public class CrossStockServiceImpl implements CrossStockService{
@Override
public void ibOrder(String orderFormId) throws CoBusinessException {
List<CereShopOrder> orderList = null;
String cereOrderFormId = orderFormId;
String[] split = orderFormId.split("-");
if(!EmptyUtils.isEmpty(split)) {
cereOrderFormId = split[0];
}
//查询是否为父订单编号
CereOrderParent parent = cereShopOrderDAO.findByParentFormid(cereOrderFormId);
if (parent != null) {
//查询所有子订单数据
orderList = cereShopOrderDAO.findByParentId(parent.getParentId());
} else {
//子订单支付回调
orderList = cereShopOrderDAO.findByFormid(cereOrderFormId);
}
if(orderList.isEmpty()){
throw new CoBusinessException("10000","订单查找出错");
}
orderList = orderList.stream().filter(item -> item.getIsCross() == 1).collect(Collectors.toList());
if(orderList.isEmpty()){
//这个是纯国内订单不需要处理
return;
}
//查找商家--第一个跨境订单
CereShopOrder firstOrder = orderList.get(0);
public void ibOrder(String orderFromId, String payTransactionNo) throws CoBusinessException {
List<CereShopOrder> cereShopOrderList = cereShopOrderDAO.findByFormid(orderFromId);
CereShopOrder cereShopOrder = cereShopOrderList.get(0);
//商家详细信息
CereShopCrossDetail cereShopCrossDetail = cereShopCrossDetailDAO.selectOne(Wrappers.<CereShopCrossDetail>lambdaQuery().eq(CereShopCrossDetail::getShopId, firstOrder.getShopId()));
if(cereShopCrossDetail == null){
throw new CoBusinessException("10000","商家未设置跨境信息");
}
// CereShopCrossDetail cereShopCrossDetail = cereShopCrossDetailDAO.selectOne(Wrappers.<CereShopCrossDetail>lambdaQuery().eq(CereShopCrossDetail::getShopId, cereShopOrder.getShopId()));
// if(cereShopCrossDetail == null){
// throw new CoBusinessException("10000","商家未设置跨境信息");
// }
log.info("firstOrder:" + new Gson().toJson(cereShopOrder));
//获取SKU详情
List<CartSku> skus = cereOrderProductService.findOrderProductSku(firstOrder.getOrderId());
List<CereOrderProduct> cereOrderProductList = cereOrderProductService.findByOrderIds(cereShopOrderList.stream().map(CereShopOrder::getOrderId).collect(Collectors.toList()));
//查询仓库--因为一个订单内所有商品都是同一个仓库的所以直接获取即可
CereShopStorehouse cereShopStorehouse = cereShopStorehouseDAO.selectOne(Wrappers.<CereShopStorehouse>lambdaQuery().eq(CereShopStorehouse::getStorehouseId, firstOrder.getShopId()));
// CereShopStorehouse cereShopStorehouse = cereShopStorehouseDAO.selectOne(Wrappers.<CereShopStorehouse>lambdaQuery().eq(CereShopStorehouse::getStorehouseId, firstOrder.getShopId()));
//组装请求参数
//获取买家信息
CereBuyerUser user = cereBuyerUserService.selectByBuyerUserId(cereShopOrder.getBuyerUserId());
NewIbOrderRequestBo bo = new NewIbOrderRequestBo();
HttpResult httpResult = HttpUtils.doPost(CrossStockConfig.getApiUrl("ibOrder"), bo);
if (httpResult.getStatus() == 200 && StringUtils.equals("success", httpResult.getBody())){
//报关成功
log.info("报关发送支付请求成功");
bo.setActuralpaid(cereShopOrder.getPrice());
// @ApiModelProperty(value = "订单批次号")
// private String batchnumbers;
bo.setBuyeridnumber(user.getIdCard());
bo.setBuyername(user.getRealName());
bo.setPurchasertelephone(user.getPhone());;
// @ApiModelProperty(value = "订购人注册号")
// private String buyerregno;
bo.setChildid("211021172149000001");
bo.setConsignee(cereShopOrder.getReceiveName());
String[] addressArray = cereShopOrder.getReceiveAdress().split("-");
bo.setConsigneeprovince(addressArray.length > 0 ? addressArray[0] : "");
bo.setConsigneecity(addressArray.length > 1 ? addressArray[0] + addressArray[1] : "");
bo.setConsigneestreet(addressArray.length > 2 ? addressArray[2] : "");
bo.setConsigneeaddress(cereShopOrder.getReceiveAdress() + cereShopOrder.getAddress());
// @ApiModelProperty(value = "收货人公司")
// private String consigneecompany;
// @ApiModelProperty(value = "收件人邮箱")
// private String consigneeemail;
// @ApiModelProperty(value = "收件人身份证")
// private String consigneeidcard;
bo.setConsigneetelephone(cereShopOrder.getReceivePhone());
// bo.setEbpcode(cereShopCrossDetail.getEbpcode());
// bo.setEbpname(cereShopCrossDetail.getEbpname());
bo.setEbpcode("46016601J4");
bo.setEbpname("得壹(海南)科技有限公司");
bo.setDiscount(cereShopOrder.getDiscountPrice());
bo.setFreight(cereShopOrder.getLogisticsPrice());
//默认顺丰
bo.setExpressid("SF");
List<IbOrderItemRequestBo> items = new ArrayList<>();
BigDecimal taxtotal = BigDecimal.ZERO;
List<CereOrderProduct> curOrderCereOrderProductList = cereOrderProductList.stream().filter(item -> item.getOrderId().equals(cereShopOrder.getOrderId())).collect(Collectors.toList());
for (CereOrderProduct cereOrderProduct : curOrderCereOrderProductList) {
IbOrderItemRequestBo item = new IbOrderItemRequestBo();
item.setPrice(cereOrderProduct.getProductPrice());
item.setQty(new BigDecimal(cereOrderProduct.getNumber()));
item.setSku(cereOrderProduct.getSKU());
items.add(item);
taxtotal = taxtotal.add(cereOrderProduct.getProductPrice()
.multiply(new BigDecimal(cereOrderProduct.getNumber()))
.multiply(cereOrderProduct.getRate().divide(BigDecimal.valueOf(100f),2,BigDecimal.ROUND_HALF_UP)));
}
bo.setItems(items);
// @ApiModelProperty(value = "企业备注")
// private String note;
bo.setOrderno(cereShopOrder.getOrderFormid());
//
bo.setPaycode("460116287K");
bo.setPayname("新生支付有限公司");
bo.setPaytransactionid(payTransactionNo);
bo.setStoreid("DY");
bo.setTaxtotal(taxtotal);
log.info("ibOrder:" + new Gson().toJson(bo));
HttpResult httpResult = HttpUtils.doPostJson(CrossStockConfig.getApiUrl("ibOrder"), new Gson().toJson(bo));
if (httpResult.getStatus() == 200){
JSONObject respone = JSONObject.parseObject(httpResult.getBody());
String result = respone.getString("result");
String desc = respone.getString("desc");
if(StringUtils.equals(result, "00")){
//报关成功
log.info("报关发送请求成功");
}else {
log.info("报关发送请求失败:" + respone.toJSONString());
}
}else {
log.info("报关发送支付请求失败:" + httpResult.getBody());
log.info("报关发送请求失败:" + httpResult.getBody());
// log.info("报关发送支付请求参数:" + request);
}
}

14
cereshop-app/src/main/resources/application-app-dev.yml

@ -67,7 +67,7 @@ spring:
max-idle: 400
min-idle: 0
#网站域名
domain: https://ceres.zkthink.com
domain: http://122.9.152.120
#阿里云短信
aliyun:
@ -101,8 +101,8 @@ miaoxinyun:
upload:
type: LOCAL # 当前支持 ALI LOCAL 两种
storage-path: /Users/root/Documents/uploadfile/file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/local/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
storage-path: /home/ceres/cereshop-file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/ceres-local-file/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
alioss:
file:
@ -225,8 +225,14 @@ pay:
xspay:
url: https://uwebgatetest.hnapay.com/webgate/unifiedAPI.htm
mer_code: 10000000381
app_return_url: xx
app_notice_url: http://122.9.152.120/ceres-app-api/extend/xsPay/pay/notify
app_baoguan_notice_url: http://122.9.152.120/ceres-app-api/extend/xsPay/pay/baoguannotify
business_return_url: xx
business_notice_url: http://122.9.152.120/ceres-business-api/extend/xsPay/pay/notify
business_return_notice_url: http://122.9.152.120/ceres-business-api/extend/xsPay/refund/notify
rsa_private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBANMGXGvYX9yqb5qauZgc2mXk4R+2op9KLhCuqO0mt5aTyAFfGXty2RHAinwQif6AUyfFZK7p0/9xz2yX4VHltA4qFNsgQmi2Qtry8MTbBrPtVgukWdLmcK7NqR9C8reXO7e/Np3SPNLle5MsEkwM25cMK56JEc3WMRe+KIRZ69d1AgMBAAECgYBTSW1suyeKplIKCQs7OBgSozUfGSwyBksMFoNhpihLa+RCdlBOYtO9p+qAcN6l7evkBIpqZqtfZIHjcEZj1m8reIHHBnuv/sKGXWPvMBKqckenwNnqUzlj4X8hvFtkbcqXLGdyYoicW+P5+P8zHmYRom+izd5FO9281zXa4UK6gQJBAOquqD84B1VnNq2xopaaJvxaL4c5IOinkfRWShttANCpt1D0t1cs+7WPq9sdFZ4cyHYomxuC4knqJh1E/WzCVqUCQQDmMZH8+6sgqOrgsECw6w0KdUci/XgzT/DRS/3MFMeRv7ygEtdlyvyxRirEArsjQgDg3IBLo9TxBUdygPhgXnSRAkEAtp95r9By7IOoKhw8cMO+qMuphqnvMP0NeD0Z6CO36ajYTXhRn9YSfiQyUQ1eAC9X05MfuJXucCR0ynwgVd0ZPQJAdYaRdow3TrFvWdAi9zDKs7A05ZRrrib+WJ1nsq5ZRfySnVeBSaNdaFTeuLx8NwAX2rY5emTm7zc2xys5pFoVQQJAUPrxmTbELDTF1by6POX/IT3iSeClzOx+M05Yd4sgXtALPjYt0VMLtnsfmt9qMEjhk0Q95wgdmeHsBHxno5qGfQ==
newpay_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDmVh2/xldLXhVU/mNT57m95uw0Hr0Pdl4pUyM2xV509LqLYTbLduCqqnuMTJUq7Irv8SsKfVqB7zKggxFyjmIfeeyTbhMDJkWZ20xRhv+rSw3ZBQD/Hbn+cxhi4FZ3gc+jUSI1pIsPrlvRK7E5DyWLa/RvZYiQfW/XYI4c1Mb29QIDAQAB
default_company_code: 460116287K
default_company_name: 新生支付有限公司

4
cereshop-app/src/main/resources/application-app-prod.yml

@ -101,8 +101,8 @@ miaoxinyun:
upload:
type: LOCAL # 当前支持 ALI LOCAL 两种
storage-path: /Users/root/Documents/uploadfile/file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/local/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
storage-path: /home/ceres/cereshop-file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/ceres-local-file/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
alioss:
file:

12
cereshop-app/src/main/resources/application.yml

@ -78,13 +78,15 @@ pay:
xspay:
url: https://uwebgate.hnapay.com/webgate/unifiedAPI.htm
app_return_url: xx
app_notice_url: xx
app_notice_url: http://14.22.116.132:81/ceres-app-api/extend/xsPay/pay/notify
app_baoguan_notice_url: http://14.22.116.132:81/ceres-app-api/extend/xsPay/pay/baoguannotify
business_return_url: xx
business_notice_url: xx
mer_code: 10000000381
business_notice_url: http://14.22.116.132:81/ceres-business-api/extend/xsPay/pay/notify
business_return_notice_url: http://14.22.116.132:81/ceres-business-api/extend/xsPay/refund/notify
mer_code: 5001626421847836001
sign_type: 1
rsa_private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBANMGXGvYX9yqb5qauZgc2mXk4R+2op9KLhCuqO0mt5aTyAFfGXty2RHAinwQif6AUyfFZK7p0/9xz2yX4VHltA4qFNsgQmi2Qtry8MTbBrPtVgukWdLmcK7NqR9C8reXO7e/Np3SPNLle5MsEkwM25cMK56JEc3WMRe+KIRZ69d1AgMBAAECgYBTSW1suyeKplIKCQs7OBgSozUfGSwyBksMFoNhpihLa+RCdlBOYtO9p+qAcN6l7evkBIpqZqtfZIHjcEZj1m8reIHHBnuv/sKGXWPvMBKqckenwNnqUzlj4X8hvFtkbcqXLGdyYoicW+P5+P8zHmYRom+izd5FO9281zXa4UK6gQJBAOquqD84B1VnNq2xopaaJvxaL4c5IOinkfRWShttANCpt1D0t1cs+7WPq9sdFZ4cyHYomxuC4knqJh1E/WzCVqUCQQDmMZH8+6sgqOrgsECw6w0KdUci/XgzT/DRS/3MFMeRv7ygEtdlyvyxRirEArsjQgDg3IBLo9TxBUdygPhgXnSRAkEAtp95r9By7IOoKhw8cMO+qMuphqnvMP0NeD0Z6CO36ajYTXhRn9YSfiQyUQ1eAC9X05MfuJXucCR0ynwgVd0ZPQJAdYaRdow3TrFvWdAi9zDKs7A05ZRrrib+WJ1nsq5ZRfySnVeBSaNdaFTeuLx8NwAX2rY5emTm7zc2xys5pFoVQQJAUPrxmTbELDTF1by6POX/IT3iSeClzOx+M05Yd4sgXtALPjYt0VMLtnsfmt9qMEjhk0Q95wgdmeHsBHxno5qGfQ==
newpay_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDmVh2/xldLXhVU/mNT57m95uw0Hr0Pdl4pUyM2xV509LqLYTbLduCqqnuMTJUq7Irv8SsKfVqB7zKggxFyjmIfeeyTbhMDJkWZ20xRhv+rSw3ZBQD/Hbn+cxhi4FZ3gc+jUSI1pIsPrlvRK7E5DyWLa/RvZYiQfW/XYI4c1Mb29QIDAQAB
rsa_private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIsNcvBCDUYCkEyHcuzYyGL9TOHV0kQWcAUJmQqgIIcn7devK2fCSgZs5N42tVm59m07VyUmYXfXrFzx80qwp0Db3bUrqAZqMDB1YnxjiM+Rrrm0pPAPGvGUR4XunPIEbqidezUe1pZCMavejql+TkouXrtHQhZVJJHOQwhTvO03AgMBAAECgYBaFKRZMPEYYaDJcxXoiaeHOUENLE/C/CYlnUofsAxigmN6Tmh4F02NTA4YRqjFL8uMh9y0nGCYGof2zmcmA7rVPSOaQwqwqmc+lHWq/Jy5Z6cAxlod1UeA+BEF9gc/d6YNJx+1UoywMJgr4o/59K9MCZofFLUPGhxoMTQzTB34wQJBAL49KvP5EktoEbloVrqoMNXalgXmGeETrUGkc29uTegT/K/29FllcY5mlSJhnL/uoW8aMuU2V8h7fv7RoJBX/DUCQQC7HqNbl0tmj4ffBUsggoTyuKQby2bNLqPJ6wHcQB5OAZhP2E4q+KC9MpS3eT0ljC27/6T+y4Qvry+THmiU1jk7AkB4bWJWhZKmN6AYvctBaB1aE4CrBUnWqM0h48fLf4lD4/svLWbrfINRQPEhjadb/OUm3u/fF/KkEEGJcAxzs68NAkAIqCo2mpFKdWl7z+rh3if4csJk5swiwf2h4dV8Mxsz0K8TQpabNlV5a1WmB13k1s9m2zTu9MtwyVISJF4CRMbxAkEAi88aKBXP1TO9AFZwyNE2Z9dVcSk2xruj9yLgfKvpcZF5eGm3/S9wGz9k+753rxe/KMkWfWd0eIK3VK0iYJ9K+Q==
newpay_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSsyBgvE
huaxun:
url: https://bg.qdhuaxun.cn/index.php

29
cereshop-app/src/main/resources/mybatis/mapper/buyer/CereBuyerUserDAO.xml

@ -12,6 +12,8 @@
<result column="wechat_number" jdbcType="VARCHAR" property="wechatNumber" />
<result column="ali_user_id" jdbcType="VARCHAR" property="aliUserId" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="real_name" jdbcType="VARCHAR" property="realName" />
<result column="id_card" jdbcType="VARCHAR" property="idCard" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="head_image" jdbcType="VARCHAR" property="headImage" />
<result column="state" jdbcType="BIT" property="state" />
@ -25,8 +27,8 @@
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
buyer_user_id, `name`, sex, birthday, wechat_open_id, wechat_union_id, wechat_name,
wechat_number, ali_user_id, phone, `password`, head_image, `state`,if_black, remark,
buyer_user_id, `name`, sex, birthday, real_name, id_card, wechat_open_id, wechat_union_id, wechat_name,
wechat_number, ali_user_id, phone, real_name, id_card, `password`, head_image, `state`,if_black, remark,
token, member_level_id, growth, credit, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@ -35,6 +37,15 @@
from cere_buyer_user
where buyer_user_id = #{buyerUserId,jdbcType=BIGINT}
</select>
<select id="selectByPrimaryKeyList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cere_buyer_user
where buyer_user_id in
<foreach collection="buyerUserIdList" item="buyerUserId" open="(" separator="," close=")">
#{buyerUserId}
</foreach>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cere_buyer_user
where buyer_user_id = #{buyerUserId,jdbcType=BIGINT}
@ -69,6 +80,12 @@
<if test="phone != null and phone!=''">
phone,
</if>
<if test="realName != null and realName!=''">
real_name,
</if>
<if test="idCard != null and idCard!=''">
id_card,
</if>
<if test="password != null and password!=''">
`password`,
</if>
@ -131,6 +148,12 @@
<if test="phone != null and phone!=''">
#{phone,jdbcType=VARCHAR},
</if>
<if test="realName != null and realName!=''">
#{realName,jdbcType=VARCHAR},
</if>
<if test="idCard != null and idCard!=''">
#{idCard,jdbcType=VARCHAR},
</if>
<if test="password != null and password!=''">
#{password,jdbcType=VARCHAR},
</if>
@ -249,6 +272,8 @@
wechat_number = #{wechatNumber,jdbcType=VARCHAR},
ali_user_id = #{aliUserId,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
real_name = #{realName,jdbcType=VARCHAR},
id_card = #{idCard,jdbcType=VARCHAR},
`password` = #{password,jdbcType=VARCHAR},
head_image = #{headImage,jdbcType=VARCHAR},
`state` = #{state,jdbcType=BIT},

25
cereshop-app/src/main/resources/mybatis/mapper/order/CereOrderProductDAO.xml

@ -16,6 +16,8 @@
<result column="activity_id" jdbcType="BIGINT" property="activityId" />
<result column="use_credit" jdbcType="INTEGER" property="useCredit"/>
<result column="use_credit_amount" jdbcType="DECIMAL" property="useCreditAmount"/>
<result column="logistics_price" jdbcType="DECIMAL" property="logisticsPrice"/>
<result column="rate" jdbcType="DECIMAL" property="rate"/>
</resultMap>
<select id="findOrderProductSku" parameterType="java.lang.Object" resultType="com.shop.cereshop.app.page.cart.CartSku">
@ -36,10 +38,25 @@
where a.order_id=#{orderId}
</select>
<select id="findByOrderIds" resultMap="BaseResultMap">
select order_id, product_id, sku_id, product_name, `number`, product_price, image, SKU, weight,
activity_type, activity_id, use_credit, use_credit_amount
from cere_order_product
where order_id in
select cop.order_id,
cop.product_id,
cop.sku_id,
cop.product_name,
cop.`number`,
cop.actual_price,
cop.product_price,
cop.image,
cop.SKU,
cop.weight,
cop.activity_type,
cop.activity_id,
cop.use_credit,
cop.use_credit_amount,
cop.logistics_price,
cps.rate
from cere_order_product cop
LEFT JOIN cere_product_sku cps ON cps.sku_id = cop.sku_id
where cop.order_id in
<foreach collection="list" item="orderId" open="(" separator="," close=")">
#{orderId}
</foreach>

8
cereshop-app/src/main/resources/mybatis/mapper/order/CereShopOrderDAO.xml

@ -498,19 +498,21 @@
<select id="findByParentId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.order.CereShopOrder">
SELECT order_id, buyer_user_id, customer_phone, shop_id, price, order_formid, customer_name, shop_group_work_id,
shop_seckill_id, shop_discount_id, payment_mode, coupon_id
shop_seckill_id, shop_discount_id, payment_mode, coupon_id, is_cross
FROM cere_shop_order where parent_id=#{parentId}
</select>
<select id="findByFormid" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.order.CereShopOrder">
SELECT order_id, buyer_user_id, customer_phone, shop_id, price, order_formid, customer_name, shop_group_work_id,
shop_seckill_id, shop_discount_id, payment_mode, coupon_id
shop_seckill_id, shop_discount_id, payment_mode, coupon_id, receive_name, receive_phone, address, remark,
receive_adress
FROM cere_shop_order where order_formid=#{orderFormId}
</select>
<select id="findByOrderId" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.order.CereShopOrder">
SELECT order_id,buyer_user_id,customer_phone,shop_id,price,order_formid,customer_name,
shop_seckill_id,shop_group_work_id,shop_discount_id
shop_seckill_id,shop_group_work_id,shop_discount_id, receive_name, receive_phone, address, remark,
receive_adress
FROM cere_shop_order where order_id=#{orderId}
</select>

67
cereshop-business/src/main/java/com/shop/cereshop/business/controller/HuaxunController.java

@ -0,0 +1,67 @@
package com.shop.cereshop.business.controller;
import com.google.gson.Gson;
import com.shop.cereshop.business.service.extend.HuaxunService;
import com.shop.cereshop.commons.domain.huaxun.HuaxunExpressRequestBo;
import com.shop.cereshop.commons.domain.huaxun.HuaxunOrderRequestBo;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 华讯模块
*/
@RestController
@RequestMapping("extend/huaxun")
@Slf4j(topic = "huaxunController")
@Api(value = "华讯模块", tags = "华讯模块")
public class HuaxunController {
@Autowired
private HuaxunService huaxunService;
/**
* 查询订单接口
* @throws Exception
*/
@PostMapping("order/queryOrder")
public String queryOrder(@RequestParam(name = "pay_start_time") String payStartTime,
@RequestParam(name = "pay_end_time") String payEndTime,
@RequestParam(name = "timestamp") Long timestamp, @RequestParam(name = "sign") String sign) throws Exception {
try {
HuaxunOrderRequestBo bo = new HuaxunOrderRequestBo();
bo.setPayStartTime(payStartTime);
bo.setPayEndTime(payEndTime);
bo.setTimestamp(timestamp);
bo.setSign(sign);
return new Gson().toJson(huaxunService.queryOrder(bo));
} catch (Exception e) {
e.printStackTrace();
}
return "[]";
}
/**
* 物流状态通知
* @throws Exception
*/
@PostMapping("express/notifyExpress")
public String notifyExpress(@RequestParam(name = "data") String data, @RequestParam(name = "timestamp") Long timestamp, @RequestParam(name = "sign") String sign) throws Exception {
try {
HuaxunExpressRequestBo bo = new HuaxunExpressRequestBo();
bo.setData(data);
bo.setTimestamp(timestamp);
bo.setSign(sign);
if(huaxunService.notifyExpress(bo)){
return "success";
}
} catch (Exception e) {
e.printStackTrace();
}
return "false";
}
}

111
cereshop-business/src/main/java/com/shop/cereshop/business/controller/XsPayController.java

@ -0,0 +1,111 @@
package com.shop.cereshop.business.controller;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.shop.cereshop.business.pay.xs.domain.XsCallBackRequestVo;
import com.shop.cereshop.business.pay.xs.service.XsPayService;
import com.shop.cereshop.business.service.order.CereShopOrderService;
import com.shop.cereshop.commons.utils.EmptyUtils;
import com.shop.cereshop.commons.utils.StringUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 新生支付模块
*/
@RestController
@RequestMapping("extend/xsPay")
@Slf4j(topic = "xsPayController")
@Api(value = "新生支付模块", tags = "新生支付模块")
public class XsPayController {
@Autowired
private XsPayService xsPayService;
//
//
// @Autowired
// private HuaxunService huaxunService;
//
//
@Autowired
private CereShopOrderService cereShopOrderService;
// /**
// * 支付通知回调
// * @throws Exception
// */
// @PostMapping("pay/notify")
// public void payNotify(@RequestParam(name = "msg") String msg) throws Exception {
// try {
// XsCallBackRequestVo xsCallBackRequestVo = xsPayService.parseCallBackRequestVo(msg);
// String status = xsCallBackRequestVo.getContent().getString("status");
// //0进行中 1成功 2失败
// if(StringUtils.equals(status, "1")){
// log.info("新生支付回调成功");
// //截取订单编号
// JSONObject content = xsCallBackRequestVo.getContent();
// String merOrderId = content.getString("merOrderId");
// String[] split = merOrderId.split("-");
// if(!EmptyUtils.isEmpty(split)){
// String orderFormId=split[0];
// if(!EmptyUtils.isEmpty(orderFormId)){
// //支付有礼
// cereShopOrderService.payGift(orderFormId);
// String dealId = content.getString("dealId");
// //处理支付成功后的其他逻辑
// cereShopOrderService.handleWxLog(orderFormId, dealId, merOrderId);
// }
//
// }
// //TODO 如果不是跨境支付应该不调用改接口------pxh
// if(StringUtils.equals(XspayConfig.DEFUALT_TRADE_TYPE, XsPayEnum.TRADE_TYPE_CROSS_BOARD_PAYMENT.getCode())){
// String payRequestBodyJson = xsPayService.getPayRequestBodyJson(merOrderId, new BigDecimal(Integer.parseInt(content.getString("orderAmount")) * 1.0f / 100),
// XsPayEnum.TRADE_TYPE_CROSS_BOARD_PAYMENT.getCode(), content.getString("payType"));
// huaxunService.pushBaoguanRequest(payRequestBodyJson);
//
// String msgStr = new String(Base64.getDecoder().decode(msg));
// huaxunService.pushBaoguanRespone(msgStr);
// }
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
//
/**
* 退款通知回调
* @throws Exception
*/
@PostMapping("refund/notify")
public void refundNotify(@RequestParam(name = "msg") String msg) throws Exception {
log.info("refundNotify msg:" + msg);
try {
XsCallBackRequestVo xsCallBackRequestVo = xsPayService.parseCallBackRequestVo(msg);
log.info(new Gson().toJson(xsCallBackRequestVo));
String status = xsCallBackRequestVo.getContent().getString("status");
//2成功 3失败
if(StringUtils.equals(status, "0")){
log.info("退款回调成功");
//截取订单编号
JSONObject content = xsCallBackRequestVo.getContent();
String merOrderId = content.getString("merOrderId");
String[] split = merOrderId.split("-");
if(!EmptyUtils.isEmpty(split)){
String orderFormId=split[0];
if(!EmptyUtils.isEmpty(orderFormId)){
String dealId = content.getString("refundOrderNo");
//处理支付成功后的其他逻辑
cereShopOrderService.handleRefundWxLog(orderFormId, dealId, merOrderId);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
//
}
}

2
cereshop-business/src/main/java/com/shop/cereshop/business/dao/buyer/CereBuyerUserDAO.java

@ -24,6 +24,8 @@ public interface CereBuyerUserDAO extends BaseMapper<CereBuyerUser> {
CereBuyerUser selectByPrimaryKey(Long buyerUserId);
List<CereBuyerUser> selectByPrimaryKeyList(List<Long> buyerUserIdList);
int updateByPrimaryKeySelective(CereBuyerUser record);
int updateByPrimaryKey(CereBuyerUser record);

4
cereshop-business/src/main/java/com/shop/cereshop/business/dao/order/CereOrderProductDAO.java

@ -9,8 +9,12 @@ import com.shop.cereshop.commons.domain.order.CereOrderProduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface CereOrderProductDAO extends BaseMapper<CereOrderProduct> {
int insertSelective(CereOrderProduct record);
List<CereOrderProduct> findByOrderIds(List<Long> orderIdList);
}

4
cereshop-business/src/main/java/com/shop/cereshop/business/dao/order/CereShopOrderDAO.java

@ -106,5 +106,7 @@ public interface CereShopOrderDAO extends BaseMapper<CereShopOrder> {
@Param("startTime") String startTime,
@Param("endTime") String endTime);
List<Map<String, Object>> selectSalesVolumeBySkuIdList(List<Long> skuIdList);
List<Map<String, Object>> selectSalesVolumeBySkuIdList(@Param("skuIdList") List<Long> skuIdList);
List<CereShopOrder> findByFormid(@Param("orderFormId") String orderFormId);
}

6
cereshop-business/src/main/java/com/shop/cereshop/business/param/product/SkuParam.java

@ -92,6 +92,12 @@ public class SkuParam {
private String skuImage;
/**
* 国际条码
*/
@ApiModelProperty(value = "国际条码")
private String skuCode;
/**
* 款式 0-单款式 1-多款式
*/
@ApiModelProperty(value = "款式 0-单款式 1-多款式")

227
cereshop-business/src/main/java/com/shop/cereshop/business/pay/xs/service/impl/XsPayServiceImpl.java

@ -11,11 +11,15 @@ import com.shop.cereshop.business.pay.xs.domain.XsRequestBo;
import com.shop.cereshop.business.pay.xs.service.XsPayService;
import com.shop.cereshop.business.pay.xs.utils.CommonUtils;
import com.shop.cereshop.business.pay.xs.utils.HttpUtils;
import com.shop.cereshop.business.service.order.CereShopOrderService;
import com.shop.cereshop.commons.config.XspayConfig;
import com.shop.cereshop.commons.constant.XsPayEnum;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.utils.EmptyUtils;
import com.shop.cereshop.commons.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.client.utils.URIBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@ -32,44 +36,66 @@ public class XsPayServiceImpl implements XsPayService {
//退款申请服务代码 serCode
private static final String REFUND_SER_CODE = "101006";
@Autowired
private CereShopOrderService cereShopOrderService;
@Override
public Map<String, String> refund(String outTradeNo, String transactionId, String outRefundNo, BigDecimal total, BigDecimal refund, Long afterId) throws Exception {
//构建请求参数
Map<String, String> headMap = CommonUtils.buildHeadMap(REFUND_SER_CODE);
Map<String, Object> contentMap = buildOrderRefundContentMap(outTradeNo, transactionId, total,
XspayConfig.APP_NOTICE_URL);
Map<String, Object> contentMap = build06ContentMap(outTradeNo, transactionId, refund,
XspayConfig.BUSINESS_RETURN_NOTICE_URL);
//head+content做md5并根据加签方式加密
String msg = CommonUtils.getRequestMsg(headMap, contentMap);
log.info("【" + PAY_SER_CODE + "】接口-请求报文:msg="+msg);
log.info("【" + REFUND_SER_CODE + "】接口-请求报文:msg="+msg);
String respMsg = HttpUtils.httpPost(XspayConfig.URL,msg);
//若响应respMsg为空时联系新生工作人员此处因时收银台模式前端页面提交方式当时错误时错误信息会重定向到其他页面展示
log.info("【" + PAY_SER_CODE + "】接口-响应报文:" + respMsg);
log.info("【" + REFUND_SER_CODE + "】接口-响应报文:" + respMsg);
// if(StrUtil.isNotBlank(respMsg)){
// try {
// //解析响应报文并验签
// CommonUtils.verifySignRespMsg(REFUND_SER_CODE,respMsg);
// LinkedHashMap<String,String> responseMap = JSONObject.parseObject(respMsg,new TypeReference<LinkedHashMap<String,String>>(){}, Feature.OrderedField );
// String resMsg = responseMap.get("msg");
// String responeMsg = new String(Base64.getDecoder().decode(resMsg));
// JSONObject jsonObject = JSONObject.parseObject(responeMsg);
// String qrCodeUrl = jsonObject.getJSONObject("content").getJSONObject("payInfo").getString("qrCodeUrl");
// qrCodeUrl = new URIBuilder(qrCodeUrl).getQueryParams().get(0).getValue();
// return qrCodeUrl;
// } catch (CoBusinessException e) {
// throw e;
// } catch (Exception e) {
// //支付方式为B2CB2BH5成功响应时respMsg为html页面代码
// if(respMsg.contains("toNativePayIndexForm")){
// log.info("【" + PAY_SER_CODE + "】接口-响应报文-HTML代码无需验签");
// }else{
// e.printStackTrace();
// }
// throw new CoBusinessException("10000","获取支付二维码出错");
// }
// }
if(StrUtil.isNotBlank(respMsg)){
try {
//解析响应报文并验签
CommonUtils.verifySignRespMsg(REFUND_SER_CODE,respMsg);
LinkedHashMap<String,String> responseMap = JSONObject.parseObject(respMsg,new TypeReference<LinkedHashMap<String,String>>(){}, Feature.OrderedField );
String resMsg = responseMap.get("msg");
String responeMsg = new String(Base64.getDecoder().decode(resMsg));
JSONObject jsonObject = JSONObject.parseObject(responeMsg);
JSONObject content = jsonObject.getJSONObject("content");
String status = content.getString("status");
//2成功 3失败
if(StringUtils.equals(status, "0")) {
String merOrderId = content.getString("merOrderId");
String oldMmerOrderId = content.getString("oldMerOrderId");
String dealId = content.getString("refundOrderNo");
String[] split = oldMmerOrderId.split("-");
if (!EmptyUtils.isEmpty(split)) {
String orderFormId = split[0];
if (!EmptyUtils.isEmpty(orderFormId)) {
//处理支付成功后的其他逻辑
cereShopOrderService.handleRefundWxLog(orderFormId, dealId, merOrderId);
}
}
}
} catch (CoBusinessException e) {
if(StringUtils.equals(e.getCode(), "0005")){
throw new CoBusinessException("10000","支付系统正在处理,请支付5分钟后再申请退款");
}else {
throw e;
}
} catch (Exception e) {
//支付方式为B2CB2BH5成功响应时respMsg为html页面代码
if(respMsg.contains("toNativePayIndexForm")){
log.info("【" + PAY_SER_CODE + "】接口-响应报文-HTML代码无需验签");
}else{
e.printStackTrace();
}
throw new CoBusinessException("10000","退款出错");
}
}
return null;
}
@ -79,39 +105,52 @@ public class XsPayServiceImpl implements XsPayService {
//构建请求参数
Map<String, String> headMap = CommonUtils.buildHeadMap(REFUND_SER_CODE);
Map<String, Object> contentMap = buildOrderRefundContentMap(outTradeNo, transactionId, total,
XspayConfig.APP_NOTICE_URL);
Map<String, Object> contentMap = build06ContentMap(outTradeNo, transactionId, refund, XspayConfig.APP_NOTICE_URL);
//head+content做md5并根据加签方式加密
String msg = CommonUtils.getRequestMsg(headMap, contentMap);
log.info("【" + PAY_SER_CODE + "】接口-请求报文:msg="+msg);
log.info("【" + REFUND_SER_CODE + "】接口-请求报文:msg="+msg);
String respMsg = HttpUtils.httpPost(XspayConfig.URL,msg);
//若响应respMsg为空时联系新生工作人员此处因时收银台模式前端页面提交方式当时错误时错误信息会重定向到其他页面展示
log.info("【" + PAY_SER_CODE + "】接口-响应报文:" + respMsg);
log.info("【" + REFUND_SER_CODE + "】接口-响应报文:" + respMsg);
// if(StrUtil.isNotBlank(respMsg)){
// try {
// //解析响应报文并验签
// CommonUtils.verifySignRespMsg(REFUND_SER_CODE,respMsg);
// LinkedHashMap<String,String> responseMap = JSONObject.parseObject(respMsg,new TypeReference<LinkedHashMap<String,String>>(){}, Feature.OrderedField );
// String resMsg = responseMap.get("msg");
// String responeMsg = new String(Base64.getDecoder().decode(resMsg));
// JSONObject jsonObject = JSONObject.parseObject(responeMsg);
// String qrCodeUrl = jsonObject.getJSONObject("content").getJSONObject("payInfo").getString("qrCodeUrl");
// qrCodeUrl = new URIBuilder(qrCodeUrl).getQueryParams().get(0).getValue();
// return qrCodeUrl;
// } catch (CoBusinessException e) {
// throw e;
// } catch (Exception e) {
// //支付方式为B2CB2BH5成功响应时respMsg为html页面代码
// if(respMsg.contains("toNativePayIndexForm")){
// log.info("【" + PAY_SER_CODE + "】接口-响应报文-HTML代码无需验签");
// }else{
// e.printStackTrace();
// }
// throw new CoBusinessException("10000","获取支付二维码出错");
// }
// }
if(StrUtil.isNotBlank(respMsg)){
try {
//解析响应报文并验签
CommonUtils.verifySignRespMsg(REFUND_SER_CODE,respMsg);
LinkedHashMap<String,String> responseMap = JSONObject.parseObject(respMsg,new TypeReference<LinkedHashMap<String,String>>(){}, Feature.OrderedField );
String resMsg = responseMap.get("msg");
String responeMsg = new String(Base64.getDecoder().decode(resMsg));
JSONObject jsonObject = JSONObject.parseObject(responeMsg);
JSONObject content = jsonObject.getJSONObject("content");
String status = content.getString("status");
//2成功 3失败
if(StringUtils.equals(status, "0")) {
String merOrderId = content.getString("merOrderId");
String[] split = merOrderId.split("-");
if (!EmptyUtils.isEmpty(split)) {
String orderFormId = split[0];
if (!EmptyUtils.isEmpty(orderFormId)) {
String dealId = content.getString("refundOrderNo");
//处理支付成功后的其他逻辑
cereShopOrderService.handleRefundWxLog(orderFormId, dealId, merOrderId);
}
}
}
} catch (CoBusinessException e) {
throw e;
} catch (Exception e) {
//支付方式为B2CB2BH5成功响应时respMsg为html页面代码
if(respMsg.contains("toNativePayIndexForm")){
log.info("【" + REFUND_SER_CODE + "】接口-响应报文-HTML代码无需验签");
}else{
e.printStackTrace();
}
throw new CoBusinessException("10000","退款出错");
}
}
return null;
}
@ -182,23 +221,24 @@ public class XsPayServiceImpl implements XsPayService {
* 构建content请求参数
* @return
*/
private static Map<String,Object> buildOrderRefundContentMap(String orderFormid, String dealId, BigDecimal money, String noticeUrl){
private static Map<String,Object> build06ContentMap(String orderFormid, String dealId, BigDecimal money, String noticeUrl){
Map<String, Object> contentMap = new LinkedHashMap<>();
log.info("orderFormid:" + orderFormid);
contentMap.put("merOrderId", System.currentTimeMillis()+"");
//oldMerOrderId 对应 101004101005接口中merOrderId
contentMap.put("oldMerOrderId", orderFormid);
//oldDealId 对应 101004101005接口响应参数中dealId
contentMap.put("oldDealId", dealId);
contentMap.put("amount", 1);//money.multiply(new BigDecimal(100)).intValue());
// contentMap.put("oldDealId", dealId);
contentMap.put("amount", money.multiply(new BigDecimal(100)).intValue());
contentMap.put("currency", "CNY");
contentMap.put("noticeUrl", noticeUrl);
return contentMap;
}
/**
* 构建content请求参数
* @return
*/
/**
* 构建content请求参数商家端的支付保证金属于国内支付不需要一些强制信息
* @return
*/
private static Map<String,Object> buildPayContentMap(String orderFormid, BigDecimal money, String tradeType,
String payType, String returnUrl, String noticeUrl){
// 设置请求正文 contentMap有序顺序按照文档从上到下为空字段可不传该字段
@ -207,17 +247,15 @@ public class XsPayServiceImpl implements XsPayService {
contentMap.put("merOrderId", orderFormid);
//商户名称 请根据实际情况替换
contentMap.put("displayName", "成美国际");
//TODO 商品名称
//商品名称 请根据实际情况替换
contentMap.put("goodsName", "商品名称");
contentMap.put("goodsName", "商家保证金");
//商品数量 请根据实际情况替换
contentMap.put("goodsCount", 1);
//商品类别 请根据实际情况替换
contentMap.put("goodsType", "01");
//订单金额单位分
contentMap.put("orderAmount", 1);//money.multiply(new BigDecimal(100)).intValue());
contentMap.put("orderAmount", money.multiply(new BigDecimal(100)).intValue());
//订单币种 CNY:人民币
contentMap.put("orderCurrencyCode", "CNY");
//贸易类型 0004-货物贸易
@ -234,9 +272,9 @@ public class XsPayServiceImpl implements XsPayService {
contentMap.put("settleCurrencyCode", "CNY");
//分账标识 0:不分账 1:实时分账 2:延时分账
contentMap.put("shareFlag", "0");
//分账订单信息 shangFlag=1时必填
JSONArray jsonArray = buildSubMerchantOrderDetails();
contentMap.put("subMerchantOrderDetails", JSONArray.toJSONString(jsonArray));
//分账订单信息 shangFlag=1时必填--商家保证金付款不需要分账和子订单
// JSONArray jsonArray = buildSubMerchantOrderDetails();
// contentMap.put("subMerchantOrderDetails", JSONArray.toJSONString(jsonArray));
//回调地址--支付成功后的前端回调地址先写死首页
contentMap.put("returnUrl", returnUrl);
@ -246,33 +284,34 @@ public class XsPayServiceImpl implements XsPayService {
//平台ID-平台型支付的时候使用
contentMap.put("platformId","");
//商户用户号 请根据实际情况选择填写 TODO 这个先写死但是应该要根据订单的支付人来传值
contentMap.put("customerId", "U00001");
//商户用户类型 请根据实际情况选择填写
contentMap.put("customerType", "1");
//商户用户姓名 请根据实际情况选择填写
contentMap.put("customerName", "潘孝河");
//商户用户证件号 请根据实际情况选择填写
contentMap.put("customerIdNo", "460004198911216054");
//商户用户手机号 请根据实际情况选择填写
contentMap.put("customerTel", "13700418358");
//以下信息在支付类型为快捷支付的时候必填
//商户用户银行卡号
contentMap.put("bankCardNo", "");
//商户用户银行卡类型
contentMap.put("bankCardType", "");
//有效期
contentMap.put("expireData", "");
//信用卡安全码
contentMap.put("cvn", "");
//备注
contentMap.put("remark", "");
//保留字段1
contentMap.put("reserve1", "");
//保留字段2 若要指定使用某条公众号/小程序appid时可填写appid或对应备案号
// //商户用户号 请根据实际情况选择填写 TODO 这个先写死但是应该要根据订单的支付人来传值
// contentMap.put("customerId", "U00001");
// //商户用户类型 请根据实际情况选择填写
// contentMap.put("customerType", "1");
// //商户用户姓名 请根据实际情况选择填写
// contentMap.put("customerName", "潘孝河");
// //商户用户证件号 请根据实际情况选择填写
// contentMap.put("customerIdNo", "460004198911216054");
// //商户用户手机号 请根据实际情况选择填写
// contentMap.put("customerTel", "13700418358");
// //以下信息在支付类型为快捷支付的时候必填
// //商户用户银行卡号
// contentMap.put("bankCardNo", "");
// //商户用户银行卡类型
// contentMap.put("bankCardType", "");
// //有效期
// contentMap.put("expireData", "");
// //信用卡安全码
// contentMap.put("cvn", "");
// //备注
// contentMap.put("remark", "");
// //保留字段1
// contentMap.put("reserve1", "");
// //保留字段2 若要指定使用某条公众号/小程序appid时可填写appid或对应备案号
contentMap.put("reserve2", "");
//预下单标识
contentMap.put("preOrderFlag", "");
// //预下单标识
// contentMap.put("preOrderFlag", "");
// declareCheck
return contentMap;
}

5
cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBuyerUserService.java

@ -11,9 +11,12 @@ import com.shop.cereshop.business.param.buyer.BuyerUserGetAllParam;
import com.shop.cereshop.business.param.buyer.UserSaveParam;
import com.shop.cereshop.business.param.buyer.UserUpdateParam;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.buyer.CereBuyerUser;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.exception.CoBusinessException;
import java.util.List;
public interface CereBuyerUserService {
Page<BuyerUser> getAll(BuyerUserGetAllParam param) throws CoBusinessException;
@ -26,4 +29,6 @@ public interface CereBuyerUserService {
void initBusinessBuyerUser();
void updateGrowth(Long buyerUserId, int growth);
List<CereBuyerUser> selectByBuyerUserIdList(List<Long> buyerUserIdList);
}

15
cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBuyerUserServiceImpl.java

@ -217,4 +217,19 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
public void updateGrowth(Long buyerUserId, int growth) {
cereBuyerUserDAO.updateGrowth(buyerUserId, growth);
}
@Override
public List<CereBuyerUser> selectByBuyerUserIdList(List<Long> buyerUserIdList) {
List<CereBuyerUser> cereBuyerUserList = cereBuyerUserDAO.selectByPrimaryKeyList(buyerUserIdList);
if(cereBuyerUserList != null){
for (CereBuyerUser cereBuyerUser : cereBuyerUserList) {
if (cereBuyerUser != null && cereBuyerUser.getWechatName() == null) {
cereBuyerUser.setWechatName(cereBuyerUser.getName());
}
}
}
return cereBuyerUserList;
}
}

41
cereshop-business/src/main/java/com/shop/cereshop/business/service/extend/HuaxunService.java

@ -0,0 +1,41 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.business.service.extend;
import com.shop.cereshop.commons.domain.huaxun.HuaxunExpressRequestBo;
import com.shop.cereshop.commons.domain.huaxun.HuaxunOrderRequestBo;
import com.shop.cereshop.commons.domain.huaxun.OrderListVo;
import com.shop.cereshop.commons.exception.CoBusinessException;
import java.io.UnsupportedEncodingException;
import java.util.List;
/**
* <p>
* 华讯清关业务接口
* </p>
*
* @author pxh
* @date 2023-03-10
*/
public interface HuaxunService {
/**
* 华讯查询订单
* @param bo
* @return
*/
List<OrderListVo> queryOrder(HuaxunOrderRequestBo bo) throws UnsupportedEncodingException, CoBusinessException;
/**
* 物流消息接收
* @param bo
* @return
*/
boolean notifyExpress(HuaxunExpressRequestBo bo) throws UnsupportedEncodingException, CoBusinessException;
}

172
cereshop-business/src/main/java/com/shop/cereshop/business/service/extend/impl/HuaxunServiceImpl.java

@ -0,0 +1,172 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.business.service.extend.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.gson.Gson;
import com.shop.cereshop.business.dao.order.CereShopOrderDAO;
import com.shop.cereshop.business.param.order.OrderDileveryParam;
import com.shop.cereshop.business.service.buyer.CereBuyerUserService;
import com.shop.cereshop.business.service.extend.HuaxunService;
import com.shop.cereshop.business.service.order.CereOrderDileverService;
import com.shop.cereshop.business.service.order.CereOrderProductService;
import com.shop.cereshop.commons.config.HuaxunConfig;
import com.shop.cereshop.commons.domain.buyer.CereBuyerUser;
import com.shop.cereshop.commons.domain.huaxun.*;
import com.shop.cereshop.commons.domain.order.CereOrderProduct;
import com.shop.cereshop.commons.domain.order.CereShopOrder;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.utils.EmptyUtils;
import com.shop.cereshop.commons.utils.MD5Utils;
import com.shop.cereshop.commons.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 华讯清关业务接口业务实现
* </p>
*
* @author pxh
* @date 2023-03-10
*/
@Slf4j
@Service
public class HuaxunServiceImpl implements HuaxunService {
@Autowired
private CereShopOrderDAO cereShopOrderDAO;
@Autowired
private CereOrderProductService cereOrderProductService;
@Autowired
private CereBuyerUserService cereBuyerUserService;
@Autowired
private CereOrderDileverService cereOrderDileverService;
@Override
public List<OrderListVo> queryOrder(HuaxunOrderRequestBo bo) throws UnsupportedEncodingException, CoBusinessException {
ValidationSign(bo);
log.info("华讯查询订单:" + new Gson().toJson(bo));
List<OrderListVo> orderListVos = new ArrayList<>();
LambdaQueryWrapper<CereShopOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CereShopOrder::getPaymentState, 1)
.eq(CereShopOrder::getState, 2)
.eq(CereShopOrder::getIsCross, 1)
.ge(CereShopOrder::getPaymentTime, bo.getPayStartTime())
.lt(CereShopOrder::getPaymentTime, bo.getPayEndTime());
List<CereShopOrder> shopOrderList = cereShopOrderDAO.selectList(wrapper);
if(shopOrderList != null && !shopOrderList.isEmpty()){
List<CereOrderProduct> opList = cereOrderProductService.findByOrderIds(shopOrderList.stream().map(CereShopOrder::getOrderId).collect(Collectors.toList()));
List<CereBuyerUser> buyerUserList = cereBuyerUserService.selectByBuyerUserIdList(shopOrderList.stream().map(CereShopOrder::getBuyerUserId).collect(Collectors.toList()));
orderListVos.addAll(shopOrderList.stream().map(shopOrder -> {
OrderListVo orderListVo = new OrderListVo();
orderListVo.setOrder_no(shopOrder.getOrderFormid());
orderListVo.setPay_amount(shopOrder.getOrderPrice().toPlainString());
CereBuyerUser buyerUser = buyerUserList.stream().filter(item -> item.getBuyerUserId().equals(shopOrder.getBuyerUserId())).findFirst().orElse(null);
if(buyerUser != null){
orderListVo.setBuyer_name(buyerUser.getRealName());
orderListVo.setBuyer_idcard(buyerUser.getIdCard());
orderListVo.setBuyer_mobile(buyerUser.getPhone());
}else {
log.info("华讯查询订单:查询不到对应的购买人");
}
orderListVo.setConsignee_name(shopOrder.getReceiveName());
orderListVo.setConsignee_mobile(shopOrder.getReceivePhone());
orderListVo.setConsignee_address(shopOrder.getReceiveAdress() + shopOrder.getAddress());
List<GoodListVo> goods = new ArrayList<>();
List<CereOrderProduct> orderOpList = opList.stream().filter(op -> op.getOrderId().equals(shopOrder.getId())).collect(Collectors.toList());
if(!orderOpList.isEmpty()){
goods.addAll(orderOpList.stream().map(orderOp -> {
GoodListVo good = new GoodListVo();
good.setGoods_title(orderOp.getProductName());
good.setModel(orderOp.getSKU());
good.setNumber(orderOp.getNumber());
good.setPrice(orderOp.getProductPrice().doubleValue());
return good;
}).collect(Collectors.toList())
);
}
orderListVo.setGoods(goods);
return orderListVo;
}).collect(Collectors.toList()));
}
return orderListVos;
}
@Override
public boolean notifyExpress(HuaxunExpressRequestBo bo) throws UnsupportedEncodingException, CoBusinessException {
ValidationSign(bo);
log.info("华讯物流状态通知:" + new Gson().toJson(bo));
ExpressListVo expressListVo = new Gson().fromJson(bo.getData(), ExpressListVo.class);
OrderDileveryParam orderDileveryParam = new OrderDileveryParam();
String orderFormId = expressListVo.getOrder_no();
String cereOrderFormId = orderFormId;
String[] split = orderFormId.split("-");
if(!EmptyUtils.isEmpty(split)) {
cereOrderFormId = split[0];
}
List<CereShopOrder> orderList = cereShopOrderDAO.findByFormid(cereOrderFormId);
if(orderList == null || orderList.isEmpty()){
log.info("查找不到对应的订单");
return false;
}
orderDileveryParam.setOrderId(orderList.get(0).getOrderId());
if(StringUtils.equals("yuantong", expressListVo.getExpress_code())){
//圆通
orderDileveryParam.setExpress(136L);
}else if(StringUtils.equals("zhongtong", expressListVo.getExpress_code())){
//中通
orderDileveryParam.setExpress(119L);
}else if(StringUtils.equals("shentong", expressListVo.getExpress_code())){
//申通
orderDileveryParam.setExpress(122L);
}else if(StringUtils.equals("yunda", expressListVo.getExpress_code())){
//韵达
orderDileveryParam.setExpress(117L);
}else if(StringUtils.equals("shunfeng", expressListVo.getExpress_code())){
//顺丰
orderDileveryParam.setExpress(118L);
}else if(StringUtils.equals("ems", expressListVo.getExpress_code())){
//邮政EMS
orderDileveryParam.setExpress(124L);
}else if(StringUtils.equals("jd", expressListVo.getExpress_code())){
//京东
orderDileveryParam.setExpress(123L);
}
orderDileveryParam.setDeliverFormid(expressListVo.getExpress_no());
try {
cereOrderDileverService.dileveryByCross(orderDileveryParam);
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
private void ValidationSign(HuaxunRequestBo bo) throws UnsupportedEncodingException, CoBusinessException {
String checkSign = bo.getTimestamp()+ HuaxunConfig.KEY;
String checkSignMd5 = MD5Utils.md5Hex(checkSign, "utf-8");
if(!StringUtils.endsWithIgnoreCase(checkSignMd5, bo.getSign())){
log.info("华讯接口验签失败:" + new Gson().toJson(bo));
throw new CoBusinessException("-1","验签校验失败");
}
}
}

8
cereshop-business/src/main/java/com/shop/cereshop/business/service/order/CereOrderDileverService.java

@ -13,5 +13,13 @@ import com.shop.cereshop.commons.exception.CoBusinessException;
public interface CereOrderDileverService {
void dilevery(OrderDileveryParam param, CerePlatformBusiness user) throws CoBusinessException,Exception;
/**
* 跨境发货
* @param param
* @throws CoBusinessException
* @throws Exception
*/
void dileveryByCross(OrderDileveryParam param) throws CoBusinessException,Exception;
void refundDilevery(AfterIdParam param, CerePlatformBusiness user) throws CoBusinessException,Exception;
}

6
cereshop-business/src/main/java/com/shop/cereshop/business/service/order/CereOrderProductService.java

@ -5,5 +5,11 @@
*/
package com.shop.cereshop.business.service.order;
import com.shop.cereshop.commons.domain.order.CereOrderProduct;
import java.util.List;
public interface CereOrderProductService {
List<CereOrderProduct> findByOrderIds(List<Long> orderIdList);
}

54
cereshop-business/src/main/java/com/shop/cereshop/business/service/order/impl/CereOrderDileverServiceImpl.java

@ -131,6 +131,60 @@ public class CereOrderDileverServiceImpl implements CereOrderDileverService {
@Override
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class})
public void dileveryByCross(OrderDileveryParam param) throws CoBusinessException,Exception {
String time = TimeUtils.yyMMddHHmmss();
CereOrderDilever cereOrderDilever=new CereOrderDilever();
cereOrderDilever.setOrderId(param.getOrderId());
cereOrderDilever.setExpress(param.getExpress());
cereOrderDilever.setDeliverFormid(param.getDeliverFormid());
cereOrderDilever.setCreateTime(time);
cereOrderDileverDAO.insert(cereOrderDilever);
//更新订单状态为待收货
CereShopOrder cereShopOrder=cereShopOrderService.findById(param.getOrderId());
cereShopOrder.setOrderId(param.getOrderId());
cereShopOrder.setState(IntegerEnum.ORDER_HAVE_DILEVERY.getCode());
cereShopOrderService.updateState(cereShopOrder);
//新增自动15天确认收货定时任务
//stringRedisService.set(StringEnum.ORDER_CONFIRM_DILEVERY.getCode()+"-"+param.getOrderId(),1,15*24*60*60*1000);
//cereRedisKeyServcice.add(StringEnum.ORDER_CONFIRM_DILEVERY.getCode()+"-"+param.getOrderId(),TimeUtils.getMoreDayAfter(time,15));
long deliveryTime = 7 * 24 * 3600 * 1000L;
if (autoDeliveryTime != null) {
deliveryTime = autoDeliveryTime;
}
Date endTime = new Date(TimeUtils.parseDate(time).getTime() + deliveryTime);
//如果订单申请了退款或者退货并且在流程中则不做自动确认收货
List<Integer> afterStateList = cereOrderAfterService.selectAfterStateList(param.getOrderId());
boolean containAllStateFree = IntegerEnum.CONFIRM_DELIVERY_AFTER_STATE_LIST.containsAll(afterStateList);
if (CollectionUtils.isEmpty(afterStateList) || containAllStateFree) {
stringRedisService.set(StringEnum.ORDER_CONFIRM_DILEVERY.getCode()+"-"+param.getOrderId(), 1, deliveryTime);
cereRedisKeyServcice.add(StringEnum.ORDER_CONFIRM_DILEVERY.getCode()+"-"+param.getOrderId(), Tools.date2Str(endTime));
log.info("add ORDER_CONFIRM_DILEVERY Redis Message key = {}", StringEnum.ORDER_CONFIRM_DILEVERY.getCode()+"-"+param.getOrderId());
}
//新增订单已完成消息
CereNotice cereNotice=new CereNotice();
cereNotice.setNoticeType(IntegerEnum.NOTICE_TYPE_SYSTEM.getCode());
cereNotice.setJump(IntegerEnum.NOTICE_JUMP_ORDER.getCode());
cereNotice.setBuyerUserId(cereShopOrder.getBuyerUserId());
cereNotice.setShopId(cereShopOrder.getShopId());
cereNotice.setReceive(3);
cereNotice.setNoticeTitle(StringEnum.NOTICE_TITLE_ORDER_DELIVERY.getCode());
cereNotice.setNoticeContent("您购买的"+cereShopOrder.getOrderFormid()+"商家已发货,点击查看物流详情");
cereNotice.setOnly(cereShopOrder.getOrderId());
cereNotice.setCreateTime(time);
cereNotice.setIfRead(IntegerEnum.NO.getCode());
cereNoticeService.insert(cereNotice);
//发送短信
if (StringUtils.isNotBlank(cereShopOrder.getCustomerPhone()) && cereShopOrder.getCustomerPhone().equals("15986612770")) {
miaoxinMessageService.sendContent(cereShopOrder.getCustomerPhone(), "您订购的商品已发货,宝贝快马加鞭的奔向您,请注意查收!海觅海淘竭诚为您服务!【海觅SeaMee】");
}
}
@Override
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class})
public void refundDilevery(AfterIdParam param, CerePlatformBusiness user) throws CoBusinessException,Exception {
String time= TimeUtils.yyMMddHHmmss();
CereAfterDilever cereAfterDilever=new CereAfterDilever();

15
cereshop-business/src/main/java/com/shop/cereshop/business/service/order/impl/CereOrderProductServiceImpl.java

@ -5,9 +5,24 @@
*/
package com.shop.cereshop.business.service.order.impl;
import com.shop.cereshop.business.dao.order.CereOrderProductDAO;
import com.shop.cereshop.business.service.order.CereOrderProductService;
import com.shop.cereshop.commons.domain.order.CereOrderProduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CereOrderProductServiceImpl implements CereOrderProductService {
@Autowired
private CereOrderProductDAO cereOrderProductDAO;
@Override
public List<CereOrderProduct> findByOrderIds(List<Long> orderIdList) {
return cereOrderProductDAO.findByOrderIds(orderIdList);
}
}

15
cereshop-business/src/main/resources/application-business-dev.yml

@ -63,7 +63,7 @@ spring:
max-idle: 400
min-idle: 0
#网站域名
domain: https://ceres.zkthink.com
domain: http://122.9.152.120
#阿里云短信
aliyun:
@ -96,9 +96,9 @@ miaoxinyun:
template: 您好,您的验证码为:{0},请妥善保管,5分钟后失效
upload:
type: ALI # 当前支持 ALI LOCAL 两种
storage-path: /Users/root/Documents/uploadfile/file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/local/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
type: LOCAL # 当前支持 ALI LOCAL 两种
storage-path: /home/ceres/cereshop-file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/ceres-local-file/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
alioss:
file:
@ -200,7 +200,14 @@ channelCouponActivityUrl: ${spring.domain}/h5/#/pages_category_page2/channelCoup
xspay:
url: https://uwebgatetest.hnapay.com/webgate/unifiedAPI.htm
mer_code: 10000000381
app_return_url: xx
app_notice_url: http://122.9.152.120/ceres-app-api/extend/xsPay/pay/notify
app_baoguan_notice_url: http://122.9.152.120/ceres-app-api/extend/xsPay/pay/baoguannotify
business_return_url: xx
business_notice_url: http://122.9.152.120/ceres-business-api/extend/xsPay/pay/notify
business_return_notice_url: http://122.9.152.120/ceres-business-api/extend/xsPay/refund/notify
rsa_private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBANMGXGvYX9yqb5qauZgc2mXk4R+2op9KLhCuqO0mt5aTyAFfGXty2RHAinwQif6AUyfFZK7p0/9xz2yX4VHltA4qFNsgQmi2Qtry8MTbBrPtVgukWdLmcK7NqR9C8reXO7e/Np3SPNLle5MsEkwM25cMK56JEc3WMRe+KIRZ69d1AgMBAAECgYBTSW1suyeKplIKCQs7OBgSozUfGSwyBksMFoNhpihLa+RCdlBOYtO9p+qAcN6l7evkBIpqZqtfZIHjcEZj1m8reIHHBnuv/sKGXWPvMBKqckenwNnqUzlj4X8hvFtkbcqXLGdyYoicW+P5+P8zHmYRom+izd5FO9281zXa4UK6gQJBAOquqD84B1VnNq2xopaaJvxaL4c5IOinkfRWShttANCpt1D0t1cs+7WPq9sdFZ4cyHYomxuC4knqJh1E/WzCVqUCQQDmMZH8+6sgqOrgsECw6w0KdUci/XgzT/DRS/3MFMeRv7ygEtdlyvyxRirEArsjQgDg3IBLo9TxBUdygPhgXnSRAkEAtp95r9By7IOoKhw8cMO+qMuphqnvMP0NeD0Z6CO36ajYTXhRn9YSfiQyUQ1eAC9X05MfuJXucCR0ynwgVd0ZPQJAdYaRdow3TrFvWdAi9zDKs7A05ZRrrib+WJ1nsq5ZRfySnVeBSaNdaFTeuLx8NwAX2rY5emTm7zc2xys5pFoVQQJAUPrxmTbELDTF1by6POX/IT3iSeClzOx+M05Yd4sgXtALPjYt0VMLtnsfmt9qMEjhk0Q95wgdmeHsBHxno5qGfQ==
newpay_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDmVh2/xldLXhVU/mNT57m95uw0Hr0Pdl4pUyM2xV509LqLYTbLduCqqnuMTJUq7Irv8SsKfVqB7zKggxFyjmIfeeyTbhMDJkWZ20xRhv+rSw3ZBQD/Hbn+cxhi4FZ3gc+jUSI1pIsPrlvRK7E5DyWLa/RvZYiQfW/XYI4c1Mb29QIDAQAB
default_company_code: 460116287K
default_company_name: 新生支付有限公司

6
cereshop-business/src/main/resources/application-business-prod.yml

@ -96,9 +96,9 @@ miaoxinyun:
template: 您好,您的验证码为:{0},请妥善保管,5分钟后失效
upload:
type: ALI # 当前支持 ALI LOCAL 两种
storage-path: /Users/root/Documents/uploadfile/file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/local/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
type: LOCAL # 当前支持 ALI LOCAL 两种
storage-path: /home/ceres/cereshop-file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/ceres-local-file/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录
alioss:
file:

2
cereshop-business/src/main/resources/application-business-test.yml

@ -96,7 +96,7 @@ miaoxinyun:
template: 您好,您的验证码为:{0},请妥善保管,5分钟后失效
upload:
type: ALI # 当前支持 ALI LOCAL 两种
type: LOCAL # 当前支持 ALI LOCAL 两种
storage-path: /Users/root/Documents/uploadfile/file/ # 这个路径在 type = LOCAL的时候才需要配置 文件存储路径 ( 某些版本的 window 需要改成 D:\\data\\projects\\uploadfile\\file\\ )
uriPrefix: ${spring.domain}/local/ # 这个路径在 type = LOCAL的时候才需要配置 域名后面的/local/ 需要配置nginx 映射到服务器上 的 storerage-path 对应的目录

12
cereshop-business/src/main/resources/application.yml

@ -67,11 +67,13 @@ autoDeliveryTime: 604800000
xspay:
url: https://uwebgate.hnapay.com/webgate/unifiedAPI.htm
app_return_url: xx
app_notice_url: xx
app_notice_url: http://14.22.116.132:81/ceres-app-api/extend/xsPay/pay/notify
app_baoguan_notice_url: http://14.22.116.132:81/ceres-app-api/extend/xsPay/pay/baoguannotify
business_return_url: xx
business_notice_url: xx
mer_code: 10000000381
business_notice_url: http://14.22.116.132:81/ceres-business-api/extend/xsPay/pay/notify
business_return_notice_url: http://14.22.116.132:81/ceres-business-api/extend/xsPay/refund/notify
mer_code: 5001626421847836001
sign_type: 1
rsa_private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBANMGXGvYX9yqb5qauZgc2mXk4R+2op9KLhCuqO0mt5aTyAFfGXty2RHAinwQif6AUyfFZK7p0/9xz2yX4VHltA4qFNsgQmi2Qtry8MTbBrPtVgukWdLmcK7NqR9C8reXO7e/Np3SPNLle5MsEkwM25cMK56JEc3WMRe+KIRZ69d1AgMBAAECgYBTSW1suyeKplIKCQs7OBgSozUfGSwyBksMFoNhpihLa+RCdlBOYtO9p+qAcN6l7evkBIpqZqtfZIHjcEZj1m8reIHHBnuv/sKGXWPvMBKqckenwNnqUzlj4X8hvFtkbcqXLGdyYoicW+P5+P8zHmYRom+izd5FO9281zXa4UK6gQJBAOquqD84B1VnNq2xopaaJvxaL4c5IOinkfRWShttANCpt1D0t1cs+7WPq9sdFZ4cyHYomxuC4knqJh1E/WzCVqUCQQDmMZH8+6sgqOrgsECw6w0KdUci/XgzT/DRS/3MFMeRv7ygEtdlyvyxRirEArsjQgDg3IBLo9TxBUdygPhgXnSRAkEAtp95r9By7IOoKhw8cMO+qMuphqnvMP0NeD0Z6CO36ajYTXhRn9YSfiQyUQ1eAC9X05MfuJXucCR0ynwgVd0ZPQJAdYaRdow3TrFvWdAi9zDKs7A05ZRrrib+WJ1nsq5ZRfySnVeBSaNdaFTeuLx8NwAX2rY5emTm7zc2xys5pFoVQQJAUPrxmTbELDTF1by6POX/IT3iSeClzOx+M05Yd4sgXtALPjYt0VMLtnsfmt9qMEjhk0Q95wgdmeHsBHxno5qGfQ==
newpay_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDmVh2/xldLXhVU/mNT57m95uw0Hr0Pdl4pUyM2xV509LqLYTbLduCqqnuMTJUq7Irv8SsKfVqB7zKggxFyjmIfeeyTbhMDJkWZ20xRhv+rSw3ZBQD/Hbn+cxhi4FZ3gc+jUSI1pIsPrlvRK7E5DyWLa/RvZYiQfW/XYI4c1Mb29QIDAQAB
rsa_private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIsNcvBCDUYCkEyHcuzYyGL9TOHV0kQWcAUJmQqgIIcn7devK2fCSgZs5N42tVm59m07VyUmYXfXrFzx80qwp0Db3bUrqAZqMDB1YnxjiM+Rrrm0pPAPGvGUR4XunPIEbqidezUe1pZCMavejql+TkouXrtHQhZVJJHOQwhTvO03AgMBAAECgYBaFKRZMPEYYaDJcxXoiaeHOUENLE/C/CYlnUofsAxigmN6Tmh4F02NTA4YRqjFL8uMh9y0nGCYGof2zmcmA7rVPSOaQwqwqmc+lHWq/Jy5Z6cAxlod1UeA+BEF9gc/d6YNJx+1UoywMJgr4o/59K9MCZofFLUPGhxoMTQzTB34wQJBAL49KvP5EktoEbloVrqoMNXalgXmGeETrUGkc29uTegT/K/29FllcY5mlSJhnL/uoW8aMuU2V8h7fv7RoJBX/DUCQQC7HqNbl0tmj4ffBUsggoTyuKQby2bNLqPJ6wHcQB5OAZhP2E4q+KC9MpS3eT0ljC27/6T+y4Qvry+THmiU1jk7AkB4bWJWhZKmN6AYvctBaB1aE4CrBUnWqM0h48fLf4lD4/svLWbrfINRQPEhjadb/OUm3u/fF/KkEEGJcAxzs68NAkAIqCo2mpFKdWl7z+rh3if4csJk5swiwf2h4dV8Mxsz0K8TQpabNlV5a1WmB13k1s9m2zTu9MtwyVISJF4CRMbxAkEAi88aKBXP1TO9AFZwyNE2Z9dVcSk2xruj9yLgfKvpcZF5eGm3/S9wGz9k+753rxe/KMkWfWd0eIK3VK0iYJ9K+Q==
newpay_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSsyBgvE

35
cereshop-business/src/main/resources/mybatis/mapper/buyer/CereBuyerUserDAO.xml

@ -11,6 +11,8 @@
<result column="wechat_name" jdbcType="VARCHAR" property="wechatName" />
<result column="wechat_number" jdbcType="VARCHAR" property="wechatNumber" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="real_name" jdbcType="VARCHAR" property="realName" />
<result column="id_card" jdbcType="VARCHAR" property="idCard" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="head_image" jdbcType="VARCHAR" property="headImage" />
<result column="state" jdbcType="BIT" property="state" />
@ -21,7 +23,7 @@
</resultMap>
<sql id="Base_Column_List">
buyer_user_id, `name`, sex, birthday, wechat_open_id, wechat_union_id, wechat_name,
wechat_number, phone, `password`, head_image, `state`, remark, token, create_time,
wechat_number, phone, real_name, id_card, `password`, head_image, `state`, remark, token, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@ -30,6 +32,17 @@
from cere_buyer_user
where buyer_user_id = #{buyerUserId,jdbcType=BIGINT}
</select>
<select id="selectByPrimaryKeyList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cere_buyer_user
where buyer_user_id in
<foreach collection="buyerUserIdList" item="buyerUserId" open="(" separator="," close=")">
#{buyerUserId}
</foreach>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cere_buyer_user
where buyer_user_id = #{buyerUserId,jdbcType=BIGINT}
@ -61,6 +74,12 @@
<if test="phone != null and phone!=''">
phone,
</if>
<if test="realName != null and realName!=''">
real_name,
</if>
<if test="idCard != null and idCard!=''">
id_card,
</if>
<if test="password != null and password!=''">
`password`,
</if>
@ -108,6 +127,12 @@
<if test="phone != null and phone!=''">
#{phone,jdbcType=VARCHAR},
</if>
<if test="realName != null and realName!=''">
#{realName,jdbcType=VARCHAR},
</if>
<if test="idCard != null and idCard!=''">
#{idCard,jdbcType=VARCHAR},
</if>
<if test="password != null and password!=''">
#{password,jdbcType=VARCHAR},
</if>
@ -158,6 +183,12 @@
<if test="phone != null and phone!=''">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="realName != null and realName!=''">
real_name = #{realName,jdbcType=VARCHAR},
</if>
<if test="idCard != null and idCard!=''">
id_card = #{idCard,jdbcType=VARCHAR},
</if>
<if test="password != null and password!=''">
`password` = #{password,jdbcType=VARCHAR},
</if>
@ -192,6 +223,8 @@
wechat_name = #{wechatName,jdbcType=VARCHAR},
wechat_number = #{wechatNumber,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
real_name = #{realName,jdbcType=VARCHAR},
id_card = #{idCard,jdbcType=VARCHAR},
`password` = #{password,jdbcType=VARCHAR},
head_image = #{headImage,jdbcType=VARCHAR},
`state` = #{state,jdbcType=BIT},

10
cereshop-business/src/main/resources/mybatis/mapper/order/CereOrderProductDAO.xml

@ -74,4 +74,14 @@
</if>
</trim>
</insert>
<select id="findByOrderIds" resultMap="BaseResultMap">
select order_id, product_id, sku_id, product_name, `number`, product_price, image, SKU, weight,
activity_type, activity_id, use_credit, use_credit_amount
from cere_order_product
where order_id in
<foreach collection="list" item="orderId" open="(" separator="," close=")">
#{orderId}
</foreach>
</select>
</mapper>

10
cereshop-business/src/main/resources/mybatis/mapper/order/CereShopOrderDAO.xml

@ -498,7 +498,7 @@
SELECT a.*
FROM cere_shop_order a
LEFT JOIN cere_pay_log b ON a.order_formid = b.order_formid
where b.out_trade_no LIKE CONCAT('%', #{orderFormid}, '%')
where b.out_trade_no LIKE CONCAT('%', #{orderFormId}, '%')
and b.state = '支付'
</select>
@ -560,9 +560,15 @@
select sku_id, sum(number) as sales_volume
from cere_shop_order a join cere_order_product b on b.order_id = a.order_id
and a.payment_state = 1 and b.sku_id in
<foreach collection="list" item="skuId" open="(" separator="," close=")">
<foreach collection="skuIdList" item="skuId" open="(" separator="," close=")">
#{skuId}
</foreach>
group by b.sku_id
</select>
<select id="findByFormid" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.order.CereShopOrder">
SELECT order_id, buyer_user_id, customer_phone, shop_id, price, order_formid, customer_name, shop_group_work_id,
shop_seckill_id, shop_discount_id, payment_mode, coupon_id
FROM cere_shop_order where order_formid=#{orderFormId}
</select>
</mapper>

32
cereshop-business/src/main/resources/mybatis/mapper/product/CereProductSkuDAO.xml

@ -10,17 +10,19 @@
<result column="rate" jdbcType="DECIMAL" property="rate"/>
<result column="storehouse_id" jdbcType="BIGINT" property="storehouseId"/>
<result column="stock_number" jdbcType="INTEGER" property="stockNumber"/>
<result column="is_cross" jdbcType="BIT" property="isCross"/>
<result column="total" jdbcType="INTEGER" property="total"/>
<result column="weight" jdbcType="DECIMAL" property="weight"/>
<result column="sku_image" jdbcType="VARCHAR" property="skuImage"/>
<result column="sku_code" jdbcType="VARCHAR" property="skuCode"/>
<result column="style" jdbcType="BIT" property="style"/>
<result column="create_time" jdbcType="VARCHAR" property="createTime"/>
<result column="update_time" jdbcType="VARCHAR" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
sku_id
, product_id,SKU, price, original_price, rate, storehouse_id, stock_number,total, weight,
sku_image, `style`, create_time, update_time
, product_id,SKU, price, original_price, rate, storehouse_id, stock_number,is_cross, total, weight,
sku_image, sku_code, `style`, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
@ -58,6 +60,9 @@
<if test="stockNumber != null">
stock_number,
</if>
<if test="isCross != null">
is_cross,
</if>
<if test="total != null">
total,
</if>
@ -67,6 +72,9 @@
<if test="skuImage != null and skuImage!=''">
sku_image,
</if>
<if test="skuCode != null and skuCode!=''">
sku_code,
</if>
<if test="style != null">
`style`,
</if>
@ -99,6 +107,9 @@
<if test="stockNumber != null">
#{stockNumber,jdbcType=INTEGER},
</if>
<if test="isCross != null">
#{isCross,jdbcType=BIT},
</if>
<if test="total != null">
#{total,jdbcType=INTEGER},
</if>
@ -108,6 +119,9 @@
<if test="skuImage != null and skuImage!=''">
#{skuImage,jdbcType=VARCHAR},
</if>
<if test="skuCode != null and skuCode!=''">
#{skuCode,jdbcType=VARCHAR},
</if>
<if test="style != null">
#{style,jdbcType=BIT},
</if>
@ -155,6 +169,9 @@
<if test="skuImage != null and skuImage!=''">
sku_image = #{skuImage,jdbcType=VARCHAR},
</if>
<if test="skuCode != null and skuCode!=''">
sku_code = #{skuCode,jdbcType=VARCHAR},
</if>
<if test="style != null">
`style` = #{style,jdbcType=BIT},
</if>
@ -176,9 +193,11 @@
rate = #{rate,jdbcType=DECIMAL},
storehouse_id = #{storehouseId,jdbcType=BIGINT},
stock_number = #{stockNumber,jdbcType=INTEGER},
is_cross = #{isCross,jdbcType=BIT},
total = #{total,jdbcType=INTEGER},
weight = #{weight,jdbcType=DECIMAL},
sku_image = #{skuImage,jdbcType=VARCHAR},
sku_code = #{skuCode,jdbcType=VARCHAR},
`style` = #{style,jdbcType=BIT},
create_time = #{createTime,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=VARCHAR}
@ -187,8 +206,8 @@
<insert id="insertBatch" parameterType="java.util.List">
insert into cere_product_sku (product_id, sku_name, sku_value,
price, original_price, rate, storehouse_id, stock_number,
weight, sku_image, `style`,
price, original_price, rate, storehouse_id, stock_number,is_cross,
weight, sku_image, sku_code, `style`,
create_time) values
<foreach collection="list" item="item" index="index" separator=",">
(
@ -200,8 +219,10 @@
#{item.rate},
#{item.storehouseId},
#{item.stockNumber},
#{item.isCross},
#{item.weight},
#{item.skuImage},
#{item.skuCode},
#{item.style},
#{item.createTime}
)
@ -235,7 +256,8 @@
weight,
sku_image,
`style`,
SKU
SKU,
sku_code
FROM cere_product_sku
where product_id = #{productId}
</select>

70
cereshop-commons/src/main/java/com/shop/cereshop/commons/config/XspayConfig.java

@ -23,11 +23,17 @@ public class XspayConfig {
// 支付结果通知地址
public static String APP_NOTICE_URL = "http://122.9.152.120/ceres-app-api/extend/xsPay/pay/notify";
// 报关结果通知地址
public static String APP_BAOGUAN_NOTICE_URL = "http://122.9.152.120/ceres-app-api/extend/xsPay/pay/boguannotify";
// 支付回调地址
public static String BUSINESS_RETURN_URL = "xx";
// 支付结果通知地址
public static String BUSINESS_NOTICE_URL = "http://122.9.152.120/ceres-app-api/extend/xsPay/pay/notify";
public static String BUSINESS_NOTICE_URL = "http://122.9.152.120/ceres-business-api/extend/xsPay/pay/notify";
// 退款结果通知地址
public static String BUSINESS_RETURN_NOTICE_URL = "http://122.9.152.120/ceres-business-api/extend/xsPay/refund/notify";
/**
* 商户会员号 merCode
@ -58,18 +64,17 @@ public class XspayConfig {
*/
public static final String DEFAULT_CHARSET = "UTF-8";
/**
* 默认报关商家电商平台代码
*/
public static String DEFAULT_COMPANY_CODE = "";
/**
* 默认报关商家电商平台名称
*/
public static String DEFAULT_COMPANY_NAME = "";
// // 页面跳转同步通知页面路径 需http://或者https://格式的完整路径不能加?id=123这类自定义参数必须外网可以正常访问 商户可以自定义同步跳转地址
// public static String REDIRECT_URL;
//
// // 退款回调地址
// public static String REFUND_NOTIFY_URL;
//
// // 支付成功后端回调地址
// public static String APP_NOTIFY_URL;
//
// // 平台活动保证金支付成功回调地址
// public static String BOND_NOTIFY_URL;
public static String wxAppid = "";
@Value("${xspay.url:}")
public void setUrl(String url) {
@ -86,6 +91,11 @@ public class XspayConfig {
this.APP_NOTICE_URL = url;
}
@Value("${xspay.app_baoguan_notice_url:}")
public void setAppBaoGuanNoticeUrl(String url) {
this.APP_BAOGUAN_NOTICE_URL = url;
}
@Value("${xspay.business_return_url:}")
public void setBusinessReturnUrl(String url) {
this.BUSINESS_RETURN_URL = url;
@ -96,6 +106,11 @@ public class XspayConfig {
this.BUSINESS_NOTICE_URL = url;
}
@Value("${xspay.business_return_notice_url:}")
public void setBusinessReturnNoticeUrl(String url) {
this.BUSINESS_RETURN_NOTICE_URL = url;
}
@Value("${xspay.mer_code:}")
public void setMerCode(String merCode) {
this.MER_CODE = merCode;
@ -116,24 +131,17 @@ public class XspayConfig {
this.NEWPAY_PUBLIC_KEY = newpayPublicKey;
}
// @Value("${alipay.redirect_url}")
// public void setRedirectUrl(String redirectUrl) {
// this.REDIRECT_URL = redirectUrl;
// }
//
// @Value("${alipay.refund_notifyurl}")
// public void setRefundNotifyUrl(String refundNotifyUrl) {
// this.REFUND_NOTIFY_URL = refundNotifyUrl;
// }
//
// @Value("${alipay.app_notifyurl}")
// public void setAppNotifyUrl(String appNotifyUrl) {
// this.APP_NOTIFY_URL = appNotifyUrl;
// }
//
// @Value("${alipay.bond_notifyurl}")
// public void setBondNotifyUrl(String bondNotifyUrl) {
// this.BOND_NOTIFY_URL = bondNotifyUrl;
// }
@Value("${xspay.default_company_code:}")
public void setCompanyCode(String defaultCompanyCode) {
this.DEFAULT_COMPANY_CODE = defaultCompanyCode;
}
@Value("${xspay.default_company_name:}")
public void setCompanyName(String defaultCompanyName) {
this.DEFAULT_COMPANY_NAME = defaultCompanyName;
}
@Value("${weixin.appid:}")
public void setWxAppid(String appId) {
this.wxAppid = appId;
}
}

6
cereshop-commons/src/main/java/com/shop/cereshop/commons/domain/order/CereOrderProduct.java

@ -102,6 +102,12 @@ public class CereOrderProduct implements Serializable {
*/
private BigDecimal logisticsPrice;
/**
* 税率
*/
@TableField(exist = false)
private BigDecimal rate;
private static final long serialVersionUID = 1L;
}

6
cereshop-commons/src/main/java/com/shop/cereshop/commons/domain/product/CereProductSku.java

@ -98,6 +98,12 @@ public class CereProductSku implements Serializable {
private String skuImage;
/**
* 国际条码
*/
@ApiModelProperty(value = "国际条码")
private String skuCode;
/**
* 款式 0-单款式 1-多款式
*/
@ApiModelProperty(value = "款式 0-单款式 1-多款式")

Loading…
Cancel
Save