Просмотр исходного кода

Merge branch 'release_real_200809' of https://git.malls.iformall.com/server/formallProject into release_real_200809

release_toaliyun_real
xiaohanzi 5 лет назад
Родитель
Сommit
a26e264ec1
6 измененных файлов: 40 добавлений и 78 удалений
  1. +13
    -7
      mallinkAdmin/src/main/resources/db/migration/V202009041200__commercialPreferential.sql
  2. +5
    -0
      mallinkCApi/src/main/java/com/iformall/controller/BaseController.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java
  5. +4
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java
  6. +16
    -69
      mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml

+ 13
- 7
mallinkAdmin/src/main/resources/db/migration/V202009041200__commercialPreferential.sql Просмотреть файл

@@ -1,17 +1,23 @@
INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (646, '商户建券  ', 602, 'Y', NULL, 1, NULL, NULL, 'commercialPreferential', NULL, 0, 646);
--加商户发卷菜单
INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (646, '商户建券  ', 602, 'Y', NULL, 1, NULL, NULL, 'commercialPreferential', NULL, 0, 646);

--销售类型加权限
update mall_sale_type set menus = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004]' where id=1;
update mall_sale_type set menus = '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 961]' where id=2;
update mall_sale_type set menus = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932]' where id=3;

--所有广场管理员角色加权限
INSERT INTO `mall_role_permission`(`id`, `tenant_id`, `parent_tenant_id`, `permission_id`, `role_id`)
select CEILING(RAND()*90000000000+10000000000) ,mui.tenant_id,mui.parent_tenant_id,646,mur.role_id
from mall_user_info mui
left join mall_user_role mur on mui.id = mur.uid
where mui.is_admin = 1 and mur.role_id is not null GROUP BY mur.role_id

ALTER TABLE `wx_coupon`
ADD COLUMN `source_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1:A端发卷,2:B端发卷' AFTER `password_support`;



--用户
ALTER TABLE `wx_c_user_basic_info`
MODIFY COLUMN `tenant_id` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID' AFTER `id`;



ALTER TABLE `mallink`.`wx_coupon`
ADD COLUMN `source_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1:A端发卷,2:B端发卷' AFTER `password_support`;
update wx_c_user_basic_info set tenant_id = concat(",",final_tenant_id,",");

+ 5
- 0
mallinkCApi/src/main/java/com/iformall/controller/BaseController.java Просмотреть файл

