Commit d0f85037 by 林永健

feat(integral): 新增平台方信息支持并查询赋值

1 parent 138598b0
...@@ -250,4 +250,12 @@ public class IntegralTransferOut implements Serializable { ...@@ -250,4 +250,12 @@ public class IntegralTransferOut implements Serializable {
@Transient @Transient
private String remark; private String remark;
@ApiModelProperty(notes = "平台方商户号(逗号拼接)")
@Column(name = "reality_platform_merchant_id")
private String realityMerchantId;
@ApiModelProperty(notes = "平台方商户名称(逗号拼接)")
@Column(name = "reality_platform_merchant_name")
private String realityMerchantName;
} }
\ No newline at end of file \ No newline at end of file
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId> <artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.0.0-SNAPSHOT</version> <version>5.5.5-SNAPSHOT</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<artifactId>rpc-scrm-shopmall-api</artifactId> <artifactId>rpc-scrm-shopmall-api</artifactId>
......
package cn.com.glsx.scrm.shopmall.config.dubbo; package cn.com.glsx.scrm.shopmall.config.dubbo;
import cn.com.glsx.dj.financial.remote.NbCbAccDetailRemote; import cn.com.glsx.dj.financial.remote.NbCbAccDetailRemote;
import cn.com.glsx.dj.smartcarlife.remote.OwnerPreferenceOrderRemote; import cn.com.glsx.dj.smartcarlife.remote.*;
import cn.com.glsx.dj.smartcarlife.remote.ServiceMerchantConfigurationRemote;
import cn.com.glsx.dj.smartcarlife.remote.ServiceMerchantRemote;
import cn.com.glsx.dj.smartcarlife.remote.ServiceMerchantStaffAllocationRemote;
import cn.com.glsx.dj.smartcarlife.remote.ShopmallSubOrderRemote;
import cn.com.glsx.dj.smartcarlife.remote.VdQuotationRemote;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -54,4 +49,8 @@ public class SmartCarLifeDubboConfig extends DubboConfig{ ...@@ -54,4 +49,8 @@ public class SmartCarLifeDubboConfig extends DubboConfig{
public NbCbAccDetailRemote getNbCbAccDetailRemote(){ public NbCbAccDetailRemote getNbCbAccDetailRemote(){
return factory.builder(NbCbAccDetailRemote.class).check(check).timeout(timeout).version("1.0.0").build(); return factory.builder(NbCbAccDetailRemote.class).check(check).timeout(timeout).version("1.0.0").build();
} }
@Bean
public DivisionRuleEffectRecordRemote divisionRuleEffectRecordRemote(){
return factory.builder(DivisionRuleEffectRecordRemote.class).check(check).timeout(timeout).build();
}
} }
package cn.com.glsx.scrm.shopmall.service.integral; package cn.com.glsx.scrm.shopmall.service.integral;
import cn.com.glsx.dj.smartcarlife.dto.DivisionRuleEffectRecordDTO;
import cn.com.glsx.dj.smartcarlife.model.DivisionRuleEffectRecord;
import cn.com.glsx.dj.smartcarlife.remote.DivisionRuleEffectRecordRemote;
import cn.com.glsx.framework.core.beans.BaseModel; import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
...@@ -102,6 +105,8 @@ public class IntegralTransferOutService { ...@@ -102,6 +105,8 @@ public class IntegralTransferOutService {
@Autowired @Autowired
private MerchantStaffWithdrawalRemote staffWithdrawalRemote; private MerchantStaffWithdrawalRemote staffWithdrawalRemote;
@Autowired @Autowired
private DivisionRuleEffectRecordRemote divisionRuleEffectRecordRemote;
@Autowired
private StaffMotivationService staffMotivationService; private StaffMotivationService staffMotivationService;
@Autowired @Autowired
private MsgProducer msgProducer; private MsgProducer msgProducer;
...@@ -252,6 +257,9 @@ public class IntegralTransferOutService { ...@@ -252,6 +257,9 @@ public class IntegralTransferOutService {
log.info("保存失败, 数据为空"); log.info("保存失败, 数据为空");
return; return;
} }
// 查询平台方信息
appendRealityMerchantInfo(request);
if (request.size() > 1) { if (request.size() > 1) {
integralTransferOutMapper.insertList(request); integralTransferOutMapper.insertList(request);
} else { } else {
...@@ -262,6 +270,54 @@ public class IntegralTransferOutService { ...@@ -262,6 +270,54 @@ public class IntegralTransferOutService {
} }
/** /**
* 查询平台方信息
*/
public void appendRealityMerchantInfo(List<IntegralTransferOut> orderList) {
Boolean appendRealityMerchant = env.getProperty("scrm.shopmall.integral.append.reality.merchant", Boolean.class, true);
if (!appendRealityMerchant) {
return;
}
Collection<Integer> merchantIds = orderList.stream()
.map(IntegralTransferOut::getMerchantId)
.filter(Objects::nonNull)
.collect(Collectors.toSet());
log.info("查询平台方信息, 订单门店: {}", merchantIds);
RpcResponse<List<DivisionRuleEffectRecordDTO>> realityMerchantResponse = divisionRuleEffectRecordRemote.getAllByMerchantIds(new ArrayList<>(merchantIds));
if (realityMerchantResponse.isFailed()) {
log.error("查询平台方信息失败, 订单号: {}, 失败原因: {}", merchantIds, realityMerchantResponse.getError());
return;
}
List<DivisionRuleEffectRecordDTO> realityMerchants = realityMerchantResponse.getResult();
if (CollectionUtils.isEmpty(realityMerchants)) {
log.info("查询平台方信息为空, 订单号: {}", merchantIds);
return;
}
Map<Integer, List<DivisionRuleEffectRecordDTO>> realityMap = realityMerchants.stream()
.collect(Collectors.groupingBy(DivisionRuleEffectRecord::getMerchantId));
orderList.forEach(order -> {
if (!realityMap.containsKey(order.getMerchantId())) {
log.info("查询平台方信息为空, 订单号: {}, 门店ID: {}", order.getOutSettleOrderId(), order.getMerchantId());
return;
}
List<DivisionRuleEffectRecordDTO> ruleList = realityMap.get(order.getMerchantId());
String realityPlatformMerchantIds = ruleList.stream()
.map(DivisionRuleEffectRecordDTO::getRealityPlatformMerchantId)
.filter(StringUtils::isNotBlank)
.collect(Collectors.joining(","));
String realityPlatformMerchantNames = ruleList.stream()
.map(DivisionRuleEffectRecordDTO::getRealityPlatformMerchantName)
.filter(StringUtils::isNotBlank)
.collect(Collectors.joining(","));
log.info("查询平台方信息, 订单号: {}, 订单门店: {}, 平台方门店ID: {}, 平台方门店名称: {}",
order.getOutSettleOrderId(), order.getMerchantId(), realityPlatformMerchantIds, realityPlatformMerchantNames);
order.setRealityMerchantId(realityPlatformMerchantIds);
order.setRealityMerchantName(realityPlatformMerchantNames);
});
}
/**
* 处理不同渠道的一些特殊前置操作 * 处理不同渠道的一些特殊前置操作
*/ */
@Async @Async
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
<result column="staff_withdrawal_id" jdbcType="INTEGER" property="staffWithdrawalId" /> <result column="staff_withdrawal_id" jdbcType="INTEGER" property="staffWithdrawalId" />
<result column="merchant_id" jdbcType="INTEGER" property="merchantId" /> <result column="merchant_id" jdbcType="INTEGER" property="merchantId" />
<result column="merchant_name" jdbcType="VARCHAR" property="merchantName" /> <result column="merchant_name" jdbcType="VARCHAR" property="merchantName" />
<result column="reality_platform_merchant_id" jdbcType="VARCHAR" property="realityMerchantId" />
<result column="reality_platform_merchant_name" jdbcType="VARCHAR" property="realityMerchantName" />
<result column="transfer_type" jdbcType="TINYINT" property="transferType" /> <result column="transfer_type" jdbcType="TINYINT" property="transferType" />
<result column="customer_name" jdbcType="VARCHAR" property="customerName" /> <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
<result column="customer_phone" jdbcType="VARCHAR" property="customerPhone" /> <result column="customer_phone" jdbcType="VARCHAR" property="customerPhone" />
...@@ -56,7 +58,8 @@ ...@@ -56,7 +58,8 @@
mobile, integral_amount, pay_amount, settle_amount, out_settle_order_id, status, mobile, integral_amount, pay_amount, settle_amount, out_settle_order_id, status,
channel, payment_entity_code, payment_entity_name, pay_date, receipt_date, error_message, batch_no, created_by, created_date, channel, payment_entity_code, payment_entity_name, pay_date, receipt_date, error_message, batch_no, created_by, created_date,
updated_by, updated_date, deleted_flag, mode, source, appid, channel_provider, approval_id, updated_by, updated_date, deleted_flag, mode, source, appid, channel_provider, approval_id,
id_card_front, id_card_back, disclaimer_agreement_url,levy_code,levy_name,levy_channel_code,levy_channel_name id_card_front, id_card_back, disclaimer_agreement_url,levy_code,levy_name,levy_channel_code,levy_channel_name,
reality_platform_merchant_id,reality_platform_merchant_name
</sql> </sql>
<resultMap extends="BaseResultMap" id="DTOResultMap" type="cn.com.glsx.scrm.shopmall.dto.integral.IntegralTransferOutDTO"> <resultMap extends="BaseResultMap" id="DTOResultMap" type="cn.com.glsx.scrm.shopmall.dto.integral.IntegralTransferOutDTO">
...@@ -141,6 +144,9 @@ ...@@ -141,6 +144,9 @@
<if test="approvalId != null"> <if test="approvalId != null">
and approval_id = #{approvalId} and approval_id = #{approvalId}
</if> </if>
<if test="realityMerchantName != null and realityMerchantName != ''">
and reality_merchant_name like CONCAT('%',#{realityMerchantName},'%')
</if>
</where> </where>
order by id desc order by id desc
</select> </select>
...@@ -152,6 +158,7 @@ ...@@ -152,6 +158,7 @@
ito.channel, ito.channel_provider, ito.created_date, ito.error_message,ito.settle_amount,ito.receipt_date,ito.transfer_type,ito.mode, ito.source, ito.appid, ito.channel, ito.channel_provider, ito.created_date, ito.error_message,ito.settle_amount,ito.receipt_date,ito.transfer_type,ito.mode, ito.source, ito.appid,
ito.approval_id, itoo.`type` as itooType, itoo.updated_date as itooCreatedDate, itoo.created_by as itooCreatedBy, itoo.remark as itooRemark, ito.approval_id, itoo.`type` as itooType, itoo.updated_date as itooCreatedDate, itoo.created_by as itooCreatedBy, itoo.remark as itooRemark,
itoo.result as itooResult, itoo.result as itooResult,
ito.reality_platform_merchant_name, ito.reality_merchant_id,
ito.payment_entity_code, ito.payment_entity_name, ito.levy_code, ito.levy_name, ito.levy_channel_code, ito.levy_channel_name ito.payment_entity_code, ito.payment_entity_name, ito.levy_code, ito.levy_name, ito.levy_channel_code, ito.levy_channel_name
from shopmall_integral_transfer_out ito from shopmall_integral_transfer_out ito
left join shopmall_integral_transfer_out_operation itoo on itoo.transfer_out_id = ito.id and itoo.deleted_flag = 'N' left join shopmall_integral_transfer_out_operation itoo on itoo.transfer_out_id = ito.id and itoo.deleted_flag = 'N'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!