合并话费修改

袁野 3 years ago
commit 012629ed83
  1. 4
      .gitignore
  2. 188
      hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java
  3. 16
      hai-bweb/src/main/java/com/bweb/excelListener/ImportRechargeOrderListener.java
  4. 199
      hai-bweb/src/main/java/com/bweb/model/ExportOutRechargeOrder.java
  5. 3
      hai-bweb/src/main/resources/dev/config.properties
  6. 3
      hai-bweb/src/main/resources/pre/config.properties
  7. 22
      hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java
  8. 2
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  9. 8
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  10. 57
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java
  11. 193
      hai-service/src/main/java/com/hai/model/OutRechargeOrderModel.java
  12. 2
      hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
  13. 139
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java

4
.gitignore vendored

@ -27,6 +27,10 @@ hai-schedule/target/*
hai-schedule/log/*
hai-schedule/hai-schedule.iml
v1/target/*
v1/log/*
v1/hai-schedule.iml

@ -14,6 +14,8 @@ 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.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.common.utils.WxUtils;
import com.hai.config.HuiLianTongUnionCardConfig;
@ -39,6 +41,7 @@ import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -55,6 +58,9 @@ import java.util.*;
public class OutRechargeOrderController {
private static Logger log = LoggerFactory.getLogger(HighMerchantStoreController.class);
@Autowired
private UserCenter userCenter;
@Resource
private OutRechargeOrderService outRechargeOrderService;
@ -85,7 +91,7 @@ public class OutRechargeOrderController {
// 查询充值子订单
Map<String, Object> childOrderMap = new HashMap<>();
childOrderMap.put("parent_order_id" , orderId);
childOrderMap.put("parent_order_id", orderId);
List<OutRechargeChildOrder> childOrderList = outRechargeChildOrderService.getListRechargeChildOrder(childOrderMap);
@ -98,88 +104,76 @@ 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="/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 = "获取订单")
public ResponseData getUserOrderList(
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "payStatus", required = false) Integer payStatus,
@RequestParam(name = "rechargeStatus", required = false) String rechargeStatus,
@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "rechargeModel", required = false) String rechargeModel,
@RequestParam(name = "operatorType", required = false) String operatorType,
@RequestParam(name = "laborUnionCard", required = false) String laborUnionCard,
@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 = "rechargeType", required = false) String rechargeType,
@RequestParam(name = "payType", required = false) Integer payType,
@RequestParam(name = "code", required = false) Integer code,
@RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
try {
Map<String,String> map = new HashMap<>();
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (status != null) {
map.put("status", status.toString());
}
if (StringUtils.isNotBlank(orderNo)) {
map.put("orderNo", orderNo);
}
if (StringUtils.isNotBlank(rechargeModel)) {
map.put("rechargeModel", rechargeModel);
}
Map<String, Object> map = new HashMap<>();
if (StringUtils.isNotBlank(rechargeContent)) {
map.put("companyId", userInfoModel.getBsCompany().getId());
map.put("rechargeStatus", rechargeStatus);
map.put("payStatus", payStatus);
map.put("orderNo", orderNo);
map.put("operatorType", operatorType);
map.put("laborUnionCard", laborUnionCard);
map.put("rechargeContent", rechargeContent);
}
if (StringUtils.isNotBlank(rechargeType)) {
map.put("rechargeType", rechargeType);
}
if (StringUtils.isNotBlank(userPhone)) {
map.put("userPhone", userPhone);
}
if (StringUtils.isNotBlank(idCard)) {
map.put("idCard", idCard);
}
if (payType != null) {
map.put("payType" , payType.toString());
}
if (code != null) {
map.put("code" , code.toString());
}
if (payTimeS != null) {
map.put("rechargeType", rechargeType);
map.put("payType", payType);
if (payTimeS != null && payTimeE != null ) {
map.put("payTimeS", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(payTimeS));
}
if (payTimeE != null) {
map.put("payTimeE", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(payTimeE));
}
if (createTimeS != null && createTimeE != null) {
map.put("createTimeS", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTimeS));
map.put("createTimeE", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTimeE));
}
PageHelper.startPage(pageNum,pageSize);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(outRechargeOrderService.getListRechargeOrder(map)));
} catch (Exception e) {
@ -192,35 +186,47 @@ public class OutRechargeOrderController {
@RequestMapping(value = "/exportOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出订单")
public ResponseData exportOrderList(@RequestParam(name = "status", required = false) Integer status,
public ResponseData exportOrderList(
@RequestParam(name = "payStatus", required = false) Integer payStatus,
@RequestParam(name = "rechargeStatus", required = false) String rechargeStatus,
@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "rechargeModel", required = false) String rechargeModel,
@RequestParam(name = "operatorType", required = false) String operatorType,
@RequestParam(name = "laborUnionCard", required = false) String laborUnionCard,
@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 = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE) {
HttpServletRequest request
) {
try {
Map<String,Object> map = new HashMap<>();
map.put("status", status);
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String, Object> map = new HashMap<>();
map.put("companyId", userInfoModel.getBsCompany().getId());
map.put("rechargeStatus", rechargeStatus);
map.put("payStatus", payStatus);
map.put("orderNo", orderNo);
map.put("rechargeModel", rechargeModel);
map.put("operatorType", operatorType);
map.put("laborUnionCard", laborUnionCard);
map.put("rechargeContent", rechargeContent);
map.put("userPhone", userPhone);
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);
map.put("payTimeE", payTimeE);
map.put("payType", payType);
if (payTimeS != null && payTimeE != null ) {
map.put("payTimeS", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(payTimeS));
map.put("payTimeE", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(payTimeE));
}
if (createTimeS != null && createTimeE != null) {
map.put("createTimeS", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTimeS));
map.put("createTimeE", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTimeE));
}
List<OutRechargeOrderModel> list = outRechargeOrderService.getOrderCount(map);
String name = "/outRechargeOrder/充值订单" + System.currentTimeMillis() + ".xlsx";
@ -245,20 +251,20 @@ public class OutRechargeOrderController {
HttpServletRequest request) {
try {
Map<String,String> map = new HashMap<>();
Map<String, String> map = new HashMap<>();
if (finishTimeS != null){
if (finishTimeS != null) {
map.put("finishTimeS", finishTimeS.toString());
}
if (finishTimeE != null){
if (finishTimeE != null) {
map.put("finishTimeE", finishTimeE.toString());
}
if (status != null){
if (status != null) {
map.put("status", status.toString());
}
PageHelper.startPage(pageNum,pageSize);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(outRechargeOrderService.getListOrderCount(map)));
} catch (Exception e) {
@ -275,16 +281,16 @@ public class OutRechargeOrderController {
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE) {
try {
Map<String,String> map = new HashMap<>();
Map<String, String> map = new HashMap<>();
if (finishTimeS != null){
if (finishTimeS != null) {
map.put("finishTimeS", finishTimeS.toString());
}
if (finishTimeE != null){
if (finishTimeE != null) {
map.put("finishTimeE", finishTimeE.toString());
}
if (status != null){
if (status != null) {
map.put("status", status.toString());
}
@ -311,17 +317,17 @@ public class OutRechargeOrderController {
HttpServletRequest request) {
try {
Map<String,String> map = new HashMap<>();
Map<String, String> map = new HashMap<>();
if (finishTimeS != null){
if (finishTimeS != null) {
map.put("finishTimeS", finishTimeS.toString());
}
if (finishTimeE != null){
if (finishTimeE != null) {
map.put("finishTimeE", finishTimeE.toString());
}
PageHelper.startPage(pageNum,pageSize);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(outRechargeOrderService.getUserCountList(map)));
} catch (Exception e) {
@ -337,13 +343,13 @@ public class OutRechargeOrderController {
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE) {
try {
Map<String,String> map = new HashMap<>();
Map<String, String> map = new HashMap<>();
if (finishTimeS != null){
if (finishTimeS != null) {
map.put("finishTimeS", finishTimeS.toString());
}
if (finishTimeE != null){
if (finishTimeE != null) {
map.put("finishTimeE", finishTimeE.toString());
}

@ -32,7 +32,7 @@ public class ImportRechargeOrderListener extends AnalysisEventListener<ExportOut
@Override
public void invoke(ExportOutRechargeOrder data, AnalysisContext context) {
if (StringUtils.isBlank(data.getOrderNo())
|| StringUtils.isBlank(data.getStatusName()) ) {
|| StringUtils.isBlank(data.getRechargeStatusName()) ) {
data.setErrorMessage("有必填项未填写");
errorData.add(data);
return;
@ -40,15 +40,15 @@ public class ImportRechargeOrderListener extends AnalysisEventListener<ExportOut
OutRechargeOrder rechargeOrder = outRechargeOrderService.findByOrderNo(data.getOrderNo());
// if (rechargeOrder.getStatus() != 2) {
// data.setErrorMessage("当前订单状态错误。");
// errorData.add(data);
// return;
// }
if (rechargeOrder.getRechargeStatus() != 201 || rechargeOrder.getRechargeType() != 2) {
data.setErrorMessage("当前订单状态错误。");
errorData.add(data);
return;
}
if (Objects.equals(data.getStatusName(), "已完成")) {
if (Objects.equals(data.getRechargeStatusName(), "成")) {
outRechargeOrderService.finishOrder(rechargeOrder.getId());
} else if (Objects.equals(data.getStatusName(), "失败")){
} else if (Objects.equals(data.getRechargeStatusName(), "失败")){
try {
outRechargeOrderService.rechargeOrderToRefund(rechargeOrder.getId());
} catch (Exception exception) {

@ -10,41 +10,38 @@ public class ExportOutRechargeOrder {
@ExcelProperty("订单号")
private String orderNo;
@ExcelProperty("用户昵称")
private String userName;
@ExcelProperty("用户联系方式")
private String userPhone;
@ExcelProperty("充值类型")
private String rechargeModelName;
@ExcelProperty("运营商")
private String operatorName;
@ExcelProperty("充值内容")
private String rechargeContent;
@ExcelProperty("备注")
private String remarks;
@ExcelProperty("充值方式")
private String rechargeTypeName;
@ExcelProperty("支付方式")
private String payTypeName;
@ExcelProperty("卡号")
private String cardNo;
@ExcelProperty("充值内容")
private String rechargeContent;
@ExcelProperty("订单金额")
private BigDecimal orderPrice;
@ExcelProperty("充值金额")
private BigDecimal rechargePrice;
@ExcelProperty("应付金额")
private BigDecimal payPrice;
@ExcelProperty("充值方式")
private String rechargeTypeName;
@ExcelProperty("优惠券抵扣金额")
private BigDecimal discountDeductionPrice;
@ExcelProperty("实付金额")
@ExcelProperty("积分抵扣金额")
private BigDecimal integralDeductionPrice;
@ExcelProperty("支付金额")
private BigDecimal payRealPrice;
@ExcelProperty("订单状态")
private String statusName;
@ExcelProperty("用户昵称")
private String userName;
@ExcelProperty("用户联系方式")
private String userPhone;
@ExcelProperty("创建时间")
private Date createTime;
@ -52,27 +49,16 @@ public class ExportOutRechargeOrder {
@ExcelProperty("支付时间")
private Date payTime;
@ExcelProperty("取消时间")
private Date cancelTime;
@ExcelProperty("完成时间")
private Date finishTime;
@ExcelProperty("退款时间")
private Date refundTime;
@ExcelProperty("退款金额")
private BigDecimal refundFee;
@ExcelProperty("支付状态")
private String payStatusName;
@ExcelProperty("退款订单号")
private String outRefundNo;
@ExcelProperty("第三方退款订单号")
private String refundId;
@ExcelProperty("充值状态")
private String rechargeStatusName;
// 错误消息
private String errorMessage;
public String getOrderNo() {
return orderNo;
}
@ -81,28 +67,28 @@ public class ExportOutRechargeOrder {
this.orderNo = orderNo;
}
public String getUserName() {
return userName;
public String getOperatorName() {
return operatorName;
}
public void setUserName(String userName) {
this.userName = userName;
public void setOperatorName(String operatorName) {
this.operatorName = operatorName;
}
public String getUserPhone() {
return userPhone;
public String getRechargeTypeName() {
return rechargeTypeName;
}
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
public void setRechargeTypeName(String rechargeTypeName) {
this.rechargeTypeName = rechargeTypeName;
}
public String getRechargeModelName() {
return rechargeModelName;
public String getPayTypeName() {
return payTypeName;
}
public void setRechargeModelName(String rechargeModelName) {
this.rechargeModelName = rechargeModelName;
public void setPayTypeName(String payTypeName) {
this.payTypeName = payTypeName;
}
public String getRechargeContent() {
@ -113,36 +99,36 @@ public class ExportOutRechargeOrder {
this.rechargeContent = rechargeContent;
}
public String getRemarks() {
return remarks;
public BigDecimal getRechargePrice() {
return rechargePrice;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
public void setRechargePrice(BigDecimal rechargePrice) {
this.rechargePrice = rechargePrice;
}
public String getPayTypeName() {
return payTypeName;
public BigDecimal getPayPrice() {
return payPrice;
}
public void setPayTypeName(String payTypeName) {
this.payTypeName = payTypeName;
public void setPayPrice(BigDecimal payPrice) {
this.payPrice = payPrice;
}
public BigDecimal getOrderPrice() {
return orderPrice;
public BigDecimal getDiscountDeductionPrice() {
return discountDeductionPrice;
}
public void setOrderPrice(BigDecimal orderPrice) {
this.orderPrice = orderPrice;
public void setDiscountDeductionPrice(BigDecimal discountDeductionPrice) {
this.discountDeductionPrice = discountDeductionPrice;
}
public BigDecimal getPayPrice() {
return payPrice;
public BigDecimal getIntegralDeductionPrice() {
return integralDeductionPrice;
}
public void setPayPrice(BigDecimal payPrice) {
this.payPrice = payPrice;
public void setIntegralDeductionPrice(BigDecimal integralDeductionPrice) {
this.integralDeductionPrice = integralDeductionPrice;
}
public BigDecimal getPayRealPrice() {
@ -153,12 +139,20 @@ public class ExportOutRechargeOrder {
this.payRealPrice = payRealPrice;
}
public String getStatusName() {
return statusName;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserPhone() {
return userPhone;
}
public void setStatusName(String statusName) {
this.statusName = statusName;
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
}
public Date getCreateTime() {
@ -177,60 +171,20 @@ public class ExportOutRechargeOrder {
this.payTime = payTime;
}
public Date getCancelTime() {
return cancelTime;
}
public void setCancelTime(Date cancelTime) {
this.cancelTime = cancelTime;
}
public Date getFinishTime() {
return finishTime;
}
public void setFinishTime(Date finishTime) {
this.finishTime = finishTime;
public String getPayStatusName() {
return payStatusName;
}
public Date getRefundTime() {
return refundTime;
public void setPayStatusName(String payStatusName) {
this.payStatusName = payStatusName;
}
public void setRefundTime(Date refundTime) {
this.refundTime = refundTime;
public String getRechargeStatusName() {
return rechargeStatusName;
}
public BigDecimal getRefundFee() {
return refundFee;
}
public void setRefundFee(BigDecimal refundFee) {
this.refundFee = refundFee;
}
public String getOutRefundNo() {
return outRefundNo;
}
public void setOutRefundNo(String outRefundNo) {
this.outRefundNo = outRefundNo;
}
public String getRefundId() {
return refundId;
}
public void setRefundId(String refundId) {
this.refundId = refundId;
}
public String getCardNo() {
return cardNo;
}
public void setCardNo(String cardNo) {
this.cardNo = cardNo;
public void setRechargeStatusName(String rechargeStatusName) {
this.rechargeStatusName = rechargeStatusName;
}
public String getErrorMessage() {
@ -240,13 +194,4 @@ public class ExportOutRechargeOrder {
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public String getRechargeTypeName() {
return rechargeTypeName;
}
public void setRechargeTypeName(String rechargeTypeName) {
this.rechargeTypeName = rechargeTypeName;
}
}

@ -1,4 +1,5 @@
fileUrl=/home/project/hsg/filesystem
#fileUrl=/home/project/hsg/filesystem
fileUrl=/Volumes/work/code/filesystem/
cmsPath=/home/project/hsg/filesystem/cmsPath
agentQrCode=/home/project/hsg/filesystem/agentQrCode
agentQrCodeWxUrl=https://hsgcs.dctpay.com/wx/?action=ic&id=

@ -1,4 +1,5 @@
fileUrl=/home/project/hsg/filesystem
#fileUrl=/home/project/hsg/filesystem
fileUrl=/Volumes/work/code/filesystem/
cmsPath=/home/project/hsg/filesystem/cmsPath
agentQrCode=/home/project/hsg/filesystem/agentQrCode
agentQrCodeWxUrl=https://hsgcs.dctpay.com/wx/?action=gogogo&id=

@ -42,7 +42,7 @@ public class OutRechargeOrderController {
private OutRechargePriceService outRechargePriceService;
@RequestMapping(value="/addOrder",method = RequestMethod.POST)
@RequestMapping(value = "/addOrder", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "增加订单")
public ResponseData addOrder(@RequestBody JSONObject object, HttpServletRequest request) {
@ -60,14 +60,12 @@ public class OutRechargeOrderController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
object.put("userId" , userInfoModel.getHighUser().getId());
object.put("userName" , userInfoModel.getHighUser().getName());
object.put("phone" , userInfoModel.getHighUser().getPhone());
object.put("userId", userInfoModel.getHighUser().getId());
return ResponseMsgUtil.success(outRechargeOrderService.insertOrder(object));
} catch (Exception e) {
log.error("HighOrderController -> addOrder() error!",e);
log.error("HighOrderController -> addOrder() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@ -124,7 +122,6 @@ public class OutRechargeOrderController {
public ResponseData getUserOrderList(
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "rechargeModel", required = false) String rechargeModel,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
@ -134,19 +131,12 @@ public class OutRechargeOrderController {
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
Map<String,String> map = new HashMap<>();
Map<String, Object> map = new HashMap<>();
map.put("userId", userInfoModel.getHighUser().getId().toString());
if (status != null) {
map.put("status", status.toString());
}
if (StringUtils.isNotBlank(orderNo)) {
map.put("payStatus", status.toString());
map.put("orderNo", orderNo);
}
if (StringUtils.isNotBlank(rechargeModel)) {
map.put("rechargeModel", rechargeModel);
}
PageHelper.startPage(pageNum,pageSize);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(outRechargeOrderService.getListRechargeOrder(map)));
} catch (Exception e) {

@ -94,7 +94,7 @@ public class HighOrderSchedule {
*/
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void initRechargeOrder() {
Map<String, String> map = new HashMap<>();
Map<String, Object> map = new HashMap<>();
map.put("status" , String.valueOf(102));
map.put("rechargeStatus" , String.valueOf(204));
List<OutRechargeOrder> orderList = outRechargeOrderService.getListRechargeOrder(map);

@ -769,7 +769,7 @@ public interface HighOrderMapperExt {
"<script>",
"select sum(pay_real_price) from out_recharge_order where" +
" <if test='map.today != null'> to_days(pay_time) = to_days(now()) and </if> " +
" status in (2,3) ",
" pay_status in (102,100) ",
"</script>"
})
BigDecimal rechargePriceTotal(@Param("map") Map<String,Object> map);
@ -787,7 +787,7 @@ public interface HighOrderMapperExt {
"<script>",
"select count(pay_real_price) from out_recharge_order where " +
"<if test='map.today != null'> to_days(pay_time) = to_days(now()) and </if> " +
"status in (2,3) ",
"pay_status in (102,100) ",
"</script>"
})
Long rechargePriceCount(@Param("map") Map<String,Object> map);
@ -845,7 +845,7 @@ public interface HighOrderMapperExt {
"left join ( " +
"select date(create_timed) as datetime, " +
"sum(pay_real_price) as num " +
"from out_recharge_order where status in (2,3)" +
"from out_recharge_order where pay_status in (102,100)" +
"group by date(create_timed) " +
") b " +
"on a.click_date = b.datetime " +
@ -907,7 +907,7 @@ public interface HighOrderMapperExt {
"left join ( " +
"select date(create_timed) as datetime, " +
"count(*) as num " +
"from out_recharge_order where status in (2,3)" +
"from out_recharge_order where pay_status in (102,100)" +
"group by date(create_timed) " +
") b " +
"on a.click_date = b.datetime " +

@ -64,43 +64,30 @@ public interface OutRechargeOrderMapperExt {
@Select({"<script>" +
"SELECT" +
" a.order_no orderNo," +
" 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," +
" a.recharge_name rechargeName," +
" case a.pay_type when 1 then '微信' when 2 then '工会卡' when 3 then '积分' when 4 then '银联' end payTypeName," +
" a.order_price orderPrice," +
" a.pay_price payPrice," +
" a.pay_real_price payRealPrice," +
" case a.status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已取消' when 5 then '已退款' when 6 then '退款中' end statusName," +
" a.create_timed createTime," +
" a.pay_time payTime," +
" a.cancel_time cancelTime," +
" a.finish_time finishTime," +
" a.refund_time refundTime," +
" a.refund_fee refundFee," +
" a.out_refund_no outRefundNo," +
" a.refund_id refundId" +
" order_no as orderNo," +
" operator_name as operatorName," +
" case recharge_type when 1 then '快充' when 2 then '慢充' end rechargeTypeName ," +
" case pay_type when 2 then '微信支付' when 3 then '工会卡支付' when 4 then '银联支付' when null then '积分抵扣' end payTypeName," +
" recharge_content as rechargeContent,recharge_price as rechargePrice,pay_price as payPrice,discount_deduction_price as discountDeductionPrice,integral_deduction_price as integralDeductionPrice,pay_real_price as payRealPrice," +
" user_name as userName, user_phone as userPhone, create_timed as createTimed, pay_time as payTime," +
" case pay_status when 100 then '已完成' when 101 then '待支付' when 102 then '已支付' when 104 then '已取消' when 105 then '已退款' end payStatusName," +
" case recharge_status when 201 then '充值中' when 202 then '充值成功' when 203 then '充值失败' when 204 then '未充值' end rechargeStatusName" +
" FROM" +
" out_recharge_order a where 1 = 1 " +
"<if test='map.status != null'> and a.`status` = #{map.status} </if>",
"<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>",
"<if test='map.userPhone != null'> and a.`user_phone` = #{map.userPhone} </if>",
"<if test='map.createTimeS != null'> <![CDATA[ and a.create_timed >= #{map.createTimeS} ]]> </if>",
"<if test='map.createTimeE != null'> <![CDATA[ and a.create_timed <= #{map.createTimeE} ]]> </if>",
"<if test='map.payTimeS != null'> <![CDATA[ and a.pay_time >= #{map.payTimeS} ]]> </if>",
"<if test='map.payTimeE != null'> <![CDATA[ and a.pay_time <= #{map.payTimeE} ]]> </if>",
"<if test='map.companyId != null'> and `company_id` = #{map.companyId} </if>",
"<if test='map.payType != null'> and `pay_type` = #{map.payType} </if>",
"<if test='map.rechargeStatus != null'> and `recharge_status` = #{map.rechargeStatus} </if>",
"<if test='map.payStatus != null'> and `pay_status` = #{map.payStatus} </if>",
"<if test='map.orderNo != null'> and `order_no` = #{map.orderNo} </if>",
"<if test='map.rechargeType != null'> and `recharge_type` = #{map.rechargeType} </if>",
"<if test='map.operatorType != null'> and `operator_type` = #{map.operatorType} </if>",
"<if test='map.rechargeContent != null'> and `recharge_content` LIKE '%${map.rechargeContent}%' </if>",
"<if test='map.laborUnionCard != null'> and `labor_union_card` LIKE '%${map.laborUnionCard}%' </if>",
"<if test='map.userPhone != null'> and `user_phone` = #{map.userPhone} </if>",
"<if test='map.createTimeS != null'> <![CDATA[ and create_timed >= #{map.createTimeS} ]]> </if>",
"<if test='map.createTimeE != null'> <![CDATA[ and create_timed <= #{map.createTimeE} ]]> </if>",
"<if test='map.payTimeS != null'> <![CDATA[ and pay_time >= #{map.payTimeS} ]]> </if>",
"<if test='map.payTimeE != null'> <![CDATA[ and pay_time <= #{map.payTimeE} ]]> </if>",
" ORDER BY" +
" a.create_timed DESC " +
"</script>"

@ -8,122 +8,137 @@ import java.util.Date;
public class OutRechargeOrderModel extends OutRechargeOrder {
private String orderNo;
private String userName;
private String userPhone;
private String rechargeModelName;
private String rechargeContent;
private String rechargeName;
private String remarks;
private String operatorName;
private String rechargeTypeName;
private String payTypeName;
private BigDecimal orderPrice;
private String rechargeContent;
private BigDecimal rechargePrice;
private BigDecimal payPrice;
private BigDecimal discountDeductionPrice;
private BigDecimal integralDeductionPrice;
private BigDecimal payRealPrice;
private String statusName;
private String userName;
private String userPhone;
private Date createTime;
private Date payTime;
private Date cancelTime;
private Date finishTime;
private Date refundTime;
private BigDecimal refundFee;
private String outRefundNo;
private String refundId;
private String cardNo;
private String rechargeTypeName;
private String payStatusName;
private String rechargeStatusName;
@Override
public String getOrderNo() {
return orderNo;
}
@Override
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getUserName() {
return userName;
@Override
public String getOperatorName() {
return operatorName;
}
public void setUserName(String userName) {
this.userName = userName;
@Override
public void setOperatorName(String operatorName) {
this.operatorName = operatorName;
}
public String getUserPhone() {
return userPhone;
public String getRechargeTypeName() {
return rechargeTypeName;
}
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
public void setRechargeTypeName(String rechargeTypeName) {
this.rechargeTypeName = rechargeTypeName;
}
public String getRechargeModelName() {
return rechargeModelName;
public String getPayTypeName() {
return payTypeName;
}
public void setRechargeModelName(String rechargeModelName) {
this.rechargeModelName = rechargeModelName;
public void setPayTypeName(String payTypeName) {
this.payTypeName = payTypeName;
}
@Override
public String getRechargeContent() {
return rechargeContent;
}
@Override
public void setRechargeContent(String rechargeContent) {
this.rechargeContent = rechargeContent;
}
public String getRechargeName() {
return rechargeName;
}
public void setRechargeName(String rechargeName) {
this.rechargeName = rechargeName;
}
public String getRemarks() {
return remarks;
@Override
public BigDecimal getRechargePrice() {
return rechargePrice;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
@Override
public void setRechargePrice(BigDecimal rechargePrice) {
this.rechargePrice = rechargePrice;
}
public String getPayTypeName() {
return payTypeName;
@Override
public BigDecimal getPayPrice() {
return payPrice;
}
public void setPayTypeName(String payTypeName) {
this.payTypeName = payTypeName;
@Override
public void setPayPrice(BigDecimal payPrice) {
this.payPrice = payPrice;
}
public BigDecimal getOrderPrice() {
return orderPrice;
@Override
public BigDecimal getDiscountDeductionPrice() {
return discountDeductionPrice;
}
public void setOrderPrice(BigDecimal orderPrice) {
this.orderPrice = orderPrice;
@Override
public void setDiscountDeductionPrice(BigDecimal discountDeductionPrice) {
this.discountDeductionPrice = discountDeductionPrice;
}
public BigDecimal getPayPrice() {
return payPrice;
@Override
public BigDecimal getIntegralDeductionPrice() {
return integralDeductionPrice;
}
public void setPayPrice(BigDecimal payPrice) {
this.payPrice = payPrice;
@Override
public void setIntegralDeductionPrice(BigDecimal integralDeductionPrice) {
this.integralDeductionPrice = integralDeductionPrice;
}
@Override
public BigDecimal getPayRealPrice() {
return payRealPrice;
}
@Override
public void setPayRealPrice(BigDecimal payRealPrice) {
this.payRealPrice = payRealPrice;
}
public String getStatusName() {
return statusName;
@Override
public String getUserName() {
return userName;
}
@Override
public void setUserName(String userName) {
this.userName = userName;
}
@Override
public String getUserPhone() {
return userPhone;
}
public void setStatusName(String statusName) {
this.statusName = statusName;
@Override
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
}
public Date getCreateTime() {
@ -134,75 +149,29 @@ public class OutRechargeOrderModel extends OutRechargeOrder {
this.createTime = createTime;
}
@Override
public Date getPayTime() {
return payTime;
}
@Override
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
public Date getCancelTime() {
return cancelTime;
}
public void setCancelTime(Date cancelTime) {
this.cancelTime = cancelTime;
}
public Date getFinishTime() {
return finishTime;
}
public void setFinishTime(Date finishTime) {
this.finishTime = finishTime;
}
public Date getRefundTime() {
return refundTime;
public String getPayStatusName() {
return payStatusName;
}
public void setRefundTime(Date refundTime) {
this.refundTime = refundTime;
public void setPayStatusName(String payStatusName) {
this.payStatusName = payStatusName;
}
public BigDecimal getRefundFee() {
return refundFee;
public String getRechargeStatusName() {
return rechargeStatusName;
}
public void setRefundFee(BigDecimal refundFee) {
this.refundFee = refundFee;
}
public String getOutRefundNo() {
return outRefundNo;
}
public void setOutRefundNo(String outRefundNo) {
this.outRefundNo = outRefundNo;
}
public String getRefundId() {
return refundId;
}
public void setRefundId(String refundId) {
this.refundId = refundId;
}
public String getCardNo() {
return cardNo;
}
public void setCardNo(String cardNo) {
this.cardNo = cardNo;
}
public String getRechargeTypeName() {
return rechargeTypeName;
}
public void setRechargeTypeName(String rechargeTypeName) {
this.rechargeTypeName = rechargeTypeName;
public void setRechargeStatusName(String rechargeStatusName) {
this.rechargeStatusName = rechargeStatusName;
}
}

@ -23,7 +23,7 @@ public interface OutRechargeOrderService {
* @Param [map]
* @return java.util.List<com.hai.entity.OutRechargeOrder>
**/
List<OutRechargeOrder> getListRechargeOrder(Map<String , String> map);
List<OutRechargeOrder> getListRechargeOrder(Map<String , Object> map);
/**
* @Author Sum1Dream

@ -92,51 +92,53 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Override
public List<OutRechargeOrder> getListRechargeOrder(Map<String, String> map) {
public List<OutRechargeOrder> getListRechargeOrder(Map<String, Object> map) {
OutRechargeOrderExample example = new OutRechargeOrderExample();
OutRechargeOrderExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId"));
}
if (MapUtils.getLong(map, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(map, "companyId"));
}
if (MapUtils.getInteger(map, "payType") != null) {
criteria.andPayTypeEqualTo(MapUtils.getInteger(map, "payType"));
}
if (MapUtils.getInteger(map, "laborUnionCard") != null) {
criteria.andLaborUnionCardEqualTo(MapUtils.getString(map, "laborUnionCard"));
}
if (MapUtils.getInteger(map, "payStatus") != null) {
criteria.andPayStatusEqualTo(MapUtils.getInteger(map, "payStatus"));
}
if (MapUtils.getInteger(map, "rechargeType") != null) {
criteria.andRechargeTypeEqualTo(MapUtils.getInteger(map, "rechargeType"));
}
if (MapUtils.getString(map, "orderNo") != null) {
criteria.andOrderNoLike("%" + MapUtils.getString(map, "orderNo") + "%");
}
if (MapUtils.getString(map, "userPhone") != null) {
criteria.andUserPhoneEqualTo(MapUtils.getString(map, "userPhone"));
}
if (MapUtils.getString(map, "rechargeContent") != null) {
criteria.andRechargeContentLike("%" + MapUtils.getString(map, "rechargeContent") + "%");
}
if (MapUtils.getString(map, "phone") != null) {
criteria.andUserPhoneEqualTo(MapUtils.getString(map, "phone"));
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andPayStatusEqualTo(MapUtils.getInteger(map, "status"));
if (MapUtils.getInteger(map, "operatorType") != null) {
criteria.andOperatorTypeEqualTo(MapUtils.getInteger(map, "operatorType"));
}
if (MapUtils.getInteger(map, "rechargeStatus") != null) {
criteria.andRechargeStatusEqualTo(MapUtils.getInteger(map, "rechargeStatus"));
}
if (StringUtils.isNotBlank(map.get("payTimeS")) && StringUtils.isNotBlank(map.get("payTimeE"))) {
if (StringUtils.isNotBlank(MapUtils.getString(map, "payTimeS")) && StringUtils.isNotBlank(MapUtils.getString(map, "payTimeE"))) {
criteria.andPayTimeBetween(
DateUtil.format(map.get("payTimeS") , "yyyy-MM-dd HH:mm:ss") ,
DateUtil.format(map.get("payTimeE") , "yyyy-MM-dd HH:mm:ss"));
DateUtil.format(MapUtils.getString(map, "payTimeS"), "yyyy-MM-dd HH:mm:ss"),
DateUtil.format(MapUtils.getString(map, "payTimeE"), "yyyy-MM-dd HH:mm:ss"));
}
if (StringUtils.isNotBlank(map.get("createTimeS")) && StringUtils.isNotBlank(map.get("createTimeE"))) {
if (StringUtils.isNotBlank(MapUtils.getString(map, "createTimeS")) && StringUtils.isNotBlank(MapUtils.getString(map, "createTimeE"))) {
criteria.andCreateTimedBetween(
DateUtil.format(map.get("createTimeS") , "yyyy-MM-dd HH:mm:ss") ,
DateUtil.format(map.get("createTimeE") , "yyyy-MM-dd HH:mm:ss"));
DateUtil.format(MapUtils.getString(map, "createTimeS"), "yyyy-MM-dd HH:mm:ss"),
DateUtil.format(MapUtils.getString(map, "createTimeE"), "yyyy-MM-dd HH:mm:ss"));
}
example.setOrderByClause("create_timed desc");
@ -158,7 +160,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Override
@Transactional(
isolation = Isolation.SERIALIZABLE,
propagation= Propagation.REQUIRES_NEW)
propagation = Propagation.REQUIRES_NEW)
public OutRechargeOrder insertOrder(JSONObject object) throws Exception {
OutRechargeOrder outRechargeOrder = new OutRechargeOrder();
@ -173,7 +175,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
String rechargeContent = object.getString("rechargeContent");
// 查询产品详情
OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(goodsId , null);
OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(goodsId, null);
Map<String, Object> listMap = new HashMap<>();
listMap.put("productType", "3");
@ -184,7 +186,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
BsProductDiscount bsProductDiscount = bsConfigService.getProductDiscountByMap(listMap);
// 判断充值系统是否关闭
if (!secConfigService.isConfig("RECHARGE" , "1")) {
if (!secConfigService.isConfig("RECHARGE", "1")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.RECHARGE_CLOSE, "");
}
@ -215,7 +217,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
if (highDiscountUserRel.getHighDiscount().getDiscountType() == 1) {
// 如果商品支付总额 小于 满减价格
if (outRechargePrice.getRechargePrice().compareTo(highDiscountUserRel.getHighDiscount().getDiscountCondition()) < 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "订单未达到"+highDiscountUserRel.getHighDiscount().getDiscountCondition()+"元,无法使用此优惠券");
throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "订单未达到" + highDiscountUserRel.getHighDiscount().getDiscountCondition() + "元,无法使用此优惠券");
}
// 计算支付金额 = 商品充值总额 - 满减额度
payPrice = outRechargePrice.getRechargePrice().subtract(highDiscountUserRel.getHighDiscount().getDiscountPrice());
@ -286,14 +288,14 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
outRechargeOrder.setUserId(object.getLong("userId"));
outRechargeOrder.setUserId(user.getId());
outRechargeOrder.setIntegralNum(object.getBigDecimal("integralNum"));
outRechargeOrder.setRechargeContent(rechargeContent);
outRechargeOrder.setCompanyId(outRechargePrice.getCompanyId());
outRechargeOrder.setUserName(object.getString("username"));
outRechargeOrder.setUserName(user.getName());
outRechargeOrder.setRechargeType(outRechargePrice.getRechargeType());
outRechargeOrder.setUserPhone(object.getString("phone"));
outRechargeOrder.setOrderNo("RCG" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5));
outRechargeOrder.setUserPhone(user.getPhone());
outRechargeOrder.setOrderNo("RCG" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5));
outRechargeOrder.setCreateTimed(new Date());
outRechargeOrder.setGoodsId(goodsId);
outRechargeOrder.setRechargePrice(outRechargePrice.getRechargePrice());
@ -315,7 +317,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
// 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
outRechargeOrder.setPayStatus(102);
outRechargeOrder.setPayTime(new Date());
outRechargeOrder.setPaySerialNo("22" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5));
outRechargeOrder.setPaySerialNo("22" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5));
} else {
// 201:充值中 202:充值成功 203:充值失败 204:未充值
outRechargeOrder.setRechargeStatus(204);
@ -355,9 +357,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void updateOrderList(List<OutRechargeOrder> rechargeOrders) throws Exception {
for (OutRechargeOrder list:rechargeOrders) {
for (OutRechargeOrder list : rechargeOrders) {
// if (list.getStatus() == 3) {
// outRechargeOrderMapper.updateByPrimaryKey(list);
// } else if (list.getStatus() == 6) {
@ -368,7 +370,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void cancelOrder(Long orderId) {
OutRechargeOrder order = findByOrderId(orderId);
if (order != null && order.getPayStatus() == 101) {
@ -400,11 +402,12 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void finishOrder(Long orderId) {
OutRechargeOrder order = findByOrderId(orderId);
if (order != null) {
// order.setStatus(3); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已取消 5.已退款
order.setRechargeStatus(202); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已取消 5.已退款
order.setPayStatus(100); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已取消 5.已退款
order.setFinishTime(new Date());
updateOrder(order);
}
@ -412,24 +415,24 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Override
public List<OutRechargeOrderModel> getOrderCount(Map<String, Object> map) throws Exception {
if(MapUtils.getLong(map, "createTimeS") != null) {
if (MapUtils.getLong(map, "createTimeS") != null) {
map.put("createTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "createTimeS")), "yyyy-MM-dd HH:mm:ss"));
}
if(MapUtils.getLong(map, "createTimeE") != null) {
if (MapUtils.getLong(map, "createTimeE") != null) {
map.put("createTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "createTimeE")), "yyyy-MM-dd HH:mm:ss"));
}
if(MapUtils.getLong(map, "payTimeS") != null) {
if (MapUtils.getLong(map, "payTimeS") != null) {
map.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeS")), "yyyy-MM-dd HH:mm:ss"));
}
if(MapUtils.getLong(map, "payTimeE") != null) {
if (MapUtils.getLong(map, "payTimeE") != null) {
map.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeE")), "yyyy-MM-dd HH:mm:ss"));
}
return outRechargeOrderMapper.selectOrderCount(map);
}
@ -479,7 +482,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
} else {
fTimeE = DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss");
}
return outRechargeOrderMapperExt.getListOrderCount(fTimeS , fTimeE , status);
return outRechargeOrderMapperExt.getListOrderCount(fTimeS, fTimeE, status);
}
@Override
@ -515,14 +518,14 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
} else {
fTimeE = DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss");
}
return outRechargeOrderMapperExt.getListUserCount(fTimeS , fTimeE);
return outRechargeOrderMapperExt.getListUserCount(fTimeS, fTimeE);
}
@Override
public void hltUnionCardPay(HighUserCard userCard, OutRechargeOrder order) throws Exception {
String goodsDesc = "充值话费";
String tranDesc = order.getRechargeContent() + "充值" + order.getPayRealPrice() +"元话费";
String tranDesc = order.getRechargeContent() + "充值" + order.getPayRealPrice() + "元话费";
String instCode = "11101290";
String businessType = "hisen_consume";
@ -530,7 +533,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
JSONObject consumption = HuiLianTongUnionCardConfig.consumption(order.getOrderNo(), userCard.getCardNo(), order.getPayRealPrice(), businessType, instCode, goodsDesc, tranDesc);
System.out.println("工会卡支付响应参数" + consumption.toJSONString());
Map<String,Object> dataMap = new HashMap<>();
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("orderNo", order.getOrderNo());
dataMap.put("cardType", "ghk");
dataMap.put("cardNo", userCard.getCardNo());
@ -550,7 +553,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
payPush.setReturnContent(consumption.toJSONString());
highGasOrderPushMapper.insert(payPush);
if(!consumption.getString("respCode").equals("0000")) {
if (!consumption.getString("respCode").equals("0000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage"));
}
JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data"));
@ -609,23 +612,23 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
} else {
// 微信退款
if (order.getPayType() == 2) {
Map<String,String> param = new HashMap<>();
Map<String, String> param = new HashMap<>();
param.put("appid", "wx637bd6f7314daa46");
param.put("mch_id", "1289663601");
param.put("sub_mch_id" , "1614670195");
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("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);
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")) {
if (orderRefundModel.getResult_code().equals("SUCCESS")) {
order.setPayStatus(105);
order.setRechargeStatus(203);
order.setRefundTime(new Date());
@ -634,16 +637,16 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
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());
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!错误代码:" + orderRefundModel.getErr_code() + ",错误描述" + orderRefundModel.getErr_code_des());
}
}
// 工会卡退款
if (order.getPayType() == 3) {
JSONObject jsonObject = HuiLianTongUnionCardConfig.refund( "HFR"+new Date().getTime() , order.getOrderNo());
JSONObject jsonObject = HuiLianTongUnionCardConfig.refund("HFR" + new Date().getTime(), order.getOrderNo());
if (jsonObject == null) {
jsonObject = HuiLianTongUnionCardConfig.refund( "HFR"+new Date().getTime() , order.getOrderNo());
jsonObject = HuiLianTongUnionCardConfig.refund("HFR" + new Date().getTime(), order.getOrderNo());
}
JSONObject dataObject = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data"));
@ -652,7 +655,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
order.setPayStatus(105);
order.setRechargeStatus(203);
order.setRefundTime(new Date());
order.setOutRefundNo("HFR"+new Date().getTime() );
order.setOutRefundNo("HFR" + new Date().getTime());
order.setRefundFee(order.getPayRealPrice());
order.setRefundId(dataObject.getString("orderId"));
outRechargeOrderService.updateOrder(order);
@ -694,7 +697,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
public String doRefundRequest(String mchId,String data) throws Exception {
public String doRefundRequest(String mchId, String data) throws Exception {
//小程序退款需要调用双向证书的认证
CloseableHttpClient httpClient = goodsOrderService.readCertificate(mchId);
@ -717,7 +720,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
} finally {
response.close();
}
} catch (Exception e){
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
httpClient.close();
@ -728,13 +731,13 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
public void pollRequest(OutRechargeOrder outRechargeOrder) throws Exception {
// 查询充值产品
OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(outRechargeOrder.getGoodsId() , null);
OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(outRechargeOrder.getGoodsId(), null);
// 查询充值子订单
Map<String, Object> childOrderMap = new HashMap<>();
childOrderMap.put("parent_order_id" , outRechargeOrder.getId());
childOrderMap.put("status" , 102);
childOrderMap.put("parent_order_id", outRechargeOrder.getId());
childOrderMap.put("status", 102);
List<OutRechargeChildOrder> childOrderList = outRechargeChildOrderService.getListRechargeChildOrder(childOrderMap);
@ -756,21 +759,21 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
JSONObject object = new JSONObject();
String orderNo = "CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5);
String orderNo = "CZ" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5);
String[] rechargePlatform = outRechargePrice.getRechargePlatform().split("-");
for (String s : rechargePlatform) {
// 尖椒充值
if (s.equals("1") && (type == 2 || type == 0)) {
object.put("out_order_id" ,orderNo );
object.put("amount" , outRechargePrice.getRechargePrice());
object.put("mobile" , outRechargeOrder.getRechargeContent());
object.put("out_order_id", orderNo);
object.put("amount", outRechargePrice.getRechargePrice());
object.put("mobile", outRechargeOrder.getRechargeContent());
if (outRechargePrice.getRechargeType() == 1) {
object.put("is_fast" , 1);
object.put("is_fast", 1);
}
JSONObject returnObject = RechargeConfig.rechargeOrderByJj(object);
object.put("return_content" , returnObject);
object.put("return_content", returnObject);
if (returnObject != null && returnObject.getLong("code") == 200) {
childOrder.setStatus(102);
} else {
@ -780,11 +783,11 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
break;
}
if (s.equals("2") && (type == 1 || type == 0)) {
object.put("out_trade_num" , orderNo);
object.put("product_id" , outRechargePrice.getGoodsId());
object.put("mobile" , outRechargeOrder.getRechargeContent());
object.put("out_trade_num", orderNo);
object.put("product_id", outRechargePrice.getGoodsId());
object.put("mobile", outRechargeOrder.getRechargeContent());
JSONObject returnObject = RechargeConfig.rechargeOrderByLy(object);
object.put("return_content" , returnObject);
object.put("return_content", returnObject);
if (returnObject != null && returnObject.getLong("errno") == 0) {
childOrder.setStatus(102);
} else {

Loading…
Cancel
Save