| @@ -10,6 +10,7 @@ import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.dto.WxCouponChannelDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import com.iformall.enums.EnumCouponSourceType; | |||
| import com.iformall.enums.EnumPayWay; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| @@ -68,10 +69,13 @@ public class WxCouponChannelController extends BaseController { | |||
| wxCouponChannel.updateTenantInfo(getTenantInfo()); | |||
| wxCouponChannel.setSortColumns(BaseEntity.SortField.CCUpdateDate_DESC); | |||
| if(null == wxCouponChannel.getSourceType()){ | |||
| wxCouponChannel.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||
| } | |||
| if(StringUtils.isNotBlank(wxCouponChannel.getSortColumn())){ | |||
| wxCouponChannel.setSortColumn("cc."+wxCouponChannel.getSortColumn()); | |||
| } | |||
| final PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -153,7 +153,7 @@ BEGIN | |||
| login_count = (SELECT SUM(login_count) FROM wx_c_user_basic_info WHERE id in (oldCuserId,newCuserId)) | |||
| WHERE id = newCuserId ; | |||
| UPDATE wx_c_user_basic_info SET phone = phone + '(作废)',`status` = 1 WHERE id = oldCuserId ; | |||
| UPDATE wx_c_user_basic_info SET phone = concat(phone,'(作废)'),`status` = 1 WHERE id = oldCuserId ; | |||
| IF err_flag THEN | |||
| ROLLBACK; | |||
| @@ -20,4 +20,89 @@ ADD COLUMN `source_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1:A端发卷,2 | |||
| 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`; | |||
| update wx_c_user_basic_info set tenant_id = concat(",",final_tenant_id,","); | |||
| update wx_c_user_basic_info set tenant_id = concat(",",final_tenant_id,","); | |||
| CREATE DEFINER=`root`@`%` PROCEDURE `move_after_group`(IN tenantIds VARCHAR(125)) | |||
| BEGIN | |||
| DECLARE done INT DEFAULT 0; | |||
| DECLARE phonestr VARCHAR(50); | |||
| DECLARE phones CURSOR FOR SELECT phone FROM `wx_c_user_basic_info` WHERE FIND_IN_SET(final_tenant_id,tenantIds) GROUP BY phone HAVING count(1) > 1; | |||
| DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET done = -1; | |||
| DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; | |||
| START TRANSACTION; | |||
| OPEN phones; | |||
| FETCH phones INTO phonestr; | |||
| while done<>1 DO | |||
| BEGIN | |||
| DECLARE done2 int DEFAULT 0; | |||
| DECLARE userid BIGINT; | |||
| DECLARE num INT DEFAULT 0; | |||
| DECLARE oldCuserId BIGINT DEFAULT 0; | |||
| DECLARE newCuserId BIGINT DEFAULT 0; | |||
| DECLARE users CURSOR FOR SELECT id FROM `wx_c_user_basic_info` WHERE phone = phonestr and FIND_IN_SET(final_tenant_id,tenantIds) order by active_time DESC; | |||
| DECLARE CONTINUE HANDLER FOR NOT FOUND SET done2 = 1; | |||
| OPEN users; | |||
| FETCH users INTO userid; | |||
| WHILE done2 <> 1 DO | |||
| if num = 0 THEN | |||
| SET oldCuserId =userid; | |||
| ELSE | |||
| SET newCuserId =userid; | |||
| UPDATE wx_c_user SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||
| UPDATE wx_activity_join SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||
| UPDATE wx_game_action_log SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||
| UPDATE wx_order_group SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||
| UPDATE wx_order_press SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||
| UPDATE wx_question_log SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||
| UPDATE wx_c_user_car SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||
| UPDATE wx_c_user_from_b SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||
| UPDATE wx_coupon_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||
| UPDATE wx_credit_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||
| UPDATE wx_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||
| UPDATE wx_pay_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||
| UPDATE wx_refund_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||
| UPDATE wx_score_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||
| UPDATE wx_card_spend SET owner_id = newCuserId WHERE owner_id = oldCuserId ; | |||
| UPDATE wx_coupon_order SET owner_id = newCuserId WHERE owner_id = oldCuserId ; | |||
| UPDATE wx_credit_history SET operator_id = newCuserId WHERE operator_type in (1,2) and operator_id = oldCuserId ; | |||
| UPDATE wx_c_user_basic_info SET poins = (SELECT SUM(poins) FROM wx_c_user_basic_info WHERE id in (oldCuserId,newCuserId)), | |||
| credit = (SELECT SUM(credit) FROM wx_c_user_basic_info WHERE id in (oldCuserId,newCuserId)), | |||
| login_count = (SELECT SUM(login_count) FROM wx_c_user_basic_info WHERE id in (oldCuserId,newCuserId)) | |||
| WHERE id = newCuserId ; | |||
| UPDATE wx_c_user_basic_info SET phone = concat(phone,'(作废)',"--",num),`status` = 1 WHERE id = oldCuserId ; | |||
| END IF; | |||
| SET num = num +1; | |||
| FETCH users INTO userid; | |||
| END WHILE; | |||
| CLOSE users; | |||
| END; | |||
| FETCH phones INTO phonestr; | |||
| END WHILE; | |||
| CLOSE phones; | |||
| IF done = -1 THEN | |||
| ROLLBACK; | |||
| ELSE | |||
| COMMIT; | |||
| END IF; | |||
| END | |||
| @@ -946,9 +946,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||
| // } | |||
| if (oldUserBase != null) { | |||
| if(!oldUserBase.getTenantId().contains(","+mallUserInfo.getTenantId()+",")){ | |||
| oldUserBase.setTenantId(oldUserBase.getTenantId()+mallUserInfo.getTenantId()+","); | |||
| } | |||
| // if(!oldUserBase.getTenantId().contains(","+mallUserInfo.getTenantId()+",")){ | |||
| // oldUserBase.setTenantId(oldUserBase.getTenantId()+mallUserInfo.getTenantId()+","); | |||
| // } | |||
| oldUserBase.setName(userBase.getName()); | |||
| oldUserBase.setSex(userBase.getSex()); | |||
| oldUserBase.setNickName(userBase.getNickName()); | |||
| @@ -971,7 +971,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||
| } | |||
| } else { | |||
| userBase.setId(idWorker.nextId()); | |||
| userBase.setTenantId(","+mallUserInfo.getTenantId()+","); | |||
| // userBase.setTenantId(","+mallUserInfo.getTenantId()+","); | |||
| userBase.setUpdateDate(userBase.getUpdateDate() == null ? new Date() : userBase.getUpdateDate()); | |||
| userBase.setCreateDate(userBase.getCreateDate() == null ? new Date() : userBase.getCreateDate()); | |||
| //新增积分 | |||
| @@ -116,6 +116,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '有价券审批', '9', '0', '" + nowTimestr + "', '" + nowTimestr + "', '1')," + | |||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '卡审批', '10', '0', '" + nowTimestr + "', '" + nowTimestr + "', '2')," + | |||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '砍价审批', '12', '0', '" + nowTimestr + "', '" + nowTimestr + "', '4')," + | |||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', 'B端创建券', '22', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + | |||
| " ( '" + idWorker.nextId() + "', '" + id2 + "', '" + tenantId + "', '多经点位租金+物业合同签约', '19', '0', '" + nowTimestr + "', '" + nowTimestr + "', '11')," + | |||
| " ( '" + idWorker.nextId() + "', '" + id2 + "', '" + tenantId + "', '商铺租金+物业合同终止', '18', '0', '" + nowTimestr + "', '" + nowTimestr + "', '10')," + | |||
| " ( '" + idWorker.nextId() + "', '" + id2 + "', '" + tenantId + "', '商铺物业合同签约', '13', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + | |||