diff --git a/bweb/src/main/java/com/bweb/controller/TestController.java b/bweb/src/main/java/com/bweb/controller/TestController.java index 639d012..f75a5e5 100644 --- a/bweb/src/main/java/com/bweb/controller/TestController.java +++ b/bweb/src/main/java/com/bweb/controller/TestController.java @@ -1,42 +1,24 @@ package com.bweb.controller; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageInfo; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.*; -import com.hfkj.entity.*; -import com.hfkj.meituan.MeiTuanService; +import com.hfkj.config.CommonSysConst; + import com.hfkj.model.ResponseData; -import com.hfkj.model.goods.GoodsModel; -import com.hfkj.service.discount.CouponDiscountService; -import com.hfkj.service.goods.BsOrderGoodsService; -import com.hfkj.service.goods.GoodsMsgService; -import com.hfkj.service.goods.GoodsSpecsService; -import com.hfkj.service.goods.GoodsUserAddressService; -import com.hfkj.service.hlt.HltCanteenService; -import com.hfkj.service.hlt.HuiLianTongUnionCardService; -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 io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.BeanUtils; + import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; -import java.math.BigDecimal; import java.util.*; -import java.util.stream.Collectors; + @Controller @RequestMapping(value="/test") @@ -44,205 +26,24 @@ import java.util.stream.Collectors; public class TestController { private static Logger log = LoggerFactory.getLogger(TestController.class); - @Resource - private GoodsMsgService goodsMsgService; - - @Resource - private GoodsSpecsService goodsSpecsService; - - @Resource - private CouponDiscountService couponDiscountService; - - @Resource - private BsOrderChildService orderChildService; - @Resource - private BsOrderGoodsService orderGoodsService; - @Resource - private BsOrderGoodsService bsOrderGoodsService; - - @Resource - 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) - @ResponseBody - @ApiOperation(value = "食堂消费") - public ResponseData canteenConsume(@RequestParam(value = "cardNo" , required = false) String cardNo, - @RequestParam(value = "instCode" , required = false) String instCode, - @RequestParam(value = "canteenId" , required = false) String canteenId) { - try { - - String orderNo = OrderUtil.generateOrderNo(); - - JSONObject cardInfo = HltCanteenService.canteenConsume(orderNo , cardNo , instCode , canteenId); - if (StringUtils.isBlank(cardInfo.getString("data"))) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求失败"); - } - return ResponseMsgUtil.success(HuiLianTongUnionCardService.resolveResponse(cardInfo.getString("data"))); - - } catch (Exception e) { - log.error("error!",e); - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value="/bindDiscountSpecs",method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "根据类型绑定") - public ResponseData bindDiscountSpecs(@RequestParam(value = "goodsType" , required = false) Integer goodsType , - @RequestParam(value = "discountId" , required = false) Long discountId) { - try { - - Map map = new HashMap<>(); - map.put("goodsType" , goodsType); - List goodsMsg = goodsMsgService.getList(map); - List specsList = goodsSpecsService.getList(map); - - List goodsRelList = new ArrayList<>(); - for (GoodsMsg goods : goodsMsg) { - List list = specsList.stream().filter(specs -> specs.getGoodsId().equals(goods.getId())). - collect(Collectors.toList()); - for (GoodsSpecs goodsSpecs : list) { - CouponDiscountGoodsRel goodsRel = new CouponDiscountGoodsRel(); - goodsRel.setDiscountId(discountId); - goodsRel.setSpecsId(goodsSpecs.getId()); - goodsRel.setCreateTime(new Date()); - goodsRel.setStatus(1); - goodsRelList.add(goodsRel); - - } - } - couponDiscountService.insertGoodsRelBatch(goodsRelList); - return ResponseMsgUtil.success("成功"); - - } catch (Exception e) { - log.error("error!",e); - return ResponseMsgUtil.exception(e); - } - } - @RequestMapping(value="/orderGoodsUpdate",method = RequestMethod.GET) + @RequestMapping(value="/haiOilLogin",method = RequestMethod.POST) @ResponseBody - @ApiOperation(value = "商品更新") - public ResponseData orderMsgUpdate() { + @ApiOperation(value = "嗨加油登陆参数") + public ResponseData haiOilLogin(@RequestBody JSONObject body) { try { - - Map map = new HashMap<>(); - - map.put("status", 1); - - List list = goodsMsgService.getList(map); - - List specsList = goodsSpecsService.getList(new HashMap<>()); - - - for (GoodsMsg goodsMsg : list) { - List goodsSpecsList = specsList.stream().filter(s -> s.getGoodsId().equals(goodsMsg.getId())).collect(Collectors.toList()); - if (!goodsSpecsList.isEmpty()) { - goodsMsg.setSaleNum(CommonUtil.saleNumRandom(goodsSpecsList.get(0).getSalePrice())); - } - goodsMsgService.update(goodsMsg); + if (body == null|| StringUtils.isBlank(body.getString("phone"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } - return ResponseMsgUtil.success("成功"); - - } catch (Exception e) { - log.error("error!",e); - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value="/orderGoodsConfirmReceipt",method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "商品确认收货") - public ResponseData orderGoodsConfirmReceipt() { - try { - Map map = new HashMap<>(); + map.put("appid" , CommonSysConst.getSysConfig().getHaiOilAppid()); + map.put("phone" , body.getString("phone")); + map.put("sign" , SignatureUtil.createSign(map , CommonSysConst.getSysConfig().getHaiOilAppSecret())); - map.put("logisticsStatus" , "SIGN"); - map.put("status" , 2); - - List orderGoodsList = orderGoodsService.getList(map); - - for (BsOrderGoods goods : orderGoodsList) { - - // 判断时间是否是十天前 - - if (DateUtil.differentDays(goods.getCreateTime() , new Date()) > 9) { - bsOrderGoodsService.confirmReceipt(goods.getId()); - goods.setStatus(3); - goods.setUpdateTime(new Date()); - orderGoodsService.update(goods); - } - } - - return ResponseMsgUtil.success("成功"); - - } catch (Exception e) { - log.error("error!",e); - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value="/getLogisticsMsg",method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "查询物流") - public ResponseData getLogisticsMsg() { - try { - Map objectMap = new HashMap<>(); - - objectMap.put("status" , 2); - - List orderGoodsList = orderGoodsService.getList(objectMap); - - for (BsOrderGoods goods : orderGoodsList) { - - if (goods == null) { - throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!"); - } - - GoodsUserAddress userAddress = addressService.queryDetail(goods.getDeliveryAddressId()); - - if (userAddress == null) { - throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!"); - } - if (goods.getLogisticsNo() != null) { - GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(goods.getLogisticsNo() , userAddress.getPhone()); - if (logistics.getLogisticsStatus() != null) { - goods.setLogisticsStatus(logistics.getLogisticsStatus()); - goods.setLogisticsStatusDesc(logistics.getLogisticsStatusDesc()); - } else { - goods.setLogisticsStatus(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getCode()); - goods.setLogisticsStatusDesc(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getName()); - } - - goods.setUpdateTime(new Date()); - - bsOrderGoodsService.update(goods); - } - - } - - return ResponseMsgUtil.success("map"); + return ResponseMsgUtil.success(map); } catch (Exception e) { log.error("error!",e); @@ -250,89 +51,4 @@ public class TestController { } } - - @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "查询汇联通工会卡消费记录") - public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, - @RequestParam(name = "cardNo", required = true) String cardNo) { - try { - - - JSONObject consumptionRecord = HuiLianTongUnionCardService.queryConsumptionRecordByBusiness(businessType, cardNo, 1661498490000L, 1882423290000L, 1, 10000); - if (StringUtils.isBlank(consumptionRecord.getString("data"))) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, ""); - } - - JSONArray array = HuiLianTongUnionCardService.resolveResponse(consumptionRecord.getString("data")).getJSONArray( - "records"); - - return ResponseMsgUtil.success(array); - - } catch (Exception e) { - log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value = "/queryTransJournal", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "查询汇联通工会卡消费记录") - public ResponseData queryTransJournal(@RequestParam(name = "tranType", required = true) String tranType, - @RequestParam(name = "cardNo", required = true) String cardNo, - @RequestParam(value = "pageNum" , required = true) Integer pageNum, - @RequestParam(value = "pageSize" , required = true) Integer pageSize) { - try { - - - JSONObject consumptionRecord = HuiLianTongUnionCardService.queryTransJournal(cardNo , tranType); - if (StringUtils.isBlank(consumptionRecord.getString("data"))) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, ""); - } - - JSONArray array = HuiLianTongUnionCardService.resolveResponse(consumptionRecord.getString("data")).getJSONArray( - "journals"); - - List list = new ArrayList<>(); - - for (Object object : array) { - JSONObject journal = (JSONObject) object; - journal.put("tranAmount", journal.getBigDecimal("tranAmount").divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)); - list.add(journal); - } - - return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum, list.size(), pageSize, new PageInfo<>(list))); - - } catch (Exception e) { - log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value = "/loginFree", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "H5免登接口") - public ResponseData loginFree(@RequestParam(name = "staffPhone", required = true) String staffPhone, - @RequestParam(name = "productType", required = true) String productType) { - try { - - Map map = new HashMap<>(); - Map staffInfo = new HashMap<>(); - - staffInfo.put("staffPhone", staffPhone); - - map.put("staffInfo", staffInfo); - map.put("ts", new Date().getTime()); - map.put("entId", 104310L); - map.put("productType", productType); - map.put("nonce" , RandomStringGeneratorUtil.generateRandomString(36)); - return ResponseMsgUtil.success(MeiTuanService.loginFree(map)); - - } catch (Exception e) { - log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); - return ResponseMsgUtil.exception(e); - } - } - - } diff --git a/cweb/src/main/java/com/cweb/controller/goods/GoodsController.java b/cweb/src/main/java/com/cweb/controller/goods/GoodsController.java index d89c2c2..0573255 100644 --- a/cweb/src/main/java/com/cweb/controller/goods/GoodsController.java +++ b/cweb/src/main/java/com/cweb/controller/goods/GoodsController.java @@ -208,6 +208,8 @@ public class GoodsController { goodsModelSpecs.add(goodsModelSpec); } + goodsModelSpecs = goodsModelSpecs.stream().sorted(Comparator.comparing(GoodsModelSpecs::getSalePrice)).collect(Collectors.toList()); + goodsModel.setGoodsModelSpecs(goodsModelSpecs); return ResponseMsgUtil.success(goodsModel); diff --git a/order/lib/open-platform-sdk-1.0.21.jar b/order/lib/open-platform-sdk-1.0.21.jar new file mode 100644 index 0000000..0cbe24f Binary files /dev/null and b/order/lib/open-platform-sdk-1.0.21.jar differ diff --git a/order/pom.xml b/order/pom.xml index dac2cc8..b88c6de 100644 --- a/order/pom.xml +++ b/order/pom.xml @@ -18,6 +18,13 @@ service PACKT-SNAPSHOT + + meituan.skd + meituan-open-sdk + system + 1.0.21 + ${basedir}/lib/open-platform-sdk-1.0.21.jar + diff --git a/order/src/main/java/com/order/controller/OrderController.java b/order/src/main/java/com/order/controller/OrderController.java index 2a8f010..6c8c126 100644 --- a/order/src/main/java/com/order/controller/OrderController.java +++ b/order/src/main/java/com/order/controller/OrderController.java @@ -289,8 +289,9 @@ public class OrderController { } 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, "当前状态不可完成激活!"); } // 子订单完成 @@ -299,14 +300,15 @@ public class OrderController { // 赠送优惠券包 GoodsSpecs goodsSpecs = goodsSpecsService.queryDetailByGoodsId(bsOrderChild.getProductSpecId()); - BsOrderGoods orderGoods = orderGoodsService.findGoodsOrderByChild(bsOrderChild.getChildOrderNo()); - Map map = new HashMap<>(); map.put("discountPkNo" , goodsSpecs.getExt1()); map.put("number" , bsOrderChild.getProductCount()); map.put("phone" , orderGoods.getUserPhone()); HaiOilService.pushPk(map); + orderGoods.setExt3("已赠送"); + orderGoodsService.update(orderGoods); + return ResponseMsgUtil.success("操作成功"); } catch (Exception e) { @@ -326,7 +328,7 @@ public class OrderController { } Map map = new HashMap<>(); - map.put("appId" , CommonSysConst.getSysConfig().getHaiOilAppid()); + map.put("appid" , CommonSysConst.getSysConfig().getHaiOilAppid()); map.put("phone" , body.getString("phone")); map.put("sign" , SignatureUtil.createSign(map , CommonSysConst.getSysConfig().getHaiOilAppSecret())); diff --git a/order/src/main/java/com/order/controller/business/BsOrderCinemaController.java b/order/src/main/java/com/order/controller/business/BsOrderCinemaController.java index 3d6c4d5..9412f8d 100644 --- a/order/src/main/java/com/order/controller/business/BsOrderCinemaController.java +++ b/order/src/main/java/com/order/controller/business/BsOrderCinemaController.java @@ -39,7 +39,6 @@ public class BsOrderCinemaController { @Resource private BsOrderCinemaService bsOrderCinemaService; - @RequestMapping(value="/getListCinema",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询列表") diff --git a/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java b/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java index 3a56f61..6f1608c 100644 --- a/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java +++ b/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java @@ -20,6 +20,7 @@ import com.hfkj.model.order.orderExport.OrderGoodsExportModel; import com.hfkj.service.file.FileRecordsService; import com.hfkj.service.goods.BsOrderGoodsService; import com.hfkj.service.goods.GoodsUserAddressService; +import com.hfkj.service.order.BsOrderAfterSalesApplyService; import com.hfkj.service.order.BsOrderService; import com.hfkj.sysenum.SecUserObjectTypeEnum; import com.hfkj.sysenum.fileRecords.FileRecordsEnum; @@ -68,6 +69,9 @@ public class BsOrderGoodsController { @Resource private BsOrderGoodsService orderGoodsService; + @Resource + private BsOrderAfterSalesApplyService bsOrderAfterSalesApplyService; + @RequestMapping(value="/getListGoods",method = RequestMethod.GET) @ResponseBody @@ -296,10 +300,21 @@ public class BsOrderGoodsController { BsOrderGoods goodsOrder = bsOrderGoodsService.queryDetail(body.getId()); + + + + if (goodsOrder == null) { throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "信息错误!"); } + // 查询是否存在退货申请 + BsOrderAfterSalesApply afterSalesApply = bsOrderAfterSalesApplyService.getDetailByChildOrderNo(goodsOrder.getChildOrderNo()); + + if (afterSalesApply != null && afterSalesApply.getStatus().equals(OrderAfterSalesApplyStatusEnum.type1.getCode())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前订单存在退货申请,不可录入!"); + } + String logisticsNo = body.getLogisticsNo().replaceAll("\\s+", ""); goodsOrder.setLogisticsNo(logisticsNo); @@ -335,6 +350,9 @@ public class BsOrderGoodsController { if (userAddress == null) { 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()); diff --git a/order/src/main/java/com/order/controller/notify/MeiTuanController.java b/order/src/main/java/com/order/controller/notify/MeiTuanController.java new file mode 100644 index 0000000..529b311 --- /dev/null +++ b/order/src/main/java/com/order/controller/notify/MeiTuanController.java @@ -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); + } + } +} diff --git a/schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java b/schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java index 3b68208..720da5f 100644 --- a/schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java +++ b/schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java @@ -1,15 +1,15 @@ package com.hfkj.schedule; -import com.alibaba.fastjson.JSONArray; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.DateUtil; -import com.hfkj.entity.BsOrderGoods; -import com.hfkj.entity.GoodsLogistics; -import com.hfkj.entity.GoodsUserAddress; +import com.hfkj.entity.*; import com.hfkj.service.goods.BsOrderGoodsService; +import com.hfkj.service.goods.BsOrderStarbucksService; import com.hfkj.service.goods.GoodsUserAddressService; +import com.hfkj.service.order.BsOrderChildService; +import com.hfkj.service.order.BsOrderService; import com.hfkj.sysenum.order.OrderLogisticsStatusEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,6 +41,15 @@ public class OrderGoodsSchedule { @Resource private GoodsUserAddressService addressService; + @Resource + private BsOrderStarbucksService orderStarbucksService; + + @Resource + private BsOrderChildService orderChildService; + + @Resource + private BsOrderService orderService; + //每日凌晨12点5秒执行一次 @Scheduled(cron = "5 0 0 * * ?") public void orderGoodsConfirmReceipt() { @@ -98,4 +107,29 @@ public class OrderGoodsSchedule { } } + + @Scheduled(cron = "5 0 0 * * ?") + public void getStarbucks() { + Map objectMap = new HashMap<>(); + + objectMap.put("status" , 15); + + List orderStarbucks = orderStarbucksService.getList(objectMap); + + for (BsOrderStarbucks starbucks : orderStarbucks) { + + if (starbucks != null) { + // 查询星巴克订单详情 + BsOrderChild child = orderChildService.getDetail(starbucks.getChildOrderNo()); + Map orderMap = new HashMap<>(); + orderMap.put("orderNo" , child.getChannelOrderNo()); + + // 子订单完成 + orderService.childOrderComplete(starbucks.getChildOrderNo()); + + } + + + } + } } diff --git a/service/src/main/java/com/hfkj/meituan/MeiTuanService.java b/service/src/main/java/com/hfkj/meituan/MeiTuanService.java index 243750b..9b0972b 100644 --- a/service/src/main/java/com/hfkj/meituan/MeiTuanService.java +++ b/service/src/main/java/com/hfkj/meituan/MeiTuanService.java @@ -22,10 +22,8 @@ import java.util.Map; **/ public class MeiTuanService { - private static Logger log = LoggerFactory.getLogger(MeiTuanService.class); - /** * @MethodName loginFree * @Description: H5免登接口 diff --git a/service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java index c500a32..865a088 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java @@ -262,6 +262,9 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { if (jsonObjects == null) { 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); return editLogistics((JSONObject) jsonObjects.get("data")); } diff --git a/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java index 37a628a..ecae015 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java @@ -61,14 +61,11 @@ public class OrderRefundSuccessService { public void goods(BsOrderChild childOrder) { // 查询实物订单 - BsOrderGoods orderGoods = bsOrderGoodsService.findGoodsOrderByChild(childOrder.getOrderNo()); + BsOrderGoods orderGoods = bsOrderGoodsService.findGoodsOrderByChild(childOrder.getChildOrderNo()); try { if (orderGoods != null) { - Map map = new HashMap<>(); - map.put("orderNo", childOrder.getOrderNo()); - CinemaService.refundMovieOrder(map); orderGoods.setStatus(OrderChildStatusEnum.status4.getCode()); orderGoods.setLogisticsStatusDesc(null); orderGoods.setLogisticsNo(null); diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index fe1f729..3b92d76 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -15,6 +15,7 @@ import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderModel; import com.hfkj.mqtopic.OrderTopic; import com.hfkj.qianzhu.CinemaService; +import com.hfkj.qianzhu.StarbucksService; import com.hfkj.service.BsProductConfigService; import com.hfkj.service.discount.CouponDiscountService; import com.hfkj.service.discount.CouponDiscountUserRelService; @@ -522,28 +523,30 @@ public class BsOrderServiceImpl implements BsOrderService { orderModel.setBusiness(orderChild.getBusiness()); } - if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type3.getCode())) { + if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type3.getCode())) { - BsOrderCinema bsOrderCinema = bsOrderCinemaService.findGoodsOrder(orderNo); + BsOrderCinema bsOrderCinema = bsOrderCinemaService.findGoodsOrder(orderNo); - Map map = new HashMap<>(); - map.put("orderNo" , bsOrderCinema.getChannelOrderNo()); - JSONObject object = CinemaService.getByOrderNo(map); - if (object != null && object.getJSONObject("data") != null) { - orderModel.setBusiness(object.getJSONObject("data")); - bsOrderCinema.setUpdateTime(new Date()); - bsOrderCinema.setStatus(object.getJSONObject("data").getInteger("status")); - } + Map map = new HashMap<>(); + map.put("orderNo" , bsOrderCinema.getChannelOrderNo()); + JSONObject object = CinemaService.getByOrderNo(map); + if (object != null && object.getJSONObject("data") != null) { + orderModel.setBusiness(object.getJSONObject("data")); + bsOrderCinema.setUpdateTime(new Date()); + bsOrderCinema.setStatus(object.getJSONObject("data").getInteger("status")); + } + + orderModel.setBusinessOrder(bsOrderCinema); + + bsOrderCinemaService.update(bsOrderCinema); - orderModel.setBusinessOrder(bsOrderCinema); + if (bsOrderCinema.getStatus() == 10) { + // 子订单完成 + childOrderComplete(orderChild.getChildOrderNo()); + } + } - bsOrderCinemaService.update(bsOrderCinema); - if (bsOrderCinema.getStatus() == 10) { - // 子订单完成 - childOrderComplete(orderChild.getChildOrderNo()); - } - } } return orderModel; diff --git a/service/src/main/resources/prod/commonConfig.properties b/service/src/main/resources/prod/commonConfig.properties index 87a69bf..b5a0f84 100644 --- a/service/src/main/resources/prod/commonConfig.properties +++ b/service/src/main/resources/prod/commonConfig.properties @@ -69,3 +69,8 @@ HgNotifyUrl = 1 HgApiKey=3fd74e7c16b04681a0f481c5bc0a96d3 HgMemberId=1622808562621276161 HgPostUrl=http://113.250.49.100:8088/recharge/ + + +haiOilPostUrl = https://oil.dctpay.com +haiOilAppid = hf166f4b2ed75e71 +haiOilAppSecret = 5a11778cfdd4962282a359397bf4f86b \ No newline at end of file diff --git a/user/src/main/java/com/user/controller/BsUserController.java b/user/src/main/java/com/user/controller/BsUserController.java index 1fcfe56..a2a54a6 100644 --- a/user/src/main/java/com/user/controller/BsUserController.java +++ b/user/src/main/java/com/user/controller/BsUserController.java @@ -156,6 +156,50 @@ public class BsUserController { } } + @RequestMapping(value = "/phoneNotVerify", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "H5手机号不校验登陆") + public ResponseData phoneNotVerify(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("platform")) + || StringUtils.isBlank(body.getString("type")) + || StringUtils.isBlank(body.getString("phone")) + ) { + log.error("LoginController --> phone() error!", "请求参数校验失败"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + String phone = body.getString("phone"); + String password = body.getString("password"); + + // 客户端 + UserLoginPlatform platform = UserLoginPlatform.getDataByType(body.getString("platform")); + if (platform == null) { + log.error("LoginController --> phone() error!", "未知客户端"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知客户端"); + } + // 校验手机号格式 + if (!MemberValidateUtil.validatePhone(phone)) { + log.error("LoginController --> phone() error!", "请输入正确的手机号"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号"); + } + // 登录类型 + UserLoginType loginType = UserLoginType.getDataByType(body.getString("type")); + if (loginType == null) { + log.error("LoginController --> phone() error!", "未知登录类型;" + body.getString("type")); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知登录类型"); + } + + Map other = new HashMap<>(); + other.put("maOpenId", "maOpenId"); + return ResponseMsgUtil.success(userService.login(platform, loginType, phone, password, other)); + + } catch (Exception e) { + log.error("LoginController --> phone() error!", e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value = "/phoneTest", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "手机号登录")