| @@ -129,9 +129,9 @@ public class WxMallController extends BaseController { | |||||
| if (mall == null) { | if (mall == null) { | ||||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | ||||
| } | } | ||||
| if(EnumYesOrNo.YES.getCode().equals(isAll)){ | |||||
| mallList.add(mall); | |||||
| } | |||||
| // if(EnumYesOrNo.YES.getCode().equals(isAll)){ | |||||
| // mallList.add(mall); | |||||
| // } | |||||
| if (mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) && | if (mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) && | ||||
| StringUtils.isBlank(mall.getParentTenantId())) { | StringUtils.isBlank(mall.getParentTenantId())) { | ||||
| List<WxMall> subMall = wxMallService.getSubByParentTenantId(mall.getTenantId()); | List<WxMall> subMall = wxMallService.getSubByParentTenantId(mall.getTenantId()); | ||||
| @@ -19,6 +19,7 @@ public class WxCardSpend extends TenantEntity { | |||||
| protected Long id; | protected Long id; | ||||
| @Excel(name = "订单类型", width = 20, orderNum = "8", replace = {"付款_0", "退款_1"}) | |||||
| @io.swagger.annotations.ApiModelProperty(value="EnumPayType",name="payType") | @io.swagger.annotations.ApiModelProperty(value="EnumPayType",name="payType") | ||||
| private Integer payType; | private Integer payType; | ||||
| @@ -34,7 +35,7 @@ public class WxCardSpend extends TenantEntity { | |||||
| private Long merchantId; | private Long merchantId; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> merchantIdList; | private List<Long> merchantIdList; | ||||
| @Excel(name = "订单号", width = 20, orderNum = "5") | |||||
| @Excel(name = "订单号", width = 20, orderNum = "7") | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单账号",name="orderId") | @io.swagger.annotations.ApiModelProperty(value="订单账号",name="orderId") | ||||
| private Long orderId; | private Long orderId; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -60,14 +61,14 @@ public class WxCardSpend extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡支付前总金额",name="cardBeforeRealAmount") | @io.swagger.annotations.ApiModelProperty(value="卡支付前总金额",name="cardBeforeRealAmount") | ||||
| private Integer cardBeforeRealAmount; | private Integer cardBeforeRealAmount; | ||||
| @Excel(name="交易时间",width = 20,orderNum = "6",format="yyyy-MM-dd HH:mm") | |||||
| @Excel(name="交易时间",width = 20,orderNum = "9",format="yyyy-MM-dd HH:mm") | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | ||||
| private Date createDate; | private Date createDate; | ||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
| private Date updateDate; | private Date updateDate; | ||||
| //@Excel(name = "支付状态", width = 20, orderNum = "11", replace = {"未支付_0", "已分账_1", "已人工分账_2"}) | //@Excel(name = "支付状态", width = 20, orderNum = "11", replace = {"未支付_0", "已分账_1", "已人工分账_2"}) | ||||
| @Excel(name = "支付状态", width = 20, orderNum = "11", replace = {"未线上分账_0", "已线上分账_1", "已线下结算_2"}) | |||||
| @Excel(name = "支付状态", width = 20, orderNum = "14", replace = {"未线上分账_0", "已线上分账_1", "已线下结算_2", "退款中_3", "已退款_4"}) | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付状态(0:未分帐, 1:已分账, 2:已人工分账, 10:预支付(POS))",name="payStatus") | @io.swagger.annotations.ApiModelProperty(value="支付状态(0:未分帐, 1:已分账, 2:已人工分账, 10:预支付(POS))",name="payStatus") | ||||
| private Integer payStatus; | private Integer payStatus; | ||||
| @@ -84,15 +85,15 @@ public class WxCardSpend extends TenantEntity { | |||||
| private String refundRemark; | private String refundRemark; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @Excel(name = "消费金额(元)", width = 20, orderNum = "7") | |||||
| @Excel(name = "消费金额(元)", width = 20, orderNum = "10") | |||||
| private String deductionAmountStr; | private String deductionAmountStr; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @Excel(name = "应付金额(元)", width = 20, orderNum = "9") | |||||
| @Excel(name = "应付金额(元)", width = 20, orderNum = "11") | |||||
| private String paymentStr; | private String paymentStr; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @Excel(name = "实付金额(扣除手续费/元)", width = 20, orderNum = "8") | |||||
| @Excel(name = "实付金额(扣除手续费/元)", width = 20, orderNum = "12") | |||||
| private String realPaymentStr; | private String realPaymentStr; | ||||
| @@ -124,7 +125,7 @@ public class WxCardSpend extends TenantEntity { | |||||
| } | } | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @Excel(name = "卡余额(元) ", width = 20, orderNum = "10") | |||||
| @Excel(name = "卡余额(元) ", width = 20, orderNum = "13") | |||||
| private String cardRemainAmountStr; | private String cardRemainAmountStr; | ||||
| public String getDeductionAmountStr() { | public String getDeductionAmountStr() { | ||||
| @@ -36,10 +36,10 @@ public class WxCardSpendVo extends WxCardSpend { | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName") | @io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName") | ||||
| @Excel(name = "消费商户", width = 20, orderNum = "6") | @Excel(name = "消费商户", width = 20, orderNum = "6") | ||||
| private String merchantName; | private String merchantName; | ||||
| @Excel(name = "补贴额(包含通道费)", width = 20, orderNum = "6") | |||||
| @Excel(name = "补贴额(包含通道费)", width = 20, orderNum = "15") | |||||
| @io.swagger.annotations.ApiModelProperty(value="补贴额(包含通道费)",name="subsidy") | @io.swagger.annotations.ApiModelProperty(value="补贴额(包含通道费)",name="subsidy") | ||||
| private Integer subsidy; | private Integer subsidy; | ||||
| @Excel(name = "线上补贴额/实收补贴额(通道费扣除)", width = 20, orderNum = "7") | |||||
| @Excel(name = "线上补贴额/实收补贴额(通道费扣除)", width = 20, orderNum = "16") | |||||
| @io.swagger.annotations.ApiModelProperty(value="线上补贴额/实收补贴额(通道费扣除)",name="realSubsidy") | @io.swagger.annotations.ApiModelProperty(value="线上补贴额/实收补贴额(通道费扣除)",name="realSubsidy") | ||||
| private Integer realSubsidy; | private Integer realSubsidy; | ||||
| @io.swagger.annotations.ApiModelProperty(value="补贴状态(0:未补贴, 1:已补贴)",name="status") | @io.swagger.annotations.ApiModelProperty(value="补贴状态(0:未补贴, 1:已补贴)",name="status") | ||||
| @@ -531,10 +531,11 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| } | } | ||||
| private List<WxCardSpendVo> handleToCardSpendVoList(List<WxCardSpend> list,TenantEntity tenantEntity) { | private List<WxCardSpendVo> handleToCardSpendVoList(List<WxCardSpend> list,TenantEntity tenantEntity) { | ||||
| List<WxCardSpendVo> retList = new ArrayList<WxCardSpendVo>(); | |||||
| if (null != list && list.size() > 0 ){ | if (null != list && list.size() > 0 ){ | ||||
| List<Long> merchantIdList = new ArrayList<Long>(); | List<Long> merchantIdList = new ArrayList<Long>(); | ||||
| List<Long> cardInfoIdList = new ArrayList<Long>(); | List<Long> cardInfoIdList = new ArrayList<Long>(); | ||||
| List<Long> merchantSubsidyOrderIdList = new ArrayList<Long>(); | |||||
| // List<Long> merchantSubsidyOrderIdList = new ArrayList<Long>(); | |||||
| List<Long> userIdList = new ArrayList<Long>(); | List<Long> userIdList = new ArrayList<Long>(); | ||||
| List<Long> couponIdList = new ArrayList<Long>(); | List<Long> couponIdList = new ArrayList<Long>(); | ||||
| for (int i = 0 ; i < list.size(); i++ ){ | for (int i = 0 ; i < list.size(); i++ ){ | ||||
| @@ -545,9 +546,9 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| if (null != _wcs.getCardId() && (!cardInfoIdList.contains(_wcs.getCardId()))) { | if (null != _wcs.getCardId() && (!cardInfoIdList.contains(_wcs.getCardId()))) { | ||||
| cardInfoIdList.add(_wcs.getCardId()) ; | cardInfoIdList.add(_wcs.getCardId()) ; | ||||
| } | } | ||||
| if (null != _wcs.getOrderId() && (!merchantSubsidyOrderIdList.contains(_wcs.getOrderId()))) { | |||||
| merchantSubsidyOrderIdList.add(_wcs.getOrderId()) ; | |||||
| } | |||||
| // if (null != _wcs.getOrderId() && (!merchantSubsidyOrderIdList.contains(_wcs.getOrderId()))) { | |||||
| // merchantSubsidyOrderIdList.add(_wcs.getOrderId()) ; | |||||
| // } | |||||
| if (null != _wcs.getOwnerId() && (!userIdList.contains(_wcs.getOwnerId()))) { | if (null != _wcs.getOwnerId() && (!userIdList.contains(_wcs.getOwnerId()))) { | ||||
| userIdList.add(_wcs.getOwnerId()) ; | userIdList.add(_wcs.getOwnerId()) ; | ||||
| } | } | ||||
| @@ -555,8 +556,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| } | } | ||||
| Map<Long,WxMerchant> merchantMap = getMerchantMap(merchantIdList, tenantEntity); | Map<Long,WxMerchant> merchantMap = getMerchantMap(merchantIdList, tenantEntity); | ||||
| Map<Long,Long> cardCouponIdMap = new HashMap<Long,Long>(); | Map<Long,Long> cardCouponIdMap = new HashMap<Long,Long>(); | ||||
| Map<Long,WxCardInfo> cardInfoMap = new HashMap<Long,WxCardInfo>(); | Map<Long,WxCardInfo> cardInfoMap = new HashMap<Long,WxCardInfo>(); | ||||
| if (cardInfoIdList.size() > 0 ){ | if (cardInfoIdList.size() > 0 ){ | ||||
| @@ -578,11 +578,11 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| Map<Long,WxCoupon> couponMap = getCouponMap(couponIdList, tenantEntity); | Map<Long,WxCoupon> couponMap = getCouponMap(couponIdList, tenantEntity); | ||||
| Map<Long,WxMerchantSubsidy> orderSubsidyMap = getOrderSubsidyMap(merchantSubsidyOrderIdList, tenantEntity); | |||||
| // Map<Long,WxMerchantSubsidy> orderSubsidyMap = getOrderSubsidyMap(merchantSubsidyOrderIdList, tenantEntity); | |||||
| Map<Long,WxCUserBasicInfo> userMap = getUserMap(userIdList, tenantEntity); | Map<Long,WxCUserBasicInfo> userMap = getUserMap(userIdList, tenantEntity); | ||||
| List<WxCardSpendVo> retList = new ArrayList<WxCardSpendVo>(); | |||||
| for (int i = 0 ; i < list.size(); i++ ){ | for (int i = 0 ; i < list.size(); i++ ){ | ||||
| WxCardSpend _wcs = list.get(i); | WxCardSpend _wcs = list.get(i); | ||||
| WxCardSpendVo vo = new WxCardSpendVo(); | WxCardSpendVo vo = new WxCardSpendVo(); | ||||
| @@ -608,14 +608,14 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| vo.setWxCardInfo(cardInfo); | vo.setWxCardInfo(cardInfo); | ||||
| } | } | ||||
| } | } | ||||
| if (null != _wcs.getOrderId()) { | |||||
| WxMerchantSubsidy subsidy = orderSubsidyMap.get(_wcs.getOrderId()); | |||||
| if (null != subsidy) { | |||||
| vo.setSubsidy(subsidy.getSubsidy()); | |||||
| vo.setRealSubsidy(subsidy.getRealSubsidy()); | |||||
| vo.setStatus(subsidy.getStatus()); | |||||
| } | |||||
| } | |||||
| // if (null != _wcs.getOrderId()) { | |||||
| // WxMerchantSubsidy subsidy = orderSubsidyMap.get(_wcs.getOrderId()); | |||||
| // if (null != subsidy) { | |||||
| // vo.setSubsidy(subsidy.getSubsidy()); | |||||
| // vo.setRealSubsidy(subsidy.getRealSubsidy()); | |||||
| // vo.setStatus(subsidy.getStatus()); | |||||
| // } | |||||
| // } | |||||
| if (null != _wcs.getOwnerId()) { | if (null != _wcs.getOwnerId()) { | ||||
| WxCUserBasicInfo user = userMap.get(_wcs.getOwnerId()); | WxCUserBasicInfo user = userMap.get(_wcs.getOwnerId()); | ||||
| if (null != user) { | if (null != user) { | ||||
| @@ -632,7 +632,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| } | } | ||||
| return retList; | return retList; | ||||
| } | } | ||||
| return null; | |||||
| return retList; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -692,7 +692,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| record.setMerchantIdList(merchantIds); | record.setMerchantIdList(merchantIds); | ||||
| } | } | ||||
| } | } | ||||
| if(EnumCardInfoType.CARD.equals(record.getCardType()) && record.getCardId() != null){ | |||||
| if(EnumCardInfoType.CARD.getCode().equals(record.getCardType()) && record.getCardId() != null){ | |||||
| WxCardInfo cardInfo = wxCardInfoService.getByCouponPasswordId(record.getCardId(), record); | WxCardInfo cardInfo = wxCardInfoService.getByCouponPasswordId(record.getCardId(), record); | ||||
| if(cardInfo == null){ | if(cardInfo == null){ | ||||
| record.setId(-999L); | record.setId(-999L); | ||||
| @@ -853,7 +853,10 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { | |||||
| refundOrderQ.setOrderId(orderId); | refundOrderQ.setOrderId(orderId); | ||||
| refundOrderQ.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | refundOrderQ.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | ||||
| List<WxRefundOrder> list = wxRefundOrderMapper.findList(refundOrderQ); | List<WxRefundOrder> list = wxRefundOrderMapper.findList(refundOrderQ); | ||||
| return list.get(0); | |||||
| if(list != null && !list.isEmpty()){ | |||||
| return list.get(0); | |||||
| } | |||||
| return null; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -1294,6 +1297,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { | |||||
| WxRefundOrder updateOrder = new WxRefundOrder(); | WxRefundOrder updateOrder = new WxRefundOrder(); | ||||
| updateOrder.setId(refundOrder.getId()); | updateOrder.setId(refundOrder.getId()); | ||||
| updateOrder.updateTenantInfo(refundOrder); | |||||
| updateOrder.setOrderId(refundOrder.getOrderId()); | updateOrder.setOrderId(refundOrder.getOrderId()); | ||||
| updateOrder.setUpdateTime(currentDate); | updateOrder.setUpdateTime(currentDate); | ||||
| updateOrder.setRefundOrderStatus(EnumRefundStatus.REFUND_SUCCESS.getCode()); | updateOrder.setRefundOrderStatus(EnumRefundStatus.REFUND_SUCCESS.getCode()); | ||||
| @@ -1308,10 +1312,10 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { | |||||
| } | } | ||||
| WxOrder refOrder = new WxOrder(); | WxOrder refOrder = new WxOrder(); | ||||
| refOrder.setId(updateOrder.getId()); | |||||
| refOrder.updateTenantInfo(wxOrder); | |||||
| refOrder.setId(wxOrder.getId()); | |||||
| refOrder.setOrderStatus(EnumOrderStatus.ORDER_STATUS_REFUND_SUCCESS.getCode()); | refOrder.setOrderStatus(EnumOrderStatus.ORDER_STATUS_REFUND_SUCCESS.getCode()); | ||||
| refOrder.setUpdateDate(currentDate); | refOrder.setUpdateDate(currentDate); | ||||
| refOrder.updateTenantInfo(updateOrder); | |||||
| try { | try { | ||||
| int i = wxOrderMapper.updateById(refOrder); | int i = wxOrderMapper.updateById(refOrder); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -1453,10 +1457,11 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { | |||||
| WxRefundOrder updateOrder = new WxRefundOrder(); | WxRefundOrder updateOrder = new WxRefundOrder(); | ||||
| updateOrder.setId(refundOrder.getId()); | updateOrder.setId(refundOrder.getId()); | ||||
| updateOrder.updateTenantInfo(refundOrder); | |||||
| updateOrder.setOrderId(refundOrder.getOrderId()); | updateOrder.setOrderId(refundOrder.getOrderId()); | ||||
| updateOrder.setUpdateTime(currentDate); | updateOrder.setUpdateTime(currentDate); | ||||
| updateOrder.setRefundOrderStatus(EnumRefundStatus.REFUND_FAIL.getCode()); | updateOrder.setRefundOrderStatus(EnumRefundStatus.REFUND_FAIL.getCode()); | ||||
| updateOrder.setFailReason(remark); | |||||
| updateOrder.setRefundDescription(remark); | |||||
| // updateOrder.setTransactionId(transactionId); | // updateOrder.setTransactionId(transactionId); | ||||
| // updateOrder.setRefundId(record.getId().toString()); | // updateOrder.setRefundId(record.getId().toString()); | ||||
| // 修改退款订单状态 | // 修改退款订单状态 | ||||
| @@ -1468,7 +1473,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { | |||||
| } | } | ||||
| WxOrder refOrder = new WxOrder(); | WxOrder refOrder = new WxOrder(); | ||||
| refOrder.setId(updateOrder.getId()); | |||||
| refOrder.setId(wxOrder.getId()); | |||||
| refOrder.updateTenantInfo(wxOrder); | refOrder.updateTenantInfo(wxOrder); | ||||
| refOrder.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); | refOrder.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); | ||||
| refOrder.setUpdateDate(currentDate); | refOrder.setUpdateDate(currentDate); | ||||