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

Commit c79d3d22 authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/jxl_1214_refund' into dev_merchant

parents 5d03270c 8cc523c0
......@@ -5,6 +5,7 @@ public class KylinRedisConst {
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_LIST_CITYNAME = "kylin:performances:cityName:";
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_NOTICE = "kylin:performances:notice";
public static final String PERFORMANCES_LIST_RECOMMEND = "kylin:performances:recommend";
......
......@@ -222,6 +222,7 @@ public class DataUtils {
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES + performanceIds);
// 大龙相关 演出列表
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITYNAME + vo.getCityName());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITY + vo.getCityId());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND);
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_RECOMMEND);
......
......@@ -47,7 +47,8 @@ public class KylinPerformancesController {
@GetMapping("localList")
@ApiOperation("本地演出列表")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称"),
@ApiImplicitParam(type = "query", dataType = "String", name = "adCode", value = "城市code"),
@ApiImplicitParam(type = "query", dataType = "int", name = "days", value = "时间范围 几天 今天1 三天3。。。"),
@ApiImplicitParam(type = "query", dataType = "int", name = "type", value = "演出类型 101音乐节 102小型演出(livehouse演出) 103巡演 演出类型只有这几个了"),
......@@ -60,6 +61,7 @@ public class KylinPerformancesController {
})
public ResponseDto<HashMap<String, Object>> localList(
@RequestParam(defaultValue = "") String cityName,
@RequestParam(defaultValue = "") String adCode,
@RequestParam(defaultValue = "0") int days,
@RequestParam(defaultValue = "0") int type,
......@@ -72,7 +74,7 @@ public class KylinPerformancesController {
@RequestParam(defaultValue = "") String sort
) {
HashMap<String, Object> result = kylinPerformancesService.localList(
days, cityName, type,
days, cityName, adCode, type,
isDiscount, isAdvance, isExclusive,
orderBy, sort
);
......@@ -124,12 +126,17 @@ public class KylinPerformancesController {
@ApiOperation("演出日历")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "yearMonth", value = "年月 2021-01", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称", required = true)
@ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称"),
@ApiImplicitParam(type = "query", dataType = "String", name = "adCode", value = "城市code")
})
public ResponseDto<List> performanceCalendar(@RequestParam String yearMonth, @RequestParam String cityName) {
public ResponseDto<List> performanceCalendar(
@RequestParam String yearMonth,
@RequestParam(defaultValue = "") String cityName,
@RequestParam(defaultValue = "") String adCode
) {
List result = CollectionUtil.arrayListString();
try {
result = kylinPerformancesService.performanceCalendar(yearMonth, cityName);
result = kylinPerformancesService.performanceCalendar(yearMonth, cityName, adCode);
} catch (Exception e) {
log.error("kylinCalendarError", e);
}
......@@ -140,11 +147,16 @@ public class KylinPerformancesController {
@ApiOperation("演出日历-演出列表")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "yearMonthDay", value = "年月日 2021-01-01", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称", required = true)
@ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称"),
@ApiImplicitParam(type = "query", dataType = "String", name = "adCode", value = "城市code")
})
public ResponseDto<List> calendarPerformances(@RequestParam String yearMonthDay, @RequestParam String cityName) {
public ResponseDto<List> calendarPerformances(
@RequestParam String yearMonthDay,
@RequestParam(defaultValue = "") String cityName,
@RequestParam(defaultValue = "") String adCode
) {
List result = null;
result = kylinPerformancesService.calendarPerformances(yearMonthDay, cityName);
result = kylinPerformancesService.calendarPerformances(yearMonthDay, cityName, adCode);
return ResponseDto.success(result);
}
......
......@@ -405,6 +405,20 @@ public class KylinOrderTicketsRefundServiceImpl {
log.error("expressPlaceFromJsonException e:[{}]", e);
}
LinkedList<String> sqls = CollectionUtil.linkedListString();
sqls.add(SqlMapping.get("kylin_order_refund.refundOrderExpress"));
LinkedList<Object[]> sqlsDataA = CollectionUtil.linkedListObjectArr();
LocalDateTime now = LocalDateTime.now();
String remark = "";
String proName = "";
String goodsValueTotal = "";
String goodsNumber = "";
String mailno = "";
String filterResult = "";
String cargoTypeCode = "";
String limitTypeCode = "";
String expressTypeCode = "";
Integer orderExpressStatus = 0;
if (null == hashMap.get("succ") || hashMap.get("succ").equals("fail")) {
String msg = "";
if (null == hashMap.get("succ")) {
......@@ -412,50 +426,48 @@ public class KylinOrderTicketsRefundServiceImpl {
} else {
msg = (String) hashMap.get("msg");
}
orderExpressStatus = 1;
} else { // 成功下单记录缓存
// 生成快递单
HashMap hashMapResult = (HashMap) hashMap.get("result");
LocalDateTime now = LocalDateTime.now();
LinkedList<String> sqls = CollectionUtil.linkedListString();
sqls.add(SqlMapping.get("kylin_order_refund.refundOrderExpress"));
LinkedList<Object[]> sqlsDataA = CollectionUtil.linkedListObjectArr();
String remark = (String) hashMapResult.get("remark");
String proName = (String) hashMapResult.get("proName");
String goodsValueTotal = (String) hashMapResult.get("goodsValueTotal");
String goodsNumber = (String) hashMapResult.get("goodsNumber");
remark = (String) hashMapResult.get("remark");
proName = (String) hashMapResult.get("proName");
goodsValueTotal = (String) hashMapResult.get("goodsValueTotal");
goodsNumber = (String) hashMapResult.get("goodsNumber");
mailno = (String) hashMapResult.get("mailno");
filterResult = (String) hashMapResult.get("filter_result");
cargoTypeCode = (String) hashMapResult.get("cargoTypeCode");
limitTypeCode = (String) hashMapResult.get("limitTypeCode");
expressTypeCode = (String) hashMapResult.get("expressTypeCode");
remark = (null == remark) ? "" : remark;
proName = (null == proName) ? "" : proName;
goodsValueTotal = (null == goodsValueTotal) ? "" : goodsValueTotal;
goodsNumber = (null == goodsNumber) ? "" : goodsNumber;
String mailno = (String) hashMapResult.get("mailno");
String filterResult = (String) hashMapResult.get("filter_result");
String cargoTypeCode = (String) hashMapResult.get("cargoTypeCode");
String limitTypeCode = (String) hashMapResult.get("limitTypeCode");
String expressTypeCode = (String) hashMapResult.get("expressTypeCode");
mailno = (null == mailno) ? "" : mailno;
filterResult = (null == filterResult) ? "" : filterResult;
cargoTypeCode = (null == cargoTypeCode) ? "" : cargoTypeCode;
limitTypeCode = (null == limitTypeCode) ? "" : limitTypeCode;
expressTypeCode = (null == expressTypeCode) ? "" : expressTypeCode;
sqlsDataA.add(new Object[]{
orderExpressId, orderTicketVo.getPerformanceId(), orderTicketVo.getOrderTicketsId(), orderRefundId,
OrderExpressCode, mailno, expressType, filterResult, remark, KylinTableStatusConst.ORDER_EXPRESS_STATUS2
, 2, sendExpressType, expressContacts, expressPhone, sendExpressAddress, appointmentTime
, proName, cargoTypeCode, limitTypeCode, expressTypeCode, goodsValueTotal, goodsNumber
, now
});
queueUtils.sendMsgByRedis(MQConst.KylinQueue.SQL_ORDER_REFUND_EXPRESS.getKey(),
SqlMapping.gets(sqls, sqlsDataA));
KylinOrderExpressVo kylinOrderExpressVo = KylinOrderExpressVo.getNew();
kylinOrderExpressVo.setOrderExpressId(orderExpressId);
kylinOrderExpressVo.setOrderTicketsId(orderTicketVo.getOrderTicketsId());
kylinOrderExpressVo.setOrderExpressCode(OrderExpressCode);
kylinOrderExpressVo.setMailno((String) hashMapResult.get("mailno"));
kylinOrderExpressVo.setExpressStatus(KylinTableStatusConst.ORDER_EXPRESS_STATUS2);
kylinOrderExpressVo.setSendExpressType(sendExpressType);
dataUtils.setOrderRefundExpressInfo(orderTicketVo.getOrderTicketsId(), kylinOrderExpressVo);
orderExpressStatus = 2;
}
sqlsDataA.add(new Object[]{
orderExpressId, orderTicketVo.getPerformanceId(), orderTicketVo.getOrderTicketsId(), orderRefundId,
OrderExpressCode, mailno, expressType, filterResult, remark, orderExpressStatus
, 2, sendExpressType, expressContacts, expressPhone, sendExpressAddress, appointmentTime
, proName, cargoTypeCode, limitTypeCode, expressTypeCode, goodsValueTotal, goodsNumber
, now
});
queueUtils.sendMsgByRedis(MQConst.KylinQueue.SQL_ORDER_REFUND_EXPRESS.getKey(),
SqlMapping.gets(sqls, sqlsDataA));
KylinOrderExpressVo kylinOrderExpressVo = KylinOrderExpressVo.getNew();
kylinOrderExpressVo.setOrderExpressId(orderExpressId);
kylinOrderExpressVo.setOrderTicketsId(orderTicketVo.getOrderTicketsId());
kylinOrderExpressVo.setOrderExpressCode(OrderExpressCode);
kylinOrderExpressVo.setMailno(mailno);
kylinOrderExpressVo.setExpressStatus(orderExpressStatus);
kylinOrderExpressVo.setSendExpressType(sendExpressType);
dataUtils.setOrderRefundExpressInfo(orderTicketVo.getOrderTicketsId(), kylinOrderExpressVo);
} else if (sendExpressType == 2) { // 自主发货
// 生成快递单 REDIS 队列入数据库
String orderExpressId = IDGenerator.nextSnowId();
......
......@@ -62,11 +62,11 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
private QueueUtils queueUtils;
public HashMap<String, Object> localList(
int days, String cityName, int type,
int days, String cityName, String adCode, int type,
Integer isDiscount, Integer isAdvance, Integer isExclusive,
String orderBy, String sort
) {
List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityName(cityName);
List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityNameOradCode(cityName, adCode);
// 是否启用推荐
Integer isRecommend = 1;
......@@ -286,8 +286,8 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
return performanceList;
}
public List performanceCalendar(String yearMonth, String cityName) {
List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityName(cityName);
public List performanceCalendar(String yearMonth, String cityName, String adCode) {
List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityNameOradCode(cityName, adCode);
// 获取此月开始结束时间
String[] split = yearMonth.split("-");
......@@ -314,8 +314,8 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
return newList;
}
public List calendarPerformances(String yearMonthDay, String cityName) {
List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityName(cityName);
public List calendarPerformances(String yearMonthDay, String cityName, String adCode) {
List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityNameOradCode(cityName, adCode);
String yearMonthDayStart = yearMonthDay.concat(" 00:00:00");
String yearMonthDayEnd = yearMonthDay.concat(" 23:59:59");
......
......@@ -294,16 +294,25 @@ public class DataUtils {
*
* @param cityName
*/
public List<KylinPerformanceVo> getPerformancesListOfcityName(String cityName) {
String redisKey = KylinRedisConst.PERFORMANCES_LIST_CITYNAME.concat(cityName);
public List<KylinPerformanceVo> getPerformancesListOfcityNameOradCode(String cityName, String adCode) {
String redisKey = "";
if (cityName.isEmpty()) {
redisKey = KylinRedisConst.PERFORMANCES_LIST_CITY.concat(adCode);
} else {
redisKey = KylinRedisConst.PERFORMANCES_LIST_CITYNAME.concat(cityName);
}
Object object = redisUtil.get(redisKey);
if (object == null) {
// 固定查询条件
Query query = getCommonWhere();
// 其他条件
Pattern cityNameCompile = Pattern.compile("^.*" + cityName + ".*$", Pattern.CASE_INSENSITIVE);
query.addCriteria(Criteria.where("cityName").regex(cityNameCompile));
if (cityName.isEmpty()) {
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");
query.with(sortName);
......
......@@ -253,6 +253,7 @@ public class DataUtils {
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES + performanceIds);
// 大龙相关 演出列表
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITYNAME + vo.getCityName());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITY + vo.getCityId());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND);
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_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