|
|
|
@@ -189,6 +189,8 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
record.setCreateDate(new Date()); |
|
|
|
//根据merchantIds判断券对应的商户是否为多商户 来赋值merchantId |
|
|
|
setMerchantId(record); |
|
|
|
wxCreditHistoryMapper.insertSelective(record); |
|
|
|
//将计算出来新的总积分 更新到两张用户表里 |
|
|
|
if (wxCUser != null) { |
|
|
|
@@ -210,6 +212,16 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { |
|
|
|
return record; |
|
|
|
} |
|
|
|
|
|
|
|
private void setMerchantId(WxCreditHistory record) { |
|
|
|
if (record.getMerchantIds() != null && record.getMerchantIds().size() > 0) { |
|
|
|
if (record.getMerchantIds().size() == 1) { |
|
|
|
record.setMerchantId(record.getMerchantIds().get(0)); |
|
|
|
} else { |
|
|
|
record.setMerchantId(Long.valueOf(EnumMerchantType.MERCHANT_MORE.getCode())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void deleteById(Long id) { |
|
|
|
wxCreditHistoryMapper.deleteByPrimaryKey(id); |
|
|
|
|