dev-discount
zdx 3 years ago
commit 8f1b5892c7
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  2. 2
      hai-bweb/src/main/java/com/bweb/controller/HighUserController.java
  3. 36
      hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java
  4. 7
      hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java
  5. 91
      hai-bweb/src/main/java/com/bweb/excelListener/ImportRechargeOrderListener.java
  6. 23
      hai-bweb/src/main/java/com/bweb/model/ExportOutRechargeOrder.java
  7. 6
      hai-bweb/src/main/resources/prod/application.yml
  8. 5
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  9. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  10. 129
      hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java
  11. 11
      hai-cweb/src/main/java/com/cweb/controller/OutRechargePriceController.java
  12. 25
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  13. 185
      hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java
  14. 9
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  15. 6
      hai-cweb/src/main/resources/prod-9401/application.yml
  16. 6
      hai-cweb/src/main/resources/prod/application.yml
  17. 4
      hai-cweb/src/test/common/test.java
  18. 6
      hai-schedule/src/main/resources/prod/application.yml
  19. 27
      hai-service/src/main/java/com/hai/common/utils/WxUtils.java
  20. 37
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  21. 2
      hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java
  22. 44
      hai-service/src/main/java/com/hai/config/UnionStagingPayConfig.java
  23. 13
      hai-service/src/main/java/com/hai/dao/HighDiscountPackageActualMapper.java
  24. 14
      hai-service/src/main/java/com/hai/dao/HighDiscountPackageActualSqlProvider.java
  25. 42
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java
  26. 2
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java
  27. 42
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java
  28. 29
      hai-service/src/main/java/com/hai/dao/OutRechargePriceMapper.java
  29. 14
      hai-service/src/main/java/com/hai/dao/OutRechargePriceSqlProvider.java
  30. 16
      hai-service/src/main/java/com/hai/entity/HighDiscountPackageActual.java
  31. 70
      hai-service/src/main/java/com/hai/entity/HighDiscountPackageActualExample.java
  32. 50
      hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java
  33. 190
      hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java
  34. 16
      hai-service/src/main/java/com/hai/entity/OutRechargePrice.java
  35. 60
      hai-service/src/main/java/com/hai/entity/OutRechargePriceExample.java
  36. 9
      hai-service/src/main/java/com/hai/model/OutRechargeOrderModel.java
  37. 2
      hai-service/src/main/java/com/hai/service/HighTestService.java
  38. 25
      hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
  39. 29
      hai-service/src/main/java/com/hai/service/impl/HighTestServiceImpl.java
  40. 2
      hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java
  41. 192
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
  42. 7
      hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java
  43. 13
      hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java
  44. 9
      hai-service/src/main/resources/dev/commonConfig.properties
  45. 6
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  46. 10
      hai-service/src/main/resources/prod/commonConfig.properties

File diff suppressed because one or more lines are too long

