| @@ -1 +1 @@ | |||||
| alter table wx_merchant add column credit_locked tinyint(1) default 0 not null comment '0开放1锁定'; | |||||
| alter table wx_merchant add column credit_locked tinyint(2) default 0 not null comment '0开放1锁定'; | |||||
| @@ -1 +1 @@ | |||||
| alter table wx_score_rules add column credit_locked tinyint(1) default 0 not null comment '0开放1锁定'; | |||||
| alter table wx_score_rules add column credit_locked tinyint(2) default 0 not null comment '0开放1锁定'; | |||||
| @@ -0,0 +1 @@ | |||||
| alter table wx_credit_history add column buserId bigint(20) default 0 not null comment 'B端微信用户ID'; | |||||
| @@ -150,7 +150,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| logger.error("核销员ID不存在:" + getUser().getId()); | logger.error("核销员ID不存在:" + getUser().getId()); | ||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "核销员ID不存在或者无权限"); | throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "核销员ID不存在或者无权限"); | ||||
| } | } | ||||
| wxMerchantBUser.setBuserId(getBuserId()); | |||||
| WxCouponOrder couponOrder = null; | WxCouponOrder couponOrder = null; | ||||
| try { | try { | ||||
| couponOrder = wxCouponOrderService.verify(wxCouponOrder, wxMerchantBUser); | couponOrder = wxCouponOrderService.verify(wxCouponOrder, wxMerchantBUser); | ||||
| @@ -9,13 +9,14 @@ import com.iformall.domain.po.WxCreditHistory; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.vo.WxCreditHistoryVo; | import com.iformall.domain.vo.WxCreditHistoryVo; | ||||
| import com.iformall.domain.vo.WxMerchantVo; | |||||
| import com.iformall.enums.*; | |||||
| import com.iformall.enums.EnumMerchantStatus; | |||||
| import com.iformall.enums.EnumScoreType; | |||||
| import com.iformall.enums.EnumUserType; | |||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | import com.iformall.service.WxCUserBasicInfoService; | ||||
| import com.iformall.service.WxCreditHistoryService; | import com.iformall.service.WxCreditHistoryService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.utils.UserUtil; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -114,6 +115,7 @@ public class WxCreditHistoryController extends BaseController { | |||||
| wxCreditHistory.setOperatorType(EnumUserType.BUSER.getCode()); | wxCreditHistory.setOperatorType(EnumUserType.BUSER.getCode()); | ||||
| try { | try { | ||||
| wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId()); | wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId()); | ||||
| wxCreditHistory.setBuserId(getBuser().getId()); | |||||
| WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | ||||
| return new ResultData(Result.SUCCESS, "操作成功", credit); | return new ResultData(Result.SUCCESS, "操作成功", credit); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| @@ -70,5 +70,8 @@ public class WxCreditHistory extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "小票号", name = "ticketNumber") | @io.swagger.annotations.ApiModelProperty(value = "小票号", name = "ticketNumber") | ||||
| private String ticketNumber; | private String ticketNumber; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "B端微信用户", name = "buserId") | |||||
| private Long buserId; | |||||
| } | } | ||||
| @@ -40,6 +40,8 @@ public class WxMerchantBUser extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "绑定状态1未绑定商户0已绑定商户", name = "status") | @io.swagger.annotations.ApiModelProperty(value = "绑定状态1未绑定商户0已绑定商户", name = "status") | ||||
| private Integer status; | private Integer status; | ||||
| private transient Long buserId; | |||||
| public String createToken(Date currentDate) { | public String createToken(Date currentDate) { | ||||
| if (expireTime == null || expireTime.getTime() - Constant.H_EXPIRE < currentDate.getTime()) { | if (expireTime == null || expireTime.getTime() - Constant.H_EXPIRE < currentDate.getTime()) { | ||||
| //提前一小时, 新生成一个token | //提前一小时, 新生成一个token | ||||
| @@ -381,6 +381,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| creditHistory.setSpend(couponOrder.getCouponPrice()); | creditHistory.setSpend(couponOrder.getCouponPrice()); | ||||
| //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | ||||
| creditHistory.setMerchantId(bUser.getMerchantId()); | creditHistory.setMerchantId(bUser.getMerchantId()); | ||||
| creditHistory.setBuserId(bUser.getBuserId()); | |||||
| wxCreditHistoryService.saveOrUpdate(creditHistory); | wxCreditHistoryService.saveOrUpdate(creditHistory); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("积分值:" + e.getMessage()); | logger.error("积分值:" + e.getMessage()); | ||||
| @@ -18,11 +18,11 @@ | |||||
| <result column="spend" jdbcType="INTEGER" property="spend" /> | <result column="spend" jdbcType="INTEGER" property="spend" /> | ||||
| <result column="change_purpose" jdbcType="VARCHAR" property="changePurpose" /> | <result column="change_purpose" jdbcType="VARCHAR" property="changePurpose" /> | ||||
| <result column="ticket_number" jdbcType="VARCHAR" property="ticketNumber"/> | <result column="ticket_number" jdbcType="VARCHAR" property="ticketNumber"/> | ||||
| <result column="buser_id" jdbcType="BIGINT" property="buserId"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`c_user_id`,`credit_amount`,`credit_num`,`credit_type`,`create_date`,`receipt_url`,`operator_type`,`operator_id`,`merchant_id`,`coupon_id`,`business_id`,`spend`,`change_purpose`,`ticket_number` | |||||
| `id`,`tenant_id`,`c_user_id`,`credit_amount`,`credit_num`,`credit_type`,`create_date`,`receipt_url`,`operator_type`,`operator_id`,`merchant_id`,`coupon_id`,`business_id`,`spend`,`change_purpose`,`ticket_number`,`buser_id` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -69,6 +69,11 @@ | |||||
| <if test=" null != ticketNumber and ''!=ticketNumber "> | <if test=" null != ticketNumber and ''!=ticketNumber "> | ||||
| and ticket_number like concat('%', #{ticketNumber},'%') | and ticket_number like concat('%', #{ticketNumber},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != buserId "> | |||||
| and `buser_id` = #{buserId} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -116,6 +121,11 @@ | |||||
| <if test=" null != ticketNumber and ''!=ticketNumber "> | <if test=" null != ticketNumber and ''!=ticketNumber "> | ||||
| and credit.ticket_number like concat('%', #{ticketNumber},'%') | and credit.ticket_number like concat('%', #{ticketNumber},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != buserId "> | |||||
| and credit.buser_id = #{buserId} | |||||
| </if> | |||||
| </sql> | </sql> | ||||
| <select id="findList" parameterType="com.iformall.domain.po.WxCreditHistory" resultMap="BaseResultMap"> | <select id="findList" parameterType="com.iformall.domain.po.WxCreditHistory" resultMap="BaseResultMap"> | ||||