记得上下班打卡 | git大法好,push需谨慎

Commit 27aa04de authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/dev' into dev

parents 988161b4 3e3157fb
...@@ -2,6 +2,7 @@ package com.liquidnet.service.adam.dto.vo; ...@@ -2,6 +2,7 @@ package com.liquidnet.service.adam.dto.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.adam.entity.AdamCollection;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -25,7 +26,7 @@ public class AdamCollectBaseVo implements Serializable, Cloneable { ...@@ -25,7 +26,7 @@ public class AdamCollectBaseVo implements Serializable, Cloneable {
private String contentId; private String contentId;
@ApiModelProperty(position = 15, value = "内容类型") @ApiModelProperty(position = 15, value = "内容类型")
private String type; private String type;
@ApiModelProperty(position = 16, value = "内容类型") @ApiModelProperty(position = 16, value = "状态")
private Integer state; private Integer state;
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern=DateUtil.DATE_FULL_STR) @JsonFormat(shape=JsonFormat.Shape.STRING, pattern=DateUtil.DATE_FULL_STR)
private LocalDateTime createdAt; private LocalDateTime createdAt;
...@@ -41,4 +42,14 @@ public class AdamCollectBaseVo implements Serializable, Cloneable { ...@@ -41,4 +42,14 @@ public class AdamCollectBaseVo implements Serializable, Cloneable {
return new AdamCollectBaseVo(); return new AdamCollectBaseVo();
} }
} }
public AdamCollectBaseVo copy(AdamCollection source) {
if (null == source) return this;
this.setUid(source.getUid());
this.setContentId(source.getContentId());
this.setType(source.getType());
this.setState(source.getState());
this.setCreatedAt(source.getCreatedAt());
return this;
}
} }
...@@ -32,12 +32,4 @@ public class AdamCollectVo implements Serializable, Cloneable { ...@@ -32,12 +32,4 @@ public class AdamCollectVo implements Serializable, Cloneable {
return new AdamCollectVo(); return new AdamCollectVo();
} }
} }
public AdamCollectVo copy(AdamCollection source) {
if (null == source) return this;
this.setContentId(source.getContentId());
this.setType(source.getType());
this.setCreatedAt(source.getCreatedAt());
return this;
}
} }
...@@ -8,7 +8,7 @@ import java.time.LocalDateTime; ...@@ -8,7 +8,7 @@ import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@Data @Data
public class KylinOrderRefundsVo { public class KylinOrderRefundsVoBase {
private Integer mid; private Integer mid;
private String orderRefundsId; private String orderRefundsId;
private String orderTicketsId; private String orderTicketsId;
......
...@@ -98,7 +98,7 @@ create unique index idx_areal_name_id on adam_real_name (real_name_id); ...@@ -98,7 +98,7 @@ create unique index idx_areal_name_id on adam_real_name (real_name_id);
create index idx_areal_name_id_card_type on adam_real_name (id_card, type); create index idx_areal_name_id_card_type on adam_real_name (id_card, type);
create index idx_areal_name_uid on adam_real_name (uid); create index idx_areal_name_uid on adam_real_name (uid);
create index idx_areal_name_state on adam_real_name (state); create index idx_areal_name_state on adam_real_name (state);
# MDB.idx:uid,state # MDB.idx:uid,type,state
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
drop table if exists adam_enters; drop table if exists adam_enters;
create table adam_enters create table adam_enters
...@@ -251,7 +251,7 @@ create table adam_member_price ...@@ -251,7 +251,7 @@ create table adam_member_price
create unique index uidx_amember_price_id on adam_member_price (member_price_id); create unique index uidx_amember_price_id on adam_member_price (member_price_id);
create index idx_amember_price_member_id on adam_member_price (member_id); create index idx_amember_price_member_id on adam_member_price (member_id);
# MDB.idx:member_id,state # MDB.idx:member_price_id,member_id,state
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
drop table if exists adam_member_order; drop table if exists adam_member_order;
create table adam_member_order create table adam_member_order
...@@ -282,7 +282,7 @@ create table adam_member_order ...@@ -282,7 +282,7 @@ create table adam_member_order
) engine = InnoDB comment '用户会员订单'; ) engine = InnoDB comment '用户会员订单';
create unique index uidx_amember_order_id on adam_member_order (order_no); create unique index uidx_amember_order_id on adam_member_order (order_no);
# MDB.idx:order_no # MDB.idx:order_no,uid,state,pay_no,member_id,member_price_id
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
drop table if exists adam_user_member; drop table if exists adam_user_member;
create table adam_user_member create table adam_user_member
...@@ -300,7 +300,7 @@ create table adam_user_member ...@@ -300,7 +300,7 @@ create table adam_user_member
create index idx_auser_member_uid on adam_user_member (uid); create index idx_auser_member_uid on adam_user_member (uid);
create index idx_auser_member_no on adam_user_member (member_no); create index idx_auser_member_no on adam_user_member (member_no);
# MDB.idx:uid,member_no # MDB.idx:uid,state,member_no
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
drop table if exists adam_member_code; drop table if exists adam_member_code;
create table adam_member_code create table adam_member_code
...@@ -324,7 +324,7 @@ create table adam_member_code ...@@ -324,7 +324,7 @@ create table adam_member_code
) engine = InnoDB comment '会员兑换码'; ) engine = InnoDB comment '会员兑换码';
create unique index uidx_amember_code_id on adam_member_code (code); create unique index uidx_amember_code_id on adam_member_code (code);
# MDB.idx:code # MDB.idx:code,state
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
use prod_ln_scene; use prod_ln_scene;
#创建集合 #创建集合
db.createCollection("AdamUserInfoVo"); db.createCollection("AdamAddressesVo");
db.createCollection("AdamCollectBaseVo");
db.createCollection("AdamDisposedBaseVo");
db.createCollection("AdamEntersVo");
db.createCollection("AdamMemberCodeVo");
db.createCollection("AdamMemberOrderVo");
db.createCollection("AdamMemberPriceVo");
db.createCollection("AdamMemberVo");
db.createCollection("AdamRealInfoVo"); db.createCollection("AdamRealInfoVo");
db.createCollection("AdamThirdPartInfoVo"); db.createCollection("AdamThirdPartInfoVo");
db.createCollection("AdamUserInfoVo");
db.createCollection("AdamUserMemberVo"); db.createCollection("AdamUserMemberVo");
db.createCollection("AdamMemberVo");
#创建索引 #创建索引
db.AdamUserInfoVo.createIndex({uid:"hashed"}); db.AdamAddressesVo.createIndex({uid:"hashed"});
db.AdamUserInfoVo.createIndex({state:"hashed"}); db.AdamAddressesVo.createIndex({state:"hashed"});
db.AdamCollectBaseVo.createIndex({uid:"hashed"});
db.AdamCollectBaseVo.createIndex({state:"hashed"});
db.AdamCollectBaseVo.createIndex({contentId:"hashed"});
db.AdamDisposedBaseVo.createIndex({uid:"hashed"});
db.AdamDisposedBaseVo.createIndex({state:"hashed"});
db.AdamDisposedBaseVo.createIndex({contentId:"hashed"});
db.AdamEntersVo.createIndex({uid:"hashed"});
db.AdamEntersVo.createIndex({state:"hashed"});
db.AdamMemberCodeVo.createIndex({code:"hashed"});
db.AdamMemberCodeVo.createIndex({state:"hashed"});
db.AdamMemberOrderVo.createIndex({orderNo:"hashed"});
db.AdamMemberOrderVo.createIndex({state:"hashed"});
db.AdamMemberOrderVo.createIndex({uid:"hashed"});
db.AdamMemberOrderVo.createIndex({payNo:"hashed"});
db.AdamMemberOrderVo.createIndex({memberId:"hashed"});
db.AdamMemberOrderVo.createIndex({memberPriceId:"hashed"});
db.AdamMemberPriceVo.createIndex({memberPriceId:"hashed"});
db.AdamMemberPriceVo.createIndex({memberId:"hashed"});
db.AdamMemberPriceVo.createIndex({state:"hashed"});
db.AdamMemberVo.createIndex({memberId:"hashed"});
db.AdamMemberVo.createIndex({state:"hashed"});
db.AdamRealInfoVo.createIndex({uid:"hashed"}); db.AdamRealInfoVo.createIndex({uid:"hashed"});
db.AdamRealInfoVo.createIndex({state:"hashed"}); db.AdamRealInfoVo.createIndex({state:"hashed"});
db.AdamRealInfoVo.createIndex({type:"hashed"});
db.AdamThirdPartInfoVo.createIndex({uid:"hashed"}); db.AdamThirdPartInfoVo.createIndex({uid:"hashed"});
db.AdamThirdPartInfoVo.createIndex({state:"hashed"}); db.AdamThirdPartInfoVo.createIndex({state:"hashed"});
db.AdamThirdPartInfoVo.createIndex({platform:"hashed"});
db.AdamThirdPartInfoVo.createIndex({openId:"hashed"});
db.AdamUserInfoVo.createIndex({uid:"hashed"});
db.AdamUserInfoVo.createIndex({state:"hashed"});
db.AdamUserInfoVo.createIndex({mobile:"hashed"});
db.AdamUserMemberVo.createIndex({uid:"hashed"}); db.AdamUserMemberVo.createIndex({uid:"hashed"});
db.AdamMemberVo.createIndex({memberId:"hashed"}); db.AdamUserMemberVo.createIndex({state:"hashed"});
db.AdamUserMemberVo.createIndex({memberNo:"hashed"});
#创建分片 #创建分片
sh.enableSharding("prod_ln_scene"); sh.enableSharding("prod_ln_scene");
sh.shardCollection("prod_ln_scene.AdamUserInfoVo",{"uid":"hashed"}); sh.shardCollection("prod_ln_scene.AdamAddressesVo",{"uid":"hashed"});
sh.shardCollection("prod_ln_scene.AdamCollectBaseVo",{"uid":"hashed"});
sh.shardCollection("prod_ln_scene.AdamDisposedBaseVo",{"uid":"hashed"});
sh.shardCollection("prod_ln_scene.AdamEntersVo",{"uid":"hashed"});
sh.shardCollection("prod_ln_scene.AdamMemberCodeVo",{"code":"hashed"});
sh.shardCollection("prod_ln_scene.AdamMemberOrderVo",{"orderNo":"hashed"});
sh.shardCollection("prod_ln_scene.AdamMemberPriceVo",{"memberPriceId":"hashed"});
sh.shardCollection("prod_ln_scene.AdamMemberVo",{"memberId":"hashed"});
sh.shardCollection("prod_ln_scene.AdamRealInfoVo",{"uid":"hashed"}); sh.shardCollection("prod_ln_scene.AdamRealInfoVo",{"uid":"hashed"});
sh.shardCollection("prod_ln_scene.AdamThirdPartInfoVo",{"uid":"hashed"}); sh.shardCollection("prod_ln_scene.AdamThirdPartInfoVo",{"uid":"hashed"});
sh.shardCollection("prod_ln_scene.AdamUserMemberVo",{"uid":"hashed"}); sh.shardCollection("prod_ln_scene.AdamUserInfoVo",{"uid":"hashed"});
sh.shardCollection("prod_ln_scene.AdamMemberVo",{"memberId":"hashed"}); sh.shardCollection("prod_ln_scene.AdamUserMemberVo",{"uid":"hashed"});
\ No newline at end of file \ No newline at end of file
use test_ln_scene; use test_ln_scene;
#创建集合 #创建集合
db.createCollection("AdamUserInfoVo"); db.createCollection("AdamAddressesVo");
db.createCollection("AdamCollectBaseVo");
db.createCollection("AdamDisposedBaseVo");
db.createCollection("AdamEntersVo");
db.createCollection("AdamMemberCodeVo");
db.createCollection("AdamMemberOrderVo");
db.createCollection("AdamMemberPriceVo");
db.createCollection("AdamMemberVo");
db.createCollection("AdamRealInfoVo"); db.createCollection("AdamRealInfoVo");
db.createCollection("AdamThirdPartInfoVo"); db.createCollection("AdamThirdPartInfoVo");
db.createCollection("AdamUserInfoVo");
db.createCollection("AdamUserMemberVo"); db.createCollection("AdamUserMemberVo");
db.createCollection("AdamMemberVo");
#创建索引 #创建索引
db.AdamUserInfoVo.createIndex({uid:"hashed"}); db.AdamAddressesVo.createIndex({uid:"hashed"});
db.AdamUserInfoVo.createIndex({state:"hashed"}); db.AdamAddressesVo.createIndex({state:"hashed"});
db.AdamCollectBaseVo.createIndex({uid:"hashed"});
db.AdamCollectBaseVo.createIndex({state:"hashed"});
db.AdamCollectBaseVo.createIndex({contentId:"hashed"});
db.AdamDisposedBaseVo.createIndex({uid:"hashed"});
db.AdamDisposedBaseVo.createIndex({state:"hashed"});
db.AdamDisposedBaseVo.createIndex({contentId:"hashed"});
db.AdamEntersVo.createIndex({uid:"hashed"});
db.AdamEntersVo.createIndex({state:"hashed"});
db.AdamMemberCodeVo.createIndex({code:"hashed"});
db.AdamMemberCodeVo.createIndex({state:"hashed"});
db.AdamMemberOrderVo.createIndex({orderNo:"hashed"});
db.AdamMemberOrderVo.createIndex({state:"hashed"});
db.AdamMemberOrderVo.createIndex({uid:"hashed"});
db.AdamMemberOrderVo.createIndex({payNo:"hashed"});
db.AdamMemberOrderVo.createIndex({memberId:"hashed"});
db.AdamMemberOrderVo.createIndex({memberPriceId:"hashed"});
db.AdamMemberPriceVo.createIndex({memberPriceId:"hashed"});
db.AdamMemberPriceVo.createIndex({memberId:"hashed"});
db.AdamMemberPriceVo.createIndex({state:"hashed"});
db.AdamMemberVo.createIndex({memberId:"hashed"});
db.AdamMemberVo.createIndex({state:"hashed"});
db.AdamRealInfoVo.createIndex({uid:"hashed"}); db.AdamRealInfoVo.createIndex({uid:"hashed"});
db.AdamRealInfoVo.createIndex({state:"hashed"}); db.AdamRealInfoVo.createIndex({state:"hashed"});
db.AdamRealInfoVo.createIndex({type:"hashed"});
db.AdamThirdPartInfoVo.createIndex({uid:"hashed"}); db.AdamThirdPartInfoVo.createIndex({uid:"hashed"});
db.AdamThirdPartInfoVo.createIndex({state:"hashed"}); db.AdamThirdPartInfoVo.createIndex({state:"hashed"});
db.AdamThirdPartInfoVo.createIndex({platform:"hashed"});
db.AdamThirdPartInfoVo.createIndex({openId:"hashed"});
db.AdamUserInfoVo.createIndex({uid:"hashed"});
db.AdamUserInfoVo.createIndex({state:"hashed"});
db.AdamUserInfoVo.createIndex({mobile:"hashed"});
db.AdamUserMemberVo.createIndex({uid:"hashed"}); db.AdamUserMemberVo.createIndex({uid:"hashed"});
db.AdamMemberVo.createIndex({memberId:"hashed"}); db.AdamUserMemberVo.createIndex({state:"hashed"});
db.AdamUserMemberVo.createIndex({memberNo:"hashed"});
#创建分片 #创建分片
sh.enableSharding("test_ln_scene"); sh.enableSharding("test_ln_scene");
sh.shardCollection("test_ln_scene.AdamUserInfoVo",{"uid":"hashed"}); sh.shardCollection("test_ln_scene.AdamAddressesVo",{"uid":"hashed"});
sh.shardCollection("test_ln_scene.AdamCollectBaseVo",{"uid":"hashed"});
sh.shardCollection("test_ln_scene.AdamDisposedBaseVo",{"uid":"hashed"});
sh.shardCollection("test_ln_scene.AdamEntersVo",{"uid":"hashed"});
sh.shardCollection("test_ln_scene.AdamMemberCodeVo",{"code":"hashed"});
sh.shardCollection("test_ln_scene.AdamMemberOrderVo",{"orderNo":"hashed"});
sh.shardCollection("test_ln_scene.AdamMemberPriceVo",{"memberPriceId":"hashed"});
sh.shardCollection("test_ln_scene.AdamMemberVo",{"memberId":"hashed"});
sh.shardCollection("test_ln_scene.AdamRealInfoVo",{"uid":"hashed"}); sh.shardCollection("test_ln_scene.AdamRealInfoVo",{"uid":"hashed"});
sh.shardCollection("test_ln_scene.AdamThirdPartInfoVo",{"uid":"hashed"}); sh.shardCollection("test_ln_scene.AdamThirdPartInfoVo",{"uid":"hashed"});
sh.shardCollection("test_ln_scene.AdamUserMemberVo",{"uid":"hashed"}); sh.shardCollection("test_ln_scene.AdamUserInfoVo",{"uid":"hashed"});
sh.shardCollection("test_ln_scene.AdamMemberVo",{"memberId":"hashed"}); sh.shardCollection("test_ln_scene.AdamUserMemberVo",{"uid":"hashed"});
\ No newline at end of file \ No newline at end of file
package com.liquidnet.service.adam.service.processor; package com.liquidnet.service.adam.service.processor;
import com.liquidnet.service.adam.dto.vo.AdamCollectVo; import com.liquidnet.service.adam.dto.vo.AdamCollectBaseVo;
import com.liquidnet.service.adam.entity.AdamCollection; import com.liquidnet.service.adam.entity.AdamCollection;
import com.liquidnet.service.adam.service.DataMigrationProcessorService; import com.liquidnet.service.adam.service.DataMigrationProcessorService;
import com.liquidnet.service.adam.service.IAdamCollectionService; import com.liquidnet.service.adam.service.IAdamCollectionService;
...@@ -32,7 +32,7 @@ public class DMCollectionProcessor extends DataMigrationProcessorService { ...@@ -32,7 +32,7 @@ public class DMCollectionProcessor extends DataMigrationProcessorService {
if (StringUtils.isNotEmpty(flu)) { if (StringUtils.isNotEmpty(flu)) {
log.info("DM.flush.collection:{}", userMapper.executeForDM("adam_collection")); log.info("DM.flush.collection:{}", userMapper.executeForDM("adam_collection"));
log.info("DM.flush.AdamCollectVo:{}", mongoTemplate.remove(Query.query(Criteria.where("_id").exists(true)), AdamCollectVo.class.getSimpleName()).getDeletedCount()); log.info("DM.flush.AdamCollectVo:{}", mongoTemplate.remove(Query.query(Criteria.where("_id").exists(true)), AdamCollectBaseVo.class.getSimpleName()).getDeletedCount());
} }
String sqlCount = "select count(1) from user_collections where type='TICKET' and status=1 and content_id>=5722 and created_at" + (StringUtils.isBlank(incrDt) ? "<" : ">=") + "curdate()"; String sqlCount = "select count(1) from user_collections where type='TICKET' and status=1 and content_id>=5722 and created_at" + (StringUtils.isBlank(incrDt) ? "<" : ">=") + "curdate()";
...@@ -71,7 +71,7 @@ public class DMCollectionProcessor extends DataMigrationProcessorService { ...@@ -71,7 +71,7 @@ public class DMCollectionProcessor extends DataMigrationProcessorService {
log.info("DM.execute.limit {},{} - begin", ls, pSize); log.info("DM.execute.limit {},{} - begin", ls, pSize);
List<AdamCollection> collectionList = new ArrayList<>(); List<AdamCollection> collectionList = new ArrayList<>();
List<AdamCollectVo> vos = new ArrayList<>(); List<AdamCollectBaseVo> vos = new ArrayList<>();
while (row.next()) { while (row.next()) {
String uid = row.getString(1); String uid = row.getString(1);
if (!reUidList.contains(uid)) { if (!reUidList.contains(uid)) {
...@@ -84,11 +84,11 @@ public class DMCollectionProcessor extends DataMigrationProcessorService { ...@@ -84,11 +84,11 @@ public class DMCollectionProcessor extends DataMigrationProcessorService {
collection.setUpdatedAt(row.getLocalDateTime(6)); collection.setUpdatedAt(row.getLocalDateTime(6));
collectionList.add(collection); collectionList.add(collection);
vos.add(AdamCollectVo.getNew().copy(collection)); vos.add(AdamCollectBaseVo.getNew().copy(collection));
} }
if (collectionList.size() == 500) { if (collectionList.size() == 500) {
tl += collectionList.size(); tl += collectionList.size();
mongoTemplate.insert(vos, AdamCollectVo.class.getSimpleName()); mongoTemplate.insert(vos, AdamCollectBaseVo.class.getSimpleName());
log.info("DM.execute.limit.result:{}", adamCollectionService.saveBatch(collectionList)); log.info("DM.execute.limit.result:{}", adamCollectionService.saveBatch(collectionList));
vos.clear(); vos.clear();
collectionList.clear(); collectionList.clear();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment