袁野 2 months ago
parent c21d2ac439
commit 14865243d3
  1. BIN
      order/lib/open-platform-sdk-1.0.21.jar
  2. 7
      order/pom.xml
  3. 8
      order/src/main/java/com/order/controller/OrderController.java
  4. 1
      order/src/main/java/com/order/controller/business/BsOrderCinemaController.java
  5. 3
      order/src/main/java/com/order/controller/business/BsOrderGoodsController.java
  6. 71
      order/src/main/java/com/order/controller/notify/MeiTuanController.java
  7. 3
      schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java
  8. 2
      service/src/main/java/com/hfkj/meituan/MeiTuanService.java
  9. 3
      service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java
  10. 5
      service/src/main/resources/prod/commonConfig.properties

@ -18,6 +18,13 @@
<artifactId>service</artifactId> <artifactId>service</artifactId>
<version>PACKT-SNAPSHOT</version> <version>PACKT-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>meituan.skd</groupId>
<artifactId>meituan-open-sdk</artifactId>
<scope>system</scope>
<version>1.0.21</version>
<systemPath>${basedir}/lib/open-platform-sdk-1.0.21.jar</systemPath>
</dependency>
</dependencies> </dependencies>
<build> <build>

@ -289,8 +289,9 @@ public class OrderController {
} }
BsOrderChild bsOrderChild = orderChildService.getDetail(body.getString("childOrderNo")); BsOrderChild bsOrderChild = orderChildService.getDetail(body.getString("childOrderNo"));
BsOrderGoods orderGoods = orderGoodsService.findGoodsOrderByChild(bsOrderChild.getChildOrderNo());
if (bsOrderChild.getStatus() != OrderChildStatusEnum.status2.getCode()) { if (orderGoods.getExt3() != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态不可完成激活!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态不可完成激活!");
} }
// 子订单完成 // 子订单完成
@ -299,14 +300,15 @@ public class OrderController {
// 赠送优惠券包 // 赠送优惠券包
GoodsSpecs goodsSpecs = goodsSpecsService.queryDetailByGoodsId(bsOrderChild.getProductSpecId()); GoodsSpecs goodsSpecs = goodsSpecsService.queryDetailByGoodsId(bsOrderChild.getProductSpecId());
BsOrderGoods orderGoods = orderGoodsService.findGoodsOrderByChild(bsOrderChild.getChildOrderNo());
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
map.put("discountPkNo" , goodsSpecs.getExt1()); map.put("discountPkNo" , goodsSpecs.getExt1());
map.put("number" , bsOrderChild.getProductCount()); map.put("number" , bsOrderChild.getProductCount());
map.put("phone" , orderGoods.getUserPhone()); map.put("phone" , orderGoods.getUserPhone());
HaiOilService.pushPk(map); HaiOilService.pushPk(map);
orderGoods.setExt3("已赠送");
orderGoodsService.update(orderGoods);
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("操作成功");
} catch (Exception e) { } catch (Exception e) {

@ -39,7 +39,6 @@ public class BsOrderCinemaController {
@Resource @Resource
private BsOrderCinemaService bsOrderCinemaService; private BsOrderCinemaService bsOrderCinemaService;
@RequestMapping(value="/getListCinema",method = RequestMethod.GET) @RequestMapping(value="/getListCinema",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询列表") @ApiOperation(value = "查询列表")

@ -350,6 +350,9 @@ public class BsOrderGoodsController {
if (userAddress == null) { if (userAddress == null) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!"); throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!");
} }
if (orderGoods.getLogisticsNo() == null) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "待揽收!");
}
GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(orderGoods.getLogisticsNo() , userAddress.getPhone()); GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(orderGoods.getLogisticsNo() , userAddress.getPhone());

@ -0,0 +1,71 @@
package com.order.controller.notify;
import com.alibaba.fastjson.JSON;
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.config.CommonSysConst;
import com.hfkj.meituan.MeiTuanService;
import com.meituan.sqt.utils.EncryptUtil;
import com.meituan.sqt.utils.JsonUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.util.Objects;
@Controller
@RequestMapping(value = "/meiTuan")
@Api(value = "美团通知")
public class MeiTuanController {
private static Logger log = LoggerFactory.getLogger(MeiTuanService.class);
@RequestMapping(value = "/placeOrder", method = RequestMethod.POST)
@ApiOperation(value = "下单")
@ResponseBody
public void placeOrder(@RequestBody JSONObject reqBodyStr, HttpServletRequest request, HttpServletResponse response) {
try {
log.info("============回调任务Start=============");
String accessKey = reqBodyStr.getString("accessKey");
String content = reqBodyStr.getString("content");
log.info("美团下单-回调参数: {}", reqBodyStr);
if (accessKey == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "accessKey错误");
}
if (!Objects.equals(accessKey, CommonSysConst.getSysConfig().getMtAccessKey())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "accessKey错误");
}
if (content == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "content错误");
}
JSONObject jsonObject = JSONObject.parseObject(EncryptUtil.aesDecrypt(content, CommonSysConst.getSysConfig().getMtSecretKey()));;
log.info("美团下单-解密参数: {}", jsonObject);
log.info("============回调任务End=============");
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=utf-8");
PrintWriter writer= response.getWriter();
writer.write("SUCCESS");
} catch (Exception e) {
log.error("WechatPayController --> wechatNotify() error!", e);
}
}
}

@ -1,13 +1,10 @@
package com.hfkj.schedule; package com.hfkj.schedule;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode; 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.DateUtil; import com.hfkj.common.utils.DateUtil;
import com.hfkj.entity.*; import com.hfkj.entity.*;
import com.hfkj.qianzhu.StarbucksService;
import com.hfkj.service.goods.BsOrderGoodsService; import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.goods.BsOrderStarbucksService; import com.hfkj.service.goods.BsOrderStarbucksService;
import com.hfkj.service.goods.GoodsUserAddressService; import com.hfkj.service.goods.GoodsUserAddressService;

@ -22,10 +22,8 @@ import java.util.Map;
**/ **/
public class MeiTuanService { public class MeiTuanService {
private static Logger log = LoggerFactory.getLogger(MeiTuanService.class); private static Logger log = LoggerFactory.getLogger(MeiTuanService.class);
/** /**
* @MethodName loginFree * @MethodName loginFree
* @Description: H5免登接口 * @Description: H5免登接口

@ -262,6 +262,9 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
if (jsonObjects == null) { if (jsonObjects == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂未发货!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂未发货!");
} }
if (!jsonObjects.getBoolean("success")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObjects.getString("msg"));
}
System.out.println("======================================" + jsonObjects); System.out.println("======================================" + jsonObjects);
return editLogistics((JSONObject) jsonObjects.get("data")); return editLogistics((JSONObject) jsonObjects.get("data"));
} }

@ -69,3 +69,8 @@ HgNotifyUrl = 1
HgApiKey=3fd74e7c16b04681a0f481c5bc0a96d3 HgApiKey=3fd74e7c16b04681a0f481c5bc0a96d3
HgMemberId=1622808562621276161 HgMemberId=1622808562621276161
HgPostUrl=http://113.250.49.100:8088/recharge/ HgPostUrl=http://113.250.49.100:8088/recharge/
haiOilPostUrl = https://oil.dctpay.com
haiOilAppid = hf166f4b2ed75e71
haiOilAppSecret = 5a11778cfdd4962282a359397bf4f86b
Loading…
Cancel
Save