diff --git a/hai-bweb/src/main/java/com/bweb/controller/BsIntegralRebateController.java b/hai-bweb/src/main/java/com/bweb/controller/BsIntegralRebateController.java index ba502141..065857f8 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/BsIntegralRebateController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/BsIntegralRebateController.java @@ -46,10 +46,10 @@ public class BsIntegralRebateController { @Resource private BsIntegralRebateService bsIntegralRebateService; - @RequestMapping(value = "/selectCompanyList", method = RequestMethod.GET) + @RequestMapping(value = "/getIntegralRebateByList", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "获取公司列表") - public ResponseData selectCompanyList(@RequestParam(name = "type", required = false) Integer type, + @ApiOperation(value = "获取列表") + public ResponseData getIntegralRebateByList(@RequestParam(name = "type", required = false) Integer type, @RequestParam(name = "productId", required = false) Long productId, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { @@ -74,7 +74,7 @@ public class BsIntegralRebateController { @RequestMapping(value = "/findIntegralRebateById", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据id查询详情") - public ResponseData getOrderById(@RequestParam(name = "id", required = true) Long id) { + public ResponseData findIntegralRebateById(@RequestParam(name = "id", required = true) Long id) { try { return ResponseMsgUtil.success(bsIntegralRebateService.findIntegralRebateById(id)); @@ -85,10 +85,10 @@ public class BsIntegralRebateController { } } - @RequestMapping(value = "/insertPrice", method = RequestMethod.POST) + @RequestMapping(value = "/insertIntegralRebate", method = RequestMethod.POST) @ResponseBody - @ApiOperation(value = "新增金额") - public ResponseData insertPrice(@RequestBody BsIntegralRebate integralRebate, HttpServletRequest request) { + @ApiOperation(value = "新增") + public ResponseData insertIntegralRebate(@RequestBody BsIntegralRebate integralRebate, HttpServletRequest request) { try { SessionObject sessionObject = userCenter.getSessionObject(request); @@ -105,6 +105,7 @@ public class BsIntegralRebateController { Map map = new HashMap<>(); map.put("type" , integralRebate.getType()); map.put("productId" , integralRebate.getProductId()); + map.put("companyId" , userInfoModel.getBsCompany().getId()); BsIntegralRebate bsIntegralRebate = bsIntegralRebateService.findIntegralRebateByMap(map); @@ -130,10 +131,10 @@ public class BsIntegralRebateController { } } - @RequestMapping(value = "/updatePrice", method = RequestMethod.POST) + @RequestMapping(value = "/updateIntegralRebate", method = RequestMethod.POST) @ResponseBody - @ApiOperation(value = "修改金额") - public ResponseData updatePrice(@RequestBody BsIntegralRebate integralRebate, HttpServletRequest request) { + @ApiOperation(value = "修改") + public ResponseData updateIntegralRebate(@RequestBody BsIntegralRebate integralRebate, HttpServletRequest request) { try { SessionObject sessionObject = userCenter.getSessionObject(request); @@ -173,4 +174,20 @@ public class BsIntegralRebateController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value = "/deleteIntegralRebate", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "删除") + public ResponseData deleteIntegralRebate(@RequestParam(value = "id", required = true) Long id) { + try { + + bsIntegralRebateService.deleteIntegralRebate(id); + return ResponseMsgUtil.success("删除成功"); + + } catch (Exception e) { + log.error("OutRechargePriceController --> deletePrice() error!", e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java index 60579f26..425ad4d7 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java @@ -775,8 +775,9 @@ public class HighGasController { highOrderService.updateOrderDetail(order); } } else if (order.getPayType() == 3){ + String remark = "订单" + order.getOrderNo() + "退款,退还积分:" + order.getPayGold(); // 积分退款 - highUserService.goldHandle(order.getMemId(), order.getPayGold(),1, 2, order.getId()); + highUserService.goldHandle(order.getMemId(), order.getPayGold(),1, 3, order.getId() , remark); order.setOrderStatus(4); order.setRefundTime(new Date()); order.setRefundPrice(order.getPayRealPrice()); 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 936acb6b..c4c18314 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.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.utils.DateUtil; import com.hai.common.utils.IDGenerator; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.HuiLianTongConfig; import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.config.QianZhuConfig; import com.hai.config.WxOrderConfig; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.service.*; 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.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 HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private HighOilCardService oilCardService; @Resource private ApiProductService apiProductService; @Resource private BsRechargeCodeService rechargeCodeService; @Resource private OutRechargePriceService rechargePriceService; @RequestMapping(value = "/kfcRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "KFC退款") public ResponseData kfcRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { OrderRefundModel orderRefundModel = null; if (StringUtils.isNotBlank(orderNo)) { // 查询订单 HighOrder order = highOrderService.getOrderByOrderNo(orderNo); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 if (order != null && order.getOrderStatus() == 2) { orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), "1609882817", order.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : order.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } order.setOrderStatus(4); order.setRefundTime(new Date()); order.setRefundPrice(order.getPayRealPrice()); highOrderService.updateOrder(order); return ResponseMsgUtil.success(orderRefundModel); } } } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/oilCardRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "油卡退款") public ResponseData oilCardRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { oilCardService.refund(orderNo); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @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="/consumption",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡重新发起充值") public ResponseData consumption( @RequestParam(name = "orderNo", required = false) String orderNo ) { try { OutRechargeOrder order = outRechargeOrderService.findByOrderNo(orderNo); String goodsDesc = "重新充值"; String tranDesc = order.getRechargeContent() + "重新充值" + order.getPayRealPrice() + "元"; String instCode = "11101527"; String businessType = "hisen_consume"; String orderNoPost = "AGAIN" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5); // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(orderNoPost, order.getLaborUnionCard(), order.getPayRealPrice(), businessType, instCode, goodsDesc, tranDesc); JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("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"); // // String s = "HFR1"; // String s1 = "AGAIN1"; // // List list = new ArrayList<>(); // // // for (Object data : array) { // JSONObject dataObject = (JSONObject) data; // if (!StringUtils.contains(dataObject.getString("orderNo"),s) && !StringUtils.contains(dataObject.getString("orderNo"),s1)) { // list.add(dataObject); // } // return ResponseMsgUtil.success(array); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分充值退款") public ResponseData orderToRefund(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } if (highUserService.findGoldRepeat(3 , highOrder.getId())) { highUserService.goldHandle(highOrder.getMemId(), highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 2, 3, highOrder.getId()); }else { log.error("orderToPay error!", "已有退款记录"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有退款记录"); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefundByHlt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "汇联通充值退款") public ResponseData orderToRefundByHlt(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), WxOrderConfig.MCH_ID_1619676214 , highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费退款") public ResponseData rechargeOrderToRefund( @RequestParam(name = "orderId", required = true) Long orderId) { try { outRechargeOrderService.rechargeOrderToRefund(orderId); return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getStarbucksProducts", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "更新星巴克商品") public ResponseData getStarbucksProducts(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getStarbucksProducts(1 , 200); JSONObject object = jsonObject.getJSONObject("data"); JSONArray array = object.getJSONArray("items"); for (Object data : array) { JSONObject dataObject = (JSONObject) data; ApiStarbucksProducts starbucksProducts = apiProductService.findStarbucksProductsByGoodsId(dataObject.getLong("id")); if (dataObject.getInteger("shelfStatus") == 5) { if (starbucksProducts == null) { starbucksProducts = new ApiStarbucksProducts(); } starbucksProducts.setCategoryName(dataObject.getString("categoryName")); starbucksProducts.setCream(dataObject.getString("cream")); starbucksProducts.setCupSize(dataObject.getString("cupSize")); starbucksProducts.setDefaultImage(dataObject.getString("defaultImage")); starbucksProducts.setDes(dataObject.getString("des")); starbucksProducts.setEspresso(dataObject.getString("espresso")); starbucksProducts.setMarketGrandePrice(dataObject.getBigDecimal("marketGrandePrice")); starbucksProducts.setMarketTallPrice(dataObject.getBigDecimal("marketTallPrice")); starbucksProducts.setMarketVentiPrice(dataObject.getBigDecimal("marketVentiPrice")); starbucksProducts.setSalesGrandePrice(dataObject.getBigDecimal("salesGrandePrice")); starbucksProducts.setSalesTallPrice(dataObject.getBigDecimal("salesTallPrice")); starbucksProducts.setSalesVentiPrice(dataObject.getBigDecimal("salesVentiPrice")); starbucksProducts.setMilk(dataObject.getString("milk")); starbucksProducts.setMilkBubble(dataObject.getString("milkBubble")); starbucksProducts.setName(dataObject.getString("name")); starbucksProducts.setTemperature(dataObject.getString("temperature")); if (starbucksProducts.getId() == null) { starbucksProducts.setCreateTime(new Date()); starbucksProducts.setOperatorId(9999L); starbucksProducts.setOperatorName("系统生成"); starbucksProducts.setStatus(100); starbucksProducts.setGoodsId(dataObject.getLong("id")); apiProductService.insertStarbucksProducts(starbucksProducts); } else { starbucksProducts.setUpdateTime(new Date()); apiProductService.updateStarbucksProducts(starbucksProducts); } } } return ResponseMsgUtil.success("商品生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getKfcStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基门店") public ResponseData getKfcStore(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getKfcStore(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; Map mapStore = new HashMap<>(); mapStore.put("storeCode" , dataObject.getString("storeCode")); ApiKfcStores apiKfcStores = apiProductService.findKfcStores(mapStore); if (apiKfcStores == null) { apiKfcStores = new ApiKfcStores(); } apiKfcStores.setProvinceCode(dataObject.getString("provinceCode")); apiKfcStores.setProvinceName(dataObject.getString("provinceName")); apiKfcStores.setCityCode(dataObject.getString("cityCode")); apiKfcStores.setCityName(dataObject.getString("cityName")); apiKfcStores.setCityNameFirstLetter(dataObject.getString("cityNameFirstLetter")); apiKfcStores.setKfcCityId(dataObject.getInteger("kfcCityId")); apiKfcStores.setKfcCityCode(dataObject.getString("kfcCityCode")); apiKfcStores.setStoreName(dataObject.getString("storeName")); apiKfcStores.setStoreCode(dataObject.getString("storeCode")); apiKfcStores.setLon(dataObject.getString("lon")); apiKfcStores.setLat(dataObject.getString("lat")); apiKfcStores.setAddress(dataObject.getString("address")); apiKfcStores.setStartTime(dataObject.getString("startTime")); apiKfcStores.setEndTime(dataObject.getString("endTime")); apiKfcStores.setStoreStatus(dataObject.getInteger("storeStatus")); apiKfcStores.setShelfStatus(dataObject.getInteger("shelfStatus")); if (apiKfcStores.getId() == null) { apiKfcStores.setCreateTime(new Date()); apiKfcStores.setOperatorId(9999L); apiKfcStores.setOperatorName("系统生成"); apiKfcStores.setStatus(100); apiProductService.insertKfcStore(apiKfcStores); } else { apiKfcStores.setUpdateTime(new Date()); apiProductService.updateKfcStore(apiKfcStores); } } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/insertCity", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "插入城市") public ResponseData insertCity(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getAllCities(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; ApiCity apiCity = new ApiCity(); apiCity.setCityInitial(dataObject.getString("cityInitial")); apiCity.setCityCode(dataObject.getString("cityCode")); apiCity.setCityName(dataObject.getString("cityName")); apiCity.setProvinceCode(dataObject.getString("provinceCode")); apiCity.setProvinceName(dataObject.getString("provinceName")); apiCity.setCreateTime(new Date()); apiCity.setUpdateTime(new Date()); apiCity.setOperatorId(9999L); apiCity.setOperatorName("系统生成"); apiCity.setStatus(100); apiProductService.insertCity(apiCity); } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/updatePrice", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "更新价格") public ResponseData updatePrice() { try { List list = rechargePriceService.getListRechargePrice(new HashMap<>()); for (OutRechargePrice rechargePrice : list) { BsRechargeCode rechargeCode = new BsRechargeCode(); if (rechargePrice.getGoodsId() != null) { rechargeCode.setStatus(100); rechargeCode.setUpdateTime(new Date()); rechargeCode.setCreateTime(new Date()); rechargeCode.setGoodsId(rechargePrice.getGoodsId().toString()); rechargeCode.setOperatorName("系统自动更新"); rechargeCode.setType(1); rechargeCode.setSourceId(rechargePrice.getId().toString()); rechargeCode.setRechargePlatform(2); rechargeCodeService.insertRechargeCode(rechargeCode); } } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/test", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "测试") public ResponseData test(@RequestBody JSONObject object) { try { return ResponseMsgUtil.success(HuiLianTongConfig.test(object)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() 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.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.utils.DateUtil; import com.hai.common.utils.IDGenerator; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.HuiLianTongConfig; import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.config.QianZhuConfig; import com.hai.config.WxOrderConfig; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.service.*; 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.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 HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private HighOilCardService oilCardService; @Resource private ApiProductService apiProductService; @Resource private BsRechargeCodeService rechargeCodeService; @Resource private OutRechargePriceService rechargePriceService; @RequestMapping(value = "/kfcRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "KFC退款") public ResponseData kfcRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { OrderRefundModel orderRefundModel = null; if (StringUtils.isNotBlank(orderNo)) { // 查询订单 HighOrder order = highOrderService.getOrderByOrderNo(orderNo); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 if (order != null && order.getOrderStatus() == 2) { orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), "1609882817", order.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : order.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } order.setOrderStatus(4); order.setRefundTime(new Date()); order.setRefundPrice(order.getPayRealPrice()); highOrderService.updateOrder(order); return ResponseMsgUtil.success(orderRefundModel); } } } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/oilCardRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "油卡退款") public ResponseData oilCardRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { oilCardService.refund(orderNo); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @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="/consumption",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡重新发起充值") public ResponseData consumption( @RequestParam(name = "orderNo", required = false) String orderNo ) { try { OutRechargeOrder order = outRechargeOrderService.findByOrderNo(orderNo); String goodsDesc = "重新充值"; String tranDesc = order.getRechargeContent() + "重新充值" + order.getPayRealPrice() + "元"; String instCode = "11101527"; String businessType = "hisen_consume"; String orderNoPost = "AGAIN" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5); // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(orderNoPost, order.getLaborUnionCard(), order.getPayRealPrice(), businessType, instCode, goodsDesc, tranDesc); JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("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"); // // String s = "HFR1"; // String s1 = "AGAIN1"; // // List list = new ArrayList<>(); // // // for (Object data : array) { // JSONObject dataObject = (JSONObject) data; // if (!StringUtils.contains(dataObject.getString("orderNo"),s) && !StringUtils.contains(dataObject.getString("orderNo"),s1)) { // list.add(dataObject); // } // return ResponseMsgUtil.success(array); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分充值退款") public ResponseData orderToRefund(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } if (highUserService.findGoldRepeat(3 , highOrder.getId())) { String remark = "订单" + highOrder.getOrderNo() + "退款积分:" + highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(); highUserService.goldHandle(highOrder.getMemId(), highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 2, 3, highOrder.getId() , remark); }else { log.error("orderToPay error!", "已有退款记录"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有退款记录"); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefundByHlt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "汇联通充值退款") public ResponseData orderToRefundByHlt(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), WxOrderConfig.MCH_ID_1619676214 , highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费退款") public ResponseData rechargeOrderToRefund( @RequestParam(name = "orderId", required = true) Long orderId) { try { outRechargeOrderService.rechargeOrderToRefund(orderId); return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getStarbucksProducts", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "更新星巴克商品") public ResponseData getStarbucksProducts(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getStarbucksProducts(1 , 200); JSONObject object = jsonObject.getJSONObject("data"); JSONArray array = object.getJSONArray("items"); for (Object data : array) { JSONObject dataObject = (JSONObject) data; ApiStarbucksProducts starbucksProducts = apiProductService.findStarbucksProductsByGoodsId(dataObject.getLong("id")); if (dataObject.getInteger("shelfStatus") == 5) { if (starbucksProducts == null) { starbucksProducts = new ApiStarbucksProducts(); } starbucksProducts.setCategoryName(dataObject.getString("categoryName")); starbucksProducts.setCream(dataObject.getString("cream")); starbucksProducts.setCupSize(dataObject.getString("cupSize")); starbucksProducts.setDefaultImage(dataObject.getString("defaultImage")); starbucksProducts.setDes(dataObject.getString("des")); starbucksProducts.setEspresso(dataObject.getString("espresso")); starbucksProducts.setMarketGrandePrice(dataObject.getBigDecimal("marketGrandePrice")); starbucksProducts.setMarketTallPrice(dataObject.getBigDecimal("marketTallPrice")); starbucksProducts.setMarketVentiPrice(dataObject.getBigDecimal("marketVentiPrice")); starbucksProducts.setSalesGrandePrice(dataObject.getBigDecimal("salesGrandePrice")); starbucksProducts.setSalesTallPrice(dataObject.getBigDecimal("salesTallPrice")); starbucksProducts.setSalesVentiPrice(dataObject.getBigDecimal("salesVentiPrice")); starbucksProducts.setMilk(dataObject.getString("milk")); starbucksProducts.setMilkBubble(dataObject.getString("milkBubble")); starbucksProducts.setName(dataObject.getString("name")); starbucksProducts.setTemperature(dataObject.getString("temperature")); if (starbucksProducts.getId() == null) { starbucksProducts.setCreateTime(new Date()); starbucksProducts.setOperatorId(9999L); starbucksProducts.setOperatorName("系统生成"); starbucksProducts.setStatus(100); starbucksProducts.setGoodsId(dataObject.getLong("id")); apiProductService.insertStarbucksProducts(starbucksProducts); } else { starbucksProducts.setUpdateTime(new Date()); apiProductService.updateStarbucksProducts(starbucksProducts); } } } return ResponseMsgUtil.success("商品生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getKfcStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基门店") public ResponseData getKfcStore(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getKfcStore(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; Map mapStore = new HashMap<>(); mapStore.put("storeCode" , dataObject.getString("storeCode")); ApiKfcStores apiKfcStores = apiProductService.findKfcStores(mapStore); if (apiKfcStores == null) { apiKfcStores = new ApiKfcStores(); } apiKfcStores.setProvinceCode(dataObject.getString("provinceCode")); apiKfcStores.setProvinceName(dataObject.getString("provinceName")); apiKfcStores.setCityCode(dataObject.getString("cityCode")); apiKfcStores.setCityName(dataObject.getString("cityName")); apiKfcStores.setCityNameFirstLetter(dataObject.getString("cityNameFirstLetter")); apiKfcStores.setKfcCityId(dataObject.getInteger("kfcCityId")); apiKfcStores.setKfcCityCode(dataObject.getString("kfcCityCode")); apiKfcStores.setStoreName(dataObject.getString("storeName")); apiKfcStores.setStoreCode(dataObject.getString("storeCode")); apiKfcStores.setLon(dataObject.getString("lon")); apiKfcStores.setLat(dataObject.getString("lat")); apiKfcStores.setAddress(dataObject.getString("address")); apiKfcStores.setStartTime(dataObject.getString("startTime")); apiKfcStores.setEndTime(dataObject.getString("endTime")); apiKfcStores.setStoreStatus(dataObject.getInteger("storeStatus")); apiKfcStores.setShelfStatus(dataObject.getInteger("shelfStatus")); if (apiKfcStores.getId() == null) { apiKfcStores.setCreateTime(new Date()); apiKfcStores.setOperatorId(9999L); apiKfcStores.setOperatorName("系统生成"); apiKfcStores.setStatus(100); apiProductService.insertKfcStore(apiKfcStores); } else { apiKfcStores.setUpdateTime(new Date()); apiProductService.updateKfcStore(apiKfcStores); } } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/insertCity", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "插入城市") public ResponseData insertCity(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getAllCities(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; ApiCity apiCity = new ApiCity(); apiCity.setCityInitial(dataObject.getString("cityInitial")); apiCity.setCityCode(dataObject.getString("cityCode")); apiCity.setCityName(dataObject.getString("cityName")); apiCity.setProvinceCode(dataObject.getString("provinceCode")); apiCity.setProvinceName(dataObject.getString("provinceName")); apiCity.setCreateTime(new Date()); apiCity.setUpdateTime(new Date()); apiCity.setOperatorId(9999L); apiCity.setOperatorName("系统生成"); apiCity.setStatus(100); apiProductService.insertCity(apiCity); } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/updatePrice", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "更新价格") public ResponseData updatePrice() { try { List list = rechargePriceService.getListRechargePrice(new HashMap<>()); for (OutRechargePrice rechargePrice : list) { BsRechargeCode rechargeCode = new BsRechargeCode(); if (rechargePrice.getGoodsId() != null) { rechargeCode.setStatus(100); rechargeCode.setUpdateTime(new Date()); rechargeCode.setCreateTime(new Date()); rechargeCode.setGoodsId(rechargePrice.getGoodsId().toString()); rechargeCode.setOperatorName("系统自动更新"); rechargeCode.setType(1); rechargeCode.setSourceId(rechargePrice.getId().toString()); rechargeCode.setRechargePlatform(2); rechargeCodeService.insertRechargeCode(rechargeCode); } } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/test", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "测试") public ResponseData test(@RequestBody JSONObject object) { try { return ResponseMsgUtil.success(HuiLianTongConfig.test(object)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java b/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java index b55877ee..3d259c16 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java @@ -127,7 +127,7 @@ public class OutRechargePriceController { object.getString("operatorType") == null || object.getJSONArray("rechargePlatform") == null || object.getJSONArray("productPlatform") == null || - object.getInteger("rechargeType") == null || +// object.getInteger("rechargeType") == null || object.getJSONArray("payType") == null || object.getInteger("rechargeWay") == null ) { @@ -180,7 +180,7 @@ public class OutRechargePriceController { object.getString("operatorType") == null || object.getJSONArray("rechargePlatform") == null || object.getJSONArray("productPlatform") == null || - object.getInteger("rechargeType") == null || +// object.getInteger("rechargeType") == null || object.getJSONArray("payType") == null || object.getInteger("rechargeWay") == null ) { @@ -270,7 +270,7 @@ public class OutRechargePriceController { map.put("sourceId" , outRechargePrice.getId()); List rechargeCodes = bsRechargeCodeService.getListRechargeCode(map); - if (outRechargePrice.getRechargePlatform().contains("-2-3-") && rechargeCodes.size() == 0) { + if ((outRechargePrice.getRechargePlatform().contains("-2-") || outRechargePrice.getRechargePlatform().contains("-3-") ) && rechargeCodes.size() == 0) { log.error("OutRechargePriceController -> editPriceStatus() error!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "龙阅,城宇平台需要输入商品编码!"); } diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGoldRecController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGoldRecController.java index e63858f6..c3aa5ab6 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGoldRecController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGoldRecController.java @@ -45,7 +45,7 @@ public class HighGoldRecController { @RequestMapping(value="/getUserGoldRecList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取用户金币使用情况") - public ResponseData getUserGoldRecList(@RequestParam(name = "goldType", required = true) Integer goldType, + public ResponseData getUserGoldRecList(@RequestParam(name = "goldType", required = false) Integer goldType, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { @@ -67,4 +67,21 @@ public class HighGoldRecController { } } + @RequestMapping(value="/selectByExpiringSoon",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取用户积分七天内即将过期积分") + public ResponseData selectByExpiringSoon(HttpServletRequest request) { + try { + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + return ResponseMsgUtil.success(highGoldRecService.selectByExpiringSoon(userInfoModel.getHighUser().getId() , 358)); + + } catch (Exception e) { + log.error("HighCouponController -> getCouponList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index 3b53ad96..e20d442a 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -103,6 +103,9 @@ public class HighOrderController { @Resource private HighGasClassGroupTaskService gasClassGroupTaskService; + @Resource + private BsCompanyService bsCompanyService; + @RequestMapping(value="/addOrder",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "增加订单") @@ -413,7 +416,8 @@ public class HighOrderController { if (buyPoints && highOrder.getPayGold() != null) { integralDeductionPrice = new BigDecimal(highOrder.getPayGold()).divide(new BigDecimal(100)); - highUserService.goldHandle(userInfoModel.getHighUser().getId(), highOrder.getPayGold(), 2, 2, highOrder.getId()); + String remark = "订单" + highOrder.getOrderNo() + "购买,使用积分:" + highOrder.getPayGold(); + highUserService.goldHandle(userInfoModel.getHighUser().getId(), highOrder.getPayGold(), 2, 2, highOrder.getId() , remark); BigDecimal payGold = new BigDecimal(highOrder.getPayGold()); @@ -423,6 +427,12 @@ public class HighOrderController { } } + SecRegion region = commonService.getParentByRegion(Long.valueOf(request.getHeader("regionId"))); + BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); + + if (bsCompany != null) { + highOrder.setCompanyId(bsCompany.getId()); + } highOrder.setMerchId(request.getHeader("mchId")); highOrder.setTotalPrice(totalPrice); diff --git a/hai-cweb/src/main/java/com/cweb/controller/OutRechargePriceController.java b/hai-cweb/src/main/java/com/cweb/controller/OutRechargePriceController.java index b2157a73..af8c3cfb 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/OutRechargePriceController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/OutRechargePriceController.java @@ -61,8 +61,7 @@ public class OutRechargePriceController { public ResponseData getRechargePriceByList( @RequestParam(name = "platformId", required = true) Integer platformId, @RequestParam(name = "regionId", required = true) String regionId, - @RequestParam(name = "operatorType", required = true) Integer operatorType, - @RequestParam(name = "rechargeType", required = true) Integer rechargeType + @RequestParam(name = "operatorType", required = true) Integer operatorType ) { try { @@ -75,7 +74,6 @@ public class OutRechargePriceController { } map.put("platformId", platformId); map.put("operatorType", operatorType); - map.put("rechargeType", rechargeType); return ResponseMsgUtil.success( outRechargePriceService.getRechargePriceByList(map)); diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java index 044499df..9102b614 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java @@ -3,6 +3,7 @@ package com.cweb.controller.pay; import com.alibaba.fastjson.JSONObject; import com.cweb.config.SysConst; import com.cweb.config.WxMsgConfig; +import com.google.gson.JsonObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; @@ -80,70 +81,11 @@ public class CzOrderController { @Resource private ApiOrderRecordService apiOrderRecordService; + @Resource + private BsIntegralRebateService bsIntegralRebateService; - @RequestMapping(value = "/rechargeCallback", method = RequestMethod.POST) - @ApiOperation(value = "龙阅充值回调") - @ResponseBody - public void rechargeCallback( - @RequestParam(name = "out_trade_num", required = true) String out_trade_num, - @RequestParam(name = "userid", required = true) Long userid, - @RequestParam(name = "state", required = true) Long state, - @RequestBody String reqBodyStr , - HttpServletRequest request, HttpServletResponse response) { - try { - // 推送记录 - HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); - highGasOrderPush.setType(OrderPushType.type2.getType()); - highGasOrderPush.setOrderNo(out_trade_num); - highGasOrderPush.setCreateTime(new Date()); - highGasOrderPush.setCode(state.toString()); - highGasOrderPush.setReturnContent(reqBodyStr); - highGasOrderPushMapper.insert(highGasOrderPush); - - OutRechargeChildOrder childOrder = outRechargeChildOrderService.findByOrderNo(out_trade_num); - - OutRechargeOrder rechargeOrder = outRechargeOrderService.findByOrderId(childOrder.getParentOrderId()); - - BsRequestRecord bsRequestRecord = bsRequestRecordService.findRequestRecordByOrderNo(childOrder.getOrderNo()); - - bsRequestRecord.setReturnContent(reqBodyStr); - bsRequestRecord.setUpdateTime(new Date()); - bsRequestRecordService.updateRequestRecord(bsRequestRecord); - - - // 判断是否充值成功 - if (state == 1) { - new Thread(() -> { - HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId()); - WxMsgConfig.rechargedSuccess( - rechargeOrder.getRechargeContent() + "充值成功", - String.valueOf(rechargeOrder.getPayRealPrice()), - rechargeOrder.getOrderNo(), - rechargeOrder.getFinishTime(), - RechargePayType.getNameByType(rechargeOrder.getPayType()), - highUser.getOpenId()); - }).start(); - childOrder.setStatus(101); - rechargeOrder.setRechargeStatus(202); - rechargeOrder.setPayStatus(100); - - outRechargeOrderService.updateOrder(rechargeOrder); - outRechargeChildOrderService.updateOrder(childOrder); - } else { - callbackResult(childOrder , rechargeOrder); - } - - 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); - } - } - + @Resource + private HighGoldRecService highGoldRecService; @RequestMapping(value = "/rechargeCallbackByJj", method = RequestMethod.POST) @ApiOperation(value = "尖椒充值回调") @@ -180,6 +122,29 @@ public class CzOrderController { // 判断是否充值成功 if (dataObject.getInteger("status") == 3) { new Thread(() -> { + + JSONObject object = new JSONObject(); + + object.put("type" , 3); + object.put("productId" , rechargeOrder.getOperatorType()); + object.put("companyId" , rechargeOrder.getCompanyId()); + object.put("price" , rechargeOrder.getPayRealPrice()); + object.put("userId" , rechargeOrder.getUserId()); + object.put("orderId" , rechargeOrder.getId()); + object.put("remark" , "话费订单" + rechargeOrder.getOrderNo() + "积分返利:"); + + Map map = new HashMap<>(); + map.put("goldType", 1); + map.put("resType", 4); + map.put("userId", rechargeOrder.getUserId()); + map.put("resId", rechargeOrder.getId()); + + List goldRecs = highGoldRecService.getGoldRec(map); + + if (goldRecs.size() == 0) { + bsIntegralRebateService.integralRebate(object); + } + HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId()); WxMsgConfig.rechargedSuccess( rechargeOrder.getRechargeContent() + "充值成功", @@ -247,6 +212,29 @@ public class CzOrderController { // 判断是否充值成功 if (state == 1) { new Thread(() -> { + + JSONObject object = new JSONObject(); + + object.put("type" , 3); + object.put("productId" , rechargeOrder.getOperatorType()); + object.put("companyId" , rechargeOrder.getCompanyId()); + object.put("price" , rechargeOrder.getPayRealPrice()); + object.put("userId" , rechargeOrder.getUserId()); + object.put("orderId" , rechargeOrder.getId()); + object.put("remark" , "话费订单" + rechargeOrder.getOrderNo() + "积分返利:"); + + Map map = new HashMap<>(); + map.put("goldType", 1); + map.put("resType", 4); + map.put("userId", rechargeOrder.getUserId()); + map.put("resId", rechargeOrder.getId()); + + List goldRecs = highGoldRecService.getGoldRec(map); + + if (goldRecs.size() == 0) { + bsIntegralRebateService.integralRebate(object); + } + HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId()); WxMsgConfig.rechargedSuccess( rechargeOrder.getRechargeContent() + "充值成功", @@ -361,13 +349,13 @@ public class CzOrderController { // 当前时间减去充值时间 int hours = (int) ((currentTime.getTime() - rechargeTime.getTime()) / (1000 * 60 * 60)); - // 判断快充 并且 充值时间小于6 - if (rechargeOrder.getRechargeType() == 1 && hours < 6) { - outRechargeOrderService.pollRequest(rechargeOrder); - return; - } +// // 判断快充 并且 充值时间小于6 +// if (rechargeOrder.getRechargeType() == 1 && hours < 6) { +// outRechargeOrderService.pollRequest(rechargeOrder); +// return; +// } // 判断慢充 并且 充值时间小于72 - if (rechargeOrder.getRechargeType() == 2 && hours < 72) { + if (hours < 72) { outRechargeOrderService.pollRequest(rechargeOrder); return; } diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java index 060a17c5..1a6b3350 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java @@ -102,8 +102,9 @@ public class TuanYouController { highOrderService.updateOrderDetail(order); } } else if (order.getPayType() == 3){ + String remark = "订单" + order.getOrderNo() + "退款,退还积分:" + order.getPayGold(); // 积分退款 - highUserService.goldHandle(order.getMemId(), order.getPayGold(),1, 2, order.getId()); + highUserService.goldHandle(order.getMemId(), order.getPayGold(),1, 3, order.getId() , remark); order.setOrderStatus(4); order.setRefundTime(new Date()); order.setRefundPrice(order.getPayRealPrice()); diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java index df13d2dd..36b5b3db 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java @@ -283,7 +283,8 @@ public class UnionPayController { highChildOrder.setChildOrdeStatus(3); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 // 金币 1:100 Integer goldNum = new BigDecimal(highChildOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue(); - highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId()); + String remark = "订单" + order.getOrderNo() + "积分充值积分:" + goldNum; + highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId() , remark); } if (highChildOrder.getGoodsType() == 3) { diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighIntegralSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighIntegralSchedule.java new file mode 100644 index 00000000..b8a6a69e --- /dev/null +++ b/hai-schedule/src/main/java/com/hai/schedule/HighIntegralSchedule.java @@ -0,0 +1,49 @@ +package com.hai.schedule; + +import com.alibaba.fastjson.JSONObject; +import com.hai.entity.HighChildOrder; +import com.hai.entity.HighGoldRec; +import com.hai.entity.HighOrder; +import com.hai.service.BsIntegralRebateService; +import com.hai.service.HighGoldRecService; +import com.hai.service.HighUserService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.Scheduled; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Configuration +public class HighIntegralSchedule { + + private static final Logger log = LoggerFactory.getLogger(HighIntegralSchedule.class); + + + @Resource + private HighGoldRecService highGoldRecService; + + @Resource + private HighUserService highUserService; + + @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 + public void integralRebateOrder() { + List list = highGoldRecService.selectByExpiringSoonByAll(365); + + for (HighGoldRec goldRec : list) { + + highUserService.goldHandle(goldRec.getUserId(), goldRec.getGold(), 2, 5, goldRec.getResId() , "积分过期" ); + + goldRec.setStatus(9); + goldRec.setUpdateTime(new Date()); + highGoldRecService.updateGoldRec(goldRec); + + + } + } + +} diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java index fe31c9e2..4d410258 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java @@ -1,17 +1,15 @@ package com.hai.schedule; import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import com.hai.common.utils.HttpsUtils; +import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.QianZhuConfig; import com.hai.config.WxOrderConfig; -import com.hai.entity.HighChildOrder; -import com.hai.entity.HighOrder; -import com.hai.entity.OutRechargeChildOrder; -import com.hai.entity.OutRechargeOrder; +import com.hai.entity.*; import com.hai.model.OrderRefundModel; -import com.hai.service.HighOrderService; -import com.hai.service.OutRechargeChildOrderService; -import com.hai.service.OutRechargeOrderService; +import com.hai.service.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Configuration; @@ -44,6 +42,12 @@ public class HighOrderSchedule { @Resource private OutRechargeChildOrderService rechargeChildOrderService; + @Resource + private HighGoldRecService highGoldRecService; + + @Resource + private BsIntegralRebateService bsIntegralRebateService; + /** * @Author 胡锐 * @Description 取消订单 15分钟 @@ -116,13 +120,13 @@ public class HighOrderSchedule { int hours = (int) ((currentTime.getTime() - rechargeTime.getTime()) / (1000 * 60 * 60)); // 判断快充 并且 充值时间小于6 - if (order.getRechargeType() == 1 && hours < 6) { - System.out.println("话费定时任务 -> 请求快充:订单id:" + order.getId()); - outRechargeOrderService.pollRequest(order); - continue; - } +// if (order.getRechargeType() == 1 && hours < 6) { +// System.out.println("话费定时任务 -> 请求快充:订单id:" + order.getId()); +// outRechargeOrderService.pollRequest(order); +// continue; +// } // 判断慢充 并且 充值时间小于72 - if (order.getRechargeType() == 2 && hours < 72) { + if (hours < 72) { System.out.println("话费定时任务 -> 请求慢充:订单id:" + order.getId()); outRechargeOrderService.pollRequest(order); continue; @@ -427,13 +431,32 @@ public class HighOrderSchedule { } } } + @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 + public void integralRebateOrder() { + List order = highOrderService.integralRebateOrder(); + for (HighOrder highOrder : order) { + Map map = new HashMap<>(); + map.put("goldType", 1); + map.put("resType", 4); + map.put("userId", highOrder.getMemId()); + map.put("resId", highOrder.getId()); + + List goldRecs = highGoldRecService.getGoldRec(map); + + if (goldRecs.size() == 0) { + List childOrderList = highOrderService.getChildOrderByOrder(highOrder.getId()); + + JSONObject object = highOrderService.orderSource(childOrderList.get(0).getGoodsType() , childOrderList.get(0).getGoodsId(),highOrder.getOrderNo() , highOrder.getCompanyId()); + + object.put("price" , highOrder.getPayRealPrice()); + object.put("userId" , highOrder.getMemId()); + object.put("orderId" , highOrder.getId()); + + bsIntegralRebateService.integralRebate(object); + + } + } + } -// @Scheduled(cron="1 * * * * * ?") //每1分钟执行一次 -// public void unionStagingPayOrder() { -// List> mapList = highOrderService.getFinishGasOrder(); -// if (mapList != null && mapList.size() > 0) { -// -// } -// } } diff --git a/hai-service/src/main/java/com/hai/config/RechargeConfig.java b/hai-service/src/main/java/com/hai/config/RechargeConfig.java index 2f45da5c..19d2bbb7 100644 --- a/hai-service/src/main/java/com/hai/config/RechargeConfig.java +++ b/hai-service/src/main/java/com/hai/config/RechargeConfig.java @@ -99,7 +99,6 @@ public class RechargeConfig { map.put("out_order_id" , object.getString("out_order_id")); map.put("app_key" , CommonSysConst.getSysConfig().getJjAppKey()); map.put("timestamp" , timestamp.substring(0,timestamp.length()-3)); - map.put("is_fast" , object.getString("is_fast")); map.put("notify_url" , object.getString("notifyUrl")); String signStr = WxUtils.generateSignatureAppSecret(map, CommonSysConst.getSysConfig().getJjAppSecret() , WXPayConstants.SignType.MD5); diff --git a/hai-service/src/main/java/com/hai/dao/HighGoldRecMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGoldRecMapperExt.java index c537735f..79d321bd 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGoldRecMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighGoldRecMapperExt.java @@ -1,7 +1,12 @@ package com.hai.dao; +import com.hai.entity.HighGoldRec; +import com.hai.entity.HighGoldRecExample; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.type.JdbcType; import java.util.List; import java.util.Map; @@ -22,4 +27,40 @@ public interface HighGoldRecMapperExt { " "}) // 查询申请记录 List> queryGold(@Param("map") Map map); + + @Select("select * from high_gold_rec WHERE status = 1 and res_type = 4 and DATE_ADD(create_time,INTERVAL #{day} DAY) < NOW() and user_id = #{userId} ") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), + @Result(column="gold_type", property="goldType", jdbcType=JdbcType.BIGINT), + @Result(column="gold", property="gold", jdbcType=JdbcType.INTEGER), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="res_type", property="resType", jdbcType=JdbcType.INTEGER), + @Result(column="res_id", property="resId", jdbcType=JdbcType.BIGINT), + @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExpiringSoon(@Param("userId") Long userId , @Param("day") Integer day); + + @Select("select * from high_gold_rec WHERE status = 1 and res_type = 4 and DATE_ADD(create_time,INTERVAL #{day} DAY) < NOW()") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), + @Result(column="gold_type", property="goldType", jdbcType=JdbcType.BIGINT), + @Result(column="gold", property="gold", jdbcType=JdbcType.INTEGER), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="res_type", property="resType", jdbcType=JdbcType.INTEGER), + @Result(column="res_id", property="resId", jdbcType=JdbcType.BIGINT), + @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExpiringSoonByAll(@Param("day") Integer day); } 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 eb64321f..96b213d5 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -1246,4 +1246,38 @@ public interface HighOrderMapperExt { @Result(column="order_status", property="orderStatus", jdbcType=JdbcType.INTEGER), }) List getSelfOilStationOrderList(@Param("goodsId") String goodsId); + + @Select("select * from high_order where order_status = 3 and pay_type != 3 and pay_real_price > 0 ") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mem_discount_id", property="memDiscountId", jdbcType=JdbcType.BIGINT), + @Result(column="mem_discount_name", property="memDiscountName", jdbcType=JdbcType.VARCHAR), + @Result(column="mem_id", property="memId", jdbcType=JdbcType.BIGINT), + @Result(column="mem_name", property="memName", jdbcType=JdbcType.VARCHAR), + @Result(column="mem_phone", property="memPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_model", property="payModel", jdbcType=JdbcType.INTEGER), + @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER), + @Result(column="pay_gold", property="payGold", jdbcType=JdbcType.INTEGER), + @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), + @Result(column="deduction_price", property="deductionPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="order_status", property="orderStatus", jdbcType=JdbcType.INTEGER), + @Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="cancel_remarks", property="cancelRemarks", jdbcType=JdbcType.VARCHAR), + @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), + @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="refund_content", property="refundContent", jdbcType=JdbcType.VARCHAR), + @Result(column="refusal_refund_content", property="refusalRefundContent", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List integralRebateOrder(); } diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargePriceMapperExt.java b/hai-service/src/main/java/com/hai/dao/OutRechargePriceMapperExt.java index 4aef32e0..6b10c95e 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargePriceMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargePriceMapperExt.java @@ -21,7 +21,6 @@ public interface OutRechargePriceMapperExt { "SELECT * from out_recharge_price orp " + "join bs_product_platform bpp on orp.id = bpp.source_id " + "where status in (1,2) and platform_id = #{param.platformId} " + - "and recharge_type = #{param.rechargeType} " + "and operator_type = #{param.operatorType} " + "and company_id = #{param.companyId} " + "order by sort asc; " + diff --git a/hai-service/src/main/java/com/hai/entity/HighGoldRec.java b/hai-service/src/main/java/com/hai/entity/HighGoldRec.java index 6269a574..8d908309 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGoldRec.java +++ b/hai-service/src/main/java/com/hai/entity/HighGoldRec.java @@ -1,5 +1,7 @@ package com.hai.entity; +import com.hai.model.HighGoldRecModel; + import java.io.Serializable; import java.util.Date; @@ -12,7 +14,7 @@ import java.util.Date; * 代码由工具生成 * **/ -public class HighGoldRec implements Serializable { +public class HighGoldRec extends HighGoldRecModel implements Serializable { /** * 编号 */ @@ -242,4 +244,4 @@ public class HighGoldRec implements Serializable { sb.append("]"); return sb.toString(); } -} \ No newline at end of file +} diff --git a/hai-service/src/main/java/com/hai/entity/HighOrder.java b/hai-service/src/main/java/com/hai/entity/HighOrder.java index 570c9db7..3819d661 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrder.java @@ -232,6 +232,8 @@ public class HighOrder implements Serializable { private String gasStaffCode; + private String password; + /** * 是否自动充值积分 0 否 1 是 */ @@ -623,6 +625,14 @@ public class HighOrder implements Serializable { this.ext3 = ext3; } + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + public Boolean getTyAgent() { return isTyAgent; } diff --git a/hai-service/src/main/java/com/hai/service/BsIntegralRebateService.java b/hai-service/src/main/java/com/hai/service/BsIntegralRebateService.java index f541bb37..fd73ed1c 100644 --- a/hai-service/src/main/java/com/hai/service/BsIntegralRebateService.java +++ b/hai-service/src/main/java/com/hai/service/BsIntegralRebateService.java @@ -1,5 +1,6 @@ package com.hai.service; +import com.alibaba.fastjson.JSONObject; import com.hai.entity.BsIntegralRebate; import com.hai.entity.BsRequestRecord; @@ -66,4 +67,16 @@ public interface BsIntegralRebateService { */ void updateIntegralRebate(BsIntegralRebate bsIntegralRebate); + + /** + * @Author Sum1Dream + * @Description //删除 Administrator + * @Date 17:31 2021/6/13 + * @Param [id] + * @return void + **/ + void deleteIntegralRebate(Long id); + + void integralRebate(JSONObject object); + } diff --git a/hai-service/src/main/java/com/hai/service/HighGoldRecService.java b/hai-service/src/main/java/com/hai/service/HighGoldRecService.java index a00fb801..92b60733 100644 --- a/hai-service/src/main/java/com/hai/service/HighGoldRecService.java +++ b/hai-service/src/main/java/com/hai/service/HighGoldRecService.java @@ -19,6 +19,16 @@ public interface HighGoldRecService { **/ void insertGoldRec(HighGoldRec highGoldRec); + /** + * @Author Sum1Dream + * @name updateGoldRec.java + * @Description // 修改记录 + * @Date 09:24 2022/8/6 + * @Param [com.hai.entity.HighGoldRec] + * @return void + */ + void updateGoldRec(HighGoldRec highGoldRec); + /** * @Author 胡锐 @@ -36,4 +46,25 @@ public interface HighGoldRecService { * @return java.util.Map **/ List > queryGold(Map map); + + /** + * @Author Sum1Dream + * @name selectByExpiringSoon.java + * @Description // 查询七天内即将过期积分 + * @Date 10:04 2022/8/5 + * @Param [] + * @return java.util.List + */ + List selectByExpiringSoon(Long userId , Integer day); + + /** + * @Author Sum1Dream + * @name selectByExpiringSoon.java + * @Description // 查询七天内即将过期积分 + * @Date 10:04 2022/8/5 + * @Param [] + * @return java.util.List + */ + List selectByExpiringSoonByAll(Integer day); + } diff --git a/hai-service/src/main/java/com/hai/service/HighOrderService.java b/hai-service/src/main/java/com/hai/service/HighOrderService.java index d5fa708d..de83004d 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderService.java @@ -6,6 +6,7 @@ import com.hai.entity.HighOrder; import com.hai.entity.HighUserCard; import com.hai.entity.OutRechargeOrder; import com.hai.model.*; +import io.swagger.models.auth.In; import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; @@ -534,4 +535,24 @@ public interface HighOrderService { * @return */ List getSelfOilStationOrderList(String goodsId); + + /** + * @Author Sum1Dream + * @name integralRebateOrder.java + * @Description // 查询可积分返利订单 + * @Date 10:13 2022/8/4 + * @Param [] + * @return java.util.List + */ + List integralRebateOrder(); + + /** + * @Author Sum1Dream + * @name orderSource.java + * @Description // 查询订单来源 + * @Date 14:11 2022/8/4 + * @Param [java.lang.Integer, java.lang.Long] + * @return com.alibaba.fastjson.JSONObject + */ + JSONObject orderSource(Integer goodsType , Long goodsId , String orderNo , Long companyId); } diff --git a/hai-service/src/main/java/com/hai/service/HighUserService.java b/hai-service/src/main/java/com/hai/service/HighUserService.java index 15344c25..14928723 100644 --- a/hai-service/src/main/java/com/hai/service/HighUserService.java +++ b/hai-service/src/main/java/com/hai/service/HighUserService.java @@ -106,7 +106,7 @@ public interface HighUserService { * @Description 用户金币充值、消费 * @Date 2021/3/27 9:51 **/ - void goldHandle(Long userId, Integer goldNum, Integer goldType, Integer resType, Long resId); + void goldHandle(Long userId, Integer goldNum, Integer goldType, Integer resType, Long resId , String remark); /** * @Author Sum1Dream diff --git a/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java index e52bbd80..f78abcc9 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java @@ -1,13 +1,17 @@ package com.hai.service.impl; +import com.alibaba.fastjson.JSONObject; import com.hai.dao.BsIntegralRebateMapper; import com.hai.entity.BsIntegralRebate; import com.hai.entity.BsIntegralRebateExample; import com.hai.service.BsIntegralRebateService; +import com.hai.service.HighUserService; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -17,6 +21,9 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService { @Resource private BsIntegralRebateMapper bsIntegralRebateMapper; + @Resource + private HighUserService highUserService; + @Override public BsIntegralRebate findIntegralRebateByMap(Map map) { @@ -36,7 +43,7 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService { List list = bsIntegralRebateMapper.selectByExample(example); if (list.size() > 0) { - bsIntegralRebateMapper.selectByExample(example).get(0); + return bsIntegralRebateMapper.selectByExample(example).get(0); } return null; @@ -73,4 +80,32 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService { public void updateIntegralRebate(BsIntegralRebate bsIntegralRebate) { bsIntegralRebateMapper.updateByPrimaryKeySelective(bsIntegralRebate); } + + @Override + public void deleteIntegralRebate(Long id) { + bsIntegralRebateMapper.deleteByPrimaryKey(id); + } + + @Override + public void integralRebate(JSONObject object) { + + Map map = new HashMap<>(); + map.put("type" , object.getInteger("type")); + map.put("productId" , object.getLong("productId")); + map.put("companyId" , object.getLong("companyId")); + + if (object.getLong("companyId") != null) { + + BsIntegralRebate bsIntegralRebate = findIntegralRebateByMap(map); + + if (bsIntegralRebate != null) { + BigDecimal integralNum = object.getBigDecimal("price").multiply(bsIntegralRebate.getPercentage()).setScale( 0, BigDecimal.ROUND_HALF_UP ); + + highUserService.goldHandle(object.getLong("userId"), integralNum.intValue(), 1, 4, object.getLong("orderId") , object.getString("remark") + integralNum); + + } + + } + + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java index a425cc94..508f4fae 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java @@ -10,6 +10,7 @@ import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -33,6 +34,11 @@ public class HighGoldRecServiceImpl implements HighGoldRecService { highGoldRecMapper.insert(highGoldRec); } + @Override + public void updateGoldRec(HighGoldRec highGoldRec) { + highGoldRecMapper.updateByPrimaryKey(highGoldRec); + } + @Override public List getGoldRec(Map map) { HighGoldRecExample example = new HighGoldRecExample(); @@ -50,10 +56,18 @@ public class HighGoldRecServiceImpl implements HighGoldRecService { if (MapUtils.getLong(map, "resType") != null) { criteria.andResTypeEqualTo(MapUtils.getInteger(map, "resType")); } + if (MapUtils.getLong(map, "resId") != null) { + criteria.andResIdEqualTo(MapUtils.getLong(map, "resId")); + } if (MapUtils.getLong(map , "createTimeS") != null) { criteria.andCreateTimeBetween(new Date(MapUtils.getLong(map , "createTimeS")) , new Date(MapUtils.getLong(map , "createTimeE"))); } + if (MapUtils.getInteger(map, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); + } { + criteria.andStatusEqualTo(1); + } example.setOrderByClause("create_time desc"); List list = highGoldRecMapper.selectByExample(example); @@ -68,4 +82,16 @@ public class HighGoldRecServiceImpl implements HighGoldRecService { return highGoldRecMapper.queryGold(map); } + + @Override + public List selectByExpiringSoon(Long userId , Integer day) { + return highGoldRecMapper.selectByExpiringSoon(userId , day); + } + + @Override + public List selectByExpiringSoonByAll(Integer day) { + return highGoldRecMapper.selectByExpiringSoonByAll( day); + } + + } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 5b49fcd1..60f06e17 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -9,17 +9,18 @@ import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.AESEncodeUtil; -import com.hai.common.utils.*; +import com.hai.common.utils.DateUtil; +import com.hai.common.utils.HttpsUtils; +import com.hai.common.utils.IDGenerator; +import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.dao.*; import com.hai.entity.*; -import com.hai.entity.OutRechargeOrder; import com.hai.enum_type.*; import com.hai.model.*; import com.hai.msg.entity.MsgTopic; import com.hai.service.*; import com.hai.service.pay.impl.GoodsOrderServiceImpl; -import io.netty.handler.ipfilter.UniqueIpFilter; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; @@ -28,7 +29,6 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.util.EntityUtils; -import org.eclipse.paho.client.mqttv3.MqttClient; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; @@ -38,7 +38,6 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; -import java.time.OffsetDateTime; import java.util.*; /** @@ -273,7 +272,9 @@ public class HighOrderServiceImpl implements HighOrderService { // 金币 1:100 Integer goldNum = new BigDecimal(highOrder.getPayPrice().toString()).multiply(new BigDecimal("100")).intValue(); - highUserService.goldHandle(userId, goldNum, 2, 2, highOrder.getId()); + + String remark = "订单" + highOrder.getOrderNo() + "下单,使用积分:" + goldNum; + highUserService.goldHandle(userId, goldNum, 2, 2, highOrder.getId() , remark); highOrder.setPayTime(new Date()); // 支付时间 highOrder.setPayModel(1); // 支付模式:1 金币,2 第三方平台,3 混合 @@ -972,7 +973,8 @@ public class HighOrderServiceImpl implements HighOrderService { highChildOrder.setChildOrdeStatus(3); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 // 金币 1:100 Integer goldNum = new BigDecimal(highChildOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue(); - highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId()); + String remark = "订单" + order.getOrderNo() + "积分充值积分:" + goldNum; + highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId() , remark); } if (highChildOrder.getGoodsType() == 3) { @@ -1462,7 +1464,8 @@ public class HighOrderServiceImpl implements HighOrderService { if (order.getPayGold() != null) { // 积分返回 - highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId()); + String remark = "订单" + order.getOrderNo() + "取消,退还积分:" + order.getPayGold(); + highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark); } updateOrder(order); @@ -2187,7 +2190,9 @@ public class HighOrderServiceImpl implements HighOrderService { if (integralPrice.compareTo(new BigDecimal(0)) > 0) { highOrder.setPayPrice(highOrder.getPayPrice().subtract(integralPrice)); - highUserService.goldHandle(highOrder.getMemId(), object.getInteger("integralNum"), 2, 2, highOrder.getId()); + + String remark = "订单" + highOrder.getOrderNo() + "下单,使用积分:" + object.getInteger("integralNum"); + highUserService.goldHandle(highOrder.getMemId(), object.getInteger("integralNum"), 2, 2, highOrder.getId() , remark); } // 判断积分支付是否扣完金额 @@ -2348,18 +2353,7 @@ public class HighOrderServiceImpl implements HighOrderService { } - // 退还积分 - if (order.getPayGold() != null) { - highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId()); - if (order.getPayRealPrice().compareTo(new BigDecimal(0)) == 0) { - order.setOrderStatus(4); - order.setRefundTime(new Date()); - for (HighChildOrder childOrder : order.getHighChildOrderList()) { - childOrder.setChildOrdeStatus(4); - } - updateOrder(order); - } - } + // 微信退款 if (order.getPayType() == 2) { Map param = new HashMap<>(); @@ -2488,7 +2482,19 @@ public class HighOrderServiceImpl implements HighOrderService { } updateOrder(order); } - + // 退还积分 + if (order.getPayGold() != null) { + String remark = "订单" + order.getOrderNo() + "退款,退还积分:" + order.getPayGold(); + highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark); + if (order.getPayRealPrice().compareTo(new BigDecimal(0)) == 0) { + order.setOrderStatus(4); + order.setRefundTime(new Date()); + for (HighChildOrder childOrder : order.getHighChildOrderList()) { + childOrder.setChildOrdeStatus(4); + } + updateOrder(order); + } + } if (order.getMemDiscountId() != null) { HighDiscountUserRel rel = highDiscountUserRelService.getRelById(order.getMemDiscountId()); @@ -2562,7 +2568,8 @@ public class HighOrderServiceImpl implements HighOrderService { if (order.getPayGold() != null) { // 积分返回 - highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId()); + String remark = "订单" + order.getOrderNo() + "取消,退还积分:" + order.getPayGold(); + highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark); } updateOrder(order); @@ -2596,4 +2603,53 @@ public class HighOrderServiceImpl implements HighOrderService { public List getSelfOilStationOrderList(String goodsId) { return highOrderMapper.getSelfOilStationOrderList(goodsId); } + + @Override + public List integralRebateOrder() { + return highOrderMapper.integralRebateOrder(); + } + + @Override + public JSONObject orderSource(Integer goodsType, Long goodsId , String orderNo , Long companyId) { + + JSONObject object = new JSONObject(); + + if (goodsType == 1) { + HighCoupon coupon = highCouponService.getCouponById(goodsId); + + object.put("type" , 1); + object.put("productId", coupon.getCouponSource()); + object.put("companyId", coupon.getCompanyId()); + object.put("remark" , "卡券订单" + orderNo + "积分返利:"); + + } + if (goodsType == 3) { + HighMerchantStore merchantStore = highMerchantStoreService.getMerchantStoreById(goodsId); + object.put("type" , 2); + object.put("productId", 1); + object.put("companyId", merchantStore.getCompanyId()); + object.put("remark" , "在线加油订单" + orderNo + "积分返利:"); + } + + if (goodsType == 4) { + object.put("type" , 4); + object.put("productId", 2); + object.put("companyId", companyId); + object.put("remark" , "肯德基订单" + orderNo + "积分返利:"); + } + if (goodsType == 9) { + object.put("type" , 4); + object.put("productId", 1); + object.put("companyId", companyId); + object.put("remark" , "星巴克订单" + orderNo + "积分返利:"); + } + if (goodsType == 10) { + object.put("type" , 4); + object.put("productId", 3); + object.put("companyId", companyId); + object.put("remark" , "会员充值订单" + orderNo + "积分返利:"); + } + + return object; + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java index db25a422..fb45eb09 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java @@ -225,7 +225,7 @@ public class HighUserServiceImpl implements HighUserService { @Override @Transactional(propagation= Propagation.REQUIRED) - public void goldHandle(Long userId, Integer goldNum, Integer goldType, Integer resType, Long resId) { + public void goldHandle(Long userId, Integer goldNum, Integer goldType, Integer resType, Long resId , String remark) { // 查询用户信息 HighUser user = highUserMapper.selectByPrimaryKey(userId); if (user == null) { @@ -254,7 +254,12 @@ public class HighUserServiceImpl implements HighUserService { highGoldRec.setCreateTime(new Date()); highGoldRec.setResType(resType); highGoldRec.setResId(resId); - highGoldRecService.insertGoldRec(highGoldRec); + highGoldRec.setStatus(1); + highGoldRec.setRemark(remark); + if (goldNum > 0) { + highGoldRecService.insertGoldRec(highGoldRec); + } + } @Override 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 e1a4b9e7..d574e491 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 @@ -74,6 +74,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { @Resource private GoodsOrderServiceImpl goodsOrderService; + @Resource + private BsIntegralRebateService bsIntegralRebateService; + @Resource private HighDiscountUserRelService highDiscountUserRelService; @@ -98,6 +101,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { @Resource private ApiMerchantsService apiMerchantsService; + @Resource + private HighGoldRecService highGoldRecService; + @Resource private ApiAmountRecordService apiAmountRecordService; @@ -356,12 +362,15 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { highDiscountAgentCodeService.updateCode(code); } - if (outRechargeOrder.getIntegralNum() != null) { - highUserService.goldHandle(outRechargeOrder.getUserId(), outRechargeOrder.getIntegralNum().intValue(), 2, 2, outRechargeOrder.getId()); - } + outRechargeOrderMapper.insert(outRechargeOrder); + if (outRechargeOrder.getIntegralNum() != null) { + String remark = "话费订单" + outRechargeOrder.getOrderNo() + "下单,使用积分:" + object.getInteger("integralNum"); + highUserService.goldHandle(outRechargeOrder.getUserId(), outRechargeOrder.getIntegralNum().intValue(), 2, 2, outRechargeOrder.getId() , remark); + } + if (outRechargeOrder.getPayStatus() == 102) { pollRequest(outRechargeOrder); } @@ -412,7 +421,8 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { if (order.getIntegralNum() != null) { // 积分返回 - highUserService.goldHandle(order.getUserId(), order.getIntegralNum().intValue(), 1, 3, order.getId()); + String remark = "话费订单" + order.getOrderNo() + "取消,退还积分:" + order.getIntegralNum().intValue(); + highUserService.goldHandle(order.getUserId(), order.getIntegralNum().intValue(), 1, 3, order.getId() , remark); } updateOrder(order); @@ -425,6 +435,33 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { public void finishOrder(Long orderId) { OutRechargeOrder order = findByOrderId(orderId); if (order != null) { + + new Thread(() -> { + JSONObject object = new JSONObject(); + + object.put("type" , 3); + object.put("productId" , order.getOperatorType()); + object.put("companyId" , order.getCompanyId()); + object.put("price" , order.getPayRealPrice()); + object.put("userId" , order.getUserId()); + object.put("orderId" , order.getId()); + object.put("remark" , "话费订单" + order.getOrderNo() + "积分返利:"); + + + Map map = new HashMap<>(); + map.put("goldType", 1); + map.put("resType", 4); + map.put("userId", order.getUserId()); + map.put("resId", order.getId()); + + List goldRecs = highGoldRecService.getGoldRec(map); + + if (goldRecs.size() == 0) { + bsIntegralRebateService.integralRebate(object); + } + + }).start(); + order.setRechargeStatus(202); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已取消 5.已退款 order.setPayStatus(100); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已取消 5.已退款 order.setFinishTime(new Date()); @@ -616,16 +653,6 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法退款,订单处于充值中状态"); } - // 退还积分 - if (order.getIntegralNum().compareTo(new BigDecimal(0)) > 0) { - highUserService.goldHandle(order.getUserId(), order.getIntegralNum().intValue(), 1, 3, order.getId()); - if (order.getPayRealPrice().compareTo(new BigDecimal(0)) == 0) { - order.setPayStatus(105); - order.setRechargeStatus(203); - order.setRefundTime(new Date()); - outRechargeOrderService.updateOrder(order); - } - } // 微信退款 if (order.getPayType() == 2) { Map param = new HashMap<>(); @@ -762,6 +789,19 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { } } + + // 退还积分 + if (order.getIntegralNum().compareTo(new BigDecimal(0)) > 0) { + String remark = "话费订单" + order.getOrderNo() + "退款,退还积分:" + order.getIntegralNum().intValue(); + highUserService.goldHandle(order.getUserId(), order.getIntegralNum().intValue(), 1, 3, order.getId() , remark); + if (order.getPayRealPrice().compareTo(new BigDecimal(0)) == 0) { + order.setPayStatus(105); + order.setRechargeStatus(203); + order.setRefundTime(new Date()); + outRechargeOrderService.updateOrder(order); + } + } + } public String doRefundRequest(String mchId, String data) throws Exception { @@ -799,19 +839,20 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { // 查询充值产品 OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(outRechargeOrder.getGoodsId(), null); - System.out.println("话费定时任务 -> 需要重新充值:开始"); // 查询充值子订单 Map childOrderMap = new HashMap<>(); + // 添加查询是否存在充值中的子订单 childOrderMap.put("parent_order_id", outRechargeOrder.getId()); childOrderMap.put("status", 102); - List childOrderList = outRechargeChildOrderService.getListRechargeChildOrder(childOrderMap); + // 定义新的子订单对象 OutRechargeChildOrder childOrder = new OutRechargeChildOrder(); // 1:尖椒 2:龙阅 3:畅停 int type = 0; + // 定义新增子订单充值平台 int rechargePlatformType = 0; // 判断子订单是否存在充值中订单 @@ -823,7 +864,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { type = childOrder.getRechargePlatform(); } else { - // 查询充值子订单 + // 查询充值状态为103充值失败的子订单 Map childOrderMap103 = new HashMap<>(); childOrderMap103.put("parent_order_id", outRechargeOrder.getId()); @@ -843,12 +884,14 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { JSONObject object = new JSONObject(); + // 定义订单哈 String orderNo = "CZ" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5); + // 查询平台 String string = outRechargePrice.getRechargePlatform().substring(1,outRechargePrice.getRechargePlatform().length()-1); - String[] rechargePlatform = string.split("-"); + // 判断平台只定义一个那么类型就是唯一 if (string.length() == 1) { type = Integer.parseInt(string); } @@ -865,9 +908,6 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { object.put("amount", outRechargePrice.getRechargePrice()); object.put("mobile", outRechargeOrder.getRechargeContent()); object.put("notifyUrl", CommonSysConst.getSysConfig().getJjNotifyUrl()); - if (outRechargeOrder.getRechargeType() == 1) { - object.put("is_fast", 1); - } JSONObject returnObject = RechargeConfig.rechargeOrderByJj(object); object.put("return_content", returnObject); if (returnObject != null && returnObject.getLong("code") == 200) { diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java index 692b28fa..48f15607 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java @@ -54,6 +54,8 @@ public class OutRechargePriceServiceImpl implements OutRechargePriceService { } if (MapUtils.getLong(map, "status") != null) { criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); + } else { + criteria.andStatusNotEqualTo(0); } if (MapUtils.getLong(map, "rechargeWay") != null) { criteria.andRechargeWayEqualTo(MapUtils.getInteger(map, "rechargeWay")); diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index 3762a59d..9c45efe0 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -274,7 +274,8 @@ public class GoodsOrderServiceImpl implements PayService { order.setOrderStatus(3); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 // 金币 1:100 Integer goldNum = new BigDecimal(highChildOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue(); - highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId()); + String remark = "订单" + order.getOrderNo() + "积分充值积分:" + goldNum; + highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId() , remark); } if (highChildOrder.getGoodsType() == 3) {