From c123f99bd28af3775810e7e427920e9ddada02c5 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Mon, 11 Nov 2024 17:34:10 +0800 Subject: [PATCH] /1 --- .../business/BsOrderMemberController.java | 84 +++++++++++++++++++ .../com/hfkj/schedule/OrderGoodsSchedule.java | 19 +++++ .../goods/impl/BsOrderMeiTuanServiceImpl.java | 2 +- .../goods/impl/BsOrderMemberServiceImpl.java | 40 ++++++++- .../resources/dev/commonConfig.properties | 4 + 5 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 order/src/main/java/com/order/controller/business/BsOrderMemberController.java diff --git a/order/src/main/java/com/order/controller/business/BsOrderMemberController.java b/order/src/main/java/com/order/controller/business/BsOrderMemberController.java new file mode 100644 index 0000000..8986774 --- /dev/null +++ b/order/src/main/java/com/order/controller/business/BsOrderMemberController.java @@ -0,0 +1,84 @@ +package com.order.controller.business; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +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.security.UserCenter; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsOrderMeituan; +import com.hfkj.entity.SecConfig; +import com.hfkj.model.ResponseData; +import com.hfkj.service.SecConfigService; +import com.hfkj.service.goods.BsOrderMeiTuanService; +import com.hfkj.service.goods.BsOrderMemberService; +import com.hfkj.service.goods.impl.BsOrderMeiTuanServiceImpl; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +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 javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value="/orderMember") +@Api(value="会员订单管理") +public class BsOrderMemberController { + + @Resource + private BsOrderMemberService bsOrderMemberService; + + private static final Logger log = LoggerFactory.getLogger(BsOrderGoodsController.class); + + @RequestMapping(value="/getListMember",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询列表") + public ResponseData getListMember( + @RequestParam(value = "orderNo" , required = false) String orderNo, + @RequestParam(value = "childOrderNo" , required = false) String childOrderNo, + @RequestParam(value = "userPhone" , required = false) String userPhone, + @RequestParam(value = "goodsName" , required = false) String goodsName, + @RequestParam(value = "payType" , required = false) Integer payType, + @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "createTimeS" , required = false) Long createTimeS, + @RequestParam(value = "createTimeE" , required = false) Long createTimeE, + @RequestParam(value = "finishTimeS" , required = false) Long finishTimeS, + @RequestParam(value = "finishTimeE" , required = false) Long finishTimeE, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize) { + try { + + Map map = new HashMap<>(); + + map.put("orderNo", orderNo); + map.put("childOrderNo", childOrderNo); + map.put("userPhone", userPhone); + map.put("goodsName", goodsName); + map.put("payType", payType); + map.put("createTimeS", createTimeS); + map.put("createTimeE", createTimeE); + map.put("finishTimeS", finishTimeS); + map.put("finishTimeE", finishTimeE); + map.put("status", status); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(bsOrderMemberService.getList(map))); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java b/schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java index 3af1b4f..f9caa3a 100644 --- a/schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java +++ b/schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java @@ -70,6 +70,25 @@ public class OrderGoodsSchedule { } } + @Scheduled(cron = "5 0 0 * * ?") + public void orderGoodsConfirmReceiptAgent() { + Map map = new HashMap<>(); + + map.put("logisticsStatus" , "AGENT_SIGN"); + map.put("status" , 2); + + List orderGoodsList = orderGoodsService.getList(map); + + for (BsOrderGoods goods : orderGoodsList) { + + // 判断时间是否是十天前 + + if (DateUtil.differentDays(goods.getCreateTime() , new Date()) > 10) { + orderGoodsService.confirmReceipt(goods.getId()); + } + } + } + @Scheduled(cron = "5 0 0 * * ?") public void getLogisticsMsg() { Map objectMap = new HashMap<>(); diff --git a/service/src/main/java/com/hfkj/service/goods/impl/BsOrderMeiTuanServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/BsOrderMeiTuanServiceImpl.java index e0f0ba6..74e211c 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/BsOrderMeiTuanServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/BsOrderMeiTuanServiceImpl.java @@ -103,7 +103,7 @@ public class BsOrderMeiTuanServiceImpl implements BsOrderMeiTuanService { criteria.andChildOrderNoEqualTo(MapUtils.getString(map, "childOrderNo")); } if (StringUtils.isNotBlank(MapUtils.getString(map, "tradeNo"))) { - criteria.andChildOrderNoEqualTo(MapUtils.getString(map, "tradeNo")); + criteria.andTradeNoEqualTo(MapUtils.getString(map, "tradeNo")); } if (StringUtils.isNotBlank(MapUtils.getString(map, "userPhone"))) { diff --git a/service/src/main/java/com/hfkj/service/goods/impl/BsOrderMemberServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/BsOrderMemberServiceImpl.java index 00505b4..070e914 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/BsOrderMemberServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/BsOrderMemberServiceImpl.java @@ -68,7 +68,45 @@ public class BsOrderMemberServiceImpl implements BsOrderMemberService { @Override public List getList(Map map) { - return Collections.emptyList(); + BsOrderMemberExample example = new BsOrderMemberExample(); + BsOrderMemberExample.Criteria criteria = example.createCriteria(); + + if (StringUtils.isNotBlank(MapUtils.getString(map, "orderNo"))) { + criteria.andOrderNoEqualTo(MapUtils.getString(map, "orderNo")); + } + if (StringUtils.isNotBlank(MapUtils.getString(map, "childOrderNo"))) { + criteria.andChildOrderNoEqualTo(MapUtils.getString(map, "childOrderNo")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(map, "userPhone"))) { + criteria.andUserPhoneEqualTo(MapUtils.getString(map, "userPhone")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(map, "goodsName"))) { + criteria.andGoodsNameLike("%"+MapUtils.getString(map, "goodsName")+"%"); + } + + if (MapUtils.getInteger(map, "payType") != null) { + criteria.andPayTypeEqualTo(MapUtils.getInteger(map, "payType")); + } + if (MapUtils.getLong(map, "createTimeS") != null) { + criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(map, "createTimeS"))); + } + if (MapUtils.getLong(map, "createTimeE") != null) { + criteria.andCreateTimeLessThan(new Date(MapUtils.getLong(map, "createTimeE"))); + } + if (MapUtils.getLong(map, "finishTimeS") != null) { + criteria.andFinishTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(map, "finishTimeS"))); + } + if (MapUtils.getLong(map, "finishTimeE") != null) { + criteria.andFinishTimeLessThan(new Date(MapUtils.getLong(map, "finishTimeE"))); + } + if (MapUtils.getInteger(map, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); + } + example.setOrderByClause("create_time desc"); + + return bsOrderMemberMapper.selectByExample(example); } @Override diff --git a/service/src/main/resources/dev/commonConfig.properties b/service/src/main/resources/dev/commonConfig.properties index 177e784..ca85c56 100644 --- a/service/src/main/resources/dev/commonConfig.properties +++ b/service/src/main/resources/dev/commonConfig.properties @@ -90,3 +90,7 @@ haiOilAppSecret = 8aef995ff71485dc19b36e35f04c4016 jDPostUrl = https://test-oil.dctpay.com jDAppKey = C4FF710550C43FE76D4114E1C9C6A0C9 jDAppSecret = 873bcbc1d8d64f36832270c2ff59c194 + +ytAccessKey=DVNKSHSDHHJ6-TK +ytSecretKey=lj2YDjGnqroY1OuR5zriWg== +ytPostUrl=https://waimai-openapi.apigw.test.meituan.com/api/sqt/open/login/h5/loginFree/redirection?test_open_swimlane=test-open