@ -156,7 +156,7 @@ public class HighUserController {
@ApiOperation(value = "请求会员体系")
public ResponseData TCheckEMsgUnionCardVipRights(@RequestParam(name = "phone", required = true) String phone) {
try {
JSONObject consumptionRecord = HuiLianTongUnionCardConfig.TCheckEMsgUnionCardVipRights(phone);
JSONObject consumptionRecord = HuiLianTongUnionCardConfig.checkEMsgUnionCardVipRights(phone);
JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponseMembership(consumptionRecord.getString("data"));
return ResponseMsgUtil.success(cardInfoObject);
} catch (Exception e) {

@ -3,9 +3,12 @@ package com.bweb.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSONObject;
import com.bweb.config.SysConst;
import com.bweb.excelListener.ImportCouponListener;
import com.bweb.excelListener.ImportRechargeOrderListener;
import com.bweb.model.ExportOutRechargeOrder;
import com.bweb.model.ExportOutRechargeOrderCount;
import com.bweb.model.ExportOutRechargeUserOrderCount;
import com.bweb.model.ImportCouponModel;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
@ -13,10 +16,12 @@ import com.hai.common.exception.ErrorHelp;
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.SessionObject;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.common.utils.WxUtils;
import com.hai.config.HuiLianTongUnionCardConfig;
import com.hai.config.UnionPayConfig;
import com.hai.entity.HighCoupon;
import com.hai.entity.HighRefundAudit;
import com.hai.entity.OutRechargeOrder;
import com.hai.model.*;
@ -36,6 +41,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -52,7 +58,6 @@ public class OutRechargeOrderController {
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Resource
private GoodsOrderServiceImpl goodsOrderService;
@ -120,6 +125,29 @@ public class OutRechargeOrderController {
}
}
@RequestMapping(value="/importRechargeOrder",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "导入话费充值订单")
public ResponseData importRechargeOrder( @RequestParam(value = "file" , required = true) MultipartFile files,
HttpServletRequest request) {
try {
ImportRechargeOrderListener importRechargeOrderListener = new ImportRechargeOrderListener();
importRechargeOrderListener.initData(outRechargeOrderService);
EasyExcel.read(files.getInputStream(), ExportOutRechargeOrder.class, importRechargeOrderListener).sheet().doRead();
Map<String, Object> map = new HashMap<>();
map.put("errorData", importRechargeOrderListener.getErrorData());
map.put("errorTotal", importRechargeOrderListener.getErrorData().size());
return ResponseMsgUtil.success(map);
} catch (Exception e) {
log.error("HighCouponController -> importStock() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取订单")
@ -128,6 +156,7 @@ public class OutRechargeOrderController {
@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "rechargeModel", required = false) String rechargeModel,
@RequestParam(name = "rechargeContent", required = false) String rechargeContent,
@RequestParam(name = "rechargeType", required = false) String rechargeType,
@RequestParam(name = "userPhone", required = false) String userPhone,
@RequestParam(name = "idCard", required = false) String idCard,
@RequestParam(name = "payType", required = false) Integer payType,
@ -154,6 +183,9 @@ public class OutRechargeOrderController {
if (StringUtils.isNotBlank(rechargeContent)) {
map.put("rechargeContent", rechargeContent);
}
if (StringUtils.isNotBlank(rechargeType)) {
map.put("rechargeType", rechargeType);
}
if (StringUtils.isNotBlank(userPhone)) {
map.put("userPhone", userPhone);
@ -206,6 +238,7 @@ public class OutRechargeOrderController {
@RequestParam(name = "rechargeContent", required = false) String rechargeContent,
@RequestParam(name = "userPhone", required = false) String userPhone,
@RequestParam(name = "idCard", required = false) String idCard,
@RequestParam(name = "rechargeType", required = false) String rechargeType,
@RequestParam(name = "payType", required = false) Integer payType,
@RequestParam(name = "code", required = false) Integer code,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@ -223,6 +256,7 @@ public class OutRechargeOrderController {
map.put("idCard", idCard);
map.put("payType", payType);
map.put("code", code);
map.put("rechargeType", rechargeType);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);

@ -46,6 +46,7 @@ public class OutRechargePriceController {
public ResponseData getListOutRechargePrice(
@RequestParam(value = "type", required = false) Integer type ,
@RequestParam(value = "showType", required = false) Integer showType ,
@RequestParam(value = "rechargeType", required = false) Integer rechargeType ,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request
) {
@ -64,6 +65,10 @@ public class OutRechargePriceController {
map.put("showType", String.valueOf(showType));
}
if (rechargeType != null ) {
map.put("rechargeType", String.valueOf(rechargeType));
}
map.put("companyId" , String.valueOf(userInfoModel.getBsCompany().getId()));
PageHelper.startPage(pageNum, pageSize);
@ -90,6 +95,7 @@ public class OutRechargePriceController {
|| outRechargePrice.getPrice() == null
|| outRechargePrice.getRealPrice() == null
|| outRechargePrice.getShowType() == null
|| outRechargePrice.getRechargeType() == null
|| outRechargePrice.getSort() == null
) {
log.error("SecOrganizationController -> insertPrice() error!");
@ -120,6 +126,7 @@ public class OutRechargePriceController {
|| outRechargePrice.getId() == null
|| outRechargePrice.getPrice() == null
|| outRechargePrice.getRealPrice() == null
|| outRechargePrice.getRechargeType() == null
|| outRechargePrice.getShowType() == null
|| outRechargePrice.getSort() == null
) {

@ -0,0 +1,91 @@
package com.bweb.excelListener;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.bweb.model.ExportOutRechargeOrder;
import com.bweb.model.ImportCouponModel;
import com.hai.common.utils.DateUtil;
import com.hai.entity.OutRechargeOrder;
import com.hai.service.OutRechargeOrderService;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
public class ImportRechargeOrderListener extends AnalysisEventListener<ExportOutRechargeOrder> {
List<ExportOutRechargeOrder> errorData = new ArrayList<>();
List<OutRechargeOrder> successData = new ArrayList<>();
private OutRechargeOrderService outRechargeOrderService;
/**
* @Author Sum1Dream
* @name invoke.java
* @Description // 解析到的每一条数据都会调用此方法
* @Date 4:03 下午 2022/1/24
* @Param [com.bweb.model.ExportOutRechargeOrder, com.alibaba.excel.context.AnalysisContext]
* @return void
*/
@Override
public void invoke(ExportOutRechargeOrder data, AnalysisContext context) {
if (StringUtils.isBlank(data.getOrderNo())
|| StringUtils.isBlank(data.getStatusName()) ) {
data.setErrorMessage("有必填项未填写");
errorData.add(data);
return;
}
OutRechargeOrder rechargeOrder = outRechargeOrderService.findByOrderNo(data.getOrderNo());
if (rechargeOrder.getStatus() != 2) {
data.setErrorMessage("当前订单状态错误。");
errorData.add(data);
return;
}
if (rechargeOrder.getRechargeType() != 2) {
data.setErrorMessage("当前话费订单充值类型为快充。");
errorData.add(data);
return;
}
if (Objects.equals(data.getStatusName(), "已完成")) {
outRechargeOrderService.finishOrder(rechargeOrder.getId());
} else if (Objects.equals(data.getStatusName(), "失败")){
try {
outRechargeOrderService.rechargeOrderToRefund(rechargeOrder.getId());
} catch (Exception exception) {
data.setErrorMessage("退款失败。");
errorData.add(data);
return;
}
}
successData.add(rechargeOrder);
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
if (successData.size() > 0) {
try {
// outRechargeOrderService.updateOrderList(successData);
} catch (Exception e) {
e.printStackTrace();
}
}
this.successData.clear();
}
public List<ExportOutRechargeOrder> getErrorData() {
return errorData;
}
public void initData(OutRechargeOrderService outRechargeOrderService) {
this.outRechargeOrderService = outRechargeOrderService;
}
}

@ -37,6 +37,9 @@ public class ExportOutRechargeOrder {
@ExcelProperty("应付金额")
private BigDecimal payPrice;
@ExcelProperty("充值方式")
private String rechargeTypeName;
@ExcelProperty("实付金额")
private BigDecimal payRealPrice;
@ -67,6 +70,9 @@ public class ExportOutRechargeOrder {
@ExcelProperty("第三方退款订单号")
private String refundId;
// 错误消息
private String errorMessage;
public String getOrderNo() {
return orderNo;
}
@ -226,4 +232,21 @@ public class ExportOutRechargeOrder {
public void setCardNo(String cardNo) {
this.cardNo = cardNo;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public String getRechargeTypeName() {
return rechargeTypeName;
}
public void setRechargeTypeName(String rechargeTypeName) {
this.rechargeTypeName = rechargeTypeName;
}
}

@ -9,9 +9,9 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: root
password: HF123456.
url: jdbc:mysql://192.168.0.63:21100/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: hsg
password: HUfukeji123456!@#
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat

@ -116,22 +116,21 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/highUser/delCacheParam")
.excludePathPatterns("/order/orderToH5Pay")
.excludePathPatterns("/order/orderToPay")
.excludePathPatterns("/test/*")
.excludePathPatterns("/cmsContent/*")
.excludePathPatterns("/highGas/*")
.excludePathPatterns("/outRechargeOrder/*")
.excludePathPatterns("/wechat/*")
.excludePathPatterns("/tuanyou/*")
.excludePathPatterns("/unionPay/*")
.excludePathPatterns("/highGas/*")
.excludePathPatterns("/common/*")
.excludePathPatterns("/order/qzOrderToPay")
.excludePathPatterns("/czOrder/orderRefundNotify")
.excludePathPatterns("/cmsContent/*")
.excludePathPatterns("/highBrand/*")
.excludePathPatterns("/highGoodsType/*")
.excludePathPatterns("/sendSms/*")
.excludePathPatterns("/sms/*")
.excludePathPatterns("/czOrder/*")
.excludePathPatterns("/outRechargeOrder/*")
;
}

File diff suppressed because one or more lines are too long

@ -69,7 +69,7 @@ public class OutRechargeOrderController {
private HighOrderService highOrderService;
@Resource
private TelApiService telApiService;
private OutRechargePriceService outRechargePriceService;
@Resource
private WechatPayUtil wechatPayUtil;
@ -124,14 +124,6 @@ public class OutRechargeOrderController {
// 判断充值模式:1 电信 2. 移动 3. 联通
// 拼接内容
remarks = outRechargeOrder.getRechargeContent() + "充值" + outRechargeOrder.getOrderPrice() + "元";
// JSONObject telObject = telApiService.outApiTel(outRechargeOrder.getRechargeContent());
// if (telObject.get("status").equals(0)) {
// JSONObject o = telObject.getObject("result",JSONObject.class);
//
// } else {
// log.error("orderToPay error!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.PHONE_NUM_IS_ERROR);
// }
HighDiscountUserRel highDiscountUserRel = null;
if (outRechargeOrder.getMemDiscountId() != null) {
@ -195,6 +187,8 @@ public class OutRechargeOrderController {
}
}
OutRechargePrice outRechargePrice = outRechargePriceService.findById(outRechargeOrder.getObjectId().longValue());
HighUserCard highUserCard = highUserCardService.getUserHtlCardNo(userInfoModel.getHighUser().getId());
if (highUserCard != null) {
outRechargeOrder.setIdCard(highUserCard.getCardNo());
@ -204,6 +198,7 @@ public class OutRechargeOrderController {
outRechargeOrder.setOrderNo("CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5));
outRechargeOrder.setUserId(userInfoModel.getHighUser().getId());
outRechargeOrder.setUserName(userInfoModel.getHighUser().getName());
outRechargeOrder.setRechargeType(outRechargePrice.getRechargeType());
outRechargeOrder.setUserPhone(userInfoModel.getHighUser().getPhone());
outRechargeOrder.setCreateTimed(new Date());
@ -479,7 +474,19 @@ public class OutRechargeOrderController {
outRechargeOrderService.goldPayOrder(userInfoModel.getHighUser().getId(), order.getId());
return ResponseMsgUtil.success("支付成功");
if (order.getRechargeType() != null && order.getRechargeType() == 1) {
JSONObject object = outRechargeOrderService.getMobile(order.getRechargeContent() , order.getOrderPrice().intValue() , order.getOrderNo());
if (object.getInteger("code") != 200) {
order.setRechargeStatus(1);
order.setStatus(2);
order.setPayType(3);
order.setPayTime(new Date()); // 支付时间
order.setAbnormalMsg(object.getString("message"));
outRechargeOrderService.updateOrder(order);
}
}
return ResponseMsgUtil.success("充值成功");
} catch (Exception e) {
log.error("orderToPay error!", e);
return ResponseMsgUtil.exception(e);
@ -528,57 +535,57 @@ public class OutRechargeOrderController {
}
@RequestMapping(value = "/orderToRefund", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "订单退款")
public ResponseData orderToRefund(@RequestParam(name = "orderId", required = false) Long orderId,
HttpServletRequest request) {
try {
OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId);
if (order == null) {
log.error("orderToPay error!", "未找到充值订单");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到充值订单");
}
// 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款
if (order.getStatus() != 2) {
log.error("orderToPay error!", "无法退款,订单不处于已支付状态");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法退款,订单不处于已支付状态");
}
Map<String,String> param = new HashMap<>();
param.put("appid", "wx637bd6f7314daa46");
param.put("mch_id", "1289663601");
param.put("sub_mch_id" , "1609882817");
param.put("nonce_str", WxUtils.makeNonStr());
param.put("transaction_id", order.getPaySerialNo());
param.put("out_refund_no", "HFR"+new Date().getTime());
param.put("total_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
param.put("refund_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
param.put("sign_type", "HMAC-SHA256");
String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
param.put("sign", signStr);
String resultXmL = doRefundRequest(param.get("mch_id"), null, WxUtils.mapToXml(param));
OrderRefundModel orderRefundModel = XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class);
if(orderRefundModel.getResult_code().equals("SUCCESS")) {
order.setStatus(5);
order.setRefundTime(new Date());
order.setOutRefundNo(orderRefundModel.getOut_refund_no());
order.setRefundId(orderRefundModel.getRefund_id());
order.setRefundFee(new BigDecimal(orderRefundModel.getRefund_fee()).divide(new BigDecimal("100")));
outRechargeOrderService.updateOrder(order);
return ResponseMsgUtil.success("退款成功");
}
return ResponseMsgUtil.success("退款失败!错误代码:"+orderRefundModel.getErr_code()+",错误描述"+orderRefundModel.getErr_code_des());
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
// @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET)
// @ResponseBody
// @ApiOperation(value = "订单退款")
// public ResponseData orderToRefund(@RequestParam(name = "orderId", required = false) Long orderId,
// HttpServletRequest request) {
// try {
//
// OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId);
// if (order == null) {
// log.error("orderToPay error!", "未找到充值订单");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到充值订单");
// }
//
// // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款
// if (order.getStatus() != 2) {
// log.error("orderToPay error!", "无法退款,订单不处于已支付状态");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法退款,订单不处于已支付状态");
// }
//
// Map<String,String> param = new HashMap<>();
// param.put("appid", "wx637bd6f7314daa46");
// param.put("mch_id", "1289663601");
// param.put("sub_mch_id" , "1609882817");
// param.put("nonce_str", WxUtils.makeNonStr());
// param.put("transaction_id", order.getPaySerialNo());
// param.put("out_refund_no", "HFR"+new Date().getTime());
// param.put("total_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
// param.put("refund_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
// param.put("sign_type", "HMAC-SHA256");
//
// String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
// param.put("sign", signStr);
//
// String resultXmL = doRefundRequest(param.get("mch_id"), null, WxUtils.mapToXml(param));
// OrderRefundModel orderRefundModel = XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class);
// if(orderRefundModel.getResult_code().equals("SUCCESS")) {
// order.setStatus(5);
// order.setRefundTime(new Date());
// order.setOutRefundNo(orderRefundModel.getOut_refund_no());
// order.setRefundId(orderRefundModel.getRefund_id());
// order.setRefundFee(new BigDecimal(orderRefundModel.getRefund_fee()).divide(new BigDecimal("100")));
// outRechargeOrderService.updateOrder(order);
// return ResponseMsgUtil.success("退款成功");
// }
// return ResponseMsgUtil.success("退款失败!错误代码:"+orderRefundModel.getErr_code()+",错误描述"+orderRefundModel.getErr_code_des());
//
// } catch (Exception e) {
// log.error("HighOrderController --> getUserOrderList() error!", e);
// return ResponseMsgUtil.exception(e);
// }
// }
@RequestMapping(value = "/wxProfitsharing", method = RequestMethod.GET)

@ -36,7 +36,7 @@ import java.util.List;
import java.util.Map;
@Controller
@RequestMapping(value = "/outRechargePrice")
@RequestMapping(value = "/outRechargePrice")
@Api(value = "查询充值金额接口")
public class OutRechargePriceController {
@ -60,7 +60,8 @@ public class OutRechargePriceController {
public ResponseData getListOutRechargePrice(
@RequestParam(value = "type", required = false) Integer type,
@RequestParam(name = "regionId", required = true) String regionId,
@RequestParam(name = "showType", required = true) Integer showType
@RequestParam(name = "showType", required = true) Integer showType,
@RequestParam(name = "rechargeType", required = false) Integer rechargeType
) {
try {
Map<String, String> map = new HashMap<>();
@ -71,10 +72,14 @@ public class OutRechargePriceController {
map.put("companyId", String.valueOf(bsCompany.getId()));
}
if (type != null ) {
if (showType != null ) {
map.put("showType", String.valueOf(showType));
}
if (rechargeType != null ) {
map.put("rechargeType", String.valueOf(rechargeType));
}
if (type != null ) {
map.put("type", String.valueOf(type));
}

@ -158,6 +158,31 @@ public class WechatController {
}
}
@RequestMapping(value = "/loginByTel", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "小程序根据手机号登录或注册")
public ResponseData loginByPhone(@RequestParam(value = "loginByTel", required = true) String loginByTel,
HttpServletRequest request, HttpServletResponse response) {
try {
// 根据手机号查询用户
HighUser user = highUserService.findByPhone(loginByTel);
// 定义个人所有数据
HighUserModel highUserModel = new HighUserModel();
HighUser detailData = highUserService.getDetailDataByUser(user.getId());
detailData.setPassword(null);
highUserModel.setHighUser(detailData);
SessionObject so = new SessionObject(user.getPhone(), 1 , highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getUserInfo", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "小程序获取用户信息")

@ -1,30 +1,51 @@
package com.cweb.controller.pay;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
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.ResponseMsgUtil;
import com.hai.common.utils.WxUtils;
import com.hai.config.CommonSysConst;
import com.hai.config.HuiLianTongUnionCardConfig;
import com.hai.config.UnionPayConfig;
import com.hai.config.WxOrderConfig;
import com.hai.dao.HighGasOrderRefundMapper;
import com.hai.entity.HighGasOrderRefund;
import com.hai.entity.HighOrder;
import com.hai.entity.HighRefundAudit;
import com.hai.entity.OutRechargeOrder;
import com.hai.model.OrderRefundModel;
import com.hai.model.ResponseData;
import com.hai.service.HighRefundAuditService;
import com.hai.service.HighUserService;
import com.hai.service.OutRechargeOrderService;
import com.hai.service.pay.impl.GoodsOrderServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Controller
@RequestMapping(value = "/czOrder")
@ -39,46 +60,172 @@ public class CzOrderController {
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Resource
private GoodsOrderServiceImpl goodsOrderService;
@Resource
private HighUserService highUserService;
@RequestMapping(value = "/orderRefundNotify", method = RequestMethod.POST)
@ApiOperation(value = "退款回调")
@RequestMapping(value = "/rechargeCallback", method = RequestMethod.POST)
@ApiOperation(value = "话费充值回调")
@ResponseBody
public void orderRefundNotify(@RequestBody String reqBodyStr, HttpServletRequest request, HttpServletResponse response) {
public void rechargeCallback(@RequestBody String reqBodyStr, HttpServletRequest request, HttpServletResponse response) {
try {
JSONObject dataObject = JSONObject.parseObject(reqBodyStr, JSONObject.class);
String dataStr = AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(dataObject.getString("data")), CommonSysConst.getSysConfig().getTuanYouAppSecret());
JSONObject object = JSONObject.parseObject(dataStr);
HighGasOrderRefund highGasOrderRefund = new HighGasOrderRefund();
highGasOrderRefund.setCreateTime(new Date());
highGasOrderRefund.setReturnContent(String.valueOf(object));
highGasOrderRefund.setReturnContent(String.valueOf(dataObject));
highGasOrderRefundMapper.insert(highGasOrderRefund);
// 查询订单
OutRechargeOrder order = outRechargeOrderService.findByOrderNo(object.getString("orderNumber"));
OutRechargeOrder order = outRechargeOrderService.findByOrderNo(dataObject.getString("out_order_id"));
// 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 6.充值失败
if (order != null && order.getStatus() == 5) {
// 订单状态 : 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 6:退款中
if (order != null && order.getStatus() == 2) {
// 退单结果 true:成功 false:失败
if (object.getInteger("rechargeState") == 1 && order != null) {
order.setStatus(3);
outRechargeOrderService.updateOrder(order);
} else if (object.getInteger("rechargeState") == 0 && order != null) {
order.setStatus(6);
if (dataObject.getInteger("status") == 3) {
order.setStatus(3);
outRechargeOrderService.updateOrder(order);
} else if (dataObject.getInteger("status") == 4) {
orderToRefund(order.getId());
}
}
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=utf-8");
PrintWriter writer= response.getWriter();
writer.write("success");
writer.write("SUCCESS");
} catch (Exception e) {
log.error("WechatPayController --> wechatNotify() error!", e);
}
}
public Boolean orderToRefund(Long orderId) {
try {
OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId);
// 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 6:退款中
if (order.getStatus() != 2) {
log.error("orderToPay error!", "无法退款,订单状态错误!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法退款,订单不处于已支付状态");
}
// 微信退款
if (order.getPayType() == 1) {
Map<String,String> param = new HashMap<>();
param.put("appid", "wx637bd6f7314daa46");
param.put("mch_id", "1289663601");
param.put("sub_mch_id" , "1614670195");
param.put("nonce_str", WxUtils.makeNonStr());
param.put("transaction_id", order.getPaySerialNo());
param.put("out_refund_no", "HFR"+new Date().getTime());
param.put("total_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
param.put("refund_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
param.put("sign_type", "HMAC-SHA256");
String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
param.put("sign", signStr);
String resultXmL = doRefundRequest(param.get("mch_id"), WxUtils.mapToXml(param));
OrderRefundModel orderRefundModel = XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class);
if(orderRefundModel.getResult_code().equals("SUCCESS")) {
order.setStatus(5);
order.setRefundTime(new Date());
order.setOutRefundNo(orderRefundModel.getOut_refund_no());
order.setRefundId(orderRefundModel.getRefund_id());
order.setRefundFee(new BigDecimal(orderRefundModel.getRefund_fee()).divide(new BigDecimal("100")));
outRechargeOrderService.updateOrder(order);
} else {
log.error("orderToPay error!", "退款失败");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!错误代码:"+orderRefundModel.getErr_code()+",错误描述"+orderRefundModel.getErr_code_des());
}
}
// 工会卡退款
if (order.getPayType() == 2) {
JSONObject jsonObject = HuiLianTongUnionCardConfig.refund( "HFR"+new Date().getTime() , order.getOrderNo());
if (jsonObject == null) {
log.error("orderToPay error!", "请求超时");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求超时,请重新点击");
}
JSONObject dataObject = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data"));
if (dataObject.getBoolean("success") || Objects.equals(dataObject.getString("message"), "原交易已撤销,不可再次操作")) {
order.setStatus(5);
order.setRefundTime(new Date());
order.setOutRefundNo("HFR"+new Date().getTime() );
order.setRefundFee(order.getPayRealPrice());
order.setRefundId(dataObject.getString("orderId"));
outRechargeOrderService.updateOrder(order);
} else {
log.error("orderToPay error!", dataObject.getString("message"));
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, dataObject.getString("message"));
}
}
if (order.getPayType() == 3) {
highUserService.goldHandle(order.getUserId(), order.getPayRealPrice().intValue() * 100, 1, 3, order.getId());
}
// 银联退款
if (order.getPayType() == 4) {
// 订单退款
JSONObject refund = UnionPayConfig.zwrefund(order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue());
if (!refund.getString("resultcode").equals("W6")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg"));
}
order.setStatus(5);
order.setRefundTime(new Date());
order.setOutRefundNo(refund.getString("oriwtorderid"));
order.setRefundFee(order.getPayRealPrice());
outRechargeOrderService.updateOrder(order);
}
return true;
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return false;
}
}
public String doRefundRequest(String mchId,String data) throws Exception {
//小程序退款需要调用双向证书的认证
CloseableHttpClient httpClient = goodsOrderService.readCertificate(mchId);
try {
HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/refund"); // 设置响应头信息
httpost.addHeader("Connection", "keep-alive");
httpost.addHeader("Accept", "*/*");
httpost.addHeader("Content-Type", "text/xml");
httpost.addHeader("Host", "api.mch.weixin.qq.com");
httpost.addHeader("X-Requested-With", "XMLHttpRequest");
httpost.addHeader("Cache-Control", "max-age=0");
httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) ");
httpost.setEntity(new StringEntity(data, "UTF-8"));
CloseableHttpResponse response = httpClient.execute(httpost);
try {
HttpEntity entity = response.getEntity();
String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8");
EntityUtils.consume(entity);
return jsonStr;
} finally {
response.close();
}
} catch (Exception e){
throw new RuntimeException(e);
} finally {
httpClient.close();
}
}
}

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst;
import com.hai.config.HuiLianTongConfig;
import com.hai.config.TuanYouConfig;
@ -386,9 +387,17 @@ public class UnionPayController {
order.setPaySerialNo(body.getString("wtorderid")); // 支付流水号
order.setPayRealPrice(order.getPayPrice()); // 实付金额
order.setStatus(2);
order.setPayType(4);
order.setPayTime(new Date()); // 支付时间
if (order.getRechargeType() != null && order.getRechargeType() == 1) {
JSONObject object = outRechargeOrderService.getMobile(order.getRechargeContent() , order.getOrderPrice().intValue() , order.getOrderNo());
if (object.getInteger("code") != 200) {
order.setRechargeStatus(1);
order.setAbnormalMsg(object.getString("message"));
}
}
outRechargeOrderService.updateOrder(order);
}
}

@ -9,9 +9,9 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: root
password: HF123456.
url: jdbc:mysql://192.168.0.63:21100/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: hsg
password: HUfukeji123456!@#
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat

@ -9,9 +9,9 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: root
password: HF123456.
url: jdbc:mysql://192.168.0.63:21100/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: hsg
password: HUfukeji123456!@#
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat

@ -46,7 +46,7 @@ public class test {
@Test
public void test(){
List<HighDiscountAgentCode> codeList = highDiscountAgentCodeService.getDiscountCodeByDiscountAgentId(55L);
/* List<HighDiscountAgentCode> codeList = highDiscountAgentCodeService.getDiscountCodeByDiscountAgentId(55L);
List<HighUser> userList = highUserService.getUserList();
@ -55,7 +55,7 @@ public class test {
// 领取优惠券
highDiscountUserRelService.receiveDiscount(user.getId(), codeList.get(num).getId());
num++;
}
}*/
}

@ -9,9 +9,9 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: root
password: HF123456.
url: jdbc:mysql://192.168.0.63:21100/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: hsg
password: HUfukeji123456!@#
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat

@ -249,6 +249,33 @@ public class WxUtils {
}
public static String generateSignatureAppSecret(final Map<String, Object> data, String key, WXPayConstants.SignType signType) throws Exception {
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN)) {
continue;
}
if (StringUtils.isBlank(sb.toString())) {
sb.append(k).append("=").append(data.get(k));
} else {
sb.append("&").append(k).append("=").append(data.get(k));
}
}
sb.append("&app_secret=").append(key);
if (WXPayConstants.SignType.MD5.equals(signType)) {
return MD5(sb.toString() , false);
}
else if (WXPayConstants.SignType.HMACSHA256.equals(signType)) {
return HMACSHA256(sb.toString(), key);
}
else {
throw new Exception(String.format("Invalid sign_type: %s", signType));
}
}
public static String generateSignature(final Map<String, Object> data) throws Exception {
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);

@ -58,6 +58,11 @@ public class CommonSysConfig {
private String telUrl;
private String czOrderNotify;
private String CzNotifyUrl;
private String CzAppKey;
private String CzUrl;
private String CzAppSecret;
public String getTuanYouUrl() {
return tuanYouUrl;
}
@ -369,4 +374,36 @@ public class CommonSysConfig {
public void setHltMembershipLevelSignCode(String hltMembershipLevelSignCode) {
HltMembershipLevelSignCode = hltMembershipLevelSignCode;
}
public String getCzNotifyUrl() {
return CzNotifyUrl;
}
public void setCzNotifyUrl(String czNotifyUrl) {
CzNotifyUrl = czNotifyUrl;
}
public String getCzAppKey() {
return CzAppKey;
}
public void setCzAppKey(String czAppKey) {
CzAppKey = czAppKey;
}
public String getCzUrl() {
return CzUrl;
}
public void setCzUrl(String czUrl) {
CzUrl = czUrl;
}
public String getCzAppSecret() {
return CzAppSecret;
}
public void setCzAppSecret(String czAppSecret) {
CzAppSecret = czAppSecret;
}
}

@ -119,7 +119,7 @@ public class HuiLianTongUnionCardConfig {
* @Param [java.lang.String]
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject TCheckEMsgUnionCardVipRights(String phone) {
public static JSONObject checkEMsgUnionCardVipRights(String phone) {
try {
Map<String , String> map = new HashMap<>();
map.put("phone" , phone);

@ -56,6 +56,15 @@ public class UnionStagingPayConfig {
return responseParam;
}
/**
* 订单查询接口
* @param orgTrace 订单号
* @param oriOrgTrace 原机构交易流水号
* @param prodCode 产品代码
* @param oriBizDate 原交易日期
* @return
* @throws Exception
*/
public static JSONObject query(String orgTrace, String oriOrgTrace,String prodCode,Date oriBizDate) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("orgId", CommonSysConst.getSysConfig().getUnionStagingPayOrgId());
@ -75,6 +84,15 @@ public class UnionStagingPayConfig {
return responseParam;
}
/**
* 分期交易查询
* @param orgTrace 交易流水
* @param oriOrgTrace 原机构交易流水号
* @param prodCode 产品代码
* @param oriBizDate 原交易日期
* @return
* @throws Exception
*/
public static JSONObject queryStaging(String orgTrace, String oriOrgTrace, String prodCode,Date oriBizDate) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("orgId", CommonSysConst.getSysConfig().getUnionStagingPayOrgId());
@ -94,7 +112,17 @@ public class UnionStagingPayConfig {
return responseParam;
}
public static JSONObject mposrefund(String orgTrace, String oriOrgTrace, BigDecimal transAmt,String prodCode,Date oriBizDate) throws Exception {
/**
* 交易退款
* @param orgTrace
* @param oriOrgTrace
* @param transAmt
* @param prodCode
* @param oriBizDate
* @return
* @throws Exception
*/
public static JSONObject standardRefund(String orgTrace, String oriOrgTrace, BigDecimal transAmt,String prodCode,Date oriBizDate) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("orgId", CommonSysConst.getSysConfig().getUnionStagingPayOrgId());
paramMap.put("orgMerCode", CommonSysConst.getSysConfig().getUnionStagingPayOrgMerCode());
@ -110,10 +138,19 @@ public class UnionStagingPayConfig {
paramMap.put("bizData", bizDataMap);
paramMap.put("sign", generateSign(bizDataMap));
JSONObject responseParam = HttpsUtils.doPost(CommonSysConst.getSysConfig().getUnionStagingPayUrl()+"ledger/mposrefund", paramMap, new HashMap<>());
JSONObject responseParam = HttpsUtils.doPost(CommonSysConst.getSysConfig().getUnionStagingPayUrl()+"cashier/trade/standardRefund", paramMap, new HashMap<>());
return responseParam;
}
/**
* 退货查询
* @param orgTrace 交易流水
* @param oriOrgTrace 原机构交易流水号
* @param prodCode 产品代码
* @param oriBizDate 原交易日期
* @return
* @throws Exception
*/
public static JSONObject mposfindrefund(String orgTrace, String oriOrgTrace,String prodCode,Date oriBizDate) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("orgId", CommonSysConst.getSysConfig().getUnionStagingPayOrgId());
@ -127,7 +164,7 @@ public class UnionStagingPayConfig {
bizDataMap.put("oriOrgTrace", oriOrgTrace);
paramMap.put("bizData", bizDataMap);
paramMap.put("sign", generateSign(bizDataMap));
JSONObject responseParam = HttpsUtils.doPost(CommonSysConst.getSysConfig().getUnionStagingPayUrl()+"ledger/mposfindrefund", paramMap, new HashMap<>());
JSONObject responseParam = HttpsUtils.doPost("https://t-wapi.bhecard.com:6111/ledger/mposfindrefund", paramMap, new HashMap<>());
return responseParam;
}
@ -178,4 +215,5 @@ public class UnionStagingPayConfig {
}
return signStr;
}
}

@ -42,13 +42,13 @@ public interface HighDiscountPackageActualMapper extends HighDiscountPackageActu
"insert into high_discount_package_actual (discount_package_id, created_user_id, ",
"created_time, user_id, ",
"allocation_time, child_order_id, ",
"batch, `status`, ext_1, ",
"ext_2, ext_3)",
"`status`, ext_1, ext_2, ",
"ext_3)",
"values (#{discountPackageId,jdbcType=INTEGER}, #{createdUserId,jdbcType=INTEGER}, ",
"#{createdTime,jdbcType=TIMESTAMP}, #{userId,jdbcType=INTEGER}, ",
"#{allocationTime,jdbcType=TIMESTAMP}, #{childOrderId,jdbcType=BIGINT}, ",
"#{batch,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighDiscountPackageActual record);
@ -66,7 +66,6 @@ public interface HighDiscountPackageActualMapper extends HighDiscountPackageActu
@Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
@Result(column="allocation_time", property="allocationTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="batch", property="batch", 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),
@ -77,7 +76,7 @@ public interface HighDiscountPackageActualMapper extends HighDiscountPackageActu
@Select({
"select",
"id, discount_package_id, created_user_id, created_time, user_id, allocation_time, ",
"child_order_id, batch, `status`, ext_1, ext_2, ext_3",
"child_order_id, `status`, ext_1, ext_2, ext_3",
"from high_discount_package_actual",
"where id = #{id,jdbcType=INTEGER}"
})
@ -89,7 +88,6 @@ public interface HighDiscountPackageActualMapper extends HighDiscountPackageActu
@Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
@Result(column="allocation_time", property="allocationTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="batch", property="batch", 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),
@ -114,7 +112,6 @@ public interface HighDiscountPackageActualMapper extends HighDiscountPackageActu
"user_id = #{userId,jdbcType=INTEGER},",
"allocation_time = #{allocationTime,jdbcType=TIMESTAMP},",
"child_order_id = #{childOrderId,jdbcType=BIGINT},",
"batch = #{batch,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",

@ -52,10 +52,6 @@ public class HighDiscountPackageActualSqlProvider {
sql.VALUES("child_order_id", "#{childOrderId,jdbcType=BIGINT}");
}
if (record.getBatch() != null) {
sql.VALUES("batch", "#{batch,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
@ -88,7 +84,6 @@ public class HighDiscountPackageActualSqlProvider {
sql.SELECT("user_id");
sql.SELECT("allocation_time");
sql.SELECT("child_order_id");
sql.SELECT("batch");
sql.SELECT("`status`");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
@ -138,10 +133,6 @@ public class HighDiscountPackageActualSqlProvider {
sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}");
}
if (record.getBatch() != null) {
sql.SET("batch = #{record.batch,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
@ -173,7 +164,6 @@ public class HighDiscountPackageActualSqlProvider {
sql.SET("user_id = #{record.userId,jdbcType=INTEGER}");
sql.SET("allocation_time = #{record.allocationTime,jdbcType=TIMESTAMP}");
sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}");
sql.SET("batch = #{record.batch,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
@ -212,10 +202,6 @@ public class HighDiscountPackageActualSqlProvider {
sql.SET("child_order_id = #{childOrderId,jdbcType=BIGINT}");
}
if (record.getBatch() != null) {
sql.SET("batch = #{batch,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}

@ -44,31 +44,33 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt {
"user_name, user_phone, ",
"recharge_model, pay_type, ",
"pay_price, order_price, ",
"pay_real_price, pay_serial_no, ",
"deduction_price, `status`, ",
"recharge_content, recharge_name, ",
"recharge_type, pay_real_price, ",
"pay_serial_no, deduction_price, ",
"`status`, recharge_content, ",
"recharge_name, recharge_status, ",
"id_card, create_timed, ",
"pay_time, cancel_time, ",
"finish_time, remarks, ",
"out_refund_no, refund_time, ",
"refund_id, refund_fee, ",
"agent_key, object_id, ",
"Identification_code)",
"Identification_code, abnormal_msg)",
"values (#{orderNo,jdbcType=VARCHAR}, #{memDiscountId,jdbcType=BIGINT}, ",
"#{memDiscountName,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, ",
"#{userName,jdbcType=VARCHAR}, #{userPhone,jdbcType=VARCHAR}, ",
"#{rechargeModel,jdbcType=INTEGER}, #{payType,jdbcType=INTEGER}, ",
"#{payPrice,jdbcType=DECIMAL}, #{orderPrice,jdbcType=DECIMAL}, ",
"#{payRealPrice,jdbcType=DECIMAL}, #{paySerialNo,jdbcType=VARCHAR}, ",
"#{deductionPrice,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
"#{rechargeContent,jdbcType=VARCHAR}, #{rechargeName,jdbcType=VARCHAR}, ",
"#{rechargeType,jdbcType=INTEGER}, #{payRealPrice,jdbcType=DECIMAL}, ",
"#{paySerialNo,jdbcType=VARCHAR}, #{deductionPrice,jdbcType=DECIMAL}, ",
"#{status,jdbcType=INTEGER}, #{rechargeContent,jdbcType=VARCHAR}, ",
"#{rechargeName,jdbcType=VARCHAR}, #{rechargeStatus,jdbcType=INTEGER}, ",
"#{idCard,jdbcType=VARCHAR}, #{createTimed,jdbcType=TIMESTAMP}, ",
"#{payTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ",
"#{finishTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, ",
"#{outRefundNo,jdbcType=VARCHAR}, #{refundTime,jdbcType=TIMESTAMP}, ",
"#{refundId,jdbcType=VARCHAR}, #{refundFee,jdbcType=DECIMAL}, ",
"#{agentKey,jdbcType=VARCHAR}, #{objectId,jdbcType=INTEGER}, ",
"#{identificationCode,jdbcType=BIGINT})"
"#{identificationCode,jdbcType=BIGINT}, #{abnormalMsg,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(OutRechargeOrder record);
@ -90,12 +92,14 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt {
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="order_price", property="orderPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="recharge_type", property="rechargeType", jdbcType=JdbcType.INTEGER),
@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="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_content", property="rechargeContent", jdbcType=JdbcType.VARCHAR),
@Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR),
@Result(column="recharge_status", property="rechargeStatus", jdbcType=JdbcType.INTEGER),
@Result(column="id_card", property="idCard", jdbcType=JdbcType.VARCHAR),
@Result(column="create_timed", property="createTimed", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@ -108,17 +112,19 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt {
@Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL),
@Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.INTEGER),
@Result(column="Identification_code", property="identificationCode", jdbcType=JdbcType.BIGINT)
@Result(column="Identification_code", property="identificationCode", jdbcType=JdbcType.BIGINT),
@Result(column="abnormal_msg", property="abnormalMsg", jdbcType=JdbcType.VARCHAR)
})
List<OutRechargeOrder> selectByExample(OutRechargeOrderExample example);
@Select({
"select",
"id, order_no, mem_discount_id, mem_discount_name, user_id, user_name, user_phone, ",
"recharge_model, pay_type, pay_price, order_price, pay_real_price, pay_serial_no, ",
"deduction_price, `status`, recharge_content, recharge_name, id_card, create_timed, ",
"pay_time, cancel_time, finish_time, remarks, out_refund_no, refund_time, refund_id, ",
"refund_fee, agent_key, object_id, Identification_code",
"recharge_model, pay_type, pay_price, order_price, recharge_type, pay_real_price, ",
"pay_serial_no, deduction_price, `status`, recharge_content, recharge_name, recharge_status, ",
"id_card, create_timed, pay_time, cancel_time, finish_time, remarks, out_refund_no, ",
"refund_time, refund_id, refund_fee, agent_key, object_id, Identification_code, ",
"abnormal_msg",
"from out_recharge_order",
"where id = #{id,jdbcType=BIGINT}"
})
@ -134,12 +140,14 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt {
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="order_price", property="orderPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="recharge_type", property="rechargeType", jdbcType=JdbcType.INTEGER),
@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="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_content", property="rechargeContent", jdbcType=JdbcType.VARCHAR),
@Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR),
@Result(column="recharge_status", property="rechargeStatus", jdbcType=JdbcType.INTEGER),
@Result(column="id_card", property="idCard", jdbcType=JdbcType.VARCHAR),
@Result(column="create_timed", property="createTimed", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@ -152,7 +160,8 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt {
@Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL),
@Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.INTEGER),
@Result(column="Identification_code", property="identificationCode", jdbcType=JdbcType.BIGINT)
@Result(column="Identification_code", property="identificationCode", jdbcType=JdbcType.BIGINT),
@Result(column="abnormal_msg", property="abnormalMsg", jdbcType=JdbcType.VARCHAR)
})
OutRechargeOrder selectByPrimaryKey(Long id);
@ -177,12 +186,14 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt {
"pay_type = #{payType,jdbcType=INTEGER},",
"pay_price = #{payPrice,jdbcType=DECIMAL},",
"order_price = #{orderPrice,jdbcType=DECIMAL},",
"recharge_type = #{rechargeType,jdbcType=INTEGER},",
"pay_real_price = #{payRealPrice,jdbcType=DECIMAL},",
"pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},",
"deduction_price = #{deductionPrice,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",
"recharge_content = #{rechargeContent,jdbcType=VARCHAR},",
"recharge_name = #{rechargeName,jdbcType=VARCHAR},",
"recharge_status = #{rechargeStatus,jdbcType=INTEGER},",
"id_card = #{idCard,jdbcType=VARCHAR},",
"create_timed = #{createTimed,jdbcType=TIMESTAMP},",
"pay_time = #{payTime,jdbcType=TIMESTAMP},",
@ -195,7 +206,8 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt {
"refund_fee = #{refundFee,jdbcType=DECIMAL},",
"agent_key = #{agentKey,jdbcType=VARCHAR},",
"object_id = #{objectId,jdbcType=INTEGER},",
"Identification_code = #{identificationCode,jdbcType=BIGINT}",
"Identification_code = #{identificationCode,jdbcType=BIGINT},",
"abnormal_msg = #{abnormalMsg,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(OutRechargeOrder record);

@ -68,6 +68,7 @@ public interface OutRechargeOrderMapperExt {
" a.user_name userName," +
" a.user_phone userPhone," +
" case a.recharge_model when 1 then '电信话费' when 2 then '移动话费' when 3 then '联通话费' end rechargeModelName," +
" case a.recharge_type when 1 then '快充' when 2 then '慢充' end rechargeTypeName," +
" a.recharge_content rechargeContent," +
" a.remarks remarks," +
" a.id_card cardNo," +
@ -91,6 +92,7 @@ public interface OutRechargeOrderMapperExt {
"<if test='map.payType != null'> and a.`pay_type` = #{map.payType} </if>",
"<if test='map.code != null'> and a.`Identification_code` = #{map.code} </if>",
"<if test='map.orderNo != null'> and a.`order_no` = #{map.orderNo} </if>",
"<if test='map.rechargeType != null'> and a.`recharge_type` = #{map.rechargeType} </if>",
"<if test='map.rechargeModel != null'> and a.`recharge_model` = #{map.rechargeModel} </if>",
"<if test='map.rechargeContent != null'> and a.`recharge_content` LIKE '%${map.rechargeContent}%' </if>",
"<if test='map.idCard != null'> and a.`id_card` LIKE '%${map.idCard}%' </if>",

@ -68,6 +68,10 @@ public class OutRechargeOrderSqlProvider {
sql.VALUES("order_price", "#{orderPrice,jdbcType=DECIMAL}");
}
if (record.getRechargeType() != null) {
sql.VALUES("recharge_type", "#{rechargeType,jdbcType=INTEGER}");
}
if (record.getPayRealPrice() != null) {
sql.VALUES("pay_real_price", "#{payRealPrice,jdbcType=DECIMAL}");
}
@ -92,6 +96,10 @@ public class OutRechargeOrderSqlProvider {
sql.VALUES("recharge_name", "#{rechargeName,jdbcType=VARCHAR}");
}
if (record.getRechargeStatus() != null) {
sql.VALUES("recharge_status", "#{rechargeStatus,jdbcType=INTEGER}");
}
if (record.getIdCard() != null) {
sql.VALUES("id_card", "#{idCard,jdbcType=VARCHAR}");
}
@ -144,6 +152,10 @@ public class OutRechargeOrderSqlProvider {
sql.VALUES("Identification_code", "#{identificationCode,jdbcType=BIGINT}");
}
if (record.getAbnormalMsg() != null) {
sql.VALUES("abnormal_msg", "#{abnormalMsg,jdbcType=VARCHAR}");
}
return sql.toString();
}
@ -164,12 +176,14 @@ public class OutRechargeOrderSqlProvider {
sql.SELECT("pay_type");
sql.SELECT("pay_price");
sql.SELECT("order_price");
sql.SELECT("recharge_type");
sql.SELECT("pay_real_price");
sql.SELECT("pay_serial_no");
sql.SELECT("deduction_price");
sql.SELECT("`status`");
sql.SELECT("recharge_content");
sql.SELECT("recharge_name");
sql.SELECT("recharge_status");
sql.SELECT("id_card");
sql.SELECT("create_timed");
sql.SELECT("pay_time");
@ -183,6 +197,7 @@ public class OutRechargeOrderSqlProvider {
sql.SELECT("agent_key");
sql.SELECT("object_id");
sql.SELECT("Identification_code");
sql.SELECT("abnormal_msg");
sql.FROM("out_recharge_order");
applyWhere(sql, example, false);
@ -244,6 +259,10 @@ public class OutRechargeOrderSqlProvider {
sql.SET("order_price = #{record.orderPrice,jdbcType=DECIMAL}");
}
if (record.getRechargeType() != null) {
sql.SET("recharge_type = #{record.rechargeType,jdbcType=INTEGER}");
}
if (record.getPayRealPrice() != null) {
sql.SET("pay_real_price = #{record.payRealPrice,jdbcType=DECIMAL}");
}
@ -268,6 +287,10 @@ public class OutRechargeOrderSqlProvider {
sql.SET("recharge_name = #{record.rechargeName,jdbcType=VARCHAR}");
}
if (record.getRechargeStatus() != null) {
sql.SET("recharge_status = #{record.rechargeStatus,jdbcType=INTEGER}");
}
if (record.getIdCard() != null) {
sql.SET("id_card = #{record.idCard,jdbcType=VARCHAR}");
}
@ -320,6 +343,10 @@ public class OutRechargeOrderSqlProvider {
sql.SET("Identification_code = #{record.identificationCode,jdbcType=BIGINT}");
}
if (record.getAbnormalMsg() != null) {
sql.SET("abnormal_msg = #{record.abnormalMsg,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
@ -339,12 +366,14 @@ public class OutRechargeOrderSqlProvider {
sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}");
sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}");
sql.SET("order_price = #{record.orderPrice,jdbcType=DECIMAL}");
sql.SET("recharge_type = #{record.rechargeType,jdbcType=INTEGER}");
sql.SET("pay_real_price = #{record.payRealPrice,jdbcType=DECIMAL}");
sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}");
sql.SET("deduction_price = #{record.deductionPrice,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("recharge_content = #{record.rechargeContent,jdbcType=VARCHAR}");
sql.SET("recharge_name = #{record.rechargeName,jdbcType=VARCHAR}");
sql.SET("recharge_status = #{record.rechargeStatus,jdbcType=INTEGER}");
sql.SET("id_card = #{record.idCard,jdbcType=VARCHAR}");
sql.SET("create_timed = #{record.createTimed,jdbcType=TIMESTAMP}");
sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}");
@ -358,6 +387,7 @@ public class OutRechargeOrderSqlProvider {
sql.SET("agent_key = #{record.agentKey,jdbcType=VARCHAR}");
sql.SET("object_id = #{record.objectId,jdbcType=INTEGER}");
sql.SET("Identification_code = #{record.identificationCode,jdbcType=BIGINT}");
sql.SET("abnormal_msg = #{record.abnormalMsg,jdbcType=VARCHAR}");
OutRechargeOrderExample example = (OutRechargeOrderExample) parameter.get("example");
applyWhere(sql, example, true);
@ -408,6 +438,10 @@ public class OutRechargeOrderSqlProvider {
sql.SET("order_price = #{orderPrice,jdbcType=DECIMAL}");
}
if (record.getRechargeType() != null) {
sql.SET("recharge_type = #{rechargeType,jdbcType=INTEGER}");
}
if (record.getPayRealPrice() != null) {
sql.SET("pay_real_price = #{payRealPrice,jdbcType=DECIMAL}");
}
@ -432,6 +466,10 @@ public class OutRechargeOrderSqlProvider {
sql.SET("recharge_name = #{rechargeName,jdbcType=VARCHAR}");
}
if (record.getRechargeStatus() != null) {
sql.SET("recharge_status = #{rechargeStatus,jdbcType=INTEGER}");
}
if (record.getIdCard() != null) {
sql.SET("id_card = #{idCard,jdbcType=VARCHAR}");
}
@ -484,6 +522,10 @@ public class OutRechargeOrderSqlProvider {
sql.SET("Identification_code = #{identificationCode,jdbcType=BIGINT}");
}
if (record.getAbnormalMsg() != null) {
sql.SET("abnormal_msg = #{abnormalMsg,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();

@ -39,16 +39,16 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into out_recharge_price (`type`, show_type, ",
"company_id, price, ",
"real_price, create_time, ",
"goods_id, discount, sort, ",
"`status`)",
"values (#{type,jdbcType=INTEGER}, #{showType,jdbcType=INTEGER}, ",
"#{companyId,jdbcType=BIGINT}, #{price,jdbcType=DECIMAL}, ",
"#{realPrice,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{goodsId,jdbcType=BIGINT}, #{discount,jdbcType=REAL}, #{sort,jdbcType=INTEGER}, ",
"#{status,jdbcType=INTEGER})"
"insert into out_recharge_price (recharge_type, `type`, ",
"show_type, company_id, ",
"price, real_price, ",
"create_time, goods_id, ",
"discount, sort, `status`)",
"values (#{rechargeType,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, ",
"#{showType,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ",
"#{price,jdbcType=DECIMAL}, #{realPrice,jdbcType=DECIMAL}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{goodsId,jdbcType=BIGINT}, ",
"#{discount,jdbcType=REAL}, #{sort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(OutRechargePrice record);
@ -60,6 +60,7 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt {
@SelectProvider(type=OutRechargePriceSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="recharge_type", property="rechargeType", jdbcType=JdbcType.INTEGER),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="show_type", property="showType", jdbcType=JdbcType.INTEGER),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@ -75,13 +76,14 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt {
@Select({
"select",
"id, `type`, show_type, company_id, price, real_price, create_time, goods_id, ",
"discount, sort, `status`",
"id, recharge_type, `type`, show_type, company_id, price, real_price, create_time, ",
"goods_id, discount, sort, `status`",
"from out_recharge_price",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="recharge_type", property="rechargeType", jdbcType=JdbcType.INTEGER),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="show_type", property="showType", jdbcType=JdbcType.INTEGER),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@ -106,7 +108,8 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt {
@Update({
"update out_recharge_price",
"set `type` = #{type,jdbcType=INTEGER},",
"set recharge_type = #{rechargeType,jdbcType=INTEGER},",
"`type` = #{type,jdbcType=INTEGER},",
"show_type = #{showType,jdbcType=INTEGER},",
"company_id = #{companyId,jdbcType=BIGINT},",
"price = #{price,jdbcType=DECIMAL},",

@ -28,6 +28,10 @@ public class OutRechargePriceSqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("out_recharge_price");
if (record.getRechargeType() != null) {
sql.VALUES("recharge_type", "#{rechargeType,jdbcType=INTEGER}");
}
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
@ -78,6 +82,7 @@ public class OutRechargePriceSqlProvider {
} else {
sql.SELECT("id");
}
sql.SELECT("recharge_type");
sql.SELECT("`type`");
sql.SELECT("show_type");
sql.SELECT("company_id");
@ -109,6 +114,10 @@ public class OutRechargePriceSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getRechargeType() != null) {
sql.SET("recharge_type = #{record.rechargeType,jdbcType=INTEGER}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
@ -158,6 +167,7 @@ public class OutRechargePriceSqlProvider {
sql.UPDATE("out_recharge_price");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("recharge_type = #{record.rechargeType,jdbcType=INTEGER}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("show_type = #{record.showType,jdbcType=INTEGER}");
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
@ -178,6 +188,10 @@ public class OutRechargePriceSqlProvider {
SQL sql = new SQL();
sql.UPDATE("out_recharge_price");
if (record.getRechargeType() != null) {
sql.SET("recharge_type = #{rechargeType,jdbcType=INTEGER}");
}
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}

@ -48,11 +48,6 @@ public class HighDiscountPackageActual implements Serializable {
*/
private Long childOrderId;
/**
* 生成批次
*/
private String batch;
/**
* 状态 1: 待分配 2:预分配售卖3:已分配
*/
@ -131,14 +126,6 @@ public class HighDiscountPackageActual implements Serializable {
this.childOrderId = childOrderId;
}
public String getBatch() {
return batch;
}
public void setBatch(String batch) {
this.batch = batch;
}
public Integer getStatus() {
return status;
}
@ -190,7 +177,6 @@ public class HighDiscountPackageActual implements Serializable {
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getAllocationTime() == null ? other.getAllocationTime() == null : this.getAllocationTime().equals(other.getAllocationTime()))
&& (this.getChildOrderId() == null ? other.getChildOrderId() == null : this.getChildOrderId().equals(other.getChildOrderId()))
&& (this.getBatch() == null ? other.getBatch() == null : this.getBatch().equals(other.getBatch()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
@ -208,7 +194,6 @@ public class HighDiscountPackageActual implements Serializable {
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getAllocationTime() == null) ? 0 : getAllocationTime().hashCode());
result = prime * result + ((getChildOrderId() == null) ? 0 : getChildOrderId().hashCode());
result = prime * result + ((getBatch() == null) ? 0 : getBatch().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
@ -229,7 +214,6 @@ public class HighDiscountPackageActual implements Serializable {
sb.append(", userId=").append(userId);
sb.append(", allocationTime=").append(allocationTime);
sb.append(", childOrderId=").append(childOrderId);
sb.append(", batch=").append(batch);
sb.append(", status=").append(status);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);

@ -545,76 +545,6 @@ public class HighDiscountPackageActualExample {
return (Criteria) this;
}
public Criteria andBatchIsNull() {
addCriterion("batch is null");
return (Criteria) this;
}
public Criteria andBatchIsNotNull() {
addCriterion("batch is not null");
return (Criteria) this;
}
public Criteria andBatchEqualTo(String value) {
addCriterion("batch =", value, "batch");
return (Criteria) this;
}
public Criteria andBatchNotEqualTo(String value) {
addCriterion("batch <>", value, "batch");
return (Criteria) this;
}
public Criteria andBatchGreaterThan(String value) {
addCriterion("batch >", value, "batch");
return (Criteria) this;
}
public Criteria andBatchGreaterThanOrEqualTo(String value) {
addCriterion("batch >=", value, "batch");
return (Criteria) this;
}
public Criteria andBatchLessThan(String value) {
addCriterion("batch <", value, "batch");
return (Criteria) this;
}
public Criteria andBatchLessThanOrEqualTo(String value) {
addCriterion("batch <=", value, "batch");
return (Criteria) this;
}
public Criteria andBatchLike(String value) {
addCriterion("batch like", value, "batch");
return (Criteria) this;
}
public Criteria andBatchNotLike(String value) {
addCriterion("batch not like", value, "batch");
return (Criteria) this;
}
public Criteria andBatchIn(List<String> values) {
addCriterion("batch in", values, "batch");
return (Criteria) this;
}
public Criteria andBatchNotIn(List<String> values) {
addCriterion("batch not in", values, "batch");
return (Criteria) this;
}
public Criteria andBatchBetween(String value1, String value2) {
addCriterion("batch between", value1, value2, "batch");
return (Criteria) this;
}
public Criteria andBatchNotBetween(String value1, String value2) {
addCriterion("batch not between", value1, value2, "batch");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;

@ -69,6 +69,11 @@ public class OutRechargeOrder implements Serializable {
*/
private BigDecimal orderPrice;
/**
* 1快充 2慢充
*/
private Integer rechargeType;
/**
* 实际金额
*/
@ -99,6 +104,11 @@ public class OutRechargeOrder implements Serializable {
*/
private String rechargeName;
/**
* 1:充值异常
*/
private Integer rechargeStatus;
/**
* 中石油需要持卡人身份证
*/
@ -158,6 +168,11 @@ public class OutRechargeOrder implements Serializable {
private Long identificationCode;
/**
* 异常信息
*/
private String abnormalMsg;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -248,6 +263,14 @@ public class OutRechargeOrder implements Serializable {
this.orderPrice = orderPrice;
}
public Integer getRechargeType() {
return rechargeType;
}
public void setRechargeType(Integer rechargeType) {
this.rechargeType = rechargeType;
}
public BigDecimal getPayRealPrice() {
return payRealPrice;
}
@ -296,6 +319,14 @@ public class OutRechargeOrder implements Serializable {
this.rechargeName = rechargeName;
}
public Integer getRechargeStatus() {
return rechargeStatus;
}
public void setRechargeStatus(Integer rechargeStatus) {
this.rechargeStatus = rechargeStatus;
}
public String getIdCard() {
return idCard;
}
@ -400,6 +431,14 @@ public class OutRechargeOrder implements Serializable {
this.identificationCode = identificationCode;
}
public String getAbnormalMsg() {
return abnormalMsg;
}
public void setAbnormalMsg(String abnormalMsg) {
this.abnormalMsg = abnormalMsg;
}
@Override
public boolean equals(Object that) {
if (this == that) {
@ -423,12 +462,14 @@ public class OutRechargeOrder implements Serializable {
&& (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals(other.getPayType()))
&& (this.getPayPrice() == null ? other.getPayPrice() == null : this.getPayPrice().equals(other.getPayPrice()))
&& (this.getOrderPrice() == null ? other.getOrderPrice() == null : this.getOrderPrice().equals(other.getOrderPrice()))
&& (this.getRechargeType() == null ? other.getRechargeType() == null : this.getRechargeType().equals(other.getRechargeType()))
&& (this.getPayRealPrice() == null ? other.getPayRealPrice() == null : this.getPayRealPrice().equals(other.getPayRealPrice()))
&& (this.getPaySerialNo() == null ? other.getPaySerialNo() == null : this.getPaySerialNo().equals(other.getPaySerialNo()))
&& (this.getDeductionPrice() == null ? other.getDeductionPrice() == null : this.getDeductionPrice().equals(other.getDeductionPrice()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getRechargeContent() == null ? other.getRechargeContent() == null : this.getRechargeContent().equals(other.getRechargeContent()))
&& (this.getRechargeName() == null ? other.getRechargeName() == null : this.getRechargeName().equals(other.getRechargeName()))
&& (this.getRechargeStatus() == null ? other.getRechargeStatus() == null : this.getRechargeStatus().equals(other.getRechargeStatus()))
&& (this.getIdCard() == null ? other.getIdCard() == null : this.getIdCard().equals(other.getIdCard()))
&& (this.getCreateTimed() == null ? other.getCreateTimed() == null : this.getCreateTimed().equals(other.getCreateTimed()))
&& (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime()))
@ -441,7 +482,8 @@ public class OutRechargeOrder implements Serializable {
&& (this.getRefundFee() == null ? other.getRefundFee() == null : this.getRefundFee().equals(other.getRefundFee()))
&& (this.getAgentKey() == null ? other.getAgentKey() == null : this.getAgentKey().equals(other.getAgentKey()))
&& (this.getObjectId() == null ? other.getObjectId() == null : this.getObjectId().equals(other.getObjectId()))
&& (this.getIdentificationCode() == null ? other.getIdentificationCode() == null : this.getIdentificationCode().equals(other.getIdentificationCode()));
&& (this.getIdentificationCode() == null ? other.getIdentificationCode() == null : this.getIdentificationCode().equals(other.getIdentificationCode()))
&& (this.getAbnormalMsg() == null ? other.getAbnormalMsg() == null : this.getAbnormalMsg().equals(other.getAbnormalMsg()));
}
@Override
@ -459,12 +501,14 @@ public class OutRechargeOrder implements Serializable {
result = prime * result + ((getPayType() == null) ? 0 : getPayType().hashCode());
result = prime * result + ((getPayPrice() == null) ? 0 : getPayPrice().hashCode());
result = prime * result + ((getOrderPrice() == null) ? 0 : getOrderPrice().hashCode());
result = prime * result + ((getRechargeType() == null) ? 0 : getRechargeType().hashCode());
result = prime * result + ((getPayRealPrice() == null) ? 0 : getPayRealPrice().hashCode());
result = prime * result + ((getPaySerialNo() == null) ? 0 : getPaySerialNo().hashCode());
result = prime * result + ((getDeductionPrice() == null) ? 0 : getDeductionPrice().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getRechargeContent() == null) ? 0 : getRechargeContent().hashCode());
result = prime * result + ((getRechargeName() == null) ? 0 : getRechargeName().hashCode());
result = prime * result + ((getRechargeStatus() == null) ? 0 : getRechargeStatus().hashCode());
result = prime * result + ((getIdCard() == null) ? 0 : getIdCard().hashCode());
result = prime * result + ((getCreateTimed() == null) ? 0 : getCreateTimed().hashCode());
result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode());
@ -478,6 +522,7 @@ public class OutRechargeOrder implements Serializable {
result = prime * result + ((getAgentKey() == null) ? 0 : getAgentKey().hashCode());
result = prime * result + ((getObjectId() == null) ? 0 : getObjectId().hashCode());
result = prime * result + ((getIdentificationCode() == null) ? 0 : getIdentificationCode().hashCode());
result = prime * result + ((getAbnormalMsg() == null) ? 0 : getAbnormalMsg().hashCode());
return result;
}
@ -498,12 +543,14 @@ public class OutRechargeOrder implements Serializable {
sb.append(", payType=").append(payType);
sb.append(", payPrice=").append(payPrice);
sb.append(", orderPrice=").append(orderPrice);
sb.append(", rechargeType=").append(rechargeType);
sb.append(", payRealPrice=").append(payRealPrice);
sb.append(", paySerialNo=").append(paySerialNo);
sb.append(", deductionPrice=").append(deductionPrice);
sb.append(", status=").append(status);
sb.append(", rechargeContent=").append(rechargeContent);
sb.append(", rechargeName=").append(rechargeName);
sb.append(", rechargeStatus=").append(rechargeStatus);
sb.append(", idCard=").append(idCard);
sb.append(", createTimed=").append(createTimed);
sb.append(", payTime=").append(payTime);
@ -517,6 +564,7 @@ public class OutRechargeOrder implements Serializable {
sb.append(", agentKey=").append(agentKey);
sb.append(", objectId=").append(objectId);
sb.append(", identificationCode=").append(identificationCode);
sb.append(", abnormalMsg=").append(abnormalMsg);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

@ -826,6 +826,66 @@ public class OutRechargeOrderExample {
return (Criteria) this;
}
public Criteria andRechargeTypeIsNull() {
addCriterion("recharge_type is null");
return (Criteria) this;
}
public Criteria andRechargeTypeIsNotNull() {
addCriterion("recharge_type is not null");
return (Criteria) this;
}
public Criteria andRechargeTypeEqualTo(Integer value) {
addCriterion("recharge_type =", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeNotEqualTo(Integer value) {
addCriterion("recharge_type <>", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeGreaterThan(Integer value) {
addCriterion("recharge_type >", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("recharge_type >=", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeLessThan(Integer value) {
addCriterion("recharge_type <", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeLessThanOrEqualTo(Integer value) {
addCriterion("recharge_type <=", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeIn(List<Integer> values) {
addCriterion("recharge_type in", values, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeNotIn(List<Integer> values) {
addCriterion("recharge_type not in", values, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeBetween(Integer value1, Integer value2) {
addCriterion("recharge_type between", value1, value2, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeNotBetween(Integer value1, Integer value2) {
addCriterion("recharge_type not between", value1, value2, "rechargeType");
return (Criteria) this;
}
public Criteria andPayRealPriceIsNull() {
addCriterion("pay_real_price is null");
return (Criteria) this;
@ -1216,6 +1276,66 @@ public class OutRechargeOrderExample {
return (Criteria) this;
}
public Criteria andRechargeStatusIsNull() {
addCriterion("recharge_status is null");
return (Criteria) this;
}
public Criteria andRechargeStatusIsNotNull() {
addCriterion("recharge_status is not null");
return (Criteria) this;
}
public Criteria andRechargeStatusEqualTo(Integer value) {
addCriterion("recharge_status =", value, "rechargeStatus");
return (Criteria) this;
}
public Criteria andRechargeStatusNotEqualTo(Integer value) {
addCriterion("recharge_status <>", value, "rechargeStatus");
return (Criteria) this;
}
public Criteria andRechargeStatusGreaterThan(Integer value) {
addCriterion("recharge_status >", value, "rechargeStatus");
return (Criteria) this;
}
public Criteria andRechargeStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("recharge_status >=", value, "rechargeStatus");
return (Criteria) this;
}
public Criteria andRechargeStatusLessThan(Integer value) {
addCriterion("recharge_status <", value, "rechargeStatus");
return (Criteria) this;
}
public Criteria andRechargeStatusLessThanOrEqualTo(Integer value) {
addCriterion("recharge_status <=", value, "rechargeStatus");
return (Criteria) this;
}
public Criteria andRechargeStatusIn(List<Integer> values) {
addCriterion("recharge_status in", values, "rechargeStatus");
return (Criteria) this;
}
public Criteria andRechargeStatusNotIn(List<Integer> values) {
addCriterion("recharge_status not in", values, "rechargeStatus");
return (Criteria) this;
}
public Criteria andRechargeStatusBetween(Integer value1, Integer value2) {
addCriterion("recharge_status between", value1, value2, "rechargeStatus");
return (Criteria) this;
}
public Criteria andRechargeStatusNotBetween(Integer value1, Integer value2) {
addCriterion("recharge_status not between", value1, value2, "rechargeStatus");
return (Criteria) this;
}
public Criteria andIdCardIsNull() {
addCriterion("id_card is null");
return (Criteria) this;
@ -2045,6 +2165,76 @@ public class OutRechargeOrderExample {
addCriterion("Identification_code not between", value1, value2, "identificationCode");
return (Criteria) this;
}
public Criteria andAbnormalMsgIsNull() {
addCriterion("abnormal_msg is null");
return (Criteria) this;
}
public Criteria andAbnormalMsgIsNotNull() {
addCriterion("abnormal_msg is not null");
return (Criteria) this;
}
public Criteria andAbnormalMsgEqualTo(String value) {
addCriterion("abnormal_msg =", value, "abnormalMsg");
return (Criteria) this;
}
public Criteria andAbnormalMsgNotEqualTo(String value) {
addCriterion("abnormal_msg <>", value, "abnormalMsg");
return (Criteria) this;
}
public Criteria andAbnormalMsgGreaterThan(String value) {
addCriterion("abnormal_msg >", value, "abnormalMsg");
return (Criteria) this;
}
public Criteria andAbnormalMsgGreaterThanOrEqualTo(String value) {
addCriterion("abnormal_msg >=", value, "abnormalMsg");
return (Criteria) this;
}
public Criteria andAbnormalMsgLessThan(String value) {
addCriterion("abnormal_msg <", value, "abnormalMsg");
return (Criteria) this;
}
public Criteria andAbnormalMsgLessThanOrEqualTo(String value) {
addCriterion("abnormal_msg <=", value, "abnormalMsg");
return (Criteria) this;
}
public Criteria andAbnormalMsgLike(String value) {
addCriterion("abnormal_msg like", value, "abnormalMsg");
return (Criteria) this;
}
public Criteria andAbnormalMsgNotLike(String value) {
addCriterion("abnormal_msg not like", value, "abnormalMsg");
return (Criteria) this;
}
public Criteria andAbnormalMsgIn(List<String> values) {
addCriterion("abnormal_msg in", values, "abnormalMsg");
return (Criteria) this;
}
public Criteria andAbnormalMsgNotIn(List<String> values) {
addCriterion("abnormal_msg not in", values, "abnormalMsg");
return (Criteria) this;
}
public Criteria andAbnormalMsgBetween(String value1, String value2) {
addCriterion("abnormal_msg between", value1, value2, "abnormalMsg");
return (Criteria) this;
}
public Criteria andAbnormalMsgNotBetween(String value1, String value2) {
addCriterion("abnormal_msg not between", value1, value2, "abnormalMsg");
return (Criteria) this;
}
}
/**

@ -19,6 +19,11 @@ public class OutRechargePrice implements Serializable {
*/
private Long id;
/**
* 1.快充 2慢充
*/
private Integer rechargeType;
/**
* 1 电信 2.移动 3.联通
*/
@ -79,6 +84,14 @@ public class OutRechargePrice implements Serializable {
this.id = id;
}
public Integer getRechargeType() {
return rechargeType;
}
public void setRechargeType(Integer rechargeType) {
this.rechargeType = rechargeType;
}
public Integer getType() {
return type;
}
@ -172,6 +185,7 @@ public class OutRechargePrice implements Serializable {
}
OutRechargePrice other = (OutRechargePrice) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getRechargeType() == null ? other.getRechargeType() == null : this.getRechargeType().equals(other.getRechargeType()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getShowType() == null ? other.getShowType() == null : this.getShowType().equals(other.getShowType()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
@ -189,6 +203,7 @@ public class OutRechargePrice implements Serializable {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getRechargeType() == null) ? 0 : getRechargeType().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getShowType() == null) ? 0 : getShowType().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
@ -209,6 +224,7 @@ public class OutRechargePrice implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", rechargeType=").append(rechargeType);
sb.append(", type=").append(type);
sb.append(", showType=").append(showType);
sb.append(", companyId=").append(companyId);

@ -186,6 +186,66 @@ public class OutRechargePriceExample {
return (Criteria) this;
}
public Criteria andRechargeTypeIsNull() {
addCriterion("recharge_type is null");
return (Criteria) this;
}
public Criteria andRechargeTypeIsNotNull() {
addCriterion("recharge_type is not null");
return (Criteria) this;
}
public Criteria andRechargeTypeEqualTo(Integer value) {
addCriterion("recharge_type =", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeNotEqualTo(Integer value) {
addCriterion("recharge_type <>", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeGreaterThan(Integer value) {
addCriterion("recharge_type >", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("recharge_type >=", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeLessThan(Integer value) {
addCriterion("recharge_type <", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeLessThanOrEqualTo(Integer value) {
addCriterion("recharge_type <=", value, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeIn(List<Integer> values) {
addCriterion("recharge_type in", values, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeNotIn(List<Integer> values) {
addCriterion("recharge_type not in", values, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeBetween(Integer value1, Integer value2) {
addCriterion("recharge_type between", value1, value2, "rechargeType");
return (Criteria) this;
}
public Criteria andRechargeTypeNotBetween(Integer value1, Integer value2) {
addCriterion("recharge_type not between", value1, value2, "rechargeType");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;

@ -28,6 +28,7 @@ public class OutRechargeOrderModel extends OutRechargeOrder {
private String outRefundNo;
private String refundId;
private String cardNo;
private String rechargeTypeName;
public String getOrderNo() {
return orderNo;
@ -196,4 +197,12 @@ public class OutRechargeOrderModel extends OutRechargeOrder {
public void setCardNo(String cardNo) {
this.cardNo = cardNo;
}
public String getRechargeTypeName() {
return rechargeTypeName;
}
public void setRechargeTypeName(String rechargeTypeName) {
this.rechargeTypeName = rechargeTypeName;
}
}

@ -40,6 +40,6 @@ public interface HighTestService {
* @Param [java.lang.String]
* @return com.alibaba.fastjson.JSONObject
*/
JSONObject getMobile(String phone) throws Exception;
JSONObject getMobile(String phone , Integer amount , String orderNo) throws Exception;
}

@ -1,5 +1,6 @@
package com.hai.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.OutRechargeOrder;
import com.hai.model.OrderCountModel;
import com.hai.model.OutOrderModel;
@ -7,6 +8,7 @@ import com.hai.model.OutRechargeOrderModel;
import com.hai.model.OutUserOrderModel;
import io.swagger.models.auth.In;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -57,6 +59,8 @@ public interface OutRechargeOrderService {
**/
void updateOrder(OutRechargeOrder outRechargeOrder);
void updateOrderList(List<OutRechargeOrder> rechargeOrders) throws Exception;
/**
* @Author Sum1Dream
* @Description //取消订单 Administrator
@ -120,7 +124,7 @@ public interface OutRechargeOrderService {
* @param userId
* @param orderId
*/
void goldPayOrder(Long userId, Long orderId);
void goldPayOrder(Long userId, Long orderId) throws Exception;
/**
* @Author Sum1Dream
@ -142,5 +146,24 @@ public interface OutRechargeOrderService {
*/
OrderCountModel rechargeOrderByIndex(Integer code);
/**
* @Author Sum1Dream
* @name getMobile.java
* @Description // 请求话费充值
* @Date 5:02 下午 2022/1/17
* @Param [java.lang.String]
* @return com.alibaba.fastjson.JSONObject
*/
JSONObject getMobile(String phone , Integer amount , String orderNo) throws Exception;
/**
* @Author Sum1Dream
* @name orderToRefund.java
* @Description // 话费订单退款
* @Date 4:44 下午 2022/1/24
* @Param [java.lang.Long]
* @return void
*/
void rechargeOrderToRefund(Long orderId) throws Exception;
}

@ -6,10 +6,8 @@ import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.WxUtils;
import com.hai.common.utils.*;
import com.hai.config.CommonSysConst;
import com.hai.dao.HighUserEtcMapper;
import com.hai.entity.HighDiscountAgentCode;
import com.hai.entity.HighUser;
@ -140,22 +138,23 @@ public class HighTestServiceImpl implements HighTestService {
}
@Override
public JSONObject getMobile(String phone) throws Exception {
public JSONObject getMobile(String phone , Integer amount , String orderNo) throws Exception {
String timestamp = String.valueOf(System.currentTimeMillis());
Map<String , Object> map = new HashMap<>();
map.put("mobile" , "18090580471");
map.put("amount" , "0.01");
map.put("out_order_id" , "CZ20220110895732352345");
map.put("app_key" , "kg5n9br7evt4q8lp");
map.put("timestamp" , DateUtil.date2String(new Date(),"yyyyMMddHHmmss"));
map.put("mobile" , phone);
map.put("amount" , amount);
map.put("out_order_id" , orderNo);
map.put("app_key" , CommonSysConst.getSysConfig().getCzAppKey());
map.put("timestamp" , timestamp.substring(0,timestamp.length()-3));
map.put("is_fast" , "1");
map.put("notify_url" , "https://hsgcs.dctpay.com/crest/czOrder/orderRefundNotify");
map.put("notify_url" , CommonSysConst.getSysConfig().getCzNotifyUrl());
StringBuilder signStr = new StringBuilder(WxUtils.generateSignature(map));
String signStr = WxUtils.generateSignatureAppSecret(map, CommonSysConst.getSysConfig().getTelApiSecret() , WXPayConstants.SignType.MD5);
map.put("sign" , WxUtils.MD5(String.valueOf(signStr.append("key=kg5n9br7evt4q8lp")),true));
map.put("sign" , signStr);
JSONObject object = HttpsUtils.doPost("https://hfcs.dmjvip.com/index.php/third/mobile/createOrder" , map);
return object;
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getCzUrl() , map);
}
}

@ -68,7 +68,7 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService {
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
JSONObject consumptionRecord = HuiLianTongUnionCardConfig.TCheckEMsgUnionCardVipRights(phone);
JSONObject consumptionRecord = HuiLianTongUnionCardConfig.checkEMsgUnionCardVipRights(phone);
JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponseMembership(consumptionRecord.getString("data"));

@ -5,23 +5,32 @@ import com.alibaba.fastjson.JSONObject;
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.pay.util.XmlUtil;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.*;
import com.hai.config.CommonSysConfig;
import com.hai.config.CommonSysConst;
import com.hai.config.HuiLianTongUnionCardConfig;
import com.hai.config.UnionPayConfig;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.dao.OutRechargeOrderMapper;
import com.hai.dao.OutRechargeOrderMapperExt;
import com.hai.entity.*;
import com.hai.enum_type.OrderPushType;
import com.hai.model.OrderCountModel;
import com.hai.model.OutOrderModel;
import com.hai.model.OutRechargeOrderModel;
import com.hai.model.OutUserOrderModel;
import com.hai.model.*;
import com.hai.service.HighUserCardService;
import com.hai.service.HighUserService;
import com.hai.service.OutRechargeOrderService;
import com.hai.service.pay.impl.GoodsOrderServiceImpl;
import io.swagger.models.auth.In;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
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.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -50,6 +59,12 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Resource
private HighUserService highUserService;
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Resource
private GoodsOrderServiceImpl goodsOrderService;
@Override
public List<OutRechargeOrder> getListRechargeOrder(Map<String, String> map) {
OutRechargeOrderExample example = new OutRechargeOrderExample();
@ -85,6 +100,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
if (MapUtils.getString(map, "rechargeContent") != null) {
criteria.andRechargeContentLike("%" + MapUtils.getString(map, "rechargeContent") + "%");
}
if (MapUtils.getString(map, "rechargeType") != null) {
criteria.andRechargeTypeEqualTo(MapUtils.getInteger(map, "rechargeType"));
}
if (MapUtils.getString(map, "phone") != null) {
criteria.andUserPhoneEqualTo(MapUtils.getString(map, "phone"));
@ -133,6 +151,19 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
outRechargeOrderMapper.updateByPrimaryKey(outRechargeOrder);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void updateOrderList(List<OutRechargeOrder> rechargeOrders) throws Exception {
for (OutRechargeOrder list:rechargeOrders) {
if (list.getStatus() == 3) {
outRechargeOrderMapper.updateByPrimaryKey(list);
} else if (list.getStatus() == 6) {
rechargeOrderToRefund(list.getId());
}
}
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void cancelOrder(Long orderId) {
@ -312,6 +343,13 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
order.setPaySerialNo(consumptionResult.getString("orderId")); // 支付流水号
order.setPayRealPrice(order.getPayPrice()); // 实付金额
if (order.getRechargeType() != null && order.getRechargeType() == 1) {
JSONObject object = outRechargeOrderService.getMobile(order.getRechargeContent() , order.getOrderPrice().intValue() , order.getOrderNo());
if (object.getInteger("code") != 200) {
order.setRechargeStatus(1);
order.setAbnormalMsg(object.getString("message"));
}
}
order.setStatus(2);
order.setPayType(2);
order.setPayTime(new Date()); // 支付时间
@ -320,7 +358,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void goldPayOrder(Long userId, Long orderId) {
public void goldPayOrder(Long userId, Long orderId) throws Exception {
OutRechargeOrder order = findByOrderId(orderId);
if(order == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, "");
@ -331,11 +369,11 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
// 金币 1:100
Integer goldNum = new BigDecimal(order.getPayPrice().toString()).multiply(new BigDecimal("100")).intValue();
highUserService.goldHandle(userId, goldNum, 2, 2, order.getId());
order.setPayRealPrice(order.getPayPrice()); // 实付金额
order.setStatus(2);
order.setPayType(3);
order.setPayTime(new Date()); // 支付时间
outRechargeOrderService.updateOrder(order);
}
@Override
@ -347,4 +385,144 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
public OrderCountModel rechargeOrderByIndex(Integer code) {
return outRechargeOrderMapper.rechargeOrderByIndex(code);
}
@Override
public JSONObject getMobile(String phone , Integer amount , String orderNo) throws Exception {
String timestamp = String.valueOf(System.currentTimeMillis());
Map<String , Object> map = new HashMap<>();
map.put("mobile" , phone);
map.put("amount" , amount);
map.put("out_order_id" , orderNo);
map.put("app_key" , CommonSysConst.getSysConfig().getCzAppKey());
map.put("timestamp" , timestamp.substring(0,timestamp.length()-3));
map.put("is_fast" , "1");
map.put("notify_url" , CommonSysConst.getSysConfig().getCzNotifyUrl());
String signStr = WxUtils.generateSignatureAppSecret(map, CommonSysConst.getSysConfig().getCzAppSecret() , WXPayConstants.SignType.MD5);
map.put("sign" , signStr);
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getCzUrl() + "createOrder" , map);
}
@Override
public void rechargeOrderToRefund(Long orderId) throws Exception {
OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId);
// 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 6:退款中
if (order.getStatus() != 2) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法退款,订单不处于已支付状态");
}
// 微信退款
if (order.getPayType() == 1) {
Map<String,String> param = new HashMap<>();
param.put("appid", "wx637bd6f7314daa46");
param.put("mch_id", "1289663601");
param.put("sub_mch_id" , "1614670195");
param.put("nonce_str", WxUtils.makeNonStr());
param.put("transaction_id", order.getPaySerialNo());
param.put("out_refund_no", "HFR"+new Date().getTime());
param.put("total_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
param.put("refund_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()));
param.put("sign_type", "HMAC-SHA256");
String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
param.put("sign", signStr);
String resultXmL = doRefundRequest(param.get("mch_id"), WxUtils.mapToXml(param));
OrderRefundModel orderRefundModel = XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class);
if(orderRefundModel.getResult_code().equals("SUCCESS")) {
order.setStatus(5);
order.setRefundTime(new Date());
order.setOutRefundNo(orderRefundModel.getOut_refund_no());
order.setRefundId(orderRefundModel.getRefund_id());
order.setRefundFee(new BigDecimal(orderRefundModel.getRefund_fee()).divide(new BigDecimal("100")));
outRechargeOrderService.updateOrder(order);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!错误代码:"+orderRefundModel.getErr_code()+",错误描述"+orderRefundModel.getErr_code_des());
}
}
// 工会卡退款
if (order.getPayType() == 2) {
JSONObject jsonObject = HuiLianTongUnionCardConfig.refund( "HFR"+new Date().getTime() , order.getOrderNo());
if (jsonObject == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求超时,请重新点击");
}
JSONObject dataObject = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data"));
if (dataObject.getBoolean("success") || Objects.equals(dataObject.getString("message"), "原交易已撤销,不可再次操作")) {
order.setStatus(5);
order.setRefundTime(new Date());
order.setOutRefundNo("HFR"+new Date().getTime() );
order.setRefundFee(order.getPayRealPrice());
order.setRefundId(dataObject.getString("orderId"));
outRechargeOrderService.updateOrder(order);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, dataObject.getString("message"));
}
}
// 金币退款
if (order.getPayType() == 3) {
highUserService.goldHandle(order.getUserId(), order.getPayRealPrice().intValue() * 100, 1, 3, order.getId());
order.setStatus(5);
order.setRefundTime(new Date());
order.setOutRefundNo("HFR"+new Date().getTime() );
order.setRefundFee(order.getPayRealPrice());
outRechargeOrderService.updateOrder(order);
}
// 银联退款
if (order.getPayType() == 4) {
// 订单退款
JSONObject refund = UnionPayConfig.zwrefund(order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue());
if (!refund.getString("resultcode").equals("W6")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg"));
}
order.setStatus(5);
order.setRefundTime(new Date());
order.setOutRefundNo(refund.getString("oriwtorderid"));
order.setRefundFee(order.getPayRealPrice());
outRechargeOrderService.updateOrder(order);
}
}
public String doRefundRequest(String mchId,String data) throws Exception {
//小程序退款需要调用双向证书的认证
CloseableHttpClient httpClient = goodsOrderService.readCertificate(mchId);
try {
HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/refund"); // 设置响应头信息
httpost.addHeader("Connection", "keep-alive");
httpost.addHeader("Accept", "*/*");
httpost.addHeader("Content-Type", "text/xml");
httpost.addHeader("Host", "api.mch.weixin.qq.com");
httpost.addHeader("X-Requested-With", "XMLHttpRequest");
httpost.addHeader("Cache-Control", "max-age=0");
httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) ");
httpost.setEntity(new StringEntity(data, "UTF-8"));
CloseableHttpResponse response = httpClient.execute(httpost);
try {
HttpEntity entity = response.getEntity();
String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8");
EntityUtils.consume(entity);
return jsonStr;
} finally {
response.close();
}
} catch (Exception e){
throw new RuntimeException(e);
} finally {
httpClient.close();
}
}
}

@ -32,6 +32,9 @@ public class OutRechargePriceServiceImpl implements OutRechargePriceService {
if (StringUtils.isNotBlank(map.get("companyId"))) {
criteria.andCompanyIdEqualTo(Long.valueOf(map.get("companyId")));
}
if (StringUtils.isNotBlank(map.get("rechargeType"))) {
criteria.andRechargeTypeEqualTo(Integer.valueOf(map.get("rechargeType")));
}
example.setOrderByClause("type asc");
return outRechargePriceMapper.selectByExample(example);
@ -52,6 +55,10 @@ public class OutRechargePriceServiceImpl implements OutRechargePriceService {
if (StringUtils.isNotBlank(map.get("companyId"))) {
criteria.andCompanyIdEqualTo(Long.valueOf(map.get("companyId")));
}
if (StringUtils.isNotBlank(map.get("rechargeType"))) {
criteria.andRechargeTypeEqualTo(Integer.valueOf(map.get("rechargeType")));
}
example.setOrderByClause("sort asc");
return outRechargePriceMapper.selectByExample(example);
}

@ -50,11 +50,6 @@ public class RechargeOrderServiceImpl implements PayService {
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Resource OutRechargePriceService outRechargePriceService;
@Resource
private HighProfitSharingRecordService highProfitSharingRecordService;
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
@ -75,8 +70,14 @@ public class RechargeOrderServiceImpl implements PayService {
order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额
order.setPayTime(new Date()); // 支付时间
order.setStatus(2); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款
if (order.getRechargeType() != null && order.getRechargeType() == 1) {
JSONObject object = outRechargeOrderService.getMobile(order.getRechargeContent() , order.getOrderPrice().intValue() , order.getOrderNo());
if (object.getInteger("code") != 200) {
order.setRechargeStatus(1);
order.setAbnormalMsg(object.getString("message"));
}
}
outRechargeOrderService.updateOrder(order);
// 推送订单记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type2.getType());

@ -39,8 +39,8 @@ unionPayTelNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/notifyTel
unionStagingPayUrl=https://mtest.eycard.cn/
unionStagingPayOrgId=ORG000000000001
unionStagingPayOrgMerCode=890000000123679
unionStagingPayOrgTermNo=W0616228
unionStagingPayOrgMerCode=83169054816W999
unionStagingPayOrgTermNo=XS000104
unionStagingPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0
unionStagingPayNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/stagingNotify
@ -51,3 +51,8 @@ TelApiKey=2d01f6b520254b1a80f6b167832cea18
TelApiSecret=d11ee9b41e014a039f030e53ae6f5295
TelMemberId=d13091df65d64aafbf0f35d2093157b7
// Mobile
CzNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/rechargeCallback
CzAppKey = eaomqcbpdz7yjfih
CzUrl = https://hfcs.dmjvip.com/index.php/third/mobile/
CzAppSecret = xkf9eoq2cjh6uvzp0mtrga134lnibdw8

@ -42,3 +42,9 @@ wx_cert=/home/project/wx_cert/
TelApiKey=2d01f6b520254b1a80f6b167832cea18
TelApiSecret=d11ee9b41e014a039f030e53ae6f5295
TelMemberId=d13091df65d64aafbf0f35d2093157b7
CzNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallback
CzAppKey = p429mlj3cvn5hb07
CzUrl = https://jj.dmjvip.com/index.php/third/mobile/
CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij

@ -32,8 +32,8 @@ unionPayTelNotifyUrl=https://hsg.dctpay.com/crest/unionPay/notifyTel
unionStagingPayUrl=https://mtest.eycard.cn/
unionStagingPayOrgId=ORG000000000001
unionStagingPayOrgMerCode=890000000123679
unionStagingPayOrgTermNo=W0616228
unionStagingPayOrgMerCode=83169054816W999
unionStagingPayOrgTermNo=XS000104
unionStagingPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0
unionStagingPayNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/stagingNotify
@ -42,3 +42,9 @@ wx_cert=/home/project/wx_cert/
TelApiKey=2d01f6b520254b1a80f6b167832cea18
TelApiSecret=d11ee9b41e014a039f030e53ae6f5295
TelMemberId=d13091df65d64aafbf0f35d2093157b7
// Mobile
CzNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallback
CzAppKey = p429mlj3cvn5hb07
CzUrl = https://jj.dmjvip.com/index.php/third/mobile/
CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij

Loading…
Cancel
Save