提交修改

dev-discount
袁野 2 years ago
parent d5bc9bd151
commit f9744d94e4
  1. 37
      hai-bweb/src/main/java/com/bweb/controller/BsIntegralRebateController.java
  2. 3
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  3. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  4. 6
      hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java
  5. 19
      hai-cweb/src/main/java/com/cweb/controller/HighGoldRecController.java
  6. 12
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  7. 4
      hai-cweb/src/main/java/com/cweb/controller/OutRechargePriceController.java
  8. 126
      hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java
  9. 3
      hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java
  10. 3
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  11. 49
      hai-schedule/src/main/java/com/hai/schedule/HighIntegralSchedule.java
  12. 63
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  13. 1
      hai-service/src/main/java/com/hai/config/RechargeConfig.java
  14. 41
      hai-service/src/main/java/com/hai/dao/HighGoldRecMapperExt.java
  15. 34
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  16. 1
      hai-service/src/main/java/com/hai/dao/OutRechargePriceMapperExt.java
  17. 6
      hai-service/src/main/java/com/hai/entity/HighGoldRec.java
  18. 10
      hai-service/src/main/java/com/hai/entity/HighOrder.java
  19. 13
      hai-service/src/main/java/com/hai/service/BsIntegralRebateService.java
  20. 31
      hai-service/src/main/java/com/hai/service/HighGoldRecService.java
  21. 21
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  22. 2
      hai-service/src/main/java/com/hai/service/HighUserService.java
  23. 37
      hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java
  24. 26
      hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java
  25. 102
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  26. 9
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  27. 82
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
  28. 2
      hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java
  29. 3
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.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<String, Object> 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);
}
}
}

@ -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());

File diff suppressed because one or more lines are too long

@ -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<BsRechargeCode> 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, "龙阅,城宇平台需要输入商品编码!");
}

@ -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);
}
}
}

@ -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);

@ -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));

@ -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<String, Object> map = new HashMap<>();
map.put("goldType", 1);
map.put("resType", 4);
map.put("userId", rechargeOrder.getUserId());
map.put("resId", rechargeOrder.getId());
List<HighGoldRec> 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<String, Object> map = new HashMap<>();
map.put("goldType", 1);
map.put("resType", 4);
map.put("userId", rechargeOrder.getUserId());
map.put("resId", rechargeOrder.getId());
List<HighGoldRec> 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;
}

@ -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());

@ -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) {

@ -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<HighGoldRec> 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);
}
}
}

@ -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<HighOrder> order = highOrderService.integralRebateOrder();
for (HighOrder highOrder : order) {
Map<String, Object> map = new HashMap<>();
map.put("goldType", 1);
map.put("resType", 4);
map.put("userId", highOrder.getMemId());
map.put("resId", highOrder.getId());
List<HighGoldRec> goldRecs = highGoldRecService.getGoldRec(map);
if (goldRecs.size() == 0) {
List<HighChildOrder> 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<Map<String, Object>> mapList = highOrderService.getFinishGasOrder();
// if (mapList != null && mapList.size() > 0) {
//
// }
// }
}

@ -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);

@ -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 {
" </script>"})
// 查询申请记录
List<Map<Long,Long>> queryGold(@Param("map") Map<String,Object> 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<HighGoldRec> 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<HighGoldRec> selectByExpiringSoonByAll(@Param("day") Integer day);
}

@ -1246,4 +1246,38 @@ public interface HighOrderMapperExt {
@Result(column="order_status", property="orderStatus", jdbcType=JdbcType.INTEGER),
})
List<SelfOilStationModel> 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<HighOrder> integralRebateOrder();
}

@ -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; " +

@ -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();
}
}
}

@ -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;
}

@ -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);
}

@ -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<java.lang.Long,java.lang.Long>
**/
List<Map<Long , Long> > queryGold(Map<String, Object> map);
/**
* @Author Sum1Dream
* @name selectByExpiringSoon.java
* @Description // 查询七天内即将过期积分
* @Date 10:04 2022/8/5
* @Param []
* @return java.util.List<com.hai.entity.HighGoldRec>
*/
List<HighGoldRec> selectByExpiringSoon(Long userId , Integer day);
/**
* @Author Sum1Dream
* @name selectByExpiringSoon.java
* @Description // 查询七天内即将过期积分
* @Date 10:04 2022/8/5
* @Param []
* @return java.util.List<com.hai.entity.HighGoldRec>
*/
List<HighGoldRec> selectByExpiringSoonByAll(Integer day);
}

@ -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<SelfOilStationModel> getSelfOilStationOrderList(String goodsId);
/**
* @Author Sum1Dream
* @name integralRebateOrder.java
* @Description // 查询可积分返利订单
* @Date 10:13 2022/8/4
* @Param []
* @return java.util.List<com.hai.entity.HighOrder>
*/
List<HighOrder> 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);
}

@ -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

@ -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<String, Object> map) {
@ -36,7 +43,7 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService {
List<BsIntegralRebate> 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<String, Object> 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);
}
}
}
}

@ -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<HighGoldRec> getGoldRec(Map<String, Object> 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<HighGoldRec> list = highGoldRecMapper.selectByExample(example);
@ -68,4 +82,16 @@ public class HighGoldRecServiceImpl implements HighGoldRecService {
return highGoldRecMapper.queryGold(map);
}
@Override
public List<HighGoldRec> selectByExpiringSoon(Long userId , Integer day) {
return highGoldRecMapper.selectByExpiringSoon(userId , day);
}
@Override
public List<HighGoldRec> selectByExpiringSoonByAll(Integer day) {
return highGoldRecMapper.selectByExpiringSoonByAll( day);
}
}

@ -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<String, String> 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<SelfOilStationModel> getSelfOilStationOrderList(String goodsId) {
return highOrderMapper.getSelfOilStationOrderList(goodsId);
}
@Override
public List<HighOrder> 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;
}
}

@ -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

@ -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<String, Object> map = new HashMap<>();
map.put("goldType", 1);
map.put("resType", 4);
map.put("userId", order.getUserId());
map.put("resId", order.getId());
List<HighGoldRec> 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<String, String> 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<String, Object> childOrderMap = new HashMap<>();
// 添加查询是否存在充值中的子订单
childOrderMap.put("parent_order_id", outRechargeOrder.getId());
childOrderMap.put("status", 102);
List<OutRechargeChildOrder> 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<String, Object> 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) {

@ -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"));

@ -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) {

Loading…
Cancel
Save