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

Commit ab382d9f authored by 张国柄's avatar 张国柄

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

parents 0a7a2955 e51facc0
...@@ -4,7 +4,6 @@ public class KylinRedisConst { ...@@ -4,7 +4,6 @@ public class KylinRedisConst {
public static final String FIELDS = "kylin:fields:id"; public static final String FIELDS = "kylin:fields:id";
public static final String PERFORMANCES = "kylin:performances:id:"; public static final String PERFORMANCES = "kylin:performances:id:";
public static final String PERFORMANCES_TRUE_NAME = "kylin:performances_true_name:id:"; public static final String PERFORMANCES_TRUE_NAME = "kylin:performances_true_name:id:";
public static final String PERFORMANCES_LIST_CITYNAME = "kylin:performances:cityName:";
public static final String PERFORMANCES_LIST_CITY = "kylin:performances:city:"; public static final String PERFORMANCES_LIST_CITY = "kylin:performances:city:";
public static final String PERFORMANCES_LIST_SYSTEM_RECOMMEND = "kylin:performances:systemRecommend"; public static final String PERFORMANCES_LIST_SYSTEM_RECOMMEND = "kylin:performances:systemRecommend";
public static final String PERFORMANCES_LIST_NOTICE = "kylin:performances:notice"; public static final String PERFORMANCES_LIST_NOTICE = "kylin:performances:notice";
......
...@@ -221,7 +221,6 @@ public class DataUtils { ...@@ -221,7 +221,6 @@ public class DataUtils {
//删除redis //删除redis
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES + performanceIds); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES + performanceIds);
// 大龙相关 演出列表 // 大龙相关 演出列表
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITYNAME + vo.getCityName());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITY.concat(String.valueOf(vo.getCityId()))); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITY.concat(String.valueOf(vo.getCityId())));
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId()); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND);
......
package com.liquidnet.service.kylin.controller; package com.liquidnet.service.kylin.controller;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.base.ErrorMapping; import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
...@@ -15,11 +14,9 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -15,11 +14,9 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.juli.logging.Log;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
......
package com.liquidnet.service.kylin.utils;
import com.fasterxml.jackson.databind.JsonNode;
import com.liquidnet.commons.lang.util.JsonUtils;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.HashMap;
import java.util.Map;
/**
* <p>
* 读取城市
* </p>
*
* @author jiangxiulong
* @since 2022-01-06
*/
public class CityJsonUtils {
private static final Map<String, Integer> cityMap;
static {
cityMap = reload();
}
public static Map<String, Integer> reload() {
Map<String, Integer> cityMap = new HashMap<>();
String jsonStr = "";
Reader reader = null;
try {
reader = new InputStreamReader(CityJsonUtils.class.getClassLoader().getResourceAsStream("city_2021.json"));
int ch = 0;
StringBuffer sb = new StringBuffer();
while ((ch = reader.read()) != -1) {
sb.append((char) ch);
}
jsonStr = sb.toString();
} catch (IOException e) {
} finally {
if (null != reader) {
try {
reader.close();
} catch (IOException e) {
}
}
}
JsonNode jsonNode = JsonUtils.fromJson(jsonStr, JsonNode.class);
String name = "name", adcode = "adcode";
for (JsonNode node : jsonNode) {
cityMap.put(node.get(name).asText(), node.get(adcode).asInt());
}
return cityMap;
}
public static Integer get(String cityName) {
return cityMap.get(cityName);
}
public static void main(String[] args) {
Integer integer = CityJsonUtils.get("新竹市");
System.out.println(integer);
}
}
\ No newline at end of file
...@@ -295,24 +295,20 @@ public class DataUtils { ...@@ -295,24 +295,20 @@ public class DataUtils {
* @param cityName * @param cityName
*/ */
public List<KylinPerformanceVo> getPerformancesListOfcityNameOradCode(String cityName, Integer adCode) { public List<KylinPerformanceVo> getPerformancesListOfcityNameOradCode(String cityName, Integer adCode) {
String redisKey = ""; if (!cityName.isEmpty()) {
if (cityName.isEmpty()) { if (!cityName.endsWith("州") && !cityName.endsWith("县") && !cityName.endsWith("区") && !cityName.endsWith("市")) {
redisKey = KylinRedisConst.PERFORMANCES_LIST_CITY.concat(String.valueOf(adCode)); cityName = cityName.concat("市");
} else { }
redisKey = KylinRedisConst.PERFORMANCES_LIST_CITYNAME.concat(cityName); adCode = CityJsonUtils.get(cityName);
} }
String redisKey = KylinRedisConst.PERFORMANCES_LIST_CITY.concat(String.valueOf(adCode));
Object object = redisUtil.get(redisKey); Object object = redisUtil.get(redisKey);
if (object == null) { if (object == null) {
// 固定查询条件 // 固定查询条件
Query query = getCommonWhere(); Query query = getCommonWhere();
// 其他条件 // 其他条件
if (cityName.isEmpty()) { query.addCriteria(Criteria.where("cityId").is(adCode));
query.addCriteria(Criteria.where("cityId").is(adCode));
} else {
Pattern cityNameCompile = Pattern.compile("^.*" + cityName + ".*$", Pattern.CASE_INSENSITIVE);
query.addCriteria(Criteria.where("cityName").regex(cityNameCompile));
}
// 排序 // 排序
Sort sortName = Sort.by(Sort.Direction.ASC, "timeStart"); Sort sortName = Sort.by(Sort.Direction.ASC, "timeStart");
query.with(sortName); query.with(sortName);
...@@ -740,6 +736,7 @@ public class DataUtils { ...@@ -740,6 +736,7 @@ public class DataUtils {
return orderRefundPoundageArrayList; return orderRefundPoundageArrayList;
} }
} }
// 获取手续费ALL说明 // 获取手续费ALL说明
public OrderRefundPoundageAll getRefundPoundageAll(Integer isRefundPoundage) { public OrderRefundPoundageAll getRefundPoundageAll(Integer isRefundPoundage) {
ArrayList<OrderRefundPoundage> refundPoundage = getRefundPoundage(isRefundPoundage); ArrayList<OrderRefundPoundage> refundPoundage = getRefundPoundage(isRefundPoundage);
...@@ -776,12 +773,12 @@ public class DataUtils { ...@@ -776,12 +773,12 @@ public class DataUtils {
// if (getTicketType.equals("express")) { // 快递票 // if (getTicketType.equals("express")) { // 快递票
// return null; // return null;
// } else { // 电子票 // } else { // 电子票
Object obj = redisUtil.get(KylinRedisConst.ORDER_REFUND_ADDRESS); Object obj = redisUtil.get(KylinRedisConst.ORDER_REFUND_ADDRESS);
if (obj == null) { if (obj == null) {
return null; return null;
} else { } else {
return (OrderRefundAddress) obj; return (OrderRefundAddress) obj;
} }
// } // }
} }
...@@ -816,12 +813,12 @@ public class DataUtils { ...@@ -816,12 +813,12 @@ public class DataUtils {
// List<KylinIpAreaVo> data = mongoTemplate.find(Query.query(Criteria.where("ipBeginLong").lte(IPUtil.ipToLong(ipAddress)) // List<KylinIpAreaVo> data = mongoTemplate.find(Query.query(Criteria.where("ipBeginLong").lte(IPUtil.ipToLong(ipAddress))
// .and("ipEndLong").gte(IPUtil.ipToLong(ipAddress))), KylinIpAreaVo.class, KylinIpAreaVo.class.getSimpleName()); // .and("ipEndLong").gte(IPUtil.ipToLong(ipAddress))), KylinIpAreaVo.class, KylinIpAreaVo.class.getSimpleName());
// if(data==null || data.size()==0){ // if(data==null || data.size()==0){
KylinIpAreaVo data0 = KylinIpAreaVo.getNew(); KylinIpAreaVo data0 = KylinIpAreaVo.getNew();
data0.setArea("未知"); data0.setArea("未知");
data0.setCity("未知"); data0.setCity("未知");
data0.setCounty("未知"); data0.setCounty("未知");
data0.setProvince("未知"); data0.setProvince("未知");
return data0; return data0;
// }else{ // }else{
// return data.get(0); // return data.get(0);
// } // }
...@@ -829,6 +826,7 @@ public class DataUtils { ...@@ -829,6 +826,7 @@ public class DataUtils {
/** /**
* 获取已经退了的快递费 * 获取已经退了的快递费
*
* @return * @return
*/ */
public BigDecimal getCanRefundPriceExpress(List<KylinOrderRefundsVo> kylinOrderRefundsVoBaseList) { public BigDecimal getCanRefundPriceExpress(List<KylinOrderRefundsVo> kylinOrderRefundsVoBaseList) {
......
...@@ -68,14 +68,14 @@ public class DataImpl { ...@@ -68,14 +68,14 @@ public class DataImpl {
DMTAuthorizationRecordsService dmtAuthorizationRecordsService; DMTAuthorizationRecordsService dmtAuthorizationRecordsService;
private static final String SQL_URL = "jdbc:mysql://39.107.71.112:3308/test_ln_scene"; // private static final String SQL_URL = "jdbc:mysql://39.107.71.112:3308/test_ln_scene";
private static final String SQL_USER = "testmall"; // private static final String SQL_USER = "testmall";
private static final String SQL_PWD = "zhengzai!mYT"; // private static final String SQL_PWD = "zhengzai!mYT";
private static final String PHP_DB = "testmall"; // private static final String PHP_DB = "testmall";
// private static final String SQL_URL = "jdbc:mysql://zhengzairead.rwlb.rds.aliyuncs.com:3306/prod_ln_scene"; private static final String SQL_URL = "jdbc:mysql://zhengzairead.rwlb.rds.aliyuncs.com:3306/prod_ln_scene";
// private static final String SQL_USER = "readonly"; private static final String SQL_USER = "readonly";
// private static final String SQL_PWD = "ZWDsf8Fy"; private static final String SQL_PWD = "ZWDsf8Fy";
// private static final String PHP_DB = "mall"; private static final String PHP_DB = "mall";
//迁移场地和场地认领关系 //迁移场地和场地认领关系
public void fieldData() { public void fieldData() {
try { try {
......
...@@ -252,7 +252,6 @@ public class DataUtils { ...@@ -252,7 +252,6 @@ public class DataUtils {
//删除redis //删除redis
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES + performanceIds); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES + performanceIds);
// 大龙相关 演出列表 // 大龙相关 演出列表
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITYNAME + vo.getCityName());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITY.concat(String.valueOf(vo.getCityId()))); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITY.concat(String.valueOf(vo.getCityId())));
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId()); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND);
......
...@@ -21,7 +21,6 @@ db.SlimeFieldAppliesVo.createIndex({uid:"hashed"}); ...@@ -21,7 +21,6 @@ db.SlimeFieldAppliesVo.createIndex({uid:"hashed"});
db.SlimeFieldCheckersVo.createIndex({fieldCheckerId:"hashed"}); db.SlimeFieldCheckersVo.createIndex({fieldCheckerId:"hashed"});
db.SlimeFieldCheckersVo.createIndex({fieldId:"hashed"}); db.SlimeFieldCheckersVo.createIndex({fieldId:"hashed"});
db.SlimeFieldCheckersVo.createIndex({uid:"hashed"}); db.SlimeFieldCheckersVo.createIndex({uid:"hashed"});
db.SlimeSponsorsVo.createIndex({sponsorId:"hashed"}); db.SlimeSponsorsVo.createIndex({sponsorId:"hashed"});
db.SlimeSponsorsVo.createIndex({isOnline:"hashed"}); db.SlimeSponsorsVo.createIndex({isOnline:"hashed"});
db.SlimeSponsorsVo.createIndex({uid:"hashed"}); db.SlimeSponsorsVo.createIndex({uid:"hashed"});
...@@ -29,13 +28,27 @@ db.SlimeSponsorsVo.createIndex({companyId:"hashed"}); ...@@ -29,13 +28,27 @@ db.SlimeSponsorsVo.createIndex({companyId:"hashed"});
db.SlimeSponsorAppliesVo.createIndex({sponsorApplyId:"hashed"}); db.SlimeSponsorAppliesVo.createIndex({sponsorApplyId:"hashed"});
db.SlimeSponsorAppliesVo.createIndex({sponsorId:"hashed"}); db.SlimeSponsorAppliesVo.createIndex({sponsorId:"hashed"});
db.SlimeSponsorAppliesVo.createIndex({uid:"hashed"}); db.SlimeSponsorAppliesVo.createIndex({uid:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({authorizationRecordId:"hashed"}); db.SlimeAuthorizationRecordsVo.createIndex({authorizationRecordId:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({performanceId:"hashed"}); db.SlimeAuthorizationRecordsVo.createIndex({performanceId:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({uidRole:"hashed"}); db.SlimeAuthorizationRecordsVo.createIndex({uidRole:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({uid:"hashed"}); db.SlimeAuthorizationRecordsVo.createIndex({uid:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({cuidRole:"hashed"}); db.SlimeAuthorizationRecordsVo.createIndex({cuidRole:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({cuid:"hashed"}); db.SlimeAuthorizationRecordsVo.createIndex({cuid:"hashed"});
db.SlimeAuthorizationPerformanceVo.createIndex({performanceId:"hashed"}); db.SlimeAuthorizationPerformanceVo.createIndex({performanceId:"hashed"});
db.SlimeAuthorizationPerformanceVo.createIndex({uid:"hashed"}); db.SlimeAuthorizationPerformanceVo.createIndex({uid:"hashed"});
db.KylinPerformanceVo.createIndex({merchantId:"hashed"});
db.KylinOrderTicketVo.createIndex({status:"hashed"});
db.KylinOrderTicketVo.createIndex({transferStatus:"hashed"});
#创建分片
sh.enableSharding("prod_ln_scene");
sh.shardCollection("prod_ln_scene.SlimeFieldsVo",{"fieldId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeFieldAppliesVo",{"fieldApplyId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeFieldCheckersVo",{"fieldCheckId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeSponsorsVo",{"sponsorId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeSponsorAppliesVo",{"sponsorApplyId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeAuthorizationRecordsVo",{"authorizationRecordId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeAuthorizationPerformanceVo",{"performanceId":"hashed"});
...@@ -19,6 +19,7 @@ import com.liquidnet.service.slime.service.SlimeRdmService; ...@@ -19,6 +19,7 @@ import com.liquidnet.service.slime.service.SlimeRdmService;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
import com.mongodb.client.model.FindOneAndUpdateOptions; import com.mongodb.client.model.FindOneAndUpdateOptions;
import com.mongodb.client.model.ReturnDocument; import com.mongodb.client.model.ReturnDocument;
import lombok.extern.slf4j.Slf4j;
import org.bson.Document; import org.bson.Document;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
...@@ -37,6 +38,7 @@ import java.util.List; ...@@ -37,6 +38,7 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Component @Component
@Slf4j
public class MongoSlimeUtils { public class MongoSlimeUtils {
@Autowired @Autowired
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;
...@@ -47,6 +49,14 @@ public class MongoSlimeUtils { ...@@ -47,6 +49,14 @@ public class MongoSlimeUtils {
@Autowired @Autowired
private SlimeRdmService slimeRdmService; private SlimeRdmService slimeRdmService;
private List<String> initPerList = new ArrayList<String>() {{
add(SlimeAuthorizationConst.PerformancePermission.READ.getId());
add(SlimeAuthorizationConst.PerformancePermission.EDIT.getId());
add(SlimeAuthorizationConst.PerformancePermission.LINE.getId());
add(SlimeAuthorizationConst.PerformancePermission.SALES.getId());
add(SlimeAuthorizationConst.PerformancePermission.CHECK.getId());
add(SlimeAuthorizationConst.PerformancePermission.GRANT.getId());
}};
public PerformancePartnerVo getPerformancePartnerVo(String performanceId) { public PerformancePartnerVo getPerformancePartnerVo(String performanceId) {
return mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performanceId)), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName()); return mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performanceId)), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName());
...@@ -256,14 +266,14 @@ public class MongoSlimeUtils { ...@@ -256,14 +266,14 @@ public class MongoSlimeUtils {
return docTicket; return docTicket;
} }
public HashMap<String,Object> getPerformanceList(PerformancePartnerListParam performancePartnerListParam) { public HashMap<String, Object> getPerformanceList(PerformancePartnerListParam performancePartnerListParam) {
performancePartnerListParam.setOrderType(performancePartnerListParam.getOrderType()); performancePartnerListParam.setOrderType(performancePartnerListParam.getOrderType());
//分页排序 //分页排序
Sort.Direction orderBy = Sort.Direction.DESC; Sort.Direction orderBy = Sort.Direction.DESC;
if (performancePartnerListParam.getOrderSc().equals("asc")) { if (performancePartnerListParam.getOrderSc().equals("asc")) {
orderBy = Sort.Direction.ASC; orderBy = Sort.Direction.ASC;
} }
long currentTime = System.currentTimeMillis();
List<String> performanceIdList = null; List<String> performanceIdList = null;
List<SlimeAuthorizationPerformanceVo> permissionVoList = ObjectUtil.getPermissionVoList(); List<SlimeAuthorizationPerformanceVo> permissionVoList = ObjectUtil.getPermissionVoList();
if (!redisSlimeUtils.superAccount(performancePartnerListParam.getMerchantId())) { if (!redisSlimeUtils.superAccount(performancePartnerListParam.getMerchantId())) {
...@@ -280,6 +290,8 @@ public class MongoSlimeUtils { ...@@ -280,6 +290,8 @@ public class MongoSlimeUtils {
SlimeAuthorizationPerformanceVo.class, SlimeAuthorizationPerformanceVo.class.getSimpleName()); SlimeAuthorizationPerformanceVo.class, SlimeAuthorizationPerformanceVo.class.getSimpleName());
performanceIdList = permissionVoList.stream().map(SlimeAuthorizationPerformanceVo::getPerformanceId).collect(Collectors.toList()); performanceIdList = permissionVoList.stream().map(SlimeAuthorizationPerformanceVo::getPerformanceId).collect(Collectors.toList());
} }
log.debug("TIME 1= " + (System.currentTimeMillis() - currentTime));
currentTime = System.currentTimeMillis();
//查询演出 //查询演出
Criteria criteriaPerformanceId = performanceIdList == null ? Criteria.where("performancesId").ne(null) : Criteria.where("performancesId").in(performanceIdList); Criteria criteriaPerformanceId = performanceIdList == null ? Criteria.where("performancesId").ne(null) : Criteria.where("performancesId").in(performanceIdList);
Criteria criteria = Criteria.where("performancesId").ne(null); Criteria criteria = Criteria.where("performancesId").ne(null);
...@@ -304,12 +316,16 @@ public class MongoSlimeUtils { ...@@ -304,12 +316,16 @@ public class MongoSlimeUtils {
.skip(((performancePartnerListParam.getPage() - 1) * performancePartnerListParam.getSize())) .skip(((performancePartnerListParam.getPage() - 1) * performancePartnerListParam.getSize()))
.limit(performancePartnerListParam.getSize()), .limit(performancePartnerListParam.getSize()),
KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName()); KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
log.debug("TIME 2= " + (System.currentTimeMillis() - currentTime));
currentTime = System.currentTimeMillis();
long total = mongoTemplate.count( long total = mongoTemplate.count(
Query.query(new Criteria().andOperator(criteria).orOperator(criteriaPerformanceId, Criteria.where("merchantId").is(performancePartnerListParam.getMerchantId()))) Query.query(new Criteria().andOperator(criteria).orOperator(criteriaPerformanceId, Criteria.where("merchantId").is(performancePartnerListParam.getMerchantId())))
.with(Sort.by(orderBy, performancePartnerListParam.getOrderItem())), .with(Sort.by(orderBy, performancePartnerListParam.getOrderItem())),
KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName()); KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
log.debug("TIME 3= " + (System.currentTimeMillis() - currentTime));
currentTime = System.currentTimeMillis();
//查询销量 //查询销量
performanceIdList = performanceVos.stream().map(KylinPerformanceVo::getPerformancesId).collect(Collectors.toList());
Aggregation aggregation = Aggregation.newAggregation( Aggregation aggregation = Aggregation.newAggregation(
Aggregation.match(Criteria.where("status").in(0, 1, 3, 6).and("couponType").is("no").and("transferStatus").in(0, 1, 2, 5).and("performanceId").in(performanceIdList)), Aggregation.match(Criteria.where("status").in(0, 1, 3, 6).and("couponType").is("no").and("transferStatus").in(0, 1, 2, 5).and("performanceId").in(performanceIdList)),
Aggregation.group("performanceId") Aggregation.group("performanceId")
...@@ -321,8 +337,12 @@ public class MongoSlimeUtils { ...@@ -321,8 +337,12 @@ public class MongoSlimeUtils {
); );
AggregationResults<PerformancePartnerListDao> outputType = mongoTemplate.aggregate(aggregation, KylinOrderTicketVo.class.getSimpleName(), PerformancePartnerListDao.class); AggregationResults<PerformancePartnerListDao> outputType = mongoTemplate.aggregate(aggregation, KylinOrderTicketVo.class.getSimpleName(), PerformancePartnerListDao.class);
log.debug("TIME 4= " + (System.currentTimeMillis() - currentTime));
currentTime = System.currentTimeMillis();
List<PerformancePartnerListDao> dataList = new ArrayList(outputType.getMappedResults()); List<PerformancePartnerListDao> dataList = new ArrayList(outputType.getMappedResults());
List<PerformancePartnerListDao> list = ObjectUtil.getPerformancePartnerListDaoArrayList(); List<PerformancePartnerListDao> list = ObjectUtil.getPerformancePartnerListDaoArrayList();
boolean isSuperAccount = redisSlimeUtils.superAccount(performancePartnerListParam.getMerchantId());
for (KylinPerformanceVo item : performanceVos) { for (KylinPerformanceVo item : performanceVos) {
boolean findData = false; boolean findData = false;
PerformancePartnerListDao dao = PerformancePartnerListDao.getNew(); PerformancePartnerListDao dao = PerformancePartnerListDao.getNew();
...@@ -359,27 +379,13 @@ public class MongoSlimeUtils { ...@@ -359,27 +379,13 @@ public class MongoSlimeUtils {
dao.setTimeSell(timeSell); dao.setTimeSell(timeSell);
dao.setTimeStop(timeStop); dao.setTimeStop(timeStop);
if (item.getMerchantId().equals(performancePartnerListParam.getMerchantId()) || redisSlimeUtils.superAccount(performancePartnerListParam.getMerchantId())) { if (item.getMerchantId().equals(performancePartnerListParam.getMerchantId()) || isSuperAccount) {
dao.setPermissionId(new ArrayList<String>() {{ dao.setPermissionId(initPerList);
add(SlimeAuthorizationConst.PerformancePermission.READ.getId());
add(SlimeAuthorizationConst.PerformancePermission.EDIT.getId());
add(SlimeAuthorizationConst.PerformancePermission.LINE.getId());
add(SlimeAuthorizationConst.PerformancePermission.SALES.getId());
add(SlimeAuthorizationConst.PerformancePermission.CHECK.getId());
add(SlimeAuthorizationConst.PerformancePermission.GRANT.getId());
}});
} }
for (SlimeAuthorizationPerformanceVo permission : permissionVoList) { for (SlimeAuthorizationPerformanceVo permission : permissionVoList) {
if (item.getMerchantId().equals(performancePartnerListParam.getMerchantId()) || redisSlimeUtils.superAccount(performancePartnerListParam.getMerchantId())) { if (item.getMerchantId().equals(performancePartnerListParam.getMerchantId()) || isSuperAccount) {
dao.setPermissionId(new ArrayList<String>() {{ dao.setPermissionId(initPerList);
add(SlimeAuthorizationConst.PerformancePermission.READ.getId());
add(SlimeAuthorizationConst.PerformancePermission.EDIT.getId());
add(SlimeAuthorizationConst.PerformancePermission.LINE.getId());
add(SlimeAuthorizationConst.PerformancePermission.SALES.getId());
add(SlimeAuthorizationConst.PerformancePermission.CHECK.getId());
add(SlimeAuthorizationConst.PerformancePermission.GRANT.getId());
}});
break; break;
} }
if (permission.getPerformanceId().equals(item.getPerformancesId())) { if (permission.getPerformanceId().equals(item.getPerformancesId())) {
...@@ -410,9 +416,10 @@ public class MongoSlimeUtils { ...@@ -410,9 +416,10 @@ public class MongoSlimeUtils {
} }
list.add(dao); list.add(dao);
} }
HashMap<String ,Object> map = CollectionUtil.mapStringObject(); log.debug("TIME 5= " + (System.currentTimeMillis() - currentTime));
map.put("data",list); HashMap<String, Object> map = CollectionUtil.mapStringObject();
map.put("total",total); map.put("data", list);
map.put("total", total);
return map; return map;
} }
......
...@@ -235,7 +235,6 @@ public class RedisSlimeUtils { ...@@ -235,7 +235,6 @@ public class RedisSlimeUtils {
//删除redis //删除redis
redisUtil.del(KylinRedisConst.PERFORMANCES + performanceIds); redisUtil.del(KylinRedisConst.PERFORMANCES + performanceIds);
// 大龙相关 演出列表 // 大龙相关 演出列表
redisUtil.del(KylinRedisConst.PERFORMANCES_LIST_CITYNAME + vo.getCityName());
redisUtil.del(KylinRedisConst.PERFORMANCES_LIST_CITY.concat(String.valueOf(vo.getCityId()))); redisUtil.del(KylinRedisConst.PERFORMANCES_LIST_CITY.concat(String.valueOf(vo.getCityId())));
redisUtil.del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId()); redisUtil.del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId());
redisUtil.del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND); redisUtil.del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND);
......
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