@@ -238,6 +238,10 @@ public class BaseController {
if(byId != null && !byId.getPhone().equals(basicInfo.getPhone())){
return Long.valueOf(-1);
}
if(!basicInfo.getTenantId().contains(","+tenantEntity.getTenantId()+",")){
basicInfo.setTenantId(basicInfo.getTenantId()+tenantEntity.getTenantId()+",");
wxCUserBasicInfoService.update(basicInfo);
}
// WxCUserBasicInfo basicInfo = list.get(0);
// 微信名称,统一成微信昵称
// if (!Objects.equals(basicInfo.getNickName(), user.getNickName())) {
@@ -270,6 +274,7 @@ public class BaseController {
basicInfo = new WxCUserBasicInfo();
final IdWorker idWorker = IdWorker.get();
basicInfo.setId(idWorker.nextId());
basicInfo.setTenantId(","+tenantEntity.getTenantId()+",");
basicInfo.undateFinalTenantId(tenantEntity);
basicInfo.setPhone(userPhone);
basicInfo.setNickName(userName);


+ 1
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java Просмотреть файл

@@ -22,7 +22,7 @@ import java.util.Objects;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class WxCUserBasicInfo extends BaseEntity {
public class WxCUserBasicInfo extends TenantEntity {

protected Long id;



+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java Просмотреть файл

@@ -71,7 +71,7 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S
* 查找wx_c_user中不存在的用户
* @return
*/
List<WxCUserBasicInfo> selectNotCUserList();
// List<WxCUserBasicInfo> selectNotCUserList();

void cuserOldToNew(@Param(value = "oldCuserId")Long oldCuserId, @Param(value = "newCuserId")Long newCuserId);



+ 4
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java Просмотреть файл

@@ -946,6 +946,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
// }

if (oldUserBase != null) {
if(!oldUserBase.getTenantId().contains(","+mallUserInfo.getTenantId()+",")){
oldUserBase.setTenantId(oldUserBase.getTenantId()+mallUserInfo.getTenantId()+",");
}
oldUserBase.setName(userBase.getName());
oldUserBase.setSex(userBase.getSex());
oldUserBase.setNickName(userBase.getNickName());
@@ -968,6 +971,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
}
} else {
userBase.setId(idWorker.nextId());
userBase.setTenantId(","+mallUserInfo.getTenantId()+",");
userBase.setUpdateDate(userBase.getUpdateDate() == null ? new Date() : userBase.getUpdateDate());
userBase.setCreateDate(userBase.getCreateDate() == null ? new Date() : userBase.getCreateDate());
//新增积分


+ 16
- 69
mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml Просмотреть файл

@@ -146,10 +146,7 @@
</if>

<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
and wcu.`tenant_id` = #{tenantInfo.tenantId}
</if>
<if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId}
and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>

<if test=" null != basicInfo.phone ">
@@ -227,7 +224,6 @@
select
<include refid="allColumns"/>
from wx_c_user_basic_info wcubi
left join wx_c_user wcu on wcu.user_id = wcubi.id
<include refid="dynamicWhereConditions1"/>
) r where 1=1

@@ -270,7 +266,6 @@

<select id="findCountBySex1" resultType="java.lang.Long">
select count(distinct wcubi.id) from wx_c_user_basic_info wcubi
left join wx_c_user wcu on wcu.user_id = wcubi.id
where wcubi.sex =#{basicInfo.sex}
<if test=" null != basicInfo.startTime ">
and wcubi.create_date &gt;= #{basicInfo.startTime}
@@ -279,10 +274,7 @@
and wcubi.create_date &lt;= #{basicInfo.endTime}
</if>
<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
and wcu.`tenant_id` = #{tenantInfo.tenantId}
</if>
<if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId}
and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>
</select>

@@ -316,7 +308,6 @@

<select id="findCountByAge1" resultType="java.lang.Long">
select count(distinct wcubi.id) from wx_c_user_basic_info wcubi
left join wx_c_user wcu on wcu.user_id = wcubi.id
where 1=1
<if test=" null != basicInfo.startTime ">
and wcubi.create_date &gt;= #{basicInfo.startTime}
@@ -336,12 +327,8 @@
<if test=" null == basicInfo.birthStartTime and null == basicInfo.birthEndTime">
and wcubi.birthdate is null
</if>

<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
and wcu.`tenant_id` = #{tenantInfo.tenantId}
</if>
<if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId}
and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>

</select>
@@ -375,7 +362,6 @@

<select id="findCountByScore1" resultType="java.lang.Long">
select count(distinct wcubi.id) from wx_c_user_basic_info wcubi
left join wx_c_user wcu on wcu.user_id = wcubi.id
where 1=1
<if test=" null != basicInfo.startTime ">
and wcubi.create_date &gt;= #{basicInfo.startTime}
@@ -397,10 +383,7 @@
</if>

<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
and wcu.`tenant_id` = #{tenantInfo.tenantId}
</if>
<if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId}
and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>

</select>
@@ -434,7 +417,6 @@
<select id="findListByScore1" resultMap="BaseResultMap">
select <include refid="allColumnsOfScoreList"/>
from wx_c_user_basic_info cub
inner join wx_c_user cu on cu.user_id = cub.id
where cub.status=0
<if test=" null != basicInfo.levelStartScore ">
and cub.poins &gt;= #{basicInfo.levelStartScore}
@@ -448,10 +430,7 @@
and cub.poins is null
</if>
<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
and cu.`tenant_id` = #{tenantInfo.tenantId}
</if>
<if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
and cu.`parent_tenant_id` = #{tenantInfo.parentTenantId}
and cub.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>
order by cub.`active_time` DESC
</select>
@@ -459,7 +438,6 @@
<select id="findBirthdayList" resultMap="BaseResultMap">
select <include refid="allColumnsOfScoreList"/>
from wx_c_user_basic_info cub
inner join wx_c_user cu on cu.user_id = cub.id
where cub.status = 0
AND DATE_FORMAT(cub.birthdate,'%m-%d') &gt;= #{begin}
AND DATE_FORMAT(cub.birthdate,'%m-%d') &lt;= #{end}
@@ -472,15 +450,11 @@
<select id="findBirthdayList1" resultMap="BaseResultMap">
select <include refid="allColumnsOfScoreList"/>
from wx_c_user_basic_info cub
inner join wx_c_user cu on cu.user_id = cub.id
where cub.status = 0
AND DATE_FORMAT(cub.birthdate,'%m-%d') &gt;= #{begin}
AND DATE_FORMAT(cub.birthdate,'%m-%d') &lt;= #{end}
<if test=" null != tenantId and '' != tenantId">
and cu.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
and cub.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>
order by cub.`active_time` DESC
</select>
@@ -504,7 +478,6 @@

