master
袁野 2 months ago
commit 079a8e2790
  1. 19
      bweb/src/main/java/com/bweb/controller/TestController.java
  2. 81
      order/src/main/java/com/order/controller/OrderController.java
  3. 4
      order/src/main/java/com/order/controller/OrderPayController.java
  4. 2
      order/src/main/java/com/order/controller/OrderPayNotifyController.java
  5. 43
      order/src/main/resources/dev/logback.xml
  6. 28
      order/src/main/resources/prod/logback.xml
  7. 78
      service/src/main/java/com/hfkj/common/utils/SignatureUtil.java
  8. 8
      service/src/main/java/com/hfkj/config/CommonSysConfig.java
  9. 67
      service/src/main/java/com/hfkj/haioil/HaiOilService.java
  10. 2
      service/src/main/java/com/hfkj/model/order/orderExport/OrderGoodsExportModel.java
  11. 52
      service/src/main/java/com/hfkj/service/SecConfigService.java
  12. 34
      service/src/main/java/com/hfkj/service/impl/SecConfigServiceImpl.java
  13. 5
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java
  14. 17
      service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java
  15. 5
      service/src/main/java/com/hfkj/service/pay/huift/TradeService.java
  16. 2
      service/src/main/java/com/hfkj/yushang/YuShangService.java
  17. 4
      service/src/main/resources/dev/commonConfig.properties

