From 5955bec57a77bfad572aab9889d7c3e61d159025 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Mon, 13 Feb 2023 18:13:11 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=8F=90=E4=BA=A42=E3=80=820=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/bweb/controller/HighTestController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java index 913cd70e..c18021e9 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java @@ -1 +1 @@ - package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alipay.api.domain.ForbbidenTime; import com.alipay.api.domain.OfferObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.order.service.OrderRefundService; import com.hai.order.service.OrderService; import com.hai.order.type.OrderRefundOpUserType; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private OrderService orderService; @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @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, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.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 = "/insertV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { Map map = new HashMap<>(); map.put("timetable" , new Date().getTime()); map.put("apiKey" , "9A838BEBC60712775E119366DB804C43"); map.put("orderNo" , "20220329182036435619"); map.put("count" , "1"); map.put("couTypeCode" , "test"); map.put("phone" , "15206071196"); map.put("merchId" , "20220670800"); map.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsgcs.dctpay.com/v1/gzSinopec/couJointDist" , map)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/phoneBillOrderError", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费订单错误") public ResponseData phoneBillOrderError() { List highOrders = orderService.phoneErrorOrder(); JSONObject object; for (HighOrder order: highOrders) { try { object = new JSONObject(); OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(order.getOrderNo()); if (outRechargeOrder.getPayStatus() == 102 && outRechargeOrder.getRechargeStatus() != 202) { if (outRechargeOrder.getOutRechargeChildOrders().size() == 0) { OutRechargeChildOrder outRechargeChildOrder = new OutRechargeChildOrder(); outRechargeChildOrder.setOrderNo("CZ" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); outRechargeChildOrder.setParentOrderId(outRechargeOrder.getId()); outRechargeChildOrder.setUpdateTime(new Date()); outRechargeChildOrder.setCreateTime(new Date()); outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else { if (outRechargeOrder.getOutRechargeChildOrders().get(0).getStatus() != 101) { // 龙阅 if (outRechargeOrder.getOutRechargeChildOrders().get(0).getRechargePlatform() == 2) { object.put("out_trade_nums" , outRechargeOrder.getOutRechargeChildOrders().get(0).getOrderNo()); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else { // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 if (objectData.getInteger("state") == 2) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else if (objectData.getInteger("state") == 1) { outRechargeOrderService.completeOrder(outRechargeOrder , outRechargeOrder.getOutRechargeChildOrders().get(0)); } } } } } } } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } return ResponseMsgUtil.success("null"); } @RequestMapping(value = "/checkOrderByLy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "龙阅话费查询") public ResponseData checkOrderByLy(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); object.put("out_trade_nums" , orderNo); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { return ResponseMsgUtil.success("话费退款"); } else { if (objectData.getInteger("state") == 2) { return ResponseMsgUtil.success("话费退款"); } else if (objectData.getInteger("state") == 1) { return ResponseMsgUtil.success("话费完成"); } } return ResponseMsgUtil.success(objectJSONArray); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file + package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alipay.api.domain.ForbbidenTime; import com.alipay.api.domain.OfferObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.order.service.OrderRefundService; import com.hai.order.service.OrderService; import com.hai.order.type.OrderRefundOpUserType; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private OrderService orderService; @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @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, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.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 = "/insertV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { Map map = new HashMap<>(); map.put("timetable" , new Date().getTime()); map.put("apiKey" , "9A838BEBC60712775E119366DB804C43"); map.put("orderNo" , "20220329182036435619"); map.put("count" , "1"); map.put("couTypeCode" , "test"); map.put("phone" , "15206071196"); map.put("merchId" , "20220670800"); map.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsgcs.dctpay.com/v1/gzSinopec/couJointDist" , map)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/phoneBillOrderError", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费订单错误") public ResponseData phoneBillOrderError() { List highOrders = orderService.phoneErrorOrder(); JSONObject object; for (HighOrder order: highOrders) { try { object = new JSONObject(); OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(order.getOrderNo()); if (outRechargeOrder.getPayStatus() == 102 && outRechargeOrder.getRechargeStatus() != 202) { if (outRechargeOrder.getOutRechargeChildOrders().size() == 0) { OutRechargeChildOrder outRechargeChildOrder = new OutRechargeChildOrder(); outRechargeChildOrder.setOrderNo("CZ" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); outRechargeChildOrder.setParentOrderId(outRechargeOrder.getId()); outRechargeChildOrder.setUpdateTime(new Date()); outRechargeChildOrder.setCreateTime(new Date()); outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else { if (outRechargeOrder.getOutRechargeChildOrders().get(0).getStatus() != 101) { // 龙阅 if (outRechargeOrder.getOutRechargeChildOrders().get(0).getRechargePlatform() == 2) { object.put("out_trade_nums" , outRechargeOrder.getOutRechargeChildOrders().get(0).getOrderNo()); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else { // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 if (objectData.getInteger("state") == 2) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else if (objectData.getInteger("state") == 1) { outRechargeOrderService.completeOrder(outRechargeOrder , outRechargeOrder.getOutRechargeChildOrders().get(0)); } } } } } } } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); } } return ResponseMsgUtil.success("null"); } @RequestMapping(value = "/checkOrderByLy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "龙阅话费查询") public ResponseData checkOrderByLy(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); object.put("out_trade_nums" , orderNo); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { return ResponseMsgUtil.success("话费退款"); } else { if (objectData.getInteger("state") == 2) { return ResponseMsgUtil.success("话费退款"); } else if (objectData.getInteger("state") == 1) { return ResponseMsgUtil.success("话费完成"); } } return ResponseMsgUtil.success(objectJSONArray); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file From ea723f08f097cb99063437413b897720dc1187c0 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 14 Feb 2023 09:33:11 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../consumer/OrderRefundSuccessConsumer.java | 30 +++++++++++++++++-- .../order/service/impl/OrderServiceImpl.java | 1 - 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/hai-order/src/main/java/com/web/rocketmq/consumer/OrderRefundSuccessConsumer.java b/hai-order/src/main/java/com/web/rocketmq/consumer/OrderRefundSuccessConsumer.java index 148825c0..460c6dad 100644 --- a/hai-order/src/main/java/com/web/rocketmq/consumer/OrderRefundSuccessConsumer.java +++ b/hai-order/src/main/java/com/web/rocketmq/consumer/OrderRefundSuccessConsumer.java @@ -1,5 +1,7 @@ package com.web.rocketmq.consumer; +import com.hai.entity.HighDiscountAgentCode; +import com.hai.entity.HighDiscountUserRel; import com.hai.entity.HighOrder; import com.hai.entity.HighOrderRefund; import com.hai.order.service.OrderRefundHandleService; @@ -9,12 +11,15 @@ import com.hai.order.type.OrderChildGoodsType; import com.hai.order.type.OrderProductType; import com.hai.order.type.OrderStatus; import com.hai.service.BsMsgService; +import com.hai.service.HighDiscountAgentCodeService; +import com.hai.service.HighDiscountUserRelService; import lombok.extern.slf4j.Slf4j; import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; import org.apache.rocketmq.spring.core.RocketMQListener; import org.springframework.stereotype.Component; import javax.annotation.Resource; +import java.math.BigDecimal; @Component @Slf4j @@ -26,15 +31,36 @@ public class OrderRefundSuccessConsumer implements RocketMQListener Date: Tue, 14 Feb 2023 10:23:58 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java index 46951c49..082f6874 100644 --- a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java @@ -14,7 +14,7 @@ public interface HighMerchantAccountMapperExt { @Select({"select " + - " case when sum(gas_price_cost) is not null then sum(gas_price_cost) ELSE 0 end " + + " case when sum(gas_refuel_price) is not null then sum(gas_refuel_price) ELSE 0 end " + " from high_gas_order " + " where store_id in (SELECT id from high_merchant_store where merchant_id = #{merId}) and `status` in (2,5,6)"}) BigDecimal countMerGasOilAmount(@Param("merId") Long merId); From 94569a95f0a928a51e4e16aa233cfe757ea691aa Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 14 Feb 2023 10:24:16 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=8F=90=E4=BA=A42=E3=80=820=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighTestController.java | 2 +- hai-bweb/src/main/resources/prod/logback.xml | 43 +++++++++++++++++++ .../schedule/HighRechargeOrderSchedule.java | 9 ++-- .../config/HuiLianTongUnionCardConfig.java | 4 +- .../java/com/hai/dao/HighOrderMapperExt.java | 2 +- 5 files changed, 50 insertions(+), 10 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java index c18021e9..cd657b50 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java @@ -1 +1 @@ - package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alipay.api.domain.ForbbidenTime; import com.alipay.api.domain.OfferObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.order.service.OrderRefundService; import com.hai.order.service.OrderService; import com.hai.order.type.OrderRefundOpUserType; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private OrderService orderService; @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @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, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.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 = "/insertV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { Map map = new HashMap<>(); map.put("timetable" , new Date().getTime()); map.put("apiKey" , "9A838BEBC60712775E119366DB804C43"); map.put("orderNo" , "20220329182036435619"); map.put("count" , "1"); map.put("couTypeCode" , "test"); map.put("phone" , "15206071196"); map.put("merchId" , "20220670800"); map.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsgcs.dctpay.com/v1/gzSinopec/couJointDist" , map)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/phoneBillOrderError", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费订单错误") public ResponseData phoneBillOrderError() { List highOrders = orderService.phoneErrorOrder(); JSONObject object; for (HighOrder order: highOrders) { try { object = new JSONObject(); OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(order.getOrderNo()); if (outRechargeOrder.getPayStatus() == 102 && outRechargeOrder.getRechargeStatus() != 202) { if (outRechargeOrder.getOutRechargeChildOrders().size() == 0) { OutRechargeChildOrder outRechargeChildOrder = new OutRechargeChildOrder(); outRechargeChildOrder.setOrderNo("CZ" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); outRechargeChildOrder.setParentOrderId(outRechargeOrder.getId()); outRechargeChildOrder.setUpdateTime(new Date()); outRechargeChildOrder.setCreateTime(new Date()); outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else { if (outRechargeOrder.getOutRechargeChildOrders().get(0).getStatus() != 101) { // 龙阅 if (outRechargeOrder.getOutRechargeChildOrders().get(0).getRechargePlatform() == 2) { object.put("out_trade_nums" , outRechargeOrder.getOutRechargeChildOrders().get(0).getOrderNo()); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else { // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 if (objectData.getInteger("state") == 2) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else if (objectData.getInteger("state") == 1) { outRechargeOrderService.completeOrder(outRechargeOrder , outRechargeOrder.getOutRechargeChildOrders().get(0)); } } } } } } } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); } } return ResponseMsgUtil.success("null"); } @RequestMapping(value = "/checkOrderByLy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "龙阅话费查询") public ResponseData checkOrderByLy(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); object.put("out_trade_nums" , orderNo); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { return ResponseMsgUtil.success("话费退款"); } else { if (objectData.getInteger("state") == 2) { return ResponseMsgUtil.success("话费退款"); } else if (objectData.getInteger("state") == 1) { return ResponseMsgUtil.success("话费完成"); } } return ResponseMsgUtil.success(objectJSONArray); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file + package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alipay.api.domain.ForbbidenTime; import com.alipay.api.domain.OfferObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.order.service.OrderRefundService; import com.hai.order.service.OrderService; import com.hai.order.type.OrderRefundOpUserType; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private OrderService orderService; @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @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, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.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 = "/insertV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { Map map = new HashMap<>(); map.put("timetable" , new Date().getTime()); map.put("apiKey" , "9A838BEBC60712775E119366DB804C43"); map.put("orderNo" , "20220329182036435619"); map.put("count" , "1"); map.put("couTypeCode" , "test"); map.put("phone" , "15206071196"); map.put("merchId" , "20220670800"); map.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsgcs.dctpay.com/v1/gzSinopec/couJointDist" , map)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/phoneBillOrderError", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费订单错误") public ResponseData phoneBillOrderError() { List highOrders = orderService.phoneErrorOrder(); JSONObject object; for (HighOrder order: highOrders) { object = new JSONObject(); OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(order.getOrderNo()); try { if (outRechargeOrder.getPayStatus() == 102 && outRechargeOrder.getRechargeStatus() != 202) { if (outRechargeOrder.getOutRechargeChildOrders().size() == 0) { OutRechargeChildOrder outRechargeChildOrder = new OutRechargeChildOrder(); outRechargeChildOrder.setOrderNo("CZ" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); outRechargeChildOrder.setParentOrderId(outRechargeOrder.getId()); outRechargeChildOrder.setUpdateTime(new Date()); outRechargeChildOrder.setCreateTime(new Date()); outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else { if (outRechargeOrder.getOutRechargeChildOrders().get(0).getStatus() != 101) { // 龙阅 if (outRechargeOrder.getOutRechargeChildOrders().get(0).getRechargePlatform() == 2) { object.put("out_trade_nums" , outRechargeOrder.getOutRechargeChildOrders().get(0).getOrderNo()); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else { // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 if (objectData.getInteger("state") == 2 || objectData.getInteger("state") == -1) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else if (objectData.getInteger("state") == 1) { outRechargeOrderService.completeOrder(outRechargeOrder , outRechargeOrder.getOutRechargeChildOrders().get(0)); } } } } } } } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); } } return ResponseMsgUtil.success("null"); } @RequestMapping(value = "/checkOrderByLy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "龙阅话费查询") public ResponseData checkOrderByLy(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(orderNo); OutRechargeChildOrder outRechargeChildOrder = outRechargeOrder.getOutRechargeChildOrders().get(0); object.put("out_trade_nums" , outRechargeChildOrder); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else { if (objectData.getInteger("state") == 2 || objectData.getInteger("state") == -1) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else if (objectData.getInteger("state") == 1) { outRechargeOrderService.completeOrder(outRechargeOrder , outRechargeChildOrder); } } return ResponseMsgUtil.success(objectJSONArray); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-bweb/src/main/resources/prod/logback.xml b/hai-bweb/src/main/resources/prod/logback.xml index 5762f5eb..4526f38b 100644 --- a/hai-bweb/src/main/resources/prod/logback.xml +++ b/hai-bweb/src/main/resources/prod/logback.xml @@ -74,6 +74,40 @@ UTF-8 + + log/RechargeLog.log + + log/RechargeLog/RechargeLog.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/HltCardLog.log + + log/hlt/hltcard.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + @@ -91,4 +125,13 @@ + + + + + + + + + diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighRechargeOrderSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighRechargeOrderSchedule.java index f7f2ee6b..106e29c1 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighRechargeOrderSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighRechargeOrderSchedule.java @@ -69,7 +69,6 @@ public class HighRechargeOrderSchedule { List childOrderList = rechargeChildOrderService.getListRechargeChildOrder(childOrderMap); - System.out.println("话费定时任务 -> 判断是否存在已支付订单:订单id:" + order.getId()); if (childOrderList.size() == 0) { Date rechargeTime = order.getCreateTimed(); Date currentTime = new Date(); @@ -77,11 +76,9 @@ public class HighRechargeOrderSchedule { // 充值时间小于72 if (hours < 72) { - System.out.println("话费定时任务 -> 请求慢充:订单id:" + order.getId()); outRechargeOrderService.pollRequest(order); continue; } - System.out.println("话费定时任务 -> 退款任务" + order.getId()); outRechargeOrderService.refundOrder(order.getId() , childOrderList.get(0)); } @@ -139,7 +136,7 @@ public class HighRechargeOrderSchedule { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , childOrder); } else { // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 - if (objectData.getInteger("state") == 2) { + if (objectData.getInteger("state") == 2 || objectData.getInteger("state") == -1) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , childOrder); } else if (objectData.getInteger("state") == 1) { outRechargeOrderService.completeOrder(outRechargeOrder , childOrder); @@ -159,8 +156,8 @@ public class HighRechargeOrderSchedule { JSONObject objectData; for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; - // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 - if (objectData.getInteger("status") == 2) { + // 充值中1成功2失败3已取消4部分充值5缓存订单 + if (objectData.getInteger("status") == 2 || objectData.getInteger("status") == 3) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , childOrder); } else if (objectData.getInteger("status") == 1) { outRechargeOrderService.completeOrder(outRechargeOrder , childOrder); diff --git a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java index 63e535b8..35c13939 100644 --- a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java +++ b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java @@ -217,11 +217,11 @@ public class HuiLianTongUnionCardConfig { log.info("============请求任务Start============="); - log.info("汇联通充值-请求参数: " + JSON.toJSONString(dataMap)); + log.info("汇联通退款-请求参数: " + JSON.toJSONString(dataMap)); JSONObject returnObject = request("qtk/refund", dataMap); - log.info("汇联通充值-响应参数: " + returnObject.toJSONString()); + log.info("汇联通退款-响应参数: " + returnObject.toJSONString()); log.info("============请求任务End=============="); return returnObject; } diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java index e9de147c..e03119b2 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -1224,7 +1224,7 @@ public interface HighOrderMapperExt { List getApiThirdOrderByList(@Param("map") Map map); - @Select("SELECT * FROM high_order WHERE create_time < NOW()-INTERVAL 3 day and product_type = 9 and order_status = 2 and pay_type = 4;") + @Select("SELECT * FROM high_order WHERE create_time < NOW()-INTERVAL 3 day and product_type = 9 and order_status = 2 and pay_type = 4 group by create_time asc;") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR), From 4a540ae44b89a18eb98a7f62d274e4f550aa2107 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 14 Feb 2023 14:46:53 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=8F=90=E4=BA=A42=E3=80=820=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighTestController.java | 2 +- .../OrderTelChargeCallbackController.java | 31 +----------- .../MobileRechargeNotifyController.java | 48 ++----------------- .../impl/OrderCreateHandleServiceImpl.java | 2 +- .../impl/OutRechargeOrderServiceImpl.java | 17 +++++-- 5 files changed, 20 insertions(+), 80 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java index cd657b50..6e967205 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java @@ -1 +1 @@ - package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alipay.api.domain.ForbbidenTime; import com.alipay.api.domain.OfferObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.order.service.OrderRefundService; import com.hai.order.service.OrderService; import com.hai.order.type.OrderRefundOpUserType; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private OrderService orderService; @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @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, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.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 = "/insertV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { Map map = new HashMap<>(); map.put("timetable" , new Date().getTime()); map.put("apiKey" , "9A838BEBC60712775E119366DB804C43"); map.put("orderNo" , "20220329182036435619"); map.put("count" , "1"); map.put("couTypeCode" , "test"); map.put("phone" , "15206071196"); map.put("merchId" , "20220670800"); map.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsgcs.dctpay.com/v1/gzSinopec/couJointDist" , map)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/phoneBillOrderError", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费订单错误") public ResponseData phoneBillOrderError() { List highOrders = orderService.phoneErrorOrder(); JSONObject object; for (HighOrder order: highOrders) { object = new JSONObject(); OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(order.getOrderNo()); try { if (outRechargeOrder.getPayStatus() == 102 && outRechargeOrder.getRechargeStatus() != 202) { if (outRechargeOrder.getOutRechargeChildOrders().size() == 0) { OutRechargeChildOrder outRechargeChildOrder = new OutRechargeChildOrder(); outRechargeChildOrder.setOrderNo("CZ" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); outRechargeChildOrder.setParentOrderId(outRechargeOrder.getId()); outRechargeChildOrder.setUpdateTime(new Date()); outRechargeChildOrder.setCreateTime(new Date()); outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else { if (outRechargeOrder.getOutRechargeChildOrders().get(0).getStatus() != 101) { // 龙阅 if (outRechargeOrder.getOutRechargeChildOrders().get(0).getRechargePlatform() == 2) { object.put("out_trade_nums" , outRechargeOrder.getOutRechargeChildOrders().get(0).getOrderNo()); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else { // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 if (objectData.getInteger("state") == 2 || objectData.getInteger("state") == -1) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else if (objectData.getInteger("state") == 1) { outRechargeOrderService.completeOrder(outRechargeOrder , outRechargeOrder.getOutRechargeChildOrders().get(0)); } } } } } } } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); } } return ResponseMsgUtil.success("null"); } @RequestMapping(value = "/checkOrderByLy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "龙阅话费查询") public ResponseData checkOrderByLy(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(orderNo); OutRechargeChildOrder outRechargeChildOrder = outRechargeOrder.getOutRechargeChildOrders().get(0); object.put("out_trade_nums" , outRechargeChildOrder); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else { if (objectData.getInteger("state") == 2 || objectData.getInteger("state") == -1) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else if (objectData.getInteger("state") == 1) { outRechargeOrderService.completeOrder(outRechargeOrder , outRechargeChildOrder); } } return ResponseMsgUtil.success(objectJSONArray); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file + package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alipay.api.domain.ForbbidenTime; import com.alipay.api.domain.OfferObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.order.service.OrderRefundService; import com.hai.order.service.OrderService; import com.hai.order.type.OrderRefundOpUserType; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private OrderService orderService; @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @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, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.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 = "/insertV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { Map map = new HashMap<>(); map.put("timetable" , new Date().getTime()); map.put("apiKey" , "9A838BEBC60712775E119366DB804C43"); map.put("orderNo" , "20220329182036435619"); map.put("count" , "1"); map.put("couTypeCode" , "test"); map.put("phone" , "15206071196"); map.put("merchId" , "20220670800"); map.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsgcs.dctpay.com/v1/gzSinopec/couJointDist" , map)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/phoneBillOrderError", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费订单错误") public ResponseData phoneBillOrderError() { List highOrders = orderService.phoneErrorOrder(); JSONObject object; for (HighOrder order: highOrders) { object = new JSONObject(); OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(order.getOrderNo()); try { if (outRechargeOrder.getPayStatus() == 102 && outRechargeOrder.getRechargeStatus() != 202) { if (outRechargeOrder.getOutRechargeChildOrders().size() == 0) { OutRechargeChildOrder outRechargeChildOrder = new OutRechargeChildOrder(); outRechargeChildOrder.setOrderNo("CZ" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); outRechargeChildOrder.setParentOrderId(outRechargeOrder.getId()); outRechargeChildOrder.setUpdateTime(new Date()); outRechargeChildOrder.setCreateTime(new Date()); outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else { if (outRechargeOrder.getOutRechargeChildOrders().get(0).getStatus() != 101) { // 龙阅 if (outRechargeOrder.getOutRechargeChildOrders().get(0).getRechargePlatform() == 2) { object.put("out_trade_nums" , outRechargeOrder.getOutRechargeChildOrders().get(0).getOrderNo()); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else { // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 if (objectData.getInteger("state") == 2 || objectData.getInteger("state") == -1) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeOrder.getOutRechargeChildOrders().get(0)); } else if (objectData.getInteger("state") == 1) { outRechargeOrderService.completeOrder(outRechargeOrder , outRechargeOrder.getOutRechargeChildOrders().get(0)); } } } } } } } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); } } return ResponseMsgUtil.success("null"); } @RequestMapping(value = "/checkOrderByLy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "龙阅话费查询") public ResponseData checkOrderByLy(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(orderNo); OutRechargeChildOrder outRechargeChildOrder = outRechargeOrder.getOutRechargeChildOrders().get(0); object.put("out_trade_nums" , outRechargeChildOrder.getOrderNo()); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else { if (objectData.getInteger("state") == 2 || objectData.getInteger("state") == -1) { outRechargeOrderService.refundOrder(outRechargeOrder.getId() , outRechargeChildOrder); } else if (objectData.getInteger("state") == 1) { outRechargeOrderService.completeOrder(outRechargeOrder , outRechargeChildOrder); } } return ResponseMsgUtil.success(objectJSONArray); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/checkOrderByLyDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "龙阅话费查询") public ResponseData checkOrderByLyDetail(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(orderNo); OutRechargeChildOrder outRechargeChildOrder = outRechargeOrder.getOutRechargeChildOrders().get(0); object.put("out_trade_nums" , outRechargeChildOrder.getOrderNo()); JSONObject jsonObject = RechargeConfig.checkOrderByLy(object); JSONArray objectJSONArray = jsonObject.getJSONArray("data"); JSONObject objectData = new JSONObject(); for (Object objects : objectJSONArray) { objectData = (JSONObject) objects; } if (objectData.size() == 0) { return ResponseMsgUtil.success("无订单退款"); } else { if (objectData.getInteger("state") == 2 || objectData.getInteger("state") == -1) { return ResponseMsgUtil.success("退款"); } else if (objectData.getInteger("state") == 1) { return ResponseMsgUtil.success("完成订单"); } } return ResponseMsgUtil.success(objectJSONArray); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-order/src/main/java/com/web/controller/business/OrderTelChargeCallbackController.java b/hai-order/src/main/java/com/web/controller/business/OrderTelChargeCallbackController.java index 3166711b..78c3659a 100644 --- a/hai-order/src/main/java/com/web/controller/business/OrderTelChargeCallbackController.java +++ b/hai-order/src/main/java/com/web/controller/business/OrderTelChargeCallbackController.java @@ -93,13 +93,7 @@ public class OrderTelChargeCallbackController { }).start(); } - childOrder.setStatus(101); - rechargeOrder.setRechargeStatus(202); - rechargeOrder.setPayStatus(100); - - outRechargeOrderService.updateOrder(rechargeOrder); - outRechargeChildOrderService.updateOrder(childOrder); - orderFinish(rechargeOrder); + outRechargeOrderService.completeOrder(rechargeOrder , childOrder); // api商户订单 if (rechargeOrder.getPayType() == 6) { @@ -156,14 +150,7 @@ public class OrderTelChargeCallbackController { highUser.getOpenId()); }).start(); } - childOrder.setStatus(101); - rechargeOrder.setRechargeStatus(202); - rechargeOrder.setPayStatus(100); - rechargeOrder.setFinishTime(new Date()); - - outRechargeOrderService.updateOrder(rechargeOrder); - outRechargeChildOrderService.updateOrder(childOrder); - orderFinish(rechargeOrder); + outRechargeOrderService.completeOrder(rechargeOrder , childOrder); // todo 代理商话费回调 // if (rechargeOrder.getPayType() == 6) { // apiOrderRecord(rechargeOrder); @@ -221,20 +208,6 @@ public class OrderTelChargeCallbackController { } - // 订单完成操作 - private void orderFinish(OutRechargeOrder rechargeOrder) { - HighOrder highOrder = highOrderService.getOrderByOrderNo(rechargeOrder.getOrderNo()); - if (highOrder != null) { - highOrder.setOrderStatus(OrderStatusEnum.type3.getType()); - highOrder.setFinishTime(new Date()); - for (HighChildOrder highChildOrder : highOrder.getHighChildOrderList()) { - highChildOrder.setChildOrderStatus(OrderChildStatus.STATUS3.getNumber()); - highChildOrder.setFinishTime(new Date()); - } - orderService.updateOrderData(highOrder); - } - - } private void apiOrderRecord(OutRechargeOrder rechargeOrder) { Map orderMap = new HashMap<>(); diff --git a/hai-order/src/main/java/com/web/controller/notify/MobileRechargeNotifyController.java b/hai-order/src/main/java/com/web/controller/notify/MobileRechargeNotifyController.java index 819d0a63..b470195a 100644 --- a/hai-order/src/main/java/com/web/controller/notify/MobileRechargeNotifyController.java +++ b/hai-order/src/main/java/com/web/controller/notify/MobileRechargeNotifyController.java @@ -86,18 +86,7 @@ public class MobileRechargeNotifyController { }).start(); } - childOrder.setStatus(101); - rechargeOrder.setRechargeStatus(202); - rechargeOrder.setPayStatus(100); - - outRechargeOrderService.updateOrder(rechargeOrder); - outRechargeChildOrderService.updateOrder(childOrder); - orderFinish(rechargeOrder); - - // api商户订单 - if (rechargeOrder.getPayType() == 6) { - apiOrderRecord(rechargeOrder); - } + outRechargeOrderService.completeOrder(rechargeOrder , childOrder); } else { // 充值失败操作 @@ -149,17 +138,7 @@ public class MobileRechargeNotifyController { highUser.getOpenId()); }).start(); } - childOrder.setStatus(101); - rechargeOrder.setRechargeStatus(202); - rechargeOrder.setPayStatus(100); - rechargeOrder.setFinishTime(new Date()); - - outRechargeOrderService.updateOrder(rechargeOrder); - outRechargeChildOrderService.updateOrder(childOrder); - orderFinish(rechargeOrder); - if (rechargeOrder.getPayType() == 6) { - apiOrderRecord(rechargeOrder); - } + outRechargeOrderService.completeOrder(rechargeOrder , childOrder); } else { callbackResult(childOrder , rechargeOrder); } @@ -234,13 +213,7 @@ public class MobileRechargeNotifyController { }).start(); } - childOrder.setStatus(101); - rechargeOrder.setRechargeStatus(202); - rechargeOrder.setPayStatus(100); - - outRechargeOrderService.updateOrder(rechargeOrder); - outRechargeChildOrderService.updateOrder(childOrder); - orderFinish(rechargeOrder); + outRechargeOrderService.completeOrder(rechargeOrder , childOrder); // api商户订单 // if (rechargeOrder.getPayType() == 6) { @@ -302,21 +275,6 @@ public class MobileRechargeNotifyController { } - // 订单完成操作 - private void orderFinish(OutRechargeOrder rechargeOrder) { - HighOrder highOrder = highOrderService.getOrderByOrderNo(rechargeOrder.getOrderNo()); - if (highOrder != null) { - highOrder.setOrderStatus(OrderStatusEnum.type3.getType()); - highOrder.setFinishTime(new Date()); - for (HighChildOrder highChildOrder : highOrder.getHighChildOrderList()) { - highChildOrder.setChildOrderStatus(OrderChildStatus.STATUS3.getNumber()); - highChildOrder.setFinishTime(new Date()); - } - orderService.updateOrderData(highOrder); - } - - } - private void apiOrderRecord(OutRechargeOrder rechargeOrder) { Map orderMap = new HashMap<>(); orderMap.put("orderId" , rechargeOrder.getId()); diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java index 74595c9e..f8bec530 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java @@ -865,7 +865,7 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo()); childOrder.setGoodsType(OrderChildGoodsType.TYPE6.getNumber()); childOrder.setGoodsId(goodsId); - childOrder.setGoodsName(OperatorEnum.getNameByType(outRechargePrice.getOperatorType()) + "话费充值" + outRechargePrice.getRechargePrice() + "元"); + childOrder.setGoodsName(rechargeContent + OperatorEnum.getNameByType(outRechargePrice.getOperatorType()) + "话费充值" + outRechargePrice.getRechargePrice() + "元"); childOrder.setGoodsSpecName(outRechargePrice.getRechargePrice() + "元"); childOrder.setGoodsPrice(outRechargePrice.getRechargePrice()); childOrder.setGoodsActualPrice(outRechargePrice.getPayPrice()); diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java index 040a9c39..f1a627b0 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java @@ -17,12 +17,10 @@ import com.hai.dao.HighOrderMapper; import com.hai.dao.OutRechargeOrderMapper; import com.hai.dao.OutRechargeOrderMapperExt; import com.hai.entity.*; -import com.hai.enum_type.DiscountUseScope; -import com.hai.enum_type.OperatorEnum; -import com.hai.enum_type.OrderPushType; -import com.hai.enum_type.RechargePayType; +import com.hai.enum_type.*; import com.hai.model.*; import com.hai.order.service.OrderService; +import com.hai.order.type.OrderChildStatus; import com.hai.order.type.OrderRefundOpUserType; import com.hai.service.*; import com.hai.service.pay.impl.GoodsOrderServiceImpl; @@ -1044,6 +1042,17 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { order.setPayStatus(100); order.setFinishTime(new Date()); + HighOrder highOrder = highOrderService.getOrderByOrderNo(order.getOrderNo()); + if (highOrder != null) { + highOrder.setOrderStatus(OrderStatusEnum.type3.getType()); + highOrder.setFinishTime(new Date()); + for (HighChildOrder highChildOrder : highOrder.getHighChildOrderList()) { + highChildOrder.setChildOrderStatus(OrderChildStatus.STATUS3.getNumber()); + highChildOrder.setFinishTime(new Date()); + } + orderService.updateOrderData(highOrder); + } + outRechargeOrderService.updateOrder(order); outRechargeChildOrderService.updateOrder(childOrder); } From 7de8bc2fc0e0b4f8512b1d1635ae8faea39d07ac Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 14 Feb 2023 16:05:05 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/web/controller/business/OrderCouponController.java | 5 ++++- .../src/main/java/com/hai/dao/order/OrderMapperExt.java | 4 +++- .../src/main/java/com/hai/order/model/OrderCouponModel.java | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hai-order/src/main/java/com/web/controller/business/OrderCouponController.java b/hai-order/src/main/java/com/web/controller/business/OrderCouponController.java index 4122c717..0e4f38c3 100644 --- a/hai-order/src/main/java/com/web/controller/business/OrderCouponController.java +++ b/hai-order/src/main/java/com/web/controller/business/OrderCouponController.java @@ -75,6 +75,7 @@ public class OrderCouponController { @RequestParam(name = "payTimeE", required = false) Long payTimeE, @RequestParam(name = "finishTimeS", required = false) Long finishTimeS, @RequestParam(name = "finishTimeE", required = false) Long finishTimeE, + @RequestParam(name = "exceptionStatus", required = false) Boolean exceptionStatus, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { @@ -109,6 +110,7 @@ public class OrderCouponController { map.put("payTimeE", payTimeE); map.put("finishTimeS", finishTimeS); map.put("finishTimeE", finishTimeE); + map.put("exceptionStatus", exceptionStatus); PageHelper.startPage(pageNum,pageSize); return ResponseMsgUtil.success(new PageInfo<>(orderServiceExt.getOrderCouponList(map))); @@ -120,7 +122,6 @@ public class OrderCouponController { } - @RequestMapping(value = "/exportOrderCouponExcel", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "导出卡券订单") @@ -138,6 +139,7 @@ public class OrderCouponController { @RequestParam(name = "payTimeE", required = false) Long payTimeE, @RequestParam(name = "finishTimeS", required = false) Long finishTimeS, @RequestParam(name = "finishTimeE", required = false) Long finishTimeE, + @RequestParam(name = "exceptionStatus", required = false) Integer exceptionStatus, HttpServletRequest request) { try { @@ -169,6 +171,7 @@ public class OrderCouponController { map.put("payTimeE", payTimeE); map.put("finishTimeS", finishTimeS); map.put("finishTimeE", finishTimeE); + map.put("exceptionStatus", exceptionStatus); List list = orderServiceExt.getOrderCouponList(map); diff --git a/hai-service/src/main/java/com/hai/dao/order/OrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/order/OrderMapperExt.java index a0d47fcf..22aaf27e 100644 --- a/hai-service/src/main/java/com/hai/dao/order/OrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/order/OrderMapperExt.java @@ -60,7 +60,8 @@ public interface OrderMapperExt { " ELSE '未知' END orderStatus," + " b.create_time createTime," + " b.pay_time payTime," + - " b.finish_time finishTime" + + " b.finish_time finishTime," + + " case b.exception_status when 1 then '异常' when 0 then '正常' else '未知' end exceptionStatus" + " from high_child_order a" + " LEFT JOIN high_order b on b.id = a.order_id" + " LEFT JOIN high_coupon d on d.id = a.goods_id" + @@ -80,6 +81,7 @@ public interface OrderMapperExt { " " + " = #{param.finishTimeS} ]]> " + " " + + " and b.exception_status = #{param.exceptionStatus} " + " ORDER BY b.create_time desc" + ""}) List queryOrderCoupon(@Param("param") Map param); diff --git a/hai-service/src/main/java/com/hai/order/model/OrderCouponModel.java b/hai-service/src/main/java/com/hai/order/model/OrderCouponModel.java index ed44c4c0..6d3b2f3f 100644 --- a/hai-service/src/main/java/com/hai/order/model/OrderCouponModel.java +++ b/hai-service/src/main/java/com/hai/order/model/OrderCouponModel.java @@ -95,4 +95,8 @@ public class OrderCouponModel { @ColumnWidth(20) @ExcelProperty(value = "完成时间") private Date finishTime; + + @ColumnWidth(10) + @ExcelProperty(value = "异常状态") + private String exceptionStatus; }