<select id="findCount1" resultType="java.lang.Long">
select count(distinct wcubi.id) from wx_c_user_basic_info wcubi
left join wx_c_user wcu on wcu.user_id = wcubi.id
where 1=1
<if test=" null != basicInfo.startTime ">
and wcubi.create_date &gt;= #{basicInfo.startTime}
@@ -513,11 +486,9 @@
and wcubi.create_date &lt; #{basicInfo.endTime}
</if>
<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
and wcu.`tenant_id` = #{tenantInfo.tenantId}
</if>
<if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId}
and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>

<if test="1 == basicInfo.queryImport">
and wcubi.create_date like '%00:00:00'
</if>
@@ -582,7 +553,6 @@

<if test="1 == basicInfo.reportType or 2 == basicInfo.reportType or 3 == basicInfo.reportType">
(select count(distinct wcubi.id) from wx_c_user_basic_info wcubi
left join wx_c_user wcu on wcu.user_id = wcubi.id
where
<if test="1 == basicInfo.reportType ">
date_format(wcubi.create_date, '%Y-%m-%d') &lt;= reportTime
@@ -594,21 +564,14 @@
date_format(wcubi.create_date, '%Y') &lt;= reportTime
</if>
<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
and wcu.`tenant_id` = #{tenantInfo.tenantId}
</if>
<if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId}
and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>
) as totalCount
</if>
from wx_c_user_basic_info wcubi
left join wx_c_user wcu on wcu.user_id = wcubi.id
where 1=1
<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
and wcu.`tenant_id` = #{tenantInfo.tenantId}
</if>
<if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId}
and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>
<if test=" null != basicInfo.startTime ">
and wcubi.create_date &gt;= #{basicInfo.startTime}
@@ -729,10 +692,7 @@
</if>

<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
and c.`tenant_id` = #{tenantInfo.tenantId}
</if>
<if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
and c.`parent_tenant_id` = #{tenantInfo.parentTenantId}
and cu.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>

<if test=" null != basicInfo.phone ">
@@ -809,7 +769,6 @@
select
<include refid="allVoColumns"/>
from wx_c_user_basic_info cu
left join wx_c_user c on c.user_id = cu.id
left join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
<include refid="dynamicVoWhereConditions1"/>
<if test=" null != basicInfo.begin ">
@@ -828,7 +787,6 @@
select
count(distinct cu.id)
from wx_c_user_basic_info cu
left join wx_c_user c on c.user_id = cu.id
left join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
<include refid="dynamicVoWhereConditions1"/>
</select>
@@ -910,10 +868,7 @@
<sql id="filterWhereConditions1">
where 1=1
<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
and c.`tenant_id` = #{tenantInfo.tenantId}
</if>
<if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
and c.`parent_tenant_id` = #{tenantInfo.parentTenantId}
and cu.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>

<if test=" null != basicInfo.startTime ">
@@ -989,7 +944,6 @@

<select id="findCountByFilter1" resultType="java.lang.Long">
select count(distinct cu.id) from wx_c_user_basic_info cu
left join wx_c_user c on c.user_id = cu.id
<if test=" null != basicInfo.tagIds ">
join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
</if>
@@ -1008,7 +962,6 @@
<select id="findListByFilter1" resultMap="BaseResultMap">
select <include refid="msgColumns"/>
from wx_c_user_basic_info cu
left join wx_c_user c on c.user_id = cu.id
<if test=" null != basicInfo.tagIds ">
join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
</if>
@@ -1030,10 +983,7 @@
left join wx_c_user cu on cubi.id=cu.user_id
where cu.id is null
<if test=" null != tenantId and '' != tenantId">
and cu.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
and cubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>
</select> -->

@@ -1051,10 +1001,7 @@
left join wx_c_user cu on cubi.id=cu.user_id
where cu.id is not null
<if test=" null != tenantId and '' != tenantId">
and cu.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
and cubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
</if>
</select>

@@ -1062,9 +1009,9 @@
UPDATE wx_c_user_basic_info set act_record = act_record +1 where id = #{id}
</update>

<select id="selectNotCUserList" resultMap="BaseResultMap">
<!--<select id="selectNotCUserList" resultMap="BaseResultMap">
select id,credit from wx_c_user_basic_info cub where not exists (select * from wx_c_user c where c.user_id=cub.id) and cub.credit is null
</select>
</select>-->

<update id="cuserOldToNew" statementType="CALLABLE" >
{call cuser_old_to_new(#{oldCuserId},#{newCuserId})}


Загрузка…
Отмена
Сохранить