@ -18,6 +18,8 @@ import com.hfkj.service.goods.GoodsUserAddressService;
import com.hfkj.service.hlt.HltCanteenService; import com.hfkj.service.hlt.HltCanteenService;
import com.hfkj.service.hlt.HuiLianTongUnionCardService; import com.hfkj.service.hlt.HuiLianTongUnionCardService;
import com.hfkj.service.order.BsOrderChildService; import com.hfkj.service.order.BsOrderChildService;
import com.hfkj.service.pay.huift.TradeService;
import com.hfkj.service.pay.huift.config.HuiftConfig;
import com.hfkj.sysenum.order.OrderLogisticsStatusEnum; import com.hfkj.sysenum.order.OrderLogisticsStatusEnum;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -60,6 +62,23 @@ public class TestController {
@Resource @Resource
private GoodsUserAddressService addressService; private GoodsUserAddressService addressService;
@Resource
private TradeService huiftTradeService;
@RequestMapping(value="/thirdPayResult",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询V家园订单交易状态")
public ResponseData thirdPayResult(@RequestParam(value = "preOrderNo" , required = true) String preOrderNo,
@RequestParam(value = "shopCode" , required = true) String shopCode,
@RequestParam(value = "signSecret" , required = true) String signSecret) {
try {
return ResponseMsgUtil.success(huiftTradeService.thirdPayResult(preOrderNo,shopCode,signSecret));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/canteenConsume",method = RequestMethod.GET) @RequestMapping(value="/canteenConsume",method = RequestMethod.GET)
@ResponseBody @ResponseBody

@ -9,23 +9,30 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter; import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.PageUtil; import com.hfkj.common.utils.PageUtil;
import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.common.utils.SignatureUtil;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsOrder; import com.hfkj.entity.BsOrder;
import com.hfkj.entity.BsOrderChild;
import com.hfkj.entity.BsOrderGoods;
import com.hfkj.entity.GoodsSpecs;
import com.hfkj.haioil.HaiOilService;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.model.UserSessionObject; import com.hfkj.model.UserSessionObject;
import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderChildModel;
import com.hfkj.model.order.OrderModel; import com.hfkj.model.order.OrderModel;
import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.goods.GoodsSpecsService;
import com.hfkj.service.order.BsOrderService; import com.hfkj.service.order.BsOrderService;
import com.hfkj.service.order.impl.BsOrderChildServiceImpl;
import com.hfkj.service.pay.HuiPayService; import com.hfkj.service.pay.HuiPayService;
import com.hfkj.sysenum.UserStatusEnum; import com.hfkj.sysenum.UserStatusEnum;
import com.hfkj.sysenum.order.OrderChildProductTypeEnum; import com.hfkj.sysenum.order.*;
import com.hfkj.sysenum.order.OrderPayChannelEnum;
import com.hfkj.sysenum.order.OrderPayTypeEnum;
import com.hfkj.sysenum.order.OrderStatusEnum;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -49,6 +56,12 @@ public class OrderController {
private UserCenter userCenter; private UserCenter userCenter;
@Resource @Resource
private BsOrderService orderService; private BsOrderService orderService;
@Resource
private BsOrderChildServiceImpl orderChildService;
@Resource
private GoodsSpecsService goodsSpecsService;
@Resource
private BsOrderGoodsService orderGoodsService;
@RequestMapping(value="/create",method = RequestMethod.POST) @RequestMapping(value="/create",method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ -265,4 +278,64 @@ public class OrderController {
} }
} }
@RequestMapping(value="/completeActivation",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "完成激活")
public ResponseData completeActivation(@RequestBody JSONObject body) {
try {
if (body == null|| StringUtils.isBlank(body.getString("childOrderNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
BsOrderChild bsOrderChild = orderChildService.getDetail(body.getString("childOrderNo"));
if (bsOrderChild.getStatus() != OrderChildStatusEnum.status2.getCode()) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态不可完成激活!");
}
// 子订单完成
orderService.childOrderComplete(bsOrderChild.getChildOrderNo());
// 赠送优惠券包
GoodsSpecs goodsSpecs = goodsSpecsService.queryDetailByGoodsId(bsOrderChild.getProductSpecId());
BsOrderGoods orderGoods = orderGoodsService.findGoodsOrderByChild(bsOrderChild.getChildOrderNo());
Map<String , Object> map = new HashMap<>();
map.put("discountPkNo" , goodsSpecs.getExt1());
map.put("number" , bsOrderChild.getProductCount());
map.put("phone" , orderGoods.getUserPhone());
HaiOilService.pushPk(map);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/haiOilLogin",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "嗨加油登陆参数")
public ResponseData haiOilLogin(@RequestBody JSONObject body) {
try {
if (body == null|| StringUtils.isBlank(body.getString("phone"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
Map<String , Object> map = new HashMap<>();
map.put("appId" , CommonSysConst.getSysConfig().getHaiOilAppid());
map.put("phone" , body.getString("phone"));
map.put("sign" , SignatureUtil.createSign(map , CommonSysConst.getSysConfig().getHaiOilAppSecret()));
return ResponseMsgUtil.success(map);
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -207,8 +207,8 @@ public class OrderPayController {
// 请求支付渠道 // 请求支付渠道
JSONObject thirdPreOrder = huiftTradeService.thirdPreOrder(order , shopCode , signSecret); JSONObject thirdPreOrder = huiftTradeService.thirdPreOrder(order , shopCode , signSecret);
for (OrderChildModel orderChild : order.getOrderChildList()) { for (OrderChildModel orderChild : order.getOrderChildList()) {
orderChild.setSettleAccount(HuiftConfig.shopcode); orderChild.setSettleAccount(shopCode);
orderChild.setSettleAccountKey(HuiftConfig.signSecret); orderChild.setSettleAccountKey(signSecret);
orderChildService.editData(orderChild); orderChildService.editData(orderChild);
} }

@ -104,7 +104,7 @@ public class OrderPayNotifyController {
log.info("开始处理订单: " + body.getString("outTradeNo")); log.info("开始处理订单: " + body.getString("outTradeNo"));
// 查询订单信息 // 查询订单信息
OrderModel order = orderService.getDetail(body.getString("outTradeNo")); OrderModel order = orderService.getDetail(body.getString("outTradeNo").split("_")[0]);
if (order != null && order.getOrderStatus().equals(OrderStatusEnum.status1.getCode())) { if (order != null && order.getOrderStatus().equals(OrderStatusEnum.status1.getCode())) {
log.info("开始处理业务"); log.info("开始处理业务");
// 处理订单业务 // 处理订单业务

@ -268,4 +268,47 @@
</logger> </logger>
<!-- 美团接口 --> <!-- 美团接口 -->
<!--娱尚接口 -->
<appender name="YuShangLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/YuShangLog.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/YuShangLog/YuShangLog.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<logger name="com.hfkj.yushang.YuShangService" level="INFO">
<appender-ref ref="YuShangLog" />
</logger>
<!-- 娱尚接口 -->
<!--嗨加油接口 -->
<appender name="HaiOilLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/HaiOilLog.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/HaiOilLog/HaiOilLog.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<logger name="com.hfkj.haioil.HaiOilService" level="INFO">
<appender-ref ref="HaiOilLog" />
</logger>
<!-- 嗨加油接口 -->
</configuration> </configuration>

@ -267,7 +267,7 @@
</logger> </logger>
<!-- 美团接口 --> <!-- 美团接口 -->
<!--美团接口 --> <!--娱尚接口 -->
<appender name="YuShangLog" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="YuShangLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/YuShangLog.log</File> <File>log/YuShangLog.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
@ -276,7 +276,7 @@
<!-- or whenever the file size reaches 64 MB --> <!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize> <maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy> </timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>7 </rollingPolicy>
<encoder> <encoder>
<pattern> <pattern>
%d %p (%file:%line\)- %m%n %d %p (%file:%line\)- %m%n
@ -287,6 +287,28 @@
<logger name="com.hfkj.yushang.YuShangService" level="INFO"> <logger name="com.hfkj.yushang.YuShangService" level="INFO">
<appender-ref ref="YuShangLog" /> <appender-ref ref="YuShangLog" />
</logger> </logger>
<!-- 美团接口 --> <!-- 娱尚接口 -->
<!--嗨加油接口 -->
<appender name="HaiOilLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/HaiOilLog.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/HaiOilLog/HaiOilLog.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<logger name="com.hfkj.haioil.HaiOilService" level="INFO">
<appender-ref ref="HaiOilLog" />
</logger>
<!-- 嗨加油接口 -->
</configuration> </configuration>

@ -0,0 +1,78 @@
package com.hfkj.common.utils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
import java.security.MessageDigest;
import java.util.Arrays;
import java.util.Map;
import java.util.Set;
public class SignatureUtil {
/**
* 参数签名
* @param param 参数
* @param key 秘钥
* @return
* @throws Exception
*/
public static String createSign(Object param, String key) throws Exception {
Map map = JSONObject.parseObject(JSONObject.toJSONString(param), Map.class);
return md5Encode(paramSort(map, key).getBytes());
}
/**
* 验证签名
* @param checkSign 需验证的签名字符串
* @param param 参数
* @param key 秘钥
* @return
* @throws Exception
*/
public static Boolean checkSign(String checkSign,Object param, String key) throws Exception {
Map map = JSONObject.parseObject(JSONObject.toJSONString(param), Map.class);
// 去除签名
map.remove("sign");
if (checkSign.equals(createSign(map, key))) {
return true;
}
return false;
}
/**
* 参数排序
* @param param
* @return
*/
public static String paramSort(final Map<String, Object> param, String key) {
Set<String> keySet = param.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (StringUtils.isBlank(sb.toString())) {
sb.append(k).append("=").append(param.get(k));
} else {
sb.append("&").append(k).append("=").append(param.get(k));
}
}
sb.append("&key=").append(key);
return sb.toString();
}
/**
* MD5加密
* @param data
* @return
* @throws Exception
*/
public static String md5Encode(byte[] data) throws Exception {
// 初始化MessageDigest
MessageDigest md = MessageDigest.getInstance("MD5");
// 执行摘要信息
byte[] digest = md.digest(data);
// 将摘要信息转换为32位的十六进制字符串
return new String(new HexBinaryAdapter().marshal(digest));
}
}

@ -145,4 +145,12 @@ public class CommonSysConfig {
private String yuShangAppKey; private String yuShangAppKey;
private String yuShangAppSecret; private String yuShangAppSecret;
private String yuShangPostUrl; private String yuShangPostUrl;
/**
* 嗨加油请求参数
*/
private String haiOilPostUrl;
private String haiOilAppid;
private String haiOilAppSecret;
} }

@ -0,0 +1,67 @@
package com.hfkj.haioil;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.SignatureUtil;
import com.hfkj.config.CommonSysConst;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.Map;
import java.util.Objects;
public class HaiOilService {
private static Logger log = LoggerFactory.getLogger(HaiOilService.class);
/**
* @MethodName pushPk
* @Description: 推送优惠券包
* @param map
* @return: com.alibaba.fastjson.JSONObject
* @Author: Sum1Dream
* @Date: 2024/9/9 下午2:57
*/
public static JSONObject pushPk(Map<String , Object> map) throws Exception {
JSONObject object = request("/openapi/discount/pushPk" , map);
if (Objects.equals(object.getString("return_code"), "000000")) {
return object;
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求失败!");
}
}
/**
* 请求
* @param postUrl 接口请求地址
* @param param 参数
* @return
* @throws Exception
*/
public static JSONObject request(String postUrl, Map<String,Object> param) throws Exception {
log.info("============ 嗨加油请求-START =============");
param.put("appId", CommonSysConst.getSysConfig().getHaiOilAppid());
param.put("reqId", new Date().getTime());
param.put("sign", SignatureUtil.createSign(param , CommonSysConst.getSysConfig().getHaiOilAppSecret()));
log.info("请求接口:" + postUrl);
log.info("请求参数:" + JSONObject.toJSONString(param));
JSONObject response = HttpsUtils.doPost(CommonSysConst.getSysConfig().getHaiOilPostUrl()+ postUrl, JSONObject.toJSONString(param));
log.info("响应参数:" + response.toJSONString());
log.info("============ 嗨加油请求-END ==============");
return response;
}
}

@ -113,7 +113,7 @@ public class OrderGoodsExportModel {
public Date updateTime; public Date updateTime;
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("签收时间") @ExcelProperty("确认收货时间")
public Date finishTime; public Date finishTime;

@ -0,0 +1,52 @@
package com.hfkj.service;
import com.hfkj.entity.SecConfig;
/**
* @ClassName SecConfigService.java
* @author Sum1Dream
* @version 1.0.0
* @Description //TODO
* @createTime 17:29 2021/6/23
**/
public interface SecConfigService {
/**
* @Author Sum1Dream
* @Name create
* @Description // 创建
* @Date 15:11 2024/4/19
* @Param GoodsBrand
* @return void
*/
void create(SecConfig secConfig);
/**
* @Author Sum1Dream
* @Name update
* @Description // 修改
* @Date 15:12 2024/4/19
* @Param GoodsBrand
* @return void
*/
void update(SecConfig secConfig);
/**
* @Author Sum1Dream
* @Name delete
* @Description // 修改
* @Date 15:12 2024/4/19
* @Param id
* @return void
*/
void delete(Integer id);
/**
* @Author Sum1Dream
* @Name queryDetail
* @Description // 根据ID查询产品类型详情
* @Date 15:12 2024/4/19
* @Param id
* @return com.hfkj.entity.GoodsBrand
*/
SecConfig queryDetail(Integer id);
}

@ -0,0 +1,34 @@
package com.hfkj.service.impl;
import com.hfkj.dao.SecConfigMapper;
import com.hfkj.entity.SecConfig;
import com.hfkj.service.SecConfigService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service("secConfigService")
public class SecConfigServiceImpl implements SecConfigService {
@Resource
private SecConfigMapper secConfigMapper;
@Override
public void create(SecConfig secConfig) {
secConfigMapper.insert(secConfig);
}
@Override
public void update(SecConfig secConfig) {
secConfigMapper.updateByPrimaryKeySelective(secConfig);
}
@Override
public void delete(Integer id) {
secConfigMapper.deleteByPrimaryKey(id);
}
@Override
public SecConfig queryDetail(Integer id) {
return secConfigMapper.selectByPrimaryKey(id);
}
}

@ -119,11 +119,12 @@ public class OrderPaySuccessService {
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("productCode" , vpd.getKey()); map.put("productCode" , vpd.getKey());
map.put("AppKey" , CommonSysConst.getSysConfig().getYuShangAppKey());
map.put("BuyCount" , childOrder.getProductCount()); map.put("BuyCount" , childOrder.getProductCount());
map.put("MOrderID" , childOrder.getChildOrderNo()); map.put("MOrderID" , childOrder.getChildOrderNo());
map.put("ChargeAccount" , childOrder.getChildOrderNo()); map.put("ChargeAccount" , childOrder.getChildOrderNo());
// 推送给汇联通 todo dingdan shangsong // 推送给娱尚
// JSONObject returnParam = YuShangService.insertV2(couponNo.getChannelOrderNo()); YuShangService.insertV2(map);
} else if (vpd.getSource() == GoodsVpdSourceEnum.type4.getCode()) { } else if (vpd.getSource() == GoodsVpdSourceEnum.type4.getCode()) {
// 推送给汇联通 // 推送给汇联通

@ -8,10 +8,7 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.RandomUtils; import com.hfkj.common.utils.RandomUtils;
import com.hfkj.dao.BsOrderRefundMapper; import com.hfkj.dao.BsOrderRefundMapper;
import com.hfkj.entity.BsMerPayConfig; import com.hfkj.entity.*;
import com.hfkj.entity.BsOrder;
import com.hfkj.entity.BsOrderRefund;
import com.hfkj.entity.BsOrderRefundExample;
import com.hfkj.mer.BsMerPayConfigService; import com.hfkj.mer.BsMerPayConfigService;
import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderChildModel;
import com.hfkj.model.order.OrderModel; import com.hfkj.model.order.OrderModel;
@ -39,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @className: BsOrderRefundServiceImpl * @className: BsOrderRefundServiceImpl
@ -229,8 +227,17 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService {
// 退款业务处理 // 退款业务处理
orderRefundSuccessService.orderRefundHandle(orderChild); orderRefundSuccessService.orderRefundHandle(orderChild);
orderChildService.editData(orderChild); orderChildService.editData(orderChild);
// 查询子订单已全部退款
Map<String,Object> map = new HashMap<>();
map.put("orderNo", orderChild.getOrderNo());
List<BsOrderChild> orderChildList = orderChildService.getList(map);
if (orderChildList.size() == orderChildList.stream().filter(o->o.getStatus().equals(OrderChildStatusEnum.status4.getCode())).collect(Collectors.toList()).size()) {
order.setOrderStatus(OrderStatusEnum.status4.getCode());
order.setRefundTime(new Date());
orderService.editData(order);
}
} }
// 删除缓存 // 删除缓存

@ -5,6 +5,7 @@ import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.HttpsUtils; import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.RandomUtils;
import com.hfkj.config.CommonSysConst; import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsOrder; import com.hfkj.entity.BsOrder;
import com.hfkj.entity.BsOrderChild; import com.hfkj.entity.BsOrderChild;
@ -40,12 +41,12 @@ public class TradeService {
public JSONObject thirdPreOrder(OrderModel order , String shopCode , String signSecret) throws Exception { public JSONObject thirdPreOrder(OrderModel order , String shopCode , String signSecret) throws Exception {
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
param.put("shopCode", shopCode); param.put("shopCode", shopCode);
param.put("outTradeNo", order.getOrderNo()); param.put("outTradeNo", order.getOrderNo()+"_"+RandomUtils.number(3,true));
param.put("transAmt", order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()); param.put("transAmt", order.getPayRealPrice().multiply(new BigDecimal("100")).intValue());
param.put("callbackUrl", CommonSysConst.getSysConfig().getDomainName() + "/order/notify/huiftPay"); param.put("callbackUrl", CommonSysConst.getSysConfig().getDomainName() + "/order/notify/huiftPay");
// param.put("remark", ""); // 备注 // param.put("remark", ""); // 备注
// param.put("outAppId", ""); // param.put("outAppId", "");
param.put("outRedirectPath", CommonSysConst.getSysConfig().getDomainName()+"/cweb/#/order/order/orderList"); param.put("outRedirectPath", CommonSysConst.getSysConfig().getDomainName()+"/outside/#/order/order/orderList");
param.put("sign", HuiftConfig.md5Encode(HuiftConfig.paramSort(param, signSecret).getBytes()).toLowerCase()); param.put("sign", HuiftConfig.md5Encode(HuiftConfig.paramSort(param, signSecret).getBytes()).toLowerCase());
JSONObject response = HttpsUtils.doPost(HuiftConfig.reqUrl + "/hfq/v1/thirdPay/thirdPreOrder", JSONObject.toJSONString(param)); JSONObject response = HttpsUtils.doPost(HuiftConfig.reqUrl + "/hfq/v1/thirdPay/thirdPreOrder", JSONObject.toJSONString(param));
if (response.getString("status").equals("ok")) { if (response.getString("status").equals("ok")) {

@ -71,7 +71,7 @@ public class YuShangService {
param.put("AppKey", CommonSysConst.getSysConfig().getYuShangAppKey()); param.put("AppKey", CommonSysConst.getSysConfig().getYuShangAppKey());
param.put("timestamp", new Date().getTime()); param.put("timestamp", new Date().getTime());
param.put("CustomerIP", "127.0.0.1"); param.put("CustomerIP", "127.0.0.1");
param.put("sign", MD5Util.encode(GenerateSign.paramSortYuShang(param,CommonSysConst.getSysConfig().getQianZhuSecret()).getBytes()).toLowerCase()); param.put("sign", MD5Util.encode(GenerateSign.paramSortYuShang(param,CommonSysConst.getSysConfig().getYuShangAppSecret()).getBytes()).toLowerCase());
log.info("请求接口:" + postUrl); log.info("请求接口:" + postUrl);
log.info("请求参数:" + JSONObject.toJSONString(param)); log.info("请求参数:" + JSONObject.toJSONString(param));

@ -80,3 +80,7 @@ mtPostUrl=https://waimai-openapi.apigw.test.meituan.com/api/sqt/open/login/h5/lo
yuShangAppKey=211394653 yuShangAppKey=211394653
yuShangAppSecret=cyQpQKMaGUG186iEZRt1uQ== yuShangAppSecret=cyQpQKMaGUG186iEZRt1uQ==
yuShangPostUrl=http://mbsmemberwebapi.test.onfishes.com/ yuShangPostUrl=http://mbsmemberwebapi.test.onfishes.com/
haiOilPostUrl = https://test-oil.dctpay.com
haiOilAppid = hf7356c71fb97ab0
haiOilAppSecret = 8aef995ff71485dc19b36e35f04c4016

Loading…
Cancel
Save