| @@ -52,4 +52,7 @@ public class WxCreditHistoryVo { | |||||
| @io.swagger.annotations.ApiModelProperty(value="操作人",name="operator") | @io.swagger.annotations.ApiModelProperty(value="操作人",name="operator") | ||||
| private String operator; | private String operator; | ||||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||||
| private Long merchantId; | |||||
| } | } | ||||
| @@ -0,0 +1,32 @@ | |||||
| package com.iformall.enums; | |||||
| public enum EnumMerchantType { | |||||
| MERCHANT_MORE(-1, "多商户") | |||||
| ; | |||||
| public static EnumMerchantType getEnum(Integer code) { | |||||
| for (EnumMerchantType value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumMerchantType(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -10,10 +10,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxCreditHistoryVo; | import com.iformall.domain.vo.WxCreditHistoryVo; | ||||
| import com.iformall.enums.EnumBusiness; | |||||
| import com.iformall.enums.EnumScoreRules; | |||||
| import com.iformall.enums.EnumScoreType; | |||||
| import com.iformall.enums.EnumUserType; | |||||
| import com.iformall.enums.*; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.WxCreditHistoryService; | import com.iformall.service.WxCreditHistoryService; | ||||
| @@ -141,6 +138,9 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||||
| } | } | ||||
| }); | }); | ||||
| } | } | ||||
| if (Long.valueOf(EnumMerchantType.MERCHANT_MORE.getCode()).equals(credit.getMerchantId())) { | |||||
| credit.setMerchantName(EnumMerchantType.MERCHANT_MORE.getMessage()); | |||||
| } | |||||
| } | } | ||||
| return new PageInfo<>(wxCreditHistoryVoList); | return new PageInfo<>(wxCreditHistoryVoList); | ||||
| } | } | ||||
| @@ -968,7 +968,19 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| creditHistory.setCouponId(coupon.getId()); | creditHistory.setCouponId(coupon.getId()); | ||||
| creditHistory.setBusinessId(Long.valueOf(coupon.getBusiness())); | creditHistory.setBusinessId(Long.valueOf(coupon.getBusiness())); | ||||
| creditHistory.setSpend(updateOrder.getPayment()); | creditHistory.setSpend(updateOrder.getPayment()); | ||||
| //creditHistory.setMerchantId(wxMerchant.getId()); | |||||
| //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | |||||
| WxCouponMerchant wxCouponMerchant = new WxCouponMerchant(); | |||||
| wxCouponMerchant.setProductId(coupon.getId()); | |||||
| wxCouponMerchant.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); | |||||
| List<WxCouponMerchant> list = wxCouponMerchantMapper.findList(wxCouponMerchant); | |||||
| if (list != null && list.size() > 0) { | |||||
| if (list.size() == 1) { | |||||
| creditHistory.setMerchantId(list.get(0).getMerchantId()); | |||||
| } | |||||
| if (list.size() > 1) { | |||||
| creditHistory.setMerchantId(Long.valueOf(EnumMerchantType.MERCHANT_MORE.getCode())); | |||||
| } | |||||
| } | |||||
| wxCreditHistoryService.saveOrUpdate(creditHistory); | wxCreditHistoryService.saveOrUpdate(creditHistory); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("积分值:" + e.getMessage()); | logger.error("积分值:" + e.getMessage()); | ||||
| @@ -124,7 +124,8 @@ | |||||
| credit.receipt_url receiptUrl, | credit.receipt_url receiptUrl, | ||||
| credit.operator_type operatorType, | credit.operator_type operatorType, | ||||
| credit.operator_id operatorId, | credit.operator_id operatorId, | ||||
| merchant.NAME merchantName | |||||
| merchant.NAME merchantName, | |||||
| credit.merchant_id merchantId | |||||
| FROM | FROM | ||||
| wx_c_user_basic_info basic | wx_c_user_basic_info basic | ||||
| INNER JOIN wx_credit_history credit ON basic.id = credit.c_user_id | INNER JOIN wx_credit_history credit ON basic.id = credit.c_user_id | ||||