diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCUser.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCUser.java
index d28ea195d..4447020e2 100644
--- a/mallinkService/src/main/java/com/iformall/domain/po/WxCUser.java
+++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCUser.java
@@ -26,6 +26,8 @@ public class WxCUser extends TenantEntity {
protected Long id;
+ @io.swagger.annotations.ApiModelProperty(value="userId",name="userId")
+ private Long userId;
@io.swagger.annotations.ApiModelProperty(value="微信openId",name="openId")
private String openId;
@io.swagger.annotations.ApiModelProperty(value="微信unionId",name="unionId")
diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java
index ceed2dd95..b7aa7055b 100644
--- a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java
+++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java
@@ -28,6 +28,8 @@ public class WxCUserBasicInfo extends TenantEntity {
@JsonIgnore
protected Date scoreDate;
+ private String finalTenantId;
+
@Excel(name="姓名",width = 20,orderNum = "1")
@NotNull
@io.swagger.annotations.ApiModelProperty(value="用户姓名",name="name")
@@ -120,6 +122,14 @@ public class WxCUserBasicInfo extends TenantEntity {
@TableField(exist = false)
private Date endTime;
+ @TableField(exist = false)
+ @io.swagger.annotations.ApiModelProperty(value="操作人类型 枚举:EnumUserType",name="operatorType")
+ private Integer operatorType;
+
+ @TableField(exist = false)
+ @io.swagger.annotations.ApiModelProperty(value="操作人ID",name="operatorId")
+ private Long operatorId;
+
public String getAddressStr() {
if (address == null)
return null;
diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java
index ff0fdeab5..66ac5a842 100644
--- a/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java
+++ b/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java
@@ -151,5 +151,6 @@ public interface WxCUserBasicInfoService {
ResultData updateStatus(WxCUserBasicInfo wxCUserBasicInfo);
+ WxCUserBasicInfo getByObject(WxCUserBasicInfo wxCUserBasicInfo);
}
diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java
index 7a2c5349c..9fc729a40 100644
--- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java
+++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java
@@ -871,6 +871,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
}
}
+
// update 昵称
{
// check c_user 是否存在
@@ -1021,5 +1022,15 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
wxCUserBasicInfoMapper.updateById(wxCUserBasicInfo);
return new ResultData();
}
+
+ @Override
+ public WxCUserBasicInfo getByObject(WxCUserBasicInfo wxCUserBasicInfo) {
+ try {
+ return wxCUserBasicInfoMapper.selectOne(new QueryWrapper(wxCUserBasicInfo));
+ } catch (Exception e) {
+ logger.error("NOT found: " + e.getMessage());
+ }
+ return null;
+ }
}
diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
index 74677ba3d..a794feb14 100644
--- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
@@ -995,14 +995,7 @@
ifnull(round(
(select sum(ss.money) from (
- select ms.subsidy money,mm.id
- from wx_merchant_subsidy ms
- left join wx_coupon_order co on co.id = ms.coupon_order_id
- left join wx_coupon c on c.id = co.coupon_id
- left join wx_merchant mm on mm.id = ms.merchant_id
- left join wx_card_spend cs on cs.order_id = ms.order_id
- left join wx_c_user cu on cu.id = cs.owner_id
- where ms.status = 0
+ select subsidy money,merchant_id id from wx_merchant_subsidy where status = 0
union all
select receive_pay money,merchant_id id from wx_bill_rent_deposit where status = 3
union all
@@ -1039,14 +1032,7 @@
)/100,2),0)-
ifnull(round(
(select sum(ss.money) from (
- select ms.subsidy money,mm.id
- from wx_merchant_subsidy ms
- left join wx_coupon_order co on co.id = ms.coupon_order_id
- left join wx_coupon c on c.id = co.coupon_id
- left join wx_merchant mm on mm.id = ms.merchant_id
- left join wx_card_spend cs on cs.order_id = ms.order_id
- left join wx_c_user cu on cu.id = cs.owner_id
- where ms.order_type in(3,0) and ms.status = 0
+ select subsidy money,merchant_id id from wx_merchant_subsidy where order_type in(3,0) and status = 0
union all
select receive_pay money,merchant_id id from wx_bill_rent_deposit where status = 3
union all
diff --git a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
index 6021edd5d..f83f58412 100644
--- a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
@@ -15,6 +15,7 @@
+
@@ -28,7 +29,7 @@
`id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`,
- `create_date`,`update_date`,`tenant_id`,`parent_tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record`
+ `create_date`,`update_date`,`tenant_id`,`parent_tenant_id`,`final_tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record`
,(select level from wx_level_config
where poins >= points and tenant_id=wcubi.tenant_id
order by points desc limit 1 ) level,status
@@ -47,6 +48,9 @@
and `parent_tenant_id` = #{parentTenantId}
+
+ and `final_tenant_id` = #{finalTenantId}
+
and `phone` like concat('%', #{phone},'%')
@@ -231,7 +235,7 @@
+
+ and `user_id` = #{userId}
+
+
and `tenant_id` = #{tenantId}
@@ -311,7 +316,7 @@
- select id,nick_name,phone,create_date,scene_address from wx_c_user where 1=1
+ select id,user_id,nick_name,phone,create_date,scene_address from wx_c_user where 1=1
and `tenant_id` = #{tenantId}
diff --git a/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml
index 6eb23e019..0f16b90d3 100644
--- a/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml
@@ -128,9 +128,10 @@
ci.`amount`,ci.`sale_amount`,ci.`remaining_amount`,ci.`service_fee_amount`,
ci.`share_fee_amount`,ci.`remaining_share_fee_amount`, ci.`rate_amount`,
ci.`create_date`,ci.`update_date`,
- c.`cover_img`, c.`cover_picture`,c.`detail_picture`,c.`title`, c.`sub_title`, c.`detail`, c.`unit`, c.`remark`, c.`sale_price`, c.`price`, c.`subsidy_type`, c.`subsidy_num`,
+ c.`cover_img`, c.`cover_picture`,c.`detail_picture`,c.`title`, c.`sub_title`, c.`detail`,
+ c.`unit`, c.`remark`, c.`sale_price`, c.`price`, c.`subsidy_type`, c.`subsidy_num`,
co.`c_user_id`, co.`owner_id`, co.`expired_time`, co.`coupon_order_status` as status,
- cu.`nick_name` as c_nick_name, ou.`nick_name` as o_nick_name, ou.`phone` as ou_phone
+ ou.`nick_name` as c_nick_name, ou.`nick_name` as o_nick_name, ou.`phone` as ou_phone
@@ -210,8 +211,7 @@
from wx_card_info ci
left join wx_coupon c on c.id = ci.coupon_id
left join wx_coupon_order co on co.id = ci.id
- left join wx_c_user cu on cu.id = co.c_user_id
- left join wx_c_user ou on ou.id = co.owner_id
+ left join wx_c_user_basic_info ou on ou.id = co.owner_id
diff --git a/mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml b/mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml
index d2c7e28b4..77f29538f 100644
--- a/mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml
@@ -411,7 +411,7 @@
left join wx_coupon c on c.id = co.coupon_id
left join wx_merchant m on m.id = cs.merchant_id
left join wx_merchant_subsidy ms on ms.order_id = cs.order_id
- left join wx_c_user ou on ou.id = co.owner_id
+ left join wx_c_user_basic_info ou on ou.id = co.owner_id
order by cs.create_date DESC
@@ -428,7 +428,7 @@
left join wx_coupon c on c.id = co.coupon_id
left join wx_merchant m on m.id = cs.merchant_id
left join wx_merchant_subsidy ms on ms.order_id = cs.order_id
- left join wx_c_user ou on ou.id = co.owner_id
+ left join wx_c_user_basic_info ou on ou.id = co.owner_id
group by cs.merchant_id
@@ -445,7 +445,7 @@
left join wx_coupon c on c.id = co.coupon_id
left join wx_merchant m on m.id = cs.merchant_id
left join wx_merchant_subsidy ms on ms.order_id = cs.order_id
- left join wx_c_user ou on ou.id = co.owner_id
+ left join wx_c_user_basic_info ou on ou.id = co.owner_id
group by cs.owner_id
diff --git a/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml
index 604c699f5..f26652927 100644
--- a/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml
@@ -313,7 +313,7 @@
LEFT JOIN wx_coupon_send cs ON cal.channel_id = cs.id
LEFT JOIN wx_coupon_order co ON cal.coupon_order_id = co.id
LEFT JOIN wx_coupon c ON cal.coupon_id = c.id
- LEFT JOIN wx_c_user cu ON cu.id = co.c_user_id
+ LEFT JOIN wx_c_user_basic_info cu ON cu.id = co.c_user_id
LEFT JOIN wx_merchant_b_user mbu ON concat(mbu.merchant_id,'') = JSON_EXTRACT(cs.conditions , '$.id')
WHERE cal.channel_type = #{channelType}
AND cs.conditions -> '$.id' = concat(#{merchantId},'')
diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml
index 9cc65084b..29eec0839 100644
--- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml
@@ -747,7 +747,8 @@
- co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,
+ co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,
+ co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,
c.type,c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,ms.subsidy subsidy_num,
bu.name, bu.phone as bphone,
cu.phone,
@@ -756,46 +757,31 @@
select
-
-
+
FROM (
SELECT wcm.product_id,wcm.merchant_id,COUNT(1) AS mc
FROM wx_coupon_merchant wcm
- WHERE STATUS = 0 AND wcm.tenant_id = #{tenantId} GROUP BY product_id) couc
+ WHERE STATUS = 0
+
+ and wcm.`tenant_id` = #{tenantId}
+
+
+ and wcm.`parent_tenant_id` = #{parentTenantId}
+
+ GROUP BY product_id) couc
RIGHT JOIN (
SELECT co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.c_user_id,co.b_user_id,co.coupon_type,
co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price
- FROM wx_coupon_order co
- WHERE co.tenant_id = #{tenantId}) co
+ FROM wx_coupon_order co WHERE 1=1
+
+ and co.`tenant_id` = #{tenantId}
+
+
+ and co.`parent_tenant_id` = #{parentTenantId}
+
+ ) co
ON co.coupon_id = couc.product_id
- INNER JOIN wx_c_user cu ON cu.id=co.c_user_id
+ INNER JOIN wx_c_user_basic_info cu ON cu.id=co.c_user_id
LEFT JOIN wx_coupon c ON c.id = co.coupon_id
LEFT JOIN wx_merchant m1 ON m1.id = couc.merchant_id
LEFT JOIN wx_merchant_subsidy ms ON co.id = ms.coupon_order_id AND ms.type = 1
@@ -889,7 +875,7 @@
select
from wx_coupon c, wx_coupon_order co
- left join wx_c_user cu on cu.id = co.c_user_id
+ left join wx_c_user_basic_info cu on cu.id = co.c_user_id
left join wx_merchant_b_user bu on co.b_user_id = bu.id
left join wx_merchant m on m.id = bu.merchant_id
left join wx_merchant_subsidy ms on co.id = ms.coupon_order_id and ms.type = 1
@@ -913,7 +899,7 @@
select
- from wx_coupon_order co,wx_coupon c,wx_c_user cu,wx_coupon_merchant cm,
+ from wx_coupon_order co,wx_coupon c,wx_c_user_basic_info cu,wx_coupon_merchant cm,
(select tco.id as tcoid,
(select count(*) from wx_coupon_merchant tcm
where tcm.product_id = tco.coupon_id
@@ -938,7 +924,7 @@
select
- from wx_coupon_order co,wx_coupon c,wx_c_user cu,wx_merchant_b_user bu
+ from wx_coupon_order co,wx_coupon c,wx_c_user_basic_info cu,wx_merchant_b_user bu
where co.coupon_id = c.id
and cu.id = co.c_user_id
and bu.id = co.b_user_id
diff --git a/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml b/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml
index aacd0cdc4..3ec5cb34d 100644
--- a/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml
@@ -164,7 +164,7 @@
credit.ticket_number ticketNumber,
case when credit.operator_type=4 then (select name from mall_user_info where id=credit.operator_id)
when credit.operator_type=3 then (select name from wx_merchant_b_user where id=credit.operator_id)
- when credit.operator_type=1 then (select nick_name from wx_c_user where id=credit.operator_id)
+ when credit.operator_type=1 then (select nick_name from wx_c_user_basic_info where id=credit.operator_id)
else '' end operator,
credit.change_purpose changePurpose
FROM
diff --git a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml
index 8c72b2cc6..af777d8bf 100644
--- a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml
@@ -427,7 +427,7 @@
o.`id`,o.`order_number`,o.`tenant_id`,o.`parent_tenant_id`,o.`c_user_id`,o.`coupon_channel_id`,o.`product_id`,o.`type`,
o.`payment_type`,o.`payment`,o.`payment_time`,o.`order_status`,o.`create_date`,o.`update_date`,o.`detail`,
m.name as merchant_name, bu.name, bu.phone as bphone,
- cu.phone, cu.nick_name, cubi.name c_user_name
+ cubi.phone, cubi.nick_name, cubi.name c_user_name
@@ -436,7 +436,6 @@
from wx_order o
inner join wx_merchant_b_user bu on bu.id = o.product_id
inner join wx_merchant m on m.id = bu.merchant_id
- LEFT JOIN wx_c_user cu on cu.id = o.c_user_id
LEFT JOIN wx_c_user_basic_info cubi on cubi.id = o.c_user_id
where o.order_status = '1' and o.`type` = 1
@@ -491,7 +490,7 @@
o.`id`,o.`order_number`,o.`tenant_id`,o.`c_user_id`,o.`coupon_channel_id`,o.`product_id`,o.`type`,
o.`payment_type`,o.`payment`,o.`payment_time`,o.`order_status`,o.`create_date`,o.`update_date`,o.`detail`,
m.name as merchant_name, bu.name, bu.phone as bphone,
- cu.phone, cu.nick_name, cubi.name c_user_name,
+ cubi.phone, cubi.nick_name, cubi.name c_user_name,
po.id as pay_order_id, po.transaction_id
@@ -502,7 +501,6 @@
inner join wx_merchant_b_user bu on bu.id = o.product_id
inner join wx_merchant m on m.id = bu.merchant_id
left join wx_pay_order po on po.order_id = o.id
- LEFT JOIN wx_c_user cu on cu.id = o.c_user_id
LEFT JOIN wx_c_user_basic_info cubi on cubi.id = o.c_user_id
where o.order_status = '0' and o.`type` = 1
diff --git a/mallinkService/src/main/resources/mapper/WxOrderPressMapper.xml b/mallinkService/src/main/resources/mapper/WxOrderPressMapper.xml
index f2569b63f..b234d4817 100644
--- a/mallinkService/src/main/resources/mapper/WxOrderPressMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxOrderPressMapper.xml
@@ -73,7 +73,7 @@
select
from wx_order_press op
- left join wx_c_user cu on cu.id = op.user_id
+ left join wx_c_user_basic_info cu on cu.id = op.user_id
where op.`order_id` = #{orderId}
order by op.`create_date` desc